From 7b6e0f89f4709cf7e417e2e146c2241fdde2e158 Mon Sep 17 00:00:00 2001 From: Mazen Touati <14861869+sunchayn@users.noreply.github.com> Date: Mon, 2 Feb 2026 02:34:48 +0100 Subject: [PATCH] chore(base): release 0.4.1-alpha (#57) * chore(base): release 0.4.1-alpha * build: update production artifacts for v0.4.1-alpha --- .release-please-manifest.json | 2 +- CHANGELOG.md | 7 + package-lock.json | 4 +- package.json | 2 +- ...e_type_script_setup_true_lang-nBfag7CV.js} | 2 +- .../{Main-BHI4Qeo7.js => Main-ChqJeGTY.js} | 300 +++++++++--------- .../{Main-BJKJQt2p.css => Main-DT_Im_ve.css} | 2 +- ...tings-CNViBy3D.js => Settings-BVB2dB75.js} | 4 +- resources/dist/assets/app-5tLSh9Fn.css | 1 - .../{app-C6VkUBdm.js => app-9y4VsaPU.js} | 4 +- resources/dist/assets/app-PzvJiV8M.css | 1 + resources/dist/manifest.json | 24 +- resources/js/pages/Settings.vue | 2 +- 13 files changed, 181 insertions(+), 174 deletions(-) rename resources/dist/assets/{AppPopoverTrigger.vue_vue_type_script_setup_true_lang-CvMdocUs.js => AppPopoverTrigger.vue_vue_type_script_setup_true_lang-nBfag7CV.js} (99%) rename resources/dist/assets/{Main-BHI4Qeo7.js => Main-ChqJeGTY.js} (67%) rename resources/dist/assets/{Main-BJKJQt2p.css => Main-DT_Im_ve.css} (93%) rename resources/dist/assets/{Settings-CNViBy3D.js => Settings-BVB2dB75.js} (98%) delete mode 100644 resources/dist/assets/app-5tLSh9Fn.css rename resources/dist/assets/{app-C6VkUBdm.js => app-9y4VsaPU.js} (99%) create mode 100644 resources/dist/assets/app-PzvJiV8M.css diff --git a/.release-please-manifest.json b/.release-please-manifest.json index e53c183..89c4981 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.4.0-alpha" + ".": "0.4.1-alpha" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 7354b49..396c13f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [0.4.1-alpha](https://github.com/sunchayn/nimbus/compare/v0.4.0-alpha...v0.4.1-alpha) (2026-02-02) + + +### Maintenance Tasks + +* wiki and artificats cleanups ([#56](https://github.com/sunchayn/nimbus/issues/56)) ([e1fe4ee](https://github.com/sunchayn/nimbus/commit/e1fe4eefeb647cd7555bb5889926941c60f32d7f)) + ## [0.4.0-alpha](https://github.com/sunchayn/nimbus/compare/v0.3.0-alpha...v0.4.0-alpha) (2026-01-31) diff --git a/package-lock.json b/package-lock.json index ef25d1f..d9028ad 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,11 +1,11 @@ { "name": "nimbus", - "version": "0.4.0-alpha", + "version": "0.4.1-alpha", "lockfileVersion": 3, "requires": true, "packages": { "": { - "version": "0.4.0-alpha", + "version": "0.4.1-alpha", "dependencies": { "@codemirror/lang-json": "^6.0.1", "@codemirror/lint": "^6.8.4", diff --git a/package.json b/package.json index a6fc7d6..38c1b2b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "private": true, - "version": "0.4.0-alpha", + "version": "0.4.1-alpha", "type": "module", "scripts": { "style:check": "eslint --config tools/eslint/.eslintrc.cjs --ignore-path tools/eslint/.eslintignore resources/js --ext .js,.ts,.vue", diff --git a/resources/dist/assets/AppPopoverTrigger.vue_vue_type_script_setup_true_lang-CvMdocUs.js b/resources/dist/assets/AppPopoverTrigger.vue_vue_type_script_setup_true_lang-nBfag7CV.js similarity index 99% rename from resources/dist/assets/AppPopoverTrigger.vue_vue_type_script_setup_true_lang-CvMdocUs.js rename to resources/dist/assets/AppPopoverTrigger.vue_vue_type_script_setup_true_lang-nBfag7CV.js index d272c70..f38c102 100644 --- a/resources/dist/assets/AppPopoverTrigger.vue_vue_type_script_setup_true_lang-CvMdocUs.js +++ b/resources/dist/assets/AppPopoverTrigger.vue_vue_type_script_setup_true_lang-nBfag7CV.js @@ -1,4 +1,4 @@ -import{G as Tt,h as z,bx as Ft,g as q,by as nt,i as re,bz as $e,bA as Ge,k as $t,q as te,Z as ae,z as rt,bB as st,d as b,u as qe,t as ye,c as ue,r as h,e as a,a as F,b as _,o as y,w as v,m as O,P as N,bC as Nt,N as R,ay as Mt,f as ie,j as W,l as x,K as Ne,S as Me,p as Ce,n as ne,C as de,D as pe,T as Re,H as lt,aw as Y,aq as K,L as it,O as H,Q as oe,aX as ut,F as dt,bD as Rt,bE as Xe,v as ce,s as zt,a4 as Lt,$ as j,a2 as pt,aB as Vt,a0 as ze,bF as Kt,J as ct,W as Ht,V as Ut,bG as jt,a1 as Le,bH as Wt,aN as Yt,av as Gt,a8 as Xt,a9 as me,a6 as ge,a7 as M,ap as ft}from"./app-C6VkUBdm.js";var vt=(t=>(t.OpenAPI="OpenAPI Specification",t.AutoDetect="Laravel Routes",t))(vt||{});function Je(t,o=Number.NEGATIVE_INFINITY,e=Number.POSITIVE_INFINITY){return Math.min(e,Math.max(o,t))}function ke(t){if(t===null||typeof t!="object")return!1;const o=Object.getPrototypeOf(t);return o!==null&&o!==Object.prototype&&Object.getPrototypeOf(o)!==null||Symbol.iterator in t?!1:Symbol.toStringTag in t?Object.prototype.toString.call(t)==="[object Module]":!0}function Te(t,o,e=".",r){if(!ke(o))return Te(t,{},e,r);const n=Object.assign({},o);for(const s in t){if(s==="__proto__"||s==="constructor")continue;const u=t[s];u!=null&&(r&&r(n,s,u,e)||(Array.isArray(u)&&Array.isArray(n[s])?n[s]=[...u,...n[s]]:ke(u)&&ke(n[s])?n[s]=Te(u,n[s],(e?`${e}.`:"")+s.toString(),r):n[s]=u))}return n}function Jt(t){return(...o)=>o.reduce((e,r)=>Te(e,r,"",t),{})}const Zt=Jt(),Qt=Tt(()=>{const t=q(new Map),o=q(),e=z(()=>{for(const u of t.value.values())if(u)return!0;return!1}),r=nt({scrollBody:q(!0)});let n=null;const s=()=>{document.body.style.paddingRight="",document.body.style.marginRight="",document.body.style.pointerEvents="",document.documentElement.style.removeProperty("--scrollbar-width"),document.body.style.overflow=o.value??"",Ge&&(n==null||n()),o.value=void 0};return re(e,(u,c)=>{var p;if(!$e)return;if(!u){c&&s();return}o.value===void 0&&(o.value=document.body.style.overflow);const l=window.innerWidth-document.documentElement.clientWidth,i={padding:l,margin:0},d=(p=r.scrollBody)!=null&&p.value?typeof r.scrollBody.value=="object"?Zt({padding:r.scrollBody.value.padding===!0?l:r.scrollBody.value.padding,margin:r.scrollBody.value.margin===!0?l:r.scrollBody.value.margin},i):i:{padding:0,margin:0};l>0&&(document.body.style.paddingRight=typeof d.padding=="number"?`${d.padding}px`:String(d.padding),document.body.style.marginRight=typeof d.margin=="number"?`${d.margin}px`:String(d.margin),document.documentElement.style.setProperty("--scrollbar-width",`${l}px`),document.body.style.overflow="hidden"),Ge&&(n=$t(document,"touchmove",f=>eo(f),{passive:!1})),te(()=>{document.body.style.pointerEvents="none",document.body.style.overflow="hidden"})},{immediate:!0,flush:"sync"}),t});function Ve(t){const o=Math.random().toString(36).substring(2,7),e=Qt();e.value.set(o,t??!1);const r=z({get:()=>e.value.get(o)??!1,set:n=>e.value.set(o,n)});return Ft(()=>{e.value.delete(o)}),r}function yt(t){const o=window.getComputedStyle(t);if(o.overflowX==="scroll"||o.overflowY==="scroll"||o.overflowX==="auto"&&t.clientWidth1?!0:(o.preventDefault&&o.cancelable&&o.preventDefault(),!1)}let De=0;function mt(){ae(t=>{if(!$e)return;const o=document.querySelectorAll("[data-reka-focus-guard]");document.body.insertAdjacentElement("afterbegin",o[0]??Ze()),document.body.insertAdjacentElement("beforeend",o[1]??Ze()),De++,t(()=>{De===1&&document.querySelectorAll("[data-reka-focus-guard]").forEach(e=>e.remove()),De--})})}function Ze(){const t=document.createElement("span");return t.setAttribute("data-reka-focus-guard",""),t.tabIndex=0,t.style.outline="none",t.style.opacity="0",t.style.position="fixed",t.style.pointerEvents="none",t}var to=function(t){if(typeof document>"u")return null;var o=Array.isArray(t)?t[0]:t;return o.ownerDocument.body},le=new WeakMap,we=new WeakMap,Se={},xe=0,gt=function(t){return t&&(t.host||gt(t.parentNode))},oo=function(t,o){return o.map(function(e){if(t.contains(e))return e;var r=gt(e);return r&&t.contains(r)?r:(console.error("aria-hidden",e,"in not contained inside",t,". Doing nothing"),null)}).filter(function(e){return!!e})},ao=function(t,o,e,r){var n=oo(o,Array.isArray(t)?t:[t]);Se[e]||(Se[e]=new WeakMap);var s=Se[e],u=[],c=new Set,l=new Set(n),i=function(p){!p||c.has(p)||(c.add(p),i(p.parentNode))};n.forEach(i);var d=function(p){!p||l.has(p)||Array.prototype.forEach.call(p.children,function(f){if(c.has(f))d(f);else try{var g=f.getAttribute(r),B=g!==null&&g!=="false",E=(le.get(f)||0)+1,P=(s.get(f)||0)+1;le.set(f,E),s.set(f,P),u.push(f),E===1&&B&&we.set(f,!0),P===1&&f.setAttribute(e,"true"),B||f.setAttribute(r,"true")}catch(I){console.error("aria-hidden: cannot operate on ",f,I)}})};return d(o),c.clear(),xe++,function(){u.forEach(function(p){var f=le.get(p)-1,g=s.get(p)-1;le.set(p,f),s.set(p,g),f||(we.has(p)||p.removeAttribute(r),we.delete(p)),g||p.removeAttribute(e)}),xe--,xe||(le=new WeakMap,le=new WeakMap,we=new WeakMap,Se={})}},no=function(t,o,e){e===void 0&&(e="data-aria-hidden");var r=Array.from(Array.isArray(t)?t:[t]),n=to(t);return n?(r.push.apply(r,Array.from(n.querySelectorAll("[aria-live], script"))),ao(r,n,e,"aria-hidden")):function(){return null}};function Ke(t){let o;re(()=>st(t),e=>{e?o=no(e):o&&o()}),rt(()=>{o&&o()})}const[G,ro]=ue("DialogRoot");var so=b({inheritAttrs:!1,__name:"DialogRoot",props:{open:{type:Boolean,required:!1,default:void 0},defaultOpen:{type:Boolean,required:!1,default:!1},modal:{type:Boolean,required:!1,default:!0}},emits:["update:open"],setup(t,{emit:o}){const e=t,n=qe(e,"open",o,{defaultValue:e.defaultOpen,passive:e.open===void 0}),s=q(),u=q(),{modal:c}=ye(e);return ro({open:n,modal:c,openModal:()=>{n.value=!0},onOpenChange:l=>{n.value=l},onOpenToggle:()=>{n.value=!n.value},contentId:"",titleId:"",descriptionId:"",triggerElement:s,contentElement:u}),(l,i)=>h(l.$slots,"default",{open:a(n),close:()=>n.value=!1})}}),lo=so,io=b({__name:"DialogClose",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"button"}},setup(t){const o=t;F();const e=G();return(r,n)=>(y(),_(a(N),O(o,{type:r.as==="button"?"button":void 0,onClick:n[0]||(n[0]=s=>a(e).onOpenChange(!1))}),{default:v(()=>[h(r.$slots,"default")]),_:3},16,["type"]))}}),uo=io;const po=Nt(()=>q([]));function co(){const t=po();return{add(o){const e=t.value[0];o!==e&&(e==null||e.pause()),t.value=Qe(t.value,o),t.value.unshift(o)},remove(o){var e;t.value=Qe(t.value,o),(e=t.value[0])==null||e.resume()}}}function Qe(t,o){const e=[...t],r=e.indexOf(o);return r!==-1&&e.splice(r,1),e}function fo(t){return t.filter(o=>o.tagName!=="A")}const Ae="focusScope.autoFocusOnMount",Ie="focusScope.autoFocusOnUnmount",et={bubbles:!1,cancelable:!0};function vo(t,{select:o=!1}={}){const e=R();for(const r of t)if(J(r,{select:o}),R()!==e)return!0}function yo(t){const o=_t(t),e=tt(o,t),r=tt(o.reverse(),t);return[e,r]}function _t(t){const o=[],e=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const n=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||n?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;e.nextNode();)o.push(e.currentNode);return o}function tt(t,o){for(const e of t)if(!mo(e,{upTo:o}))return e}function mo(t,{upTo:o}){if(getComputedStyle(t).visibility==="hidden")return!0;for(;t;){if(o!==void 0&&t===o)return!1;if(getComputedStyle(t).display==="none")return!0;t=t.parentElement}return!1}function go(t){return t instanceof HTMLInputElement&&"select"in t}function J(t,{select:o=!1}={}){if(t&&t.focus){const e=R();t.focus({preventScroll:!0}),t!==e&&go(t)&&o&&t.select()}}var _o=b({__name:"FocusScope",props:{loop:{type:Boolean,required:!1,default:!1},trapped:{type:Boolean,required:!1,default:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["mountAutoFocus","unmountAutoFocus"],setup(t,{emit:o}){const e=t,r=o,{currentRef:n,currentElement:s}=F(),u=q(null),c=co(),l=Mt({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}});ae(d=>{if(!$e)return;const p=s.value;if(!e.trapped)return;function f(P){if(l.paused||!p)return;const I=P.target;p.contains(I)?u.value=I:J(u.value,{select:!0})}function g(P){if(l.paused||!p)return;const I=P.relatedTarget;I!==null&&(p.contains(I)||J(u.value,{select:!0}))}function B(P){p.contains(u.value)||J(p)}document.addEventListener("focusin",f),document.addEventListener("focusout",g);const E=new MutationObserver(B);p&&E.observe(p,{childList:!0,subtree:!0}),d(()=>{document.removeEventListener("focusin",f),document.removeEventListener("focusout",g),E.disconnect()})}),ae(async d=>{const p=s.value;if(await te(),!p)return;c.add(l);const f=R();if(!p.contains(f)){const B=new CustomEvent(Ae,et);p.addEventListener(Ae,E=>r("mountAutoFocus",E)),p.dispatchEvent(B),B.defaultPrevented||(vo(fo(_t(p)),{select:!0}),R()===f&&J(p))}d(()=>{p.removeEventListener(Ae,P=>r("mountAutoFocus",P));const B=new CustomEvent(Ie,et),E=P=>{r("unmountAutoFocus",P)};p.addEventListener(Ie,E),p.dispatchEvent(B),setTimeout(()=>{B.defaultPrevented||J(f??document.body,{select:!0}),p.removeEventListener(Ie,E),c.remove(l)},0)})});function i(d){if(!e.loop&&!e.trapped||l.paused)return;const p=d.key==="Tab"&&!d.altKey&&!d.ctrlKey&&!d.metaKey,f=R();if(p&&f){const g=d.currentTarget,[B,E]=yo(g);B&&E?!d.shiftKey&&f===E?(d.preventDefault(),e.loop&&J(B,{select:!0})):d.shiftKey&&f===B&&(d.preventDefault(),e.loop&&J(E,{select:!0})):f===g&&d.preventDefault()}}return(d,p)=>(y(),_(a(N),{ref_key:"currentRef",ref:n,tabindex:"-1","as-child":d.asChild,as:d.as,onKeydown:i},{default:v(()=>[h(d.$slots,"default")]),_:3},8,["as-child","as"]))}}),He=_o;const on="menu.itemSelect",ot=["Enter"," "],ho=["ArrowDown","PageUp","Home"],bo=["ArrowUp","PageDown","End"],an=[...ho,...bo];[...ot],[...ot];function wo(t){return t?"open":"closed"}function at(t){const o=R();for(const e of t)if(e===o||(e.focus(),R()!==o))return}function So(t,o){const{x:e,y:r}=t;let n=!1;for(let s=0,u=o.length-1;sr!=d>r&&e<(i-c)*(r-l)/(d-l)+c&&(n=!n)}return n}function nn(t,o){if(!o)return!1;const e={x:t.clientX,y:t.clientY};return So(e,o)}function rn(t){return t.pointerType==="mouse"}var qo=b({__name:"DialogContentImpl",props:{forceMount:{type:Boolean,required:!1},trapFocus:{type:Boolean,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","openAutoFocus","closeAutoFocus"],setup(t,{emit:o}){const e=t,r=o,n=G(),{forwardRef:s,currentElement:u}=F();return n.titleId||(n.titleId=ie(void 0,"reka-dialog-title")),n.descriptionId||(n.descriptionId=ie(void 0,"reka-dialog-description")),W(()=>{n.contentElement=u,R()!==document.body&&(n.triggerElement.value=R())}),(c,l)=>(y(),_(a(He),{"as-child":"",loop:"",trapped:e.trapFocus,onMountAutoFocus:l[5]||(l[5]=i=>r("openAutoFocus",i)),onUnmountAutoFocus:l[6]||(l[6]=i=>r("closeAutoFocus",i))},{default:v(()=>[x(a(Ne),O({id:a(n).contentId,ref:a(s),as:c.as,"as-child":c.asChild,"disable-outside-pointer-events":c.disableOutsidePointerEvents,role:"dialog","aria-describedby":a(n).descriptionId,"aria-labelledby":a(n).titleId,"data-state":a(wo)(a(n).open.value)},c.$attrs,{onDismiss:l[0]||(l[0]=i=>a(n).onOpenChange(!1)),onEscapeKeyDown:l[1]||(l[1]=i=>r("escapeKeyDown",i)),onFocusOutside:l[2]||(l[2]=i=>r("focusOutside",i)),onInteractOutside:l[3]||(l[3]=i=>r("interactOutside",i)),onPointerDownOutside:l[4]||(l[4]=i=>r("pointerDownOutside",i))}),{default:v(()=>[h(c.$slots,"default")]),_:3},16,["id","as","as-child","disable-outside-pointer-events","aria-describedby","aria-labelledby","data-state"])]),_:3},8,["trapped"]))}}),ht=qo,Co=b({__name:"DialogContentModal",props:{forceMount:{type:Boolean,required:!1},trapFocus:{type:Boolean,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","openAutoFocus","closeAutoFocus"],setup(t,{emit:o}){const e=t,r=o,n=G(),s=Me(r),{forwardRef:u,currentElement:c}=F();return Ke(c),(l,i)=>(y(),_(ht,O({...e,...a(s)},{ref:a(u),"trap-focus":a(n).open.value,"disable-outside-pointer-events":!0,onCloseAutoFocus:i[0]||(i[0]=d=>{var p;d.defaultPrevented||(d.preventDefault(),(p=a(n).triggerElement.value)==null||p.focus())}),onPointerDownOutside:i[1]||(i[1]=d=>{const p=d.detail.originalEvent,f=p.button===0&&p.ctrlKey===!0;(p.button===2||f)&&d.preventDefault()}),onFocusOutside:i[2]||(i[2]=d=>{d.preventDefault()})}),{default:v(()=>[h(l.$slots,"default")]),_:3},16,["trap-focus"]))}}),Bo=Co,Po=b({__name:"DialogContentNonModal",props:{forceMount:{type:Boolean,required:!1},trapFocus:{type:Boolean,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","openAutoFocus","closeAutoFocus"],setup(t,{emit:o}){const e=t,n=Me(o);F();const s=G(),u=q(!1),c=q(!1);return(l,i)=>(y(),_(ht,O({...e,...a(n)},{"trap-focus":!1,"disable-outside-pointer-events":!1,onCloseAutoFocus:i[0]||(i[0]=d=>{var p;d.defaultPrevented||(u.value||(p=a(s).triggerElement.value)==null||p.focus(),d.preventDefault()),u.value=!1,c.value=!1}),onInteractOutside:i[1]||(i[1]=d=>{var g;d.defaultPrevented||(u.value=!0,d.detail.originalEvent.type==="pointerdown"&&(c.value=!0));const p=d.target;((g=a(s).triggerElement.value)==null?void 0:g.contains(p))&&d.preventDefault(),d.detail.originalEvent.type==="focusin"&&c.value&&d.preventDefault()})}),{default:v(()=>[h(l.$slots,"default")]),_:3},16))}}),Oo=Po,Eo=b({__name:"DialogContent",props:{forceMount:{type:Boolean,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","openAutoFocus","closeAutoFocus"],setup(t,{emit:o}){const e=t,r=o,n=G(),s=Me(r),{forwardRef:u}=F();return(c,l)=>(y(),_(a(Ce),{present:c.forceMount||a(n).open.value},{default:v(()=>[a(n).modal.value?(y(),_(Bo,O({key:0,ref:a(u)},{...e,...a(s),...c.$attrs}),{default:v(()=>[h(c.$slots,"default")]),_:3},16)):(y(),_(Oo,O({key:1,ref:a(u)},{...e,...a(s),...c.$attrs}),{default:v(()=>[h(c.$slots,"default")]),_:3},16))]),_:3},8,["present"]))}}),ko=Eo,Do=b({__name:"DialogDescription",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"p"}},setup(t){const o=t;F();const e=G();return(r,n)=>(y(),_(a(N),O(o,{id:a(e).descriptionId}),{default:v(()=>[h(r.$slots,"default")]),_:3},16,["id"]))}}),xo=Do,Ao=b({__name:"DialogOverlayImpl",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(t){const o=G();return Ve(!0),F(),(e,r)=>(y(),_(a(N),{as:e.as,"as-child":e.asChild,"data-state":a(o).open.value?"open":"closed",style:{"pointer-events":"auto"}},{default:v(()=>[h(e.$slots,"default")]),_:3},8,["as","as-child","data-state"]))}}),Io=Ao,To=b({__name:"DialogOverlay",props:{forceMount:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(t){const o=G(),{forwardRef:e}=F();return(r,n)=>{var s;return(s=a(o))!=null&&s.modal.value?(y(),_(a(Ce),{key:0,present:r.forceMount||a(o).open.value},{default:v(()=>[x(Io,O(r.$attrs,{ref:a(e),as:r.as,"as-child":r.asChild}),{default:v(()=>[h(r.$slots,"default")]),_:3},16,["as","as-child"])]),_:3},8,["present"])):ne("v-if",!0)}}}),Fo=To,$o=b({__name:"DialogPortal",props:{to:{type:null,required:!1},disabled:{type:Boolean,required:!1},defer:{type:Boolean,required:!1},forceMount:{type:Boolean,required:!1}},setup(t){const o=t;return(e,r)=>(y(),_(a(Re),de(pe(o)),{default:v(()=>[h(e.$slots,"default")]),_:3},16))}}),No=$o,Mo=b({__name:"DialogTitle",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"h2"}},setup(t){const o=t,e=G();return F(),(r,n)=>(y(),_(a(N),O(o,{id:a(e).titleId}),{default:v(()=>[h(r.$slots,"default")]),_:3},16,["id"]))}}),Ro=Mo;function zo(t){const o=nt({nonce:q()});return z(()=>{var e;return(t==null?void 0:t.value)||((e=o.nonce)==null?void 0:e.value)})}const[_e,Lo]=ue("PopoverRoot");var Vo=b({__name:"PopoverRoot",props:{defaultOpen:{type:Boolean,required:!1,default:!1},open:{type:Boolean,required:!1,default:void 0},modal:{type:Boolean,required:!1,default:!1}},emits:["update:open"],setup(t,{emit:o}){const e=t,r=o,{modal:n}=ye(e),s=qe(e,"open",r,{defaultValue:e.defaultOpen,passive:e.open===void 0}),u=q(),c=q(!1);return Lo({contentId:"",triggerId:"",modal:n,open:s,onOpenChange:l=>{s.value=l},onOpenToggle:()=>{s.value=!s.value},triggerElement:u,hasCustomAnchor:c}),(l,i)=>(y(),_(a(lt),null,{default:v(()=>[h(l.$slots,"default",{open:a(s),close:()=>s.value=!1})]),_:3}))}}),Ko=Vo,Ho=b({__name:"PopoverContentImpl",props:{trapFocus:{type:Boolean,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","openAutoFocus","closeAutoFocus"],setup(t,{emit:o}){const e=t,r=o,n=Y(K(e,"trapFocus","disableOutsidePointerEvents")),{forwardRef:s}=F(),u=_e();return mt(),(c,l)=>(y(),_(a(He),{"as-child":"",loop:"",trapped:c.trapFocus,onMountAutoFocus:l[5]||(l[5]=i=>r("openAutoFocus",i)),onUnmountAutoFocus:l[6]||(l[6]=i=>r("closeAutoFocus",i))},{default:v(()=>[x(a(Ne),{"as-child":"","disable-outside-pointer-events":c.disableOutsidePointerEvents,onPointerDownOutside:l[0]||(l[0]=i=>r("pointerDownOutside",i)),onInteractOutside:l[1]||(l[1]=i=>r("interactOutside",i)),onEscapeKeyDown:l[2]||(l[2]=i=>r("escapeKeyDown",i)),onFocusOutside:l[3]||(l[3]=i=>r("focusOutside",i)),onDismiss:l[4]||(l[4]=i=>a(u).onOpenChange(!1))},{default:v(()=>[x(a(it),O(a(n),{id:a(u).contentId,ref:a(s),"data-state":a(u).open.value?"open":"closed","aria-labelledby":a(u).triggerId,style:{"--reka-popover-content-transform-origin":"var(--reka-popper-transform-origin)","--reka-popover-content-available-width":"var(--reka-popper-available-width)","--reka-popover-content-available-height":"var(--reka-popper-available-height)","--reka-popover-trigger-width":"var(--reka-popper-anchor-width)","--reka-popover-trigger-height":"var(--reka-popper-anchor-height)"},role:"dialog"}),{default:v(()=>[h(c.$slots,"default")]),_:3},16,["id","data-state","aria-labelledby"])]),_:3},8,["disable-outside-pointer-events"])]),_:3},8,["trapped"]))}}),bt=Ho,Uo=b({__name:"PopoverContentModal",props:{side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","openAutoFocus","closeAutoFocus"],setup(t,{emit:o}){const e=t,r=o,n=_e(),s=q(!1);Ve(!0);const u=H(e,r),{forwardRef:c,currentElement:l}=F();return Ke(l),(i,d)=>(y(),_(bt,O(a(u),{ref:a(c),"trap-focus":a(n).open.value,"disable-outside-pointer-events":"",onCloseAutoFocus:d[0]||(d[0]=oe(p=>{var f;r("closeAutoFocus",p),s.value||(f=a(n).triggerElement.value)==null||f.focus()},["prevent"])),onPointerDownOutside:d[1]||(d[1]=p=>{r("pointerDownOutside",p);const f=p.detail.originalEvent,g=f.button===0&&f.ctrlKey===!0,B=f.button===2||g;s.value=B}),onFocusOutside:d[2]||(d[2]=oe(()=>{},["prevent"]))}),{default:v(()=>[h(i.$slots,"default")]),_:3},16,["trap-focus"]))}}),jo=Uo,Wo=b({__name:"PopoverContentNonModal",props:{side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","openAutoFocus","closeAutoFocus"],setup(t,{emit:o}){const e=t,r=o,n=_e(),s=q(!1),u=q(!1),c=H(e,r);return(l,i)=>(y(),_(bt,O(a(c),{"trap-focus":!1,"disable-outside-pointer-events":!1,onCloseAutoFocus:i[0]||(i[0]=d=>{var p;r("closeAutoFocus",d),d.defaultPrevented||(s.value||(p=a(n).triggerElement.value)==null||p.focus(),d.preventDefault()),s.value=!1,u.value=!1}),onInteractOutside:i[1]||(i[1]=async d=>{var g;r("interactOutside",d),d.defaultPrevented||(s.value=!0,d.detail.originalEvent.type==="pointerdown"&&(u.value=!0));const p=d.target;((g=a(n).triggerElement.value)==null?void 0:g.contains(p))&&d.preventDefault(),d.detail.originalEvent.type==="focusin"&&u.value&&d.preventDefault()})}),{default:v(()=>[h(l.$slots,"default")]),_:3},16))}}),Yo=Wo,Go=b({__name:"PopoverContent",props:{forceMount:{type:Boolean,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","openAutoFocus","closeAutoFocus"],setup(t,{emit:o}){const e=t,r=o,n=_e(),s=H(e,r),{forwardRef:u}=F();return n.contentId||(n.contentId=ie(void 0,"reka-popover-content")),(c,l)=>(y(),_(a(Ce),{present:c.forceMount||a(n).open.value},{default:v(()=>[a(n).modal.value?(y(),_(jo,O({key:0},a(s),{ref:a(u)}),{default:v(()=>[h(c.$slots,"default")]),_:3},16)):(y(),_(Yo,O({key:1},a(s),{ref:a(u)}),{default:v(()=>[h(c.$slots,"default")]),_:3},16))]),_:3},8,["present"]))}}),Xo=Go,Jo=b({__name:"PopoverPortal",props:{to:{type:null,required:!1},disabled:{type:Boolean,required:!1},defer:{type:Boolean,required:!1},forceMount:{type:Boolean,required:!1}},setup(t){const o=t;return(e,r)=>(y(),_(a(Re),de(pe(o)),{default:v(()=>[h(e.$slots,"default")]),_:3},16))}}),Zo=Jo,Qo=b({__name:"PopoverTrigger",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"button"}},setup(t){const o=t,e=_e(),{forwardRef:r,currentElement:n}=F();return e.triggerId||(e.triggerId=ie(void 0,"reka-popover-trigger")),W(()=>{e.triggerElement.value=n.value}),(s,u)=>(y(),_(ut(a(e).hasCustomAnchor.value?a(N):a(dt)),{"as-child":""},{default:v(()=>[x(a(N),{id:a(e).triggerId,ref:a(r),type:s.as==="button"?"button":void 0,"aria-haspopup":"dialog","aria-expanded":a(e).open.value,"aria-controls":a(e).contentId,"data-state":a(e).open.value?"open":"closed",as:s.as,"as-child":o.asChild,onClick:a(e).onOpenToggle},{default:v(()=>[h(s.$slots,"default")]),_:3},8,["id","type","aria-expanded","aria-controls","data-state","as","as-child","onClick"])]),_:3}))}}),ea=Qo;const ta=[" ","Enter","ArrowUp","ArrowDown"],oa=[" ","Enter"],V=10;function ve(t,o,e){return t===void 0?!1:Array.isArray(t)?t.some(r=>Fe(r,o,e)):Fe(t,o,e)}function Fe(t,o,e){return t===void 0||o===void 0?!1:typeof t=="string"?t===o:typeof e=="function"?e(t,o):typeof e=="string"?(t==null?void 0:t[e])===(o==null?void 0:o[e]):Rt(t,o)}function aa(t){return t==null||t===""||Array.isArray(t)&&t.length===0}const na={key:0,value:""},[Z,wt]=ue("SelectRoot");var ra=b({inheritAttrs:!1,__name:"SelectRoot",props:{open:{type:Boolean,required:!1,default:void 0},defaultOpen:{type:Boolean,required:!1},defaultValue:{type:null,required:!1},modelValue:{type:null,required:!1,default:void 0},by:{type:[String,Function],required:!1},dir:{type:String,required:!1},multiple:{type:Boolean,required:!1},autocomplete:{type:String,required:!1},disabled:{type:Boolean,required:!1},name:{type:String,required:!1},required:{type:Boolean,required:!1}},emits:["update:modelValue","update:open"],setup(t,{emit:o}){const e=t,r=o,{required:n,disabled:s,multiple:u,dir:c}=ye(e),l=qe(e,"modelValue",r,{defaultValue:e.defaultValue??(u.value?[]:void 0),passive:e.modelValue===void 0,deep:!0}),i=qe(e,"open",r,{defaultValue:e.defaultOpen,passive:e.open===void 0}),d=q(),p=q(),f=q({x:0,y:0}),g=z(()=>{var m;return u.value&&Array.isArray(l.value)?((m=l.value)==null?void 0:m.length)===0:Xe(l.value)});ce({isProvider:!0});const B=zt(c),E=Lt(d),P=q(new Set),I=z(()=>Array.from(P.value).map(m=>m.value).join(";"));function S(m){if(u.value){const C=Array.isArray(l.value)?[...l.value]:[],w=C.findIndex(D=>Fe(D,m,e.by));w===-1?C.push(m):C.splice(w,1),l.value=[...C]}else l.value=m}function k(m){return Array.from(P.value).find(C=>ve(m,C.value,e.by))}return wt({triggerElement:d,onTriggerChange:m=>{d.value=m},valueElement:p,onValueElementChange:m=>{p.value=m},contentId:"",modelValue:l,onValueChange:S,by:e.by,open:i,multiple:u,required:n,onOpenChange:m=>{i.value=m},dir:B,triggerPointerDownPosRef:f,disabled:s,isEmptyModelValue:g,optionsSet:P,onOptionAdd:m=>{const C=k(m.value);C&&P.value.delete(C),P.value.add(m)},onOptionRemove:m=>{const C=k(m.value);C&&P.value.delete(C)}}),(m,C)=>(y(),_(a(lt),null,{default:v(()=>[h(m.$slots,"default",{modelValue:a(l),open:a(i)}),a(E)?(y(),_(ia,{key:I.value,"aria-hidden":"true",tabindex:"-1",multiple:a(u),required:a(n),name:m.name,autocomplete:m.autocomplete,disabled:a(s),value:a(l)},{default:v(()=>[a(Xe)(a(l))?(y(),j("option",na)):ne("v-if",!0),(y(!0),j(pt,null,Vt(Array.from(P.value),w=>(y(),j("option",O({key:w.value??""},{ref_for:!0},w),null,16))),128))]),_:1},8,["multiple","required","name","autocomplete","disabled","value"])):ne("v-if",!0)]),_:3}))}}),sa=ra,la=b({__name:"BubbleSelect",props:{autocomplete:{type:String,required:!1},autofocus:{type:Boolean,required:!1},disabled:{type:Boolean,required:!1},form:{type:String,required:!1},multiple:{type:Boolean,required:!1},name:{type:String,required:!1},required:{type:Boolean,required:!1},size:{type:Number,required:!1},value:{type:null,required:!1}},setup(t){const o=t,e=q(),r=Z();re(()=>o.value,(s,u)=>{const c=window.HTMLSelectElement.prototype,i=Object.getOwnPropertyDescriptor(c,"value").set;if(s!==u&&i&&e.value){const d=new Event("change",{bubbles:!0});i.call(e.value,s),e.value.dispatchEvent(d)}});function n(s){r.onValueChange(s.target.value)}return(s,u)=>(y(),_(a(Kt),{"as-child":""},{default:v(()=>[ze("select",O({ref_key:"selectElement",ref:e},o,{onInput:n}),[h(s.$slots,"default")],16)]),_:3}))}}),ia=la,ua=b({__name:"SelectPopperPosition",props:{side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1,default:"start"},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1,default:V},arrowPadding:{type:Number,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(t){const e=Y(t);return(r,n)=>(y(),_(a(it),O(a(e),{style:{boxSizing:"border-box","--reka-select-content-transform-origin":"var(--reka-popper-transform-origin)","--reka-select-content-available-width":"var(--reka-popper-available-width)","--reka-select-content-available-height":"var(--reka-popper-available-height)","--reka-select-trigger-width":"var(--reka-popper-anchor-width)","--reka-select-trigger-height":"var(--reka-popper-anchor-height)"}}),{default:v(()=>[h(r.$slots,"default")]),_:3},16))}}),da=ua;const pa={onViewportChange:()=>{},itemTextRefCallback:()=>{},itemRefCallback:()=>{}},[se,St]=ue("SelectContent");var ca=b({__name:"SelectContentImpl",props:{position:{type:String,required:!1,default:"item-aligned"},bodyLock:{type:Boolean,required:!1,default:!0},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1,default:"start"},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1,default:!0}},emits:["closeAutoFocus","escapeKeyDown","pointerDownOutside"],setup(t,{emit:o}){const e=t,r=o,n=Z();mt(),Ve(e.bodyLock);const{CollectionSlot:s,getItems:u}=ce(),c=q();Ke(c);const{search:l,handleTypeaheadSearch:i}=ct(),d=q(),p=q(),f=q(),g=q(!1),B=q(!1),E=q(!1);function P(){p.value&&c.value&&at([p.value,c.value])}re(g,()=>{P()});const{onOpenChange:I,triggerPointerDownPosRef:S}=n;ae(w=>{if(!c.value)return;let D={x:0,y:0};const T=$=>{var L,fe;D={x:Math.abs(Math.round($.pageX)-(((L=S.value)==null?void 0:L.x)??0)),y:Math.abs(Math.round($.pageY)-(((fe=S.value)==null?void 0:fe.y)??0))}},A=$=>{var L;$.pointerType!=="touch"&&(D.x<=10&&D.y<=10?$.preventDefault():(L=c.value)!=null&&L.contains($.target)||I(!1),document.removeEventListener("pointermove",T),S.value=null)};S.value!==null&&(document.addEventListener("pointermove",T),document.addEventListener("pointerup",A,{capture:!0,once:!0})),w(()=>{document.removeEventListener("pointermove",T),document.removeEventListener("pointerup",A,{capture:!0})})});function k(w){const D=w.ctrlKey||w.altKey||w.metaKey;if(w.key==="Tab"&&w.preventDefault(),!D&&w.key.length===1&&i(w.key,u()),["ArrowUp","ArrowDown","Home","End"].includes(w.key)){let A=[...u().map($=>$.ref)];if(["ArrowUp","End"].includes(w.key)&&(A=A.slice().reverse()),["ArrowUp","ArrowDown"].includes(w.key)){const $=w.target,L=A.indexOf($);A=A.slice(L+1)}setTimeout(()=>at(A)),w.preventDefault()}}const m=z(()=>e.position==="popper"?e:{}),C=Y(m.value);return St({content:c,viewport:d,onViewportChange:w=>{d.value=w},itemRefCallback:(w,D,T)=>{const A=!B.value&&!T,$=ve(n.modelValue.value,D,n.by);if(n.multiple.value){if(E.value)return;($||A)&&(p.value=w,$&&(E.value=!0))}else($||A)&&(p.value=w);A&&(B.value=!0)},selectedItem:p,selectedItemText:f,onItemLeave:()=>{var w;(w=c.value)==null||w.focus()},itemTextRefCallback:(w,D,T)=>{const A=!B.value&&!T;(ve(n.modelValue.value,D,n.by)||A)&&(f.value=w)},focusSelectedItem:P,position:e.position,isPositioned:g,searchRef:l}),(w,D)=>(y(),_(a(s),null,{default:v(()=>[x(a(He),{"as-child":"",onMountAutoFocus:D[6]||(D[6]=oe(()=>{},["prevent"])),onUnmountAutoFocus:D[7]||(D[7]=T=>{var A;r("closeAutoFocus",T),!T.defaultPrevented&&((A=a(n).triggerElement.value)==null||A.focus({preventScroll:!0}),T.preventDefault())})},{default:v(()=>[x(a(Ne),{"as-child":"","disable-outside-pointer-events":w.disableOutsidePointerEvents,onFocusOutside:D[2]||(D[2]=oe(()=>{},["prevent"])),onDismiss:D[3]||(D[3]=T=>a(n).onOpenChange(!1)),onEscapeKeyDown:D[4]||(D[4]=T=>r("escapeKeyDown",T)),onPointerDownOutside:D[5]||(D[5]=T=>r("pointerDownOutside",T))},{default:v(()=>[(y(),_(ut(w.position==="popper"?da:ma),O({...w.$attrs,...a(C)},{id:a(n).contentId,ref:T=>{const A=a(st)(T);A!=null&&A.hasAttribute("data-reka-popper-content-wrapper")?c.value=A.firstElementChild:c.value=A},role:"listbox","data-state":a(n).open.value?"open":"closed",dir:a(n).dir.value,style:{display:"flex",flexDirection:"column",outline:"none"},onContextmenu:D[0]||(D[0]=oe(()=>{},["prevent"])),onPlaced:D[1]||(D[1]=T=>g.value=!0),onKeydown:k}),{default:v(()=>[h(w.$slots,"default")]),_:3},16,["id","data-state","dir","onKeydown"]))]),_:3},8,["disable-outside-pointer-events"])]),_:3})]),_:3}))}}),fa=ca;const[Ue,va]=ue("SelectItemAlignedPosition");var ya=b({inheritAttrs:!1,__name:"SelectItemAlignedPosition",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["placed"],setup(t,{emit:o}){const e=t,r=o,{getItems:n}=ce(),s=Z(),u=se(),c=q(!1),l=q(!0),i=q(),{forwardRef:d,currentElement:p}=F(),{viewport:f,selectedItem:g,selectedItemText:B,focusSelectedItem:E}=u;function P(){if(s.triggerElement.value&&s.valueElement.value&&i.value&&p.value&&(f!=null&&f.value)&&(g!=null&&g.value)&&(B!=null&&B.value)){const k=s.triggerElement.value.getBoundingClientRect(),m=p.value.getBoundingClientRect(),C=s.valueElement.value.getBoundingClientRect(),w=B.value.getBoundingClientRect();if(s.dir.value!=="rtl"){const U=w.left-m.left,X=C.left-U,Q=k.left-X,ee=k.width+Q,Pe=Math.max(ee,m.width),Oe=window.innerWidth-V,Ee=Je(X,V,Math.max(V,Oe-Pe));i.value.style.minWidth=`${ee}px`,i.value.style.left=`${Ee}px`}else{const U=m.right-w.right,X=window.innerWidth-C.right-U,Q=window.innerWidth-k.right-X,ee=k.width+Q,Pe=Math.max(ee,m.width),Oe=window.innerWidth-V,Ee=Je(X,V,Math.max(V,Oe-Pe));i.value.style.minWidth=`${ee}px`,i.value.style.right=`${Ee}px`}const D=n().map(U=>U.ref),T=window.innerHeight-V*2,A=f.value.scrollHeight,$=window.getComputedStyle(p.value),L=Number.parseInt($.borderTopWidth,10),fe=Number.parseInt($.paddingTop,10),je=Number.parseInt($.borderBottomWidth,10),Ot=Number.parseInt($.paddingBottom,10),We=L+fe+A+Ot+je,Et=Math.min(g.value.offsetHeight*5,We),Ye=window.getComputedStyle(f.value),kt=Number.parseInt(Ye.paddingTop,10),Dt=Number.parseInt(Ye.paddingBottom,10),he=k.top+k.height/2-V,xt=T-he,Be=g.value.offsetHeight/2,At=g.value.offsetTop+Be,be=L+fe+At,It=We-be;if(be<=he){const U=g.value===D[D.length-1];i.value.style.bottom="0px";const X=p.value.clientHeight-f.value.offsetTop-f.value.offsetHeight,Q=Math.max(xt,Be+(U?Dt:0)+X+je),ee=be+Q;i.value.style.height=`${ee}px`}else{const U=g.value===D[0];i.value.style.top="0px";const Q=Math.max(he,L+f.value.offsetTop+(U?kt:0)+Be)+It;i.value.style.height=`${Q}px`,f.value.scrollTop=be-he+f.value.offsetTop}i.value.style.margin=`${V}px 0`,i.value.style.minHeight=`${Et}px`,i.value.style.maxHeight=`${T}px`,r("placed"),requestAnimationFrame(()=>c.value=!0)}}const I=q("");W(async()=>{await te(),P(),p.value&&(I.value=window.getComputedStyle(p.value).zIndex)});function S(k){k&&l.value===!0&&(P(),E==null||E(),l.value=!1)}return Ht(s.triggerElement,()=>{P()}),va({contentWrapper:i,shouldExpandOnScrollRef:c,onScrollButtonChange:S}),(k,m)=>(y(),j("div",{ref_key:"contentWrapperElement",ref:i,style:Ut({display:"flex",flexDirection:"column",position:"fixed",zIndex:I.value})},[x(a(N),O({ref:a(d),style:{boxSizing:"border-box",maxHeight:"100%"}},{...k.$attrs,...e}),{default:v(()=>[h(k.$slots,"default")]),_:3},16)],4))}}),ma=ya,ga=b({inheritAttrs:!1,__name:"SelectProvider",props:{context:{type:Object,required:!0}},setup(t){return wt(t.context),St(pa),(e,r)=>h(e.$slots,"default")}}),_a=ga;const ha={key:1};var ba=b({inheritAttrs:!1,__name:"SelectContent",props:{forceMount:{type:Boolean,required:!1},position:{type:String,required:!1},bodyLock:{type:Boolean,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1}},emits:["closeAutoFocus","escapeKeyDown","pointerDownOutside"],setup(t,{emit:o}){const e=t,n=H(e,o),s=Z(),u=q();W(()=>{u.value=new DocumentFragment});const c=q(),l=z(()=>e.forceMount||s.open.value),i=q(l.value);return re(l,()=>{setTimeout(()=>i.value=l.value)}),(d,p)=>{var f;return l.value||i.value||(f=c.value)!=null&&f.present?(y(),_(a(Ce),{key:0,ref_key:"presenceRef",ref:c,present:l.value},{default:v(()=>[x(fa,de(pe({...a(n),...d.$attrs})),{default:v(()=>[h(d.$slots,"default")]),_:3},16)]),_:3},8,["present"])):u.value?(y(),j("div",ha,[(y(),_(jt,{to:u.value},[x(_a,{context:a(s)},{default:v(()=>[h(d.$slots,"default")]),_:3},8,["context"])],8,["to"]))])):ne("v-if",!0)}}}),wa=ba,Sa=b({__name:"SelectIcon",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"span"}},setup(t){return(o,e)=>(y(),_(a(N),{"aria-hidden":"true",as:o.as,"as-child":o.asChild},{default:v(()=>[h(o.$slots,"default",{},()=>[e[0]||(e[0]=Le("▼"))])]),_:3},8,["as","as-child"]))}}),qa=Sa;const[qt,Ca]=ue("SelectItem");var Ba=b({__name:"SelectItem",props:{value:{type:null,required:!0},disabled:{type:Boolean,required:!1},textValue:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["select"],setup(t,{emit:o}){const e=t,r=o,{disabled:n}=ye(e),s=Z(),u=se(),{forwardRef:c,currentElement:l}=F(),{CollectionItem:i}=ce(),d=z(()=>{var m;return ve((m=s.modelValue)==null?void 0:m.value,e.value,s.by)}),p=q(!1),f=q(e.textValue??""),g=ie(void 0,"reka-select-item-text"),B="select.select";async function E(m){if(m.defaultPrevented)return;const C={originalEvent:m,value:e.value};Wt(B,P,C)}async function P(m){await te(),r("select",m),!m.defaultPrevented&&(n.value||(s.onValueChange(e.value),s.multiple.value||s.onOpenChange(!1)))}async function I(m){var C,w;await te(),!m.defaultPrevented&&(n.value?(C=u.onItemLeave)==null||C.call(u):(w=m.currentTarget)==null||w.focus({preventScroll:!0}))}async function S(m){var C;await te(),!m.defaultPrevented&&m.currentTarget===R()&&((C=u.onItemLeave)==null||C.call(u))}async function k(m){var w;await te(),!(m.defaultPrevented||((w=u.searchRef)==null?void 0:w.value)!==""&&m.key===" ")&&(oa.includes(m.key)&&E(m),m.key===" "&&m.preventDefault())}if(e.value==="")throw new Error("A must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return W(()=>{l.value&&u.itemRefCallback(l.value,e.value,e.disabled)}),Ca({value:e.value,disabled:n,textId:g,isSelected:d,onItemTextChange:m=>{f.value=((f.value||(m==null?void 0:m.textContent))??"").trim()}}),(m,C)=>(y(),_(a(i),{value:{textValue:f.value}},{default:v(()=>[x(a(N),{ref:a(c),role:"option","aria-labelledby":a(g),"data-highlighted":p.value?"":void 0,"aria-selected":d.value,"data-state":d.value?"checked":"unchecked","aria-disabled":a(n)||void 0,"data-disabled":a(n)?"":void 0,tabindex:a(n)?void 0:-1,as:m.as,"as-child":m.asChild,onFocus:C[0]||(C[0]=w=>p.value=!0),onBlur:C[1]||(C[1]=w=>p.value=!1),onPointerup:E,onPointerdown:C[2]||(C[2]=w=>{w.currentTarget.focus({preventScroll:!0})}),onTouchend:C[3]||(C[3]=oe(()=>{},["prevent","stop"])),onPointermove:I,onPointerleave:S,onKeydown:k},{default:v(()=>[h(m.$slots,"default")]),_:3},8,["aria-labelledby","data-highlighted","aria-selected","data-state","aria-disabled","data-disabled","tabindex","as","as-child"])]),_:3},8,["value"]))}}),Pa=Ba,Oa=b({__name:"SelectItemIndicator",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"span"}},setup(t){const o=t,e=qt();return(r,n)=>a(e).isSelected.value?(y(),_(a(N),O({key:0,"aria-hidden":"true"},o),{default:v(()=>[h(r.$slots,"default")]),_:3},16)):ne("v-if",!0)}}),Ea=Oa,ka=b({inheritAttrs:!1,__name:"SelectItemText",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"span"}},setup(t){const o=t,e=Z(),r=se(),n=qt(),{forwardRef:s,currentElement:u}=F(),c=z(()=>{var l,i;return{value:n.value,disabled:n.disabled.value,textContent:((l=u.value)==null?void 0:l.textContent)??((i=n.value)==null?void 0:i.toString())??""}});return W(()=>{u.value&&(n.onItemTextChange(u.value),r.itemTextRefCallback(u.value,n.value,n.disabled.value),e.onOptionAdd(c.value))}),rt(()=>{e.onOptionRemove(c.value)}),(l,i)=>(y(),_(a(N),O({id:a(n).textId,ref:a(s)},{...o,...l.$attrs}),{default:v(()=>[h(l.$slots,"default")]),_:3},16,["id"]))}}),Da=ka,xa=b({__name:"SelectPortal",props:{to:{type:null,required:!1},disabled:{type:Boolean,required:!1},defer:{type:Boolean,required:!1},forceMount:{type:Boolean,required:!1}},setup(t){const o=t;return(e,r)=>(y(),_(a(Re),de(pe(o)),{default:v(()=>[h(e.$slots,"default")]),_:3},16))}}),Aa=xa,Ia=b({__name:"SelectScrollButtonImpl",emits:["autoScroll"],setup(t,{emit:o}){const e=o,{getItems:r}=ce(),n=se(),s=q(null);function u(){s.value!==null&&(window.clearInterval(s.value),s.value=null)}ae(()=>{const i=r().map(d=>d.ref).find(d=>d===R());i==null||i.scrollIntoView({block:"nearest"})});function c(){s.value===null&&(s.value=window.setInterval(()=>{e("autoScroll")},50))}function l(){var i;(i=n.onItemLeave)==null||i.call(n),s.value===null&&(s.value=window.setInterval(()=>{e("autoScroll")},50))}return Yt(()=>u()),(i,d)=>{var p;return y(),_(a(N),O({"aria-hidden":"true",style:{flexShrink:0}},(p=i.$parent)==null?void 0:p.$props,{onPointerdown:c,onPointermove:l,onPointerleave:d[0]||(d[0]=()=>{u()})}),{default:v(()=>[h(i.$slots,"default")]),_:3},16)}}}),Ct=Ia,Ta=b({__name:"SelectScrollDownButton",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(t){const o=se(),e=o.position==="item-aligned"?Ue():void 0,{forwardRef:r,currentElement:n}=F(),s=q(!1);return ae(u=>{var c,l;if((c=o.viewport)!=null&&c.value&&((l=o.isPositioned)!=null&&l.value)){let d=function(){const p=i.scrollHeight-i.clientHeight;s.value=Math.ceil(i.scrollTop)i.removeEventListener("scroll",d))}}),re(n,()=>{n.value&&(e==null||e.onScrollButtonChange(n.value))}),(u,c)=>s.value?(y(),_(Ct,{key:0,ref:a(r),onAutoScroll:c[0]||(c[0]=()=>{const{viewport:l,selectedItem:i}=a(o);l!=null&&l.value&&(i!=null&&i.value)&&(l.value.scrollTop=l.value.scrollTop+i.value.offsetHeight)})},{default:v(()=>[h(u.$slots,"default")]),_:3},512)):ne("v-if",!0)}}),Fa=Ta,$a=b({__name:"SelectScrollUpButton",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(t){const o=se(),e=o.position==="item-aligned"?Ue():void 0,{forwardRef:r,currentElement:n}=F(),s=q(!1);return ae(u=>{var c,l;if((c=o.viewport)!=null&&c.value&&((l=o.isPositioned)!=null&&l.value)){let d=function(){s.value=i.scrollTop>0};const i=o.viewport.value;d(),i.addEventListener("scroll",d),u(()=>i.removeEventListener("scroll",d))}}),re(n,()=>{n.value&&(e==null||e.onScrollButtonChange(n.value))}),(u,c)=>s.value?(y(),_(Ct,{key:0,ref:a(r),onAutoScroll:c[0]||(c[0]=()=>{const{viewport:l,selectedItem:i}=a(o);l!=null&&l.value&&(i!=null&&i.value)&&(l.value.scrollTop=l.value.scrollTop-i.value.offsetHeight)})},{default:v(()=>[h(u.$slots,"default")]),_:3},512)):ne("v-if",!0)}}),Na=$a,Ma=b({__name:"SelectTrigger",props:{disabled:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"button"}},setup(t){const o=t,e=Z(),{forwardRef:r,currentElement:n}=F(),s=z(()=>{var f;return((f=e.disabled)==null?void 0:f.value)||o.disabled});e.contentId||(e.contentId=ie(void 0,"reka-select-content")),W(()=>{e.onTriggerChange(n.value)});const{getItems:u}=ce(),{search:c,handleTypeaheadSearch:l,resetTypeahead:i}=ct();function d(){s.value||(e.onOpenChange(!0),i())}function p(f){d(),e.triggerPointerDownPosRef.value={x:Math.round(f.pageX),y:Math.round(f.pageY)}}return(f,g)=>(y(),_(a(dt),{"as-child":"",reference:f.reference},{default:v(()=>{var B,E,P,I;return[x(a(N),{ref:a(r),role:"combobox",type:f.as==="button"?"button":void 0,"aria-controls":a(e).contentId,"aria-expanded":a(e).open.value||!1,"aria-required":(B=a(e).required)==null?void 0:B.value,"aria-autocomplete":"none",disabled:s.value,dir:(E=a(e))==null?void 0:E.dir.value,"data-state":(P=a(e))!=null&&P.open.value?"open":"closed","data-disabled":s.value?"":void 0,"data-placeholder":a(aa)((I=a(e).modelValue)==null?void 0:I.value)?"":void 0,"as-child":f.asChild,as:f.as,onClick:g[0]||(g[0]=S=>{var k;(k=S==null?void 0:S.currentTarget)==null||k.focus()}),onPointerdown:g[1]||(g[1]=S=>{if(S.pointerType==="touch")return S.preventDefault();const k=S.target;k.hasPointerCapture(S.pointerId)&&k.releasePointerCapture(S.pointerId),S.button===0&&S.ctrlKey===!1&&(p(S),S.preventDefault())}),onPointerup:g[2]||(g[2]=oe(S=>{S.pointerType==="touch"&&p(S)},["prevent"])),onKeydown:g[3]||(g[3]=S=>{const k=a(c)!=="";!(S.ctrlKey||S.altKey||S.metaKey)&&S.key.length===1&&k&&S.key===" "||(a(l)(S.key,a(u)()),a(ta).includes(S.key)&&(d(),S.preventDefault()))})},{default:v(()=>[h(f.$slots,"default")]),_:3},8,["type","aria-controls","aria-expanded","aria-required","disabled","dir","data-state","data-disabled","data-placeholder","as-child","as"])]}),_:3},8,["reference"]))}}),Ra=Ma,za=b({__name:"SelectValue",props:{placeholder:{type:String,required:!1,default:""},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"span"}},setup(t){const o=t,{forwardRef:e,currentElement:r}=F(),n=Z();W(()=>{n.valueElement=r});const s=z(()=>{var d;let c=[];const l=Array.from(n.optionsSet.value),i=p=>l.find(f=>ve(p,f.value,n.by));return Array.isArray(n.modelValue.value)?c=n.modelValue.value.map(p=>{var f;return((f=i(p))==null?void 0:f.textContent)??""}):c=[((d=i(n.modelValue.value))==null?void 0:d.textContent)??""],c.filter(Boolean)}),u=z(()=>s.value.length?s.value.join(", "):o.placeholder);return(c,l)=>(y(),_(a(N),{ref:a(e),as:c.as,"as-child":c.asChild,style:{pointerEvents:"none"},"data-placeholder":s.value.length?void 0:o.placeholder},{default:v(()=>[h(c.$slots,"default",{selectedLabel:s.value,modelValue:a(n).modelValue.value},()=>[Le(Gt(u.value),1)])]),_:3},8,["as","as-child","data-placeholder"]))}}),La=za,Va=b({__name:"SelectViewport",props:{nonce:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(t){const o=t,{nonce:e}=ye(o),r=zo(e),n=se(),s=n.position==="item-aligned"?Ue():void 0,{forwardRef:u,currentElement:c}=F();W(()=>{n==null||n.onViewportChange(c.value)});const l=q(0);function i(d){const p=d.currentTarget,{shouldExpandOnScrollRef:f,contentWrapper:g}=s??{};if(f!=null&&f.value&&(g!=null&&g.value)){const B=Math.abs(l.value-p.scrollTop);if(B>0){const E=window.innerHeight-V*2,P=Number.parseFloat(g.value.style.minHeight),I=Number.parseFloat(g.value.style.height),S=Math.max(P,I);if(S0?C:0,g.value.style.justifyContent="flex-end")}}}l.value=p.scrollTop}return(d,p)=>(y(),j(pt,null,[x(a(N),O({ref:a(u),"data-reka-select-viewport":"",role:"presentation"},{...d.$attrs,...o},{style:{position:"relative",flex:1,overflow:"hidden auto"},onScroll:i}),{default:v(()=>[h(d.$slots,"default")]),_:3},16),x(a(N),{as:"style",nonce:a(r)},{default:v(()=>p[0]||(p[0]=[Le(" /* Hide scrollbars cross-browser and enable momentum scroll for touch devices */ [data-reka-select-viewport] { scrollbar-width:none; -ms-overflow-style: none; -webkit-overflow-scrolling: touch; } [data-reka-select-viewport]::-webkit-scrollbar { display: none; } ")])),_:1,__:[0]},8,["nonce"])],64))}}),Ka=Va;const sn=Xt("config",()=>{var p,f,g,B,E,P,I,S,k;const t=((p=window.Nimbus)==null?void 0:p.apiBaseUrl)||"http://localhost",o=((f=window.Nimbus)==null?void 0:f.isVersioned)||!1,e=((g=window.Nimbus)==null?void 0:g.basePath)||"",r=(B=window.Nimbus)!=null&&B.headers?JSON.parse(window.Nimbus.headers):[],n=(E=window.Nimbus)!=null&&E.currentUser?JSON.parse(window.Nimbus.currentUser):null,s=(P=window.Nimbus)!=null&&P.applications?JSON.parse(window.Nimbus.applications):{},u=((I=window.Nimbus)==null?void 0:I.activeApplication)||null,c=((S=window.Nimbus)==null?void 0:S.primaryProcessorName)||vt.AutoDetect,l=((k=window.Nimbus)==null?void 0:k.showOperationId)||!1,i=n!==null,d=(n==null?void 0:n.id)??null;return{apiUrl:t,appBasePath:e,headers:r,isVersioned:o,isLoggedIn:i,userId:d,applications:s,activeApplication:u,primaryProcessorName:c,showOperationId:l}});/** +import{G as Tt,h as z,bx as Ft,g as q,by as nt,i as re,bz as $e,bA as Ge,k as $t,q as te,Z as ae,z as rt,bB as st,d as b,u as qe,t as ye,c as ue,r as h,e as a,a as F,b as _,o as y,w as v,m as O,P as N,bC as Nt,N as R,ay as Mt,f as ie,j as W,l as x,K as Ne,S as Me,p as Ce,n as ne,C as de,D as pe,T as Re,H as lt,aw as Y,aq as K,L as it,O as H,Q as oe,aX as ut,F as dt,bD as Rt,bE as Xe,v as ce,s as zt,a4 as Lt,$ as j,a2 as pt,aB as Vt,a0 as ze,bF as Kt,J as ct,W as Ht,V as Ut,bG as jt,a1 as Le,bH as Wt,aN as Yt,av as Gt,a8 as Xt,a9 as me,a6 as ge,a7 as M,ap as ft}from"./app-9y4VsaPU.js";var vt=(t=>(t.OpenAPI="OpenAPI Specification",t.AutoDetect="Laravel Routes",t))(vt||{});function Je(t,o=Number.NEGATIVE_INFINITY,e=Number.POSITIVE_INFINITY){return Math.min(e,Math.max(o,t))}function ke(t){if(t===null||typeof t!="object")return!1;const o=Object.getPrototypeOf(t);return o!==null&&o!==Object.prototype&&Object.getPrototypeOf(o)!==null||Symbol.iterator in t?!1:Symbol.toStringTag in t?Object.prototype.toString.call(t)==="[object Module]":!0}function Te(t,o,e=".",r){if(!ke(o))return Te(t,{},e,r);const n=Object.assign({},o);for(const s in t){if(s==="__proto__"||s==="constructor")continue;const u=t[s];u!=null&&(r&&r(n,s,u,e)||(Array.isArray(u)&&Array.isArray(n[s])?n[s]=[...u,...n[s]]:ke(u)&&ke(n[s])?n[s]=Te(u,n[s],(e?`${e}.`:"")+s.toString(),r):n[s]=u))}return n}function Jt(t){return(...o)=>o.reduce((e,r)=>Te(e,r,"",t),{})}const Zt=Jt(),Qt=Tt(()=>{const t=q(new Map),o=q(),e=z(()=>{for(const u of t.value.values())if(u)return!0;return!1}),r=nt({scrollBody:q(!0)});let n=null;const s=()=>{document.body.style.paddingRight="",document.body.style.marginRight="",document.body.style.pointerEvents="",document.documentElement.style.removeProperty("--scrollbar-width"),document.body.style.overflow=o.value??"",Ge&&(n==null||n()),o.value=void 0};return re(e,(u,c)=>{var p;if(!$e)return;if(!u){c&&s();return}o.value===void 0&&(o.value=document.body.style.overflow);const l=window.innerWidth-document.documentElement.clientWidth,i={padding:l,margin:0},d=(p=r.scrollBody)!=null&&p.value?typeof r.scrollBody.value=="object"?Zt({padding:r.scrollBody.value.padding===!0?l:r.scrollBody.value.padding,margin:r.scrollBody.value.margin===!0?l:r.scrollBody.value.margin},i):i:{padding:0,margin:0};l>0&&(document.body.style.paddingRight=typeof d.padding=="number"?`${d.padding}px`:String(d.padding),document.body.style.marginRight=typeof d.margin=="number"?`${d.margin}px`:String(d.margin),document.documentElement.style.setProperty("--scrollbar-width",`${l}px`),document.body.style.overflow="hidden"),Ge&&(n=$t(document,"touchmove",f=>eo(f),{passive:!1})),te(()=>{document.body.style.pointerEvents="none",document.body.style.overflow="hidden"})},{immediate:!0,flush:"sync"}),t});function Ve(t){const o=Math.random().toString(36).substring(2,7),e=Qt();e.value.set(o,t??!1);const r=z({get:()=>e.value.get(o)??!1,set:n=>e.value.set(o,n)});return Ft(()=>{e.value.delete(o)}),r}function yt(t){const o=window.getComputedStyle(t);if(o.overflowX==="scroll"||o.overflowY==="scroll"||o.overflowX==="auto"&&t.clientWidth1?!0:(o.preventDefault&&o.cancelable&&o.preventDefault(),!1)}let De=0;function mt(){ae(t=>{if(!$e)return;const o=document.querySelectorAll("[data-reka-focus-guard]");document.body.insertAdjacentElement("afterbegin",o[0]??Ze()),document.body.insertAdjacentElement("beforeend",o[1]??Ze()),De++,t(()=>{De===1&&document.querySelectorAll("[data-reka-focus-guard]").forEach(e=>e.remove()),De--})})}function Ze(){const t=document.createElement("span");return t.setAttribute("data-reka-focus-guard",""),t.tabIndex=0,t.style.outline="none",t.style.opacity="0",t.style.position="fixed",t.style.pointerEvents="none",t}var to=function(t){if(typeof document>"u")return null;var o=Array.isArray(t)?t[0]:t;return o.ownerDocument.body},le=new WeakMap,we=new WeakMap,Se={},xe=0,gt=function(t){return t&&(t.host||gt(t.parentNode))},oo=function(t,o){return o.map(function(e){if(t.contains(e))return e;var r=gt(e);return r&&t.contains(r)?r:(console.error("aria-hidden",e,"in not contained inside",t,". Doing nothing"),null)}).filter(function(e){return!!e})},ao=function(t,o,e,r){var n=oo(o,Array.isArray(t)?t:[t]);Se[e]||(Se[e]=new WeakMap);var s=Se[e],u=[],c=new Set,l=new Set(n),i=function(p){!p||c.has(p)||(c.add(p),i(p.parentNode))};n.forEach(i);var d=function(p){!p||l.has(p)||Array.prototype.forEach.call(p.children,function(f){if(c.has(f))d(f);else try{var g=f.getAttribute(r),B=g!==null&&g!=="false",E=(le.get(f)||0)+1,P=(s.get(f)||0)+1;le.set(f,E),s.set(f,P),u.push(f),E===1&&B&&we.set(f,!0),P===1&&f.setAttribute(e,"true"),B||f.setAttribute(r,"true")}catch(I){console.error("aria-hidden: cannot operate on ",f,I)}})};return d(o),c.clear(),xe++,function(){u.forEach(function(p){var f=le.get(p)-1,g=s.get(p)-1;le.set(p,f),s.set(p,g),f||(we.has(p)||p.removeAttribute(r),we.delete(p)),g||p.removeAttribute(e)}),xe--,xe||(le=new WeakMap,le=new WeakMap,we=new WeakMap,Se={})}},no=function(t,o,e){e===void 0&&(e="data-aria-hidden");var r=Array.from(Array.isArray(t)?t:[t]),n=to(t);return n?(r.push.apply(r,Array.from(n.querySelectorAll("[aria-live], script"))),ao(r,n,e,"aria-hidden")):function(){return null}};function Ke(t){let o;re(()=>st(t),e=>{e?o=no(e):o&&o()}),rt(()=>{o&&o()})}const[G,ro]=ue("DialogRoot");var so=b({inheritAttrs:!1,__name:"DialogRoot",props:{open:{type:Boolean,required:!1,default:void 0},defaultOpen:{type:Boolean,required:!1,default:!1},modal:{type:Boolean,required:!1,default:!0}},emits:["update:open"],setup(t,{emit:o}){const e=t,n=qe(e,"open",o,{defaultValue:e.defaultOpen,passive:e.open===void 0}),s=q(),u=q(),{modal:c}=ye(e);return ro({open:n,modal:c,openModal:()=>{n.value=!0},onOpenChange:l=>{n.value=l},onOpenToggle:()=>{n.value=!n.value},contentId:"",titleId:"",descriptionId:"",triggerElement:s,contentElement:u}),(l,i)=>h(l.$slots,"default",{open:a(n),close:()=>n.value=!1})}}),lo=so,io=b({__name:"DialogClose",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"button"}},setup(t){const o=t;F();const e=G();return(r,n)=>(y(),_(a(N),O(o,{type:r.as==="button"?"button":void 0,onClick:n[0]||(n[0]=s=>a(e).onOpenChange(!1))}),{default:v(()=>[h(r.$slots,"default")]),_:3},16,["type"]))}}),uo=io;const po=Nt(()=>q([]));function co(){const t=po();return{add(o){const e=t.value[0];o!==e&&(e==null||e.pause()),t.value=Qe(t.value,o),t.value.unshift(o)},remove(o){var e;t.value=Qe(t.value,o),(e=t.value[0])==null||e.resume()}}}function Qe(t,o){const e=[...t],r=e.indexOf(o);return r!==-1&&e.splice(r,1),e}function fo(t){return t.filter(o=>o.tagName!=="A")}const Ae="focusScope.autoFocusOnMount",Ie="focusScope.autoFocusOnUnmount",et={bubbles:!1,cancelable:!0};function vo(t,{select:o=!1}={}){const e=R();for(const r of t)if(J(r,{select:o}),R()!==e)return!0}function yo(t){const o=_t(t),e=tt(o,t),r=tt(o.reverse(),t);return[e,r]}function _t(t){const o=[],e=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const n=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||n?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;e.nextNode();)o.push(e.currentNode);return o}function tt(t,o){for(const e of t)if(!mo(e,{upTo:o}))return e}function mo(t,{upTo:o}){if(getComputedStyle(t).visibility==="hidden")return!0;for(;t;){if(o!==void 0&&t===o)return!1;if(getComputedStyle(t).display==="none")return!0;t=t.parentElement}return!1}function go(t){return t instanceof HTMLInputElement&&"select"in t}function J(t,{select:o=!1}={}){if(t&&t.focus){const e=R();t.focus({preventScroll:!0}),t!==e&&go(t)&&o&&t.select()}}var _o=b({__name:"FocusScope",props:{loop:{type:Boolean,required:!1,default:!1},trapped:{type:Boolean,required:!1,default:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["mountAutoFocus","unmountAutoFocus"],setup(t,{emit:o}){const e=t,r=o,{currentRef:n,currentElement:s}=F(),u=q(null),c=co(),l=Mt({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}});ae(d=>{if(!$e)return;const p=s.value;if(!e.trapped)return;function f(P){if(l.paused||!p)return;const I=P.target;p.contains(I)?u.value=I:J(u.value,{select:!0})}function g(P){if(l.paused||!p)return;const I=P.relatedTarget;I!==null&&(p.contains(I)||J(u.value,{select:!0}))}function B(P){p.contains(u.value)||J(p)}document.addEventListener("focusin",f),document.addEventListener("focusout",g);const E=new MutationObserver(B);p&&E.observe(p,{childList:!0,subtree:!0}),d(()=>{document.removeEventListener("focusin",f),document.removeEventListener("focusout",g),E.disconnect()})}),ae(async d=>{const p=s.value;if(await te(),!p)return;c.add(l);const f=R();if(!p.contains(f)){const B=new CustomEvent(Ae,et);p.addEventListener(Ae,E=>r("mountAutoFocus",E)),p.dispatchEvent(B),B.defaultPrevented||(vo(fo(_t(p)),{select:!0}),R()===f&&J(p))}d(()=>{p.removeEventListener(Ae,P=>r("mountAutoFocus",P));const B=new CustomEvent(Ie,et),E=P=>{r("unmountAutoFocus",P)};p.addEventListener(Ie,E),p.dispatchEvent(B),setTimeout(()=>{B.defaultPrevented||J(f??document.body,{select:!0}),p.removeEventListener(Ie,E),c.remove(l)},0)})});function i(d){if(!e.loop&&!e.trapped||l.paused)return;const p=d.key==="Tab"&&!d.altKey&&!d.ctrlKey&&!d.metaKey,f=R();if(p&&f){const g=d.currentTarget,[B,E]=yo(g);B&&E?!d.shiftKey&&f===E?(d.preventDefault(),e.loop&&J(B,{select:!0})):d.shiftKey&&f===B&&(d.preventDefault(),e.loop&&J(E,{select:!0})):f===g&&d.preventDefault()}}return(d,p)=>(y(),_(a(N),{ref_key:"currentRef",ref:n,tabindex:"-1","as-child":d.asChild,as:d.as,onKeydown:i},{default:v(()=>[h(d.$slots,"default")]),_:3},8,["as-child","as"]))}}),He=_o;const on="menu.itemSelect",ot=["Enter"," "],ho=["ArrowDown","PageUp","Home"],bo=["ArrowUp","PageDown","End"],an=[...ho,...bo];[...ot],[...ot];function wo(t){return t?"open":"closed"}function at(t){const o=R();for(const e of t)if(e===o||(e.focus(),R()!==o))return}function So(t,o){const{x:e,y:r}=t;let n=!1;for(let s=0,u=o.length-1;sr!=d>r&&e<(i-c)*(r-l)/(d-l)+c&&(n=!n)}return n}function nn(t,o){if(!o)return!1;const e={x:t.clientX,y:t.clientY};return So(e,o)}function rn(t){return t.pointerType==="mouse"}var qo=b({__name:"DialogContentImpl",props:{forceMount:{type:Boolean,required:!1},trapFocus:{type:Boolean,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","openAutoFocus","closeAutoFocus"],setup(t,{emit:o}){const e=t,r=o,n=G(),{forwardRef:s,currentElement:u}=F();return n.titleId||(n.titleId=ie(void 0,"reka-dialog-title")),n.descriptionId||(n.descriptionId=ie(void 0,"reka-dialog-description")),W(()=>{n.contentElement=u,R()!==document.body&&(n.triggerElement.value=R())}),(c,l)=>(y(),_(a(He),{"as-child":"",loop:"",trapped:e.trapFocus,onMountAutoFocus:l[5]||(l[5]=i=>r("openAutoFocus",i)),onUnmountAutoFocus:l[6]||(l[6]=i=>r("closeAutoFocus",i))},{default:v(()=>[x(a(Ne),O({id:a(n).contentId,ref:a(s),as:c.as,"as-child":c.asChild,"disable-outside-pointer-events":c.disableOutsidePointerEvents,role:"dialog","aria-describedby":a(n).descriptionId,"aria-labelledby":a(n).titleId,"data-state":a(wo)(a(n).open.value)},c.$attrs,{onDismiss:l[0]||(l[0]=i=>a(n).onOpenChange(!1)),onEscapeKeyDown:l[1]||(l[1]=i=>r("escapeKeyDown",i)),onFocusOutside:l[2]||(l[2]=i=>r("focusOutside",i)),onInteractOutside:l[3]||(l[3]=i=>r("interactOutside",i)),onPointerDownOutside:l[4]||(l[4]=i=>r("pointerDownOutside",i))}),{default:v(()=>[h(c.$slots,"default")]),_:3},16,["id","as","as-child","disable-outside-pointer-events","aria-describedby","aria-labelledby","data-state"])]),_:3},8,["trapped"]))}}),ht=qo,Co=b({__name:"DialogContentModal",props:{forceMount:{type:Boolean,required:!1},trapFocus:{type:Boolean,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","openAutoFocus","closeAutoFocus"],setup(t,{emit:o}){const e=t,r=o,n=G(),s=Me(r),{forwardRef:u,currentElement:c}=F();return Ke(c),(l,i)=>(y(),_(ht,O({...e,...a(s)},{ref:a(u),"trap-focus":a(n).open.value,"disable-outside-pointer-events":!0,onCloseAutoFocus:i[0]||(i[0]=d=>{var p;d.defaultPrevented||(d.preventDefault(),(p=a(n).triggerElement.value)==null||p.focus())}),onPointerDownOutside:i[1]||(i[1]=d=>{const p=d.detail.originalEvent,f=p.button===0&&p.ctrlKey===!0;(p.button===2||f)&&d.preventDefault()}),onFocusOutside:i[2]||(i[2]=d=>{d.preventDefault()})}),{default:v(()=>[h(l.$slots,"default")]),_:3},16,["trap-focus"]))}}),Bo=Co,Po=b({__name:"DialogContentNonModal",props:{forceMount:{type:Boolean,required:!1},trapFocus:{type:Boolean,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","openAutoFocus","closeAutoFocus"],setup(t,{emit:o}){const e=t,n=Me(o);F();const s=G(),u=q(!1),c=q(!1);return(l,i)=>(y(),_(ht,O({...e,...a(n)},{"trap-focus":!1,"disable-outside-pointer-events":!1,onCloseAutoFocus:i[0]||(i[0]=d=>{var p;d.defaultPrevented||(u.value||(p=a(s).triggerElement.value)==null||p.focus(),d.preventDefault()),u.value=!1,c.value=!1}),onInteractOutside:i[1]||(i[1]=d=>{var g;d.defaultPrevented||(u.value=!0,d.detail.originalEvent.type==="pointerdown"&&(c.value=!0));const p=d.target;((g=a(s).triggerElement.value)==null?void 0:g.contains(p))&&d.preventDefault(),d.detail.originalEvent.type==="focusin"&&c.value&&d.preventDefault()})}),{default:v(()=>[h(l.$slots,"default")]),_:3},16))}}),Oo=Po,Eo=b({__name:"DialogContent",props:{forceMount:{type:Boolean,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","openAutoFocus","closeAutoFocus"],setup(t,{emit:o}){const e=t,r=o,n=G(),s=Me(r),{forwardRef:u}=F();return(c,l)=>(y(),_(a(Ce),{present:c.forceMount||a(n).open.value},{default:v(()=>[a(n).modal.value?(y(),_(Bo,O({key:0,ref:a(u)},{...e,...a(s),...c.$attrs}),{default:v(()=>[h(c.$slots,"default")]),_:3},16)):(y(),_(Oo,O({key:1,ref:a(u)},{...e,...a(s),...c.$attrs}),{default:v(()=>[h(c.$slots,"default")]),_:3},16))]),_:3},8,["present"]))}}),ko=Eo,Do=b({__name:"DialogDescription",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"p"}},setup(t){const o=t;F();const e=G();return(r,n)=>(y(),_(a(N),O(o,{id:a(e).descriptionId}),{default:v(()=>[h(r.$slots,"default")]),_:3},16,["id"]))}}),xo=Do,Ao=b({__name:"DialogOverlayImpl",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(t){const o=G();return Ve(!0),F(),(e,r)=>(y(),_(a(N),{as:e.as,"as-child":e.asChild,"data-state":a(o).open.value?"open":"closed",style:{"pointer-events":"auto"}},{default:v(()=>[h(e.$slots,"default")]),_:3},8,["as","as-child","data-state"]))}}),Io=Ao,To=b({__name:"DialogOverlay",props:{forceMount:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(t){const o=G(),{forwardRef:e}=F();return(r,n)=>{var s;return(s=a(o))!=null&&s.modal.value?(y(),_(a(Ce),{key:0,present:r.forceMount||a(o).open.value},{default:v(()=>[x(Io,O(r.$attrs,{ref:a(e),as:r.as,"as-child":r.asChild}),{default:v(()=>[h(r.$slots,"default")]),_:3},16,["as","as-child"])]),_:3},8,["present"])):ne("v-if",!0)}}}),Fo=To,$o=b({__name:"DialogPortal",props:{to:{type:null,required:!1},disabled:{type:Boolean,required:!1},defer:{type:Boolean,required:!1},forceMount:{type:Boolean,required:!1}},setup(t){const o=t;return(e,r)=>(y(),_(a(Re),de(pe(o)),{default:v(()=>[h(e.$slots,"default")]),_:3},16))}}),No=$o,Mo=b({__name:"DialogTitle",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"h2"}},setup(t){const o=t,e=G();return F(),(r,n)=>(y(),_(a(N),O(o,{id:a(e).titleId}),{default:v(()=>[h(r.$slots,"default")]),_:3},16,["id"]))}}),Ro=Mo;function zo(t){const o=nt({nonce:q()});return z(()=>{var e;return(t==null?void 0:t.value)||((e=o.nonce)==null?void 0:e.value)})}const[_e,Lo]=ue("PopoverRoot");var Vo=b({__name:"PopoverRoot",props:{defaultOpen:{type:Boolean,required:!1,default:!1},open:{type:Boolean,required:!1,default:void 0},modal:{type:Boolean,required:!1,default:!1}},emits:["update:open"],setup(t,{emit:o}){const e=t,r=o,{modal:n}=ye(e),s=qe(e,"open",r,{defaultValue:e.defaultOpen,passive:e.open===void 0}),u=q(),c=q(!1);return Lo({contentId:"",triggerId:"",modal:n,open:s,onOpenChange:l=>{s.value=l},onOpenToggle:()=>{s.value=!s.value},triggerElement:u,hasCustomAnchor:c}),(l,i)=>(y(),_(a(lt),null,{default:v(()=>[h(l.$slots,"default",{open:a(s),close:()=>s.value=!1})]),_:3}))}}),Ko=Vo,Ho=b({__name:"PopoverContentImpl",props:{trapFocus:{type:Boolean,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","openAutoFocus","closeAutoFocus"],setup(t,{emit:o}){const e=t,r=o,n=Y(K(e,"trapFocus","disableOutsidePointerEvents")),{forwardRef:s}=F(),u=_e();return mt(),(c,l)=>(y(),_(a(He),{"as-child":"",loop:"",trapped:c.trapFocus,onMountAutoFocus:l[5]||(l[5]=i=>r("openAutoFocus",i)),onUnmountAutoFocus:l[6]||(l[6]=i=>r("closeAutoFocus",i))},{default:v(()=>[x(a(Ne),{"as-child":"","disable-outside-pointer-events":c.disableOutsidePointerEvents,onPointerDownOutside:l[0]||(l[0]=i=>r("pointerDownOutside",i)),onInteractOutside:l[1]||(l[1]=i=>r("interactOutside",i)),onEscapeKeyDown:l[2]||(l[2]=i=>r("escapeKeyDown",i)),onFocusOutside:l[3]||(l[3]=i=>r("focusOutside",i)),onDismiss:l[4]||(l[4]=i=>a(u).onOpenChange(!1))},{default:v(()=>[x(a(it),O(a(n),{id:a(u).contentId,ref:a(s),"data-state":a(u).open.value?"open":"closed","aria-labelledby":a(u).triggerId,style:{"--reka-popover-content-transform-origin":"var(--reka-popper-transform-origin)","--reka-popover-content-available-width":"var(--reka-popper-available-width)","--reka-popover-content-available-height":"var(--reka-popper-available-height)","--reka-popover-trigger-width":"var(--reka-popper-anchor-width)","--reka-popover-trigger-height":"var(--reka-popper-anchor-height)"},role:"dialog"}),{default:v(()=>[h(c.$slots,"default")]),_:3},16,["id","data-state","aria-labelledby"])]),_:3},8,["disable-outside-pointer-events"])]),_:3},8,["trapped"]))}}),bt=Ho,Uo=b({__name:"PopoverContentModal",props:{side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","openAutoFocus","closeAutoFocus"],setup(t,{emit:o}){const e=t,r=o,n=_e(),s=q(!1);Ve(!0);const u=H(e,r),{forwardRef:c,currentElement:l}=F();return Ke(l),(i,d)=>(y(),_(bt,O(a(u),{ref:a(c),"trap-focus":a(n).open.value,"disable-outside-pointer-events":"",onCloseAutoFocus:d[0]||(d[0]=oe(p=>{var f;r("closeAutoFocus",p),s.value||(f=a(n).triggerElement.value)==null||f.focus()},["prevent"])),onPointerDownOutside:d[1]||(d[1]=p=>{r("pointerDownOutside",p);const f=p.detail.originalEvent,g=f.button===0&&f.ctrlKey===!0,B=f.button===2||g;s.value=B}),onFocusOutside:d[2]||(d[2]=oe(()=>{},["prevent"]))}),{default:v(()=>[h(i.$slots,"default")]),_:3},16,["trap-focus"]))}}),jo=Uo,Wo=b({__name:"PopoverContentNonModal",props:{side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","openAutoFocus","closeAutoFocus"],setup(t,{emit:o}){const e=t,r=o,n=_e(),s=q(!1),u=q(!1),c=H(e,r);return(l,i)=>(y(),_(bt,O(a(c),{"trap-focus":!1,"disable-outside-pointer-events":!1,onCloseAutoFocus:i[0]||(i[0]=d=>{var p;r("closeAutoFocus",d),d.defaultPrevented||(s.value||(p=a(n).triggerElement.value)==null||p.focus(),d.preventDefault()),s.value=!1,u.value=!1}),onInteractOutside:i[1]||(i[1]=async d=>{var g;r("interactOutside",d),d.defaultPrevented||(s.value=!0,d.detail.originalEvent.type==="pointerdown"&&(u.value=!0));const p=d.target;((g=a(n).triggerElement.value)==null?void 0:g.contains(p))&&d.preventDefault(),d.detail.originalEvent.type==="focusin"&&u.value&&d.preventDefault()})}),{default:v(()=>[h(l.$slots,"default")]),_:3},16))}}),Yo=Wo,Go=b({__name:"PopoverContent",props:{forceMount:{type:Boolean,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","openAutoFocus","closeAutoFocus"],setup(t,{emit:o}){const e=t,r=o,n=_e(),s=H(e,r),{forwardRef:u}=F();return n.contentId||(n.contentId=ie(void 0,"reka-popover-content")),(c,l)=>(y(),_(a(Ce),{present:c.forceMount||a(n).open.value},{default:v(()=>[a(n).modal.value?(y(),_(jo,O({key:0},a(s),{ref:a(u)}),{default:v(()=>[h(c.$slots,"default")]),_:3},16)):(y(),_(Yo,O({key:1},a(s),{ref:a(u)}),{default:v(()=>[h(c.$slots,"default")]),_:3},16))]),_:3},8,["present"]))}}),Xo=Go,Jo=b({__name:"PopoverPortal",props:{to:{type:null,required:!1},disabled:{type:Boolean,required:!1},defer:{type:Boolean,required:!1},forceMount:{type:Boolean,required:!1}},setup(t){const o=t;return(e,r)=>(y(),_(a(Re),de(pe(o)),{default:v(()=>[h(e.$slots,"default")]),_:3},16))}}),Zo=Jo,Qo=b({__name:"PopoverTrigger",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"button"}},setup(t){const o=t,e=_e(),{forwardRef:r,currentElement:n}=F();return e.triggerId||(e.triggerId=ie(void 0,"reka-popover-trigger")),W(()=>{e.triggerElement.value=n.value}),(s,u)=>(y(),_(ut(a(e).hasCustomAnchor.value?a(N):a(dt)),{"as-child":""},{default:v(()=>[x(a(N),{id:a(e).triggerId,ref:a(r),type:s.as==="button"?"button":void 0,"aria-haspopup":"dialog","aria-expanded":a(e).open.value,"aria-controls":a(e).contentId,"data-state":a(e).open.value?"open":"closed",as:s.as,"as-child":o.asChild,onClick:a(e).onOpenToggle},{default:v(()=>[h(s.$slots,"default")]),_:3},8,["id","type","aria-expanded","aria-controls","data-state","as","as-child","onClick"])]),_:3}))}}),ea=Qo;const ta=[" ","Enter","ArrowUp","ArrowDown"],oa=[" ","Enter"],V=10;function ve(t,o,e){return t===void 0?!1:Array.isArray(t)?t.some(r=>Fe(r,o,e)):Fe(t,o,e)}function Fe(t,o,e){return t===void 0||o===void 0?!1:typeof t=="string"?t===o:typeof e=="function"?e(t,o):typeof e=="string"?(t==null?void 0:t[e])===(o==null?void 0:o[e]):Rt(t,o)}function aa(t){return t==null||t===""||Array.isArray(t)&&t.length===0}const na={key:0,value:""},[Z,wt]=ue("SelectRoot");var ra=b({inheritAttrs:!1,__name:"SelectRoot",props:{open:{type:Boolean,required:!1,default:void 0},defaultOpen:{type:Boolean,required:!1},defaultValue:{type:null,required:!1},modelValue:{type:null,required:!1,default:void 0},by:{type:[String,Function],required:!1},dir:{type:String,required:!1},multiple:{type:Boolean,required:!1},autocomplete:{type:String,required:!1},disabled:{type:Boolean,required:!1},name:{type:String,required:!1},required:{type:Boolean,required:!1}},emits:["update:modelValue","update:open"],setup(t,{emit:o}){const e=t,r=o,{required:n,disabled:s,multiple:u,dir:c}=ye(e),l=qe(e,"modelValue",r,{defaultValue:e.defaultValue??(u.value?[]:void 0),passive:e.modelValue===void 0,deep:!0}),i=qe(e,"open",r,{defaultValue:e.defaultOpen,passive:e.open===void 0}),d=q(),p=q(),f=q({x:0,y:0}),g=z(()=>{var m;return u.value&&Array.isArray(l.value)?((m=l.value)==null?void 0:m.length)===0:Xe(l.value)});ce({isProvider:!0});const B=zt(c),E=Lt(d),P=q(new Set),I=z(()=>Array.from(P.value).map(m=>m.value).join(";"));function S(m){if(u.value){const C=Array.isArray(l.value)?[...l.value]:[],w=C.findIndex(D=>Fe(D,m,e.by));w===-1?C.push(m):C.splice(w,1),l.value=[...C]}else l.value=m}function k(m){return Array.from(P.value).find(C=>ve(m,C.value,e.by))}return wt({triggerElement:d,onTriggerChange:m=>{d.value=m},valueElement:p,onValueElementChange:m=>{p.value=m},contentId:"",modelValue:l,onValueChange:S,by:e.by,open:i,multiple:u,required:n,onOpenChange:m=>{i.value=m},dir:B,triggerPointerDownPosRef:f,disabled:s,isEmptyModelValue:g,optionsSet:P,onOptionAdd:m=>{const C=k(m.value);C&&P.value.delete(C),P.value.add(m)},onOptionRemove:m=>{const C=k(m.value);C&&P.value.delete(C)}}),(m,C)=>(y(),_(a(lt),null,{default:v(()=>[h(m.$slots,"default",{modelValue:a(l),open:a(i)}),a(E)?(y(),_(ia,{key:I.value,"aria-hidden":"true",tabindex:"-1",multiple:a(u),required:a(n),name:m.name,autocomplete:m.autocomplete,disabled:a(s),value:a(l)},{default:v(()=>[a(Xe)(a(l))?(y(),j("option",na)):ne("v-if",!0),(y(!0),j(pt,null,Vt(Array.from(P.value),w=>(y(),j("option",O({key:w.value??""},{ref_for:!0},w),null,16))),128))]),_:1},8,["multiple","required","name","autocomplete","disabled","value"])):ne("v-if",!0)]),_:3}))}}),sa=ra,la=b({__name:"BubbleSelect",props:{autocomplete:{type:String,required:!1},autofocus:{type:Boolean,required:!1},disabled:{type:Boolean,required:!1},form:{type:String,required:!1},multiple:{type:Boolean,required:!1},name:{type:String,required:!1},required:{type:Boolean,required:!1},size:{type:Number,required:!1},value:{type:null,required:!1}},setup(t){const o=t,e=q(),r=Z();re(()=>o.value,(s,u)=>{const c=window.HTMLSelectElement.prototype,i=Object.getOwnPropertyDescriptor(c,"value").set;if(s!==u&&i&&e.value){const d=new Event("change",{bubbles:!0});i.call(e.value,s),e.value.dispatchEvent(d)}});function n(s){r.onValueChange(s.target.value)}return(s,u)=>(y(),_(a(Kt),{"as-child":""},{default:v(()=>[ze("select",O({ref_key:"selectElement",ref:e},o,{onInput:n}),[h(s.$slots,"default")],16)]),_:3}))}}),ia=la,ua=b({__name:"SelectPopperPosition",props:{side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1,default:"start"},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1,default:V},arrowPadding:{type:Number,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(t){const e=Y(t);return(r,n)=>(y(),_(a(it),O(a(e),{style:{boxSizing:"border-box","--reka-select-content-transform-origin":"var(--reka-popper-transform-origin)","--reka-select-content-available-width":"var(--reka-popper-available-width)","--reka-select-content-available-height":"var(--reka-popper-available-height)","--reka-select-trigger-width":"var(--reka-popper-anchor-width)","--reka-select-trigger-height":"var(--reka-popper-anchor-height)"}}),{default:v(()=>[h(r.$slots,"default")]),_:3},16))}}),da=ua;const pa={onViewportChange:()=>{},itemTextRefCallback:()=>{},itemRefCallback:()=>{}},[se,St]=ue("SelectContent");var ca=b({__name:"SelectContentImpl",props:{position:{type:String,required:!1,default:"item-aligned"},bodyLock:{type:Boolean,required:!1,default:!0},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1,default:"start"},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1,default:!0}},emits:["closeAutoFocus","escapeKeyDown","pointerDownOutside"],setup(t,{emit:o}){const e=t,r=o,n=Z();mt(),Ve(e.bodyLock);const{CollectionSlot:s,getItems:u}=ce(),c=q();Ke(c);const{search:l,handleTypeaheadSearch:i}=ct(),d=q(),p=q(),f=q(),g=q(!1),B=q(!1),E=q(!1);function P(){p.value&&c.value&&at([p.value,c.value])}re(g,()=>{P()});const{onOpenChange:I,triggerPointerDownPosRef:S}=n;ae(w=>{if(!c.value)return;let D={x:0,y:0};const T=$=>{var L,fe;D={x:Math.abs(Math.round($.pageX)-(((L=S.value)==null?void 0:L.x)??0)),y:Math.abs(Math.round($.pageY)-(((fe=S.value)==null?void 0:fe.y)??0))}},A=$=>{var L;$.pointerType!=="touch"&&(D.x<=10&&D.y<=10?$.preventDefault():(L=c.value)!=null&&L.contains($.target)||I(!1),document.removeEventListener("pointermove",T),S.value=null)};S.value!==null&&(document.addEventListener("pointermove",T),document.addEventListener("pointerup",A,{capture:!0,once:!0})),w(()=>{document.removeEventListener("pointermove",T),document.removeEventListener("pointerup",A,{capture:!0})})});function k(w){const D=w.ctrlKey||w.altKey||w.metaKey;if(w.key==="Tab"&&w.preventDefault(),!D&&w.key.length===1&&i(w.key,u()),["ArrowUp","ArrowDown","Home","End"].includes(w.key)){let A=[...u().map($=>$.ref)];if(["ArrowUp","End"].includes(w.key)&&(A=A.slice().reverse()),["ArrowUp","ArrowDown"].includes(w.key)){const $=w.target,L=A.indexOf($);A=A.slice(L+1)}setTimeout(()=>at(A)),w.preventDefault()}}const m=z(()=>e.position==="popper"?e:{}),C=Y(m.value);return St({content:c,viewport:d,onViewportChange:w=>{d.value=w},itemRefCallback:(w,D,T)=>{const A=!B.value&&!T,$=ve(n.modelValue.value,D,n.by);if(n.multiple.value){if(E.value)return;($||A)&&(p.value=w,$&&(E.value=!0))}else($||A)&&(p.value=w);A&&(B.value=!0)},selectedItem:p,selectedItemText:f,onItemLeave:()=>{var w;(w=c.value)==null||w.focus()},itemTextRefCallback:(w,D,T)=>{const A=!B.value&&!T;(ve(n.modelValue.value,D,n.by)||A)&&(f.value=w)},focusSelectedItem:P,position:e.position,isPositioned:g,searchRef:l}),(w,D)=>(y(),_(a(s),null,{default:v(()=>[x(a(He),{"as-child":"",onMountAutoFocus:D[6]||(D[6]=oe(()=>{},["prevent"])),onUnmountAutoFocus:D[7]||(D[7]=T=>{var A;r("closeAutoFocus",T),!T.defaultPrevented&&((A=a(n).triggerElement.value)==null||A.focus({preventScroll:!0}),T.preventDefault())})},{default:v(()=>[x(a(Ne),{"as-child":"","disable-outside-pointer-events":w.disableOutsidePointerEvents,onFocusOutside:D[2]||(D[2]=oe(()=>{},["prevent"])),onDismiss:D[3]||(D[3]=T=>a(n).onOpenChange(!1)),onEscapeKeyDown:D[4]||(D[4]=T=>r("escapeKeyDown",T)),onPointerDownOutside:D[5]||(D[5]=T=>r("pointerDownOutside",T))},{default:v(()=>[(y(),_(ut(w.position==="popper"?da:ma),O({...w.$attrs,...a(C)},{id:a(n).contentId,ref:T=>{const A=a(st)(T);A!=null&&A.hasAttribute("data-reka-popper-content-wrapper")?c.value=A.firstElementChild:c.value=A},role:"listbox","data-state":a(n).open.value?"open":"closed",dir:a(n).dir.value,style:{display:"flex",flexDirection:"column",outline:"none"},onContextmenu:D[0]||(D[0]=oe(()=>{},["prevent"])),onPlaced:D[1]||(D[1]=T=>g.value=!0),onKeydown:k}),{default:v(()=>[h(w.$slots,"default")]),_:3},16,["id","data-state","dir","onKeydown"]))]),_:3},8,["disable-outside-pointer-events"])]),_:3})]),_:3}))}}),fa=ca;const[Ue,va]=ue("SelectItemAlignedPosition");var ya=b({inheritAttrs:!1,__name:"SelectItemAlignedPosition",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["placed"],setup(t,{emit:o}){const e=t,r=o,{getItems:n}=ce(),s=Z(),u=se(),c=q(!1),l=q(!0),i=q(),{forwardRef:d,currentElement:p}=F(),{viewport:f,selectedItem:g,selectedItemText:B,focusSelectedItem:E}=u;function P(){if(s.triggerElement.value&&s.valueElement.value&&i.value&&p.value&&(f!=null&&f.value)&&(g!=null&&g.value)&&(B!=null&&B.value)){const k=s.triggerElement.value.getBoundingClientRect(),m=p.value.getBoundingClientRect(),C=s.valueElement.value.getBoundingClientRect(),w=B.value.getBoundingClientRect();if(s.dir.value!=="rtl"){const U=w.left-m.left,X=C.left-U,Q=k.left-X,ee=k.width+Q,Pe=Math.max(ee,m.width),Oe=window.innerWidth-V,Ee=Je(X,V,Math.max(V,Oe-Pe));i.value.style.minWidth=`${ee}px`,i.value.style.left=`${Ee}px`}else{const U=m.right-w.right,X=window.innerWidth-C.right-U,Q=window.innerWidth-k.right-X,ee=k.width+Q,Pe=Math.max(ee,m.width),Oe=window.innerWidth-V,Ee=Je(X,V,Math.max(V,Oe-Pe));i.value.style.minWidth=`${ee}px`,i.value.style.right=`${Ee}px`}const D=n().map(U=>U.ref),T=window.innerHeight-V*2,A=f.value.scrollHeight,$=window.getComputedStyle(p.value),L=Number.parseInt($.borderTopWidth,10),fe=Number.parseInt($.paddingTop,10),je=Number.parseInt($.borderBottomWidth,10),Ot=Number.parseInt($.paddingBottom,10),We=L+fe+A+Ot+je,Et=Math.min(g.value.offsetHeight*5,We),Ye=window.getComputedStyle(f.value),kt=Number.parseInt(Ye.paddingTop,10),Dt=Number.parseInt(Ye.paddingBottom,10),he=k.top+k.height/2-V,xt=T-he,Be=g.value.offsetHeight/2,At=g.value.offsetTop+Be,be=L+fe+At,It=We-be;if(be<=he){const U=g.value===D[D.length-1];i.value.style.bottom="0px";const X=p.value.clientHeight-f.value.offsetTop-f.value.offsetHeight,Q=Math.max(xt,Be+(U?Dt:0)+X+je),ee=be+Q;i.value.style.height=`${ee}px`}else{const U=g.value===D[0];i.value.style.top="0px";const Q=Math.max(he,L+f.value.offsetTop+(U?kt:0)+Be)+It;i.value.style.height=`${Q}px`,f.value.scrollTop=be-he+f.value.offsetTop}i.value.style.margin=`${V}px 0`,i.value.style.minHeight=`${Et}px`,i.value.style.maxHeight=`${T}px`,r("placed"),requestAnimationFrame(()=>c.value=!0)}}const I=q("");W(async()=>{await te(),P(),p.value&&(I.value=window.getComputedStyle(p.value).zIndex)});function S(k){k&&l.value===!0&&(P(),E==null||E(),l.value=!1)}return Ht(s.triggerElement,()=>{P()}),va({contentWrapper:i,shouldExpandOnScrollRef:c,onScrollButtonChange:S}),(k,m)=>(y(),j("div",{ref_key:"contentWrapperElement",ref:i,style:Ut({display:"flex",flexDirection:"column",position:"fixed",zIndex:I.value})},[x(a(N),O({ref:a(d),style:{boxSizing:"border-box",maxHeight:"100%"}},{...k.$attrs,...e}),{default:v(()=>[h(k.$slots,"default")]),_:3},16)],4))}}),ma=ya,ga=b({inheritAttrs:!1,__name:"SelectProvider",props:{context:{type:Object,required:!0}},setup(t){return wt(t.context),St(pa),(e,r)=>h(e.$slots,"default")}}),_a=ga;const ha={key:1};var ba=b({inheritAttrs:!1,__name:"SelectContent",props:{forceMount:{type:Boolean,required:!1},position:{type:String,required:!1},bodyLock:{type:Boolean,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1}},emits:["closeAutoFocus","escapeKeyDown","pointerDownOutside"],setup(t,{emit:o}){const e=t,n=H(e,o),s=Z(),u=q();W(()=>{u.value=new DocumentFragment});const c=q(),l=z(()=>e.forceMount||s.open.value),i=q(l.value);return re(l,()=>{setTimeout(()=>i.value=l.value)}),(d,p)=>{var f;return l.value||i.value||(f=c.value)!=null&&f.present?(y(),_(a(Ce),{key:0,ref_key:"presenceRef",ref:c,present:l.value},{default:v(()=>[x(fa,de(pe({...a(n),...d.$attrs})),{default:v(()=>[h(d.$slots,"default")]),_:3},16)]),_:3},8,["present"])):u.value?(y(),j("div",ha,[(y(),_(jt,{to:u.value},[x(_a,{context:a(s)},{default:v(()=>[h(d.$slots,"default")]),_:3},8,["context"])],8,["to"]))])):ne("v-if",!0)}}}),wa=ba,Sa=b({__name:"SelectIcon",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"span"}},setup(t){return(o,e)=>(y(),_(a(N),{"aria-hidden":"true",as:o.as,"as-child":o.asChild},{default:v(()=>[h(o.$slots,"default",{},()=>[e[0]||(e[0]=Le("▼"))])]),_:3},8,["as","as-child"]))}}),qa=Sa;const[qt,Ca]=ue("SelectItem");var Ba=b({__name:"SelectItem",props:{value:{type:null,required:!0},disabled:{type:Boolean,required:!1},textValue:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["select"],setup(t,{emit:o}){const e=t,r=o,{disabled:n}=ye(e),s=Z(),u=se(),{forwardRef:c,currentElement:l}=F(),{CollectionItem:i}=ce(),d=z(()=>{var m;return ve((m=s.modelValue)==null?void 0:m.value,e.value,s.by)}),p=q(!1),f=q(e.textValue??""),g=ie(void 0,"reka-select-item-text"),B="select.select";async function E(m){if(m.defaultPrevented)return;const C={originalEvent:m,value:e.value};Wt(B,P,C)}async function P(m){await te(),r("select",m),!m.defaultPrevented&&(n.value||(s.onValueChange(e.value),s.multiple.value||s.onOpenChange(!1)))}async function I(m){var C,w;await te(),!m.defaultPrevented&&(n.value?(C=u.onItemLeave)==null||C.call(u):(w=m.currentTarget)==null||w.focus({preventScroll:!0}))}async function S(m){var C;await te(),!m.defaultPrevented&&m.currentTarget===R()&&((C=u.onItemLeave)==null||C.call(u))}async function k(m){var w;await te(),!(m.defaultPrevented||((w=u.searchRef)==null?void 0:w.value)!==""&&m.key===" ")&&(oa.includes(m.key)&&E(m),m.key===" "&&m.preventDefault())}if(e.value==="")throw new Error("A must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return W(()=>{l.value&&u.itemRefCallback(l.value,e.value,e.disabled)}),Ca({value:e.value,disabled:n,textId:g,isSelected:d,onItemTextChange:m=>{f.value=((f.value||(m==null?void 0:m.textContent))??"").trim()}}),(m,C)=>(y(),_(a(i),{value:{textValue:f.value}},{default:v(()=>[x(a(N),{ref:a(c),role:"option","aria-labelledby":a(g),"data-highlighted":p.value?"":void 0,"aria-selected":d.value,"data-state":d.value?"checked":"unchecked","aria-disabled":a(n)||void 0,"data-disabled":a(n)?"":void 0,tabindex:a(n)?void 0:-1,as:m.as,"as-child":m.asChild,onFocus:C[0]||(C[0]=w=>p.value=!0),onBlur:C[1]||(C[1]=w=>p.value=!1),onPointerup:E,onPointerdown:C[2]||(C[2]=w=>{w.currentTarget.focus({preventScroll:!0})}),onTouchend:C[3]||(C[3]=oe(()=>{},["prevent","stop"])),onPointermove:I,onPointerleave:S,onKeydown:k},{default:v(()=>[h(m.$slots,"default")]),_:3},8,["aria-labelledby","data-highlighted","aria-selected","data-state","aria-disabled","data-disabled","tabindex","as","as-child"])]),_:3},8,["value"]))}}),Pa=Ba,Oa=b({__name:"SelectItemIndicator",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"span"}},setup(t){const o=t,e=qt();return(r,n)=>a(e).isSelected.value?(y(),_(a(N),O({key:0,"aria-hidden":"true"},o),{default:v(()=>[h(r.$slots,"default")]),_:3},16)):ne("v-if",!0)}}),Ea=Oa,ka=b({inheritAttrs:!1,__name:"SelectItemText",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"span"}},setup(t){const o=t,e=Z(),r=se(),n=qt(),{forwardRef:s,currentElement:u}=F(),c=z(()=>{var l,i;return{value:n.value,disabled:n.disabled.value,textContent:((l=u.value)==null?void 0:l.textContent)??((i=n.value)==null?void 0:i.toString())??""}});return W(()=>{u.value&&(n.onItemTextChange(u.value),r.itemTextRefCallback(u.value,n.value,n.disabled.value),e.onOptionAdd(c.value))}),rt(()=>{e.onOptionRemove(c.value)}),(l,i)=>(y(),_(a(N),O({id:a(n).textId,ref:a(s)},{...o,...l.$attrs}),{default:v(()=>[h(l.$slots,"default")]),_:3},16,["id"]))}}),Da=ka,xa=b({__name:"SelectPortal",props:{to:{type:null,required:!1},disabled:{type:Boolean,required:!1},defer:{type:Boolean,required:!1},forceMount:{type:Boolean,required:!1}},setup(t){const o=t;return(e,r)=>(y(),_(a(Re),de(pe(o)),{default:v(()=>[h(e.$slots,"default")]),_:3},16))}}),Aa=xa,Ia=b({__name:"SelectScrollButtonImpl",emits:["autoScroll"],setup(t,{emit:o}){const e=o,{getItems:r}=ce(),n=se(),s=q(null);function u(){s.value!==null&&(window.clearInterval(s.value),s.value=null)}ae(()=>{const i=r().map(d=>d.ref).find(d=>d===R());i==null||i.scrollIntoView({block:"nearest"})});function c(){s.value===null&&(s.value=window.setInterval(()=>{e("autoScroll")},50))}function l(){var i;(i=n.onItemLeave)==null||i.call(n),s.value===null&&(s.value=window.setInterval(()=>{e("autoScroll")},50))}return Yt(()=>u()),(i,d)=>{var p;return y(),_(a(N),O({"aria-hidden":"true",style:{flexShrink:0}},(p=i.$parent)==null?void 0:p.$props,{onPointerdown:c,onPointermove:l,onPointerleave:d[0]||(d[0]=()=>{u()})}),{default:v(()=>[h(i.$slots,"default")]),_:3},16)}}}),Ct=Ia,Ta=b({__name:"SelectScrollDownButton",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(t){const o=se(),e=o.position==="item-aligned"?Ue():void 0,{forwardRef:r,currentElement:n}=F(),s=q(!1);return ae(u=>{var c,l;if((c=o.viewport)!=null&&c.value&&((l=o.isPositioned)!=null&&l.value)){let d=function(){const p=i.scrollHeight-i.clientHeight;s.value=Math.ceil(i.scrollTop)i.removeEventListener("scroll",d))}}),re(n,()=>{n.value&&(e==null||e.onScrollButtonChange(n.value))}),(u,c)=>s.value?(y(),_(Ct,{key:0,ref:a(r),onAutoScroll:c[0]||(c[0]=()=>{const{viewport:l,selectedItem:i}=a(o);l!=null&&l.value&&(i!=null&&i.value)&&(l.value.scrollTop=l.value.scrollTop+i.value.offsetHeight)})},{default:v(()=>[h(u.$slots,"default")]),_:3},512)):ne("v-if",!0)}}),Fa=Ta,$a=b({__name:"SelectScrollUpButton",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(t){const o=se(),e=o.position==="item-aligned"?Ue():void 0,{forwardRef:r,currentElement:n}=F(),s=q(!1);return ae(u=>{var c,l;if((c=o.viewport)!=null&&c.value&&((l=o.isPositioned)!=null&&l.value)){let d=function(){s.value=i.scrollTop>0};const i=o.viewport.value;d(),i.addEventListener("scroll",d),u(()=>i.removeEventListener("scroll",d))}}),re(n,()=>{n.value&&(e==null||e.onScrollButtonChange(n.value))}),(u,c)=>s.value?(y(),_(Ct,{key:0,ref:a(r),onAutoScroll:c[0]||(c[0]=()=>{const{viewport:l,selectedItem:i}=a(o);l!=null&&l.value&&(i!=null&&i.value)&&(l.value.scrollTop=l.value.scrollTop-i.value.offsetHeight)})},{default:v(()=>[h(u.$slots,"default")]),_:3},512)):ne("v-if",!0)}}),Na=$a,Ma=b({__name:"SelectTrigger",props:{disabled:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"button"}},setup(t){const o=t,e=Z(),{forwardRef:r,currentElement:n}=F(),s=z(()=>{var f;return((f=e.disabled)==null?void 0:f.value)||o.disabled});e.contentId||(e.contentId=ie(void 0,"reka-select-content")),W(()=>{e.onTriggerChange(n.value)});const{getItems:u}=ce(),{search:c,handleTypeaheadSearch:l,resetTypeahead:i}=ct();function d(){s.value||(e.onOpenChange(!0),i())}function p(f){d(),e.triggerPointerDownPosRef.value={x:Math.round(f.pageX),y:Math.round(f.pageY)}}return(f,g)=>(y(),_(a(dt),{"as-child":"",reference:f.reference},{default:v(()=>{var B,E,P,I;return[x(a(N),{ref:a(r),role:"combobox",type:f.as==="button"?"button":void 0,"aria-controls":a(e).contentId,"aria-expanded":a(e).open.value||!1,"aria-required":(B=a(e).required)==null?void 0:B.value,"aria-autocomplete":"none",disabled:s.value,dir:(E=a(e))==null?void 0:E.dir.value,"data-state":(P=a(e))!=null&&P.open.value?"open":"closed","data-disabled":s.value?"":void 0,"data-placeholder":a(aa)((I=a(e).modelValue)==null?void 0:I.value)?"":void 0,"as-child":f.asChild,as:f.as,onClick:g[0]||(g[0]=S=>{var k;(k=S==null?void 0:S.currentTarget)==null||k.focus()}),onPointerdown:g[1]||(g[1]=S=>{if(S.pointerType==="touch")return S.preventDefault();const k=S.target;k.hasPointerCapture(S.pointerId)&&k.releasePointerCapture(S.pointerId),S.button===0&&S.ctrlKey===!1&&(p(S),S.preventDefault())}),onPointerup:g[2]||(g[2]=oe(S=>{S.pointerType==="touch"&&p(S)},["prevent"])),onKeydown:g[3]||(g[3]=S=>{const k=a(c)!=="";!(S.ctrlKey||S.altKey||S.metaKey)&&S.key.length===1&&k&&S.key===" "||(a(l)(S.key,a(u)()),a(ta).includes(S.key)&&(d(),S.preventDefault()))})},{default:v(()=>[h(f.$slots,"default")]),_:3},8,["type","aria-controls","aria-expanded","aria-required","disabled","dir","data-state","data-disabled","data-placeholder","as-child","as"])]}),_:3},8,["reference"]))}}),Ra=Ma,za=b({__name:"SelectValue",props:{placeholder:{type:String,required:!1,default:""},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"span"}},setup(t){const o=t,{forwardRef:e,currentElement:r}=F(),n=Z();W(()=>{n.valueElement=r});const s=z(()=>{var d;let c=[];const l=Array.from(n.optionsSet.value),i=p=>l.find(f=>ve(p,f.value,n.by));return Array.isArray(n.modelValue.value)?c=n.modelValue.value.map(p=>{var f;return((f=i(p))==null?void 0:f.textContent)??""}):c=[((d=i(n.modelValue.value))==null?void 0:d.textContent)??""],c.filter(Boolean)}),u=z(()=>s.value.length?s.value.join(", "):o.placeholder);return(c,l)=>(y(),_(a(N),{ref:a(e),as:c.as,"as-child":c.asChild,style:{pointerEvents:"none"},"data-placeholder":s.value.length?void 0:o.placeholder},{default:v(()=>[h(c.$slots,"default",{selectedLabel:s.value,modelValue:a(n).modelValue.value},()=>[Le(Gt(u.value),1)])]),_:3},8,["as","as-child","data-placeholder"]))}}),La=za,Va=b({__name:"SelectViewport",props:{nonce:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(t){const o=t,{nonce:e}=ye(o),r=zo(e),n=se(),s=n.position==="item-aligned"?Ue():void 0,{forwardRef:u,currentElement:c}=F();W(()=>{n==null||n.onViewportChange(c.value)});const l=q(0);function i(d){const p=d.currentTarget,{shouldExpandOnScrollRef:f,contentWrapper:g}=s??{};if(f!=null&&f.value&&(g!=null&&g.value)){const B=Math.abs(l.value-p.scrollTop);if(B>0){const E=window.innerHeight-V*2,P=Number.parseFloat(g.value.style.minHeight),I=Number.parseFloat(g.value.style.height),S=Math.max(P,I);if(S0?C:0,g.value.style.justifyContent="flex-end")}}}l.value=p.scrollTop}return(d,p)=>(y(),j(pt,null,[x(a(N),O({ref:a(u),"data-reka-select-viewport":"",role:"presentation"},{...d.$attrs,...o},{style:{position:"relative",flex:1,overflow:"hidden auto"},onScroll:i}),{default:v(()=>[h(d.$slots,"default")]),_:3},16),x(a(N),{as:"style",nonce:a(r)},{default:v(()=>p[0]||(p[0]=[Le(" /* Hide scrollbars cross-browser and enable momentum scroll for touch devices */ [data-reka-select-viewport] { scrollbar-width:none; -ms-overflow-style: none; -webkit-overflow-scrolling: touch; } [data-reka-select-viewport]::-webkit-scrollbar { display: none; } ")])),_:1,__:[0]},8,["nonce"])],64))}}),Ka=Va;const sn=Xt("config",()=>{var p,f,g,B,E,P,I,S,k;const t=((p=window.Nimbus)==null?void 0:p.apiBaseUrl)||"http://localhost",o=((f=window.Nimbus)==null?void 0:f.isVersioned)||!1,e=((g=window.Nimbus)==null?void 0:g.basePath)||"",r=(B=window.Nimbus)!=null&&B.headers?JSON.parse(window.Nimbus.headers):[],n=(E=window.Nimbus)!=null&&E.currentUser?JSON.parse(window.Nimbus.currentUser):null,s=(P=window.Nimbus)!=null&&P.applications?JSON.parse(window.Nimbus.applications):{},u=((I=window.Nimbus)==null?void 0:I.activeApplication)||null,c=((S=window.Nimbus)==null?void 0:S.primaryProcessorName)||vt.AutoDetect,l=((k=window.Nimbus)==null?void 0:k.showOperationId)||!1,i=n!==null,d=(n==null?void 0:n.id)??null;return{apiUrl:t,appBasePath:e,headers:r,isVersioned:o,isLoggedIn:i,userId:d,applications:s,activeApplication:u,primaryProcessorName:c,showOperationId:l}});/** * @license lucide-vue-next v0.475.0 - ISC * * This source code is licensed under the ISC license. diff --git a/resources/dist/assets/Main-BHI4Qeo7.js b/resources/dist/assets/Main-ChqJeGTY.js similarity index 67% rename from resources/dist/assets/Main-BHI4Qeo7.js rename to resources/dist/assets/Main-ChqJeGTY.js index 5918097..e4d743e 100644 --- a/resources/dist/assets/Main-BHI4Qeo7.js +++ b/resources/dist/assets/Main-ChqJeGTY.js @@ -1,194 +1,194 @@ -var cI=Object.defineProperty;var fI=(t,e,n)=>e in t?cI(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var X=(t,e,n)=>fI(t,typeof e!="symbol"?e+"":e,n);import{d as z,u as wa,t as cr,c as Ir,a as Ye,b as L,o as T,w as O,r as Q,e as v,P as lt,f as Wi,g as Z,h as q,i as at,j as gn,k as q1,l as k,m as Ce,n as we,p as Yl,q as kr,s as Jl,v as Hy,x as $C,E as dI,y as hI,z as wo,A as pI,B as mI,C as Yn,D as Pr,F as gI,G as bI,H as yI,I as vI,J as xI,K as SI,L as EI,M as wI,N as _I,O as Yr,Q as eo,T as CI,R as _l,S as AI,U as qy,V as _a,W as co,X as Gy,Y as DI,Z as aa,_ as zC,$ as K,a0 as M,a1 as ne,a2 as Qe,a3 as kI,a4 as OI,a5 as TI,a6 as Se,a7 as ke,a8 as Ca,a9 as nt,aa as kc,ab as II,ac as PI,ad as RI,ae as Or,af as O0,ag as Ax,ah as NI,ai as MI,aj as Je,ak as Wy,al as T0,am as la,an as FI,ao as LI,ap as jC,aq as Aa,ar as BI,as as $I,at as zI,au as jI,av as de,aw as I0,ax as VI,ay as VC,az as UI,aA as Ky,aB as _n,aC as fo,aD as Xy,aE as Da,aF as Ki,aG as Dx,aH as ig,aI as _o,aJ as sg,aK as og,aL as Yy,aM as HI,aN as qI,aO as GI,aP as UC,aQ as Sh,aR as Cl,aS as HC,aT as Al,aU as qC,aV as kx,aW as WI,aX as KI,aY as pd,aZ as XI,a_ as ac,a$ as ms,b0 as on,b1 as md,b2 as Jy,b3 as YI,b4 as GC,b5 as to,b6 as JI,b7 as WC,b8 as ZI,b9 as qs,ba as KC,bb as Ox,bc as QI,bd as eP,be as tP,bf as nP,bg as rP,bh as P0,bi as iP,bj as sP,bk as oP,bl as XC,bm as YC,bn as G1,bo as ap,bp as aP,bq as lP,br as uP,bs as cP,bt as fP,bu as dP}from"./app-C6VkUBdm.js";import{i as hP,u as pP,a as mP,g as gP,F as bP,b as yP,c as vP,L as xP,f as SP,d as W1,S as EP,I as wP,e as _P,h as CP,j as JC,k as Xi,D as AP,_ as gt,l as Zl,m as Ql,n as eu,o as Es,p as tu,q as Zy,r as Cf,s as Af,t as Df,v as kf,w as R0,x as nu,y as Qy,C as ZC,z as QC,A as DP,B as kP,E as OP,X as TP}from"./AppPopoverTrigger.vue_vue_type_script_setup_true_lang-CvMdocUs.js";/* empty css */var jt=(t=>(t.Object="object",t.Array="array",t.String="string",t.Constant="constant",t.Uninitialized="uninitialized",t.Number="number",t.Closure="closure",t.Unknown="unknown",t))(jt||{}),Eh=(t=>(t.Uuid="UUID",t.Email="Email",t.String="String",t))(Eh||{});const ag={DELETION_CONFIRMATION_TIMEOUT:1200,SYNC_DEBOUNCE_DELAY:300},Of=typeof document<"u",IP=["INPUT","TEXTAREA"];function PP(t,e,n,r={}){if(!e||r.enableIgnoredElement&&IP.includes(e.nodeName))return null;const{arrowKeyOptions:i="both",attributeName:s="[data-reka-collection-item]",itemsArray:o=[],loop:a=!0,dir:l="ltr",preventScroll:u=!0,focus:c=!1}=r,[f,d,h,p,m,g]=[t.key==="ArrowRight",t.key==="ArrowLeft",t.key==="ArrowUp",t.key==="ArrowDown",t.key==="Home",t.key==="End"],b=h||p,y=f||d;if(!m&&!g&&(!b&&!y||i==="vertical"&&y||i==="horizontal"&&b))return null;const x=n?Array.from(n.querySelectorAll(s)):o;if(!x.length)return null;u&&t.preventDefault();let S=null;return y||b?S=eA(x,e,{goForward:b?p:l==="ltr"?f:d,loop:a}):m?S=x.at(0)||null:g&&(S=x.at(-1)||null),c&&(S==null||S.focus()),S}function eA(t,e,n,r=t.length){if(--r===0)return null;const i=t.indexOf(e),s=n.goForward?i+1:i-1;if(!n.loop&&(s<0||s>=t.length))return null;const o=(s+t.length)%t.length,a=t[o];return a?a.hasAttribute("disabled")&&a.getAttribute("disabled")!=="false"?eA(t,a,n,r):a:null}const[tA,RP]=Ir("CollapsibleRoot");var NP=z({__name:"CollapsibleRoot",props:{defaultOpen:{type:Boolean,required:!1,default:!1},open:{type:Boolean,required:!1,default:void 0},disabled:{type:Boolean,required:!1},unmountOnHide:{type:Boolean,required:!1,default:!0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["update:open"],setup(t,{expose:e,emit:n}){const r=t,s=wa(r,"open",n,{defaultValue:r.defaultOpen,passive:r.open===void 0}),{disabled:o,unmountOnHide:a}=cr(r);return RP({contentId:"",disabled:o,open:s,unmountOnHide:a,onOpenToggle:()=>{o.value||(s.value=!s.value)}}),e({open:s}),Ye(),(l,u)=>(T(),L(v(lt),{as:l.as,"as-child":r.asChild,"data-state":v(s)?"open":"closed","data-disabled":v(o)?"":void 0},{default:O(()=>[Q(l.$slots,"default",{open:v(s)})]),_:3},8,["as","as-child","data-state","data-disabled"]))}}),MP=NP,FP=z({inheritAttrs:!1,__name:"CollapsibleContent",props:{forceMount:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["contentFound"],setup(t,{emit:e}){const n=t,r=e,i=tA();i.contentId||(i.contentId=Wi(void 0,"reka-collapsible-content"));const s=Z(),{forwardRef:o,currentElement:a}=Ye(),l=Z(0),u=Z(0),c=q(()=>i.open.value),f=Z(c.value),d=Z();at(()=>{var p;return[c.value,(p=s.value)==null?void 0:p.present]},async()=>{await kr();const p=a.value;if(!p)return;d.value=d.value||{transitionDuration:p.style.transitionDuration,animationName:p.style.animationName},p.style.transitionDuration="0s",p.style.animationName="none";const m=p.getBoundingClientRect();u.value=m.height,l.value=m.width,f.value||(p.style.transitionDuration=d.value.transitionDuration,p.style.animationName=d.value.animationName)},{immediate:!0});const h=q(()=>f.value&&i.open.value);return gn(()=>{requestAnimationFrame(()=>{f.value=!1})}),q1(a,"beforematch",p=>{requestAnimationFrame(()=>{i.onOpenToggle(),r("contentFound")})}),(p,m)=>(T(),L(v(Yl),{ref_key:"presentRef",ref:s,present:p.forceMount||v(i).open.value,"force-mount":!0},{default:O(({present:g})=>{var b;return[k(v(lt),Ce(p.$attrs,{id:v(i).contentId,ref:v(o),"as-child":n.asChild,as:p.as,hidden:g?void 0:v(i).unmountOnHide.value?"":"until-found","data-state":h.value?void 0:v(i).open.value?"open":"closed","data-disabled":(b=v(i).disabled)!=null&&b.value?"":void 0,style:{"--reka-collapsible-content-height":`${u.value}px`,"--reka-collapsible-content-width":`${l.value}px`}}),{default:O(()=>[!v(i).unmountOnHide.value||g?Q(p.$slots,"default",{key:0}):we("v-if",!0)]),_:2},1040,["id","as-child","as","hidden","data-state","data-disabled","style"])]}),_:3},8,["present"]))}}),LP=FP,BP=z({__name:"CollapsibleTrigger",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"button"}},setup(t){const e=t;Ye();const n=tA();return(r,i)=>{var s,o;return T(),L(v(lt),{type:r.as==="button"?"button":void 0,as:r.as,"as-child":e.asChild,"aria-controls":v(n).contentId,"aria-expanded":v(n).open.value,"data-state":v(n).open.value?"open":"closed","data-disabled":(s=v(n).disabled)!=null&&s.value?"":void 0,disabled:(o=v(n).disabled)==null?void 0:o.value,onClick:v(n).onOpenToggle},{default:O(()=>[Q(r.$slots,"default")]),_:3},8,["type","as","as-child","aria-controls","aria-expanded","data-state","data-disabled","disabled","onClick"])}}}),$P=BP,zP=z({__name:"DialogTrigger",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"button"}},setup(t){const e=t,n=hP(),{forwardRef:r,currentElement:i}=Ye();return n.contentId||(n.contentId=Wi(void 0,"reka-dialog-content")),gn(()=>{n.triggerElement.value=i.value}),(s,o)=>(T(),L(v(lt),Ce(e,{ref:v(r),type:s.as==="button"?"button":void 0,"aria-haspopup":"dialog","aria-expanded":v(n).open.value||!1,"aria-controls":v(n).open.value?v(n).contentId:void 0,"data-state":v(n).open.value?"open":"closed",onClick:v(n).onOpenToggle}),{default:O(()=>[Q(s.$slots,"default")]),_:3},16,["type","aria-expanded","aria-controls","data-state","onClick"]))}}),jP=zP;const[VP,UP]=Ir("RovingFocusGroup");var HP=z({__name:"RovingFocusGroup",props:{orientation:{type:String,required:!1,default:void 0},dir:{type:String,required:!1},loop:{type:Boolean,required:!1,default:!1},currentTabStopId:{type:[String,null],required:!1},defaultCurrentTabStopId:{type:String,required:!1},preventScrollOnEntryFocus:{type:Boolean,required:!1,default:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["entryFocus","update:currentTabStopId"],setup(t,{expose:e,emit:n}){const r=t,i=n,{loop:s,orientation:o,dir:a}=cr(r),l=Jl(a),u=wa(r,"currentTabStopId",i,{defaultValue:r.defaultCurrentTabStopId,passive:r.currentTabStopId===void 0}),c=Z(!1),f=Z(!1),d=Z(0),{getItems:h,CollectionSlot:p}=Hy({isProvider:!0});function m(b){const y=!f.value;if(b.currentTarget&&b.target===b.currentTarget&&y&&!c.value){const x=new CustomEvent(dI,hI);if(b.currentTarget.dispatchEvent(x),i("entryFocus",x),!x.defaultPrevented){const S=h().map(_=>_.ref).filter(_=>_.dataset.disabled!==""),E=S.find(_=>_.getAttribute("data-active")===""),C=S.find(_=>_.getAttribute("data-highlighted")===""),w=S.find(_=>_.id===u.value),A=[E,C,w,...S].filter(Boolean);$C(A,r.preventScrollOnEntryFocus)}}f.value=!1}function g(){setTimeout(()=>{f.value=!1},1)}return e({getItems:h}),UP({loop:s,dir:l,orientation:o,currentTabStopId:u,onItemFocus:b=>{u.value=b},onItemShiftTab:()=>{c.value=!0},onFocusableItemAdd:()=>{d.value++},onFocusableItemRemove:()=>{d.value--}}),(b,y)=>(T(),L(v(p),null,{default:O(()=>[k(v(lt),{tabindex:c.value||d.value===0?-1:0,"data-orientation":v(o),as:b.as,"as-child":b.asChild,dir:v(l),style:{outline:"none"},onMousedown:y[0]||(y[0]=x=>f.value=!0),onMouseup:g,onFocus:m,onBlur:y[1]||(y[1]=x=>c.value=!1)},{default:O(()=>[Q(b.$slots,"default")]),_:3},8,["tabindex","data-orientation","as","as-child","dir"])]),_:3}))}}),nA=HP,qP=z({__name:"RovingFocusItem",props:{tabStopId:{type:String,required:!1},focusable:{type:Boolean,required:!1,default:!0},active:{type:Boolean,required:!1},allowShiftKey:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"span"}},setup(t){const e=t,n=VP(),r=Wi(),i=q(()=>e.tabStopId||r),s=q(()=>n.currentTabStopId.value===i.value),{getItems:o,CollectionItem:a}=Hy();gn(()=>{e.focusable&&n.onFocusableItemAdd()}),wo(()=>{e.focusable&&n.onFocusableItemRemove()});function l(u){if(u.key==="Tab"&&u.shiftKey){n.onItemShiftTab();return}if(u.target!==u.currentTarget)return;const c=pI(u,n.orientation.value,n.dir.value);if(c!==void 0){if(u.metaKey||u.ctrlKey||u.altKey||!e.allowShiftKey&&u.shiftKey)return;u.preventDefault();let f=[...o().map(d=>d.ref).filter(d=>d.dataset.disabled!=="")];if(c==="last")f.reverse();else if(c==="prev"||c==="next"){c==="prev"&&f.reverse();const d=f.indexOf(u.currentTarget);f=n.loop.value?mI(f,d+1):f.slice(d+1)}kr(()=>$C(f))}}return(u,c)=>(T(),L(v(a),null,{default:O(()=>[k(v(lt),{tabindex:s.value?0:-1,"data-orientation":v(n).orientation.value,"data-active":u.active?"":void 0,"data-disabled":u.focusable?void 0:"",as:u.as,"as-child":u.asChild,onMousedown:c[0]||(c[0]=f=>{u.focusable?v(n).onItemFocus(i.value):f.preventDefault()}),onFocus:c[1]||(c[1]=f=>v(n).onItemFocus(i.value)),onKeydown:l},{default:O(()=>[Q(u.$slots,"default")]),_:3},8,["tabindex","data-orientation","data-active","data-disabled","as","as-child"])]),_:3}))}}),GP=qP,WP=z({__name:"MenuAnchor",props:{reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(t){const e=t;return(n,r)=>(T(),L(v(gI),Yn(Pr(e)),{default:O(()=>[Q(n.$slots,"default")]),_:3},16))}}),KP=WP;function XP(){const t=Z(!1);return gn(()=>{q1("keydown",()=>{t.value=!0},{capture:!0,passive:!0}),q1(["pointerdown","pointermove"],()=>{t.value=!1},{capture:!0,passive:!0})}),t}const YP=bI(XP),[N0,JP]=Ir(["MenuRoot","MenuSub"],"MenuContext"),[ev,ZP]=Ir("MenuRoot");var QP=z({__name:"MenuRoot",props:{open:{type:Boolean,required:!1,default:!1},dir:{type:String,required:!1},modal:{type:Boolean,required:!1,default:!0}},emits:["update:open"],setup(t,{emit:e}){const n=t,r=e,{modal:i,dir:s}=cr(n),o=Jl(s),a=wa(n,"open",r),l=Z(),u=YP();return JP({open:a,onOpenChange:c=>{a.value=c},content:l,onContentChange:c=>{l.value=c}}),ZP({onClose:()=>{a.value=!1},isUsingKeyboardRef:u,dir:o,modal:i}),(c,f)=>(T(),L(v(yI),null,{default:O(()=>[Q(c.$slots,"default")]),_:3}))}}),e5=QP;const[rA,t5]=Ir("MenuContent");var n5=z({__name:"MenuContentImpl",props:vI({loop:{type:Boolean,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1},disableOutsideScroll:{type:Boolean,required:!1},trapFocus:{type:Boolean,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},{...wI}),emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","entryFocus","openAutoFocus","closeAutoFocus","dismiss"],setup(t,{emit:e}){const n=t,r=e,i=N0(),s=ev(),{trapFocus:o,disableOutsidePointerEvents:a,loop:l}=cr(n);pP(),mP(a.value);const u=Z(""),c=Z(0),f=Z(0),d=Z(null),h=Z("right"),p=Z(0),m=Z(null),g=Z(),{forwardRef:b,currentElement:y}=Ye(),{handleTypeaheadSearch:x}=xI();at(y,_=>{i.onContentChange(_)}),wo(()=>{window.clearTimeout(c.value)});function S(_){var I,N;return h.value===((I=d.value)==null?void 0:I.side)&&yP(_,(N=d.value)==null?void 0:N.area)}async function E(_){var D;r("openAutoFocus",_),!_.defaultPrevented&&(_.preventDefault(),(D=y.value)==null||D.focus({preventScroll:!0}))}function C(_){var B;if(_.defaultPrevented)return;const I=_.target.closest("[data-reka-menu-content]")===_.currentTarget,N=_.ctrlKey||_.altKey||_.metaKey,P=_.key.length===1,R=PP(_,_I(),y.value,{loop:l.value,arrowKeyOptions:"vertical",dir:s==null?void 0:s.dir.value,focus:!0,attributeName:"[data-reka-collection-item]:not([data-disabled])"});if(R)return R==null?void 0:R.focus();if(_.code==="Space")return;const F=((B=g.value)==null?void 0:B.getItems())??[];if(I&&(_.key==="Tab"&&_.preventDefault(),!N&&P&&x(_.key,F)),_.target!==y.value||!vP.includes(_.key))return;_.preventDefault();const V=[...F.map(G=>G.ref)];xP.includes(_.key)&&V.reverse(),SP(V)}function w(_){var D,I;(I=(D=_==null?void 0:_.currentTarget)==null?void 0:D.contains)!=null&&I.call(D,_.target)||(window.clearTimeout(c.value),u.value="")}function A(_){var N;if(!W1(_))return;const D=_.target,I=p.value!==_.clientX;if((N=_==null?void 0:_.currentTarget)!=null&&N.contains(D)&&I){const P=_.clientX>p.value?"right":"left";h.value=P,p.value=_.clientX}}return t5({onItemEnter:_=>!!S(_),onItemLeave:_=>{var D;S(_)||((D=y.value)==null||D.focus(),m.value=null)},onTriggerLeave:_=>!!S(_),searchRef:u,pointerGraceTimerRef:f,onPointerGraceIntentChange:_=>{d.value=_}}),(_,D)=>(T(),L(v(bP),{"as-child":"",trapped:v(o),onMountAutoFocus:E,onUnmountAutoFocus:D[7]||(D[7]=I=>r("closeAutoFocus",I))},{default:O(()=>[k(v(SI),{"as-child":"","disable-outside-pointer-events":v(a),onEscapeKeyDown:D[2]||(D[2]=I=>r("escapeKeyDown",I)),onPointerDownOutside:D[3]||(D[3]=I=>r("pointerDownOutside",I)),onFocusOutside:D[4]||(D[4]=I=>r("focusOutside",I)),onInteractOutside:D[5]||(D[5]=I=>r("interactOutside",I)),onDismiss:D[6]||(D[6]=I=>r("dismiss"))},{default:O(()=>[k(v(nA),{ref_key:"rovingFocusGroupRef",ref:g,"current-tab-stop-id":m.value,"onUpdate:currentTabStopId":D[0]||(D[0]=I=>m.value=I),"as-child":"",orientation:"vertical",dir:v(s).dir.value,loop:v(l),onEntryFocus:D[1]||(D[1]=I=>{r("entryFocus",I),v(s).isUsingKeyboardRef.value||I.preventDefault()})},{default:O(()=>[k(v(EI),{ref:v(b),role:"menu",as:_.as,"as-child":_.asChild,"aria-orientation":"vertical","data-reka-menu-content":"","data-state":v(gP)(v(i).open.value),dir:v(s).dir.value,side:_.side,"side-offset":_.sideOffset,align:_.align,"align-offset":_.alignOffset,"avoid-collisions":_.avoidCollisions,"collision-boundary":_.collisionBoundary,"collision-padding":_.collisionPadding,"arrow-padding":_.arrowPadding,"prioritize-position":_.prioritizePosition,"position-strategy":_.positionStrategy,"update-position-strategy":_.updatePositionStrategy,sticky:_.sticky,"hide-when-detached":_.hideWhenDetached,reference:_.reference,onKeydown:C,onBlur:w,onPointermove:A},{default:O(()=>[Q(_.$slots,"default")]),_:3},8,["as","as-child","data-state","dir","side","side-offset","align","align-offset","avoid-collisions","collision-boundary","collision-padding","arrow-padding","prioritize-position","position-strategy","update-position-strategy","sticky","hide-when-detached","reference"])]),_:3},8,["current-tab-stop-id","dir","loop"])]),_:3},8,["disable-outside-pointer-events"])]),_:3},8,["trapped"]))}}),iA=n5,r5=z({inheritAttrs:!1,__name:"MenuItemImpl",props:{disabled:{type:Boolean,required:!1},textValue:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(t){const e=t,n=rA(),{forwardRef:r}=Ye(),{CollectionItem:i}=Hy(),s=Z(!1);async function o(l){if(!l.defaultPrevented&&W1(l)){if(e.disabled)n.onItemLeave(l);else if(!n.onItemEnter(l)){const c=l.currentTarget;c==null||c.focus({preventScroll:!0})}}}async function a(l){await kr(),!l.defaultPrevented&&W1(l)&&n.onItemLeave(l)}return(l,u)=>(T(),L(v(i),{value:{textValue:l.textValue}},{default:O(()=>[k(v(lt),Ce({ref:v(r),role:"menuitem",tabindex:"-1"},l.$attrs,{as:l.as,"as-child":l.asChild,"aria-disabled":l.disabled||void 0,"data-disabled":l.disabled?"":void 0,"data-highlighted":s.value?"":void 0,onPointermove:o,onPointerleave:a,onFocus:u[0]||(u[0]=async c=>{await kr(),!(c.defaultPrevented||l.disabled)&&(s.value=!0)}),onBlur:u[1]||(u[1]=async c=>{await kr(),!c.defaultPrevented&&(s.value=!1)})}),{default:O(()=>[Q(l.$slots,"default")]),_:3},16,["as","as-child","aria-disabled","data-disabled","data-highlighted"])]),_:3},8,["value"]))}}),i5=r5,s5=z({__name:"MenuItem",props:{disabled:{type:Boolean,required:!1},textValue:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["select"],setup(t,{emit:e}){const n=t,r=e,{forwardRef:i,currentElement:s}=Ye(),o=ev(),a=rA(),l=Z(!1);async function u(){const c=s.value;if(!n.disabled&&c){const f=new CustomEvent(wP,{bubbles:!0,cancelable:!0});r("select",f),await kr(),f.defaultPrevented?l.value=!1:o.onClose()}}return(c,f)=>(T(),L(i5,Ce(n,{ref:v(i),onClick:u,onPointerdown:f[0]||(f[0]=()=>{l.value=!0}),onPointerup:f[1]||(f[1]=async d=>{var h;await kr(),!d.defaultPrevented&&(l.value||(h=d.currentTarget)==null||h.click())}),onKeydown:f[2]||(f[2]=async d=>{const h=v(a).searchRef.value!=="";c.disabled||h&&d.key===" "||v(EP).includes(d.key)&&(d.currentTarget.click(),d.preventDefault())})}),{default:O(()=>[Q(c.$slots,"default")]),_:3},16))}}),o5=s5,a5=z({__name:"MenuRootContentModal",props:{loop:{type:Boolean,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","entryFocus","openAutoFocus","closeAutoFocus"],setup(t,{emit:e}){const n=t,r=e,i=Yr(n,r),s=N0(),{forwardRef:o,currentElement:a}=Ye();return _P(a),(l,u)=>(T(),L(iA,Ce(v(i),{ref:v(o),"trap-focus":v(s).open.value,"disable-outside-pointer-events":v(s).open.value,"disable-outside-scroll":!0,onDismiss:u[0]||(u[0]=c=>v(s).onOpenChange(!1)),onFocusOutside:u[1]||(u[1]=eo(c=>r("focusOutside",c),["prevent"]))}),{default:O(()=>[Q(l.$slots,"default")]),_:3},16,["trap-focus","disable-outside-pointer-events"]))}}),l5=a5,u5=z({__name:"MenuRootContentNonModal",props:{loop:{type:Boolean,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","entryFocus","openAutoFocus","closeAutoFocus"],setup(t,{emit:e}){const i=Yr(t,e),s=N0();return(o,a)=>(T(),L(iA,Ce(v(i),{"trap-focus":!1,"disable-outside-pointer-events":!1,"disable-outside-scroll":!1,onDismiss:a[0]||(a[0]=l=>v(s).onOpenChange(!1))}),{default:O(()=>[Q(o.$slots,"default")]),_:3},16))}}),c5=u5,f5=z({__name:"MenuContent",props:{forceMount:{type:Boolean,required:!1},loop:{type:Boolean,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","entryFocus","openAutoFocus","closeAutoFocus"],setup(t,{emit:e}){const i=Yr(t,e),s=N0(),o=ev();return(a,l)=>(T(),L(v(Yl),{present:a.forceMount||v(s).open.value},{default:O(()=>[v(o).modal.value?(T(),L(l5,Yn(Ce({key:0},{...a.$attrs,...v(i)})),{default:O(()=>[Q(a.$slots,"default")]),_:3},16)):(T(),L(c5,Yn(Ce({key:1},{...a.$attrs,...v(i)})),{default:O(()=>[Q(a.$slots,"default")]),_:3},16))]),_:3},8,["present"]))}}),d5=f5,h5=z({__name:"MenuGroup",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(t){const e=t;return(n,r)=>(T(),L(v(lt),Ce({role:"group"},e),{default:O(()=>[Q(n.$slots,"default")]),_:3},16))}}),p5=h5,m5=z({__name:"MenuLabel",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"div"}},setup(t){const e=t;return(n,r)=>(T(),L(v(lt),Yn(Pr(e)),{default:O(()=>[Q(n.$slots,"default")]),_:3},16))}}),g5=m5,b5=z({__name:"MenuPortal",props:{to:{type:null,required:!1},disabled:{type:Boolean,required:!1},defer:{type:Boolean,required:!1},forceMount:{type:Boolean,required:!1}},setup(t){const e=t;return(n,r)=>(T(),L(v(CI),Yn(Pr(e)),{default:O(()=>[Q(n.$slots,"default")]),_:3},16))}}),y5=b5,v5=z({__name:"MenuSeparator",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(t){const e=t;return(n,r)=>(T(),L(v(lt),Ce(e,{role:"separator","aria-orientation":"horizontal"}),{default:O(()=>[Q(n.$slots,"default")]),_:3},16))}}),x5=v5;const[sA,S5]=Ir("DropdownMenuRoot");var E5=z({__name:"DropdownMenuRoot",props:{defaultOpen:{type:Boolean,required:!1},open:{type:Boolean,required:!1,default:void 0},dir:{type:String,required:!1},modal:{type:Boolean,required:!1,default:!0}},emits:["update:open"],setup(t,{emit:e}){const n=t,r=e;Ye();const i=wa(n,"open",r,{defaultValue:n.defaultOpen,passive:n.open===void 0}),s=Z(),{modal:o,dir:a}=cr(n),l=Jl(a);return S5({open:i,onOpenChange:u=>{i.value=u},onOpenToggle:()=>{i.value=!i.value},triggerId:"",triggerElement:s,contentId:"",modal:o,dir:l}),(u,c)=>(T(),L(v(e5),{open:v(i),"onUpdate:open":c[0]||(c[0]=f=>_l(i)?i.value=f:null),dir:v(l),modal:v(o)},{default:O(()=>[Q(u.$slots,"default",{open:v(i)})]),_:3},8,["open","dir","modal"]))}}),w5=E5,_5=z({__name:"DropdownMenuContent",props:{forceMount:{type:Boolean,required:!1},loop:{type:Boolean,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","closeAutoFocus"],setup(t,{emit:e}){const i=Yr(t,e);Ye();const s=sA(),o=Z(!1);function a(l){l.defaultPrevented||(o.value||setTimeout(()=>{var u;(u=s.triggerElement.value)==null||u.focus()},0),o.value=!1,l.preventDefault())}return s.contentId||(s.contentId=Wi(void 0,"reka-dropdown-menu-content")),(l,u)=>{var c;return T(),L(v(d5),Ce(v(i),{id:v(s).contentId,"aria-labelledby":(c=v(s))==null?void 0:c.triggerId,style:{"--reka-dropdown-menu-content-transform-origin":"var(--reka-popper-transform-origin)","--reka-dropdown-menu-content-available-width":"var(--reka-popper-available-width)","--reka-dropdown-menu-content-available-height":"var(--reka-popper-available-height)","--reka-dropdown-menu-trigger-width":"var(--reka-popper-anchor-width)","--reka-dropdown-menu-trigger-height":"var(--reka-popper-anchor-height)"},onCloseAutoFocus:a,onInteractOutside:u[0]||(u[0]=f=>{var m;if(f.defaultPrevented)return;const d=f.detail.originalEvent,h=d.button===0&&d.ctrlKey===!0,p=d.button===2||h;(!v(s).modal.value||p)&&(o.value=!0),(m=v(s).triggerElement.value)!=null&&m.contains(f.target)&&f.preventDefault()})}),{default:O(()=>[Q(l.$slots,"default")]),_:3},16,["id","aria-labelledby"])}}}),C5=_5,A5=z({__name:"DropdownMenuGroup",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(t){const e=t;return Ye(),(n,r)=>(T(),L(v(p5),Yn(Pr(e)),{default:O(()=>[Q(n.$slots,"default")]),_:3},16))}}),D5=A5,k5=z({__name:"DropdownMenuItem",props:{disabled:{type:Boolean,required:!1},textValue:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["select"],setup(t,{emit:e}){const n=t,i=AI(e);return Ye(),(s,o)=>(T(),L(v(o5),Yn(Pr({...n,...v(i)})),{default:O(()=>[Q(s.$slots,"default")]),_:3},16))}}),O5=k5,T5=z({__name:"DropdownMenuLabel",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(t){const e=t;return Ye(),(n,r)=>(T(),L(v(g5),Yn(Pr(e)),{default:O(()=>[Q(n.$slots,"default")]),_:3},16))}}),I5=T5,P5=z({__name:"DropdownMenuPortal",props:{to:{type:null,required:!1},disabled:{type:Boolean,required:!1},defer:{type:Boolean,required:!1},forceMount:{type:Boolean,required:!1}},setup(t){const e=t;return(n,r)=>(T(),L(v(y5),Yn(Pr(e)),{default:O(()=>[Q(n.$slots,"default")]),_:3},16))}}),R5=P5,N5=z({__name:"DropdownMenuSeparator",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(t){const e=t;return Ye(),(n,r)=>(T(),L(v(x5),Yn(Pr(e)),{default:O(()=>[Q(n.$slots,"default")]),_:3},16))}}),M5=N5,F5=z({__name:"DropdownMenuTrigger",props:{disabled:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"button"}},setup(t){const e=t,n=sA(),{forwardRef:r,currentElement:i}=Ye();return gn(()=>{n.triggerElement=i}),n.triggerId||(n.triggerId=Wi(void 0,"reka-dropdown-menu-trigger")),(s,o)=>(T(),L(v(KP),{"as-child":""},{default:O(()=>[k(v(lt),{id:v(n).triggerId,ref:v(r),type:s.as==="button"?"button":void 0,"as-child":e.asChild,as:s.as,"aria-haspopup":"menu","aria-expanded":v(n).open.value,"aria-controls":v(n).open.value?v(n).contentId:void 0,"data-disabled":s.disabled?"":void 0,disabled:s.disabled,"data-state":v(n).open.value?"open":"closed",onClick:o[0]||(o[0]=async a=>{var l;!s.disabled&&a.button===0&&a.ctrlKey===!1&&((l=v(n))==null||l.onOpenToggle(),await kr(),v(n).open.value&&a.preventDefault())}),onKeydown:o[1]||(o[1]=qy(a=>{s.disabled||(["Enter"," "].includes(a.key)&&v(n).onOpenToggle(),a.key==="ArrowDown"&&v(n).onOpenChange(!0),["Enter"," ","ArrowDown"].includes(a.key)&&a.preventDefault())},["enter","space","arrow-down"]))},{default:O(()=>[Q(s.$slots,"default")]),_:3},8,["id","type","as-child","as","aria-expanded","aria-controls","data-disabled","disabled","data-state"])]),_:3}))}}),L5=F5;const[Jr,B5]=Ir("ScrollAreaRoot");var $5=z({__name:"ScrollAreaRoot",props:{type:{type:String,required:!1,default:"hover"},dir:{type:String,required:!1},scrollHideDelay:{type:Number,required:!1,default:600},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(t,{expose:e}){const n=t,r=Z(0),i=Z(0),s=Z(),o=Z(),a=Z(),l=Z(),u=Z(!1),c=Z(!1),{type:f,dir:d,scrollHideDelay:h}=cr(n),p=Jl(d);function m(){var x;(x=s.value)==null||x.scrollTo({top:0})}function g(){var x;(x=s.value)==null||x.scrollTo({top:0,left:0})}e({viewport:s,scrollTop:m,scrollTopLeft:g});const{forwardRef:b,currentElement:y}=Ye();return B5({type:f,dir:p,scrollHideDelay:h,scrollArea:y,viewport:s,onViewportChange:x=>{s.value=x||void 0},content:o,onContentChange:x=>{o.value=x},scrollbarX:a,scrollbarXEnabled:u,scrollbarY:l,scrollbarYEnabled:c,onScrollbarXChange:x=>{a.value=x||void 0},onScrollbarYChange:x=>{l.value=x||void 0},onScrollbarXEnabledChange:x=>{u.value=x},onScrollbarYEnabledChange:x=>{c.value=x},onCornerWidthChange:x=>{r.value=x},onCornerHeightChange:x=>{i.value=x}}),(x,S)=>(T(),L(v(lt),{ref:v(b),"as-child":n.asChild,as:x.as,dir:v(p),style:_a({position:"relative","--reka-scroll-area-corner-width":`${r.value}px`,"--reka-scroll-area-corner-height":`${i.value}px`})},{default:O(()=>[Q(x.$slots,"default")]),_:3},8,["as-child","as","dir","style"]))}}),z5=$5,j5=z({__name:"ScrollAreaCornerImpl",setup(t){const e=Jr(),n=Z(0),r=Z(0),i=q(()=>!!n.value&&!!r.value);function s(){var l;const a=((l=e.scrollbarX.value)==null?void 0:l.offsetHeight)||0;e.onCornerHeightChange(a),r.value=a}function o(){var l;const a=((l=e.scrollbarY.value)==null?void 0:l.offsetWidth)||0;e.onCornerWidthChange(a),n.value=a}return co(e.scrollbarX.value,s),co(e.scrollbarY.value,o),at(()=>e.scrollbarX.value,s),at(()=>e.scrollbarY.value,o),(a,l)=>{var u;return i.value?(T(),L(v(lt),Ce({key:0,style:{width:`${n.value}px`,height:`${r.value}px`,position:"absolute",right:v(e).dir.value==="ltr"?0:void 0,left:v(e).dir.value==="rtl"?0:void 0,bottom:0}},(u=a.$parent)==null?void 0:u.$props),{default:O(()=>[Q(a.$slots,"default")]),_:3},16,["style"])):we("v-if",!0)}}}),V5=j5,U5=z({__name:"ScrollAreaCorner",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(t){const e=t,{forwardRef:n}=Ye(),r=Jr(),i=q(()=>!!r.scrollbarX.value&&!!r.scrollbarY.value),s=q(()=>r.type.value!=="scroll"&&i.value);return(o,a)=>s.value?(T(),L(V5,Ce({key:0},e,{ref:v(n)}),{default:O(()=>[Q(o.$slots,"default")]),_:3},16)):we("v-if",!0)}}),H5=U5;function oA(t,e){return n=>{if(t[0]===t[1]||e[0]===e[1])return e[0];const r=(e[1]-e[0])/(t[1]-t[0]);return e[0]+r*(n-t[0])}}function M0(t){const e=aA(t.viewport,t.content),n=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,r=(t.scrollbar.size-n)*e;return Math.max(r,18)}function aA(t,e){const n=t/e;return Number.isNaN(n)?0:n}function q5(t,e=()=>{}){let n={left:t.scrollLeft,top:t.scrollTop},r=0;return(function i(){const s={left:t.scrollLeft,top:t.scrollTop},o=n.left!==s.left,a=n.top!==s.top;(o||a)&&e(),n=s,r=window.requestAnimationFrame(i)})(),()=>window.cancelAnimationFrame(r)}function Tx(t,e,n="ltr"){const r=M0(e),i=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,s=e.scrollbar.size-i,o=e.content-e.viewport,a=s-r,l=n==="ltr"?[0,o]:[o*-1,0],u=CP(t,l[0],l[1]);return oA([0,o],[0,a])(u)}function gd(t){return t?Number.parseInt(t,10):0}function G5(t,e,n,r="ltr"){const i=M0(n),s=i/2,o=e||s,a=i-o,l=n.scrollbar.paddingStart+o,u=n.scrollbar.size-n.scrollbar.paddingEnd-a,c=n.content-n.viewport,f=r==="ltr"?[0,c]:[c*-1,0];return oA([l,u],f)(t)}function Ix(t,e){return t>0&&t{i.value&&e.onScrollbarXChange(i.value)});const s=q(()=>n.sizes.value);return(o,a)=>(T(),L(uA,{ref:v(r),"is-horizontal":!0,"data-orientation":"horizontal",style:_a({bottom:0,left:v(e).dir.value==="rtl"?"var(--reka-scroll-area-corner-width)":0,right:v(e).dir.value==="ltr"?"var(--reka-scroll-area-corner-width)":0,"--reka-scroll-area-thumb-width":s.value?`${v(M0)(s.value)}px`:void 0}),onOnDragScroll:a[0]||(a[0]=l=>v(n).onDragScroll(l.x))},{default:O(()=>[Q(o.$slots,"default")]),_:3},8,["style"]))}}),K5=W5,X5=z({__name:"ScrollAreaScrollbarY",setup(t){const e=Jr(),n=L0(),{forwardRef:r,currentElement:i}=Ye();gn(()=>{i.value&&e.onScrollbarYChange(i.value)});const s=q(()=>n.sizes.value);return(o,a)=>(T(),L(uA,{ref:v(r),"is-horizontal":!1,"data-orientation":"vertical",style:_a({top:0,right:v(e).dir.value==="ltr"?0:void 0,left:v(e).dir.value==="rtl"?0:void 0,bottom:"var(--reka-scroll-area-corner-height)","--reka-scroll-area-thumb-height":s.value?`${v(M0)(s.value)}px`:void 0}),onOnDragScroll:a[0]||(a[0]=l=>v(n).onDragScroll(l.y))},{default:O(()=>[Q(o.$slots,"default")]),_:3},8,["style"]))}}),Y5=X5,J5=z({__name:"ScrollAreaScrollbarAuto",props:{forceMount:{type:Boolean,required:!1}},setup(t){const e=Jr(),n=F0(),{forwardRef:r}=Ye(),i=Z(!1),s=Gy(()=>{if(e.viewport.value){const o=e.viewport.value.offsetWidths()),co(e.viewport,s),co(e.content,s),(o,a)=>(T(),L(v(Yl),{present:o.forceMount||i.value},{default:O(()=>[k(tv,Ce(o.$attrs,{ref:v(r),"data-state":i.value?"visible":"hidden"}),{default:O(()=>[Q(o.$slots,"default")]),_:3},16,["data-state"])]),_:3},8,["present"]))}}),lA=J5,Z5=z({inheritAttrs:!1,__name:"ScrollAreaScrollbarHover",props:{forceMount:{type:Boolean,required:!1}},setup(t){const e=Jr(),{forwardRef:n}=Ye();let r;const i=Z(!1);function s(){window.clearTimeout(r),i.value=!0}function o(){r=window.setTimeout(()=>{i.value=!1},e.scrollHideDelay.value)}return gn(()=>{const a=e.scrollArea.value;a&&(a.addEventListener("pointerenter",s),a.addEventListener("pointerleave",o))}),wo(()=>{const a=e.scrollArea.value;a&&(window.clearTimeout(r),a.removeEventListener("pointerenter",s),a.removeEventListener("pointerleave",o))}),(a,l)=>(T(),L(v(Yl),{present:a.forceMount||i.value},{default:O(()=>[k(lA,Ce(a.$attrs,{ref:v(n),"data-state":i.value?"visible":"hidden"}),{default:O(()=>[Q(a.$slots,"default")]),_:3},16,["data-state"])]),_:3},8,["present"]))}}),Q5=Z5,eR=z({__name:"ScrollAreaScrollbarScroll",props:{forceMount:{type:Boolean,required:!1}},setup(t){const e=Jr(),n=F0(),{forwardRef:r}=Ye(),{state:i,dispatch:s}=DI("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}}),o=q(()=>i.value!=="hidden");aa(l=>{if(i.value==="idle"){const u=window.setTimeout(()=>s("HIDE"),e.scrollHideDelay.value);l(()=>{window.clearTimeout(u)})}});const a=Gy(()=>s("SCROLL_END"),100);return aa(l=>{const u=e.viewport.value,c=n.isHorizontal.value?"scrollLeft":"scrollTop";if(u){let f=u[c];const d=()=>{const h=u[c];f!==h&&(s("SCROLL"),a()),f=h};u.addEventListener("scroll",d),l(()=>{u.removeEventListener("scroll",d)})}}),(l,u)=>(T(),L(v(Yl),{present:l.forceMount||o.value},{default:O(()=>[k(tv,Ce(l.$attrs,{ref:v(r),"data-state":o.value?"visible":"hidden"}),{default:O(()=>[Q(l.$slots,"default")]),_:3},16,["data-state"])]),_:3},8,["present"]))}}),tR=eR;const[F0,nR]=Ir("ScrollAreaScrollbar");var rR=z({inheritAttrs:!1,__name:"ScrollAreaScrollbar",props:{orientation:{type:String,required:!1,default:"vertical"},forceMount:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"div"}},setup(t){const e=t,{forwardRef:n}=Ye(),r=Jr(),i=q(()=>e.orientation==="horizontal");at(i,()=>{i.value?r.onScrollbarXEnabledChange(!0):r.onScrollbarYEnabledChange(!0)},{immediate:!0}),wo(()=>{r.onScrollbarXEnabledChange(!1),r.onScrollbarYEnabledChange(!1)});const{orientation:s,forceMount:o,asChild:a,as:l}=cr(e);return nR({orientation:s,forceMount:o,isHorizontal:i,as:l,asChild:a}),(u,c)=>v(r).type.value==="hover"?(T(),L(Q5,Ce({key:0},u.$attrs,{ref:v(n),"force-mount":v(o)}),{default:O(()=>[Q(u.$slots,"default")]),_:3},16,["force-mount"])):v(r).type.value==="scroll"?(T(),L(tR,Ce({key:1},u.$attrs,{ref:v(n),"force-mount":v(o)}),{default:O(()=>[Q(u.$slots,"default")]),_:3},16,["force-mount"])):v(r).type.value==="auto"?(T(),L(lA,Ce({key:2},u.$attrs,{ref:v(n),"force-mount":v(o)}),{default:O(()=>[Q(u.$slots,"default")]),_:3},16,["force-mount"])):v(r).type.value==="always"?(T(),L(tv,Ce({key:3},u.$attrs,{ref:v(n),"data-state":"visible"}),{default:O(()=>[Q(u.$slots,"default")]),_:3},16)):we("v-if",!0)}}),iR=rR;const[L0,sR]=Ir("ScrollAreaScrollbarVisible");var oR=z({__name:"ScrollAreaScrollbarVisible",setup(t){const e=Jr(),n=F0(),{forwardRef:r}=Ye(),i=Z({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),s=q(()=>{const b=aA(i.value.viewport,i.value.content);return b>0&&b<1}),o=Z(),a=Z(0);function l(b,y){if(h.value){const x=e.viewport.value.scrollLeft+b.deltaY;e.viewport.value.scrollLeft=x,Ix(x,y)&&b.preventDefault()}else{const x=e.viewport.value.scrollTop+b.deltaY;e.viewport.value.scrollTop=x,Ix(x,y)&&b.preventDefault()}}function u(b,y){h.value?a.value=y.x:a.value=y.y}function c(b){a.value=0}function f(b){i.value=b}function d(b,y){return G5(b,a.value,i.value,y)}const h=q(()=>n.isHorizontal.value);function p(b){h.value?e.viewport.value.scrollLeft=d(b,e.dir.value):e.viewport.value.scrollTop=d(b)}function m(){if(h.value){if(e.viewport.value&&o.value){const b=e.viewport.value.scrollLeft,y=Tx(b,i.value,e.dir.value);o.value.style.transform=`translate3d(${y}px, 0, 0)`}}else if(e.viewport.value&&o.value){const b=e.viewport.value.scrollTop,y=Tx(b,i.value);o.value.style.transform=`translate3d(0, ${y}px, 0)`}}function g(b){o.value=b}return sR({sizes:i,hasThumb:s,handleWheelScroll:l,handleThumbDown:u,handleThumbUp:c,handleSizeChange:f,onThumbPositionChange:m,onThumbChange:g,onDragScroll:p}),(b,y)=>h.value?(T(),L(K5,Ce({key:0},b.$attrs,{ref:v(r)}),{default:O(()=>[Q(b.$slots,"default")]),_:3},16)):(T(),L(Y5,Ce({key:1},b.$attrs,{ref:v(r)}),{default:O(()=>[Q(b.$slots,"default")]),_:3},16))}}),tv=oR,aR=z({__name:"ScrollAreaScrollbarImpl",props:{isHorizontal:{type:Boolean,required:!0}},emits:["onDragScroll","onWheelScroll","onThumbPointerDown"],setup(t,{emit:e}){const n=t,r=e,i=Jr(),s=L0(),o=F0(),{forwardRef:a,currentElement:l}=Ye(),u=Z(""),c=Z();function f(b){var y,x;if(c.value){const S=b.clientX-((y=c.value)==null?void 0:y.left),E=b.clientY-((x=c.value)==null?void 0:x.top);r("onDragScroll",{x:S,y:E})}}function d(b){b.button===0&&(b.target.setPointerCapture(b.pointerId),c.value=l.value.getBoundingClientRect(),u.value=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",i.viewport&&(i.viewport.value.style.scrollBehavior="auto"),f(b))}function h(b){f(b)}function p(b){const y=b.target;y.hasPointerCapture(b.pointerId)&&y.releasePointerCapture(b.pointerId),document.body.style.webkitUserSelect=u.value,i.viewport&&(i.viewport.value.style.scrollBehavior=""),c.value=void 0}function m(b){var E;const y=b.target,x=(E=l.value)==null?void 0:E.contains(y),S=s.sizes.value.content-s.sizes.value.viewport;x&&s.handleWheelScroll(b,S)}gn(()=>{document.addEventListener("wheel",m,{passive:!1})}),wo(()=>{document.removeEventListener("wheel",m)});function g(){var b,y,x,S,E;l.value&&(n.isHorizontal?s.handleSizeChange({content:((b=i.viewport.value)==null?void 0:b.scrollWidth)??0,viewport:((y=i.viewport.value)==null?void 0:y.offsetWidth)??0,scrollbar:{size:l.value.clientWidth??0,paddingStart:gd(getComputedStyle(l.value).paddingLeft),paddingEnd:gd(getComputedStyle(l.value).paddingRight)}}):s.handleSizeChange({content:((x=i.viewport.value)==null?void 0:x.scrollHeight)??0,viewport:((S=i.viewport.value)==null?void 0:S.offsetHeight)??0,scrollbar:{size:((E=l.value)==null?void 0:E.clientHeight)??0,paddingStart:gd(getComputedStyle(l.value).paddingTop),paddingEnd:gd(getComputedStyle(l.value).paddingBottom)}}),s.onThumbPositionChange())}return co(l,g),co(i.content,g),(b,y)=>(T(),L(v(lt),{ref:v(a),style:{position:"absolute"},"data-scrollbarimpl":"",as:v(o).as.value,"as-child":v(o).asChild.value,onPointerdown:d,onPointermove:h,onPointerup:p},{default:O(()=>[Q(b.$slots,"default")]),_:3},8,["as","as-child"]))}}),uA=aR,lR=z({__name:"ScrollAreaThumb",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(t){const e=t,n=Jr(),r=L0();function i(d){const p=d.target.getBoundingClientRect(),m=d.clientX-p.left,g=d.clientY-p.top;r.handleThumbDown(d,{x:m,y:g})}function s(d){r.handleThumbUp(d)}const{forwardRef:o,currentElement:a}=Ye(),l=Z(),u=q(()=>n.viewport.value);function c(){if(!l.value){const d=q5(u.value,r.onThumbPositionChange);l.value=d,r.onThumbPositionChange()}}const f=q(()=>r.sizes.value);return zC(f,()=>{r.onThumbChange(a.value),u.value&&(r.onThumbPositionChange(),u.value.addEventListener("scroll",c))}),wo(()=>{var d;u.value.removeEventListener("scroll",c),(d=n.viewport.value)==null||d.removeEventListener("scroll",c)}),(d,h)=>(T(),L(v(lt),{ref:v(o),"data-state":v(r).hasThumb?"visible":"hidden",style:{width:"var(--reka-scroll-area-thumb-width)",height:"var(--reka-scroll-area-thumb-height)"},"as-child":e.asChild,as:d.as,onPointerdown:i,onPointerup:s},{default:O(()=>[Q(d.$slots,"default")]),_:3},8,["data-state","as-child","as"]))}}),uR=lR,cR=z({inheritAttrs:!1,__name:"ScrollAreaViewport",props:{nonce:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(t,{expose:e}){const n=t,{nonce:r}=cr(n),i=JC(r),s=Jr(),o=Z();gn(()=>{s.onViewportChange(o.value),s.onContentChange(l.value)}),e({viewportElement:o});const{forwardRef:a,currentElement:l}=Ye();return(u,c)=>(T(),K(Qe,null,[M("div",Ce({ref_key:"viewportElement",ref:o,"data-reka-scroll-area-viewport":"",style:{overflowX:v(s).scrollbarXEnabled.value?"scroll":"hidden",overflowY:v(s).scrollbarYEnabled.value?"scroll":"hidden"}},u.$attrs,{tabindex:0}),[k(v(lt),{ref:v(a),style:_a({minWidth:v(s).scrollbarXEnabled.value?"fit-content":void 0}),"as-child":n.asChild,as:u.as},{default:O(()=>[Q(u.$slots,"default")]),_:3},8,["style","as-child","as"])],16),k(v(lt),{as:"style",nonce:v(i)},{default:O(()=>c[0]||(c[0]=[ne(" /* Hide scrollbars cross-browser and enable momentum scroll for touch devices */ [data-reka-scroll-area-viewport] { scrollbar-width:none; -ms-overflow-style:none; -webkit-overflow-scrolling:touch; } [data-reka-scroll-area-viewport]::-webkit-scrollbar { display:none; } ")])),_:1,__:[0]},8,["nonce"])],64))}}),fR=cR;const[dR,hR]=Ir("SelectGroup");var pR=z({__name:"SelectGroup",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(t){const e=t,n=Wi(void 0,"reka-select-group");return hR({id:n}),(r,i)=>(T(),L(v(lt),Ce({role:"group"},e,{"aria-labelledby":v(n)}),{default:O(()=>[Q(r.$slots,"default")]),_:3},16,["aria-labelledby"]))}}),mR=pR,gR=z({__name:"SelectLabel",props:{for:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"div"}},setup(t){const e=t,n=dR({id:""});return(r,i)=>(T(),L(v(lt),Ce(e,{id:v(n).id}),{default:O(()=>[Q(r.$slots,"default")]),_:3},16,["id"]))}}),bR=gR,yR=z({__name:"SelectSeparator",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(t){const e=t;return(n,r)=>(T(),L(v(lt),Ce({"aria-hidden":"true"},e),{default:O(()=>[Q(n.$slots,"default")]),_:3},16))}}),vR=yR;function ze(t,e="Assertion failed!"){if(!t)throw console.error(e),new Error(e)}function cA(t,e=document){var r;if(!Of)return null;if(e instanceof HTMLElement&&((r=e==null?void 0:e.dataset)==null?void 0:r.panelGroupId)===t)return e;const n=e.querySelector(`[data-panel-group][data-panel-group-id="${t}"]`);return n||null}function B0(t,e=document){if(!Of)return null;const n=e.querySelector(`[data-panel-resize-handle-id="${t}"]`);return n||null}function fA(t,e,n=document){return Of?Oc(t,n).findIndex(s=>s.getAttribute("data-panel-resize-handle-id")===e)??null:null}function Oc(t,e=document){return Of?Array.from(e.querySelectorAll(`[data-panel-resize-handle-id][data-panel-group-id="${t}"]`)):[]}function xR(t,e,n,r=document){var u,c;const i=B0(e,r),s=Oc(t,r),o=i?s.indexOf(i):-1,a=((u=n[o])==null?void 0:u.id)??null,l=((c=n[o+1])==null?void 0:c.id)??null;return[a,l]}function dA(t){return t.type==="keydown"}function hA(t){return t.type.startsWith("mouse")}function pA(t){return t.type.startsWith("touch")}function $0(t){if(hA(t))return{x:t.clientX,y:t.clientY};if(pA(t)){const e=t.touches[0];if(e&&e.clientX&&e.clientY)return{x:e.clientX,y:e.clientY}}return{x:Number.POSITIVE_INFINITY,y:Number.POSITIVE_INFINITY}}function mA(t,e){const n=t==="horizontal",{x:r,y:i}=$0(e);return n?r:i}function SR(t,e,n,r,i){const s=n==="horizontal",o=B0(e,i);ze(o);const a=o.getAttribute("data-panel-group-id");ze(a);const{initialCursorPosition:l}=r,u=mA(n,t),c=cA(a,i);ze(c);const f=c.getBoundingClientRect(),d=s?f.width:f.height;return(u-l)/d*100}function ER(t,e,n,r,i,s){if(dA(t)){const o=n==="horizontal";let a=0;t.shiftKey?a=100:a=i??10;let l=0;switch(t.key){case"ArrowDown":l=o?0:a;break;case"ArrowLeft":l=o?-a:0;break;case"ArrowRight":l=o?a:0;break;case"ArrowUp":l=o?0:-a;break;case"End":l=100;break;case"Home":l=-100;break}return l}else return r==null?0:SR(t,e,n,r,s)}function wR({layout:t,panelsArray:e,pivotIndices:n}){let r=0,i=100,s=0,o=0;const a=n[0];ze(a!=null),e.forEach((f,d)=>{const{constraints:h}=f,{maxSize:p=100,minSize:m=0}=h;d===a?(r=m,i=p):(s+=m,o+=p)});const l=Math.min(i,100-s),u=Math.max(r,100-o),c=t[a];return{valueMax:l,valueMin:u,valueNow:c}}function _R({panelDataArray:t}){const e=Array.from({length:t.length}),n=t.map(s=>s.constraints);let r=0,i=100;for(let s=0;s{const s=t[i];ze(s);const{callbacks:o,constraints:a,id:l}=s,{collapsedSize:u=0,collapsible:c}=a,f=n[l];if(f==null||r!==f){n[l]=r;const{onCollapse:d,onExpand:h,onResize:p}=o;p&&p(r,f),c&&(d||h)&&(h&&(f==null||f===u)&&r!==u&&h(),d&&(f==null||f!==u)&&r===u&&d())}})}function CR(t,e=10){let n=null;return(...i)=>{n!==null&&clearTimeout(n),n=setTimeout(()=>{t(...i)},e)}}const nv=10;function Tc(t,e,n=nv){t=Number.parseFloat(t.toFixed(n)),e=Number.parseFloat(e.toFixed(n));const r=t-e;return r===0?0:r>0?1:-1}function xr(t,e,n){return Tc(t,e,n)===0}function Za({panelConstraints:t,panelIndex:e,size:n}){const r=t[e];ze(r!=null);const{collapsedSize:i=0,collapsible:s,maxSize:o=100,minSize:a=0}=r;if(Tc(n,a)<0)if(s){const l=(i+a)/2;Tc(n,l)<0?n=i:n=a}else n=a;return n=Math.min(o,n),n=Number.parseFloat(n.toFixed(nv)),n}function bd(t,e){if(t.length!==e.length)return!1;for(let n=0;n0&&(t=t<0?0-g:g)}}}{const c=t<0?o:a,f=n[c];ze(f);const{collapsible:d}=f;if(d){const h=e[c];ze(h!=null);const p=n[c];ze(p);const{collapsedSize:m=0,minSize:g=0}=p;if(xr(h,g)){const b=h-m;Tc(b,Math.abs(t))>0&&(t=t<0?0-b:b)}}}}{const c=t<0?1:-1;let f=t<0?a:o,d=0;for(;;){const p=e[f];ze(p!=null);const g=Za({panelConstraints:n,panelIndex:f,size:100})-p;if(d+=g,f+=c,f<0||f>=n.length)break}const h=Math.min(Math.abs(t),Math.abs(d));t=t<0?0-h:h}{let f=t<0?o:a;for(;f>=0&&f=0))break;t<0?f--:f++}}if(xr(l,0))return e;{const c=t<0?a:o,f=e[c];ze(f!=null);const d=f+l,h=Za({panelConstraints:n,panelIndex:c,size:d});if(s[c]=h,!xr(h,d)){let p=d-h,g=t<0?a:o;for(;g>=0&&g0?g--:g++}}}const u=s.reduce((c,f)=>f+c,0);return xr(u,100)?s:e}function gA(t,e,n){const r=fA(t,e,n);return r!=null?[r,r+1]:[-1,-1]}function AR(t,e,n){return t.xe.x&&t.ye.y}function DR(t,e){if(t===e)throw new Error("Cannot compare node with itself");const n={a:Nx(t),b:Nx(e)};let r;for(;n.a.at(-1)===n.b.at(-1);)t=n.a.pop(),e=n.b.pop(),r=t;ze(r);const i={a:Rx(Px(n.a)),b:Rx(Px(n.b))};if(i.a===i.b){const s=r.childNodes,o={a:n.a.at(-1),b:n.b.at(-1)};let a=s.length;for(;a--;){const l=s[a];if(l===o.a)return 1;if(l===o.b)return-1}}return Math.sign(i.a-i.b)}const kR=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function OR(t){const e=getComputedStyle(bA(t)).display;return e==="flex"||e==="inline-flex"}function TR(t){const e=getComputedStyle(t);return!!(e.position==="fixed"||e.zIndex!=="auto"&&(e.position!=="static"||OR(t))||+e.opacity<1||"transform"in e&&e.transform!=="none"||"webkitTransform"in e&&e.webkitTransform!=="none"||"mixBlendMode"in e&&e.mixBlendMode!=="normal"||"filter"in e&&e.filter!=="none"||"webkitFilter"in e&&e.webkitFilter!=="none"||"isolation"in e&&e.isolation==="isolate"||kR.test(e.willChange)||e.webkitOverflowScrolling==="touch")}function Px(t){let e=t.length;for(;e--;){const n=t[e];if(ze(n),TR(n))return n}return null}function Rx(t){return t&&Number(getComputedStyle(t).zIndex)||0}function Nx(t){const e=[];for(;t;)e.push(t),t=bA(t);return e}function bA(t){var e;return t.parentNode instanceof DocumentFragment&&((e=t.parentNode)==null?void 0:e.host)||t.parentNode}const yA=1,vA=2,xA=4,SA=8;function IR(){if(typeof matchMedia=="function")return matchMedia("(pointer:coarse)").matches?"coarse":"fine"}const PR=IR()==="coarse",ho=[];let z0=!1;const $s=new Map,j0=new Map,Ic=new Set;function RR(t,e,n,r,i,s){const{ownerDocument:o}=e,a={direction:n,element:e,hitAreaMargins:r,nonce:i,setResizeHandlerState:s},l=$s.get(o)??0;return $s.set(o,l+1),Ic.add(a),lp(),function(){j0.delete(t),Ic.delete(a);const c=$s.get(o)??1;$s.set(o,c-1),lp(),wA(),c===1&&$s.delete(o)}}function yd(t){const{target:e}=t,{x:n,y:r}=$0(t);z0=!0,rv({target:e,x:n,y:r}),lp(),ho.length>0&&(iv("down",t),t.preventDefault())}function Os(t){const{x:e,y:n}=$0(t);if(!z0){const{target:r}=t;rv({target:r,x:e,y:n})}iv("move",t),EA(),ho.length>0&&t.preventDefault()}function Ts(t){const{target:e}=t,{x:n,y:r}=$0(t);j0.clear(),z0=!1,ho.length>0&&t.preventDefault(),iv("up",t),rv({target:e,x:n,y:r}),EA(),lp()}function rv({target:t,x:e,y:n}){ho.splice(0);let r=null;t instanceof HTMLElement&&(r=t),Ic.forEach(i=>{const{element:s,hitAreaMargins:o}=i,a=s.getBoundingClientRect(),{bottom:l,left:u,right:c,top:f}=a,d=PR?o.coarse:o.fine;if(e>=u-d&&e<=c+d&&n>=f-d&&n<=l+d){if(r!==null&&s!==r&&!s.contains(r)&&!r.contains(s)&&DR(r,s)>0){let p=r,m=!1;for(;p&&!p.contains(s);){if(AR(p.getBoundingClientRect(),a)){m=!0;break}p=p.parentElement}if(m)return}ho.push(i)}})}function lg(t,e){j0.set(t,e)}function EA(){let t=!1,e=!1,n;ho.forEach(i=>{const{direction:s,nonce:o}=i;s.value==="horizontal"?t=!0:e=!0,n=o.value});let r=0;j0.forEach(i=>{r|=i}),t&&e?ug("intersection",r,n):t?ug("horizontal",r,n):e?ug("vertical",r,n):wA()}function lp(){$s.forEach((t,e)=>{const{body:n}=e;n.removeEventListener("contextmenu",Ts),n.removeEventListener("mousedown",yd),n.removeEventListener("mouseleave",Os),n.removeEventListener("mousemove",Os),n.removeEventListener("touchmove",Os),n.removeEventListener("touchstart",yd)}),window.removeEventListener("mouseup",Ts),window.removeEventListener("touchcancel",Ts),window.removeEventListener("touchend",Ts),Ic.size>0&&(z0?(ho.length>0&&$s.forEach((t,e)=>{const{body:n}=e;t>0&&(n.addEventListener("contextmenu",Ts),n.addEventListener("mouseleave",Os),n.addEventListener("mousemove",Os),n.addEventListener("touchmove",Os,{passive:!1}))}),window.addEventListener("mouseup",Ts),window.addEventListener("touchcancel",Ts),window.addEventListener("touchend",Ts)):$s.forEach((t,e)=>{const{body:n}=e;t>0&&(n.addEventListener("mousedown",yd),n.addEventListener("mousemove",Os),n.addEventListener("touchmove",Os,{passive:!1}),n.addEventListener("touchstart",yd))}))}function iv(t,e){Ic.forEach(n=>{const{setResizeHandlerState:r}=n,i=ho.includes(n);r(t,i,e)})}let K1=null,zs=null;function NR(t,e){if(e){const n=(e&yA)!==0,r=(e&vA)!==0,i=(e&xA)!==0,s=(e&SA)!==0;if(n)return i?"se-resize":s?"ne-resize":"e-resize";if(r)return i?"sw-resize":s?"nw-resize":"w-resize";if(i)return"s-resize";if(s)return"n-resize"}switch(t){case"horizontal":return"ew-resize";case"intersection":return"move";case"vertical":return"ns-resize"}}function wA(){zs!==null&&(document.head.removeChild(zs),K1=null,zs=null)}function ug(t,e,n){const r=NR(t,e);K1!==r&&(K1=r,zs===null&&(zs=document.createElement("style"),n&&(zs.nonce=n),document.head.appendChild(zs)),zs.innerHTML=`*{cursor: ${r}!important;}`)}function MR({defaultSize:t,dragState:e,layout:n,panelData:r,panelIndex:i,precision:s=3}){const o=n[i];let a;return o==null?a=t!==void 0?t.toPrecision(s):"1":r.length===1?a="1":a=o.toPrecision(s),{flexBasis:0,flexGrow:a,flexShrink:1,overflow:"hidden",pointerEvents:e!==null?"none":void 0}}function FR({layout:t,panelConstraints:e}){const n=[...t],r=n.reduce((s,o)=>s+o,0);if(n.length!==e.length)throw new Error(`Invalid ${e.length} panel layout: ${n.map(s=>`${s}%`).join(", ")}`);if(!xr(r,100)){console.warn(`WARNING: Invalid layout total size: ${n.map(s=>`${s}%`).join(", ")}. Layout normalization will be applied.`);for(let s=0;s{const a=i.value;if(!a)return;const l=Oc(e,a);for(let u=0;u{l.forEach(u=>{u.removeAttribute("aria-controls"),u.removeAttribute("aria-valuemax"),u.removeAttribute("aria-valuemin"),u.removeAttribute("aria-valuenow")})})}),aa(o=>{const a=i.value;if(!a)return;const l=t.value;ze(l);const{panelDataArray:u}=l,c=cA(e,a);ze(c!=null,`No group found for id "${e}"`);const f=Oc(e,a);ze(f);const d=f.map(h=>{const p=h.getAttribute("data-panel-resize-handle-id");ze(p);const[m,g]=xR(e,p,u,a);if(m==null||g==null)return()=>{};const b=y=>{if(!y.defaultPrevented)switch(y.key){case"Enter":{y.preventDefault();const x=u.findIndex(S=>S.id===m);if(x>=0){const S=u[x];ze(S);const E=n.value[x],{collapsedSize:C=0,collapsible:w,minSize:A=0}=S.constraints;if(E!=null&&w){const _=qu({delta:xr(E,C)?A-C:C-E,layout:n.value,panelConstraints:u.map(D=>D.constraints),pivotIndices:gA(e,p,a),trigger:"keyboard"});n.value!==_&&s(_)}}break}}};return h.addEventListener("keydown",b),()=>{h.removeEventListener("keydown",b)}});o(()=>{d.forEach(h=>h())})})}function Mx(t){try{if(typeof localStorage<"u")t.getItem=e=>localStorage.getItem(e),t.setItem=(e,n)=>{localStorage.setItem(e,n)};else throw new TypeError("localStorage not supported in this environment")}catch(e){console.error(e),t.getItem=()=>null,t.setItem=()=>{}}}function _A(t){return`reka:${t}`}function CA(t){return t.map(e=>{const{constraints:n,id:r,idIsFromProps:i,order:s}=e;return i?r:s?`${s}:${JSON.stringify(n)}`:JSON.stringify(n)}).sort((e,n)=>e.localeCompare(n)).join(",")}function AA(t,e){try{const n=_A(t),r=e.getItem(n);if(r){const i=JSON.parse(r);if(typeof i=="object"&&i!=null)return i}}catch{}return null}function BR(t,e,n){const r=AA(t,n)??{},i=CA(e);return r[i]??null}function $R(t,e,n,r,i){const s=_A(t),o=CA(e),a=AA(t,i)??{};a[o]={expandToSizes:Object.fromEntries(n.entries()),layout:r};try{i.setItem(s,JSON.stringify(a))}catch(l){console.error(l)}}const zR=100,Gu={getItem:t=>(Mx(Gu),Gu.getItem(t)),setItem:(t,e)=>{Mx(Gu),Gu.setItem(t,e)}},[DA,jR]=Ir("PanelGroup");var VR=z({__name:"SplitterGroup",props:{id:{type:[String,null],required:!1},autoSaveId:{type:[String,null],required:!1,default:null},direction:{type:String,required:!0},keyboardResizeBy:{type:[Number,null],required:!1,default:10},storage:{type:Object,required:!1,default:()=>Gu},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["layout"],setup(t,{emit:e}){const n=t,r=e,i={},{direction:s}=cr(n),o=Wi(n.id,"reka-splitter-group"),a=Jl(),{forwardRef:l,currentElement:u}=Ye(),c=Z(null),f=Z([]),d=Z({}),h=Z(new Map),p=Z(0),m=q(()=>({autoSaveId:n.autoSaveId,direction:n.direction,dragState:c.value,id:o,keyboardResizeBy:n.keyboardResizeBy,storage:n.storage})),g=Z({layout:f.value,panelDataArray:[],panelDataArrayChanged:!1}),b=B=>f.value=B;LR({eagerValuesRef:g,groupId:o,layout:f,panelDataArray:g.value.panelDataArray,setLayout:b,panelGroupElement:u}),aa(()=>{const{panelDataArray:B}=g.value,{autoSaveId:G}=n;if(G){if(f.value.length===0||f.value.length!==B.length)return;let H=i[G];H||(H=CR($R,zR),i[G]=H);const ie=[...B],se=new Map(h.value);H(G,ie,se,f.value,n.storage)}});function y(B,G){const{panelDataArray:H}=g.value,ie=F(H,B);return MR({defaultSize:G,dragState:c.value,layout:f.value,panelData:H,panelIndex:ie})}function x(B){const{panelDataArray:G}=g.value;G.push(B),G.sort((H,ie)=>{const se=H.order,$=ie.order;return se==null&&$==null?0:se==null?-1:$==null?1:se-$}),g.value.panelDataArrayChanged=!0}at(()=>g.value.panelDataArrayChanged,()=>{if(g.value.panelDataArrayChanged){g.value.panelDataArrayChanged=!1;const{autoSaveId:B,storage:G}=m.value,{layout:H,panelDataArray:ie}=g.value;let se=null;if(B){const ee=BR(B,ie,G);ee&&(h.value=new Map(Object.entries(ee.expandToSizes)),se=ee.layout)}se===null&&(se=_R({panelDataArray:ie}));const $=FR({layout:se,panelConstraints:ie.map(ee=>ee.constraints)});kI(H,$)||(b($),g.value.layout=$,r("layout",$),ku(ie,$,d.value))}});function S(B){return function(H){H.preventDefault();const ie=u.value;if(!ie)return()=>null;const{direction:se,dragState:$,id:ee,keyboardResizeBy:pe}=m.value,{layout:fe,panelDataArray:me}=g.value,{initialLayout:Me}=$??{},Nt=gA(ee,B,ie);let ot=ER(H,B,se,$,pe,ie);if(ot===0)return;const Qr=se==="horizontal";a.value==="rtl"&&Qr&&(ot=-ot);const Qi=me.map(nn=>nn.constraints),Jn=qu({delta:ot,layout:Me??fe,panelConstraints:Qi,pivotIndices:Nt,trigger:dA(H)?"keyboard":"mouse-or-touch"}),Kt=!bd(fe,Jn);(hA(H)||pA(H))&&p.value!==ot&&(p.value=ot,Kt?lg(B,0):Qr?lg(B,ot<0?yA:vA):lg(B,ot<0?xA:SA)),Kt&&(b(Jn),g.value.layout=Jn,r("layout",Jn),ku(me,Jn,d.value))}}function E(B,G){const{layout:H,panelDataArray:ie}=g.value,se=ie.map(Me=>Me.constraints),{panelSize:$,pivotIndices:ee}=V(ie,B,H);ze($!=null);const fe=F(ie,B)===ie.length-1?$-G:G-$,me=qu({delta:fe,layout:H,panelConstraints:se,pivotIndices:ee,trigger:"imperative-api"});bd(H,me)||(b(me),g.value.layout=me,r("layout",me),ku(ie,me,d.value))}function C(B,G){const{layout:H,panelDataArray:ie}=g.value,se=F(ie,B);ie[se]=B,g.value.panelDataArrayChanged=!0;const{collapsedSize:$=0,collapsible:ee}=G,{collapsedSize:pe=0,collapsible:fe,maxSize:me=100,minSize:Me=0}=B.constraints,{panelSize:Nt}=V(ie,B,H);Nt!==null&&(ee&&fe&&Nt===$?$!==pe&&E(B,pe):Ntme&&E(B,me))}function w(B,G){const{direction:H}=m.value,{layout:ie}=g.value;if(!u.value)return;const se=B0(B,u.value);ze(se);const $=mA(H,G);c.value={dragHandleId:B,dragHandleRect:se.getBoundingClientRect(),initialCursorPosition:$,initialLayout:ie}}function A(){c.value=null}function _(B){const{panelDataArray:G}=g.value,H=F(G,B);H>=0&&(G.splice(H,1),delete d.value[B.id],g.value.panelDataArrayChanged=!0)}function D(B){const{layout:G,panelDataArray:H}=g.value;if(B.constraints.collapsible){const ie=H.map(pe=>pe.constraints),{collapsedSize:se=0,panelSize:$,pivotIndices:ee}=V(H,B,G);if(ze($!=null,`Panel size not found for panel "${B.id}"`),$!==se){h.value.set(B.id,$);const fe=F(H,B)===H.length-1?$-se:se-$,me=qu({delta:fe,layout:G,panelConstraints:ie,pivotIndices:ee,trigger:"imperative-api"});bd(G,me)||(b(me),g.value.layout=me,r("layout",me),ku(H,me,d.value))}}}function I(B){const{layout:G,panelDataArray:H}=g.value;if(B.constraints.collapsible){const ie=H.map(fe=>fe.constraints),{collapsedSize:se=0,panelSize:$,minSize:ee=0,pivotIndices:pe}=V(H,B,G);if($===se){const fe=h.value.get(B.id),me=fe!=null&&fe>=ee?fe:ee,Nt=F(H,B)===H.length-1?$-me:me-$,ot=qu({delta:Nt,layout:G,panelConstraints:ie,pivotIndices:pe,trigger:"imperative-api"});bd(G,ot)||(b(ot),g.value.layout=ot,r("layout",ot),ku(H,ot,d.value))}}}function N(B){const{layout:G,panelDataArray:H}=g.value,{panelSize:ie}=V(H,B,G);return ze(ie!=null,`Panel size not found for panel "${B.id}"`),ie}function P(B){const{layout:G,panelDataArray:H}=g.value,{collapsedSize:ie=0,collapsible:se,panelSize:$}=V(H,B,G);return se?$===void 0?B.constraints.defaultSize===B.constraints.collapsedSize:$===ie:!1}function R(B){const{layout:G,panelDataArray:H}=g.value,{collapsedSize:ie=0,collapsible:se,panelSize:$}=V(H,B,G);return ze($!=null,`Panel size not found for panel "${B.id}"`),!se||$>ie}jR({direction:s,dragState:c.value,groupId:o,reevaluatePanelConstraints:C,registerPanel:x,registerResizeHandle:S,resizePanel:E,startDragging:w,stopDragging:A,unregisterPanel:_,panelGroupElement:u,collapsePanel:D,expandPanel:I,isPanelCollapsed:P,isPanelExpanded:R,getPanelSize:N,getPanelStyle:y});function F(B,G){return B.findIndex(H=>H===G||H.id===G.id)}function V(B,G,H){const ie=F(B,G),$=ie===B.length-1?[ie-1,ie]:[ie,ie+1],ee=H[ie];return{...G.constraints,panelSize:ee,pivotIndices:$}}return(B,G)=>(T(),L(v(lt),{ref:v(l),as:B.as,"as-child":B.asChild,style:_a({display:"flex",flexDirection:v(s)==="horizontal"?"row":"column",height:"100%",overflow:"hidden",width:"100%"}),"data-panel-group":"","data-orientation":v(s),"data-panel-group-id":v(o)},{default:O(()=>[Q(B.$slots,"default",{layout:f.value})]),_:3},8,["as","as-child","style","data-orientation","data-panel-group-id"]))}}),UR=VR,HR=z({__name:"SplitterPanel",props:{collapsedSize:{type:Number,required:!1},collapsible:{type:Boolean,required:!1},defaultSize:{type:Number,required:!1},id:{type:String,required:!1},maxSize:{type:Number,required:!1},minSize:{type:Number,required:!1},order:{type:Number,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["collapse","expand","resize"],setup(t,{expose:e,emit:n}){const r=t,i=n,s=DA();if(s===null)throw new Error("SplitterPanel components must be rendered within a SplitterGroup container");const{collapsePanel:o,expandPanel:a,getPanelSize:l,getPanelStyle:u,isPanelCollapsed:c,resizePanel:f,groupId:d,reevaluatePanelConstraints:h,registerPanel:p,unregisterPanel:m}=s,g=Wi(r.id,"reka-splitter-panel"),b=q(()=>({callbacks:{onCollapse:()=>i("collapse"),onExpand:()=>i("expand"),onResize:(...A)=>i("resize",...A)},constraints:{collapsedSize:r.collapsedSize&&Number.parseFloat(r.collapsedSize.toFixed(nv)),collapsible:r.collapsible,defaultSize:r.defaultSize,maxSize:r.maxSize,minSize:r.minSize},id:g,idIsFromProps:r.id!==void 0,order:r.order}));at(()=>b.value.constraints,(A,_)=>{(_.collapsedSize!==A.collapsedSize||_.collapsible!==A.collapsible||_.maxSize!==A.maxSize||_.minSize!==A.minSize)&&h(b.value,_)},{deep:!0}),gn(()=>{p(b.value)}),wo(()=>{m(b.value)});const y=q(()=>u(b.value,r.defaultSize)),x=q(()=>c(b.value)),S=q(()=>!x.value);function E(){o(b.value)}function C(){a(b.value)}function w(A){f(b.value,A)}return e({collapse:E,expand:C,getSize(){return l(b.value)},resize:w,isCollapsed:x,isExpanded:S}),(A,_)=>(T(),L(v(lt),{id:v(g),style:_a(y.value),as:A.as,"as-child":A.asChild,"data-panel":"","data-panel-collapsible":A.collapsible||void 0,"data-panel-group-id":v(d),"data-panel-id":v(g),"data-panel-size":Number.parseFloat(`${y.value.flexGrow}`).toFixed(1),"data-state":A.collapsible?x.value?"collapsed":"expanded":void 0},{default:O(()=>[Q(A.$slots,"default",{isCollapsed:x.value,isExpanded:S.value,expand:C,collapse:E,resize:w})]),_:3},8,["id","style","as","as-child","data-panel-collapsible","data-panel-group-id","data-panel-id","data-panel-size","data-state"]))}}),qR=HR;function GR({disabled:t,handleId:e,resizeHandler:n,panelGroupElement:r}){aa(i=>{const s=r.value;if(t.value||n.value===null||s===null)return;const o=B0(e,s);if(o==null)return;const a=l=>{var u;if(!l.defaultPrevented)switch(l.key){case"ArrowDown":case"ArrowLeft":case"ArrowRight":case"ArrowUp":case"End":case"Home":{l.preventDefault(),(u=n.value)==null||u.call(n,l);break}case"F6":{l.preventDefault();const c=o.getAttribute("data-panel-group-id");ze(c);const f=Oc(c,s),d=fA(c,e,s);ze(d!==null);const h=l.shiftKey?d>0?d-1:f.length-1:d+1{o.removeEventListener("keydown",a)})})}var WR=z({__name:"SplitterResizeHandle",props:{id:{type:String,required:!1},hitAreaMargins:{type:Object,required:!1},tabindex:{type:Number,required:!1,default:0},disabled:{type:Boolean,required:!1},nonce:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["dragging"],setup(t,{emit:e}){const n=t,r=e,{forwardRef:i,currentElement:s}=Ye(),{disabled:o}=cr(n),a=DA();if(a===null)throw new Error("PanelResizeHandle components must be rendered within a PanelGroup container");const{direction:l,groupId:u,registerResizeHandle:c,startDragging:f,stopDragging:d,panelGroupElement:h}=a,p=Wi(n.id,"reka-splitter-resize-handle"),m=Z("inactive"),g=Z(!1),b=Z(null),{nonce:y}=cr(n),x=JC(y);return at(o,()=>{Of&&(o.value?b.value=null:b.value=c(p))},{immediate:!0}),aa(S=>{var w,A;if(o.value||b.value===null)return;const E=s.value;if(!E)return;ze(E);const C=(_,D,I)=>{var N;if(D)switch(_){case"down":{m.value="drag",f(p,I),r("dragging",!0);break}case"move":{m.value!=="drag"&&(m.value="hover"),(N=b.value)==null||N.call(b,I);break}case"up":{m.value="hover",d(),r("dragging",!1);break}}else m.value="inactive"};S(RR(p,E,l,{coarse:((w=n.hitAreaMargins)==null?void 0:w.coarse)??15,fine:((A=n.hitAreaMargins)==null?void 0:A.fine)??5},x,C))}),GR({disabled:o,resizeHandler:b,handleId:p,panelGroupElement:h}),(S,E)=>(T(),L(v(lt),{id:v(p),ref:v(i),style:{touchAction:"none",userSelect:"none"},as:S.as,"as-child":S.asChild,role:"separator","data-resize-handle":"",tabindex:S.tabindex,"data-state":m.value,"data-disabled":v(o)?"":void 0,"data-orientation":v(l),"data-panel-group-id":v(u),"data-resize-handle-active":m.value==="drag"?"pointer":g.value?"keyboard":void 0,"data-resize-handle-state":m.value,"data-panel-resize-handle-enabled":!v(o),"data-panel-resize-handle-id":v(p),onBlur:E[0]||(E[0]=C=>g.value=!1),onFocus:E[1]||(E[1]=C=>g.value=!1)},{default:O(()=>[Q(S.$slots,"default")]),_:3},8,["id","as","as-child","tabindex","data-state","data-disabled","data-orientation","data-panel-group-id","data-resize-handle-active","data-resize-handle-state","data-panel-resize-handle-enabled","data-panel-resize-handle-id"]))}}),KR=WR;const[XR,YR]=Ir("SwitchRoot");var JR=z({__name:"SwitchRoot",props:{defaultValue:{type:Boolean,required:!1},modelValue:{type:[Boolean,null],required:!1,default:void 0},disabled:{type:Boolean,required:!1},id:{type:String,required:!1},value:{type:String,required:!1,default:"on"},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"button"},name:{type:String,required:!1},required:{type:Boolean,required:!1}},emits:["update:modelValue"],setup(t,{emit:e}){const n=t,r=e,{disabled:i}=cr(n),s=wa(n,"modelValue",r,{defaultValue:n.defaultValue,passive:n.modelValue===void 0});function o(){i.value||(s.value=!s.value)}const{forwardRef:a,currentElement:l}=Ye(),u=OI(l),c=q(()=>{var f;return n.id&&l.value?(f=document.querySelector(`[for="${n.id}"]`))==null?void 0:f.innerText:void 0});return YR({modelValue:s,toggleCheck:o,disabled:i}),(f,d)=>(T(),L(v(lt),Ce(f.$attrs,{id:f.id,ref:v(a),role:"switch",type:f.as==="button"?"button":void 0,value:f.value,"aria-label":f.$attrs["aria-label"]||c.value,"aria-checked":v(s),"aria-required":f.required,"data-state":v(s)?"checked":"unchecked","data-disabled":v(i)?"":void 0,"as-child":f.asChild,as:f.as,disabled:v(i),onClick:o,onKeydown:qy(eo(o,["prevent"]),["enter"])}),{default:O(()=>[Q(f.$slots,"default",{modelValue:v(s)}),v(u)&&f.name?(T(),L(v(TI),{key:0,type:"checkbox",name:f.name,disabled:v(i),required:f.required,value:f.value,checked:!!v(s)},null,8,["name","disabled","required","value","checked"])):we("v-if",!0)]),_:3},16,["id","type","value","aria-label","aria-checked","aria-required","data-state","data-disabled","as-child","as","disabled","onKeydown"]))}}),ZR=JR,QR=z({__name:"SwitchThumb",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"span"}},setup(t){const e=XR();return Ye(),(n,r)=>{var i;return T(),L(v(lt),{"data-state":(i=v(e).modelValue)!=null&&i.value?"checked":"unchecked","data-disabled":v(e).disabled.value?"":void 0,"as-child":n.asChild,as:n.as},{default:O(()=>[Q(n.$slots,"default")]),_:3},8,["data-state","data-disabled","as-child","as"])}}}),eN=QR;const[sv,tN]=Ir("TabsRoot");var nN=z({__name:"TabsRoot",props:{defaultValue:{type:null,required:!1},orientation:{type:String,required:!1,default:"horizontal"},dir:{type:String,required:!1},activationMode:{type:String,required:!1,default:"automatic"},modelValue:{type:null,required:!1},unmountOnHide:{type:Boolean,required:!1,default:!0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["update:modelValue"],setup(t,{emit:e}){const n=t,r=e,{orientation:i,unmountOnHide:s,dir:o}=cr(n),a=Jl(o);Ye();const l=wa(n,"modelValue",r,{defaultValue:n.defaultValue,passive:n.modelValue===void 0}),u=Z();return tN({modelValue:l,changeModelValue:c=>{l.value=c},orientation:i,dir:a,unmountOnHide:s,activationMode:n.activationMode,baseId:Wi(void 0,"reka-tabs"),tabsList:u}),(c,f)=>(T(),L(v(lt),{dir:v(a),"data-orientation":v(i),"as-child":c.asChild,as:c.as},{default:O(()=>[Q(c.$slots,"default",{modelValue:v(l)})]),_:3},8,["dir","data-orientation","as-child","as"]))}}),rN=nN;function kA(t,e){return`${t}-trigger-${e}`}function OA(t,e){return`${t}-content-${e}`}var iN=z({__name:"TabsContent",props:{value:{type:[String,Number],required:!0},forceMount:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(t){const e=t,{forwardRef:n}=Ye(),r=sv(),i=q(()=>kA(r.baseId,e.value)),s=q(()=>OA(r.baseId,e.value)),o=q(()=>e.value===r.modelValue.value),a=Z(o.value);return gn(()=>{requestAnimationFrame(()=>{a.value=!1})}),(l,u)=>(T(),L(v(Yl),{present:l.forceMount||o.value,"force-mount":""},{default:O(({present:c})=>[k(v(lt),{id:s.value,ref:v(n),"as-child":l.asChild,as:l.as,role:"tabpanel","data-state":o.value?"active":"inactive","data-orientation":v(r).orientation.value,"aria-labelledby":i.value,hidden:!c,tabindex:"0",style:_a({animationDuration:a.value?"0s":void 0})},{default:O(()=>[!v(r).unmountOnHide.value||c?Q(l.$slots,"default",{key:0}):we("v-if",!0)]),_:2},1032,["id","as-child","as","data-state","data-orientation","aria-labelledby","hidden","style"])]),_:3},8,["present"]))}}),sN=iN,oN=z({__name:"TabsList",props:{loop:{type:Boolean,required:!1,default:!0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(t){const e=t,{loop:n}=cr(e),{forwardRef:r,currentElement:i}=Ye(),s=sv();return s.tabsList=i,(o,a)=>(T(),L(v(nA),{"as-child":"",orientation:v(s).orientation.value,dir:v(s).dir.value,loop:v(n)},{default:O(()=>[k(v(lt),{ref:v(r),role:"tablist","as-child":o.asChild,as:o.as,"aria-orientation":v(s).orientation.value},{default:O(()=>[Q(o.$slots,"default")]),_:3},8,["as-child","as","aria-orientation"])]),_:3},8,["orientation","dir","loop"]))}}),aN=oN,lN=z({__name:"TabsTrigger",props:{value:{type:[String,Number],required:!0},disabled:{type:Boolean,required:!1,default:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"button"}},setup(t){const e=t,{forwardRef:n}=Ye(),r=sv(),i=q(()=>kA(r.baseId,e.value)),s=q(()=>OA(r.baseId,e.value)),o=q(()=>e.value===r.modelValue.value);return(a,l)=>(T(),L(v(GP),{"as-child":"",focusable:!a.disabled,active:o.value},{default:O(()=>[k(v(lt),{id:i.value,ref:v(n),role:"tab",type:a.as==="button"?"button":void 0,as:a.as,"as-child":a.asChild,"aria-selected":o.value?"true":"false","aria-controls":s.value,"data-state":o.value?"active":"inactive",disabled:a.disabled,"data-disabled":a.disabled?"":void 0,"data-orientation":v(r).orientation.value,onMousedown:l[0]||(l[0]=eo(u=>{!a.disabled&&u.ctrlKey===!1?v(r).changeModelValue(a.value):u.preventDefault()},["left"])),onKeydown:l[1]||(l[1]=qy(u=>v(r).changeModelValue(a.value),["enter","space"])),onFocus:l[2]||(l[2]=()=>{const u=v(r).activationMode!=="manual";!o.value&&!a.disabled&&u&&v(r).changeModelValue(a.value)})},{default:O(()=>[Q(a.$slots,"default")]),_:3},8,["id","type","as","as-child","aria-selected","aria-controls","data-state","disabled","data-disabled","data-orientation"])]),_:3},8,["focusable","active"]))}}),uN=lN;const cN=z({__name:"AppSidebarGroupLabel",props:{class:{},asChild:{type:Boolean},as:{}},setup(t){const e=t;return(n,r)=>(T(),L(v(lt),{"data-sidebar":"group-label",as:t.as,"as-child":t.asChild,class:Se(v(ke)("text-sidebar-foreground/70 ring-sidebar-ring flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium transition-[margin,opa] duration-200 ease-linear outline-none focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0",e.class))},{default:O(()=>[Q(n.$slots,"default")]),_:3},8,["as","as-child","class"]))}});var _r=(t=>(t.Text="text",t.File="file",t))(_r||{});function fN(t){if(typeof t!="string")return null;try{return JSON.parse(t)}catch{return null}}const dN=Ca("errors",()=>{const t=Z(null),e=()=>{var i;t.value=fN(((i=window.Nimbus)==null?void 0:i.globalException)??null)},n=()=>{t.value=null},r=q(()=>t.value!==null);return{globalError:t,initializeGlobalErrors:e,clearGlobalError:n,hasGlobalError:r}}),hN=Ca("sharedState",()=>{const t=Z(null),e=Z(!1),n=q(()=>t.value!==null),r=q(()=>e.value),i=q(()=>{var c;return((c=t.value)==null?void 0:c.routeExists)??!0}),s=q(()=>{var c;return(c=t.value)==null?void 0:c.payload}),o=q(()=>{var c;return(c=t.value)==null?void 0:c.error});return{sharedState:t,isRestoredFromShare:e,hasSharedState:n,wasImportedFromShare:r,routeExists:i,sharedPayload:s,sharedError:o,initializeFromWindow:()=>{var f;const c=(f=window.Nimbus)==null?void 0:f.sharedState;c&&(t.value=c,e.value=!0)},markAsConsumed:()=>{e.value=!0},clearSharedState:()=>{t.value=null,e.value=!1}}});/** +var fI=Object.defineProperty;var dI=(t,e,n)=>e in t?fI(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var X=(t,e,n)=>dI(t,typeof e!="symbol"?e+"":e,n);import{d as z,u as _a,t as cr,c as Ir,a as Ye,b as L,o as T,w as D,r as Q,e as v,P as lt,f as Wi,g as Z,h as q,i as nt,j as gn,k as G1,l as k,m as Ce,n as we,p as Yl,q as kr,s as Jl,v as qy,x as zC,E as hI,y as pI,z as wo,A as mI,B as gI,C as Yn,D as Pr,F as bI,G as yI,H as vI,I as xI,J as SI,K as EI,L as wI,M as _I,N as CI,O as Yr,Q as eo,T as AI,R as _l,S as DI,U as Gy,V as _o,W as co,X as Wy,Y as kI,Z as la,_ as jC,$ as K,a0 as M,a1 as ne,a2 as Qe,a3 as OI,a4 as TI,a5 as II,a6 as Se,a7 as ke,a8 as Ca,a9 as rt,aa as kc,ab as PI,ac as RI,ad as NI,ae as Or,af as T0,ag as Dx,ah as MI,ai as FI,aj as Je,ak as Ky,al as I0,am as ua,an as LI,ao as BI,ap as VC,aq as Aa,ar as $I,as as zI,at as jI,au as VI,av as de,aw as P0,ax as UI,ay as UC,az as HI,aA as Xy,aB as _n,aC as fo,aD as Yy,aE as Da,aF as Ki,aG as kx,aH as sg,aI as Co,aJ as og,aK as ag,aL as Jy,aM as qI,aN as GI,aO as WI,aP as HC,aQ as Eh,aR as Cl,aS as qC,aT as Al,aU as GC,aV as Ox,aW as KI,aX as XI,aY as md,aZ as YI,a_ as ac,a$ as ms,b0 as on,b1 as gd,b2 as Zy,b3 as JI,b4 as WC,b5 as to,b6 as ZI,b7 as KC,b8 as QI,b9 as qs,ba as XC,bb as Tx,bc as eP,bd as tP,be as nP,bf as rP,bg as iP,bh as R0,bi as sP,bj as oP,bk as aP,bl as YC,bm as JC,bn as W1,bo as lp,bp as lP,bq as uP,br as cP,bs as fP,bt as dP,bu as hP}from"./app-9y4VsaPU.js";import{i as pP,u as mP,a as gP,g as bP,F as yP,b as vP,c as xP,L as SP,f as EP,d as K1,S as wP,I as _P,e as CP,h as AP,j as ZC,k as Xi,D as DP,_ as gt,l as Zl,m as Ql,n as eu,o as Es,p as tu,q as Qy,r as Cf,s as Af,t as Df,v as kf,w as N0,x as nu,y as ev,C as QC,z as eA,A as kP,B as OP,E as TP,X as IP}from"./AppPopoverTrigger.vue_vue_type_script_setup_true_lang-nBfag7CV.js";/* empty css */var jt=(t=>(t.Object="object",t.Array="array",t.String="string",t.Constant="constant",t.Uninitialized="uninitialized",t.Number="number",t.Closure="closure",t.Unknown="unknown",t))(jt||{}),wh=(t=>(t.Uuid="UUID",t.Email="Email",t.String="String",t))(wh||{});const lg={DELETION_CONFIRMATION_TIMEOUT:1200,SYNC_DEBOUNCE_DELAY:300},Of=typeof document<"u",PP=["INPUT","TEXTAREA"];function RP(t,e,n,r={}){if(!e||r.enableIgnoredElement&&PP.includes(e.nodeName))return null;const{arrowKeyOptions:i="both",attributeName:s="[data-reka-collection-item]",itemsArray:o=[],loop:a=!0,dir:l="ltr",preventScroll:u=!0,focus:c=!1}=r,[f,d,h,p,m,g]=[t.key==="ArrowRight",t.key==="ArrowLeft",t.key==="ArrowUp",t.key==="ArrowDown",t.key==="Home",t.key==="End"],b=h||p,y=f||d;if(!m&&!g&&(!b&&!y||i==="vertical"&&y||i==="horizontal"&&b))return null;const x=n?Array.from(n.querySelectorAll(s)):o;if(!x.length)return null;u&&t.preventDefault();let S=null;return y||b?S=tA(x,e,{goForward:b?p:l==="ltr"?f:d,loop:a}):m?S=x.at(0)||null:g&&(S=x.at(-1)||null),c&&(S==null||S.focus()),S}function tA(t,e,n,r=t.length){if(--r===0)return null;const i=t.indexOf(e),s=n.goForward?i+1:i-1;if(!n.loop&&(s<0||s>=t.length))return null;const o=(s+t.length)%t.length,a=t[o];return a?a.hasAttribute("disabled")&&a.getAttribute("disabled")!=="false"?tA(t,a,n,r):a:null}const[nA,NP]=Ir("CollapsibleRoot");var MP=z({__name:"CollapsibleRoot",props:{defaultOpen:{type:Boolean,required:!1,default:!1},open:{type:Boolean,required:!1,default:void 0},disabled:{type:Boolean,required:!1},unmountOnHide:{type:Boolean,required:!1,default:!0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["update:open"],setup(t,{expose:e,emit:n}){const r=t,s=_a(r,"open",n,{defaultValue:r.defaultOpen,passive:r.open===void 0}),{disabled:o,unmountOnHide:a}=cr(r);return NP({contentId:"",disabled:o,open:s,unmountOnHide:a,onOpenToggle:()=>{o.value||(s.value=!s.value)}}),e({open:s}),Ye(),(l,u)=>(T(),L(v(lt),{as:l.as,"as-child":r.asChild,"data-state":v(s)?"open":"closed","data-disabled":v(o)?"":void 0},{default:D(()=>[Q(l.$slots,"default",{open:v(s)})]),_:3},8,["as","as-child","data-state","data-disabled"]))}}),FP=MP,LP=z({inheritAttrs:!1,__name:"CollapsibleContent",props:{forceMount:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["contentFound"],setup(t,{emit:e}){const n=t,r=e,i=nA();i.contentId||(i.contentId=Wi(void 0,"reka-collapsible-content"));const s=Z(),{forwardRef:o,currentElement:a}=Ye(),l=Z(0),u=Z(0),c=q(()=>i.open.value),f=Z(c.value),d=Z();nt(()=>{var p;return[c.value,(p=s.value)==null?void 0:p.present]},async()=>{await kr();const p=a.value;if(!p)return;d.value=d.value||{transitionDuration:p.style.transitionDuration,animationName:p.style.animationName},p.style.transitionDuration="0s",p.style.animationName="none";const m=p.getBoundingClientRect();u.value=m.height,l.value=m.width,f.value||(p.style.transitionDuration=d.value.transitionDuration,p.style.animationName=d.value.animationName)},{immediate:!0});const h=q(()=>f.value&&i.open.value);return gn(()=>{requestAnimationFrame(()=>{f.value=!1})}),G1(a,"beforematch",p=>{requestAnimationFrame(()=>{i.onOpenToggle(),r("contentFound")})}),(p,m)=>(T(),L(v(Yl),{ref_key:"presentRef",ref:s,present:p.forceMount||v(i).open.value,"force-mount":!0},{default:D(({present:g})=>{var b;return[k(v(lt),Ce(p.$attrs,{id:v(i).contentId,ref:v(o),"as-child":n.asChild,as:p.as,hidden:g?void 0:v(i).unmountOnHide.value?"":"until-found","data-state":h.value?void 0:v(i).open.value?"open":"closed","data-disabled":(b=v(i).disabled)!=null&&b.value?"":void 0,style:{"--reka-collapsible-content-height":`${u.value}px`,"--reka-collapsible-content-width":`${l.value}px`}}),{default:D(()=>[!v(i).unmountOnHide.value||g?Q(p.$slots,"default",{key:0}):we("v-if",!0)]),_:2},1040,["id","as-child","as","hidden","data-state","data-disabled","style"])]}),_:3},8,["present"]))}}),BP=LP,$P=z({__name:"CollapsibleTrigger",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"button"}},setup(t){const e=t;Ye();const n=nA();return(r,i)=>{var s,o;return T(),L(v(lt),{type:r.as==="button"?"button":void 0,as:r.as,"as-child":e.asChild,"aria-controls":v(n).contentId,"aria-expanded":v(n).open.value,"data-state":v(n).open.value?"open":"closed","data-disabled":(s=v(n).disabled)!=null&&s.value?"":void 0,disabled:(o=v(n).disabled)==null?void 0:o.value,onClick:v(n).onOpenToggle},{default:D(()=>[Q(r.$slots,"default")]),_:3},8,["type","as","as-child","aria-controls","aria-expanded","data-state","data-disabled","disabled","onClick"])}}}),zP=$P,jP=z({__name:"DialogTrigger",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"button"}},setup(t){const e=t,n=pP(),{forwardRef:r,currentElement:i}=Ye();return n.contentId||(n.contentId=Wi(void 0,"reka-dialog-content")),gn(()=>{n.triggerElement.value=i.value}),(s,o)=>(T(),L(v(lt),Ce(e,{ref:v(r),type:s.as==="button"?"button":void 0,"aria-haspopup":"dialog","aria-expanded":v(n).open.value||!1,"aria-controls":v(n).open.value?v(n).contentId:void 0,"data-state":v(n).open.value?"open":"closed",onClick:v(n).onOpenToggle}),{default:D(()=>[Q(s.$slots,"default")]),_:3},16,["type","aria-expanded","aria-controls","data-state","onClick"]))}}),VP=jP;const[UP,HP]=Ir("RovingFocusGroup");var qP=z({__name:"RovingFocusGroup",props:{orientation:{type:String,required:!1,default:void 0},dir:{type:String,required:!1},loop:{type:Boolean,required:!1,default:!1},currentTabStopId:{type:[String,null],required:!1},defaultCurrentTabStopId:{type:String,required:!1},preventScrollOnEntryFocus:{type:Boolean,required:!1,default:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["entryFocus","update:currentTabStopId"],setup(t,{expose:e,emit:n}){const r=t,i=n,{loop:s,orientation:o,dir:a}=cr(r),l=Jl(a),u=_a(r,"currentTabStopId",i,{defaultValue:r.defaultCurrentTabStopId,passive:r.currentTabStopId===void 0}),c=Z(!1),f=Z(!1),d=Z(0),{getItems:h,CollectionSlot:p}=qy({isProvider:!0});function m(b){const y=!f.value;if(b.currentTarget&&b.target===b.currentTarget&&y&&!c.value){const x=new CustomEvent(hI,pI);if(b.currentTarget.dispatchEvent(x),i("entryFocus",x),!x.defaultPrevented){const S=h().map(_=>_.ref).filter(_=>_.dataset.disabled!==""),E=S.find(_=>_.getAttribute("data-active")===""),C=S.find(_=>_.getAttribute("data-highlighted")===""),w=S.find(_=>_.id===u.value),A=[E,C,w,...S].filter(Boolean);zC(A,r.preventScrollOnEntryFocus)}}f.value=!1}function g(){setTimeout(()=>{f.value=!1},1)}return e({getItems:h}),HP({loop:s,dir:l,orientation:o,currentTabStopId:u,onItemFocus:b=>{u.value=b},onItemShiftTab:()=>{c.value=!0},onFocusableItemAdd:()=>{d.value++},onFocusableItemRemove:()=>{d.value--}}),(b,y)=>(T(),L(v(p),null,{default:D(()=>[k(v(lt),{tabindex:c.value||d.value===0?-1:0,"data-orientation":v(o),as:b.as,"as-child":b.asChild,dir:v(l),style:{outline:"none"},onMousedown:y[0]||(y[0]=x=>f.value=!0),onMouseup:g,onFocus:m,onBlur:y[1]||(y[1]=x=>c.value=!1)},{default:D(()=>[Q(b.$slots,"default")]),_:3},8,["tabindex","data-orientation","as","as-child","dir"])]),_:3}))}}),rA=qP,GP=z({__name:"RovingFocusItem",props:{tabStopId:{type:String,required:!1},focusable:{type:Boolean,required:!1,default:!0},active:{type:Boolean,required:!1},allowShiftKey:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"span"}},setup(t){const e=t,n=UP(),r=Wi(),i=q(()=>e.tabStopId||r),s=q(()=>n.currentTabStopId.value===i.value),{getItems:o,CollectionItem:a}=qy();gn(()=>{e.focusable&&n.onFocusableItemAdd()}),wo(()=>{e.focusable&&n.onFocusableItemRemove()});function l(u){if(u.key==="Tab"&&u.shiftKey){n.onItemShiftTab();return}if(u.target!==u.currentTarget)return;const c=mI(u,n.orientation.value,n.dir.value);if(c!==void 0){if(u.metaKey||u.ctrlKey||u.altKey||!e.allowShiftKey&&u.shiftKey)return;u.preventDefault();let f=[...o().map(d=>d.ref).filter(d=>d.dataset.disabled!=="")];if(c==="last")f.reverse();else if(c==="prev"||c==="next"){c==="prev"&&f.reverse();const d=f.indexOf(u.currentTarget);f=n.loop.value?gI(f,d+1):f.slice(d+1)}kr(()=>zC(f))}}return(u,c)=>(T(),L(v(a),null,{default:D(()=>[k(v(lt),{tabindex:s.value?0:-1,"data-orientation":v(n).orientation.value,"data-active":u.active?"":void 0,"data-disabled":u.focusable?void 0:"",as:u.as,"as-child":u.asChild,onMousedown:c[0]||(c[0]=f=>{u.focusable?v(n).onItemFocus(i.value):f.preventDefault()}),onFocus:c[1]||(c[1]=f=>v(n).onItemFocus(i.value)),onKeydown:l},{default:D(()=>[Q(u.$slots,"default")]),_:3},8,["tabindex","data-orientation","data-active","data-disabled","as","as-child"])]),_:3}))}}),WP=GP,KP=z({__name:"MenuAnchor",props:{reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(t){const e=t;return(n,r)=>(T(),L(v(bI),Yn(Pr(e)),{default:D(()=>[Q(n.$slots,"default")]),_:3},16))}}),XP=KP;function YP(){const t=Z(!1);return gn(()=>{G1("keydown",()=>{t.value=!0},{capture:!0,passive:!0}),G1(["pointerdown","pointermove"],()=>{t.value=!1},{capture:!0,passive:!0})}),t}const JP=yI(YP),[M0,ZP]=Ir(["MenuRoot","MenuSub"],"MenuContext"),[tv,QP]=Ir("MenuRoot");var e5=z({__name:"MenuRoot",props:{open:{type:Boolean,required:!1,default:!1},dir:{type:String,required:!1},modal:{type:Boolean,required:!1,default:!0}},emits:["update:open"],setup(t,{emit:e}){const n=t,r=e,{modal:i,dir:s}=cr(n),o=Jl(s),a=_a(n,"open",r),l=Z(),u=JP();return ZP({open:a,onOpenChange:c=>{a.value=c},content:l,onContentChange:c=>{l.value=c}}),QP({onClose:()=>{a.value=!1},isUsingKeyboardRef:u,dir:o,modal:i}),(c,f)=>(T(),L(v(vI),null,{default:D(()=>[Q(c.$slots,"default")]),_:3}))}}),t5=e5;const[iA,n5]=Ir("MenuContent");var r5=z({__name:"MenuContentImpl",props:xI({loop:{type:Boolean,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1},disableOutsideScroll:{type:Boolean,required:!1},trapFocus:{type:Boolean,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},{..._I}),emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","entryFocus","openAutoFocus","closeAutoFocus","dismiss"],setup(t,{emit:e}){const n=t,r=e,i=M0(),s=tv(),{trapFocus:o,disableOutsidePointerEvents:a,loop:l}=cr(n);mP(),gP(a.value);const u=Z(""),c=Z(0),f=Z(0),d=Z(null),h=Z("right"),p=Z(0),m=Z(null),g=Z(),{forwardRef:b,currentElement:y}=Ye(),{handleTypeaheadSearch:x}=SI();nt(y,_=>{i.onContentChange(_)}),wo(()=>{window.clearTimeout(c.value)});function S(_){var I,N;return h.value===((I=d.value)==null?void 0:I.side)&&vP(_,(N=d.value)==null?void 0:N.area)}async function E(_){var O;r("openAutoFocus",_),!_.defaultPrevented&&(_.preventDefault(),(O=y.value)==null||O.focus({preventScroll:!0}))}function C(_){var B;if(_.defaultPrevented)return;const I=_.target.closest("[data-reka-menu-content]")===_.currentTarget,N=_.ctrlKey||_.altKey||_.metaKey,P=_.key.length===1,R=RP(_,CI(),y.value,{loop:l.value,arrowKeyOptions:"vertical",dir:s==null?void 0:s.dir.value,focus:!0,attributeName:"[data-reka-collection-item]:not([data-disabled])"});if(R)return R==null?void 0:R.focus();if(_.code==="Space")return;const F=((B=g.value)==null?void 0:B.getItems())??[];if(I&&(_.key==="Tab"&&_.preventDefault(),!N&&P&&x(_.key,F)),_.target!==y.value||!xP.includes(_.key))return;_.preventDefault();const V=[...F.map(G=>G.ref)];SP.includes(_.key)&&V.reverse(),EP(V)}function w(_){var O,I;(I=(O=_==null?void 0:_.currentTarget)==null?void 0:O.contains)!=null&&I.call(O,_.target)||(window.clearTimeout(c.value),u.value="")}function A(_){var N;if(!K1(_))return;const O=_.target,I=p.value!==_.clientX;if((N=_==null?void 0:_.currentTarget)!=null&&N.contains(O)&&I){const P=_.clientX>p.value?"right":"left";h.value=P,p.value=_.clientX}}return n5({onItemEnter:_=>!!S(_),onItemLeave:_=>{var O;S(_)||((O=y.value)==null||O.focus(),m.value=null)},onTriggerLeave:_=>!!S(_),searchRef:u,pointerGraceTimerRef:f,onPointerGraceIntentChange:_=>{d.value=_}}),(_,O)=>(T(),L(v(yP),{"as-child":"",trapped:v(o),onMountAutoFocus:E,onUnmountAutoFocus:O[7]||(O[7]=I=>r("closeAutoFocus",I))},{default:D(()=>[k(v(EI),{"as-child":"","disable-outside-pointer-events":v(a),onEscapeKeyDown:O[2]||(O[2]=I=>r("escapeKeyDown",I)),onPointerDownOutside:O[3]||(O[3]=I=>r("pointerDownOutside",I)),onFocusOutside:O[4]||(O[4]=I=>r("focusOutside",I)),onInteractOutside:O[5]||(O[5]=I=>r("interactOutside",I)),onDismiss:O[6]||(O[6]=I=>r("dismiss"))},{default:D(()=>[k(v(rA),{ref_key:"rovingFocusGroupRef",ref:g,"current-tab-stop-id":m.value,"onUpdate:currentTabStopId":O[0]||(O[0]=I=>m.value=I),"as-child":"",orientation:"vertical",dir:v(s).dir.value,loop:v(l),onEntryFocus:O[1]||(O[1]=I=>{r("entryFocus",I),v(s).isUsingKeyboardRef.value||I.preventDefault()})},{default:D(()=>[k(v(wI),{ref:v(b),role:"menu",as:_.as,"as-child":_.asChild,"aria-orientation":"vertical","data-reka-menu-content":"","data-state":v(bP)(v(i).open.value),dir:v(s).dir.value,side:_.side,"side-offset":_.sideOffset,align:_.align,"align-offset":_.alignOffset,"avoid-collisions":_.avoidCollisions,"collision-boundary":_.collisionBoundary,"collision-padding":_.collisionPadding,"arrow-padding":_.arrowPadding,"prioritize-position":_.prioritizePosition,"position-strategy":_.positionStrategy,"update-position-strategy":_.updatePositionStrategy,sticky:_.sticky,"hide-when-detached":_.hideWhenDetached,reference:_.reference,onKeydown:C,onBlur:w,onPointermove:A},{default:D(()=>[Q(_.$slots,"default")]),_:3},8,["as","as-child","data-state","dir","side","side-offset","align","align-offset","avoid-collisions","collision-boundary","collision-padding","arrow-padding","prioritize-position","position-strategy","update-position-strategy","sticky","hide-when-detached","reference"])]),_:3},8,["current-tab-stop-id","dir","loop"])]),_:3},8,["disable-outside-pointer-events"])]),_:3},8,["trapped"]))}}),sA=r5,i5=z({inheritAttrs:!1,__name:"MenuItemImpl",props:{disabled:{type:Boolean,required:!1},textValue:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(t){const e=t,n=iA(),{forwardRef:r}=Ye(),{CollectionItem:i}=qy(),s=Z(!1);async function o(l){if(!l.defaultPrevented&&K1(l)){if(e.disabled)n.onItemLeave(l);else if(!n.onItemEnter(l)){const c=l.currentTarget;c==null||c.focus({preventScroll:!0})}}}async function a(l){await kr(),!l.defaultPrevented&&K1(l)&&n.onItemLeave(l)}return(l,u)=>(T(),L(v(i),{value:{textValue:l.textValue}},{default:D(()=>[k(v(lt),Ce({ref:v(r),role:"menuitem",tabindex:"-1"},l.$attrs,{as:l.as,"as-child":l.asChild,"aria-disabled":l.disabled||void 0,"data-disabled":l.disabled?"":void 0,"data-highlighted":s.value?"":void 0,onPointermove:o,onPointerleave:a,onFocus:u[0]||(u[0]=async c=>{await kr(),!(c.defaultPrevented||l.disabled)&&(s.value=!0)}),onBlur:u[1]||(u[1]=async c=>{await kr(),!c.defaultPrevented&&(s.value=!1)})}),{default:D(()=>[Q(l.$slots,"default")]),_:3},16,["as","as-child","aria-disabled","data-disabled","data-highlighted"])]),_:3},8,["value"]))}}),s5=i5,o5=z({__name:"MenuItem",props:{disabled:{type:Boolean,required:!1},textValue:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["select"],setup(t,{emit:e}){const n=t,r=e,{forwardRef:i,currentElement:s}=Ye(),o=tv(),a=iA(),l=Z(!1);async function u(){const c=s.value;if(!n.disabled&&c){const f=new CustomEvent(_P,{bubbles:!0,cancelable:!0});r("select",f),await kr(),f.defaultPrevented?l.value=!1:o.onClose()}}return(c,f)=>(T(),L(s5,Ce(n,{ref:v(i),onClick:u,onPointerdown:f[0]||(f[0]=()=>{l.value=!0}),onPointerup:f[1]||(f[1]=async d=>{var h;await kr(),!d.defaultPrevented&&(l.value||(h=d.currentTarget)==null||h.click())}),onKeydown:f[2]||(f[2]=async d=>{const h=v(a).searchRef.value!=="";c.disabled||h&&d.key===" "||v(wP).includes(d.key)&&(d.currentTarget.click(),d.preventDefault())})}),{default:D(()=>[Q(c.$slots,"default")]),_:3},16))}}),a5=o5,l5=z({__name:"MenuRootContentModal",props:{loop:{type:Boolean,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","entryFocus","openAutoFocus","closeAutoFocus"],setup(t,{emit:e}){const n=t,r=e,i=Yr(n,r),s=M0(),{forwardRef:o,currentElement:a}=Ye();return CP(a),(l,u)=>(T(),L(sA,Ce(v(i),{ref:v(o),"trap-focus":v(s).open.value,"disable-outside-pointer-events":v(s).open.value,"disable-outside-scroll":!0,onDismiss:u[0]||(u[0]=c=>v(s).onOpenChange(!1)),onFocusOutside:u[1]||(u[1]=eo(c=>r("focusOutside",c),["prevent"]))}),{default:D(()=>[Q(l.$slots,"default")]),_:3},16,["trap-focus","disable-outside-pointer-events"]))}}),u5=l5,c5=z({__name:"MenuRootContentNonModal",props:{loop:{type:Boolean,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","entryFocus","openAutoFocus","closeAutoFocus"],setup(t,{emit:e}){const i=Yr(t,e),s=M0();return(o,a)=>(T(),L(sA,Ce(v(i),{"trap-focus":!1,"disable-outside-pointer-events":!1,"disable-outside-scroll":!1,onDismiss:a[0]||(a[0]=l=>v(s).onOpenChange(!1))}),{default:D(()=>[Q(o.$slots,"default")]),_:3},16))}}),f5=c5,d5=z({__name:"MenuContent",props:{forceMount:{type:Boolean,required:!1},loop:{type:Boolean,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","entryFocus","openAutoFocus","closeAutoFocus"],setup(t,{emit:e}){const i=Yr(t,e),s=M0(),o=tv();return(a,l)=>(T(),L(v(Yl),{present:a.forceMount||v(s).open.value},{default:D(()=>[v(o).modal.value?(T(),L(u5,Yn(Ce({key:0},{...a.$attrs,...v(i)})),{default:D(()=>[Q(a.$slots,"default")]),_:3},16)):(T(),L(f5,Yn(Ce({key:1},{...a.$attrs,...v(i)})),{default:D(()=>[Q(a.$slots,"default")]),_:3},16))]),_:3},8,["present"]))}}),h5=d5,p5=z({__name:"MenuGroup",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(t){const e=t;return(n,r)=>(T(),L(v(lt),Ce({role:"group"},e),{default:D(()=>[Q(n.$slots,"default")]),_:3},16))}}),m5=p5,g5=z({__name:"MenuLabel",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"div"}},setup(t){const e=t;return(n,r)=>(T(),L(v(lt),Yn(Pr(e)),{default:D(()=>[Q(n.$slots,"default")]),_:3},16))}}),b5=g5,y5=z({__name:"MenuPortal",props:{to:{type:null,required:!1},disabled:{type:Boolean,required:!1},defer:{type:Boolean,required:!1},forceMount:{type:Boolean,required:!1}},setup(t){const e=t;return(n,r)=>(T(),L(v(AI),Yn(Pr(e)),{default:D(()=>[Q(n.$slots,"default")]),_:3},16))}}),v5=y5,x5=z({__name:"MenuSeparator",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(t){const e=t;return(n,r)=>(T(),L(v(lt),Ce(e,{role:"separator","aria-orientation":"horizontal"}),{default:D(()=>[Q(n.$slots,"default")]),_:3},16))}}),S5=x5;const[oA,E5]=Ir("DropdownMenuRoot");var w5=z({__name:"DropdownMenuRoot",props:{defaultOpen:{type:Boolean,required:!1},open:{type:Boolean,required:!1,default:void 0},dir:{type:String,required:!1},modal:{type:Boolean,required:!1,default:!0}},emits:["update:open"],setup(t,{emit:e}){const n=t,r=e;Ye();const i=_a(n,"open",r,{defaultValue:n.defaultOpen,passive:n.open===void 0}),s=Z(),{modal:o,dir:a}=cr(n),l=Jl(a);return E5({open:i,onOpenChange:u=>{i.value=u},onOpenToggle:()=>{i.value=!i.value},triggerId:"",triggerElement:s,contentId:"",modal:o,dir:l}),(u,c)=>(T(),L(v(t5),{open:v(i),"onUpdate:open":c[0]||(c[0]=f=>_l(i)?i.value=f:null),dir:v(l),modal:v(o)},{default:D(()=>[Q(u.$slots,"default",{open:v(i)})]),_:3},8,["open","dir","modal"]))}}),_5=w5,C5=z({__name:"DropdownMenuContent",props:{forceMount:{type:Boolean,required:!1},loop:{type:Boolean,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","closeAutoFocus"],setup(t,{emit:e}){const i=Yr(t,e);Ye();const s=oA(),o=Z(!1);function a(l){l.defaultPrevented||(o.value||setTimeout(()=>{var u;(u=s.triggerElement.value)==null||u.focus()},0),o.value=!1,l.preventDefault())}return s.contentId||(s.contentId=Wi(void 0,"reka-dropdown-menu-content")),(l,u)=>{var c;return T(),L(v(h5),Ce(v(i),{id:v(s).contentId,"aria-labelledby":(c=v(s))==null?void 0:c.triggerId,style:{"--reka-dropdown-menu-content-transform-origin":"var(--reka-popper-transform-origin)","--reka-dropdown-menu-content-available-width":"var(--reka-popper-available-width)","--reka-dropdown-menu-content-available-height":"var(--reka-popper-available-height)","--reka-dropdown-menu-trigger-width":"var(--reka-popper-anchor-width)","--reka-dropdown-menu-trigger-height":"var(--reka-popper-anchor-height)"},onCloseAutoFocus:a,onInteractOutside:u[0]||(u[0]=f=>{var m;if(f.defaultPrevented)return;const d=f.detail.originalEvent,h=d.button===0&&d.ctrlKey===!0,p=d.button===2||h;(!v(s).modal.value||p)&&(o.value=!0),(m=v(s).triggerElement.value)!=null&&m.contains(f.target)&&f.preventDefault()})}),{default:D(()=>[Q(l.$slots,"default")]),_:3},16,["id","aria-labelledby"])}}}),A5=C5,D5=z({__name:"DropdownMenuGroup",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(t){const e=t;return Ye(),(n,r)=>(T(),L(v(m5),Yn(Pr(e)),{default:D(()=>[Q(n.$slots,"default")]),_:3},16))}}),k5=D5,O5=z({__name:"DropdownMenuItem",props:{disabled:{type:Boolean,required:!1},textValue:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["select"],setup(t,{emit:e}){const n=t,i=DI(e);return Ye(),(s,o)=>(T(),L(v(a5),Yn(Pr({...n,...v(i)})),{default:D(()=>[Q(s.$slots,"default")]),_:3},16))}}),T5=O5,I5=z({__name:"DropdownMenuLabel",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(t){const e=t;return Ye(),(n,r)=>(T(),L(v(b5),Yn(Pr(e)),{default:D(()=>[Q(n.$slots,"default")]),_:3},16))}}),P5=I5,R5=z({__name:"DropdownMenuPortal",props:{to:{type:null,required:!1},disabled:{type:Boolean,required:!1},defer:{type:Boolean,required:!1},forceMount:{type:Boolean,required:!1}},setup(t){const e=t;return(n,r)=>(T(),L(v(v5),Yn(Pr(e)),{default:D(()=>[Q(n.$slots,"default")]),_:3},16))}}),N5=R5,M5=z({__name:"DropdownMenuSeparator",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(t){const e=t;return Ye(),(n,r)=>(T(),L(v(S5),Yn(Pr(e)),{default:D(()=>[Q(n.$slots,"default")]),_:3},16))}}),F5=M5,L5=z({__name:"DropdownMenuTrigger",props:{disabled:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"button"}},setup(t){const e=t,n=oA(),{forwardRef:r,currentElement:i}=Ye();return gn(()=>{n.triggerElement=i}),n.triggerId||(n.triggerId=Wi(void 0,"reka-dropdown-menu-trigger")),(s,o)=>(T(),L(v(XP),{"as-child":""},{default:D(()=>[k(v(lt),{id:v(n).triggerId,ref:v(r),type:s.as==="button"?"button":void 0,"as-child":e.asChild,as:s.as,"aria-haspopup":"menu","aria-expanded":v(n).open.value,"aria-controls":v(n).open.value?v(n).contentId:void 0,"data-disabled":s.disabled?"":void 0,disabled:s.disabled,"data-state":v(n).open.value?"open":"closed",onClick:o[0]||(o[0]=async a=>{var l;!s.disabled&&a.button===0&&a.ctrlKey===!1&&((l=v(n))==null||l.onOpenToggle(),await kr(),v(n).open.value&&a.preventDefault())}),onKeydown:o[1]||(o[1]=Gy(a=>{s.disabled||(["Enter"," "].includes(a.key)&&v(n).onOpenToggle(),a.key==="ArrowDown"&&v(n).onOpenChange(!0),["Enter"," ","ArrowDown"].includes(a.key)&&a.preventDefault())},["enter","space","arrow-down"]))},{default:D(()=>[Q(s.$slots,"default")]),_:3},8,["id","type","as-child","as","aria-expanded","aria-controls","data-disabled","disabled","data-state"])]),_:3}))}}),B5=L5;const[Jr,$5]=Ir("ScrollAreaRoot");var z5=z({__name:"ScrollAreaRoot",props:{type:{type:String,required:!1,default:"hover"},dir:{type:String,required:!1},scrollHideDelay:{type:Number,required:!1,default:600},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(t,{expose:e}){const n=t,r=Z(0),i=Z(0),s=Z(),o=Z(),a=Z(),l=Z(),u=Z(!1),c=Z(!1),{type:f,dir:d,scrollHideDelay:h}=cr(n),p=Jl(d);function m(){var x;(x=s.value)==null||x.scrollTo({top:0})}function g(){var x;(x=s.value)==null||x.scrollTo({top:0,left:0})}e({viewport:s,scrollTop:m,scrollTopLeft:g});const{forwardRef:b,currentElement:y}=Ye();return $5({type:f,dir:p,scrollHideDelay:h,scrollArea:y,viewport:s,onViewportChange:x=>{s.value=x||void 0},content:o,onContentChange:x=>{o.value=x},scrollbarX:a,scrollbarXEnabled:u,scrollbarY:l,scrollbarYEnabled:c,onScrollbarXChange:x=>{a.value=x||void 0},onScrollbarYChange:x=>{l.value=x||void 0},onScrollbarXEnabledChange:x=>{u.value=x},onScrollbarYEnabledChange:x=>{c.value=x},onCornerWidthChange:x=>{r.value=x},onCornerHeightChange:x=>{i.value=x}}),(x,S)=>(T(),L(v(lt),{ref:v(b),"as-child":n.asChild,as:x.as,dir:v(p),style:_o({position:"relative","--reka-scroll-area-corner-width":`${r.value}px`,"--reka-scroll-area-corner-height":`${i.value}px`})},{default:D(()=>[Q(x.$slots,"default")]),_:3},8,["as-child","as","dir","style"]))}}),j5=z5,V5=z({__name:"ScrollAreaCornerImpl",setup(t){const e=Jr(),n=Z(0),r=Z(0),i=q(()=>!!n.value&&!!r.value);function s(){var l;const a=((l=e.scrollbarX.value)==null?void 0:l.offsetHeight)||0;e.onCornerHeightChange(a),r.value=a}function o(){var l;const a=((l=e.scrollbarY.value)==null?void 0:l.offsetWidth)||0;e.onCornerWidthChange(a),n.value=a}return co(e.scrollbarX.value,s),co(e.scrollbarY.value,o),nt(()=>e.scrollbarX.value,s),nt(()=>e.scrollbarY.value,o),(a,l)=>{var u;return i.value?(T(),L(v(lt),Ce({key:0,style:{width:`${n.value}px`,height:`${r.value}px`,position:"absolute",right:v(e).dir.value==="ltr"?0:void 0,left:v(e).dir.value==="rtl"?0:void 0,bottom:0}},(u=a.$parent)==null?void 0:u.$props),{default:D(()=>[Q(a.$slots,"default")]),_:3},16,["style"])):we("v-if",!0)}}}),U5=V5,H5=z({__name:"ScrollAreaCorner",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(t){const e=t,{forwardRef:n}=Ye(),r=Jr(),i=q(()=>!!r.scrollbarX.value&&!!r.scrollbarY.value),s=q(()=>r.type.value!=="scroll"&&i.value);return(o,a)=>s.value?(T(),L(U5,Ce({key:0},e,{ref:v(n)}),{default:D(()=>[Q(o.$slots,"default")]),_:3},16)):we("v-if",!0)}}),q5=H5;function aA(t,e){return n=>{if(t[0]===t[1]||e[0]===e[1])return e[0];const r=(e[1]-e[0])/(t[1]-t[0]);return e[0]+r*(n-t[0])}}function F0(t){const e=lA(t.viewport,t.content),n=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,r=(t.scrollbar.size-n)*e;return Math.max(r,18)}function lA(t,e){const n=t/e;return Number.isNaN(n)?0:n}function G5(t,e=()=>{}){let n={left:t.scrollLeft,top:t.scrollTop},r=0;return(function i(){const s={left:t.scrollLeft,top:t.scrollTop},o=n.left!==s.left,a=n.top!==s.top;(o||a)&&e(),n=s,r=window.requestAnimationFrame(i)})(),()=>window.cancelAnimationFrame(r)}function Ix(t,e,n="ltr"){const r=F0(e),i=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,s=e.scrollbar.size-i,o=e.content-e.viewport,a=s-r,l=n==="ltr"?[0,o]:[o*-1,0],u=AP(t,l[0],l[1]);return aA([0,o],[0,a])(u)}function bd(t){return t?Number.parseInt(t,10):0}function W5(t,e,n,r="ltr"){const i=F0(n),s=i/2,o=e||s,a=i-o,l=n.scrollbar.paddingStart+o,u=n.scrollbar.size-n.scrollbar.paddingEnd-a,c=n.content-n.viewport,f=r==="ltr"?[0,c]:[c*-1,0];return aA([l,u],f)(t)}function Px(t,e){return t>0&&t{i.value&&e.onScrollbarXChange(i.value)});const s=q(()=>n.sizes.value);return(o,a)=>(T(),L(cA,{ref:v(r),"is-horizontal":!0,"data-orientation":"horizontal",style:_o({bottom:0,left:v(e).dir.value==="rtl"?"var(--reka-scroll-area-corner-width)":0,right:v(e).dir.value==="ltr"?"var(--reka-scroll-area-corner-width)":0,"--reka-scroll-area-thumb-width":s.value?`${v(F0)(s.value)}px`:void 0}),onOnDragScroll:a[0]||(a[0]=l=>v(n).onDragScroll(l.x))},{default:D(()=>[Q(o.$slots,"default")]),_:3},8,["style"]))}}),X5=K5,Y5=z({__name:"ScrollAreaScrollbarY",setup(t){const e=Jr(),n=B0(),{forwardRef:r,currentElement:i}=Ye();gn(()=>{i.value&&e.onScrollbarYChange(i.value)});const s=q(()=>n.sizes.value);return(o,a)=>(T(),L(cA,{ref:v(r),"is-horizontal":!1,"data-orientation":"vertical",style:_o({top:0,right:v(e).dir.value==="ltr"?0:void 0,left:v(e).dir.value==="rtl"?0:void 0,bottom:"var(--reka-scroll-area-corner-height)","--reka-scroll-area-thumb-height":s.value?`${v(F0)(s.value)}px`:void 0}),onOnDragScroll:a[0]||(a[0]=l=>v(n).onDragScroll(l.y))},{default:D(()=>[Q(o.$slots,"default")]),_:3},8,["style"]))}}),J5=Y5,Z5=z({__name:"ScrollAreaScrollbarAuto",props:{forceMount:{type:Boolean,required:!1}},setup(t){const e=Jr(),n=L0(),{forwardRef:r}=Ye(),i=Z(!1),s=Wy(()=>{if(e.viewport.value){const o=e.viewport.value.offsetWidths()),co(e.viewport,s),co(e.content,s),(o,a)=>(T(),L(v(Yl),{present:o.forceMount||i.value},{default:D(()=>[k(nv,Ce(o.$attrs,{ref:v(r),"data-state":i.value?"visible":"hidden"}),{default:D(()=>[Q(o.$slots,"default")]),_:3},16,["data-state"])]),_:3},8,["present"]))}}),uA=Z5,Q5=z({inheritAttrs:!1,__name:"ScrollAreaScrollbarHover",props:{forceMount:{type:Boolean,required:!1}},setup(t){const e=Jr(),{forwardRef:n}=Ye();let r;const i=Z(!1);function s(){window.clearTimeout(r),i.value=!0}function o(){r=window.setTimeout(()=>{i.value=!1},e.scrollHideDelay.value)}return gn(()=>{const a=e.scrollArea.value;a&&(a.addEventListener("pointerenter",s),a.addEventListener("pointerleave",o))}),wo(()=>{const a=e.scrollArea.value;a&&(window.clearTimeout(r),a.removeEventListener("pointerenter",s),a.removeEventListener("pointerleave",o))}),(a,l)=>(T(),L(v(Yl),{present:a.forceMount||i.value},{default:D(()=>[k(uA,Ce(a.$attrs,{ref:v(n),"data-state":i.value?"visible":"hidden"}),{default:D(()=>[Q(a.$slots,"default")]),_:3},16,["data-state"])]),_:3},8,["present"]))}}),eR=Q5,tR=z({__name:"ScrollAreaScrollbarScroll",props:{forceMount:{type:Boolean,required:!1}},setup(t){const e=Jr(),n=L0(),{forwardRef:r}=Ye(),{state:i,dispatch:s}=kI("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}}),o=q(()=>i.value!=="hidden");la(l=>{if(i.value==="idle"){const u=window.setTimeout(()=>s("HIDE"),e.scrollHideDelay.value);l(()=>{window.clearTimeout(u)})}});const a=Wy(()=>s("SCROLL_END"),100);return la(l=>{const u=e.viewport.value,c=n.isHorizontal.value?"scrollLeft":"scrollTop";if(u){let f=u[c];const d=()=>{const h=u[c];f!==h&&(s("SCROLL"),a()),f=h};u.addEventListener("scroll",d),l(()=>{u.removeEventListener("scroll",d)})}}),(l,u)=>(T(),L(v(Yl),{present:l.forceMount||o.value},{default:D(()=>[k(nv,Ce(l.$attrs,{ref:v(r),"data-state":o.value?"visible":"hidden"}),{default:D(()=>[Q(l.$slots,"default")]),_:3},16,["data-state"])]),_:3},8,["present"]))}}),nR=tR;const[L0,rR]=Ir("ScrollAreaScrollbar");var iR=z({inheritAttrs:!1,__name:"ScrollAreaScrollbar",props:{orientation:{type:String,required:!1,default:"vertical"},forceMount:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"div"}},setup(t){const e=t,{forwardRef:n}=Ye(),r=Jr(),i=q(()=>e.orientation==="horizontal");nt(i,()=>{i.value?r.onScrollbarXEnabledChange(!0):r.onScrollbarYEnabledChange(!0)},{immediate:!0}),wo(()=>{r.onScrollbarXEnabledChange(!1),r.onScrollbarYEnabledChange(!1)});const{orientation:s,forceMount:o,asChild:a,as:l}=cr(e);return rR({orientation:s,forceMount:o,isHorizontal:i,as:l,asChild:a}),(u,c)=>v(r).type.value==="hover"?(T(),L(eR,Ce({key:0},u.$attrs,{ref:v(n),"force-mount":v(o)}),{default:D(()=>[Q(u.$slots,"default")]),_:3},16,["force-mount"])):v(r).type.value==="scroll"?(T(),L(nR,Ce({key:1},u.$attrs,{ref:v(n),"force-mount":v(o)}),{default:D(()=>[Q(u.$slots,"default")]),_:3},16,["force-mount"])):v(r).type.value==="auto"?(T(),L(uA,Ce({key:2},u.$attrs,{ref:v(n),"force-mount":v(o)}),{default:D(()=>[Q(u.$slots,"default")]),_:3},16,["force-mount"])):v(r).type.value==="always"?(T(),L(nv,Ce({key:3},u.$attrs,{ref:v(n),"data-state":"visible"}),{default:D(()=>[Q(u.$slots,"default")]),_:3},16)):we("v-if",!0)}}),sR=iR;const[B0,oR]=Ir("ScrollAreaScrollbarVisible");var aR=z({__name:"ScrollAreaScrollbarVisible",setup(t){const e=Jr(),n=L0(),{forwardRef:r}=Ye(),i=Z({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),s=q(()=>{const b=lA(i.value.viewport,i.value.content);return b>0&&b<1}),o=Z(),a=Z(0);function l(b,y){if(h.value){const x=e.viewport.value.scrollLeft+b.deltaY;e.viewport.value.scrollLeft=x,Px(x,y)&&b.preventDefault()}else{const x=e.viewport.value.scrollTop+b.deltaY;e.viewport.value.scrollTop=x,Px(x,y)&&b.preventDefault()}}function u(b,y){h.value?a.value=y.x:a.value=y.y}function c(b){a.value=0}function f(b){i.value=b}function d(b,y){return W5(b,a.value,i.value,y)}const h=q(()=>n.isHorizontal.value);function p(b){h.value?e.viewport.value.scrollLeft=d(b,e.dir.value):e.viewport.value.scrollTop=d(b)}function m(){if(h.value){if(e.viewport.value&&o.value){const b=e.viewport.value.scrollLeft,y=Ix(b,i.value,e.dir.value);o.value.style.transform=`translate3d(${y}px, 0, 0)`}}else if(e.viewport.value&&o.value){const b=e.viewport.value.scrollTop,y=Ix(b,i.value);o.value.style.transform=`translate3d(0, ${y}px, 0)`}}function g(b){o.value=b}return oR({sizes:i,hasThumb:s,handleWheelScroll:l,handleThumbDown:u,handleThumbUp:c,handleSizeChange:f,onThumbPositionChange:m,onThumbChange:g,onDragScroll:p}),(b,y)=>h.value?(T(),L(X5,Ce({key:0},b.$attrs,{ref:v(r)}),{default:D(()=>[Q(b.$slots,"default")]),_:3},16)):(T(),L(J5,Ce({key:1},b.$attrs,{ref:v(r)}),{default:D(()=>[Q(b.$slots,"default")]),_:3},16))}}),nv=aR,lR=z({__name:"ScrollAreaScrollbarImpl",props:{isHorizontal:{type:Boolean,required:!0}},emits:["onDragScroll","onWheelScroll","onThumbPointerDown"],setup(t,{emit:e}){const n=t,r=e,i=Jr(),s=B0(),o=L0(),{forwardRef:a,currentElement:l}=Ye(),u=Z(""),c=Z();function f(b){var y,x;if(c.value){const S=b.clientX-((y=c.value)==null?void 0:y.left),E=b.clientY-((x=c.value)==null?void 0:x.top);r("onDragScroll",{x:S,y:E})}}function d(b){b.button===0&&(b.target.setPointerCapture(b.pointerId),c.value=l.value.getBoundingClientRect(),u.value=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",i.viewport&&(i.viewport.value.style.scrollBehavior="auto"),f(b))}function h(b){f(b)}function p(b){const y=b.target;y.hasPointerCapture(b.pointerId)&&y.releasePointerCapture(b.pointerId),document.body.style.webkitUserSelect=u.value,i.viewport&&(i.viewport.value.style.scrollBehavior=""),c.value=void 0}function m(b){var E;const y=b.target,x=(E=l.value)==null?void 0:E.contains(y),S=s.sizes.value.content-s.sizes.value.viewport;x&&s.handleWheelScroll(b,S)}gn(()=>{document.addEventListener("wheel",m,{passive:!1})}),wo(()=>{document.removeEventListener("wheel",m)});function g(){var b,y,x,S,E;l.value&&(n.isHorizontal?s.handleSizeChange({content:((b=i.viewport.value)==null?void 0:b.scrollWidth)??0,viewport:((y=i.viewport.value)==null?void 0:y.offsetWidth)??0,scrollbar:{size:l.value.clientWidth??0,paddingStart:bd(getComputedStyle(l.value).paddingLeft),paddingEnd:bd(getComputedStyle(l.value).paddingRight)}}):s.handleSizeChange({content:((x=i.viewport.value)==null?void 0:x.scrollHeight)??0,viewport:((S=i.viewport.value)==null?void 0:S.offsetHeight)??0,scrollbar:{size:((E=l.value)==null?void 0:E.clientHeight)??0,paddingStart:bd(getComputedStyle(l.value).paddingTop),paddingEnd:bd(getComputedStyle(l.value).paddingBottom)}}),s.onThumbPositionChange())}return co(l,g),co(i.content,g),(b,y)=>(T(),L(v(lt),{ref:v(a),style:{position:"absolute"},"data-scrollbarimpl":"",as:v(o).as.value,"as-child":v(o).asChild.value,onPointerdown:d,onPointermove:h,onPointerup:p},{default:D(()=>[Q(b.$slots,"default")]),_:3},8,["as","as-child"]))}}),cA=lR,uR=z({__name:"ScrollAreaThumb",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(t){const e=t,n=Jr(),r=B0();function i(d){const p=d.target.getBoundingClientRect(),m=d.clientX-p.left,g=d.clientY-p.top;r.handleThumbDown(d,{x:m,y:g})}function s(d){r.handleThumbUp(d)}const{forwardRef:o,currentElement:a}=Ye(),l=Z(),u=q(()=>n.viewport.value);function c(){if(!l.value){const d=G5(u.value,r.onThumbPositionChange);l.value=d,r.onThumbPositionChange()}}const f=q(()=>r.sizes.value);return jC(f,()=>{r.onThumbChange(a.value),u.value&&(r.onThumbPositionChange(),u.value.addEventListener("scroll",c))}),wo(()=>{var d;u.value.removeEventListener("scroll",c),(d=n.viewport.value)==null||d.removeEventListener("scroll",c)}),(d,h)=>(T(),L(v(lt),{ref:v(o),"data-state":v(r).hasThumb?"visible":"hidden",style:{width:"var(--reka-scroll-area-thumb-width)",height:"var(--reka-scroll-area-thumb-height)"},"as-child":e.asChild,as:d.as,onPointerdown:i,onPointerup:s},{default:D(()=>[Q(d.$slots,"default")]),_:3},8,["data-state","as-child","as"]))}}),cR=uR,fR=z({inheritAttrs:!1,__name:"ScrollAreaViewport",props:{nonce:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(t,{expose:e}){const n=t,{nonce:r}=cr(n),i=ZC(r),s=Jr(),o=Z();gn(()=>{s.onViewportChange(o.value),s.onContentChange(l.value)}),e({viewportElement:o});const{forwardRef:a,currentElement:l}=Ye();return(u,c)=>(T(),K(Qe,null,[M("div",Ce({ref_key:"viewportElement",ref:o,"data-reka-scroll-area-viewport":"",style:{overflowX:v(s).scrollbarXEnabled.value?"scroll":"hidden",overflowY:v(s).scrollbarYEnabled.value?"scroll":"hidden"}},u.$attrs,{tabindex:0}),[k(v(lt),{ref:v(a),style:_o({minWidth:v(s).scrollbarXEnabled.value?"fit-content":void 0}),"as-child":n.asChild,as:u.as},{default:D(()=>[Q(u.$slots,"default")]),_:3},8,["style","as-child","as"])],16),k(v(lt),{as:"style",nonce:v(i)},{default:D(()=>c[0]||(c[0]=[ne(" /* Hide scrollbars cross-browser and enable momentum scroll for touch devices */ [data-reka-scroll-area-viewport] { scrollbar-width:none; -ms-overflow-style:none; -webkit-overflow-scrolling:touch; } [data-reka-scroll-area-viewport]::-webkit-scrollbar { display:none; } ")])),_:1,__:[0]},8,["nonce"])],64))}}),dR=fR;const[hR,pR]=Ir("SelectGroup");var mR=z({__name:"SelectGroup",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(t){const e=t,n=Wi(void 0,"reka-select-group");return pR({id:n}),(r,i)=>(T(),L(v(lt),Ce({role:"group"},e,{"aria-labelledby":v(n)}),{default:D(()=>[Q(r.$slots,"default")]),_:3},16,["aria-labelledby"]))}}),gR=mR,bR=z({__name:"SelectLabel",props:{for:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"div"}},setup(t){const e=t,n=hR({id:""});return(r,i)=>(T(),L(v(lt),Ce(e,{id:v(n).id}),{default:D(()=>[Q(r.$slots,"default")]),_:3},16,["id"]))}}),yR=bR,vR=z({__name:"SelectSeparator",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(t){const e=t;return(n,r)=>(T(),L(v(lt),Ce({"aria-hidden":"true"},e),{default:D(()=>[Q(n.$slots,"default")]),_:3},16))}}),xR=vR;function ze(t,e="Assertion failed!"){if(!t)throw console.error(e),new Error(e)}function fA(t,e=document){var r;if(!Of)return null;if(e instanceof HTMLElement&&((r=e==null?void 0:e.dataset)==null?void 0:r.panelGroupId)===t)return e;const n=e.querySelector(`[data-panel-group][data-panel-group-id="${t}"]`);return n||null}function $0(t,e=document){if(!Of)return null;const n=e.querySelector(`[data-panel-resize-handle-id="${t}"]`);return n||null}function dA(t,e,n=document){return Of?Oc(t,n).findIndex(s=>s.getAttribute("data-panel-resize-handle-id")===e)??null:null}function Oc(t,e=document){return Of?Array.from(e.querySelectorAll(`[data-panel-resize-handle-id][data-panel-group-id="${t}"]`)):[]}function SR(t,e,n,r=document){var u,c;const i=$0(e,r),s=Oc(t,r),o=i?s.indexOf(i):-1,a=((u=n[o])==null?void 0:u.id)??null,l=((c=n[o+1])==null?void 0:c.id)??null;return[a,l]}function hA(t){return t.type==="keydown"}function pA(t){return t.type.startsWith("mouse")}function mA(t){return t.type.startsWith("touch")}function z0(t){if(pA(t))return{x:t.clientX,y:t.clientY};if(mA(t)){const e=t.touches[0];if(e&&e.clientX&&e.clientY)return{x:e.clientX,y:e.clientY}}return{x:Number.POSITIVE_INFINITY,y:Number.POSITIVE_INFINITY}}function gA(t,e){const n=t==="horizontal",{x:r,y:i}=z0(e);return n?r:i}function ER(t,e,n,r,i){const s=n==="horizontal",o=$0(e,i);ze(o);const a=o.getAttribute("data-panel-group-id");ze(a);const{initialCursorPosition:l}=r,u=gA(n,t),c=fA(a,i);ze(c);const f=c.getBoundingClientRect(),d=s?f.width:f.height;return(u-l)/d*100}function wR(t,e,n,r,i,s){if(hA(t)){const o=n==="horizontal";let a=0;t.shiftKey?a=100:a=i??10;let l=0;switch(t.key){case"ArrowDown":l=o?0:a;break;case"ArrowLeft":l=o?-a:0;break;case"ArrowRight":l=o?a:0;break;case"ArrowUp":l=o?0:-a;break;case"End":l=100;break;case"Home":l=-100;break}return l}else return r==null?0:ER(t,e,n,r,s)}function _R({layout:t,panelsArray:e,pivotIndices:n}){let r=0,i=100,s=0,o=0;const a=n[0];ze(a!=null),e.forEach((f,d)=>{const{constraints:h}=f,{maxSize:p=100,minSize:m=0}=h;d===a?(r=m,i=p):(s+=m,o+=p)});const l=Math.min(i,100-s),u=Math.max(r,100-o),c=t[a];return{valueMax:l,valueMin:u,valueNow:c}}function CR({panelDataArray:t}){const e=Array.from({length:t.length}),n=t.map(s=>s.constraints);let r=0,i=100;for(let s=0;s{const s=t[i];ze(s);const{callbacks:o,constraints:a,id:l}=s,{collapsedSize:u=0,collapsible:c}=a,f=n[l];if(f==null||r!==f){n[l]=r;const{onCollapse:d,onExpand:h,onResize:p}=o;p&&p(r,f),c&&(d||h)&&(h&&(f==null||f===u)&&r!==u&&h(),d&&(f==null||f!==u)&&r===u&&d())}})}function AR(t,e=10){let n=null;return(...i)=>{n!==null&&clearTimeout(n),n=setTimeout(()=>{t(...i)},e)}}const rv=10;function Tc(t,e,n=rv){t=Number.parseFloat(t.toFixed(n)),e=Number.parseFloat(e.toFixed(n));const r=t-e;return r===0?0:r>0?1:-1}function xr(t,e,n){return Tc(t,e,n)===0}function Za({panelConstraints:t,panelIndex:e,size:n}){const r=t[e];ze(r!=null);const{collapsedSize:i=0,collapsible:s,maxSize:o=100,minSize:a=0}=r;if(Tc(n,a)<0)if(s){const l=(i+a)/2;Tc(n,l)<0?n=i:n=a}else n=a;return n=Math.min(o,n),n=Number.parseFloat(n.toFixed(rv)),n}function yd(t,e){if(t.length!==e.length)return!1;for(let n=0;n0&&(t=t<0?0-g:g)}}}{const c=t<0?o:a,f=n[c];ze(f);const{collapsible:d}=f;if(d){const h=e[c];ze(h!=null);const p=n[c];ze(p);const{collapsedSize:m=0,minSize:g=0}=p;if(xr(h,g)){const b=h-m;Tc(b,Math.abs(t))>0&&(t=t<0?0-b:b)}}}}{const c=t<0?1:-1;let f=t<0?a:o,d=0;for(;;){const p=e[f];ze(p!=null);const g=Za({panelConstraints:n,panelIndex:f,size:100})-p;if(d+=g,f+=c,f<0||f>=n.length)break}const h=Math.min(Math.abs(t),Math.abs(d));t=t<0?0-h:h}{let f=t<0?o:a;for(;f>=0&&f=0))break;t<0?f--:f++}}if(xr(l,0))return e;{const c=t<0?a:o,f=e[c];ze(f!=null);const d=f+l,h=Za({panelConstraints:n,panelIndex:c,size:d});if(s[c]=h,!xr(h,d)){let p=d-h,g=t<0?a:o;for(;g>=0&&g0?g--:g++}}}const u=s.reduce((c,f)=>f+c,0);return xr(u,100)?s:e}function bA(t,e,n){const r=dA(t,e,n);return r!=null?[r,r+1]:[-1,-1]}function DR(t,e,n){return t.xe.x&&t.ye.y}function kR(t,e){if(t===e)throw new Error("Cannot compare node with itself");const n={a:Mx(t),b:Mx(e)};let r;for(;n.a.at(-1)===n.b.at(-1);)t=n.a.pop(),e=n.b.pop(),r=t;ze(r);const i={a:Nx(Rx(n.a)),b:Nx(Rx(n.b))};if(i.a===i.b){const s=r.childNodes,o={a:n.a.at(-1),b:n.b.at(-1)};let a=s.length;for(;a--;){const l=s[a];if(l===o.a)return 1;if(l===o.b)return-1}}return Math.sign(i.a-i.b)}const OR=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function TR(t){const e=getComputedStyle(yA(t)).display;return e==="flex"||e==="inline-flex"}function IR(t){const e=getComputedStyle(t);return!!(e.position==="fixed"||e.zIndex!=="auto"&&(e.position!=="static"||TR(t))||+e.opacity<1||"transform"in e&&e.transform!=="none"||"webkitTransform"in e&&e.webkitTransform!=="none"||"mixBlendMode"in e&&e.mixBlendMode!=="normal"||"filter"in e&&e.filter!=="none"||"webkitFilter"in e&&e.webkitFilter!=="none"||"isolation"in e&&e.isolation==="isolate"||OR.test(e.willChange)||e.webkitOverflowScrolling==="touch")}function Rx(t){let e=t.length;for(;e--;){const n=t[e];if(ze(n),IR(n))return n}return null}function Nx(t){return t&&Number(getComputedStyle(t).zIndex)||0}function Mx(t){const e=[];for(;t;)e.push(t),t=yA(t);return e}function yA(t){var e;return t.parentNode instanceof DocumentFragment&&((e=t.parentNode)==null?void 0:e.host)||t.parentNode}const vA=1,xA=2,SA=4,EA=8;function PR(){if(typeof matchMedia=="function")return matchMedia("(pointer:coarse)").matches?"coarse":"fine"}const RR=PR()==="coarse",ho=[];let j0=!1;const $s=new Map,V0=new Map,Ic=new Set;function NR(t,e,n,r,i,s){const{ownerDocument:o}=e,a={direction:n,element:e,hitAreaMargins:r,nonce:i,setResizeHandlerState:s},l=$s.get(o)??0;return $s.set(o,l+1),Ic.add(a),up(),function(){V0.delete(t),Ic.delete(a);const c=$s.get(o)??1;$s.set(o,c-1),up(),_A(),c===1&&$s.delete(o)}}function vd(t){const{target:e}=t,{x:n,y:r}=z0(t);j0=!0,iv({target:e,x:n,y:r}),up(),ho.length>0&&(sv("down",t),t.preventDefault())}function Os(t){const{x:e,y:n}=z0(t);if(!j0){const{target:r}=t;iv({target:r,x:e,y:n})}sv("move",t),wA(),ho.length>0&&t.preventDefault()}function Ts(t){const{target:e}=t,{x:n,y:r}=z0(t);V0.clear(),j0=!1,ho.length>0&&t.preventDefault(),sv("up",t),iv({target:e,x:n,y:r}),wA(),up()}function iv({target:t,x:e,y:n}){ho.splice(0);let r=null;t instanceof HTMLElement&&(r=t),Ic.forEach(i=>{const{element:s,hitAreaMargins:o}=i,a=s.getBoundingClientRect(),{bottom:l,left:u,right:c,top:f}=a,d=RR?o.coarse:o.fine;if(e>=u-d&&e<=c+d&&n>=f-d&&n<=l+d){if(r!==null&&s!==r&&!s.contains(r)&&!r.contains(s)&&kR(r,s)>0){let p=r,m=!1;for(;p&&!p.contains(s);){if(DR(p.getBoundingClientRect(),a)){m=!0;break}p=p.parentElement}if(m)return}ho.push(i)}})}function ug(t,e){V0.set(t,e)}function wA(){let t=!1,e=!1,n;ho.forEach(i=>{const{direction:s,nonce:o}=i;s.value==="horizontal"?t=!0:e=!0,n=o.value});let r=0;V0.forEach(i=>{r|=i}),t&&e?cg("intersection",r,n):t?cg("horizontal",r,n):e?cg("vertical",r,n):_A()}function up(){$s.forEach((t,e)=>{const{body:n}=e;n.removeEventListener("contextmenu",Ts),n.removeEventListener("mousedown",vd),n.removeEventListener("mouseleave",Os),n.removeEventListener("mousemove",Os),n.removeEventListener("touchmove",Os),n.removeEventListener("touchstart",vd)}),window.removeEventListener("mouseup",Ts),window.removeEventListener("touchcancel",Ts),window.removeEventListener("touchend",Ts),Ic.size>0&&(j0?(ho.length>0&&$s.forEach((t,e)=>{const{body:n}=e;t>0&&(n.addEventListener("contextmenu",Ts),n.addEventListener("mouseleave",Os),n.addEventListener("mousemove",Os),n.addEventListener("touchmove",Os,{passive:!1}))}),window.addEventListener("mouseup",Ts),window.addEventListener("touchcancel",Ts),window.addEventListener("touchend",Ts)):$s.forEach((t,e)=>{const{body:n}=e;t>0&&(n.addEventListener("mousedown",vd),n.addEventListener("mousemove",Os),n.addEventListener("touchmove",Os,{passive:!1}),n.addEventListener("touchstart",vd))}))}function sv(t,e){Ic.forEach(n=>{const{setResizeHandlerState:r}=n,i=ho.includes(n);r(t,i,e)})}let X1=null,zs=null;function MR(t,e){if(e){const n=(e&vA)!==0,r=(e&xA)!==0,i=(e&SA)!==0,s=(e&EA)!==0;if(n)return i?"se-resize":s?"ne-resize":"e-resize";if(r)return i?"sw-resize":s?"nw-resize":"w-resize";if(i)return"s-resize";if(s)return"n-resize"}switch(t){case"horizontal":return"ew-resize";case"intersection":return"move";case"vertical":return"ns-resize"}}function _A(){zs!==null&&(document.head.removeChild(zs),X1=null,zs=null)}function cg(t,e,n){const r=MR(t,e);X1!==r&&(X1=r,zs===null&&(zs=document.createElement("style"),n&&(zs.nonce=n),document.head.appendChild(zs)),zs.innerHTML=`*{cursor: ${r}!important;}`)}function FR({defaultSize:t,dragState:e,layout:n,panelData:r,panelIndex:i,precision:s=3}){const o=n[i];let a;return o==null?a=t!==void 0?t.toPrecision(s):"1":r.length===1?a="1":a=o.toPrecision(s),{flexBasis:0,flexGrow:a,flexShrink:1,overflow:"hidden",pointerEvents:e!==null?"none":void 0}}function LR({layout:t,panelConstraints:e}){const n=[...t],r=n.reduce((s,o)=>s+o,0);if(n.length!==e.length)throw new Error(`Invalid ${e.length} panel layout: ${n.map(s=>`${s}%`).join(", ")}`);if(!xr(r,100)){console.warn(`WARNING: Invalid layout total size: ${n.map(s=>`${s}%`).join(", ")}. Layout normalization will be applied.`);for(let s=0;s{const a=i.value;if(!a)return;const l=Oc(e,a);for(let u=0;u{l.forEach(u=>{u.removeAttribute("aria-controls"),u.removeAttribute("aria-valuemax"),u.removeAttribute("aria-valuemin"),u.removeAttribute("aria-valuenow")})})}),la(o=>{const a=i.value;if(!a)return;const l=t.value;ze(l);const{panelDataArray:u}=l,c=fA(e,a);ze(c!=null,`No group found for id "${e}"`);const f=Oc(e,a);ze(f);const d=f.map(h=>{const p=h.getAttribute("data-panel-resize-handle-id");ze(p);const[m,g]=SR(e,p,u,a);if(m==null||g==null)return()=>{};const b=y=>{if(!y.defaultPrevented)switch(y.key){case"Enter":{y.preventDefault();const x=u.findIndex(S=>S.id===m);if(x>=0){const S=u[x];ze(S);const E=n.value[x],{collapsedSize:C=0,collapsible:w,minSize:A=0}=S.constraints;if(E!=null&&w){const _=qu({delta:xr(E,C)?A-C:C-E,layout:n.value,panelConstraints:u.map(O=>O.constraints),pivotIndices:bA(e,p,a),trigger:"keyboard"});n.value!==_&&s(_)}}break}}};return h.addEventListener("keydown",b),()=>{h.removeEventListener("keydown",b)}});o(()=>{d.forEach(h=>h())})})}function Fx(t){try{if(typeof localStorage<"u")t.getItem=e=>localStorage.getItem(e),t.setItem=(e,n)=>{localStorage.setItem(e,n)};else throw new TypeError("localStorage not supported in this environment")}catch(e){console.error(e),t.getItem=()=>null,t.setItem=()=>{}}}function CA(t){return`reka:${t}`}function AA(t){return t.map(e=>{const{constraints:n,id:r,idIsFromProps:i,order:s}=e;return i?r:s?`${s}:${JSON.stringify(n)}`:JSON.stringify(n)}).sort((e,n)=>e.localeCompare(n)).join(",")}function DA(t,e){try{const n=CA(t),r=e.getItem(n);if(r){const i=JSON.parse(r);if(typeof i=="object"&&i!=null)return i}}catch{}return null}function $R(t,e,n){const r=DA(t,n)??{},i=AA(e);return r[i]??null}function zR(t,e,n,r,i){const s=CA(t),o=AA(e),a=DA(t,i)??{};a[o]={expandToSizes:Object.fromEntries(n.entries()),layout:r};try{i.setItem(s,JSON.stringify(a))}catch(l){console.error(l)}}const jR=100,Gu={getItem:t=>(Fx(Gu),Gu.getItem(t)),setItem:(t,e)=>{Fx(Gu),Gu.setItem(t,e)}},[kA,VR]=Ir("PanelGroup");var UR=z({__name:"SplitterGroup",props:{id:{type:[String,null],required:!1},autoSaveId:{type:[String,null],required:!1,default:null},direction:{type:String,required:!0},keyboardResizeBy:{type:[Number,null],required:!1,default:10},storage:{type:Object,required:!1,default:()=>Gu},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["layout"],setup(t,{emit:e}){const n=t,r=e,i={},{direction:s}=cr(n),o=Wi(n.id,"reka-splitter-group"),a=Jl(),{forwardRef:l,currentElement:u}=Ye(),c=Z(null),f=Z([]),d=Z({}),h=Z(new Map),p=Z(0),m=q(()=>({autoSaveId:n.autoSaveId,direction:n.direction,dragState:c.value,id:o,keyboardResizeBy:n.keyboardResizeBy,storage:n.storage})),g=Z({layout:f.value,panelDataArray:[],panelDataArrayChanged:!1}),b=B=>f.value=B;BR({eagerValuesRef:g,groupId:o,layout:f,panelDataArray:g.value.panelDataArray,setLayout:b,panelGroupElement:u}),la(()=>{const{panelDataArray:B}=g.value,{autoSaveId:G}=n;if(G){if(f.value.length===0||f.value.length!==B.length)return;let H=i[G];H||(H=AR(zR,jR),i[G]=H);const ie=[...B],se=new Map(h.value);H(G,ie,se,f.value,n.storage)}});function y(B,G){const{panelDataArray:H}=g.value,ie=F(H,B);return FR({defaultSize:G,dragState:c.value,layout:f.value,panelData:H,panelIndex:ie})}function x(B){const{panelDataArray:G}=g.value;G.push(B),G.sort((H,ie)=>{const se=H.order,$=ie.order;return se==null&&$==null?0:se==null?-1:$==null?1:se-$}),g.value.panelDataArrayChanged=!0}nt(()=>g.value.panelDataArrayChanged,()=>{if(g.value.panelDataArrayChanged){g.value.panelDataArrayChanged=!1;const{autoSaveId:B,storage:G}=m.value,{layout:H,panelDataArray:ie}=g.value;let se=null;if(B){const ee=$R(B,ie,G);ee&&(h.value=new Map(Object.entries(ee.expandToSizes)),se=ee.layout)}se===null&&(se=CR({panelDataArray:ie}));const $=LR({layout:se,panelConstraints:ie.map(ee=>ee.constraints)});OI(H,$)||(b($),g.value.layout=$,r("layout",$),ku(ie,$,d.value))}});function S(B){return function(H){H.preventDefault();const ie=u.value;if(!ie)return()=>null;const{direction:se,dragState:$,id:ee,keyboardResizeBy:pe}=m.value,{layout:fe,panelDataArray:me}=g.value,{initialLayout:Me}=$??{},Nt=bA(ee,B,ie);let at=wR(H,B,se,$,pe,ie);if(at===0)return;const Qr=se==="horizontal";a.value==="rtl"&&Qr&&(at=-at);const Qi=me.map(nn=>nn.constraints),Jn=qu({delta:at,layout:Me??fe,panelConstraints:Qi,pivotIndices:Nt,trigger:hA(H)?"keyboard":"mouse-or-touch"}),Kt=!yd(fe,Jn);(pA(H)||mA(H))&&p.value!==at&&(p.value=at,Kt?ug(B,0):Qr?ug(B,at<0?vA:xA):ug(B,at<0?SA:EA)),Kt&&(b(Jn),g.value.layout=Jn,r("layout",Jn),ku(me,Jn,d.value))}}function E(B,G){const{layout:H,panelDataArray:ie}=g.value,se=ie.map(Me=>Me.constraints),{panelSize:$,pivotIndices:ee}=V(ie,B,H);ze($!=null);const fe=F(ie,B)===ie.length-1?$-G:G-$,me=qu({delta:fe,layout:H,panelConstraints:se,pivotIndices:ee,trigger:"imperative-api"});yd(H,me)||(b(me),g.value.layout=me,r("layout",me),ku(ie,me,d.value))}function C(B,G){const{layout:H,panelDataArray:ie}=g.value,se=F(ie,B);ie[se]=B,g.value.panelDataArrayChanged=!0;const{collapsedSize:$=0,collapsible:ee}=G,{collapsedSize:pe=0,collapsible:fe,maxSize:me=100,minSize:Me=0}=B.constraints,{panelSize:Nt}=V(ie,B,H);Nt!==null&&(ee&&fe&&Nt===$?$!==pe&&E(B,pe):Ntme&&E(B,me))}function w(B,G){const{direction:H}=m.value,{layout:ie}=g.value;if(!u.value)return;const se=$0(B,u.value);ze(se);const $=gA(H,G);c.value={dragHandleId:B,dragHandleRect:se.getBoundingClientRect(),initialCursorPosition:$,initialLayout:ie}}function A(){c.value=null}function _(B){const{panelDataArray:G}=g.value,H=F(G,B);H>=0&&(G.splice(H,1),delete d.value[B.id],g.value.panelDataArrayChanged=!0)}function O(B){const{layout:G,panelDataArray:H}=g.value;if(B.constraints.collapsible){const ie=H.map(pe=>pe.constraints),{collapsedSize:se=0,panelSize:$,pivotIndices:ee}=V(H,B,G);if(ze($!=null,`Panel size not found for panel "${B.id}"`),$!==se){h.value.set(B.id,$);const fe=F(H,B)===H.length-1?$-se:se-$,me=qu({delta:fe,layout:G,panelConstraints:ie,pivotIndices:ee,trigger:"imperative-api"});yd(G,me)||(b(me),g.value.layout=me,r("layout",me),ku(H,me,d.value))}}}function I(B){const{layout:G,panelDataArray:H}=g.value;if(B.constraints.collapsible){const ie=H.map(fe=>fe.constraints),{collapsedSize:se=0,panelSize:$,minSize:ee=0,pivotIndices:pe}=V(H,B,G);if($===se){const fe=h.value.get(B.id),me=fe!=null&&fe>=ee?fe:ee,Nt=F(H,B)===H.length-1?$-me:me-$,at=qu({delta:Nt,layout:G,panelConstraints:ie,pivotIndices:pe,trigger:"imperative-api"});yd(G,at)||(b(at),g.value.layout=at,r("layout",at),ku(H,at,d.value))}}}function N(B){const{layout:G,panelDataArray:H}=g.value,{panelSize:ie}=V(H,B,G);return ze(ie!=null,`Panel size not found for panel "${B.id}"`),ie}function P(B){const{layout:G,panelDataArray:H}=g.value,{collapsedSize:ie=0,collapsible:se,panelSize:$}=V(H,B,G);return se?$===void 0?B.constraints.defaultSize===B.constraints.collapsedSize:$===ie:!1}function R(B){const{layout:G,panelDataArray:H}=g.value,{collapsedSize:ie=0,collapsible:se,panelSize:$}=V(H,B,G);return ze($!=null,`Panel size not found for panel "${B.id}"`),!se||$>ie}VR({direction:s,dragState:c.value,groupId:o,reevaluatePanelConstraints:C,registerPanel:x,registerResizeHandle:S,resizePanel:E,startDragging:w,stopDragging:A,unregisterPanel:_,panelGroupElement:u,collapsePanel:O,expandPanel:I,isPanelCollapsed:P,isPanelExpanded:R,getPanelSize:N,getPanelStyle:y});function F(B,G){return B.findIndex(H=>H===G||H.id===G.id)}function V(B,G,H){const ie=F(B,G),$=ie===B.length-1?[ie-1,ie]:[ie,ie+1],ee=H[ie];return{...G.constraints,panelSize:ee,pivotIndices:$}}return(B,G)=>(T(),L(v(lt),{ref:v(l),as:B.as,"as-child":B.asChild,style:_o({display:"flex",flexDirection:v(s)==="horizontal"?"row":"column",height:"100%",overflow:"hidden",width:"100%"}),"data-panel-group":"","data-orientation":v(s),"data-panel-group-id":v(o)},{default:D(()=>[Q(B.$slots,"default",{layout:f.value})]),_:3},8,["as","as-child","style","data-orientation","data-panel-group-id"]))}}),HR=UR,qR=z({__name:"SplitterPanel",props:{collapsedSize:{type:Number,required:!1},collapsible:{type:Boolean,required:!1},defaultSize:{type:Number,required:!1},id:{type:String,required:!1},maxSize:{type:Number,required:!1},minSize:{type:Number,required:!1},order:{type:Number,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["collapse","expand","resize"],setup(t,{expose:e,emit:n}){const r=t,i=n,s=kA();if(s===null)throw new Error("SplitterPanel components must be rendered within a SplitterGroup container");const{collapsePanel:o,expandPanel:a,getPanelSize:l,getPanelStyle:u,isPanelCollapsed:c,resizePanel:f,groupId:d,reevaluatePanelConstraints:h,registerPanel:p,unregisterPanel:m}=s,g=Wi(r.id,"reka-splitter-panel"),b=q(()=>({callbacks:{onCollapse:()=>i("collapse"),onExpand:()=>i("expand"),onResize:(...A)=>i("resize",...A)},constraints:{collapsedSize:r.collapsedSize&&Number.parseFloat(r.collapsedSize.toFixed(rv)),collapsible:r.collapsible,defaultSize:r.defaultSize,maxSize:r.maxSize,minSize:r.minSize},id:g,idIsFromProps:r.id!==void 0,order:r.order}));nt(()=>b.value.constraints,(A,_)=>{(_.collapsedSize!==A.collapsedSize||_.collapsible!==A.collapsible||_.maxSize!==A.maxSize||_.minSize!==A.minSize)&&h(b.value,_)},{deep:!0}),gn(()=>{p(b.value)}),wo(()=>{m(b.value)});const y=q(()=>u(b.value,r.defaultSize)),x=q(()=>c(b.value)),S=q(()=>!x.value);function E(){o(b.value)}function C(){a(b.value)}function w(A){f(b.value,A)}return e({collapse:E,expand:C,getSize(){return l(b.value)},resize:w,isCollapsed:x,isExpanded:S}),(A,_)=>(T(),L(v(lt),{id:v(g),style:_o(y.value),as:A.as,"as-child":A.asChild,"data-panel":"","data-panel-collapsible":A.collapsible||void 0,"data-panel-group-id":v(d),"data-panel-id":v(g),"data-panel-size":Number.parseFloat(`${y.value.flexGrow}`).toFixed(1),"data-state":A.collapsible?x.value?"collapsed":"expanded":void 0},{default:D(()=>[Q(A.$slots,"default",{isCollapsed:x.value,isExpanded:S.value,expand:C,collapse:E,resize:w})]),_:3},8,["id","style","as","as-child","data-panel-collapsible","data-panel-group-id","data-panel-id","data-panel-size","data-state"]))}}),GR=qR;function WR({disabled:t,handleId:e,resizeHandler:n,panelGroupElement:r}){la(i=>{const s=r.value;if(t.value||n.value===null||s===null)return;const o=$0(e,s);if(o==null)return;const a=l=>{var u;if(!l.defaultPrevented)switch(l.key){case"ArrowDown":case"ArrowLeft":case"ArrowRight":case"ArrowUp":case"End":case"Home":{l.preventDefault(),(u=n.value)==null||u.call(n,l);break}case"F6":{l.preventDefault();const c=o.getAttribute("data-panel-group-id");ze(c);const f=Oc(c,s),d=dA(c,e,s);ze(d!==null);const h=l.shiftKey?d>0?d-1:f.length-1:d+1{o.removeEventListener("keydown",a)})})}var KR=z({__name:"SplitterResizeHandle",props:{id:{type:String,required:!1},hitAreaMargins:{type:Object,required:!1},tabindex:{type:Number,required:!1,default:0},disabled:{type:Boolean,required:!1},nonce:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["dragging"],setup(t,{emit:e}){const n=t,r=e,{forwardRef:i,currentElement:s}=Ye(),{disabled:o}=cr(n),a=kA();if(a===null)throw new Error("PanelResizeHandle components must be rendered within a PanelGroup container");const{direction:l,groupId:u,registerResizeHandle:c,startDragging:f,stopDragging:d,panelGroupElement:h}=a,p=Wi(n.id,"reka-splitter-resize-handle"),m=Z("inactive"),g=Z(!1),b=Z(null),{nonce:y}=cr(n),x=ZC(y);return nt(o,()=>{Of&&(o.value?b.value=null:b.value=c(p))},{immediate:!0}),la(S=>{var w,A;if(o.value||b.value===null)return;const E=s.value;if(!E)return;ze(E);const C=(_,O,I)=>{var N;if(O)switch(_){case"down":{m.value="drag",f(p,I),r("dragging",!0);break}case"move":{m.value!=="drag"&&(m.value="hover"),(N=b.value)==null||N.call(b,I);break}case"up":{m.value="hover",d(),r("dragging",!1);break}}else m.value="inactive"};S(NR(p,E,l,{coarse:((w=n.hitAreaMargins)==null?void 0:w.coarse)??15,fine:((A=n.hitAreaMargins)==null?void 0:A.fine)??5},x,C))}),WR({disabled:o,resizeHandler:b,handleId:p,panelGroupElement:h}),(S,E)=>(T(),L(v(lt),{id:v(p),ref:v(i),style:{touchAction:"none",userSelect:"none"},as:S.as,"as-child":S.asChild,role:"separator","data-resize-handle":"",tabindex:S.tabindex,"data-state":m.value,"data-disabled":v(o)?"":void 0,"data-orientation":v(l),"data-panel-group-id":v(u),"data-resize-handle-active":m.value==="drag"?"pointer":g.value?"keyboard":void 0,"data-resize-handle-state":m.value,"data-panel-resize-handle-enabled":!v(o),"data-panel-resize-handle-id":v(p),onBlur:E[0]||(E[0]=C=>g.value=!1),onFocus:E[1]||(E[1]=C=>g.value=!1)},{default:D(()=>[Q(S.$slots,"default")]),_:3},8,["id","as","as-child","tabindex","data-state","data-disabled","data-orientation","data-panel-group-id","data-resize-handle-active","data-resize-handle-state","data-panel-resize-handle-enabled","data-panel-resize-handle-id"]))}}),XR=KR;const[YR,JR]=Ir("SwitchRoot");var ZR=z({__name:"SwitchRoot",props:{defaultValue:{type:Boolean,required:!1},modelValue:{type:[Boolean,null],required:!1,default:void 0},disabled:{type:Boolean,required:!1},id:{type:String,required:!1},value:{type:String,required:!1,default:"on"},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"button"},name:{type:String,required:!1},required:{type:Boolean,required:!1}},emits:["update:modelValue"],setup(t,{emit:e}){const n=t,r=e,{disabled:i}=cr(n),s=_a(n,"modelValue",r,{defaultValue:n.defaultValue,passive:n.modelValue===void 0});function o(){i.value||(s.value=!s.value)}const{forwardRef:a,currentElement:l}=Ye(),u=TI(l),c=q(()=>{var f;return n.id&&l.value?(f=document.querySelector(`[for="${n.id}"]`))==null?void 0:f.innerText:void 0});return JR({modelValue:s,toggleCheck:o,disabled:i}),(f,d)=>(T(),L(v(lt),Ce(f.$attrs,{id:f.id,ref:v(a),role:"switch",type:f.as==="button"?"button":void 0,value:f.value,"aria-label":f.$attrs["aria-label"]||c.value,"aria-checked":v(s),"aria-required":f.required,"data-state":v(s)?"checked":"unchecked","data-disabled":v(i)?"":void 0,"as-child":f.asChild,as:f.as,disabled:v(i),onClick:o,onKeydown:Gy(eo(o,["prevent"]),["enter"])}),{default:D(()=>[Q(f.$slots,"default",{modelValue:v(s)}),v(u)&&f.name?(T(),L(v(II),{key:0,type:"checkbox",name:f.name,disabled:v(i),required:f.required,value:f.value,checked:!!v(s)},null,8,["name","disabled","required","value","checked"])):we("v-if",!0)]),_:3},16,["id","type","value","aria-label","aria-checked","aria-required","data-state","data-disabled","as-child","as","disabled","onKeydown"]))}}),QR=ZR,eN=z({__name:"SwitchThumb",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"span"}},setup(t){const e=YR();return Ye(),(n,r)=>{var i;return T(),L(v(lt),{"data-state":(i=v(e).modelValue)!=null&&i.value?"checked":"unchecked","data-disabled":v(e).disabled.value?"":void 0,"as-child":n.asChild,as:n.as},{default:D(()=>[Q(n.$slots,"default")]),_:3},8,["data-state","data-disabled","as-child","as"])}}}),tN=eN;const[ov,nN]=Ir("TabsRoot");var rN=z({__name:"TabsRoot",props:{defaultValue:{type:null,required:!1},orientation:{type:String,required:!1,default:"horizontal"},dir:{type:String,required:!1},activationMode:{type:String,required:!1,default:"automatic"},modelValue:{type:null,required:!1},unmountOnHide:{type:Boolean,required:!1,default:!0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["update:modelValue"],setup(t,{emit:e}){const n=t,r=e,{orientation:i,unmountOnHide:s,dir:o}=cr(n),a=Jl(o);Ye();const l=_a(n,"modelValue",r,{defaultValue:n.defaultValue,passive:n.modelValue===void 0}),u=Z();return nN({modelValue:l,changeModelValue:c=>{l.value=c},orientation:i,dir:a,unmountOnHide:s,activationMode:n.activationMode,baseId:Wi(void 0,"reka-tabs"),tabsList:u}),(c,f)=>(T(),L(v(lt),{dir:v(a),"data-orientation":v(i),"as-child":c.asChild,as:c.as},{default:D(()=>[Q(c.$slots,"default",{modelValue:v(l)})]),_:3},8,["dir","data-orientation","as-child","as"]))}}),iN=rN;function OA(t,e){return`${t}-trigger-${e}`}function TA(t,e){return`${t}-content-${e}`}var sN=z({__name:"TabsContent",props:{value:{type:[String,Number],required:!0},forceMount:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(t){const e=t,{forwardRef:n}=Ye(),r=ov(),i=q(()=>OA(r.baseId,e.value)),s=q(()=>TA(r.baseId,e.value)),o=q(()=>e.value===r.modelValue.value),a=Z(o.value);return gn(()=>{requestAnimationFrame(()=>{a.value=!1})}),(l,u)=>(T(),L(v(Yl),{present:l.forceMount||o.value,"force-mount":""},{default:D(({present:c})=>[k(v(lt),{id:s.value,ref:v(n),"as-child":l.asChild,as:l.as,role:"tabpanel","data-state":o.value?"active":"inactive","data-orientation":v(r).orientation.value,"aria-labelledby":i.value,hidden:!c,tabindex:"0",style:_o({animationDuration:a.value?"0s":void 0})},{default:D(()=>[!v(r).unmountOnHide.value||c?Q(l.$slots,"default",{key:0}):we("v-if",!0)]),_:2},1032,["id","as-child","as","data-state","data-orientation","aria-labelledby","hidden","style"])]),_:3},8,["present"]))}}),oN=sN,aN=z({__name:"TabsList",props:{loop:{type:Boolean,required:!1,default:!0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(t){const e=t,{loop:n}=cr(e),{forwardRef:r,currentElement:i}=Ye(),s=ov();return s.tabsList=i,(o,a)=>(T(),L(v(rA),{"as-child":"",orientation:v(s).orientation.value,dir:v(s).dir.value,loop:v(n)},{default:D(()=>[k(v(lt),{ref:v(r),role:"tablist","as-child":o.asChild,as:o.as,"aria-orientation":v(s).orientation.value},{default:D(()=>[Q(o.$slots,"default")]),_:3},8,["as-child","as","aria-orientation"])]),_:3},8,["orientation","dir","loop"]))}}),lN=aN,uN=z({__name:"TabsTrigger",props:{value:{type:[String,Number],required:!0},disabled:{type:Boolean,required:!1,default:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"button"}},setup(t){const e=t,{forwardRef:n}=Ye(),r=ov(),i=q(()=>OA(r.baseId,e.value)),s=q(()=>TA(r.baseId,e.value)),o=q(()=>e.value===r.modelValue.value);return(a,l)=>(T(),L(v(WP),{"as-child":"",focusable:!a.disabled,active:o.value},{default:D(()=>[k(v(lt),{id:i.value,ref:v(n),role:"tab",type:a.as==="button"?"button":void 0,as:a.as,"as-child":a.asChild,"aria-selected":o.value?"true":"false","aria-controls":s.value,"data-state":o.value?"active":"inactive",disabled:a.disabled,"data-disabled":a.disabled?"":void 0,"data-orientation":v(r).orientation.value,onMousedown:l[0]||(l[0]=eo(u=>{!a.disabled&&u.ctrlKey===!1?v(r).changeModelValue(a.value):u.preventDefault()},["left"])),onKeydown:l[1]||(l[1]=Gy(u=>v(r).changeModelValue(a.value),["enter","space"])),onFocus:l[2]||(l[2]=()=>{const u=v(r).activationMode!=="manual";!o.value&&!a.disabled&&u&&v(r).changeModelValue(a.value)})},{default:D(()=>[Q(a.$slots,"default")]),_:3},8,["id","type","as","as-child","aria-selected","aria-controls","data-state","disabled","data-disabled","data-orientation"])]),_:3},8,["focusable","active"]))}}),cN=uN;const fN=z({__name:"AppSidebarGroupLabel",props:{class:{},asChild:{type:Boolean},as:{}},setup(t){const e=t;return(n,r)=>(T(),L(v(lt),{"data-sidebar":"group-label",as:t.as,"as-child":t.asChild,class:Se(v(ke)("text-sidebar-foreground/70 ring-sidebar-ring flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium transition-[margin,opa] duration-200 ease-linear outline-none focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0",e.class))},{default:D(()=>[Q(n.$slots,"default")]),_:3},8,["as","as-child","class"]))}});var _r=(t=>(t.Text="text",t.File="file",t))(_r||{});function dN(t){if(typeof t!="string")return null;try{return JSON.parse(t)}catch{return null}}const hN=Ca("errors",()=>{const t=Z(null),e=()=>{var i;t.value=dN(((i=window.Nimbus)==null?void 0:i.globalException)??null)},n=()=>{t.value=null},r=q(()=>t.value!==null);return{globalError:t,initializeGlobalErrors:e,clearGlobalError:n,hasGlobalError:r}}),pN=Ca("sharedState",()=>{const t=Z(null),e=Z(!1),n=q(()=>t.value!==null),r=q(()=>e.value),i=q(()=>{var c;return((c=t.value)==null?void 0:c.routeExists)??!0}),s=q(()=>{var c;return(c=t.value)==null?void 0:c.payload}),o=q(()=>{var c;return(c=t.value)==null?void 0:c.error});return{sharedState:t,isRestoredFromShare:e,hasSharedState:n,wasImportedFromShare:r,routeExists:i,sharedPayload:s,sharedError:o,initializeFromWindow:()=>{var f;const c=(f=window.Nimbus)==null?void 0:f.sharedState;c&&(t.value=c,e.value=!0)},markAsConsumed:()=>{e.value=!0},clearSharedState:()=>{t.value=null,e.value=!1}}});/** * @license lucide-vue-next v0.475.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const pN=nt("ChevronLeftIcon",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/** + */const mN=rt("ChevronLeftIcon",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/** * @license lucide-vue-next v0.475.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const V0=nt("ChevronRightIcon",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/** + */const U0=rt("ChevronRightIcon",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/** * @license lucide-vue-next v0.475.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const ov=nt("ChevronsLeftRightIcon",[["path",{d:"m9 7-5 5 5 5",key:"j5w590"}],["path",{d:"m15 7 5 5-5 5",key:"1bl6da"}]]);/** + */const av=rt("ChevronsLeftRightIcon",[["path",{d:"m9 7-5 5 5 5",key:"j5w590"}],["path",{d:"m15 7 5 5-5 5",key:"1bl6da"}]]);/** * @license lucide-vue-next v0.475.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const mN=nt("CircleAlertIcon",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/** + */const gN=rt("CircleAlertIcon",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/** * @license lucide-vue-next v0.475.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const gN=nt("CircleHelpIcon",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/** + */const bN=rt("CircleHelpIcon",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/** * @license lucide-vue-next v0.475.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const bN=nt("CircleSlash2Icon",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M22 2 2 22",key:"y4kqgn"}]]);/** + */const yN=rt("CircleSlash2Icon",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M22 2 2 22",key:"y4kqgn"}]]);/** * @license lucide-vue-next v0.475.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const yN=nt("CodeXmlIcon",[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]]);/** + */const vN=rt("CodeXmlIcon",[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]]);/** * @license lucide-vue-next v0.475.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const vN=nt("CornerDownLeftIcon",[["polyline",{points:"9 10 4 15 9 20",key:"r3jprv"}],["path",{d:"M20 4v7a4 4 0 0 1-4 4H4",key:"6o5b7l"}]]);/** + */const xN=rt("CornerDownLeftIcon",[["polyline",{points:"9 10 4 15 9 20",key:"r3jprv"}],["path",{d:"M20 4v7a4 4 0 0 1-4 4H4",key:"6o5b7l"}]]);/** * @license lucide-vue-next v0.475.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const xN=nt("DatabaseBackupIcon",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 12a9 3 0 0 0 5 2.69",key:"1ui2ym"}],["path",{d:"M21 9.3V5",key:"6k6cib"}],["path",{d:"M3 5v14a9 3 0 0 0 6.47 2.88",key:"i62tjy"}],["path",{d:"M12 12v4h4",key:"1bxaet"}],["path",{d:"M13 20a5 5 0 0 0 9-3 4.5 4.5 0 0 0-4.5-4.5c-1.33 0-2.54.54-3.41 1.41L12 16",key:"1f4ei9"}]]);/** + */const SN=rt("DatabaseBackupIcon",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 12a9 3 0 0 0 5 2.69",key:"1ui2ym"}],["path",{d:"M21 9.3V5",key:"6k6cib"}],["path",{d:"M3 5v14a9 3 0 0 0 6.47 2.88",key:"i62tjy"}],["path",{d:"M12 12v4h4",key:"1bxaet"}],["path",{d:"M13 20a5 5 0 0 0 9-3 4.5 4.5 0 0 0-4.5-4.5c-1.33 0-2.54.54-3.41 1.41L12 16",key:"1f4ei9"}]]);/** * @license lucide-vue-next v0.475.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const SN=nt("ExternalLinkIcon",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);/** + */const EN=rt("ExternalLinkIcon",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);/** * @license lucide-vue-next v0.475.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const EN=nt("EyeClosedIcon",[["path",{d:"m15 18-.722-3.25",key:"1j64jw"}],["path",{d:"M2 8a10.645 10.645 0 0 0 20 0",key:"1e7gxb"}],["path",{d:"m20 15-1.726-2.05",key:"1cnuld"}],["path",{d:"m4 15 1.726-2.05",key:"1dsqqd"}],["path",{d:"m9 18 .722-3.25",key:"ypw2yx"}]]);/** + */const wN=rt("EyeClosedIcon",[["path",{d:"m15 18-.722-3.25",key:"1j64jw"}],["path",{d:"M2 8a10.645 10.645 0 0 0 20 0",key:"1e7gxb"}],["path",{d:"m20 15-1.726-2.05",key:"1cnuld"}],["path",{d:"m4 15 1.726-2.05",key:"1dsqqd"}],["path",{d:"m9 18 .722-3.25",key:"ypw2yx"}]]);/** * @license lucide-vue-next v0.475.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const wN=nt("EyeIcon",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/** + */const _N=rt("EyeIcon",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/** * @license lucide-vue-next v0.475.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const _N=nt("FolderIcon",[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]);/** + */const CN=rt("FolderIcon",[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]);/** * @license lucide-vue-next v0.475.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const CN=nt("GripVerticalIcon",[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]]);/** + */const AN=rt("GripVerticalIcon",[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]]);/** * @license lucide-vue-next v0.475.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const AN=nt("HistoryIcon",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]]);/** + */const DN=rt("HistoryIcon",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]]);/** * @license lucide-vue-next v0.475.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const DN=nt("ImportIcon",[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m8 11 4 4 4-4",key:"1dohi6"}],["path",{d:"M8 5H4a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2h-4",key:"1ywtjm"}]]);/** + */const kN=rt("ImportIcon",[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m8 11 4 4 4-4",key:"1dohi6"}],["path",{d:"M8 5H4a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2h-4",key:"1ywtjm"}]]);/** * @license lucide-vue-next v0.475.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const TA=nt("InfoIcon",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/** + */const IA=rt("InfoIcon",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/** * @license lucide-vue-next v0.475.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const kN=nt("LayersIcon",[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]]);/** + */const ON=rt("LayersIcon",[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]]);/** * @license lucide-vue-next v0.475.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const ON=nt("LightbulbIcon",[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]]);/** + */const TN=rt("LightbulbIcon",[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]]);/** * @license lucide-vue-next v0.475.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const IA=nt("Link2Icon",[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]]);/** + */const PA=rt("Link2Icon",[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]]);/** * @license lucide-vue-next v0.475.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const TN=nt("LoaderCircleIcon",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/** + */const IN=rt("LoaderCircleIcon",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/** * @license lucide-vue-next v0.475.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const IN=nt("LockKeyholeOpenIcon",[["circle",{cx:"12",cy:"16",r:"1",key:"1au0dj"}],["rect",{width:"18",height:"12",x:"3",y:"10",rx:"2",key:"l0tzu3"}],["path",{d:"M7 10V7a5 5 0 0 1 9.33-2.5",key:"car5b7"}]]);/** + */const PN=rt("LockKeyholeOpenIcon",[["circle",{cx:"12",cy:"16",r:"1",key:"1au0dj"}],["rect",{width:"18",height:"12",x:"3",y:"10",rx:"2",key:"l0tzu3"}],["path",{d:"M7 10V7a5 5 0 0 1 9.33-2.5",key:"car5b7"}]]);/** * @license lucide-vue-next v0.475.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Fx=nt("LockOpenIcon",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 9.9-1",key:"1mm8w8"}]]);/** + */const Lx=rt("LockOpenIcon",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 9.9-1",key:"1mm8w8"}]]);/** * @license lucide-vue-next v0.475.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const PN=nt("LockIcon",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]);/** + */const RN=rt("LockIcon",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]);/** * @license lucide-vue-next v0.475.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const RN=nt("PlusIcon",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/** + */const NN=rt("PlusIcon",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/** * @license lucide-vue-next v0.475.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const PA=nt("RefreshCcwIcon",[["path",{d:"M21 12a9 9 0 0 0-9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"14sxne"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M3 12a9 9 0 0 0 9 9 9.75 9.75 0 0 0 6.74-2.74L21 16",key:"1hlbsb"}],["path",{d:"M16 16h5v5",key:"ccwih5"}]]);/** + */const RA=rt("RefreshCcwIcon",[["path",{d:"M21 12a9 9 0 0 0-9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"14sxne"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M3 12a9 9 0 0 0 9 9 9.75 9.75 0 0 0 6.74-2.74L21 16",key:"1hlbsb"}],["path",{d:"M16 16h5v5",key:"ccwih5"}]]);/** * @license lucide-vue-next v0.475.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const NN=nt("RefreshCwOffIcon",[["path",{d:"M21 8L18.74 5.74A9.75 9.75 0 0 0 12 3C11 3 10.03 3.16 9.13 3.47",key:"1krf6h"}],["path",{d:"M8 16H3v5",key:"1cv678"}],["path",{d:"M3 12C3 9.51 4 7.26 5.64 5.64",key:"ruvoct"}],["path",{d:"m3 16 2.26 2.26A9.75 9.75 0 0 0 12 21c2.49 0 4.74-1 6.36-2.64",key:"19q130"}],["path",{d:"M21 12c0 1-.16 1.97-.47 2.87",key:"4w8emr"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M22 22 2 2",key:"1r8tn9"}]]);/** + */const MN=rt("RefreshCwOffIcon",[["path",{d:"M21 8L18.74 5.74A9.75 9.75 0 0 0 12 3C11 3 10.03 3.16 9.13 3.47",key:"1krf6h"}],["path",{d:"M8 16H3v5",key:"1cv678"}],["path",{d:"M3 12C3 9.51 4 7.26 5.64 5.64",key:"ruvoct"}],["path",{d:"m3 16 2.26 2.26A9.75 9.75 0 0 0 12 21c2.49 0 4.74-1 6.36-2.64",key:"19q130"}],["path",{d:"M21 12c0 1-.16 1.97-.47 2.87",key:"4w8emr"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M22 22 2 2",key:"1r8tn9"}]]);/** * @license lucide-vue-next v0.475.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const MN=nt("SkipForwardIcon",[["polygon",{points:"5 4 15 12 5 20 5 4",key:"16p6eg"}],["line",{x1:"19",x2:"19",y1:"5",y2:"19",key:"futhcm"}]]);/** + */const FN=rt("SkipForwardIcon",[["polygon",{points:"5 4 15 12 5 20 5 4",key:"16p6eg"}],["line",{x1:"19",x2:"19",y1:"5",y2:"19",key:"futhcm"}]]);/** * @license lucide-vue-next v0.475.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const up=nt("Trash2Icon",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/** + */const cp=rt("Trash2Icon",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/** * @license lucide-vue-next v0.475.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const U0=nt("TriangleAlertIcon",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/** + */const H0=rt("TriangleAlertIcon",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/** * @license lucide-vue-next v0.475.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const FN=nt("UserRoundIcon",[["circle",{cx:"12",cy:"8",r:"5",key:"1hypcn"}],["path",{d:"M20 21a8 8 0 0 0-16 0",key:"rfgkzh"}]]);/** + */const LN=rt("UserRoundIcon",[["circle",{cx:"12",cy:"8",r:"5",key:"1hypcn"}],["path",{d:"M20 21a8 8 0 0 0-16 0",key:"rfgkzh"}]]);/** * @license lucide-vue-next v0.475.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const LN=nt("WandSparklesIcon",[["path",{d:"m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72",key:"ul74o6"}],["path",{d:"m14 7 3 3",key:"1r5n42"}],["path",{d:"M5 6v4",key:"ilb8ba"}],["path",{d:"M19 14v4",key:"blhpug"}],["path",{d:"M10 2v2",key:"7u0qdc"}],["path",{d:"M7 8H3",key:"zfb6yr"}],["path",{d:"M21 16h-4",key:"1cnmox"}],["path",{d:"M11 3H9",key:"1obp7u"}]]),RA=t=>{const e=new FormData;return Object.entries(t).forEach(([n,r])=>{X1(e,n,r)}),e},X1=(t,e,n)=>{if(Array.isArray(n)){n.forEach((r,i)=>{X1(t,`${e}[${i}]`,r)});return}if(n instanceof Blob){t.append(e,n);return}if(n&&typeof n=="object"){(n instanceof FormData?n.entries():Object.entries(n)).forEach(([i,s])=>{X1(t,`${e}[${i}]`,s)});return}t.append(e,n===null?"":String(n))};var xt=(t=>(t.INFORMATION="Information",t.SUCCESS="Success",t.SERVER_ERROR="Server Error",t.CLIENT_ERROR="Client Error",t.REDIRECT="Redirect",t.EMPTY="No request yet",t.PENDING="Pending",t.OTHER="Other",t.DUMP_AND_DIE="Dump & Die",t))(xt||{});const BN=t=>t>=100&&t<200?xt.INFORMATION:t>=200&&t<300?xt.SUCCESS:t>=300&&t<400?xt.REDIRECT:t>=400&&t<500?xt.CLIENT_ERROR:t>=500&&t<600?xt.SERVER_ERROR:t===999?xt.DUMP_AND_DIE:xt.OTHER;function $N(){const t=Xi(),e=Z(null),n=Z(!1),r=c=>{const f=t.apiUrl,d=c.endpoint.replace(/^\/+/,""),h=new URL(`${f}/${d}`);return c.queryParameters.filter(p=>p.enabled&&p.key.trim()).forEach(p=>{h.searchParams.append(p.key,p.value)}),h.toString()},i=c=>{const f=c.body[c.method]??null;return f?f[c.payloadType]??null:null},s=c=>{const f=RI(c.payloadType,c.headers.filter(d=>d.enabled&&d.key.trim()!=="").map(d=>({key:d.key,value:d.value})));return{endpoint:r(c),method:c.method,headers:f,authorization:c.authorization,body:i(c)}},o=c=>{const f=c.headers,d=c.statusCode,h=c.headers.find(p=>p.key.toLowerCase()==="content-length");return{status:BN(d),statusCode:d,statusText:c.statusText,body:c.body,sizeInBytes:h?Number(h.value):c.body.length,headers:f,cookies:c.cookies.map(p=>({key:p.key,value:{raw:p.value.raw,decrypted:p.value.decrypted}})),timestamp:c.timestamp}},a=c=>new Promise((f,d)=>{var b;const h=t.appBasePath+"/api/relay",p=s(c),m=RA(p),g={"Content-Type":"multipart/form-data"};c.transactionMode&&(g["X-Nimbus-Transaction-Mode"]="1"),PI.post(h,m,{headers:g,transformResponse:y=>y,signal:(b=e.value)==null?void 0:b.signal}).then(y=>{const x=JSON.parse(y.data),S=o(x);f({response:S,duration:x.duration})}).catch(y=>{if(y.code==="ERR_CANCELED"){f(null);return}if(y.response){let x=y.message;try{x=JSON.parse(y.response.data).message??y.message}catch(S){console.error(S)}d({message:x,status:y.response.status,body:y.response.data});return}d({message:y.message})})});return{executeRequest:async c=>{if(n.value)throw new Error("Request already in progress");n.value=!0,e.value=new AbortController;try{const f=new Promise((d,h)=>setTimeout(()=>h(new Error("Request timeout")),II.TIMEOUT));return await Promise.race([a(c),f])}finally{n.value=!1,e.value=null}},cancelCurrentRequest:()=>{e.value&&e.value.abort()},buildRequestUrl:r,isExecuting:kc(n)}}const zN=t=>JSON.stringify(t,null,3),jN=t=>Object.entries(t).map(([e,n])=>`${e}=${n};`).join(` -`),Lx=(t,e)=>{switch(e){case Or.JSON:return zN(t);case Or.PLAIN_TEXT:return jN(t);case Or.FORM_DATA:return RA(t);default:return null}},ll={EMPTY_FIELD_PROBABILITY:.3,MAX_ARRAY_ITEMS:5,MIN_ARRAY_ITEMS:1,NUMBER_RANGE:{min:1,max:9999},STRING_LENGTH:{minLength:5,maxLength:20}};var jo=(t=>(t.STRING="string",t.INTEGER="integer",t.NUMBER="number",t.BOOLEAN="boolean",t.ARRAY="array",t.OBJECT="object",t))(jo||{});function VN(t){return t==="string"||t==="integer"||t==="number"||t==="boolean"}function UN(t){return t==="array"||t==="object"}function HN(t){return H0(t,!1)}function qN(t){return H0(t,!0)}function GN(t,e){if(!t.enum||t.enum.length===0)throw new Error("Enum values are required for enum type");return e?t.enum[0]:O0.helpers.arrayElement(t.enum)}function WN(t,e,n,r){switch(t.type){case jo.STRING:return ZN(t,e,n,r);case jo.NUMBER:case jo.INTEGER:return QN(t,e,n);case jo.BOOLEAN:return e?!1:O0.datatype.boolean();default:throw new Error(`Unsupported primitive type: ${t.type}`)}}function KN(t,e){switch(t.type){case jo.ARRAY:return JN(t,e);case jo.OBJECT:return t.properties?H0(t,e):{};default:throw new Error(`Unsupported complex type: ${t.type}`)}}function NA(t,e,n,r){return t.enum&&t.enum.length>0?GN(t,e):t.type&&VN(t.type)?WN(t,e,n,r):t.type&&UN(t.type)?KN(t,e):null}function XN(t,e,n){return Array.from({length:n},()=>H0(t,e))}function YN(t,e,n){return Array.from({length:n},()=>NA(t,e,"item",!1)).filter(i=>i!==null&&i.toString().length)}function JN(t,e){const n=t.items;if(n===void 0||typeof n!="object"||n===null||Array.isArray(n))return[];const r=e?ll.MIN_ARRAY_ITEMS:ll.MIN_ARRAY_ITEMS+Math.floor(Math.random()*ll.MAX_ARRAY_ITEMS);return n.properties!==void 0?XN(n,e,r):YN(n,e,r)}function H0(t,e=!1){const n={};if(t.properties&&typeof t.properties=="object"){const r=t.required||[];for(const i in t.properties){const s=t.properties[i];if(typeof s!="object"||s===null||Array.isArray(s))continue;const o=r.includes(i);n[i]=NA(s,e,i,o)}}return n}function ZN(t,e,n,r){if(e)return"";if(!r&&Math.random()o.id===s))==null?void 0:i.generate())??null}for(const s of NI){if(r&&!s.isInteger||!s.pattern.test(n))continue;const o=Ax.find(a=>a.id===s.generatorId);if(o)return o.generate({...s.generatorConfig,...e})??null}return null}async function eM(t){const e={};return Object.keys(t).forEach(n=>{const r=t[n],i=[];Object.keys(r).forEach(s=>{const o=r[s];i.push({resource:s,routes:o.flatMap(a=>a.methods.map(l=>({method:l,endpoint:a.uri,shortEndpoint:a.shortUri,schema:{shape:a.schema,extractionErrors:a.extractionError},metadata:a.metadata}))).sort((a,l)=>a.shortEndpoint.localeCompare(l.shortEndpoint))})}),e[n]=i.sort((s,o)=>s.resource.localeCompare(o.resource))}),e}function tM(t){if(typeof t!="string")return null;try{return JSON.parse(t)}catch{return null}}function nM(t,e){if(!t||!e.trim())return[];const n=[],r=e.toLowerCase();return Object.entries(t).forEach(([i,s])=>{s.forEach(o=>{o.routes.forEach(a=>{(a.endpoint.toLowerCase().includes(r)||a.shortEndpoint.toLowerCase().includes(r)||a.method.toLowerCase().includes(r)||o.resource.toLowerCase().includes(r))&&n.push({version:i,resource:o.resource,route:a})})})}),n}function rM(t){return t?Object.values(t).reduce((e,n)=>e+n.reduce((r,i)=>r+i.routes.length,0),0):0}const cp=[],FA=t=>`nimbus:${t}`,LA=t=>{if(cp.includes(t)){const e=t+"-duplicate";return console.warn(`Key ${t} must be unique. '${e}' will be used instead.`),LA(e)}return cp.push(t),FA(t)},Tf=t=>(cp.includes(t)||cp.push(t),FA(t));function iM(t,e){const{queryParameters:n,requestBody:r}=sM(t),i=oM(t.method),s=$A(e,t.endpoint,n),o=aM(t),a=lM(t.authorization),l=pM(r);return{command:["curl"].concat(i?[i]:[]).concat([`"${s}"`]).concat(o).concat(a?[a]:[]).concat(l).join(` \\ - `),hasSpecialAuth:yM(t.authorization)}}function sM(t){const e=hM(t);if(t.method.toLowerCase()==="get"){const r=mM(e,t.payloadType);return{queryParameters:[...t.queryParameters.filter(BA),...uM(r)],requestBody:null}}return{queryParameters:t.queryParameters,requestBody:e}}function oM(t){const e=t.toUpperCase();return e==="GET"?null:`-X ${e}`}function aM(t){const e=cM(t),n=e.map(i=>`-H "${i.key}: ${i.value}"`),r=MI(t.payloadType);return r&&(e.some(s=>s.key.toLowerCase()==="content-type")||n.push(`-H "Content-Type: ${r}"`)),n}function lM(t){const e=fM(t);return e?`-H "${e}"`:null}function uM(t){return Object.entries(t).map(([e,n])=>({type:_r.Text,enabled:!0,key:e,value:n}))}function cM(t){return t.headers.filter(BA)}function BA(t){return t.enabled&&t.key.trim()!==""}function fM(t){if(!t)return null;switch(t.type){case Je.Bearer:return`Authorization: Bearer ${t.value}`;case Je.Basic:return dM(t.value);case Je.None:case Je.CurrentUser:case Je.Impersonate:return null;default:return null}}function dM(t){return`Authorization: Basic ${btoa(`${t.username}:${t.password}`)}`}function hM(t){const n=t.body[t.method];if(n===void 0)return null;const r=n[t.payloadType];return r===void 0?null:r}function pM(t){return t===null?[]:gM(t)}function mM(t,e){return t===null?{}:typeof t=="string"&&e===Or.JSON?JSON.parse(t):t instanceof FormData?Object.fromEntries(Array.from(t.entries()).map(([n,r])=>[n,r instanceof File?`@${r}`:r])):t.split(` -`).reduce(function(n,r){const{0:i,1:s}=r.split("=");return n[i]=s,n},{})}function gM(t){return typeof t=="string"?[`-d '${t}'`]:bM(t)}function bM(t){return Array.from(t.entries()).map(([e,n])=>n instanceof File?`-F ${e}=@${n.name}`:`-F ${e}=${n}`)}function yM(t){return t.type===Je.CurrentUser?!0:t.type===Je.Impersonate}function vM(t){return t.key.trim()!==""}function $A(t,e,n){const r=new URL(`${t}/${e}`);return n.forEach(i=>{vM(i)&&Y1(r.searchParams,i.key,i.value)}),r.toString()}function Y1(t,e,n){n!=null&&(Array.isArray(n)?n.forEach(r=>Y1(t,`${e}[]`,r)):typeof n=="object"?Object.entries(n).forEach(([r,i])=>{Y1(t,`${e}[${r}]`,i)}):t.append(e,String(n)))}function $x(t){return Object.keys(t.schema.shape.properties??{}).length>0?Or.JSON:Or.EMPTY}function xM(t,e,n){return{durationInMs:e,isProcessing:!1,request:zA(t),response:n}}function SM(t,e){return{durationInMs:0,isProcessing:!1,request:zA(t),error:e}}const zA=function(t){const e=t.body[t.method]??null,n=e?e[t.payloadType]??null:null;return{method:t.method,endpoint:t.endpoint,headers:t.headers.map(r=>({...r})),body:n,queryParameters:t.queryParameters.map(r=>({...r})),payloadType:t.payloadType,authorization:{...t.authorization},routeDefinition:{...t.routeDefinition},transactionMode:t.transactionMode}};function EM(t){const e=performance.now();let r=window.setInterval(()=>{const i=Math.floor(performance.now()-e);t(i)},86);return{stop:()=>(r&&(clearInterval(r),r=null),Math.floor(performance.now()-e))}}const wM=Ca("_requestExecutor",()=>{const t=q0(),e=ka(),{executeRequest:n,cancelCurrentRequest:r}=$N(),i=Z(!1),s=Z(0),o=q(()=>l=>l!==null&&!l.isProcessing&&l.endpoint.trim()!=="");return{isProcessing:i,duration:s,canExecute:o,executeRequestWithTiming:async l=>{if(!o.value(l))return;let u=null;const c=()=>{u&&u.stop(),l.isProcessing=!1,l.wasExecuted=!0};try{l.isProcessing=!0,l.durationInMs=0,u=EM(h=>{l.isProcessing&&(l.durationInMs=h)});const f=await n(l);if(f===null){c(),l.durationInMs=0;return}const d=xM(l,f.duration,f.response);t.addLog(d),e.updateActiveTabResponse(d)}catch(f){const d=SM(l,f);t.addLog(d),e.updateActiveTabResponse(d),console.error("Request failed:",f)}finally{c()}},cancelCurrentRequest:r}}),q0=Ca("requestHistory",()=>{const t=Wy(),e=Z([]),n=Z(null),r=q(()=>t.preferences.maxHistoryLogs),i=q(()=>e.value),s=q(()=>n.value!==null&&e.value[n.value]?e.value[n.value]:e.value[e.value.length-1]??null);return{logs:e,maxLogs:r,activeLogIndex:n,allLogs:i,lastLog:s,addLog:u=>{e.value.push(u),e.value.length>r.value&&(e.value=e.value.slice(-r.value)),n.value=null},clearLogs:()=>{e.value=[]},setActiveLog:u=>{n.value=u}}},{persist:!0}),Rr=Ca("request",()=>{const t=ka(),e=wM(),n=q(()=>t.hasActiveRequest),r=q(()=>t.pendingRequestData),i=q(()=>e.canExecute(t.pendingRequestData)),s=(o,a)=>{var l,u;o.endpoint===((l=r.value)==null?void 0:l.endpoint)&&o.method===((u=r.value)==null?void 0:u.method)||(e.cancelCurrentRequest(),t.openTab(o,a))};return{isProcessing:q(()=>e.isProcessing),hasActiveRequest:n,pendingRequestData:r,canExecute:i,updateRequestMethod:t.updateRequestMethod,updateRequestEndpoint:t.updateRequestEndpoint,updateRequestHeaders:t.updateRequestHeaders,updateRequestBody:t.updateRequestBody,updateQueryParameters:t.updateQueryParameters,updateAuthorization:t.updateAuthorization,updateTransactionMode:t.updateTransactionMode,getRequestUrl:t.getRequestUrl,resetRequest:t.resetRequest,restoreFromHistory:t.restoreFromHistory,executeCurrentRequest:()=>{if(t.pendingRequestData)return e.executeRequestWithTiming(t.pendingRequestData)},cancelCurrentRequest:e.cancelCurrentRequest,initializeRequest:s}});function jA(t,e){switch(t){case Eh.Uuid:return e.generateValue("uuid");case Eh.Email:return e.generateValue("email");case Eh.String:return e.generateValue("word");default:return e.generateValue("word")}}const ka=Ca("tabs",()=>{const t=Wy(),e=Xi(),n=T0(),r=Z([]),i=Z(null),s=Z(null),o=Z([]),a=q(()=>r.value.find($=>$.id===i.value)??null),l=q(()=>{var $;return(($=a.value)==null?void 0:$.request)??null}),u=q(()=>{var $;return(($=a.value)==null?void 0:$.response)??null}),c=q(()=>l.value),f=q(()=>l.value!==null),d=()=>e.headers.map($=>({type:_r.Text,key:$.header,value:$.type==="generator"?jA($.value,n):String($.value),enabled:!0}));function h(){if(!l.value)return;const $=o.value.map(fe=>fe.key),ee=l.value.headers.filter(fe=>!$.includes(fe.key)),pe=d();l.value.headers=[...pe,...ee],o.value=pe}const p=()=>l.value!==null?l.value.authorization:t.preferences.defaultAuthorizationType===Je.CurrentUser?{type:Je.CurrentUser}:t.preferences.defaultAuthorizationType===Je.Impersonate?{type:Je.Impersonate,value:1}:t.preferences.defaultAuthorizationType===Je.Bearer?{type:Je.Bearer,value:""}:t.preferences.defaultAuthorizationType===Je.Basic?{type:Je.Basic,value:{username:"",password:""}}:{type:Je.None},m=$=>t.preferences.defaultRequestBodyType===-1?$x($):t.preferences.defaultRequestBodyType;function g($){const ee=d(),pe=ee.map(me=>me.key),fe=$.headers.filter(me=>!pe.includes(me.key));$.headers=[...ee,...fe],o.value=ee}function b($,ee){var fe,me,Me;const pe={method:$.method,endpoint:$.endpoint,headers:(fe=l.value)!=null&&fe.headers?F(l.value.headers):[],body:{},payloadType:m($),schema:$.schema,queryParameters:[],authorization:((me=l.value)==null?void 0:me.authorization)??p(),supportedRoutes:ee,routeDefinition:$,isProcessing:!1,wasExecuted:!1,durationInMs:0,transactionMode:((Me=l.value)==null?void 0:Me.transactionMode)??!1};return g(pe),pe}function y($,ee){const pe=r.value.find(Me=>Me.method.toUpperCase()===$.method.toUpperCase()&&Me.request.endpoint===$.endpoint);if(pe){i.value=pe.id;return}const fe=crypto.randomUUID(),me={id:fe,title:$.shortEndpoint||$.endpoint,method:$.method,request:b($,ee),response:null};r.value.push(me),i.value=fe}function x($){const ee=r.value.findIndex(pe=>pe.id===$);if(ee!==-1&&(r.value.splice(ee,1),i.value===$))if(r.value.length>0){const pe=Math.min(ee,r.value.length-1);i.value=r.value[pe].id}else i.value=null}function S($){r.value.some(ee=>ee.id===$)&&(i.value=$)}function E($,ee){if($<0||$>=r.value.length||ee<0||ee>=r.value.length)return;const pe=r.value.splice($,1)[0];r.value.splice(ee,0,pe)}function C($){a.value&&(a.value.response=$)}function w($){if(!l.value)return;const ee=$.toUpperCase();if(ee===l.value.method)return;l.value.method=ee;const pe=l.value.supportedRoutes.find(fe=>fe.method.toUpperCase()===ee);if(!pe){l.value.payloadType=Or.EMPTY,l.value.schema={shape:{},extractionErrors:null};return}l.value.payloadType=$x(pe),l.value.schema=pe.schema}function A($){l.value&&(l.value.endpoint=$)}function _($){l.value&&(l.value.headers=$)}function D($){l.value&&(l.value.body=$)}function I($){l.value&&(l.value.queryParameters=$)}function N($){l.value&&(l.value.authorization=$)}function P($){l.value&&(l.value.transactionMode=$)}const R=()=>{i.value&&x(i.value)},F=$=>$.map(ee=>({...ee})),V=($,ee,pe,fe)=>{const me={...$},Me=me[ee]??{};return me[ee]={...Me,[pe]:fe},me},B=$=>{var pe;const ee=$.response!==void 0&&$.response.durationInMs!==void 0;return{method:$.method.toUpperCase(),endpoint:$.endpoint,headers:$.headers.map(fe=>({key:fe.key,value:String(fe.value??""),type:_r.Text,enabled:!0})),body:$.body,payloadType:$.payloadType,schema:{shape:{},extractionErrors:null},queryParameters:$.queryParameters.map(fe=>({key:fe.key,value:fe.value,type:fe.type==="file"?_r.File:_r.Text,enabled:!0})),authorization:{type:$.authorization.type,value:$.authorization.value},supportedRoutes:[],routeDefinition:{endpoint:$.endpoint,method:$.method.toUpperCase(),schema:{shape:{},extractionErrors:null},shortEndpoint:$.endpoint},isProcessing:!1,wasExecuted:ee,durationInMs:((pe=$.response)==null?void 0:pe.durationInMs)??0,transactionMode:!1}};return{tabs:r,activeTabId:i,activeApplication:s,lastSyncedGlobalHeaders:o,pendingRequestData:c,activeTab:a,activeRequest:l,activeResponse:u,hasActiveRequest:f,openTab:y,closeTab:x,setActiveTab:S,moveTab:E,updateActiveTabResponse:C,updateRequestMethod:w,updateRequestEndpoint:A,updateRequestHeaders:_,updateRequestBody:D,updateQueryParameters:I,updateAuthorization:N,updateTransactionMode:P,resetRequest:R,restoreFromHistory:$=>{if(!l.value)return;const ee=$.request.method.toUpperCase(),pe=$.request.payloadType,fe=l.value.supportedRoutes.find(me=>me.method.toUpperCase()===ee&&me.endpoint===$.request.endpoint);a.value.request={...l.value,method:ee,endpoint:$.request.endpoint,headers:F($.request.headers),queryParameters:F($.request.queryParameters),payloadType:pe,body:V(l.value.body,ee,pe,$.request.body),authorization:{...$.request.authorization},...fe?{routeDefinition:fe,schema:fe.schema}:{},wasExecuted:!0,transactionMode:l.value.transactionMode??!1},a.value.response=$},restoreFromSharedPayload:$=>{var me;const ee=B($),pe=crypto.randomUUID(),fe={id:pe,title:$.endpoint,method:$.method,request:ee,response:ee.wasExecuted&&$.response?{durationInMs:$.response.durationInMs,isProcessing:!1,request:{...ee,headers:F(ee.headers),queryParameters:F(ee.queryParameters),body:ee.body?((me=ee.body[ee.method])==null?void 0:me[ee.payloadType])??null:null},response:$.response,importedFromShare:!0}:null};r.value.push(fe),i.value=pe},syncGlobalHeadersWhenApplicable:()=>{s.value!==e.activeApplication&&(h(),s.value=e.activeApplication)},getRequestUrl:$=>$A(e.apiUrl,$.endpoint,$.queryParameters.filter(ee=>ee.enabled&&ee.key.trim()!==""))}},{persist:{pick:["tabs","activeTabId","activeApplication","lastSyncedGlobalHeaders"],afterHydrate:t=>{t.store.syncGlobalHeadersWhenApplicable()}}}),av=Ca("routes",()=>{const t=Z(null),e=Z(null),n=Z(!1),r=Z(null),i=async()=>{var g;n.value=!0,r.value=null;try{const b=((g=window.Nimbus)==null?void 0:g.routes)??"[]";if(typeof b!="string"){t.value=null;return}const y=JSON.parse(b);t.value=await eM(y)}catch(b){r.value=b instanceof Error?b.message:"Failed to load routes",t.value=null}finally{n.value=!1}},s=async()=>{var g;e.value=tM(((g=window.Nimbus)==null?void 0:g.routeExtractorException)??null),await i()},o=g=>{var b;return((b=g.metadata)==null?void 0:b.isMissingImplementation)??!1},a=g=>{var b;return((b=g.metadata)==null?void 0:b.isUndocumented)??!1},l=()=>{t.value=null,e.value=null,r.value=null},u=q(()=>t.value!==null&&Object.keys(t.value).length>0),c=q(()=>e.value!==null),f=q(()=>c.value),d=q(()=>t.value?Object.keys(t.value):[]),h=q(()=>rM(t.value)),p=q(()=>g=>{var b;return((b=t.value)==null?void 0:b[g])||[]}),m=q(()=>g=>nM(t.value,g));return{routes:t,routeExtractorException:e,isLoading:n,error:r,fetchAvailableRoutes:i,initializeRoutes:s,resetRoutesState:l,isMissingImplementation:o,isUndocumented:a,hasRoutes:u,hasExtractionError:c,hasAnyError:f,routeVersions:d,totalRouteCount:h,getRoutesByVersion:p,searchRoutes:m}}),_M=["type","placeholder","disabled"],CM=500,ws=z({__name:"AppInput",props:{defaultValue:{},modelValue:{},class:{},type:{},placeholder:{},disabled:{type:Boolean},variant:{}},emits:["update:modelValue"],setup(t,{emit:e}){const n=t,i=wa(n,"modelValue",e,{passive:!0,defaultValue:n.defaultValue}),{openCommand:s}=T0(),o=Z(),a=Z(0),l=u=>{if(u.key==="Shift"){const c=Date.now();c-a.valuela((T(),K("input",{ref_key:"inputRef",ref:o,"onUpdate:modelValue":c[0]||(c[0]=f=>_l(i)?i.value=f:null),type:t.type??"text",class:Se(v(ke)(v(AM)({variant:t.variant}),n.class)),placeholder:t.placeholder,disabled:t.disabled,onKeydown:l},null,42,_M)),[[FI,v(i)]])}}),AM=jC("flex h-9 w-full bg-transparent px-3 py-1 text-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-zinc-500 focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50 dark:placeholder:text-zinc-400",{variants:{variant:{default:"rounded-md border border-zinc-200 shadow-sm focus-visible:ring-1 focus-visible:ring-zinc-950 dark:border-zinc-800 dark:focus-visible:ring-zinc-300",toolbar:"rounded-none border-0 shadow-none focus-visible:ring-0"}},defaultVariants:{variant:"default"}}),DM=z({__name:"AppSidebarInput",props:{class:{},variant:{}},setup(t){const e=t,n=Aa(e,"class");return(r,i)=>(T(),L(v(ws),Ce({"data-sidebar":"input"},v(n),{class:v(ke)("h-8 w-full bg-white shadow-none focus-visible:ring-0 dark:bg-zinc-950",e.class)}),{default:O(()=>[Q(r.$slots,"default")]),_:3},16,["class"]))}}),kM=z({__name:"AppTooltipProvider",props:{delayDuration:{},skipDelayDuration:{},disableHoverableContent:{type:Boolean},disableClosingTrigger:{type:Boolean},disabled:{type:Boolean},ignoreNonKeyboardFocus:{type:Boolean}},setup(t){const e=t;return(n,r)=>(T(),L(v(BI),Yn(Pr(e)),{default:O(()=>[Q(n.$slots,"default")]),_:3},16))}}),fp=z({__name:"AppTooltipWrapper",props:{value:{},delay:{default:300},as:{default:"button"},onClick:{type:Function,default:()=>{}}},setup(t){const e=t;return(n,r)=>(T(),L(v(kM),{"delay-duration":t.delay},{default:O(()=>[k(v($I),null,{default:O(()=>[k(v(zI),{as:t.as,onClick:t.onClick},{default:O(()=>[M("span",null,[Q(n.$slots,"default")])]),_:3},8,["as","onClick"]),k(v(jI),null,{default:O(()=>[ne(de(e.value),1)]),_:1})]),_:3})]),_:3},8,["delay-duration"]))}}),OM=z({__name:"AppSidebarMenuSub",props:{class:{}},setup(t){const e=t;return(n,r)=>(T(),K("ul",{"data-sidebar":"menu-badge",class:Se(v(ke)("border-sidebar-border ml-2.5 flex min-w-0 translate-x-px flex-col gap-1 border-l py-0.5 pl-0.5","group-data-[collapsible=icon]:hidden",e.class))},[Q(n.$slots,"default")],2))}}),lv=z({__name:"AppDialogClose",props:{asChild:{type:Boolean},as:{}},setup(t){const e=t;return(n,r)=>(T(),L(v(AP),Ce({"data-slot":"dialog-close"},e),{default:O(()=>[Q(n.$slots,"default")]),_:3},16))}}),uv=z({__name:"AppDialogTrigger",props:{asChild:{type:Boolean},as:{}},setup(t){const e=t;return(n,r)=>(T(),L(v(jP),Ce({"data-slot":"dialog-trigger"},e),{default:O(()=>[Q(n.$slots,"default")]),_:3},16))}}),TM={key:0,class:"z-10 flex h-4 w-3 items-center justify-center rounded-xs border bg-zinc-200 dark:bg-zinc-800"},J1=z({__name:"AppResizableHandle",props:{class:{},withHandle:{type:Boolean},id:{},hitAreaMargins:{},tabindex:{},disabled:{type:Boolean},nonce:{},asChild:{type:Boolean},as:{}},emits:["dragging"],setup(t,{emit:e}){const n=t,r=e,i=Aa(n,"class","withHandle"),s=Yr(i,r);return(o,a)=>(T(),L(v(KR),Ce({"data-slot":"resizable-handle"},v(s),{class:v(ke)("relative flex w-px items-center justify-center bg-zinc-200 after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:ring-1 focus-visible:ring-zinc-950 focus-visible:ring-offset-1 focus-visible:outline-hidden data-[orientation=vertical]:h-px data-[orientation=vertical]:w-full data-[orientation=vertical]:after:left-0 data-[orientation=vertical]:after:h-1 data-[orientation=vertical]:after:w-full data-[orientation=vertical]:after:translate-x-0 data-[orientation=vertical]:after:-translate-y-1/2 dark:bg-zinc-800 dark:focus-visible:ring-zinc-300 [&[data-orientation=vertical]>div]:rotate-90",n.class)}),{default:O(()=>[n.withHandle?(T(),K("div",TM,[k(v(CN),{class:"size-2.5"})])):we("",!0)]),_:1},16,["class"]))}}),Ps=z({__name:"AppResizablePanel",props:{collapsedSize:{},collapsible:{type:Boolean},defaultSize:{},id:{},maxSize:{},minSize:{},order:{},asChild:{type:Boolean},as:{}},emits:["collapse","expand","resize"],setup(t,{expose:e,emit:n}){const s=Yr(t,n),o=Z(null);return e({collapse:()=>{var a;return(a=o.value)==null?void 0:a.collapse()},expand:()=>{var a;return(a=o.value)==null?void 0:a.expand()}}),(a,l)=>(T(),L(v(qR),Ce({ref_key:"splitterPanelRef",ref:o,"data-slot":"resizable-panel"},v(s)),{default:O(()=>[Q(a.$slots,"default")]),_:3},16))}}),Z1=z({__name:"AppResizablePanelGroup",props:{class:{},id:{},autoSaveId:{},direction:{},keyboardResizeBy:{},storage:{},asChild:{type:Boolean},as:{}},emits:["layout"],setup(t,{emit:e}){const n=t,r=e,i=Aa(n,"class"),s=Yr(i,r);return(o,a)=>(T(),L(v(UR),Ce({"data-slot":"resizable-panel-group"},v(s),{class:v(ke)("flex h-full w-full data-[orientation=vertical]:flex-col",n.class)}),{default:O(()=>[Q(o.$slots,"default")]),_:3},16,["class"]))}}),VA=z({__name:"AppTabs",props:{defaultValue:{},orientation:{},dir:{},activationMode:{},modelValue:{},unmountOnHide:{type:Boolean},asChild:{type:Boolean},as:{}},emits:["update:modelValue"],setup(t,{emit:e}){const i=Yr(t,e);return(s,o)=>(T(),L(v(rN),Ce(v(i),{"unmount-on-hide":!1}),{default:O(()=>[Q(s.$slots,"default")]),_:3},16))}}),Vo=z({__name:"AppTabsContent",props:{class:{},value:{},forceMount:{type:Boolean},asChild:{type:Boolean},as:{}},setup(t){const e=t,n=q(()=>{const{class:r,...i}=e;return i});return(r,i)=>(T(),L(v(sN),Ce({class:v(ke)("mt-2 ring-offset-white focus-visible:outline-none",e.class)},n.value),{default:O(()=>[Q(r.$slots,"default")]),_:3},16,["class"]))}}),UA=z({__name:"AppTabsList",props:{class:{},loop:{type:Boolean},asChild:{type:Boolean},as:{}},setup(t){const e=t,n=q(()=>{const{class:r,...i}=e;return i});return(r,i)=>(T(),L(v(aN),Ce(n.value,{class:v(ke)("text-subtle-foreground inline-flex items-center justify-center rounded-sm p-1",e.class)}),{default:O(()=>[Q(r.$slots,"default")]),_:3},16,["class"]))}}),IM={class:"truncate"},Uo=z({__name:"AppTabsTrigger",props:{label:{},class:{},value:{},disabled:{type:Boolean},asChild:{type:Boolean},as:{}},setup(t){const e=t,n=q(()=>{const{class:i,...s}=e;return s}),r=I0(n);return(i,s)=>(T(),L(v(uN),Ce(v(r),{class:v(ke)("inline-flex items-center justify-center rounded-sm px-2.5 py-1 text-sm font-medium whitespace-nowrap ring-offset-white transition-all focus-visible:ring-2 focus-visible:ring-zinc-950 focus-visible:ring-offset-2 focus-visible:outline-none disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-white data-[state=active]:text-zinc-950 data-[state=active]:shadow-sm dark:ring-offset-zinc-950 dark:focus-visible:ring-zinc-300 dark:data-[state=active]:bg-zinc-950 dark:data-[state=active]:text-zinc-50",e.class)}),{default:O(()=>[M("span",IM,[t.label?(T(),K(Qe,{key:0},[ne(de(t.label),1)],64)):Q(i.$slots,"default",{key:1})])]),_:3},16,["class"]))}}),Pc=z({__name:"AppSelectGroup",props:{class:{},asChild:{type:Boolean},as:{}},setup(t){const e=t,n=Aa(e,"class");return(r,i)=>(T(),L(v(mR),Ce({class:v(ke)("w-full",e.class)},v(n)),{default:O(()=>[Q(r.$slots,"default")]),_:3},16,["class"]))}}),Rc=z({__name:"AppSelectLabel",props:{class:{},for:{},asChild:{type:Boolean},as:{}},setup(t){const e=t;return(n,r)=>(T(),L(v(bR),{class:Se(v(ke)("p-1 text-xs font-semibold",e.class))},{default:O(()=>[Q(n.$slots,"default")]),_:3},8,["class"]))}}),PM=z({__name:"AppSelectSeparator",props:{class:{},asChild:{type:Boolean},as:{}},setup(t){const e=t,n=Aa(e,"class");return(r,i)=>(T(),L(v(vR),Ce(v(n),{class:v(ke)("-mx-1 my-1 h-px bg-zinc-100 dark:bg-zinc-800",e.class)}),null,16,["class"]))}}),HA=z({__name:"AppSwitch",props:{class:{},variant:{},defaultValue:{type:Boolean},modelValue:{type:[Boolean,null]},disabled:{type:Boolean},id:{},value:{},asChild:{type:Boolean},as:{},name:{},required:{type:Boolean}},emits:["update:modelValue"],setup(t,{emit:e}){const n=t,r=e,i=q(()=>{const{class:o,...a}=n;return a}),s=Yr(i,r);return(o,a)=>{var l;return T(),L(v(ZR),Ce(v(s),{class:v(ke)(((l=n.variant)==null?void 0:l.type)==="default"?"h-5 w-9":"h-4 w-8","peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-sm transition-colors focus-visible:ring-2 focus-visible:ring-zinc-950 focus-visible:ring-offset-2 focus-visible:ring-offset-white focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-zinc-900 data-[state=unchecked]:bg-zinc-200 dark:focus-visible:ring-zinc-300 dark:focus-visible:ring-offset-zinc-950 dark:data-[state=checked]:bg-zinc-50 dark:data-[state=unchecked]:bg-zinc-800",n.class)}),{default:O(()=>{var u;return[k(v(eN),{class:Se(v(ke)(((u=n.variant)==null?void 0:u.type)==="default"?"h-4 w-4":"h-3 w-3","pointer-events-none block rounded-full bg-white shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0 dark:bg-zinc-950"))},{default:O(()=>[Q(o.$slots,"thumb")]),_:3},8,["class"])]}),_:3},16,["class"])}}});function RM(t,e){const{count:n,inc:r}=VI(),i=Z([]),s=VC(new Map),o=Z({deleting:!1}),a=_=>({type:_r.Text,id:_,key:"",value:"",enabled:!0}),l=_=>{const D=s.get(_);return D!=null&&D.deleting?(c(_),!0):(f(_),!1)},u=_=>{var D;return((D=s.get(_))==null?void 0:D.deleting)??!1},c=_=>{const D=s.get(_);D!=null&&D.timeoutId&&clearTimeout(D.timeoutId),s.delete(_)},f=_=>{const D=window.setTimeout(()=>{s.delete(_)},ag.DELETION_CONFIRMATION_TIMEOUT);s.set(_,{deleting:!0,timeoutId:D})},d=()=>o.value.deleting?(p(),!0):(m(),!1),h=()=>o.value.deleting,p=()=>{o.value.timeoutId&&clearTimeout(o.value.timeoutId),o.value={deleting:!1}},m=()=>{const _=window.setTimeout(()=>{o.value={deleting:!1}},ag.DELETION_CONFIRMATION_TIMEOUT);o.value={deleting:!0,timeoutId:_}},g=()=>{s.forEach((_,D)=>c(D)),p()},b=()=>{const _=t.value??[],D=new Map(i.value.map(N=>[N.id,N])),I=_.map(N=>{const P=D.get(N.id);return P?{...P,id:N.id,key:N.key,value:N.value,type:N.type,enabled:N.enabled}:(r(),{id:n.value,...N})});I.length===0&&(r(),I.push(a(n.value))),JSON.stringify(i.value)!==JSON.stringify(_)&&(i.value=I)},y=()=>{const _=i.value.map(D=>({id:D.id,type:D.type,key:D.key,value:D.value,enabled:D.enabled}));e(_)},x=q(()=>i.value.every(_=>!_.enabled)),S=q(()=>h()),E=()=>{r();const _=a(n.value);i.value.push(_)},C=()=>{const _=x.value;i.value.forEach(D=>D.enabled=_)},w=_=>{!i.value[_]||!l(_)||i.value.splice(_,1)},A=()=>{d()&&(i.value=[])};return UI(i,()=>{y()},{deep:!0,debounce:ag.SYNC_DEBOUNCE_DELAY}),at(t,()=>{b()},{deep:!0}),Ky(()=>{b(),i.value.length===0&&E()}),{parameters:i,deletingAll:S,areAllParametersDisabled:x,addNewEmptyParameter:E,toggleAllParametersEnabledState:C,triggerParameterDeletion:w,deleteAllParameters:A,updateParametersFromParentModel:b,isParameterMarkedForDeletion:u,clearAllDeletionStates:g}}const NM={class:"flex h-8 items-center overflow-hidden border-b p-0"},MM={class:"flex-1 overflow-y-auto"},FM={class:"flex flex-1"},LM={class:"flex items-center justify-center border-r px-2"},BM={key:1,class:"flex items-center justify-center px-2","data-testid":"delete-button"},cv=z({__name:"KeyValueParameters",props:{modelValue:{default:()=>[]},freeFormTypes:{type:Boolean,default:!1},class:{default:void 0}},emits:["update:parameters"],setup(t,{emit:e}){const n=t,r=e,{openCommand:i,closeCommand:s}=T0(),o=Z(null),a=Z(null),l=q(()=>n.modelValue),u=w=>{r("update:parameters",w)},{parameters:c,deletingAll:f,isParameterMarkedForDeletion:d,areAllParametersDisabled:h,addNewEmptyParameter:p,toggleAllParametersEnabledState:m,triggerParameterDeletion:g,deleteAllParameters:b}=RM(l,u),y=(w,A)=>o.value===w&&A.enabled,x=(w,A)=>{o.value=w,a.value=A},S=w=>{const A=w.relatedTarget;A!=null&&A.closest("[data-ValueGenerator-focus-hook]")||(o.value=null,a.value=null,setTimeout(s,100))},E=()=>{a.value&&i(a.value)},C=w=>{g(w)};return(w,A)=>(T(),K("div",{class:Se(v(ke)("flex h-full flex-col overflow-hidden",n.class)),"data-testid":"kv-container"},[M("div",NM,[k(v(gt),{variant:"ghost",size:"xs",class:"px-panel h-full -translate-x-0.5 rounded-none text-xs","data-testid":"add-button",onClick:v(p)},{default:O(()=>[k(v(RN)),A[0]||(A[0]=ne(" Add ",-1))]),_:1},8,["onClick"]),k(v(gt),{variant:"ghost",size:"xs",class:"px-panel h-full -translate-x-0.5 rounded-none text-xs",disabled:v(c).length===0,"data-testid":"enable-all-button",onClick:v(m)},{default:O(()=>[v(h)?(T(),L(v(wN),{key:0})):(T(),L(v(EN),{key:1})),ne(" "+de(v(h)?"Enable All":"Disable All"),1)]),_:1},8,["disabled","onClick"]),k(v(gt),{variant:"ghost",size:"xs",class:Se(["px-panel h-full -translate-x-0.5 rounded-none text-xs",{"!text-destructive hover:text-destructive/90":v(f)}]),disabled:v(c).length===0,"data-testid":"delete-all-button",onClick:v(b)},{default:O(()=>[k(v(up)),A[1]||(A[1]=ne(" Delete All ",-1))]),_:1},8,["class","disabled","onClick"])]),M("div",MM,[(T(!0),K(Qe,null,_n(v(c),(_,D)=>(T(),K("div",{key:_.id,class:"flex h-8 border-b","data-testid":"parameter-row"},[M("div",FM,[t.freeFormTypes?(T(),L(v(tu),{key:0,modelValue:_.type,"onUpdate:modelValue":I=>_.type=I,"default-value":"text"},{default:O(()=>[k(v(Zl),{class:"pl-panel h-full w-[80px] rounded-none border-0 border-r p-0 text-xs shadow-none focus:ring-0","data-testid":"type-selector"},{default:O(()=>[k(v(Ql),{placeholder:"Select a Type"})]),_:1}),k(v(eu),null,{default:O(()=>[k(v(Es),{value:"text"},{default:O(()=>[...A[2]||(A[2]=[ne("Text",-1)])]),_:1}),k(v(Es),{value:"file",disabled:""},{default:O(()=>[A[4]||(A[4]=ne(" File ",-1)),k(v(fo),{variant:"outline",class:"ml-0.5 px-1 py-0"},{default:O(()=>[...A[3]||(A[3]=[ne(" soon ",-1)])]),_:1})]),_:1})]),_:1})]),_:1},8,["modelValue","onUpdate:modelValue"])):we("",!0),k(v(ws),{modelValue:_.key,"onUpdate:modelValue":I=>_.key=I,placeholder:"Key",class:"selector-key h-full flex-1 rounded-none border-0 border-r shadow-none focus:ring-0 focus-visible:ring-0",disabled:!_.enabled,name:"kv-key","data-testid":"kv-key",autocomplete:"off"},null,8,["modelValue","onUpdate:modelValue","disabled"]),k(v(ws),{modelValue:_.value,"onUpdate:modelValue":I=>_.value=I,placeholder:"Value",class:"pl-panel h-full flex-1 rounded-none border-0 border-r shadow-none focus:ring-0 focus-visible:ring-0",disabled:!_.enabled,name:"kv-value","data-testid":"kv-value",autocomplete:"off",onFocus:I=>x(D,I.target),onBlur:S},null,8,["modelValue","onUpdate:modelValue","disabled","onFocus"])]),M("div",LM,[k(v(fp),{value:"Enable/Disable"},{default:O(()=>[k(v(HA),{modelValue:_.enabled,"onUpdate:modelValue":I=>_.enabled=I,class:"h-4 w-8"},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1024)]),y(D,_)?(T(),K("div",{key:0,class:"flex cursor-pointer items-center justify-center p-2",title:"Generate Value","data-testid":"generator-button",onMousedown:eo(E,["prevent"])},[k(v(Xy),{class:"text-subtle-foreground hover:text-foreground size-4 transition-colors"})],32)):(T(),K("div",BM,[k(v(fp),{value:"Delete","on-click":()=>C(D)},{default:O(()=>[k(v(up),{class:Se(["size-4",{"text-destructive":v(d)(D)}])},null,8,["class"])]),_:2},1032,["on-click"])]))]))),128))])],2))}}),$M={class:"text-subtle-foreground text-xs"},Oa=z({__name:"PanelSubHeader",props:{class:{}},setup(t){const e=t;return(n,r)=>(T(),K("div",{class:Se(v(ke)("px-panel h-sub-toolbar flex items-center justify-between",e.class))},[M("span",$M,[Q(n.$slots,"default")]),Q(n.$slots,"toolbox")],2))}}),zM=z({__name:"RequestHeaders",setup(t){const e=Rr(),n=Xi(),r=T0(),i=Z([]),s=q(()=>e.pendingRequestData),o=c=>{e.updateRequestHeaders(c)},a=q(()=>{var c;return((c=s.value)==null?void 0:c.headers)??[]}),l=q(()=>{const c=a.value;return c.length===0?i.value:c}),u=c=>{o(c)};return Ky(()=>{i.value=n.headers.map(c=>({type:_r.Text,key:c.header,value:c.type==="generator"?jA(c.value,r):String(c.value),enabled:!0}))}),(c,f)=>(T(),K(Qe,null,[k(Oa,{class:"border-b"},{default:O(()=>[...f[0]||(f[0]=[ne("Request Headers",-1)])]),_:1}),k(cv,{ref:"parametersBuilder","model-value":l.value,"onUpdate:parameters":u},null,8,["model-value"])],64))}}),jM={class:"grid h-8 grid-cols-3 border-b"},VM={class:"grid h-8 grid-cols-3 border-b"},UM=z({__name:"RequestAuthorizationBasicAuth",props:{modelValue:{default:()=>({username:"",password:""})},modelModifiers:{}},emits:Da(["update:modelValue"],["update:modelValue"]),setup(t,{emit:e}){const n=e,r=Ki(t,"modelValue"),i=Z(r.value.username),s=Z(r.value.password);return at(i,o=>{r.value.username=o,n("update:modelValue",r.value)}),at(s,o=>{r.value.password=o,n("update:modelValue",r.value)}),(o,a)=>(T(),K(Qe,null,[M("div",jM,[a[2]||(a[2]=M("label",{class:"px-panel flex h-8 items-center border-r py-1 text-xs",for:"username"}," Username ",-1)),k(v(ws),{id:"username",modelValue:i.value,"onUpdate:modelValue":a[0]||(a[0]=l=>i.value=l),placeholder:"-",class:"col-span-2 h-full rounded-none border-0 text-xs shadow-none focus:ring-0 focus-visible:ring-0"},null,8,["modelValue"])]),M("div",VM,[a[3]||(a[3]=M("label",{class:"px-panel flex h-8 items-center border-r py-1 text-xs",for:"password"}," Password ",-1)),k(v(ws),{id:"password",modelValue:s.value,"onUpdate:modelValue":a[1]||(a[1]=l=>s.value=l),placeholder:"-",class:"col-span-2 h-full rounded-none border-0 text-xs shadow-none focus:ring-0 focus-visible:ring-0"},null,8,["modelValue"])])],64))}}),HM={class:"grid h-8 grid-cols-3 border-b"},qM=z({__name:"RequestAuthorizationBearer",props:{modelValue:{default:()=>""},modelModifiers:{}},emits:["update:modelValue"],setup(t){const e=Ki(t,"modelValue");return(n,r)=>(T(),K("div",HM,[r[1]||(r[1]=M("label",{class:"px-panel flex h-8 items-center border-r py-1 text-xs",for:"bearer"}," Bearer Token ",-1)),k(v(ws),{id:"bearer",modelValue:e.value,"onUpdate:modelValue":r[0]||(r[0]=i=>e.value=i),placeholder:"Token",class:"col-span-2 h-full rounded-none border-0 text-xs shadow-none focus:ring-0 focus-visible:ring-0"},null,8,["modelValue"])]))}}),dp=z({__name:"AppPanelDescription",props:{class:{}},setup(t){const e=t;return(n,r)=>(T(),K("p",{class:Se(v(ke)("text-subtle-foreground text-sm",e.class))},[Q(n.$slots,"default")],2))}}),fv=z({__name:"AppPanelHeader",props:{class:{}},setup(t){const e=t;return(n,r)=>(T(),K("div",{class:Se(v(ke)("px-panel flex items-center gap-2 py-2.5",e.class))},[Q(n.$slots,"default")],2))}}),hp=z({__name:"AppPanelTitle",props:{class:{}},setup(t){const e=t;return(n,r)=>(T(),K("h3",{class:Se(v(ke)("text-sm leading-none font-semibold tracking-tight",e.class))},[Q(n.$slots,"default")],2))}}),GM={class:"flex flex-col"},WM={class:"whitespace-nowrap"},KM=z({__name:"RequestAuthorizationCurrentUser",setup(t){const e=Xi();return(n,r)=>(T(),L(v(Zy),{class:"border-b shadow-none"},{default:O(()=>[k(v(fv),{class:"items-start"},{default:O(()=>[v(e).isLoggedIn?(T(),L(v(FN),{key:0,class:"size-5 min-w-5"})):(T(),L(v(mN),{key:1,class:"text-destructive size-5 min-w-5"})),M("div",GM,[v(e).isLoggedIn?(T(),L(v(hp),{key:0},{default:O(()=>[...r[0]||(r[0]=[ne(" You're logged in! ",-1)])]),_:1})):(T(),L(v(hp),{key:1},{default:O(()=>[...r[1]||(r[1]=[ne("Please log in first",-1)])]),_:1})),v(e).isLoggedIn?(T(),L(v(dp),{key:2},{default:O(()=>[r[2]||(r[2]=ne(" You're performing the request acting as the currently logged-in user ",-1)),M("span",WM,"(ID: "+de(v(e).userId)+")",1),r[3]||(r[3]=ne(" . ",-1))]),_:1})):(T(),L(v(dp),{key:3},{default:O(()=>[...r[4]||(r[4]=[ne(" You need to be logged in to make requests as the currently logged-in user. ",-1)])]),_:1}))])]),_:1})]),_:1}))}}),XM={class:"grid h-8 grid-cols-3 border-b"},YM=z({__name:"RequestAuthorizationImpersonateUser",props:{modelValue:{default:()=>0},modelModifiers:{}},emits:["update:modelValue"],setup(t){const e=Ki(t,"modelValue");return(n,r)=>(T(),K("div",XM,[r[1]||(r[1]=M("label",{class:"px-panel flex h-8 items-center border-r py-1 text-xs",for:"user-id"}," User ID ",-1)),k(v(ws),{id:"user-id",modelValue:e.value,"onUpdate:modelValue":r[0]||(r[0]=i=>e.value=i),placeholder:"Pick a user ID to impersonate it.",class:"col-span-2 h-full rounded-none border-0 text-xs shadow-none focus:ring-0 focus-visible:ring-0",type:"numeric"},null,8,["modelValue"])]))}}),JM={class:"flex flex-col"},ZM=z({__name:"RequestAuthorizationNone",setup(t){return(e,n)=>(T(),L(v(Zy),{class:"border-b shadow-none"},{default:O(()=>[k(v(fv),{class:"items-start"},{default:O(()=>[k(v(IN),{class:"size-5 min-w-5"}),M("div",JM,[k(v(hp),null,{default:O(()=>[...n[0]||(n[0]=[ne("No Authorization",-1)])]),_:1}),k(v(dp),null,{default:O(()=>[...n[1]||(n[1]=[ne(" You're performing the request as a guest. ",-1)])]),_:1})])]),_:1})]),_:1}))}}),QM={class:"flex items-center"},eF={class:"flex items-center"},tF=z({__name:"RequestAuthorizationSelector",props:Da({types:{}},{modelValue:{default:()=>Je.CurrentUser},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const e=t,n=Ki(t,"modelValue"),r=Rr(),i=Wy(),s=q(()=>r.pendingRequestData);return zC(s,o=>{n.value=(o==null?void 0:o.authorization.type)??i.preferences.defaultAuthorizationType},{deep:!0}),(o,a)=>(T(),K("div",QM,[a[3]||(a[3]=M("span",{class:"text-subtle-foreground w-[120px] text-xs"},"Authorization Type:",-1)),k(v(tu),{modelValue:n.value,"onUpdate:modelValue":a[0]||(a[0]=l=>n.value=l)},{default:O(()=>[k(v(Zl),{class:"min-w-[120px] rounded-none border-0 text-xs shadow-none focus:ring-0"},{default:O(()=>[k(v(Ql))]),_:1}),k(v(eu),null,{default:O(()=>[k(v(Pc),null,{default:O(()=>[k(v(Rc),null,{default:O(()=>[M("div",eF,[k(v(Xy),{size:14,class:"mr-2"}),a[1]||(a[1]=ne(" Special ",-1))])]),_:1}),(T(!0),K(Qe,null,_n(e.types.special,l=>(T(),L(v(Es),{key:l.id,value:l.id},{default:O(()=>[ne(de(l.label),1)]),_:2},1032,["value"]))),128))]),_:1}),k(v(Pc),null,{default:O(()=>[k(v(Rc),null,{default:O(()=>[...a[2]||(a[2]=[ne("Other",-1)])]),_:1}),(T(!0),K(Qe,null,_n(e.types.traditional,l=>(T(),L(v(Es),{key:l.id,value:l.id},{default:O(()=>[ne(de(l.label),1)]),_:2},1032,["value"]))),128))]),_:1})]),_:1})]),_:1},8,["modelValue"])]))}});function nF(){const t=Rr(),e={[Je.None]:{type:Je.None},[Je.Bearer]:{type:Je.Bearer,value:""},[Je.Basic]:{type:Je.Basic,value:{username:"",password:""}},[Je.CurrentUser]:{type:Je.CurrentUser},[Je.Impersonate]:{type:Je.Impersonate,value:0}},n=new Map;Object.entries(e).forEach(([l,u])=>{n.set(l,u)});const r=q(()=>{var l;return((l=t.pendingRequestData)==null?void 0:l.authorization)??{type:Je.CurrentUser}}),i=q({get:()=>r.value.type,set:l=>{l!==r.value.type&&s(l)}}),s=l=>{n.set(r.value.type,{...r.value});const u=n.get(l),c=u?{...u}:e[l];(c.type!==r.value.type||JSON.stringify(c.value)!==JSON.stringify(r.value.value))&&t.updateAuthorization(c)},o=l=>{var c;const u=((c=t.pendingRequestData)==null?void 0:c.authorization)??{type:Je.CurrentUser};JSON.stringify(l)!==JSON.stringify(u.value)&&t.updateAuthorization({...u,value:l})},a=()=>{n.set(r.value.type,{...r.value})};return at(r,a,{deep:!0}),{authorization:kc(r),selectedType:i,types:{special:Dx.TYPES.SPECIAL,traditional:Dx.TYPES.TRADITIONAL},updateAuthorizationType:s,updateCurrentAuthorizationValue:o,saveAuthorizationToStore:a}}const rF={class:"flex h-full flex-col"},iF={class:"relative w-full flex-1 overflow-hidden"},sF=z({__name:"RequestAuthorization",setup(t){const{authorization:e,selectedType:n,types:r,updateCurrentAuthorizationValue:i}=nF();return(s,o)=>(T(),K("div",rF,[k(Oa,{class:"border-b"},{default:O(()=>[k(tF,{modelValue:v(n),"onUpdate:modelValue":o[0]||(o[0]=a=>_l(n)?n.value=a:null),types:v(r)},null,8,["modelValue","types"])]),_:1}),M("div",iF,[!v(e)||v(e).type===v(Je).None?(T(),L(ZM,{key:0})):v(e).type===v(Je).CurrentUser?(T(),L(KM,{key:1})):v(e).type===v(Je).Impersonate?(T(),L(YM,{key:2,"model-value":v(e).value,"onUpdate:modelValue":o[1]||(o[1]=a=>v(i)(a))},null,8,["model-value"])):v(e).type===v(Je).Bearer?(T(),L(qM,{key:3,"model-value":v(e).value,"onUpdate:modelValue":o[2]||(o[2]=a=>v(i)(a))},null,8,["model-value"])):v(e).type===v(Je).Basic?(T(),L(UM,{key:4,"model-value":{username:v(e).value.username,password:v(e).value.password},"onUpdate:modelValue":o[3]||(o[3]=a=>v(i)(a))},null,8,["model-value"])):we("",!0)])]))}});function oF(){const t=Rr(),e=HN,n=qN,r=Z(Or.EMPTY),i=Z(null),s=q(()=>t.pendingRequestData),o=q(()=>{var c,f,d;return((c=ig.find(h=>h.id===r.value))==null?void 0:c.autoFillable)===!0&&((d=(f=s.value)==null?void 0:f.schema)==null?void 0:d.shape)!==void 0}),a=()=>{var m,g,b;if(!s.value||r.value===Or.EMPTY)return null;const c=s.value.method,f=s.value.body,d=((m=f==null?void 0:f[c])==null?void 0:m[r.value])??null;if(d)return d;const h=(b=(g=s.value)==null?void 0:g.schema)==null?void 0:b.shape;if(!h)return null;const p=n(h);return Lx(p,r.value)},l=()=>{var d;const c=(d=s.value)==null?void 0:d.headers.find(h=>h.key==="Content-Type");if(!c)return;const f=ig.find(h=>h.mimeType===c.value);f&&(r.value=f.id)},u=()=>{var h;if(!s.value)return;const c=(h=s.value.schema)==null?void 0:h.shape;if(!c)return;const f=e(c),d=Lx(f,r.value);i.value=d};return at(s,c=>{r.value=(c==null?void 0:c.payloadType)??Or.EMPTY,i.value=a()},{deep:!0,immediate:!0}),at(r,c=>{if(s.value===null){i.value=a();return}i.value=a(),s.value.payloadType=c}),at(i,()=>{if(!s.value)return;const c=s.value.method;s.value.body||(s.value.body={});const f=s.value.body;f[c]||(f[c]={}),f[c][r.value]=i.value},{deep:!0}),gn(()=>{l(),i.value=a()}),{payloadType:r,payload:i,pendingRequestData:s,supportsAutoFill:o,autofill:u,generateCurrentPayload:a,initializePayloadTypeFromHeaders:l,types:ig}}const aF={class:"px-panel from-warning/5 dark:from-warning/15 flex items-center justify-between border-b bg-gradient-to-tr to-transparent to-50% py-0.5"},lF={class:"flex items-center gap-2 text-xs"},uF={class:"px-1 py-2"},cF={class:"leading-3.5"},fF={class:"text-subtle-foreground mb-0"},dF={class:"to-background from-warning/10 dark:from-warning/15 flex h-full w-full flex-col gap-4 bg-gradient-to-bl to-40% p-3.5"},hF={class:"flex flex-col gap-3.5 text-sm wrap-anywhere"},pF={class:"border-b pb-3.5"},mF={class:"px-panel inline-flex items-center space-x-2 rounded border bg-white font-mono text-xs"},gF=z({__name:"ImplementationMissingWarning",setup(t){const e=Xi(),{copy:n,copied:r}=_o();return(i,s)=>(T(),K("div",aF,[M("div",lF,[M("div",uF,[k(v(U0),{class:"text-warning size-4"})]),M("div",cF,[s[0]||(s[0]=M("span",{class:"mb-0 flex items-center gap-1 font-bold"}," Route not found ",-1)),M("p",fF," This route is defined in the "+de(v(e).primaryProcessorName)+", but it is not found in your application ",1)])]),k(v(Cf),null,{default:O(()=>[k(v(uv),null,{default:O(()=>[k(v(gt),{size:"xs",variant:"ghost"},{default:O(()=>[k(v(ov)),s[1]||(s[1]=ne(" Info ",-1))]),_:1})]),_:1}),k(v(Af),{class:"bg-background max-h-[90dvh] flex-col p-0 sm:max-w-[600px]"},{default:O(()=>[M("div",dF,[k(v(Df),null,{default:O(()=>[k(v(kf),null,{default:O(()=>[...s[2]||(s[2]=[ne("Route Not Found",-1)])]),_:1}),k(v(R0),null,{default:O(()=>[ne(" This route is defined in "+de(v(e).primaryProcessorName)+" but it cannot be found in the currently selected application's laravel routes. ",1)]),_:1})]),_:1}),M("div",hF,[s[6]||(s[6]=M("span",null,"Possible Solutions:",-1)),M("div",pF,[s[4]||(s[4]=M("h3",{class:"text-base font-bold"},"Clear routes cache",-1)),s[5]||(s[5]=M("p",{class:"mb-2"}," It might be that you switched to a new branch but your routes are cached. ",-1)),M("div",mF,[s[3]||(s[3]=M("code",{class:"flex-1"},"php artisan route:clear",-1)),k(nu,{"on-click":()=>v(n)("php artisan route:clear"),copied:v(r)},null,8,["on-click","copied"])])]),s[7]||(s[7]=M("div",null,[M("h3",{class:"text-base font-bold"},"Sync your branch"),M("p",{class:"text-sm"}," Your schema files might be out of sync with the current branch state, make sure to rebase with the main branch. ")],-1))]),k(v(Qy),{class:"border-t pt-3.5 sm:justify-start"},{default:O(()=>[k(v(lv),{"as-child":""},{default:O(()=>[k(v(gt),{variant:"default",size:"xs"},{default:O(()=>[...s[8]||(s[8]=[ne("Dismiss",-1)])]),_:1})]),_:1})]),_:1})])]),_:1})]),_:1})]))}}),qA=z({__name:"DocumentationLinkButton",props:{class:{}},setup(t){return(e,n)=>(T(),L(v(gt),{size:"xs",as:"a",href:"https://github.com/sunchayn/nimbus/tree/base/wiki/user-guide",target:"_blank"},{default:O(()=>[k(v(SN)),n[0]||(n[0]=ne(" Documentation ",-1))]),_:1}))}}),bF={class:"px-panel flex items-center justify-between border-b bg-gradient-to-tr from-blue-500/5 to-transparent to-50% py-0.5 dark:from-blue-700/30"},yF={class:"flex items-center gap-2 text-xs"},vF={class:"px-1 py-2"},xF={class:"leading-3.5"},SF={class:"text-subtle-foreground mb-0"},EF={class:"to-background from-warning/10 dark:from-warning/15 flex h-full w-full flex-col gap-4 bg-gradient-to-bl to-40% p-3.5"},wF={class:"flex flex-col gap-3.5 text-sm wrap-anywhere"},_F=z({__name:"MissingRouteInPrimarySourceInfo",setup(t){const e=Xi();return(n,r)=>(T(),K("div",bF,[M("div",yF,[M("div",vF,[k(v(TA),{class:"size-4 text-blue-900 dark:text-blue-100"})]),M("div",xF,[r[0]||(r[0]=M("span",{class:"mb-0 flex items-center gap-1 font-bold"}," Route is auto-detected ",-1)),M("p",SF," This route is not defined in "+de(v(e).primaryProcessorName)+", but it was auto-detected and added. ",1)])]),k(v(Cf),null,{default:O(()=>[k(v(uv),null,{default:O(()=>[k(v(gt),{size:"xs",variant:"ghost"},{default:O(()=>[k(v(ov)),r[1]||(r[1]=ne(" Info ",-1))]),_:1})]),_:1}),k(v(Af),{class:"bg-background max-h-[90dvh] flex-col p-0 sm:max-w-[600px]"},{default:O(()=>[M("div",EF,[k(v(Df),null,{default:O(()=>[k(v(kf),null,{default:O(()=>[...r[2]||(r[2]=[ne("Route is auto-detected",-1)])]),_:1})]),_:1}),M("p",wF,[ne(" This application is configured to use "+de(v(e).primaryProcessorName)+". However, this route is not defined there. It was auto-detected from your local routes and added accordingly. ",1),r[3]||(r[3]=M("br",null,null,-1)),M("small",null," This will help you test out routes without having to define them yet in the "+de(v(e).primaryProcessorName)+". ",1)]),M("div",null,[k(qA,{variant:"outline"})]),k(v(Qy),{class:"border-t pt-3.5 sm:justify-start"},{default:O(()=>[k(v(lv),{"as-child":""},{default:O(()=>[k(v(gt),{variant:"default",size:"xs"},{default:O(()=>[...r[4]||(r[4]=[ne("Dismiss",-1)])]),_:1})]),_:1})]),_:1})])]),_:1})]),_:1})]))}}),CF={class:"dark:bg-subtle bg-destructive/10 max-w-full flex-1 overflow-auto p-2 leading-tight wrap-anywhere"},AF=["innerHTML"],DF=z({__name:"SchemaExtractionErrorButton",props:{errorHtml:{}},setup(t){return(e,n)=>(T(),L(v(Cf),null,{default:O(()=>[k(v(uv),null,{default:O(()=>[k(v(gt),{size:"xs",variant:"ghost"},{default:O(()=>[k(v(ov)),n[0]||(n[0]=ne(" Error Info ",-1))]),_:1})]),_:1}),k(v(Af),{class:"to-background from-destructive/10 dark:from-destructive/15 flex max-h-[90dvh] flex-col bg-gradient-to-bl to-50% sm:max-w-[600px]"},{default:O(()=>[k(v(Df),null,{default:O(()=>[k(v(kf),null,{default:O(()=>[...n[1]||(n[1]=[ne("Schema Extraction Error",-1)])]),_:1}),k(v(R0),null,{default:O(()=>[...n[2]||(n[2]=[ne(" The following error was thrown when trying to call the `rules()` method from the request. ",-1)])]),_:1})]),_:1}),M("div",CF,[M("p",{innerHTML:t.errorHtml},null,8,AF)]),n[4]||(n[4]=M("p",{class:"text-xs italic"}," Note: An attempt to understand the schema statically (from the code as is) was made. The schema might not be complete. ",-1)),k(v(Qy),{class:"sm:justify-start"},{default:O(()=>[k(v(lv),{"as-child":""},{default:O(()=>[k(v(gt),{variant:"secondary"},{default:O(()=>[...n[3]||(n[3]=[ne("Dismiss",-1)])]),_:1})]),_:1})]),_:1})]),_:1})]),_:1}))}}),kF={class:"px-panel from-destructive/5 dark:from-destructive/15 flex items-center justify-between border-b bg-gradient-to-tr to-transparent to-50% py-0.5"},OF={class:"flex items-center gap-2 text-xs"},TF={class:"px-1 py-2"},IF=z({__name:"RouteExtractionError",props:{extractionError:{}},setup(t){const e=t;return(n,r)=>(T(),K("div",kF,[M("div",OF,[M("div",TF,[k(v(U0),{class:"text-destructive size-4"})]),r[0]||(r[0]=M("div",{class:"leading-3.5"},[M("span",{class:"flex items-center gap-1 font-bold"},"Extraction Error"),M("p",{class:"text-subtle-foreground mb-0"}," It wasn't possible to fully extract the shape of this route, there was an error. ")],-1))]),k(DF,{"error-html":e.extractionError},null,8,["error-html"])]))}}),PF=z({__name:"RequestBodyFormData",props:{modelValue:{default:()=>null},modelModifiers:{}},emits:Da(["update:modelValue"],["update:modelValue"]),setup(t,{emit:e}){const n=e,r=Ki(t,"modelValue"),i=Z(!1),s=Z([]);function o(u){const c=new FormData;for(const f of u){if(f.value===null){c.set(f.key,"");continue}if(f.value instanceof Blob){c.set(f.key,f.value);continue}c.set(f.key,String(f.value))}return c}function a(u){const c=[];return u.forEach((f,d)=>{if(f instanceof File){c.push({type:_r.File,key:d,value:f.name,enabled:!0});return}c.push({type:_r.Text,key:d,value:f,enabled:!0})}),c}const l=u=>{i.value=!0,s.value=u,n("update:modelValue",o(u))};return at(r,u=>{u!==null&&(i.value||(s.value=u instanceof FormData?a(u):[],kr(()=>{i.value=!1})))},{deep:!0}),(u,c)=>(T(),L(cv,{"model-value":s.value,"free-form-types":!0,"onUpdate:parameters":l},null,8,["model-value"]))}}),RF={class:"flex flex-col"},NF=z({__name:"RequestBodyFormNone",emits:["update:modelValue"],setup(t,{emit:e}){const n=e;return gn(()=>n("update:modelValue",null)),(r,i)=>(T(),L(v(Zy),{class:"border-b shadow-none"},{default:O(()=>[k(v(fv),{class:"items-start"},{default:O(()=>[k(v(bN),{class:"size-5 min-w-5"}),M("div",RF,[k(v(hp),null,{default:O(()=>[...i[0]||(i[0]=[ne("No Body",-1)])]),_:1}),k(v(dp),null,{default:O(()=>[...i[1]||(i[1]=[ne(" You're performing the request without a Payload. ",-1)])]),_:1})])]),_:1})]),_:1}))}});let Q1=[],GA=[];(()=>{let t="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(e=>e?parseInt(e,36):1);for(let e=0,n=0;e>1;if(t=GA[r])e=r+1;else return!0;if(e==n)return!1}}function zx(t){return t>=127462&&t<=127487}const jx=8205;function FF(t,e,n=!0,r=!0){return(n?WA:LF)(t,e,r)}function WA(t,e,n){if(e==t.length)return e;e&&KA(t.charCodeAt(e))&&XA(t.charCodeAt(e-1))&&e--;let r=cg(t,e);for(e+=Vx(r);e=0&&zx(cg(t,o));)s++,o-=2;if(s%2==0)break;e+=2}else break}return e}function LF(t,e,n){for(;e>0;){let r=WA(t,e-2,n);if(r=56320&&t<57344}function XA(t){return t>=55296&&t<56320}function Vx(t){return t<65536?1:2}class Ze{lineAt(e){if(e<0||e>this.length)throw new RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw new RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,n,r){[e,n]=Dl(this,e,n);let i=[];return this.decompose(0,e,i,2),r.length&&r.decompose(0,r.length,i,3),this.decompose(n,this.length,i,1),Ai.from(i,this.length-(n-e)+r.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,n=this.length){[e,n]=Dl(this,e,n);let r=[];return this.decompose(e,n,r,0),Ai.from(r,n-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let n=this.scanIdentical(e,1),r=this.length-this.scanIdentical(e,-1),i=new lc(this),s=new lc(e);for(let o=n,a=n;;){if(i.next(o),s.next(o),o=0,i.lineBreak!=s.lineBreak||i.done!=s.done||i.value!=s.value)return!1;if(a+=i.value.length,i.done||a>=r)return!0}}iter(e=1){return new lc(this,e)}iterRange(e,n=this.length){return new YA(this,e,n)}iterLines(e,n){let r;if(e==null)r=this.iter();else{n==null&&(n=this.lines+1);let i=this.line(e).from;r=this.iterRange(i,Math.max(i,n==this.lines+1?this.length:n<=1?0:this.line(n-1).to))}return new JA(r)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(e){if(e.length==0)throw new RangeError("A document must have at least one line");return e.length==1&&!e[0]?Ze.empty:e.length<=32?new Ht(e):Ai.from(Ht.split(e,[]))}}class Ht extends Ze{constructor(e,n=BF(e)){super(),this.text=e,this.length=n}get lines(){return this.text.length}get children(){return null}lineInner(e,n,r,i){for(let s=0;;s++){let o=this.text[s],a=i+o.length;if((n?r:a)>=e)return new $F(i,a,r,o);i=a+1,r++}}decompose(e,n,r,i){let s=e<=0&&n>=this.length?this:new Ht(Ux(this.text,e,n),Math.min(n,this.length)-Math.max(0,e));if(i&1){let o=r.pop(),a=wh(s.text,o.text.slice(),0,s.length);if(a.length<=32)r.push(new Ht(a,o.length+s.length));else{let l=a.length>>1;r.push(new Ht(a.slice(0,l)),new Ht(a.slice(l)))}}else r.push(s)}replace(e,n,r){if(!(r instanceof Ht))return super.replace(e,n,r);[e,n]=Dl(this,e,n);let i=wh(this.text,wh(r.text,Ux(this.text,0,e)),n),s=this.length+r.length-(n-e);return i.length<=32?new Ht(i,s):Ai.from(Ht.split(i,[]),s)}sliceString(e,n=this.length,r=` + */const BN=rt("WandSparklesIcon",[["path",{d:"m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72",key:"ul74o6"}],["path",{d:"m14 7 3 3",key:"1r5n42"}],["path",{d:"M5 6v4",key:"ilb8ba"}],["path",{d:"M19 14v4",key:"blhpug"}],["path",{d:"M10 2v2",key:"7u0qdc"}],["path",{d:"M7 8H3",key:"zfb6yr"}],["path",{d:"M21 16h-4",key:"1cnmox"}],["path",{d:"M11 3H9",key:"1obp7u"}]]),NA=t=>{const e=new FormData;return Object.entries(t).forEach(([n,r])=>{Y1(e,n,r)}),e},Y1=(t,e,n)=>{if(Array.isArray(n)){n.forEach((r,i)=>{Y1(t,`${e}[${i}]`,r)});return}if(n instanceof Blob){t.append(e,n);return}if(n&&typeof n=="object"){(n instanceof FormData?n.entries():Object.entries(n)).forEach(([i,s])=>{Y1(t,`${e}[${i}]`,s)});return}t.append(e,n===null?"":String(n))};var xt=(t=>(t.INFORMATION="Information",t.SUCCESS="Success",t.SERVER_ERROR="Server Error",t.CLIENT_ERROR="Client Error",t.REDIRECT="Redirect",t.EMPTY="No request yet",t.PENDING="Pending",t.OTHER="Other",t.DUMP_AND_DIE="Dump & Die",t))(xt||{});const $N=t=>t>=100&&t<200?xt.INFORMATION:t>=200&&t<300?xt.SUCCESS:t>=300&&t<400?xt.REDIRECT:t>=400&&t<500?xt.CLIENT_ERROR:t>=500&&t<600?xt.SERVER_ERROR:t===999?xt.DUMP_AND_DIE:xt.OTHER;function zN(){const t=Xi(),e=Z(null),n=Z(!1),r=c=>{const f=t.apiUrl,d=c.endpoint.replace(/^\/+/,""),h=new URL(`${f}/${d}`);return c.queryParameters.filter(p=>p.enabled&&p.key.trim()).forEach(p=>{h.searchParams.append(p.key,p.value)}),h.toString()},i=c=>{const f=c.body[c.method]??null;return f?f[c.payloadType]??null:null},s=c=>{const f=NI(c.payloadType,c.headers.filter(d=>d.enabled&&d.key.trim()!=="").map(d=>({key:d.key,value:d.value})));return{endpoint:r(c),method:c.method,headers:f,authorization:c.authorization,body:i(c)}},o=c=>{const f=c.headers,d=c.statusCode,h=c.headers.find(p=>p.key.toLowerCase()==="content-length");return{status:$N(d),statusCode:d,statusText:c.statusText,body:c.body,sizeInBytes:h?Number(h.value):c.body.length,headers:f,cookies:c.cookies.map(p=>({key:p.key,value:{raw:p.value.raw,decrypted:p.value.decrypted}})),timestamp:c.timestamp}},a=c=>new Promise((f,d)=>{var b;const h=t.appBasePath+"/api/relay",p=s(c),m=NA(p),g={"Content-Type":"multipart/form-data"};c.transactionMode&&(g["X-Nimbus-Transaction-Mode"]="1"),RI.post(h,m,{headers:g,transformResponse:y=>y,signal:(b=e.value)==null?void 0:b.signal}).then(y=>{const x=JSON.parse(y.data),S=o(x);f({response:S,duration:x.duration})}).catch(y=>{if(y.code==="ERR_CANCELED"){f(null);return}if(y.response){let x=y.message;try{x=JSON.parse(y.response.data).message??y.message}catch(S){console.error(S)}d({message:x,status:y.response.status,body:y.response.data});return}d({message:y.message})})});return{executeRequest:async c=>{if(n.value)throw new Error("Request already in progress");n.value=!0,e.value=new AbortController;try{const f=new Promise((d,h)=>setTimeout(()=>h(new Error("Request timeout")),PI.TIMEOUT));return await Promise.race([a(c),f])}finally{n.value=!1,e.value=null}},cancelCurrentRequest:()=>{e.value&&e.value.abort()},buildRequestUrl:r,isExecuting:kc(n)}}const jN=t=>JSON.stringify(t,null,3),VN=t=>Object.entries(t).map(([e,n])=>`${e}=${n};`).join(` +`),Bx=(t,e)=>{switch(e){case Or.JSON:return jN(t);case Or.PLAIN_TEXT:return VN(t);case Or.FORM_DATA:return NA(t);default:return null}},ll={EMPTY_FIELD_PROBABILITY:.3,MAX_ARRAY_ITEMS:5,MIN_ARRAY_ITEMS:1,NUMBER_RANGE:{min:1,max:9999},STRING_LENGTH:{minLength:5,maxLength:20}};var Vo=(t=>(t.STRING="string",t.INTEGER="integer",t.NUMBER="number",t.BOOLEAN="boolean",t.ARRAY="array",t.OBJECT="object",t))(Vo||{});function UN(t){return t==="string"||t==="integer"||t==="number"||t==="boolean"}function HN(t){return t==="array"||t==="object"}function qN(t){return q0(t,!1)}function GN(t){return q0(t,!0)}function WN(t,e){if(!t.enum||t.enum.length===0)throw new Error("Enum values are required for enum type");return e?t.enum[0]:T0.helpers.arrayElement(t.enum)}function KN(t,e,n,r){switch(t.type){case Vo.STRING:return QN(t,e,n,r);case Vo.NUMBER:case Vo.INTEGER:return eM(t,e,n);case Vo.BOOLEAN:return e?!1:T0.datatype.boolean();default:throw new Error(`Unsupported primitive type: ${t.type}`)}}function XN(t,e){switch(t.type){case Vo.ARRAY:return ZN(t,e);case Vo.OBJECT:return t.properties?q0(t,e):{};default:throw new Error(`Unsupported complex type: ${t.type}`)}}function MA(t,e,n,r){return t.enum&&t.enum.length>0?WN(t,e):t.type&&UN(t.type)?KN(t,e,n,r):t.type&&HN(t.type)?XN(t,e):null}function YN(t,e,n){return Array.from({length:n},()=>q0(t,e))}function JN(t,e,n){return Array.from({length:n},()=>MA(t,e,"item",!1)).filter(i=>i!==null&&i.toString().length)}function ZN(t,e){const n=t.items;if(n===void 0||typeof n!="object"||n===null||Array.isArray(n))return[];const r=e?ll.MIN_ARRAY_ITEMS:ll.MIN_ARRAY_ITEMS+Math.floor(Math.random()*ll.MAX_ARRAY_ITEMS);return n.properties!==void 0?YN(n,e,r):JN(n,e,r)}function q0(t,e=!1){const n={};if(t.properties&&typeof t.properties=="object"){const r=t.required||[];for(const i in t.properties){const s=t.properties[i];if(typeof s!="object"||s===null||Array.isArray(s))continue;const o=r.includes(i);n[i]=MA(s,e,i,o)}}return n}function QN(t,e,n,r){if(e)return"";if(!r&&Math.random()o.id===s))==null?void 0:i.generate())??null}for(const s of MI){if(r&&!s.isInteger||!s.pattern.test(n))continue;const o=Dx.find(a=>a.id===s.generatorId);if(o)return o.generate({...s.generatorConfig,...e})??null}return null}async function tM(t){const e={};return Object.keys(t).forEach(n=>{const r=t[n],i=[];Object.keys(r).forEach(s=>{const o=r[s];i.push({resource:s,routes:o.flatMap(a=>a.methods.map(l=>({method:l,endpoint:a.uri,shortEndpoint:a.shortUri,schema:{shape:a.schema,extractionErrors:a.extractionError},metadata:a.metadata}))).sort((a,l)=>a.shortEndpoint.localeCompare(l.shortEndpoint))})}),e[n]=i.sort((s,o)=>s.resource.localeCompare(o.resource))}),e}function nM(t){if(typeof t!="string")return null;try{return JSON.parse(t)}catch{return null}}function rM(t,e){if(!t||!e.trim())return[];const n=[],r=e.toLowerCase();return Object.entries(t).forEach(([i,s])=>{s.forEach(o=>{o.routes.forEach(a=>{(a.endpoint.toLowerCase().includes(r)||a.shortEndpoint.toLowerCase().includes(r)||a.method.toLowerCase().includes(r)||o.resource.toLowerCase().includes(r))&&n.push({version:i,resource:o.resource,route:a})})})}),n}function iM(t){return t?Object.values(t).reduce((e,n)=>e+n.reduce((r,i)=>r+i.routes.length,0),0):0}const fp=[],LA=t=>`nimbus:${t}`,BA=t=>{if(fp.includes(t)){const e=t+"-duplicate";return console.warn(`Key ${t} must be unique. '${e}' will be used instead.`),BA(e)}return fp.push(t),LA(t)},Tf=t=>(fp.includes(t)||fp.push(t),LA(t));function sM(t,e){const{queryParameters:n,requestBody:r}=oM(t),i=aM(t.method),s=zA(e,t.endpoint,n),o=lM(t),a=uM(t.authorization),l=mM(r);return{command:["curl"].concat(i?[i]:[]).concat([`"${s}"`]).concat(o).concat(a?[a]:[]).concat(l).join(` \\ + `),hasSpecialAuth:vM(t.authorization)}}function oM(t){const e=pM(t);if(t.method.toLowerCase()==="get"){const r=gM(e,t.payloadType);return{queryParameters:[...t.queryParameters.filter($A),...cM(r)],requestBody:null}}return{queryParameters:t.queryParameters,requestBody:e}}function aM(t){const e=t.toUpperCase();return e==="GET"?null:`-X ${e}`}function lM(t){const e=fM(t),n=e.map(i=>`-H "${i.key}: ${i.value}"`),r=FI(t.payloadType);return r&&(e.some(s=>s.key.toLowerCase()==="content-type")||n.push(`-H "Content-Type: ${r}"`)),n}function uM(t){const e=dM(t);return e?`-H "${e}"`:null}function cM(t){return Object.entries(t).map(([e,n])=>({type:_r.Text,enabled:!0,key:e,value:n}))}function fM(t){return t.headers.filter($A)}function $A(t){return t.enabled&&t.key.trim()!==""}function dM(t){if(!t)return null;switch(t.type){case Je.Bearer:return`Authorization: Bearer ${t.value}`;case Je.Basic:return hM(t.value);case Je.None:case Je.CurrentUser:case Je.Impersonate:return null;default:return null}}function hM(t){return`Authorization: Basic ${btoa(`${t.username}:${t.password}`)}`}function pM(t){const n=t.body[t.method];if(n===void 0)return null;const r=n[t.payloadType];return r===void 0?null:r}function mM(t){return t===null?[]:bM(t)}function gM(t,e){return t===null?{}:typeof t=="string"&&e===Or.JSON?JSON.parse(t):t instanceof FormData?Object.fromEntries(Array.from(t.entries()).map(([n,r])=>[n,r instanceof File?`@${r}`:r])):t.split(` +`).reduce(function(n,r){const{0:i,1:s}=r.split("=");return n[i]=s,n},{})}function bM(t){return typeof t=="string"?[`-d '${t}'`]:yM(t)}function yM(t){return Array.from(t.entries()).map(([e,n])=>n instanceof File?`-F ${e}=@${n.name}`:`-F ${e}=${n}`)}function vM(t){return t.type===Je.CurrentUser?!0:t.type===Je.Impersonate}function xM(t){return t.key.trim()!==""}function zA(t,e,n){const r=new URL(`${t}/${e}`);return n.forEach(i=>{xM(i)&&J1(r.searchParams,i.key,i.value)}),r.toString()}function J1(t,e,n){n!=null&&(Array.isArray(n)?n.forEach(r=>J1(t,`${e}[]`,r)):typeof n=="object"?Object.entries(n).forEach(([r,i])=>{J1(t,`${e}[${r}]`,i)}):t.append(e,String(n)))}function zx(t){return Object.keys(t.schema.shape.properties??{}).length>0?Or.JSON:Or.EMPTY}function SM(t,e,n){return{durationInMs:e,isProcessing:!1,request:jA(t),response:n}}function EM(t,e){return{durationInMs:0,isProcessing:!1,request:jA(t),error:e}}const jA=function(t){const e=t.body[t.method]??null,n=e?e[t.payloadType]??null:null;return{method:t.method,endpoint:t.endpoint,headers:t.headers.map(r=>({...r})),body:n,queryParameters:t.queryParameters.map(r=>({...r})),payloadType:t.payloadType,authorization:{...t.authorization},routeDefinition:{...t.routeDefinition},transactionMode:t.transactionMode}};function wM(t){const e=performance.now();let r=window.setInterval(()=>{const i=Math.floor(performance.now()-e);t(i)},86);return{stop:()=>(r&&(clearInterval(r),r=null),Math.floor(performance.now()-e))}}const _M=Ca("_requestExecutor",()=>{const t=G0(),e=ka(),{executeRequest:n,cancelCurrentRequest:r}=zN(),i=Z(!1),s=Z(0),o=q(()=>l=>l!==null&&!l.isProcessing&&l.endpoint.trim()!=="");return{isProcessing:i,duration:s,canExecute:o,executeRequestWithTiming:async l=>{if(!o.value(l))return;let u=null;const c=()=>{u&&u.stop(),l.isProcessing=!1,l.wasExecuted=!0};try{l.isProcessing=!0,l.durationInMs=0,u=wM(h=>{l.isProcessing&&(l.durationInMs=h)});const f=await n(l);if(f===null){c(),l.durationInMs=0;return}const d=SM(l,f.duration,f.response);t.addLog(d),e.updateActiveTabResponse(d)}catch(f){const d=EM(l,f);t.addLog(d),e.updateActiveTabResponse(d),console.error("Request failed:",f)}finally{c()}},cancelCurrentRequest:r}}),G0=Ca("requestHistory",()=>{const t=Ky(),e=Z([]),n=Z(null),r=q(()=>t.preferences.maxHistoryLogs),i=q(()=>e.value),s=q(()=>n.value!==null&&e.value[n.value]?e.value[n.value]:e.value[e.value.length-1]??null);return{logs:e,maxLogs:r,activeLogIndex:n,allLogs:i,lastLog:s,addLog:u=>{e.value.push(u),e.value.length>r.value&&(e.value=e.value.slice(-r.value)),n.value=null},clearLogs:()=>{e.value=[]},setActiveLog:u=>{n.value=u}}},{persist:!0}),Rr=Ca("request",()=>{const t=ka(),e=_M(),n=q(()=>t.hasActiveRequest),r=q(()=>t.pendingRequestData),i=q(()=>e.canExecute(t.pendingRequestData)),s=(o,a)=>{var l,u;o.endpoint===((l=r.value)==null?void 0:l.endpoint)&&o.method===((u=r.value)==null?void 0:u.method)||(e.cancelCurrentRequest(),t.openTab(o,a))};return{isProcessing:q(()=>e.isProcessing),hasActiveRequest:n,pendingRequestData:r,canExecute:i,updateRequestMethod:t.updateRequestMethod,updateRequestEndpoint:t.updateRequestEndpoint,updateRequestHeaders:t.updateRequestHeaders,updateRequestBody:t.updateRequestBody,updateQueryParameters:t.updateQueryParameters,updateAuthorization:t.updateAuthorization,updateTransactionMode:t.updateTransactionMode,getRequestUrl:t.getRequestUrl,resetRequest:t.resetRequest,restoreFromHistory:t.restoreFromHistory,executeCurrentRequest:()=>{if(t.pendingRequestData)return e.executeRequestWithTiming(t.pendingRequestData)},cancelCurrentRequest:e.cancelCurrentRequest,initializeRequest:s}});function VA(t,e){switch(t){case wh.Uuid:return e.generateValue("uuid");case wh.Email:return e.generateValue("email");case wh.String:return e.generateValue("word");default:return e.generateValue("word")}}const ka=Ca("tabs",()=>{const t=Ky(),e=Xi(),n=I0(),r=Z([]),i=Z(null),s=Z(null),o=Z([]),a=q(()=>r.value.find($=>$.id===i.value)??null),l=q(()=>{var $;return(($=a.value)==null?void 0:$.request)??null}),u=q(()=>{var $;return(($=a.value)==null?void 0:$.response)??null}),c=q(()=>l.value),f=q(()=>l.value!==null),d=()=>e.headers.map($=>({type:_r.Text,key:$.header,value:$.type==="generator"?VA($.value,n):String($.value),enabled:!0}));function h(){if(!l.value)return;const $=o.value.map(fe=>fe.key),ee=l.value.headers.filter(fe=>!$.includes(fe.key)),pe=d();l.value.headers=[...pe,...ee],o.value=pe}const p=()=>l.value!==null?l.value.authorization:t.preferences.defaultAuthorizationType===Je.CurrentUser?{type:Je.CurrentUser}:t.preferences.defaultAuthorizationType===Je.Impersonate?{type:Je.Impersonate,value:1}:t.preferences.defaultAuthorizationType===Je.Bearer?{type:Je.Bearer,value:""}:t.preferences.defaultAuthorizationType===Je.Basic?{type:Je.Basic,value:{username:"",password:""}}:{type:Je.None},m=$=>t.preferences.defaultRequestBodyType===-1?zx($):t.preferences.defaultRequestBodyType;function g($){const ee=d(),pe=ee.map(me=>me.key),fe=$.headers.filter(me=>!pe.includes(me.key));$.headers=[...ee,...fe],o.value=ee}function b($,ee){var fe,me,Me;const pe={method:$.method,endpoint:$.endpoint,headers:(fe=l.value)!=null&&fe.headers?F(l.value.headers):[],body:{},payloadType:m($),schema:$.schema,queryParameters:[],authorization:((me=l.value)==null?void 0:me.authorization)??p(),supportedRoutes:ee,routeDefinition:$,isProcessing:!1,wasExecuted:!1,durationInMs:0,transactionMode:((Me=l.value)==null?void 0:Me.transactionMode)??!1};return g(pe),pe}function y($,ee){const pe=r.value.find(Me=>Me.method.toUpperCase()===$.method.toUpperCase()&&Me.request.endpoint===$.endpoint);if(pe){i.value=pe.id;return}const fe=crypto.randomUUID(),me={id:fe,title:$.shortEndpoint||$.endpoint,method:$.method,request:b($,ee),response:null};r.value.push(me),i.value=fe}function x($){const ee=r.value.findIndex(pe=>pe.id===$);if(ee!==-1&&(r.value.splice(ee,1),i.value===$))if(r.value.length>0){const pe=Math.min(ee,r.value.length-1);i.value=r.value[pe].id}else i.value=null}function S($){r.value.some(ee=>ee.id===$)&&(i.value=$)}function E($,ee){if($<0||$>=r.value.length||ee<0||ee>=r.value.length)return;const pe=r.value.splice($,1)[0];r.value.splice(ee,0,pe)}function C($){a.value&&(a.value.response=$)}function w($){if(!l.value)return;const ee=$.toUpperCase();if(ee===l.value.method)return;l.value.method=ee;const pe=l.value.supportedRoutes.find(fe=>fe.method.toUpperCase()===ee);if(!pe){l.value.payloadType=Or.EMPTY,l.value.schema={shape:{},extractionErrors:null};return}l.value.payloadType=zx(pe),l.value.schema=pe.schema}function A($){l.value&&(l.value.endpoint=$)}function _($){l.value&&(l.value.headers=$)}function O($){l.value&&(l.value.body=$)}function I($){l.value&&(l.value.queryParameters=$)}function N($){l.value&&(l.value.authorization=$)}function P($){l.value&&(l.value.transactionMode=$)}const R=()=>{i.value&&x(i.value)},F=$=>$.map(ee=>({...ee})),V=($,ee,pe,fe)=>{const me={...$},Me=me[ee]??{};return me[ee]={...Me,[pe]:fe},me},B=$=>{var pe;const ee=$.response!==void 0&&$.response.durationInMs!==void 0;return{method:$.method.toUpperCase(),endpoint:$.endpoint,headers:$.headers.map(fe=>({key:fe.key,value:String(fe.value??""),type:_r.Text,enabled:!0})),body:$.body,payloadType:$.payloadType,schema:{shape:{},extractionErrors:null},queryParameters:$.queryParameters.map(fe=>({key:fe.key,value:fe.value,type:fe.type==="file"?_r.File:_r.Text,enabled:!0})),authorization:{type:$.authorization.type,value:$.authorization.value},supportedRoutes:[],routeDefinition:{endpoint:$.endpoint,method:$.method.toUpperCase(),schema:{shape:{},extractionErrors:null},shortEndpoint:$.endpoint},isProcessing:!1,wasExecuted:ee,durationInMs:((pe=$.response)==null?void 0:pe.durationInMs)??0,transactionMode:!1}};return{tabs:r,activeTabId:i,activeApplication:s,lastSyncedGlobalHeaders:o,pendingRequestData:c,activeTab:a,activeRequest:l,activeResponse:u,hasActiveRequest:f,openTab:y,closeTab:x,setActiveTab:S,moveTab:E,updateActiveTabResponse:C,updateRequestMethod:w,updateRequestEndpoint:A,updateRequestHeaders:_,updateRequestBody:O,updateQueryParameters:I,updateAuthorization:N,updateTransactionMode:P,resetRequest:R,restoreFromHistory:$=>{if(!l.value)return;const ee=$.request.method.toUpperCase(),pe=$.request.payloadType,fe=l.value.supportedRoutes.find(me=>me.method.toUpperCase()===ee&&me.endpoint===$.request.endpoint);a.value.request={...l.value,method:ee,endpoint:$.request.endpoint,headers:F($.request.headers),queryParameters:F($.request.queryParameters),payloadType:pe,body:V(l.value.body,ee,pe,$.request.body),authorization:{...$.request.authorization},...fe?{routeDefinition:fe,schema:fe.schema}:{},wasExecuted:!0,transactionMode:l.value.transactionMode??!1},a.value.response=$},restoreFromSharedPayload:$=>{var me;const ee=B($),pe=crypto.randomUUID(),fe={id:pe,title:$.endpoint,method:$.method,request:ee,response:ee.wasExecuted&&$.response?{durationInMs:$.response.durationInMs,isProcessing:!1,request:{...ee,headers:F(ee.headers),queryParameters:F(ee.queryParameters),body:ee.body?((me=ee.body[ee.method])==null?void 0:me[ee.payloadType])??null:null},response:$.response,importedFromShare:!0}:null};r.value.push(fe),i.value=pe},syncGlobalHeadersWhenApplicable:()=>{s.value!==e.activeApplication&&(h(),s.value=e.activeApplication)},getRequestUrl:$=>zA(e.apiUrl,$.endpoint,$.queryParameters.filter(ee=>ee.enabled&&ee.key.trim()!==""))}},{persist:{pick:["tabs","activeTabId","activeApplication","lastSyncedGlobalHeaders"],afterHydrate:t=>{t.store.syncGlobalHeadersWhenApplicable()}}}),lv=Ca("routes",()=>{const t=Z(null),e=Z(null),n=Z(!1),r=Z(null),i=async()=>{var g;n.value=!0,r.value=null;try{const b=((g=window.Nimbus)==null?void 0:g.routes)??"[]";if(typeof b!="string"){t.value=null;return}const y=JSON.parse(b);t.value=await tM(y)}catch(b){r.value=b instanceof Error?b.message:"Failed to load routes",t.value=null}finally{n.value=!1}},s=async()=>{var g;e.value=nM(((g=window.Nimbus)==null?void 0:g.routeExtractorException)??null),await i()},o=g=>{var b;return((b=g.metadata)==null?void 0:b.isMissingImplementation)??!1},a=g=>{var b;return((b=g.metadata)==null?void 0:b.isUndocumented)??!1},l=()=>{t.value=null,e.value=null,r.value=null},u=q(()=>t.value!==null&&Object.keys(t.value).length>0),c=q(()=>e.value!==null),f=q(()=>c.value),d=q(()=>t.value?Object.keys(t.value):[]),h=q(()=>iM(t.value)),p=q(()=>g=>{var b;return((b=t.value)==null?void 0:b[g])||[]}),m=q(()=>g=>rM(t.value,g));return{routes:t,routeExtractorException:e,isLoading:n,error:r,fetchAvailableRoutes:i,initializeRoutes:s,resetRoutesState:l,isMissingImplementation:o,isUndocumented:a,hasRoutes:u,hasExtractionError:c,hasAnyError:f,routeVersions:d,totalRouteCount:h,getRoutesByVersion:p,searchRoutes:m}}),CM=["type","placeholder","disabled"],AM=500,ws=z({__name:"AppInput",props:{defaultValue:{},modelValue:{},class:{},type:{},placeholder:{},disabled:{type:Boolean},variant:{}},emits:["update:modelValue"],setup(t,{emit:e}){const n=t,i=_a(n,"modelValue",e,{passive:!0,defaultValue:n.defaultValue}),{openCommand:s}=I0(),o=Z(),a=Z(0),l=u=>{if(u.key==="Shift"){const c=Date.now();c-a.valueua((T(),K("input",{ref_key:"inputRef",ref:o,"onUpdate:modelValue":c[0]||(c[0]=f=>_l(i)?i.value=f:null),type:t.type??"text",class:Se(v(ke)(v(DM)({variant:t.variant}),n.class)),placeholder:t.placeholder,disabled:t.disabled,onKeydown:l},null,42,CM)),[[LI,v(i)]])}}),DM=VC("flex h-9 w-full bg-transparent px-3 py-1 text-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-zinc-500 focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50 dark:placeholder:text-zinc-400",{variants:{variant:{default:"rounded-md border border-zinc-200 shadow-sm focus-visible:ring-1 focus-visible:ring-zinc-950 dark:border-zinc-800 dark:focus-visible:ring-zinc-300",toolbar:"rounded-none border-0 shadow-none focus-visible:ring-0"}},defaultVariants:{variant:"default"}}),kM=z({__name:"AppSidebarInput",props:{class:{},variant:{}},setup(t){const e=t,n=Aa(e,"class");return(r,i)=>(T(),L(v(ws),Ce({"data-sidebar":"input"},v(n),{class:v(ke)("h-8 w-full bg-white shadow-none focus-visible:ring-0 dark:bg-zinc-950",e.class)}),{default:D(()=>[Q(r.$slots,"default")]),_:3},16,["class"]))}}),OM=z({__name:"AppTooltipProvider",props:{delayDuration:{},skipDelayDuration:{},disableHoverableContent:{type:Boolean},disableClosingTrigger:{type:Boolean},disabled:{type:Boolean},ignoreNonKeyboardFocus:{type:Boolean}},setup(t){const e=t;return(n,r)=>(T(),L(v($I),Yn(Pr(e)),{default:D(()=>[Q(n.$slots,"default")]),_:3},16))}}),dp=z({__name:"AppTooltipWrapper",props:{value:{},delay:{default:300},as:{default:"button"},onClick:{type:Function,default:()=>{}}},setup(t){const e=t;return(n,r)=>(T(),L(v(OM),{"delay-duration":t.delay},{default:D(()=>[k(v(zI),null,{default:D(()=>[k(v(jI),{as:t.as,onClick:t.onClick},{default:D(()=>[M("span",null,[Q(n.$slots,"default")])]),_:3},8,["as","onClick"]),k(v(VI),null,{default:D(()=>[ne(de(e.value),1)]),_:1})]),_:3})]),_:3},8,["delay-duration"]))}}),TM=z({__name:"AppSidebarMenuSub",props:{class:{}},setup(t){const e=t;return(n,r)=>(T(),K("ul",{"data-sidebar":"menu-badge",class:Se(v(ke)("border-sidebar-border ml-2.5 flex min-w-0 translate-x-px flex-col gap-1 border-l py-0.5 pl-0.5","group-data-[collapsible=icon]:hidden",e.class))},[Q(n.$slots,"default")],2))}}),uv=z({__name:"AppDialogClose",props:{asChild:{type:Boolean},as:{}},setup(t){const e=t;return(n,r)=>(T(),L(v(DP),Ce({"data-slot":"dialog-close"},e),{default:D(()=>[Q(n.$slots,"default")]),_:3},16))}}),cv=z({__name:"AppDialogTrigger",props:{asChild:{type:Boolean},as:{}},setup(t){const e=t;return(n,r)=>(T(),L(v(VP),Ce({"data-slot":"dialog-trigger"},e),{default:D(()=>[Q(n.$slots,"default")]),_:3},16))}}),IM={key:0,class:"z-10 flex h-4 w-3 items-center justify-center rounded-xs border bg-zinc-200 dark:bg-zinc-800"},Z1=z({__name:"AppResizableHandle",props:{class:{},withHandle:{type:Boolean},id:{},hitAreaMargins:{},tabindex:{},disabled:{type:Boolean},nonce:{},asChild:{type:Boolean},as:{}},emits:["dragging"],setup(t,{emit:e}){const n=t,r=e,i=Aa(n,"class","withHandle"),s=Yr(i,r);return(o,a)=>(T(),L(v(XR),Ce({"data-slot":"resizable-handle"},v(s),{class:v(ke)("relative flex w-px items-center justify-center bg-zinc-200 after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:ring-1 focus-visible:ring-zinc-950 focus-visible:ring-offset-1 focus-visible:outline-hidden data-[orientation=vertical]:h-px data-[orientation=vertical]:w-full data-[orientation=vertical]:after:left-0 data-[orientation=vertical]:after:h-1 data-[orientation=vertical]:after:w-full data-[orientation=vertical]:after:translate-x-0 data-[orientation=vertical]:after:-translate-y-1/2 dark:bg-zinc-800 dark:focus-visible:ring-zinc-300 [&[data-orientation=vertical]>div]:rotate-90",n.class)}),{default:D(()=>[n.withHandle?(T(),K("div",IM,[k(v(AN),{class:"size-2.5"})])):we("",!0)]),_:1},16,["class"]))}}),Ps=z({__name:"AppResizablePanel",props:{collapsedSize:{},collapsible:{type:Boolean},defaultSize:{},id:{},maxSize:{},minSize:{},order:{},asChild:{type:Boolean},as:{}},emits:["collapse","expand","resize"],setup(t,{expose:e,emit:n}){const s=Yr(t,n),o=Z(null);return e({collapse:()=>{var a;return(a=o.value)==null?void 0:a.collapse()},expand:()=>{var a;return(a=o.value)==null?void 0:a.expand()}}),(a,l)=>(T(),L(v(GR),Ce({ref_key:"splitterPanelRef",ref:o,"data-slot":"resizable-panel"},v(s)),{default:D(()=>[Q(a.$slots,"default")]),_:3},16))}}),Q1=z({__name:"AppResizablePanelGroup",props:{class:{},id:{},autoSaveId:{},direction:{},keyboardResizeBy:{},storage:{},asChild:{type:Boolean},as:{}},emits:["layout"],setup(t,{emit:e}){const n=t,r=e,i=Aa(n,"class"),s=Yr(i,r);return(o,a)=>(T(),L(v(HR),Ce({"data-slot":"resizable-panel-group"},v(s),{class:v(ke)("flex h-full w-full data-[orientation=vertical]:flex-col",n.class)}),{default:D(()=>[Q(o.$slots,"default")]),_:3},16,["class"]))}}),UA=z({__name:"AppTabs",props:{defaultValue:{},orientation:{},dir:{},activationMode:{},modelValue:{},unmountOnHide:{type:Boolean},asChild:{type:Boolean},as:{}},emits:["update:modelValue"],setup(t,{emit:e}){const i=Yr(t,e);return(s,o)=>(T(),L(v(iN),Ce(v(i),{"unmount-on-hide":!1}),{default:D(()=>[Q(s.$slots,"default")]),_:3},16))}}),Uo=z({__name:"AppTabsContent",props:{class:{},value:{},forceMount:{type:Boolean},asChild:{type:Boolean},as:{}},setup(t){const e=t,n=q(()=>{const{class:r,...i}=e;return i});return(r,i)=>(T(),L(v(oN),Ce({class:v(ke)("mt-2 ring-offset-white focus-visible:outline-none",e.class)},n.value),{default:D(()=>[Q(r.$slots,"default")]),_:3},16,["class"]))}}),HA=z({__name:"AppTabsList",props:{class:{},loop:{type:Boolean},asChild:{type:Boolean},as:{}},setup(t){const e=t,n=q(()=>{const{class:r,...i}=e;return i});return(r,i)=>(T(),L(v(lN),Ce(n.value,{class:v(ke)("text-subtle-foreground inline-flex items-center justify-center rounded-sm p-1",e.class)}),{default:D(()=>[Q(r.$slots,"default")]),_:3},16,["class"]))}}),PM={class:"truncate"},Ho=z({__name:"AppTabsTrigger",props:{label:{},class:{},value:{},disabled:{type:Boolean},asChild:{type:Boolean},as:{}},setup(t){const e=t,n=q(()=>{const{class:i,...s}=e;return s}),r=P0(n);return(i,s)=>(T(),L(v(cN),Ce(v(r),{class:v(ke)("inline-flex items-center justify-center rounded-sm px-2.5 py-1 text-sm font-medium whitespace-nowrap ring-offset-white transition-all focus-visible:ring-2 focus-visible:ring-zinc-950 focus-visible:ring-offset-2 focus-visible:outline-none disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-white data-[state=active]:text-zinc-950 data-[state=active]:shadow-sm dark:ring-offset-zinc-950 dark:focus-visible:ring-zinc-300 dark:data-[state=active]:bg-zinc-950 dark:data-[state=active]:text-zinc-50",e.class)}),{default:D(()=>[M("span",PM,[t.label?(T(),K(Qe,{key:0},[ne(de(t.label),1)],64)):Q(i.$slots,"default",{key:1})])]),_:3},16,["class"]))}}),Pc=z({__name:"AppSelectGroup",props:{class:{},asChild:{type:Boolean},as:{}},setup(t){const e=t,n=Aa(e,"class");return(r,i)=>(T(),L(v(gR),Ce({class:v(ke)("w-full",e.class)},v(n)),{default:D(()=>[Q(r.$slots,"default")]),_:3},16,["class"]))}}),Rc=z({__name:"AppSelectLabel",props:{class:{},for:{},asChild:{type:Boolean},as:{}},setup(t){const e=t;return(n,r)=>(T(),L(v(yR),{class:Se(v(ke)("p-1 text-xs font-semibold",e.class))},{default:D(()=>[Q(n.$slots,"default")]),_:3},8,["class"]))}}),RM=z({__name:"AppSelectSeparator",props:{class:{},asChild:{type:Boolean},as:{}},setup(t){const e=t,n=Aa(e,"class");return(r,i)=>(T(),L(v(xR),Ce(v(n),{class:v(ke)("-mx-1 my-1 h-px bg-zinc-100 dark:bg-zinc-800",e.class)}),null,16,["class"]))}}),qA=z({__name:"AppSwitch",props:{class:{},variant:{},defaultValue:{type:Boolean},modelValue:{type:[Boolean,null]},disabled:{type:Boolean},id:{},value:{},asChild:{type:Boolean},as:{},name:{},required:{type:Boolean}},emits:["update:modelValue"],setup(t,{emit:e}){const n=t,r=e,i=q(()=>{const{class:o,...a}=n;return a}),s=Yr(i,r);return(o,a)=>{var l;return T(),L(v(QR),Ce(v(s),{class:v(ke)(((l=n.variant)==null?void 0:l.type)==="default"?"h-5 w-9":"h-4 w-8","peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-sm transition-colors focus-visible:ring-2 focus-visible:ring-zinc-950 focus-visible:ring-offset-2 focus-visible:ring-offset-white focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-zinc-900 data-[state=unchecked]:bg-zinc-200 dark:focus-visible:ring-zinc-300 dark:focus-visible:ring-offset-zinc-950 dark:data-[state=checked]:bg-zinc-50 dark:data-[state=unchecked]:bg-zinc-800",n.class)}),{default:D(()=>{var u;return[k(v(tN),{class:Se(v(ke)(((u=n.variant)==null?void 0:u.type)==="default"?"h-4 w-4":"h-3 w-3","pointer-events-none block rounded-full bg-white shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0 dark:bg-zinc-950"))},{default:D(()=>[Q(o.$slots,"thumb")]),_:3},8,["class"])]}),_:3},16,["class"])}}});function NM(t,e){const{count:n,inc:r}=UI(),i=Z([]),s=UC(new Map),o=Z({deleting:!1}),a=_=>({type:_r.Text,id:_,key:"",value:"",enabled:!0}),l=_=>{const O=s.get(_);return O!=null&&O.deleting?(c(_),!0):(f(_),!1)},u=_=>{var O;return((O=s.get(_))==null?void 0:O.deleting)??!1},c=_=>{const O=s.get(_);O!=null&&O.timeoutId&&clearTimeout(O.timeoutId),s.delete(_)},f=_=>{const O=window.setTimeout(()=>{s.delete(_)},lg.DELETION_CONFIRMATION_TIMEOUT);s.set(_,{deleting:!0,timeoutId:O})},d=()=>o.value.deleting?(p(),!0):(m(),!1),h=()=>o.value.deleting,p=()=>{o.value.timeoutId&&clearTimeout(o.value.timeoutId),o.value={deleting:!1}},m=()=>{const _=window.setTimeout(()=>{o.value={deleting:!1}},lg.DELETION_CONFIRMATION_TIMEOUT);o.value={deleting:!0,timeoutId:_}},g=()=>{s.forEach((_,O)=>c(O)),p()},b=()=>{const _=t.value??[],O=new Map(i.value.map(N=>[N.id,N])),I=_.map(N=>{const P=O.get(N.id);return P?{...P,id:N.id,key:N.key,value:N.value,type:N.type,enabled:N.enabled}:(r(),{id:n.value,...N})});I.length===0&&(r(),I.push(a(n.value))),JSON.stringify(i.value)!==JSON.stringify(_)&&(i.value=I)},y=()=>{const _=i.value.map(O=>({id:O.id,type:O.type,key:O.key,value:O.value,enabled:O.enabled}));e(_)},x=q(()=>i.value.every(_=>!_.enabled)),S=q(()=>h()),E=()=>{r();const _=a(n.value);i.value.push(_)},C=()=>{const _=x.value;i.value.forEach(O=>O.enabled=_)},w=_=>{!i.value[_]||!l(_)||i.value.splice(_,1)},A=()=>{d()&&(i.value=[])};return HI(i,()=>{y()},{deep:!0,debounce:lg.SYNC_DEBOUNCE_DELAY}),nt(t,()=>{b()},{deep:!0}),Xy(()=>{b(),i.value.length===0&&E()}),{parameters:i,deletingAll:S,areAllParametersDisabled:x,addNewEmptyParameter:E,toggleAllParametersEnabledState:C,triggerParameterDeletion:w,deleteAllParameters:A,updateParametersFromParentModel:b,isParameterMarkedForDeletion:u,clearAllDeletionStates:g}}const MM={class:"flex h-8 items-center overflow-hidden border-b p-0"},FM={class:"flex-1 overflow-y-auto"},LM={class:"flex flex-1"},BM={class:"flex items-center justify-center border-r px-2"},$M={key:1,class:"flex items-center justify-center px-2","data-testid":"delete-button"},fv=z({__name:"KeyValueParameters",props:{modelValue:{default:()=>[]},freeFormTypes:{type:Boolean,default:!1},class:{default:void 0}},emits:["update:parameters"],setup(t,{emit:e}){const n=t,r=e,{openCommand:i,closeCommand:s}=I0(),o=Z(null),a=Z(null),l=q(()=>n.modelValue),u=w=>{r("update:parameters",w)},{parameters:c,deletingAll:f,isParameterMarkedForDeletion:d,areAllParametersDisabled:h,addNewEmptyParameter:p,toggleAllParametersEnabledState:m,triggerParameterDeletion:g,deleteAllParameters:b}=NM(l,u),y=(w,A)=>o.value===w&&A.enabled,x=(w,A)=>{o.value=w,a.value=A},S=w=>{const A=w.relatedTarget;A!=null&&A.closest("[data-ValueGenerator-focus-hook]")||(o.value=null,a.value=null,setTimeout(s,100))},E=()=>{a.value&&i(a.value)},C=w=>{g(w)};return(w,A)=>(T(),K("div",{class:Se(v(ke)("flex h-full flex-col overflow-hidden",n.class)),"data-testid":"kv-container"},[M("div",MM,[k(v(gt),{variant:"ghost",size:"xs",class:"px-panel h-full -translate-x-0.5 rounded-none text-xs","data-testid":"add-button",onClick:v(p)},{default:D(()=>[k(v(NN)),A[0]||(A[0]=ne(" Add ",-1))]),_:1},8,["onClick"]),k(v(gt),{variant:"ghost",size:"xs",class:"px-panel h-full -translate-x-0.5 rounded-none text-xs",disabled:v(c).length===0,"data-testid":"enable-all-button",onClick:v(m)},{default:D(()=>[v(h)?(T(),L(v(_N),{key:0})):(T(),L(v(wN),{key:1})),ne(" "+de(v(h)?"Enable All":"Disable All"),1)]),_:1},8,["disabled","onClick"]),k(v(gt),{variant:"ghost",size:"xs",class:Se(["px-panel h-full -translate-x-0.5 rounded-none text-xs",{"!text-destructive hover:text-destructive/90":v(f)}]),disabled:v(c).length===0,"data-testid":"delete-all-button",onClick:v(b)},{default:D(()=>[k(v(cp)),A[1]||(A[1]=ne(" Delete All ",-1))]),_:1},8,["class","disabled","onClick"])]),M("div",FM,[(T(!0),K(Qe,null,_n(v(c),(_,O)=>(T(),K("div",{key:_.id,class:"flex h-8 border-b","data-testid":"parameter-row"},[M("div",LM,[t.freeFormTypes?(T(),L(v(tu),{key:0,modelValue:_.type,"onUpdate:modelValue":I=>_.type=I,"default-value":"text"},{default:D(()=>[k(v(Zl),{class:"pl-panel h-full w-[80px] rounded-none border-0 border-r p-0 text-xs shadow-none focus:ring-0","data-testid":"type-selector"},{default:D(()=>[k(v(Ql),{placeholder:"Select a Type"})]),_:1}),k(v(eu),null,{default:D(()=>[k(v(Es),{value:"text"},{default:D(()=>[...A[2]||(A[2]=[ne("Text",-1)])]),_:1}),k(v(Es),{value:"file",disabled:""},{default:D(()=>[A[4]||(A[4]=ne(" File ",-1)),k(v(fo),{variant:"outline",class:"ml-0.5 px-1 py-0"},{default:D(()=>[...A[3]||(A[3]=[ne(" soon ",-1)])]),_:1})]),_:1})]),_:1})]),_:1},8,["modelValue","onUpdate:modelValue"])):we("",!0),k(v(ws),{modelValue:_.key,"onUpdate:modelValue":I=>_.key=I,placeholder:"Key",class:"selector-key h-full flex-1 rounded-none border-0 border-r shadow-none focus:ring-0 focus-visible:ring-0",disabled:!_.enabled,name:"kv-key","data-testid":"kv-key",autocomplete:"off"},null,8,["modelValue","onUpdate:modelValue","disabled"]),k(v(ws),{modelValue:_.value,"onUpdate:modelValue":I=>_.value=I,placeholder:"Value",class:"pl-panel h-full flex-1 rounded-none border-0 border-r shadow-none focus:ring-0 focus-visible:ring-0",disabled:!_.enabled,name:"kv-value","data-testid":"kv-value",autocomplete:"off",onFocus:I=>x(O,I.target),onBlur:S},null,8,["modelValue","onUpdate:modelValue","disabled","onFocus"])]),M("div",BM,[k(v(dp),{value:"Enable/Disable"},{default:D(()=>[k(v(qA),{modelValue:_.enabled,"onUpdate:modelValue":I=>_.enabled=I,class:"h-4 w-8"},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1024)]),y(O,_)?(T(),K("div",{key:0,class:"flex cursor-pointer items-center justify-center p-2",title:"Generate Value","data-testid":"generator-button",onMousedown:eo(E,["prevent"])},[k(v(Yy),{class:"text-subtle-foreground hover:text-foreground size-4 transition-colors"})],32)):(T(),K("div",$M,[k(v(dp),{value:"Delete","on-click":()=>C(O)},{default:D(()=>[k(v(cp),{class:Se(["size-4",{"text-destructive":v(d)(O)}])},null,8,["class"])]),_:2},1032,["on-click"])]))]))),128))])],2))}}),zM={class:"text-subtle-foreground text-xs"},Oa=z({__name:"PanelSubHeader",props:{class:{}},setup(t){const e=t;return(n,r)=>(T(),K("div",{class:Se(v(ke)("px-panel h-sub-toolbar flex items-center justify-between",e.class))},[M("span",zM,[Q(n.$slots,"default")]),Q(n.$slots,"toolbox")],2))}}),jM=z({__name:"RequestHeaders",setup(t){const e=Rr(),n=Xi(),r=I0(),i=Z([]),s=q(()=>e.pendingRequestData),o=c=>{e.updateRequestHeaders(c)},a=q(()=>{var c;return((c=s.value)==null?void 0:c.headers)??[]}),l=q(()=>{const c=a.value;return c.length===0?i.value:c}),u=c=>{o(c)};return Xy(()=>{i.value=n.headers.map(c=>({type:_r.Text,key:c.header,value:c.type==="generator"?VA(c.value,r):String(c.value),enabled:!0}))}),(c,f)=>(T(),K(Qe,null,[k(Oa,{class:"border-b"},{default:D(()=>[...f[0]||(f[0]=[ne("Request Headers",-1)])]),_:1}),k(fv,{ref:"parametersBuilder","model-value":l.value,"onUpdate:parameters":u},null,8,["model-value"])],64))}}),VM={class:"grid h-8 grid-cols-3 border-b"},UM={class:"grid h-8 grid-cols-3 border-b"},HM=z({__name:"RequestAuthorizationBasicAuth",props:{modelValue:{default:()=>({username:"",password:""})},modelModifiers:{}},emits:Da(["update:modelValue"],["update:modelValue"]),setup(t,{emit:e}){const n=e,r=Ki(t,"modelValue"),i=Z(r.value.username),s=Z(r.value.password);return nt(i,o=>{r.value.username=o,n("update:modelValue",r.value)}),nt(s,o=>{r.value.password=o,n("update:modelValue",r.value)}),(o,a)=>(T(),K(Qe,null,[M("div",VM,[a[2]||(a[2]=M("label",{class:"px-panel flex h-8 items-center border-r py-1 text-xs",for:"username"}," Username ",-1)),k(v(ws),{id:"username",modelValue:i.value,"onUpdate:modelValue":a[0]||(a[0]=l=>i.value=l),placeholder:"-",class:"col-span-2 h-full rounded-none border-0 text-xs shadow-none focus:ring-0 focus-visible:ring-0"},null,8,["modelValue"])]),M("div",UM,[a[3]||(a[3]=M("label",{class:"px-panel flex h-8 items-center border-r py-1 text-xs",for:"password"}," Password ",-1)),k(v(ws),{id:"password",modelValue:s.value,"onUpdate:modelValue":a[1]||(a[1]=l=>s.value=l),placeholder:"-",class:"col-span-2 h-full rounded-none border-0 text-xs shadow-none focus:ring-0 focus-visible:ring-0"},null,8,["modelValue"])])],64))}}),qM={class:"grid h-8 grid-cols-3 border-b"},GM=z({__name:"RequestAuthorizationBearer",props:{modelValue:{default:()=>""},modelModifiers:{}},emits:["update:modelValue"],setup(t){const e=Ki(t,"modelValue");return(n,r)=>(T(),K("div",qM,[r[1]||(r[1]=M("label",{class:"px-panel flex h-8 items-center border-r py-1 text-xs",for:"bearer"}," Bearer Token ",-1)),k(v(ws),{id:"bearer",modelValue:e.value,"onUpdate:modelValue":r[0]||(r[0]=i=>e.value=i),placeholder:"Token",class:"col-span-2 h-full rounded-none border-0 text-xs shadow-none focus:ring-0 focus-visible:ring-0"},null,8,["modelValue"])]))}}),hp=z({__name:"AppPanelDescription",props:{class:{}},setup(t){const e=t;return(n,r)=>(T(),K("p",{class:Se(v(ke)("text-subtle-foreground text-sm",e.class))},[Q(n.$slots,"default")],2))}}),dv=z({__name:"AppPanelHeader",props:{class:{}},setup(t){const e=t;return(n,r)=>(T(),K("div",{class:Se(v(ke)("px-panel flex items-center gap-2 py-2.5",e.class))},[Q(n.$slots,"default")],2))}}),pp=z({__name:"AppPanelTitle",props:{class:{}},setup(t){const e=t;return(n,r)=>(T(),K("h3",{class:Se(v(ke)("text-sm leading-none font-semibold tracking-tight",e.class))},[Q(n.$slots,"default")],2))}}),WM={class:"flex flex-col"},KM={class:"whitespace-nowrap"},XM=z({__name:"RequestAuthorizationCurrentUser",setup(t){const e=Xi();return(n,r)=>(T(),L(v(Qy),{class:"border-b shadow-none"},{default:D(()=>[k(v(dv),{class:"items-start"},{default:D(()=>[v(e).isLoggedIn?(T(),L(v(LN),{key:0,class:"size-5 min-w-5"})):(T(),L(v(gN),{key:1,class:"text-destructive size-5 min-w-5"})),M("div",WM,[v(e).isLoggedIn?(T(),L(v(pp),{key:0},{default:D(()=>[...r[0]||(r[0]=[ne(" You're logged in! ",-1)])]),_:1})):(T(),L(v(pp),{key:1},{default:D(()=>[...r[1]||(r[1]=[ne("Please log in first",-1)])]),_:1})),v(e).isLoggedIn?(T(),L(v(hp),{key:2},{default:D(()=>[r[2]||(r[2]=ne(" You're performing the request acting as the currently logged-in user ",-1)),M("span",KM,"(ID: "+de(v(e).userId)+")",1),r[3]||(r[3]=ne(" . ",-1))]),_:1})):(T(),L(v(hp),{key:3},{default:D(()=>[...r[4]||(r[4]=[ne(" You need to be logged in to make requests as the currently logged-in user. ",-1)])]),_:1}))])]),_:1})]),_:1}))}}),YM={class:"grid h-8 grid-cols-3 border-b"},JM=z({__name:"RequestAuthorizationImpersonateUser",props:{modelValue:{default:()=>0},modelModifiers:{}},emits:["update:modelValue"],setup(t){const e=Ki(t,"modelValue");return(n,r)=>(T(),K("div",YM,[r[1]||(r[1]=M("label",{class:"px-panel flex h-8 items-center border-r py-1 text-xs",for:"user-id"}," User ID ",-1)),k(v(ws),{id:"user-id",modelValue:e.value,"onUpdate:modelValue":r[0]||(r[0]=i=>e.value=i),placeholder:"Pick a user ID to impersonate it.",class:"col-span-2 h-full rounded-none border-0 text-xs shadow-none focus:ring-0 focus-visible:ring-0",type:"numeric"},null,8,["modelValue"])]))}}),ZM={class:"flex flex-col"},QM=z({__name:"RequestAuthorizationNone",setup(t){return(e,n)=>(T(),L(v(Qy),{class:"border-b shadow-none"},{default:D(()=>[k(v(dv),{class:"items-start"},{default:D(()=>[k(v(PN),{class:"size-5 min-w-5"}),M("div",ZM,[k(v(pp),null,{default:D(()=>[...n[0]||(n[0]=[ne("No Authorization",-1)])]),_:1}),k(v(hp),null,{default:D(()=>[...n[1]||(n[1]=[ne(" You're performing the request as a guest. ",-1)])]),_:1})])]),_:1})]),_:1}))}}),eF={class:"flex items-center"},tF={class:"flex items-center"},nF=z({__name:"RequestAuthorizationSelector",props:Da({types:{}},{modelValue:{default:()=>Je.CurrentUser},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const e=t,n=Ki(t,"modelValue"),r=Rr(),i=Ky(),s=q(()=>r.pendingRequestData);return jC(s,o=>{n.value=(o==null?void 0:o.authorization.type)??i.preferences.defaultAuthorizationType},{deep:!0}),(o,a)=>(T(),K("div",eF,[a[3]||(a[3]=M("span",{class:"text-subtle-foreground w-[120px] text-xs"},"Authorization Type:",-1)),k(v(tu),{modelValue:n.value,"onUpdate:modelValue":a[0]||(a[0]=l=>n.value=l)},{default:D(()=>[k(v(Zl),{class:"min-w-[120px] rounded-none border-0 text-xs shadow-none focus:ring-0"},{default:D(()=>[k(v(Ql))]),_:1}),k(v(eu),null,{default:D(()=>[k(v(Pc),null,{default:D(()=>[k(v(Rc),null,{default:D(()=>[M("div",tF,[k(v(Yy),{size:14,class:"mr-2"}),a[1]||(a[1]=ne(" Special ",-1))])]),_:1}),(T(!0),K(Qe,null,_n(e.types.special,l=>(T(),L(v(Es),{key:l.id,value:l.id},{default:D(()=>[ne(de(l.label),1)]),_:2},1032,["value"]))),128))]),_:1}),k(v(Pc),null,{default:D(()=>[k(v(Rc),null,{default:D(()=>[...a[2]||(a[2]=[ne("Other",-1)])]),_:1}),(T(!0),K(Qe,null,_n(e.types.traditional,l=>(T(),L(v(Es),{key:l.id,value:l.id},{default:D(()=>[ne(de(l.label),1)]),_:2},1032,["value"]))),128))]),_:1})]),_:1})]),_:1},8,["modelValue"])]))}});function rF(){const t=Rr(),e={[Je.None]:{type:Je.None},[Je.Bearer]:{type:Je.Bearer,value:""},[Je.Basic]:{type:Je.Basic,value:{username:"",password:""}},[Je.CurrentUser]:{type:Je.CurrentUser},[Je.Impersonate]:{type:Je.Impersonate,value:0}},n=new Map;Object.entries(e).forEach(([l,u])=>{n.set(l,u)});const r=q(()=>{var l;return((l=t.pendingRequestData)==null?void 0:l.authorization)??{type:Je.CurrentUser}}),i=q({get:()=>r.value.type,set:l=>{l!==r.value.type&&s(l)}}),s=l=>{n.set(r.value.type,{...r.value});const u=n.get(l),c=u?{...u}:e[l];(c.type!==r.value.type||JSON.stringify(c.value)!==JSON.stringify(r.value.value))&&t.updateAuthorization(c)},o=l=>{var c;const u=((c=t.pendingRequestData)==null?void 0:c.authorization)??{type:Je.CurrentUser};JSON.stringify(l)!==JSON.stringify(u.value)&&t.updateAuthorization({...u,value:l})},a=()=>{n.set(r.value.type,{...r.value})};return nt(r,a,{deep:!0}),{authorization:kc(r),selectedType:i,types:{special:kx.TYPES.SPECIAL,traditional:kx.TYPES.TRADITIONAL},updateAuthorizationType:s,updateCurrentAuthorizationValue:o,saveAuthorizationToStore:a}}const iF={class:"flex h-full flex-col"},sF={class:"relative w-full flex-1 overflow-hidden"},oF=z({__name:"RequestAuthorization",setup(t){const{authorization:e,selectedType:n,types:r,updateCurrentAuthorizationValue:i}=rF();return(s,o)=>(T(),K("div",iF,[k(Oa,{class:"border-b"},{default:D(()=>[k(nF,{modelValue:v(n),"onUpdate:modelValue":o[0]||(o[0]=a=>_l(n)?n.value=a:null),types:v(r)},null,8,["modelValue","types"])]),_:1}),M("div",sF,[!v(e)||v(e).type===v(Je).None?(T(),L(QM,{key:0})):v(e).type===v(Je).CurrentUser?(T(),L(XM,{key:1})):v(e).type===v(Je).Impersonate?(T(),L(JM,{key:2,"model-value":v(e).value,"onUpdate:modelValue":o[1]||(o[1]=a=>v(i)(a))},null,8,["model-value"])):v(e).type===v(Je).Bearer?(T(),L(GM,{key:3,"model-value":v(e).value,"onUpdate:modelValue":o[2]||(o[2]=a=>v(i)(a))},null,8,["model-value"])):v(e).type===v(Je).Basic?(T(),L(HM,{key:4,"model-value":{username:v(e).value.username,password:v(e).value.password},"onUpdate:modelValue":o[3]||(o[3]=a=>v(i)(a))},null,8,["model-value"])):we("",!0)])]))}});function aF(){const t=Rr(),e=qN,n=GN,r=Z(Or.EMPTY),i=Z(null),s=q(()=>t.pendingRequestData),o=q(()=>{var c,f,d;return((c=sg.find(h=>h.id===r.value))==null?void 0:c.autoFillable)===!0&&((d=(f=s.value)==null?void 0:f.schema)==null?void 0:d.shape)!==void 0}),a=()=>{var m,g,b;if(!s.value||r.value===Or.EMPTY)return null;const c=s.value.method,f=s.value.body,d=((m=f==null?void 0:f[c])==null?void 0:m[r.value])??null;if(d)return d;const h=(b=(g=s.value)==null?void 0:g.schema)==null?void 0:b.shape;if(!h)return null;const p=n(h);return Bx(p,r.value)},l=()=>{var d;const c=(d=s.value)==null?void 0:d.headers.find(h=>h.key==="Content-Type");if(!c)return;const f=sg.find(h=>h.mimeType===c.value);f&&(r.value=f.id)},u=()=>{var h;if(!s.value)return;const c=(h=s.value.schema)==null?void 0:h.shape;if(!c)return;const f=e(c),d=Bx(f,r.value);i.value=d};return nt(s,c=>{r.value=(c==null?void 0:c.payloadType)??Or.EMPTY,i.value=a()},{deep:!0,immediate:!0}),nt(r,c=>{if(s.value===null){i.value=a();return}i.value=a(),s.value.payloadType=c}),nt(i,()=>{if(!s.value)return;const c=s.value.method;s.value.body||(s.value.body={});const f=s.value.body;f[c]||(f[c]={}),f[c][r.value]=i.value},{deep:!0}),gn(()=>{l(),i.value=a()}),{payloadType:r,payload:i,pendingRequestData:s,supportsAutoFill:o,autofill:u,generateCurrentPayload:a,initializePayloadTypeFromHeaders:l,types:sg}}const lF={class:"px-panel from-warning/5 dark:from-warning/15 flex items-center justify-between border-b bg-gradient-to-tr to-transparent to-50% py-0.5"},uF={class:"flex items-center gap-2 text-xs"},cF={class:"px-1 py-2"},fF={class:"leading-3.5"},dF={class:"text-subtle-foreground mb-0"},hF={class:"to-background from-warning/10 dark:from-warning/15 flex h-full w-full flex-col gap-4 bg-gradient-to-bl to-40% p-3.5"},pF={class:"flex flex-col gap-3.5 text-sm wrap-anywhere"},mF={class:"border-b pb-3.5"},gF={class:"px-panel inline-flex items-center space-x-2 rounded border bg-white font-mono text-xs"},bF=z({__name:"ImplementationMissingWarning",setup(t){const e=Xi(),{copy:n,copied:r}=Co();return(i,s)=>(T(),K("div",lF,[M("div",uF,[M("div",cF,[k(v(H0),{class:"text-warning size-4"})]),M("div",fF,[s[0]||(s[0]=M("span",{class:"mb-0 flex items-center gap-1 font-bold"}," Route not found ",-1)),M("p",dF," This route is defined in the "+de(v(e).primaryProcessorName)+", but it is not found in your application ",1)])]),k(v(Cf),null,{default:D(()=>[k(v(cv),null,{default:D(()=>[k(v(gt),{size:"xs",variant:"ghost"},{default:D(()=>[k(v(av)),s[1]||(s[1]=ne(" Info ",-1))]),_:1})]),_:1}),k(v(Af),{class:"bg-background max-h-[90dvh] flex-col p-0 sm:max-w-[600px]"},{default:D(()=>[M("div",hF,[k(v(Df),null,{default:D(()=>[k(v(kf),null,{default:D(()=>[...s[2]||(s[2]=[ne("Route Not Found",-1)])]),_:1}),k(v(N0),null,{default:D(()=>[ne(" This route is defined in "+de(v(e).primaryProcessorName)+" but it cannot be found in the currently selected application's laravel routes. ",1)]),_:1})]),_:1}),M("div",pF,[s[6]||(s[6]=M("span",null,"Possible Solutions:",-1)),M("div",mF,[s[4]||(s[4]=M("h3",{class:"text-base font-bold"},"Clear routes cache",-1)),s[5]||(s[5]=M("p",{class:"mb-2"}," It might be that you switched to a new branch but your routes are cached. ",-1)),M("div",gF,[s[3]||(s[3]=M("code",{class:"flex-1"},"php artisan route:clear",-1)),k(nu,{"on-click":()=>v(n)("php artisan route:clear"),copied:v(r)},null,8,["on-click","copied"])])]),s[7]||(s[7]=M("div",null,[M("h3",{class:"text-base font-bold"},"Sync your branch"),M("p",{class:"text-sm"}," Your schema files might be out of sync with the current branch state, make sure to rebase with the main branch. ")],-1))]),k(v(ev),{class:"border-t pt-3.5 sm:justify-start"},{default:D(()=>[k(v(uv),{"as-child":""},{default:D(()=>[k(v(gt),{variant:"default",size:"xs"},{default:D(()=>[...s[8]||(s[8]=[ne("Dismiss",-1)])]),_:1})]),_:1})]),_:1})])]),_:1})]),_:1})]))}}),GA=z({__name:"DocumentationLinkButton",props:{class:{}},setup(t){return(e,n)=>(T(),L(v(gt),{size:"xs",as:"a",href:"https://github.com/sunchayn/nimbus/tree/base/wiki/user-guide",target:"_blank"},{default:D(()=>[k(v(EN)),n[0]||(n[0]=ne(" Documentation ",-1))]),_:1}))}}),yF={class:"px-panel flex items-center justify-between border-b bg-gradient-to-tr from-blue-500/5 to-transparent to-50% py-0.5 dark:from-blue-700/30"},vF={class:"flex items-center gap-2 text-xs"},xF={class:"px-1 py-2"},SF={class:"leading-3.5"},EF={class:"text-subtle-foreground mb-0"},wF={class:"to-background from-warning/10 dark:from-warning/15 flex h-full w-full flex-col gap-4 bg-gradient-to-bl to-40% p-3.5"},_F={class:"flex flex-col gap-3.5 text-sm wrap-anywhere"},CF=z({__name:"MissingRouteInPrimarySourceInfo",setup(t){const e=Xi();return(n,r)=>(T(),K("div",yF,[M("div",vF,[M("div",xF,[k(v(IA),{class:"size-4 text-blue-900 dark:text-blue-100"})]),M("div",SF,[r[0]||(r[0]=M("span",{class:"mb-0 flex items-center gap-1 font-bold"}," Route is auto-detected ",-1)),M("p",EF," This route is not defined in "+de(v(e).primaryProcessorName)+", but it was auto-detected and added. ",1)])]),k(v(Cf),null,{default:D(()=>[k(v(cv),null,{default:D(()=>[k(v(gt),{size:"xs",variant:"ghost"},{default:D(()=>[k(v(av)),r[1]||(r[1]=ne(" Info ",-1))]),_:1})]),_:1}),k(v(Af),{class:"bg-background max-h-[90dvh] flex-col p-0 sm:max-w-[600px]"},{default:D(()=>[M("div",wF,[k(v(Df),null,{default:D(()=>[k(v(kf),null,{default:D(()=>[...r[2]||(r[2]=[ne("Route is auto-detected",-1)])]),_:1})]),_:1}),M("p",_F,[ne(" This application is configured to use "+de(v(e).primaryProcessorName)+". However, this route is not defined there. It was auto-detected from your local routes and added accordingly. ",1),r[3]||(r[3]=M("br",null,null,-1)),M("small",null," This will help you test out routes without having to define them yet in the "+de(v(e).primaryProcessorName)+". ",1)]),M("div",null,[k(GA,{variant:"outline"})]),k(v(ev),{class:"border-t pt-3.5 sm:justify-start"},{default:D(()=>[k(v(uv),{"as-child":""},{default:D(()=>[k(v(gt),{variant:"default",size:"xs"},{default:D(()=>[...r[4]||(r[4]=[ne("Dismiss",-1)])]),_:1})]),_:1})]),_:1})])]),_:1})]),_:1})]))}}),AF={class:"dark:bg-subtle bg-destructive/10 max-w-full flex-1 overflow-auto p-2 leading-tight wrap-anywhere"},DF=["innerHTML"],kF=z({__name:"SchemaExtractionErrorButton",props:{errorHtml:{}},setup(t){return(e,n)=>(T(),L(v(Cf),null,{default:D(()=>[k(v(cv),null,{default:D(()=>[k(v(gt),{size:"xs",variant:"ghost"},{default:D(()=>[k(v(av)),n[0]||(n[0]=ne(" Error Info ",-1))]),_:1})]),_:1}),k(v(Af),{class:"to-background from-destructive/10 dark:from-destructive/15 flex max-h-[90dvh] flex-col bg-gradient-to-bl to-50% sm:max-w-[600px]"},{default:D(()=>[k(v(Df),null,{default:D(()=>[k(v(kf),null,{default:D(()=>[...n[1]||(n[1]=[ne("Schema Extraction Error",-1)])]),_:1}),k(v(N0),null,{default:D(()=>[...n[2]||(n[2]=[ne(" The following error was thrown when trying to call the `rules()` method from the request. ",-1)])]),_:1})]),_:1}),M("div",AF,[M("p",{innerHTML:t.errorHtml},null,8,DF)]),n[4]||(n[4]=M("p",{class:"text-xs italic"}," Note: An attempt to understand the schema statically (from the code as is) was made. The schema might not be complete. ",-1)),k(v(ev),{class:"sm:justify-start"},{default:D(()=>[k(v(uv),{"as-child":""},{default:D(()=>[k(v(gt),{variant:"secondary"},{default:D(()=>[...n[3]||(n[3]=[ne("Dismiss",-1)])]),_:1})]),_:1})]),_:1})]),_:1})]),_:1}))}}),OF={class:"px-panel from-destructive/5 dark:from-destructive/15 flex items-center justify-between border-b bg-gradient-to-tr to-transparent to-50% py-0.5"},TF={class:"flex items-center gap-2 text-xs"},IF={class:"px-1 py-2"},PF=z({__name:"RouteExtractionError",props:{extractionError:{}},setup(t){const e=t;return(n,r)=>(T(),K("div",OF,[M("div",TF,[M("div",IF,[k(v(H0),{class:"text-destructive size-4"})]),r[0]||(r[0]=M("div",{class:"leading-3.5"},[M("span",{class:"flex items-center gap-1 font-bold"},"Extraction Error"),M("p",{class:"text-subtle-foreground mb-0"}," It wasn't possible to fully extract the shape of this route, there was an error. ")],-1))]),k(kF,{"error-html":e.extractionError},null,8,["error-html"])]))}}),RF=z({__name:"AppScrollBar",props:{class:{default:void 0},orientation:{default:"vertical"},forceMount:{type:Boolean},asChild:{type:Boolean},as:{}},setup(t){const e=t,n=Aa(e,"class");return(r,i)=>(T(),L(v(sR),Ce({"data-slot":"scroll-area-scrollbar"},v(n),{class:v(ke)("flex touch-none p-px transition-colors select-none",t.orientation==="vertical"&&"h-full w-2.5 border-l border-l-transparent",t.orientation==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent",e.class)}),{default:D(()=>[k(v(cR),{"data-slot":"scroll-area-thumb",class:"relative flex-1 rounded-full bg-gray-400 dark:bg-gray-600"})]),_:1},16,["class"]))}}),If=z({__name:"AppScrollArea",props:{class:{},type:{},dir:{},scrollHideDelay:{},asChild:{type:Boolean},as:{}},setup(t,{expose:e}){const n=t,r=Aa(n,"class"),i=Z(null);return e({viewport:i}),(s,o)=>(T(),L(v(j5),Ce({"data-slot":"scroll-area"},v(r),{class:v(ke)("relative",n.class)}),{default:D(()=>[k(v(dR),{ref_key:"viewport",ref:i,"data-slot":"scroll-area-viewport",class:"focus-visible:ring-ring/50 size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:outline-1 [&>div]:h-full"},{default:D(()=>[Q(s.$slots,"default")]),_:3},512),k(RF),k(v(q5))]),_:3},16,["class"]))}}),NF=z({__name:"RequestBodyFormData",props:{modelValue:{default:()=>null},modelModifiers:{}},emits:Da(["update:modelValue"],["update:modelValue"]),setup(t,{emit:e}){const n=e,r=Ki(t,"modelValue"),i=Z(!1),s=Z([]);function o(u){const c=new FormData;for(const f of u){if(f.value===null){c.set(f.key,"");continue}if(f.value instanceof Blob){c.set(f.key,f.value);continue}c.set(f.key,String(f.value))}return c}function a(u){const c=[];return u.forEach((f,d)=>{if(f instanceof File){c.push({type:_r.File,key:d,value:f.name,enabled:!0});return}c.push({type:_r.Text,key:d,value:f,enabled:!0})}),c}const l=u=>{i.value=!0,s.value=u,n("update:modelValue",o(u))};return nt(r,u=>{u!==null&&(i.value||(s.value=u instanceof FormData?a(u):[],kr(()=>{i.value=!1})))},{deep:!0}),(u,c)=>(T(),L(fv,{"model-value":s.value,"free-form-types":!0,"onUpdate:parameters":l},null,8,["model-value"]))}}),MF={class:"flex flex-col"},FF=z({__name:"RequestBodyFormNone",emits:["update:modelValue"],setup(t,{emit:e}){const n=e;return gn(()=>n("update:modelValue",null)),(r,i)=>(T(),L(v(Qy),{class:"border-b shadow-none"},{default:D(()=>[k(v(dv),{class:"items-start"},{default:D(()=>[k(v(yN),{class:"size-5 min-w-5"}),M("div",MF,[k(v(pp),null,{default:D(()=>[...i[0]||(i[0]=[ne("No Body",-1)])]),_:1}),k(v(hp),null,{default:D(()=>[...i[1]||(i[1]=[ne(" You're performing the request without a Payload. ",-1)])]),_:1})])]),_:1})]),_:1}))}});let eb=[],WA=[];(()=>{let t="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(e=>e?parseInt(e,36):1);for(let e=0,n=0;e>1;if(t=WA[r])e=r+1;else return!0;if(e==n)return!1}}function jx(t){return t>=127462&&t<=127487}const Vx=8205;function BF(t,e,n=!0,r=!0){return(n?KA:$F)(t,e,r)}function KA(t,e,n){if(e==t.length)return e;e&&XA(t.charCodeAt(e))&&YA(t.charCodeAt(e-1))&&e--;let r=fg(t,e);for(e+=Ux(r);e=0&&jx(fg(t,o));)s++,o-=2;if(s%2==0)break;e+=2}else break}return e}function $F(t,e,n){for(;e>0;){let r=KA(t,e-2,n);if(r=56320&&t<57344}function YA(t){return t>=55296&&t<56320}function Ux(t){return t<65536?1:2}class Ze{lineAt(e){if(e<0||e>this.length)throw new RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw new RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,n,r){[e,n]=Dl(this,e,n);let i=[];return this.decompose(0,e,i,2),r.length&&r.decompose(0,r.length,i,3),this.decompose(n,this.length,i,1),Ai.from(i,this.length-(n-e)+r.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,n=this.length){[e,n]=Dl(this,e,n);let r=[];return this.decompose(e,n,r,0),Ai.from(r,n-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let n=this.scanIdentical(e,1),r=this.length-this.scanIdentical(e,-1),i=new lc(this),s=new lc(e);for(let o=n,a=n;;){if(i.next(o),s.next(o),o=0,i.lineBreak!=s.lineBreak||i.done!=s.done||i.value!=s.value)return!1;if(a+=i.value.length,i.done||a>=r)return!0}}iter(e=1){return new lc(this,e)}iterRange(e,n=this.length){return new JA(this,e,n)}iterLines(e,n){let r;if(e==null)r=this.iter();else{n==null&&(n=this.lines+1);let i=this.line(e).from;r=this.iterRange(i,Math.max(i,n==this.lines+1?this.length:n<=1?0:this.line(n-1).to))}return new ZA(r)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(e){if(e.length==0)throw new RangeError("A document must have at least one line");return e.length==1&&!e[0]?Ze.empty:e.length<=32?new Ht(e):Ai.from(Ht.split(e,[]))}}class Ht extends Ze{constructor(e,n=zF(e)){super(),this.text=e,this.length=n}get lines(){return this.text.length}get children(){return null}lineInner(e,n,r,i){for(let s=0;;s++){let o=this.text[s],a=i+o.length;if((n?r:a)>=e)return new jF(i,a,r,o);i=a+1,r++}}decompose(e,n,r,i){let s=e<=0&&n>=this.length?this:new Ht(Hx(this.text,e,n),Math.min(n,this.length)-Math.max(0,e));if(i&1){let o=r.pop(),a=_h(s.text,o.text.slice(),0,s.length);if(a.length<=32)r.push(new Ht(a,o.length+s.length));else{let l=a.length>>1;r.push(new Ht(a.slice(0,l)),new Ht(a.slice(l)))}}else r.push(s)}replace(e,n,r){if(!(r instanceof Ht))return super.replace(e,n,r);[e,n]=Dl(this,e,n);let i=_h(this.text,_h(r.text,Hx(this.text,0,e)),n),s=this.length+r.length-(n-e);return i.length<=32?new Ht(i,s):Ai.from(Ht.split(i,[]),s)}sliceString(e,n=this.length,r=` `){[e,n]=Dl(this,e,n);let i="";for(let s=0,o=0;s<=n&&oe&&o&&(i+=r),es&&(i+=a.slice(Math.max(0,e-s),n-s)),s=l+1}return i}flatten(e){for(let n of this.text)e.push(n)}scanIdentical(){return 0}static split(e,n){let r=[],i=-1;for(let s of e)r.push(s),i+=s.length+1,r.length==32&&(n.push(new Ht(r,i)),r=[],i=-1);return i>-1&&n.push(new Ht(r,i)),n}}class Ai extends Ze{constructor(e,n){super(),this.children=e,this.length=n,this.lines=0;for(let r of e)this.lines+=r.lines}lineInner(e,n,r,i){for(let s=0;;s++){let o=this.children[s],a=i+o.length,l=r+o.lines-1;if((n?l:a)>=e)return o.lineInner(e,n,r,i);i=a+1,r=l+1}}decompose(e,n,r,i){for(let s=0,o=0;o<=n&&s=o){let u=i&((o<=e?1:0)|(l>=n?2:0));o>=e&&l<=n&&!u?r.push(a):a.decompose(e-o,n-o,r,u)}o=l+1}}replace(e,n,r){if([e,n]=Dl(this,e,n),r.lines=s&&n<=a){let l=o.replace(e-s,n-s,r),u=this.lines-o.lines+l.lines;if(l.lines>4&&l.lines>u>>6){let c=this.children.slice();return c[i]=l,new Ai(c,this.length-(n-e)+r.length)}return super.replace(s,a,l)}s=a+1}return super.replace(e,n,r)}sliceString(e,n=this.length,r=` -`){[e,n]=Dl(this,e,n);let i="";for(let s=0,o=0;se&&s&&(i+=r),eo&&(i+=a.sliceString(e-o,n-o,r)),o=l+1}return i}flatten(e){for(let n of this.children)n.flatten(e)}scanIdentical(e,n){if(!(e instanceof Ai))return 0;let r=0,[i,s,o,a]=n>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;i+=n,s+=n){if(i==o||s==a)return r;let l=this.children[i],u=e.children[s];if(l!=u)return r+l.scanIdentical(u,n);r+=l.length+1}}static from(e,n=e.reduce((r,i)=>r+i.length+1,-1)){let r=0;for(let h of e)r+=h.lines;if(r<32){let h=[];for(let p of e)p.flatten(h);return new Ht(h,n)}let i=Math.max(32,r>>5),s=i<<1,o=i>>1,a=[],l=0,u=-1,c=[];function f(h){let p;if(h.lines>s&&h instanceof Ai)for(let m of h.children)f(m);else h.lines>o&&(l>o||!l)?(d(),a.push(h)):h instanceof Ht&&l&&(p=c[c.length-1])instanceof Ht&&h.lines+p.lines<=32?(l+=h.lines,u+=h.length+1,c[c.length-1]=new Ht(p.text.concat(h.text),p.length+1+h.length)):(l+h.lines>i&&d(),l+=h.lines,u+=h.length+1,c.push(h))}function d(){l!=0&&(a.push(c.length==1?c[0]:Ai.from(c,u)),u=-1,l=c.length=0)}for(let h of e)f(h);return d(),a.length==1?a[0]:new Ai(a,n)}}Ze.empty=new Ht([""],0);function BF(t){let e=-1;for(let n of t)e+=n.length+1;return e}function wh(t,e,n=0,r=1e9){for(let i=0,s=0,o=!0;s=n&&(l>r&&(a=a.slice(0,r-i)),i0?1:(e instanceof Ht?e.text.length:e.children.length)<<1]}nextInner(e,n){for(this.done=this.lineBreak=!1;;){let r=this.nodes.length-1,i=this.nodes[r],s=this.offsets[r],o=s>>1,a=i instanceof Ht?i.text.length:i.children.length;if(o==(n>0?a:0)){if(r==0)return this.done=!0,this.value="",this;n>0&&this.offsets[r-1]++,this.nodes.pop(),this.offsets.pop()}else if((s&1)==(n>0?0:1)){if(this.offsets[r]+=n,e==0)return this.lineBreak=!0,this.value=` -`,this;e--}else if(i instanceof Ht){let l=i.text[o+(n<0?-1:0)];if(this.offsets[r]+=n,l.length>Math.max(0,e))return this.value=e==0?l:n>0?l.slice(e):l.slice(0,l.length-e),this;e-=l.length}else{let l=i.children[o+(n<0?-1:0)];e>l.length?(e-=l.length,this.offsets[r]+=n):(n<0&&this.offsets[r]--,this.nodes.push(l),this.offsets.push(n>0?1:(l instanceof Ht?l.text.length:l.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}class YA{constructor(e,n,r){this.value="",this.done=!1,this.cursor=new lc(e,n>r?-1:1),this.pos=n>r?e.length:0,this.from=Math.min(n,r),this.to=Math.max(n,r)}nextInner(e,n){if(n<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;e+=Math.max(0,n<0?this.pos-this.to:this.from-this.pos);let r=n<0?this.pos-this.from:this.to-this.pos;e>r&&(e=r),r-=e;let{value:i}=this.cursor.next(e);return this.pos+=(i.length+e)*n,this.value=i.length<=r?i:n<0?i.slice(i.length-r):i.slice(0,r),this.done=!this.value,this}next(e=0){return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=""}}class JA{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:n,lineBreak:r,value:i}=this.inner.next(e);return n&&this.afterBreak?(this.value="",this.afterBreak=!1):n?(this.done=!0,this.value=""):r?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=i,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol<"u"&&(Ze.prototype[Symbol.iterator]=function(){return this.iter()},lc.prototype[Symbol.iterator]=YA.prototype[Symbol.iterator]=JA.prototype[Symbol.iterator]=function(){return this});class $F{constructor(e,n,r,i){this.from=e,this.to=n,this.number=r,this.text=i}get length(){return this.to-this.from}}function Dl(t,e,n){return e=Math.max(0,Math.min(t.length,e)),[e,Math.max(e,Math.min(t.length,n))]}function wn(t,e,n=!0,r=!0){return FF(t,e,n,r)}function zF(t){return t>=56320&&t<57344}function jF(t){return t>=55296&&t<56320}function ir(t,e){let n=t.charCodeAt(e);if(!jF(n)||e+1==t.length)return n;let r=t.charCodeAt(e+1);return zF(r)?(n-55296<<10)+(r-56320)+65536:n}function dv(t){return t<=65535?String.fromCharCode(t):(t-=65536,String.fromCharCode((t>>10)+55296,(t&1023)+56320))}function Di(t){return t<65536?1:2}const eb=/\r\n?|\n/;var En=(function(t){return t[t.Simple=0]="Simple",t[t.TrackDel=1]="TrackDel",t[t.TrackBefore=2]="TrackBefore",t[t.TrackAfter=3]="TrackAfter",t})(En||(En={}));class Li{constructor(e){this.sections=e}get length(){let e=0;for(let n=0;ne)return s+(e-i);s+=a}else{if(r!=En.Simple&&u>=e&&(r==En.TrackDel&&ie||r==En.TrackBefore&&ie))return null;if(u>e||u==e&&n<0&&!a)return e==i||n<0?s:s+l;s+=l}i=u}if(e>i)throw new RangeError(`Position ${e} is out of range for changeset of length ${i}`);return s}touchesRange(e,n=e){for(let r=0,i=0;r=0&&i<=n&&a>=e)return in?"cover":!0;i=a}return!1}toString(){let e="";for(let n=0;n=0?":"+i:"")}return e}toJSON(){return this.sections}static fromJSON(e){if(!Array.isArray(e)||e.length%2||e.some(n=>typeof n!="number"))throw new RangeError("Invalid JSON representation of ChangeDesc");return new Li(e)}static create(e){return new Li(e)}}class sn extends Li{constructor(e,n){super(e),this.inserted=n}apply(e){if(this.length!=e.length)throw new RangeError("Applying change set to a document with the wrong length");return tb(this,(n,r,i,s,o)=>e=e.replace(i,i+(r-n),o),!1),e}mapDesc(e,n=!1){return nb(this,e,n,!0)}invert(e){let n=this.sections.slice(),r=[];for(let i=0,s=0;i=0){n[i]=a,n[i+1]=o;let l=i>>1;for(;r.length0&&Gs(r,n,s.text),s.forward(c),a+=c}let u=e[o++];for(;a>1].toJSON()))}return e}static of(e,n,r){let i=[],s=[],o=0,a=null;function l(c=!1){if(!c&&!i.length)return;od||f<0||d>n)throw new RangeError(`Invalid change range ${f} to ${d} (in doc of length ${n})`);let p=h?typeof h=="string"?Ze.of(h.split(r||eb)):h:Ze.empty,m=p.length;if(f==d&&m==0)return;fo&&On(i,f-o,-1),On(i,d-f,m),Gs(s,i,p),o=d}}return u(e),l(!a),a}static empty(e){return new sn(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw new RangeError("Invalid JSON representation of ChangeSet");let n=[],r=[];for(let i=0;ia&&typeof o!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(s.length==1)n.push(s[0],0);else{for(;r.length=0&&n<=0&&n==t[i+1]?t[i]+=e:i>=0&&e==0&&t[i]==0?t[i+1]+=n:r?(t[i]+=e,t[i+1]+=n):t.push(e,n)}function Gs(t,e,n){if(n.length==0)return;let r=e.length-2>>1;if(r>1])),!(n||o==t.sections.length||t.sections[o+1]<0);)a=t.sections[o++],l=t.sections[o++];e(i,u,s,c,f),i=u,s=c}}}function nb(t,e,n,r=!1){let i=[],s=r?[]:null,o=new Nc(t),a=new Nc(e);for(let l=-1;;){if(o.done&&a.len||a.done&&o.len)throw new Error("Mismatched change set lengths");if(o.ins==-1&&a.ins==-1){let u=Math.min(o.len,a.len);On(i,u,-1),o.forward(u),a.forward(u)}else if(a.ins>=0&&(o.ins<0||l==o.i||o.off==0&&(a.len=0&&l=0){let u=0,c=o.len;for(;c;)if(a.ins==-1){let f=Math.min(c,a.len);u+=f,c-=f,a.forward(f)}else if(a.ins==0&&a.lenl||o.ins>=0&&o.len>l)&&(a||r.length>u),s.forward2(l),o.forward(l)}}}}class Nc{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i>1;return n>=e.length?Ze.empty:e[n]}textBit(e){let{inserted:n}=this.set,r=this.i-2>>1;return r>=n.length&&!e?Ze.empty:n[r].slice(this.off,e==null?void 0:this.off+e)}forward(e){e==this.len?this.next():(this.len-=e,this.off+=e)}forward2(e){this.ins==-1?this.forward(e):e==this.ins?this.next():(this.ins-=e,this.off+=e)}}class Ho{constructor(e,n,r){this.from=e,this.to=n,this.flags=r}get anchor(){return this.flags&32?this.to:this.from}get head(){return this.flags&32?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return this.flags&8?-1:this.flags&16?1:0}get bidiLevel(){let e=this.flags&7;return e==7?null:e}get goalColumn(){let e=this.flags>>6;return e==16777215?void 0:e}map(e,n=-1){let r,i;return this.empty?r=i=e.mapPos(this.from,n):(r=e.mapPos(this.from,1),i=e.mapPos(this.to,-1)),r==this.from&&i==this.to?this:new Ho(r,i,this.flags)}extend(e,n=e){if(e<=this.anchor&&n>=this.anchor)return Y.range(e,n);let r=Math.abs(e-this.anchor)>Math.abs(n-this.anchor)?e:n;return Y.range(this.anchor,r)}eq(e,n=!1){return this.anchor==e.anchor&&this.head==e.head&&(!n||!this.empty||this.assoc==e.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(e){if(!e||typeof e.anchor!="number"||typeof e.head!="number")throw new RangeError("Invalid JSON representation for SelectionRange");return Y.range(e.anchor,e.head)}static create(e,n,r){return new Ho(e,n,r)}}class Y{constructor(e,n){this.ranges=e,this.mainIndex=n}map(e,n=-1){return e.empty?this:Y.create(this.ranges.map(r=>r.map(e,n)),this.mainIndex)}eq(e,n=!1){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let r=0;re.toJSON()),main:this.mainIndex}}static fromJSON(e){if(!e||!Array.isArray(e.ranges)||typeof e.main!="number"||e.main>=e.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new Y(e.ranges.map(n=>Ho.fromJSON(n)),e.main)}static single(e,n=e){return new Y([Y.range(e,n)],0)}static create(e,n=0){if(e.length==0)throw new RangeError("A selection needs at least one range");for(let r=0,i=0;ie?8:0)|s)}static normalized(e,n=0){let r=e[n];e.sort((i,s)=>i.from-s.from),n=e.indexOf(r);for(let i=1;is.head?Y.range(l,a):Y.range(a,l))}}return new Y(e,n)}}function QA(t,e){for(let n of t.ranges)if(n.to>e)throw new RangeError("Selection points outside of document")}let hv=0;class he{constructor(e,n,r,i,s){this.combine=e,this.compareInput=n,this.compare=r,this.isStatic=i,this.id=hv++,this.default=e([]),this.extensions=typeof s=="function"?s(this):s}get reader(){return this}static define(e={}){return new he(e.combine||(n=>n),e.compareInput||((n,r)=>n===r),e.compare||(e.combine?(n,r)=>n===r:pv),!!e.static,e.enables)}of(e){return new _h([],this,0,e)}compute(e,n){if(this.isStatic)throw new Error("Can't compute a static facet");return new _h(e,this,1,n)}computeN(e,n){if(this.isStatic)throw new Error("Can't compute a static facet");return new _h(e,this,2,n)}from(e,n){return n||(n=r=>r),this.compute([e],r=>n(r.field(e)))}}function pv(t,e){return t==e||t.length==e.length&&t.every((n,r)=>n===e[r])}class _h{constructor(e,n,r,i){this.dependencies=e,this.facet=n,this.type=r,this.value=i,this.id=hv++}dynamicSlot(e){var n;let r=this.value,i=this.facet.compareInput,s=this.id,o=e[s]>>1,a=this.type==2,l=!1,u=!1,c=[];for(let f of this.dependencies)f=="doc"?l=!0:f=="selection"?u=!0:(((n=e[f.id])!==null&&n!==void 0?n:1)&1)==0&&c.push(e[f.id]);return{create(f){return f.values[o]=r(f),1},update(f,d){if(l&&d.docChanged||u&&(d.docChanged||d.selection)||rb(f,c)){let h=r(f);if(a?!Hx(h,f.values[o],i):!i(h,f.values[o]))return f.values[o]=h,1}return 0},reconfigure:(f,d)=>{let h,p=d.config.address[s];if(p!=null){let m=mp(d,p);if(this.dependencies.every(g=>g instanceof he?d.facet(g)===f.facet(g):g instanceof Wt?d.field(g,!1)==f.field(g,!1):!0)||(a?Hx(h=r(f),m,i):i(h=r(f),m)))return f.values[o]=m,0}else h=r(f);return f.values[o]=h,1}}}}function Hx(t,e,n){if(t.length!=e.length)return!1;for(let r=0;rt[l.id]),i=n.map(l=>l.type),s=r.filter(l=>!(l&1)),o=t[e.id]>>1;function a(l){let u=[];for(let c=0;cr===i),e);return e.provide&&(n.provides=e.provide(n)),n}create(e){let n=e.facet(vd).find(r=>r.field==this);return((n==null?void 0:n.create)||this.createF)(e)}slot(e){let n=e[this.id]>>1;return{create:r=>(r.values[n]=this.create(r),1),update:(r,i)=>{let s=r.values[n],o=this.updateF(s,i);return this.compareF(s,o)?0:(r.values[n]=o,1)},reconfigure:(r,i)=>{let s=r.facet(vd),o=i.facet(vd),a;return(a=s.find(l=>l.field==this))&&a!=o.find(l=>l.field==this)?(r.values[n]=a.create(r),1):i.config.address[this.id]!=null?(r.values[n]=i.field(this),0):(r.values[n]=this.create(r),1)}}}init(e){return[this,vd.of({field:this,create:e})]}get extension(){return this}}const Bo={lowest:4,low:3,default:2,high:1,highest:0};function Ou(t){return e=>new eD(e,t)}const Co={highest:Ou(Bo.highest),high:Ou(Bo.high),default:Ou(Bo.default),low:Ou(Bo.low),lowest:Ou(Bo.lowest)};class eD{constructor(e,n){this.inner=e,this.prec=n}}class If{of(e){return new ib(this,e)}reconfigure(e){return If.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class ib{constructor(e,n){this.compartment=e,this.inner=n}}class pp{constructor(e,n,r,i,s,o){for(this.base=e,this.compartments=n,this.dynamicSlots=r,this.address=i,this.staticValues=s,this.facets=o,this.statusTemplate=[];this.statusTemplate.length>1]}static resolve(e,n,r){let i=[],s=Object.create(null),o=new Map;for(let d of UF(e,n,o))d instanceof Wt?i.push(d):(s[d.facet.id]||(s[d.facet.id]=[])).push(d);let a=Object.create(null),l=[],u=[];for(let d of i)a[d.id]=u.length<<1,u.push(h=>d.slot(h));let c=r==null?void 0:r.config.facets;for(let d in s){let h=s[d],p=h[0].facet,m=c&&c[d]||[];if(h.every(g=>g.type==0))if(a[p.id]=l.length<<1|1,pv(m,h))l.push(r.facet(p));else{let g=p.combine(h.map(b=>b.value));l.push(r&&p.compare(g,r.facet(p))?r.facet(p):g)}else{for(let g of h)g.type==0?(a[g.id]=l.length<<1|1,l.push(g.value)):(a[g.id]=u.length<<1,u.push(b=>g.dynamicSlot(b)));a[p.id]=u.length<<1,u.push(g=>VF(g,p,h))}}let f=u.map(d=>d(a));return new pp(e,o,f,a,l,s)}}function UF(t,e,n){let r=[[],[],[],[],[]],i=new Map;function s(o,a){let l=i.get(o);if(l!=null){if(l<=a)return;let u=r[l].indexOf(o);u>-1&&r[l].splice(u,1),o instanceof ib&&n.delete(o.compartment)}if(i.set(o,a),Array.isArray(o))for(let u of o)s(u,a);else if(o instanceof ib){if(n.has(o.compartment))throw new RangeError("Duplicate use of compartment in extensions");let u=e.get(o.compartment)||o.inner;n.set(o.compartment,u),s(u,a)}else if(o instanceof eD)s(o.inner,o.prec);else if(o instanceof Wt)r[a].push(o),o.provides&&s(o.provides,a);else if(o instanceof _h)r[a].push(o),o.facet.extensions&&s(o.facet.extensions,Bo.default);else{let u=o.extension;if(!u)throw new Error(`Unrecognized extension value in extension set (${o}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);s(u,a)}}return s(t,Bo.default),r.reduce((o,a)=>o.concat(a))}function uc(t,e){if(e&1)return 2;let n=e>>1,r=t.status[n];if(r==4)throw new Error("Cyclic dependency between fields and/or facets");if(r&2)return r;t.status[n]=4;let i=t.computeSlot(t,t.config.dynamicSlots[n]);return t.status[n]=2|i}function mp(t,e){return e&1?t.config.staticValues[e>>1]:t.values[e>>1]}const tD=he.define(),sb=he.define({combine:t=>t.some(e=>e),static:!0}),nD=he.define({combine:t=>t.length?t[0]:void 0,static:!0}),rD=he.define(),iD=he.define(),sD=he.define(),oD=he.define({combine:t=>t.length?t[0]:!1});class As{constructor(e,n){this.type=e,this.value=n}static define(){return new HF}}class HF{of(e){return new As(this,e)}}class qF{constructor(e){this.map=e}of(e){return new De(this,e)}}class De{constructor(e,n){this.type=e,this.value=n}map(e){let n=this.type.map(this.value,e);return n===void 0?void 0:n==this.value?this:new De(this.type,n)}is(e){return this.type==e}static define(e={}){return new qF(e.map||(n=>n))}static mapEffects(e,n){if(!e.length)return e;let r=[];for(let i of e){let s=i.map(n);s&&r.push(s)}return r}}De.reconfigure=De.define();De.appendConfig=De.define();class Qt{constructor(e,n,r,i,s,o){this.startState=e,this.changes=n,this.selection=r,this.effects=i,this.annotations=s,this.scrollIntoView=o,this._doc=null,this._state=null,r&&QA(r,n.newLength),s.some(a=>a.type==Qt.time)||(this.annotations=s.concat(Qt.time.of(Date.now())))}static create(e,n,r,i,s,o){return new Qt(e,n,r,i,s,o)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(e){for(let n of this.annotations)if(n.type==e)return n.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(e){let n=this.annotation(Qt.userEvent);return!!(n&&(n==e||n.length>e.length&&n.slice(0,e.length)==e&&n[e.length]=="."))}}Qt.time=As.define();Qt.userEvent=As.define();Qt.addToHistory=As.define();Qt.remote=As.define();function GF(t,e){let n=[];for(let r=0,i=0;;){let s,o;if(r=t[r]))s=t[r++],o=t[r++];else if(i=0;i--){let s=r[i](t);s instanceof Qt?t=s:Array.isArray(s)&&s.length==1&&s[0]instanceof Qt?t=s[0]:t=lD(e,ul(s),!1)}return t}function KF(t){let e=t.startState,n=e.facet(sD),r=t;for(let i=n.length-1;i>=0;i--){let s=n[i](t);s&&Object.keys(s).length&&(r=aD(r,ob(e,s,t.changes.newLength),!0))}return r==t?t:Qt.create(e,t.changes,t.selection,r.effects,r.annotations,r.scrollIntoView)}const XF=[];function ul(t){return t==null?XF:Array.isArray(t)?t:[t]}var kt=(function(t){return t[t.Word=0]="Word",t[t.Space=1]="Space",t[t.Other=2]="Other",t})(kt||(kt={}));const YF=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let ab;try{ab=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function JF(t){if(ab)return ab.test(t);for(let e=0;e"€"&&(n.toUpperCase()!=n.toLowerCase()||YF.test(n)))return!0}return!1}function ZF(t){return e=>{if(!/\S/.test(e))return kt.Space;if(JF(e))return kt.Word;for(let n=0;n-1)return kt.Word;return kt.Other}}class Ue{constructor(e,n,r,i,s,o){this.config=e,this.doc=n,this.selection=r,this.values=i,this.status=e.statusTemplate.slice(),this.computeSlot=s,o&&(o._state=this);for(let a=0;ai.set(u,l)),n=null),i.set(a.value.compartment,a.value.extension)):a.is(De.reconfigure)?(n=null,r=a.value):a.is(De.appendConfig)&&(n=null,r=ul(r).concat(a.value));let s;n?s=e.startState.values.slice():(n=pp.resolve(r,i,this),s=new Ue(n,this.doc,this.selection,n.dynamicSlots.map(()=>null),(l,u)=>u.reconfigure(l,this),null).values);let o=e.startState.facet(sb)?e.newSelection:e.newSelection.asSingle();new Ue(n,e.newDoc,o,s,(a,l)=>l.update(a,e),e)}replaceSelection(e){return typeof e=="string"&&(e=this.toText(e)),this.changeByRange(n=>({changes:{from:n.from,to:n.to,insert:e},range:Y.cursor(n.from+e.length)}))}changeByRange(e){let n=this.selection,r=e(n.ranges[0]),i=this.changes(r.changes),s=[r.range],o=ul(r.effects);for(let a=1;ao.spec.fromJSON(a,l)))}}return Ue.create({doc:e.doc,selection:Y.fromJSON(e.selection),extensions:n.extensions?i.concat([n.extensions]):i})}static create(e={}){let n=pp.resolve(e.extensions||[],new Map),r=e.doc instanceof Ze?e.doc:Ze.of((e.doc||"").split(n.staticFacet(Ue.lineSeparator)||eb)),i=e.selection?e.selection instanceof Y?e.selection:Y.single(e.selection.anchor,e.selection.head):Y.single(0);return QA(i,r.length),n.staticFacet(sb)||(i=i.asSingle()),new Ue(n,r,i,n.dynamicSlots.map(()=>null),(s,o)=>o.create(s),null)}get tabSize(){return this.facet(Ue.tabSize)}get lineBreak(){return this.facet(Ue.lineSeparator)||` -`}get readOnly(){return this.facet(oD)}phrase(e,...n){for(let r of this.facet(Ue.phrases))if(Object.prototype.hasOwnProperty.call(r,e)){e=r[e];break}return n.length&&(e=e.replace(/\$(\$|\d*)/g,(r,i)=>{if(i=="$")return"$";let s=+(i||1);return!s||s>n.length?r:n[s-1]})),e}languageDataAt(e,n,r=-1){let i=[];for(let s of this.facet(tD))for(let o of s(this,n,r))Object.prototype.hasOwnProperty.call(o,e)&&i.push(o[e]);return i}charCategorizer(e){return ZF(this.languageDataAt("wordChars",e).join(""))}wordAt(e){let{text:n,from:r,length:i}=this.doc.lineAt(e),s=this.charCategorizer(e),o=e-r,a=e-r;for(;o>0;){let l=wn(n,o,!1);if(s(n.slice(l,o))!=kt.Word)break;o=l}for(;at.length?t[0]:4});Ue.lineSeparator=nD;Ue.readOnly=oD;Ue.phrases=he.define({compare(t,e){let n=Object.keys(t),r=Object.keys(e);return n.length==r.length&&n.every(i=>t[i]==e[i])}});Ue.languageData=tD;Ue.changeFilter=rD;Ue.transactionFilter=iD;Ue.transactionExtender=sD;If.reconfigure=De.define();function fi(t,e,n={}){let r={};for(let i of t)for(let s of Object.keys(i)){let o=i[s],a=r[s];if(a===void 0)r[s]=o;else if(!(a===o||o===void 0))if(Object.hasOwnProperty.call(n,s))r[s]=n[s](a,o);else throw new Error("Config merge conflict for field "+s)}for(let i in e)r[i]===void 0&&(r[i]=e[i]);return r}class ua{eq(e){return this==e}range(e,n=e){return lb.create(e,n,this)}}ua.prototype.startSide=ua.prototype.endSide=0;ua.prototype.point=!1;ua.prototype.mapMode=En.TrackDel;let lb=class uD{constructor(e,n,r){this.from=e,this.to=n,this.value=r}static create(e,n,r){return new uD(e,n,r)}};function ub(t,e){return t.from-e.from||t.value.startSide-e.value.startSide}class mv{constructor(e,n,r,i){this.from=e,this.to=n,this.value=r,this.maxPoint=i}get length(){return this.to[this.to.length-1]}findIndex(e,n,r,i=0){let s=r?this.to:this.from;for(let o=i,a=s.length;;){if(o==a)return o;let l=o+a>>1,u=s[l]-e||(r?this.value[l].endSide:this.value[l].startSide)-n;if(l==o)return u>=0?o:a;u>=0?a=l:o=l+1}}between(e,n,r,i){for(let s=this.findIndex(n,-1e9,!0),o=this.findIndex(r,1e9,!1,s);sh||d==h&&u.startSide>0&&u.endSide<=0)continue;(h-d||u.endSide-u.startSide)<0||(o<0&&(o=d),u.point&&(a=Math.max(a,h-d)),r.push(u),i.push(d-o),s.push(h-o))}return{mapped:r.length?new mv(i,s,r,a):null,pos:o}}}class Xe{constructor(e,n,r,i){this.chunkPos=e,this.chunk=n,this.nextLayer=r,this.maxPoint=i}static create(e,n,r,i){return new Xe(e,n,r,i)}get length(){let e=this.chunk.length-1;return e<0?0:Math.max(this.chunkEnd(e),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let e=this.nextLayer.size;for(let n of this.chunk)e+=n.value.length;return e}chunkEnd(e){return this.chunkPos[e]+this.chunk[e].length}update(e){let{add:n=[],sort:r=!1,filterFrom:i=0,filterTo:s=this.length}=e,o=e.filter;if(n.length==0&&!o)return this;if(r&&(n=n.slice().sort(ub)),this.isEmpty)return n.length?Xe.of(n):this;let a=new cD(this,null,-1).goto(0),l=0,u=[],c=new _s;for(;a.value||l=0){let f=n[l++];c.addInner(f.from,f.to,f.value)||u.push(f)}else a.rangeIndex==1&&a.chunkIndexthis.chunkEnd(a.chunkIndex)||sa.to||s=s&&e<=s+o.length&&o.between(s,e-s,n-s,r)===!1)return}this.nextLayer.between(e,n,r)}}iter(e=0){return Mc.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,n=0){return Mc.from(e).goto(n)}static compare(e,n,r,i,s=-1){let o=e.filter(f=>f.maxPoint>0||!f.isEmpty&&f.maxPoint>=s),a=n.filter(f=>f.maxPoint>0||!f.isEmpty&&f.maxPoint>=s),l=qx(o,a,r),u=new Tu(o,l,s),c=new Tu(a,l,s);r.iterGaps((f,d,h)=>Gx(u,f,c,d,h,i)),r.empty&&r.length==0&&Gx(u,0,c,0,0,i)}static eq(e,n,r=0,i){i==null&&(i=999999999);let s=e.filter(c=>!c.isEmpty&&n.indexOf(c)<0),o=n.filter(c=>!c.isEmpty&&e.indexOf(c)<0);if(s.length!=o.length)return!1;if(!s.length)return!0;let a=qx(s,o),l=new Tu(s,a,0).goto(r),u=new Tu(o,a,0).goto(r);for(;;){if(l.to!=u.to||!cb(l.active,u.active)||l.point&&(!u.point||!l.point.eq(u.point)))return!1;if(l.to>i)return!0;l.next(),u.next()}}static spans(e,n,r,i,s=-1){let o=new Tu(e,null,s).goto(n),a=n,l=o.openStart;for(;;){let u=Math.min(o.to,r);if(o.point){let c=o.activeForPoint(o.to),f=o.pointFroma&&(i.span(a,u,o.active,l),l=o.openEnd(u));if(o.to>r)return l+(o.point&&o.to>r?1:0);a=o.to,o.next()}}static of(e,n=!1){let r=new _s;for(let i of e instanceof lb?[e]:n?QF(e):e)r.add(i.from,i.to,i.value);return r.finish()}static join(e){if(!e.length)return Xe.empty;let n=e[e.length-1];for(let r=e.length-2;r>=0;r--)for(let i=e[r];i!=Xe.empty;i=i.nextLayer)n=new Xe(i.chunkPos,i.chunk,n,Math.max(i.maxPoint,n.maxPoint));return n}}Xe.empty=new Xe([],[],null,-1);function QF(t){if(t.length>1)for(let e=t[0],n=1;n0)return t.slice().sort(ub);e=r}return t}Xe.empty.nextLayer=Xe.empty;class _s{finishChunk(e){this.chunks.push(new mv(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,e&&(this.from=[],this.to=[],this.value=[])}constructor(){this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-1e9,this.lastTo=-1e9,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null}add(e,n,r){this.addInner(e,n,r)||(this.nextLayer||(this.nextLayer=new _s)).add(e,n,r)}addInner(e,n,r){let i=e-this.lastTo||r.startSide-this.last.endSide;if(i<=0&&(e-this.lastFrom||r.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return i<0?!1:(this.from.length==250&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=e),this.from.push(e-this.chunkStart),this.to.push(n-this.chunkStart),this.last=r,this.lastFrom=e,this.lastTo=n,this.value.push(r),r.point&&(this.maxPoint=Math.max(this.maxPoint,n-e)),!0)}addChunk(e,n){if((e-this.lastTo||n.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,n.maxPoint),this.chunks.push(n),this.chunkPos.push(e);let r=n.value.length-1;return this.last=n.value[r],this.lastFrom=n.from[r]+e,this.lastTo=n.to[r]+e,!0}finish(){return this.finishInner(Xe.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return e;let n=Xe.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,n}}function qx(t,e,n){let r=new Map;for(let s of t)for(let o=0;o=this.minPoint)break}}setRangeIndex(e){if(e==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex=r&&i.push(new cD(o,n,r,s));return i.length==1?i[0]:new Mc(i)}get startSide(){return this.value?this.value.startSide:0}goto(e,n=-1e9){for(let r of this.heap)r.goto(e,n);for(let r=this.heap.length>>1;r>=0;r--)fg(this.heap,r);return this.next(),this}forward(e,n){for(let r of this.heap)r.forward(e,n);for(let r=this.heap.length>>1;r>=0;r--)fg(this.heap,r);(this.to-e||this.value.endSide-n)<0&&this.next()}next(){if(this.heap.length==0)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let e=this.heap[0];this.from=e.from,this.to=e.to,this.value=e.value,this.rank=e.rank,e.value&&e.next(),fg(this.heap,0)}}}function fg(t,e){for(let n=t[e];;){let r=(e<<1)+1;if(r>=t.length)break;let i=t[r];if(r+1=0&&(i=t[r+1],r++),n.compare(i)<0)break;t[r]=n,t[e]=i,e=r}}class Tu{constructor(e,n,r){this.minPoint=r,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-1e9,this.endSide=0,this.openStart=-1,this.cursor=Mc.from(e,n,r)}goto(e,n=-1e9){return this.cursor.goto(e,n),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=e,this.endSide=n,this.openStart=-1,this.next(),this}forward(e,n){for(;this.minActive>-1&&(this.activeTo[this.minActive]-e||this.active[this.minActive].endSide-n)<0;)this.removeActive(this.minActive);this.cursor.forward(e,n)}removeActive(e){xd(this.active,e),xd(this.activeTo,e),xd(this.activeRank,e),this.minActive=Wx(this.active,this.activeTo)}addActive(e){let n=0,{value:r,to:i,rank:s}=this.cursor;for(;n0;)n++;Sd(this.active,n,r),Sd(this.activeTo,n,i),Sd(this.activeRank,n,s),e&&Sd(e,n,this.cursor.from),this.minActive=Wx(this.active,this.activeTo)}next(){let e=this.to,n=this.point;this.point=null;let r=this.openStart<0?[]:null;for(;;){let i=this.minActive;if(i>-1&&(this.activeTo[i]-this.cursor.from||this.active[i].endSide-this.cursor.startSide)<0){if(this.activeTo[i]>e){this.to=this.activeTo[i],this.endSide=this.active[i].endSide;break}this.removeActive(i),r&&xd(r,i)}else if(this.cursor.value)if(this.cursor.from>e){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}else{let s=this.cursor.value;if(!s.point)this.addActive(r),this.cursor.next();else if(n&&this.cursor.to==this.to&&this.cursor.from=0&&r[i]=0&&!(this.activeRank[r]e||this.activeTo[r]==e&&this.active[r].endSide>=this.point.endSide)&&n.push(this.active[r]);return n.reverse()}openEnd(e){let n=0;for(let r=this.activeTo.length-1;r>=0&&this.activeTo[r]>e;r--)n++;return n}}function Gx(t,e,n,r,i,s){t.goto(e),n.goto(r);let o=r+i,a=r,l=r-e;for(;;){let u=t.to+l-n.to,c=u||t.endSide-n.endSide,f=c<0?t.to+l:n.to,d=Math.min(f,o);if(t.point||n.point?t.point&&n.point&&(t.point==n.point||t.point.eq(n.point))&&cb(t.activeForPoint(t.to),n.activeForPoint(n.to))||s.comparePoint(a,d,t.point,n.point):d>a&&!cb(t.active,n.active)&&s.compareRange(a,d,t.active,n.active),f>o)break;(u||t.openEnd!=n.openEnd)&&s.boundChange&&s.boundChange(f),a=f,c<=0&&t.next(),c>=0&&n.next()}}function cb(t,e){if(t.length!=e.length)return!1;for(let n=0;n=e;r--)t[r+1]=t[r];t[e]=n}function Wx(t,e){let n=-1,r=1e9;for(let i=0;i=e)return i;if(i==t.length)break;s+=t.charCodeAt(i)==9?n-s%n:1,i=wn(t,i)}return r===!0?-1:t.length}const db="ͼ",Kx=typeof Symbol>"u"?"__"+db:Symbol.for(db),hb=typeof Symbol>"u"?"__styleSet"+Math.floor(Math.random()*1e8):Symbol("styleSet"),Xx=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};class po{constructor(e,n){this.rules=[];let{finish:r}=n||{};function i(o){return/^@/.test(o)?[o]:o.split(/,\s*/)}function s(o,a,l,u){let c=[],f=/^@(\w+)\b/.exec(o[0]),d=f&&f[1]=="keyframes";if(f&&a==null)return l.push(o[0]+";");for(let h in a){let p=a[h];if(/&/.test(h))s(h.split(/,\s*/).map(m=>o.map(g=>m.replace(/&/,g))).reduce((m,g)=>m.concat(g)),p,l);else if(p&&typeof p=="object"){if(!f)throw new RangeError("The value of a property ("+h+") should be a primitive value.");s(i(h),p,c,d)}else p!=null&&c.push(h.replace(/_.*/,"").replace(/[A-Z]/g,m=>"-"+m.toLowerCase())+": "+p+";")}(c.length||d)&&l.push((r&&!f&&!u?o.map(r):o).join(", ")+" {"+c.join(" ")+"}")}for(let o in e)s(i(o),e[o],this.rules)}getRules(){return this.rules.join(` -`)}static newName(){let e=Xx[Kx]||1;return Xx[Kx]=e+1,db+e.toString(36)}static mount(e,n,r){let i=e[hb],s=r&&r.nonce;i?s&&i.setNonce(s):i=new e9(e,s),i.mount(Array.isArray(n)?n:[n],e)}}let Yx=new Map;class e9{constructor(e,n){let r=e.ownerDocument||e,i=r.defaultView;if(!e.head&&e.adoptedStyleSheets&&i.CSSStyleSheet){let s=Yx.get(r);if(s)return e[hb]=s;this.sheet=new i.CSSStyleSheet,Yx.set(r,this)}else this.styleTag=r.createElement("style"),n&&this.styleTag.setAttribute("nonce",n);this.modules=[],e[hb]=this}mount(e,n){let r=this.sheet,i=0,s=0;for(let o=0;o-1&&(this.modules.splice(l,1),s--,l=-1),l==-1){if(this.modules.splice(s++,0,a),r)for(let u=0;u",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},t9=typeof navigator<"u"&&/Mac/.test(navigator.platform),n9=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var Sn=0;Sn<10;Sn++)mo[48+Sn]=mo[96+Sn]=String(Sn);for(var Sn=1;Sn<=24;Sn++)mo[Sn+111]="F"+Sn;for(var Sn=65;Sn<=90;Sn++)mo[Sn]=String.fromCharCode(Sn+32),Fc[Sn]=String.fromCharCode(Sn);for(var dg in mo)Fc.hasOwnProperty(dg)||(Fc[dg]=mo[dg]);function r9(t){var e=t9&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||n9&&t.shiftKey&&t.key&&t.key.length==1||t.key=="Unidentified",n=!e&&t.key||(t.shiftKey?Fc:mo)[t.keyCode]||t.key||"Unidentified";return n=="Esc"&&(n="Escape"),n=="Del"&&(n="Delete"),n=="Left"&&(n="ArrowLeft"),n=="Up"&&(n="ArrowUp"),n=="Right"&&(n="ArrowRight"),n=="Down"&&(n="ArrowDown"),n}function ct(){var t=arguments[0];typeof t=="string"&&(t=document.createElement(t));var e=1,n=arguments[1];if(n&&typeof n=="object"&&n.nodeType==null&&!Array.isArray(n)){for(var r in n)if(Object.prototype.hasOwnProperty.call(n,r)){var i=n[r];typeof i=="string"?t.setAttribute(r,i):i!=null&&(t[r]=i)}e++}for(;e2);var ue={mac:Zx||/Mac/.test($n.platform),windows:/Win/.test($n.platform),linux:/Linux|X11/.test($n.platform),ie:G0,ie_version:dD?pb.documentMode||6:gb?+gb[1]:mb?+mb[1]:0,gecko:Jx,gecko_version:Jx?+(/Firefox\/(\d+)/.exec($n.userAgent)||[0,0])[1]:0,chrome:!!hg,chrome_version:hg?+hg[1]:0,ios:Zx,android:/Android\b/.test($n.userAgent),webkit_version:i9?+(/\bAppleWebKit\/(\d+)/.exec($n.userAgent)||[0,0])[1]:0,safari:bb,safari_version:bb?+(/\bVersion\/(\d+(\.\d+)?)/.exec($n.userAgent)||[0,0])[1]:0,tabSize:pb.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};function Lc(t){let e;return t.nodeType==11?e=t.getSelection?t:t.ownerDocument:e=t,e.getSelection()}function yb(t,e){return e?t==e||t.contains(e.nodeType!=1?e.parentNode:e):!1}function Ch(t,e){if(!e.anchorNode)return!1;try{return yb(t,e.anchorNode)}catch{return!1}}function kl(t){return t.nodeType==3?fa(t,0,t.nodeValue.length).getClientRects():t.nodeType==1?t.getClientRects():[]}function cc(t,e,n,r){return n?Qx(t,e,n,r,-1)||Qx(t,e,n,r,1):!1}function ca(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e}function gp(t){return t.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(t.nodeName)}function Qx(t,e,n,r,i){for(;;){if(t==n&&e==r)return!0;if(e==(i<0?0:Vi(t))){if(t.nodeName=="DIV")return!1;let s=t.parentNode;if(!s||s.nodeType!=1)return!1;e=ca(t)+(i<0?0:1),t=s}else if(t.nodeType==1){if(t=t.childNodes[e+(i<0?-1:0)],t.nodeType==1&&t.contentEditable=="false")return!1;e=i<0?Vi(t):0}else return!1}}function Vi(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function Pf(t,e){let n=e?t.left:t.right;return{left:n,right:n,top:t.top,bottom:t.bottom}}function s9(t){let e=t.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:t.innerWidth,top:0,bottom:t.innerHeight}}function hD(t,e){let n=e.width/t.offsetWidth,r=e.height/t.offsetHeight;return(n>.995&&n<1.005||!isFinite(n)||Math.abs(e.width-t.offsetWidth)<1)&&(n=1),(r>.995&&r<1.005||!isFinite(r)||Math.abs(e.height-t.offsetHeight)<1)&&(r=1),{scaleX:n,scaleY:r}}function o9(t,e,n,r,i,s,o,a){let l=t.ownerDocument,u=l.defaultView||window;for(let c=t,f=!1;c&&!f;)if(c.nodeType==1){let d,h=c==l.body,p=1,m=1;if(h)d=s9(u);else{if(/^(fixed|sticky)$/.test(getComputedStyle(c).position)&&(f=!0),c.scrollHeight<=c.clientHeight&&c.scrollWidth<=c.clientWidth){c=c.assignedSlot||c.parentNode;continue}let y=c.getBoundingClientRect();({scaleX:p,scaleY:m}=hD(c,y)),d={left:y.left,right:y.left+c.clientWidth*p,top:y.top,bottom:y.top+c.clientHeight*m}}let g=0,b=0;if(i=="nearest")e.top0&&e.bottom>d.bottom+b&&(b=e.bottom-d.bottom+o)):e.bottom>d.bottom&&(b=e.bottom-d.bottom+o,n<0&&e.top-b0&&e.right>d.right+g&&(g=e.right-d.right+s)):e.right>d.right&&(g=e.right-d.right+s,n<0&&e.leftd.bottom||e.leftd.right)&&(e={left:Math.max(e.left,d.left),right:Math.min(e.right,d.right),top:Math.max(e.top,d.top),bottom:Math.min(e.bottom,d.bottom)}),c=c.assignedSlot||c.parentNode}else if(c.nodeType==11)c=c.host;else break}function a9(t){let e=t.ownerDocument,n,r;for(let i=t.parentNode;i&&!(i==e.body||n&&r);)if(i.nodeType==1)!r&&i.scrollHeight>i.clientHeight&&(r=i),!n&&i.scrollWidth>i.clientWidth&&(n=i),i=i.assignedSlot||i.parentNode;else if(i.nodeType==11)i=i.host;else break;return{x:n,y:r}}class l9{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}eq(e){return this.anchorNode==e.anchorNode&&this.anchorOffset==e.anchorOffset&&this.focusNode==e.focusNode&&this.focusOffset==e.focusOffset}setRange(e){let{anchorNode:n,focusNode:r}=e;this.set(n,Math.min(e.anchorOffset,n?Vi(n):0),r,Math.min(e.focusOffset,r?Vi(r):0))}set(e,n,r,i){this.anchorNode=e,this.anchorOffset=n,this.focusNode=r,this.focusOffset=i}}let No=null;ue.safari&&ue.safari_version>=26&&(No=!1);function pD(t){if(t.setActive)return t.setActive();if(No)return t.focus(No);let e=[];for(let n=t;n&&(e.push(n,n.scrollTop,n.scrollLeft),n!=n.ownerDocument);n=n.parentNode);if(t.focus(No==null?{get preventScroll(){return No={preventScroll:!0},!0}}:void 0),!No){No=!1;for(let n=0;nMath.max(1,t.scrollHeight-t.clientHeight-4)}function bD(t,e){for(let n=t,r=e;;){if(n.nodeType==3&&r>0)return{node:n,offset:r};if(n.nodeType==1&&r>0){if(n.contentEditable=="false")return null;n=n.childNodes[r-1],r=Vi(n)}else if(n.parentNode&&!gp(n))r=ca(n),n=n.parentNode;else return null}}function yD(t,e){for(let n=t,r=e;;){if(n.nodeType==3&&rn)return f.domBoundsAround(e,n,u);if(d>=e&&i==-1&&(i=l,s=u),u>n&&f.dom.parentNode==this.dom){o=l,a=c;break}c=d,u=d+f.breakAfter}return{from:s,to:a<0?r+this.length:a,startDOM:(i?this.children[i-1].dom.nextSibling:null)||this.dom.firstChild,endDOM:o=0?this.children[o].dom:null}}markDirty(e=!1){this.flags|=2,this.markParentsDirty(e)}markParentsDirty(e){for(let n=this.parent;n;n=n.parent){if(e&&(n.flags|=2),n.flags&1)return;n.flags|=1,e=!1}}setParent(e){this.parent!=e&&(this.parent=e,this.flags&7&&this.markParentsDirty(!0))}setDOM(e){this.dom!=e&&(this.dom&&(this.dom.cmView=null),this.dom=e,e.cmView=this)}get rootView(){for(let e=this;;){let n=e.parent;if(!n)return e;e=n}}replaceChildren(e,n,r=gv){this.markDirty();for(let i=e;ithis.pos||e==this.pos&&(n>0||this.i==0||this.children[this.i-1].breakAfter))return this.off=e-this.pos,this;let r=this.children[--this.i];this.pos-=r.length+r.breakAfter}}}function xD(t,e,n,r,i,s,o,a,l){let{children:u}=t,c=u.length?u[e]:null,f=s.length?s[s.length-1]:null,d=f?f.breakAfter:o;if(!(e==r&&c&&!o&&!d&&s.length<2&&c.merge(n,i,s.length?f:null,n==0,a,l))){if(r0&&(!o&&s.length&&c.merge(n,c.length,s[0],!1,a,0)?c.breakAfter=s.shift().breakAfter:(nf9||r.flags&8)?!1:(this.text=this.text.slice(0,e)+(r?r.text:"")+this.text.slice(n),this.markDirty(),!0)}split(e){let n=new ui(this.text.slice(e));return this.text=this.text.slice(0,e),this.markDirty(),n.flags|=this.flags&8,n}localPosFromDOM(e,n){return e==this.dom?n:n?this.text.length:0}domAtPos(e){return new Tn(this.dom,e)}domBoundsAround(e,n,r){return{from:r,to:r+this.length,startDOM:this.dom,endDOM:this.dom.nextSibling}}coordsAt(e,n){return d9(this.dom,e,n)}}class Cs extends ut{constructor(e,n=[],r=0){super(),this.mark=e,this.children=n,this.length=r;for(let i of n)i.setParent(this)}setAttrs(e){if(mD(e),this.mark.class&&(e.className=this.mark.class),this.mark.attrs)for(let n in this.mark.attrs)e.setAttribute(n,this.mark.attrs[n]);return e}canReuseDOM(e){return super.canReuseDOM(e)&&!((this.flags|e.flags)&8)}reuseDOM(e){e.nodeName==this.mark.tagName.toUpperCase()&&(this.setDOM(e),this.flags|=6)}sync(e,n){this.dom?this.flags&4&&this.setAttrs(this.dom):this.setDOM(this.setAttrs(document.createElement(this.mark.tagName))),super.sync(e,n)}merge(e,n,r,i,s,o){return r&&(!(r instanceof Cs&&r.mark.eq(this.mark))||e&&s<=0||ne&&n.push(r=e&&(i=s),r=l,s++}let o=this.length-e;return this.length=e,i>-1&&(this.children.length=i,this.markDirty()),new Cs(this.mark,n,o)}domAtPos(e){return ED(this,e)}coordsAt(e,n){return _D(this,e,n)}}function d9(t,e,n){let r=t.nodeValue.length;e>r&&(e=r);let i=e,s=e,o=0;e==0&&n<0||e==r&&n>=0?ue.chrome||ue.gecko||(e?(i--,o=1):s=0)?0:a.length-1];return ue.safari&&!o&&l.width==0&&(l=Array.prototype.find.call(a,u=>u.width)||l),o?Pf(l,o<0):l||null}class Ws extends ut{static create(e,n,r){return new Ws(e,n,r)}constructor(e,n,r){super(),this.widget=e,this.length=n,this.side=r,this.prevWidget=null}split(e){let n=Ws.create(this.widget,this.length-e,this.side);return this.length-=e,n}sync(e){(!this.dom||!this.widget.updateDOM(this.dom,e))&&(this.dom&&this.prevWidget&&this.prevWidget.destroy(this.dom),this.prevWidget=null,this.setDOM(this.widget.toDOM(e)),this.widget.editable||(this.dom.contentEditable="false"))}getSide(){return this.side}merge(e,n,r,i,s,o){return r&&(!(r instanceof Ws)||!this.widget.compare(r.widget)||e>0&&s<=0||n0)?Tn.before(this.dom):Tn.after(this.dom,e==this.length)}domBoundsAround(){return null}coordsAt(e,n){let r=this.widget.coordsAt(this.dom,e,n);if(r)return r;let i=this.dom.getClientRects(),s=null;if(!i.length)return null;let o=this.side?this.side<0:e>0;for(let a=o?i.length-1:0;s=i[a],!(e>0?a==0:a==i.length-1||s.top0?Tn.before(this.dom):Tn.after(this.dom)}localPosFromDOM(){return 0}domBoundsAround(){return null}coordsAt(e){return this.dom.getBoundingClientRect()}get overrideDOMText(){return Ze.empty}get isHidden(){return!0}}ui.prototype.children=Ws.prototype.children=Ol.prototype.children=gv;function ED(t,e){let n=t.dom,{children:r}=t,i=0;for(let s=0;is&&e0;s--){let o=r[s-1];if(o.dom.parentNode==n)return o.domAtPos(o.length)}for(let s=i;s0&&e instanceof Cs&&i.length&&(r=i[i.length-1])instanceof Cs&&r.mark.eq(e.mark)?wD(r,e.children[0],n-1):(i.push(e),e.setParent(t)),t.length+=e.length}function _D(t,e,n){let r=null,i=-1,s=null,o=-1;function a(u,c){for(let f=0,d=0;f=c&&(h.children.length?a(h,c-d):(!s||s.isHidden&&(n>0||p9(s,h)))&&(p>c||d==p&&h.getSide()>0)?(s=h,o=c-d):(d-1?1:0)!=i.length-(n&&i.indexOf(n)>-1?1:0))return!1;for(let s of r)if(s!=n&&(i.indexOf(s)==-1||t[s]!==e[s]))return!1;return!0}function xb(t,e,n){let r=!1;if(e)for(let i in e)n&&i in n||(r=!0,i=="style"?t.style.cssText="":t.removeAttribute(i));if(n)for(let i in n)e&&e[i]==n[i]||(r=!0,i=="style"?t.style.cssText=n[i]:t.setAttribute(i,n[i]));return r}function m9(t){let e=Object.create(null);for(let n=0;n0?3e8:-4e8:n>0?1e8:-1e8,new go(e,n,n,r,e.widget||null,!1)}static replace(e){let n=!!e.block,r,i;if(e.isBlockGap)r=-5e8,i=4e8;else{let{start:s,end:o}=CD(e,n);r=(s?n?-3e8:-1:5e8)-1,i=(o?n?2e8:1:-6e8)+1}return new go(e,r,i,n,e.widget||null,!0)}static line(e){return new Nf(e)}static set(e,n=!1){return Xe.of(e,n)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}}ve.none=Xe.empty;class Rf extends ve{constructor(e){let{start:n,end:r}=CD(e);super(n?-1:5e8,r?1:-6e8,null,e),this.tagName=e.tagName||"span",this.class=e.class||"",this.attrs=e.attributes||null}eq(e){var n,r;return this==e||e instanceof Rf&&this.tagName==e.tagName&&(this.class||((n=this.attrs)===null||n===void 0?void 0:n.class))==(e.class||((r=e.attrs)===null||r===void 0?void 0:r.class))&&bp(this.attrs,e.attrs,"class")}range(e,n=e){if(e>=n)throw new RangeError("Mark decorations may not be empty");return super.range(e,n)}}Rf.prototype.point=!1;class Nf extends ve{constructor(e){super(-2e8,-2e8,null,e)}eq(e){return e instanceof Nf&&this.spec.class==e.spec.class&&bp(this.spec.attributes,e.spec.attributes)}range(e,n=e){if(n!=e)throw new RangeError("Line decoration ranges must be zero-length");return super.range(e,n)}}Nf.prototype.mapMode=En.TrackBefore;Nf.prototype.point=!0;class go extends ve{constructor(e,n,r,i,s,o){super(n,r,s,e),this.block=i,this.isReplace=o,this.mapMode=i?n<=0?En.TrackBefore:En.TrackAfter:En.TrackDel}get type(){return this.startSide!=this.endSide?Kn.WidgetRange:this.startSide<=0?Kn.WidgetBefore:Kn.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(e){return e instanceof go&&g9(this.widget,e.widget)&&this.block==e.block&&this.startSide==e.startSide&&this.endSide==e.endSide}range(e,n=e){if(this.isReplace&&(e>n||e==n&&this.startSide>0&&this.endSide<=0))throw new RangeError("Invalid range for replacement decoration");if(!this.isReplace&&n!=e)throw new RangeError("Widget decorations can only have zero-length ranges");return super.range(e,n)}}go.prototype.point=!0;function CD(t,e=!1){let{inclusiveStart:n,inclusiveEnd:r}=t;return n==null&&(n=t.inclusive),r==null&&(r=t.inclusive),{start:n??e,end:r??e}}function g9(t,e){return t==e||!!(t&&e&&t.compare(e))}function Ah(t,e,n,r=0){let i=n.length-1;i>=0&&n[i]+r>=t?n[i]=Math.max(n[i],e):n.push(t,e)}class Jt extends ut{constructor(){super(...arguments),this.children=[],this.length=0,this.prevAttrs=void 0,this.attrs=null,this.breakAfter=0}merge(e,n,r,i,s,o){if(r){if(!(r instanceof Jt))return!1;this.dom||r.transferDOM(this)}return i&&this.setDeco(r?r.attrs:null),SD(this,e,n,r?r.children.slice():[],s,o),!0}split(e){let n=new Jt;if(n.breakAfter=this.breakAfter,this.length==0)return n;let{i:r,off:i}=this.childPos(e);i&&(n.append(this.children[r].split(i),0),this.children[r].merge(i,this.children[r].length,null,!1,0,0),r++);for(let s=r;s0&&this.children[r-1].length==0;)this.children[--r].destroy();return this.children.length=r,this.markDirty(),this.length=e,n}transferDOM(e){this.dom&&(this.markDirty(),e.setDOM(this.dom),e.prevAttrs=this.prevAttrs===void 0?this.attrs:this.prevAttrs,this.prevAttrs=void 0,this.dom=null)}setDeco(e){bp(this.attrs,e)||(this.dom&&(this.prevAttrs=this.attrs,this.markDirty()),this.attrs=e)}append(e,n){wD(this,e,n)}addLineDeco(e){let n=e.spec.attributes,r=e.spec.class;n&&(this.attrs=vb(n,this.attrs||{})),r&&(this.attrs=vb({class:r},this.attrs||{}))}domAtPos(e){return ED(this,e)}reuseDOM(e){e.nodeName=="DIV"&&(this.setDOM(e),this.flags|=6)}sync(e,n){var r;this.dom?this.flags&4&&(mD(this.dom),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0):(this.setDOM(document.createElement("div")),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0),this.prevAttrs!==void 0&&(xb(this.dom,this.prevAttrs,this.attrs),this.dom.classList.add("cm-line"),this.prevAttrs=void 0),super.sync(e,n);let i=this.dom.lastChild;for(;i&&ut.get(i)instanceof Cs;)i=i.lastChild;if(!i||!this.length||i.nodeName!="BR"&&((r=ut.get(i))===null||r===void 0?void 0:r.isEditable)==!1&&(!ue.ios||!this.children.some(s=>s instanceof ui))){let s=document.createElement("BR");s.cmIgnore=!0,this.dom.appendChild(s)}}measureTextSize(){if(this.children.length==0||this.length>20)return null;let e=0,n;for(let r of this.children){if(!(r instanceof ui)||/[^ -~]/.test(r.text))return null;let i=kl(r.dom);if(i.length!=1)return null;e+=i[0].width,n=i[0].height}return e?{lineHeight:this.dom.getBoundingClientRect().height,charWidth:e/this.length,textHeight:n}:null}coordsAt(e,n){let r=_D(this,e,n);if(!this.children.length&&r&&this.parent){let{heightOracle:i}=this.parent.view.viewState,s=r.bottom-r.top;if(Math.abs(s-i.lineHeight)<2&&i.textHeight=n){if(s instanceof Jt)return s;if(o>n)break}i=o+s.breakAfter}return null}}class gs extends ut{constructor(e,n,r){super(),this.widget=e,this.length=n,this.deco=r,this.breakAfter=0,this.prevWidget=null}merge(e,n,r,i,s,o){return r&&(!(r instanceof gs)||!this.widget.compare(r.widget)||e>0&&s<=0||n0}}class Sb extends Yi{constructor(e){super(),this.height=e}toDOM(){let e=document.createElement("div");return e.className="cm-gap",this.updateDOM(e),e}eq(e){return e.height==this.height}updateDOM(e){return e.style.height=this.height+"px",!0}get editable(){return!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}}class fc{constructor(e,n,r,i){this.doc=e,this.pos=n,this.end=r,this.disallowBlockEffectsFor=i,this.content=[],this.curLine=null,this.breakAtStart=0,this.pendingBuffer=0,this.bufferMarks=[],this.atCursorPos=!0,this.openStart=-1,this.openEnd=-1,this.text="",this.textOff=0,this.cursor=e.iter(),this.skip=n}posCovered(){if(this.content.length==0)return!this.breakAtStart&&this.doc.lineAt(this.pos).from!=this.pos;let e=this.content[this.content.length-1];return!(e.breakAfter||e instanceof gs&&e.deco.endSide<0)}getLine(){return this.curLine||(this.content.push(this.curLine=new Jt),this.atCursorPos=!0),this.curLine}flushBuffer(e=this.bufferMarks){this.pendingBuffer&&(this.curLine.append(Ed(new Ol(-1),e),e.length),this.pendingBuffer=0)}addBlockWidget(e){this.flushBuffer(),this.curLine=null,this.content.push(e)}finish(e){this.pendingBuffer&&e<=this.bufferMarks.length?this.flushBuffer():this.pendingBuffer=0,!this.posCovered()&&!(e&&this.content.length&&this.content[this.content.length-1]instanceof gs)&&this.getLine()}buildText(e,n,r){for(;e>0;){if(this.textOff==this.text.length){let{value:o,lineBreak:a,done:l}=this.cursor.next(this.skip);if(this.skip=0,l)throw new Error("Ran out of text content when drawing inline views");if(a){this.posCovered()||this.getLine(),this.content.length?this.content[this.content.length-1].breakAfter=1:this.breakAtStart=1,this.flushBuffer(),this.curLine=null,this.atCursorPos=!0,e--;continue}else this.text=o,this.textOff=0}let i=Math.min(this.text.length-this.textOff,e),s=Math.min(i,512);this.flushBuffer(n.slice(n.length-r)),this.getLine().append(Ed(new ui(this.text.slice(this.textOff,this.textOff+s)),n),r),this.atCursorPos=!0,this.textOff+=s,e-=s,r=i<=s?0:n.length}}span(e,n,r,i){this.buildText(n-e,r,i),this.pos=n,this.openStart<0&&(this.openStart=i)}point(e,n,r,i,s,o){if(this.disallowBlockEffectsFor[o]&&r instanceof go){if(r.block)throw new RangeError("Block decorations may not be specified via plugins");if(n>this.doc.lineAt(this.pos).to)throw new RangeError("Decorations that replace line breaks may not be specified via plugins")}let a=n-e;if(r instanceof go)if(r.block)r.startSide>0&&!this.posCovered()&&this.getLine(),this.addBlockWidget(new gs(r.widget||Tl.block,a,r));else{let l=Ws.create(r.widget||Tl.inline,a,a?0:r.startSide),u=this.atCursorPos&&!l.isEditable&&s<=i.length&&(e0),c=!l.isEditable&&(ei.length||r.startSide<=0),f=this.getLine();this.pendingBuffer==2&&!u&&!l.isEditable&&(this.pendingBuffer=0),this.flushBuffer(i),u&&(f.append(Ed(new Ol(1),i),s),s=i.length+Math.max(0,s-i.length)),f.append(Ed(l,i),s),this.atCursorPos=c,this.pendingBuffer=c?ei.length?1:2:0,this.pendingBuffer&&(this.bufferMarks=i.slice())}else this.doc.lineAt(this.pos).from==this.pos&&this.getLine().addLineDeco(r);a&&(this.textOff+a<=this.text.length?this.textOff+=a:(this.skip+=a-(this.text.length-this.textOff),this.text="",this.textOff=0),this.pos=n),this.openStart<0&&(this.openStart=s)}static build(e,n,r,i,s){let o=new fc(e,n,r,s);return o.openEnd=Xe.spans(i,n,r,o),o.openStart<0&&(o.openStart=o.openEnd),o.finish(o.openEnd),o}}function Ed(t,e){for(let n of e)t=new Cs(n,[t],t.length);return t}class Tl extends Yi{constructor(e){super(),this.tag=e}eq(e){return e.tag==this.tag}toDOM(){return document.createElement(this.tag)}updateDOM(e){return e.nodeName.toLowerCase()==this.tag}get isHidden(){return!0}}Tl.inline=new Tl("span");Tl.block=new Tl("div");var Et=(function(t){return t[t.LTR=0]="LTR",t[t.RTL=1]="RTL",t})(Et||(Et={}));const da=Et.LTR,bv=Et.RTL;function AD(t){let e=[];for(let n=0;n=n){if(a.level==r)return o;(s<0||(i!=0?i<0?a.fromn:e[s].level>a.level))&&(s=o)}}if(s<0)throw new RangeError("Index out of range");return s}}function kD(t,e){if(t.length!=e.length)return!1;for(let n=0;n=0;m-=3)if(yi[m+1]==-h){let g=yi[m+2],b=g&2?i:g&4?g&1?s:i:0;b&&(ft[f]=ft[yi[m]]=b),a=m;break}}else{if(yi.length==189)break;yi[a++]=f,yi[a++]=d,yi[a++]=l}else if((p=ft[f])==2||p==1){let m=p==i;l=m?0:1;for(let g=a-3;g>=0;g-=3){let b=yi[g+2];if(b&2)break;if(m)yi[g+2]|=2;else{if(b&4)break;yi[g+2]|=4}}}}}function E9(t,e,n,r){for(let i=0,s=r;i<=n.length;i++){let o=i?n[i-1].to:t,a=il;)p==g&&(p=n[--m].from,g=m?n[m-1].to:t),ft[--p]=h;l=c}else s=u,l++}}}function wb(t,e,n,r,i,s,o){let a=r%2?2:1;if(r%2==i%2)for(let l=e,u=0;ll&&o.push(new Ks(l,m.from,h));let g=m.direction==da!=!(h%2);_b(t,g?r+1:r,i,m.inner,m.from,m.to,o),l=m.to}p=m.to}else{if(p==n||(c?ft[p]!=a:ft[p]==a))break;p++}d?wb(t,l,p,r+1,i,d,o):le;){let c=!0,f=!1;if(!u||l>s[u-1].to){let m=ft[l-1];m!=a&&(c=!1,f=m==16)}let d=!c&&a==1?[]:null,h=c?r:r+1,p=l;e:for(;;)if(u&&p==s[u-1].to){if(f)break e;let m=s[--u];if(!c)for(let g=m.from,b=u;;){if(g==e)break e;if(b&&s[b-1].to==g)g=s[--b].from;else{if(ft[g-1]==a)break e;break}}if(d)d.push(m);else{m.toft.length;)ft[ft.length]=256;let r=[],i=e==da?0:1;return _b(t,i,i,n,0,t.length,r),r}function OD(t){return[new Ks(0,t,0)]}let TD="";function _9(t,e,n,r,i){var s;let o=r.head-t.from,a=Ks.find(e,o,(s=r.bidiLevel)!==null&&s!==void 0?s:-1,r.assoc),l=e[a],u=l.side(i,n);if(o==u){let d=a+=i?1:-1;if(d<0||d>=e.length)return null;l=e[a=d],o=l.side(!i,n),u=l.side(i,n)}let c=wn(t.text,o,l.forward(i,n));(cl.to)&&(c=u),TD=t.text.slice(Math.min(o,c),Math.max(o,c));let f=a==(i?e.length-1:0)?null:e[a+(i?1:-1)];return f&&c==u&&f.level+(i?0:1)t.some(e=>e)}),BD=he.define({combine:t=>t.some(e=>e)}),$D=he.define();class fl{constructor(e,n="nearest",r="nearest",i=5,s=5,o=!1){this.range=e,this.y=n,this.x=r,this.yMargin=i,this.xMargin=s,this.isSnapshot=o}map(e){return e.empty?this:new fl(this.range.map(e),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}clip(e){return this.range.to<=e.doc.length?this:new fl(Y.cursor(e.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}}const wd=De.define({map:(t,e)=>t.map(e)}),zD=De.define();function qn(t,e,n){let r=t.facet(ND);r.length?r[0](e):window.onerror&&window.onerror(String(e),n,void 0,void 0,e)||(n?console.error(n+":",e):console.error(e))}const ls=he.define({combine:t=>t.length?t[0]:!0});let A9=0;const Qa=he.define({combine(t){return t.filter((e,n)=>{for(let r=0;r{let l=[];return o&&l.push(Bc.of(u=>{let c=u.plugin(a);return c?o(c):ve.none})),s&&l.push(s(a)),l})}static fromClass(e,n){return $t.define((r,i)=>new e(r,i),n)}}class pg{constructor(e){this.spec=e,this.mustUpdate=null,this.value=null}get plugin(){return this.spec&&this.spec.plugin}update(e){if(this.value){if(this.mustUpdate){let n=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(n)}catch(r){if(qn(n.state,r,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch{}this.deactivate()}}}else if(this.spec)try{this.value=this.spec.plugin.create(e,this.spec.arg)}catch(n){qn(e.state,n,"CodeMirror plugin crashed"),this.deactivate()}return this}destroy(e){var n;if(!((n=this.value)===null||n===void 0)&&n.destroy)try{this.value.destroy()}catch(r){qn(e.state,r,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const jD=he.define(),xv=he.define(),Bc=he.define(),VD=he.define(),Mf=he.define(),UD=he.define();function rS(t,e){let n=t.state.facet(UD);if(!n.length)return n;let r=n.map(s=>s instanceof Function?s(t):s),i=[];return Xe.spans(r,e.from,e.to,{point(){},span(s,o,a,l){let u=s-e.from,c=o-e.from,f=i;for(let d=a.length-1;d>=0;d--,l--){let h=a[d].spec.bidiIsolate,p;if(h==null&&(h=C9(e.text,u,c)),l>0&&f.length&&(p=f[f.length-1]).to==u&&p.direction==h)p.to=c,f=p.inner;else{let m={from:u,to:c,direction:h,inner:[]};f.push(m),f=m.inner}}}}),i}const HD=he.define();function Sv(t){let e=0,n=0,r=0,i=0;for(let s of t.state.facet(HD)){let o=s(t);o&&(o.left!=null&&(e=Math.max(e,o.left)),o.right!=null&&(n=Math.max(n,o.right)),o.top!=null&&(r=Math.max(r,o.top)),o.bottom!=null&&(i=Math.max(i,o.bottom)))}return{left:e,right:n,top:r,bottom:i}}const Wu=he.define();class jr{constructor(e,n,r,i){this.fromA=e,this.toA=n,this.fromB=r,this.toB=i}join(e){return new jr(Math.min(this.fromA,e.fromA),Math.max(this.toA,e.toA),Math.min(this.fromB,e.fromB),Math.max(this.toB,e.toB))}addToSet(e){let n=e.length,r=this;for(;n>0;n--){let i=e[n-1];if(!(i.fromA>r.toA)){if(i.toAc)break;s+=2}if(!l)return r;new jr(l.fromA,l.toA,l.fromB,l.toB).addToSet(r),o=l.toA,a=l.toB}}}class yp{constructor(e,n,r){this.view=e,this.state=n,this.transactions=r,this.flags=0,this.startState=e.state,this.changes=sn.empty(this.startState.doc.length);for(let s of r)this.changes=this.changes.compose(s.changes);let i=[];this.changes.iterChangedRanges((s,o,a,l)=>i.push(new jr(s,o,a,l))),this.changedRanges=i}static create(e,n,r){return new yp(e,n,r)}get viewportChanged(){return(this.flags&4)>0}get viewportMoved(){return(this.flags&8)>0}get heightChanged(){return(this.flags&2)>0}get geometryChanged(){return this.docChanged||(this.flags&18)>0}get focusChanged(){return(this.flags&1)>0}get docChanged(){return!this.changes.empty}get selectionSet(){return this.transactions.some(e=>e.selection)}get empty(){return this.flags==0&&this.transactions.length==0}}class iS extends ut{get length(){return this.view.state.doc.length}constructor(e){super(),this.view=e,this.decorations=[],this.dynamicDecorationMap=[!1],this.domChanged=null,this.hasComposition=null,this.markedForComposition=new Set,this.editContextFormatting=ve.none,this.lastCompositionAfterCursor=!1,this.minWidth=0,this.minWidthFrom=0,this.minWidthTo=0,this.impreciseAnchor=null,this.impreciseHead=null,this.forceSelection=!1,this.lastUpdate=Date.now(),this.setDOM(e.contentDOM),this.children=[new Jt],this.children[0].setParent(this),this.updateDeco(),this.updateInner([new jr(0,0,0,e.state.doc.length)],0,null)}update(e){var n;let r=e.changedRanges;this.minWidth>0&&r.length&&(r.every(({fromA:u,toA:c})=>cthis.minWidthTo)?(this.minWidthFrom=e.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=e.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0),this.updateEditContextFormatting(e);let i=-1;this.view.inputState.composing>=0&&!this.view.observer.editContext&&(!((n=this.domChanged)===null||n===void 0)&&n.newSel?i=this.domChanged.newSel.head:!R9(e.changes,this.hasComposition)&&!e.selectionSet&&(i=e.state.selection.main.head));let s=i>-1?k9(this.view,e.changes,i):null;if(this.domChanged=null,this.hasComposition){this.markedForComposition.clear();let{from:u,to:c}=this.hasComposition;r=new jr(u,c,e.changes.mapPos(u,-1),e.changes.mapPos(c,1)).addToSet(r.slice())}this.hasComposition=s?{from:s.range.fromB,to:s.range.toB}:null,(ue.ie||ue.chrome)&&!s&&e&&e.state.doc.lines!=e.startState.doc.lines&&(this.forceSelection=!0);let o=this.decorations,a=this.updateDeco(),l=I9(o,a,e.changes);return r=jr.extendWithRanges(r,l),!(this.flags&7)&&r.length==0?!1:(this.updateInner(r,e.startState.doc.length,s),e.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(e,n,r){this.view.viewState.mustMeasureContent=!0,this.updateChildren(e,n,r);let{observer:i}=this.view;i.ignore(()=>{this.dom.style.height=this.view.viewState.contentHeight/this.view.scaleY+"px",this.dom.style.flexBasis=this.minWidth?this.minWidth+"px":"";let o=ue.chrome||ue.ios?{node:i.selectionRange.focusNode,written:!1}:void 0;this.sync(this.view,o),this.flags&=-8,o&&(o.written||i.selectionRange.focusNode!=o.node)&&(this.forceSelection=!0),this.dom.style.height=""}),this.markedForComposition.forEach(o=>o.flags&=-9);let s=[];if(this.view.viewport.from||this.view.viewport.to=0?i[o]:null;if(!a)break;let{fromA:l,toA:u,fromB:c,toB:f}=a,d,h,p,m;if(r&&r.range.fromBc){let S=fc.build(this.view.state.doc,c,r.range.fromB,this.decorations,this.dynamicDecorationMap),E=fc.build(this.view.state.doc,r.range.toB,f,this.decorations,this.dynamicDecorationMap);h=S.breakAtStart,p=S.openStart,m=E.openEnd;let C=this.compositionView(r);E.breakAtStart?C.breakAfter=1:E.content.length&&C.merge(C.length,C.length,E.content[0],!1,E.openStart,0)&&(C.breakAfter=E.content[0].breakAfter,E.content.shift()),S.content.length&&C.merge(0,0,S.content[S.content.length-1],!0,0,S.openEnd)&&S.content.pop(),d=S.content.concat(C).concat(E.content)}else({content:d,breakAtStart:h,openStart:p,openEnd:m}=fc.build(this.view.state.doc,c,f,this.decorations,this.dynamicDecorationMap));let{i:g,off:b}=s.findPos(u,1),{i:y,off:x}=s.findPos(l,-1);xD(this,y,x,g,b,d,h,p,m)}r&&this.fixCompositionDOM(r)}updateEditContextFormatting(e){this.editContextFormatting=this.editContextFormatting.map(e.changes);for(let n of e.transactions)for(let r of n.effects)r.is(zD)&&(this.editContextFormatting=r.value)}compositionView(e){let n=new ui(e.text.nodeValue);n.flags|=8;for(let{deco:i}of e.marks)n=new Cs(i,[n],n.length);let r=new Jt;return r.append(n,0),r}fixCompositionDOM(e){let n=(s,o)=>{o.flags|=8|(o.children.some(l=>l.flags&7)?1:0),this.markedForComposition.add(o);let a=ut.get(s);a&&a!=o&&(a.dom=null),o.setDOM(s)},r=this.childPos(e.range.fromB,1),i=this.children[r.i];n(e.line,i);for(let s=e.marks.length-1;s>=-1;s--)r=i.childPos(r.off,1),i=i.children[r.i],n(s>=0?e.marks[s].node:e.text,i)}updateSelection(e=!1,n=!1){(e||!this.view.observer.selectionRange.focusNode)&&this.view.observer.readSelectionRange();let r=this.view.root.activeElement,i=r==this.dom,s=!i&&!(this.view.state.facet(ls)||this.dom.tabIndex>-1)&&Ch(this.dom,this.view.observer.selectionRange)&&!(r&&this.dom.contains(r));if(!(i||n||s))return;let o=this.forceSelection;this.forceSelection=!1;let a=this.view.state.selection.main,l=this.moveToLine(this.domAtPos(a.anchor)),u=a.empty?l:this.moveToLine(this.domAtPos(a.head));if(ue.gecko&&a.empty&&!this.hasComposition&&D9(l)){let f=document.createTextNode("");this.view.observer.ignore(()=>l.node.insertBefore(f,l.node.childNodes[l.offset]||null)),l=u=new Tn(f,0),o=!0}let c=this.view.observer.selectionRange;(o||!c.focusNode||(!cc(l.node,l.offset,c.anchorNode,c.anchorOffset)||!cc(u.node,u.offset,c.focusNode,c.focusOffset))&&!this.suppressWidgetCursorChange(c,a))&&(this.view.observer.ignore(()=>{ue.android&&ue.chrome&&this.dom.contains(c.focusNode)&&P9(c.focusNode,this.dom)&&(this.dom.blur(),this.dom.focus({preventScroll:!0}));let f=Lc(this.view.root);if(f)if(a.empty){if(ue.gecko){let d=O9(l.node,l.offset);if(d&&d!=3){let h=(d==1?bD:yD)(l.node,l.offset);h&&(l=new Tn(h.node,h.offset))}}f.collapse(l.node,l.offset),a.bidiLevel!=null&&f.caretBidiLevel!==void 0&&(f.caretBidiLevel=a.bidiLevel)}else if(f.extend){f.collapse(l.node,l.offset);try{f.extend(u.node,u.offset)}catch{}}else{let d=document.createRange();a.anchor>a.head&&([l,u]=[u,l]),d.setEnd(u.node,u.offset),d.setStart(l.node,l.offset),f.removeAllRanges(),f.addRange(d)}s&&this.view.root.activeElement==this.dom&&(this.dom.blur(),r&&r.focus())}),this.view.observer.setSelectionRange(l,u)),this.impreciseAnchor=l.precise?null:new Tn(c.anchorNode,c.anchorOffset),this.impreciseHead=u.precise?null:new Tn(c.focusNode,c.focusOffset)}suppressWidgetCursorChange(e,n){return this.hasComposition&&n.empty&&cc(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)&&this.posFromDOM(e.focusNode,e.focusOffset)==n.head}enforceCursorAssoc(){if(this.hasComposition)return;let{view:e}=this,n=e.state.selection.main,r=Lc(e.root),{anchorNode:i,anchorOffset:s}=e.observer.selectionRange;if(!r||!n.empty||!n.assoc||!r.modify)return;let o=Jt.find(this,n.head);if(!o)return;let a=o.posAtStart;if(n.head==a||n.head==a+o.length)return;let l=this.coordsAt(n.head,-1),u=this.coordsAt(n.head,1);if(!l||!u||l.bottom>u.top)return;let c=this.domAtPos(n.head+n.assoc);r.collapse(c.node,c.offset),r.modify("move",n.assoc<0?"forward":"backward","lineboundary"),e.observer.readSelectionRange();let f=e.observer.selectionRange;e.docView.posFromDOM(f.anchorNode,f.anchorOffset)!=n.from&&r.collapse(i,s)}moveToLine(e){let n=this.dom,r;if(e.node!=n)return e;for(let i=e.offset;!r&&i=0;i--){let s=ut.get(n.childNodes[i]);s instanceof Jt&&(r=s.domAtPos(s.length))}return r?new Tn(r.node,r.offset,!0):e}nearest(e){for(let n=e;n;){let r=ut.get(n);if(r&&r.rootView==this)return r;n=n.parentNode}return null}posFromDOM(e,n){let r=this.nearest(e);if(!r)throw new RangeError("Trying to find position for a DOM position outside of the document");return r.localPosFromDOM(e,n)+r.posAtStart}domAtPos(e){let{i:n,off:r}=this.childCursor().findPos(e,-1);for(;n=0;o--){let a=this.children[o],l=s-a.breakAfter,u=l-a.length;if(le||a.covers(1))&&(!r||a instanceof Jt&&!(r instanceof Jt&&n>=0)))r=a,i=u;else if(r&&u==e&&l==e&&a instanceof gs&&Math.abs(n)<2){if(a.deco.startSide<0)break;o&&(r=null)}s=u}return r?r.coordsAt(e-i,n):null}coordsForChar(e){let{i:n,off:r}=this.childPos(e,1),i=this.children[n];if(!(i instanceof Jt))return null;for(;i.children.length;){let{i:a,off:l}=i.childPos(r,1);for(;;a++){if(a==i.children.length)return null;if((i=i.children[a]).length)break}r=l}if(!(i instanceof ui))return null;let s=wn(i.text,r);if(s==r)return null;let o=fa(i.dom,r,s).getClientRects();for(let a=0;aMath.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,a=-1,l=this.view.textDirection==Et.LTR;for(let u=0,c=0;ci)break;if(u>=r){let h=f.dom.getBoundingClientRect();if(n.push(h.height),o){let p=f.dom.lastChild,m=p?kl(p):[];if(m.length){let g=m[m.length-1],b=l?g.right-h.left:h.right-g.left;b>a&&(a=b,this.minWidth=s,this.minWidthFrom=u,this.minWidthTo=d)}}}u=d+f.breakAfter}return n}textDirectionAt(e){let{i:n}=this.childPos(e,1);return getComputedStyle(this.children[n].dom).direction=="rtl"?Et.RTL:Et.LTR}measureTextSize(){for(let s of this.children)if(s instanceof Jt){let o=s.measureTextSize();if(o)return o}let e=document.createElement("div"),n,r,i;return e.className="cm-line",e.style.width="99999px",e.style.position="absolute",e.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore(()=>{this.dom.appendChild(e);let s=kl(e.firstChild)[0];n=e.getBoundingClientRect().height,r=s?s.width/27:7,i=s?s.height:n,e.remove()}),{lineHeight:n,charWidth:r,textHeight:i}}childCursor(e=this.length){let n=this.children.length;return n&&(e-=this.children[--n].length),new vD(this.children,e,n)}computeBlockGapDeco(){let e=[],n=this.view.viewState;for(let r=0,i=0;;i++){let s=i==n.viewports.length?null:n.viewports[i],o=s?s.from-1:this.length;if(o>r){let a=(n.lineBlockAt(o).bottom-n.lineBlockAt(r).top)/this.view.scaleY;e.push(ve.replace({widget:new Sb(a),block:!0,inclusive:!0,isBlockGap:!0}).range(r,o))}if(!s)break;r=s.to+1}return ve.set(e)}updateDeco(){let e=1,n=this.view.state.facet(Bc).map(s=>(this.dynamicDecorationMap[e++]=typeof s=="function")?s(this.view):s),r=!1,i=this.view.state.facet(VD).map((s,o)=>{let a=typeof s=="function";return a&&(r=!0),a?s(this.view):s});for(i.length&&(this.dynamicDecorationMap[e++]=r,n.push(Xe.join(i))),this.decorations=[this.editContextFormatting,...n,this.computeBlockGapDeco(),this.view.viewState.lineGapDeco];en.anchor?-1:1),i;if(!r)return;!n.empty&&(i=this.coordsAt(n.anchor,n.anchor>n.head?-1:1))&&(r={left:Math.min(r.left,i.left),top:Math.min(r.top,i.top),right:Math.max(r.right,i.right),bottom:Math.max(r.bottom,i.bottom)});let s=Sv(this.view),o={left:r.left-s.left,top:r.top-s.top,right:r.right+s.right,bottom:r.bottom+s.bottom},{offsetWidth:a,offsetHeight:l}=this.view.scrollDOM;o9(this.view.scrollDOM,o,n.head{re.from&&(n=!0)}),n}function N9(t,e,n=1){let r=t.charCategorizer(e),i=t.doc.lineAt(e),s=e-i.from;if(i.length==0)return Y.cursor(e);s==0?n=1:s==i.length&&(n=-1);let o=s,a=s;n<0?o=wn(i.text,s,!1):a=wn(i.text,s);let l=r(i.text.slice(o,a));for(;o>0;){let u=wn(i.text,o,!1);if(r(i.text.slice(u,o))!=l)break;o=u}for(;at?e.left-t:Math.max(0,t-e.right)}function F9(t,e){return e.top>t?e.top-t:Math.max(0,t-e.bottom)}function mg(t,e){return t.tope.top+1}function sS(t,e){return et.bottom?{top:t.top,left:t.left,right:t.right,bottom:e}:t}function Ab(t,e,n){let r,i,s,o,a=!1,l,u,c,f;for(let p=t.firstChild;p;p=p.nextSibling){let m=kl(p);for(let g=0;gx||o==x&&s>y)&&(r=p,i=b,s=y,o=x,a=y?e0:gb.bottom&&(!c||c.bottomb.top)&&(u=p,f=b):c&&mg(c,b)?c=oS(c,b.bottom):f&&mg(f,b)&&(f=sS(f,b.top))}}if(c&&c.bottom>=n?(r=l,i=c):f&&f.top<=n&&(r=u,i=f),!r)return{node:t,offset:0};let d=Math.max(i.left,Math.min(i.right,e));if(r.nodeType==3)return aS(r,d,n);if(a&&r.contentEditable!="false")return Ab(r,d,n);let h=Array.prototype.indexOf.call(t.childNodes,r)+(e>=(i.left+i.right)/2?1:0);return{node:t,offset:h}}function aS(t,e,n){let r=t.nodeValue.length,i=-1,s=1e9,o=0;for(let a=0;an?c.top-n:n-c.bottom)-1;if(c.left-1<=e&&c.right+1>=e&&f=(c.left+c.right)/2,h=d;if((ue.chrome||ue.gecko)&&fa(t,a).getBoundingClientRect().left==c.right&&(h=!d),f<=0)return{node:t,offset:a+(h?1:0)};i=a+(h?1:0),s=f}}}return{node:t,offset:i>-1?i:o>0?t.nodeValue.length:0}}function GD(t,e,n,r=-1){var i,s;let o=t.contentDOM.getBoundingClientRect(),a=o.top+t.viewState.paddingTop,l,{docHeight:u}=t.viewState,{x:c,y:f}=e,d=f-a;if(d<0)return 0;if(d>u)return t.state.doc.length;for(let S=t.viewState.heightOracle.textHeight/2,E=!1;l=t.elementAtHeight(d),l.type!=Kn.Text;)for(;d=r>0?l.bottom+S:l.top-S,!(d>=0&&d<=u);){if(E)return n?null:0;E=!0,r=-r}f=a+d;let h=l.from;if(ht.viewport.to)return t.viewport.to==t.state.doc.length?t.state.doc.length:n?null:lS(t,o,l,c,f);let p=t.dom.ownerDocument,m=t.root.elementFromPoint?t.root:p,g=m.elementFromPoint(c,f);g&&!t.contentDOM.contains(g)&&(g=null),g||(c=Math.max(o.left+1,Math.min(o.right-1,c)),g=m.elementFromPoint(c,f),g&&!t.contentDOM.contains(g)&&(g=null));let b,y=-1;if(g&&((i=t.docView.nearest(g))===null||i===void 0?void 0:i.isEditable)!=!1){if(p.caretPositionFromPoint){let S=p.caretPositionFromPoint(c,f);S&&({offsetNode:b,offset:y}=S)}else if(p.caretRangeFromPoint){let S=p.caretRangeFromPoint(c,f);S&&({startContainer:b,startOffset:y}=S)}b&&(!t.contentDOM.contains(b)||ue.safari&&L9(b,y,c)||ue.chrome&&B9(b,y,c))&&(b=void 0),b&&(y=Math.min(Vi(b),y))}if(!b||!t.docView.dom.contains(b)){let S=Jt.find(t.docView,h);if(!S)return d>l.top+l.height/2?l.to:l.from;({node:b,offset:y}=Ab(S.dom,c,f))}let x=t.docView.nearest(b);if(!x)return null;if(x.isWidget&&((s=x.dom)===null||s===void 0?void 0:s.nodeType)==1){let S=x.dom.getBoundingClientRect();return e.yt.defaultLineHeight*1.5){let a=t.viewState.heightOracle.textHeight,l=Math.floor((i-n.top-(t.defaultLineHeight-a)*.5)/a);s+=l*t.viewState.heightOracle.lineLength}let o=t.state.sliceDoc(n.from,n.to);return n.from+fb(o,s,t.state.tabSize)}function WD(t,e,n){let r,i=t;if(t.nodeType!=3||e!=(r=t.nodeValue.length))return!1;for(;;){let s=i.nextSibling;if(s){if(s.nodeName=="BR")break;return!1}else{let o=i.parentNode;if(!o||o.nodeName=="DIV")break;i=o}}return fa(t,r-1,r).getBoundingClientRect().right>n}function L9(t,e,n){return WD(t,e,n)}function B9(t,e,n){if(e!=0)return WD(t,e,n);for(let i=t;;){let s=i.parentNode;if(!s||s.nodeType!=1||s.firstChild!=i)return!1;if(s.classList.contains("cm-line"))break;i=s}let r=t.nodeType==1?t.getBoundingClientRect():fa(t,0,Math.max(t.nodeValue.length,1)).getBoundingClientRect();return n-r.left>5}function Db(t,e,n){let r=t.lineBlockAt(e);if(Array.isArray(r.type)){let i;for(let s of r.type){if(s.from>e)break;if(!(s.toe)return s;(!i||s.type==Kn.Text&&(i.type!=s.type||(n<0?s.frome)))&&(i=s)}}return i||r}return r}function $9(t,e,n,r){let i=Db(t,e.head,e.assoc||-1),s=!r||i.type!=Kn.Text||!(t.lineWrapping||i.widgetLineBreaks)?null:t.coordsAtPos(e.assoc<0&&e.head>i.from?e.head-1:e.head);if(s){let o=t.dom.getBoundingClientRect(),a=t.textDirectionAt(i.from),l=t.posAtCoords({x:n==(a==Et.LTR)?o.right-1:o.left+1,y:(s.top+s.bottom)/2});if(l!=null)return Y.cursor(l,n?-1:1)}return Y.cursor(n?i.to:i.from,n?-1:1)}function uS(t,e,n,r){let i=t.state.doc.lineAt(e.head),s=t.bidiSpans(i),o=t.textDirectionAt(i.from);for(let a=e,l=null;;){let u=_9(i,s,o,a,n),c=TD;if(!u){if(i.number==(n?t.state.doc.lines:1))return a;c=` -`,i=t.state.doc.line(i.number+(n?1:-1)),s=t.bidiSpans(i),u=t.visualLineSide(i,!n)}if(l){if(!l(c))return a}else{if(!r)return u;l=r(c)}a=u}}function z9(t,e,n){let r=t.state.charCategorizer(e),i=r(n);return s=>{let o=r(s);return i==kt.Space&&(i=o),i==o}}function j9(t,e,n,r){let i=e.head,s=n?1:-1;if(i==(n?t.state.doc.length:0))return Y.cursor(i,e.assoc);let o=e.goalColumn,a,l=t.contentDOM.getBoundingClientRect(),u=t.coordsAtPos(i,e.assoc||-1),c=t.documentTop;if(u)o==null&&(o=u.left-l.left),a=s<0?u.top:u.bottom;else{let h=t.viewState.lineBlockAt(i);o==null&&(o=Math.min(l.right-l.left,t.defaultCharacterWidth*(i-h.from))),a=(s<0?h.top:h.bottom)+c}let f=l.left+o,d=r??t.viewState.heightOracle.textHeight>>1;for(let h=0;;h+=10){let p=a+(d+h)*s,m=GD(t,{x:f,y:p},!1,s);if(pl.bottom||(s<0?mi)){let g=t.docView.coordsForChar(m),b=!g||p{if(e>s&&ei(t)),n.from,e.head>n.from?-1:1);return r==n.from?n:Y.cursor(r,rs)&&!H9(o,n)&&this.lineBreak(),i=o}return this.findPointBefore(r,n),this}readTextNode(e){let n=e.nodeValue;for(let r of this.points)r.node==e&&(r.pos=this.text.length+Math.min(r.offset,n.length));for(let r=0,i=this.lineSeparator?null:/\r\n?|\n/g;;){let s=-1,o=1,a;if(this.lineSeparator?(s=n.indexOf(this.lineSeparator,r),o=this.lineSeparator.length):(a=i.exec(n))&&(s=a.index,o=a[0].length),this.append(n.slice(r,s<0?n.length:s)),s<0)break;if(this.lineBreak(),o>1)for(let l of this.points)l.node==e&&l.pos>this.text.length&&(l.pos-=o-1);r=s+o}}readNode(e){if(e.cmIgnore)return;let n=ut.get(e),r=n&&n.overrideDOMText;if(r!=null){this.findPointInside(e,r.length);for(let i=r.iter();!i.next().done;)i.lineBreak?this.lineBreak():this.append(i.value)}else e.nodeType==3?this.readTextNode(e):e.nodeName=="BR"?e.nextSibling&&this.lineBreak():e.nodeType==1&&this.readRange(e.firstChild,null)}findPointBefore(e,n){for(let r of this.points)r.node==e&&e.childNodes[r.offset]==n&&(r.pos=this.text.length)}findPointInside(e,n){for(let r of this.points)(e.nodeType==3?r.node==e:e.contains(r.node))&&(r.pos=this.text.length+(U9(e,r.node,r.offset)?n:0))}}function U9(t,e,n){for(;;){if(!e||n-1;let{impreciseHead:s,impreciseAnchor:o}=e.docView;if(e.state.readOnly&&n>-1)this.newSel=null;else if(n>-1&&(this.bounds=e.docView.domBoundsAround(n,r,0))){let a=s||o?[]:W9(e),l=new V9(a,e.state);l.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=l.text,this.newSel=K9(a,this.bounds.from)}else{let a=e.observer.selectionRange,l=s&&s.node==a.focusNode&&s.offset==a.focusOffset||!yb(e.contentDOM,a.focusNode)?e.state.selection.main.head:e.docView.posFromDOM(a.focusNode,a.focusOffset),u=o&&o.node==a.anchorNode&&o.offset==a.anchorOffset||!yb(e.contentDOM,a.anchorNode)?e.state.selection.main.anchor:e.docView.posFromDOM(a.anchorNode,a.anchorOffset),c=e.viewport;if((ue.ios||ue.chrome)&&e.state.selection.main.empty&&l!=u&&(c.from>0||c.toDate.now()-100?t.inputState.lastKeyCode:-1;if(e.bounds){let{from:o,to:a}=e.bounds,l=i.from,u=null;(s===8||ue.android&&e.text.length=i.from&&n.to<=i.to&&(n.from!=i.from||n.to!=i.to)&&i.to-i.from-(n.to-n.from)<=4?n={from:i.from,to:i.to,insert:t.state.doc.slice(i.from,n.from).append(n.insert).append(t.state.doc.slice(n.to,i.to))}:ue.chrome&&n&&n.from==n.to&&n.from==i.head&&n.insert.toString()==` - `&&t.lineWrapping&&(r&&(r=Y.single(r.main.anchor-1,r.main.head-1)),n={from:i.from,to:i.to,insert:Ze.of([" "])}),n)return Ev(t,n,r,s);if(r&&!r.main.eq(i)){let o=!1,a="select";return t.inputState.lastSelectionTime>Date.now()-50&&(t.inputState.lastSelectionOrigin=="select"&&(o=!0),a=t.inputState.lastSelectionOrigin,a=="select.pointer"&&(r=KD(t.state.facet(Mf).map(l=>l(t)),r))),t.dispatch({selection:r,scrollIntoView:o,userEvent:a}),!0}else return!1}function Ev(t,e,n,r=-1){if(ue.ios&&t.inputState.flushIOSKey(e))return!0;let i=t.state.selection.main;if(ue.android&&(e.to==i.to&&(e.from==i.from||e.from==i.from-1&&t.state.sliceDoc(e.from,i.from)==" ")&&e.insert.length==1&&e.insert.lines==2&&cl(t.contentDOM,"Enter",13)||(e.from==i.from-1&&e.to==i.to&&e.insert.length==0||r==8&&e.insert.lengthi.head)&&cl(t.contentDOM,"Backspace",8)||e.from==i.from&&e.to==i.to+1&&e.insert.length==0&&cl(t.contentDOM,"Delete",46)))return!0;let s=e.insert.toString();t.inputState.composing>=0&&t.inputState.composing++;let o,a=()=>o||(o=G9(t,e,n));return t.state.facet(MD).some(l=>l(t,e.from,e.to,s,a))||t.dispatch(a()),!0}function G9(t,e,n){let r,i=t.state,s=i.selection.main,o=-1;if(e.from==e.to&&e.froms.to){let l=e.fromf(t)),u,l);e.from==c&&(o=c)}if(o>-1)r={changes:e,selection:Y.cursor(e.from+e.insert.length,-1)};else if(e.from>=s.from&&e.to<=s.to&&e.to-e.from>=(s.to-s.from)/3&&(!n||n.main.empty&&n.main.from==e.from+e.insert.length)&&t.inputState.composing<0){let l=s.frome.to?i.sliceDoc(e.to,s.to):"";r=i.replaceSelection(t.state.toText(l+e.insert.sliceString(0,void 0,t.state.lineBreak)+u))}else{let l=i.changes(e),u=n&&n.main.to<=l.newLength?n.main:void 0;if(i.selection.ranges.length>1&&t.inputState.composing>=0&&e.to<=s.to&&e.to>=s.to-10){let c=t.state.sliceDoc(e.from,e.to),f,d=n&&qD(t,n.main.head);if(d){let m=e.insert.length-(e.to-e.from);f={from:d.from,to:d.to-m}}else f=t.state.doc.lineAt(s.head);let h=s.to-e.to,p=s.to-s.from;r=i.changeByRange(m=>{if(m.from==s.from&&m.to==s.to)return{changes:l,range:u||m.map(l)};let g=m.to-h,b=g-c.length;if(m.to-m.from!=p||t.state.sliceDoc(b,g)!=c||m.to>=f.from&&m.from<=f.to)return{range:m};let y=i.changes({from:b,to:g,insert:e.insert}),x=m.to-s.to;return{changes:y,range:u?Y.range(Math.max(0,u.anchor+x),Math.max(0,u.head+x)):m.map(y)}})}else r={changes:l,selection:u&&i.selection.replaceRange(u)}}let a="input.type";return(t.composing||t.inputState.compositionPendingChange&&t.inputState.compositionEndedAt>Date.now()-50)&&(t.inputState.compositionPendingChange=!1,a+=".compose",t.inputState.compositionFirstChange&&(a+=".start",t.inputState.compositionFirstChange=!1)),i.update(r,{userEvent:a,scrollIntoView:!0})}function YD(t,e,n,r){let i=Math.min(t.length,e.length),s=0;for(;s0&&a>0&&t.charCodeAt(o-1)==e.charCodeAt(a-1);)o--,a--;if(r=="end"){let l=Math.max(0,s-Math.min(o,a));n-=o+l-s}if(o=o?s-n:0;s-=l,a=s+(a-o),o=s}else if(a=a?s-n:0;s-=l,o=s+(o-a),a=s}return{from:s,toA:o,toB:a}}function W9(t){let e=[];if(t.root.activeElement!=t.contentDOM)return e;let{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:s}=t.observer.selectionRange;return n&&(e.push(new cS(n,r)),(i!=n||s!=r)&&e.push(new cS(i,s))),e}function K9(t,e){if(t.length==0)return null;let n=t[0].pos,r=t.length==2?t[1].pos:n;return n>-1&&r>-1?Y.single(n+e,r+e):null}class X9{setSelectionOrigin(e){this.lastSelectionOrigin=e,this.lastSelectionTime=Date.now()}constructor(e){this.view=e,this.lastKeyCode=0,this.lastKeyTime=0,this.lastTouchTime=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.pendingIOSKey=void 0,this.tabFocusMode=-1,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastContextMenu=0,this.scrollHandlers=[],this.handlers=Object.create(null),this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.compositionPendingKey=!1,this.compositionPendingChange=!1,this.mouseSelection=null,this.draggedContent=null,this.handleEvent=this.handleEvent.bind(this),this.notifiedFocused=e.hasFocus,ue.safari&&e.contentDOM.addEventListener("input",()=>null),ue.gecko&&fL(e.contentDOM.ownerDocument)}handleEvent(e){!rL(this.view,e)||this.ignoreDuringComposition(e)||e.type=="keydown"&&this.keydown(e)||(this.view.updateState!=0?Promise.resolve().then(()=>this.runHandlers(e.type,e)):this.runHandlers(e.type,e))}runHandlers(e,n){let r=this.handlers[e];if(r){for(let i of r.observers)i(this.view,n);for(let i of r.handlers){if(n.defaultPrevented)break;if(i(this.view,n)){n.preventDefault();break}}}}ensureHandlers(e){let n=Y9(e),r=this.handlers,i=this.view.contentDOM;for(let s in n)if(s!="scroll"){let o=!n[s].handlers.length,a=r[s];a&&o!=!a.handlers.length&&(i.removeEventListener(s,this.handleEvent),a=null),a||i.addEventListener(s,this.handleEvent,{passive:o})}for(let s in r)s!="scroll"&&!n[s]&&i.removeEventListener(s,this.handleEvent);this.handlers=n}keydown(e){if(this.lastKeyCode=e.keyCode,this.lastKeyTime=Date.now(),e.keyCode==9&&this.tabFocusMode>-1&&(!this.tabFocusMode||Date.now()<=this.tabFocusMode))return!0;if(this.tabFocusMode>0&&e.keyCode!=27&&ZD.indexOf(e.keyCode)<0&&(this.tabFocusMode=-1),ue.android&&ue.chrome&&!e.synthetic&&(e.keyCode==13||e.keyCode==8))return this.view.observer.delayAndroidKey(e.key,e.keyCode),!0;let n;return ue.ios&&!e.synthetic&&!e.altKey&&!e.metaKey&&((n=JD.find(r=>r.keyCode==e.keyCode))&&!e.ctrlKey||J9.indexOf(e.key)>-1&&e.ctrlKey&&!e.shiftKey)?(this.pendingIOSKey=n||e,setTimeout(()=>this.flushIOSKey(),250),!0):(e.keyCode!=229&&this.view.observer.forceFlush(),!1)}flushIOSKey(e){let n=this.pendingIOSKey;return!n||n.key=="Enter"&&e&&e.from0?!0:ue.safari&&!ue.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100?(this.compositionPendingKey=!1,!0):!1}startMouseSelection(e){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=e}update(e){this.view.observer.update(e),this.mouseSelection&&this.mouseSelection.update(e),this.draggedContent&&e.docChanged&&(this.draggedContent=this.draggedContent.map(e.changes)),e.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}}function fS(t,e){return(n,r)=>{try{return e.call(t,r,n)}catch(i){qn(n.state,i)}}}function Y9(t){let e=Object.create(null);function n(r){return e[r]||(e[r]={observers:[],handlers:[]})}for(let r of t){let i=r.spec,s=i&&i.plugin.domEventHandlers,o=i&&i.plugin.domEventObservers;if(s)for(let a in s){let l=s[a];l&&n(a).handlers.push(fS(r.value,l))}if(o)for(let a in o){let l=o[a];l&&n(a).observers.push(fS(r.value,l))}}for(let r in ci)n(r).handlers.push(ci[r]);for(let r in qr)n(r).observers.push(qr[r]);return e}const JD=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],J9="dthko",ZD=[16,17,18,20,91,92,224,225],_d=6;function Cd(t){return Math.max(0,t)*.7+8}function Z9(t,e){return Math.max(Math.abs(t.clientX-e.clientX),Math.abs(t.clientY-e.clientY))}class Q9{constructor(e,n,r,i){this.view=e,this.startEvent=n,this.style=r,this.mustSelect=i,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=n,this.scrollParents=a9(e.contentDOM),this.atoms=e.state.facet(Mf).map(o=>o(e));let s=e.contentDOM.ownerDocument;s.addEventListener("mousemove",this.move=this.move.bind(this)),s.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=n.shiftKey,this.multiple=e.state.facet(Ue.allowMultipleSelections)&&eL(e,n),this.dragging=nL(e,n)&&tk(n)==1?null:!1}start(e){this.dragging===!1&&this.select(e)}move(e){if(e.buttons==0)return this.destroy();if(this.dragging||this.dragging==null&&Z9(this.startEvent,e)<10)return;this.select(this.lastEvent=e);let n=0,r=0,i=0,s=0,o=this.view.win.innerWidth,a=this.view.win.innerHeight;this.scrollParents.x&&({left:i,right:o}=this.scrollParents.x.getBoundingClientRect()),this.scrollParents.y&&({top:s,bottom:a}=this.scrollParents.y.getBoundingClientRect());let l=Sv(this.view);e.clientX-l.left<=i+_d?n=-Cd(i-e.clientX):e.clientX+l.right>=o-_d&&(n=Cd(e.clientX-o)),e.clientY-l.top<=s+_d?r=-Cd(s-e.clientY):e.clientY+l.bottom>=a-_d&&(r=Cd(e.clientY-a)),this.setScrollSpeed(n,r)}up(e){this.dragging==null&&this.select(this.lastEvent),this.dragging||e.preventDefault(),this.destroy()}destroy(){this.setScrollSpeed(0,0);let e=this.view.contentDOM.ownerDocument;e.removeEventListener("mousemove",this.move),e.removeEventListener("mouseup",this.up),this.view.inputState.mouseSelection=this.view.inputState.draggedContent=null}setScrollSpeed(e,n){this.scrollSpeed={x:e,y:n},e||n?this.scrolling<0&&(this.scrolling=setInterval(()=>this.scroll(),50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1)}scroll(){let{x:e,y:n}=this.scrollSpeed;e&&this.scrollParents.x&&(this.scrollParents.x.scrollLeft+=e,e=0),n&&this.scrollParents.y&&(this.scrollParents.y.scrollTop+=n,n=0),(e||n)&&this.view.win.scrollBy(e,n),this.dragging===!1&&this.select(this.lastEvent)}select(e){let{view:n}=this,r=KD(this.atoms,this.style.get(e,this.extend,this.multiple));(this.mustSelect||!r.eq(n.state.selection,this.dragging===!1))&&this.view.dispatch({selection:r,userEvent:"select.pointer"}),this.mustSelect=!1}update(e){e.transactions.some(n=>n.isUserEvent("input.type"))?this.destroy():this.style.update(e)&&setTimeout(()=>this.select(this.lastEvent),20)}}function eL(t,e){let n=t.state.facet(ID);return n.length?n[0](e):ue.mac?e.metaKey:e.ctrlKey}function tL(t,e){let n=t.state.facet(PD);return n.length?n[0](e):ue.mac?!e.altKey:!e.ctrlKey}function nL(t,e){let{main:n}=t.state.selection;if(n.empty)return!1;let r=Lc(t.root);if(!r||r.rangeCount==0)return!0;let i=r.getRangeAt(0).getClientRects();for(let s=0;s=e.clientX&&o.top<=e.clientY&&o.bottom>=e.clientY)return!0}return!1}function rL(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let n=e.target,r;n!=t.contentDOM;n=n.parentNode)if(!n||n.nodeType==11||(r=ut.get(n))&&r.ignoreEvent(e))return!1;return!0}const ci=Object.create(null),qr=Object.create(null),QD=ue.ie&&ue.ie_version<15||ue.ios&&ue.webkit_version<604;function iL(t){let e=t.dom.parentNode;if(!e)return;let n=e.appendChild(document.createElement("textarea"));n.style.cssText="position: fixed; left: -10000px; top: 10px",n.focus(),setTimeout(()=>{t.focus(),n.remove(),ek(t,n.value)},50)}function W0(t,e,n){for(let r of t.facet(e))n=r(n,t);return n}function ek(t,e){e=W0(t.state,yv,e);let{state:n}=t,r,i=1,s=n.toText(e),o=s.lines==n.selection.ranges.length;if(kb!=null&&n.selection.ranges.every(l=>l.empty)&&kb==s.toString()){let l=-1;r=n.changeByRange(u=>{let c=n.doc.lineAt(u.from);if(c.from==l)return{range:u};l=c.from;let f=n.toText((o?s.line(i++).text:e)+n.lineBreak);return{changes:{from:c.from,insert:f},range:Y.cursor(u.from+f.length)}})}else o?r=n.changeByRange(l=>{let u=s.line(i++);return{changes:{from:l.from,to:l.to,insert:u.text},range:Y.cursor(l.from+u.length)}}):r=n.replaceSelection(s);t.dispatch(r,{userEvent:"input.paste",scrollIntoView:!0})}qr.scroll=t=>{t.inputState.lastScrollTop=t.scrollDOM.scrollTop,t.inputState.lastScrollLeft=t.scrollDOM.scrollLeft};ci.keydown=(t,e)=>(t.inputState.setSelectionOrigin("select"),e.keyCode==27&&t.inputState.tabFocusMode!=0&&(t.inputState.tabFocusMode=Date.now()+2e3),!1);qr.touchstart=(t,e)=>{t.inputState.lastTouchTime=Date.now(),t.inputState.setSelectionOrigin("select.pointer")};qr.touchmove=t=>{t.inputState.setSelectionOrigin("select.pointer")};ci.mousedown=(t,e)=>{if(t.observer.flush(),t.inputState.lastTouchTime>Date.now()-2e3)return!1;let n=null;for(let r of t.state.facet(RD))if(n=r(t,e),n)break;if(!n&&e.button==0&&(n=aL(t,e)),n){let r=!t.hasFocus;t.inputState.startMouseSelection(new Q9(t,e,n,r)),r&&t.observer.ignore(()=>{pD(t.contentDOM);let s=t.root.activeElement;s&&!s.contains(t.contentDOM)&&s.blur()});let i=t.inputState.mouseSelection;if(i)return i.start(e),i.dragging===!1}else t.inputState.setSelectionOrigin("select.pointer");return!1};function dS(t,e,n,r){if(r==1)return Y.cursor(e,n);if(r==2)return N9(t.state,e,n);{let i=Jt.find(t.docView,e),s=t.state.doc.lineAt(i?i.posAtEnd:e),o=i?i.posAtStart:s.from,a=i?i.posAtEnd:s.to;return ae>=n.top&&e<=n.bottom&&t>=n.left&&t<=n.right;function sL(t,e,n,r){let i=Jt.find(t.docView,e);if(!i)return 1;let s=e-i.posAtStart;if(s==0)return 1;if(s==i.length)return-1;let o=i.coordsAt(s,-1);if(o&&hS(n,r,o))return-1;let a=i.coordsAt(s,1);return a&&hS(n,r,a)?1:o&&o.bottom>=r?-1:1}function pS(t,e){let n=t.posAtCoords({x:e.clientX,y:e.clientY},!1);return{pos:n,bias:sL(t,n,e.clientX,e.clientY)}}const oL=ue.ie&&ue.ie_version<=11;let mS=null,gS=0,bS=0;function tk(t){if(!oL)return t.detail;let e=mS,n=bS;return mS=t,bS=Date.now(),gS=!e||n>Date.now()-400&&Math.abs(e.clientX-t.clientX)<2&&Math.abs(e.clientY-t.clientY)<2?(gS+1)%3:1}function aL(t,e){let n=pS(t,e),r=tk(e),i=t.state.selection;return{update(s){s.docChanged&&(n.pos=s.changes.mapPos(n.pos),i=i.map(s.changes))},get(s,o,a){let l=pS(t,s),u,c=dS(t,l.pos,l.bias,r);if(n.pos!=l.pos&&!o){let f=dS(t,n.pos,n.bias,r),d=Math.min(f.from,c.from),h=Math.max(f.to,c.to);c=d1&&(u=lL(i,l.pos))?u:a?i.addRange(c):Y.create([c])}}}function lL(t,e){for(let n=0;n=e)return Y.create(t.ranges.slice(0,n).concat(t.ranges.slice(n+1)),t.mainIndex==n?0:t.mainIndex-(t.mainIndex>n?1:0))}return null}ci.dragstart=(t,e)=>{let{selection:{main:n}}=t.state;if(e.target.draggable){let i=t.docView.nearest(e.target);if(i&&i.isWidget){let s=i.posAtStart,o=s+i.length;(s>=n.to||o<=n.from)&&(n=Y.range(s,o))}}let{inputState:r}=t;return r.mouseSelection&&(r.mouseSelection.dragging=!0),r.draggedContent=n,e.dataTransfer&&(e.dataTransfer.setData("Text",W0(t.state,vv,t.state.sliceDoc(n.from,n.to))),e.dataTransfer.effectAllowed="copyMove"),!1};ci.dragend=t=>(t.inputState.draggedContent=null,!1);function yS(t,e,n,r){if(n=W0(t.state,yv,n),!n)return;let i=t.posAtCoords({x:e.clientX,y:e.clientY},!1),{draggedContent:s}=t.inputState,o=r&&s&&tL(t,e)?{from:s.from,to:s.to}:null,a={from:i,insert:n},l=t.state.changes(o?[o,a]:a);t.focus(),t.dispatch({changes:l,selection:{anchor:l.mapPos(i,-1),head:l.mapPos(i,1)},userEvent:o?"move.drop":"input.drop"}),t.inputState.draggedContent=null}ci.drop=(t,e)=>{if(!e.dataTransfer)return!1;if(t.state.readOnly)return!0;let n=e.dataTransfer.files;if(n&&n.length){let r=Array(n.length),i=0,s=()=>{++i==n.length&&yS(t,e,r.filter(o=>o!=null).join(t.state.lineBreak),!1)};for(let o=0;o{/[\x00-\x08\x0e-\x1f]{2}/.test(a.result)||(r[o]=a.result),s()},a.readAsText(n[o])}return!0}else{let r=e.dataTransfer.getData("Text");if(r)return yS(t,e,r,!0),!0}return!1};ci.paste=(t,e)=>{if(t.state.readOnly)return!0;t.observer.flush();let n=QD?null:e.clipboardData;return n?(ek(t,n.getData("text/plain")||n.getData("text/uri-list")),!0):(iL(t),!1)};function uL(t,e){let n=t.dom.parentNode;if(!n)return;let r=n.appendChild(document.createElement("textarea"));r.style.cssText="position: fixed; left: -10000px; top: 10px",r.value=e,r.focus(),r.selectionEnd=e.length,r.selectionStart=0,setTimeout(()=>{r.remove(),t.focus()},50)}function cL(t){let e=[],n=[],r=!1;for(let i of t.selection.ranges)i.empty||(e.push(t.sliceDoc(i.from,i.to)),n.push(i));if(!e.length){let i=-1;for(let{from:s}of t.selection.ranges){let o=t.doc.lineAt(s);o.number>i&&(e.push(o.text),n.push({from:o.from,to:Math.min(t.doc.length,o.to+1)})),i=o.number}r=!0}return{text:W0(t,vv,e.join(t.lineBreak)),ranges:n,linewise:r}}let kb=null;ci.copy=ci.cut=(t,e)=>{let{text:n,ranges:r,linewise:i}=cL(t.state);if(!n&&!i)return!1;kb=i?n:null,e.type=="cut"&&!t.state.readOnly&&t.dispatch({changes:r,scrollIntoView:!0,userEvent:"delete.cut"});let s=QD?null:e.clipboardData;return s?(s.clearData(),s.setData("text/plain",n),!0):(uL(t,n),!1)};const nk=As.define();function rk(t,e){let n=[];for(let r of t.facet(FD)){let i=r(t,e);i&&n.push(i)}return n.length?t.update({effects:n,annotations:nk.of(!0)}):null}function ik(t){setTimeout(()=>{let e=t.hasFocus;if(e!=t.inputState.notifiedFocused){let n=rk(t.state,e);n?t.dispatch(n):t.update([])}},10)}qr.focus=t=>{t.inputState.lastFocusTime=Date.now(),!t.scrollDOM.scrollTop&&(t.inputState.lastScrollTop||t.inputState.lastScrollLeft)&&(t.scrollDOM.scrollTop=t.inputState.lastScrollTop,t.scrollDOM.scrollLeft=t.inputState.lastScrollLeft),ik(t)};qr.blur=t=>{t.observer.clearSelectionRange(),ik(t)};qr.compositionstart=qr.compositionupdate=t=>{t.observer.editContext||(t.inputState.compositionFirstChange==null&&(t.inputState.compositionFirstChange=!0),t.inputState.composing<0&&(t.inputState.composing=0))};qr.compositionend=t=>{t.observer.editContext||(t.inputState.composing=-1,t.inputState.compositionEndedAt=Date.now(),t.inputState.compositionPendingKey=!0,t.inputState.compositionPendingChange=t.observer.pendingRecords().length>0,t.inputState.compositionFirstChange=null,ue.chrome&&ue.android?t.observer.flushSoon():t.inputState.compositionPendingChange?Promise.resolve().then(()=>t.observer.flush()):setTimeout(()=>{t.inputState.composing<0&&t.docView.hasComposition&&t.update([])},50))};qr.contextmenu=t=>{t.inputState.lastContextMenu=Date.now()};ci.beforeinput=(t,e)=>{var n,r;if(e.inputType=="insertReplacementText"&&t.observer.editContext){let s=(n=e.dataTransfer)===null||n===void 0?void 0:n.getData("text/plain"),o=e.getTargetRanges();if(s&&o.length){let a=o[0],l=t.posAtDOM(a.startContainer,a.startOffset),u=t.posAtDOM(a.endContainer,a.endOffset);return Ev(t,{from:l,to:u,insert:t.state.toText(s)},null),!0}}let i;if(ue.chrome&&ue.android&&(i=JD.find(s=>s.inputType==e.inputType))&&(t.observer.delayAndroidKey(i.key,i.keyCode),i.key=="Backspace"||i.key=="Delete")){let s=((r=window.visualViewport)===null||r===void 0?void 0:r.height)||0;setTimeout(()=>{var o;(((o=window.visualViewport)===null||o===void 0?void 0:o.height)||0)>s+10&&t.hasFocus&&(t.contentDOM.blur(),t.focus())},100)}return ue.ios&&e.inputType=="deleteContentForward"&&t.observer.flushSoon(),ue.safari&&e.inputType=="insertText"&&t.inputState.composing>=0&&setTimeout(()=>qr.compositionend(t,e),20),!1};const vS=new Set;function fL(t){vS.has(t)||(vS.add(t),t.addEventListener("copy",()=>{}),t.addEventListener("cut",()=>{}))}const xS=["pre-wrap","normal","pre-line","break-spaces"];let Il=!1;function SS(){Il=!1}class dL{constructor(e){this.lineWrapping=e,this.doc=Ze.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30}heightForGap(e,n){let r=this.doc.lineAt(n).number-this.doc.lineAt(e).number+1;return this.lineWrapping&&(r+=Math.max(0,Math.ceil((n-e-r*this.lineLength*.5)/this.lineLength))),this.lineHeight*r}heightForLine(e){return this.lineWrapping?(1+Math.max(0,Math.ceil((e-this.lineLength)/Math.max(1,this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(e){return this.doc=e,this}mustRefreshForWrapping(e){return xS.indexOf(e)>-1!=this.lineWrapping}mustRefreshForHeights(e){let n=!1;for(let r=0;r-1,l=Math.round(n)!=Math.round(this.lineHeight)||this.lineWrapping!=a;if(this.lineWrapping=a,this.lineHeight=n,this.charWidth=r,this.textHeight=i,this.lineLength=s,l){this.heightSamples={};for(let u=0;u0}set outdated(e){this.flags=(e?2:0)|this.flags&-3}setHeight(e){this.height!=e&&(Math.abs(this.height-e)>Dh&&(Il=!0),this.height=e)}replace(e,n,r){return Xn.of(r)}decomposeLeft(e,n){n.push(this)}decomposeRight(e,n){n.push(this)}applyChanges(e,n,r,i){let s=this,o=r.doc;for(let a=i.length-1;a>=0;a--){let{fromA:l,toA:u,fromB:c,toB:f}=i[a],d=s.lineAt(l,vt.ByPosNoHeight,r.setDoc(n),0,0),h=d.to>=u?d:s.lineAt(u,vt.ByPosNoHeight,r,0,0);for(f+=h.to-u,u=h.to;a>0&&d.from<=i[a-1].toA;)l=i[a-1].fromA,c=i[a-1].fromB,a--,ls*2){let a=e[n-1];a.break?e.splice(--n,1,a.left,null,a.right):e.splice(--n,1,a.left,a.right),r+=1+a.break,i-=a.size}else if(s>i*2){let a=e[r];a.break?e.splice(r,1,a.left,null,a.right):e.splice(r,1,a.left,a.right),r+=2+a.break,s-=a.size}else break;else if(i=s&&o(this.blockAt(0,r,i,s))}updateHeight(e,n=0,r=!1,i){return i&&i.from<=n&&i.more&&this.setHeight(i.heights[i.index++]),this.outdated=!1,this}toString(){return`block(${this.length})`}}class Sr extends sk{constructor(e,n){super(e,n,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0}blockAt(e,n,r,i){return new ki(i,this.length,r,this.height,this.breaks)}replace(e,n,r){let i=r[0];return r.length==1&&(i instanceof Sr||i instanceof xn&&i.flags&4)&&Math.abs(this.length-i.length)<10?(i instanceof xn?i=new Sr(i.length,this.height):i.height=this.height,this.outdated||(i.outdated=!1),i):Xn.of(r)}updateHeight(e,n=0,r=!1,i){return i&&i.from<=n&&i.more?this.setHeight(i.heights[i.index++]):(r||this.outdated)&&this.setHeight(Math.max(this.widgetHeight,e.heightForLine(this.length-this.collapsed))+this.breaks*e.lineHeight),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:""}${this.widgetHeight?":"+this.widgetHeight:""})`}}class xn extends Xn{constructor(e){super(e,0)}heightMetrics(e,n){let r=e.doc.lineAt(n).number,i=e.doc.lineAt(n+this.length).number,s=i-r+1,o,a=0;if(e.lineWrapping){let l=Math.min(this.height,e.lineHeight*s);o=l/s,this.length>s+1&&(a=(this.height-l)/(this.length-s-1))}else o=this.height/s;return{firstLine:r,lastLine:i,perLine:o,perChar:a}}blockAt(e,n,r,i){let{firstLine:s,lastLine:o,perLine:a,perChar:l}=this.heightMetrics(n,i);if(n.lineWrapping){let u=i+(e0){let s=r[r.length-1];s instanceof xn?r[r.length-1]=new xn(s.length+i):r.push(null,new xn(i-1))}if(e>0){let s=r[0];s instanceof xn?r[0]=new xn(e+s.length):r.unshift(new xn(e-1),null)}return Xn.of(r)}decomposeLeft(e,n){n.push(new xn(e-1),null)}decomposeRight(e,n){n.push(null,new xn(this.length-e-1))}updateHeight(e,n=0,r=!1,i){let s=n+this.length;if(i&&i.from<=n+this.length&&i.more){let o=[],a=Math.max(n,i.from),l=-1;for(i.from>n&&o.push(new xn(i.from-n-1).updateHeight(e,n));a<=s&&i.more;){let c=e.doc.lineAt(a).length;o.length&&o.push(null);let f=i.heights[i.index++];l==-1?l=f:Math.abs(f-l)>=Dh&&(l=-2);let d=new Sr(c,f);d.outdated=!1,o.push(d),a+=c+1}a<=s&&o.push(null,new xn(s-a).updateHeight(e,a));let u=Xn.of(o);return(l<0||Math.abs(u.height-this.height)>=Dh||Math.abs(l-this.heightMetrics(e,n).perLine)>=Dh)&&(Il=!0),vp(this,u)}else(r||this.outdated)&&(this.setHeight(e.heightForGap(n,n+this.length)),this.outdated=!1);return this}toString(){return`gap(${this.length})`}}class pL extends Xn{constructor(e,n,r){super(e.length+n+r.length,e.height+r.height,n|(e.outdated||r.outdated?2:0)),this.left=e,this.right=r,this.size=e.size+r.size}get break(){return this.flags&1}blockAt(e,n,r,i){let s=r+this.left.height;return ea))return u;let c=n==vt.ByPosNoHeight?vt.ByPosNoHeight:vt.ByPos;return l?u.join(this.right.lineAt(a,c,r,o,a)):this.left.lineAt(a,c,r,i,s).join(u)}forEachLine(e,n,r,i,s,o){let a=i+this.left.height,l=s+this.left.length+this.break;if(this.break)e=l&&this.right.forEachLine(e,n,r,a,l,o);else{let u=this.lineAt(l,vt.ByPos,r,i,s);e=e&&u.from<=n&&o(u),n>u.to&&this.right.forEachLine(u.to+1,n,r,a,l,o)}}replace(e,n,r){let i=this.left.length+this.break;if(nthis.left.length)return this.balanced(this.left,this.right.replace(e-i,n-i,r));let s=[];e>0&&this.decomposeLeft(e,s);let o=s.length;for(let a of r)s.push(a);if(e>0&&ES(s,o-1),n=r&&n.push(null)),e>r&&this.right.decomposeLeft(e-r,n)}decomposeRight(e,n){let r=this.left.length,i=r+this.break;if(e>=i)return this.right.decomposeRight(e-i,n);e2*n.size||n.size>2*e.size?Xn.of(this.break?[e,null,n]:[e,n]):(this.left=vp(this.left,e),this.right=vp(this.right,n),this.setHeight(e.height+n.height),this.outdated=e.outdated||n.outdated,this.size=e.size+n.size,this.length=e.length+this.break+n.length,this)}updateHeight(e,n=0,r=!1,i){let{left:s,right:o}=this,a=n+s.length+this.break,l=null;return i&&i.from<=n+s.length&&i.more?l=s=s.updateHeight(e,n,r,i):s.updateHeight(e,n,r),i&&i.from<=a+o.length&&i.more?l=o=o.updateHeight(e,a,r,i):o.updateHeight(e,a,r),l?this.balanced(s,o):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function ES(t,e){let n,r;t[e]==null&&(n=t[e-1])instanceof xn&&(r=t[e+1])instanceof xn&&t.splice(e-1,3,new xn(n.length+1+r.length))}const mL=5;class wv{constructor(e,n){this.pos=e,this.oracle=n,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=e}get isCovered(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}span(e,n){if(this.lineStart>-1){let r=Math.min(n,this.lineEnd),i=this.nodes[this.nodes.length-1];i instanceof Sr?i.length+=r-this.pos:(r>this.pos||!this.isCovered)&&this.nodes.push(new Sr(r-this.pos,-1)),this.writtenTo=r,n>r&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=n}point(e,n,r){if(e=mL)&&this.addLineDeco(i,s,o)}else n>e&&this.span(e,n);this.lineEnd>-1&&this.lineEnd-1)return;let{from:e,to:n}=this.oracle.doc.lineAt(this.pos);this.lineStart=e,this.lineEnd=n,this.writtenToe&&this.nodes.push(new Sr(this.pos-e,-1)),this.writtenTo=this.pos}blankContent(e,n){let r=new xn(n-e);return this.oracle.doc.lineAt(e).to==n&&(r.flags|=4),r}ensureLine(){this.enterLine();let e=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(e instanceof Sr)return e;let n=new Sr(0,-1);return this.nodes.push(n),n}addBlock(e){this.enterLine();let n=e.deco;n&&n.startSide>0&&!this.isCovered&&this.ensureLine(),this.nodes.push(e),this.writtenTo=this.pos=this.pos+e.length,n&&n.endSide>0&&(this.covering=e)}addLineDeco(e,n,r){let i=this.ensureLine();i.length+=r,i.collapsed+=r,i.widgetHeight=Math.max(i.widgetHeight,e),i.breaks+=n,this.writtenTo=this.pos=this.pos+r}finish(e){let n=this.nodes.length==0?null:this.nodes[this.nodes.length-1];this.lineStart>-1&&!(n instanceof Sr)&&!this.isCovered?this.nodes.push(new Sr(0,-1)):(this.writtenToc.clientHeight||c.scrollWidth>c.clientWidth)&&f.overflow!="visible"){let d=c.getBoundingClientRect();s=Math.max(s,d.left),o=Math.min(o,d.right),a=Math.max(a,d.top),l=Math.min(u==t.parentNode?i.innerHeight:l,d.bottom)}u=f.position=="absolute"||f.position=="fixed"?c.offsetParent:c.parentNode}else if(u.nodeType==11)u=u.host;else break;return{left:s-n.left,right:Math.max(s,o)-n.left,top:a-(n.top+e),bottom:Math.max(a,l)-(n.top+e)}}function vL(t){let e=t.getBoundingClientRect(),n=t.ownerDocument.defaultView||window;return e.left0&&e.top0}function xL(t,e){let n=t.getBoundingClientRect();return{left:0,right:n.right-n.left,top:e,bottom:n.bottom-(n.top+e)}}class bg{constructor(e,n,r,i){this.from=e,this.to=n,this.size=r,this.displaySize=i}static same(e,n){if(e.length!=n.length)return!1;for(let r=0;rtypeof r!="function"&&r.class=="cm-lineWrapping");this.heightOracle=new dL(n),this.stateDeco=e.facet(Bc).filter(r=>typeof r!="function"),this.heightMap=Xn.empty().applyChanges(this.stateDeco,Ze.empty,this.heightOracle.setDoc(e.doc),[new jr(0,0,0,e.doc.length)]);for(let r=0;r<2&&(this.viewport=this.getViewport(0,null),!!this.updateForViewport());r++);this.updateViewportLines(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=ve.set(this.lineGaps.map(r=>r.draw(this,!1))),this.computeVisibleRanges()}updateForViewport(){let e=[this.viewport],{main:n}=this.state.selection;for(let r=0;r<=1;r++){let i=r?n.head:n.anchor;if(!e.some(({from:s,to:o})=>i>=s&&i<=o)){let{from:s,to:o}=this.lineBlockAt(i);e.push(new Ad(s,o))}}return this.viewports=e.sort((r,i)=>r.from-i.from),this.updateScaler()}updateScaler(){let e=this.scaler;return this.scaler=this.heightMap.height<=7e6?_S:new _v(this.heightOracle,this.heightMap,this.viewports),e.eq(this.scaler)?0:2}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.heightOracle.setDoc(this.state.doc),0,0,e=>{this.viewportLines.push(Xu(e,this.scaler))})}update(e,n=null){this.state=e.state;let r=this.stateDeco;this.stateDeco=this.state.facet(Bc).filter(c=>typeof c!="function");let i=e.changedRanges,s=jr.extendWithRanges(i,gL(r,this.stateDeco,e?e.changes:sn.empty(this.state.doc.length))),o=this.heightMap.height,a=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollTop);SS(),this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),s),(this.heightMap.height!=o||Il)&&(e.flags|=2),a?(this.scrollAnchorPos=e.changes.mapPos(a.from,-1),this.scrollAnchorHeight=a.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=o);let l=s.length?this.mapViewport(this.viewport,e.changes):this.viewport;(n&&(n.range.headl.to)||!this.viewportIsAppropriate(l))&&(l=this.getViewport(0,n));let u=l.from!=this.viewport.from||l.to!=this.viewport.to;this.viewport=l,e.flags|=this.updateForViewport(),(u||!e.changes.empty||e.flags&2)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,e.changes))),e.flags|=this.computeVisibleRanges(e.changes),n&&(this.scrollTarget=n),!this.mustEnforceCursorAssoc&&e.selectionSet&&e.view.lineWrapping&&e.state.selection.main.empty&&e.state.selection.main.assoc&&!e.state.facet(BD)&&(this.mustEnforceCursorAssoc=!0)}measure(e){let n=e.contentDOM,r=window.getComputedStyle(n),i=this.heightOracle,s=r.whiteSpace;this.defaultTextDirection=r.direction=="rtl"?Et.RTL:Et.LTR;let o=this.heightOracle.mustRefreshForWrapping(s),a=n.getBoundingClientRect(),l=o||this.mustMeasureContent||this.contentDOMHeight!=a.height;this.contentDOMHeight=a.height,this.mustMeasureContent=!1;let u=0,c=0;if(a.width&&a.height){let{scaleX:S,scaleY:E}=hD(n,a);(S>.005&&Math.abs(this.scaleX-S)>.005||E>.005&&Math.abs(this.scaleY-E)>.005)&&(this.scaleX=S,this.scaleY=E,u|=16,o=l=!0)}let f=(parseInt(r.paddingTop)||0)*this.scaleY,d=(parseInt(r.paddingBottom)||0)*this.scaleY;(this.paddingTop!=f||this.paddingBottom!=d)&&(this.paddingTop=f,this.paddingBottom=d,u|=18),this.editorWidth!=e.scrollDOM.clientWidth&&(i.lineWrapping&&(l=!0),this.editorWidth=e.scrollDOM.clientWidth,u|=16);let h=e.scrollDOM.scrollTop*this.scaleY;this.scrollTop!=h&&(this.scrollAnchorHeight=-1,this.scrollTop=h),this.scrolledToBottom=gD(e.scrollDOM);let p=(this.printing?xL:yL)(n,this.paddingTop),m=p.top-this.pixelViewport.top,g=p.bottom-this.pixelViewport.bottom;this.pixelViewport=p;let b=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(b!=this.inView&&(this.inView=b,b&&(l=!0)),!this.inView&&!this.scrollTarget&&!vL(e.dom))return 0;let y=a.width;if((this.contentDOMWidth!=y||this.editorHeight!=e.scrollDOM.clientHeight)&&(this.contentDOMWidth=a.width,this.editorHeight=e.scrollDOM.clientHeight,u|=16),l){let S=e.docView.measureVisibleLineHeights(this.viewport);if(i.mustRefreshForHeights(S)&&(o=!0),o||i.lineWrapping&&Math.abs(y-this.contentDOMWidth)>i.charWidth){let{lineHeight:E,charWidth:C,textHeight:w}=e.docView.measureTextSize();o=E>0&&i.refresh(s,E,C,w,Math.max(5,y/C),S),o&&(e.docView.minWidth=0,u|=16)}m>0&&g>0?c=Math.max(m,g):m<0&&g<0&&(c=Math.min(m,g)),SS();for(let E of this.viewports){let C=E.from==this.viewport.from?S:e.docView.measureVisibleLineHeights(E);this.heightMap=(o?Xn.empty().applyChanges(this.stateDeco,Ze.empty,this.heightOracle,[new jr(0,0,0,e.state.doc.length)]):this.heightMap).updateHeight(i,0,o,new hL(E.from,C))}Il&&(u|=2)}let x=!this.viewportIsAppropriate(this.viewport,c)||this.scrollTarget&&(this.scrollTarget.range.headthis.viewport.to);return x&&(u&2&&(u|=this.updateScaler()),this.viewport=this.getViewport(c,this.scrollTarget),u|=this.updateForViewport()),(u&2||x)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(o?[]:this.lineGaps,e)),u|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,e.docView.enforceCursorAssoc()),u}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(e,n){let r=.5-Math.max(-.5,Math.min(.5,e/1e3/2)),i=this.heightMap,s=this.heightOracle,{visibleTop:o,visibleBottom:a}=this,l=new Ad(i.lineAt(o-r*1e3,vt.ByHeight,s,0,0).from,i.lineAt(a+(1-r)*1e3,vt.ByHeight,s,0,0).to);if(n){let{head:u}=n.range;if(ul.to){let c=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),f=i.lineAt(u,vt.ByPos,s,0,0),d;n.y=="center"?d=(f.top+f.bottom)/2-c/2:n.y=="start"||n.y=="nearest"&&u=a+Math.max(10,Math.min(r,250)))&&i>o-2*1e3&&s>1,o=i<<1;if(this.defaultTextDirection!=Et.LTR&&!r)return[];let a=[],l=(c,f,d,h)=>{if(f-cc&&bb.from>=d.from&&b.to<=d.to&&Math.abs(b.from-c)b.fromy));if(!g){if(fx.from<=f&&x.to>=f)){let x=n.moveToLineBoundary(Y.cursor(f),!1,!0).head;x>c&&(f=x)}let b=this.gapSize(d,c,f,h),y=r||b<2e6?b:2e6;g=new bg(c,f,b,y)}a.push(g)},u=c=>{if(c.length2e6)for(let C of e)C.from>=c.from&&C.fromc.from&&l(c.from,h,c,f),pn.draw(this,this.heightOracle.lineWrapping))))}computeVisibleRanges(e){let n=this.stateDeco;this.lineGaps.length&&(n=n.concat(this.lineGapDeco));let r=[];Xe.spans(n,this.viewport.from,this.viewport.to,{span(s,o){r.push({from:s,to:o})},point(){}},20);let i=0;if(r.length!=this.visibleRanges.length)i=12;else for(let s=0;s=this.viewport.from&&e<=this.viewport.to&&this.viewportLines.find(n=>n.from<=e&&n.to>=e)||Xu(this.heightMap.lineAt(e,vt.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(e){return e>=this.viewportLines[0].top&&e<=this.viewportLines[this.viewportLines.length-1].bottom&&this.viewportLines.find(n=>n.top<=e&&n.bottom>=e)||Xu(this.heightMap.lineAt(this.scaler.fromDOM(e),vt.ByHeight,this.heightOracle,0,0),this.scaler)}scrollAnchorAt(e){let n=this.lineBlockAtHeight(e+8);return n.from>=this.viewport.from||this.viewportLines[0].top-e>200?n:this.viewportLines[0]}elementAtHeight(e){return Xu(this.heightMap.blockAt(this.scaler.fromDOM(e),this.heightOracle,0,0),this.scaler)}get docHeight(){return this.scaler.toDOM(this.heightMap.height)}get contentHeight(){return this.docHeight+this.paddingTop+this.paddingBottom}}class Ad{constructor(e,n){this.from=e,this.to=n}}function EL(t,e,n){let r=[],i=t,s=0;return Xe.spans(n,t,e,{span(){},point(o,a){o>i&&(r.push({from:i,to:o}),s+=o-i),i=a}},20),i=1)return e[e.length-1].to;let r=Math.floor(t*n);for(let i=0;;i++){let{from:s,to:o}=e[i],a=o-s;if(r<=a)return s+r;r-=a}}function kd(t,e){let n=0;for(let{from:r,to:i}of t.ranges){if(e<=i){n+=e-r;break}n+=i-r}return n/t.total}function wL(t,e){for(let n of t)if(e(n))return n}const _S={toDOM(t){return t},fromDOM(t){return t},scale:1,eq(t){return t==this}};class _v{constructor(e,n,r){let i=0,s=0,o=0;this.viewports=r.map(({from:a,to:l})=>{let u=n.lineAt(a,vt.ByPos,e,0,0).top,c=n.lineAt(l,vt.ByPos,e,0,0).bottom;return i+=c-u,{from:a,to:l,top:u,bottom:c,domTop:0,domBottom:0}}),this.scale=(7e6-i)/(n.height-i);for(let a of this.viewports)a.domTop=o+(a.top-s)*this.scale,o=a.domBottom=a.domTop+(a.bottom-a.top),s=a.bottom}toDOM(e){for(let n=0,r=0,i=0;;n++){let s=nn.from==e.viewports[r].from&&n.to==e.viewports[r].to):!1}}function Xu(t,e){if(e.scale==1)return t;let n=e.toDOM(t.top),r=e.toDOM(t.bottom);return new ki(t.from,t.length,n,r-n,Array.isArray(t._content)?t._content.map(i=>Xu(i,e)):t._content)}const Od=he.define({combine:t=>t.join(" ")}),Ob=he.define({combine:t=>t.indexOf(!0)>-1}),Tb=po.newName(),ok=po.newName(),ak=po.newName(),lk={"&light":"."+ok,"&dark":"."+ak};function Ib(t,e,n){return new po(e,{finish(r){return/&/.test(r)?r.replace(/&\w*/,i=>{if(i=="&")return t;if(!n||!n[i])throw new RangeError(`Unsupported selector: ${i}`);return n[i]}):t+" "+r}})}const _L=Ib("."+Tb,{"&":{position:"relative !important",boxSizing:"border-box","&.cm-focused":{outline:"1px dotted #212121"},display:"flex !important",flexDirection:"column"},".cm-scroller":{display:"flex !important",alignItems:"flex-start !important",fontFamily:"monospace",lineHeight:1.4,height:"100%",overflowX:"auto",position:"relative",zIndex:0,overflowAnchor:"none"},".cm-content":{margin:0,flexGrow:2,flexShrink:0,display:"block",whiteSpace:"pre",wordWrap:"normal",boxSizing:"border-box",minHeight:"100%",padding:"4px 0",outline:"none","&[contenteditable=true]":{WebkitUserModify:"read-write-plaintext-only"}},".cm-lineWrapping":{whiteSpace_fallback:"pre-wrap",whiteSpace:"break-spaces",wordBreak:"break-word",overflowWrap:"anywhere",flexShrink:1},"&light .cm-content":{caretColor:"black"},"&dark .cm-content":{caretColor:"white"},".cm-line":{display:"block",padding:"0 2px 0 6px"},".cm-layer":{position:"absolute",left:0,top:0,contain:"size style","& > *":{position:"absolute"}},"&light .cm-selectionBackground":{background:"#d9d9d9"},"&dark .cm-selectionBackground":{background:"#222"},"&light.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#d7d4f0"},"&dark.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#233"},".cm-cursorLayer":{pointerEvents:"none"},"&.cm-focused > .cm-scroller > .cm-cursorLayer":{animation:"steps(1) cm-blink 1.2s infinite"},"@keyframes cm-blink":{"0%":{},"50%":{opacity:0},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{opacity:0},"100%":{}},".cm-cursor, .cm-dropCursor":{borderLeft:"1.2px solid black",marginLeft:"-0.6px",pointerEvents:"none"},".cm-cursor":{display:"none"},"&dark .cm-cursor":{borderLeftColor:"#ddd"},".cm-dropCursor":{position:"absolute"},"&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor":{display:"block"},".cm-iso":{unicodeBidi:"isolate"},".cm-announced":{position:"fixed",top:"-10000px"},"@media print":{".cm-announced":{display:"none"}},"&light .cm-activeLine":{backgroundColor:"#cceeff44"},"&dark .cm-activeLine":{backgroundColor:"#99eeff33"},"&light .cm-specialChar":{color:"red"},"&dark .cm-specialChar":{color:"#f78"},".cm-gutters":{flexShrink:0,display:"flex",height:"100%",boxSizing:"border-box",zIndex:200},".cm-gutters-before":{insetInlineStart:0},".cm-gutters-after":{insetInlineEnd:0},"&light .cm-gutters":{backgroundColor:"#f5f5f5",color:"#6c6c6c",border:"0px solid #ddd","&.cm-gutters-before":{borderRightWidth:"1px"},"&.cm-gutters-after":{borderLeftWidth:"1px"}},"&dark .cm-gutters":{backgroundColor:"#333338",color:"#ccc"},".cm-gutter":{display:"flex !important",flexDirection:"column",flexShrink:0,boxSizing:"border-box",minHeight:"100%",overflow:"hidden"},".cm-gutterElement":{boxSizing:"border-box"},".cm-lineNumbers .cm-gutterElement":{padding:"0 3px 0 5px",minWidth:"20px",textAlign:"right",whiteSpace:"nowrap"},"&light .cm-activeLineGutter":{backgroundColor:"#e2f2ff"},"&dark .cm-activeLineGutter":{backgroundColor:"#222227"},".cm-panels":{boxSizing:"border-box",position:"sticky",left:0,right:0,zIndex:300},"&light .cm-panels":{backgroundColor:"#f5f5f5",color:"black"},"&light .cm-panels-top":{borderBottom:"1px solid #ddd"},"&light .cm-panels-bottom":{borderTop:"1px solid #ddd"},"&dark .cm-panels":{backgroundColor:"#333338",color:"white"},".cm-dialog":{padding:"2px 19px 4px 6px",position:"relative","& label":{fontSize:"80%"}},".cm-dialog-close":{position:"absolute",top:"3px",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",fontSize:"14px",padding:"0"},".cm-tab":{display:"inline-block",overflow:"hidden",verticalAlign:"bottom"},".cm-widgetBuffer":{verticalAlign:"text-top",height:"1em",width:0,display:"inline"},".cm-placeholder":{color:"#888",display:"inline-block",verticalAlign:"top",userSelect:"none"},".cm-highlightSpace":{backgroundImage:"radial-gradient(circle at 50% 55%, #aaa 20%, transparent 5%)",backgroundPosition:"center"},".cm-highlightTab":{backgroundImage:`url('data:image/svg+xml,')`,backgroundSize:"auto 100%",backgroundPosition:"right 90%",backgroundRepeat:"no-repeat"},".cm-trailingSpace":{backgroundColor:"#ff332255"},".cm-button":{verticalAlign:"middle",color:"inherit",fontSize:"70%",padding:".2em 1em",borderRadius:"1px"},"&light .cm-button":{backgroundImage:"linear-gradient(#eff1f5, #d9d9df)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#b4b4b4, #d0d3d6)"}},"&dark .cm-button":{backgroundImage:"linear-gradient(#393939, #111)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#111, #333)"}},".cm-textfield":{verticalAlign:"middle",color:"inherit",fontSize:"70%",border:"1px solid silver",padding:".2em .5em"},"&light .cm-textfield":{backgroundColor:"white"},"&dark .cm-textfield":{border:"1px solid #555",backgroundColor:"inherit"}},lk),CL={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},yg=ue.ie&&ue.ie_version<=11;class AL{constructor(e){this.view=e,this.active=!1,this.editContext=null,this.selectionRange=new l9,this.selectionChanged=!1,this.delayedFlush=-1,this.resizeTimeout=-1,this.queue=[],this.delayedAndroidKey=null,this.flushingAndroidKey=-1,this.lastChange=0,this.scrollTargets=[],this.intersection=null,this.resizeScroll=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.printQuery=null,this.parentCheck=-1,this.dom=e.contentDOM,this.observer=new MutationObserver(n=>{for(let r of n)this.queue.push(r);(ue.ie&&ue.ie_version<=11||ue.ios&&e.composing)&&n.some(r=>r.type=="childList"&&r.removedNodes.length||r.type=="characterData"&&r.oldValue.length>r.target.nodeValue.length)?this.flushSoon():this.flush()}),window.EditContext&&ue.android&&e.constructor.EDIT_CONTEXT!==!1&&!(ue.chrome&&ue.chrome_version<126)&&(this.editContext=new kL(e),e.state.facet(ls)&&(e.contentDOM.editContext=this.editContext.editContext)),yg&&(this.onCharData=n=>{this.queue.push({target:n.target,type:"characterData",oldValue:n.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.onResize=this.onResize.bind(this),this.onPrint=this.onPrint.bind(this),this.onScroll=this.onScroll.bind(this),window.matchMedia&&(this.printQuery=window.matchMedia("print")),typeof ResizeObserver=="function"&&(this.resizeScroll=new ResizeObserver(()=>{var n;((n=this.view.docView)===null||n===void 0?void 0:n.lastUpdate){this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),n.length>0&&n[n.length-1].intersectionRatio>0!=this.intersecting&&(this.intersecting=!this.intersecting,this.intersecting!=this.view.inView&&this.onScrollChanged(document.createEvent("Event")))},{threshold:[0,.001]}),this.intersection.observe(this.dom),this.gapIntersection=new IntersectionObserver(n=>{n.length>0&&n[n.length-1].intersectionRatio>0&&this.onScrollChanged(document.createEvent("Event"))},{})),this.listenForScroll(),this.readSelectionRange()}onScrollChanged(e){this.view.inputState.runHandlers("scroll",e),this.intersecting&&this.view.measure()}onScroll(e){this.intersecting&&this.flush(!1),this.editContext&&this.view.requestMeasure(this.editContext.measureReq),this.onScrollChanged(e)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout(()=>{this.resizeTimeout=-1,this.view.requestMeasure()},50))}onPrint(e){(e.type=="change"||!e.type)&&!e.matches||(this.view.viewState.printing=!0,this.view.measure(),setTimeout(()=>{this.view.viewState.printing=!1,this.view.requestMeasure()},500))}updateGaps(e){if(this.gapIntersection&&(e.length!=this.gaps.length||this.gaps.some((n,r)=>n!=e[r]))){this.gapIntersection.disconnect();for(let n of e)this.gapIntersection.observe(n);this.gaps=e}}onSelectionChange(e){let n=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:r}=this,i=this.selectionRange;if(r.state.facet(ls)?r.root.activeElement!=this.dom:!Ch(this.dom,i))return;let s=i.anchorNode&&r.docView.nearest(i.anchorNode);if(s&&s.ignoreEvent(e)){n||(this.selectionChanged=!1);return}(ue.ie&&ue.ie_version<=11||ue.android&&ue.chrome)&&!r.state.selection.main.empty&&i.focusNode&&cc(i.focusNode,i.focusOffset,i.anchorNode,i.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,n=Lc(e.root);if(!n)return!1;let r=ue.safari&&e.root.nodeType==11&&e.root.activeElement==this.dom&&DL(this.view,n)||n;if(!r||this.selectionRange.eq(r))return!1;let i=Ch(this.dom,r);return i&&!this.selectionChanged&&e.inputState.lastFocusTime>Date.now()-200&&e.inputState.lastTouchTime{let s=this.delayedAndroidKey;s&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=s.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&s.force&&cl(this.dom,s.key,s.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(i)}(!this.delayedAndroidKey||e=="Enter")&&(this.delayedAndroidKey={key:e,keyCode:n,force:this.lastChange{this.delayedFlush=-1,this.flush()}))}forceFlush(){this.delayedFlush>=0&&(this.view.win.cancelAnimationFrame(this.delayedFlush),this.delayedFlush=-1),this.flush()}pendingRecords(){for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}processRecords(){let e=this.pendingRecords();e.length&&(this.queue=[]);let n=-1,r=-1,i=!1;for(let s of e){let o=this.readMutation(s);o&&(o.typeOver&&(i=!0),n==-1?{from:n,to:r}=o:(n=Math.min(o.from,n),r=Math.max(o.to,r)))}return{from:n,to:r,typeOver:i}}readChange(){let{from:e,to:n,typeOver:r}=this.processRecords(),i=this.selectionChanged&&Ch(this.dom,this.selectionRange);if(e<0&&!i)return null;e>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let s=new q9(this.view,e,n,r);return this.view.docView.domChanged={newSel:s.newSel?s.newSel.main:null},s}flush(e=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;e&&this.readSelectionRange();let n=this.readChange();if(!n)return this.view.requestMeasure(),!1;let r=this.view.state,i=XD(this.view,n);return this.view.state==r&&(n.domChanged||n.newSel&&!n.newSel.main.eq(this.view.state.selection.main))&&this.view.update([]),i}readMutation(e){let n=this.view.docView.nearest(e.target);if(!n||n.ignoreMutation(e))return null;if(n.markDirty(e.type=="attributes"),e.type=="attributes"&&(n.flags|=4),e.type=="childList"){let r=CS(n,e.previousSibling||e.target.previousSibling,-1),i=CS(n,e.nextSibling||e.target.nextSibling,1);return{from:r?n.posAfter(r):n.posAtStart,to:i?n.posBefore(i):n.posAtEnd,typeOver:!1}}else return e.type=="characterData"?{from:n.posAtStart,to:n.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}:null}setWindow(e){e!=this.win&&(this.removeWindowListeners(this.win),this.win=e,this.addWindowListeners(this.win))}addWindowListeners(e){e.addEventListener("resize",this.onResize),this.printQuery?this.printQuery.addEventListener?this.printQuery.addEventListener("change",this.onPrint):this.printQuery.addListener(this.onPrint):e.addEventListener("beforeprint",this.onPrint),e.addEventListener("scroll",this.onScroll),e.document.addEventListener("selectionchange",this.onSelectionChange)}removeWindowListeners(e){e.removeEventListener("scroll",this.onScroll),e.removeEventListener("resize",this.onResize),this.printQuery?this.printQuery.removeEventListener?this.printQuery.removeEventListener("change",this.onPrint):this.printQuery.removeListener(this.onPrint):e.removeEventListener("beforeprint",this.onPrint),e.document.removeEventListener("selectionchange",this.onSelectionChange)}update(e){this.editContext&&(this.editContext.update(e),e.startState.facet(ls)!=e.state.facet(ls)&&(e.view.contentDOM.editContext=e.state.facet(ls)?this.editContext.editContext:null))}destroy(){var e,n,r;this.stop(),(e=this.intersection)===null||e===void 0||e.disconnect(),(n=this.gapIntersection)===null||n===void 0||n.disconnect(),(r=this.resizeScroll)===null||r===void 0||r.disconnect();for(let i of this.scrollTargets)i.removeEventListener("scroll",this.onScroll);this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout),this.win.cancelAnimationFrame(this.delayedFlush),this.win.cancelAnimationFrame(this.flushingAndroidKey),this.editContext&&(this.view.contentDOM.editContext=null,this.editContext.destroy())}}function CS(t,e,n){for(;e;){let r=ut.get(e);if(r&&r.parent==t)return r;let i=e.parentNode;e=i!=t.dom?i:n>0?e.nextSibling:e.previousSibling}return null}function AS(t,e){let n=e.startContainer,r=e.startOffset,i=e.endContainer,s=e.endOffset,o=t.docView.domAtPos(t.state.selection.main.anchor);return cc(o.node,o.offset,i,s)&&([n,r,i,s]=[i,s,n,r]),{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:s}}function DL(t,e){if(e.getComposedRanges){let i=e.getComposedRanges(t.root)[0];if(i)return AS(t,i)}let n=null;function r(i){i.preventDefault(),i.stopImmediatePropagation(),n=i.getTargetRanges()[0]}return t.contentDOM.addEventListener("beforeinput",r,!0),t.dom.ownerDocument.execCommand("indent"),t.contentDOM.removeEventListener("beforeinput",r,!0),n?AS(t,n):null}class kL{constructor(e){this.from=0,this.to=0,this.pendingContextChange=null,this.handlers=Object.create(null),this.composing=null,this.resetRange(e.state);let n=this.editContext=new window.EditContext({text:e.state.doc.sliceString(this.from,this.to),selectionStart:this.toContextPos(Math.max(this.from,Math.min(this.to,e.state.selection.main.anchor))),selectionEnd:this.toContextPos(e.state.selection.main.head)});this.handlers.textupdate=r=>{let i=e.state.selection.main,{anchor:s,head:o}=i,a=this.toEditorPos(r.updateRangeStart),l=this.toEditorPos(r.updateRangeEnd);e.inputState.composing>=0&&!this.composing&&(this.composing={contextBase:r.updateRangeStart,editorBase:a,drifted:!1});let u=l-a>r.text.length;a==this.from&&sthis.to&&(l=s);let c=YD(e.state.sliceDoc(a,l),r.text,(u?i.from:i.to)-a,u?"end":null);if(!c){let d=Y.single(this.toEditorPos(r.selectionStart),this.toEditorPos(r.selectionEnd));d.main.eq(i)||e.dispatch({selection:d,userEvent:"select"});return}let f={from:c.from+a,to:c.toA+a,insert:Ze.of(r.text.slice(c.from,c.toB).split(` -`))};if((ue.mac||ue.android)&&f.from==o-1&&/^\. ?$/.test(r.text)&&e.contentDOM.getAttribute("autocorrect")=="off"&&(f={from:a,to:l,insert:Ze.of([r.text.replace("."," ")])}),this.pendingContextChange=f,!e.state.readOnly){let d=this.to-this.from+(f.to-f.from+f.insert.length);Ev(e,f,Y.single(this.toEditorPos(r.selectionStart,d),this.toEditorPos(r.selectionEnd,d)))}this.pendingContextChange&&(this.revertPending(e.state),this.setSelection(e.state)),f.from=0&&!/[\\p{Alphabetic}\\p{Number}_]/.test(n.text.slice(Math.max(0,r.updateRangeStart-1),Math.min(n.text.length,r.updateRangeStart+1)))&&this.handlers.compositionend(r)},this.handlers.characterboundsupdate=r=>{let i=[],s=null;for(let o=this.toEditorPos(r.rangeStart),a=this.toEditorPos(r.rangeEnd);o{let i=[];for(let s of r.getTextFormats()){let o=s.underlineStyle,a=s.underlineThickness;if(!/none/i.test(o)&&!/none/i.test(a)){let l=this.toEditorPos(s.rangeStart),u=this.toEditorPos(s.rangeEnd);if(l{e.inputState.composing<0&&(e.inputState.composing=0,e.inputState.compositionFirstChange=!0)},this.handlers.compositionend=()=>{if(e.inputState.composing=-1,e.inputState.compositionFirstChange=null,this.composing){let{drifted:r}=this.composing;this.composing=null,r&&this.reset(e.state)}};for(let r in this.handlers)n.addEventListener(r,this.handlers[r]);this.measureReq={read:r=>{this.editContext.updateControlBounds(r.contentDOM.getBoundingClientRect());let i=Lc(r.root);i&&i.rangeCount&&this.editContext.updateSelectionBounds(i.getRangeAt(0).getBoundingClientRect())}}}applyEdits(e){let n=0,r=!1,i=this.pendingContextChange;return e.changes.iterChanges((s,o,a,l,u)=>{if(r)return;let c=u.length-(o-s);if(i&&o>=i.to)if(i.from==s&&i.to==o&&i.insert.eq(u)){i=this.pendingContextChange=null,n+=c,this.to+=c;return}else i=null,this.revertPending(e.state);if(s+=n,o+=n,o<=this.from)this.from+=c,this.to+=c;else if(sthis.to||this.to-this.from+u.length>3e4){r=!0;return}this.editContext.updateText(this.toContextPos(s),this.toContextPos(o),u.toString()),this.to+=c}n+=c}),i&&!r&&this.revertPending(e.state),!r}update(e){let n=this.pendingContextChange,r=e.startState.selection.main;this.composing&&(this.composing.drifted||!e.changes.touchesRange(r.from,r.to)&&e.transactions.some(i=>!i.isUserEvent("input.type")&&i.changes.touchesRange(this.from,this.to)))?(this.composing.drifted=!0,this.composing.editorBase=e.changes.mapPos(this.composing.editorBase)):!this.applyEdits(e)||!this.rangeIsValid(e.state)?(this.pendingContextChange=null,this.reset(e.state)):(e.docChanged||e.selectionSet||n)&&this.setSelection(e.state),(e.geometryChanged||e.docChanged||e.selectionSet)&&e.view.requestMeasure(this.measureReq)}resetRange(e){let{head:n}=e.selection.main;this.from=Math.max(0,n-1e4),this.to=Math.min(e.doc.length,n+1e4)}reset(e){this.resetRange(e),this.editContext.updateText(0,this.editContext.text.length,e.doc.sliceString(this.from,this.to)),this.setSelection(e)}revertPending(e){let n=this.pendingContextChange;this.pendingContextChange=null,this.editContext.updateText(this.toContextPos(n.from),this.toContextPos(n.from+n.insert.length),e.doc.sliceString(n.from,n.to))}setSelection(e){let{main:n}=e.selection,r=this.toContextPos(Math.max(this.from,Math.min(this.to,n.anchor))),i=this.toContextPos(n.head);(this.editContext.selectionStart!=r||this.editContext.selectionEnd!=i)&&this.editContext.updateSelection(r,i)}rangeIsValid(e){let{head:n}=e.selection.main;return!(this.from>0&&n-this.from<500||this.to1e4*3)}toEditorPos(e,n=this.to-this.from){e=Math.min(e,n);let r=this.composing;return r&&r.drifted?r.editorBase+(e-r.contextBase):e+this.from}toContextPos(e){let n=this.composing;return n&&n.drifted?n.contextBase+(e-n.editorBase):e-this.from}destroy(){for(let e in this.handlers)this.editContext.removeEventListener(e,this.handlers[e])}}class ce{get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return!!this.inputState&&this.inputState.composing>0}get compositionStarted(){return!!this.inputState&&this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(e={}){var n;this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.contentDOM=document.createElement("div"),this.scrollDOM=document.createElement("div"),this.scrollDOM.tabIndex=-1,this.scrollDOM.className="cm-scroller",this.scrollDOM.appendChild(this.contentDOM),this.announceDOM=document.createElement("div"),this.announceDOM.className="cm-announced",this.announceDOM.setAttribute("aria-live","polite"),this.dom=document.createElement("div"),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),e.parent&&e.parent.appendChild(this.dom);let{dispatch:r}=e;this.dispatchTransactions=e.dispatchTransactions||r&&(i=>i.forEach(s=>r(s,this)))||(i=>this.update(i)),this.dispatch=this.dispatch.bind(this),this._root=e.root||u9(e.parent)||document,this.viewState=new wS(e.state||Ue.create(e)),e.scrollTo&&e.scrollTo.is(wd)&&(this.viewState.scrollTarget=e.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(Qa).map(i=>new pg(i));for(let i of this.plugins)i.update(this);this.observer=new AL(this),this.inputState=new X9(this),this.inputState.ensureHandlers(this.plugins),this.docView=new iS(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),!((n=document.fonts)===null||n===void 0)&&n.ready&&document.fonts.ready.then(()=>this.requestMeasure())}dispatch(...e){let n=e.length==1&&e[0]instanceof Qt?e:e.length==1&&Array.isArray(e[0])?e[0]:[this.state.update(...e)];this.dispatchTransactions(n,this)}update(e){if(this.updateState!=0)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");let n=!1,r=!1,i,s=this.state;for(let d of e){if(d.startState!=s)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");s=d.state}if(this.destroyed){this.viewState.state=s;return}let o=this.hasFocus,a=0,l=null;e.some(d=>d.annotation(nk))?(this.inputState.notifiedFocused=o,a=1):o!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=o,l=rk(s,o),l||(a=1));let u=this.observer.delayedAndroidKey,c=null;if(u?(this.observer.clearDelayedAndroidKey(),c=this.observer.readChange(),(c&&!this.state.doc.eq(s.doc)||!this.state.selection.eq(s.selection))&&(c=null)):this.observer.clear(),s.facet(Ue.phrases)!=this.state.facet(Ue.phrases))return this.setState(s);i=yp.create(this,s,e),i.flags|=a;let f=this.viewState.scrollTarget;try{this.updateState=2;for(let d of e){if(f&&(f=f.map(d.changes)),d.scrollIntoView){let{main:h}=d.state.selection;f=new fl(h.empty?h:Y.cursor(h.head,h.head>h.anchor?-1:1))}for(let h of d.effects)h.is(wd)&&(f=h.value.clip(this.state))}this.viewState.update(i,f),this.bidiCache=xp.update(this.bidiCache,i.changes),i.empty||(this.updatePlugins(i),this.inputState.update(i)),n=this.docView.update(i),this.state.facet(Wu)!=this.styleModules&&this.mountStyles(),r=this.updateAttrs(),this.showAnnouncements(e),this.docView.updateSelection(n,e.some(d=>d.isUserEvent("select.pointer")))}finally{this.updateState=0}if(i.startState.facet(Od)!=i.state.facet(Od)&&(this.viewState.mustMeasureContent=!0),(n||r||f||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),n&&this.docViewUpdate(),!i.empty)for(let d of this.state.facet(Cb))try{d(i)}catch(h){qn(this.state,h,"update listener")}(l||c)&&Promise.resolve().then(()=>{l&&this.state==l.startState&&this.dispatch(l),c&&!XD(this,c)&&u.force&&cl(this.contentDOM,u.key,u.keyCode)})}setState(e){if(this.updateState!=0)throw new Error("Calls to EditorView.setState are not allowed while an update is in progress");if(this.destroyed){this.viewState.state=e;return}this.updateState=2;let n=this.hasFocus;try{for(let r of this.plugins)r.destroy(this);this.viewState=new wS(e),this.plugins=e.facet(Qa).map(r=>new pg(r)),this.pluginMap.clear();for(let r of this.plugins)r.update(this);this.docView.destroy(),this.docView=new iS(this),this.inputState.ensureHandlers(this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}n&&this.focus(),this.requestMeasure()}updatePlugins(e){let n=e.startState.facet(Qa),r=e.state.facet(Qa);if(n!=r){let i=[];for(let s of r){let o=n.indexOf(s);if(o<0)i.push(new pg(s));else{let a=this.plugins[o];a.mustUpdate=e,i.push(a)}}for(let s of this.plugins)s.mustUpdate!=e&&s.destroy(this);this.plugins=i,this.pluginMap.clear()}else for(let i of this.plugins)i.mustUpdate=e;for(let i=0;i-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.observer.delayedAndroidKey){this.measureScheduled=-1,this.requestMeasure();return}this.measureScheduled=0,e&&this.observer.forceFlush();let n=null,r=this.scrollDOM,i=r.scrollTop*this.scaleY,{scrollAnchorPos:s,scrollAnchorHeight:o}=this.viewState;Math.abs(i-this.viewState.scrollTop)>1&&(o=-1),this.viewState.scrollAnchorHeight=-1;try{for(let a=0;;a++){if(o<0)if(gD(r))s=-1,o=this.viewState.heightMap.height;else{let h=this.viewState.scrollAnchorAt(i);s=h.from,o=h.top}this.updateState=1;let l=this.viewState.measure(this);if(!l&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(a>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let u=[];l&4||([this.measureRequests,u]=[u,this.measureRequests]);let c=u.map(h=>{try{return h.read(this)}catch(p){return qn(this.state,p),DS}}),f=yp.create(this,this.state,[]),d=!1;f.flags|=l,n?n.flags|=l:n=f,this.updateState=2,f.empty||(this.updatePlugins(f),this.inputState.update(f),this.updateAttrs(),d=this.docView.update(f),d&&this.docViewUpdate());for(let h=0;h1||p<-1){i=i+p,r.scrollTop=i/this.scaleY,o=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(n&&!n.empty)for(let a of this.state.facet(Cb))a(n)}get themeClasses(){return Tb+" "+(this.state.facet(Ob)?ak:ok)+" "+this.state.facet(Od)}updateAttrs(){let e=kS(this,jD,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),n={spellcheck:"false",autocorrect:"off",autocapitalize:"off",writingsuggestions:"false",translate:"no",contenteditable:this.state.facet(ls)?"true":"false",class:"cm-content",style:`${ue.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(n["aria-readonly"]="true"),kS(this,xv,n);let r=this.observer.ignore(()=>{let i=xb(this.contentDOM,this.contentAttrs,n),s=xb(this.dom,this.editorAttrs,e);return i||s});return this.editorAttrs=e,this.contentAttrs=n,r}showAnnouncements(e){let n=!0;for(let r of e)for(let i of r.effects)if(i.is(ce.announce)){n&&(this.announceDOM.textContent=""),n=!1;let s=this.announceDOM.appendChild(document.createElement("div"));s.textContent=i.value}}mountStyles(){this.styleModules=this.state.facet(Wu);let e=this.state.facet(ce.cspNonce);po.mount(this.root,this.styleModules.concat(_L).reverse(),e?{nonce:e}:void 0)}readMeasured(){if(this.updateState==2)throw new Error("Reading the editor layout isn't allowed during an update");this.updateState==0&&this.measureScheduled>-1&&this.measure(!1)}requestMeasure(e){if(this.measureScheduled<0&&(this.measureScheduled=this.win.requestAnimationFrame(()=>this.measure())),e){if(this.measureRequests.indexOf(e)>-1)return;if(e.key!=null){for(let n=0;nr.plugin==e)||null),n&&n.update(this).value}get documentTop(){return this.contentDOM.getBoundingClientRect().top+this.viewState.paddingTop}get documentPadding(){return{top:this.viewState.paddingTop,bottom:this.viewState.paddingBottom}}get scaleX(){return this.viewState.scaleX}get scaleY(){return this.viewState.scaleY}elementAtHeight(e){return this.readMeasured(),this.viewState.elementAtHeight(e)}lineBlockAtHeight(e){return this.readMeasured(),this.viewState.lineBlockAtHeight(e)}get viewportLineBlocks(){return this.viewState.viewportLines}lineBlockAt(e){return this.viewState.lineBlockAt(e)}get contentHeight(){return this.viewState.contentHeight}moveByChar(e,n,r){return gg(this,e,uS(this,e,n,r))}moveByGroup(e,n){return gg(this,e,uS(this,e,n,r=>z9(this,e.head,r)))}visualLineSide(e,n){let r=this.bidiSpans(e),i=this.textDirectionAt(e.from),s=r[n?r.length-1:0];return Y.cursor(s.side(n,i)+e.from,s.forward(!n,i)?1:-1)}moveToLineBoundary(e,n,r=!0){return $9(this,e,n,r)}moveVertically(e,n,r){return gg(this,e,j9(this,e,n,r))}domAtPos(e){return this.docView.domAtPos(e)}posAtDOM(e,n=0){return this.docView.posFromDOM(e,n)}posAtCoords(e,n=!0){return this.readMeasured(),GD(this,e,n)}coordsAtPos(e,n=1){this.readMeasured();let r=this.docView.coordsAt(e,n);if(!r||r.left==r.right)return r;let i=this.state.doc.lineAt(e),s=this.bidiSpans(i),o=s[Ks.find(s,e-i.from,-1,n)];return Pf(r,o.dir==Et.LTR==n>0)}coordsForChar(e){return this.readMeasured(),this.docView.coordsForChar(e)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(e){return!this.state.facet(LD)||ethis.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(e))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(e){if(e.length>OL)return OD(e.length);let n=this.textDirectionAt(e.from),r;for(let s of this.bidiCache)if(s.from==e.from&&s.dir==n&&(s.fresh||kD(s.isolates,r=rS(this,e))))return s.order;r||(r=rS(this,e));let i=w9(e.text,n,r);return this.bidiCache.push(new xp(e.from,e.to,n,r,!0,i)),i}get hasFocus(){var e;return(this.dom.ownerDocument.hasFocus()||ue.safari&&((e=this.inputState)===null||e===void 0?void 0:e.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{pD(this.contentDOM),this.docView.updateSelection()})}setRoot(e){this._root!=e&&(this._root=e,this.observer.setWindow((e.nodeType==9?e:e.ownerDocument).defaultView||window),this.mountStyles())}destroy(){this.root.activeElement==this.contentDOM&&this.contentDOM.blur();for(let e of this.plugins)e.destroy(this);this.plugins=[],this.inputState.destroy(),this.docView.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(e,n={}){return wd.of(new fl(typeof e=="number"?Y.cursor(e):e,n.y,n.x,n.yMargin,n.xMargin))}scrollSnapshot(){let{scrollTop:e,scrollLeft:n}=this.scrollDOM,r=this.viewState.scrollAnchorAt(e);return wd.of(new fl(Y.cursor(r.from),"start","start",r.top-e,n,!0))}setTabFocusMode(e){e==null?this.inputState.tabFocusMode=this.inputState.tabFocusMode<0?0:-1:typeof e=="boolean"?this.inputState.tabFocusMode=e?0:-1:this.inputState.tabFocusMode!=0&&(this.inputState.tabFocusMode=Date.now()+e)}static domEventHandlers(e){return $t.define(()=>({}),{eventHandlers:e})}static domEventObservers(e){return $t.define(()=>({}),{eventObservers:e})}static theme(e,n){let r=po.newName(),i=[Od.of(r),Wu.of(Ib(`.${r}`,e))];return n&&n.dark&&i.push(Ob.of(!0)),i}static baseTheme(e){return Co.lowest(Wu.of(Ib("."+Tb,e,lk)))}static findFromDOM(e){var n;let r=e.querySelector(".cm-content"),i=r&&ut.get(r)||ut.get(e);return((n=i==null?void 0:i.rootView)===null||n===void 0?void 0:n.view)||null}}ce.styleModule=Wu;ce.inputHandler=MD;ce.clipboardInputFilter=yv;ce.clipboardOutputFilter=vv;ce.scrollHandler=$D;ce.focusChangeEffect=FD;ce.perLineTextDirection=LD;ce.exceptionSink=ND;ce.updateListener=Cb;ce.editable=ls;ce.mouseSelectionStyle=RD;ce.dragMovesSelection=PD;ce.clickAddsSelectionRange=ID;ce.decorations=Bc;ce.outerDecorations=VD;ce.atomicRanges=Mf;ce.bidiIsolatedRanges=UD;ce.scrollMargins=HD;ce.darkTheme=Ob;ce.cspNonce=he.define({combine:t=>t.length?t[0]:""});ce.contentAttributes=xv;ce.editorAttributes=jD;ce.lineWrapping=ce.contentAttributes.of({class:"cm-lineWrapping"});ce.announce=De.define();const OL=4096,DS={};class xp{constructor(e,n,r,i,s,o){this.from=e,this.to=n,this.dir=r,this.isolates=i,this.fresh=s,this.order=o}static update(e,n){if(n.empty&&!e.some(s=>s.fresh))return e;let r=[],i=e.length?e[e.length-1].dir:Et.LTR;for(let s=Math.max(0,e.length-10);s=0;i--){let s=r[i],o=typeof s=="function"?s(t):s;o&&vb(o,n)}return n}const TL=ue.mac?"mac":ue.windows?"win":ue.linux?"linux":"key";function IL(t,e){const n=t.split(/-(?!$)/);let r=n[n.length-1];r=="Space"&&(r=" ");let i,s,o,a;for(let l=0;lr.concat(i),[]))),n}function RL(t,e,n){return ck(uk(t.state),e,t,n)}let js=null;const NL=4e3;function ML(t,e=TL){let n=Object.create(null),r=Object.create(null),i=(o,a)=>{let l=r[o];if(l==null)r[o]=a;else if(l!=a)throw new Error("Key binding "+o+" is used both as a regular binding and as a multi-stroke prefix")},s=(o,a,l,u,c)=>{var f,d;let h=n[o]||(n[o]=Object.create(null)),p=a.split(/ (?!$)/).map(b=>IL(b,e));for(let b=1;b{let S=js={view:x,prefix:y,scope:o};return setTimeout(()=>{js==S&&(js=null)},NL),!0}]})}let m=p.join(" ");i(m,!1);let g=h[m]||(h[m]={preventDefault:!1,stopPropagation:!1,run:((d=(f=h._any)===null||f===void 0?void 0:f.run)===null||d===void 0?void 0:d.slice())||[]});l&&g.run.push(l),u&&(g.preventDefault=!0),c&&(g.stopPropagation=!0)};for(let o of t){let a=o.scope?o.scope.split(" "):["editor"];if(o.any)for(let u of a){let c=n[u]||(n[u]=Object.create(null));c._any||(c._any={preventDefault:!1,stopPropagation:!1,run:[]});let{any:f}=o;for(let d in c)c[d].run.push(h=>f(h,Pb))}let l=o[e]||o.key;if(l)for(let u of a)s(u,l,o.run,o.preventDefault,o.stopPropagation),o.shift&&s(u,"Shift-"+l,o.shift,o.preventDefault,o.stopPropagation)}return n}let Pb=null;function ck(t,e,n,r){Pb=e;let i=r9(e),s=ir(i,0),o=Di(s)==i.length&&i!=" ",a="",l=!1,u=!1,c=!1;js&&js.view==n&&js.scope==r&&(a=js.prefix+" ",ZD.indexOf(e.keyCode)<0&&(u=!0,js=null));let f=new Set,d=g=>{if(g){for(let b of g.run)if(!f.has(b)&&(f.add(b),b(n)))return g.stopPropagation&&(c=!0),!0;g.preventDefault&&(g.stopPropagation&&(c=!0),u=!0)}return!1},h=t[r],p,m;return h&&(d(h[a+Td(i,e,!o)])?l=!0:o&&(e.altKey||e.metaKey||e.ctrlKey)&&!(ue.windows&&e.ctrlKey&&e.altKey)&&!(ue.mac&&e.altKey&&!(e.ctrlKey||e.metaKey))&&(p=mo[e.keyCode])&&p!=i?(d(h[a+Td(p,e,!0)])||e.shiftKey&&(m=Fc[e.keyCode])!=i&&m!=p&&d(h[a+Td(m,e,!1)]))&&(l=!0):o&&e.shiftKey&&d(h[a+Td(i,e,!0)])&&(l=!0),!l&&d(h._any)&&(l=!0)),u&&(l=!0),l&&c&&e.stopPropagation(),Pb=null,l}class Lf{constructor(e,n,r,i,s){this.className=e,this.left=n,this.top=r,this.width=i,this.height=s}draw(){let e=document.createElement("div");return e.className=this.className,this.adjust(e),e}update(e,n){return n.className!=this.className?!1:(this.adjust(e),!0)}adjust(e){e.style.left=this.left+"px",e.style.top=this.top+"px",this.width!=null&&(e.style.width=this.width+"px"),e.style.height=this.height+"px"}eq(e){return this.left==e.left&&this.top==e.top&&this.width==e.width&&this.height==e.height&&this.className==e.className}static forRange(e,n,r){if(r.empty){let i=e.coordsAtPos(r.head,r.assoc||1);if(!i)return[];let s=fk(e);return[new Lf(n,i.left-s.left,i.top-s.top,null,i.bottom-i.top)]}else return FL(e,n,r)}}function fk(t){let e=t.scrollDOM.getBoundingClientRect();return{left:(t.textDirection==Et.LTR?e.left:e.right-t.scrollDOM.clientWidth*t.scaleX)-t.scrollDOM.scrollLeft*t.scaleX,top:e.top-t.scrollDOM.scrollTop*t.scaleY}}function TS(t,e,n,r){let i=t.coordsAtPos(e,n*2);if(!i)return r;let s=t.dom.getBoundingClientRect(),o=(i.top+i.bottom)/2,a=t.posAtCoords({x:s.left+1,y:o}),l=t.posAtCoords({x:s.right-1,y:o});return a==null||l==null?r:{from:Math.max(r.from,Math.min(a,l)),to:Math.min(r.to,Math.max(a,l))}}function FL(t,e,n){if(n.to<=t.viewport.from||n.from>=t.viewport.to)return[];let r=Math.max(n.from,t.viewport.from),i=Math.min(n.to,t.viewport.to),s=t.textDirection==Et.LTR,o=t.contentDOM,a=o.getBoundingClientRect(),l=fk(t),u=o.querySelector(".cm-line"),c=u&&window.getComputedStyle(u),f=a.left+(c?parseInt(c.paddingLeft)+Math.min(0,parseInt(c.textIndent)):0),d=a.right-(c?parseInt(c.paddingRight):0),h=Db(t,r,1),p=Db(t,i,-1),m=h.type==Kn.Text?h:null,g=p.type==Kn.Text?p:null;if(m&&(t.lineWrapping||h.widgetLineBreaks)&&(m=TS(t,r,1,m)),g&&(t.lineWrapping||p.widgetLineBreaks)&&(g=TS(t,i,-1,g)),m&&g&&m.from==g.from&&m.to==g.to)return y(x(n.from,n.to,m));{let E=m?x(n.from,null,m):S(h,!1),C=g?x(null,n.to,g):S(p,!0),w=[];return(m||h).to<(g||p).from-(m&&g?1:0)||h.widgetLineBreaks>1&&E.bottom+t.defaultLineHeight/2N&&R.from=V)break;ie>F&&I(Math.max(H,F),E==null&&H<=N,Math.min(ie,V),C==null&&ie>=P,G.dir)}if(F=B.to+1,F>=V)break}return D.length==0&&I(N,E==null,P,C==null,t.textDirection),{top:A,bottom:_,horizontal:D}}function S(E,C){let w=a.top+(C?E.top:E.bottom);return{top:w,bottom:w,horizontal:[]}}}function LL(t,e){return t.constructor==e.constructor&&t.eq(e)}class BL{constructor(e,n){this.view=e,this.layer=n,this.drawn=[],this.scaleX=1,this.scaleY=1,this.measureReq={read:this.measure.bind(this),write:this.draw.bind(this)},this.dom=e.scrollDOM.appendChild(document.createElement("div")),this.dom.classList.add("cm-layer"),n.above&&this.dom.classList.add("cm-layer-above"),n.class&&this.dom.classList.add(n.class),this.scale(),this.dom.setAttribute("aria-hidden","true"),this.setOrder(e.state),e.requestMeasure(this.measureReq),n.mount&&n.mount(this.dom,e)}update(e){e.startState.facet(kh)!=e.state.facet(kh)&&this.setOrder(e.state),(this.layer.update(e,this.dom)||e.geometryChanged)&&(this.scale(),e.view.requestMeasure(this.measureReq))}docViewUpdate(e){this.layer.updateOnDocViewUpdate!==!1&&e.requestMeasure(this.measureReq)}setOrder(e){let n=0,r=e.facet(kh);for(;n!LL(n,this.drawn[r]))){let n=this.dom.firstChild,r=0;for(let i of e)i.update&&n&&i.constructor&&this.drawn[r].constructor&&i.update(n,this.drawn[r])?(n=n.nextSibling,r++):this.dom.insertBefore(i.draw(),n);for(;n;){let i=n.nextSibling;n.remove(),n=i}this.drawn=e,ue.safari&&ue.safari_version>=26&&(this.dom.style.display=this.dom.firstChild?"":"none")}}destroy(){this.layer.destroy&&this.layer.destroy(this.dom,this.view),this.dom.remove()}}const kh=he.define();function dk(t){return[$t.define(e=>new BL(e,t)),kh.of(t)]}const $c=he.define({combine(t){return fi(t,{cursorBlinkRate:1200,drawRangeCursor:!0},{cursorBlinkRate:(e,n)=>Math.min(e,n),drawRangeCursor:(e,n)=>e||n})}});function $L(t={}){return[$c.of(t),zL,jL,VL,BD.of(!0)]}function hk(t){return t.startState.facet($c)!=t.state.facet($c)}const zL=dk({above:!0,markers(t){let{state:e}=t,n=e.facet($c),r=[];for(let i of e.selection.ranges){let s=i==e.selection.main;if(i.empty||n.drawRangeCursor){let o=s?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary",a=i.empty?i:Y.cursor(i.head,i.head>i.anchor?-1:1);for(let l of Lf.forRange(t,o,a))r.push(l)}}return r},update(t,e){t.transactions.some(r=>r.selection)&&(e.style.animationName=e.style.animationName=="cm-blink"?"cm-blink2":"cm-blink");let n=hk(t);return n&&IS(t.state,e),t.docChanged||t.selectionSet||n},mount(t,e){IS(e.state,t)},class:"cm-cursorLayer"});function IS(t,e){e.style.animationDuration=t.facet($c).cursorBlinkRate+"ms"}const jL=dk({above:!1,markers(t){return t.state.selection.ranges.map(e=>e.empty?[]:Lf.forRange(t,"cm-selectionBackground",e)).reduce((e,n)=>e.concat(n))},update(t,e){return t.docChanged||t.selectionSet||t.viewportChanged||hk(t)},class:"cm-selectionLayer"}),VL=Co.highest(ce.theme({".cm-line":{"& ::selection, &::selection":{backgroundColor:"transparent !important"},caretColor:"transparent !important"},".cm-content":{caretColor:"transparent !important","& :focus":{caretColor:"initial !important","&::selection, & ::selection":{backgroundColor:"Highlight !important"}}}})),pk=De.define({map(t,e){return t==null?null:e.mapPos(t)}}),Yu=Wt.define({create(){return null},update(t,e){return t!=null&&(t=e.changes.mapPos(t)),e.effects.reduce((n,r)=>r.is(pk)?r.value:n,t)}}),UL=$t.fromClass(class{constructor(t){this.view=t,this.cursor=null,this.measureReq={read:this.readPos.bind(this),write:this.drawCursor.bind(this)}}update(t){var e;let n=t.state.field(Yu);n==null?this.cursor!=null&&((e=this.cursor)===null||e===void 0||e.remove(),this.cursor=null):(this.cursor||(this.cursor=this.view.scrollDOM.appendChild(document.createElement("div")),this.cursor.className="cm-dropCursor"),(t.startState.field(Yu)!=n||t.docChanged||t.geometryChanged)&&this.view.requestMeasure(this.measureReq))}readPos(){let{view:t}=this,e=t.state.field(Yu),n=e!=null&&t.coordsAtPos(e);if(!n)return null;let r=t.scrollDOM.getBoundingClientRect();return{left:n.left-r.left+t.scrollDOM.scrollLeft*t.scaleX,top:n.top-r.top+t.scrollDOM.scrollTop*t.scaleY,height:n.bottom-n.top}}drawCursor(t){if(this.cursor){let{scaleX:e,scaleY:n}=this.view;t?(this.cursor.style.left=t.left/e+"px",this.cursor.style.top=t.top/n+"px",this.cursor.style.height=t.height/n+"px"):this.cursor.style.left="-100000px"}}destroy(){this.cursor&&this.cursor.remove()}setDropPos(t){this.view.state.field(Yu)!=t&&this.view.dispatch({effects:pk.of(t)})}},{eventObservers:{dragover(t){this.setDropPos(this.view.posAtCoords({x:t.clientX,y:t.clientY}))},dragleave(t){(t.target==this.view.contentDOM||!this.view.contentDOM.contains(t.relatedTarget))&&this.setDropPos(null)},dragend(){this.setDropPos(null)},drop(){this.setDropPos(null)}}});function HL(){return[Yu,UL]}function PS(t,e,n,r,i){e.lastIndex=0;for(let s=t.iterRange(n,r),o=n,a;!s.next().done;o+=s.value.length)if(!s.lineBreak)for(;a=e.exec(s.value);)i(o+a.index,a)}function qL(t,e){let n=t.visibleRanges;if(n.length==1&&n[0].from==t.viewport.from&&n[0].to==t.viewport.to)return n;let r=[];for(let{from:i,to:s}of n)i=Math.max(t.state.doc.lineAt(i).from,i-e),s=Math.min(t.state.doc.lineAt(s).to,s+e),r.length&&r[r.length-1].to>=i?r[r.length-1].to=s:r.push({from:i,to:s});return r}class GL{constructor(e){const{regexp:n,decoration:r,decorate:i,boundary:s,maxLength:o=1e3}=e;if(!n.global)throw new RangeError("The regular expression given to MatchDecorator should have its 'g' flag set");if(this.regexp=n,i)this.addMatch=(a,l,u,c)=>i(c,u,u+a[0].length,a,l);else if(typeof r=="function")this.addMatch=(a,l,u,c)=>{let f=r(a,l,u);f&&c(u,u+a[0].length,f)};else if(r)this.addMatch=(a,l,u,c)=>c(u,u+a[0].length,r);else throw new RangeError("Either 'decorate' or 'decoration' should be provided to MatchDecorator");this.boundary=s,this.maxLength=o}createDeco(e){let n=new _s,r=n.add.bind(n);for(let{from:i,to:s}of qL(e,this.maxLength))PS(e.state.doc,this.regexp,i,s,(o,a)=>this.addMatch(a,e,o,r));return n.finish()}updateDeco(e,n){let r=1e9,i=-1;return e.docChanged&&e.changes.iterChanges((s,o,a,l)=>{l>=e.view.viewport.from&&a<=e.view.viewport.to&&(r=Math.min(a,r),i=Math.max(l,i))}),e.viewportMoved||i-r>1e3?this.createDeco(e.view):i>-1?this.updateRange(e.view,n.map(e.changes),r,i):n}updateRange(e,n,r,i){for(let s of e.visibleRanges){let o=Math.max(s.from,r),a=Math.min(s.to,i);if(a>=o){let l=e.state.doc.lineAt(o),u=l.tol.from;o--)if(this.boundary.test(l.text[o-1-l.from])){c=o;break}for(;ad.push(b.range(m,g));if(l==u)for(this.regexp.lastIndex=c-l.from;(h=this.regexp.exec(l.text))&&h.indexthis.addMatch(g,e,m,p));n=n.update({filterFrom:c,filterTo:f,filter:(m,g)=>mf,add:d})}}return n}}const Rb=/x/.unicode!=null?"gu":"g",WL=new RegExp(`[\0-\b ---Ÿ­؜​‎‏\u2028\u2029‭‮⁦⁧⁩\uFEFF-]`,Rb),KL={0:"null",7:"bell",8:"backspace",10:"newline",11:"vertical tab",13:"carriage return",27:"escape",8203:"zero width space",8204:"zero width non-joiner",8205:"zero width joiner",8206:"left-to-right mark",8207:"right-to-left mark",8232:"line separator",8237:"left-to-right override",8238:"right-to-left override",8294:"left-to-right isolate",8295:"right-to-left isolate",8297:"pop directional isolate",8233:"paragraph separator",65279:"zero width no-break space",65532:"object replacement"};let vg=null;function XL(){var t;if(vg==null&&typeof document<"u"&&document.body){let e=document.body.style;vg=((t=e.tabSize)!==null&&t!==void 0?t:e.MozTabSize)!=null}return vg||!1}const Oh=he.define({combine(t){let e=fi(t,{render:null,specialChars:WL,addSpecialChars:null});return(e.replaceTabs=!XL())&&(e.specialChars=new RegExp(" |"+e.specialChars.source,Rb)),e.addSpecialChars&&(e.specialChars=new RegExp(e.specialChars.source+"|"+e.addSpecialChars.source,Rb)),e}});function YL(t={}){return[Oh.of(t),JL()]}let RS=null;function JL(){return RS||(RS=$t.fromClass(class{constructor(t){this.view=t,this.decorations=ve.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(t.state.facet(Oh)),this.decorations=this.decorator.createDeco(t)}makeDecorator(t){return new GL({regexp:t.specialChars,decoration:(e,n,r)=>{let{doc:i}=n.state,s=ir(e[0],0);if(s==9){let o=i.lineAt(r),a=n.state.tabSize,l=ru(o.text,a,r-o.from);return ve.replace({widget:new tB((a-l%a)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[s]||(this.decorationCache[s]=ve.replace({widget:new eB(t,s)}))},boundary:t.replaceTabs?void 0:/[^]/})}update(t){let e=t.state.facet(Oh);t.startState.facet(Oh)!=e?(this.decorator=this.makeDecorator(e),this.decorations=this.decorator.createDeco(t.view)):this.decorations=this.decorator.updateDeco(t,this.decorations)}},{decorations:t=>t.decorations}))}const ZL="•";function QL(t){return t>=32?ZL:t==10?"␤":String.fromCharCode(9216+t)}class eB extends Yi{constructor(e,n){super(),this.options=e,this.code=n}eq(e){return e.code==this.code}toDOM(e){let n=QL(this.code),r=e.state.phrase("Control character")+" "+(KL[this.code]||"0x"+this.code.toString(16)),i=this.options.render&&this.options.render(this.code,r,n);if(i)return i;let s=document.createElement("span");return s.textContent=n,s.title=r,s.setAttribute("aria-label",r),s.className="cm-specialChar",s}ignoreEvent(){return!1}}class tB extends Yi{constructor(e){super(),this.width=e}eq(e){return e.width==this.width}toDOM(){let e=document.createElement("span");return e.textContent=" ",e.className="cm-tab",e.style.width=this.width+"px",e}ignoreEvent(){return!1}}function nB(){return iB}const rB=ve.line({class:"cm-activeLine"}),iB=$t.fromClass(class{constructor(t){this.decorations=this.getDeco(t)}update(t){(t.docChanged||t.selectionSet)&&(this.decorations=this.getDeco(t.view))}getDeco(t){let e=-1,n=[];for(let r of t.state.selection.ranges){let i=t.lineBlockAt(r.head);i.from>e&&(n.push(rB.range(i.from)),e=i.from)}return ve.set(n)}},{decorations:t=>t.decorations});class sB extends Yi{constructor(e){super(),this.content=e}toDOM(e){let n=document.createElement("span");return n.className="cm-placeholder",n.style.pointerEvents="none",n.appendChild(typeof this.content=="string"?document.createTextNode(this.content):typeof this.content=="function"?this.content(e):this.content.cloneNode(!0)),n.setAttribute("aria-hidden","true"),n}coordsAt(e){let n=e.firstChild?kl(e.firstChild):[];if(!n.length)return null;let r=window.getComputedStyle(e.parentNode),i=Pf(n[0],r.direction!="rtl"),s=parseInt(r.lineHeight);return i.bottom-i.top>s*1.5?{left:i.left,right:i.right,top:i.top,bottom:i.top+s}:i}ignoreEvent(){return!1}}function oB(t){let e=$t.fromClass(class{constructor(n){this.view=n,this.placeholder=t?ve.set([ve.widget({widget:new sB(t),side:1}).range(0)]):ve.none}get decorations(){return this.view.state.doc.length?ve.none:this.placeholder}},{decorations:n=>n.decorations});return typeof t=="string"?[e,ce.contentAttributes.of({"aria-placeholder":t})]:e}const Nb=2e3;function aB(t,e,n){let r=Math.min(e.line,n.line),i=Math.max(e.line,n.line),s=[];if(e.off>Nb||n.off>Nb||e.col<0||n.col<0){let o=Math.min(e.off,n.off),a=Math.max(e.off,n.off);for(let l=r;l<=i;l++){let u=t.doc.line(l);u.length<=a&&s.push(Y.range(u.from+o,u.to+a))}}else{let o=Math.min(e.col,n.col),a=Math.max(e.col,n.col);for(let l=r;l<=i;l++){let u=t.doc.line(l),c=fb(u.text,o,t.tabSize,!0);if(c<0)s.push(Y.cursor(u.to));else{let f=fb(u.text,a,t.tabSize);s.push(Y.range(u.from+c,u.from+f))}}}return s}function lB(t,e){let n=t.coordsAtPos(t.viewport.from);return n?Math.round(Math.abs((n.left-e)/t.defaultCharacterWidth)):-1}function NS(t,e){let n=t.posAtCoords({x:e.clientX,y:e.clientY},!1),r=t.state.doc.lineAt(n),i=n-r.from,s=i>Nb?-1:i==r.length?lB(t,e.clientX):ru(r.text,t.state.tabSize,n-r.from);return{line:r.number,col:s,off:i}}function uB(t,e){let n=NS(t,e),r=t.state.selection;return n?{update(i){if(i.docChanged){let s=i.changes.mapPos(i.startState.doc.line(n.line).from),o=i.state.doc.lineAt(s);n={line:o.number,col:n.col,off:Math.min(n.off,o.length)},r=r.map(i.changes)}},get(i,s,o){let a=NS(t,i);if(!a)return r;let l=aB(t.state,n,a);return l.length?o?Y.create(l.concat(r.ranges)):Y.create(l):r}}:null}function cB(t){let e=(n=>n.altKey&&n.button==0);return ce.mouseSelectionStyle.of((n,r)=>e(r)?uB(n,r):null)}const fB={Alt:[18,t=>!!t.altKey],Control:[17,t=>!!t.ctrlKey],Shift:[16,t=>!!t.shiftKey],Meta:[91,t=>!!t.metaKey]},dB={style:"cursor: crosshair"};function hB(t={}){let[e,n]=fB[t.key||"Alt"],r=$t.fromClass(class{constructor(i){this.view=i,this.isDown=!1}set(i){this.isDown!=i&&(this.isDown=i,this.view.update([]))}},{eventObservers:{keydown(i){this.set(i.keyCode==e||n(i))},keyup(i){(i.keyCode==e||!n(i))&&this.set(!1)},mousemove(i){this.set(n(i))}}});return[r,ce.contentAttributes.of(i=>{var s;return!((s=i.plugin(r))===null||s===void 0)&&s.isDown?dB:null})]}const Iu="-10000px";class mk{constructor(e,n,r,i){this.facet=n,this.createTooltipView=r,this.removeTooltipView=i,this.input=e.state.facet(n),this.tooltips=this.input.filter(o=>o);let s=null;this.tooltipViews=this.tooltips.map(o=>s=r(o,s))}update(e,n){var r;let i=e.state.facet(this.facet),s=i.filter(l=>l);if(i===this.input){for(let l of this.tooltipViews)l.update&&l.update(e);return!1}let o=[],a=n?[]:null;for(let l=0;ln[u]=l),n.length=a.length),this.input=i,this.tooltips=s,this.tooltipViews=o,!0}}function pB(t){let e=t.dom.ownerDocument.documentElement;return{top:0,left:0,bottom:e.clientHeight,right:e.clientWidth}}const xg=he.define({combine:t=>{var e,n,r;return{position:ue.ios?"absolute":((e=t.find(i=>i.position))===null||e===void 0?void 0:e.position)||"fixed",parent:((n=t.find(i=>i.parent))===null||n===void 0?void 0:n.parent)||null,tooltipSpace:((r=t.find(i=>i.tooltipSpace))===null||r===void 0?void 0:r.tooltipSpace)||pB}}}),MS=new WeakMap,Cv=$t.fromClass(class{constructor(t){this.view=t,this.above=[],this.inView=!0,this.madeAbsolute=!1,this.lastTransaction=0,this.measureTimeout=-1;let e=t.state.facet(xg);this.position=e.position,this.parent=e.parent,this.classes=t.themeClasses,this.createContainer(),this.measureReq={read:this.readMeasure.bind(this),write:this.writeMeasure.bind(this),key:this},this.resizeObserver=typeof ResizeObserver=="function"?new ResizeObserver(()=>this.measureSoon()):null,this.manager=new mk(t,K0,(n,r)=>this.createTooltip(n,r),n=>{this.resizeObserver&&this.resizeObserver.unobserve(n.dom),n.dom.remove()}),this.above=this.manager.tooltips.map(n=>!!n.above),this.intersectionObserver=typeof IntersectionObserver=="function"?new IntersectionObserver(n=>{Date.now()>this.lastTransaction-50&&n.length>0&&n[n.length-1].intersectionRatio<1&&this.measureSoon()},{threshold:[1]}):null,this.observeIntersection(),t.win.addEventListener("resize",this.measureSoon=this.measureSoon.bind(this)),this.maybeMeasure()}createContainer(){this.parent?(this.container=document.createElement("div"),this.container.style.position="relative",this.container.className=this.view.themeClasses,this.parent.appendChild(this.container)):this.container=this.view.dom}observeIntersection(){if(this.intersectionObserver){this.intersectionObserver.disconnect();for(let t of this.manager.tooltipViews)this.intersectionObserver.observe(t.dom)}}measureSoon(){this.measureTimeout<0&&(this.measureTimeout=setTimeout(()=>{this.measureTimeout=-1,this.maybeMeasure()},50))}update(t){t.transactions.length&&(this.lastTransaction=Date.now());let e=this.manager.update(t,this.above);e&&this.observeIntersection();let n=e||t.geometryChanged,r=t.state.facet(xg);if(r.position!=this.position&&!this.madeAbsolute){this.position=r.position;for(let i of this.manager.tooltipViews)i.dom.style.position=this.position;n=!0}if(r.parent!=this.parent){this.parent&&this.container.remove(),this.parent=r.parent,this.createContainer();for(let i of this.manager.tooltipViews)this.container.appendChild(i.dom);n=!0}else this.parent&&this.view.themeClasses!=this.classes&&(this.classes=this.container.className=this.view.themeClasses);n&&this.maybeMeasure()}createTooltip(t,e){let n=t.create(this.view),r=e?e.dom:null;if(n.dom.classList.add("cm-tooltip"),t.arrow&&!n.dom.querySelector(".cm-tooltip > .cm-tooltip-arrow")){let i=document.createElement("div");i.className="cm-tooltip-arrow",n.dom.appendChild(i)}return n.dom.style.position=this.position,n.dom.style.top=Iu,n.dom.style.left="0px",this.container.insertBefore(n.dom,r),n.mount&&n.mount(this.view),this.resizeObserver&&this.resizeObserver.observe(n.dom),n}destroy(){var t,e,n;this.view.win.removeEventListener("resize",this.measureSoon);for(let r of this.manager.tooltipViews)r.dom.remove(),(t=r.destroy)===null||t===void 0||t.call(r);this.parent&&this.container.remove(),(e=this.resizeObserver)===null||e===void 0||e.disconnect(),(n=this.intersectionObserver)===null||n===void 0||n.disconnect(),clearTimeout(this.measureTimeout)}readMeasure(){let t=1,e=1,n=!1;if(this.position=="fixed"&&this.manager.tooltipViews.length){let{dom:s}=this.manager.tooltipViews[0];if(ue.gecko)n=s.offsetParent!=this.container.ownerDocument.body;else if(s.style.top==Iu&&s.style.left=="0px"){let o=s.getBoundingClientRect();n=Math.abs(o.top+1e4)>1||Math.abs(o.left)>1}}if(n||this.position=="absolute")if(this.parent){let s=this.parent.getBoundingClientRect();s.width&&s.height&&(t=s.width/this.parent.offsetWidth,e=s.height/this.parent.offsetHeight)}else({scaleX:t,scaleY:e}=this.view.viewState);let r=this.view.scrollDOM.getBoundingClientRect(),i=Sv(this.view);return{visible:{left:r.left+i.left,top:r.top+i.top,right:r.right-i.right,bottom:r.bottom-i.bottom},parent:this.parent?this.container.getBoundingClientRect():this.view.dom.getBoundingClientRect(),pos:this.manager.tooltips.map((s,o)=>{let a=this.manager.tooltipViews[o];return a.getCoords?a.getCoords(s.pos):this.view.coordsAtPos(s.pos)}),size:this.manager.tooltipViews.map(({dom:s})=>s.getBoundingClientRect()),space:this.view.state.facet(xg).tooltipSpace(this.view),scaleX:t,scaleY:e,makeAbsolute:n}}writeMeasure(t){var e;if(t.makeAbsolute){this.madeAbsolute=!0,this.position="absolute";for(let a of this.manager.tooltipViews)a.dom.style.position="absolute"}let{visible:n,space:r,scaleX:i,scaleY:s}=t,o=[];for(let a=0;a=Math.min(n.bottom,r.bottom)||f.rightMath.min(n.right,r.right)+.1)){c.style.top=Iu;continue}let h=l.arrow?u.dom.querySelector(".cm-tooltip-arrow"):null,p=h?7:0,m=d.right-d.left,g=(e=MS.get(u))!==null&&e!==void 0?e:d.bottom-d.top,b=u.offset||gB,y=this.view.textDirection==Et.LTR,x=d.width>r.right-r.left?y?r.left:r.right-d.width:y?Math.max(r.left,Math.min(f.left-(h?14:0)+b.x,r.right-m)):Math.min(Math.max(r.left,f.left-m+(h?14:0)-b.x),r.right-m),S=this.above[a];!l.strictSide&&(S?f.top-g-p-b.yr.bottom)&&S==r.bottom-f.bottom>f.top-r.top&&(S=this.above[a]=!S);let E=(S?f.top-r.top:r.bottom-f.bottom)-p;if(Ex&&A.topC&&(C=S?A.top-g-2-p:A.bottom+p+2);if(this.position=="absolute"?(c.style.top=(C-t.parent.top)/s+"px",FS(c,(x-t.parent.left)/i)):(c.style.top=C/s+"px",FS(c,x/i)),h){let A=f.left+(y?b.x:-b.x)-(x+14-7);h.style.left=A/i+"px"}u.overlap!==!0&&o.push({left:x,top:C,right:w,bottom:C+g}),c.classList.toggle("cm-tooltip-above",S),c.classList.toggle("cm-tooltip-below",!S),u.positioned&&u.positioned(t.space)}}maybeMeasure(){if(this.manager.tooltips.length&&(this.view.inView&&this.view.requestMeasure(this.measureReq),this.inView!=this.view.inView&&(this.inView=this.view.inView,!this.inView)))for(let t of this.manager.tooltipViews)t.dom.style.top=Iu}},{eventObservers:{scroll(){this.maybeMeasure()}}});function FS(t,e){let n=parseInt(t.style.left,10);(isNaN(n)||Math.abs(e-n)>1)&&(t.style.left=e+"px")}const mB=ce.baseTheme({".cm-tooltip":{zIndex:500,boxSizing:"border-box"},"&light .cm-tooltip":{border:"1px solid #bbb",backgroundColor:"#f5f5f5"},"&light .cm-tooltip-section:not(:first-child)":{borderTop:"1px solid #bbb"},"&dark .cm-tooltip":{backgroundColor:"#333338",color:"white"},".cm-tooltip-arrow":{height:"7px",width:"14px",position:"absolute",zIndex:-1,overflow:"hidden","&:before, &:after":{content:"''",position:"absolute",width:0,height:0,borderLeft:"7px solid transparent",borderRight:"7px solid transparent"},".cm-tooltip-above &":{bottom:"-7px","&:before":{borderTop:"7px solid #bbb"},"&:after":{borderTop:"7px solid #f5f5f5",bottom:"1px"}},".cm-tooltip-below &":{top:"-7px","&:before":{borderBottom:"7px solid #bbb"},"&:after":{borderBottom:"7px solid #f5f5f5",top:"1px"}}},"&dark .cm-tooltip .cm-tooltip-arrow":{"&:before":{borderTopColor:"#333338",borderBottomColor:"#333338"},"&:after":{borderTopColor:"transparent",borderBottomColor:"transparent"}}}),gB={x:0,y:0},K0=he.define({enables:[Cv,mB]}),Sp=he.define({combine:t=>t.reduce((e,n)=>e.concat(n),[])});class X0{static create(e){return new X0(e)}constructor(e){this.view=e,this.mounted=!1,this.dom=document.createElement("div"),this.dom.classList.add("cm-tooltip-hover"),this.manager=new mk(e,Sp,(n,r)=>this.createHostedView(n,r),n=>n.dom.remove())}createHostedView(e,n){let r=e.create(this.view);return r.dom.classList.add("cm-tooltip-section"),this.dom.insertBefore(r.dom,n?n.dom.nextSibling:this.dom.firstChild),this.mounted&&r.mount&&r.mount(this.view),r}mount(e){for(let n of this.manager.tooltipViews)n.mount&&n.mount(e);this.mounted=!0}positioned(e){for(let n of this.manager.tooltipViews)n.positioned&&n.positioned(e)}update(e){this.manager.update(e)}destroy(){var e;for(let n of this.manager.tooltipViews)(e=n.destroy)===null||e===void 0||e.call(n)}passProp(e){let n;for(let r of this.manager.tooltipViews){let i=r[e];if(i!==void 0){if(n===void 0)n=i;else if(n!==i)return}}return n}get offset(){return this.passProp("offset")}get getCoords(){return this.passProp("getCoords")}get overlap(){return this.passProp("overlap")}get resize(){return this.passProp("resize")}}const bB=K0.compute([Sp],t=>{let e=t.facet(Sp);return e.length===0?null:{pos:Math.min(...e.map(n=>n.pos)),end:Math.max(...e.map(n=>{var r;return(r=n.end)!==null&&r!==void 0?r:n.pos})),create:X0.create,above:e[0].above,arrow:e.some(n=>n.arrow)}});class yB{constructor(e,n,r,i,s){this.view=e,this.source=n,this.field=r,this.setHover=i,this.hoverTime=s,this.hoverTimeout=-1,this.restartTimeout=-1,this.pending=null,this.lastMove={x:0,y:0,target:e.dom,time:0},this.checkHover=this.checkHover.bind(this),e.dom.addEventListener("mouseleave",this.mouseleave=this.mouseleave.bind(this)),e.dom.addEventListener("mousemove",this.mousemove=this.mousemove.bind(this))}update(){this.pending&&(this.pending=null,clearTimeout(this.restartTimeout),this.restartTimeout=setTimeout(()=>this.startHover(),20))}get active(){return this.view.state.field(this.field)}checkHover(){if(this.hoverTimeout=-1,this.active.length)return;let e=Date.now()-this.lastMove.time;ea.bottom||n.xa.right+e.defaultCharacterWidth)return;let l=e.bidiSpans(e.state.doc.lineAt(i)).find(c=>c.from<=i&&c.to>=i),u=l&&l.dir==Et.RTL?-1:1;s=n.x{this.pending==a&&(this.pending=null,l&&!(Array.isArray(l)&&!l.length)&&e.dispatch({effects:this.setHover.of(Array.isArray(l)?l:[l])}))},l=>qn(e.state,l,"hover tooltip"))}else o&&!(Array.isArray(o)&&!o.length)&&e.dispatch({effects:this.setHover.of(Array.isArray(o)?o:[o])})}get tooltip(){let e=this.view.plugin(Cv),n=e?e.manager.tooltips.findIndex(r=>r.create==X0.create):-1;return n>-1?e.manager.tooltipViews[n]:null}mousemove(e){var n,r;this.lastMove={x:e.clientX,y:e.clientY,target:e.target,time:Date.now()},this.hoverTimeout<0&&(this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime));let{active:i,tooltip:s}=this;if(i.length&&s&&!vB(s.dom,e)||this.pending){let{pos:o}=i[0]||this.pending,a=(r=(n=i[0])===null||n===void 0?void 0:n.end)!==null&&r!==void 0?r:o;(o==a?this.view.posAtCoords(this.lastMove)!=o:!xB(this.view,o,a,e.clientX,e.clientY))&&(this.view.dispatch({effects:this.setHover.of([])}),this.pending=null)}}mouseleave(e){clearTimeout(this.hoverTimeout),this.hoverTimeout=-1;let{active:n}=this;if(n.length){let{tooltip:r}=this;r&&r.dom.contains(e.relatedTarget)?this.watchTooltipLeave(r.dom):this.view.dispatch({effects:this.setHover.of([])})}}watchTooltipLeave(e){let n=r=>{e.removeEventListener("mouseleave",n),this.active.length&&!this.view.dom.contains(r.relatedTarget)&&this.view.dispatch({effects:this.setHover.of([])})};e.addEventListener("mouseleave",n)}destroy(){clearTimeout(this.hoverTimeout),this.view.dom.removeEventListener("mouseleave",this.mouseleave),this.view.dom.removeEventListener("mousemove",this.mousemove)}}const Id=4;function vB(t,e){let{left:n,right:r,top:i,bottom:s}=t.getBoundingClientRect(),o;if(o=t.querySelector(".cm-tooltip-arrow")){let a=o.getBoundingClientRect();i=Math.min(a.top,i),s=Math.max(a.bottom,s)}return e.clientX>=n-Id&&e.clientX<=r+Id&&e.clientY>=i-Id&&e.clientY<=s+Id}function xB(t,e,n,r,i,s){let o=t.scrollDOM.getBoundingClientRect(),a=t.documentTop+t.documentPadding.top+t.contentHeight;if(o.left>r||o.righti||Math.min(o.bottom,a)=e&&l<=n}function gk(t,e={}){let n=De.define(),r=Wt.define({create(){return[]},update(i,s){if(i.length&&(e.hideOnChange&&(s.docChanged||s.selection)?i=[]:e.hideOn&&(i=i.filter(o=>!e.hideOn(s,o))),s.docChanged)){let o=[];for(let a of i){let l=s.changes.mapPos(a.pos,-1,En.TrackDel);if(l!=null){let u=Object.assign(Object.create(null),a);u.pos=l,u.end!=null&&(u.end=s.changes.mapPos(u.end)),o.push(u)}}i=o}for(let o of s.effects)o.is(n)&&(i=o.value),o.is(SB)&&(i=[]);return i},provide:i=>Sp.from(i)});return{active:r,extension:[r,$t.define(i=>new yB(i,t,r,n,e.hoverTime||300)),bB]}}function bk(t,e){let n=t.plugin(Cv);if(!n)return null;let r=n.manager.tooltips.indexOf(e);return r<0?null:n.manager.tooltipViews[r]}const SB=De.define(),LS=he.define({combine(t){let e,n;for(let r of t)e=e||r.topContainer,n=n||r.bottomContainer;return{topContainer:e,bottomContainer:n}}});function zc(t,e){let n=t.plugin(yk),r=n?n.specs.indexOf(e):-1;return r>-1?n.panels[r]:null}const yk=$t.fromClass(class{constructor(t){this.input=t.state.facet(jc),this.specs=this.input.filter(n=>n),this.panels=this.specs.map(n=>n(t));let e=t.state.facet(LS);this.top=new Pd(t,!0,e.topContainer),this.bottom=new Pd(t,!1,e.bottomContainer),this.top.sync(this.panels.filter(n=>n.top)),this.bottom.sync(this.panels.filter(n=>!n.top));for(let n of this.panels)n.dom.classList.add("cm-panel"),n.mount&&n.mount()}update(t){let e=t.state.facet(LS);this.top.container!=e.topContainer&&(this.top.sync([]),this.top=new Pd(t.view,!0,e.topContainer)),this.bottom.container!=e.bottomContainer&&(this.bottom.sync([]),this.bottom=new Pd(t.view,!1,e.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let n=t.state.facet(jc);if(n!=this.input){let r=n.filter(l=>l),i=[],s=[],o=[],a=[];for(let l of r){let u=this.specs.indexOf(l),c;u<0?(c=l(t.view),a.push(c)):(c=this.panels[u],c.update&&c.update(t)),i.push(c),(c.top?s:o).push(c)}this.specs=r,this.panels=i,this.top.sync(s),this.bottom.sync(o);for(let l of a)l.dom.classList.add("cm-panel"),l.mount&&l.mount()}else for(let r of this.panels)r.update&&r.update(t)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:t=>ce.scrollMargins.of(e=>{let n=e.plugin(t);return n&&{top:n.top.scrollMargin(),bottom:n.bottom.scrollMargin()}})});class Pd{constructor(e,n,r){this.view=e,this.top=n,this.container=r,this.dom=void 0,this.classes="",this.panels=[],this.syncClasses()}sync(e){for(let n of this.panels)n.destroy&&e.indexOf(n)<0&&n.destroy();this.panels=e,this.syncDOM()}syncDOM(){if(this.panels.length==0){this.dom&&(this.dom.remove(),this.dom=void 0);return}if(!this.dom){this.dom=document.createElement("div"),this.dom.className=this.top?"cm-panels cm-panels-top":"cm-panels cm-panels-bottom",this.dom.style[this.top?"top":"bottom"]="0";let n=this.container||this.view.dom;n.insertBefore(this.dom,this.top?n.firstChild:null)}let e=this.dom.firstChild;for(let n of this.panels)if(n.dom.parentNode==this.dom){for(;e!=n.dom;)e=BS(e);e=e.nextSibling}else this.dom.insertBefore(n.dom,e);for(;e;)e=BS(e)}scrollMargin(){return!this.dom||this.container?0:Math.max(0,this.top?this.dom.getBoundingClientRect().bottom-Math.max(0,this.view.scrollDOM.getBoundingClientRect().top):Math.min(innerHeight,this.view.scrollDOM.getBoundingClientRect().bottom)-this.dom.getBoundingClientRect().top)}syncClasses(){if(!(!this.container||this.classes==this.view.themeClasses)){for(let e of this.classes.split(" "))e&&this.container.classList.remove(e);for(let e of(this.classes=this.view.themeClasses).split(" "))e&&this.container.classList.add(e)}}}function BS(t){let e=t.nextSibling;return t.remove(),e}const jc=he.define({enables:yk});class Ui extends ua{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}}Ui.prototype.elementClass="";Ui.prototype.toDOM=void 0;Ui.prototype.mapMode=En.TrackBefore;Ui.prototype.startSide=Ui.prototype.endSide=-1;Ui.prototype.point=!0;const Th=he.define(),EB=he.define(),wB={class:"",renderEmptyElements:!1,elementStyle:"",markers:()=>Xe.empty,lineMarker:()=>null,widgetMarker:()=>null,lineMarkerChange:null,initialSpacer:null,updateSpacer:null,domEventHandlers:{},side:"before"},hc=he.define();function vk(t){return[xk(),hc.of({...wB,...t})]}const $S=he.define({combine:t=>t.some(e=>e)});function xk(t){return[_B]}const _B=$t.fromClass(class{constructor(t){this.view=t,this.domAfter=null,this.prevViewport=t.viewport,this.dom=document.createElement("div"),this.dom.className="cm-gutters cm-gutters-before",this.dom.setAttribute("aria-hidden","true"),this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.gutters=t.state.facet(hc).map(e=>new jS(t,e)),this.fixed=!t.state.facet($S);for(let e of this.gutters)e.config.side=="after"?this.getDOMAfter().appendChild(e.dom):this.dom.appendChild(e.dom);this.fixed&&(this.dom.style.position="sticky"),this.syncGutters(!1),t.scrollDOM.insertBefore(this.dom,t.contentDOM)}getDOMAfter(){return this.domAfter||(this.domAfter=document.createElement("div"),this.domAfter.className="cm-gutters cm-gutters-after",this.domAfter.setAttribute("aria-hidden","true"),this.domAfter.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.domAfter.style.position=this.fixed?"sticky":"",this.view.scrollDOM.appendChild(this.domAfter)),this.domAfter}update(t){if(this.updateGutters(t)){let e=this.prevViewport,n=t.view.viewport,r=Math.min(e.to,n.to)-Math.max(e.from,n.from);this.syncGutters(r<(n.to-n.from)*.8)}if(t.geometryChanged){let e=this.view.contentHeight/this.view.scaleY+"px";this.dom.style.minHeight=e,this.domAfter&&(this.domAfter.style.minHeight=e)}this.view.state.facet($S)!=!this.fixed&&(this.fixed=!this.fixed,this.dom.style.position=this.fixed?"sticky":"",this.domAfter&&(this.domAfter.style.position=this.fixed?"sticky":"")),this.prevViewport=t.view.viewport}syncGutters(t){let e=this.dom.nextSibling;t&&(this.dom.remove(),this.domAfter&&this.domAfter.remove());let n=Xe.iter(this.view.state.facet(Th),this.view.viewport.from),r=[],i=this.gutters.map(s=>new CB(s,this.view.viewport,-this.view.documentPadding.top));for(let s of this.view.viewportLineBlocks)if(r.length&&(r=[]),Array.isArray(s.type)){let o=!0;for(let a of s.type)if(a.type==Kn.Text&&o){Mb(n,r,a.from);for(let l of i)l.line(this.view,a,r);o=!1}else if(a.widget)for(let l of i)l.widget(this.view,a)}else if(s.type==Kn.Text){Mb(n,r,s.from);for(let o of i)o.line(this.view,s,r)}else if(s.widget)for(let o of i)o.widget(this.view,s);for(let s of i)s.finish();t&&(this.view.scrollDOM.insertBefore(this.dom,e),this.domAfter&&this.view.scrollDOM.appendChild(this.domAfter))}updateGutters(t){let e=t.startState.facet(hc),n=t.state.facet(hc),r=t.docChanged||t.heightChanged||t.viewportChanged||!Xe.eq(t.startState.facet(Th),t.state.facet(Th),t.view.viewport.from,t.view.viewport.to);if(e==n)for(let i of this.gutters)i.update(t)&&(r=!0);else{r=!0;let i=[];for(let s of n){let o=e.indexOf(s);o<0?i.push(new jS(this.view,s)):(this.gutters[o].update(t),i.push(this.gutters[o]))}for(let s of this.gutters)s.dom.remove(),i.indexOf(s)<0&&s.destroy();for(let s of i)s.config.side=="after"?this.getDOMAfter().appendChild(s.dom):this.dom.appendChild(s.dom);this.gutters=i}return r}destroy(){for(let t of this.gutters)t.destroy();this.dom.remove(),this.domAfter&&this.domAfter.remove()}},{provide:t=>ce.scrollMargins.of(e=>{let n=e.plugin(t);if(!n||n.gutters.length==0||!n.fixed)return null;let r=n.dom.offsetWidth*e.scaleX,i=n.domAfter?n.domAfter.offsetWidth*e.scaleX:0;return e.textDirection==Et.LTR?{left:r,right:i}:{right:r,left:i}})});function zS(t){return Array.isArray(t)?t:[t]}function Mb(t,e,n){for(;t.value&&t.from<=n;)t.from==n&&e.push(t.value),t.next()}class CB{constructor(e,n,r){this.gutter=e,this.height=r,this.i=0,this.cursor=Xe.iter(e.markers,n.from)}addElement(e,n,r){let{gutter:i}=this,s=(n.top-this.height)/e.scaleY,o=n.height/e.scaleY;if(this.i==i.elements.length){let a=new Sk(e,o,s,r);i.elements.push(a),i.dom.appendChild(a.dom)}else i.elements[this.i].update(e,o,s,r);this.height=n.bottom,this.i++}line(e,n,r){let i=[];Mb(this.cursor,i,n.from),r.length&&(i=i.concat(r));let s=this.gutter.config.lineMarker(e,n,i);s&&i.unshift(s);let o=this.gutter;i.length==0&&!o.config.renderEmptyElements||this.addElement(e,n,i)}widget(e,n){let r=this.gutter.config.widgetMarker(e,n.widget,n),i=r?[r]:null;for(let s of e.state.facet(EB)){let o=s(e,n.widget,n);o&&(i||(i=[])).push(o)}i&&this.addElement(e,n,i)}finish(){let e=this.gutter;for(;e.elements.length>this.i;){let n=e.elements.pop();e.dom.removeChild(n.dom),n.destroy()}}}class jS{constructor(e,n){this.view=e,this.config=n,this.elements=[],this.spacer=null,this.dom=document.createElement("div"),this.dom.className="cm-gutter"+(this.config.class?" "+this.config.class:"");for(let r in n.domEventHandlers)this.dom.addEventListener(r,i=>{let s=i.target,o;if(s!=this.dom&&this.dom.contains(s)){for(;s.parentNode!=this.dom;)s=s.parentNode;let l=s.getBoundingClientRect();o=(l.top+l.bottom)/2}else o=i.clientY;let a=e.lineBlockAtHeight(o-e.documentTop);n.domEventHandlers[r](e,a,i)&&i.preventDefault()});this.markers=zS(n.markers(e)),n.initialSpacer&&(this.spacer=new Sk(e,0,0,[n.initialSpacer(e)]),this.dom.appendChild(this.spacer.dom),this.spacer.dom.style.cssText+="visibility: hidden; pointer-events: none")}update(e){let n=this.markers;if(this.markers=zS(this.config.markers(e.view)),this.spacer&&this.config.updateSpacer){let i=this.config.updateSpacer(this.spacer.markers[0],e);i!=this.spacer.markers[0]&&this.spacer.update(e.view,0,0,[i])}let r=e.view.viewport;return!Xe.eq(this.markers,n,r.from,r.to)||(this.config.lineMarkerChange?this.config.lineMarkerChange(e):!1)}destroy(){for(let e of this.elements)e.destroy()}}class Sk{constructor(e,n,r,i){this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement("div"),this.dom.className="cm-gutterElement",this.update(e,n,r,i)}update(e,n,r,i){this.height!=n&&(this.height=n,this.dom.style.height=n+"px"),this.above!=r&&(this.dom.style.marginTop=(this.above=r)?r+"px":""),AB(this.markers,i)||this.setMarkers(e,i)}setMarkers(e,n){let r="cm-gutterElement",i=this.dom.firstChild;for(let s=0,o=0;;){let a=o,l=ss(a,l,u)||o(a,l,u):o}return r}})}});class Sg extends Ui{constructor(e){super(),this.number=e}eq(e){return this.number==e.number}toDOM(){return document.createTextNode(this.number)}}function Eg(t,e){return t.state.facet(el).formatNumber(e,t.state)}const OB=hc.compute([el],t=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers(e){return e.state.facet(DB)},lineMarker(e,n,r){return r.some(i=>i.toDOM)?null:new Sg(Eg(e,e.state.doc.lineAt(n.from).number))},widgetMarker:(e,n,r)=>{for(let i of e.state.facet(kB)){let s=i(e,n,r);if(s)return s}return null},lineMarkerChange:e=>e.startState.facet(el)!=e.state.facet(el),initialSpacer(e){return new Sg(Eg(e,VS(e.state.doc.lines)))},updateSpacer(e,n){let r=Eg(n.view,VS(n.view.state.doc.lines));return r==e.number?e:new Sg(r)},domEventHandlers:t.facet(el).domEventHandlers,side:"before"}));function TB(t={}){return[el.of(t),xk(),OB]}function VS(t){let e=9;for(;e{let e=[],n=-1;for(let r of t.selection.ranges){let i=t.doc.lineAt(r.head).from;i>n&&(n=i,e.push(IB.range(i)))}return Xe.of(e)});function RB(){return PB}class US{constructor(e,n,r){this.from=e,this.to=n,this.diagnostic=r}}class $o{constructor(e,n,r){this.diagnostics=e,this.panel=n,this.selected=r}static init(e,n,r){let i=r.facet(Pi).markerFilter;i&&(e=i(e,r));let s=e.slice().sort((c,f)=>c.from-f.from||c.to-f.to),o=new _s,a=[],l=0;for(let c=0;;){let f=c==s.length?null:s[c];if(!f&&!a.length)break;let d,h;for(a.length?(d=l,h=a.reduce((m,g)=>Math.min(m,g.to),f&&f.from>d?f.from:1e8)):(d=f.from,h=f.to,a.push(f),c++);cm.from||m.to==d))a.push(m),c++,h=Math.min(m.to,h);else{h=Math.min(m.from,h);break}}let p=kk(a);if(a.some(m=>m.from==m.to||m.from==m.to-1&&r.doc.lineAt(m.from).to==m.from))o.add(d,d,ve.widget({widget:new VB(p),diagnostics:a.slice()}));else{let m=a.reduce((g,b)=>b.markClass?g+" "+b.markClass:g,"");o.add(d,h,ve.mark({class:"cm-lintRange cm-lintRange-"+p+m,diagnostics:a.slice(),inclusiveEnd:a.some(g=>g.to>h)}))}l=h;for(let m=0;m{if(!(e&&o.diagnostics.indexOf(e)<0))if(!r)r=new US(i,s,e||o.diagnostics[0]);else{if(o.diagnostics.indexOf(r.diagnostic)<0)return!1;r=new US(r.from,s,r.diagnostic)}}),r}function Ek(t,e){let n=e.pos,r=e.end||n,i=t.state.facet(Pi).hideOn(t,n,r);if(i!=null)return i;let s=t.startState.doc.lineAt(e.pos);return!!(t.effects.some(o=>o.is(Y0))||t.changes.touchesRange(s.from,Math.max(s.to,r)))}function wk(t,e){return t.field(Cr,!1)?e:e.concat(De.appendConfig.of(Ik))}function NB(t,e){return{effects:wk(t,[Y0.of(e)])}}const Y0=De.define(),Av=De.define(),_k=De.define(),Cr=Wt.define({create(){return new $o(ve.none,null,null)},update(t,e){if(e.docChanged&&t.diagnostics.size){let n=t.diagnostics.map(e.changes),r=null,i=t.panel;if(t.selected){let s=e.changes.mapPos(t.selected.from,1);r=Pl(n,t.selected.diagnostic,s)||Pl(n,null,s)}!n.size&&i&&e.state.facet(Pi).autoPanel&&(i=null),t=new $o(n,i,r)}for(let n of e.effects)if(n.is(Y0)){let r=e.state.facet(Pi).autoPanel?n.value.length?Vc.open:null:t.panel;t=$o.init(n.value,r,e.state)}else n.is(Av)?t=new $o(t.diagnostics,n.value?Vc.open:null,t.selected):n.is(_k)&&(t=new $o(t.diagnostics,t.panel,n.value));return t},provide:t=>[jc.from(t,e=>e.panel),ce.decorations.from(t,e=>e.diagnostics)]}),MB=ve.mark({class:"cm-lintRange cm-lintRange-active"});function FB(t,e,n){let{diagnostics:r}=t.state.field(Cr),i,s=-1,o=-1;r.between(e-(n<0?1:0),e+(n>0?1:0),(l,u,{spec:c})=>{if(e>=l&&e<=u&&(l==u||(e>l||n>0)&&(eDk(t,n,!1)))}const LB=t=>{let e=t.state.field(Cr,!1);(!e||!e.panel)&&t.dispatch({effects:wk(t.state,[Av.of(!0)])});let n=zc(t,Vc.open);return n&&n.dom.querySelector(".cm-panel-lint ul").focus(),!0},HS=t=>{let e=t.state.field(Cr,!1);return!e||!e.panel?!1:(t.dispatch({effects:Av.of(!1)}),!0)},BB=t=>{let e=t.state.field(Cr,!1);if(!e)return!1;let n=t.state.selection.main,r=e.diagnostics.iter(n.to+1);return!r.value&&(r=e.diagnostics.iter(0),!r.value||r.from==n.from&&r.to==n.to)?!1:(t.dispatch({selection:{anchor:r.from,head:r.to},scrollIntoView:!0}),!0)},$B=[{key:"Mod-Shift-m",run:LB,preventDefault:!0},{key:"F8",run:BB}],zB=$t.fromClass(class{constructor(t){this.view=t,this.timeout=-1,this.set=!0;let{delay:e}=t.state.facet(Pi);this.lintTime=Date.now()+e,this.run=this.run.bind(this),this.timeout=setTimeout(this.run,e)}run(){clearTimeout(this.timeout);let t=Date.now();if(tPromise.resolve(r(this.view))),r=>{this.view.state.doc==e.doc&&this.view.dispatch(NB(this.view.state,r.reduce((i,s)=>i.concat(s))))},r=>{qn(this.view.state,r)})}}update(t){let e=t.state.facet(Pi);(t.docChanged||e!=t.startState.facet(Pi)||e.needsRefresh&&e.needsRefresh(t))&&(this.lintTime=Date.now()+e.delay,this.set||(this.set=!0,this.timeout=setTimeout(this.run,e.delay)))}force(){this.set&&(this.lintTime=Date.now(),this.run())}destroy(){clearTimeout(this.timeout)}});function jB(t,e,n){let r=[],i=-1;for(let s of t)s.then(o=>{r.push(o),clearTimeout(i),r.length==t.length?e(r):i=setTimeout(()=>e(r),200)},n)}const Pi=he.define({combine(t){return{sources:t.map(e=>e.source).filter(e=>e!=null),...fi(t.map(e=>e.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null,hideOn:()=>null},{delay:Math.max,markerFilter:qS,tooltipFilter:qS,needsRefresh:(e,n)=>e?n?r=>e(r)||n(r):e:n,hideOn:(e,n)=>e?n?(r,i,s)=>e(r,i,s)||n(r,i,s):e:n,autoPanel:(e,n)=>e||n})}}});function qS(t,e){return t?e?(n,r)=>e(t(n,r),r):t:e}function Fb(t,e={}){return[Pi.of({source:t,config:e}),zB,Ik]}function Ak(t){let e=[];if(t)e:for(let{name:n}of t){for(let r=0;rs.toLowerCase()==i.toLowerCase())){e.push(i);continue e}}e.push("")}return e}function Dk(t,e,n){var r;let i=n?Ak(e.actions):[];return ct("li",{class:"cm-diagnostic cm-diagnostic-"+e.severity},ct("span",{class:"cm-diagnosticText"},e.renderMessage?e.renderMessage(t):e.message),(r=e.actions)===null||r===void 0?void 0:r.map((s,o)=>{let a=!1,l=h=>{if(h.preventDefault(),a)return;a=!0;let p=Pl(t.state.field(Cr).diagnostics,e);p&&s.apply(t,p.from,p.to)},{name:u}=s,c=i[o]?u.indexOf(i[o]):-1,f=c<0?u:[u.slice(0,c),ct("u",u.slice(c,c+1)),u.slice(c+1)],d=s.markClass?" "+s.markClass:"";return ct("button",{type:"button",class:"cm-diagnosticAction"+d,onclick:l,onmousedown:l,"aria-label":` Action: ${u}${c<0?"":` (access key "${i[o]})"`}.`},f)}),e.source&&ct("div",{class:"cm-diagnosticSource"},e.source))}class VB extends Yi{constructor(e){super(),this.sev=e}eq(e){return e.sev==this.sev}toDOM(){return ct("span",{class:"cm-lintPoint cm-lintPoint-"+this.sev})}}class GS{constructor(e,n){this.diagnostic=n,this.id="item_"+Math.floor(Math.random()*4294967295).toString(16),this.dom=Dk(e,n,!0),this.dom.id=this.id,this.dom.setAttribute("role","option")}}class Vc{constructor(e){this.view=e,this.items=[];let n=i=>{if(i.keyCode==27)HS(this.view),this.view.focus();else if(i.keyCode==38||i.keyCode==33)this.moveSelection((this.selectedIndex-1+this.items.length)%this.items.length);else if(i.keyCode==40||i.keyCode==34)this.moveSelection((this.selectedIndex+1)%this.items.length);else if(i.keyCode==36)this.moveSelection(0);else if(i.keyCode==35)this.moveSelection(this.items.length-1);else if(i.keyCode==13)this.view.focus();else if(i.keyCode>=65&&i.keyCode<=90&&this.selectedIndex>=0){let{diagnostic:s}=this.items[this.selectedIndex],o=Ak(s.actions);for(let a=0;a{for(let s=0;sHS(this.view)},"×")),this.update()}get selectedIndex(){let e=this.view.state.field(Cr).selected;if(!e)return-1;for(let n=0;n{for(let c of u.diagnostics){if(o.has(c))continue;o.add(c);let f=-1,d;for(let h=r;hr&&(this.items.splice(r,f-r),i=!0)),n&&d.diagnostic==n.diagnostic?d.dom.hasAttribute("aria-selected")||(d.dom.setAttribute("aria-selected","true"),s=d):d.dom.hasAttribute("aria-selected")&&d.dom.removeAttribute("aria-selected"),r++}});r({sel:s.dom.getBoundingClientRect(),panel:this.list.getBoundingClientRect()}),write:({sel:a,panel:l})=>{let u=l.height/this.list.offsetHeight;a.topl.bottom&&(this.list.scrollTop+=(a.bottom-l.bottom)/u)}})):this.selectedIndex<0&&this.list.removeAttribute("aria-activedescendant"),i&&this.sync()}sync(){let e=this.list.firstChild;function n(){let r=e;e=r.nextSibling,r.remove()}for(let r of this.items)if(r.dom.parentNode==this.list){for(;e!=r.dom;)n();e=r.dom.nextSibling}else this.list.insertBefore(r.dom,e);for(;e;)n()}moveSelection(e){if(this.selectedIndex<0)return;let n=this.view.state.field(Cr),r=Pl(n.diagnostics,this.items[e].diagnostic);r&&this.view.dispatch({selection:{anchor:r.from,head:r.to},scrollIntoView:!0,effects:_k.of(r)})}static open(e){return new Vc(e)}}function Ih(t,e='viewBox="0 0 40 40"'){return`url('data:image/svg+xml,${encodeURIComponent(t)}')`}function Rd(t){return Ih(``,'width="6" height="3"')}const UB=ce.baseTheme({".cm-diagnostic":{padding:"3px 6px 3px 8px",marginLeft:"-1px",display:"block",whiteSpace:"pre-wrap"},".cm-diagnostic-error":{borderLeft:"5px solid #d11"},".cm-diagnostic-warning":{borderLeft:"5px solid orange"},".cm-diagnostic-info":{borderLeft:"5px solid #999"},".cm-diagnostic-hint":{borderLeft:"5px solid #66d"},".cm-diagnosticAction":{font:"inherit",border:"none",padding:"2px 4px",backgroundColor:"#444",color:"white",borderRadius:"3px",marginLeft:"8px",cursor:"pointer"},".cm-diagnosticSource":{fontSize:"70%",opacity:.7},".cm-lintRange":{backgroundPosition:"left bottom",backgroundRepeat:"repeat-x",paddingBottom:"0.7px"},".cm-lintRange-error":{backgroundImage:Rd("#d11")},".cm-lintRange-warning":{backgroundImage:Rd("orange")},".cm-lintRange-info":{backgroundImage:Rd("#999")},".cm-lintRange-hint":{backgroundImage:Rd("#66d")},".cm-lintRange-active":{backgroundColor:"#ffdd9980"},".cm-tooltip-lint":{padding:0,margin:0},".cm-lintPoint":{position:"relative","&:after":{content:'""',position:"absolute",bottom:0,left:"-2px",borderLeft:"3px solid transparent",borderRight:"3px solid transparent",borderBottom:"4px solid #d11"}},".cm-lintPoint-warning":{"&:after":{borderBottomColor:"orange"}},".cm-lintPoint-info":{"&:after":{borderBottomColor:"#999"}},".cm-lintPoint-hint":{"&:after":{borderBottomColor:"#66d"}},".cm-panel.cm-panel-lint":{position:"relative","& ul":{maxHeight:"100px",overflowY:"auto","& [aria-selected]":{backgroundColor:"#ddd","& u":{textDecoration:"underline"}},"&:focus [aria-selected]":{background_fallback:"#bdf",backgroundColor:"Highlight",color_fallback:"white",color:"HighlightText"},"& u":{textDecoration:"none"},padding:0,margin:0},"& [name=close]":{position:"absolute",top:"0",right:"2px",background:"inherit",border:"none",font:"inherit",padding:0,margin:0}}});function HB(t){return t=="error"?4:t=="warning"?3:t=="info"?2:1}function kk(t){let e="hint",n=1;for(let r of t){let i=HB(r.severity);i>n&&(n=i,e=r.severity)}return e}class Ok extends Ui{constructor(e){super(),this.diagnostics=e,this.severity=kk(e)}toDOM(e){let n=document.createElement("div");n.className="cm-lint-marker cm-lint-marker-"+this.severity;let r=this.diagnostics,i=e.state.facet(J0).tooltipFilter;return i&&(r=i(r,e.state)),r.length&&(n.onmouseover=()=>GB(e,n,r)),n}}function qB(t,e){let n=r=>{let i=e.getBoundingClientRect();if(!(r.clientX>i.left-10&&r.clientXi.top-10&&r.clientYe.getBoundingClientRect()}}})}),e.onmouseout=e.onmousemove=null,qB(t,e)}let{hoverTime:i}=t.state.facet(J0),s=setTimeout(r,i);e.onmouseout=()=>{clearTimeout(s),e.onmouseout=e.onmousemove=null},e.onmousemove=()=>{clearTimeout(s),s=setTimeout(r,i)}}function WB(t,e){let n=Object.create(null);for(let i of e){let s=t.lineAt(i.from);(n[s.from]||(n[s.from]=[])).push(i)}let r=[];for(let i in n)r.push(new Ok(n[i]).range(+i));return Xe.of(r,!0)}const KB=vk({class:"cm-gutter-lint",markers:t=>t.state.field(Lb),widgetMarker:(t,e,n)=>{let r=[];return t.state.field(Lb).between(n.from,n.to,(i,s,o)=>{i>n.from&&ir.is(Dv)?r.value:n,t)},provide:t=>K0.from(t)}),XB=ce.baseTheme({".cm-gutter-lint":{width:"1.4em","& .cm-gutterElement":{padding:".2em"}},".cm-lint-marker":{width:"1em",height:"1em"},".cm-lint-marker-info":{content:Ih('')},".cm-lint-marker-warning":{content:Ih('')},".cm-lint-marker-error":{content:Ih('')}}),Ik=[Cr,ce.decorations.compute([Cr],t=>{let{selected:e,panel:n}=t.field(Cr);return!e||!n||e.from==e.to?ve.none:ve.set([MB.range(e.from,e.to)])}),gk(FB,{hideOn:Ek}),UB],J0=he.define({combine(t){return fi(t,{hoverTime:300,markerFilter:null,tooltipFilter:null})}});function YB(t={}){return[J0.of(t),Lb,KB,XB,Tk]}function JB(t,e=!1){const n=t.length;let r=0,i="",s=0,o=16,a=0,l=0,u=0,c=0,f=0;function d(x,S){let E=0,C=0;for(;E=48&&w<=57)C=C*16+w-48;else if(w>=65&&w<=70)C=C*16+w-65+10;else if(w>=97&&w<=102)C=C*16+w-97+10;else break;r++,E++}return E=n){x+=t.substring(S,r),f=2;break}const E=t.charCodeAt(r);if(E===34){x+=t.substring(S,r),r++;break}if(E===92){if(x+=t.substring(S,r),r++,r>=n){f=2;break}switch(t.charCodeAt(r++)){case 34:x+='"';break;case 92:x+="\\";break;case 47:x+="/";break;case 98:x+="\b";break;case 102:x+="\f";break;case 110:x+=` -`;break;case 114:x+="\r";break;case 116:x+=" ";break;case 117:const w=d(4);w>=0?x+=String.fromCharCode(w):f=4;break;default:f=5}S=r;continue}if(E>=0&&E<=31)if(Pu(E)){x+=t.substring(S,r),f=2;break}else f=6;r++}return x}function g(){if(i="",f=0,s=r,l=a,c=u,r>=n)return s=n,o=17;let x=t.charCodeAt(r);if(wg(x)){do r++,i+=String.fromCharCode(x),x=t.charCodeAt(r);while(wg(x));return o=15}if(Pu(x))return r++,i+=String.fromCharCode(x),x===13&&t.charCodeAt(r)===10&&(r++,i+=` -`),a++,u=r,o=14;switch(x){case 123:return r++,o=1;case 125:return r++,o=2;case 91:return r++,o=3;case 93:return r++,o=4;case 58:return r++,o=6;case 44:return r++,o=5;case 34:return r++,i=m(),o=10;case 47:const S=r-1;if(t.charCodeAt(r+1)===47){for(r+=2;r=12&&x<=15);return x}return{setPosition:h,getPosition:()=>r,scan:e?y:g,getToken:()=>o,getTokenValue:()=>i,getTokenOffset:()=>s,getTokenLength:()=>r-s,getTokenStartLine:()=>l,getTokenStartCharacter:()=>s-c,getTokenError:()=>f}}function wg(t){return t===32||t===9}function Pu(t){return t===10||t===13}function Fa(t){return t>=48&&t<=57}var WS;(function(t){t[t.lineFeed=10]="lineFeed",t[t.carriageReturn=13]="carriageReturn",t[t.space=32]="space",t[t._0=48]="_0",t[t._1=49]="_1",t[t._2=50]="_2",t[t._3=51]="_3",t[t._4=52]="_4",t[t._5=53]="_5",t[t._6=54]="_6",t[t._7=55]="_7",t[t._8=56]="_8",t[t._9=57]="_9",t[t.a=97]="a",t[t.b=98]="b",t[t.c=99]="c",t[t.d=100]="d",t[t.e=101]="e",t[t.f=102]="f",t[t.g=103]="g",t[t.h=104]="h",t[t.i=105]="i",t[t.j=106]="j",t[t.k=107]="k",t[t.l=108]="l",t[t.m=109]="m",t[t.n=110]="n",t[t.o=111]="o",t[t.p=112]="p",t[t.q=113]="q",t[t.r=114]="r",t[t.s=115]="s",t[t.t=116]="t",t[t.u=117]="u",t[t.v=118]="v",t[t.w=119]="w",t[t.x=120]="x",t[t.y=121]="y",t[t.z=122]="z",t[t.A=65]="A",t[t.B=66]="B",t[t.C=67]="C",t[t.D=68]="D",t[t.E=69]="E",t[t.F=70]="F",t[t.G=71]="G",t[t.H=72]="H",t[t.I=73]="I",t[t.J=74]="J",t[t.K=75]="K",t[t.L=76]="L",t[t.M=77]="M",t[t.N=78]="N",t[t.O=79]="O",t[t.P=80]="P",t[t.Q=81]="Q",t[t.R=82]="R",t[t.S=83]="S",t[t.T=84]="T",t[t.U=85]="U",t[t.V=86]="V",t[t.W=87]="W",t[t.X=88]="X",t[t.Y=89]="Y",t[t.Z=90]="Z",t[t.asterisk=42]="asterisk",t[t.backslash=92]="backslash",t[t.closeBrace=125]="closeBrace",t[t.closeBracket=93]="closeBracket",t[t.colon=58]="colon",t[t.comma=44]="comma",t[t.dot=46]="dot",t[t.doubleQuote=34]="doubleQuote",t[t.minus=45]="minus",t[t.openBrace=123]="openBrace",t[t.openBracket=91]="openBracket",t[t.plus=43]="plus",t[t.slash=47]="slash",t[t.formFeed=12]="formFeed",t[t.tab=9]="tab"})(WS||(WS={}));new Array(20).fill(0).map((t,e)=>" ".repeat(e));const La=200;new Array(La).fill(0).map((t,e)=>` +`){[e,n]=Dl(this,e,n);let i="";for(let s=0,o=0;se&&s&&(i+=r),eo&&(i+=a.sliceString(e-o,n-o,r)),o=l+1}return i}flatten(e){for(let n of this.children)n.flatten(e)}scanIdentical(e,n){if(!(e instanceof Ai))return 0;let r=0,[i,s,o,a]=n>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;i+=n,s+=n){if(i==o||s==a)return r;let l=this.children[i],u=e.children[s];if(l!=u)return r+l.scanIdentical(u,n);r+=l.length+1}}static from(e,n=e.reduce((r,i)=>r+i.length+1,-1)){let r=0;for(let h of e)r+=h.lines;if(r<32){let h=[];for(let p of e)p.flatten(h);return new Ht(h,n)}let i=Math.max(32,r>>5),s=i<<1,o=i>>1,a=[],l=0,u=-1,c=[];function f(h){let p;if(h.lines>s&&h instanceof Ai)for(let m of h.children)f(m);else h.lines>o&&(l>o||!l)?(d(),a.push(h)):h instanceof Ht&&l&&(p=c[c.length-1])instanceof Ht&&h.lines+p.lines<=32?(l+=h.lines,u+=h.length+1,c[c.length-1]=new Ht(p.text.concat(h.text),p.length+1+h.length)):(l+h.lines>i&&d(),l+=h.lines,u+=h.length+1,c.push(h))}function d(){l!=0&&(a.push(c.length==1?c[0]:Ai.from(c,u)),u=-1,l=c.length=0)}for(let h of e)f(h);return d(),a.length==1?a[0]:new Ai(a,n)}}Ze.empty=new Ht([""],0);function zF(t){let e=-1;for(let n of t)e+=n.length+1;return e}function _h(t,e,n=0,r=1e9){for(let i=0,s=0,o=!0;s=n&&(l>r&&(a=a.slice(0,r-i)),i0?1:(e instanceof Ht?e.text.length:e.children.length)<<1]}nextInner(e,n){for(this.done=this.lineBreak=!1;;){let r=this.nodes.length-1,i=this.nodes[r],s=this.offsets[r],o=s>>1,a=i instanceof Ht?i.text.length:i.children.length;if(o==(n>0?a:0)){if(r==0)return this.done=!0,this.value="",this;n>0&&this.offsets[r-1]++,this.nodes.pop(),this.offsets.pop()}else if((s&1)==(n>0?0:1)){if(this.offsets[r]+=n,e==0)return this.lineBreak=!0,this.value=` +`,this;e--}else if(i instanceof Ht){let l=i.text[o+(n<0?-1:0)];if(this.offsets[r]+=n,l.length>Math.max(0,e))return this.value=e==0?l:n>0?l.slice(e):l.slice(0,l.length-e),this;e-=l.length}else{let l=i.children[o+(n<0?-1:0)];e>l.length?(e-=l.length,this.offsets[r]+=n):(n<0&&this.offsets[r]--,this.nodes.push(l),this.offsets.push(n>0?1:(l instanceof Ht?l.text.length:l.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}class JA{constructor(e,n,r){this.value="",this.done=!1,this.cursor=new lc(e,n>r?-1:1),this.pos=n>r?e.length:0,this.from=Math.min(n,r),this.to=Math.max(n,r)}nextInner(e,n){if(n<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;e+=Math.max(0,n<0?this.pos-this.to:this.from-this.pos);let r=n<0?this.pos-this.from:this.to-this.pos;e>r&&(e=r),r-=e;let{value:i}=this.cursor.next(e);return this.pos+=(i.length+e)*n,this.value=i.length<=r?i:n<0?i.slice(i.length-r):i.slice(0,r),this.done=!this.value,this}next(e=0){return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=""}}class ZA{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:n,lineBreak:r,value:i}=this.inner.next(e);return n&&this.afterBreak?(this.value="",this.afterBreak=!1):n?(this.done=!0,this.value=""):r?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=i,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol<"u"&&(Ze.prototype[Symbol.iterator]=function(){return this.iter()},lc.prototype[Symbol.iterator]=JA.prototype[Symbol.iterator]=ZA.prototype[Symbol.iterator]=function(){return this});class jF{constructor(e,n,r,i){this.from=e,this.to=n,this.number=r,this.text=i}get length(){return this.to-this.from}}function Dl(t,e,n){return e=Math.max(0,Math.min(t.length,e)),[e,Math.max(e,Math.min(t.length,n))]}function wn(t,e,n=!0,r=!0){return BF(t,e,n,r)}function VF(t){return t>=56320&&t<57344}function UF(t){return t>=55296&&t<56320}function ir(t,e){let n=t.charCodeAt(e);if(!UF(n)||e+1==t.length)return n;let r=t.charCodeAt(e+1);return VF(r)?(n-55296<<10)+(r-56320)+65536:n}function hv(t){return t<=65535?String.fromCharCode(t):(t-=65536,String.fromCharCode((t>>10)+55296,(t&1023)+56320))}function Di(t){return t<65536?1:2}const tb=/\r\n?|\n/;var En=(function(t){return t[t.Simple=0]="Simple",t[t.TrackDel=1]="TrackDel",t[t.TrackBefore=2]="TrackBefore",t[t.TrackAfter=3]="TrackAfter",t})(En||(En={}));class Li{constructor(e){this.sections=e}get length(){let e=0;for(let n=0;ne)return s+(e-i);s+=a}else{if(r!=En.Simple&&u>=e&&(r==En.TrackDel&&ie||r==En.TrackBefore&&ie))return null;if(u>e||u==e&&n<0&&!a)return e==i||n<0?s:s+l;s+=l}i=u}if(e>i)throw new RangeError(`Position ${e} is out of range for changeset of length ${i}`);return s}touchesRange(e,n=e){for(let r=0,i=0;r=0&&i<=n&&a>=e)return in?"cover":!0;i=a}return!1}toString(){let e="";for(let n=0;n=0?":"+i:"")}return e}toJSON(){return this.sections}static fromJSON(e){if(!Array.isArray(e)||e.length%2||e.some(n=>typeof n!="number"))throw new RangeError("Invalid JSON representation of ChangeDesc");return new Li(e)}static create(e){return new Li(e)}}class sn extends Li{constructor(e,n){super(e),this.inserted=n}apply(e){if(this.length!=e.length)throw new RangeError("Applying change set to a document with the wrong length");return nb(this,(n,r,i,s,o)=>e=e.replace(i,i+(r-n),o),!1),e}mapDesc(e,n=!1){return rb(this,e,n,!0)}invert(e){let n=this.sections.slice(),r=[];for(let i=0,s=0;i=0){n[i]=a,n[i+1]=o;let l=i>>1;for(;r.length0&&Gs(r,n,s.text),s.forward(c),a+=c}let u=e[o++];for(;a>1].toJSON()))}return e}static of(e,n,r){let i=[],s=[],o=0,a=null;function l(c=!1){if(!c&&!i.length)return;od||f<0||d>n)throw new RangeError(`Invalid change range ${f} to ${d} (in doc of length ${n})`);let p=h?typeof h=="string"?Ze.of(h.split(r||tb)):h:Ze.empty,m=p.length;if(f==d&&m==0)return;fo&&On(i,f-o,-1),On(i,d-f,m),Gs(s,i,p),o=d}}return u(e),l(!a),a}static empty(e){return new sn(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw new RangeError("Invalid JSON representation of ChangeSet");let n=[],r=[];for(let i=0;ia&&typeof o!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(s.length==1)n.push(s[0],0);else{for(;r.length=0&&n<=0&&n==t[i+1]?t[i]+=e:i>=0&&e==0&&t[i]==0?t[i+1]+=n:r?(t[i]+=e,t[i+1]+=n):t.push(e,n)}function Gs(t,e,n){if(n.length==0)return;let r=e.length-2>>1;if(r>1])),!(n||o==t.sections.length||t.sections[o+1]<0);)a=t.sections[o++],l=t.sections[o++];e(i,u,s,c,f),i=u,s=c}}}function rb(t,e,n,r=!1){let i=[],s=r?[]:null,o=new Nc(t),a=new Nc(e);for(let l=-1;;){if(o.done&&a.len||a.done&&o.len)throw new Error("Mismatched change set lengths");if(o.ins==-1&&a.ins==-1){let u=Math.min(o.len,a.len);On(i,u,-1),o.forward(u),a.forward(u)}else if(a.ins>=0&&(o.ins<0||l==o.i||o.off==0&&(a.len=0&&l=0){let u=0,c=o.len;for(;c;)if(a.ins==-1){let f=Math.min(c,a.len);u+=f,c-=f,a.forward(f)}else if(a.ins==0&&a.lenl||o.ins>=0&&o.len>l)&&(a||r.length>u),s.forward2(l),o.forward(l)}}}}class Nc{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i>1;return n>=e.length?Ze.empty:e[n]}textBit(e){let{inserted:n}=this.set,r=this.i-2>>1;return r>=n.length&&!e?Ze.empty:n[r].slice(this.off,e==null?void 0:this.off+e)}forward(e){e==this.len?this.next():(this.len-=e,this.off+=e)}forward2(e){this.ins==-1?this.forward(e):e==this.ins?this.next():(this.ins-=e,this.off+=e)}}class qo{constructor(e,n,r){this.from=e,this.to=n,this.flags=r}get anchor(){return this.flags&32?this.to:this.from}get head(){return this.flags&32?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return this.flags&8?-1:this.flags&16?1:0}get bidiLevel(){let e=this.flags&7;return e==7?null:e}get goalColumn(){let e=this.flags>>6;return e==16777215?void 0:e}map(e,n=-1){let r,i;return this.empty?r=i=e.mapPos(this.from,n):(r=e.mapPos(this.from,1),i=e.mapPos(this.to,-1)),r==this.from&&i==this.to?this:new qo(r,i,this.flags)}extend(e,n=e){if(e<=this.anchor&&n>=this.anchor)return Y.range(e,n);let r=Math.abs(e-this.anchor)>Math.abs(n-this.anchor)?e:n;return Y.range(this.anchor,r)}eq(e,n=!1){return this.anchor==e.anchor&&this.head==e.head&&(!n||!this.empty||this.assoc==e.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(e){if(!e||typeof e.anchor!="number"||typeof e.head!="number")throw new RangeError("Invalid JSON representation for SelectionRange");return Y.range(e.anchor,e.head)}static create(e,n,r){return new qo(e,n,r)}}class Y{constructor(e,n){this.ranges=e,this.mainIndex=n}map(e,n=-1){return e.empty?this:Y.create(this.ranges.map(r=>r.map(e,n)),this.mainIndex)}eq(e,n=!1){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let r=0;re.toJSON()),main:this.mainIndex}}static fromJSON(e){if(!e||!Array.isArray(e.ranges)||typeof e.main!="number"||e.main>=e.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new Y(e.ranges.map(n=>qo.fromJSON(n)),e.main)}static single(e,n=e){return new Y([Y.range(e,n)],0)}static create(e,n=0){if(e.length==0)throw new RangeError("A selection needs at least one range");for(let r=0,i=0;ie?8:0)|s)}static normalized(e,n=0){let r=e[n];e.sort((i,s)=>i.from-s.from),n=e.indexOf(r);for(let i=1;is.head?Y.range(l,a):Y.range(a,l))}}return new Y(e,n)}}function eD(t,e){for(let n of t.ranges)if(n.to>e)throw new RangeError("Selection points outside of document")}let pv=0;class he{constructor(e,n,r,i,s){this.combine=e,this.compareInput=n,this.compare=r,this.isStatic=i,this.id=pv++,this.default=e([]),this.extensions=typeof s=="function"?s(this):s}get reader(){return this}static define(e={}){return new he(e.combine||(n=>n),e.compareInput||((n,r)=>n===r),e.compare||(e.combine?(n,r)=>n===r:mv),!!e.static,e.enables)}of(e){return new Ch([],this,0,e)}compute(e,n){if(this.isStatic)throw new Error("Can't compute a static facet");return new Ch(e,this,1,n)}computeN(e,n){if(this.isStatic)throw new Error("Can't compute a static facet");return new Ch(e,this,2,n)}from(e,n){return n||(n=r=>r),this.compute([e],r=>n(r.field(e)))}}function mv(t,e){return t==e||t.length==e.length&&t.every((n,r)=>n===e[r])}class Ch{constructor(e,n,r,i){this.dependencies=e,this.facet=n,this.type=r,this.value=i,this.id=pv++}dynamicSlot(e){var n;let r=this.value,i=this.facet.compareInput,s=this.id,o=e[s]>>1,a=this.type==2,l=!1,u=!1,c=[];for(let f of this.dependencies)f=="doc"?l=!0:f=="selection"?u=!0:(((n=e[f.id])!==null&&n!==void 0?n:1)&1)==0&&c.push(e[f.id]);return{create(f){return f.values[o]=r(f),1},update(f,d){if(l&&d.docChanged||u&&(d.docChanged||d.selection)||ib(f,c)){let h=r(f);if(a?!qx(h,f.values[o],i):!i(h,f.values[o]))return f.values[o]=h,1}return 0},reconfigure:(f,d)=>{let h,p=d.config.address[s];if(p!=null){let m=gp(d,p);if(this.dependencies.every(g=>g instanceof he?d.facet(g)===f.facet(g):g instanceof Wt?d.field(g,!1)==f.field(g,!1):!0)||(a?qx(h=r(f),m,i):i(h=r(f),m)))return f.values[o]=m,0}else h=r(f);return f.values[o]=h,1}}}}function qx(t,e,n){if(t.length!=e.length)return!1;for(let r=0;rt[l.id]),i=n.map(l=>l.type),s=r.filter(l=>!(l&1)),o=t[e.id]>>1;function a(l){let u=[];for(let c=0;cr===i),e);return e.provide&&(n.provides=e.provide(n)),n}create(e){let n=e.facet(xd).find(r=>r.field==this);return((n==null?void 0:n.create)||this.createF)(e)}slot(e){let n=e[this.id]>>1;return{create:r=>(r.values[n]=this.create(r),1),update:(r,i)=>{let s=r.values[n],o=this.updateF(s,i);return this.compareF(s,o)?0:(r.values[n]=o,1)},reconfigure:(r,i)=>{let s=r.facet(xd),o=i.facet(xd),a;return(a=s.find(l=>l.field==this))&&a!=o.find(l=>l.field==this)?(r.values[n]=a.create(r),1):i.config.address[this.id]!=null?(r.values[n]=i.field(this),0):(r.values[n]=this.create(r),1)}}}init(e){return[this,xd.of({field:this,create:e})]}get extension(){return this}}const $o={lowest:4,low:3,default:2,high:1,highest:0};function Ou(t){return e=>new tD(e,t)}const Ao={highest:Ou($o.highest),high:Ou($o.high),default:Ou($o.default),low:Ou($o.low),lowest:Ou($o.lowest)};class tD{constructor(e,n){this.inner=e,this.prec=n}}class Pf{of(e){return new sb(this,e)}reconfigure(e){return Pf.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class sb{constructor(e,n){this.compartment=e,this.inner=n}}class mp{constructor(e,n,r,i,s,o){for(this.base=e,this.compartments=n,this.dynamicSlots=r,this.address=i,this.staticValues=s,this.facets=o,this.statusTemplate=[];this.statusTemplate.length>1]}static resolve(e,n,r){let i=[],s=Object.create(null),o=new Map;for(let d of qF(e,n,o))d instanceof Wt?i.push(d):(s[d.facet.id]||(s[d.facet.id]=[])).push(d);let a=Object.create(null),l=[],u=[];for(let d of i)a[d.id]=u.length<<1,u.push(h=>d.slot(h));let c=r==null?void 0:r.config.facets;for(let d in s){let h=s[d],p=h[0].facet,m=c&&c[d]||[];if(h.every(g=>g.type==0))if(a[p.id]=l.length<<1|1,mv(m,h))l.push(r.facet(p));else{let g=p.combine(h.map(b=>b.value));l.push(r&&p.compare(g,r.facet(p))?r.facet(p):g)}else{for(let g of h)g.type==0?(a[g.id]=l.length<<1|1,l.push(g.value)):(a[g.id]=u.length<<1,u.push(b=>g.dynamicSlot(b)));a[p.id]=u.length<<1,u.push(g=>HF(g,p,h))}}let f=u.map(d=>d(a));return new mp(e,o,f,a,l,s)}}function qF(t,e,n){let r=[[],[],[],[],[]],i=new Map;function s(o,a){let l=i.get(o);if(l!=null){if(l<=a)return;let u=r[l].indexOf(o);u>-1&&r[l].splice(u,1),o instanceof sb&&n.delete(o.compartment)}if(i.set(o,a),Array.isArray(o))for(let u of o)s(u,a);else if(o instanceof sb){if(n.has(o.compartment))throw new RangeError("Duplicate use of compartment in extensions");let u=e.get(o.compartment)||o.inner;n.set(o.compartment,u),s(u,a)}else if(o instanceof tD)s(o.inner,o.prec);else if(o instanceof Wt)r[a].push(o),o.provides&&s(o.provides,a);else if(o instanceof Ch)r[a].push(o),o.facet.extensions&&s(o.facet.extensions,$o.default);else{let u=o.extension;if(!u)throw new Error(`Unrecognized extension value in extension set (${o}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);s(u,a)}}return s(t,$o.default),r.reduce((o,a)=>o.concat(a))}function uc(t,e){if(e&1)return 2;let n=e>>1,r=t.status[n];if(r==4)throw new Error("Cyclic dependency between fields and/or facets");if(r&2)return r;t.status[n]=4;let i=t.computeSlot(t,t.config.dynamicSlots[n]);return t.status[n]=2|i}function gp(t,e){return e&1?t.config.staticValues[e>>1]:t.values[e>>1]}const nD=he.define(),ob=he.define({combine:t=>t.some(e=>e),static:!0}),rD=he.define({combine:t=>t.length?t[0]:void 0,static:!0}),iD=he.define(),sD=he.define(),oD=he.define(),aD=he.define({combine:t=>t.length?t[0]:!1});class As{constructor(e,n){this.type=e,this.value=n}static define(){return new GF}}class GF{of(e){return new As(this,e)}}class WF{constructor(e){this.map=e}of(e){return new De(this,e)}}class De{constructor(e,n){this.type=e,this.value=n}map(e){let n=this.type.map(this.value,e);return n===void 0?void 0:n==this.value?this:new De(this.type,n)}is(e){return this.type==e}static define(e={}){return new WF(e.map||(n=>n))}static mapEffects(e,n){if(!e.length)return e;let r=[];for(let i of e){let s=i.map(n);s&&r.push(s)}return r}}De.reconfigure=De.define();De.appendConfig=De.define();class Qt{constructor(e,n,r,i,s,o){this.startState=e,this.changes=n,this.selection=r,this.effects=i,this.annotations=s,this.scrollIntoView=o,this._doc=null,this._state=null,r&&eD(r,n.newLength),s.some(a=>a.type==Qt.time)||(this.annotations=s.concat(Qt.time.of(Date.now())))}static create(e,n,r,i,s,o){return new Qt(e,n,r,i,s,o)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(e){for(let n of this.annotations)if(n.type==e)return n.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(e){let n=this.annotation(Qt.userEvent);return!!(n&&(n==e||n.length>e.length&&n.slice(0,e.length)==e&&n[e.length]=="."))}}Qt.time=As.define();Qt.userEvent=As.define();Qt.addToHistory=As.define();Qt.remote=As.define();function KF(t,e){let n=[];for(let r=0,i=0;;){let s,o;if(r=t[r]))s=t[r++],o=t[r++];else if(i=0;i--){let s=r[i](t);s instanceof Qt?t=s:Array.isArray(s)&&s.length==1&&s[0]instanceof Qt?t=s[0]:t=uD(e,ul(s),!1)}return t}function YF(t){let e=t.startState,n=e.facet(oD),r=t;for(let i=n.length-1;i>=0;i--){let s=n[i](t);s&&Object.keys(s).length&&(r=lD(r,ab(e,s,t.changes.newLength),!0))}return r==t?t:Qt.create(e,t.changes,t.selection,r.effects,r.annotations,r.scrollIntoView)}const JF=[];function ul(t){return t==null?JF:Array.isArray(t)?t:[t]}var kt=(function(t){return t[t.Word=0]="Word",t[t.Space=1]="Space",t[t.Other=2]="Other",t})(kt||(kt={}));const ZF=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let lb;try{lb=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function QF(t){if(lb)return lb.test(t);for(let e=0;e"€"&&(n.toUpperCase()!=n.toLowerCase()||ZF.test(n)))return!0}return!1}function e9(t){return e=>{if(!/\S/.test(e))return kt.Space;if(QF(e))return kt.Word;for(let n=0;n-1)return kt.Word;return kt.Other}}class Ue{constructor(e,n,r,i,s,o){this.config=e,this.doc=n,this.selection=r,this.values=i,this.status=e.statusTemplate.slice(),this.computeSlot=s,o&&(o._state=this);for(let a=0;ai.set(u,l)),n=null),i.set(a.value.compartment,a.value.extension)):a.is(De.reconfigure)?(n=null,r=a.value):a.is(De.appendConfig)&&(n=null,r=ul(r).concat(a.value));let s;n?s=e.startState.values.slice():(n=mp.resolve(r,i,this),s=new Ue(n,this.doc,this.selection,n.dynamicSlots.map(()=>null),(l,u)=>u.reconfigure(l,this),null).values);let o=e.startState.facet(ob)?e.newSelection:e.newSelection.asSingle();new Ue(n,e.newDoc,o,s,(a,l)=>l.update(a,e),e)}replaceSelection(e){return typeof e=="string"&&(e=this.toText(e)),this.changeByRange(n=>({changes:{from:n.from,to:n.to,insert:e},range:Y.cursor(n.from+e.length)}))}changeByRange(e){let n=this.selection,r=e(n.ranges[0]),i=this.changes(r.changes),s=[r.range],o=ul(r.effects);for(let a=1;ao.spec.fromJSON(a,l)))}}return Ue.create({doc:e.doc,selection:Y.fromJSON(e.selection),extensions:n.extensions?i.concat([n.extensions]):i})}static create(e={}){let n=mp.resolve(e.extensions||[],new Map),r=e.doc instanceof Ze?e.doc:Ze.of((e.doc||"").split(n.staticFacet(Ue.lineSeparator)||tb)),i=e.selection?e.selection instanceof Y?e.selection:Y.single(e.selection.anchor,e.selection.head):Y.single(0);return eD(i,r.length),n.staticFacet(ob)||(i=i.asSingle()),new Ue(n,r,i,n.dynamicSlots.map(()=>null),(s,o)=>o.create(s),null)}get tabSize(){return this.facet(Ue.tabSize)}get lineBreak(){return this.facet(Ue.lineSeparator)||` +`}get readOnly(){return this.facet(aD)}phrase(e,...n){for(let r of this.facet(Ue.phrases))if(Object.prototype.hasOwnProperty.call(r,e)){e=r[e];break}return n.length&&(e=e.replace(/\$(\$|\d*)/g,(r,i)=>{if(i=="$")return"$";let s=+(i||1);return!s||s>n.length?r:n[s-1]})),e}languageDataAt(e,n,r=-1){let i=[];for(let s of this.facet(nD))for(let o of s(this,n,r))Object.prototype.hasOwnProperty.call(o,e)&&i.push(o[e]);return i}charCategorizer(e){return e9(this.languageDataAt("wordChars",e).join(""))}wordAt(e){let{text:n,from:r,length:i}=this.doc.lineAt(e),s=this.charCategorizer(e),o=e-r,a=e-r;for(;o>0;){let l=wn(n,o,!1);if(s(n.slice(l,o))!=kt.Word)break;o=l}for(;at.length?t[0]:4});Ue.lineSeparator=rD;Ue.readOnly=aD;Ue.phrases=he.define({compare(t,e){let n=Object.keys(t),r=Object.keys(e);return n.length==r.length&&n.every(i=>t[i]==e[i])}});Ue.languageData=nD;Ue.changeFilter=iD;Ue.transactionFilter=sD;Ue.transactionExtender=oD;Pf.reconfigure=De.define();function fi(t,e,n={}){let r={};for(let i of t)for(let s of Object.keys(i)){let o=i[s],a=r[s];if(a===void 0)r[s]=o;else if(!(a===o||o===void 0))if(Object.hasOwnProperty.call(n,s))r[s]=n[s](a,o);else throw new Error("Config merge conflict for field "+s)}for(let i in e)r[i]===void 0&&(r[i]=e[i]);return r}class ca{eq(e){return this==e}range(e,n=e){return ub.create(e,n,this)}}ca.prototype.startSide=ca.prototype.endSide=0;ca.prototype.point=!1;ca.prototype.mapMode=En.TrackDel;let ub=class cD{constructor(e,n,r){this.from=e,this.to=n,this.value=r}static create(e,n,r){return new cD(e,n,r)}};function cb(t,e){return t.from-e.from||t.value.startSide-e.value.startSide}class gv{constructor(e,n,r,i){this.from=e,this.to=n,this.value=r,this.maxPoint=i}get length(){return this.to[this.to.length-1]}findIndex(e,n,r,i=0){let s=r?this.to:this.from;for(let o=i,a=s.length;;){if(o==a)return o;let l=o+a>>1,u=s[l]-e||(r?this.value[l].endSide:this.value[l].startSide)-n;if(l==o)return u>=0?o:a;u>=0?a=l:o=l+1}}between(e,n,r,i){for(let s=this.findIndex(n,-1e9,!0),o=this.findIndex(r,1e9,!1,s);sh||d==h&&u.startSide>0&&u.endSide<=0)continue;(h-d||u.endSide-u.startSide)<0||(o<0&&(o=d),u.point&&(a=Math.max(a,h-d)),r.push(u),i.push(d-o),s.push(h-o))}return{mapped:r.length?new gv(i,s,r,a):null,pos:o}}}class Xe{constructor(e,n,r,i){this.chunkPos=e,this.chunk=n,this.nextLayer=r,this.maxPoint=i}static create(e,n,r,i){return new Xe(e,n,r,i)}get length(){let e=this.chunk.length-1;return e<0?0:Math.max(this.chunkEnd(e),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let e=this.nextLayer.size;for(let n of this.chunk)e+=n.value.length;return e}chunkEnd(e){return this.chunkPos[e]+this.chunk[e].length}update(e){let{add:n=[],sort:r=!1,filterFrom:i=0,filterTo:s=this.length}=e,o=e.filter;if(n.length==0&&!o)return this;if(r&&(n=n.slice().sort(cb)),this.isEmpty)return n.length?Xe.of(n):this;let a=new fD(this,null,-1).goto(0),l=0,u=[],c=new _s;for(;a.value||l=0){let f=n[l++];c.addInner(f.from,f.to,f.value)||u.push(f)}else a.rangeIndex==1&&a.chunkIndexthis.chunkEnd(a.chunkIndex)||sa.to||s=s&&e<=s+o.length&&o.between(s,e-s,n-s,r)===!1)return}this.nextLayer.between(e,n,r)}}iter(e=0){return Mc.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,n=0){return Mc.from(e).goto(n)}static compare(e,n,r,i,s=-1){let o=e.filter(f=>f.maxPoint>0||!f.isEmpty&&f.maxPoint>=s),a=n.filter(f=>f.maxPoint>0||!f.isEmpty&&f.maxPoint>=s),l=Gx(o,a,r),u=new Tu(o,l,s),c=new Tu(a,l,s);r.iterGaps((f,d,h)=>Wx(u,f,c,d,h,i)),r.empty&&r.length==0&&Wx(u,0,c,0,0,i)}static eq(e,n,r=0,i){i==null&&(i=999999999);let s=e.filter(c=>!c.isEmpty&&n.indexOf(c)<0),o=n.filter(c=>!c.isEmpty&&e.indexOf(c)<0);if(s.length!=o.length)return!1;if(!s.length)return!0;let a=Gx(s,o),l=new Tu(s,a,0).goto(r),u=new Tu(o,a,0).goto(r);for(;;){if(l.to!=u.to||!fb(l.active,u.active)||l.point&&(!u.point||!l.point.eq(u.point)))return!1;if(l.to>i)return!0;l.next(),u.next()}}static spans(e,n,r,i,s=-1){let o=new Tu(e,null,s).goto(n),a=n,l=o.openStart;for(;;){let u=Math.min(o.to,r);if(o.point){let c=o.activeForPoint(o.to),f=o.pointFroma&&(i.span(a,u,o.active,l),l=o.openEnd(u));if(o.to>r)return l+(o.point&&o.to>r?1:0);a=o.to,o.next()}}static of(e,n=!1){let r=new _s;for(let i of e instanceof ub?[e]:n?t9(e):e)r.add(i.from,i.to,i.value);return r.finish()}static join(e){if(!e.length)return Xe.empty;let n=e[e.length-1];for(let r=e.length-2;r>=0;r--)for(let i=e[r];i!=Xe.empty;i=i.nextLayer)n=new Xe(i.chunkPos,i.chunk,n,Math.max(i.maxPoint,n.maxPoint));return n}}Xe.empty=new Xe([],[],null,-1);function t9(t){if(t.length>1)for(let e=t[0],n=1;n0)return t.slice().sort(cb);e=r}return t}Xe.empty.nextLayer=Xe.empty;class _s{finishChunk(e){this.chunks.push(new gv(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,e&&(this.from=[],this.to=[],this.value=[])}constructor(){this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-1e9,this.lastTo=-1e9,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null}add(e,n,r){this.addInner(e,n,r)||(this.nextLayer||(this.nextLayer=new _s)).add(e,n,r)}addInner(e,n,r){let i=e-this.lastTo||r.startSide-this.last.endSide;if(i<=0&&(e-this.lastFrom||r.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return i<0?!1:(this.from.length==250&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=e),this.from.push(e-this.chunkStart),this.to.push(n-this.chunkStart),this.last=r,this.lastFrom=e,this.lastTo=n,this.value.push(r),r.point&&(this.maxPoint=Math.max(this.maxPoint,n-e)),!0)}addChunk(e,n){if((e-this.lastTo||n.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,n.maxPoint),this.chunks.push(n),this.chunkPos.push(e);let r=n.value.length-1;return this.last=n.value[r],this.lastFrom=n.from[r]+e,this.lastTo=n.to[r]+e,!0}finish(){return this.finishInner(Xe.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return e;let n=Xe.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,n}}function Gx(t,e,n){let r=new Map;for(let s of t)for(let o=0;o=this.minPoint)break}}setRangeIndex(e){if(e==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex=r&&i.push(new fD(o,n,r,s));return i.length==1?i[0]:new Mc(i)}get startSide(){return this.value?this.value.startSide:0}goto(e,n=-1e9){for(let r of this.heap)r.goto(e,n);for(let r=this.heap.length>>1;r>=0;r--)dg(this.heap,r);return this.next(),this}forward(e,n){for(let r of this.heap)r.forward(e,n);for(let r=this.heap.length>>1;r>=0;r--)dg(this.heap,r);(this.to-e||this.value.endSide-n)<0&&this.next()}next(){if(this.heap.length==0)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let e=this.heap[0];this.from=e.from,this.to=e.to,this.value=e.value,this.rank=e.rank,e.value&&e.next(),dg(this.heap,0)}}}function dg(t,e){for(let n=t[e];;){let r=(e<<1)+1;if(r>=t.length)break;let i=t[r];if(r+1=0&&(i=t[r+1],r++),n.compare(i)<0)break;t[r]=n,t[e]=i,e=r}}class Tu{constructor(e,n,r){this.minPoint=r,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-1e9,this.endSide=0,this.openStart=-1,this.cursor=Mc.from(e,n,r)}goto(e,n=-1e9){return this.cursor.goto(e,n),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=e,this.endSide=n,this.openStart=-1,this.next(),this}forward(e,n){for(;this.minActive>-1&&(this.activeTo[this.minActive]-e||this.active[this.minActive].endSide-n)<0;)this.removeActive(this.minActive);this.cursor.forward(e,n)}removeActive(e){Sd(this.active,e),Sd(this.activeTo,e),Sd(this.activeRank,e),this.minActive=Kx(this.active,this.activeTo)}addActive(e){let n=0,{value:r,to:i,rank:s}=this.cursor;for(;n0;)n++;Ed(this.active,n,r),Ed(this.activeTo,n,i),Ed(this.activeRank,n,s),e&&Ed(e,n,this.cursor.from),this.minActive=Kx(this.active,this.activeTo)}next(){let e=this.to,n=this.point;this.point=null;let r=this.openStart<0?[]:null;for(;;){let i=this.minActive;if(i>-1&&(this.activeTo[i]-this.cursor.from||this.active[i].endSide-this.cursor.startSide)<0){if(this.activeTo[i]>e){this.to=this.activeTo[i],this.endSide=this.active[i].endSide;break}this.removeActive(i),r&&Sd(r,i)}else if(this.cursor.value)if(this.cursor.from>e){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}else{let s=this.cursor.value;if(!s.point)this.addActive(r),this.cursor.next();else if(n&&this.cursor.to==this.to&&this.cursor.from=0&&r[i]=0&&!(this.activeRank[r]e||this.activeTo[r]==e&&this.active[r].endSide>=this.point.endSide)&&n.push(this.active[r]);return n.reverse()}openEnd(e){let n=0;for(let r=this.activeTo.length-1;r>=0&&this.activeTo[r]>e;r--)n++;return n}}function Wx(t,e,n,r,i,s){t.goto(e),n.goto(r);let o=r+i,a=r,l=r-e;for(;;){let u=t.to+l-n.to,c=u||t.endSide-n.endSide,f=c<0?t.to+l:n.to,d=Math.min(f,o);if(t.point||n.point?t.point&&n.point&&(t.point==n.point||t.point.eq(n.point))&&fb(t.activeForPoint(t.to),n.activeForPoint(n.to))||s.comparePoint(a,d,t.point,n.point):d>a&&!fb(t.active,n.active)&&s.compareRange(a,d,t.active,n.active),f>o)break;(u||t.openEnd!=n.openEnd)&&s.boundChange&&s.boundChange(f),a=f,c<=0&&t.next(),c>=0&&n.next()}}function fb(t,e){if(t.length!=e.length)return!1;for(let n=0;n=e;r--)t[r+1]=t[r];t[e]=n}function Kx(t,e){let n=-1,r=1e9;for(let i=0;i=e)return i;if(i==t.length)break;s+=t.charCodeAt(i)==9?n-s%n:1,i=wn(t,i)}return r===!0?-1:t.length}const hb="ͼ",Xx=typeof Symbol>"u"?"__"+hb:Symbol.for(hb),pb=typeof Symbol>"u"?"__styleSet"+Math.floor(Math.random()*1e8):Symbol("styleSet"),Yx=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};class po{constructor(e,n){this.rules=[];let{finish:r}=n||{};function i(o){return/^@/.test(o)?[o]:o.split(/,\s*/)}function s(o,a,l,u){let c=[],f=/^@(\w+)\b/.exec(o[0]),d=f&&f[1]=="keyframes";if(f&&a==null)return l.push(o[0]+";");for(let h in a){let p=a[h];if(/&/.test(h))s(h.split(/,\s*/).map(m=>o.map(g=>m.replace(/&/,g))).reduce((m,g)=>m.concat(g)),p,l);else if(p&&typeof p=="object"){if(!f)throw new RangeError("The value of a property ("+h+") should be a primitive value.");s(i(h),p,c,d)}else p!=null&&c.push(h.replace(/_.*/,"").replace(/[A-Z]/g,m=>"-"+m.toLowerCase())+": "+p+";")}(c.length||d)&&l.push((r&&!f&&!u?o.map(r):o).join(", ")+" {"+c.join(" ")+"}")}for(let o in e)s(i(o),e[o],this.rules)}getRules(){return this.rules.join(` +`)}static newName(){let e=Yx[Xx]||1;return Yx[Xx]=e+1,hb+e.toString(36)}static mount(e,n,r){let i=e[pb],s=r&&r.nonce;i?s&&i.setNonce(s):i=new n9(e,s),i.mount(Array.isArray(n)?n:[n],e)}}let Jx=new Map;class n9{constructor(e,n){let r=e.ownerDocument||e,i=r.defaultView;if(!e.head&&e.adoptedStyleSheets&&i.CSSStyleSheet){let s=Jx.get(r);if(s)return e[pb]=s;this.sheet=new i.CSSStyleSheet,Jx.set(r,this)}else this.styleTag=r.createElement("style"),n&&this.styleTag.setAttribute("nonce",n);this.modules=[],e[pb]=this}mount(e,n){let r=this.sheet,i=0,s=0;for(let o=0;o-1&&(this.modules.splice(l,1),s--,l=-1),l==-1){if(this.modules.splice(s++,0,a),r)for(let u=0;u",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},r9=typeof navigator<"u"&&/Mac/.test(navigator.platform),i9=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var Sn=0;Sn<10;Sn++)mo[48+Sn]=mo[96+Sn]=String(Sn);for(var Sn=1;Sn<=24;Sn++)mo[Sn+111]="F"+Sn;for(var Sn=65;Sn<=90;Sn++)mo[Sn]=String.fromCharCode(Sn+32),Fc[Sn]=String.fromCharCode(Sn);for(var hg in mo)Fc.hasOwnProperty(hg)||(Fc[hg]=mo[hg]);function s9(t){var e=r9&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||i9&&t.shiftKey&&t.key&&t.key.length==1||t.key=="Unidentified",n=!e&&t.key||(t.shiftKey?Fc:mo)[t.keyCode]||t.key||"Unidentified";return n=="Esc"&&(n="Escape"),n=="Del"&&(n="Delete"),n=="Left"&&(n="ArrowLeft"),n=="Up"&&(n="ArrowUp"),n=="Right"&&(n="ArrowRight"),n=="Down"&&(n="ArrowDown"),n}function ct(){var t=arguments[0];typeof t=="string"&&(t=document.createElement(t));var e=1,n=arguments[1];if(n&&typeof n=="object"&&n.nodeType==null&&!Array.isArray(n)){for(var r in n)if(Object.prototype.hasOwnProperty.call(n,r)){var i=n[r];typeof i=="string"?t.setAttribute(r,i):i!=null&&(t[r]=i)}e++}for(;e2);var ue={mac:Qx||/Mac/.test($n.platform),windows:/Win/.test($n.platform),linux:/Linux|X11/.test($n.platform),ie:W0,ie_version:hD?mb.documentMode||6:bb?+bb[1]:gb?+gb[1]:0,gecko:Zx,gecko_version:Zx?+(/Firefox\/(\d+)/.exec($n.userAgent)||[0,0])[1]:0,chrome:!!pg,chrome_version:pg?+pg[1]:0,ios:Qx,android:/Android\b/.test($n.userAgent),webkit_version:o9?+(/\bAppleWebKit\/(\d+)/.exec($n.userAgent)||[0,0])[1]:0,safari:yb,safari_version:yb?+(/\bVersion\/(\d+(\.\d+)?)/.exec($n.userAgent)||[0,0])[1]:0,tabSize:mb.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};function Lc(t){let e;return t.nodeType==11?e=t.getSelection?t:t.ownerDocument:e=t,e.getSelection()}function vb(t,e){return e?t==e||t.contains(e.nodeType!=1?e.parentNode:e):!1}function Ah(t,e){if(!e.anchorNode)return!1;try{return vb(t,e.anchorNode)}catch{return!1}}function kl(t){return t.nodeType==3?da(t,0,t.nodeValue.length).getClientRects():t.nodeType==1?t.getClientRects():[]}function cc(t,e,n,r){return n?eS(t,e,n,r,-1)||eS(t,e,n,r,1):!1}function fa(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e}function bp(t){return t.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(t.nodeName)}function eS(t,e,n,r,i){for(;;){if(t==n&&e==r)return!0;if(e==(i<0?0:Vi(t))){if(t.nodeName=="DIV")return!1;let s=t.parentNode;if(!s||s.nodeType!=1)return!1;e=fa(t)+(i<0?0:1),t=s}else if(t.nodeType==1){if(t=t.childNodes[e+(i<0?-1:0)],t.nodeType==1&&t.contentEditable=="false")return!1;e=i<0?Vi(t):0}else return!1}}function Vi(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function Rf(t,e){let n=e?t.left:t.right;return{left:n,right:n,top:t.top,bottom:t.bottom}}function a9(t){let e=t.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:t.innerWidth,top:0,bottom:t.innerHeight}}function pD(t,e){let n=e.width/t.offsetWidth,r=e.height/t.offsetHeight;return(n>.995&&n<1.005||!isFinite(n)||Math.abs(e.width-t.offsetWidth)<1)&&(n=1),(r>.995&&r<1.005||!isFinite(r)||Math.abs(e.height-t.offsetHeight)<1)&&(r=1),{scaleX:n,scaleY:r}}function l9(t,e,n,r,i,s,o,a){let l=t.ownerDocument,u=l.defaultView||window;for(let c=t,f=!1;c&&!f;)if(c.nodeType==1){let d,h=c==l.body,p=1,m=1;if(h)d=a9(u);else{if(/^(fixed|sticky)$/.test(getComputedStyle(c).position)&&(f=!0),c.scrollHeight<=c.clientHeight&&c.scrollWidth<=c.clientWidth){c=c.assignedSlot||c.parentNode;continue}let y=c.getBoundingClientRect();({scaleX:p,scaleY:m}=pD(c,y)),d={left:y.left,right:y.left+c.clientWidth*p,top:y.top,bottom:y.top+c.clientHeight*m}}let g=0,b=0;if(i=="nearest")e.top0&&e.bottom>d.bottom+b&&(b=e.bottom-d.bottom+o)):e.bottom>d.bottom&&(b=e.bottom-d.bottom+o,n<0&&e.top-b0&&e.right>d.right+g&&(g=e.right-d.right+s)):e.right>d.right&&(g=e.right-d.right+s,n<0&&e.leftd.bottom||e.leftd.right)&&(e={left:Math.max(e.left,d.left),right:Math.min(e.right,d.right),top:Math.max(e.top,d.top),bottom:Math.min(e.bottom,d.bottom)}),c=c.assignedSlot||c.parentNode}else if(c.nodeType==11)c=c.host;else break}function u9(t){let e=t.ownerDocument,n,r;for(let i=t.parentNode;i&&!(i==e.body||n&&r);)if(i.nodeType==1)!r&&i.scrollHeight>i.clientHeight&&(r=i),!n&&i.scrollWidth>i.clientWidth&&(n=i),i=i.assignedSlot||i.parentNode;else if(i.nodeType==11)i=i.host;else break;return{x:n,y:r}}class c9{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}eq(e){return this.anchorNode==e.anchorNode&&this.anchorOffset==e.anchorOffset&&this.focusNode==e.focusNode&&this.focusOffset==e.focusOffset}setRange(e){let{anchorNode:n,focusNode:r}=e;this.set(n,Math.min(e.anchorOffset,n?Vi(n):0),r,Math.min(e.focusOffset,r?Vi(r):0))}set(e,n,r,i){this.anchorNode=e,this.anchorOffset=n,this.focusNode=r,this.focusOffset=i}}let Mo=null;ue.safari&&ue.safari_version>=26&&(Mo=!1);function mD(t){if(t.setActive)return t.setActive();if(Mo)return t.focus(Mo);let e=[];for(let n=t;n&&(e.push(n,n.scrollTop,n.scrollLeft),n!=n.ownerDocument);n=n.parentNode);if(t.focus(Mo==null?{get preventScroll(){return Mo={preventScroll:!0},!0}}:void 0),!Mo){Mo=!1;for(let n=0;nMath.max(1,t.scrollHeight-t.clientHeight-4)}function yD(t,e){for(let n=t,r=e;;){if(n.nodeType==3&&r>0)return{node:n,offset:r};if(n.nodeType==1&&r>0){if(n.contentEditable=="false")return null;n=n.childNodes[r-1],r=Vi(n)}else if(n.parentNode&&!bp(n))r=fa(n),n=n.parentNode;else return null}}function vD(t,e){for(let n=t,r=e;;){if(n.nodeType==3&&rn)return f.domBoundsAround(e,n,u);if(d>=e&&i==-1&&(i=l,s=u),u>n&&f.dom.parentNode==this.dom){o=l,a=c;break}c=d,u=d+f.breakAfter}return{from:s,to:a<0?r+this.length:a,startDOM:(i?this.children[i-1].dom.nextSibling:null)||this.dom.firstChild,endDOM:o=0?this.children[o].dom:null}}markDirty(e=!1){this.flags|=2,this.markParentsDirty(e)}markParentsDirty(e){for(let n=this.parent;n;n=n.parent){if(e&&(n.flags|=2),n.flags&1)return;n.flags|=1,e=!1}}setParent(e){this.parent!=e&&(this.parent=e,this.flags&7&&this.markParentsDirty(!0))}setDOM(e){this.dom!=e&&(this.dom&&(this.dom.cmView=null),this.dom=e,e.cmView=this)}get rootView(){for(let e=this;;){let n=e.parent;if(!n)return e;e=n}}replaceChildren(e,n,r=bv){this.markDirty();for(let i=e;ithis.pos||e==this.pos&&(n>0||this.i==0||this.children[this.i-1].breakAfter))return this.off=e-this.pos,this;let r=this.children[--this.i];this.pos-=r.length+r.breakAfter}}}function SD(t,e,n,r,i,s,o,a,l){let{children:u}=t,c=u.length?u[e]:null,f=s.length?s[s.length-1]:null,d=f?f.breakAfter:o;if(!(e==r&&c&&!o&&!d&&s.length<2&&c.merge(n,i,s.length?f:null,n==0,a,l))){if(r0&&(!o&&s.length&&c.merge(n,c.length,s[0],!1,a,0)?c.breakAfter=s.shift().breakAfter:(nh9||r.flags&8)?!1:(this.text=this.text.slice(0,e)+(r?r.text:"")+this.text.slice(n),this.markDirty(),!0)}split(e){let n=new ui(this.text.slice(e));return this.text=this.text.slice(0,e),this.markDirty(),n.flags|=this.flags&8,n}localPosFromDOM(e,n){return e==this.dom?n:n?this.text.length:0}domAtPos(e){return new Tn(this.dom,e)}domBoundsAround(e,n,r){return{from:r,to:r+this.length,startDOM:this.dom,endDOM:this.dom.nextSibling}}coordsAt(e,n){return p9(this.dom,e,n)}}class Cs extends ut{constructor(e,n=[],r=0){super(),this.mark=e,this.children=n,this.length=r;for(let i of n)i.setParent(this)}setAttrs(e){if(gD(e),this.mark.class&&(e.className=this.mark.class),this.mark.attrs)for(let n in this.mark.attrs)e.setAttribute(n,this.mark.attrs[n]);return e}canReuseDOM(e){return super.canReuseDOM(e)&&!((this.flags|e.flags)&8)}reuseDOM(e){e.nodeName==this.mark.tagName.toUpperCase()&&(this.setDOM(e),this.flags|=6)}sync(e,n){this.dom?this.flags&4&&this.setAttrs(this.dom):this.setDOM(this.setAttrs(document.createElement(this.mark.tagName))),super.sync(e,n)}merge(e,n,r,i,s,o){return r&&(!(r instanceof Cs&&r.mark.eq(this.mark))||e&&s<=0||ne&&n.push(r=e&&(i=s),r=l,s++}let o=this.length-e;return this.length=e,i>-1&&(this.children.length=i,this.markDirty()),new Cs(this.mark,n,o)}domAtPos(e){return wD(this,e)}coordsAt(e,n){return CD(this,e,n)}}function p9(t,e,n){let r=t.nodeValue.length;e>r&&(e=r);let i=e,s=e,o=0;e==0&&n<0||e==r&&n>=0?ue.chrome||ue.gecko||(e?(i--,o=1):s=0)?0:a.length-1];return ue.safari&&!o&&l.width==0&&(l=Array.prototype.find.call(a,u=>u.width)||l),o?Rf(l,o<0):l||null}class Ws extends ut{static create(e,n,r){return new Ws(e,n,r)}constructor(e,n,r){super(),this.widget=e,this.length=n,this.side=r,this.prevWidget=null}split(e){let n=Ws.create(this.widget,this.length-e,this.side);return this.length-=e,n}sync(e){(!this.dom||!this.widget.updateDOM(this.dom,e))&&(this.dom&&this.prevWidget&&this.prevWidget.destroy(this.dom),this.prevWidget=null,this.setDOM(this.widget.toDOM(e)),this.widget.editable||(this.dom.contentEditable="false"))}getSide(){return this.side}merge(e,n,r,i,s,o){return r&&(!(r instanceof Ws)||!this.widget.compare(r.widget)||e>0&&s<=0||n0)?Tn.before(this.dom):Tn.after(this.dom,e==this.length)}domBoundsAround(){return null}coordsAt(e,n){let r=this.widget.coordsAt(this.dom,e,n);if(r)return r;let i=this.dom.getClientRects(),s=null;if(!i.length)return null;let o=this.side?this.side<0:e>0;for(let a=o?i.length-1:0;s=i[a],!(e>0?a==0:a==i.length-1||s.top0?Tn.before(this.dom):Tn.after(this.dom)}localPosFromDOM(){return 0}domBoundsAround(){return null}coordsAt(e){return this.dom.getBoundingClientRect()}get overrideDOMText(){return Ze.empty}get isHidden(){return!0}}ui.prototype.children=Ws.prototype.children=Ol.prototype.children=bv;function wD(t,e){let n=t.dom,{children:r}=t,i=0;for(let s=0;is&&e0;s--){let o=r[s-1];if(o.dom.parentNode==n)return o.domAtPos(o.length)}for(let s=i;s0&&e instanceof Cs&&i.length&&(r=i[i.length-1])instanceof Cs&&r.mark.eq(e.mark)?_D(r,e.children[0],n-1):(i.push(e),e.setParent(t)),t.length+=e.length}function CD(t,e,n){let r=null,i=-1,s=null,o=-1;function a(u,c){for(let f=0,d=0;f=c&&(h.children.length?a(h,c-d):(!s||s.isHidden&&(n>0||g9(s,h)))&&(p>c||d==p&&h.getSide()>0)?(s=h,o=c-d):(d-1?1:0)!=i.length-(n&&i.indexOf(n)>-1?1:0))return!1;for(let s of r)if(s!=n&&(i.indexOf(s)==-1||t[s]!==e[s]))return!1;return!0}function Sb(t,e,n){let r=!1;if(e)for(let i in e)n&&i in n||(r=!0,i=="style"?t.style.cssText="":t.removeAttribute(i));if(n)for(let i in n)e&&e[i]==n[i]||(r=!0,i=="style"?t.style.cssText=n[i]:t.setAttribute(i,n[i]));return r}function b9(t){let e=Object.create(null);for(let n=0;n0?3e8:-4e8:n>0?1e8:-1e8,new go(e,n,n,r,e.widget||null,!1)}static replace(e){let n=!!e.block,r,i;if(e.isBlockGap)r=-5e8,i=4e8;else{let{start:s,end:o}=AD(e,n);r=(s?n?-3e8:-1:5e8)-1,i=(o?n?2e8:1:-6e8)+1}return new go(e,r,i,n,e.widget||null,!0)}static line(e){return new Mf(e)}static set(e,n=!1){return Xe.of(e,n)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}}ve.none=Xe.empty;class Nf extends ve{constructor(e){let{start:n,end:r}=AD(e);super(n?-1:5e8,r?1:-6e8,null,e),this.tagName=e.tagName||"span",this.class=e.class||"",this.attrs=e.attributes||null}eq(e){var n,r;return this==e||e instanceof Nf&&this.tagName==e.tagName&&(this.class||((n=this.attrs)===null||n===void 0?void 0:n.class))==(e.class||((r=e.attrs)===null||r===void 0?void 0:r.class))&&yp(this.attrs,e.attrs,"class")}range(e,n=e){if(e>=n)throw new RangeError("Mark decorations may not be empty");return super.range(e,n)}}Nf.prototype.point=!1;class Mf extends ve{constructor(e){super(-2e8,-2e8,null,e)}eq(e){return e instanceof Mf&&this.spec.class==e.spec.class&&yp(this.spec.attributes,e.spec.attributes)}range(e,n=e){if(n!=e)throw new RangeError("Line decoration ranges must be zero-length");return super.range(e,n)}}Mf.prototype.mapMode=En.TrackBefore;Mf.prototype.point=!0;class go extends ve{constructor(e,n,r,i,s,o){super(n,r,s,e),this.block=i,this.isReplace=o,this.mapMode=i?n<=0?En.TrackBefore:En.TrackAfter:En.TrackDel}get type(){return this.startSide!=this.endSide?Kn.WidgetRange:this.startSide<=0?Kn.WidgetBefore:Kn.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(e){return e instanceof go&&y9(this.widget,e.widget)&&this.block==e.block&&this.startSide==e.startSide&&this.endSide==e.endSide}range(e,n=e){if(this.isReplace&&(e>n||e==n&&this.startSide>0&&this.endSide<=0))throw new RangeError("Invalid range for replacement decoration");if(!this.isReplace&&n!=e)throw new RangeError("Widget decorations can only have zero-length ranges");return super.range(e,n)}}go.prototype.point=!0;function AD(t,e=!1){let{inclusiveStart:n,inclusiveEnd:r}=t;return n==null&&(n=t.inclusive),r==null&&(r=t.inclusive),{start:n??e,end:r??e}}function y9(t,e){return t==e||!!(t&&e&&t.compare(e))}function Dh(t,e,n,r=0){let i=n.length-1;i>=0&&n[i]+r>=t?n[i]=Math.max(n[i],e):n.push(t,e)}class Jt extends ut{constructor(){super(...arguments),this.children=[],this.length=0,this.prevAttrs=void 0,this.attrs=null,this.breakAfter=0}merge(e,n,r,i,s,o){if(r){if(!(r instanceof Jt))return!1;this.dom||r.transferDOM(this)}return i&&this.setDeco(r?r.attrs:null),ED(this,e,n,r?r.children.slice():[],s,o),!0}split(e){let n=new Jt;if(n.breakAfter=this.breakAfter,this.length==0)return n;let{i:r,off:i}=this.childPos(e);i&&(n.append(this.children[r].split(i),0),this.children[r].merge(i,this.children[r].length,null,!1,0,0),r++);for(let s=r;s0&&this.children[r-1].length==0;)this.children[--r].destroy();return this.children.length=r,this.markDirty(),this.length=e,n}transferDOM(e){this.dom&&(this.markDirty(),e.setDOM(this.dom),e.prevAttrs=this.prevAttrs===void 0?this.attrs:this.prevAttrs,this.prevAttrs=void 0,this.dom=null)}setDeco(e){yp(this.attrs,e)||(this.dom&&(this.prevAttrs=this.attrs,this.markDirty()),this.attrs=e)}append(e,n){_D(this,e,n)}addLineDeco(e){let n=e.spec.attributes,r=e.spec.class;n&&(this.attrs=xb(n,this.attrs||{})),r&&(this.attrs=xb({class:r},this.attrs||{}))}domAtPos(e){return wD(this,e)}reuseDOM(e){e.nodeName=="DIV"&&(this.setDOM(e),this.flags|=6)}sync(e,n){var r;this.dom?this.flags&4&&(gD(this.dom),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0):(this.setDOM(document.createElement("div")),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0),this.prevAttrs!==void 0&&(Sb(this.dom,this.prevAttrs,this.attrs),this.dom.classList.add("cm-line"),this.prevAttrs=void 0),super.sync(e,n);let i=this.dom.lastChild;for(;i&&ut.get(i)instanceof Cs;)i=i.lastChild;if(!i||!this.length||i.nodeName!="BR"&&((r=ut.get(i))===null||r===void 0?void 0:r.isEditable)==!1&&(!ue.ios||!this.children.some(s=>s instanceof ui))){let s=document.createElement("BR");s.cmIgnore=!0,this.dom.appendChild(s)}}measureTextSize(){if(this.children.length==0||this.length>20)return null;let e=0,n;for(let r of this.children){if(!(r instanceof ui)||/[^ -~]/.test(r.text))return null;let i=kl(r.dom);if(i.length!=1)return null;e+=i[0].width,n=i[0].height}return e?{lineHeight:this.dom.getBoundingClientRect().height,charWidth:e/this.length,textHeight:n}:null}coordsAt(e,n){let r=CD(this,e,n);if(!this.children.length&&r&&this.parent){let{heightOracle:i}=this.parent.view.viewState,s=r.bottom-r.top;if(Math.abs(s-i.lineHeight)<2&&i.textHeight=n){if(s instanceof Jt)return s;if(o>n)break}i=o+s.breakAfter}return null}}class gs extends ut{constructor(e,n,r){super(),this.widget=e,this.length=n,this.deco=r,this.breakAfter=0,this.prevWidget=null}merge(e,n,r,i,s,o){return r&&(!(r instanceof gs)||!this.widget.compare(r.widget)||e>0&&s<=0||n0}}class Eb extends Yi{constructor(e){super(),this.height=e}toDOM(){let e=document.createElement("div");return e.className="cm-gap",this.updateDOM(e),e}eq(e){return e.height==this.height}updateDOM(e){return e.style.height=this.height+"px",!0}get editable(){return!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}}class fc{constructor(e,n,r,i){this.doc=e,this.pos=n,this.end=r,this.disallowBlockEffectsFor=i,this.content=[],this.curLine=null,this.breakAtStart=0,this.pendingBuffer=0,this.bufferMarks=[],this.atCursorPos=!0,this.openStart=-1,this.openEnd=-1,this.text="",this.textOff=0,this.cursor=e.iter(),this.skip=n}posCovered(){if(this.content.length==0)return!this.breakAtStart&&this.doc.lineAt(this.pos).from!=this.pos;let e=this.content[this.content.length-1];return!(e.breakAfter||e instanceof gs&&e.deco.endSide<0)}getLine(){return this.curLine||(this.content.push(this.curLine=new Jt),this.atCursorPos=!0),this.curLine}flushBuffer(e=this.bufferMarks){this.pendingBuffer&&(this.curLine.append(wd(new Ol(-1),e),e.length),this.pendingBuffer=0)}addBlockWidget(e){this.flushBuffer(),this.curLine=null,this.content.push(e)}finish(e){this.pendingBuffer&&e<=this.bufferMarks.length?this.flushBuffer():this.pendingBuffer=0,!this.posCovered()&&!(e&&this.content.length&&this.content[this.content.length-1]instanceof gs)&&this.getLine()}buildText(e,n,r){for(;e>0;){if(this.textOff==this.text.length){let{value:o,lineBreak:a,done:l}=this.cursor.next(this.skip);if(this.skip=0,l)throw new Error("Ran out of text content when drawing inline views");if(a){this.posCovered()||this.getLine(),this.content.length?this.content[this.content.length-1].breakAfter=1:this.breakAtStart=1,this.flushBuffer(),this.curLine=null,this.atCursorPos=!0,e--;continue}else this.text=o,this.textOff=0}let i=Math.min(this.text.length-this.textOff,e),s=Math.min(i,512);this.flushBuffer(n.slice(n.length-r)),this.getLine().append(wd(new ui(this.text.slice(this.textOff,this.textOff+s)),n),r),this.atCursorPos=!0,this.textOff+=s,e-=s,r=i<=s?0:n.length}}span(e,n,r,i){this.buildText(n-e,r,i),this.pos=n,this.openStart<0&&(this.openStart=i)}point(e,n,r,i,s,o){if(this.disallowBlockEffectsFor[o]&&r instanceof go){if(r.block)throw new RangeError("Block decorations may not be specified via plugins");if(n>this.doc.lineAt(this.pos).to)throw new RangeError("Decorations that replace line breaks may not be specified via plugins")}let a=n-e;if(r instanceof go)if(r.block)r.startSide>0&&!this.posCovered()&&this.getLine(),this.addBlockWidget(new gs(r.widget||Tl.block,a,r));else{let l=Ws.create(r.widget||Tl.inline,a,a?0:r.startSide),u=this.atCursorPos&&!l.isEditable&&s<=i.length&&(e0),c=!l.isEditable&&(ei.length||r.startSide<=0),f=this.getLine();this.pendingBuffer==2&&!u&&!l.isEditable&&(this.pendingBuffer=0),this.flushBuffer(i),u&&(f.append(wd(new Ol(1),i),s),s=i.length+Math.max(0,s-i.length)),f.append(wd(l,i),s),this.atCursorPos=c,this.pendingBuffer=c?ei.length?1:2:0,this.pendingBuffer&&(this.bufferMarks=i.slice())}else this.doc.lineAt(this.pos).from==this.pos&&this.getLine().addLineDeco(r);a&&(this.textOff+a<=this.text.length?this.textOff+=a:(this.skip+=a-(this.text.length-this.textOff),this.text="",this.textOff=0),this.pos=n),this.openStart<0&&(this.openStart=s)}static build(e,n,r,i,s){let o=new fc(e,n,r,s);return o.openEnd=Xe.spans(i,n,r,o),o.openStart<0&&(o.openStart=o.openEnd),o.finish(o.openEnd),o}}function wd(t,e){for(let n of e)t=new Cs(n,[t],t.length);return t}class Tl extends Yi{constructor(e){super(),this.tag=e}eq(e){return e.tag==this.tag}toDOM(){return document.createElement(this.tag)}updateDOM(e){return e.nodeName.toLowerCase()==this.tag}get isHidden(){return!0}}Tl.inline=new Tl("span");Tl.block=new Tl("div");var Et=(function(t){return t[t.LTR=0]="LTR",t[t.RTL=1]="RTL",t})(Et||(Et={}));const ha=Et.LTR,yv=Et.RTL;function DD(t){let e=[];for(let n=0;n=n){if(a.level==r)return o;(s<0||(i!=0?i<0?a.fromn:e[s].level>a.level))&&(s=o)}}if(s<0)throw new RangeError("Index out of range");return s}}function OD(t,e){if(t.length!=e.length)return!1;for(let n=0;n=0;m-=3)if(yi[m+1]==-h){let g=yi[m+2],b=g&2?i:g&4?g&1?s:i:0;b&&(ft[f]=ft[yi[m]]=b),a=m;break}}else{if(yi.length==189)break;yi[a++]=f,yi[a++]=d,yi[a++]=l}else if((p=ft[f])==2||p==1){let m=p==i;l=m?0:1;for(let g=a-3;g>=0;g-=3){let b=yi[g+2];if(b&2)break;if(m)yi[g+2]|=2;else{if(b&4)break;yi[g+2]|=4}}}}}function _9(t,e,n,r){for(let i=0,s=r;i<=n.length;i++){let o=i?n[i-1].to:t,a=il;)p==g&&(p=n[--m].from,g=m?n[m-1].to:t),ft[--p]=h;l=c}else s=u,l++}}}function _b(t,e,n,r,i,s,o){let a=r%2?2:1;if(r%2==i%2)for(let l=e,u=0;ll&&o.push(new Ks(l,m.from,h));let g=m.direction==ha!=!(h%2);Cb(t,g?r+1:r,i,m.inner,m.from,m.to,o),l=m.to}p=m.to}else{if(p==n||(c?ft[p]!=a:ft[p]==a))break;p++}d?_b(t,l,p,r+1,i,d,o):le;){let c=!0,f=!1;if(!u||l>s[u-1].to){let m=ft[l-1];m!=a&&(c=!1,f=m==16)}let d=!c&&a==1?[]:null,h=c?r:r+1,p=l;e:for(;;)if(u&&p==s[u-1].to){if(f)break e;let m=s[--u];if(!c)for(let g=m.from,b=u;;){if(g==e)break e;if(b&&s[b-1].to==g)g=s[--b].from;else{if(ft[g-1]==a)break e;break}}if(d)d.push(m);else{m.toft.length;)ft[ft.length]=256;let r=[],i=e==ha?0:1;return Cb(t,i,i,n,0,t.length,r),r}function TD(t){return[new Ks(0,t,0)]}let ID="";function A9(t,e,n,r,i){var s;let o=r.head-t.from,a=Ks.find(e,o,(s=r.bidiLevel)!==null&&s!==void 0?s:-1,r.assoc),l=e[a],u=l.side(i,n);if(o==u){let d=a+=i?1:-1;if(d<0||d>=e.length)return null;l=e[a=d],o=l.side(!i,n),u=l.side(i,n)}let c=wn(t.text,o,l.forward(i,n));(cl.to)&&(c=u),ID=t.text.slice(Math.min(o,c),Math.max(o,c));let f=a==(i?e.length-1:0)?null:e[a+(i?1:-1)];return f&&c==u&&f.level+(i?0:1)t.some(e=>e)}),$D=he.define({combine:t=>t.some(e=>e)}),zD=he.define();class fl{constructor(e,n="nearest",r="nearest",i=5,s=5,o=!1){this.range=e,this.y=n,this.x=r,this.yMargin=i,this.xMargin=s,this.isSnapshot=o}map(e){return e.empty?this:new fl(this.range.map(e),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}clip(e){return this.range.to<=e.doc.length?this:new fl(Y.cursor(e.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}}const _d=De.define({map:(t,e)=>t.map(e)}),jD=De.define();function qn(t,e,n){let r=t.facet(MD);r.length?r[0](e):window.onerror&&window.onerror(String(e),n,void 0,void 0,e)||(n?console.error(n+":",e):console.error(e))}const ls=he.define({combine:t=>t.length?t[0]:!0});let k9=0;const Qa=he.define({combine(t){return t.filter((e,n)=>{for(let r=0;r{let l=[];return o&&l.push(Bc.of(u=>{let c=u.plugin(a);return c?o(c):ve.none})),s&&l.push(s(a)),l})}static fromClass(e,n){return $t.define((r,i)=>new e(r,i),n)}}class mg{constructor(e){this.spec=e,this.mustUpdate=null,this.value=null}get plugin(){return this.spec&&this.spec.plugin}update(e){if(this.value){if(this.mustUpdate){let n=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(n)}catch(r){if(qn(n.state,r,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch{}this.deactivate()}}}else if(this.spec)try{this.value=this.spec.plugin.create(e,this.spec.arg)}catch(n){qn(e.state,n,"CodeMirror plugin crashed"),this.deactivate()}return this}destroy(e){var n;if(!((n=this.value)===null||n===void 0)&&n.destroy)try{this.value.destroy()}catch(r){qn(e.state,r,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const VD=he.define(),Sv=he.define(),Bc=he.define(),UD=he.define(),Ff=he.define(),HD=he.define();function iS(t,e){let n=t.state.facet(HD);if(!n.length)return n;let r=n.map(s=>s instanceof Function?s(t):s),i=[];return Xe.spans(r,e.from,e.to,{point(){},span(s,o,a,l){let u=s-e.from,c=o-e.from,f=i;for(let d=a.length-1;d>=0;d--,l--){let h=a[d].spec.bidiIsolate,p;if(h==null&&(h=D9(e.text,u,c)),l>0&&f.length&&(p=f[f.length-1]).to==u&&p.direction==h)p.to=c,f=p.inner;else{let m={from:u,to:c,direction:h,inner:[]};f.push(m),f=m.inner}}}}),i}const qD=he.define();function Ev(t){let e=0,n=0,r=0,i=0;for(let s of t.state.facet(qD)){let o=s(t);o&&(o.left!=null&&(e=Math.max(e,o.left)),o.right!=null&&(n=Math.max(n,o.right)),o.top!=null&&(r=Math.max(r,o.top)),o.bottom!=null&&(i=Math.max(i,o.bottom)))}return{left:e,right:n,top:r,bottom:i}}const Wu=he.define();class jr{constructor(e,n,r,i){this.fromA=e,this.toA=n,this.fromB=r,this.toB=i}join(e){return new jr(Math.min(this.fromA,e.fromA),Math.max(this.toA,e.toA),Math.min(this.fromB,e.fromB),Math.max(this.toB,e.toB))}addToSet(e){let n=e.length,r=this;for(;n>0;n--){let i=e[n-1];if(!(i.fromA>r.toA)){if(i.toAc)break;s+=2}if(!l)return r;new jr(l.fromA,l.toA,l.fromB,l.toB).addToSet(r),o=l.toA,a=l.toB}}}class vp{constructor(e,n,r){this.view=e,this.state=n,this.transactions=r,this.flags=0,this.startState=e.state,this.changes=sn.empty(this.startState.doc.length);for(let s of r)this.changes=this.changes.compose(s.changes);let i=[];this.changes.iterChangedRanges((s,o,a,l)=>i.push(new jr(s,o,a,l))),this.changedRanges=i}static create(e,n,r){return new vp(e,n,r)}get viewportChanged(){return(this.flags&4)>0}get viewportMoved(){return(this.flags&8)>0}get heightChanged(){return(this.flags&2)>0}get geometryChanged(){return this.docChanged||(this.flags&18)>0}get focusChanged(){return(this.flags&1)>0}get docChanged(){return!this.changes.empty}get selectionSet(){return this.transactions.some(e=>e.selection)}get empty(){return this.flags==0&&this.transactions.length==0}}class sS extends ut{get length(){return this.view.state.doc.length}constructor(e){super(),this.view=e,this.decorations=[],this.dynamicDecorationMap=[!1],this.domChanged=null,this.hasComposition=null,this.markedForComposition=new Set,this.editContextFormatting=ve.none,this.lastCompositionAfterCursor=!1,this.minWidth=0,this.minWidthFrom=0,this.minWidthTo=0,this.impreciseAnchor=null,this.impreciseHead=null,this.forceSelection=!1,this.lastUpdate=Date.now(),this.setDOM(e.contentDOM),this.children=[new Jt],this.children[0].setParent(this),this.updateDeco(),this.updateInner([new jr(0,0,0,e.state.doc.length)],0,null)}update(e){var n;let r=e.changedRanges;this.minWidth>0&&r.length&&(r.every(({fromA:u,toA:c})=>cthis.minWidthTo)?(this.minWidthFrom=e.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=e.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0),this.updateEditContextFormatting(e);let i=-1;this.view.inputState.composing>=0&&!this.view.observer.editContext&&(!((n=this.domChanged)===null||n===void 0)&&n.newSel?i=this.domChanged.newSel.head:!M9(e.changes,this.hasComposition)&&!e.selectionSet&&(i=e.state.selection.main.head));let s=i>-1?T9(this.view,e.changes,i):null;if(this.domChanged=null,this.hasComposition){this.markedForComposition.clear();let{from:u,to:c}=this.hasComposition;r=new jr(u,c,e.changes.mapPos(u,-1),e.changes.mapPos(c,1)).addToSet(r.slice())}this.hasComposition=s?{from:s.range.fromB,to:s.range.toB}:null,(ue.ie||ue.chrome)&&!s&&e&&e.state.doc.lines!=e.startState.doc.lines&&(this.forceSelection=!0);let o=this.decorations,a=this.updateDeco(),l=R9(o,a,e.changes);return r=jr.extendWithRanges(r,l),!(this.flags&7)&&r.length==0?!1:(this.updateInner(r,e.startState.doc.length,s),e.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(e,n,r){this.view.viewState.mustMeasureContent=!0,this.updateChildren(e,n,r);let{observer:i}=this.view;i.ignore(()=>{this.dom.style.height=this.view.viewState.contentHeight/this.view.scaleY+"px",this.dom.style.flexBasis=this.minWidth?this.minWidth+"px":"";let o=ue.chrome||ue.ios?{node:i.selectionRange.focusNode,written:!1}:void 0;this.sync(this.view,o),this.flags&=-8,o&&(o.written||i.selectionRange.focusNode!=o.node)&&(this.forceSelection=!0),this.dom.style.height=""}),this.markedForComposition.forEach(o=>o.flags&=-9);let s=[];if(this.view.viewport.from||this.view.viewport.to=0?i[o]:null;if(!a)break;let{fromA:l,toA:u,fromB:c,toB:f}=a,d,h,p,m;if(r&&r.range.fromBc){let S=fc.build(this.view.state.doc,c,r.range.fromB,this.decorations,this.dynamicDecorationMap),E=fc.build(this.view.state.doc,r.range.toB,f,this.decorations,this.dynamicDecorationMap);h=S.breakAtStart,p=S.openStart,m=E.openEnd;let C=this.compositionView(r);E.breakAtStart?C.breakAfter=1:E.content.length&&C.merge(C.length,C.length,E.content[0],!1,E.openStart,0)&&(C.breakAfter=E.content[0].breakAfter,E.content.shift()),S.content.length&&C.merge(0,0,S.content[S.content.length-1],!0,0,S.openEnd)&&S.content.pop(),d=S.content.concat(C).concat(E.content)}else({content:d,breakAtStart:h,openStart:p,openEnd:m}=fc.build(this.view.state.doc,c,f,this.decorations,this.dynamicDecorationMap));let{i:g,off:b}=s.findPos(u,1),{i:y,off:x}=s.findPos(l,-1);SD(this,y,x,g,b,d,h,p,m)}r&&this.fixCompositionDOM(r)}updateEditContextFormatting(e){this.editContextFormatting=this.editContextFormatting.map(e.changes);for(let n of e.transactions)for(let r of n.effects)r.is(jD)&&(this.editContextFormatting=r.value)}compositionView(e){let n=new ui(e.text.nodeValue);n.flags|=8;for(let{deco:i}of e.marks)n=new Cs(i,[n],n.length);let r=new Jt;return r.append(n,0),r}fixCompositionDOM(e){let n=(s,o)=>{o.flags|=8|(o.children.some(l=>l.flags&7)?1:0),this.markedForComposition.add(o);let a=ut.get(s);a&&a!=o&&(a.dom=null),o.setDOM(s)},r=this.childPos(e.range.fromB,1),i=this.children[r.i];n(e.line,i);for(let s=e.marks.length-1;s>=-1;s--)r=i.childPos(r.off,1),i=i.children[r.i],n(s>=0?e.marks[s].node:e.text,i)}updateSelection(e=!1,n=!1){(e||!this.view.observer.selectionRange.focusNode)&&this.view.observer.readSelectionRange();let r=this.view.root.activeElement,i=r==this.dom,s=!i&&!(this.view.state.facet(ls)||this.dom.tabIndex>-1)&&Ah(this.dom,this.view.observer.selectionRange)&&!(r&&this.dom.contains(r));if(!(i||n||s))return;let o=this.forceSelection;this.forceSelection=!1;let a=this.view.state.selection.main,l=this.moveToLine(this.domAtPos(a.anchor)),u=a.empty?l:this.moveToLine(this.domAtPos(a.head));if(ue.gecko&&a.empty&&!this.hasComposition&&O9(l)){let f=document.createTextNode("");this.view.observer.ignore(()=>l.node.insertBefore(f,l.node.childNodes[l.offset]||null)),l=u=new Tn(f,0),o=!0}let c=this.view.observer.selectionRange;(o||!c.focusNode||(!cc(l.node,l.offset,c.anchorNode,c.anchorOffset)||!cc(u.node,u.offset,c.focusNode,c.focusOffset))&&!this.suppressWidgetCursorChange(c,a))&&(this.view.observer.ignore(()=>{ue.android&&ue.chrome&&this.dom.contains(c.focusNode)&&N9(c.focusNode,this.dom)&&(this.dom.blur(),this.dom.focus({preventScroll:!0}));let f=Lc(this.view.root);if(f)if(a.empty){if(ue.gecko){let d=I9(l.node,l.offset);if(d&&d!=3){let h=(d==1?yD:vD)(l.node,l.offset);h&&(l=new Tn(h.node,h.offset))}}f.collapse(l.node,l.offset),a.bidiLevel!=null&&f.caretBidiLevel!==void 0&&(f.caretBidiLevel=a.bidiLevel)}else if(f.extend){f.collapse(l.node,l.offset);try{f.extend(u.node,u.offset)}catch{}}else{let d=document.createRange();a.anchor>a.head&&([l,u]=[u,l]),d.setEnd(u.node,u.offset),d.setStart(l.node,l.offset),f.removeAllRanges(),f.addRange(d)}s&&this.view.root.activeElement==this.dom&&(this.dom.blur(),r&&r.focus())}),this.view.observer.setSelectionRange(l,u)),this.impreciseAnchor=l.precise?null:new Tn(c.anchorNode,c.anchorOffset),this.impreciseHead=u.precise?null:new Tn(c.focusNode,c.focusOffset)}suppressWidgetCursorChange(e,n){return this.hasComposition&&n.empty&&cc(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)&&this.posFromDOM(e.focusNode,e.focusOffset)==n.head}enforceCursorAssoc(){if(this.hasComposition)return;let{view:e}=this,n=e.state.selection.main,r=Lc(e.root),{anchorNode:i,anchorOffset:s}=e.observer.selectionRange;if(!r||!n.empty||!n.assoc||!r.modify)return;let o=Jt.find(this,n.head);if(!o)return;let a=o.posAtStart;if(n.head==a||n.head==a+o.length)return;let l=this.coordsAt(n.head,-1),u=this.coordsAt(n.head,1);if(!l||!u||l.bottom>u.top)return;let c=this.domAtPos(n.head+n.assoc);r.collapse(c.node,c.offset),r.modify("move",n.assoc<0?"forward":"backward","lineboundary"),e.observer.readSelectionRange();let f=e.observer.selectionRange;e.docView.posFromDOM(f.anchorNode,f.anchorOffset)!=n.from&&r.collapse(i,s)}moveToLine(e){let n=this.dom,r;if(e.node!=n)return e;for(let i=e.offset;!r&&i=0;i--){let s=ut.get(n.childNodes[i]);s instanceof Jt&&(r=s.domAtPos(s.length))}return r?new Tn(r.node,r.offset,!0):e}nearest(e){for(let n=e;n;){let r=ut.get(n);if(r&&r.rootView==this)return r;n=n.parentNode}return null}posFromDOM(e,n){let r=this.nearest(e);if(!r)throw new RangeError("Trying to find position for a DOM position outside of the document");return r.localPosFromDOM(e,n)+r.posAtStart}domAtPos(e){let{i:n,off:r}=this.childCursor().findPos(e,-1);for(;n=0;o--){let a=this.children[o],l=s-a.breakAfter,u=l-a.length;if(le||a.covers(1))&&(!r||a instanceof Jt&&!(r instanceof Jt&&n>=0)))r=a,i=u;else if(r&&u==e&&l==e&&a instanceof gs&&Math.abs(n)<2){if(a.deco.startSide<0)break;o&&(r=null)}s=u}return r?r.coordsAt(e-i,n):null}coordsForChar(e){let{i:n,off:r}=this.childPos(e,1),i=this.children[n];if(!(i instanceof Jt))return null;for(;i.children.length;){let{i:a,off:l}=i.childPos(r,1);for(;;a++){if(a==i.children.length)return null;if((i=i.children[a]).length)break}r=l}if(!(i instanceof ui))return null;let s=wn(i.text,r);if(s==r)return null;let o=da(i.dom,r,s).getClientRects();for(let a=0;aMath.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,a=-1,l=this.view.textDirection==Et.LTR;for(let u=0,c=0;ci)break;if(u>=r){let h=f.dom.getBoundingClientRect();if(n.push(h.height),o){let p=f.dom.lastChild,m=p?kl(p):[];if(m.length){let g=m[m.length-1],b=l?g.right-h.left:h.right-g.left;b>a&&(a=b,this.minWidth=s,this.minWidthFrom=u,this.minWidthTo=d)}}}u=d+f.breakAfter}return n}textDirectionAt(e){let{i:n}=this.childPos(e,1);return getComputedStyle(this.children[n].dom).direction=="rtl"?Et.RTL:Et.LTR}measureTextSize(){for(let s of this.children)if(s instanceof Jt){let o=s.measureTextSize();if(o)return o}let e=document.createElement("div"),n,r,i;return e.className="cm-line",e.style.width="99999px",e.style.position="absolute",e.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore(()=>{this.dom.appendChild(e);let s=kl(e.firstChild)[0];n=e.getBoundingClientRect().height,r=s?s.width/27:7,i=s?s.height:n,e.remove()}),{lineHeight:n,charWidth:r,textHeight:i}}childCursor(e=this.length){let n=this.children.length;return n&&(e-=this.children[--n].length),new xD(this.children,e,n)}computeBlockGapDeco(){let e=[],n=this.view.viewState;for(let r=0,i=0;;i++){let s=i==n.viewports.length?null:n.viewports[i],o=s?s.from-1:this.length;if(o>r){let a=(n.lineBlockAt(o).bottom-n.lineBlockAt(r).top)/this.view.scaleY;e.push(ve.replace({widget:new Eb(a),block:!0,inclusive:!0,isBlockGap:!0}).range(r,o))}if(!s)break;r=s.to+1}return ve.set(e)}updateDeco(){let e=1,n=this.view.state.facet(Bc).map(s=>(this.dynamicDecorationMap[e++]=typeof s=="function")?s(this.view):s),r=!1,i=this.view.state.facet(UD).map((s,o)=>{let a=typeof s=="function";return a&&(r=!0),a?s(this.view):s});for(i.length&&(this.dynamicDecorationMap[e++]=r,n.push(Xe.join(i))),this.decorations=[this.editContextFormatting,...n,this.computeBlockGapDeco(),this.view.viewState.lineGapDeco];en.anchor?-1:1),i;if(!r)return;!n.empty&&(i=this.coordsAt(n.anchor,n.anchor>n.head?-1:1))&&(r={left:Math.min(r.left,i.left),top:Math.min(r.top,i.top),right:Math.max(r.right,i.right),bottom:Math.max(r.bottom,i.bottom)});let s=Ev(this.view),o={left:r.left-s.left,top:r.top-s.top,right:r.right+s.right,bottom:r.bottom+s.bottom},{offsetWidth:a,offsetHeight:l}=this.view.scrollDOM;l9(this.view.scrollDOM,o,n.head{re.from&&(n=!0)}),n}function F9(t,e,n=1){let r=t.charCategorizer(e),i=t.doc.lineAt(e),s=e-i.from;if(i.length==0)return Y.cursor(e);s==0?n=1:s==i.length&&(n=-1);let o=s,a=s;n<0?o=wn(i.text,s,!1):a=wn(i.text,s);let l=r(i.text.slice(o,a));for(;o>0;){let u=wn(i.text,o,!1);if(r(i.text.slice(u,o))!=l)break;o=u}for(;at?e.left-t:Math.max(0,t-e.right)}function B9(t,e){return e.top>t?e.top-t:Math.max(0,t-e.bottom)}function gg(t,e){return t.tope.top+1}function oS(t,e){return et.bottom?{top:t.top,left:t.left,right:t.right,bottom:e}:t}function Db(t,e,n){let r,i,s,o,a=!1,l,u,c,f;for(let p=t.firstChild;p;p=p.nextSibling){let m=kl(p);for(let g=0;gx||o==x&&s>y)&&(r=p,i=b,s=y,o=x,a=y?e0:gb.bottom&&(!c||c.bottomb.top)&&(u=p,f=b):c&&gg(c,b)?c=aS(c,b.bottom):f&&gg(f,b)&&(f=oS(f,b.top))}}if(c&&c.bottom>=n?(r=l,i=c):f&&f.top<=n&&(r=u,i=f),!r)return{node:t,offset:0};let d=Math.max(i.left,Math.min(i.right,e));if(r.nodeType==3)return lS(r,d,n);if(a&&r.contentEditable!="false")return Db(r,d,n);let h=Array.prototype.indexOf.call(t.childNodes,r)+(e>=(i.left+i.right)/2?1:0);return{node:t,offset:h}}function lS(t,e,n){let r=t.nodeValue.length,i=-1,s=1e9,o=0;for(let a=0;an?c.top-n:n-c.bottom)-1;if(c.left-1<=e&&c.right+1>=e&&f=(c.left+c.right)/2,h=d;if((ue.chrome||ue.gecko)&&da(t,a).getBoundingClientRect().left==c.right&&(h=!d),f<=0)return{node:t,offset:a+(h?1:0)};i=a+(h?1:0),s=f}}}return{node:t,offset:i>-1?i:o>0?t.nodeValue.length:0}}function WD(t,e,n,r=-1){var i,s;let o=t.contentDOM.getBoundingClientRect(),a=o.top+t.viewState.paddingTop,l,{docHeight:u}=t.viewState,{x:c,y:f}=e,d=f-a;if(d<0)return 0;if(d>u)return t.state.doc.length;for(let S=t.viewState.heightOracle.textHeight/2,E=!1;l=t.elementAtHeight(d),l.type!=Kn.Text;)for(;d=r>0?l.bottom+S:l.top-S,!(d>=0&&d<=u);){if(E)return n?null:0;E=!0,r=-r}f=a+d;let h=l.from;if(ht.viewport.to)return t.viewport.to==t.state.doc.length?t.state.doc.length:n?null:uS(t,o,l,c,f);let p=t.dom.ownerDocument,m=t.root.elementFromPoint?t.root:p,g=m.elementFromPoint(c,f);g&&!t.contentDOM.contains(g)&&(g=null),g||(c=Math.max(o.left+1,Math.min(o.right-1,c)),g=m.elementFromPoint(c,f),g&&!t.contentDOM.contains(g)&&(g=null));let b,y=-1;if(g&&((i=t.docView.nearest(g))===null||i===void 0?void 0:i.isEditable)!=!1){if(p.caretPositionFromPoint){let S=p.caretPositionFromPoint(c,f);S&&({offsetNode:b,offset:y}=S)}else if(p.caretRangeFromPoint){let S=p.caretRangeFromPoint(c,f);S&&({startContainer:b,startOffset:y}=S)}b&&(!t.contentDOM.contains(b)||ue.safari&&$9(b,y,c)||ue.chrome&&z9(b,y,c))&&(b=void 0),b&&(y=Math.min(Vi(b),y))}if(!b||!t.docView.dom.contains(b)){let S=Jt.find(t.docView,h);if(!S)return d>l.top+l.height/2?l.to:l.from;({node:b,offset:y}=Db(S.dom,c,f))}let x=t.docView.nearest(b);if(!x)return null;if(x.isWidget&&((s=x.dom)===null||s===void 0?void 0:s.nodeType)==1){let S=x.dom.getBoundingClientRect();return e.yt.defaultLineHeight*1.5){let a=t.viewState.heightOracle.textHeight,l=Math.floor((i-n.top-(t.defaultLineHeight-a)*.5)/a);s+=l*t.viewState.heightOracle.lineLength}let o=t.state.sliceDoc(n.from,n.to);return n.from+db(o,s,t.state.tabSize)}function KD(t,e,n){let r,i=t;if(t.nodeType!=3||e!=(r=t.nodeValue.length))return!1;for(;;){let s=i.nextSibling;if(s){if(s.nodeName=="BR")break;return!1}else{let o=i.parentNode;if(!o||o.nodeName=="DIV")break;i=o}}return da(t,r-1,r).getBoundingClientRect().right>n}function $9(t,e,n){return KD(t,e,n)}function z9(t,e,n){if(e!=0)return KD(t,e,n);for(let i=t;;){let s=i.parentNode;if(!s||s.nodeType!=1||s.firstChild!=i)return!1;if(s.classList.contains("cm-line"))break;i=s}let r=t.nodeType==1?t.getBoundingClientRect():da(t,0,Math.max(t.nodeValue.length,1)).getBoundingClientRect();return n-r.left>5}function kb(t,e,n){let r=t.lineBlockAt(e);if(Array.isArray(r.type)){let i;for(let s of r.type){if(s.from>e)break;if(!(s.toe)return s;(!i||s.type==Kn.Text&&(i.type!=s.type||(n<0?s.frome)))&&(i=s)}}return i||r}return r}function j9(t,e,n,r){let i=kb(t,e.head,e.assoc||-1),s=!r||i.type!=Kn.Text||!(t.lineWrapping||i.widgetLineBreaks)?null:t.coordsAtPos(e.assoc<0&&e.head>i.from?e.head-1:e.head);if(s){let o=t.dom.getBoundingClientRect(),a=t.textDirectionAt(i.from),l=t.posAtCoords({x:n==(a==Et.LTR)?o.right-1:o.left+1,y:(s.top+s.bottom)/2});if(l!=null)return Y.cursor(l,n?-1:1)}return Y.cursor(n?i.to:i.from,n?-1:1)}function cS(t,e,n,r){let i=t.state.doc.lineAt(e.head),s=t.bidiSpans(i),o=t.textDirectionAt(i.from);for(let a=e,l=null;;){let u=A9(i,s,o,a,n),c=ID;if(!u){if(i.number==(n?t.state.doc.lines:1))return a;c=` +`,i=t.state.doc.line(i.number+(n?1:-1)),s=t.bidiSpans(i),u=t.visualLineSide(i,!n)}if(l){if(!l(c))return a}else{if(!r)return u;l=r(c)}a=u}}function V9(t,e,n){let r=t.state.charCategorizer(e),i=r(n);return s=>{let o=r(s);return i==kt.Space&&(i=o),i==o}}function U9(t,e,n,r){let i=e.head,s=n?1:-1;if(i==(n?t.state.doc.length:0))return Y.cursor(i,e.assoc);let o=e.goalColumn,a,l=t.contentDOM.getBoundingClientRect(),u=t.coordsAtPos(i,e.assoc||-1),c=t.documentTop;if(u)o==null&&(o=u.left-l.left),a=s<0?u.top:u.bottom;else{let h=t.viewState.lineBlockAt(i);o==null&&(o=Math.min(l.right-l.left,t.defaultCharacterWidth*(i-h.from))),a=(s<0?h.top:h.bottom)+c}let f=l.left+o,d=r??t.viewState.heightOracle.textHeight>>1;for(let h=0;;h+=10){let p=a+(d+h)*s,m=WD(t,{x:f,y:p},!1,s);if(pl.bottom||(s<0?mi)){let g=t.docView.coordsForChar(m),b=!g||p{if(e>s&&ei(t)),n.from,e.head>n.from?-1:1);return r==n.from?n:Y.cursor(r,rs)&&!G9(o,n)&&this.lineBreak(),i=o}return this.findPointBefore(r,n),this}readTextNode(e){let n=e.nodeValue;for(let r of this.points)r.node==e&&(r.pos=this.text.length+Math.min(r.offset,n.length));for(let r=0,i=this.lineSeparator?null:/\r\n?|\n/g;;){let s=-1,o=1,a;if(this.lineSeparator?(s=n.indexOf(this.lineSeparator,r),o=this.lineSeparator.length):(a=i.exec(n))&&(s=a.index,o=a[0].length),this.append(n.slice(r,s<0?n.length:s)),s<0)break;if(this.lineBreak(),o>1)for(let l of this.points)l.node==e&&l.pos>this.text.length&&(l.pos-=o-1);r=s+o}}readNode(e){if(e.cmIgnore)return;let n=ut.get(e),r=n&&n.overrideDOMText;if(r!=null){this.findPointInside(e,r.length);for(let i=r.iter();!i.next().done;)i.lineBreak?this.lineBreak():this.append(i.value)}else e.nodeType==3?this.readTextNode(e):e.nodeName=="BR"?e.nextSibling&&this.lineBreak():e.nodeType==1&&this.readRange(e.firstChild,null)}findPointBefore(e,n){for(let r of this.points)r.node==e&&e.childNodes[r.offset]==n&&(r.pos=this.text.length)}findPointInside(e,n){for(let r of this.points)(e.nodeType==3?r.node==e:e.contains(r.node))&&(r.pos=this.text.length+(q9(e,r.node,r.offset)?n:0))}}function q9(t,e,n){for(;;){if(!e||n-1;let{impreciseHead:s,impreciseAnchor:o}=e.docView;if(e.state.readOnly&&n>-1)this.newSel=null;else if(n>-1&&(this.bounds=e.docView.domBoundsAround(n,r,0))){let a=s||o?[]:X9(e),l=new H9(a,e.state);l.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=l.text,this.newSel=Y9(a,this.bounds.from)}else{let a=e.observer.selectionRange,l=s&&s.node==a.focusNode&&s.offset==a.focusOffset||!vb(e.contentDOM,a.focusNode)?e.state.selection.main.head:e.docView.posFromDOM(a.focusNode,a.focusOffset),u=o&&o.node==a.anchorNode&&o.offset==a.anchorOffset||!vb(e.contentDOM,a.anchorNode)?e.state.selection.main.anchor:e.docView.posFromDOM(a.anchorNode,a.anchorOffset),c=e.viewport;if((ue.ios||ue.chrome)&&e.state.selection.main.empty&&l!=u&&(c.from>0||c.toDate.now()-100?t.inputState.lastKeyCode:-1;if(e.bounds){let{from:o,to:a}=e.bounds,l=i.from,u=null;(s===8||ue.android&&e.text.length=i.from&&n.to<=i.to&&(n.from!=i.from||n.to!=i.to)&&i.to-i.from-(n.to-n.from)<=4?n={from:i.from,to:i.to,insert:t.state.doc.slice(i.from,n.from).append(n.insert).append(t.state.doc.slice(n.to,i.to))}:ue.chrome&&n&&n.from==n.to&&n.from==i.head&&n.insert.toString()==` + `&&t.lineWrapping&&(r&&(r=Y.single(r.main.anchor-1,r.main.head-1)),n={from:i.from,to:i.to,insert:Ze.of([" "])}),n)return wv(t,n,r,s);if(r&&!r.main.eq(i)){let o=!1,a="select";return t.inputState.lastSelectionTime>Date.now()-50&&(t.inputState.lastSelectionOrigin=="select"&&(o=!0),a=t.inputState.lastSelectionOrigin,a=="select.pointer"&&(r=XD(t.state.facet(Ff).map(l=>l(t)),r))),t.dispatch({selection:r,scrollIntoView:o,userEvent:a}),!0}else return!1}function wv(t,e,n,r=-1){if(ue.ios&&t.inputState.flushIOSKey(e))return!0;let i=t.state.selection.main;if(ue.android&&(e.to==i.to&&(e.from==i.from||e.from==i.from-1&&t.state.sliceDoc(e.from,i.from)==" ")&&e.insert.length==1&&e.insert.lines==2&&cl(t.contentDOM,"Enter",13)||(e.from==i.from-1&&e.to==i.to&&e.insert.length==0||r==8&&e.insert.lengthi.head)&&cl(t.contentDOM,"Backspace",8)||e.from==i.from&&e.to==i.to+1&&e.insert.length==0&&cl(t.contentDOM,"Delete",46)))return!0;let s=e.insert.toString();t.inputState.composing>=0&&t.inputState.composing++;let o,a=()=>o||(o=K9(t,e,n));return t.state.facet(FD).some(l=>l(t,e.from,e.to,s,a))||t.dispatch(a()),!0}function K9(t,e,n){let r,i=t.state,s=i.selection.main,o=-1;if(e.from==e.to&&e.froms.to){let l=e.fromf(t)),u,l);e.from==c&&(o=c)}if(o>-1)r={changes:e,selection:Y.cursor(e.from+e.insert.length,-1)};else if(e.from>=s.from&&e.to<=s.to&&e.to-e.from>=(s.to-s.from)/3&&(!n||n.main.empty&&n.main.from==e.from+e.insert.length)&&t.inputState.composing<0){let l=s.frome.to?i.sliceDoc(e.to,s.to):"";r=i.replaceSelection(t.state.toText(l+e.insert.sliceString(0,void 0,t.state.lineBreak)+u))}else{let l=i.changes(e),u=n&&n.main.to<=l.newLength?n.main:void 0;if(i.selection.ranges.length>1&&t.inputState.composing>=0&&e.to<=s.to&&e.to>=s.to-10){let c=t.state.sliceDoc(e.from,e.to),f,d=n&&GD(t,n.main.head);if(d){let m=e.insert.length-(e.to-e.from);f={from:d.from,to:d.to-m}}else f=t.state.doc.lineAt(s.head);let h=s.to-e.to,p=s.to-s.from;r=i.changeByRange(m=>{if(m.from==s.from&&m.to==s.to)return{changes:l,range:u||m.map(l)};let g=m.to-h,b=g-c.length;if(m.to-m.from!=p||t.state.sliceDoc(b,g)!=c||m.to>=f.from&&m.from<=f.to)return{range:m};let y=i.changes({from:b,to:g,insert:e.insert}),x=m.to-s.to;return{changes:y,range:u?Y.range(Math.max(0,u.anchor+x),Math.max(0,u.head+x)):m.map(y)}})}else r={changes:l,selection:u&&i.selection.replaceRange(u)}}let a="input.type";return(t.composing||t.inputState.compositionPendingChange&&t.inputState.compositionEndedAt>Date.now()-50)&&(t.inputState.compositionPendingChange=!1,a+=".compose",t.inputState.compositionFirstChange&&(a+=".start",t.inputState.compositionFirstChange=!1)),i.update(r,{userEvent:a,scrollIntoView:!0})}function JD(t,e,n,r){let i=Math.min(t.length,e.length),s=0;for(;s0&&a>0&&t.charCodeAt(o-1)==e.charCodeAt(a-1);)o--,a--;if(r=="end"){let l=Math.max(0,s-Math.min(o,a));n-=o+l-s}if(o=o?s-n:0;s-=l,a=s+(a-o),o=s}else if(a=a?s-n:0;s-=l,o=s+(o-a),a=s}return{from:s,toA:o,toB:a}}function X9(t){let e=[];if(t.root.activeElement!=t.contentDOM)return e;let{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:s}=t.observer.selectionRange;return n&&(e.push(new fS(n,r)),(i!=n||s!=r)&&e.push(new fS(i,s))),e}function Y9(t,e){if(t.length==0)return null;let n=t[0].pos,r=t.length==2?t[1].pos:n;return n>-1&&r>-1?Y.single(n+e,r+e):null}class J9{setSelectionOrigin(e){this.lastSelectionOrigin=e,this.lastSelectionTime=Date.now()}constructor(e){this.view=e,this.lastKeyCode=0,this.lastKeyTime=0,this.lastTouchTime=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.pendingIOSKey=void 0,this.tabFocusMode=-1,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastContextMenu=0,this.scrollHandlers=[],this.handlers=Object.create(null),this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.compositionPendingKey=!1,this.compositionPendingChange=!1,this.mouseSelection=null,this.draggedContent=null,this.handleEvent=this.handleEvent.bind(this),this.notifiedFocused=e.hasFocus,ue.safari&&e.contentDOM.addEventListener("input",()=>null),ue.gecko&&hL(e.contentDOM.ownerDocument)}handleEvent(e){!sL(this.view,e)||this.ignoreDuringComposition(e)||e.type=="keydown"&&this.keydown(e)||(this.view.updateState!=0?Promise.resolve().then(()=>this.runHandlers(e.type,e)):this.runHandlers(e.type,e))}runHandlers(e,n){let r=this.handlers[e];if(r){for(let i of r.observers)i(this.view,n);for(let i of r.handlers){if(n.defaultPrevented)break;if(i(this.view,n)){n.preventDefault();break}}}}ensureHandlers(e){let n=Z9(e),r=this.handlers,i=this.view.contentDOM;for(let s in n)if(s!="scroll"){let o=!n[s].handlers.length,a=r[s];a&&o!=!a.handlers.length&&(i.removeEventListener(s,this.handleEvent),a=null),a||i.addEventListener(s,this.handleEvent,{passive:o})}for(let s in r)s!="scroll"&&!n[s]&&i.removeEventListener(s,this.handleEvent);this.handlers=n}keydown(e){if(this.lastKeyCode=e.keyCode,this.lastKeyTime=Date.now(),e.keyCode==9&&this.tabFocusMode>-1&&(!this.tabFocusMode||Date.now()<=this.tabFocusMode))return!0;if(this.tabFocusMode>0&&e.keyCode!=27&&QD.indexOf(e.keyCode)<0&&(this.tabFocusMode=-1),ue.android&&ue.chrome&&!e.synthetic&&(e.keyCode==13||e.keyCode==8))return this.view.observer.delayAndroidKey(e.key,e.keyCode),!0;let n;return ue.ios&&!e.synthetic&&!e.altKey&&!e.metaKey&&((n=ZD.find(r=>r.keyCode==e.keyCode))&&!e.ctrlKey||Q9.indexOf(e.key)>-1&&e.ctrlKey&&!e.shiftKey)?(this.pendingIOSKey=n||e,setTimeout(()=>this.flushIOSKey(),250),!0):(e.keyCode!=229&&this.view.observer.forceFlush(),!1)}flushIOSKey(e){let n=this.pendingIOSKey;return!n||n.key=="Enter"&&e&&e.from0?!0:ue.safari&&!ue.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100?(this.compositionPendingKey=!1,!0):!1}startMouseSelection(e){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=e}update(e){this.view.observer.update(e),this.mouseSelection&&this.mouseSelection.update(e),this.draggedContent&&e.docChanged&&(this.draggedContent=this.draggedContent.map(e.changes)),e.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}}function dS(t,e){return(n,r)=>{try{return e.call(t,r,n)}catch(i){qn(n.state,i)}}}function Z9(t){let e=Object.create(null);function n(r){return e[r]||(e[r]={observers:[],handlers:[]})}for(let r of t){let i=r.spec,s=i&&i.plugin.domEventHandlers,o=i&&i.plugin.domEventObservers;if(s)for(let a in s){let l=s[a];l&&n(a).handlers.push(dS(r.value,l))}if(o)for(let a in o){let l=o[a];l&&n(a).observers.push(dS(r.value,l))}}for(let r in ci)n(r).handlers.push(ci[r]);for(let r in qr)n(r).observers.push(qr[r]);return e}const ZD=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],Q9="dthko",QD=[16,17,18,20,91,92,224,225],Cd=6;function Ad(t){return Math.max(0,t)*.7+8}function eL(t,e){return Math.max(Math.abs(t.clientX-e.clientX),Math.abs(t.clientY-e.clientY))}class tL{constructor(e,n,r,i){this.view=e,this.startEvent=n,this.style=r,this.mustSelect=i,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=n,this.scrollParents=u9(e.contentDOM),this.atoms=e.state.facet(Ff).map(o=>o(e));let s=e.contentDOM.ownerDocument;s.addEventListener("mousemove",this.move=this.move.bind(this)),s.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=n.shiftKey,this.multiple=e.state.facet(Ue.allowMultipleSelections)&&nL(e,n),this.dragging=iL(e,n)&&nk(n)==1?null:!1}start(e){this.dragging===!1&&this.select(e)}move(e){if(e.buttons==0)return this.destroy();if(this.dragging||this.dragging==null&&eL(this.startEvent,e)<10)return;this.select(this.lastEvent=e);let n=0,r=0,i=0,s=0,o=this.view.win.innerWidth,a=this.view.win.innerHeight;this.scrollParents.x&&({left:i,right:o}=this.scrollParents.x.getBoundingClientRect()),this.scrollParents.y&&({top:s,bottom:a}=this.scrollParents.y.getBoundingClientRect());let l=Ev(this.view);e.clientX-l.left<=i+Cd?n=-Ad(i-e.clientX):e.clientX+l.right>=o-Cd&&(n=Ad(e.clientX-o)),e.clientY-l.top<=s+Cd?r=-Ad(s-e.clientY):e.clientY+l.bottom>=a-Cd&&(r=Ad(e.clientY-a)),this.setScrollSpeed(n,r)}up(e){this.dragging==null&&this.select(this.lastEvent),this.dragging||e.preventDefault(),this.destroy()}destroy(){this.setScrollSpeed(0,0);let e=this.view.contentDOM.ownerDocument;e.removeEventListener("mousemove",this.move),e.removeEventListener("mouseup",this.up),this.view.inputState.mouseSelection=this.view.inputState.draggedContent=null}setScrollSpeed(e,n){this.scrollSpeed={x:e,y:n},e||n?this.scrolling<0&&(this.scrolling=setInterval(()=>this.scroll(),50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1)}scroll(){let{x:e,y:n}=this.scrollSpeed;e&&this.scrollParents.x&&(this.scrollParents.x.scrollLeft+=e,e=0),n&&this.scrollParents.y&&(this.scrollParents.y.scrollTop+=n,n=0),(e||n)&&this.view.win.scrollBy(e,n),this.dragging===!1&&this.select(this.lastEvent)}select(e){let{view:n}=this,r=XD(this.atoms,this.style.get(e,this.extend,this.multiple));(this.mustSelect||!r.eq(n.state.selection,this.dragging===!1))&&this.view.dispatch({selection:r,userEvent:"select.pointer"}),this.mustSelect=!1}update(e){e.transactions.some(n=>n.isUserEvent("input.type"))?this.destroy():this.style.update(e)&&setTimeout(()=>this.select(this.lastEvent),20)}}function nL(t,e){let n=t.state.facet(PD);return n.length?n[0](e):ue.mac?e.metaKey:e.ctrlKey}function rL(t,e){let n=t.state.facet(RD);return n.length?n[0](e):ue.mac?!e.altKey:!e.ctrlKey}function iL(t,e){let{main:n}=t.state.selection;if(n.empty)return!1;let r=Lc(t.root);if(!r||r.rangeCount==0)return!0;let i=r.getRangeAt(0).getClientRects();for(let s=0;s=e.clientX&&o.top<=e.clientY&&o.bottom>=e.clientY)return!0}return!1}function sL(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let n=e.target,r;n!=t.contentDOM;n=n.parentNode)if(!n||n.nodeType==11||(r=ut.get(n))&&r.ignoreEvent(e))return!1;return!0}const ci=Object.create(null),qr=Object.create(null),ek=ue.ie&&ue.ie_version<15||ue.ios&&ue.webkit_version<604;function oL(t){let e=t.dom.parentNode;if(!e)return;let n=e.appendChild(document.createElement("textarea"));n.style.cssText="position: fixed; left: -10000px; top: 10px",n.focus(),setTimeout(()=>{t.focus(),n.remove(),tk(t,n.value)},50)}function K0(t,e,n){for(let r of t.facet(e))n=r(n,t);return n}function tk(t,e){e=K0(t.state,vv,e);let{state:n}=t,r,i=1,s=n.toText(e),o=s.lines==n.selection.ranges.length;if(Ob!=null&&n.selection.ranges.every(l=>l.empty)&&Ob==s.toString()){let l=-1;r=n.changeByRange(u=>{let c=n.doc.lineAt(u.from);if(c.from==l)return{range:u};l=c.from;let f=n.toText((o?s.line(i++).text:e)+n.lineBreak);return{changes:{from:c.from,insert:f},range:Y.cursor(u.from+f.length)}})}else o?r=n.changeByRange(l=>{let u=s.line(i++);return{changes:{from:l.from,to:l.to,insert:u.text},range:Y.cursor(l.from+u.length)}}):r=n.replaceSelection(s);t.dispatch(r,{userEvent:"input.paste",scrollIntoView:!0})}qr.scroll=t=>{t.inputState.lastScrollTop=t.scrollDOM.scrollTop,t.inputState.lastScrollLeft=t.scrollDOM.scrollLeft};ci.keydown=(t,e)=>(t.inputState.setSelectionOrigin("select"),e.keyCode==27&&t.inputState.tabFocusMode!=0&&(t.inputState.tabFocusMode=Date.now()+2e3),!1);qr.touchstart=(t,e)=>{t.inputState.lastTouchTime=Date.now(),t.inputState.setSelectionOrigin("select.pointer")};qr.touchmove=t=>{t.inputState.setSelectionOrigin("select.pointer")};ci.mousedown=(t,e)=>{if(t.observer.flush(),t.inputState.lastTouchTime>Date.now()-2e3)return!1;let n=null;for(let r of t.state.facet(ND))if(n=r(t,e),n)break;if(!n&&e.button==0&&(n=uL(t,e)),n){let r=!t.hasFocus;t.inputState.startMouseSelection(new tL(t,e,n,r)),r&&t.observer.ignore(()=>{mD(t.contentDOM);let s=t.root.activeElement;s&&!s.contains(t.contentDOM)&&s.blur()});let i=t.inputState.mouseSelection;if(i)return i.start(e),i.dragging===!1}else t.inputState.setSelectionOrigin("select.pointer");return!1};function hS(t,e,n,r){if(r==1)return Y.cursor(e,n);if(r==2)return F9(t.state,e,n);{let i=Jt.find(t.docView,e),s=t.state.doc.lineAt(i?i.posAtEnd:e),o=i?i.posAtStart:s.from,a=i?i.posAtEnd:s.to;return ae>=n.top&&e<=n.bottom&&t>=n.left&&t<=n.right;function aL(t,e,n,r){let i=Jt.find(t.docView,e);if(!i)return 1;let s=e-i.posAtStart;if(s==0)return 1;if(s==i.length)return-1;let o=i.coordsAt(s,-1);if(o&&pS(n,r,o))return-1;let a=i.coordsAt(s,1);return a&&pS(n,r,a)?1:o&&o.bottom>=r?-1:1}function mS(t,e){let n=t.posAtCoords({x:e.clientX,y:e.clientY},!1);return{pos:n,bias:aL(t,n,e.clientX,e.clientY)}}const lL=ue.ie&&ue.ie_version<=11;let gS=null,bS=0,yS=0;function nk(t){if(!lL)return t.detail;let e=gS,n=yS;return gS=t,yS=Date.now(),bS=!e||n>Date.now()-400&&Math.abs(e.clientX-t.clientX)<2&&Math.abs(e.clientY-t.clientY)<2?(bS+1)%3:1}function uL(t,e){let n=mS(t,e),r=nk(e),i=t.state.selection;return{update(s){s.docChanged&&(n.pos=s.changes.mapPos(n.pos),i=i.map(s.changes))},get(s,o,a){let l=mS(t,s),u,c=hS(t,l.pos,l.bias,r);if(n.pos!=l.pos&&!o){let f=hS(t,n.pos,n.bias,r),d=Math.min(f.from,c.from),h=Math.max(f.to,c.to);c=d1&&(u=cL(i,l.pos))?u:a?i.addRange(c):Y.create([c])}}}function cL(t,e){for(let n=0;n=e)return Y.create(t.ranges.slice(0,n).concat(t.ranges.slice(n+1)),t.mainIndex==n?0:t.mainIndex-(t.mainIndex>n?1:0))}return null}ci.dragstart=(t,e)=>{let{selection:{main:n}}=t.state;if(e.target.draggable){let i=t.docView.nearest(e.target);if(i&&i.isWidget){let s=i.posAtStart,o=s+i.length;(s>=n.to||o<=n.from)&&(n=Y.range(s,o))}}let{inputState:r}=t;return r.mouseSelection&&(r.mouseSelection.dragging=!0),r.draggedContent=n,e.dataTransfer&&(e.dataTransfer.setData("Text",K0(t.state,xv,t.state.sliceDoc(n.from,n.to))),e.dataTransfer.effectAllowed="copyMove"),!1};ci.dragend=t=>(t.inputState.draggedContent=null,!1);function vS(t,e,n,r){if(n=K0(t.state,vv,n),!n)return;let i=t.posAtCoords({x:e.clientX,y:e.clientY},!1),{draggedContent:s}=t.inputState,o=r&&s&&rL(t,e)?{from:s.from,to:s.to}:null,a={from:i,insert:n},l=t.state.changes(o?[o,a]:a);t.focus(),t.dispatch({changes:l,selection:{anchor:l.mapPos(i,-1),head:l.mapPos(i,1)},userEvent:o?"move.drop":"input.drop"}),t.inputState.draggedContent=null}ci.drop=(t,e)=>{if(!e.dataTransfer)return!1;if(t.state.readOnly)return!0;let n=e.dataTransfer.files;if(n&&n.length){let r=Array(n.length),i=0,s=()=>{++i==n.length&&vS(t,e,r.filter(o=>o!=null).join(t.state.lineBreak),!1)};for(let o=0;o{/[\x00-\x08\x0e-\x1f]{2}/.test(a.result)||(r[o]=a.result),s()},a.readAsText(n[o])}return!0}else{let r=e.dataTransfer.getData("Text");if(r)return vS(t,e,r,!0),!0}return!1};ci.paste=(t,e)=>{if(t.state.readOnly)return!0;t.observer.flush();let n=ek?null:e.clipboardData;return n?(tk(t,n.getData("text/plain")||n.getData("text/uri-list")),!0):(oL(t),!1)};function fL(t,e){let n=t.dom.parentNode;if(!n)return;let r=n.appendChild(document.createElement("textarea"));r.style.cssText="position: fixed; left: -10000px; top: 10px",r.value=e,r.focus(),r.selectionEnd=e.length,r.selectionStart=0,setTimeout(()=>{r.remove(),t.focus()},50)}function dL(t){let e=[],n=[],r=!1;for(let i of t.selection.ranges)i.empty||(e.push(t.sliceDoc(i.from,i.to)),n.push(i));if(!e.length){let i=-1;for(let{from:s}of t.selection.ranges){let o=t.doc.lineAt(s);o.number>i&&(e.push(o.text),n.push({from:o.from,to:Math.min(t.doc.length,o.to+1)})),i=o.number}r=!0}return{text:K0(t,xv,e.join(t.lineBreak)),ranges:n,linewise:r}}let Ob=null;ci.copy=ci.cut=(t,e)=>{let{text:n,ranges:r,linewise:i}=dL(t.state);if(!n&&!i)return!1;Ob=i?n:null,e.type=="cut"&&!t.state.readOnly&&t.dispatch({changes:r,scrollIntoView:!0,userEvent:"delete.cut"});let s=ek?null:e.clipboardData;return s?(s.clearData(),s.setData("text/plain",n),!0):(fL(t,n),!1)};const rk=As.define();function ik(t,e){let n=[];for(let r of t.facet(LD)){let i=r(t,e);i&&n.push(i)}return n.length?t.update({effects:n,annotations:rk.of(!0)}):null}function sk(t){setTimeout(()=>{let e=t.hasFocus;if(e!=t.inputState.notifiedFocused){let n=ik(t.state,e);n?t.dispatch(n):t.update([])}},10)}qr.focus=t=>{t.inputState.lastFocusTime=Date.now(),!t.scrollDOM.scrollTop&&(t.inputState.lastScrollTop||t.inputState.lastScrollLeft)&&(t.scrollDOM.scrollTop=t.inputState.lastScrollTop,t.scrollDOM.scrollLeft=t.inputState.lastScrollLeft),sk(t)};qr.blur=t=>{t.observer.clearSelectionRange(),sk(t)};qr.compositionstart=qr.compositionupdate=t=>{t.observer.editContext||(t.inputState.compositionFirstChange==null&&(t.inputState.compositionFirstChange=!0),t.inputState.composing<0&&(t.inputState.composing=0))};qr.compositionend=t=>{t.observer.editContext||(t.inputState.composing=-1,t.inputState.compositionEndedAt=Date.now(),t.inputState.compositionPendingKey=!0,t.inputState.compositionPendingChange=t.observer.pendingRecords().length>0,t.inputState.compositionFirstChange=null,ue.chrome&&ue.android?t.observer.flushSoon():t.inputState.compositionPendingChange?Promise.resolve().then(()=>t.observer.flush()):setTimeout(()=>{t.inputState.composing<0&&t.docView.hasComposition&&t.update([])},50))};qr.contextmenu=t=>{t.inputState.lastContextMenu=Date.now()};ci.beforeinput=(t,e)=>{var n,r;if(e.inputType=="insertReplacementText"&&t.observer.editContext){let s=(n=e.dataTransfer)===null||n===void 0?void 0:n.getData("text/plain"),o=e.getTargetRanges();if(s&&o.length){let a=o[0],l=t.posAtDOM(a.startContainer,a.startOffset),u=t.posAtDOM(a.endContainer,a.endOffset);return wv(t,{from:l,to:u,insert:t.state.toText(s)},null),!0}}let i;if(ue.chrome&&ue.android&&(i=ZD.find(s=>s.inputType==e.inputType))&&(t.observer.delayAndroidKey(i.key,i.keyCode),i.key=="Backspace"||i.key=="Delete")){let s=((r=window.visualViewport)===null||r===void 0?void 0:r.height)||0;setTimeout(()=>{var o;(((o=window.visualViewport)===null||o===void 0?void 0:o.height)||0)>s+10&&t.hasFocus&&(t.contentDOM.blur(),t.focus())},100)}return ue.ios&&e.inputType=="deleteContentForward"&&t.observer.flushSoon(),ue.safari&&e.inputType=="insertText"&&t.inputState.composing>=0&&setTimeout(()=>qr.compositionend(t,e),20),!1};const xS=new Set;function hL(t){xS.has(t)||(xS.add(t),t.addEventListener("copy",()=>{}),t.addEventListener("cut",()=>{}))}const SS=["pre-wrap","normal","pre-line","break-spaces"];let Il=!1;function ES(){Il=!1}class pL{constructor(e){this.lineWrapping=e,this.doc=Ze.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30}heightForGap(e,n){let r=this.doc.lineAt(n).number-this.doc.lineAt(e).number+1;return this.lineWrapping&&(r+=Math.max(0,Math.ceil((n-e-r*this.lineLength*.5)/this.lineLength))),this.lineHeight*r}heightForLine(e){return this.lineWrapping?(1+Math.max(0,Math.ceil((e-this.lineLength)/Math.max(1,this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(e){return this.doc=e,this}mustRefreshForWrapping(e){return SS.indexOf(e)>-1!=this.lineWrapping}mustRefreshForHeights(e){let n=!1;for(let r=0;r-1,l=Math.round(n)!=Math.round(this.lineHeight)||this.lineWrapping!=a;if(this.lineWrapping=a,this.lineHeight=n,this.charWidth=r,this.textHeight=i,this.lineLength=s,l){this.heightSamples={};for(let u=0;u0}set outdated(e){this.flags=(e?2:0)|this.flags&-3}setHeight(e){this.height!=e&&(Math.abs(this.height-e)>kh&&(Il=!0),this.height=e)}replace(e,n,r){return Xn.of(r)}decomposeLeft(e,n){n.push(this)}decomposeRight(e,n){n.push(this)}applyChanges(e,n,r,i){let s=this,o=r.doc;for(let a=i.length-1;a>=0;a--){let{fromA:l,toA:u,fromB:c,toB:f}=i[a],d=s.lineAt(l,vt.ByPosNoHeight,r.setDoc(n),0,0),h=d.to>=u?d:s.lineAt(u,vt.ByPosNoHeight,r,0,0);for(f+=h.to-u,u=h.to;a>0&&d.from<=i[a-1].toA;)l=i[a-1].fromA,c=i[a-1].fromB,a--,ls*2){let a=e[n-1];a.break?e.splice(--n,1,a.left,null,a.right):e.splice(--n,1,a.left,a.right),r+=1+a.break,i-=a.size}else if(s>i*2){let a=e[r];a.break?e.splice(r,1,a.left,null,a.right):e.splice(r,1,a.left,a.right),r+=2+a.break,s-=a.size}else break;else if(i=s&&o(this.blockAt(0,r,i,s))}updateHeight(e,n=0,r=!1,i){return i&&i.from<=n&&i.more&&this.setHeight(i.heights[i.index++]),this.outdated=!1,this}toString(){return`block(${this.length})`}}class Sr extends ok{constructor(e,n){super(e,n,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0}blockAt(e,n,r,i){return new ki(i,this.length,r,this.height,this.breaks)}replace(e,n,r){let i=r[0];return r.length==1&&(i instanceof Sr||i instanceof xn&&i.flags&4)&&Math.abs(this.length-i.length)<10?(i instanceof xn?i=new Sr(i.length,this.height):i.height=this.height,this.outdated||(i.outdated=!1),i):Xn.of(r)}updateHeight(e,n=0,r=!1,i){return i&&i.from<=n&&i.more?this.setHeight(i.heights[i.index++]):(r||this.outdated)&&this.setHeight(Math.max(this.widgetHeight,e.heightForLine(this.length-this.collapsed))+this.breaks*e.lineHeight),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:""}${this.widgetHeight?":"+this.widgetHeight:""})`}}class xn extends Xn{constructor(e){super(e,0)}heightMetrics(e,n){let r=e.doc.lineAt(n).number,i=e.doc.lineAt(n+this.length).number,s=i-r+1,o,a=0;if(e.lineWrapping){let l=Math.min(this.height,e.lineHeight*s);o=l/s,this.length>s+1&&(a=(this.height-l)/(this.length-s-1))}else o=this.height/s;return{firstLine:r,lastLine:i,perLine:o,perChar:a}}blockAt(e,n,r,i){let{firstLine:s,lastLine:o,perLine:a,perChar:l}=this.heightMetrics(n,i);if(n.lineWrapping){let u=i+(e0){let s=r[r.length-1];s instanceof xn?r[r.length-1]=new xn(s.length+i):r.push(null,new xn(i-1))}if(e>0){let s=r[0];s instanceof xn?r[0]=new xn(e+s.length):r.unshift(new xn(e-1),null)}return Xn.of(r)}decomposeLeft(e,n){n.push(new xn(e-1),null)}decomposeRight(e,n){n.push(null,new xn(this.length-e-1))}updateHeight(e,n=0,r=!1,i){let s=n+this.length;if(i&&i.from<=n+this.length&&i.more){let o=[],a=Math.max(n,i.from),l=-1;for(i.from>n&&o.push(new xn(i.from-n-1).updateHeight(e,n));a<=s&&i.more;){let c=e.doc.lineAt(a).length;o.length&&o.push(null);let f=i.heights[i.index++];l==-1?l=f:Math.abs(f-l)>=kh&&(l=-2);let d=new Sr(c,f);d.outdated=!1,o.push(d),a+=c+1}a<=s&&o.push(null,new xn(s-a).updateHeight(e,a));let u=Xn.of(o);return(l<0||Math.abs(u.height-this.height)>=kh||Math.abs(l-this.heightMetrics(e,n).perLine)>=kh)&&(Il=!0),xp(this,u)}else(r||this.outdated)&&(this.setHeight(e.heightForGap(n,n+this.length)),this.outdated=!1);return this}toString(){return`gap(${this.length})`}}class gL extends Xn{constructor(e,n,r){super(e.length+n+r.length,e.height+r.height,n|(e.outdated||r.outdated?2:0)),this.left=e,this.right=r,this.size=e.size+r.size}get break(){return this.flags&1}blockAt(e,n,r,i){let s=r+this.left.height;return ea))return u;let c=n==vt.ByPosNoHeight?vt.ByPosNoHeight:vt.ByPos;return l?u.join(this.right.lineAt(a,c,r,o,a)):this.left.lineAt(a,c,r,i,s).join(u)}forEachLine(e,n,r,i,s,o){let a=i+this.left.height,l=s+this.left.length+this.break;if(this.break)e=l&&this.right.forEachLine(e,n,r,a,l,o);else{let u=this.lineAt(l,vt.ByPos,r,i,s);e=e&&u.from<=n&&o(u),n>u.to&&this.right.forEachLine(u.to+1,n,r,a,l,o)}}replace(e,n,r){let i=this.left.length+this.break;if(nthis.left.length)return this.balanced(this.left,this.right.replace(e-i,n-i,r));let s=[];e>0&&this.decomposeLeft(e,s);let o=s.length;for(let a of r)s.push(a);if(e>0&&wS(s,o-1),n=r&&n.push(null)),e>r&&this.right.decomposeLeft(e-r,n)}decomposeRight(e,n){let r=this.left.length,i=r+this.break;if(e>=i)return this.right.decomposeRight(e-i,n);e2*n.size||n.size>2*e.size?Xn.of(this.break?[e,null,n]:[e,n]):(this.left=xp(this.left,e),this.right=xp(this.right,n),this.setHeight(e.height+n.height),this.outdated=e.outdated||n.outdated,this.size=e.size+n.size,this.length=e.length+this.break+n.length,this)}updateHeight(e,n=0,r=!1,i){let{left:s,right:o}=this,a=n+s.length+this.break,l=null;return i&&i.from<=n+s.length&&i.more?l=s=s.updateHeight(e,n,r,i):s.updateHeight(e,n,r),i&&i.from<=a+o.length&&i.more?l=o=o.updateHeight(e,a,r,i):o.updateHeight(e,a,r),l?this.balanced(s,o):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function wS(t,e){let n,r;t[e]==null&&(n=t[e-1])instanceof xn&&(r=t[e+1])instanceof xn&&t.splice(e-1,3,new xn(n.length+1+r.length))}const bL=5;class _v{constructor(e,n){this.pos=e,this.oracle=n,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=e}get isCovered(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}span(e,n){if(this.lineStart>-1){let r=Math.min(n,this.lineEnd),i=this.nodes[this.nodes.length-1];i instanceof Sr?i.length+=r-this.pos:(r>this.pos||!this.isCovered)&&this.nodes.push(new Sr(r-this.pos,-1)),this.writtenTo=r,n>r&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=n}point(e,n,r){if(e=bL)&&this.addLineDeco(i,s,o)}else n>e&&this.span(e,n);this.lineEnd>-1&&this.lineEnd-1)return;let{from:e,to:n}=this.oracle.doc.lineAt(this.pos);this.lineStart=e,this.lineEnd=n,this.writtenToe&&this.nodes.push(new Sr(this.pos-e,-1)),this.writtenTo=this.pos}blankContent(e,n){let r=new xn(n-e);return this.oracle.doc.lineAt(e).to==n&&(r.flags|=4),r}ensureLine(){this.enterLine();let e=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(e instanceof Sr)return e;let n=new Sr(0,-1);return this.nodes.push(n),n}addBlock(e){this.enterLine();let n=e.deco;n&&n.startSide>0&&!this.isCovered&&this.ensureLine(),this.nodes.push(e),this.writtenTo=this.pos=this.pos+e.length,n&&n.endSide>0&&(this.covering=e)}addLineDeco(e,n,r){let i=this.ensureLine();i.length+=r,i.collapsed+=r,i.widgetHeight=Math.max(i.widgetHeight,e),i.breaks+=n,this.writtenTo=this.pos=this.pos+r}finish(e){let n=this.nodes.length==0?null:this.nodes[this.nodes.length-1];this.lineStart>-1&&!(n instanceof Sr)&&!this.isCovered?this.nodes.push(new Sr(0,-1)):(this.writtenToc.clientHeight||c.scrollWidth>c.clientWidth)&&f.overflow!="visible"){let d=c.getBoundingClientRect();s=Math.max(s,d.left),o=Math.min(o,d.right),a=Math.max(a,d.top),l=Math.min(u==t.parentNode?i.innerHeight:l,d.bottom)}u=f.position=="absolute"||f.position=="fixed"?c.offsetParent:c.parentNode}else if(u.nodeType==11)u=u.host;else break;return{left:s-n.left,right:Math.max(s,o)-n.left,top:a-(n.top+e),bottom:Math.max(a,l)-(n.top+e)}}function SL(t){let e=t.getBoundingClientRect(),n=t.ownerDocument.defaultView||window;return e.left0&&e.top0}function EL(t,e){let n=t.getBoundingClientRect();return{left:0,right:n.right-n.left,top:e,bottom:n.bottom-(n.top+e)}}class yg{constructor(e,n,r,i){this.from=e,this.to=n,this.size=r,this.displaySize=i}static same(e,n){if(e.length!=n.length)return!1;for(let r=0;rtypeof r!="function"&&r.class=="cm-lineWrapping");this.heightOracle=new pL(n),this.stateDeco=e.facet(Bc).filter(r=>typeof r!="function"),this.heightMap=Xn.empty().applyChanges(this.stateDeco,Ze.empty,this.heightOracle.setDoc(e.doc),[new jr(0,0,0,e.doc.length)]);for(let r=0;r<2&&(this.viewport=this.getViewport(0,null),!!this.updateForViewport());r++);this.updateViewportLines(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=ve.set(this.lineGaps.map(r=>r.draw(this,!1))),this.computeVisibleRanges()}updateForViewport(){let e=[this.viewport],{main:n}=this.state.selection;for(let r=0;r<=1;r++){let i=r?n.head:n.anchor;if(!e.some(({from:s,to:o})=>i>=s&&i<=o)){let{from:s,to:o}=this.lineBlockAt(i);e.push(new Dd(s,o))}}return this.viewports=e.sort((r,i)=>r.from-i.from),this.updateScaler()}updateScaler(){let e=this.scaler;return this.scaler=this.heightMap.height<=7e6?CS:new Cv(this.heightOracle,this.heightMap,this.viewports),e.eq(this.scaler)?0:2}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.heightOracle.setDoc(this.state.doc),0,0,e=>{this.viewportLines.push(Xu(e,this.scaler))})}update(e,n=null){this.state=e.state;let r=this.stateDeco;this.stateDeco=this.state.facet(Bc).filter(c=>typeof c!="function");let i=e.changedRanges,s=jr.extendWithRanges(i,yL(r,this.stateDeco,e?e.changes:sn.empty(this.state.doc.length))),o=this.heightMap.height,a=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollTop);ES(),this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),s),(this.heightMap.height!=o||Il)&&(e.flags|=2),a?(this.scrollAnchorPos=e.changes.mapPos(a.from,-1),this.scrollAnchorHeight=a.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=o);let l=s.length?this.mapViewport(this.viewport,e.changes):this.viewport;(n&&(n.range.headl.to)||!this.viewportIsAppropriate(l))&&(l=this.getViewport(0,n));let u=l.from!=this.viewport.from||l.to!=this.viewport.to;this.viewport=l,e.flags|=this.updateForViewport(),(u||!e.changes.empty||e.flags&2)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,e.changes))),e.flags|=this.computeVisibleRanges(e.changes),n&&(this.scrollTarget=n),!this.mustEnforceCursorAssoc&&e.selectionSet&&e.view.lineWrapping&&e.state.selection.main.empty&&e.state.selection.main.assoc&&!e.state.facet($D)&&(this.mustEnforceCursorAssoc=!0)}measure(e){let n=e.contentDOM,r=window.getComputedStyle(n),i=this.heightOracle,s=r.whiteSpace;this.defaultTextDirection=r.direction=="rtl"?Et.RTL:Et.LTR;let o=this.heightOracle.mustRefreshForWrapping(s),a=n.getBoundingClientRect(),l=o||this.mustMeasureContent||this.contentDOMHeight!=a.height;this.contentDOMHeight=a.height,this.mustMeasureContent=!1;let u=0,c=0;if(a.width&&a.height){let{scaleX:S,scaleY:E}=pD(n,a);(S>.005&&Math.abs(this.scaleX-S)>.005||E>.005&&Math.abs(this.scaleY-E)>.005)&&(this.scaleX=S,this.scaleY=E,u|=16,o=l=!0)}let f=(parseInt(r.paddingTop)||0)*this.scaleY,d=(parseInt(r.paddingBottom)||0)*this.scaleY;(this.paddingTop!=f||this.paddingBottom!=d)&&(this.paddingTop=f,this.paddingBottom=d,u|=18),this.editorWidth!=e.scrollDOM.clientWidth&&(i.lineWrapping&&(l=!0),this.editorWidth=e.scrollDOM.clientWidth,u|=16);let h=e.scrollDOM.scrollTop*this.scaleY;this.scrollTop!=h&&(this.scrollAnchorHeight=-1,this.scrollTop=h),this.scrolledToBottom=bD(e.scrollDOM);let p=(this.printing?EL:xL)(n,this.paddingTop),m=p.top-this.pixelViewport.top,g=p.bottom-this.pixelViewport.bottom;this.pixelViewport=p;let b=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(b!=this.inView&&(this.inView=b,b&&(l=!0)),!this.inView&&!this.scrollTarget&&!SL(e.dom))return 0;let y=a.width;if((this.contentDOMWidth!=y||this.editorHeight!=e.scrollDOM.clientHeight)&&(this.contentDOMWidth=a.width,this.editorHeight=e.scrollDOM.clientHeight,u|=16),l){let S=e.docView.measureVisibleLineHeights(this.viewport);if(i.mustRefreshForHeights(S)&&(o=!0),o||i.lineWrapping&&Math.abs(y-this.contentDOMWidth)>i.charWidth){let{lineHeight:E,charWidth:C,textHeight:w}=e.docView.measureTextSize();o=E>0&&i.refresh(s,E,C,w,Math.max(5,y/C),S),o&&(e.docView.minWidth=0,u|=16)}m>0&&g>0?c=Math.max(m,g):m<0&&g<0&&(c=Math.min(m,g)),ES();for(let E of this.viewports){let C=E.from==this.viewport.from?S:e.docView.measureVisibleLineHeights(E);this.heightMap=(o?Xn.empty().applyChanges(this.stateDeco,Ze.empty,this.heightOracle,[new jr(0,0,0,e.state.doc.length)]):this.heightMap).updateHeight(i,0,o,new mL(E.from,C))}Il&&(u|=2)}let x=!this.viewportIsAppropriate(this.viewport,c)||this.scrollTarget&&(this.scrollTarget.range.headthis.viewport.to);return x&&(u&2&&(u|=this.updateScaler()),this.viewport=this.getViewport(c,this.scrollTarget),u|=this.updateForViewport()),(u&2||x)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(o?[]:this.lineGaps,e)),u|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,e.docView.enforceCursorAssoc()),u}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(e,n){let r=.5-Math.max(-.5,Math.min(.5,e/1e3/2)),i=this.heightMap,s=this.heightOracle,{visibleTop:o,visibleBottom:a}=this,l=new Dd(i.lineAt(o-r*1e3,vt.ByHeight,s,0,0).from,i.lineAt(a+(1-r)*1e3,vt.ByHeight,s,0,0).to);if(n){let{head:u}=n.range;if(ul.to){let c=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),f=i.lineAt(u,vt.ByPos,s,0,0),d;n.y=="center"?d=(f.top+f.bottom)/2-c/2:n.y=="start"||n.y=="nearest"&&u=a+Math.max(10,Math.min(r,250)))&&i>o-2*1e3&&s>1,o=i<<1;if(this.defaultTextDirection!=Et.LTR&&!r)return[];let a=[],l=(c,f,d,h)=>{if(f-cc&&bb.from>=d.from&&b.to<=d.to&&Math.abs(b.from-c)b.fromy));if(!g){if(fx.from<=f&&x.to>=f)){let x=n.moveToLineBoundary(Y.cursor(f),!1,!0).head;x>c&&(f=x)}let b=this.gapSize(d,c,f,h),y=r||b<2e6?b:2e6;g=new yg(c,f,b,y)}a.push(g)},u=c=>{if(c.length2e6)for(let C of e)C.from>=c.from&&C.fromc.from&&l(c.from,h,c,f),pn.draw(this,this.heightOracle.lineWrapping))))}computeVisibleRanges(e){let n=this.stateDeco;this.lineGaps.length&&(n=n.concat(this.lineGapDeco));let r=[];Xe.spans(n,this.viewport.from,this.viewport.to,{span(s,o){r.push({from:s,to:o})},point(){}},20);let i=0;if(r.length!=this.visibleRanges.length)i=12;else for(let s=0;s=this.viewport.from&&e<=this.viewport.to&&this.viewportLines.find(n=>n.from<=e&&n.to>=e)||Xu(this.heightMap.lineAt(e,vt.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(e){return e>=this.viewportLines[0].top&&e<=this.viewportLines[this.viewportLines.length-1].bottom&&this.viewportLines.find(n=>n.top<=e&&n.bottom>=e)||Xu(this.heightMap.lineAt(this.scaler.fromDOM(e),vt.ByHeight,this.heightOracle,0,0),this.scaler)}scrollAnchorAt(e){let n=this.lineBlockAtHeight(e+8);return n.from>=this.viewport.from||this.viewportLines[0].top-e>200?n:this.viewportLines[0]}elementAtHeight(e){return Xu(this.heightMap.blockAt(this.scaler.fromDOM(e),this.heightOracle,0,0),this.scaler)}get docHeight(){return this.scaler.toDOM(this.heightMap.height)}get contentHeight(){return this.docHeight+this.paddingTop+this.paddingBottom}}class Dd{constructor(e,n){this.from=e,this.to=n}}function _L(t,e,n){let r=[],i=t,s=0;return Xe.spans(n,t,e,{span(){},point(o,a){o>i&&(r.push({from:i,to:o}),s+=o-i),i=a}},20),i=1)return e[e.length-1].to;let r=Math.floor(t*n);for(let i=0;;i++){let{from:s,to:o}=e[i],a=o-s;if(r<=a)return s+r;r-=a}}function Od(t,e){let n=0;for(let{from:r,to:i}of t.ranges){if(e<=i){n+=e-r;break}n+=i-r}return n/t.total}function CL(t,e){for(let n of t)if(e(n))return n}const CS={toDOM(t){return t},fromDOM(t){return t},scale:1,eq(t){return t==this}};class Cv{constructor(e,n,r){let i=0,s=0,o=0;this.viewports=r.map(({from:a,to:l})=>{let u=n.lineAt(a,vt.ByPos,e,0,0).top,c=n.lineAt(l,vt.ByPos,e,0,0).bottom;return i+=c-u,{from:a,to:l,top:u,bottom:c,domTop:0,domBottom:0}}),this.scale=(7e6-i)/(n.height-i);for(let a of this.viewports)a.domTop=o+(a.top-s)*this.scale,o=a.domBottom=a.domTop+(a.bottom-a.top),s=a.bottom}toDOM(e){for(let n=0,r=0,i=0;;n++){let s=nn.from==e.viewports[r].from&&n.to==e.viewports[r].to):!1}}function Xu(t,e){if(e.scale==1)return t;let n=e.toDOM(t.top),r=e.toDOM(t.bottom);return new ki(t.from,t.length,n,r-n,Array.isArray(t._content)?t._content.map(i=>Xu(i,e)):t._content)}const Td=he.define({combine:t=>t.join(" ")}),Tb=he.define({combine:t=>t.indexOf(!0)>-1}),Ib=po.newName(),ak=po.newName(),lk=po.newName(),uk={"&light":"."+ak,"&dark":"."+lk};function Pb(t,e,n){return new po(e,{finish(r){return/&/.test(r)?r.replace(/&\w*/,i=>{if(i=="&")return t;if(!n||!n[i])throw new RangeError(`Unsupported selector: ${i}`);return n[i]}):t+" "+r}})}const AL=Pb("."+Ib,{"&":{position:"relative !important",boxSizing:"border-box","&.cm-focused":{outline:"1px dotted #212121"},display:"flex !important",flexDirection:"column"},".cm-scroller":{display:"flex !important",alignItems:"flex-start !important",fontFamily:"monospace",lineHeight:1.4,height:"100%",overflowX:"auto",position:"relative",zIndex:0,overflowAnchor:"none"},".cm-content":{margin:0,flexGrow:2,flexShrink:0,display:"block",whiteSpace:"pre",wordWrap:"normal",boxSizing:"border-box",minHeight:"100%",padding:"4px 0",outline:"none","&[contenteditable=true]":{WebkitUserModify:"read-write-plaintext-only"}},".cm-lineWrapping":{whiteSpace_fallback:"pre-wrap",whiteSpace:"break-spaces",wordBreak:"break-word",overflowWrap:"anywhere",flexShrink:1},"&light .cm-content":{caretColor:"black"},"&dark .cm-content":{caretColor:"white"},".cm-line":{display:"block",padding:"0 2px 0 6px"},".cm-layer":{position:"absolute",left:0,top:0,contain:"size style","& > *":{position:"absolute"}},"&light .cm-selectionBackground":{background:"#d9d9d9"},"&dark .cm-selectionBackground":{background:"#222"},"&light.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#d7d4f0"},"&dark.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#233"},".cm-cursorLayer":{pointerEvents:"none"},"&.cm-focused > .cm-scroller > .cm-cursorLayer":{animation:"steps(1) cm-blink 1.2s infinite"},"@keyframes cm-blink":{"0%":{},"50%":{opacity:0},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{opacity:0},"100%":{}},".cm-cursor, .cm-dropCursor":{borderLeft:"1.2px solid black",marginLeft:"-0.6px",pointerEvents:"none"},".cm-cursor":{display:"none"},"&dark .cm-cursor":{borderLeftColor:"#ddd"},".cm-dropCursor":{position:"absolute"},"&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor":{display:"block"},".cm-iso":{unicodeBidi:"isolate"},".cm-announced":{position:"fixed",top:"-10000px"},"@media print":{".cm-announced":{display:"none"}},"&light .cm-activeLine":{backgroundColor:"#cceeff44"},"&dark .cm-activeLine":{backgroundColor:"#99eeff33"},"&light .cm-specialChar":{color:"red"},"&dark .cm-specialChar":{color:"#f78"},".cm-gutters":{flexShrink:0,display:"flex",height:"100%",boxSizing:"border-box",zIndex:200},".cm-gutters-before":{insetInlineStart:0},".cm-gutters-after":{insetInlineEnd:0},"&light .cm-gutters":{backgroundColor:"#f5f5f5",color:"#6c6c6c",border:"0px solid #ddd","&.cm-gutters-before":{borderRightWidth:"1px"},"&.cm-gutters-after":{borderLeftWidth:"1px"}},"&dark .cm-gutters":{backgroundColor:"#333338",color:"#ccc"},".cm-gutter":{display:"flex !important",flexDirection:"column",flexShrink:0,boxSizing:"border-box",minHeight:"100%",overflow:"hidden"},".cm-gutterElement":{boxSizing:"border-box"},".cm-lineNumbers .cm-gutterElement":{padding:"0 3px 0 5px",minWidth:"20px",textAlign:"right",whiteSpace:"nowrap"},"&light .cm-activeLineGutter":{backgroundColor:"#e2f2ff"},"&dark .cm-activeLineGutter":{backgroundColor:"#222227"},".cm-panels":{boxSizing:"border-box",position:"sticky",left:0,right:0,zIndex:300},"&light .cm-panels":{backgroundColor:"#f5f5f5",color:"black"},"&light .cm-panels-top":{borderBottom:"1px solid #ddd"},"&light .cm-panels-bottom":{borderTop:"1px solid #ddd"},"&dark .cm-panels":{backgroundColor:"#333338",color:"white"},".cm-dialog":{padding:"2px 19px 4px 6px",position:"relative","& label":{fontSize:"80%"}},".cm-dialog-close":{position:"absolute",top:"3px",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",fontSize:"14px",padding:"0"},".cm-tab":{display:"inline-block",overflow:"hidden",verticalAlign:"bottom"},".cm-widgetBuffer":{verticalAlign:"text-top",height:"1em",width:0,display:"inline"},".cm-placeholder":{color:"#888",display:"inline-block",verticalAlign:"top",userSelect:"none"},".cm-highlightSpace":{backgroundImage:"radial-gradient(circle at 50% 55%, #aaa 20%, transparent 5%)",backgroundPosition:"center"},".cm-highlightTab":{backgroundImage:`url('data:image/svg+xml,')`,backgroundSize:"auto 100%",backgroundPosition:"right 90%",backgroundRepeat:"no-repeat"},".cm-trailingSpace":{backgroundColor:"#ff332255"},".cm-button":{verticalAlign:"middle",color:"inherit",fontSize:"70%",padding:".2em 1em",borderRadius:"1px"},"&light .cm-button":{backgroundImage:"linear-gradient(#eff1f5, #d9d9df)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#b4b4b4, #d0d3d6)"}},"&dark .cm-button":{backgroundImage:"linear-gradient(#393939, #111)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#111, #333)"}},".cm-textfield":{verticalAlign:"middle",color:"inherit",fontSize:"70%",border:"1px solid silver",padding:".2em .5em"},"&light .cm-textfield":{backgroundColor:"white"},"&dark .cm-textfield":{border:"1px solid #555",backgroundColor:"inherit"}},uk),DL={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},vg=ue.ie&&ue.ie_version<=11;class kL{constructor(e){this.view=e,this.active=!1,this.editContext=null,this.selectionRange=new c9,this.selectionChanged=!1,this.delayedFlush=-1,this.resizeTimeout=-1,this.queue=[],this.delayedAndroidKey=null,this.flushingAndroidKey=-1,this.lastChange=0,this.scrollTargets=[],this.intersection=null,this.resizeScroll=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.printQuery=null,this.parentCheck=-1,this.dom=e.contentDOM,this.observer=new MutationObserver(n=>{for(let r of n)this.queue.push(r);(ue.ie&&ue.ie_version<=11||ue.ios&&e.composing)&&n.some(r=>r.type=="childList"&&r.removedNodes.length||r.type=="characterData"&&r.oldValue.length>r.target.nodeValue.length)?this.flushSoon():this.flush()}),window.EditContext&&ue.android&&e.constructor.EDIT_CONTEXT!==!1&&!(ue.chrome&&ue.chrome_version<126)&&(this.editContext=new TL(e),e.state.facet(ls)&&(e.contentDOM.editContext=this.editContext.editContext)),vg&&(this.onCharData=n=>{this.queue.push({target:n.target,type:"characterData",oldValue:n.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.onResize=this.onResize.bind(this),this.onPrint=this.onPrint.bind(this),this.onScroll=this.onScroll.bind(this),window.matchMedia&&(this.printQuery=window.matchMedia("print")),typeof ResizeObserver=="function"&&(this.resizeScroll=new ResizeObserver(()=>{var n;((n=this.view.docView)===null||n===void 0?void 0:n.lastUpdate){this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),n.length>0&&n[n.length-1].intersectionRatio>0!=this.intersecting&&(this.intersecting=!this.intersecting,this.intersecting!=this.view.inView&&this.onScrollChanged(document.createEvent("Event")))},{threshold:[0,.001]}),this.intersection.observe(this.dom),this.gapIntersection=new IntersectionObserver(n=>{n.length>0&&n[n.length-1].intersectionRatio>0&&this.onScrollChanged(document.createEvent("Event"))},{})),this.listenForScroll(),this.readSelectionRange()}onScrollChanged(e){this.view.inputState.runHandlers("scroll",e),this.intersecting&&this.view.measure()}onScroll(e){this.intersecting&&this.flush(!1),this.editContext&&this.view.requestMeasure(this.editContext.measureReq),this.onScrollChanged(e)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout(()=>{this.resizeTimeout=-1,this.view.requestMeasure()},50))}onPrint(e){(e.type=="change"||!e.type)&&!e.matches||(this.view.viewState.printing=!0,this.view.measure(),setTimeout(()=>{this.view.viewState.printing=!1,this.view.requestMeasure()},500))}updateGaps(e){if(this.gapIntersection&&(e.length!=this.gaps.length||this.gaps.some((n,r)=>n!=e[r]))){this.gapIntersection.disconnect();for(let n of e)this.gapIntersection.observe(n);this.gaps=e}}onSelectionChange(e){let n=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:r}=this,i=this.selectionRange;if(r.state.facet(ls)?r.root.activeElement!=this.dom:!Ah(this.dom,i))return;let s=i.anchorNode&&r.docView.nearest(i.anchorNode);if(s&&s.ignoreEvent(e)){n||(this.selectionChanged=!1);return}(ue.ie&&ue.ie_version<=11||ue.android&&ue.chrome)&&!r.state.selection.main.empty&&i.focusNode&&cc(i.focusNode,i.focusOffset,i.anchorNode,i.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,n=Lc(e.root);if(!n)return!1;let r=ue.safari&&e.root.nodeType==11&&e.root.activeElement==this.dom&&OL(this.view,n)||n;if(!r||this.selectionRange.eq(r))return!1;let i=Ah(this.dom,r);return i&&!this.selectionChanged&&e.inputState.lastFocusTime>Date.now()-200&&e.inputState.lastTouchTime{let s=this.delayedAndroidKey;s&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=s.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&s.force&&cl(this.dom,s.key,s.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(i)}(!this.delayedAndroidKey||e=="Enter")&&(this.delayedAndroidKey={key:e,keyCode:n,force:this.lastChange{this.delayedFlush=-1,this.flush()}))}forceFlush(){this.delayedFlush>=0&&(this.view.win.cancelAnimationFrame(this.delayedFlush),this.delayedFlush=-1),this.flush()}pendingRecords(){for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}processRecords(){let e=this.pendingRecords();e.length&&(this.queue=[]);let n=-1,r=-1,i=!1;for(let s of e){let o=this.readMutation(s);o&&(o.typeOver&&(i=!0),n==-1?{from:n,to:r}=o:(n=Math.min(o.from,n),r=Math.max(o.to,r)))}return{from:n,to:r,typeOver:i}}readChange(){let{from:e,to:n,typeOver:r}=this.processRecords(),i=this.selectionChanged&&Ah(this.dom,this.selectionRange);if(e<0&&!i)return null;e>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let s=new W9(this.view,e,n,r);return this.view.docView.domChanged={newSel:s.newSel?s.newSel.main:null},s}flush(e=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;e&&this.readSelectionRange();let n=this.readChange();if(!n)return this.view.requestMeasure(),!1;let r=this.view.state,i=YD(this.view,n);return this.view.state==r&&(n.domChanged||n.newSel&&!n.newSel.main.eq(this.view.state.selection.main))&&this.view.update([]),i}readMutation(e){let n=this.view.docView.nearest(e.target);if(!n||n.ignoreMutation(e))return null;if(n.markDirty(e.type=="attributes"),e.type=="attributes"&&(n.flags|=4),e.type=="childList"){let r=AS(n,e.previousSibling||e.target.previousSibling,-1),i=AS(n,e.nextSibling||e.target.nextSibling,1);return{from:r?n.posAfter(r):n.posAtStart,to:i?n.posBefore(i):n.posAtEnd,typeOver:!1}}else return e.type=="characterData"?{from:n.posAtStart,to:n.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}:null}setWindow(e){e!=this.win&&(this.removeWindowListeners(this.win),this.win=e,this.addWindowListeners(this.win))}addWindowListeners(e){e.addEventListener("resize",this.onResize),this.printQuery?this.printQuery.addEventListener?this.printQuery.addEventListener("change",this.onPrint):this.printQuery.addListener(this.onPrint):e.addEventListener("beforeprint",this.onPrint),e.addEventListener("scroll",this.onScroll),e.document.addEventListener("selectionchange",this.onSelectionChange)}removeWindowListeners(e){e.removeEventListener("scroll",this.onScroll),e.removeEventListener("resize",this.onResize),this.printQuery?this.printQuery.removeEventListener?this.printQuery.removeEventListener("change",this.onPrint):this.printQuery.removeListener(this.onPrint):e.removeEventListener("beforeprint",this.onPrint),e.document.removeEventListener("selectionchange",this.onSelectionChange)}update(e){this.editContext&&(this.editContext.update(e),e.startState.facet(ls)!=e.state.facet(ls)&&(e.view.contentDOM.editContext=e.state.facet(ls)?this.editContext.editContext:null))}destroy(){var e,n,r;this.stop(),(e=this.intersection)===null||e===void 0||e.disconnect(),(n=this.gapIntersection)===null||n===void 0||n.disconnect(),(r=this.resizeScroll)===null||r===void 0||r.disconnect();for(let i of this.scrollTargets)i.removeEventListener("scroll",this.onScroll);this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout),this.win.cancelAnimationFrame(this.delayedFlush),this.win.cancelAnimationFrame(this.flushingAndroidKey),this.editContext&&(this.view.contentDOM.editContext=null,this.editContext.destroy())}}function AS(t,e,n){for(;e;){let r=ut.get(e);if(r&&r.parent==t)return r;let i=e.parentNode;e=i!=t.dom?i:n>0?e.nextSibling:e.previousSibling}return null}function DS(t,e){let n=e.startContainer,r=e.startOffset,i=e.endContainer,s=e.endOffset,o=t.docView.domAtPos(t.state.selection.main.anchor);return cc(o.node,o.offset,i,s)&&([n,r,i,s]=[i,s,n,r]),{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:s}}function OL(t,e){if(e.getComposedRanges){let i=e.getComposedRanges(t.root)[0];if(i)return DS(t,i)}let n=null;function r(i){i.preventDefault(),i.stopImmediatePropagation(),n=i.getTargetRanges()[0]}return t.contentDOM.addEventListener("beforeinput",r,!0),t.dom.ownerDocument.execCommand("indent"),t.contentDOM.removeEventListener("beforeinput",r,!0),n?DS(t,n):null}class TL{constructor(e){this.from=0,this.to=0,this.pendingContextChange=null,this.handlers=Object.create(null),this.composing=null,this.resetRange(e.state);let n=this.editContext=new window.EditContext({text:e.state.doc.sliceString(this.from,this.to),selectionStart:this.toContextPos(Math.max(this.from,Math.min(this.to,e.state.selection.main.anchor))),selectionEnd:this.toContextPos(e.state.selection.main.head)});this.handlers.textupdate=r=>{let i=e.state.selection.main,{anchor:s,head:o}=i,a=this.toEditorPos(r.updateRangeStart),l=this.toEditorPos(r.updateRangeEnd);e.inputState.composing>=0&&!this.composing&&(this.composing={contextBase:r.updateRangeStart,editorBase:a,drifted:!1});let u=l-a>r.text.length;a==this.from&&sthis.to&&(l=s);let c=JD(e.state.sliceDoc(a,l),r.text,(u?i.from:i.to)-a,u?"end":null);if(!c){let d=Y.single(this.toEditorPos(r.selectionStart),this.toEditorPos(r.selectionEnd));d.main.eq(i)||e.dispatch({selection:d,userEvent:"select"});return}let f={from:c.from+a,to:c.toA+a,insert:Ze.of(r.text.slice(c.from,c.toB).split(` +`))};if((ue.mac||ue.android)&&f.from==o-1&&/^\. ?$/.test(r.text)&&e.contentDOM.getAttribute("autocorrect")=="off"&&(f={from:a,to:l,insert:Ze.of([r.text.replace("."," ")])}),this.pendingContextChange=f,!e.state.readOnly){let d=this.to-this.from+(f.to-f.from+f.insert.length);wv(e,f,Y.single(this.toEditorPos(r.selectionStart,d),this.toEditorPos(r.selectionEnd,d)))}this.pendingContextChange&&(this.revertPending(e.state),this.setSelection(e.state)),f.from=0&&!/[\\p{Alphabetic}\\p{Number}_]/.test(n.text.slice(Math.max(0,r.updateRangeStart-1),Math.min(n.text.length,r.updateRangeStart+1)))&&this.handlers.compositionend(r)},this.handlers.characterboundsupdate=r=>{let i=[],s=null;for(let o=this.toEditorPos(r.rangeStart),a=this.toEditorPos(r.rangeEnd);o{let i=[];for(let s of r.getTextFormats()){let o=s.underlineStyle,a=s.underlineThickness;if(!/none/i.test(o)&&!/none/i.test(a)){let l=this.toEditorPos(s.rangeStart),u=this.toEditorPos(s.rangeEnd);if(l{e.inputState.composing<0&&(e.inputState.composing=0,e.inputState.compositionFirstChange=!0)},this.handlers.compositionend=()=>{if(e.inputState.composing=-1,e.inputState.compositionFirstChange=null,this.composing){let{drifted:r}=this.composing;this.composing=null,r&&this.reset(e.state)}};for(let r in this.handlers)n.addEventListener(r,this.handlers[r]);this.measureReq={read:r=>{this.editContext.updateControlBounds(r.contentDOM.getBoundingClientRect());let i=Lc(r.root);i&&i.rangeCount&&this.editContext.updateSelectionBounds(i.getRangeAt(0).getBoundingClientRect())}}}applyEdits(e){let n=0,r=!1,i=this.pendingContextChange;return e.changes.iterChanges((s,o,a,l,u)=>{if(r)return;let c=u.length-(o-s);if(i&&o>=i.to)if(i.from==s&&i.to==o&&i.insert.eq(u)){i=this.pendingContextChange=null,n+=c,this.to+=c;return}else i=null,this.revertPending(e.state);if(s+=n,o+=n,o<=this.from)this.from+=c,this.to+=c;else if(sthis.to||this.to-this.from+u.length>3e4){r=!0;return}this.editContext.updateText(this.toContextPos(s),this.toContextPos(o),u.toString()),this.to+=c}n+=c}),i&&!r&&this.revertPending(e.state),!r}update(e){let n=this.pendingContextChange,r=e.startState.selection.main;this.composing&&(this.composing.drifted||!e.changes.touchesRange(r.from,r.to)&&e.transactions.some(i=>!i.isUserEvent("input.type")&&i.changes.touchesRange(this.from,this.to)))?(this.composing.drifted=!0,this.composing.editorBase=e.changes.mapPos(this.composing.editorBase)):!this.applyEdits(e)||!this.rangeIsValid(e.state)?(this.pendingContextChange=null,this.reset(e.state)):(e.docChanged||e.selectionSet||n)&&this.setSelection(e.state),(e.geometryChanged||e.docChanged||e.selectionSet)&&e.view.requestMeasure(this.measureReq)}resetRange(e){let{head:n}=e.selection.main;this.from=Math.max(0,n-1e4),this.to=Math.min(e.doc.length,n+1e4)}reset(e){this.resetRange(e),this.editContext.updateText(0,this.editContext.text.length,e.doc.sliceString(this.from,this.to)),this.setSelection(e)}revertPending(e){let n=this.pendingContextChange;this.pendingContextChange=null,this.editContext.updateText(this.toContextPos(n.from),this.toContextPos(n.from+n.insert.length),e.doc.sliceString(n.from,n.to))}setSelection(e){let{main:n}=e.selection,r=this.toContextPos(Math.max(this.from,Math.min(this.to,n.anchor))),i=this.toContextPos(n.head);(this.editContext.selectionStart!=r||this.editContext.selectionEnd!=i)&&this.editContext.updateSelection(r,i)}rangeIsValid(e){let{head:n}=e.selection.main;return!(this.from>0&&n-this.from<500||this.to1e4*3)}toEditorPos(e,n=this.to-this.from){e=Math.min(e,n);let r=this.composing;return r&&r.drifted?r.editorBase+(e-r.contextBase):e+this.from}toContextPos(e){let n=this.composing;return n&&n.drifted?n.contextBase+(e-n.editorBase):e-this.from}destroy(){for(let e in this.handlers)this.editContext.removeEventListener(e,this.handlers[e])}}class ce{get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return!!this.inputState&&this.inputState.composing>0}get compositionStarted(){return!!this.inputState&&this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(e={}){var n;this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.contentDOM=document.createElement("div"),this.scrollDOM=document.createElement("div"),this.scrollDOM.tabIndex=-1,this.scrollDOM.className="cm-scroller",this.scrollDOM.appendChild(this.contentDOM),this.announceDOM=document.createElement("div"),this.announceDOM.className="cm-announced",this.announceDOM.setAttribute("aria-live","polite"),this.dom=document.createElement("div"),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),e.parent&&e.parent.appendChild(this.dom);let{dispatch:r}=e;this.dispatchTransactions=e.dispatchTransactions||r&&(i=>i.forEach(s=>r(s,this)))||(i=>this.update(i)),this.dispatch=this.dispatch.bind(this),this._root=e.root||f9(e.parent)||document,this.viewState=new _S(e.state||Ue.create(e)),e.scrollTo&&e.scrollTo.is(_d)&&(this.viewState.scrollTarget=e.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(Qa).map(i=>new mg(i));for(let i of this.plugins)i.update(this);this.observer=new kL(this),this.inputState=new J9(this),this.inputState.ensureHandlers(this.plugins),this.docView=new sS(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),!((n=document.fonts)===null||n===void 0)&&n.ready&&document.fonts.ready.then(()=>this.requestMeasure())}dispatch(...e){let n=e.length==1&&e[0]instanceof Qt?e:e.length==1&&Array.isArray(e[0])?e[0]:[this.state.update(...e)];this.dispatchTransactions(n,this)}update(e){if(this.updateState!=0)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");let n=!1,r=!1,i,s=this.state;for(let d of e){if(d.startState!=s)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");s=d.state}if(this.destroyed){this.viewState.state=s;return}let o=this.hasFocus,a=0,l=null;e.some(d=>d.annotation(rk))?(this.inputState.notifiedFocused=o,a=1):o!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=o,l=ik(s,o),l||(a=1));let u=this.observer.delayedAndroidKey,c=null;if(u?(this.observer.clearDelayedAndroidKey(),c=this.observer.readChange(),(c&&!this.state.doc.eq(s.doc)||!this.state.selection.eq(s.selection))&&(c=null)):this.observer.clear(),s.facet(Ue.phrases)!=this.state.facet(Ue.phrases))return this.setState(s);i=vp.create(this,s,e),i.flags|=a;let f=this.viewState.scrollTarget;try{this.updateState=2;for(let d of e){if(f&&(f=f.map(d.changes)),d.scrollIntoView){let{main:h}=d.state.selection;f=new fl(h.empty?h:Y.cursor(h.head,h.head>h.anchor?-1:1))}for(let h of d.effects)h.is(_d)&&(f=h.value.clip(this.state))}this.viewState.update(i,f),this.bidiCache=Sp.update(this.bidiCache,i.changes),i.empty||(this.updatePlugins(i),this.inputState.update(i)),n=this.docView.update(i),this.state.facet(Wu)!=this.styleModules&&this.mountStyles(),r=this.updateAttrs(),this.showAnnouncements(e),this.docView.updateSelection(n,e.some(d=>d.isUserEvent("select.pointer")))}finally{this.updateState=0}if(i.startState.facet(Td)!=i.state.facet(Td)&&(this.viewState.mustMeasureContent=!0),(n||r||f||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),n&&this.docViewUpdate(),!i.empty)for(let d of this.state.facet(Ab))try{d(i)}catch(h){qn(this.state,h,"update listener")}(l||c)&&Promise.resolve().then(()=>{l&&this.state==l.startState&&this.dispatch(l),c&&!YD(this,c)&&u.force&&cl(this.contentDOM,u.key,u.keyCode)})}setState(e){if(this.updateState!=0)throw new Error("Calls to EditorView.setState are not allowed while an update is in progress");if(this.destroyed){this.viewState.state=e;return}this.updateState=2;let n=this.hasFocus;try{for(let r of this.plugins)r.destroy(this);this.viewState=new _S(e),this.plugins=e.facet(Qa).map(r=>new mg(r)),this.pluginMap.clear();for(let r of this.plugins)r.update(this);this.docView.destroy(),this.docView=new sS(this),this.inputState.ensureHandlers(this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}n&&this.focus(),this.requestMeasure()}updatePlugins(e){let n=e.startState.facet(Qa),r=e.state.facet(Qa);if(n!=r){let i=[];for(let s of r){let o=n.indexOf(s);if(o<0)i.push(new mg(s));else{let a=this.plugins[o];a.mustUpdate=e,i.push(a)}}for(let s of this.plugins)s.mustUpdate!=e&&s.destroy(this);this.plugins=i,this.pluginMap.clear()}else for(let i of this.plugins)i.mustUpdate=e;for(let i=0;i-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.observer.delayedAndroidKey){this.measureScheduled=-1,this.requestMeasure();return}this.measureScheduled=0,e&&this.observer.forceFlush();let n=null,r=this.scrollDOM,i=r.scrollTop*this.scaleY,{scrollAnchorPos:s,scrollAnchorHeight:o}=this.viewState;Math.abs(i-this.viewState.scrollTop)>1&&(o=-1),this.viewState.scrollAnchorHeight=-1;try{for(let a=0;;a++){if(o<0)if(bD(r))s=-1,o=this.viewState.heightMap.height;else{let h=this.viewState.scrollAnchorAt(i);s=h.from,o=h.top}this.updateState=1;let l=this.viewState.measure(this);if(!l&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(a>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let u=[];l&4||([this.measureRequests,u]=[u,this.measureRequests]);let c=u.map(h=>{try{return h.read(this)}catch(p){return qn(this.state,p),kS}}),f=vp.create(this,this.state,[]),d=!1;f.flags|=l,n?n.flags|=l:n=f,this.updateState=2,f.empty||(this.updatePlugins(f),this.inputState.update(f),this.updateAttrs(),d=this.docView.update(f),d&&this.docViewUpdate());for(let h=0;h1||p<-1){i=i+p,r.scrollTop=i/this.scaleY,o=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(n&&!n.empty)for(let a of this.state.facet(Ab))a(n)}get themeClasses(){return Ib+" "+(this.state.facet(Tb)?lk:ak)+" "+this.state.facet(Td)}updateAttrs(){let e=OS(this,VD,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),n={spellcheck:"false",autocorrect:"off",autocapitalize:"off",writingsuggestions:"false",translate:"no",contenteditable:this.state.facet(ls)?"true":"false",class:"cm-content",style:`${ue.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(n["aria-readonly"]="true"),OS(this,Sv,n);let r=this.observer.ignore(()=>{let i=Sb(this.contentDOM,this.contentAttrs,n),s=Sb(this.dom,this.editorAttrs,e);return i||s});return this.editorAttrs=e,this.contentAttrs=n,r}showAnnouncements(e){let n=!0;for(let r of e)for(let i of r.effects)if(i.is(ce.announce)){n&&(this.announceDOM.textContent=""),n=!1;let s=this.announceDOM.appendChild(document.createElement("div"));s.textContent=i.value}}mountStyles(){this.styleModules=this.state.facet(Wu);let e=this.state.facet(ce.cspNonce);po.mount(this.root,this.styleModules.concat(AL).reverse(),e?{nonce:e}:void 0)}readMeasured(){if(this.updateState==2)throw new Error("Reading the editor layout isn't allowed during an update");this.updateState==0&&this.measureScheduled>-1&&this.measure(!1)}requestMeasure(e){if(this.measureScheduled<0&&(this.measureScheduled=this.win.requestAnimationFrame(()=>this.measure())),e){if(this.measureRequests.indexOf(e)>-1)return;if(e.key!=null){for(let n=0;nr.plugin==e)||null),n&&n.update(this).value}get documentTop(){return this.contentDOM.getBoundingClientRect().top+this.viewState.paddingTop}get documentPadding(){return{top:this.viewState.paddingTop,bottom:this.viewState.paddingBottom}}get scaleX(){return this.viewState.scaleX}get scaleY(){return this.viewState.scaleY}elementAtHeight(e){return this.readMeasured(),this.viewState.elementAtHeight(e)}lineBlockAtHeight(e){return this.readMeasured(),this.viewState.lineBlockAtHeight(e)}get viewportLineBlocks(){return this.viewState.viewportLines}lineBlockAt(e){return this.viewState.lineBlockAt(e)}get contentHeight(){return this.viewState.contentHeight}moveByChar(e,n,r){return bg(this,e,cS(this,e,n,r))}moveByGroup(e,n){return bg(this,e,cS(this,e,n,r=>V9(this,e.head,r)))}visualLineSide(e,n){let r=this.bidiSpans(e),i=this.textDirectionAt(e.from),s=r[n?r.length-1:0];return Y.cursor(s.side(n,i)+e.from,s.forward(!n,i)?1:-1)}moveToLineBoundary(e,n,r=!0){return j9(this,e,n,r)}moveVertically(e,n,r){return bg(this,e,U9(this,e,n,r))}domAtPos(e){return this.docView.domAtPos(e)}posAtDOM(e,n=0){return this.docView.posFromDOM(e,n)}posAtCoords(e,n=!0){return this.readMeasured(),WD(this,e,n)}coordsAtPos(e,n=1){this.readMeasured();let r=this.docView.coordsAt(e,n);if(!r||r.left==r.right)return r;let i=this.state.doc.lineAt(e),s=this.bidiSpans(i),o=s[Ks.find(s,e-i.from,-1,n)];return Rf(r,o.dir==Et.LTR==n>0)}coordsForChar(e){return this.readMeasured(),this.docView.coordsForChar(e)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(e){return!this.state.facet(BD)||ethis.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(e))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(e){if(e.length>IL)return TD(e.length);let n=this.textDirectionAt(e.from),r;for(let s of this.bidiCache)if(s.from==e.from&&s.dir==n&&(s.fresh||OD(s.isolates,r=iS(this,e))))return s.order;r||(r=iS(this,e));let i=C9(e.text,n,r);return this.bidiCache.push(new Sp(e.from,e.to,n,r,!0,i)),i}get hasFocus(){var e;return(this.dom.ownerDocument.hasFocus()||ue.safari&&((e=this.inputState)===null||e===void 0?void 0:e.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{mD(this.contentDOM),this.docView.updateSelection()})}setRoot(e){this._root!=e&&(this._root=e,this.observer.setWindow((e.nodeType==9?e:e.ownerDocument).defaultView||window),this.mountStyles())}destroy(){this.root.activeElement==this.contentDOM&&this.contentDOM.blur();for(let e of this.plugins)e.destroy(this);this.plugins=[],this.inputState.destroy(),this.docView.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(e,n={}){return _d.of(new fl(typeof e=="number"?Y.cursor(e):e,n.y,n.x,n.yMargin,n.xMargin))}scrollSnapshot(){let{scrollTop:e,scrollLeft:n}=this.scrollDOM,r=this.viewState.scrollAnchorAt(e);return _d.of(new fl(Y.cursor(r.from),"start","start",r.top-e,n,!0))}setTabFocusMode(e){e==null?this.inputState.tabFocusMode=this.inputState.tabFocusMode<0?0:-1:typeof e=="boolean"?this.inputState.tabFocusMode=e?0:-1:this.inputState.tabFocusMode!=0&&(this.inputState.tabFocusMode=Date.now()+e)}static domEventHandlers(e){return $t.define(()=>({}),{eventHandlers:e})}static domEventObservers(e){return $t.define(()=>({}),{eventObservers:e})}static theme(e,n){let r=po.newName(),i=[Td.of(r),Wu.of(Pb(`.${r}`,e))];return n&&n.dark&&i.push(Tb.of(!0)),i}static baseTheme(e){return Ao.lowest(Wu.of(Pb("."+Ib,e,uk)))}static findFromDOM(e){var n;let r=e.querySelector(".cm-content"),i=r&&ut.get(r)||ut.get(e);return((n=i==null?void 0:i.rootView)===null||n===void 0?void 0:n.view)||null}}ce.styleModule=Wu;ce.inputHandler=FD;ce.clipboardInputFilter=vv;ce.clipboardOutputFilter=xv;ce.scrollHandler=zD;ce.focusChangeEffect=LD;ce.perLineTextDirection=BD;ce.exceptionSink=MD;ce.updateListener=Ab;ce.editable=ls;ce.mouseSelectionStyle=ND;ce.dragMovesSelection=RD;ce.clickAddsSelectionRange=PD;ce.decorations=Bc;ce.outerDecorations=UD;ce.atomicRanges=Ff;ce.bidiIsolatedRanges=HD;ce.scrollMargins=qD;ce.darkTheme=Tb;ce.cspNonce=he.define({combine:t=>t.length?t[0]:""});ce.contentAttributes=Sv;ce.editorAttributes=VD;ce.lineWrapping=ce.contentAttributes.of({class:"cm-lineWrapping"});ce.announce=De.define();const IL=4096,kS={};class Sp{constructor(e,n,r,i,s,o){this.from=e,this.to=n,this.dir=r,this.isolates=i,this.fresh=s,this.order=o}static update(e,n){if(n.empty&&!e.some(s=>s.fresh))return e;let r=[],i=e.length?e[e.length-1].dir:Et.LTR;for(let s=Math.max(0,e.length-10);s=0;i--){let s=r[i],o=typeof s=="function"?s(t):s;o&&xb(o,n)}return n}const PL=ue.mac?"mac":ue.windows?"win":ue.linux?"linux":"key";function RL(t,e){const n=t.split(/-(?!$)/);let r=n[n.length-1];r=="Space"&&(r=" ");let i,s,o,a;for(let l=0;lr.concat(i),[]))),n}function ML(t,e,n){return fk(ck(t.state),e,t,n)}let js=null;const FL=4e3;function LL(t,e=PL){let n=Object.create(null),r=Object.create(null),i=(o,a)=>{let l=r[o];if(l==null)r[o]=a;else if(l!=a)throw new Error("Key binding "+o+" is used both as a regular binding and as a multi-stroke prefix")},s=(o,a,l,u,c)=>{var f,d;let h=n[o]||(n[o]=Object.create(null)),p=a.split(/ (?!$)/).map(b=>RL(b,e));for(let b=1;b{let S=js={view:x,prefix:y,scope:o};return setTimeout(()=>{js==S&&(js=null)},FL),!0}]})}let m=p.join(" ");i(m,!1);let g=h[m]||(h[m]={preventDefault:!1,stopPropagation:!1,run:((d=(f=h._any)===null||f===void 0?void 0:f.run)===null||d===void 0?void 0:d.slice())||[]});l&&g.run.push(l),u&&(g.preventDefault=!0),c&&(g.stopPropagation=!0)};for(let o of t){let a=o.scope?o.scope.split(" "):["editor"];if(o.any)for(let u of a){let c=n[u]||(n[u]=Object.create(null));c._any||(c._any={preventDefault:!1,stopPropagation:!1,run:[]});let{any:f}=o;for(let d in c)c[d].run.push(h=>f(h,Rb))}let l=o[e]||o.key;if(l)for(let u of a)s(u,l,o.run,o.preventDefault,o.stopPropagation),o.shift&&s(u,"Shift-"+l,o.shift,o.preventDefault,o.stopPropagation)}return n}let Rb=null;function fk(t,e,n,r){Rb=e;let i=s9(e),s=ir(i,0),o=Di(s)==i.length&&i!=" ",a="",l=!1,u=!1,c=!1;js&&js.view==n&&js.scope==r&&(a=js.prefix+" ",QD.indexOf(e.keyCode)<0&&(u=!0,js=null));let f=new Set,d=g=>{if(g){for(let b of g.run)if(!f.has(b)&&(f.add(b),b(n)))return g.stopPropagation&&(c=!0),!0;g.preventDefault&&(g.stopPropagation&&(c=!0),u=!0)}return!1},h=t[r],p,m;return h&&(d(h[a+Id(i,e,!o)])?l=!0:o&&(e.altKey||e.metaKey||e.ctrlKey)&&!(ue.windows&&e.ctrlKey&&e.altKey)&&!(ue.mac&&e.altKey&&!(e.ctrlKey||e.metaKey))&&(p=mo[e.keyCode])&&p!=i?(d(h[a+Id(p,e,!0)])||e.shiftKey&&(m=Fc[e.keyCode])!=i&&m!=p&&d(h[a+Id(m,e,!1)]))&&(l=!0):o&&e.shiftKey&&d(h[a+Id(i,e,!0)])&&(l=!0),!l&&d(h._any)&&(l=!0)),u&&(l=!0),l&&c&&e.stopPropagation(),Rb=null,l}class Bf{constructor(e,n,r,i,s){this.className=e,this.left=n,this.top=r,this.width=i,this.height=s}draw(){let e=document.createElement("div");return e.className=this.className,this.adjust(e),e}update(e,n){return n.className!=this.className?!1:(this.adjust(e),!0)}adjust(e){e.style.left=this.left+"px",e.style.top=this.top+"px",this.width!=null&&(e.style.width=this.width+"px"),e.style.height=this.height+"px"}eq(e){return this.left==e.left&&this.top==e.top&&this.width==e.width&&this.height==e.height&&this.className==e.className}static forRange(e,n,r){if(r.empty){let i=e.coordsAtPos(r.head,r.assoc||1);if(!i)return[];let s=dk(e);return[new Bf(n,i.left-s.left,i.top-s.top,null,i.bottom-i.top)]}else return BL(e,n,r)}}function dk(t){let e=t.scrollDOM.getBoundingClientRect();return{left:(t.textDirection==Et.LTR?e.left:e.right-t.scrollDOM.clientWidth*t.scaleX)-t.scrollDOM.scrollLeft*t.scaleX,top:e.top-t.scrollDOM.scrollTop*t.scaleY}}function IS(t,e,n,r){let i=t.coordsAtPos(e,n*2);if(!i)return r;let s=t.dom.getBoundingClientRect(),o=(i.top+i.bottom)/2,a=t.posAtCoords({x:s.left+1,y:o}),l=t.posAtCoords({x:s.right-1,y:o});return a==null||l==null?r:{from:Math.max(r.from,Math.min(a,l)),to:Math.min(r.to,Math.max(a,l))}}function BL(t,e,n){if(n.to<=t.viewport.from||n.from>=t.viewport.to)return[];let r=Math.max(n.from,t.viewport.from),i=Math.min(n.to,t.viewport.to),s=t.textDirection==Et.LTR,o=t.contentDOM,a=o.getBoundingClientRect(),l=dk(t),u=o.querySelector(".cm-line"),c=u&&window.getComputedStyle(u),f=a.left+(c?parseInt(c.paddingLeft)+Math.min(0,parseInt(c.textIndent)):0),d=a.right-(c?parseInt(c.paddingRight):0),h=kb(t,r,1),p=kb(t,i,-1),m=h.type==Kn.Text?h:null,g=p.type==Kn.Text?p:null;if(m&&(t.lineWrapping||h.widgetLineBreaks)&&(m=IS(t,r,1,m)),g&&(t.lineWrapping||p.widgetLineBreaks)&&(g=IS(t,i,-1,g)),m&&g&&m.from==g.from&&m.to==g.to)return y(x(n.from,n.to,m));{let E=m?x(n.from,null,m):S(h,!1),C=g?x(null,n.to,g):S(p,!0),w=[];return(m||h).to<(g||p).from-(m&&g?1:0)||h.widgetLineBreaks>1&&E.bottom+t.defaultLineHeight/2N&&R.from=V)break;ie>F&&I(Math.max(H,F),E==null&&H<=N,Math.min(ie,V),C==null&&ie>=P,G.dir)}if(F=B.to+1,F>=V)break}return O.length==0&&I(N,E==null,P,C==null,t.textDirection),{top:A,bottom:_,horizontal:O}}function S(E,C){let w=a.top+(C?E.top:E.bottom);return{top:w,bottom:w,horizontal:[]}}}function $L(t,e){return t.constructor==e.constructor&&t.eq(e)}class zL{constructor(e,n){this.view=e,this.layer=n,this.drawn=[],this.scaleX=1,this.scaleY=1,this.measureReq={read:this.measure.bind(this),write:this.draw.bind(this)},this.dom=e.scrollDOM.appendChild(document.createElement("div")),this.dom.classList.add("cm-layer"),n.above&&this.dom.classList.add("cm-layer-above"),n.class&&this.dom.classList.add(n.class),this.scale(),this.dom.setAttribute("aria-hidden","true"),this.setOrder(e.state),e.requestMeasure(this.measureReq),n.mount&&n.mount(this.dom,e)}update(e){e.startState.facet(Oh)!=e.state.facet(Oh)&&this.setOrder(e.state),(this.layer.update(e,this.dom)||e.geometryChanged)&&(this.scale(),e.view.requestMeasure(this.measureReq))}docViewUpdate(e){this.layer.updateOnDocViewUpdate!==!1&&e.requestMeasure(this.measureReq)}setOrder(e){let n=0,r=e.facet(Oh);for(;n!$L(n,this.drawn[r]))){let n=this.dom.firstChild,r=0;for(let i of e)i.update&&n&&i.constructor&&this.drawn[r].constructor&&i.update(n,this.drawn[r])?(n=n.nextSibling,r++):this.dom.insertBefore(i.draw(),n);for(;n;){let i=n.nextSibling;n.remove(),n=i}this.drawn=e,ue.safari&&ue.safari_version>=26&&(this.dom.style.display=this.dom.firstChild?"":"none")}}destroy(){this.layer.destroy&&this.layer.destroy(this.dom,this.view),this.dom.remove()}}const Oh=he.define();function hk(t){return[$t.define(e=>new zL(e,t)),Oh.of(t)]}const $c=he.define({combine(t){return fi(t,{cursorBlinkRate:1200,drawRangeCursor:!0},{cursorBlinkRate:(e,n)=>Math.min(e,n),drawRangeCursor:(e,n)=>e||n})}});function jL(t={}){return[$c.of(t),VL,UL,HL,$D.of(!0)]}function pk(t){return t.startState.facet($c)!=t.state.facet($c)}const VL=hk({above:!0,markers(t){let{state:e}=t,n=e.facet($c),r=[];for(let i of e.selection.ranges){let s=i==e.selection.main;if(i.empty||n.drawRangeCursor){let o=s?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary",a=i.empty?i:Y.cursor(i.head,i.head>i.anchor?-1:1);for(let l of Bf.forRange(t,o,a))r.push(l)}}return r},update(t,e){t.transactions.some(r=>r.selection)&&(e.style.animationName=e.style.animationName=="cm-blink"?"cm-blink2":"cm-blink");let n=pk(t);return n&&PS(t.state,e),t.docChanged||t.selectionSet||n},mount(t,e){PS(e.state,t)},class:"cm-cursorLayer"});function PS(t,e){e.style.animationDuration=t.facet($c).cursorBlinkRate+"ms"}const UL=hk({above:!1,markers(t){return t.state.selection.ranges.map(e=>e.empty?[]:Bf.forRange(t,"cm-selectionBackground",e)).reduce((e,n)=>e.concat(n))},update(t,e){return t.docChanged||t.selectionSet||t.viewportChanged||pk(t)},class:"cm-selectionLayer"}),HL=Ao.highest(ce.theme({".cm-line":{"& ::selection, &::selection":{backgroundColor:"transparent !important"},caretColor:"transparent !important"},".cm-content":{caretColor:"transparent !important","& :focus":{caretColor:"initial !important","&::selection, & ::selection":{backgroundColor:"Highlight !important"}}}})),mk=De.define({map(t,e){return t==null?null:e.mapPos(t)}}),Yu=Wt.define({create(){return null},update(t,e){return t!=null&&(t=e.changes.mapPos(t)),e.effects.reduce((n,r)=>r.is(mk)?r.value:n,t)}}),qL=$t.fromClass(class{constructor(t){this.view=t,this.cursor=null,this.measureReq={read:this.readPos.bind(this),write:this.drawCursor.bind(this)}}update(t){var e;let n=t.state.field(Yu);n==null?this.cursor!=null&&((e=this.cursor)===null||e===void 0||e.remove(),this.cursor=null):(this.cursor||(this.cursor=this.view.scrollDOM.appendChild(document.createElement("div")),this.cursor.className="cm-dropCursor"),(t.startState.field(Yu)!=n||t.docChanged||t.geometryChanged)&&this.view.requestMeasure(this.measureReq))}readPos(){let{view:t}=this,e=t.state.field(Yu),n=e!=null&&t.coordsAtPos(e);if(!n)return null;let r=t.scrollDOM.getBoundingClientRect();return{left:n.left-r.left+t.scrollDOM.scrollLeft*t.scaleX,top:n.top-r.top+t.scrollDOM.scrollTop*t.scaleY,height:n.bottom-n.top}}drawCursor(t){if(this.cursor){let{scaleX:e,scaleY:n}=this.view;t?(this.cursor.style.left=t.left/e+"px",this.cursor.style.top=t.top/n+"px",this.cursor.style.height=t.height/n+"px"):this.cursor.style.left="-100000px"}}destroy(){this.cursor&&this.cursor.remove()}setDropPos(t){this.view.state.field(Yu)!=t&&this.view.dispatch({effects:mk.of(t)})}},{eventObservers:{dragover(t){this.setDropPos(this.view.posAtCoords({x:t.clientX,y:t.clientY}))},dragleave(t){(t.target==this.view.contentDOM||!this.view.contentDOM.contains(t.relatedTarget))&&this.setDropPos(null)},dragend(){this.setDropPos(null)},drop(){this.setDropPos(null)}}});function GL(){return[Yu,qL]}function RS(t,e,n,r,i){e.lastIndex=0;for(let s=t.iterRange(n,r),o=n,a;!s.next().done;o+=s.value.length)if(!s.lineBreak)for(;a=e.exec(s.value);)i(o+a.index,a)}function WL(t,e){let n=t.visibleRanges;if(n.length==1&&n[0].from==t.viewport.from&&n[0].to==t.viewport.to)return n;let r=[];for(let{from:i,to:s}of n)i=Math.max(t.state.doc.lineAt(i).from,i-e),s=Math.min(t.state.doc.lineAt(s).to,s+e),r.length&&r[r.length-1].to>=i?r[r.length-1].to=s:r.push({from:i,to:s});return r}class KL{constructor(e){const{regexp:n,decoration:r,decorate:i,boundary:s,maxLength:o=1e3}=e;if(!n.global)throw new RangeError("The regular expression given to MatchDecorator should have its 'g' flag set");if(this.regexp=n,i)this.addMatch=(a,l,u,c)=>i(c,u,u+a[0].length,a,l);else if(typeof r=="function")this.addMatch=(a,l,u,c)=>{let f=r(a,l,u);f&&c(u,u+a[0].length,f)};else if(r)this.addMatch=(a,l,u,c)=>c(u,u+a[0].length,r);else throw new RangeError("Either 'decorate' or 'decoration' should be provided to MatchDecorator");this.boundary=s,this.maxLength=o}createDeco(e){let n=new _s,r=n.add.bind(n);for(let{from:i,to:s}of WL(e,this.maxLength))RS(e.state.doc,this.regexp,i,s,(o,a)=>this.addMatch(a,e,o,r));return n.finish()}updateDeco(e,n){let r=1e9,i=-1;return e.docChanged&&e.changes.iterChanges((s,o,a,l)=>{l>=e.view.viewport.from&&a<=e.view.viewport.to&&(r=Math.min(a,r),i=Math.max(l,i))}),e.viewportMoved||i-r>1e3?this.createDeco(e.view):i>-1?this.updateRange(e.view,n.map(e.changes),r,i):n}updateRange(e,n,r,i){for(let s of e.visibleRanges){let o=Math.max(s.from,r),a=Math.min(s.to,i);if(a>=o){let l=e.state.doc.lineAt(o),u=l.tol.from;o--)if(this.boundary.test(l.text[o-1-l.from])){c=o;break}for(;ad.push(b.range(m,g));if(l==u)for(this.regexp.lastIndex=c-l.from;(h=this.regexp.exec(l.text))&&h.indexthis.addMatch(g,e,m,p));n=n.update({filterFrom:c,filterTo:f,filter:(m,g)=>mf,add:d})}}return n}}const Nb=/x/.unicode!=null?"gu":"g",XL=new RegExp(`[\0-\b +--Ÿ­؜​‎‏\u2028\u2029‭‮⁦⁧⁩\uFEFF-]`,Nb),YL={0:"null",7:"bell",8:"backspace",10:"newline",11:"vertical tab",13:"carriage return",27:"escape",8203:"zero width space",8204:"zero width non-joiner",8205:"zero width joiner",8206:"left-to-right mark",8207:"right-to-left mark",8232:"line separator",8237:"left-to-right override",8238:"right-to-left override",8294:"left-to-right isolate",8295:"right-to-left isolate",8297:"pop directional isolate",8233:"paragraph separator",65279:"zero width no-break space",65532:"object replacement"};let xg=null;function JL(){var t;if(xg==null&&typeof document<"u"&&document.body){let e=document.body.style;xg=((t=e.tabSize)!==null&&t!==void 0?t:e.MozTabSize)!=null}return xg||!1}const Th=he.define({combine(t){let e=fi(t,{render:null,specialChars:XL,addSpecialChars:null});return(e.replaceTabs=!JL())&&(e.specialChars=new RegExp(" |"+e.specialChars.source,Nb)),e.addSpecialChars&&(e.specialChars=new RegExp(e.specialChars.source+"|"+e.addSpecialChars.source,Nb)),e}});function ZL(t={}){return[Th.of(t),QL()]}let NS=null;function QL(){return NS||(NS=$t.fromClass(class{constructor(t){this.view=t,this.decorations=ve.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(t.state.facet(Th)),this.decorations=this.decorator.createDeco(t)}makeDecorator(t){return new KL({regexp:t.specialChars,decoration:(e,n,r)=>{let{doc:i}=n.state,s=ir(e[0],0);if(s==9){let o=i.lineAt(r),a=n.state.tabSize,l=ru(o.text,a,r-o.from);return ve.replace({widget:new rB((a-l%a)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[s]||(this.decorationCache[s]=ve.replace({widget:new nB(t,s)}))},boundary:t.replaceTabs?void 0:/[^]/})}update(t){let e=t.state.facet(Th);t.startState.facet(Th)!=e?(this.decorator=this.makeDecorator(e),this.decorations=this.decorator.createDeco(t.view)):this.decorations=this.decorator.updateDeco(t,this.decorations)}},{decorations:t=>t.decorations}))}const eB="•";function tB(t){return t>=32?eB:t==10?"␤":String.fromCharCode(9216+t)}class nB extends Yi{constructor(e,n){super(),this.options=e,this.code=n}eq(e){return e.code==this.code}toDOM(e){let n=tB(this.code),r=e.state.phrase("Control character")+" "+(YL[this.code]||"0x"+this.code.toString(16)),i=this.options.render&&this.options.render(this.code,r,n);if(i)return i;let s=document.createElement("span");return s.textContent=n,s.title=r,s.setAttribute("aria-label",r),s.className="cm-specialChar",s}ignoreEvent(){return!1}}class rB extends Yi{constructor(e){super(),this.width=e}eq(e){return e.width==this.width}toDOM(){let e=document.createElement("span");return e.textContent=" ",e.className="cm-tab",e.style.width=this.width+"px",e}ignoreEvent(){return!1}}function iB(){return oB}const sB=ve.line({class:"cm-activeLine"}),oB=$t.fromClass(class{constructor(t){this.decorations=this.getDeco(t)}update(t){(t.docChanged||t.selectionSet)&&(this.decorations=this.getDeco(t.view))}getDeco(t){let e=-1,n=[];for(let r of t.state.selection.ranges){let i=t.lineBlockAt(r.head);i.from>e&&(n.push(sB.range(i.from)),e=i.from)}return ve.set(n)}},{decorations:t=>t.decorations});class aB extends Yi{constructor(e){super(),this.content=e}toDOM(e){let n=document.createElement("span");return n.className="cm-placeholder",n.style.pointerEvents="none",n.appendChild(typeof this.content=="string"?document.createTextNode(this.content):typeof this.content=="function"?this.content(e):this.content.cloneNode(!0)),n.setAttribute("aria-hidden","true"),n}coordsAt(e){let n=e.firstChild?kl(e.firstChild):[];if(!n.length)return null;let r=window.getComputedStyle(e.parentNode),i=Rf(n[0],r.direction!="rtl"),s=parseInt(r.lineHeight);return i.bottom-i.top>s*1.5?{left:i.left,right:i.right,top:i.top,bottom:i.top+s}:i}ignoreEvent(){return!1}}function lB(t){let e=$t.fromClass(class{constructor(n){this.view=n,this.placeholder=t?ve.set([ve.widget({widget:new aB(t),side:1}).range(0)]):ve.none}get decorations(){return this.view.state.doc.length?ve.none:this.placeholder}},{decorations:n=>n.decorations});return typeof t=="string"?[e,ce.contentAttributes.of({"aria-placeholder":t})]:e}const Mb=2e3;function uB(t,e,n){let r=Math.min(e.line,n.line),i=Math.max(e.line,n.line),s=[];if(e.off>Mb||n.off>Mb||e.col<0||n.col<0){let o=Math.min(e.off,n.off),a=Math.max(e.off,n.off);for(let l=r;l<=i;l++){let u=t.doc.line(l);u.length<=a&&s.push(Y.range(u.from+o,u.to+a))}}else{let o=Math.min(e.col,n.col),a=Math.max(e.col,n.col);for(let l=r;l<=i;l++){let u=t.doc.line(l),c=db(u.text,o,t.tabSize,!0);if(c<0)s.push(Y.cursor(u.to));else{let f=db(u.text,a,t.tabSize);s.push(Y.range(u.from+c,u.from+f))}}}return s}function cB(t,e){let n=t.coordsAtPos(t.viewport.from);return n?Math.round(Math.abs((n.left-e)/t.defaultCharacterWidth)):-1}function MS(t,e){let n=t.posAtCoords({x:e.clientX,y:e.clientY},!1),r=t.state.doc.lineAt(n),i=n-r.from,s=i>Mb?-1:i==r.length?cB(t,e.clientX):ru(r.text,t.state.tabSize,n-r.from);return{line:r.number,col:s,off:i}}function fB(t,e){let n=MS(t,e),r=t.state.selection;return n?{update(i){if(i.docChanged){let s=i.changes.mapPos(i.startState.doc.line(n.line).from),o=i.state.doc.lineAt(s);n={line:o.number,col:n.col,off:Math.min(n.off,o.length)},r=r.map(i.changes)}},get(i,s,o){let a=MS(t,i);if(!a)return r;let l=uB(t.state,n,a);return l.length?o?Y.create(l.concat(r.ranges)):Y.create(l):r}}:null}function dB(t){let e=(n=>n.altKey&&n.button==0);return ce.mouseSelectionStyle.of((n,r)=>e(r)?fB(n,r):null)}const hB={Alt:[18,t=>!!t.altKey],Control:[17,t=>!!t.ctrlKey],Shift:[16,t=>!!t.shiftKey],Meta:[91,t=>!!t.metaKey]},pB={style:"cursor: crosshair"};function mB(t={}){let[e,n]=hB[t.key||"Alt"],r=$t.fromClass(class{constructor(i){this.view=i,this.isDown=!1}set(i){this.isDown!=i&&(this.isDown=i,this.view.update([]))}},{eventObservers:{keydown(i){this.set(i.keyCode==e||n(i))},keyup(i){(i.keyCode==e||!n(i))&&this.set(!1)},mousemove(i){this.set(n(i))}}});return[r,ce.contentAttributes.of(i=>{var s;return!((s=i.plugin(r))===null||s===void 0)&&s.isDown?pB:null})]}const Iu="-10000px";class gk{constructor(e,n,r,i){this.facet=n,this.createTooltipView=r,this.removeTooltipView=i,this.input=e.state.facet(n),this.tooltips=this.input.filter(o=>o);let s=null;this.tooltipViews=this.tooltips.map(o=>s=r(o,s))}update(e,n){var r;let i=e.state.facet(this.facet),s=i.filter(l=>l);if(i===this.input){for(let l of this.tooltipViews)l.update&&l.update(e);return!1}let o=[],a=n?[]:null;for(let l=0;ln[u]=l),n.length=a.length),this.input=i,this.tooltips=s,this.tooltipViews=o,!0}}function gB(t){let e=t.dom.ownerDocument.documentElement;return{top:0,left:0,bottom:e.clientHeight,right:e.clientWidth}}const Sg=he.define({combine:t=>{var e,n,r;return{position:ue.ios?"absolute":((e=t.find(i=>i.position))===null||e===void 0?void 0:e.position)||"fixed",parent:((n=t.find(i=>i.parent))===null||n===void 0?void 0:n.parent)||null,tooltipSpace:((r=t.find(i=>i.tooltipSpace))===null||r===void 0?void 0:r.tooltipSpace)||gB}}}),FS=new WeakMap,Av=$t.fromClass(class{constructor(t){this.view=t,this.above=[],this.inView=!0,this.madeAbsolute=!1,this.lastTransaction=0,this.measureTimeout=-1;let e=t.state.facet(Sg);this.position=e.position,this.parent=e.parent,this.classes=t.themeClasses,this.createContainer(),this.measureReq={read:this.readMeasure.bind(this),write:this.writeMeasure.bind(this),key:this},this.resizeObserver=typeof ResizeObserver=="function"?new ResizeObserver(()=>this.measureSoon()):null,this.manager=new gk(t,X0,(n,r)=>this.createTooltip(n,r),n=>{this.resizeObserver&&this.resizeObserver.unobserve(n.dom),n.dom.remove()}),this.above=this.manager.tooltips.map(n=>!!n.above),this.intersectionObserver=typeof IntersectionObserver=="function"?new IntersectionObserver(n=>{Date.now()>this.lastTransaction-50&&n.length>0&&n[n.length-1].intersectionRatio<1&&this.measureSoon()},{threshold:[1]}):null,this.observeIntersection(),t.win.addEventListener("resize",this.measureSoon=this.measureSoon.bind(this)),this.maybeMeasure()}createContainer(){this.parent?(this.container=document.createElement("div"),this.container.style.position="relative",this.container.className=this.view.themeClasses,this.parent.appendChild(this.container)):this.container=this.view.dom}observeIntersection(){if(this.intersectionObserver){this.intersectionObserver.disconnect();for(let t of this.manager.tooltipViews)this.intersectionObserver.observe(t.dom)}}measureSoon(){this.measureTimeout<0&&(this.measureTimeout=setTimeout(()=>{this.measureTimeout=-1,this.maybeMeasure()},50))}update(t){t.transactions.length&&(this.lastTransaction=Date.now());let e=this.manager.update(t,this.above);e&&this.observeIntersection();let n=e||t.geometryChanged,r=t.state.facet(Sg);if(r.position!=this.position&&!this.madeAbsolute){this.position=r.position;for(let i of this.manager.tooltipViews)i.dom.style.position=this.position;n=!0}if(r.parent!=this.parent){this.parent&&this.container.remove(),this.parent=r.parent,this.createContainer();for(let i of this.manager.tooltipViews)this.container.appendChild(i.dom);n=!0}else this.parent&&this.view.themeClasses!=this.classes&&(this.classes=this.container.className=this.view.themeClasses);n&&this.maybeMeasure()}createTooltip(t,e){let n=t.create(this.view),r=e?e.dom:null;if(n.dom.classList.add("cm-tooltip"),t.arrow&&!n.dom.querySelector(".cm-tooltip > .cm-tooltip-arrow")){let i=document.createElement("div");i.className="cm-tooltip-arrow",n.dom.appendChild(i)}return n.dom.style.position=this.position,n.dom.style.top=Iu,n.dom.style.left="0px",this.container.insertBefore(n.dom,r),n.mount&&n.mount(this.view),this.resizeObserver&&this.resizeObserver.observe(n.dom),n}destroy(){var t,e,n;this.view.win.removeEventListener("resize",this.measureSoon);for(let r of this.manager.tooltipViews)r.dom.remove(),(t=r.destroy)===null||t===void 0||t.call(r);this.parent&&this.container.remove(),(e=this.resizeObserver)===null||e===void 0||e.disconnect(),(n=this.intersectionObserver)===null||n===void 0||n.disconnect(),clearTimeout(this.measureTimeout)}readMeasure(){let t=1,e=1,n=!1;if(this.position=="fixed"&&this.manager.tooltipViews.length){let{dom:s}=this.manager.tooltipViews[0];if(ue.gecko)n=s.offsetParent!=this.container.ownerDocument.body;else if(s.style.top==Iu&&s.style.left=="0px"){let o=s.getBoundingClientRect();n=Math.abs(o.top+1e4)>1||Math.abs(o.left)>1}}if(n||this.position=="absolute")if(this.parent){let s=this.parent.getBoundingClientRect();s.width&&s.height&&(t=s.width/this.parent.offsetWidth,e=s.height/this.parent.offsetHeight)}else({scaleX:t,scaleY:e}=this.view.viewState);let r=this.view.scrollDOM.getBoundingClientRect(),i=Ev(this.view);return{visible:{left:r.left+i.left,top:r.top+i.top,right:r.right-i.right,bottom:r.bottom-i.bottom},parent:this.parent?this.container.getBoundingClientRect():this.view.dom.getBoundingClientRect(),pos:this.manager.tooltips.map((s,o)=>{let a=this.manager.tooltipViews[o];return a.getCoords?a.getCoords(s.pos):this.view.coordsAtPos(s.pos)}),size:this.manager.tooltipViews.map(({dom:s})=>s.getBoundingClientRect()),space:this.view.state.facet(Sg).tooltipSpace(this.view),scaleX:t,scaleY:e,makeAbsolute:n}}writeMeasure(t){var e;if(t.makeAbsolute){this.madeAbsolute=!0,this.position="absolute";for(let a of this.manager.tooltipViews)a.dom.style.position="absolute"}let{visible:n,space:r,scaleX:i,scaleY:s}=t,o=[];for(let a=0;a=Math.min(n.bottom,r.bottom)||f.rightMath.min(n.right,r.right)+.1)){c.style.top=Iu;continue}let h=l.arrow?u.dom.querySelector(".cm-tooltip-arrow"):null,p=h?7:0,m=d.right-d.left,g=(e=FS.get(u))!==null&&e!==void 0?e:d.bottom-d.top,b=u.offset||yB,y=this.view.textDirection==Et.LTR,x=d.width>r.right-r.left?y?r.left:r.right-d.width:y?Math.max(r.left,Math.min(f.left-(h?14:0)+b.x,r.right-m)):Math.min(Math.max(r.left,f.left-m+(h?14:0)-b.x),r.right-m),S=this.above[a];!l.strictSide&&(S?f.top-g-p-b.yr.bottom)&&S==r.bottom-f.bottom>f.top-r.top&&(S=this.above[a]=!S);let E=(S?f.top-r.top:r.bottom-f.bottom)-p;if(Ex&&A.topC&&(C=S?A.top-g-2-p:A.bottom+p+2);if(this.position=="absolute"?(c.style.top=(C-t.parent.top)/s+"px",LS(c,(x-t.parent.left)/i)):(c.style.top=C/s+"px",LS(c,x/i)),h){let A=f.left+(y?b.x:-b.x)-(x+14-7);h.style.left=A/i+"px"}u.overlap!==!0&&o.push({left:x,top:C,right:w,bottom:C+g}),c.classList.toggle("cm-tooltip-above",S),c.classList.toggle("cm-tooltip-below",!S),u.positioned&&u.positioned(t.space)}}maybeMeasure(){if(this.manager.tooltips.length&&(this.view.inView&&this.view.requestMeasure(this.measureReq),this.inView!=this.view.inView&&(this.inView=this.view.inView,!this.inView)))for(let t of this.manager.tooltipViews)t.dom.style.top=Iu}},{eventObservers:{scroll(){this.maybeMeasure()}}});function LS(t,e){let n=parseInt(t.style.left,10);(isNaN(n)||Math.abs(e-n)>1)&&(t.style.left=e+"px")}const bB=ce.baseTheme({".cm-tooltip":{zIndex:500,boxSizing:"border-box"},"&light .cm-tooltip":{border:"1px solid #bbb",backgroundColor:"#f5f5f5"},"&light .cm-tooltip-section:not(:first-child)":{borderTop:"1px solid #bbb"},"&dark .cm-tooltip":{backgroundColor:"#333338",color:"white"},".cm-tooltip-arrow":{height:"7px",width:"14px",position:"absolute",zIndex:-1,overflow:"hidden","&:before, &:after":{content:"''",position:"absolute",width:0,height:0,borderLeft:"7px solid transparent",borderRight:"7px solid transparent"},".cm-tooltip-above &":{bottom:"-7px","&:before":{borderTop:"7px solid #bbb"},"&:after":{borderTop:"7px solid #f5f5f5",bottom:"1px"}},".cm-tooltip-below &":{top:"-7px","&:before":{borderBottom:"7px solid #bbb"},"&:after":{borderBottom:"7px solid #f5f5f5",top:"1px"}}},"&dark .cm-tooltip .cm-tooltip-arrow":{"&:before":{borderTopColor:"#333338",borderBottomColor:"#333338"},"&:after":{borderTopColor:"transparent",borderBottomColor:"transparent"}}}),yB={x:0,y:0},X0=he.define({enables:[Av,bB]}),Ep=he.define({combine:t=>t.reduce((e,n)=>e.concat(n),[])});class Y0{static create(e){return new Y0(e)}constructor(e){this.view=e,this.mounted=!1,this.dom=document.createElement("div"),this.dom.classList.add("cm-tooltip-hover"),this.manager=new gk(e,Ep,(n,r)=>this.createHostedView(n,r),n=>n.dom.remove())}createHostedView(e,n){let r=e.create(this.view);return r.dom.classList.add("cm-tooltip-section"),this.dom.insertBefore(r.dom,n?n.dom.nextSibling:this.dom.firstChild),this.mounted&&r.mount&&r.mount(this.view),r}mount(e){for(let n of this.manager.tooltipViews)n.mount&&n.mount(e);this.mounted=!0}positioned(e){for(let n of this.manager.tooltipViews)n.positioned&&n.positioned(e)}update(e){this.manager.update(e)}destroy(){var e;for(let n of this.manager.tooltipViews)(e=n.destroy)===null||e===void 0||e.call(n)}passProp(e){let n;for(let r of this.manager.tooltipViews){let i=r[e];if(i!==void 0){if(n===void 0)n=i;else if(n!==i)return}}return n}get offset(){return this.passProp("offset")}get getCoords(){return this.passProp("getCoords")}get overlap(){return this.passProp("overlap")}get resize(){return this.passProp("resize")}}const vB=X0.compute([Ep],t=>{let e=t.facet(Ep);return e.length===0?null:{pos:Math.min(...e.map(n=>n.pos)),end:Math.max(...e.map(n=>{var r;return(r=n.end)!==null&&r!==void 0?r:n.pos})),create:Y0.create,above:e[0].above,arrow:e.some(n=>n.arrow)}});class xB{constructor(e,n,r,i,s){this.view=e,this.source=n,this.field=r,this.setHover=i,this.hoverTime=s,this.hoverTimeout=-1,this.restartTimeout=-1,this.pending=null,this.lastMove={x:0,y:0,target:e.dom,time:0},this.checkHover=this.checkHover.bind(this),e.dom.addEventListener("mouseleave",this.mouseleave=this.mouseleave.bind(this)),e.dom.addEventListener("mousemove",this.mousemove=this.mousemove.bind(this))}update(){this.pending&&(this.pending=null,clearTimeout(this.restartTimeout),this.restartTimeout=setTimeout(()=>this.startHover(),20))}get active(){return this.view.state.field(this.field)}checkHover(){if(this.hoverTimeout=-1,this.active.length)return;let e=Date.now()-this.lastMove.time;ea.bottom||n.xa.right+e.defaultCharacterWidth)return;let l=e.bidiSpans(e.state.doc.lineAt(i)).find(c=>c.from<=i&&c.to>=i),u=l&&l.dir==Et.RTL?-1:1;s=n.x{this.pending==a&&(this.pending=null,l&&!(Array.isArray(l)&&!l.length)&&e.dispatch({effects:this.setHover.of(Array.isArray(l)?l:[l])}))},l=>qn(e.state,l,"hover tooltip"))}else o&&!(Array.isArray(o)&&!o.length)&&e.dispatch({effects:this.setHover.of(Array.isArray(o)?o:[o])})}get tooltip(){let e=this.view.plugin(Av),n=e?e.manager.tooltips.findIndex(r=>r.create==Y0.create):-1;return n>-1?e.manager.tooltipViews[n]:null}mousemove(e){var n,r;this.lastMove={x:e.clientX,y:e.clientY,target:e.target,time:Date.now()},this.hoverTimeout<0&&(this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime));let{active:i,tooltip:s}=this;if(i.length&&s&&!SB(s.dom,e)||this.pending){let{pos:o}=i[0]||this.pending,a=(r=(n=i[0])===null||n===void 0?void 0:n.end)!==null&&r!==void 0?r:o;(o==a?this.view.posAtCoords(this.lastMove)!=o:!EB(this.view,o,a,e.clientX,e.clientY))&&(this.view.dispatch({effects:this.setHover.of([])}),this.pending=null)}}mouseleave(e){clearTimeout(this.hoverTimeout),this.hoverTimeout=-1;let{active:n}=this;if(n.length){let{tooltip:r}=this;r&&r.dom.contains(e.relatedTarget)?this.watchTooltipLeave(r.dom):this.view.dispatch({effects:this.setHover.of([])})}}watchTooltipLeave(e){let n=r=>{e.removeEventListener("mouseleave",n),this.active.length&&!this.view.dom.contains(r.relatedTarget)&&this.view.dispatch({effects:this.setHover.of([])})};e.addEventListener("mouseleave",n)}destroy(){clearTimeout(this.hoverTimeout),this.view.dom.removeEventListener("mouseleave",this.mouseleave),this.view.dom.removeEventListener("mousemove",this.mousemove)}}const Pd=4;function SB(t,e){let{left:n,right:r,top:i,bottom:s}=t.getBoundingClientRect(),o;if(o=t.querySelector(".cm-tooltip-arrow")){let a=o.getBoundingClientRect();i=Math.min(a.top,i),s=Math.max(a.bottom,s)}return e.clientX>=n-Pd&&e.clientX<=r+Pd&&e.clientY>=i-Pd&&e.clientY<=s+Pd}function EB(t,e,n,r,i,s){let o=t.scrollDOM.getBoundingClientRect(),a=t.documentTop+t.documentPadding.top+t.contentHeight;if(o.left>r||o.righti||Math.min(o.bottom,a)=e&&l<=n}function bk(t,e={}){let n=De.define(),r=Wt.define({create(){return[]},update(i,s){if(i.length&&(e.hideOnChange&&(s.docChanged||s.selection)?i=[]:e.hideOn&&(i=i.filter(o=>!e.hideOn(s,o))),s.docChanged)){let o=[];for(let a of i){let l=s.changes.mapPos(a.pos,-1,En.TrackDel);if(l!=null){let u=Object.assign(Object.create(null),a);u.pos=l,u.end!=null&&(u.end=s.changes.mapPos(u.end)),o.push(u)}}i=o}for(let o of s.effects)o.is(n)&&(i=o.value),o.is(wB)&&(i=[]);return i},provide:i=>Ep.from(i)});return{active:r,extension:[r,$t.define(i=>new xB(i,t,r,n,e.hoverTime||300)),vB]}}function yk(t,e){let n=t.plugin(Av);if(!n)return null;let r=n.manager.tooltips.indexOf(e);return r<0?null:n.manager.tooltipViews[r]}const wB=De.define(),BS=he.define({combine(t){let e,n;for(let r of t)e=e||r.topContainer,n=n||r.bottomContainer;return{topContainer:e,bottomContainer:n}}});function zc(t,e){let n=t.plugin(vk),r=n?n.specs.indexOf(e):-1;return r>-1?n.panels[r]:null}const vk=$t.fromClass(class{constructor(t){this.input=t.state.facet(jc),this.specs=this.input.filter(n=>n),this.panels=this.specs.map(n=>n(t));let e=t.state.facet(BS);this.top=new Rd(t,!0,e.topContainer),this.bottom=new Rd(t,!1,e.bottomContainer),this.top.sync(this.panels.filter(n=>n.top)),this.bottom.sync(this.panels.filter(n=>!n.top));for(let n of this.panels)n.dom.classList.add("cm-panel"),n.mount&&n.mount()}update(t){let e=t.state.facet(BS);this.top.container!=e.topContainer&&(this.top.sync([]),this.top=new Rd(t.view,!0,e.topContainer)),this.bottom.container!=e.bottomContainer&&(this.bottom.sync([]),this.bottom=new Rd(t.view,!1,e.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let n=t.state.facet(jc);if(n!=this.input){let r=n.filter(l=>l),i=[],s=[],o=[],a=[];for(let l of r){let u=this.specs.indexOf(l),c;u<0?(c=l(t.view),a.push(c)):(c=this.panels[u],c.update&&c.update(t)),i.push(c),(c.top?s:o).push(c)}this.specs=r,this.panels=i,this.top.sync(s),this.bottom.sync(o);for(let l of a)l.dom.classList.add("cm-panel"),l.mount&&l.mount()}else for(let r of this.panels)r.update&&r.update(t)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:t=>ce.scrollMargins.of(e=>{let n=e.plugin(t);return n&&{top:n.top.scrollMargin(),bottom:n.bottom.scrollMargin()}})});class Rd{constructor(e,n,r){this.view=e,this.top=n,this.container=r,this.dom=void 0,this.classes="",this.panels=[],this.syncClasses()}sync(e){for(let n of this.panels)n.destroy&&e.indexOf(n)<0&&n.destroy();this.panels=e,this.syncDOM()}syncDOM(){if(this.panels.length==0){this.dom&&(this.dom.remove(),this.dom=void 0);return}if(!this.dom){this.dom=document.createElement("div"),this.dom.className=this.top?"cm-panels cm-panels-top":"cm-panels cm-panels-bottom",this.dom.style[this.top?"top":"bottom"]="0";let n=this.container||this.view.dom;n.insertBefore(this.dom,this.top?n.firstChild:null)}let e=this.dom.firstChild;for(let n of this.panels)if(n.dom.parentNode==this.dom){for(;e!=n.dom;)e=$S(e);e=e.nextSibling}else this.dom.insertBefore(n.dom,e);for(;e;)e=$S(e)}scrollMargin(){return!this.dom||this.container?0:Math.max(0,this.top?this.dom.getBoundingClientRect().bottom-Math.max(0,this.view.scrollDOM.getBoundingClientRect().top):Math.min(innerHeight,this.view.scrollDOM.getBoundingClientRect().bottom)-this.dom.getBoundingClientRect().top)}syncClasses(){if(!(!this.container||this.classes==this.view.themeClasses)){for(let e of this.classes.split(" "))e&&this.container.classList.remove(e);for(let e of(this.classes=this.view.themeClasses).split(" "))e&&this.container.classList.add(e)}}}function $S(t){let e=t.nextSibling;return t.remove(),e}const jc=he.define({enables:vk});class Ui extends ca{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}}Ui.prototype.elementClass="";Ui.prototype.toDOM=void 0;Ui.prototype.mapMode=En.TrackBefore;Ui.prototype.startSide=Ui.prototype.endSide=-1;Ui.prototype.point=!0;const Ih=he.define(),_B=he.define(),CB={class:"",renderEmptyElements:!1,elementStyle:"",markers:()=>Xe.empty,lineMarker:()=>null,widgetMarker:()=>null,lineMarkerChange:null,initialSpacer:null,updateSpacer:null,domEventHandlers:{},side:"before"},hc=he.define();function xk(t){return[Sk(),hc.of({...CB,...t})]}const zS=he.define({combine:t=>t.some(e=>e)});function Sk(t){return[AB]}const AB=$t.fromClass(class{constructor(t){this.view=t,this.domAfter=null,this.prevViewport=t.viewport,this.dom=document.createElement("div"),this.dom.className="cm-gutters cm-gutters-before",this.dom.setAttribute("aria-hidden","true"),this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.gutters=t.state.facet(hc).map(e=>new VS(t,e)),this.fixed=!t.state.facet(zS);for(let e of this.gutters)e.config.side=="after"?this.getDOMAfter().appendChild(e.dom):this.dom.appendChild(e.dom);this.fixed&&(this.dom.style.position="sticky"),this.syncGutters(!1),t.scrollDOM.insertBefore(this.dom,t.contentDOM)}getDOMAfter(){return this.domAfter||(this.domAfter=document.createElement("div"),this.domAfter.className="cm-gutters cm-gutters-after",this.domAfter.setAttribute("aria-hidden","true"),this.domAfter.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.domAfter.style.position=this.fixed?"sticky":"",this.view.scrollDOM.appendChild(this.domAfter)),this.domAfter}update(t){if(this.updateGutters(t)){let e=this.prevViewport,n=t.view.viewport,r=Math.min(e.to,n.to)-Math.max(e.from,n.from);this.syncGutters(r<(n.to-n.from)*.8)}if(t.geometryChanged){let e=this.view.contentHeight/this.view.scaleY+"px";this.dom.style.minHeight=e,this.domAfter&&(this.domAfter.style.minHeight=e)}this.view.state.facet(zS)!=!this.fixed&&(this.fixed=!this.fixed,this.dom.style.position=this.fixed?"sticky":"",this.domAfter&&(this.domAfter.style.position=this.fixed?"sticky":"")),this.prevViewport=t.view.viewport}syncGutters(t){let e=this.dom.nextSibling;t&&(this.dom.remove(),this.domAfter&&this.domAfter.remove());let n=Xe.iter(this.view.state.facet(Ih),this.view.viewport.from),r=[],i=this.gutters.map(s=>new DB(s,this.view.viewport,-this.view.documentPadding.top));for(let s of this.view.viewportLineBlocks)if(r.length&&(r=[]),Array.isArray(s.type)){let o=!0;for(let a of s.type)if(a.type==Kn.Text&&o){Fb(n,r,a.from);for(let l of i)l.line(this.view,a,r);o=!1}else if(a.widget)for(let l of i)l.widget(this.view,a)}else if(s.type==Kn.Text){Fb(n,r,s.from);for(let o of i)o.line(this.view,s,r)}else if(s.widget)for(let o of i)o.widget(this.view,s);for(let s of i)s.finish();t&&(this.view.scrollDOM.insertBefore(this.dom,e),this.domAfter&&this.view.scrollDOM.appendChild(this.domAfter))}updateGutters(t){let e=t.startState.facet(hc),n=t.state.facet(hc),r=t.docChanged||t.heightChanged||t.viewportChanged||!Xe.eq(t.startState.facet(Ih),t.state.facet(Ih),t.view.viewport.from,t.view.viewport.to);if(e==n)for(let i of this.gutters)i.update(t)&&(r=!0);else{r=!0;let i=[];for(let s of n){let o=e.indexOf(s);o<0?i.push(new VS(this.view,s)):(this.gutters[o].update(t),i.push(this.gutters[o]))}for(let s of this.gutters)s.dom.remove(),i.indexOf(s)<0&&s.destroy();for(let s of i)s.config.side=="after"?this.getDOMAfter().appendChild(s.dom):this.dom.appendChild(s.dom);this.gutters=i}return r}destroy(){for(let t of this.gutters)t.destroy();this.dom.remove(),this.domAfter&&this.domAfter.remove()}},{provide:t=>ce.scrollMargins.of(e=>{let n=e.plugin(t);if(!n||n.gutters.length==0||!n.fixed)return null;let r=n.dom.offsetWidth*e.scaleX,i=n.domAfter?n.domAfter.offsetWidth*e.scaleX:0;return e.textDirection==Et.LTR?{left:r,right:i}:{right:r,left:i}})});function jS(t){return Array.isArray(t)?t:[t]}function Fb(t,e,n){for(;t.value&&t.from<=n;)t.from==n&&e.push(t.value),t.next()}class DB{constructor(e,n,r){this.gutter=e,this.height=r,this.i=0,this.cursor=Xe.iter(e.markers,n.from)}addElement(e,n,r){let{gutter:i}=this,s=(n.top-this.height)/e.scaleY,o=n.height/e.scaleY;if(this.i==i.elements.length){let a=new Ek(e,o,s,r);i.elements.push(a),i.dom.appendChild(a.dom)}else i.elements[this.i].update(e,o,s,r);this.height=n.bottom,this.i++}line(e,n,r){let i=[];Fb(this.cursor,i,n.from),r.length&&(i=i.concat(r));let s=this.gutter.config.lineMarker(e,n,i);s&&i.unshift(s);let o=this.gutter;i.length==0&&!o.config.renderEmptyElements||this.addElement(e,n,i)}widget(e,n){let r=this.gutter.config.widgetMarker(e,n.widget,n),i=r?[r]:null;for(let s of e.state.facet(_B)){let o=s(e,n.widget,n);o&&(i||(i=[])).push(o)}i&&this.addElement(e,n,i)}finish(){let e=this.gutter;for(;e.elements.length>this.i;){let n=e.elements.pop();e.dom.removeChild(n.dom),n.destroy()}}}class VS{constructor(e,n){this.view=e,this.config=n,this.elements=[],this.spacer=null,this.dom=document.createElement("div"),this.dom.className="cm-gutter"+(this.config.class?" "+this.config.class:"");for(let r in n.domEventHandlers)this.dom.addEventListener(r,i=>{let s=i.target,o;if(s!=this.dom&&this.dom.contains(s)){for(;s.parentNode!=this.dom;)s=s.parentNode;let l=s.getBoundingClientRect();o=(l.top+l.bottom)/2}else o=i.clientY;let a=e.lineBlockAtHeight(o-e.documentTop);n.domEventHandlers[r](e,a,i)&&i.preventDefault()});this.markers=jS(n.markers(e)),n.initialSpacer&&(this.spacer=new Ek(e,0,0,[n.initialSpacer(e)]),this.dom.appendChild(this.spacer.dom),this.spacer.dom.style.cssText+="visibility: hidden; pointer-events: none")}update(e){let n=this.markers;if(this.markers=jS(this.config.markers(e.view)),this.spacer&&this.config.updateSpacer){let i=this.config.updateSpacer(this.spacer.markers[0],e);i!=this.spacer.markers[0]&&this.spacer.update(e.view,0,0,[i])}let r=e.view.viewport;return!Xe.eq(this.markers,n,r.from,r.to)||(this.config.lineMarkerChange?this.config.lineMarkerChange(e):!1)}destroy(){for(let e of this.elements)e.destroy()}}class Ek{constructor(e,n,r,i){this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement("div"),this.dom.className="cm-gutterElement",this.update(e,n,r,i)}update(e,n,r,i){this.height!=n&&(this.height=n,this.dom.style.height=n+"px"),this.above!=r&&(this.dom.style.marginTop=(this.above=r)?r+"px":""),kB(this.markers,i)||this.setMarkers(e,i)}setMarkers(e,n){let r="cm-gutterElement",i=this.dom.firstChild;for(let s=0,o=0;;){let a=o,l=ss(a,l,u)||o(a,l,u):o}return r}})}});class Eg extends Ui{constructor(e){super(),this.number=e}eq(e){return this.number==e.number}toDOM(){return document.createTextNode(this.number)}}function wg(t,e){return t.state.facet(el).formatNumber(e,t.state)}const IB=hc.compute([el],t=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers(e){return e.state.facet(OB)},lineMarker(e,n,r){return r.some(i=>i.toDOM)?null:new Eg(wg(e,e.state.doc.lineAt(n.from).number))},widgetMarker:(e,n,r)=>{for(let i of e.state.facet(TB)){let s=i(e,n,r);if(s)return s}return null},lineMarkerChange:e=>e.startState.facet(el)!=e.state.facet(el),initialSpacer(e){return new Eg(wg(e,US(e.state.doc.lines)))},updateSpacer(e,n){let r=wg(n.view,US(n.view.state.doc.lines));return r==e.number?e:new Eg(r)},domEventHandlers:t.facet(el).domEventHandlers,side:"before"}));function PB(t={}){return[el.of(t),Sk(),IB]}function US(t){let e=9;for(;e{let e=[],n=-1;for(let r of t.selection.ranges){let i=t.doc.lineAt(r.head).from;i>n&&(n=i,e.push(RB.range(i)))}return Xe.of(e)});function MB(){return NB}class HS{constructor(e,n,r){this.from=e,this.to=n,this.diagnostic=r}}class zo{constructor(e,n,r){this.diagnostics=e,this.panel=n,this.selected=r}static init(e,n,r){let i=r.facet(Pi).markerFilter;i&&(e=i(e,r));let s=e.slice().sort((c,f)=>c.from-f.from||c.to-f.to),o=new _s,a=[],l=0;for(let c=0;;){let f=c==s.length?null:s[c];if(!f&&!a.length)break;let d,h;for(a.length?(d=l,h=a.reduce((m,g)=>Math.min(m,g.to),f&&f.from>d?f.from:1e8)):(d=f.from,h=f.to,a.push(f),c++);cm.from||m.to==d))a.push(m),c++,h=Math.min(m.to,h);else{h=Math.min(m.from,h);break}}let p=Ok(a);if(a.some(m=>m.from==m.to||m.from==m.to-1&&r.doc.lineAt(m.from).to==m.from))o.add(d,d,ve.widget({widget:new HB(p),diagnostics:a.slice()}));else{let m=a.reduce((g,b)=>b.markClass?g+" "+b.markClass:g,"");o.add(d,h,ve.mark({class:"cm-lintRange cm-lintRange-"+p+m,diagnostics:a.slice(),inclusiveEnd:a.some(g=>g.to>h)}))}l=h;for(let m=0;m{if(!(e&&o.diagnostics.indexOf(e)<0))if(!r)r=new HS(i,s,e||o.diagnostics[0]);else{if(o.diagnostics.indexOf(r.diagnostic)<0)return!1;r=new HS(r.from,s,r.diagnostic)}}),r}function wk(t,e){let n=e.pos,r=e.end||n,i=t.state.facet(Pi).hideOn(t,n,r);if(i!=null)return i;let s=t.startState.doc.lineAt(e.pos);return!!(t.effects.some(o=>o.is(J0))||t.changes.touchesRange(s.from,Math.max(s.to,r)))}function _k(t,e){return t.field(Cr,!1)?e:e.concat(De.appendConfig.of(Pk))}function FB(t,e){return{effects:_k(t,[J0.of(e)])}}const J0=De.define(),Dv=De.define(),Ck=De.define(),Cr=Wt.define({create(){return new zo(ve.none,null,null)},update(t,e){if(e.docChanged&&t.diagnostics.size){let n=t.diagnostics.map(e.changes),r=null,i=t.panel;if(t.selected){let s=e.changes.mapPos(t.selected.from,1);r=Pl(n,t.selected.diagnostic,s)||Pl(n,null,s)}!n.size&&i&&e.state.facet(Pi).autoPanel&&(i=null),t=new zo(n,i,r)}for(let n of e.effects)if(n.is(J0)){let r=e.state.facet(Pi).autoPanel?n.value.length?Vc.open:null:t.panel;t=zo.init(n.value,r,e.state)}else n.is(Dv)?t=new zo(t.diagnostics,n.value?Vc.open:null,t.selected):n.is(Ck)&&(t=new zo(t.diagnostics,t.panel,n.value));return t},provide:t=>[jc.from(t,e=>e.panel),ce.decorations.from(t,e=>e.diagnostics)]}),LB=ve.mark({class:"cm-lintRange cm-lintRange-active"});function BB(t,e,n){let{diagnostics:r}=t.state.field(Cr),i,s=-1,o=-1;r.between(e-(n<0?1:0),e+(n>0?1:0),(l,u,{spec:c})=>{if(e>=l&&e<=u&&(l==u||(e>l||n>0)&&(ekk(t,n,!1)))}const $B=t=>{let e=t.state.field(Cr,!1);(!e||!e.panel)&&t.dispatch({effects:_k(t.state,[Dv.of(!0)])});let n=zc(t,Vc.open);return n&&n.dom.querySelector(".cm-panel-lint ul").focus(),!0},qS=t=>{let e=t.state.field(Cr,!1);return!e||!e.panel?!1:(t.dispatch({effects:Dv.of(!1)}),!0)},zB=t=>{let e=t.state.field(Cr,!1);if(!e)return!1;let n=t.state.selection.main,r=e.diagnostics.iter(n.to+1);return!r.value&&(r=e.diagnostics.iter(0),!r.value||r.from==n.from&&r.to==n.to)?!1:(t.dispatch({selection:{anchor:r.from,head:r.to},scrollIntoView:!0}),!0)},jB=[{key:"Mod-Shift-m",run:$B,preventDefault:!0},{key:"F8",run:zB}],VB=$t.fromClass(class{constructor(t){this.view=t,this.timeout=-1,this.set=!0;let{delay:e}=t.state.facet(Pi);this.lintTime=Date.now()+e,this.run=this.run.bind(this),this.timeout=setTimeout(this.run,e)}run(){clearTimeout(this.timeout);let t=Date.now();if(tPromise.resolve(r(this.view))),r=>{this.view.state.doc==e.doc&&this.view.dispatch(FB(this.view.state,r.reduce((i,s)=>i.concat(s))))},r=>{qn(this.view.state,r)})}}update(t){let e=t.state.facet(Pi);(t.docChanged||e!=t.startState.facet(Pi)||e.needsRefresh&&e.needsRefresh(t))&&(this.lintTime=Date.now()+e.delay,this.set||(this.set=!0,this.timeout=setTimeout(this.run,e.delay)))}force(){this.set&&(this.lintTime=Date.now(),this.run())}destroy(){clearTimeout(this.timeout)}});function UB(t,e,n){let r=[],i=-1;for(let s of t)s.then(o=>{r.push(o),clearTimeout(i),r.length==t.length?e(r):i=setTimeout(()=>e(r),200)},n)}const Pi=he.define({combine(t){return{sources:t.map(e=>e.source).filter(e=>e!=null),...fi(t.map(e=>e.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null,hideOn:()=>null},{delay:Math.max,markerFilter:GS,tooltipFilter:GS,needsRefresh:(e,n)=>e?n?r=>e(r)||n(r):e:n,hideOn:(e,n)=>e?n?(r,i,s)=>e(r,i,s)||n(r,i,s):e:n,autoPanel:(e,n)=>e||n})}}});function GS(t,e){return t?e?(n,r)=>e(t(n,r),r):t:e}function Lb(t,e={}){return[Pi.of({source:t,config:e}),VB,Pk]}function Dk(t){let e=[];if(t)e:for(let{name:n}of t){for(let r=0;rs.toLowerCase()==i.toLowerCase())){e.push(i);continue e}}e.push("")}return e}function kk(t,e,n){var r;let i=n?Dk(e.actions):[];return ct("li",{class:"cm-diagnostic cm-diagnostic-"+e.severity},ct("span",{class:"cm-diagnosticText"},e.renderMessage?e.renderMessage(t):e.message),(r=e.actions)===null||r===void 0?void 0:r.map((s,o)=>{let a=!1,l=h=>{if(h.preventDefault(),a)return;a=!0;let p=Pl(t.state.field(Cr).diagnostics,e);p&&s.apply(t,p.from,p.to)},{name:u}=s,c=i[o]?u.indexOf(i[o]):-1,f=c<0?u:[u.slice(0,c),ct("u",u.slice(c,c+1)),u.slice(c+1)],d=s.markClass?" "+s.markClass:"";return ct("button",{type:"button",class:"cm-diagnosticAction"+d,onclick:l,onmousedown:l,"aria-label":` Action: ${u}${c<0?"":` (access key "${i[o]})"`}.`},f)}),e.source&&ct("div",{class:"cm-diagnosticSource"},e.source))}class HB extends Yi{constructor(e){super(),this.sev=e}eq(e){return e.sev==this.sev}toDOM(){return ct("span",{class:"cm-lintPoint cm-lintPoint-"+this.sev})}}class WS{constructor(e,n){this.diagnostic=n,this.id="item_"+Math.floor(Math.random()*4294967295).toString(16),this.dom=kk(e,n,!0),this.dom.id=this.id,this.dom.setAttribute("role","option")}}class Vc{constructor(e){this.view=e,this.items=[];let n=i=>{if(i.keyCode==27)qS(this.view),this.view.focus();else if(i.keyCode==38||i.keyCode==33)this.moveSelection((this.selectedIndex-1+this.items.length)%this.items.length);else if(i.keyCode==40||i.keyCode==34)this.moveSelection((this.selectedIndex+1)%this.items.length);else if(i.keyCode==36)this.moveSelection(0);else if(i.keyCode==35)this.moveSelection(this.items.length-1);else if(i.keyCode==13)this.view.focus();else if(i.keyCode>=65&&i.keyCode<=90&&this.selectedIndex>=0){let{diagnostic:s}=this.items[this.selectedIndex],o=Dk(s.actions);for(let a=0;a{for(let s=0;sqS(this.view)},"×")),this.update()}get selectedIndex(){let e=this.view.state.field(Cr).selected;if(!e)return-1;for(let n=0;n{for(let c of u.diagnostics){if(o.has(c))continue;o.add(c);let f=-1,d;for(let h=r;hr&&(this.items.splice(r,f-r),i=!0)),n&&d.diagnostic==n.diagnostic?d.dom.hasAttribute("aria-selected")||(d.dom.setAttribute("aria-selected","true"),s=d):d.dom.hasAttribute("aria-selected")&&d.dom.removeAttribute("aria-selected"),r++}});r({sel:s.dom.getBoundingClientRect(),panel:this.list.getBoundingClientRect()}),write:({sel:a,panel:l})=>{let u=l.height/this.list.offsetHeight;a.topl.bottom&&(this.list.scrollTop+=(a.bottom-l.bottom)/u)}})):this.selectedIndex<0&&this.list.removeAttribute("aria-activedescendant"),i&&this.sync()}sync(){let e=this.list.firstChild;function n(){let r=e;e=r.nextSibling,r.remove()}for(let r of this.items)if(r.dom.parentNode==this.list){for(;e!=r.dom;)n();e=r.dom.nextSibling}else this.list.insertBefore(r.dom,e);for(;e;)n()}moveSelection(e){if(this.selectedIndex<0)return;let n=this.view.state.field(Cr),r=Pl(n.diagnostics,this.items[e].diagnostic);r&&this.view.dispatch({selection:{anchor:r.from,head:r.to},scrollIntoView:!0,effects:Ck.of(r)})}static open(e){return new Vc(e)}}function Ph(t,e='viewBox="0 0 40 40"'){return`url('data:image/svg+xml,${encodeURIComponent(t)}')`}function Nd(t){return Ph(``,'width="6" height="3"')}const qB=ce.baseTheme({".cm-diagnostic":{padding:"3px 6px 3px 8px",marginLeft:"-1px",display:"block",whiteSpace:"pre-wrap"},".cm-diagnostic-error":{borderLeft:"5px solid #d11"},".cm-diagnostic-warning":{borderLeft:"5px solid orange"},".cm-diagnostic-info":{borderLeft:"5px solid #999"},".cm-diagnostic-hint":{borderLeft:"5px solid #66d"},".cm-diagnosticAction":{font:"inherit",border:"none",padding:"2px 4px",backgroundColor:"#444",color:"white",borderRadius:"3px",marginLeft:"8px",cursor:"pointer"},".cm-diagnosticSource":{fontSize:"70%",opacity:.7},".cm-lintRange":{backgroundPosition:"left bottom",backgroundRepeat:"repeat-x",paddingBottom:"0.7px"},".cm-lintRange-error":{backgroundImage:Nd("#d11")},".cm-lintRange-warning":{backgroundImage:Nd("orange")},".cm-lintRange-info":{backgroundImage:Nd("#999")},".cm-lintRange-hint":{backgroundImage:Nd("#66d")},".cm-lintRange-active":{backgroundColor:"#ffdd9980"},".cm-tooltip-lint":{padding:0,margin:0},".cm-lintPoint":{position:"relative","&:after":{content:'""',position:"absolute",bottom:0,left:"-2px",borderLeft:"3px solid transparent",borderRight:"3px solid transparent",borderBottom:"4px solid #d11"}},".cm-lintPoint-warning":{"&:after":{borderBottomColor:"orange"}},".cm-lintPoint-info":{"&:after":{borderBottomColor:"#999"}},".cm-lintPoint-hint":{"&:after":{borderBottomColor:"#66d"}},".cm-panel.cm-panel-lint":{position:"relative","& ul":{maxHeight:"100px",overflowY:"auto","& [aria-selected]":{backgroundColor:"#ddd","& u":{textDecoration:"underline"}},"&:focus [aria-selected]":{background_fallback:"#bdf",backgroundColor:"Highlight",color_fallback:"white",color:"HighlightText"},"& u":{textDecoration:"none"},padding:0,margin:0},"& [name=close]":{position:"absolute",top:"0",right:"2px",background:"inherit",border:"none",font:"inherit",padding:0,margin:0}}});function GB(t){return t=="error"?4:t=="warning"?3:t=="info"?2:1}function Ok(t){let e="hint",n=1;for(let r of t){let i=GB(r.severity);i>n&&(n=i,e=r.severity)}return e}class Tk extends Ui{constructor(e){super(),this.diagnostics=e,this.severity=Ok(e)}toDOM(e){let n=document.createElement("div");n.className="cm-lint-marker cm-lint-marker-"+this.severity;let r=this.diagnostics,i=e.state.facet(Z0).tooltipFilter;return i&&(r=i(r,e.state)),r.length&&(n.onmouseover=()=>KB(e,n,r)),n}}function WB(t,e){let n=r=>{let i=e.getBoundingClientRect();if(!(r.clientX>i.left-10&&r.clientXi.top-10&&r.clientYe.getBoundingClientRect()}}})}),e.onmouseout=e.onmousemove=null,WB(t,e)}let{hoverTime:i}=t.state.facet(Z0),s=setTimeout(r,i);e.onmouseout=()=>{clearTimeout(s),e.onmouseout=e.onmousemove=null},e.onmousemove=()=>{clearTimeout(s),s=setTimeout(r,i)}}function XB(t,e){let n=Object.create(null);for(let i of e){let s=t.lineAt(i.from);(n[s.from]||(n[s.from]=[])).push(i)}let r=[];for(let i in n)r.push(new Tk(n[i]).range(+i));return Xe.of(r,!0)}const YB=xk({class:"cm-gutter-lint",markers:t=>t.state.field(Bb),widgetMarker:(t,e,n)=>{let r=[];return t.state.field(Bb).between(n.from,n.to,(i,s,o)=>{i>n.from&&ir.is(kv)?r.value:n,t)},provide:t=>X0.from(t)}),JB=ce.baseTheme({".cm-gutter-lint":{width:"1.4em","& .cm-gutterElement":{padding:".2em"}},".cm-lint-marker":{width:"1em",height:"1em"},".cm-lint-marker-info":{content:Ph('')},".cm-lint-marker-warning":{content:Ph('')},".cm-lint-marker-error":{content:Ph('')}}),Pk=[Cr,ce.decorations.compute([Cr],t=>{let{selected:e,panel:n}=t.field(Cr);return!e||!n||e.from==e.to?ve.none:ve.set([LB.range(e.from,e.to)])}),bk(BB,{hideOn:wk}),qB],Z0=he.define({combine(t){return fi(t,{hoverTime:300,markerFilter:null,tooltipFilter:null})}});function ZB(t={}){return[Z0.of(t),Bb,YB,JB,Ik]}function QB(t,e=!1){const n=t.length;let r=0,i="",s=0,o=16,a=0,l=0,u=0,c=0,f=0;function d(x,S){let E=0,C=0;for(;E=48&&w<=57)C=C*16+w-48;else if(w>=65&&w<=70)C=C*16+w-65+10;else if(w>=97&&w<=102)C=C*16+w-97+10;else break;r++,E++}return E=n){x+=t.substring(S,r),f=2;break}const E=t.charCodeAt(r);if(E===34){x+=t.substring(S,r),r++;break}if(E===92){if(x+=t.substring(S,r),r++,r>=n){f=2;break}switch(t.charCodeAt(r++)){case 34:x+='"';break;case 92:x+="\\";break;case 47:x+="/";break;case 98:x+="\b";break;case 102:x+="\f";break;case 110:x+=` +`;break;case 114:x+="\r";break;case 116:x+=" ";break;case 117:const w=d(4);w>=0?x+=String.fromCharCode(w):f=4;break;default:f=5}S=r;continue}if(E>=0&&E<=31)if(Pu(E)){x+=t.substring(S,r),f=2;break}else f=6;r++}return x}function g(){if(i="",f=0,s=r,l=a,c=u,r>=n)return s=n,o=17;let x=t.charCodeAt(r);if(_g(x)){do r++,i+=String.fromCharCode(x),x=t.charCodeAt(r);while(_g(x));return o=15}if(Pu(x))return r++,i+=String.fromCharCode(x),x===13&&t.charCodeAt(r)===10&&(r++,i+=` +`),a++,u=r,o=14;switch(x){case 123:return r++,o=1;case 125:return r++,o=2;case 91:return r++,o=3;case 93:return r++,o=4;case 58:return r++,o=6;case 44:return r++,o=5;case 34:return r++,i=m(),o=10;case 47:const S=r-1;if(t.charCodeAt(r+1)===47){for(r+=2;r=12&&x<=15);return x}return{setPosition:h,getPosition:()=>r,scan:e?y:g,getToken:()=>o,getTokenValue:()=>i,getTokenOffset:()=>s,getTokenLength:()=>r-s,getTokenStartLine:()=>l,getTokenStartCharacter:()=>s-c,getTokenError:()=>f}}function _g(t){return t===32||t===9}function Pu(t){return t===10||t===13}function Fa(t){return t>=48&&t<=57}var KS;(function(t){t[t.lineFeed=10]="lineFeed",t[t.carriageReturn=13]="carriageReturn",t[t.space=32]="space",t[t._0=48]="_0",t[t._1=49]="_1",t[t._2=50]="_2",t[t._3=51]="_3",t[t._4=52]="_4",t[t._5=53]="_5",t[t._6=54]="_6",t[t._7=55]="_7",t[t._8=56]="_8",t[t._9=57]="_9",t[t.a=97]="a",t[t.b=98]="b",t[t.c=99]="c",t[t.d=100]="d",t[t.e=101]="e",t[t.f=102]="f",t[t.g=103]="g",t[t.h=104]="h",t[t.i=105]="i",t[t.j=106]="j",t[t.k=107]="k",t[t.l=108]="l",t[t.m=109]="m",t[t.n=110]="n",t[t.o=111]="o",t[t.p=112]="p",t[t.q=113]="q",t[t.r=114]="r",t[t.s=115]="s",t[t.t=116]="t",t[t.u=117]="u",t[t.v=118]="v",t[t.w=119]="w",t[t.x=120]="x",t[t.y=121]="y",t[t.z=122]="z",t[t.A=65]="A",t[t.B=66]="B",t[t.C=67]="C",t[t.D=68]="D",t[t.E=69]="E",t[t.F=70]="F",t[t.G=71]="G",t[t.H=72]="H",t[t.I=73]="I",t[t.J=74]="J",t[t.K=75]="K",t[t.L=76]="L",t[t.M=77]="M",t[t.N=78]="N",t[t.O=79]="O",t[t.P=80]="P",t[t.Q=81]="Q",t[t.R=82]="R",t[t.S=83]="S",t[t.T=84]="T",t[t.U=85]="U",t[t.V=86]="V",t[t.W=87]="W",t[t.X=88]="X",t[t.Y=89]="Y",t[t.Z=90]="Z",t[t.asterisk=42]="asterisk",t[t.backslash=92]="backslash",t[t.closeBrace=125]="closeBrace",t[t.closeBracket=93]="closeBracket",t[t.colon=58]="colon",t[t.comma=44]="comma",t[t.dot=46]="dot",t[t.doubleQuote=34]="doubleQuote",t[t.minus=45]="minus",t[t.openBrace=123]="openBrace",t[t.openBracket=91]="openBracket",t[t.plus=43]="plus",t[t.slash=47]="slash",t[t.formFeed=12]="formFeed",t[t.tab=9]="tab"})(KS||(KS={}));new Array(20).fill(0).map((t,e)=>" ".repeat(e));const La=200;new Array(La).fill(0).map((t,e)=>` `+" ".repeat(e)),new Array(La).fill(0).map((t,e)=>"\r"+" ".repeat(e)),new Array(La).fill(0).map((t,e)=>`\r `+" ".repeat(e)),new Array(La).fill(0).map((t,e)=>` `+" ".repeat(e)),new Array(La).fill(0).map((t,e)=>"\r"+" ".repeat(e)),new Array(La).fill(0).map((t,e)=>`\r -`+" ".repeat(e));var Ep;(function(t){t.DEFAULT={allowTrailingComma:!1}})(Ep||(Ep={}));function ZB(t,e=[],n=Ep.DEFAULT){let r=null,i=[];const s=[];function o(l){Array.isArray(i)?i.push(l):r!==null&&(i[r]=l)}return QB(t,{onObjectBegin:()=>{const l={};o(l),s.push(i),i=l,r=null},onObjectProperty:l=>{r=l},onObjectEnd:()=>{i=s.pop()},onArrayBegin:()=>{const l=[];o(l),s.push(i),i=l,r=null},onArrayEnd:()=>{i=s.pop()},onLiteralValue:o,onError:(l,u,c)=>{e.push({error:l,offset:u,length:c})}},n),i[0]}function QB(t,e,n=Ep.DEFAULT){const r=JB(t,!1),i=[];let s=0;function o(R){return R?()=>s===0&&R(r.getTokenOffset(),r.getTokenLength(),r.getTokenStartLine(),r.getTokenStartCharacter()):()=>!0}function a(R){return R?F=>s===0&&R(F,r.getTokenOffset(),r.getTokenLength(),r.getTokenStartLine(),r.getTokenStartCharacter()):()=>!0}function l(R){return R?F=>s===0&&R(F,r.getTokenOffset(),r.getTokenLength(),r.getTokenStartLine(),r.getTokenStartCharacter(),()=>i.slice()):()=>!0}function u(R){return R?()=>{s>0?s++:R(r.getTokenOffset(),r.getTokenLength(),r.getTokenStartLine(),r.getTokenStartCharacter(),()=>i.slice())===!1&&(s=1)}:()=>!0}function c(R){return R?()=>{s>0&&s--,s===0&&R(r.getTokenOffset(),r.getTokenLength(),r.getTokenStartLine(),r.getTokenStartCharacter())}:()=>!0}const f=u(e.onObjectBegin),d=l(e.onObjectProperty),h=c(e.onObjectEnd),p=u(e.onArrayBegin),m=c(e.onArrayEnd),g=l(e.onLiteralValue),b=a(e.onSeparator),y=o(e.onComment),x=a(e.onError),S=n&&n.disallowComments,E=n&&n.allowTrailingComma;function C(){for(;;){const R=r.scan();switch(r.getTokenError()){case 4:w(14);break;case 5:w(15);break;case 3:w(13);break;case 1:S||w(11);break;case 2:w(12);break;case 6:w(16);break}switch(R){case 12:case 13:S?w(10):y();break;case 16:w(1);break;case 15:case 14:break;default:return R}}}function w(R,F=[],V=[]){if(x(R),F.length+V.length>0){let B=r.getToken();for(;B!==17;){if(F.indexOf(B)!==-1){C();break}else if(V.indexOf(B)!==-1)break;B=C()}}}function A(R){const F=r.getTokenValue();return R?g(F):(d(F),i.push(F)),C(),!0}function _(){switch(r.getToken()){case 11:const R=r.getTokenValue();let F=Number(R);isNaN(F)&&(w(2),F=0),g(F);break;case 7:g(null);break;case 8:g(!0);break;case 9:g(!1);break;default:return!1}return C(),!0}function D(){return r.getToken()!==10?(w(3,[],[2,5]),!1):(A(!1),r.getToken()===6?(b(":"),C(),P()||w(4,[],[2,5])):w(5,[],[2,5]),i.pop(),!0)}function I(){f(),C();let R=!1;for(;r.getToken()!==2&&r.getToken()!==17;){if(r.getToken()===5){if(R||w(4,[],[]),b(","),C(),r.getToken()===2&&E)break}else R&&w(6,[],[]);D()||w(4,[],[2,5]),R=!0}return h(),r.getToken()!==2?w(7,[2],[]):C(),!0}function N(){p(),C();let R=!0,F=!1;for(;r.getToken()!==4&&r.getToken()!==17;){if(r.getToken()===5){if(F||w(4,[],[]),b(","),C(),r.getToken()===4&&E)break}else F&&w(6,[],[]);R?(i.push(0),R=!1):i[i.length-1]++,P()||w(4,[],[4,5]),F=!0}return m(),R||i.pop(),r.getToken()!==4?w(8,[4],[]):C(),!0}function P(){switch(r.getToken()){case 3:return N();case 1:return I();case 10:return A(!0);default:return _()}}return C(),r.getToken()===17?n.allowEmptyContent?!0:(w(4,[],[]),!1):P()?(r.getToken()!==17&&w(9,[],[]),!0):(w(4,[],[]),!1)}var KS;(function(t){t[t.None=0]="None",t[t.UnexpectedEndOfComment=1]="UnexpectedEndOfComment",t[t.UnexpectedEndOfString=2]="UnexpectedEndOfString",t[t.UnexpectedEndOfNumber=3]="UnexpectedEndOfNumber",t[t.InvalidUnicode=4]="InvalidUnicode",t[t.InvalidEscapeCharacter=5]="InvalidEscapeCharacter",t[t.InvalidCharacter=6]="InvalidCharacter"})(KS||(KS={}));var XS;(function(t){t[t.OpenBraceToken=1]="OpenBraceToken",t[t.CloseBraceToken=2]="CloseBraceToken",t[t.OpenBracketToken=3]="OpenBracketToken",t[t.CloseBracketToken=4]="CloseBracketToken",t[t.CommaToken=5]="CommaToken",t[t.ColonToken=6]="ColonToken",t[t.NullKeyword=7]="NullKeyword",t[t.TrueKeyword=8]="TrueKeyword",t[t.FalseKeyword=9]="FalseKeyword",t[t.StringLiteral=10]="StringLiteral",t[t.NumericLiteral=11]="NumericLiteral",t[t.LineCommentTrivia=12]="LineCommentTrivia",t[t.BlockCommentTrivia=13]="BlockCommentTrivia",t[t.LineBreakTrivia=14]="LineBreakTrivia",t[t.Trivia=15]="Trivia",t[t.Unknown=16]="Unknown",t[t.EOF=17]="EOF"})(XS||(XS={}));const e$=ZB;var YS;(function(t){t[t.InvalidSymbol=1]="InvalidSymbol",t[t.InvalidNumberFormat=2]="InvalidNumberFormat",t[t.PropertyNameExpected=3]="PropertyNameExpected",t[t.ValueExpected=4]="ValueExpected",t[t.ColonExpected=5]="ColonExpected",t[t.CommaExpected=6]="CommaExpected",t[t.CloseBraceExpected=7]="CloseBraceExpected",t[t.CloseBracketExpected=8]="CloseBracketExpected",t[t.EndOfFileExpected=9]="EndOfFileExpected",t[t.InvalidCommentToken=10]="InvalidCommentToken",t[t.UnexpectedEndOfComment=11]="UnexpectedEndOfComment",t[t.UnexpectedEndOfString=12]="UnexpectedEndOfString",t[t.UnexpectedEndOfNumber=13]="UnexpectedEndOfNumber",t[t.InvalidUnicode=14]="InvalidUnicode",t[t.InvalidEscapeCharacter=15]="InvalidEscapeCharacter",t[t.InvalidCharacter=16]="InvalidCharacter"})(YS||(YS={}));function t$(t){switch(t){case 1:return"InvalidSymbol";case 2:return"InvalidNumberFormat";case 3:return"PropertyNameExpected";case 4:return"ValueExpected";case 5:return"ColonExpected";case 6:return"CommaExpected";case 7:return"CloseBraceExpected";case 8:return"CloseBracketExpected";case 9:return"EndOfFileExpected";case 10:return"InvalidCommentToken";case 11:return"UnexpectedEndOfComment";case 12:return"UnexpectedEndOfString";case 13:return"UnexpectedEndOfNumber";case 14:return"InvalidUnicode";case 15:return"InvalidEscapeCharacter";case 16:return"InvalidCharacter"}return""}const n$=Fb(t=>{const e=t.state.doc.toString();if(e.length===0)return[];const n=[];return e$(e,n),n.map(r=>({from:r.offset,to:r.offset+1,severity:"error",message:t$(r.error)}))}),Pk=1024;let r$=0;class _g{constructor(e,n){this.from=e,this.to=n}}class Ve{constructor(e={}){this.id=r$++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")})}add(e){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof e!="function"&&(e=fr.match(e)),n=>{let r=e(n);return r===void 0?null:[this,r]}}}Ve.closedBy=new Ve({deserialize:t=>t.split(" ")});Ve.openedBy=new Ve({deserialize:t=>t.split(" ")});Ve.group=new Ve({deserialize:t=>t.split(" ")});Ve.isolate=new Ve({deserialize:t=>{if(t&&t!="rtl"&&t!="ltr"&&t!="auto")throw new RangeError("Invalid value for isolate: "+t);return t||"auto"}});Ve.contextHash=new Ve({perNode:!0});Ve.lookAhead=new Ve({perNode:!0});Ve.mounted=new Ve({perNode:!0});class wp{constructor(e,n,r){this.tree=e,this.overlay=n,this.parser=r}static get(e){return e&&e.props&&e.props[Ve.mounted.id]}}const i$=Object.create(null);class fr{constructor(e,n,r,i=0){this.name=e,this.props=n,this.id=r,this.flags=i}static define(e){let n=e.props&&e.props.length?Object.create(null):i$,r=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(e.name==null?8:0),i=new fr(e.name||"",n,e.id,r);if(e.props){for(let s of e.props)if(Array.isArray(s)||(s=s(i)),s){if(s[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");n[s[0].id]=s[1]}}return i}prop(e){return this.props[e.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(e){if(typeof e=="string"){if(this.name==e)return!0;let n=this.prop(Ve.group);return n?n.indexOf(e)>-1:!1}return this.id==e}static match(e){let n=Object.create(null);for(let r in e)for(let i of r.split(" "))n[i]=e[r];return r=>{for(let i=r.prop(Ve.group),s=-1;s<(i?i.length:0);s++){let o=n[s<0?r.name:i[s]];if(o)return o}}}}fr.none=new fr("",Object.create(null),0,8);class kv{constructor(e){this.types=e;for(let n=0;n0;for(let l=this.cursor(o|hn.IncludeAnonymous);;){let u=!1;if(l.from<=s&&l.to>=i&&(!a&&l.type.isAnonymous||n(l)!==!1)){if(l.firstChild())continue;u=!0}for(;u&&r&&(a||!l.type.isAnonymous)&&r(l),!l.nextSibling();){if(!l.parent())return;u=!0}}}prop(e){return e.perNode?this.props?this.props[e.id]:void 0:this.type.prop(e)}get propValues(){let e=[];if(this.props)for(let n in this.props)e.push([+n,this.props[n]]);return e}balance(e={}){return this.children.length<=8?this:Iv(fr.none,this.children,this.positions,0,this.children.length,0,this.length,(n,r,i)=>new en(this.type,n,r,i,this.propValues),e.makeTree||((n,r,i)=>new en(fr.none,n,r,i)))}static build(e){return l$(e)}}en.empty=new en(fr.none,[],[],0);class Ov{constructor(e,n){this.buffer=e,this.index=n}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new Ov(this.buffer,this.index)}}class bo{constructor(e,n,r){this.buffer=e,this.length=n,this.set=r}get type(){return fr.none}toString(){let e=[];for(let n=0;n0));l=o[l+3]);return a}slice(e,n,r){let i=this.buffer,s=new Uint16Array(n-e),o=0;for(let a=e,l=0;a=e&&ne;case 1:return n<=e&&r>e;case 2:return r>e;case 4:return!0}}function Uc(t,e,n,r){for(var i;t.from==t.to||(n<1?t.from>=e:t.from>e)||(n>-1?t.to<=e:t.to0?a.length:-1;e!=u;e+=n){let c=a[e],f=l[e]+o.from;if(Rk(i,r,f,f+c.length)){if(c instanceof bo){if(s&hn.ExcludeBuffers)continue;let d=c.findChild(0,c.buffer.length,n,r-f,i);if(d>-1)return new Xs(new s$(o,c,e,f),null,d)}else if(s&hn.IncludeAnonymous||!c.type.isAnonymous||Tv(c)){let d;if(!(s&hn.IgnoreMounts)&&(d=wp.get(c))&&!d.overlay)return new Vr(d.tree,f,e,o);let h=new Vr(c,f,e,o);return s&hn.IncludeAnonymous||!h.type.isAnonymous?h:h.nextChild(n<0?c.children.length-1:0,n,r,i)}}}if(s&hn.IncludeAnonymous||!o.type.isAnonymous||(o.index>=0?e=o.index+n:e=n<0?-1:o._parent._tree.children.length,o=o._parent,!o))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(e){return this.nextChild(0,1,e,2)}childBefore(e){return this.nextChild(this._tree.children.length-1,-1,e,-2)}enter(e,n,r=0){let i;if(!(r&hn.IgnoreOverlays)&&(i=wp.get(this._tree))&&i.overlay){let s=e-this.from;for(let{from:o,to:a}of i.overlay)if((n>0?o<=s:o=s:a>s))return new Vr(i.tree,i.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,e,n,r)}nextSignificantParent(){let e=this;for(;e.type.isAnonymous&&e._parent;)e=e._parent;return e}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}}function ZS(t,e,n,r){let i=t.cursor(),s=[];if(!i.firstChild())return s;if(n!=null){for(let o=!1;!o;)if(o=i.type.is(n),!i.nextSibling())return s}for(;;){if(r!=null&&i.type.is(r))return s;if(i.type.is(e)&&s.push(i.node),!i.nextSibling())return r==null?s:[]}}function Bb(t,e,n=e.length-1){for(let r=t;n>=0;r=r.parent){if(!r)return!1;if(!r.type.isAnonymous){if(e[n]&&e[n]!=r.name)return!1;n--}}return!0}class s${constructor(e,n,r,i){this.parent=e,this.buffer=n,this.index=r,this.start=i}}class Xs extends Nk{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(e,n,r){super(),this.context=e,this._parent=n,this.index=r,this.type=e.buffer.set.types[e.buffer.buffer[r]]}child(e,n,r){let{buffer:i}=this.context,s=i.findChild(this.index+4,i.buffer[this.index+3],e,n-this.context.start,r);return s<0?null:new Xs(this.context,this,s)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(e){return this.child(1,e,2)}childBefore(e){return this.child(-1,e,-2)}enter(e,n,r=0){if(r&hn.ExcludeBuffers)return null;let{buffer:i}=this.context,s=i.findChild(this.index+4,i.buffer[this.index+3],n>0?1:-1,e-this.context.start,n);return s<0?null:new Xs(this.context,this,s)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(e){return this._parent?null:this.context.parent.nextChild(this.context.index+e,e,0,4)}get nextSibling(){let{buffer:e}=this.context,n=e.buffer[this.index+3];return n<(this._parent?e.buffer[this._parent.index+3]:e.buffer.length)?new Xs(this.context,this._parent,n):this.externalSibling(1)}get prevSibling(){let{buffer:e}=this.context,n=this._parent?this._parent.index+4:0;return this.index==n?this.externalSibling(-1):new Xs(this.context,this._parent,e.findChild(n,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],n=[],{buffer:r}=this.context,i=this.index+4,s=r.buffer[this.index+3];if(s>i){let o=r.buffer[this.index+1];e.push(r.slice(i,s,o)),n.push(0)}return new en(this.type,e,n,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function Mk(t){if(!t.length)return null;let e=0,n=t[0];for(let s=1;sn.from||o.to=e){let a=new Vr(o.tree,o.overlay[0].from+s.from,-1,s);(i||(i=[r])).push(Uc(a,e,n,!1))}}return i?Mk(i):r}class $b{get name(){return this.type.name}constructor(e,n=0){if(this.mode=n,this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,e instanceof Vr)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let r=e._parent;r;r=r._parent)this.stack.unshift(r.index);this.bufferNode=e,this.yieldBuf(e.index)}}yieldNode(e){return e?(this._tree=e,this.type=e.type,this.from=e.from,this.to=e.to,!0):!1}yieldBuf(e,n){this.index=e;let{start:r,buffer:i}=this.buffer;return this.type=n||i.set.types[i.buffer[e]],this.from=r+i.buffer[e+1],this.to=r+i.buffer[e+2],!0}yield(e){return e?e instanceof Vr?(this.buffer=null,this.yieldNode(e)):(this.buffer=e.context,this.yieldBuf(e.index,e.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(e,n,r){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,n,r,this.mode));let{buffer:i}=this.buffer,s=i.findChild(this.index+4,i.buffer[this.index+3],e,n-this.buffer.start,r);return s<0?!1:(this.stack.push(this.index),this.yieldBuf(s))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(e){return this.enterChild(1,e,2)}childBefore(e){return this.enterChild(-1,e,-2)}enter(e,n,r=this.mode){return this.buffer?r&hn.ExcludeBuffers?!1:this.enterChild(1,e,n):this.yield(this._tree.enter(e,n,r))}parent(){if(!this.buffer)return this.yieldNode(this.mode&hn.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&hn.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(e)}sibling(e){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+e,e,0,4,this.mode)):!1;let{buffer:n}=this.buffer,r=this.stack.length-1;if(e<0){let i=r<0?0:this.stack[r]+4;if(this.index!=i)return this.yieldBuf(n.findChild(i,this.index,-1,0,4))}else{let i=n.buffer[this.index+3];if(i<(r<0?n.buffer.length:n.buffer[this.stack[r]+3]))return this.yieldBuf(i)}return r<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+e,e,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(e){let n,r,{buffer:i}=this;if(i){if(e>0){if(this.index-1)for(let s=n+e,o=e<0?-1:r._tree.children.length;s!=o;s+=e){let a=r._tree.children[s];if(this.mode&hn.IncludeAnonymous||a instanceof bo||!a.type.isAnonymous||Tv(a))return!1}return!0}move(e,n){if(n&&this.enterChild(e,0,4))return!0;for(;;){if(this.sibling(e))return!0;if(this.atLastNode(e)||!this.parent())return!1}}next(e=!0){return this.move(1,e)}prev(e=!0){return this.move(-1,e)}moveTo(e,n=0){for(;(this.from==this.to||(n<1?this.from>=e:this.from>e)||(n>-1?this.to<=e:this.to=0;){for(let o=e;o;o=o._parent)if(o.index==i){if(i==this.index)return o;n=o,r=s+1;break e}i=this.stack[--s]}for(let i=r;i=0;s--){if(s<0)return Bb(this._tree,e,i);let o=r[n.buffer[this.stack[s]]];if(!o.isAnonymous){if(e[i]&&e[i]!=o.name)return!1;i--}}return!0}}function Tv(t){return t.children.some(e=>e instanceof bo||!e.type.isAnonymous||Tv(e))}function l$(t){var e;let{buffer:n,nodeSet:r,maxBufferLength:i=Pk,reused:s=[],minRepeatType:o=r.types.length}=t,a=Array.isArray(n)?new Ov(n,n.length):n,l=r.types,u=0,c=0;function f(E,C,w,A,_,D){let{id:I,start:N,end:P,size:R}=a,F=c,V=u;for(;R<0;)if(a.next(),R==-1){let se=s[I];w.push(se),A.push(N-E);return}else if(R==-3){u=I;return}else if(R==-4){c=I;return}else throw new RangeError(`Unrecognized record size: ${R}`);let B=l[I],G,H,ie=N-E;if(P-N<=i&&(H=g(a.pos-C,_))){let se=new Uint16Array(H.size-H.skip),$=a.pos-H.size,ee=se.length;for(;a.pos>$;)ee=b(H.start,se,ee);G=new bo(se,P-H.start,r),ie=H.start-E}else{let se=a.pos-R;a.next();let $=[],ee=[],pe=I>=o?I:-1,fe=0,me=P;for(;a.pos>se;)pe>=0&&a.id==pe&&a.size>=0?(a.end<=me-i&&(p($,ee,N,fe,a.end,me,pe,F,V),fe=$.length,me=a.end),a.next()):D>2500?d(N,se,$,ee):f(N,se,$,ee,pe,D+1);if(pe>=0&&fe>0&&fe<$.length&&p($,ee,N,fe,N,me,pe,F,V),$.reverse(),ee.reverse(),pe>-1&&fe>0){let Me=h(B,V);G=Iv(B,$,ee,0,$.length,0,P-N,Me,Me)}else G=m(B,$,ee,P-N,F-P,V)}w.push(G),A.push(ie)}function d(E,C,w,A){let _=[],D=0,I=-1;for(;a.pos>C;){let{id:N,start:P,end:R,size:F}=a;if(F>4)a.next();else{if(I>-1&&P=0;R-=3)N[F++]=_[R],N[F++]=_[R+1]-P,N[F++]=_[R+2]-P,N[F++]=F;w.push(new bo(N,_[2]-P,r)),A.push(P-E)}}function h(E,C){return(w,A,_)=>{let D=0,I=w.length-1,N,P;if(I>=0&&(N=w[I])instanceof en){if(!I&&N.type==E&&N.length==_)return N;(P=N.prop(Ve.lookAhead))&&(D=A[I]+N.length+P)}return m(E,w,A,_,D,C)}}function p(E,C,w,A,_,D,I,N,P){let R=[],F=[];for(;E.length>A;)R.push(E.pop()),F.push(C.pop()+w-_);E.push(m(r.types[I],R,F,D-_,N-D,P)),C.push(_-w)}function m(E,C,w,A,_,D,I){if(D){let N=[Ve.contextHash,D];I=I?[N].concat(I):[N]}if(_>25){let N=[Ve.lookAhead,_];I=I?[N].concat(I):[N]}return new en(E,C,w,A,I)}function g(E,C){let w=a.fork(),A=0,_=0,D=0,I=w.end-i,N={size:0,start:0,skip:0};e:for(let P=w.pos-E;w.pos>P;){let R=w.size;if(w.id==C&&R>=0){N.size=A,N.start=_,N.skip=D,D+=4,A+=4,w.next();continue}let F=w.pos-R;if(R<0||F=o?4:0,B=w.start;for(w.next();w.pos>F;){if(w.size<0)if(w.size==-3)V+=4;else break e;else w.id>=o&&(V+=4);w.next()}_=B,A+=R,D+=V}return(C<0||A==E)&&(N.size=A,N.start=_,N.skip=D),N.size>4?N:void 0}function b(E,C,w){let{id:A,start:_,end:D,size:I}=a;if(a.next(),I>=0&&A4){let P=a.pos-(I-4);for(;a.pos>P;)w=b(E,C,w)}C[--w]=N,C[--w]=D-E,C[--w]=_-E,C[--w]=A}else I==-3?u=A:I==-4&&(c=A);return w}let y=[],x=[];for(;a.pos>0;)f(t.start||0,t.bufferStart||0,y,x,-1,0);let S=(e=t.length)!==null&&e!==void 0?e:y.length?x[0]+y[0].length:0;return new en(l[t.topID],y.reverse(),x.reverse(),S)}const QS=new WeakMap;function Ph(t,e){if(!t.isAnonymous||e instanceof bo||e.type!=t)return 1;let n=QS.get(e);if(n==null){n=1;for(let r of e.children){if(r.type!=t||!(r instanceof en)){n=1;break}n+=Ph(t,r)}QS.set(e,n)}return n}function Iv(t,e,n,r,i,s,o,a,l){let u=0;for(let p=r;p=c)break;C+=w}if(x==S+1){if(C>c){let w=p[S];h(w.children,w.positions,0,w.children.length,m[S]+y);continue}f.push(p[S])}else{let w=m[x-1]+p[x-1].length-E;f.push(Iv(t,p,m,S,x,E,w,null,l))}d.push(E+y-s)}}return h(e,n,r,i,0),(a||l)(f,d,o)}class na{constructor(e,n,r,i,s=!1,o=!1){this.from=e,this.to=n,this.tree=r,this.offset=i,this.open=(s?1:0)|(o?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(e,n=[],r=!1){let i=[new na(0,e.length,e,0,!1,r)];for(let s of n)s.to>e.length&&i.push(s);return i}static applyChanges(e,n,r=128){if(!n.length)return e;let i=[],s=1,o=e.length?e[0]:null;for(let a=0,l=0,u=0;;a++){let c=a=r)for(;o&&o.from=d.from||f<=d.to||u){let h=Math.max(d.from,l)-u,p=Math.min(d.to,f)-u;d=h>=p?null:new na(h,p,d.tree,d.offset+u,a>0,!!c)}if(d&&i.push(d),o.to>f)break;o=snew _g(i.from,i.to)):[new _g(0,0)]:[new _g(0,e.length)],this.createParse(e,n||[],r)}parse(e,n,r){let i=this.startParse(e,n,r);for(;;){let s=i.advance();if(s)return s}}};class u${constructor(e){this.string=e}get length(){return this.string.length}chunk(e){return this.string.slice(e)}get lineChunks(){return!1}read(e,n){return this.string.slice(e,n)}}new Ve({perNode:!0});var eE={};class _p{constructor(e,n,r,i,s,o,a,l,u,c=0,f){this.p=e,this.stack=n,this.state=r,this.reducePos=i,this.pos=s,this.score=o,this.buffer=a,this.bufferBase=l,this.curContext=u,this.lookAhead=c,this.parent=f}toString(){return`[${this.stack.filter((e,n)=>n%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(e,n,r=0){let i=e.parser.context;return new _p(e,[],n,r,r,0,[],0,i?new tE(i,i.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(e,n){this.stack.push(this.state,n,this.bufferBase+this.buffer.length),this.state=e}reduce(e){var n;let r=e>>19,i=e&65535,{parser:s}=this.p,o=this.reducePos=2e3&&!(!((n=this.p.parser.nodeSet.types[i])===null||n===void 0)&&n.isAnonymous)&&(u==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=c):this.p.lastBigReductionSizel;)this.stack.pop();this.reduceContext(i,u)}storeNode(e,n,r,i=4,s=!1){if(e==0&&(!this.stack.length||this.stack[this.stack.length-1]0&&o.buffer[a-4]==0&&o.buffer[a-1]>-1){if(n==r)return;if(o.buffer[a-2]>=n){o.buffer[a-2]=r;return}}}if(!s||this.pos==r)this.buffer.push(e,n,r,i);else{let o=this.buffer.length;if(o>0&&this.buffer[o-4]!=0){let a=!1;for(let l=o;l>0&&this.buffer[l-2]>r;l-=4)if(this.buffer[l-1]>=0){a=!0;break}if(a)for(;o>0&&this.buffer[o-2]>r;)this.buffer[o]=this.buffer[o-4],this.buffer[o+1]=this.buffer[o-3],this.buffer[o+2]=this.buffer[o-2],this.buffer[o+3]=this.buffer[o-1],o-=4,i>4&&(i-=4)}this.buffer[o]=e,this.buffer[o+1]=n,this.buffer[o+2]=r,this.buffer[o+3]=i}}shift(e,n,r,i){if(e&131072)this.pushState(e&65535,this.pos);else if((e&262144)==0){let s=e,{parser:o}=this.p;(i>this.pos||n<=o.maxNode)&&(this.pos=i,o.stateFlag(s,1)||(this.reducePos=i)),this.pushState(s,r),this.shiftContext(n,r),n<=o.maxNode&&this.buffer.push(n,r,i,4)}else this.pos=i,this.shiftContext(n,r),n<=this.p.parser.maxNode&&this.buffer.push(n,r,i,4)}apply(e,n,r,i){e&65536?this.reduce(e):this.shift(e,n,r,i)}useNode(e,n){let r=this.p.reused.length-1;(r<0||this.p.reused[r]!=e)&&(this.p.reused.push(e),r++);let i=this.pos;this.reducePos=this.pos=i+e.length,this.pushState(n,i),this.buffer.push(r,i,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,e,this,this.p.stream.reset(this.pos-e.length)))}split(){let e=this,n=e.buffer.length;for(;n>0&&e.buffer[n-2]>e.reducePos;)n-=4;let r=e.buffer.slice(n),i=e.bufferBase+n;for(;e&&i==e.bufferBase;)e=e.parent;return new _p(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,r,i,this.curContext,this.lookAhead,e)}recoverByDelete(e,n){let r=e<=this.p.parser.maxNode;r&&this.storeNode(e,this.pos,n,4),this.storeNode(0,this.pos,n,r?8:4),this.pos=this.reducePos=n,this.score-=190}canShift(e){for(let n=new c$(this);;){let r=this.p.parser.stateSlot(n.state,4)||this.p.parser.hasAction(n.state,e);if(r==0)return!1;if((r&65536)==0)return!0;n.reduce(r)}}recoverByInsert(e){if(this.stack.length>=300)return[];let n=this.p.parser.nextStates(this.state);if(n.length>8||this.stack.length>=120){let i=[];for(let s=0,o;sl&1&&a==o)||i.push(n[s],o)}n=i}let r=[];for(let i=0;i>19,i=n&65535,s=this.stack.length-r*3;if(s<0||e.getGoto(this.stack[s],i,!1)<0){let o=this.findForcedReduction();if(o==null)return!1;n=o}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(n),!0}findForcedReduction(){let{parser:e}=this.p,n=[],r=(i,s)=>{if(!n.includes(i))return n.push(i),e.allActions(i,o=>{if(!(o&393216))if(o&65536){let a=(o>>19)-s;if(a>1){let l=o&65535,u=this.stack.length-a*3;if(u>=0&&e.getGoto(this.stack[u],l,!1)>=0)return a<<19|65536|l}}else{let a=r(o,s+1);if(a!=null)return a}})};return r(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(this.stack.length!=3)return!1;let{parser:e}=this.p;return e.data[e.stateSlot(this.state,1)]==65535&&!e.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(e){if(this.state!=e.state||this.stack.length!=e.stack.length)return!1;for(let n=0;nthis.lookAhead&&(this.emitLookAhead(),this.lookAhead=e)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}}class tE{constructor(e,n){this.tracker=e,this.context=n,this.hash=e.strict?e.hash(n):0}}class c${constructor(e){this.start=e,this.state=e.state,this.stack=e.stack,this.base=this.stack.length}reduce(e){let n=e&65535,r=e>>19;r==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(r-1)*3;let i=this.start.p.parser.getGoto(this.stack[this.base-3],n,!0);this.state=i}}class Cp{constructor(e,n,r){this.stack=e,this.pos=n,this.index=r,this.buffer=e.buffer,this.index==0&&this.maybeNext()}static create(e,n=e.bufferBase+e.buffer.length){return new Cp(e,n,n-e.bufferBase)}maybeNext(){let e=this.stack.parent;e!=null&&(this.index=this.stack.bufferBase-e.bufferBase,this.stack=e,this.buffer=e.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,this.index==0&&this.maybeNext()}fork(){return new Cp(this.stack,this.pos,this.index)}}function Md(t,e=Uint16Array){if(typeof t!="string")return t;let n=null;for(let r=0,i=0;r=92&&o--,o>=34&&o--;let l=o-32;if(l>=46&&(l-=46,a=!0),s+=l,a)break;s*=46}n?n[i++]=s:n=new e(s)}return n}class Rh{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const nE=new Rh;class f${constructor(e,n){this.input=e,this.ranges=n,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=nE,this.rangeIndex=0,this.pos=this.chunkPos=n[0].from,this.range=n[0],this.end=n[n.length-1].to,this.readNext()}resolveOffset(e,n){let r=this.range,i=this.rangeIndex,s=this.pos+e;for(;sr.to:s>=r.to;){if(i==this.ranges.length-1)return null;let o=this.ranges[++i];s+=o.from-r.to,r=o}return s}clipPos(e){if(e>=this.range.from&&ee)return Math.max(e,n.from);return this.end}peek(e){let n=this.chunkOff+e,r,i;if(n>=0&&n=this.chunk2Pos&&ra.to&&(this.chunk2=this.chunk2.slice(0,a.to-r)),i=this.chunk2.charCodeAt(0)}}return r>=this.token.lookAhead&&(this.token.lookAhead=r+1),i}acceptToken(e,n=0){let r=n?this.resolveOffset(n,-1):this.pos;if(r==null||r=this.chunk2Pos&&this.posthis.range.to?e.slice(0,this.range.to-this.pos):e,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(e=1){for(this.chunkOff+=e;this.pos+e>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();e-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=e,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}reset(e,n){if(n?(this.token=n,n.start=e,n.lookAhead=e+1,n.value=n.extended=-1):this.token=nE,this.pos!=e){if(this.pos=e,e==this.end)return this.setDone(),this;for(;e=this.range.to;)this.range=this.ranges[++this.rangeIndex];e>=this.chunkPos&&e=this.chunkPos&&n<=this.chunkPos+this.chunk.length)return this.chunk.slice(e-this.chunkPos,n-this.chunkPos);if(e>=this.chunk2Pos&&n<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(e-this.chunk2Pos,n-this.chunk2Pos);if(e>=this.range.from&&n<=this.range.to)return this.input.read(e,n);let r="";for(let i of this.ranges){if(i.from>=n)break;i.to>e&&(r+=this.input.read(Math.max(i.from,e),Math.min(i.to,n)))}return r}}class dl{constructor(e,n){this.data=e,this.id=n}token(e,n){let{parser:r}=n.p;d$(this.data,e,n,this.id,r.data,r.tokenPrecTable)}}dl.prototype.contextual=dl.prototype.fallback=dl.prototype.extend=!1;dl.prototype.fallback=dl.prototype.extend=!1;function d$(t,e,n,r,i,s){let o=0,a=1<0){let p=t[h];if(l.allows(p)&&(e.token.value==-1||e.token.value==p||h$(p,e.token.value,i,s))){e.acceptToken(p);break}}let c=e.next,f=0,d=t[o+2];if(e.next<0&&d>f&&t[u+d*3-3]==65535){o=t[u+d*3-1];continue e}for(;f>1,p=u+h+(h<<1),m=t[p],g=t[p+1]||65536;if(c=g)f=h+1;else{o=t[p+2],e.advance();continue e}}break}}function rE(t,e,n){for(let r=e,i;(i=t[r])!=65535;r++)if(i==n)return r-e;return-1}function h$(t,e,n,r){let i=rE(n,r,e);return i<0||rE(n,r,t)e)&&!r.type.isError)return n<0?Math.max(0,Math.min(r.to-1,e-25)):Math.min(t.length,Math.max(r.from+1,e+25));if(n<0?r.prevSibling():r.nextSibling())break;if(!r.parent())return n<0?0:t.length}}class p${constructor(e,n){this.fragments=e,this.nodeSet=n,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let e=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(e){for(this.safeFrom=e.openStart?iE(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?iE(e.tree,e.to+e.offset,-1)-e.offset:e.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(e.tree),this.start.push(-e.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(e){if(ee)return this.nextStart=o,null;if(s instanceof en){if(o==e){if(o=Math.max(this.safeFrom,e)&&(this.trees.push(s),this.start.push(o),this.index.push(0))}else this.index[n]++,this.nextStart=o+s.length}}}class m${constructor(e,n){this.stream=n,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map(r=>new Rh)}getActions(e){let n=0,r=null,{parser:i}=e.p,{tokenizers:s}=i,o=i.stateSlot(e.state,3),a=e.curContext?e.curContext.hash:0,l=0;for(let u=0;uf.end+25&&(l=Math.max(f.lookAhead,l)),f.value!=0)){let d=n;if(f.extended>-1&&(n=this.addActions(e,f.extended,f.end,n)),n=this.addActions(e,f.value,f.end,n),!c.extend&&(r=f,n>d))break}}for(;this.actions.length>n;)this.actions.pop();return l&&e.setLookAhead(l),!r&&e.pos==this.stream.end&&(r=new Rh,r.value=e.p.parser.eofTerm,r.start=r.end=e.pos,n=this.addActions(e,r.value,r.end,n)),this.mainToken=r,this.actions}getMainToken(e){if(this.mainToken)return this.mainToken;let n=new Rh,{pos:r,p:i}=e;return n.start=r,n.end=Math.min(r+1,i.stream.end),n.value=r==i.stream.end?i.parser.eofTerm:0,n}updateCachedToken(e,n,r){let i=this.stream.clipPos(r.pos);if(n.token(this.stream.reset(i,e),r),e.value>-1){let{parser:s}=r.p;for(let o=0;o=0&&r.p.parser.dialect.allows(a>>1)){(a&1)==0?e.value=a>>1:e.extended=a>>1;break}}}else e.value=0,e.end=this.stream.clipPos(i+1)}putAction(e,n,r,i){for(let s=0;se.bufferLength*4?new p$(r,e.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let e=this.stacks,n=this.minStackPos,r=this.stacks=[],i,s;if(this.bigReductionCount>300&&e.length==1){let[o]=e;for(;o.forceReduce()&&o.stack.length&&o.stack[o.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let o=0;on)r.push(a);else{if(this.advanceStack(a,r,e))continue;{i||(i=[],s=[]),i.push(a);let l=this.tokens.getMainToken(a);s.push(l.value,l.end)}}break}}if(!r.length){let o=i&&y$(i);if(o)return pr&&console.log("Finish with "+this.stackID(o)),this.stackToTree(o);if(this.parser.strict)throw pr&&i&&console.log("Stuck with token "+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):"none")),new SyntaxError("No parse at "+n);this.recovering||(this.recovering=5)}if(this.recovering&&i){let o=this.stoppedAt!=null&&i[0].pos>this.stoppedAt?i[0]:this.runRecovery(i,s,r);if(o)return pr&&console.log("Force-finish "+this.stackID(o)),this.stackToTree(o.forceAll())}if(this.recovering){let o=this.recovering==1?1:this.recovering*3;if(r.length>o)for(r.sort((a,l)=>l.score-a.score);r.length>o;)r.pop();r.some(a=>a.reducePos>n)&&this.recovering--}else if(r.length>1){e:for(let o=0;o500&&u.buffer.length>500)if((a.score-u.score||a.buffer.length-u.buffer.length)>0)r.splice(l--,1);else{r.splice(o--,1);continue e}}}r.length>12&&r.splice(12,r.length-12)}this.minStackPos=r[0].pos;for(let o=1;o ":"";if(this.stoppedAt!=null&&i>this.stoppedAt)return e.forceReduce()?e:null;if(this.fragments){let u=e.curContext&&e.curContext.tracker.strict,c=u?e.curContext.hash:0;for(let f=this.fragments.nodeAt(i);f;){let d=this.parser.nodeSet.types[f.type.id]==f.type?s.getGoto(e.state,f.type.id):-1;if(d>-1&&f.length&&(!u||(f.prop(Ve.contextHash)||0)==c))return e.useNode(f,d),pr&&console.log(o+this.stackID(e)+` (via reuse of ${s.getName(f.type.id)})`),!0;if(!(f instanceof en)||f.children.length==0||f.positions[0]>0)break;let h=f.children[0];if(h instanceof en&&f.positions[0]==0)f=h;else break}}let a=s.stateSlot(e.state,4);if(a>0)return e.reduce(a),pr&&console.log(o+this.stackID(e)+` (via always-reduce ${s.getName(a&65535)})`),!0;if(e.stack.length>=8400)for(;e.stack.length>6e3&&e.forceReduce(););let l=this.tokens.getActions(e);for(let u=0;ui?n.push(p):r.push(p)}return!1}advanceFully(e,n){let r=e.pos;for(;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>r)return sE(e,n),!0}}runRecovery(e,n,r){let i=null,s=!1;for(let o=0;o ":"";if(a.deadEnd&&(s||(s=!0,a.restart(),pr&&console.log(c+this.stackID(a)+" (restarted)"),this.advanceFully(a,r))))continue;let f=a.split(),d=c;for(let h=0;f.forceReduce()&&h<10&&(pr&&console.log(d+this.stackID(f)+" (via force-reduce)"),!this.advanceFully(f,r));h++)pr&&(d=this.stackID(f)+" -> ");for(let h of a.recoverByInsert(l))pr&&console.log(c+this.stackID(h)+" (via recover-insert)"),this.advanceFully(h,r);this.stream.end>a.pos?(u==a.pos&&(u++,l=0),a.recoverByDelete(l,u),pr&&console.log(c+this.stackID(a)+` (via recover-delete ${this.parser.getName(l)})`),sE(a,r)):(!i||i.scoree.topRules[a][1]),i=[];for(let a=0;a=0)s(c,l,a[u++]);else{let f=a[u+-c];for(let d=-c;d>0;d--)s(a[u++],l,f);u++}}}this.nodeSet=new kv(n.map((a,l)=>fr.define({name:l>=this.minRepeatTerm?void 0:a,id:l,props:i[l],top:r.indexOf(l)>-1,error:l==0,skipped:e.skippedNodes&&e.skippedNodes.indexOf(l)>-1}))),e.propSources&&(this.nodeSet=this.nodeSet.extend(...e.propSources)),this.strict=!1,this.bufferLength=Pk;let o=Md(e.tokenData);this.context=e.context,this.specializerSpecs=e.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let a=0;atypeof a=="number"?new dl(o,a):a),this.topRules=e.topRules,this.dialects=e.dialects||{},this.dynamicPrecedences=e.dynamicPrecedences||null,this.tokenPrecTable=e.tokenPrec,this.termNames=e.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(e,n,r){let i=new g$(this,e,n,r);for(let s of this.wrappers)i=s(i,e,n,r);return i}getGoto(e,n,r=!1){let i=this.goto;if(n>=i[0])return-1;for(let s=i[n+1];;){let o=i[s++],a=o&1,l=i[s++];if(a&&r)return l;for(let u=s+(o>>1);s0}validAction(e,n){return!!this.allActions(e,r=>r==n?!0:null)}allActions(e,n){let r=this.stateSlot(e,4),i=r?n(r):void 0;for(let s=this.stateSlot(e,1);i==null;s+=3){if(this.data[s]==65535)if(this.data[s+1]==1)s=ss(this.data,s+2);else break;i=n(ss(this.data,s+1))}return i}nextStates(e){let n=[];for(let r=this.stateSlot(e,1);;r+=3){if(this.data[r]==65535)if(this.data[r+1]==1)r=ss(this.data,r+2);else break;if((this.data[r+2]&1)==0){let i=this.data[r+1];n.some((s,o)=>o&1&&s==i)||n.push(this.data[r],i)}}return n}configure(e){let n=Object.assign(Object.create(Ap.prototype),this);if(e.props&&(n.nodeSet=this.nodeSet.extend(...e.props)),e.top){let r=this.topRules[e.top];if(!r)throw new RangeError(`Invalid top rule name ${e.top}`);n.top=r}return e.tokenizers&&(n.tokenizers=this.tokenizers.map(r=>{let i=e.tokenizers.find(s=>s.from==r);return i?i.to:r})),e.specializers&&(n.specializers=this.specializers.slice(),n.specializerSpecs=this.specializerSpecs.map((r,i)=>{let s=e.specializers.find(a=>a.from==r.external);if(!s)return r;let o=Object.assign(Object.assign({},r),{external:s.to});return n.specializers[i]=oE(o),o})),e.contextTracker&&(n.context=e.contextTracker),e.dialect&&(n.dialect=this.parseDialect(e.dialect)),e.strict!=null&&(n.strict=e.strict),e.wrap&&(n.wrappers=n.wrappers.concat(e.wrap)),e.bufferLength!=null&&(n.bufferLength=e.bufferLength),n}hasWrappers(){return this.wrappers.length>0}getName(e){return this.termNames?this.termNames[e]:String(e<=this.maxNode&&this.nodeSet.types[e].name||e)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(e){let n=this.dynamicPrecedences;return n==null?0:n[e]||0}parseDialect(e){let n=Object.keys(this.dialects),r=n.map(()=>!1);if(e)for(let s of e.split(" ")){let o=n.indexOf(s);o>=0&&(r[o]=!0)}let i=null;for(let s=0;sr)&&n.p.parser.stateFlag(n.state,2)&&(!e||e.scoret.external(n,r)<<1|e}return t.get}let v$=0;class Fr{constructor(e,n,r,i){this.name=e,this.set=n,this.base=r,this.modified=i,this.id=v$++}toString(){let{name:e}=this;for(let n of this.modified)n.name&&(e=`${n.name}(${e})`);return e}static define(e,n){let r=typeof e=="string"?e:"?";if(e instanceof Fr&&(n=e),n!=null&&n.base)throw new Error("Can not derive from a modified tag");let i=new Fr(r,[],null,[]);if(i.set.push(i),n)for(let s of n.set)i.set.push(s);return i}static defineModifier(e){let n=new Dp(e);return r=>r.modified.indexOf(n)>-1?r:Dp.get(r.base||r,r.modified.concat(n).sort((i,s)=>i.id-s.id))}}let x$=0;class Dp{constructor(e){this.name=e,this.instances=[],this.id=x$++}static get(e,n){if(!n.length)return e;let r=n[0].instances.find(a=>a.base==e&&S$(n,a.modified));if(r)return r;let i=[],s=new Fr(e.name,i,e,n);for(let a of n)a.instances.push(s);let o=E$(n);for(let a of e.set)if(!a.modified.length)for(let l of o)i.push(Dp.get(a,l));return s}}function S$(t,e){return t.length==e.length&&t.every((n,r)=>n==e[r])}function E$(t){let e=[[]];for(let n=0;nr.length-n.length)}function Lk(t){let e=Object.create(null);for(let n in t){let r=t[n];Array.isArray(r)||(r=[r]);for(let i of n.split(" "))if(i){let s=[],o=2,a=i;for(let f=0;;){if(a=="..."&&f>0&&f+3==i.length){o=1;break}let d=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(a);if(!d)throw new RangeError("Invalid path: "+i);if(s.push(d[0]=="*"?"":d[0][0]=='"'?JSON.parse(d[0]):d[0]),f+=d[0].length,f==i.length)break;let h=i[f++];if(f==i.length&&h=="!"){o=0;break}if(h!="/")throw new RangeError("Invalid path: "+i);a=i.slice(f)}let l=s.length-1,u=s[l];if(!u)throw new RangeError("Invalid path: "+i);let c=new kp(r,o,l>0?s.slice(0,l):null);e[u]=c.sort(e[u])}}return Bk.add(e)}const Bk=new Ve;let kp=class{constructor(e,n,r,i){this.tags=e,this.mode=n,this.context=r,this.next=i}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(e){return!e||e.depth{let o=i;for(let a of s)for(let l of a.set){let u=n[l.id];if(u){o=o?o+" "+u:u;break}}return o},scope:r}}function w$(t,e){let n=null;for(let r of t){let i=r.style(e);i&&(n=n?n+" "+i:i)}return n}function _$(t,e,n,r=0,i=t.length){let s=new C$(r,Array.isArray(e)?e:[e],n);s.highlightRange(t.cursor(),r,i,"",s.highlighters),s.flush(i)}class C${constructor(e,n,r){this.at=e,this.highlighters=n,this.span=r,this.class=""}startSpan(e,n){n!=this.class&&(this.flush(e),e>this.at&&(this.at=e),this.class=n)}flush(e){e>this.at&&this.class&&this.span(this.at,e,this.class)}highlightRange(e,n,r,i,s){let{type:o,from:a,to:l}=e;if(a>=r||l<=n)return;o.isTop&&(s=this.highlighters.filter(h=>!h.scope||h.scope(o)));let u=i,c=A$(e)||kp.empty,f=w$(s,c.tags);if(f&&(u&&(u+=" "),u+=f,c.mode==1&&(i+=(i?" ":"")+f)),this.startSpan(Math.max(n,a),u),c.opaque)return;let d=e.tree&&e.tree.prop(Ve.mounted);if(d&&d.overlay){let h=e.node.enter(d.overlay[0].from+a,1),p=this.highlighters.filter(g=>!g.scope||g.scope(d.tree.type)),m=e.firstChild();for(let g=0,b=a;;g++){let y=g=x||!e.nextSibling())););if(!y||x>r)break;b=y.to+a,b>n&&(this.highlightRange(h.cursor(),Math.max(n,y.from+a),Math.min(r,b),"",p),this.startSpan(Math.min(r,b),u))}m&&e.parent()}else if(e.firstChild()){d&&(i="");do if(!(e.to<=n)){if(e.from>=r)break;this.highlightRange(e,n,r,i,s),this.startSpan(Math.min(r,e.to),u)}while(e.nextSibling());e.parent()}}}function A$(t){let e=t.type.prop(Bk);for(;e&&e.context&&!t.matchContext(e.context);)e=e.next;return e||null}const le=Fr.define,Fd=le(),Rs=le(),aE=le(Rs),lE=le(Rs),Ns=le(),Ld=le(Ns),Ag=le(Ns),Ei=le(),Oo=le(Ei),vi=le(),xi=le(),zb=le(),Ru=le(zb),Bd=le(),oe={comment:Fd,lineComment:le(Fd),blockComment:le(Fd),docComment:le(Fd),name:Rs,variableName:le(Rs),typeName:aE,tagName:le(aE),propertyName:lE,attributeName:le(lE),className:le(Rs),labelName:le(Rs),namespace:le(Rs),macroName:le(Rs),literal:Ns,string:Ld,docString:le(Ld),character:le(Ld),attributeValue:le(Ld),number:Ag,integer:le(Ag),float:le(Ag),bool:le(Ns),regexp:le(Ns),escape:le(Ns),color:le(Ns),url:le(Ns),keyword:vi,self:le(vi),null:le(vi),atom:le(vi),unit:le(vi),modifier:le(vi),operatorKeyword:le(vi),controlKeyword:le(vi),definitionKeyword:le(vi),moduleKeyword:le(vi),operator:xi,derefOperator:le(xi),arithmeticOperator:le(xi),logicOperator:le(xi),bitwiseOperator:le(xi),compareOperator:le(xi),updateOperator:le(xi),definitionOperator:le(xi),typeOperator:le(xi),controlOperator:le(xi),punctuation:zb,separator:le(zb),bracket:Ru,angleBracket:le(Ru),squareBracket:le(Ru),paren:le(Ru),brace:le(Ru),content:Ei,heading:Oo,heading1:le(Oo),heading2:le(Oo),heading3:le(Oo),heading4:le(Oo),heading5:le(Oo),heading6:le(Oo),contentSeparator:le(Ei),list:le(Ei),quote:le(Ei),emphasis:le(Ei),strong:le(Ei),link:le(Ei),monospace:le(Ei),strikethrough:le(Ei),inserted:le(),deleted:le(),changed:le(),invalid:le(),meta:Bd,documentMeta:le(Bd),annotation:le(Bd),processingInstruction:le(Bd),definition:Fr.defineModifier("definition"),constant:Fr.defineModifier("constant"),function:Fr.defineModifier("function"),standard:Fr.defineModifier("standard"),local:Fr.defineModifier("local"),special:Fr.defineModifier("special")};for(let t in oe){let e=oe[t];e instanceof Fr&&(e.name=t)}$k([{tag:oe.link,class:"tok-link"},{tag:oe.heading,class:"tok-heading"},{tag:oe.emphasis,class:"tok-emphasis"},{tag:oe.strong,class:"tok-strong"},{tag:oe.keyword,class:"tok-keyword"},{tag:oe.atom,class:"tok-atom"},{tag:oe.bool,class:"tok-bool"},{tag:oe.url,class:"tok-url"},{tag:oe.labelName,class:"tok-labelName"},{tag:oe.inserted,class:"tok-inserted"},{tag:oe.deleted,class:"tok-deleted"},{tag:oe.literal,class:"tok-literal"},{tag:oe.string,class:"tok-string"},{tag:oe.number,class:"tok-number"},{tag:[oe.regexp,oe.escape,oe.special(oe.string)],class:"tok-string2"},{tag:oe.variableName,class:"tok-variableName"},{tag:oe.local(oe.variableName),class:"tok-variableName tok-local"},{tag:oe.definition(oe.variableName),class:"tok-variableName tok-definition"},{tag:oe.special(oe.variableName),class:"tok-variableName2"},{tag:oe.definition(oe.propertyName),class:"tok-propertyName tok-definition"},{tag:oe.typeName,class:"tok-typeName"},{tag:oe.namespace,class:"tok-namespace"},{tag:oe.className,class:"tok-className"},{tag:oe.macroName,class:"tok-macroName"},{tag:oe.propertyName,class:"tok-propertyName"},{tag:oe.operator,class:"tok-operator"},{tag:oe.comment,class:"tok-comment"},{tag:oe.meta,class:"tok-meta"},{tag:oe.invalid,class:"tok-invalid"},{tag:oe.punctuation,class:"tok-punctuation"}]);const D$=Lk({String:oe.string,Number:oe.number,"True False":oe.bool,PropertyName:oe.propertyName,Null:oe.null,", :":oe.separator,"[ ]":oe.squareBracket,"{ }":oe.brace}),k$=Ap.deserialize({version:14,states:"$bOVQPOOOOQO'#Cb'#CbOnQPO'#CeOvQPO'#ClOOQO'#Cr'#CrQOQPOOOOQO'#Cg'#CgO}QPO'#CfO!SQPO'#CtOOQO,59P,59PO![QPO,59PO!aQPO'#CuOOQO,59W,59WO!iQPO,59WOVQPO,59QOqQPO'#CmO!nQPO,59`OOQO1G.k1G.kOVQPO'#CnO!vQPO,59aOOQO1G.r1G.rOOQO1G.l1G.lOOQO,59X,59XOOQO-E6k-E6kOOQO,59Y,59YOOQO-E6l-E6l",stateData:"#O~OeOS~OQSORSOSSOTSOWQO_ROgPO~OVXOgUO~O^[O~PVO[^O~O]_OVhX~OVaO~O]bO^iX~O^dO~O]_OVha~O]bO^ia~O",goto:"!kjPPPPPPkPPkqwPPPPk{!RPPP!XP!e!hXSOR^bQWQRf_TVQ_Q`WRg`QcZRicQTOQZRQe^RhbRYQR]R",nodeNames:"⚠ JsonText True False Null Number String } { Object Property PropertyName : , ] [ Array",maxTerm:25,nodeProps:[["isolate",-2,6,11,""],["openedBy",7,"{",14,"["],["closedBy",8,"}",15,"]"]],propSources:[D$],skippedNodes:[0],repeatNodeCount:2,tokenData:"(|~RaXY!WYZ!W]^!Wpq!Wrs!]|}$u}!O$z!Q!R%T!R![&c![!]&t!}#O&y#P#Q'O#Y#Z'T#b#c'r#h#i(Z#o#p(r#q#r(w~!]Oe~~!`Wpq!]qr!]rs!xs#O!]#O#P!}#P;'S!];'S;=`$o<%lO!]~!}Og~~#QXrs!]!P!Q!]#O#P!]#U#V!]#Y#Z!]#b#c!]#f#g!]#h#i!]#i#j#m~#pR!Q![#y!c!i#y#T#Z#y~#|R!Q![$V!c!i$V#T#Z$V~$YR!Q![$c!c!i$c#T#Z$c~$fR!Q![!]!c!i!]#T#Z!]~$rP;=`<%l!]~$zO]~~$}Q!Q!R%T!R![&c~%YRT~!O!P%c!g!h%w#X#Y%w~%fP!Q![%i~%nRT~!Q![%i!g!h%w#X#Y%w~%zR{|&T}!O&T!Q![&Z~&WP!Q![&Z~&`PT~!Q![&Z~&hST~!O!P%c!Q![&c!g!h%w#X#Y%w~&yO[~~'OO_~~'TO^~~'WP#T#U'Z~'^P#`#a'a~'dP#g#h'g~'jP#X#Y'm~'rOR~~'uP#i#j'x~'{P#`#a(O~(RP#`#a(U~(ZOS~~(^P#f#g(a~(dP#i#j(g~(jP#X#Y(m~(rOQ~~(wOW~~(|OV~",tokenizers:[0],topRules:{JsonText:[0,1]},tokenPrec:0});var Dg;const tl=new Ve;function O$(t){return he.define({combine:t?e=>e.concat(t):void 0})}const T$=new Ve;class ai{constructor(e,n,r=[],i=""){this.data=e,this.name=i,Ue.prototype.hasOwnProperty("tree")||Object.defineProperty(Ue.prototype,"tree",{get(){return tn(this)}}),this.parser=n,this.extension=[yo.of(this),Ue.languageData.of((s,o,a)=>{let l=uE(s,o,a),u=l.type.prop(tl);if(!u)return[];let c=s.facet(u),f=l.type.prop(T$);if(f){let d=l.resolve(o-l.from,a);for(let h of f)if(h.test(d,s)){let p=s.facet(h.facet);return h.type=="replace"?p:p.concat(c)}}return c})].concat(r)}isActiveAt(e,n,r=-1){return uE(e,n,r).type.prop(tl)==this.data}findRegions(e){let n=e.facet(yo);if((n==null?void 0:n.data)==this.data)return[{from:0,to:e.doc.length}];if(!n||!n.allowsNesting)return[];let r=[],i=(s,o)=>{if(s.prop(tl)==this.data){r.push({from:o,to:o+s.length});return}let a=s.prop(Ve.mounted);if(a){if(a.tree.prop(tl)==this.data){if(a.overlay)for(let l of a.overlay)r.push({from:l.from+o,to:l.to+o});else r.push({from:o,to:o+s.length});return}else if(a.overlay){let l=r.length;if(i(a.tree,a.overlay[0].from+o),r.length>l)return}}for(let l=0;lr.isTop?n:void 0)]}),e.name)}configure(e,n){return new Op(this.data,this.parser.configure(e),n||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function tn(t){let e=t.field(ai.state,!1);return e?e.tree:en.empty}class I${constructor(e){this.doc=e,this.cursorPos=0,this.string="",this.cursor=e.iter()}get length(){return this.doc.length}syncTo(e){return this.string=this.cursor.next(e-this.cursorPos).value,this.cursorPos=e+this.string.length,this.cursorPos-this.string.length}chunk(e){return this.syncTo(e),this.string}get lineChunks(){return!0}read(e,n){let r=this.cursorPos-this.string.length;return e=this.cursorPos?this.doc.sliceString(e,n):this.string.slice(e-r,n-r)}}let Nu=null;class Tp{constructor(e,n,r=[],i,s,o,a,l){this.parser=e,this.state=n,this.fragments=r,this.tree=i,this.treeLen=s,this.viewport=o,this.skipped=a,this.scheduleOn=l,this.parse=null,this.tempSkipped=[]}static create(e,n,r){return new Tp(e,n,[],en.empty,0,r,[],null)}startParse(){return this.parser.startParse(new I$(this.state.doc),this.fragments)}work(e,n){return n!=null&&n>=this.state.doc.length&&(n=void 0),this.tree!=en.empty&&this.isDone(n??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var r;if(typeof e=="number"){let i=Date.now()+e;e=()=>Date.now()>i}for(this.parse||(this.parse=this.startParse()),n!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>n)&&n=this.treeLen&&((this.parse.stoppedAt==null||this.parse.stoppedAt>e)&&this.parse.stopAt(e),this.withContext(()=>{for(;!(n=this.parse.advance()););}),this.treeLen=e,this.tree=n,this.fragments=this.withoutTempSkipped(na.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let n=Nu;Nu=this;try{return e()}finally{Nu=n}}withoutTempSkipped(e){for(let n;n=this.tempSkipped.pop();)e=cE(e,n.from,n.to);return e}changes(e,n){let{fragments:r,tree:i,treeLen:s,viewport:o,skipped:a}=this;if(this.takeTree(),!e.empty){let l=[];if(e.iterChangedRanges((u,c,f,d)=>l.push({fromA:u,toA:c,fromB:f,toB:d})),r=na.applyChanges(r,l),i=en.empty,s=0,o={from:e.mapPos(o.from,-1),to:e.mapPos(o.to,1)},this.skipped.length){a=[];for(let u of this.skipped){let c=e.mapPos(u.from,1),f=e.mapPos(u.to,-1);ce.from&&(this.fragments=cE(this.fragments,i,s),this.skipped.splice(r--,1))}return this.skipped.length>=n?!1:(this.reset(),!0)}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(e,n){this.skipped.push({from:e,to:n})}static getSkippingParser(e){return new class extends Fk{createParse(n,r,i){let s=i[0].from,o=i[i.length-1].to;return{parsedPos:s,advance(){let l=Nu;if(l){for(let u of i)l.tempSkipped.push(u);e&&(l.scheduleOn=l.scheduleOn?Promise.all([l.scheduleOn,e]):e)}return this.parsedPos=o,new en(fr.none,[],[],o-s)},stoppedAt:null,stopAt(){}}}}}isDone(e){e=Math.min(e,this.state.doc.length);let n=this.fragments;return this.treeLen>=e&&n.length&&n[0].from==0&&n[0].to>=e}static get(){return Nu}}function cE(t,e,n){return na.applyChanges(t,[{fromA:e,toA:n,fromB:e,toB:n}])}class Rl{constructor(e){this.context=e,this.tree=e.tree}apply(e){if(!e.docChanged&&this.tree==this.context.tree)return this;let n=this.context.changes(e.changes,e.state),r=this.context.treeLen==e.startState.doc.length?void 0:Math.max(e.changes.mapPos(this.context.treeLen),n.viewport.to);return n.work(20,r)||n.takeTree(),new Rl(n)}static init(e){let n=Math.min(3e3,e.doc.length),r=Tp.create(e.facet(yo).parser,e,{from:0,to:n});return r.work(20,n)||r.takeTree(),new Rl(r)}}ai.state=Wt.define({create:Rl.init,update(t,e){for(let n of e.effects)if(n.is(ai.setState))return n.value;return e.startState.facet(yo)!=e.state.facet(yo)?Rl.init(e.state):t.apply(e)}});let zk=t=>{let e=setTimeout(()=>t(),500);return()=>clearTimeout(e)};typeof requestIdleCallback<"u"&&(zk=t=>{let e=-1,n=setTimeout(()=>{e=requestIdleCallback(t,{timeout:400})},100);return()=>e<0?clearTimeout(n):cancelIdleCallback(e)});const kg=typeof navigator<"u"&&(!((Dg=navigator.scheduling)===null||Dg===void 0)&&Dg.isInputPending)?()=>navigator.scheduling.isInputPending():null,P$=$t.fromClass(class{constructor(e){this.view=e,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(e){let n=this.view.state.field(ai.state).context;(n.updateViewport(e.view.viewport)||this.view.viewport.to>n.treeLen)&&this.scheduleWork(),(e.docChanged||e.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(n)}scheduleWork(){if(this.working)return;let{state:e}=this.view,n=e.field(ai.state);(n.tree!=n.context.tree||!n.context.isDone(e.doc.length))&&(this.working=zk(this.work))}work(e){this.working=null;let n=Date.now();if(this.chunkEndi+1e3,l=s.context.work(()=>kg&&kg()||Date.now()>o,i+(a?0:1e5));this.chunkBudget-=Date.now()-n,(l||this.chunkBudget<=0)&&(s.context.takeTree(),this.view.dispatch({effects:ai.setState.of(new Rl(s.context))})),this.chunkBudget>0&&!(l&&!a)&&this.scheduleWork(),this.checkAsyncSchedule(s.context)}checkAsyncSchedule(e){e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(n=>qn(this.view.state,n)).then(()=>this.workScheduled--),e.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),yo=he.define({combine(t){return t.length?t[0]:null},enables:t=>[ai.state,P$,ce.contentAttributes.compute([t],e=>{let n=e.facet(t);return n&&n.name?{"data-language":n.name}:{}})]});class R${constructor(e,n=[]){this.language=e,this.support=n,this.extension=[e,n]}}const N$=he.define(),Bf=he.define({combine:t=>{if(!t.length)return" ";let e=t[0];if(!e||/\S/.test(e)||Array.from(e).some(n=>n!=e[0]))throw new Error("Invalid indent unit: "+JSON.stringify(t[0]));return e}});function Ip(t){let e=t.facet(Bf);return e.charCodeAt(0)==9?t.tabSize*e.length:e.length}function Hc(t,e){let n="",r=t.tabSize,i=t.facet(Bf)[0];if(i==" "){for(;e>=r;)n+=" ",e-=r;i=" "}for(let s=0;s=e?M$(t,n,e):null}class Z0{constructor(e,n={}){this.state=e,this.options=n,this.unit=Ip(e)}lineAt(e,n=1){let r=this.state.doc.lineAt(e),{simulateBreak:i,simulateDoubleBreak:s}=this.options;return i!=null&&i>=r.from&&i<=r.to?s&&i==e?{text:"",from:e}:(n<0?i-1&&(s+=o-this.countColumn(r,r.search(/\S|$/))),s}countColumn(e,n=e.length){return ru(e,this.state.tabSize,n)}lineIndent(e,n=1){let{text:r,from:i}=this.lineAt(e,n),s=this.options.overrideIndentation;if(s){let o=s(i);if(o>-1)return o}return this.countColumn(r,r.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const jk=new Ve;function M$(t,e,n){let r=e.resolveStack(n),i=e.resolveInner(n,-1).resolve(n,0).enterUnfinishedNodesBefore(n);if(i!=r.node){let s=[];for(let o=i;o&&!(o.fromr.node.to||o.from==r.node.from&&o.type==r.node.type);o=o.parent)s.push(o);for(let o=s.length-1;o>=0;o--)r={node:s[o],next:r}}return Vk(r,t,n)}function Vk(t,e,n){for(let r=t;r;r=r.next){let i=L$(r.node);if(i)return i(Rv.create(e,n,r))}return 0}function F$(t){return t.pos==t.options.simulateBreak&&t.options.simulateDoubleBreak}function L$(t){let e=t.type.prop(jk);if(e)return e;let n=t.firstChild,r;if(n&&(r=n.type.prop(Ve.closedBy))){let i=t.lastChild,s=i&&r.indexOf(i.name)>-1;return o=>j$(o,!0,1,void 0,s&&!F$(o)?i.from:void 0)}return t.parent==null?B$:null}function B$(){return 0}class Rv extends Z0{constructor(e,n,r){super(e.state,e.options),this.base=e,this.pos=n,this.context=r}get node(){return this.context.node}static create(e,n,r){return new Rv(e,n,r)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(e){let n=this.state.doc.lineAt(e.from);for(;;){let r=e.resolve(n.from);for(;r.parent&&r.parent.from==r.from;)r=r.parent;if($$(r,e))break;n=this.state.doc.lineAt(r.from)}return this.lineIndent(n.from)}continue(){return Vk(this.context.next,this.base,this.pos)}}function $$(t,e){for(let n=e;n;n=n.parent)if(t==n)return!0;return!1}function z$(t){let e=t.node,n=e.childAfter(e.from),r=e.lastChild;if(!n)return null;let i=t.options.simulateBreak,s=t.state.doc.lineAt(n.from),o=i==null||i<=s.from?s.to:Math.min(s.to,i);for(let a=n.to;;){let l=e.childAfter(a);if(!l||l==r)return null;if(!l.type.isSkipped){if(l.from>=o)return null;let u=/^ */.exec(s.text.slice(n.to-s.from))[0].length;return{from:n.from,to:n.to+u}}a=l.to}}function j$(t,e,n,r,i){let s=t.textAfter,o=s.match(/^\s*/)[0].length,a=r&&s.slice(o,o+r.length)==r||i==t.pos+o,l=z$(t);return l?a?t.column(l.from):t.column(l.to):t.baseIndent+(a?0:t.unit*n)}function fE({except:t,units:e=1}={}){return n=>{let r=t&&t.test(n.textAfter);return n.baseIndent+(r?0:e*n.unit)}}const V$=200;function U$(){return Ue.transactionFilter.of(t=>{if(!t.docChanged||!t.isUserEvent("input.type")&&!t.isUserEvent("input.complete"))return t;let e=t.startState.languageDataAt("indentOnInput",t.startState.selection.main.head);if(!e.length)return t;let n=t.newDoc,{head:r}=t.newSelection.main,i=n.lineAt(r);if(r>i.from+V$)return t;let s=n.sliceString(i.from,r);if(!e.some(u=>u.test(s)))return t;let{state:o}=t,a=-1,l=[];for(let{head:u}of o.selection.ranges){let c=o.doc.lineAt(u);if(c.from==a)continue;a=c.from;let f=Pv(o,c.from);if(f==null)continue;let d=/^\s*/.exec(c.text)[0],h=Hc(o,f);d!=h&&l.push({from:c.from,to:c.from+d.length,insert:h})}return l.length?[t,{changes:l,sequential:!0}]:t})}const H$=he.define(),Uk=new Ve;function q$(t){let e=t.firstChild,n=t.lastChild;return e&&e.ton)continue;if(s&&a.from=e&&u.to>n&&(s=u)}}return s}function W$(t){let e=t.lastChild;return e&&e.to==t.to&&e.type.isError}function Pp(t,e,n){for(let r of t.facet(H$)){let i=r(t,e,n);if(i)return i}return G$(t,e,n)}function Hk(t,e){let n=e.mapPos(t.from,1),r=e.mapPos(t.to,-1);return n>=r?void 0:{from:n,to:r}}const Q0=De.define({map:Hk}),$f=De.define({map:Hk});function qk(t){let e=[];for(let{head:n}of t.state.selection.ranges)e.some(r=>r.from<=n&&r.to>=n)||e.push(t.lineBlockAt(n));return e}const ha=Wt.define({create(){return ve.none},update(t,e){e.isUserEvent("delete")&&e.changes.iterChangedRanges((n,r)=>t=dE(t,n,r)),t=t.map(e.changes);for(let n of e.effects)if(n.is(Q0)&&!K$(t,n.value.from,n.value.to)){let{preparePlaceholder:r}=e.state.facet(Kk),i=r?ve.replace({widget:new t7(r(e.state,n.value))}):hE;t=t.update({add:[i.range(n.value.from,n.value.to)]})}else n.is($f)&&(t=t.update({filter:(r,i)=>n.value.from!=r||n.value.to!=i,filterFrom:n.value.from,filterTo:n.value.to}));return e.selection&&(t=dE(t,e.selection.main.head)),t},provide:t=>ce.decorations.from(t),toJSON(t,e){let n=[];return t.between(0,e.doc.length,(r,i)=>{n.push(r,i)}),n},fromJSON(t){if(!Array.isArray(t)||t.length%2)throw new RangeError("Invalid JSON for fold state");let e=[];for(let n=0;n{ie&&(r=!0)}),r?t.update({filterFrom:e,filterTo:n,filter:(i,s)=>i>=n||s<=e}):t}function Rp(t,e,n){var r;let i=null;return(r=t.field(ha,!1))===null||r===void 0||r.between(e,n,(s,o)=>{(!i||i.from>s)&&(i={from:s,to:o})}),i}function K$(t,e,n){let r=!1;return t.between(e,e,(i,s)=>{i==e&&s==n&&(r=!0)}),r}function Gk(t,e){return t.field(ha,!1)?e:e.concat(De.appendConfig.of(Xk()))}const X$=t=>{for(let e of qk(t)){let n=Pp(t.state,e.from,e.to);if(n)return t.dispatch({effects:Gk(t.state,[Q0.of(n),Wk(t,n)])}),!0}return!1},Y$=t=>{if(!t.state.field(ha,!1))return!1;let e=[];for(let n of qk(t)){let r=Rp(t.state,n.from,n.to);r&&e.push($f.of(r),Wk(t,r,!1))}return e.length&&t.dispatch({effects:e}),e.length>0};function Wk(t,e,n=!0){let r=t.state.doc.lineAt(e.from).number,i=t.state.doc.lineAt(e.to).number;return ce.announce.of(`${t.state.phrase(n?"Folded lines":"Unfolded lines")} ${r} ${t.state.phrase("to")} ${i}.`)}const J$=t=>{let{state:e}=t,n=[];for(let r=0;r{let e=t.state.field(ha,!1);if(!e||!e.size)return!1;let n=[];return e.between(0,t.state.doc.length,(r,i)=>{n.push($f.of({from:r,to:i}))}),t.dispatch({effects:n}),!0},Q$=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:X$},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:Y$},{key:"Ctrl-Alt-[",run:J$},{key:"Ctrl-Alt-]",run:Z$}],e7={placeholderDOM:null,preparePlaceholder:null,placeholderText:"…"},Kk=he.define({combine(t){return fi(t,e7)}});function Xk(t){return[ha,i7]}function Yk(t,e){let{state:n}=t,r=n.facet(Kk),i=o=>{let a=t.lineBlockAt(t.posAtDOM(o.target)),l=Rp(t.state,a.from,a.to);l&&t.dispatch({effects:$f.of(l)}),o.preventDefault()};if(r.placeholderDOM)return r.placeholderDOM(t,i,e);let s=document.createElement("span");return s.textContent=r.placeholderText,s.setAttribute("aria-label",n.phrase("folded code")),s.title=n.phrase("unfold"),s.className="cm-foldPlaceholder",s.onclick=i,s}const hE=ve.replace({widget:new class extends Yi{toDOM(t){return Yk(t,null)}}});class t7 extends Yi{constructor(e){super(),this.value=e}eq(e){return this.value==e.value}toDOM(e){return Yk(e,this.value)}}const n7={openText:"⌄",closedText:"›",markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1};class Og extends Ui{constructor(e,n){super(),this.config=e,this.open=n}eq(e){return this.config==e.config&&this.open==e.open}toDOM(e){if(this.config.markerDOM)return this.config.markerDOM(this.open);let n=document.createElement("span");return n.textContent=this.open?this.config.openText:this.config.closedText,n.title=e.state.phrase(this.open?"Fold line":"Unfold line"),n}}function r7(t={}){let e={...n7,...t},n=new Og(e,!0),r=new Og(e,!1),i=$t.fromClass(class{constructor(o){this.from=o.viewport.from,this.markers=this.buildMarkers(o)}update(o){(o.docChanged||o.viewportChanged||o.startState.facet(yo)!=o.state.facet(yo)||o.startState.field(ha,!1)!=o.state.field(ha,!1)||tn(o.startState)!=tn(o.state)||e.foldingChanged(o))&&(this.markers=this.buildMarkers(o.view))}buildMarkers(o){let a=new _s;for(let l of o.viewportLineBlocks){let u=Rp(o.state,l.from,l.to)?r:Pp(o.state,l.from,l.to)?n:null;u&&a.add(l.from,l.from,u)}return a.finish()}}),{domEventHandlers:s}=e;return[i,vk({class:"cm-foldGutter",markers(o){var a;return((a=o.plugin(i))===null||a===void 0?void 0:a.markers)||Xe.empty},initialSpacer(){return new Og(e,!1)},domEventHandlers:{...s,click:(o,a,l)=>{if(s.click&&s.click(o,a,l))return!0;let u=Rp(o.state,a.from,a.to);if(u)return o.dispatch({effects:$f.of(u)}),!0;let c=Pp(o.state,a.from,a.to);return c?(o.dispatch({effects:Q0.of(c)}),!0):!1}}}),Xk()]}const i7=ce.baseTheme({".cm-foldPlaceholder":{backgroundColor:"#eee",border:"1px solid #ddd",color:"#888",borderRadius:".2em",margin:"0 1px",padding:"0 1px",cursor:"pointer"},".cm-foldGutter span":{padding:"0 1px",cursor:"pointer"}});class em{constructor(e,n){this.specs=e;let r;function i(a){let l=po.newName();return(r||(r=Object.create(null)))["."+l]=a,l}const s=typeof n.all=="string"?n.all:n.all?i(n.all):void 0,o=n.scope;this.scope=o instanceof ai?a=>a.prop(tl)==o.data:o?a=>a==o:void 0,this.style=$k(e.map(a=>({tag:a.tag,class:a.class||i(Object.assign({},a,{tag:null}))})),{all:s}).style,this.module=r?new po(r):null,this.themeType=n.themeType}static define(e,n){return new em(e,n||{})}}const jb=he.define(),Jk=he.define({combine(t){return t.length?[t[0]]:null}});function Tg(t){let e=t.facet(jb);return e.length?e:t.facet(Jk)}function s7(t,e){let n=[a7],r;return t instanceof em&&(t.module&&n.push(ce.styleModule.of(t.module)),r=t.themeType),e!=null&&e.fallback?n.push(Jk.of(t)):r?n.push(jb.computeN([ce.darkTheme],i=>i.facet(ce.darkTheme)==(r=="dark")?[t]:[])):n.push(jb.of(t)),n}class o7{constructor(e){this.markCache=Object.create(null),this.tree=tn(e.state),this.decorations=this.buildDeco(e,Tg(e.state)),this.decoratedTo=e.viewport.to}update(e){let n=tn(e.state),r=Tg(e.state),i=r!=Tg(e.startState),{viewport:s}=e.view,o=e.changes.mapPos(this.decoratedTo,1);n.length=s.to?(this.decorations=this.decorations.map(e.changes),this.decoratedTo=o):(n!=this.tree||e.viewportChanged||i)&&(this.tree=n,this.decorations=this.buildDeco(e.view,r),this.decoratedTo=s.to)}buildDeco(e,n){if(!n||!this.tree.length)return ve.none;let r=new _s;for(let{from:i,to:s}of e.visibleRanges)_$(this.tree,n,(o,a,l)=>{r.add(o,a,this.markCache[l]||(this.markCache[l]=ve.mark({class:l})))},i,s);return r.finish()}}const a7=Co.high($t.fromClass(o7,{decorations:t=>t.decorations})),l7=em.define([{tag:oe.meta,color:"#404740"},{tag:oe.link,textDecoration:"underline"},{tag:oe.heading,textDecoration:"underline",fontWeight:"bold"},{tag:oe.emphasis,fontStyle:"italic"},{tag:oe.strong,fontWeight:"bold"},{tag:oe.strikethrough,textDecoration:"line-through"},{tag:oe.keyword,color:"#708"},{tag:[oe.atom,oe.bool,oe.url,oe.contentSeparator,oe.labelName],color:"#219"},{tag:[oe.literal,oe.inserted],color:"#164"},{tag:[oe.string,oe.deleted],color:"#a11"},{tag:[oe.regexp,oe.escape,oe.special(oe.string)],color:"#e40"},{tag:oe.definition(oe.variableName),color:"#00f"},{tag:oe.local(oe.variableName),color:"#30a"},{tag:[oe.typeName,oe.namespace],color:"#085"},{tag:oe.className,color:"#167"},{tag:[oe.special(oe.variableName),oe.macroName],color:"#256"},{tag:oe.definition(oe.propertyName),color:"#00c"},{tag:oe.comment,color:"#940"},{tag:oe.invalid,color:"#f00"}]),u7=ce.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),Zk=1e4,Qk="()[]{}",e3=he.define({combine(t){return fi(t,{afterCursor:!0,brackets:Qk,maxScanDistance:Zk,renderMatch:d7})}}),c7=ve.mark({class:"cm-matchingBracket"}),f7=ve.mark({class:"cm-nonmatchingBracket"});function d7(t){let e=[],n=t.matched?c7:f7;return e.push(n.range(t.start.from,t.start.to)),t.end&&e.push(n.range(t.end.from,t.end.to)),e}const h7=Wt.define({create(){return ve.none},update(t,e){if(!e.docChanged&&!e.selection)return t;let n=[],r=e.state.facet(e3);for(let i of e.state.selection.ranges){if(!i.empty)continue;let s=Ri(e.state,i.head,-1,r)||i.head>0&&Ri(e.state,i.head-1,1,r)||r.afterCursor&&(Ri(e.state,i.head,1,r)||i.headce.decorations.from(t)}),p7=[h7,u7];function m7(t={}){return[e3.of(t),p7]}const g7=new Ve;function Vb(t,e,n){let r=t.prop(e<0?Ve.openedBy:Ve.closedBy);if(r)return r;if(t.name.length==1){let i=n.indexOf(t.name);if(i>-1&&i%2==(e<0?1:0))return[n[i+e]]}return null}function Ub(t){let e=t.type.prop(g7);return e?e(t.node):t}function Ri(t,e,n,r={}){let i=r.maxScanDistance||Zk,s=r.brackets||Qk,o=tn(t),a=o.resolveInner(e,n);for(let l=a;l;l=l.parent){let u=Vb(l.type,n,s);if(u&&l.from0?e>=c.from&&ec.from&&e<=c.to))return b7(t,e,n,l,c,u,s)}}return y7(t,e,n,o,a.type,i,s)}function b7(t,e,n,r,i,s,o){let a=r.parent,l={from:i.from,to:i.to},u=0,c=a==null?void 0:a.cursor();if(c&&(n<0?c.childBefore(r.from):c.childAfter(r.to)))do if(n<0?c.to<=r.from:c.from>=r.to){if(u==0&&s.indexOf(c.type.name)>-1&&c.from0)return null;let u={from:n<0?e-1:e,to:n>0?e+1:e},c=t.doc.iterRange(e,n>0?t.doc.length:0),f=0;for(let d=0;!c.next().done&&d<=s;){let h=c.value;n<0&&(d+=h.length);let p=e+d*n;for(let m=n>0?0:h.length-1,g=n>0?h.length:-1;m!=g;m+=n){let b=o.indexOf(h[m]);if(!(b<0||r.resolveInner(p+m,1).type!=i))if(b%2==0==n>0)f++;else{if(f==1)return{start:u,end:{from:p+m,to:p+m+1},matched:b>>1==l>>1};f--}}n>0&&(d+=h.length)}return c.done?{start:u,matched:!1}:null}const v7=Object.create(null),pE=[fr.none],mE=[],gE=Object.create(null),x7=Object.create(null);for(let[t,e]of[["variable","variableName"],["variable-2","variableName.special"],["string-2","string.special"],["def","variableName.definition"],["tag","tagName"],["attribute","attributeName"],["type","typeName"],["builtin","variableName.standard"],["qualifier","modifier"],["error","invalid"],["header","heading"],["property","propertyName"]])x7[t]=S7(v7,e);function Ig(t,e){mE.indexOf(t)>-1||(mE.push(t),console.warn(e))}function S7(t,e){let n=[];for(let a of e.split(" ")){let l=[];for(let u of a.split(".")){let c=t[u]||oe[u];c?typeof c=="function"?l.length?l=l.map(c):Ig(u,`Modifier ${u} used at start of tag`):l.length?Ig(u,`Tag ${u} used as modifier`):l=Array.isArray(c)?c:[c]:Ig(u,`Unknown highlighting tag ${u}`)}for(let u of l)n.push(u)}if(!n.length)return 0;let r=e.replace(/ /g,"_"),i=r+" "+n.map(a=>a.id),s=gE[i];if(s)return s.id;let o=gE[i]=fr.define({id:pE.length,name:r,props:[Lk({[r]:n})]});return pE.push(o),o.id}Et.RTL,Et.LTR;const E7=()=>t=>{try{JSON.parse(t.state.doc.toString())}catch(e){if(!(e instanceof SyntaxError))throw e;const n=w7(e,t.state.doc);return[{from:n,message:e.message,severity:"error",to:n}]}return[]};function w7(t,e){let n;return(n=t.message.match(/at position (\d+)/))?Math.min(+n[1],e.length):(n=t.message.match(/at line (\d+) column (\d+)/))?Math.min(e.line(+n[1]).from+ +n[2]-1,e.length):0}const t3=Op.define({name:"json",parser:k$.configure({props:[jk.add({Object:fE({except:/^\s*\}/}),Array:fE({except:/^\s*\]/})}),Uk.add({"Object Array":q$})]}),languageData:{closeBrackets:{brackets:["[","{",'"']},indentOnInput:/^\s*[\}\]]$/}});function n3(){return new R$(t3)}class r3{constructor(e,n,r,i){this.state=e,this.pos=n,this.explicit=r,this.view=i,this.abortListeners=[],this.abortOnDocChange=!1}tokenBefore(e){let n=tn(this.state).resolveInner(this.pos,-1);for(;n&&e.indexOf(n.name)<0;)n=n.parent;return n?{from:n.from,to:this.pos,text:this.state.sliceDoc(n.from,this.pos),type:n.type}:null}matchBefore(e){let n=this.state.doc.lineAt(this.pos),r=Math.max(n.from,this.pos-250),i=n.text.slice(r-n.from,this.pos-n.from),s=i.search(i3(e,!1));return s<0?null:{from:r+s,to:this.pos,text:i.slice(s)}}get aborted(){return this.abortListeners==null}addEventListener(e,n,r){e=="abort"&&this.abortListeners&&(this.abortListeners.push(n),r&&r.onDocChange&&(this.abortOnDocChange=!0))}}function bE(t){let e=Object.keys(t).join(""),n=/\w/.test(e);return n&&(e=e.replace(/\w/g,"")),`[${n?"\\w":""}${e.replace(/[^\w\s]/g,"\\$&")}]`}function _7(t){let e=Object.create(null),n=Object.create(null);for(let{label:i}of t){e[i[0]]=!0;for(let s=1;stypeof i=="string"?{label:i}:i),[n,r]=e.every(i=>/^\w+$/.test(i.label))?[/\w*$/,/\w+$/]:_7(e);return i=>{let s=i.matchBefore(r);return s||i.explicit?{from:s?s.from:i.pos,options:e,validFor:n}:null}}class yE{constructor(e,n,r,i){this.completion=e,this.source=n,this.match=r,this.score=i}}function ra(t){return t.selection.main.from}function i3(t,e){var n;let{source:r}=t,i=e&&r[0]!="^",s=r[r.length-1]!="$";return!i&&!s?t:new RegExp(`${i?"^":""}(?:${r})${s?"$":""}`,(n=t.flags)!==null&&n!==void 0?n:t.ignoreCase?"i":"")}const Nv=As.define();function A7(t,e,n,r){let{main:i}=t.selection,s=n-i.from,o=r-i.from;return{...t.changeByRange(a=>{if(a!=i&&n!=r&&t.sliceDoc(a.from+s,a.from+o)!=t.sliceDoc(n,r))return{range:a};let l=t.toText(e);return{changes:{from:a.from+s,to:r==i.from?a.to:a.from+o,insert:l},range:Y.cursor(a.from+s+l.length)}}),scrollIntoView:!0,userEvent:"input.complete"}}const vE=new WeakMap;function D7(t){if(!Array.isArray(t))return t;let e=vE.get(t);return e||vE.set(t,e=C7(t)),e}const Np=De.define(),qc=De.define();class k7{constructor(e){this.pattern=e,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[],this.score=0,this.matched=[];for(let n=0;n=48&&E<=57||E>=97&&E<=122?2:E>=65&&E<=90?1:0:(C=dv(E))!=C.toLowerCase()?1:C!=C.toUpperCase()?2:0;(!y||w==1&&g||S==0&&w!=0)&&(n[f]==E||r[f]==E&&(d=!0)?o[f++]=y:o.length&&(b=!1)),S=w,y+=Di(E)}return f==l&&o[0]==0&&b?this.result(-100+(d?-200:0),o,e):h==l&&p==0?this.ret(-200-e.length+(m==e.length?0:-100),[0,m]):a>-1?this.ret(-700-e.length,[a,a+this.pattern.length]):h==l?this.ret(-900-e.length,[p,m]):f==l?this.result(-100+(d?-200:0)+-700+(b?0:-1100),o,e):n.length==2?null:this.result((i[0]?-700:0)+-200+-1100,i,e)}result(e,n,r){let i=[],s=0;for(let o of n){let a=o+(this.astral?Di(ir(r,o)):1);s&&i[s-1]==o?i[s-1]=a:(i[s++]=o,i[s++]=a)}return this.ret(e-r.length,i)}}class O7{constructor(e){this.pattern=e,this.matched=[],this.score=0,this.folded=e.toLowerCase()}match(e){if(e.length!1,activateOnTypingDelay:100,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,tooltipClass:()=>"",optionClass:()=>"",aboveCursor:!1,icons:!0,addToOptions:[],positionInfo:T7,filterStrict:!1,compareCompletions:(e,n)=>e.label.localeCompare(n.label),interactionDelay:75,updateSyncTime:100},{defaultKeymap:(e,n)=>e&&n,closeOnBlur:(e,n)=>e&&n,icons:(e,n)=>e&&n,tooltipClass:(e,n)=>r=>xE(e(r),n(r)),optionClass:(e,n)=>r=>xE(e(r),n(r)),addToOptions:(e,n)=>e.concat(n),filterStrict:(e,n)=>e||n})}});function xE(t,e){return t?e?t+" "+e:t:e}function T7(t,e,n,r,i,s){let o=t.textDirection==Et.RTL,a=o,l=!1,u="top",c,f,d=e.left-i.left,h=i.right-e.right,p=r.right-r.left,m=r.bottom-r.top;if(a&&d=m||y>e.top?c=n.bottom-e.top:(u="bottom",c=e.bottom-n.top)}let g=(e.bottom-e.top)/s.offsetHeight,b=(e.right-e.left)/s.offsetWidth;return{style:`${u}: ${c/g}px; max-width: ${f/b}px`,class:"cm-completionInfo-"+(l?o?"left-narrow":"right-narrow":a?"left":"right")}}function I7(t){let e=t.addToOptions.slice();return t.icons&&e.push({render(n){let r=document.createElement("div");return r.classList.add("cm-completionIcon"),n.type&&r.classList.add(...n.type.split(/\s+/g).map(i=>"cm-completionIcon-"+i)),r.setAttribute("aria-hidden","true"),r},position:20}),e.push({render(n,r,i,s){let o=document.createElement("span");o.className="cm-completionLabel";let a=n.displayLabel||n.label,l=0;for(let u=0;ul&&o.appendChild(document.createTextNode(a.slice(l,c)));let d=o.appendChild(document.createElement("span"));d.appendChild(document.createTextNode(a.slice(c,f))),d.className="cm-completionMatchedText",l=f}return ln.position-r.position).map(n=>n.render)}function Pg(t,e,n){if(t<=n)return{from:0,to:t};if(e<0&&(e=0),e<=t>>1){let i=Math.floor(e/n);return{from:i*n,to:(i+1)*n}}let r=Math.floor((t-e)/n);return{from:t-(r+1)*n,to:t-r*n}}class P7{constructor(e,n,r){this.view=e,this.stateField=n,this.applyCompletion=r,this.info=null,this.infoDestroy=null,this.placeInfoReq={read:()=>this.measureInfo(),write:l=>this.placeInfo(l),key:this},this.space=null,this.currentClass="";let i=e.state.field(n),{options:s,selected:o}=i.open,a=e.state.facet(pn);this.optionContent=I7(a),this.optionClass=a.optionClass,this.tooltipClass=a.tooltipClass,this.range=Pg(s.length,o,a.maxRenderedOptions),this.dom=document.createElement("div"),this.dom.className="cm-tooltip-autocomplete",this.updateTooltipClass(e.state),this.dom.addEventListener("mousedown",l=>{let{options:u}=e.state.field(n).open;for(let c=l.target,f;c&&c!=this.dom;c=c.parentNode)if(c.nodeName=="LI"&&(f=/-(\d+)$/.exec(c.id))&&+f[1]{let u=e.state.field(this.stateField,!1);u&&u.tooltip&&e.state.facet(pn).closeOnBlur&&l.relatedTarget!=e.contentDOM&&e.dispatch({effects:qc.of(null)})}),this.showOptions(s,i.id)}mount(){this.updateSel()}showOptions(e,n){this.list&&this.list.remove(),this.list=this.dom.appendChild(this.createListBox(e,n,this.range)),this.list.addEventListener("scroll",()=>{this.info&&this.view.requestMeasure(this.placeInfoReq)})}update(e){var n;let r=e.state.field(this.stateField),i=e.startState.field(this.stateField);if(this.updateTooltipClass(e.state),r!=i){let{options:s,selected:o,disabled:a}=r.open;(!i.open||i.open.options!=s)&&(this.range=Pg(s.length,o,e.state.facet(pn).maxRenderedOptions),this.showOptions(s,r.id)),this.updateSel(),a!=((n=i.open)===null||n===void 0?void 0:n.disabled)&&this.dom.classList.toggle("cm-tooltip-autocomplete-disabled",!!a)}}updateTooltipClass(e){let n=this.tooltipClass(e);if(n!=this.currentClass){for(let r of this.currentClass.split(" "))r&&this.dom.classList.remove(r);for(let r of n.split(" "))r&&this.dom.classList.add(r);this.currentClass=n}}positioned(e){this.space=e,this.info&&this.view.requestMeasure(this.placeInfoReq)}updateSel(){let e=this.view.state.field(this.stateField),n=e.open;if((n.selected>-1&&n.selected=this.range.to)&&(this.range=Pg(n.options.length,n.selected,this.view.state.facet(pn).maxRenderedOptions),this.showOptions(n.options,e.id)),this.updateSelectedOption(n.selected)){this.destroyInfo();let{completion:r}=n.options[n.selected],{info:i}=r;if(!i)return;let s=typeof i=="string"?document.createTextNode(i):i(r);if(!s)return;"then"in s?s.then(o=>{o&&this.view.state.field(this.stateField,!1)==e&&this.addInfoPane(o,r)}).catch(o=>qn(this.view.state,o,"completion info")):this.addInfoPane(s,r)}}addInfoPane(e,n){this.destroyInfo();let r=this.info=document.createElement("div");if(r.className="cm-tooltip cm-completionInfo",e.nodeType!=null)r.appendChild(e),this.infoDestroy=null;else{let{dom:i,destroy:s}=e;r.appendChild(i),this.infoDestroy=s||null}this.dom.appendChild(r),this.view.requestMeasure(this.placeInfoReq)}updateSelectedOption(e){let n=null;for(let r=this.list.firstChild,i=this.range.from;r;r=r.nextSibling,i++)r.nodeName!="LI"||!r.id?i--:i==e?r.hasAttribute("aria-selected")||(r.setAttribute("aria-selected","true"),n=r):r.hasAttribute("aria-selected")&&r.removeAttribute("aria-selected");return n&&N7(this.list,n),n}measureInfo(){let e=this.dom.querySelector("[aria-selected]");if(!e||!this.info)return null;let n=this.dom.getBoundingClientRect(),r=this.info.getBoundingClientRect(),i=e.getBoundingClientRect(),s=this.space;if(!s){let o=this.dom.ownerDocument.documentElement;s={left:0,top:0,right:o.clientWidth,bottom:o.clientHeight}}return i.top>Math.min(s.bottom,n.bottom)-10||i.bottom{o.target==i&&o.preventDefault()});let s=null;for(let o=r.from;or.from||r.from==0))if(s=d,typeof u!="string"&&u.header)i.appendChild(u.header(u));else{let h=i.appendChild(document.createElement("completion-section"));h.textContent=d}}const c=i.appendChild(document.createElement("li"));c.id=n+"-"+o,c.setAttribute("role","option");let f=this.optionClass(a);f&&(c.className=f);for(let d of this.optionContent){let h=d(a,this.view.state,this.view,l);h&&c.appendChild(h)}}return r.from&&i.classList.add("cm-completionListIncompleteTop"),r.tonew P7(n,t,e)}function N7(t,e){let n=t.getBoundingClientRect(),r=e.getBoundingClientRect(),i=n.height/t.offsetHeight;r.topn.bottom&&(t.scrollTop+=(r.bottom-n.bottom)/i)}function SE(t){return(t.boost||0)*100+(t.apply?10:0)+(t.info?5:0)+(t.type?1:0)}function M7(t,e){let n=[],r=null,i=null,s=c=>{n.push(c);let{section:f}=c.completion;if(f){r||(r=[]);let d=typeof f=="string"?f:f.name;r.some(h=>h.name==d)||r.push(typeof f=="string"?{name:d}:f)}},o=e.facet(pn);for(let c of t)if(c.hasResult()){let f=c.result.getMatch;if(c.result.filter===!1)for(let d of c.result.options)s(new yE(d,c.source,f?f(d):[],1e9-n.length));else{let d=e.sliceDoc(c.from,c.to),h,p=o.filterStrict?new O7(d):new k7(d);for(let m of c.result.options)if(h=p.match(m.label)){let g=m.displayLabel?f?f(m,h.matched):[]:h.matched,b=h.score+(m.boost||0);if(s(new yE(m,c.source,g,b)),typeof m.section=="object"&&m.section.rank==="dynamic"){let{name:y}=m.section;i||(i=Object.create(null)),i[y]=Math.max(b,i[y]||-1e9)}}}}if(r){let c=Object.create(null),f=0,d=(h,p)=>(h.rank==="dynamic"&&p.rank==="dynamic"?i[p.name]-i[h.name]:0)||(typeof h.rank=="number"?h.rank:1e9)-(typeof p.rank=="number"?p.rank:1e9)||(h.named.score-f.score||u(f.completion,d.completion))){let f=c.completion;!l||l.label!=f.label||l.detail!=f.detail||l.type!=null&&f.type!=null&&l.type!=f.type||l.apply!=f.apply||l.boost!=f.boost?a.push(c):SE(c.completion)>SE(l)&&(a[a.length-1]=c),l=c.completion}return a}class nl{constructor(e,n,r,i,s,o){this.options=e,this.attrs=n,this.tooltip=r,this.timestamp=i,this.selected=s,this.disabled=o}setSelected(e,n){return e==this.selected||e>=this.options.length?this:new nl(this.options,EE(n,e),this.tooltip,this.timestamp,e,this.disabled)}static build(e,n,r,i,s,o){if(i&&!o&&e.some(u=>u.isPending))return i.setDisabled();let a=M7(e,n);if(!a.length)return i&&e.some(u=>u.isPending)?i.setDisabled():null;let l=n.facet(pn).selectOnOpen?0:-1;if(i&&i.selected!=l&&i.selected!=-1){let u=i.options[i.selected].completion;for(let c=0;cc.hasResult()?Math.min(u,c.from):u,1e8),create:j7,above:s.aboveCursor},i?i.timestamp:Date.now(),l,!1)}map(e){return new nl(this.options,this.attrs,{...this.tooltip,pos:e.mapPos(this.tooltip.pos)},this.timestamp,this.selected,this.disabled)}setDisabled(){return new nl(this.options,this.attrs,this.tooltip,this.timestamp,this.selected,!0)}}class Mp{constructor(e,n,r){this.active=e,this.id=n,this.open=r}static start(){return new Mp($7,"cm-ac-"+Math.floor(Math.random()*2e6).toString(36),null)}update(e){let{state:n}=e,r=n.facet(pn),s=(r.override||n.languageDataAt("autocomplete",ra(n)).map(D7)).map(l=>(this.active.find(c=>c.source==l)||new $r(l,this.active.some(c=>c.state!=0)?1:0)).update(e,r));s.length==this.active.length&&s.every((l,u)=>l==this.active[u])&&(s=this.active);let o=this.open,a=e.effects.some(l=>l.is(Mv));o&&e.docChanged&&(o=o.map(e.changes)),e.selection||s.some(l=>l.hasResult()&&e.changes.touchesRange(l.from,l.to))||!F7(s,this.active)||a?o=nl.build(s,n,this.id,o,r,a):o&&o.disabled&&!s.some(l=>l.isPending)&&(o=null),!o&&s.every(l=>!l.isPending)&&s.some(l=>l.hasResult())&&(s=s.map(l=>l.hasResult()?new $r(l.source,0):l));for(let l of e.effects)l.is(o3)&&(o=o&&o.setSelected(l.value,this.id));return s==this.active&&o==this.open?this:new Mp(s,this.id,o)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:this.active.length?L7:B7}}function F7(t,e){if(t==e)return!0;for(let n=0,r=0;;){for(;n-1&&(n["aria-activedescendant"]=t+"-"+e),n}const $7=[];function s3(t,e){if(t.isUserEvent("input.complete")){let r=t.annotation(Nv);if(r&&e.activateOnCompletion(r))return 12}let n=t.isUserEvent("input.type");return n&&e.activateOnTyping?5:n?1:t.isUserEvent("delete.backward")?2:t.selection?8:t.docChanged?16:0}class $r{constructor(e,n,r=!1){this.source=e,this.state=n,this.explicit=r}hasResult(){return!1}get isPending(){return this.state==1}update(e,n){let r=s3(e,n),i=this;(r&8||r&16&&this.touches(e))&&(i=new $r(i.source,0)),r&4&&i.state==0&&(i=new $r(this.source,1)),i=i.updateFor(e,r);for(let s of e.effects)if(s.is(Np))i=new $r(i.source,1,s.value);else if(s.is(qc))i=new $r(i.source,0);else if(s.is(Mv))for(let o of s.value)o.source==i.source&&(i=o);return i}updateFor(e,n){return this.map(e.changes)}map(e){return this}touches(e){return e.changes.touchesRange(ra(e.state))}}class hl extends $r{constructor(e,n,r,i,s,o){super(e,3,n),this.limit=r,this.result=i,this.from=s,this.to=o}hasResult(){return!0}updateFor(e,n){var r;if(!(n&3))return this.map(e.changes);let i=this.result;i.map&&!e.changes.empty&&(i=i.map(i,e.changes));let s=e.changes.mapPos(this.from),o=e.changes.mapPos(this.to,1),a=ra(e.state);if(a>o||!i||n&2&&(ra(e.startState)==this.from||an.map(e))}}),o3=De.define(),sr=Wt.define({create(){return Mp.start()},update(t,e){return t.update(e)},provide:t=>[K0.from(t,e=>e.tooltip),ce.contentAttributes.from(t,e=>e.attrs)]});function Fv(t,e){const n=e.completion.apply||e.completion.label;let r=t.state.field(sr).active.find(i=>i.source==e.source);return r instanceof hl?(typeof n=="string"?t.dispatch({...A7(t.state,n,r.from,r.to),annotations:Nv.of(e.completion)}):n(t,e.completion,r.from,r.to),!0):!1}const j7=R7(sr,Fv);function $d(t,e="option"){return n=>{let r=n.state.field(sr,!1);if(!r||!r.open||r.open.disabled||Date.now()-r.open.timestamp-1?r.open.selected+i*(t?1:-1):t?0:o-1;return a<0?a=e=="page"?0:o-1:a>=o&&(a=e=="page"?o-1:0),n.dispatch({effects:o3.of(a)}),!0}}const V7=t=>{let e=t.state.field(sr,!1);return t.state.readOnly||!e||!e.open||e.open.selected<0||e.open.disabled||Date.now()-e.open.timestampt.state.field(sr,!1)?(t.dispatch({effects:Np.of(!0)}),!0):!1,U7=t=>{let e=t.state.field(sr,!1);return!e||!e.active.some(n=>n.state!=0)?!1:(t.dispatch({effects:qc.of(null)}),!0)};class H7{constructor(e,n){this.active=e,this.context=n,this.time=Date.now(),this.updates=[],this.done=void 0}}const q7=50,G7=1e3,W7=$t.fromClass(class{constructor(t){this.view=t,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.pendingStart=!1,this.composing=0;for(let e of t.state.field(sr).active)e.isPending&&this.startQuery(e)}update(t){let e=t.state.field(sr),n=t.state.facet(pn);if(!t.selectionSet&&!t.docChanged&&t.startState.field(sr)==e)return;let r=t.transactions.some(s=>{let o=s3(s,n);return o&8||(s.selection||s.docChanged)&&!(o&3)});for(let s=0;sq7&&Date.now()-o.time>G7){for(let a of o.context.abortListeners)try{a()}catch(l){qn(this.view.state,l)}o.context.abortListeners=null,this.running.splice(s--,1)}else o.updates.push(...t.transactions)}this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),t.transactions.some(s=>s.effects.some(o=>o.is(Np)))&&(this.pendingStart=!0);let i=this.pendingStart?50:n.activateOnTypingDelay;if(this.debounceUpdate=e.active.some(s=>s.isPending&&!this.running.some(o=>o.active.source==s.source))?setTimeout(()=>this.startUpdate(),i):-1,this.composing!=0)for(let s of t.transactions)s.isUserEvent("input.type")?this.composing=2:this.composing==2&&s.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1,this.pendingStart=!1;let{state:t}=this.view,e=t.field(sr);for(let n of e.active)n.isPending&&!this.running.some(r=>r.active.source==n.source)&&this.startQuery(n);this.running.length&&e.open&&e.open.disabled&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(pn).updateSyncTime))}startQuery(t){let{state:e}=this.view,n=ra(e),r=new r3(e,n,t.explicit,this.view),i=new H7(t,r);this.running.push(i),Promise.resolve(t.source(r)).then(s=>{i.context.aborted||(i.done=s||null,this.scheduleAccept())},s=>{this.view.dispatch({effects:qc.of(null)}),qn(this.view.state,s)})}scheduleAccept(){this.running.every(t=>t.done!==void 0)?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(pn).updateSyncTime))}accept(){var t;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let e=[],n=this.view.state.facet(pn),r=this.view.state.field(sr);for(let i=0;ia.source==s.active.source);if(o&&o.isPending)if(s.done==null){let a=new $r(s.active.source,0);for(let l of s.updates)a=a.update(l,n);a.isPending||e.push(a)}else this.startQuery(o)}(e.length||r.open&&r.open.disabled)&&this.view.dispatch({effects:Mv.of(e)})}},{eventHandlers:{blur(t){let e=this.view.state.field(sr,!1);if(e&&e.tooltip&&this.view.state.facet(pn).closeOnBlur){let n=e.open&&bk(this.view,e.open.tooltip);(!n||!n.dom.contains(t.relatedTarget))&&setTimeout(()=>this.view.dispatch({effects:qc.of(null)}),10)}},compositionstart(){this.composing=1},compositionend(){this.composing==3&&setTimeout(()=>this.view.dispatch({effects:Np.of(!1)}),20),this.composing=0}}}),K7=typeof navigator=="object"&&/Win/.test(navigator.platform),X7=Co.highest(ce.domEventHandlers({keydown(t,e){let n=e.state.field(sr,!1);if(!n||!n.open||n.open.disabled||n.open.selected<0||t.key.length>1||t.ctrlKey&&!(K7&&t.altKey)||t.metaKey)return!1;let r=n.open.options[n.open.selected],i=n.active.find(o=>o.source==r.source),s=r.completion.commitCharacters||i.result.commitCharacters;return s&&s.indexOf(t.key)>-1&&Fv(e,r),!1}})),a3=ce.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:"monospace",whiteSpace:"nowrap",overflow:"hidden auto",maxWidth_fallback:"700px",maxWidth:"min(700px, 95vw)",minWidth:"250px",maxHeight:"10em",height:"100%",listStyle:"none",margin:0,padding:0,"& > li, & > completion-section":{padding:"1px 3px",lineHeight:1.2},"& > li":{overflowX:"hidden",textOverflow:"ellipsis",cursor:"pointer"},"& > completion-section":{display:"list-item",borderBottom:"1px solid silver",paddingLeft:"0.5em",opacity:.7}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#17c",color:"white"},"&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#777"},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#347",color:"white"},"&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#444"},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:'"···"',opacity:.5,display:"block",textAlign:"center"},".cm-tooltip.cm-completionInfo":{position:"absolute",padding:"3px 9px",width:"max-content",maxWidth:"400px",boxSizing:"border-box",whiteSpace:"pre-line"},".cm-completionInfo.cm-completionInfo-left":{right:"100%"},".cm-completionInfo.cm-completionInfo-right":{left:"100%"},".cm-completionInfo.cm-completionInfo-left-narrow":{right:"30px"},".cm-completionInfo.cm-completionInfo-right-narrow":{left:"30px"},"&light .cm-snippetField":{backgroundColor:"#00000022"},"&dark .cm-snippetField":{backgroundColor:"#ffffff22"},".cm-snippetFieldPosition":{verticalAlign:"text-top",width:0,height:"1.15em",display:"inline-block",margin:"0 -0.7px -.7em",borderLeft:"1.4px dotted #888"},".cm-completionMatchedText":{textDecoration:"underline"},".cm-completionDetail":{marginLeft:"0.5em",fontStyle:"italic"},".cm-completionIcon":{fontSize:"90%",width:".8em",display:"inline-block",textAlign:"center",paddingRight:".6em",opacity:"0.6",boxSizing:"content-box"},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:"'ƒ'"}},".cm-completionIcon-class":{"&:after":{content:"'○'"}},".cm-completionIcon-interface":{"&:after":{content:"'◌'"}},".cm-completionIcon-variable":{"&:after":{content:"'𝑥'"}},".cm-completionIcon-constant":{"&:after":{content:"'𝐶'"}},".cm-completionIcon-type":{"&:after":{content:"'𝑡'"}},".cm-completionIcon-enum":{"&:after":{content:"'∪'"}},".cm-completionIcon-property":{"&:after":{content:"'□'"}},".cm-completionIcon-keyword":{"&:after":{content:"'🔑︎'"}},".cm-completionIcon-namespace":{"&:after":{content:"'▢'"}},".cm-completionIcon-text":{"&:after":{content:"'abc'",fontSize:"50%",verticalAlign:"middle"}}});class Y7{constructor(e,n,r,i){this.field=e,this.line=n,this.from=r,this.to=i}}class Lv{constructor(e,n,r){this.field=e,this.from=n,this.to=r}map(e){let n=e.mapPos(this.from,-1,En.TrackDel),r=e.mapPos(this.to,1,En.TrackDel);return n==null||r==null?null:new Lv(this.field,n,r)}}class Bv{constructor(e,n){this.lines=e,this.fieldPositions=n}instantiate(e,n){let r=[],i=[n],s=e.doc.lineAt(n),o=/^\s*/.exec(s.text)[0];for(let l of this.lines){if(r.length){let u=o,c=/^\t*/.exec(l)[0].length;for(let f=0;fnew Lv(l.field,i[l.line]+l.from,i[l.line]+l.to));return{text:r,ranges:a}}static parse(e){let n=[],r=[],i=[],s;for(let o of e.split(/\r\n?|\n/)){for(;s=/[#$]\{(?:(\d+)(?::([^{}]*))?|((?:\\[{}]|[^{}])*))\}/.exec(o);){let a=s[1]?+s[1]:null,l=s[2]||s[3]||"",u=-1,c=l.replace(/\\[{}]/g,f=>f[1]);for(let f=0;f=u&&d.field++}for(let f of i)if(f.line==r.length&&f.from>s.index){let d=s[2]?3+(s[1]||"").length:2;f.from-=d,f.to-=d}i.push(new Y7(u,r.length,s.index,s.index+c.length)),o=o.slice(0,s.index)+l+o.slice(s.index+s[0].length)}o=o.replace(/\\([{}])/g,(a,l,u)=>{for(let c of i)c.line==r.length&&c.from>u&&(c.from--,c.to--);return l}),r.push(o)}return new Bv(r,i)}}let J7=ve.widget({widget:new class extends Yi{toDOM(){let t=document.createElement("span");return t.className="cm-snippetFieldPosition",t}ignoreEvent(){return!1}}}),Z7=ve.mark({class:"cm-snippetField"});class iu{constructor(e,n){this.ranges=e,this.active=n,this.deco=ve.set(e.map(r=>(r.from==r.to?J7:Z7).range(r.from,r.to)),!0)}map(e){let n=[];for(let r of this.ranges){let i=r.map(e);if(!i)return null;n.push(i)}return new iu(n,this.active)}selectionInsideField(e){return e.ranges.every(n=>this.ranges.some(r=>r.field==this.active&&r.from<=n.from&&r.to>=n.to))}}const zf=De.define({map(t,e){return t&&t.map(e)}}),Q7=De.define(),Gc=Wt.define({create(){return null},update(t,e){for(let n of e.effects){if(n.is(zf))return n.value;if(n.is(Q7)&&t)return new iu(t.ranges,n.value)}return t&&e.docChanged&&(t=t.map(e.changes)),t&&e.selection&&!t.selectionInsideField(e.selection)&&(t=null),t},provide:t=>ce.decorations.from(t,e=>e?e.deco:ve.none)});function $v(t,e){return Y.create(t.filter(n=>n.field==e).map(n=>Y.range(n.from,n.to)))}function ez(t){let e=Bv.parse(t);return(n,r,i,s)=>{let{text:o,ranges:a}=e.instantiate(n.state,i),{main:l}=n.state.selection,u={changes:{from:i,to:s==l.from?l.to:s,insert:Ze.of(o)},scrollIntoView:!0,annotations:r?[Nv.of(r),Qt.userEvent.of("input.complete")]:void 0};if(a.length&&(u.selection=$v(a,0)),a.some(c=>c.field>0)){let c=new iu(a,0),f=u.effects=[zf.of(c)];n.state.field(Gc,!1)===void 0&&f.push(De.appendConfig.of([Gc,sz,az,a3]))}n.dispatch(n.state.update(u))}}function l3(t){return({state:e,dispatch:n})=>{let r=e.field(Gc,!1);if(!r||t<0&&r.active==0)return!1;let i=r.active+t,s=t>0&&!r.ranges.some(o=>o.field==i+t);return n(e.update({selection:$v(r.ranges,i),effects:zf.of(s?null:new iu(r.ranges,i)),scrollIntoView:!0})),!0}}const tz=({state:t,dispatch:e})=>t.field(Gc,!1)?(e(t.update({effects:zf.of(null)})),!0):!1,nz=l3(1),rz=l3(-1),iz=[{key:"Tab",run:nz,shift:rz},{key:"Escape",run:tz}],wE=he.define({combine(t){return t.length?t[0]:iz}}),sz=Co.highest(Ff.compute([wE],t=>t.facet(wE)));function oz(t,e){return{...e,apply:ez(t)}}const az=ce.domEventHandlers({mousedown(t,e){let n=e.state.field(Gc,!1),r;if(!n||(r=e.posAtCoords({x:t.clientX,y:t.clientY}))==null)return!1;let i=n.ranges.find(s=>s.from<=r&&s.to>=r);return!i||i.field==n.active?!1:(e.dispatch({selection:$v(n.ranges,i.field),effects:zf.of(n.ranges.some(s=>s.field>i.field)?new iu(n.ranges,i.field):null),scrollIntoView:!0}),!0)}}),Wc={brackets:["(","[","{","'",'"'],before:")]}:;>",stringPrefixes:[]},qo=De.define({map(t,e){let n=e.mapPos(t,-1,En.TrackAfter);return n??void 0}}),zv=new class extends ua{};zv.startSide=1;zv.endSide=-1;const u3=Wt.define({create(){return Xe.empty},update(t,e){if(t=t.map(e.changes),e.selection){let n=e.state.doc.lineAt(e.selection.main.head);t=t.update({filter:r=>r>=n.from&&r<=n.to})}for(let n of e.effects)n.is(qo)&&(t=t.update({add:[zv.range(n.value,n.value+1)]}));return t}});function lz(){return[cz,u3]}const Ng="()[]{}<>«»»«[]{}";function c3(t){for(let e=0;e{if((uz?t.composing:t.compositionStarted)||t.state.readOnly)return!1;let i=t.state.selection.main;if(r.length>2||r.length==2&&Di(ir(r,0))==1||e!=i.from||n!=i.to)return!1;let s=hz(t.state,r);return s?(t.dispatch(s),!0):!1}),fz=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let r=f3(t,t.selection.main.head).brackets||Wc.brackets,i=null,s=t.changeByRange(o=>{if(o.empty){let a=pz(t.doc,o.head);for(let l of r)if(l==a&&tm(t.doc,o.head)==c3(ir(l,0)))return{changes:{from:o.head-l.length,to:o.head+l.length},range:Y.cursor(o.head-l.length)}}return{range:i=o}});return i||e(t.update(s,{scrollIntoView:!0,userEvent:"delete.backward"})),!i},dz=[{key:"Backspace",run:fz}];function hz(t,e){let n=f3(t,t.selection.main.head),r=n.brackets||Wc.brackets;for(let i of r){let s=c3(ir(i,0));if(e==i)return s==i?bz(t,i,r.indexOf(i+i+i)>-1,n):mz(t,i,s,n.before||Wc.before);if(e==s&&d3(t,t.selection.main.from))return gz(t,i,s)}return null}function d3(t,e){let n=!1;return t.field(u3).between(0,t.doc.length,r=>{r==e&&(n=!0)}),n}function tm(t,e){let n=t.sliceString(e,e+2);return n.slice(0,Di(ir(n,0)))}function pz(t,e){let n=t.sliceString(e-2,e);return Di(ir(n,0))==n.length?n:n.slice(1)}function mz(t,e,n,r){let i=null,s=t.changeByRange(o=>{if(!o.empty)return{changes:[{insert:e,from:o.from},{insert:n,from:o.to}],effects:qo.of(o.to+e.length),range:Y.range(o.anchor+e.length,o.head+e.length)};let a=tm(t.doc,o.head);return!a||/\s/.test(a)||r.indexOf(a)>-1?{changes:{insert:e+n,from:o.head},effects:qo.of(o.head+e.length),range:Y.cursor(o.head+e.length)}:{range:i=o}});return i?null:t.update(s,{scrollIntoView:!0,userEvent:"input.type"})}function gz(t,e,n){let r=null,i=t.changeByRange(s=>s.empty&&tm(t.doc,s.head)==n?{changes:{from:s.head,to:s.head+n.length,insert:n},range:Y.cursor(s.head+n.length)}:r={range:s});return r?null:t.update(i,{scrollIntoView:!0,userEvent:"input.type"})}function bz(t,e,n,r){let i=r.stringPrefixes||Wc.stringPrefixes,s=null,o=t.changeByRange(a=>{if(!a.empty)return{changes:[{insert:e,from:a.from},{insert:e,from:a.to}],effects:qo.of(a.to+e.length),range:Y.range(a.anchor+e.length,a.head+e.length)};let l=a.head,u=tm(t.doc,l),c;if(u==e){if(_E(t,l))return{changes:{insert:e+e,from:l},effects:qo.of(l+e.length),range:Y.cursor(l+e.length)};if(d3(t,l)){let d=n&&t.sliceDoc(l,l+e.length*3)==e+e+e?e+e+e:e;return{changes:{from:l,to:l+d.length,insert:d},range:Y.cursor(l+d.length)}}}else{if(n&&t.sliceDoc(l-2*e.length,l)==e+e&&(c=CE(t,l-2*e.length,i))>-1&&_E(t,c))return{changes:{insert:e+e+e+e,from:l},effects:qo.of(l+e.length),range:Y.cursor(l+e.length)};if(t.charCategorizer(l)(u)!=kt.Word&&CE(t,l,i)>-1&&!yz(t,l,e,i))return{changes:{insert:e+e,from:l},effects:qo.of(l+e.length),range:Y.cursor(l+e.length)}}return{range:s=a}});return s?null:t.update(o,{scrollIntoView:!0,userEvent:"input.type"})}function _E(t,e){let n=tn(t).resolveInner(e+1);return n.parent&&n.from==e}function yz(t,e,n,r){let i=tn(t).resolveInner(e,-1),s=r.reduce((o,a)=>Math.max(o,a.length),0);for(let o=0;o<5;o++){let a=t.sliceDoc(i.from,Math.min(i.to,i.from+n.length+s)),l=a.indexOf(n);if(!l||l>-1&&r.indexOf(a.slice(0,l))>-1){let c=i.firstChild;for(;c&&c.from==i.from&&c.to-c.from>n.length+l;){if(t.sliceDoc(c.to-n.length,c.to)==n)return!1;c=c.firstChild}return!0}let u=i.to==e&&i.parent;if(!u)break;i=u}return!1}function CE(t,e,n){let r=t.charCategorizer(e);if(r(t.sliceDoc(e-1,e))!=kt.Word)return e;for(let i of n){let s=e-i.length;if(t.sliceDoc(s,e)==i&&r(t.sliceDoc(s-1,s))!=kt.Word)return s}return-1}function vz(t={}){return[X7,sr,pn.of(t),W7,xz,a3]}const h3=[{key:"Ctrl-Space",run:Rg},{mac:"Alt-`",run:Rg},{mac:"Alt-i",run:Rg},{key:"Escape",run:U7},{key:"ArrowDown",run:$d(!0)},{key:"ArrowUp",run:$d(!1)},{key:"PageDown",run:$d(!0,"page")},{key:"PageUp",run:$d(!1,"page")},{key:"Enter",run:V7}],xz=Co.highest(Ff.computeN([pn],t=>t.facet(pn).defaultKeymap?[h3]:[]));function Ta(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function nm(t){if(Object.prototype.hasOwnProperty.call(t,"__esModule"))return t;var e=t.default;if(typeof e=="function"){var n=function r(){return this instanceof r?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};n.prototype=e.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(t).forEach(function(r){var i=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return t[r]}})}),n}var Nh={exports:{}},Sz=Nh.exports,AE;function Ez(){return AE||(AE=1,(function(t){(function(e,n){t.exports?t.exports=n():e.log=n()})(Sz,function(){var e=function(){},n="undefined",r=typeof window!==n&&typeof window.navigator!==n&&/Trident\/|MSIE /.test(window.navigator.userAgent),i=["trace","debug","info","warn","error"],s={},o=null;function a(m,g){var b=m[g];if(typeof b.bind=="function")return b.bind(m);try{return Function.prototype.bind.call(b,m)}catch{return function(){return Function.prototype.apply.apply(b,[m,arguments])}}}function l(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}function u(m){return m==="debug"&&(m="log"),typeof console===n?!1:m==="trace"&&r?l:console[m]!==void 0?a(console,m):console.log!==void 0?a(console,"log"):e}function c(){for(var m=this.getLevel(),g=0;g=0&&N<=b.levels.SILENT)return N;throw new TypeError("log.setLevel() called with invalid level: "+I)}b.name=m,b.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},b.methodFactory=g||d,b.getLevel=function(){return S??x??y},b.setLevel=function(I,N){return S=_(I),N!==!1&&C(S),c.call(b)},b.setDefaultLevel=function(I){x=_(I),w()||b.setLevel(I,!1)},b.resetLevel=function(){S=null,A(),c.call(b)},b.enableAll=function(I){b.setLevel(b.levels.TRACE,I)},b.disableAll=function(I){b.setLevel(b.levels.SILENT,I)},b.rebuild=function(){if(o!==b&&(y=_(o.getLevel())),c.call(b),o===b)for(var I in s)s[I].rebuild()},y=_(o?o.getLevel():"WARN");var D=w();D!=null&&(S=_(D)),c.call(b)}o=new h,o.getLogger=function(g){if(typeof g!="symbol"&&typeof g!="string"||g==="")throw new TypeError("You must supply a name when creating a logger.");var b=s[g];return b||(b=s[g]=new h(g,o.methodFactory)),b};var p=typeof window!==n?window.log:void 0;return o.noConflict=function(){return typeof window!==n&&window.log===o&&(window.log=p),o},o.getLoggers=function(){return s},o.default=o,o})})(Nh)),Nh.exports}var wz=Ez();const p3=Ta(wz);p3.setLevel("silent");const Tt=p3,Ne={STRING:"String",NUMBER:"Number",TRUE:"True",FALSE:"False",NULL:"Null",OBJECT:"Object",ARRAY:"Array",PROPERTY:"Property",PROPERTY_NAME:"PropertyName",PROPERTY_COLON:"PropertyColon",ITEM:"Item",JSON_TEXT:"JsonText",INVALID:"⚠"},_z={Pair:Ne.PROPERTY,Key:Ne.PROPERTY_NAME,BlockSequence:Ne.ARRAY,BlockMapping:Ne.OBJECT,FlowSequence:Ne.ARRAY,FlowMapping:Ne.OBJECT,QuotedLiteral:Ne.STRING,Literal:Ne.STRING,Stream:Ne.JSON_TEXT,Document:Ne.OBJECT},Cz={File:Ne.JSON_TEXT},jv=[Ne.STRING,Ne.NUMBER,Ne.TRUE,Ne.FALSE,Ne.NULL],m3=[Ne.OBJECT,Ne.ARRAY,Ne.ITEM],At={JSON5:"json5",JSON:"json4",YAML:"yaml"},qt=(t,e)=>{var n,r;switch(e){case At.YAML:return(n=_z[t])!==null&&n!==void 0?n:t;case At.JSON5:return(r=Cz[t])!==null&&r!==void 0?r:t;default:return t}};function g3(t,e,n){const r=[];for(let i=e;i!=null&&i.parent;i=i.parent)switch(qt(i.parent.name,n)){case Ne.PROPERTY:{const s=Hb(i.parent,Ne.PROPERTY_NAME,n);if(s){let o=Wa(t,s).replace(/[/~]/g,a=>a==="~"?"~0":"~1");r.unshift(o)}break}case Ne.ARRAY:{if(Dz(i,n)){const s=v3(i.parent,i,n);r.unshift(`${s}`)}break}}return r.length===0?"":"/"+r.join("/")}const b3=(t,e,n=-1,r)=>g3(t.doc,tn(t).resolve(e,n),r),Vv=(t,e)=>{const n=tn(t),r=new Map;return n.iterate({enter:i=>{var s,o,a,l,u,c,f,d;if([Ne.PROPERTY_NAME,Ne.OBJECT].includes(qt(i.name,e))){const h=g3(t.doc,i.node,e),{from:p,to:m}=i.node;if(!(!((o=(s=i.node)===null||s===void 0?void 0:s.nextSibling)===null||o===void 0)&&o.node))return r.set(h,{keyFrom:p,keyTo:m}),!0;const g=e===At.JSON?(l=(a=i.node)===null||a===void 0?void 0:a.nextSibling)===null||l===void 0?void 0:l.node:(d=(f=(c=(u=i.node)===null||u===void 0?void 0:u.nextSibling)===null||c===void 0?void 0:c.node)===null||f===void 0?void 0:f.nextSibling)===null||d===void 0?void 0:d.node;if(!g)return r.set(h,{keyFrom:p,keyTo:m}),!0;const{from:b,to:y}=g;return r.set(h,{keyFrom:p,keyTo:m,valueFrom:b,valueTo:y}),!0}}}),r},Mg=(t,e,n=-1)=>tn(t).resolveInner(e,n),Mh=t=>t.replace(/^"(.*)"$/,"$1").replace(/^'(.*)'$/,"$1"),Az=t=>t.replace(/^"(.*)"$/,"'$1'"),Wa=(t,e,n=!0,r=!0)=>{const i=e?t.sliceString(e.from,e.to):"";return n?r?Mh(i):i.replace(/(^["'])|(["']$)/g,""):i},y3=(t,e)=>{var n,r,i,s;return qt(t.name,e)===Ne.INVALID&&(qt((r=(n=t.prevSibling)===null||n===void 0?void 0:n.name)!==null&&r!==void 0?r:"",e)===Ne.PROPERTY_NAME||qt((s=(i=t.prevSibling)===null||i===void 0?void 0:i.name)!==null&&s!==void 0?s:"",e)===Ne.PROPERTY_COLON)},Fh=(t,e)=>jv.includes(qt(t.name,e))||y3(t,e),Dz=(t,e)=>[...jv,...m3].includes(qt(t.name,e))||y3(t,e),zd=(t,e)=>{var n,r,i,s,o,a;return qt(t.name,e)===Ne.PROPERTY_NAME||qt(t.name,e)===Ne.INVALID&&(qt((r=(n=t.prevSibling)===null||n===void 0?void 0:n.name)!==null&&r!==void 0?r:"",e)===Ne.PROPERTY||qt((s=(i=t.prevSibling)===null||i===void 0?void 0:i.name)!==null&&s!==void 0?s:"",e)==="{")||e===At.YAML&&qt((a=(o=t.parent)===null||o===void 0?void 0:o.name)!==null&&a!==void 0?a:"",e)===Ne.OBJECT},jf=t=>{const e=[];let n=t.firstChild;for(;n;)n&&e.push(n),n=n==null?void 0:n.nextSibling;return e},kz=(t,e,n)=>jf(t).filter(r=>qt(r.name,n)===e),Hb=(t,e,n)=>{var r;return(r=jf(t).find(i=>qt(i.name,n)===e))!==null&&r!==void 0?r:null},DE=(t,e)=>jf(t).find(n=>Fh(n,e)),Oz=(t,e)=>jf(t).filter(n=>jv.includes(qt(n.name,e))||m3.includes(qt(n.name,e))),v3=(t,e,n)=>Oz(t,n).findIndex(r=>r.from===e.from&&r.to===e.to),kE=(t,e,n,r=1/0)=>{let i=t;for(;i&&r>0;){if(qt(i.name,n)===e)return i;i=i.parent,r--}return null},Tz=De.define(),Fp=Wt.define({create(){},update(t,e){for(const n of e.effects)if(n.is(Tz))return n.value;return t}}),Uv=t=>t.field(Fp),Iz=t=>[Fp.init(()=>t)],Pz={AdditionalItemsError:"Array at `{{pointer}}` may not have an additional item `{{key}}`",AdditionalPropertiesError:"Additional property `{{property}}` on `{{pointer}}` does not match schema `{{schema}}`",AllOfError:"Value `{{value}}` at `{{pointer}}` does not match schema of `{{allOf}}`",AnyOfError:"Value `{{value}}` at `{{pointer}}` does not match any schema of `{{anyOf}}`",ConstError:"Expected value at `{{pointer}}` to be `{{expected}}`, but value given is `{{value}}`",containsAnyError:"The array at `{{pointer}}` must contain at least one item",ContainsArrayError:"The property at `{{pointer}}` must not be an array",ContainsError:"The array at `{{pointer}}` must contain an element that matches `{{schema}}`",EnumError:"Expected given value `{{value}}` in `{{pointer}}` to be one of `{{values}}`",ForbiddenPropertyError:"Property name `{{property}}` at `{{pointer}}` is not allowed",FormatDateError:"Value `{{value}}` at `{{pointer}}` is not a valid date",FormatDateTimeError:"Value `{{value}}` at `{{pointer}}` is not a valid date-time",FormatEmailError:"Value `{{value}}` at `{{pointer}}` is not a valid email",FormatHostnameError:"Value `{{value}}` at `{{pointer}}` is not a valid hostname",FormatIPV4Error:"Value `{{value}}` at `{{pointer}}` is not a valid IPv4 address",FormatIPV4LeadingZeroError:"IPv4 addresses starting with zero are invalid, since they are interpreted as octals",FormatIPV6Error:"Value `{{value}}` at `{{pointer}}` is not a valid IPv6 address",FormatIPV6LeadingZeroError:"IPv6 addresses starting with zero are invalid, since they are interpreted as octals",FormatJsonPointerError:"Value `{{value}}` at `{{pointer}}` is not a valid json-pointer",FormatRegExError:"Value `{{value}}` at `{{pointer}}` is not a valid regular expression",FormatTimeError:"Value `{{value}}` at `{{pointer}}` is not a valid time",FormatURIError:"Value `{{value}}` at `{{pointer}}` is not a valid uri",FormatURIReferenceError:"Value `{{value}}` at `{{pointer}}` is not a valid uri-reference",FormatURITemplateError:"Value `{{value}}` at `{{pointer}}` is not a valid uri-template",FormatURLError:"Value `{{value}}` at `{{pointer}}` is not a valid url",InvalidDataError:"No value may be specified in `{{pointer}}`",InvalidPropertyNameError:"Invalid property name `{{property}}` at `{{pointer}}`",MaximumError:"Value in `{{pointer}}` is `{{length}}`, but should be `{{maximum}}` at maximum",MaxItemsError:"Too many items in `{{pointer}}`, should be `{{maximum}}` at most, but got `{{length}}`",MaxLengthError:"Value `{{pointer}}` should have a maximum length of `{{maxLength}}`, but got `{{length}}`.",MaxPropertiesError:"Too many properties in `{{pointer}}`, should be `{{maximum}}` at most, but got `{{length}}`",MinimumError:"Value in `{{pointer}}` is `{{length}}`, but should be `{{minimum}}` at minimum",MinItemsError:"Too few items in `{{pointer}}`, should be at least `{{minItems}}`, but got `{{length}}`",MinItemsOneError:"At least one item is required in `{{pointer}}`",MinLengthError:"Value `{{pointer}}` should have a minimum length of `{{minLength}}`, but got `{{length}}`.",MinLengthOneError:"A value is required in `{{pointer}}`",MinPropertiesError:"Too few properties in `{{pointer}}`, should be at least `{{minimum}}`, but got `{{length}}`",MissingDependencyError:"The required propery '{{missingProperty}}' in `{{pointer}}` is missing",MissingOneOfPropertyError:"Value at `{{pointer}}` property: `{{property}}`",MultipleOfError:"Expected `{{value}}` in `{{pointer}}` to be multiple of `{{multipleOf}}`",MultipleOneOfError:"Value `{{value}}` should not match multiple schemas in oneOf `{{matches}}`",NoAdditionalPropertiesError:"Additional property `{{property}}` in `{{pointer}}` is not allowed",NotError:"Value `{{value}}` at pointer should not match schema `{{not}}`",OneOfError:"Value `{{value}}` in `{{pointer}}` does not match any given oneof schema",OneOfPropertyError:"Failed finding a matching oneOfProperty schema in `{{pointer}}` where `{{property}}` matches `{{value}}`",PatternError:"Value in `{{pointer}}` should match `{{description}}`, but received `{{received}}`",PatternPropertiesError:"Property `{{key}}` does not match any patterns in `{{pointer}}`. Valid patterns are: {{patterns}}",RequiredPropertyError:"The required property `{{key}}` is missing at `{{pointer}}`",SchemaWarning:"Failed retrieving a schema from '{{pointer}}' to key '{{key}}'",TypeError:"Expected `{{value}}` ({{received}}) in `{{pointer}}` to be of type `{{expected}}`",UndefinedValueError:"Value must not be undefined in `{{pointer}}`",UniqueItemsError:"Items in array must be unique. Value `{{value}}` in `{{pointer}}` is a duplicate of {{duplicatePointer}}.",UnknownPropertyError:"Could not find a valid schema for property `{{pointer}}` within object",ValueNotEmptyError:"A value for `{{property}}` is required at `{{pointer}}`"},Rz=Object.prototype.toString;function tt(t){const e=Rz.call(t).match(/\s([^\]]+)\]/).pop().toLowerCase();return e==="file"?"object":e}const Nz="object",Mz="array";function Fz(t,e={}){return t.replace(/\{\{\w+\}\}/g,n=>{const r=n.replace(/[{}]/g,""),i=e[r],s=tt(i);return s===Nz||s===Mz?JSON.stringify(i):i})}function Lz(t,e,n=t){var r;const i=(r=Pz[t])!==null&&r!==void 0?r:n;return Fz(i,e)}function Bz(t){return t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function $z(t,e){return{type:"error",name:t,code:Bz(t),message:Lz(t,e),data:e}}function xe(t){return $z.bind(null,t)}function Kc(t,e=[]){for(let n=0;n({index:n,schema:t})}),r}function Nn(t){return(t==null?void 0:t.type)==="error"}function zz(t){return t instanceof Promise}function Lp(t){return Nn(t)||zz(t)}const{DECLARATOR_ONEOF:pl}=su;function x3(t,e,n=t.rootSchema,r="#"){if(e!=null&&n[pl]){const o=[],a=n[pl],l=e[n[pl]];if(l===void 0)return t.errors.missingOneOfPropertyError({property:a,pointer:r,schema:n,value:e});for(let u=0;u0)o.push(...d);else return pc(n,c,u)}return t.errors.oneOfPropertyError({property:a,value:l,pointer:r,schema:n,errors:o})}const i=[],s=[];for(let o=0;o0?s.push(...l):i.push({index:o,schema:a})}return i.length===1?pc(n,i[0].schema,i[0].index):i.length>1?t.errors.multipleOneOfError({value:e,pointer:r,schema:n,matches:i}):t.errors.oneOfError({value:JSON.stringify(e),pointer:r,schema:n,oneOf:n.oneOf,errors:s})}function jz(t,e,n,r){if(n==null||e.properties==null)return-1;let i=0;const s=Object.keys(e.properties);for(let o=0;o0)s.push(...f);else return pc(n,u,l)}return t.errors.oneOfPropertyError({property:o,value:a,pointer:r,schema:n,errors:s})}const i=[];for(let s=0;s1?t.errors.multipleOneOfError({matches:i,pointer:r,schema:n,value:e}):t.errors.oneOfError({value:JSON.stringify(e),pointer:r,schema:n,oneOf:n.oneOf})}const Vz=(t,e,n,r)=>{if(Array.isArray(e.oneOf)){const i=t.resolveOneOf(n,e,r);if(Nn(i))return i}};var Fg,OE;function Uz(){if(OE)return Fg;OE=1;var t=function(y){return e(y)&&!n(y)};function e(b){return!!b&&typeof b=="object"}function n(b){var y=Object.prototype.toString.call(b);return y==="[object RegExp]"||y==="[object Date]"||s(b)}var r=typeof Symbol=="function"&&Symbol.for,i=r?Symbol.for("react.element"):60103;function s(b){return b.$$typeof===i}function o(b){return Array.isArray(b)?[]:{}}function a(b,y){return y.clone!==!1&&y.isMergeableObject(b)?m(o(b),b,y):b}function l(b,y,x){return b.concat(y).map(function(S){return a(S,x)})}function u(b,y){if(!y.customMerge)return m;var x=y.customMerge(b);return typeof x=="function"?x:m}function c(b){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(b).filter(function(y){return Object.propertyIsEnumerable.call(b,y)}):[]}function f(b){return Object.keys(b).concat(c(b))}function d(b,y){try{return y in b}catch{return!1}}function h(b,y){return d(b,y)&&!(Object.hasOwnProperty.call(b,y)&&Object.propertyIsEnumerable.call(b,y))}function p(b,y,x){var S={};return x.isMergeableObject(b)&&f(b).forEach(function(E){S[E]=a(b[E],x)}),f(y).forEach(function(E){h(b,E)||(d(b,E)&&x.isMergeableObject(y[E])?S[E]=u(E,x)(b[E],y[E],x):S[E]=a(y[E],x))}),S}function m(b,y,x){x=x||{},x.arrayMerge=x.arrayMerge||l,x.isMergeableObject=x.isMergeableObject||t,x.cloneUnlessOtherwiseSpecified=a;var S=Array.isArray(y),E=Array.isArray(b),C=S===E;return C?S?x.arrayMerge(b,y,x):p(b,y,x):a(y,x)}m.all=function(y,x){if(!Array.isArray(y))throw new Error("first argument should be an array");return y.reduce(function(S,E){return m(S,E,x)},{})};var g=m;return Fg=g,Fg}var Hz=Uz();const S3=Ta(Hz),qz=(t,e)=>e,qv=(t,e)=>S3(t,e,{arrayMerge:qz}),Gz=(t,e)=>{const n=t.concat(e);return n.filter((r,i)=>n.indexOf(r)===i)},Wz=(t,e)=>S3(t,e,{arrayMerge:Gz});function zn(t,e){const n=tt(t),r=tt(e);if(n!==r)return t;const i=Wz(t,e);return t.getOneOfOrigin?Object.defineProperty(i,"getOneOfOrigin",{enumerable:!1,value:t.getOneOfOrigin}):e.getOneOfOrigin&&Object.defineProperty(i,"getOneOfOrigin",{enumerable:!1,value:e.getOneOfOrigin}),i}function Xc(t,...e){const n={};return Object.keys(t).forEach(r=>{e.includes(r)||(n[r]=t[r])}),t.getOneOfOrigin&&Object.defineProperty(n,"getOneOfOrigin",{enumerable:!1,value:t.getOneOfOrigin}),n}var Kz=Function.prototype.toString,Lg=Object.create,Xz=Object.prototype.toString,Yz=(function(){function t(){this._keys=[],this._values=[]}return t.prototype.has=function(e){return!!~this._keys.indexOf(e)},t.prototype.get=function(e){return this._values[this._keys.indexOf(e)]},t.prototype.set=function(e,n){this._keys.push(e),this._values.push(n)},t})();function Jz(){return new Yz}function Zz(){return new WeakMap}var Qz=typeof WeakMap<"u"?Zz:Jz;function Gv(t){if(!t)return Lg(null);var e=t.constructor;if(e===Object)return t===Object.prototype?{}:Lg(t);if(e&&~Kz.call(e).indexOf("[native code]"))try{return new e}catch{}return Lg(t)}function ej(t){var e="";return t.global&&(e+="g"),t.ignoreCase&&(e+="i"),t.multiline&&(e+="m"),t.unicode&&(e+="u"),t.sticky&&(e+="y"),e}function tj(t){return t.flags}var nj=/test/g.flags==="g"?tj:ej;function E3(t){var e=Xz.call(t);return e.substring(8,e.length-1)}function rj(t){return t[Symbol.toStringTag]||E3(t)}var ij=typeof Symbol<"u"?rj:E3,sj=Object.defineProperty,oj=Object.getOwnPropertyDescriptor,w3=Object.getOwnPropertyNames,Wv=Object.getOwnPropertySymbols,_3=Object.prototype,C3=_3.hasOwnProperty,aj=_3.propertyIsEnumerable,A3=typeof Wv=="function";function lj(t){return w3(t).concat(Wv(t))}var uj=A3?lj:w3;function rm(t,e,n){for(var r=uj(t),i=0,s=r.length,o=void 0,a=void 0;i{const i=im(t,e,n);if(i)return t.validate(n,i,r)};function P3(t,e,n){var r;const i={...(r=t.resolveRef(e))!==null&&r!==void 0?r:{}},s=im(t,i,n);return s||Xc(i,"if","then","else")}function R3(t,e,n=t.rootSchema){let r=Bp(n);for(let i=0;i{r=zn(r,t.resolveRef(i))}),r}const kj=(t,e,n,r)=>{const{allOf:i}=e;if(!Array.isArray(i)||i.length===0)return;const s=[];return e.allOf.forEach(o=>{s.push(...t.validate(n,o,r))}),s};function M3(t,e){return t==null||t.$ref==null?t:t.getRoot?t.getRoot().getRef(t):e.getRef(t)}function Oj(t){return t.filter((e,n)=>t.indexOf(e)===n)}function no(t){return tt(t)==="object"}function F3(t,e,n){const{dependencies:r}=e;if(!no(r)||!no(n))return;let i=!1,s={required:[]};if(Object.keys(r).forEach(o=>{var a,l;if(n[o]==null&&!(!((a=e.required)===null||a===void 0)&&a.includes(o)||!((l=s.required)===null||l===void 0)&&l.includes(o)))return;const u=r[o];if(Array.isArray(u)){i=!0,s.required.push(...u);return}if(no(u)){i=!0,s=zn(s,t.resolveRef(u));return}}),i)return s.required=Oj(s.required),s}const Tj=(t,e,n,r)=>{if(tt(e.dependencies)!=="object")return;const i=[];return Object.keys(n).forEach(s=>{if(e.dependencies[s]===void 0||e.dependencies[s]===!0)return;if(e.dependencies[s]===!1){i.push(t.errors.missingDependencyError({pointer:r,schema:e,value:n}));return}let o;const a=tt(e.dependencies[s]);if(a==="array")o=e.dependencies[s].filter(l=>n[l]===void 0).map(l=>t.errors.missingDependencyError({missingProperty:l,pointer:r,schema:e,value:n}));else if(a==="object")o=t.validate(n,e.dependencies[s],r);else throw new Error(`Invalid dependency definition for ${r}/${s}. Must be string[] or schema`);i.push(...o)}),i.length>0?i:void 0};function L3(t,e,n){if(!Array.isArray(e.anyOf)||e.anyOf.length===0)return;let r;return e.anyOf.forEach(i=>{i=t.resolveRef(i),t.isValid(n,i)&&(r=r?zn(r,i):i)}),r}function B3(t,e,n=t.rootSchema,r="#"){const{anyOf:i}=n;if(!Array.isArray(i)||i.length===0)return n;const s=L3(t,n,e);if(s==null)return t.errors.anyOfError({pointer:r,schema:n,value:e,anyOf:JSON.stringify(i)});const o=zn(n,s);return Xc(o,"anyOf")}const Ij=(t,e,n,r)=>{if(!(!Array.isArray(e.anyOf)||e.anyOf.length===0)){for(let i=0;ie.includes(n))!==-1}function qb(t,e,n,r){let i,s;if(e=t.resolveRef(e),e.oneOf){const c=Hv(t,n,e,r);Nn(c)?s=c:c&&(i=zn(i??{},c))}if(Array.isArray(e.allOf)){const c=e.allOf.map(f=>{if(Rj(f)){let d=qb(t,f,n,r);return d?(d=zn(f,d),Xc(d,...TE)):void 0}return f});if(c.length>0){const f=N3(t,{allOf:c});i=zn(i??{},f)}}const o=L3(t,e,n);o&&(i=zn(i??{},o));const a=F3(t,e,n);a&&(i=zn(i??{},a));const l=im(t,e,n);if(l&&(i=zn(i??{},l)),i==null)return s;const u=qb(t,i,n,r);return u&&(i=zn(i,u)),Xc(i,...TE)}const Nj=["allOf","anyOf","oneOf","dependencies","if","then","else"];function IE(t,e,n,r){let i=qb(t,e,n,r);return i?(i=zn(e,i),Xc(i,...Nj)):e}class $3{constructor(e,n){this.remotes={},this.errors={},this.typeKeywords={},this.validateKeyword={},this.validateType={},this.validateFormat={},this.config=e,this.typeKeywords=Bp(e.typeKeywords),this.validateKeyword=Object.assign({},e.validateKeyword),this.validateType=Object.assign({},e.validateType),this.validateFormat=Object.assign({},e.validateFormat),this.errors=Object.assign({},e.errors),this.setSchema(n)}get rootSchema(){return this.__rootSchema}set rootSchema(e){e!=null&&(this.__rootSchema=this.config.compileSchema(this,e))}addRemoteSchema(e,n){this.config.addRemoteSchema(this,e,n)}compileSchema(e){var n;return this.config.compileSchema(this,e,(n=this.rootSchema)!==null&&n!==void 0?n:e)}createSchemaOf(e){return this.config.createSchemaOf(e)}each(e,n,r,i){return this.config.each(this,e,n,r,i)}eachSchema(e,n=this.rootSchema){return this.config.eachSchema(n,e)}getChildSchemaSelection(e,n){return this.config.getChildSchemaSelection(this,e,n)}getSchema(e){return this.config.getSchema(this,e)}getTemplate(e,n,r=this.config.templateDefaultOptions){return this.config.getTemplate(this,e,n,r)}isValid(e,n,r){return this.config.isValid(this,e,n,r)}resolveAnyOf(e,n,r){return this.config.resolveAnyOf(this,e,n,r)}resolveAllOf(e,n){return this.config.resolveAllOf(this,e,n)}resolveRef(e){return this.config.resolveRef(e,this.rootSchema)}resolveOneOf(e,n,r){return this.config.resolveOneOf(this,e,n,r)}setSchema(e){this.rootSchema=e}step(e,n,r,i){return this.config.step(this,e,n,r,i)}validate(e,n,r){return this.config.validate(this,e,n,r)}}function z3(t,e,n){n.id=n.id||e,t.remotes[e]=t.compileSchema(n)}var Bh={exports:{}},Mj=Bh.exports,PE;function Fj(){return PE||(PE=1,(function(t,e){(function(n,r){t.exports=r()})(typeof self<"u"?self:Mj,(()=>(()=>{var n={d:(P,R)=>{for(var F in R)n.o(R,F)&&!n.o(P,F)&&Object.defineProperty(P,F,{enumerable:!0,get:R[F]})},o:(P,R)=>Object.prototype.hasOwnProperty.call(P,R),r:P=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(P,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(P,"__esModule",{value:!0})}},r={};function i(P){return P==="#"||P===""||Array.isArray(P)&&P.length===0||!1}n.r(r),n.d(r,{default:()=>N,get:()=>d,isRoot:()=>i,join:()=>D,remove:()=>E,removeUndefinedItems:()=>S,set:()=>b,split:()=>f,splitLast:()=>I});const s=/~1/g,o=/~0/g,a=/\/+/g,l=/(^[#/]*|\/+$)/g;function u(P){return P.replace(s,"/").replace(o,"~")}function c(P){return u(decodeURIComponent(P))}function f(P){if(P==null||typeof P!="string"||i(P))return Array.isArray(P)?P:[];const R=P.indexOf("#")>=0?c:u,F=(P=(P=P.replace(a,"/")).replace(l,"")).split("/");for(let V=0,B=F.length;V0&&R[0]=="prototype"}function b(P,R,F){if(R==null)return P;const V=f(R);if(V.length===0)return P;P==null&&(P=p.test(V[0])?[]:{});let B,G,H=P;for(;V.length>1;)B=V.shift(),G=p.test(V[0]),g(B,V)||(H=x(H,B,G));return B=V.pop(),y(H,B,F),P}function y(P,R,F){let V;const B=R.match(m);R==="[]"&&Array.isArray(P)?P.push(F):B?(V=B.pop(),P[V]=F):P[R]=F}function x(P,R,F){if(P[R]!=null)return P[R];const V=F?[]:{};return y(P,R,V),V}function S(P){let R=0,F=0;for(;R+F0?null:{type:null,text:b[0],rest:m.substr(b[0].length),start:0,end:b[0].length-1,fullText:b[0],errors:[],children:[],parent:null}:null}Qn.readToken=s;function o(m){return m.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}Qn.escapeRegExp=o;function a(m){m.rest="",m.children&&m.children.forEach(g=>a(g))}function l(m,g){m.start+=g,m.end+=g,m.children&&m.children.forEach(b=>l(b,m.start))}function u(m,g){g.errors&&g.errors.length&&g.errors.forEach(b=>m.push(b)),g.children&&g.children.forEach(b=>u(m,b))}function c(m){let g=e.exec(m),b=n.exec(m),y=g&&g[0]||"",x=b&&b[0]||"",S={raw:m,name:m.replace(e,"").replace(n,""),isOptional:y=="?"||y=="*",allowRepetition:y=="+"||y=="*",atLeastOne:y=="+",lookupPositive:x=="&",lookupNegative:x=="!",pinned:x=="@",lookup:!1,isLiteral:!1};return S.isLiteral=S.name[0]=="'"||S.name[0]=='"',S.lookup=S.lookupNegative||S.lookupPositive,S}Qn.parseRuleName=c;function f(m,g){let b=c(m);return g.cachedRules[b.name]||null}Qn.findRuleByName=f;function d(m,g){if(m.children){let b=m.children.filter(y=>y.type&&g.test(y.type));for(let y=0;yd(y,g))}}const h=["EOF"];class p{constructor(g,b){this.grammarRules=g,this.options=b,this.cachedRules={},this.debug=b?b.debug===!0:!1;let y=[],x=[];if(g.forEach(S=>{let E=c(S.name);if(E.name in this.cachedRules){y.push("Duplicated rule "+E.name);return}else this.cachedRules[E.name]=S;if(!S.bnf||!S.bnf.length){let C="Missing rule content, rule: "+S.name;y.indexOf(C)==-1&&y.push(C)}else S.bnf.forEach(C=>{if(typeof C[0]=="string"&&c(C[0]).name==S.name){let A="Left recursion is not allowed, rule: "+S.name;y.indexOf(A)==-1&&y.push(A)}C.forEach(w=>{if(typeof w=="string"){let A=c(w);!A.isLiteral&&x.indexOf(A.name)==-1&&h.indexOf(A.name)==-1&&x.push(A.name)}})});r==S.name&&(S.implicitWs=!1),S.implicitWs&&x.indexOf(r)==-1&&x.push(r),S.recover&&x.indexOf(S.recover)==-1&&x.push(S.recover)}),x.forEach(S=>{S in this.cachedRules||y.push("Missing rule "+S)}),y.length)throw new Error(y.join(` +`+" ".repeat(e));var wp;(function(t){t.DEFAULT={allowTrailingComma:!1}})(wp||(wp={}));function e$(t,e=[],n=wp.DEFAULT){let r=null,i=[];const s=[];function o(l){Array.isArray(i)?i.push(l):r!==null&&(i[r]=l)}return t$(t,{onObjectBegin:()=>{const l={};o(l),s.push(i),i=l,r=null},onObjectProperty:l=>{r=l},onObjectEnd:()=>{i=s.pop()},onArrayBegin:()=>{const l=[];o(l),s.push(i),i=l,r=null},onArrayEnd:()=>{i=s.pop()},onLiteralValue:o,onError:(l,u,c)=>{e.push({error:l,offset:u,length:c})}},n),i[0]}function t$(t,e,n=wp.DEFAULT){const r=QB(t,!1),i=[];let s=0;function o(R){return R?()=>s===0&&R(r.getTokenOffset(),r.getTokenLength(),r.getTokenStartLine(),r.getTokenStartCharacter()):()=>!0}function a(R){return R?F=>s===0&&R(F,r.getTokenOffset(),r.getTokenLength(),r.getTokenStartLine(),r.getTokenStartCharacter()):()=>!0}function l(R){return R?F=>s===0&&R(F,r.getTokenOffset(),r.getTokenLength(),r.getTokenStartLine(),r.getTokenStartCharacter(),()=>i.slice()):()=>!0}function u(R){return R?()=>{s>0?s++:R(r.getTokenOffset(),r.getTokenLength(),r.getTokenStartLine(),r.getTokenStartCharacter(),()=>i.slice())===!1&&(s=1)}:()=>!0}function c(R){return R?()=>{s>0&&s--,s===0&&R(r.getTokenOffset(),r.getTokenLength(),r.getTokenStartLine(),r.getTokenStartCharacter())}:()=>!0}const f=u(e.onObjectBegin),d=l(e.onObjectProperty),h=c(e.onObjectEnd),p=u(e.onArrayBegin),m=c(e.onArrayEnd),g=l(e.onLiteralValue),b=a(e.onSeparator),y=o(e.onComment),x=a(e.onError),S=n&&n.disallowComments,E=n&&n.allowTrailingComma;function C(){for(;;){const R=r.scan();switch(r.getTokenError()){case 4:w(14);break;case 5:w(15);break;case 3:w(13);break;case 1:S||w(11);break;case 2:w(12);break;case 6:w(16);break}switch(R){case 12:case 13:S?w(10):y();break;case 16:w(1);break;case 15:case 14:break;default:return R}}}function w(R,F=[],V=[]){if(x(R),F.length+V.length>0){let B=r.getToken();for(;B!==17;){if(F.indexOf(B)!==-1){C();break}else if(V.indexOf(B)!==-1)break;B=C()}}}function A(R){const F=r.getTokenValue();return R?g(F):(d(F),i.push(F)),C(),!0}function _(){switch(r.getToken()){case 11:const R=r.getTokenValue();let F=Number(R);isNaN(F)&&(w(2),F=0),g(F);break;case 7:g(null);break;case 8:g(!0);break;case 9:g(!1);break;default:return!1}return C(),!0}function O(){return r.getToken()!==10?(w(3,[],[2,5]),!1):(A(!1),r.getToken()===6?(b(":"),C(),P()||w(4,[],[2,5])):w(5,[],[2,5]),i.pop(),!0)}function I(){f(),C();let R=!1;for(;r.getToken()!==2&&r.getToken()!==17;){if(r.getToken()===5){if(R||w(4,[],[]),b(","),C(),r.getToken()===2&&E)break}else R&&w(6,[],[]);O()||w(4,[],[2,5]),R=!0}return h(),r.getToken()!==2?w(7,[2],[]):C(),!0}function N(){p(),C();let R=!0,F=!1;for(;r.getToken()!==4&&r.getToken()!==17;){if(r.getToken()===5){if(F||w(4,[],[]),b(","),C(),r.getToken()===4&&E)break}else F&&w(6,[],[]);R?(i.push(0),R=!1):i[i.length-1]++,P()||w(4,[],[4,5]),F=!0}return m(),R||i.pop(),r.getToken()!==4?w(8,[4],[]):C(),!0}function P(){switch(r.getToken()){case 3:return N();case 1:return I();case 10:return A(!0);default:return _()}}return C(),r.getToken()===17?n.allowEmptyContent?!0:(w(4,[],[]),!1):P()?(r.getToken()!==17&&w(9,[],[]),!0):(w(4,[],[]),!1)}var XS;(function(t){t[t.None=0]="None",t[t.UnexpectedEndOfComment=1]="UnexpectedEndOfComment",t[t.UnexpectedEndOfString=2]="UnexpectedEndOfString",t[t.UnexpectedEndOfNumber=3]="UnexpectedEndOfNumber",t[t.InvalidUnicode=4]="InvalidUnicode",t[t.InvalidEscapeCharacter=5]="InvalidEscapeCharacter",t[t.InvalidCharacter=6]="InvalidCharacter"})(XS||(XS={}));var YS;(function(t){t[t.OpenBraceToken=1]="OpenBraceToken",t[t.CloseBraceToken=2]="CloseBraceToken",t[t.OpenBracketToken=3]="OpenBracketToken",t[t.CloseBracketToken=4]="CloseBracketToken",t[t.CommaToken=5]="CommaToken",t[t.ColonToken=6]="ColonToken",t[t.NullKeyword=7]="NullKeyword",t[t.TrueKeyword=8]="TrueKeyword",t[t.FalseKeyword=9]="FalseKeyword",t[t.StringLiteral=10]="StringLiteral",t[t.NumericLiteral=11]="NumericLiteral",t[t.LineCommentTrivia=12]="LineCommentTrivia",t[t.BlockCommentTrivia=13]="BlockCommentTrivia",t[t.LineBreakTrivia=14]="LineBreakTrivia",t[t.Trivia=15]="Trivia",t[t.Unknown=16]="Unknown",t[t.EOF=17]="EOF"})(YS||(YS={}));const n$=e$;var JS;(function(t){t[t.InvalidSymbol=1]="InvalidSymbol",t[t.InvalidNumberFormat=2]="InvalidNumberFormat",t[t.PropertyNameExpected=3]="PropertyNameExpected",t[t.ValueExpected=4]="ValueExpected",t[t.ColonExpected=5]="ColonExpected",t[t.CommaExpected=6]="CommaExpected",t[t.CloseBraceExpected=7]="CloseBraceExpected",t[t.CloseBracketExpected=8]="CloseBracketExpected",t[t.EndOfFileExpected=9]="EndOfFileExpected",t[t.InvalidCommentToken=10]="InvalidCommentToken",t[t.UnexpectedEndOfComment=11]="UnexpectedEndOfComment",t[t.UnexpectedEndOfString=12]="UnexpectedEndOfString",t[t.UnexpectedEndOfNumber=13]="UnexpectedEndOfNumber",t[t.InvalidUnicode=14]="InvalidUnicode",t[t.InvalidEscapeCharacter=15]="InvalidEscapeCharacter",t[t.InvalidCharacter=16]="InvalidCharacter"})(JS||(JS={}));function r$(t){switch(t){case 1:return"InvalidSymbol";case 2:return"InvalidNumberFormat";case 3:return"PropertyNameExpected";case 4:return"ValueExpected";case 5:return"ColonExpected";case 6:return"CommaExpected";case 7:return"CloseBraceExpected";case 8:return"CloseBracketExpected";case 9:return"EndOfFileExpected";case 10:return"InvalidCommentToken";case 11:return"UnexpectedEndOfComment";case 12:return"UnexpectedEndOfString";case 13:return"UnexpectedEndOfNumber";case 14:return"InvalidUnicode";case 15:return"InvalidEscapeCharacter";case 16:return"InvalidCharacter"}return""}const i$=Lb(t=>{const e=t.state.doc.toString();if(e.length===0)return[];const n=[];return n$(e,n),n.map(r=>({from:r.offset,to:r.offset+1,severity:"error",message:r$(r.error)}))}),Rk=1024;let s$=0;class Cg{constructor(e,n){this.from=e,this.to=n}}class Ve{constructor(e={}){this.id=s$++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")})}add(e){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof e!="function"&&(e=fr.match(e)),n=>{let r=e(n);return r===void 0?null:[this,r]}}}Ve.closedBy=new Ve({deserialize:t=>t.split(" ")});Ve.openedBy=new Ve({deserialize:t=>t.split(" ")});Ve.group=new Ve({deserialize:t=>t.split(" ")});Ve.isolate=new Ve({deserialize:t=>{if(t&&t!="rtl"&&t!="ltr"&&t!="auto")throw new RangeError("Invalid value for isolate: "+t);return t||"auto"}});Ve.contextHash=new Ve({perNode:!0});Ve.lookAhead=new Ve({perNode:!0});Ve.mounted=new Ve({perNode:!0});class _p{constructor(e,n,r){this.tree=e,this.overlay=n,this.parser=r}static get(e){return e&&e.props&&e.props[Ve.mounted.id]}}const o$=Object.create(null);class fr{constructor(e,n,r,i=0){this.name=e,this.props=n,this.id=r,this.flags=i}static define(e){let n=e.props&&e.props.length?Object.create(null):o$,r=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(e.name==null?8:0),i=new fr(e.name||"",n,e.id,r);if(e.props){for(let s of e.props)if(Array.isArray(s)||(s=s(i)),s){if(s[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");n[s[0].id]=s[1]}}return i}prop(e){return this.props[e.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(e){if(typeof e=="string"){if(this.name==e)return!0;let n=this.prop(Ve.group);return n?n.indexOf(e)>-1:!1}return this.id==e}static match(e){let n=Object.create(null);for(let r in e)for(let i of r.split(" "))n[i]=e[r];return r=>{for(let i=r.prop(Ve.group),s=-1;s<(i?i.length:0);s++){let o=n[s<0?r.name:i[s]];if(o)return o}}}}fr.none=new fr("",Object.create(null),0,8);class Ov{constructor(e){this.types=e;for(let n=0;n0;for(let l=this.cursor(o|hn.IncludeAnonymous);;){let u=!1;if(l.from<=s&&l.to>=i&&(!a&&l.type.isAnonymous||n(l)!==!1)){if(l.firstChild())continue;u=!0}for(;u&&r&&(a||!l.type.isAnonymous)&&r(l),!l.nextSibling();){if(!l.parent())return;u=!0}}}prop(e){return e.perNode?this.props?this.props[e.id]:void 0:this.type.prop(e)}get propValues(){let e=[];if(this.props)for(let n in this.props)e.push([+n,this.props[n]]);return e}balance(e={}){return this.children.length<=8?this:Pv(fr.none,this.children,this.positions,0,this.children.length,0,this.length,(n,r,i)=>new en(this.type,n,r,i,this.propValues),e.makeTree||((n,r,i)=>new en(fr.none,n,r,i)))}static build(e){return c$(e)}}en.empty=new en(fr.none,[],[],0);class Tv{constructor(e,n){this.buffer=e,this.index=n}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new Tv(this.buffer,this.index)}}class bo{constructor(e,n,r){this.buffer=e,this.length=n,this.set=r}get type(){return fr.none}toString(){let e=[];for(let n=0;n0));l=o[l+3]);return a}slice(e,n,r){let i=this.buffer,s=new Uint16Array(n-e),o=0;for(let a=e,l=0;a=e&&ne;case 1:return n<=e&&r>e;case 2:return r>e;case 4:return!0}}function Uc(t,e,n,r){for(var i;t.from==t.to||(n<1?t.from>=e:t.from>e)||(n>-1?t.to<=e:t.to0?a.length:-1;e!=u;e+=n){let c=a[e],f=l[e]+o.from;if(Nk(i,r,f,f+c.length)){if(c instanceof bo){if(s&hn.ExcludeBuffers)continue;let d=c.findChild(0,c.buffer.length,n,r-f,i);if(d>-1)return new Xs(new a$(o,c,e,f),null,d)}else if(s&hn.IncludeAnonymous||!c.type.isAnonymous||Iv(c)){let d;if(!(s&hn.IgnoreMounts)&&(d=_p.get(c))&&!d.overlay)return new Vr(d.tree,f,e,o);let h=new Vr(c,f,e,o);return s&hn.IncludeAnonymous||!h.type.isAnonymous?h:h.nextChild(n<0?c.children.length-1:0,n,r,i)}}}if(s&hn.IncludeAnonymous||!o.type.isAnonymous||(o.index>=0?e=o.index+n:e=n<0?-1:o._parent._tree.children.length,o=o._parent,!o))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(e){return this.nextChild(0,1,e,2)}childBefore(e){return this.nextChild(this._tree.children.length-1,-1,e,-2)}enter(e,n,r=0){let i;if(!(r&hn.IgnoreOverlays)&&(i=_p.get(this._tree))&&i.overlay){let s=e-this.from;for(let{from:o,to:a}of i.overlay)if((n>0?o<=s:o=s:a>s))return new Vr(i.tree,i.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,e,n,r)}nextSignificantParent(){let e=this;for(;e.type.isAnonymous&&e._parent;)e=e._parent;return e}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}}function QS(t,e,n,r){let i=t.cursor(),s=[];if(!i.firstChild())return s;if(n!=null){for(let o=!1;!o;)if(o=i.type.is(n),!i.nextSibling())return s}for(;;){if(r!=null&&i.type.is(r))return s;if(i.type.is(e)&&s.push(i.node),!i.nextSibling())return r==null?s:[]}}function $b(t,e,n=e.length-1){for(let r=t;n>=0;r=r.parent){if(!r)return!1;if(!r.type.isAnonymous){if(e[n]&&e[n]!=r.name)return!1;n--}}return!0}class a${constructor(e,n,r,i){this.parent=e,this.buffer=n,this.index=r,this.start=i}}class Xs extends Mk{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(e,n,r){super(),this.context=e,this._parent=n,this.index=r,this.type=e.buffer.set.types[e.buffer.buffer[r]]}child(e,n,r){let{buffer:i}=this.context,s=i.findChild(this.index+4,i.buffer[this.index+3],e,n-this.context.start,r);return s<0?null:new Xs(this.context,this,s)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(e){return this.child(1,e,2)}childBefore(e){return this.child(-1,e,-2)}enter(e,n,r=0){if(r&hn.ExcludeBuffers)return null;let{buffer:i}=this.context,s=i.findChild(this.index+4,i.buffer[this.index+3],n>0?1:-1,e-this.context.start,n);return s<0?null:new Xs(this.context,this,s)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(e){return this._parent?null:this.context.parent.nextChild(this.context.index+e,e,0,4)}get nextSibling(){let{buffer:e}=this.context,n=e.buffer[this.index+3];return n<(this._parent?e.buffer[this._parent.index+3]:e.buffer.length)?new Xs(this.context,this._parent,n):this.externalSibling(1)}get prevSibling(){let{buffer:e}=this.context,n=this._parent?this._parent.index+4:0;return this.index==n?this.externalSibling(-1):new Xs(this.context,this._parent,e.findChild(n,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],n=[],{buffer:r}=this.context,i=this.index+4,s=r.buffer[this.index+3];if(s>i){let o=r.buffer[this.index+1];e.push(r.slice(i,s,o)),n.push(0)}return new en(this.type,e,n,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function Fk(t){if(!t.length)return null;let e=0,n=t[0];for(let s=1;sn.from||o.to=e){let a=new Vr(o.tree,o.overlay[0].from+s.from,-1,s);(i||(i=[r])).push(Uc(a,e,n,!1))}}return i?Fk(i):r}class zb{get name(){return this.type.name}constructor(e,n=0){if(this.mode=n,this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,e instanceof Vr)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let r=e._parent;r;r=r._parent)this.stack.unshift(r.index);this.bufferNode=e,this.yieldBuf(e.index)}}yieldNode(e){return e?(this._tree=e,this.type=e.type,this.from=e.from,this.to=e.to,!0):!1}yieldBuf(e,n){this.index=e;let{start:r,buffer:i}=this.buffer;return this.type=n||i.set.types[i.buffer[e]],this.from=r+i.buffer[e+1],this.to=r+i.buffer[e+2],!0}yield(e){return e?e instanceof Vr?(this.buffer=null,this.yieldNode(e)):(this.buffer=e.context,this.yieldBuf(e.index,e.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(e,n,r){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,n,r,this.mode));let{buffer:i}=this.buffer,s=i.findChild(this.index+4,i.buffer[this.index+3],e,n-this.buffer.start,r);return s<0?!1:(this.stack.push(this.index),this.yieldBuf(s))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(e){return this.enterChild(1,e,2)}childBefore(e){return this.enterChild(-1,e,-2)}enter(e,n,r=this.mode){return this.buffer?r&hn.ExcludeBuffers?!1:this.enterChild(1,e,n):this.yield(this._tree.enter(e,n,r))}parent(){if(!this.buffer)return this.yieldNode(this.mode&hn.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&hn.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(e)}sibling(e){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+e,e,0,4,this.mode)):!1;let{buffer:n}=this.buffer,r=this.stack.length-1;if(e<0){let i=r<0?0:this.stack[r]+4;if(this.index!=i)return this.yieldBuf(n.findChild(i,this.index,-1,0,4))}else{let i=n.buffer[this.index+3];if(i<(r<0?n.buffer.length:n.buffer[this.stack[r]+3]))return this.yieldBuf(i)}return r<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+e,e,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(e){let n,r,{buffer:i}=this;if(i){if(e>0){if(this.index-1)for(let s=n+e,o=e<0?-1:r._tree.children.length;s!=o;s+=e){let a=r._tree.children[s];if(this.mode&hn.IncludeAnonymous||a instanceof bo||!a.type.isAnonymous||Iv(a))return!1}return!0}move(e,n){if(n&&this.enterChild(e,0,4))return!0;for(;;){if(this.sibling(e))return!0;if(this.atLastNode(e)||!this.parent())return!1}}next(e=!0){return this.move(1,e)}prev(e=!0){return this.move(-1,e)}moveTo(e,n=0){for(;(this.from==this.to||(n<1?this.from>=e:this.from>e)||(n>-1?this.to<=e:this.to=0;){for(let o=e;o;o=o._parent)if(o.index==i){if(i==this.index)return o;n=o,r=s+1;break e}i=this.stack[--s]}for(let i=r;i=0;s--){if(s<0)return $b(this._tree,e,i);let o=r[n.buffer[this.stack[s]]];if(!o.isAnonymous){if(e[i]&&e[i]!=o.name)return!1;i--}}return!0}}function Iv(t){return t.children.some(e=>e instanceof bo||!e.type.isAnonymous||Iv(e))}function c$(t){var e;let{buffer:n,nodeSet:r,maxBufferLength:i=Rk,reused:s=[],minRepeatType:o=r.types.length}=t,a=Array.isArray(n)?new Tv(n,n.length):n,l=r.types,u=0,c=0;function f(E,C,w,A,_,O){let{id:I,start:N,end:P,size:R}=a,F=c,V=u;for(;R<0;)if(a.next(),R==-1){let se=s[I];w.push(se),A.push(N-E);return}else if(R==-3){u=I;return}else if(R==-4){c=I;return}else throw new RangeError(`Unrecognized record size: ${R}`);let B=l[I],G,H,ie=N-E;if(P-N<=i&&(H=g(a.pos-C,_))){let se=new Uint16Array(H.size-H.skip),$=a.pos-H.size,ee=se.length;for(;a.pos>$;)ee=b(H.start,se,ee);G=new bo(se,P-H.start,r),ie=H.start-E}else{let se=a.pos-R;a.next();let $=[],ee=[],pe=I>=o?I:-1,fe=0,me=P;for(;a.pos>se;)pe>=0&&a.id==pe&&a.size>=0?(a.end<=me-i&&(p($,ee,N,fe,a.end,me,pe,F,V),fe=$.length,me=a.end),a.next()):O>2500?d(N,se,$,ee):f(N,se,$,ee,pe,O+1);if(pe>=0&&fe>0&&fe<$.length&&p($,ee,N,fe,N,me,pe,F,V),$.reverse(),ee.reverse(),pe>-1&&fe>0){let Me=h(B,V);G=Pv(B,$,ee,0,$.length,0,P-N,Me,Me)}else G=m(B,$,ee,P-N,F-P,V)}w.push(G),A.push(ie)}function d(E,C,w,A){let _=[],O=0,I=-1;for(;a.pos>C;){let{id:N,start:P,end:R,size:F}=a;if(F>4)a.next();else{if(I>-1&&P=0;R-=3)N[F++]=_[R],N[F++]=_[R+1]-P,N[F++]=_[R+2]-P,N[F++]=F;w.push(new bo(N,_[2]-P,r)),A.push(P-E)}}function h(E,C){return(w,A,_)=>{let O=0,I=w.length-1,N,P;if(I>=0&&(N=w[I])instanceof en){if(!I&&N.type==E&&N.length==_)return N;(P=N.prop(Ve.lookAhead))&&(O=A[I]+N.length+P)}return m(E,w,A,_,O,C)}}function p(E,C,w,A,_,O,I,N,P){let R=[],F=[];for(;E.length>A;)R.push(E.pop()),F.push(C.pop()+w-_);E.push(m(r.types[I],R,F,O-_,N-O,P)),C.push(_-w)}function m(E,C,w,A,_,O,I){if(O){let N=[Ve.contextHash,O];I=I?[N].concat(I):[N]}if(_>25){let N=[Ve.lookAhead,_];I=I?[N].concat(I):[N]}return new en(E,C,w,A,I)}function g(E,C){let w=a.fork(),A=0,_=0,O=0,I=w.end-i,N={size:0,start:0,skip:0};e:for(let P=w.pos-E;w.pos>P;){let R=w.size;if(w.id==C&&R>=0){N.size=A,N.start=_,N.skip=O,O+=4,A+=4,w.next();continue}let F=w.pos-R;if(R<0||F=o?4:0,B=w.start;for(w.next();w.pos>F;){if(w.size<0)if(w.size==-3)V+=4;else break e;else w.id>=o&&(V+=4);w.next()}_=B,A+=R,O+=V}return(C<0||A==E)&&(N.size=A,N.start=_,N.skip=O),N.size>4?N:void 0}function b(E,C,w){let{id:A,start:_,end:O,size:I}=a;if(a.next(),I>=0&&A4){let P=a.pos-(I-4);for(;a.pos>P;)w=b(E,C,w)}C[--w]=N,C[--w]=O-E,C[--w]=_-E,C[--w]=A}else I==-3?u=A:I==-4&&(c=A);return w}let y=[],x=[];for(;a.pos>0;)f(t.start||0,t.bufferStart||0,y,x,-1,0);let S=(e=t.length)!==null&&e!==void 0?e:y.length?x[0]+y[0].length:0;return new en(l[t.topID],y.reverse(),x.reverse(),S)}const eE=new WeakMap;function Rh(t,e){if(!t.isAnonymous||e instanceof bo||e.type!=t)return 1;let n=eE.get(e);if(n==null){n=1;for(let r of e.children){if(r.type!=t||!(r instanceof en)){n=1;break}n+=Rh(t,r)}eE.set(e,n)}return n}function Pv(t,e,n,r,i,s,o,a,l){let u=0;for(let p=r;p=c)break;C+=w}if(x==S+1){if(C>c){let w=p[S];h(w.children,w.positions,0,w.children.length,m[S]+y);continue}f.push(p[S])}else{let w=m[x-1]+p[x-1].length-E;f.push(Pv(t,p,m,S,x,E,w,null,l))}d.push(E+y-s)}}return h(e,n,r,i,0),(a||l)(f,d,o)}class ra{constructor(e,n,r,i,s=!1,o=!1){this.from=e,this.to=n,this.tree=r,this.offset=i,this.open=(s?1:0)|(o?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(e,n=[],r=!1){let i=[new ra(0,e.length,e,0,!1,r)];for(let s of n)s.to>e.length&&i.push(s);return i}static applyChanges(e,n,r=128){if(!n.length)return e;let i=[],s=1,o=e.length?e[0]:null;for(let a=0,l=0,u=0;;a++){let c=a=r)for(;o&&o.from=d.from||f<=d.to||u){let h=Math.max(d.from,l)-u,p=Math.min(d.to,f)-u;d=h>=p?null:new ra(h,p,d.tree,d.offset+u,a>0,!!c)}if(d&&i.push(d),o.to>f)break;o=snew Cg(i.from,i.to)):[new Cg(0,0)]:[new Cg(0,e.length)],this.createParse(e,n||[],r)}parse(e,n,r){let i=this.startParse(e,n,r);for(;;){let s=i.advance();if(s)return s}}};class f${constructor(e){this.string=e}get length(){return this.string.length}chunk(e){return this.string.slice(e)}get lineChunks(){return!1}read(e,n){return this.string.slice(e,n)}}new Ve({perNode:!0});var tE={};class Cp{constructor(e,n,r,i,s,o,a,l,u,c=0,f){this.p=e,this.stack=n,this.state=r,this.reducePos=i,this.pos=s,this.score=o,this.buffer=a,this.bufferBase=l,this.curContext=u,this.lookAhead=c,this.parent=f}toString(){return`[${this.stack.filter((e,n)=>n%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(e,n,r=0){let i=e.parser.context;return new Cp(e,[],n,r,r,0,[],0,i?new nE(i,i.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(e,n){this.stack.push(this.state,n,this.bufferBase+this.buffer.length),this.state=e}reduce(e){var n;let r=e>>19,i=e&65535,{parser:s}=this.p,o=this.reducePos=2e3&&!(!((n=this.p.parser.nodeSet.types[i])===null||n===void 0)&&n.isAnonymous)&&(u==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=c):this.p.lastBigReductionSizel;)this.stack.pop();this.reduceContext(i,u)}storeNode(e,n,r,i=4,s=!1){if(e==0&&(!this.stack.length||this.stack[this.stack.length-1]0&&o.buffer[a-4]==0&&o.buffer[a-1]>-1){if(n==r)return;if(o.buffer[a-2]>=n){o.buffer[a-2]=r;return}}}if(!s||this.pos==r)this.buffer.push(e,n,r,i);else{let o=this.buffer.length;if(o>0&&this.buffer[o-4]!=0){let a=!1;for(let l=o;l>0&&this.buffer[l-2]>r;l-=4)if(this.buffer[l-1]>=0){a=!0;break}if(a)for(;o>0&&this.buffer[o-2]>r;)this.buffer[o]=this.buffer[o-4],this.buffer[o+1]=this.buffer[o-3],this.buffer[o+2]=this.buffer[o-2],this.buffer[o+3]=this.buffer[o-1],o-=4,i>4&&(i-=4)}this.buffer[o]=e,this.buffer[o+1]=n,this.buffer[o+2]=r,this.buffer[o+3]=i}}shift(e,n,r,i){if(e&131072)this.pushState(e&65535,this.pos);else if((e&262144)==0){let s=e,{parser:o}=this.p;(i>this.pos||n<=o.maxNode)&&(this.pos=i,o.stateFlag(s,1)||(this.reducePos=i)),this.pushState(s,r),this.shiftContext(n,r),n<=o.maxNode&&this.buffer.push(n,r,i,4)}else this.pos=i,this.shiftContext(n,r),n<=this.p.parser.maxNode&&this.buffer.push(n,r,i,4)}apply(e,n,r,i){e&65536?this.reduce(e):this.shift(e,n,r,i)}useNode(e,n){let r=this.p.reused.length-1;(r<0||this.p.reused[r]!=e)&&(this.p.reused.push(e),r++);let i=this.pos;this.reducePos=this.pos=i+e.length,this.pushState(n,i),this.buffer.push(r,i,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,e,this,this.p.stream.reset(this.pos-e.length)))}split(){let e=this,n=e.buffer.length;for(;n>0&&e.buffer[n-2]>e.reducePos;)n-=4;let r=e.buffer.slice(n),i=e.bufferBase+n;for(;e&&i==e.bufferBase;)e=e.parent;return new Cp(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,r,i,this.curContext,this.lookAhead,e)}recoverByDelete(e,n){let r=e<=this.p.parser.maxNode;r&&this.storeNode(e,this.pos,n,4),this.storeNode(0,this.pos,n,r?8:4),this.pos=this.reducePos=n,this.score-=190}canShift(e){for(let n=new d$(this);;){let r=this.p.parser.stateSlot(n.state,4)||this.p.parser.hasAction(n.state,e);if(r==0)return!1;if((r&65536)==0)return!0;n.reduce(r)}}recoverByInsert(e){if(this.stack.length>=300)return[];let n=this.p.parser.nextStates(this.state);if(n.length>8||this.stack.length>=120){let i=[];for(let s=0,o;sl&1&&a==o)||i.push(n[s],o)}n=i}let r=[];for(let i=0;i>19,i=n&65535,s=this.stack.length-r*3;if(s<0||e.getGoto(this.stack[s],i,!1)<0){let o=this.findForcedReduction();if(o==null)return!1;n=o}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(n),!0}findForcedReduction(){let{parser:e}=this.p,n=[],r=(i,s)=>{if(!n.includes(i))return n.push(i),e.allActions(i,o=>{if(!(o&393216))if(o&65536){let a=(o>>19)-s;if(a>1){let l=o&65535,u=this.stack.length-a*3;if(u>=0&&e.getGoto(this.stack[u],l,!1)>=0)return a<<19|65536|l}}else{let a=r(o,s+1);if(a!=null)return a}})};return r(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(this.stack.length!=3)return!1;let{parser:e}=this.p;return e.data[e.stateSlot(this.state,1)]==65535&&!e.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(e){if(this.state!=e.state||this.stack.length!=e.stack.length)return!1;for(let n=0;nthis.lookAhead&&(this.emitLookAhead(),this.lookAhead=e)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}}class nE{constructor(e,n){this.tracker=e,this.context=n,this.hash=e.strict?e.hash(n):0}}class d${constructor(e){this.start=e,this.state=e.state,this.stack=e.stack,this.base=this.stack.length}reduce(e){let n=e&65535,r=e>>19;r==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(r-1)*3;let i=this.start.p.parser.getGoto(this.stack[this.base-3],n,!0);this.state=i}}class Ap{constructor(e,n,r){this.stack=e,this.pos=n,this.index=r,this.buffer=e.buffer,this.index==0&&this.maybeNext()}static create(e,n=e.bufferBase+e.buffer.length){return new Ap(e,n,n-e.bufferBase)}maybeNext(){let e=this.stack.parent;e!=null&&(this.index=this.stack.bufferBase-e.bufferBase,this.stack=e,this.buffer=e.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,this.index==0&&this.maybeNext()}fork(){return new Ap(this.stack,this.pos,this.index)}}function Fd(t,e=Uint16Array){if(typeof t!="string")return t;let n=null;for(let r=0,i=0;r=92&&o--,o>=34&&o--;let l=o-32;if(l>=46&&(l-=46,a=!0),s+=l,a)break;s*=46}n?n[i++]=s:n=new e(s)}return n}class Nh{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const rE=new Nh;class h${constructor(e,n){this.input=e,this.ranges=n,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=rE,this.rangeIndex=0,this.pos=this.chunkPos=n[0].from,this.range=n[0],this.end=n[n.length-1].to,this.readNext()}resolveOffset(e,n){let r=this.range,i=this.rangeIndex,s=this.pos+e;for(;sr.to:s>=r.to;){if(i==this.ranges.length-1)return null;let o=this.ranges[++i];s+=o.from-r.to,r=o}return s}clipPos(e){if(e>=this.range.from&&ee)return Math.max(e,n.from);return this.end}peek(e){let n=this.chunkOff+e,r,i;if(n>=0&&n=this.chunk2Pos&&ra.to&&(this.chunk2=this.chunk2.slice(0,a.to-r)),i=this.chunk2.charCodeAt(0)}}return r>=this.token.lookAhead&&(this.token.lookAhead=r+1),i}acceptToken(e,n=0){let r=n?this.resolveOffset(n,-1):this.pos;if(r==null||r=this.chunk2Pos&&this.posthis.range.to?e.slice(0,this.range.to-this.pos):e,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(e=1){for(this.chunkOff+=e;this.pos+e>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();e-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=e,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}reset(e,n){if(n?(this.token=n,n.start=e,n.lookAhead=e+1,n.value=n.extended=-1):this.token=rE,this.pos!=e){if(this.pos=e,e==this.end)return this.setDone(),this;for(;e=this.range.to;)this.range=this.ranges[++this.rangeIndex];e>=this.chunkPos&&e=this.chunkPos&&n<=this.chunkPos+this.chunk.length)return this.chunk.slice(e-this.chunkPos,n-this.chunkPos);if(e>=this.chunk2Pos&&n<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(e-this.chunk2Pos,n-this.chunk2Pos);if(e>=this.range.from&&n<=this.range.to)return this.input.read(e,n);let r="";for(let i of this.ranges){if(i.from>=n)break;i.to>e&&(r+=this.input.read(Math.max(i.from,e),Math.min(i.to,n)))}return r}}class dl{constructor(e,n){this.data=e,this.id=n}token(e,n){let{parser:r}=n.p;p$(this.data,e,n,this.id,r.data,r.tokenPrecTable)}}dl.prototype.contextual=dl.prototype.fallback=dl.prototype.extend=!1;dl.prototype.fallback=dl.prototype.extend=!1;function p$(t,e,n,r,i,s){let o=0,a=1<0){let p=t[h];if(l.allows(p)&&(e.token.value==-1||e.token.value==p||m$(p,e.token.value,i,s))){e.acceptToken(p);break}}let c=e.next,f=0,d=t[o+2];if(e.next<0&&d>f&&t[u+d*3-3]==65535){o=t[u+d*3-1];continue e}for(;f>1,p=u+h+(h<<1),m=t[p],g=t[p+1]||65536;if(c=g)f=h+1;else{o=t[p+2],e.advance();continue e}}break}}function iE(t,e,n){for(let r=e,i;(i=t[r])!=65535;r++)if(i==n)return r-e;return-1}function m$(t,e,n,r){let i=iE(n,r,e);return i<0||iE(n,r,t)e)&&!r.type.isError)return n<0?Math.max(0,Math.min(r.to-1,e-25)):Math.min(t.length,Math.max(r.from+1,e+25));if(n<0?r.prevSibling():r.nextSibling())break;if(!r.parent())return n<0?0:t.length}}class g${constructor(e,n){this.fragments=e,this.nodeSet=n,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let e=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(e){for(this.safeFrom=e.openStart?sE(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?sE(e.tree,e.to+e.offset,-1)-e.offset:e.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(e.tree),this.start.push(-e.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(e){if(ee)return this.nextStart=o,null;if(s instanceof en){if(o==e){if(o=Math.max(this.safeFrom,e)&&(this.trees.push(s),this.start.push(o),this.index.push(0))}else this.index[n]++,this.nextStart=o+s.length}}}class b${constructor(e,n){this.stream=n,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map(r=>new Nh)}getActions(e){let n=0,r=null,{parser:i}=e.p,{tokenizers:s}=i,o=i.stateSlot(e.state,3),a=e.curContext?e.curContext.hash:0,l=0;for(let u=0;uf.end+25&&(l=Math.max(f.lookAhead,l)),f.value!=0)){let d=n;if(f.extended>-1&&(n=this.addActions(e,f.extended,f.end,n)),n=this.addActions(e,f.value,f.end,n),!c.extend&&(r=f,n>d))break}}for(;this.actions.length>n;)this.actions.pop();return l&&e.setLookAhead(l),!r&&e.pos==this.stream.end&&(r=new Nh,r.value=e.p.parser.eofTerm,r.start=r.end=e.pos,n=this.addActions(e,r.value,r.end,n)),this.mainToken=r,this.actions}getMainToken(e){if(this.mainToken)return this.mainToken;let n=new Nh,{pos:r,p:i}=e;return n.start=r,n.end=Math.min(r+1,i.stream.end),n.value=r==i.stream.end?i.parser.eofTerm:0,n}updateCachedToken(e,n,r){let i=this.stream.clipPos(r.pos);if(n.token(this.stream.reset(i,e),r),e.value>-1){let{parser:s}=r.p;for(let o=0;o=0&&r.p.parser.dialect.allows(a>>1)){(a&1)==0?e.value=a>>1:e.extended=a>>1;break}}}else e.value=0,e.end=this.stream.clipPos(i+1)}putAction(e,n,r,i){for(let s=0;se.bufferLength*4?new g$(r,e.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let e=this.stacks,n=this.minStackPos,r=this.stacks=[],i,s;if(this.bigReductionCount>300&&e.length==1){let[o]=e;for(;o.forceReduce()&&o.stack.length&&o.stack[o.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let o=0;on)r.push(a);else{if(this.advanceStack(a,r,e))continue;{i||(i=[],s=[]),i.push(a);let l=this.tokens.getMainToken(a);s.push(l.value,l.end)}}break}}if(!r.length){let o=i&&x$(i);if(o)return pr&&console.log("Finish with "+this.stackID(o)),this.stackToTree(o);if(this.parser.strict)throw pr&&i&&console.log("Stuck with token "+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):"none")),new SyntaxError("No parse at "+n);this.recovering||(this.recovering=5)}if(this.recovering&&i){let o=this.stoppedAt!=null&&i[0].pos>this.stoppedAt?i[0]:this.runRecovery(i,s,r);if(o)return pr&&console.log("Force-finish "+this.stackID(o)),this.stackToTree(o.forceAll())}if(this.recovering){let o=this.recovering==1?1:this.recovering*3;if(r.length>o)for(r.sort((a,l)=>l.score-a.score);r.length>o;)r.pop();r.some(a=>a.reducePos>n)&&this.recovering--}else if(r.length>1){e:for(let o=0;o500&&u.buffer.length>500)if((a.score-u.score||a.buffer.length-u.buffer.length)>0)r.splice(l--,1);else{r.splice(o--,1);continue e}}}r.length>12&&r.splice(12,r.length-12)}this.minStackPos=r[0].pos;for(let o=1;o ":"";if(this.stoppedAt!=null&&i>this.stoppedAt)return e.forceReduce()?e:null;if(this.fragments){let u=e.curContext&&e.curContext.tracker.strict,c=u?e.curContext.hash:0;for(let f=this.fragments.nodeAt(i);f;){let d=this.parser.nodeSet.types[f.type.id]==f.type?s.getGoto(e.state,f.type.id):-1;if(d>-1&&f.length&&(!u||(f.prop(Ve.contextHash)||0)==c))return e.useNode(f,d),pr&&console.log(o+this.stackID(e)+` (via reuse of ${s.getName(f.type.id)})`),!0;if(!(f instanceof en)||f.children.length==0||f.positions[0]>0)break;let h=f.children[0];if(h instanceof en&&f.positions[0]==0)f=h;else break}}let a=s.stateSlot(e.state,4);if(a>0)return e.reduce(a),pr&&console.log(o+this.stackID(e)+` (via always-reduce ${s.getName(a&65535)})`),!0;if(e.stack.length>=8400)for(;e.stack.length>6e3&&e.forceReduce(););let l=this.tokens.getActions(e);for(let u=0;ui?n.push(p):r.push(p)}return!1}advanceFully(e,n){let r=e.pos;for(;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>r)return oE(e,n),!0}}runRecovery(e,n,r){let i=null,s=!1;for(let o=0;o ":"";if(a.deadEnd&&(s||(s=!0,a.restart(),pr&&console.log(c+this.stackID(a)+" (restarted)"),this.advanceFully(a,r))))continue;let f=a.split(),d=c;for(let h=0;f.forceReduce()&&h<10&&(pr&&console.log(d+this.stackID(f)+" (via force-reduce)"),!this.advanceFully(f,r));h++)pr&&(d=this.stackID(f)+" -> ");for(let h of a.recoverByInsert(l))pr&&console.log(c+this.stackID(h)+" (via recover-insert)"),this.advanceFully(h,r);this.stream.end>a.pos?(u==a.pos&&(u++,l=0),a.recoverByDelete(l,u),pr&&console.log(c+this.stackID(a)+` (via recover-delete ${this.parser.getName(l)})`),oE(a,r)):(!i||i.scoree.topRules[a][1]),i=[];for(let a=0;a=0)s(c,l,a[u++]);else{let f=a[u+-c];for(let d=-c;d>0;d--)s(a[u++],l,f);u++}}}this.nodeSet=new Ov(n.map((a,l)=>fr.define({name:l>=this.minRepeatTerm?void 0:a,id:l,props:i[l],top:r.indexOf(l)>-1,error:l==0,skipped:e.skippedNodes&&e.skippedNodes.indexOf(l)>-1}))),e.propSources&&(this.nodeSet=this.nodeSet.extend(...e.propSources)),this.strict=!1,this.bufferLength=Rk;let o=Fd(e.tokenData);this.context=e.context,this.specializerSpecs=e.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let a=0;atypeof a=="number"?new dl(o,a):a),this.topRules=e.topRules,this.dialects=e.dialects||{},this.dynamicPrecedences=e.dynamicPrecedences||null,this.tokenPrecTable=e.tokenPrec,this.termNames=e.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(e,n,r){let i=new y$(this,e,n,r);for(let s of this.wrappers)i=s(i,e,n,r);return i}getGoto(e,n,r=!1){let i=this.goto;if(n>=i[0])return-1;for(let s=i[n+1];;){let o=i[s++],a=o&1,l=i[s++];if(a&&r)return l;for(let u=s+(o>>1);s0}validAction(e,n){return!!this.allActions(e,r=>r==n?!0:null)}allActions(e,n){let r=this.stateSlot(e,4),i=r?n(r):void 0;for(let s=this.stateSlot(e,1);i==null;s+=3){if(this.data[s]==65535)if(this.data[s+1]==1)s=ss(this.data,s+2);else break;i=n(ss(this.data,s+1))}return i}nextStates(e){let n=[];for(let r=this.stateSlot(e,1);;r+=3){if(this.data[r]==65535)if(this.data[r+1]==1)r=ss(this.data,r+2);else break;if((this.data[r+2]&1)==0){let i=this.data[r+1];n.some((s,o)=>o&1&&s==i)||n.push(this.data[r],i)}}return n}configure(e){let n=Object.assign(Object.create(Dp.prototype),this);if(e.props&&(n.nodeSet=this.nodeSet.extend(...e.props)),e.top){let r=this.topRules[e.top];if(!r)throw new RangeError(`Invalid top rule name ${e.top}`);n.top=r}return e.tokenizers&&(n.tokenizers=this.tokenizers.map(r=>{let i=e.tokenizers.find(s=>s.from==r);return i?i.to:r})),e.specializers&&(n.specializers=this.specializers.slice(),n.specializerSpecs=this.specializerSpecs.map((r,i)=>{let s=e.specializers.find(a=>a.from==r.external);if(!s)return r;let o=Object.assign(Object.assign({},r),{external:s.to});return n.specializers[i]=aE(o),o})),e.contextTracker&&(n.context=e.contextTracker),e.dialect&&(n.dialect=this.parseDialect(e.dialect)),e.strict!=null&&(n.strict=e.strict),e.wrap&&(n.wrappers=n.wrappers.concat(e.wrap)),e.bufferLength!=null&&(n.bufferLength=e.bufferLength),n}hasWrappers(){return this.wrappers.length>0}getName(e){return this.termNames?this.termNames[e]:String(e<=this.maxNode&&this.nodeSet.types[e].name||e)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(e){let n=this.dynamicPrecedences;return n==null?0:n[e]||0}parseDialect(e){let n=Object.keys(this.dialects),r=n.map(()=>!1);if(e)for(let s of e.split(" ")){let o=n.indexOf(s);o>=0&&(r[o]=!0)}let i=null;for(let s=0;sr)&&n.p.parser.stateFlag(n.state,2)&&(!e||e.scoret.external(n,r)<<1|e}return t.get}let S$=0;class Fr{constructor(e,n,r,i){this.name=e,this.set=n,this.base=r,this.modified=i,this.id=S$++}toString(){let{name:e}=this;for(let n of this.modified)n.name&&(e=`${n.name}(${e})`);return e}static define(e,n){let r=typeof e=="string"?e:"?";if(e instanceof Fr&&(n=e),n!=null&&n.base)throw new Error("Can not derive from a modified tag");let i=new Fr(r,[],null,[]);if(i.set.push(i),n)for(let s of n.set)i.set.push(s);return i}static defineModifier(e){let n=new kp(e);return r=>r.modified.indexOf(n)>-1?r:kp.get(r.base||r,r.modified.concat(n).sort((i,s)=>i.id-s.id))}}let E$=0;class kp{constructor(e){this.name=e,this.instances=[],this.id=E$++}static get(e,n){if(!n.length)return e;let r=n[0].instances.find(a=>a.base==e&&w$(n,a.modified));if(r)return r;let i=[],s=new Fr(e.name,i,e,n);for(let a of n)a.instances.push(s);let o=_$(n);for(let a of e.set)if(!a.modified.length)for(let l of o)i.push(kp.get(a,l));return s}}function w$(t,e){return t.length==e.length&&t.every((n,r)=>n==e[r])}function _$(t){let e=[[]];for(let n=0;nr.length-n.length)}function Bk(t){let e=Object.create(null);for(let n in t){let r=t[n];Array.isArray(r)||(r=[r]);for(let i of n.split(" "))if(i){let s=[],o=2,a=i;for(let f=0;;){if(a=="..."&&f>0&&f+3==i.length){o=1;break}let d=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(a);if(!d)throw new RangeError("Invalid path: "+i);if(s.push(d[0]=="*"?"":d[0][0]=='"'?JSON.parse(d[0]):d[0]),f+=d[0].length,f==i.length)break;let h=i[f++];if(f==i.length&&h=="!"){o=0;break}if(h!="/")throw new RangeError("Invalid path: "+i);a=i.slice(f)}let l=s.length-1,u=s[l];if(!u)throw new RangeError("Invalid path: "+i);let c=new Op(r,o,l>0?s.slice(0,l):null);e[u]=c.sort(e[u])}}return $k.add(e)}const $k=new Ve;let Op=class{constructor(e,n,r,i){this.tags=e,this.mode=n,this.context=r,this.next=i}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(e){return!e||e.depth{let o=i;for(let a of s)for(let l of a.set){let u=n[l.id];if(u){o=o?o+" "+u:u;break}}return o},scope:r}}function C$(t,e){let n=null;for(let r of t){let i=r.style(e);i&&(n=n?n+" "+i:i)}return n}function A$(t,e,n,r=0,i=t.length){let s=new D$(r,Array.isArray(e)?e:[e],n);s.highlightRange(t.cursor(),r,i,"",s.highlighters),s.flush(i)}class D${constructor(e,n,r){this.at=e,this.highlighters=n,this.span=r,this.class=""}startSpan(e,n){n!=this.class&&(this.flush(e),e>this.at&&(this.at=e),this.class=n)}flush(e){e>this.at&&this.class&&this.span(this.at,e,this.class)}highlightRange(e,n,r,i,s){let{type:o,from:a,to:l}=e;if(a>=r||l<=n)return;o.isTop&&(s=this.highlighters.filter(h=>!h.scope||h.scope(o)));let u=i,c=k$(e)||Op.empty,f=C$(s,c.tags);if(f&&(u&&(u+=" "),u+=f,c.mode==1&&(i+=(i?" ":"")+f)),this.startSpan(Math.max(n,a),u),c.opaque)return;let d=e.tree&&e.tree.prop(Ve.mounted);if(d&&d.overlay){let h=e.node.enter(d.overlay[0].from+a,1),p=this.highlighters.filter(g=>!g.scope||g.scope(d.tree.type)),m=e.firstChild();for(let g=0,b=a;;g++){let y=g=x||!e.nextSibling())););if(!y||x>r)break;b=y.to+a,b>n&&(this.highlightRange(h.cursor(),Math.max(n,y.from+a),Math.min(r,b),"",p),this.startSpan(Math.min(r,b),u))}m&&e.parent()}else if(e.firstChild()){d&&(i="");do if(!(e.to<=n)){if(e.from>=r)break;this.highlightRange(e,n,r,i,s),this.startSpan(Math.min(r,e.to),u)}while(e.nextSibling());e.parent()}}}function k$(t){let e=t.type.prop($k);for(;e&&e.context&&!t.matchContext(e.context);)e=e.next;return e||null}const le=Fr.define,Ld=le(),Rs=le(),lE=le(Rs),uE=le(Rs),Ns=le(),Bd=le(Ns),Dg=le(Ns),Ei=le(),To=le(Ei),vi=le(),xi=le(),jb=le(),Ru=le(jb),$d=le(),oe={comment:Ld,lineComment:le(Ld),blockComment:le(Ld),docComment:le(Ld),name:Rs,variableName:le(Rs),typeName:lE,tagName:le(lE),propertyName:uE,attributeName:le(uE),className:le(Rs),labelName:le(Rs),namespace:le(Rs),macroName:le(Rs),literal:Ns,string:Bd,docString:le(Bd),character:le(Bd),attributeValue:le(Bd),number:Dg,integer:le(Dg),float:le(Dg),bool:le(Ns),regexp:le(Ns),escape:le(Ns),color:le(Ns),url:le(Ns),keyword:vi,self:le(vi),null:le(vi),atom:le(vi),unit:le(vi),modifier:le(vi),operatorKeyword:le(vi),controlKeyword:le(vi),definitionKeyword:le(vi),moduleKeyword:le(vi),operator:xi,derefOperator:le(xi),arithmeticOperator:le(xi),logicOperator:le(xi),bitwiseOperator:le(xi),compareOperator:le(xi),updateOperator:le(xi),definitionOperator:le(xi),typeOperator:le(xi),controlOperator:le(xi),punctuation:jb,separator:le(jb),bracket:Ru,angleBracket:le(Ru),squareBracket:le(Ru),paren:le(Ru),brace:le(Ru),content:Ei,heading:To,heading1:le(To),heading2:le(To),heading3:le(To),heading4:le(To),heading5:le(To),heading6:le(To),contentSeparator:le(Ei),list:le(Ei),quote:le(Ei),emphasis:le(Ei),strong:le(Ei),link:le(Ei),monospace:le(Ei),strikethrough:le(Ei),inserted:le(),deleted:le(),changed:le(),invalid:le(),meta:$d,documentMeta:le($d),annotation:le($d),processingInstruction:le($d),definition:Fr.defineModifier("definition"),constant:Fr.defineModifier("constant"),function:Fr.defineModifier("function"),standard:Fr.defineModifier("standard"),local:Fr.defineModifier("local"),special:Fr.defineModifier("special")};for(let t in oe){let e=oe[t];e instanceof Fr&&(e.name=t)}zk([{tag:oe.link,class:"tok-link"},{tag:oe.heading,class:"tok-heading"},{tag:oe.emphasis,class:"tok-emphasis"},{tag:oe.strong,class:"tok-strong"},{tag:oe.keyword,class:"tok-keyword"},{tag:oe.atom,class:"tok-atom"},{tag:oe.bool,class:"tok-bool"},{tag:oe.url,class:"tok-url"},{tag:oe.labelName,class:"tok-labelName"},{tag:oe.inserted,class:"tok-inserted"},{tag:oe.deleted,class:"tok-deleted"},{tag:oe.literal,class:"tok-literal"},{tag:oe.string,class:"tok-string"},{tag:oe.number,class:"tok-number"},{tag:[oe.regexp,oe.escape,oe.special(oe.string)],class:"tok-string2"},{tag:oe.variableName,class:"tok-variableName"},{tag:oe.local(oe.variableName),class:"tok-variableName tok-local"},{tag:oe.definition(oe.variableName),class:"tok-variableName tok-definition"},{tag:oe.special(oe.variableName),class:"tok-variableName2"},{tag:oe.definition(oe.propertyName),class:"tok-propertyName tok-definition"},{tag:oe.typeName,class:"tok-typeName"},{tag:oe.namespace,class:"tok-namespace"},{tag:oe.className,class:"tok-className"},{tag:oe.macroName,class:"tok-macroName"},{tag:oe.propertyName,class:"tok-propertyName"},{tag:oe.operator,class:"tok-operator"},{tag:oe.comment,class:"tok-comment"},{tag:oe.meta,class:"tok-meta"},{tag:oe.invalid,class:"tok-invalid"},{tag:oe.punctuation,class:"tok-punctuation"}]);const O$=Bk({String:oe.string,Number:oe.number,"True False":oe.bool,PropertyName:oe.propertyName,Null:oe.null,", :":oe.separator,"[ ]":oe.squareBracket,"{ }":oe.brace}),T$=Dp.deserialize({version:14,states:"$bOVQPOOOOQO'#Cb'#CbOnQPO'#CeOvQPO'#ClOOQO'#Cr'#CrQOQPOOOOQO'#Cg'#CgO}QPO'#CfO!SQPO'#CtOOQO,59P,59PO![QPO,59PO!aQPO'#CuOOQO,59W,59WO!iQPO,59WOVQPO,59QOqQPO'#CmO!nQPO,59`OOQO1G.k1G.kOVQPO'#CnO!vQPO,59aOOQO1G.r1G.rOOQO1G.l1G.lOOQO,59X,59XOOQO-E6k-E6kOOQO,59Y,59YOOQO-E6l-E6l",stateData:"#O~OeOS~OQSORSOSSOTSOWQO_ROgPO~OVXOgUO~O^[O~PVO[^O~O]_OVhX~OVaO~O]bO^iX~O^dO~O]_OVha~O]bO^ia~O",goto:"!kjPPPPPPkPPkqwPPPPk{!RPPP!XP!e!hXSOR^bQWQRf_TVQ_Q`WRg`QcZRicQTOQZRQe^RhbRYQR]R",nodeNames:"⚠ JsonText True False Null Number String } { Object Property PropertyName : , ] [ Array",maxTerm:25,nodeProps:[["isolate",-2,6,11,""],["openedBy",7,"{",14,"["],["closedBy",8,"}",15,"]"]],propSources:[O$],skippedNodes:[0],repeatNodeCount:2,tokenData:"(|~RaXY!WYZ!W]^!Wpq!Wrs!]|}$u}!O$z!Q!R%T!R![&c![!]&t!}#O&y#P#Q'O#Y#Z'T#b#c'r#h#i(Z#o#p(r#q#r(w~!]Oe~~!`Wpq!]qr!]rs!xs#O!]#O#P!}#P;'S!];'S;=`$o<%lO!]~!}Og~~#QXrs!]!P!Q!]#O#P!]#U#V!]#Y#Z!]#b#c!]#f#g!]#h#i!]#i#j#m~#pR!Q![#y!c!i#y#T#Z#y~#|R!Q![$V!c!i$V#T#Z$V~$YR!Q![$c!c!i$c#T#Z$c~$fR!Q![!]!c!i!]#T#Z!]~$rP;=`<%l!]~$zO]~~$}Q!Q!R%T!R![&c~%YRT~!O!P%c!g!h%w#X#Y%w~%fP!Q![%i~%nRT~!Q![%i!g!h%w#X#Y%w~%zR{|&T}!O&T!Q![&Z~&WP!Q![&Z~&`PT~!Q![&Z~&hST~!O!P%c!Q![&c!g!h%w#X#Y%w~&yO[~~'OO_~~'TO^~~'WP#T#U'Z~'^P#`#a'a~'dP#g#h'g~'jP#X#Y'm~'rOR~~'uP#i#j'x~'{P#`#a(O~(RP#`#a(U~(ZOS~~(^P#f#g(a~(dP#i#j(g~(jP#X#Y(m~(rOQ~~(wOW~~(|OV~",tokenizers:[0],topRules:{JsonText:[0,1]},tokenPrec:0});var kg;const tl=new Ve;function I$(t){return he.define({combine:t?e=>e.concat(t):void 0})}const P$=new Ve;class ai{constructor(e,n,r=[],i=""){this.data=e,this.name=i,Ue.prototype.hasOwnProperty("tree")||Object.defineProperty(Ue.prototype,"tree",{get(){return tn(this)}}),this.parser=n,this.extension=[yo.of(this),Ue.languageData.of((s,o,a)=>{let l=cE(s,o,a),u=l.type.prop(tl);if(!u)return[];let c=s.facet(u),f=l.type.prop(P$);if(f){let d=l.resolve(o-l.from,a);for(let h of f)if(h.test(d,s)){let p=s.facet(h.facet);return h.type=="replace"?p:p.concat(c)}}return c})].concat(r)}isActiveAt(e,n,r=-1){return cE(e,n,r).type.prop(tl)==this.data}findRegions(e){let n=e.facet(yo);if((n==null?void 0:n.data)==this.data)return[{from:0,to:e.doc.length}];if(!n||!n.allowsNesting)return[];let r=[],i=(s,o)=>{if(s.prop(tl)==this.data){r.push({from:o,to:o+s.length});return}let a=s.prop(Ve.mounted);if(a){if(a.tree.prop(tl)==this.data){if(a.overlay)for(let l of a.overlay)r.push({from:l.from+o,to:l.to+o});else r.push({from:o,to:o+s.length});return}else if(a.overlay){let l=r.length;if(i(a.tree,a.overlay[0].from+o),r.length>l)return}}for(let l=0;lr.isTop?n:void 0)]}),e.name)}configure(e,n){return new Tp(this.data,this.parser.configure(e),n||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function tn(t){let e=t.field(ai.state,!1);return e?e.tree:en.empty}class R${constructor(e){this.doc=e,this.cursorPos=0,this.string="",this.cursor=e.iter()}get length(){return this.doc.length}syncTo(e){return this.string=this.cursor.next(e-this.cursorPos).value,this.cursorPos=e+this.string.length,this.cursorPos-this.string.length}chunk(e){return this.syncTo(e),this.string}get lineChunks(){return!0}read(e,n){let r=this.cursorPos-this.string.length;return e=this.cursorPos?this.doc.sliceString(e,n):this.string.slice(e-r,n-r)}}let Nu=null;class Ip{constructor(e,n,r=[],i,s,o,a,l){this.parser=e,this.state=n,this.fragments=r,this.tree=i,this.treeLen=s,this.viewport=o,this.skipped=a,this.scheduleOn=l,this.parse=null,this.tempSkipped=[]}static create(e,n,r){return new Ip(e,n,[],en.empty,0,r,[],null)}startParse(){return this.parser.startParse(new R$(this.state.doc),this.fragments)}work(e,n){return n!=null&&n>=this.state.doc.length&&(n=void 0),this.tree!=en.empty&&this.isDone(n??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var r;if(typeof e=="number"){let i=Date.now()+e;e=()=>Date.now()>i}for(this.parse||(this.parse=this.startParse()),n!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>n)&&n=this.treeLen&&((this.parse.stoppedAt==null||this.parse.stoppedAt>e)&&this.parse.stopAt(e),this.withContext(()=>{for(;!(n=this.parse.advance()););}),this.treeLen=e,this.tree=n,this.fragments=this.withoutTempSkipped(ra.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let n=Nu;Nu=this;try{return e()}finally{Nu=n}}withoutTempSkipped(e){for(let n;n=this.tempSkipped.pop();)e=fE(e,n.from,n.to);return e}changes(e,n){let{fragments:r,tree:i,treeLen:s,viewport:o,skipped:a}=this;if(this.takeTree(),!e.empty){let l=[];if(e.iterChangedRanges((u,c,f,d)=>l.push({fromA:u,toA:c,fromB:f,toB:d})),r=ra.applyChanges(r,l),i=en.empty,s=0,o={from:e.mapPos(o.from,-1),to:e.mapPos(o.to,1)},this.skipped.length){a=[];for(let u of this.skipped){let c=e.mapPos(u.from,1),f=e.mapPos(u.to,-1);ce.from&&(this.fragments=fE(this.fragments,i,s),this.skipped.splice(r--,1))}return this.skipped.length>=n?!1:(this.reset(),!0)}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(e,n){this.skipped.push({from:e,to:n})}static getSkippingParser(e){return new class extends Lk{createParse(n,r,i){let s=i[0].from,o=i[i.length-1].to;return{parsedPos:s,advance(){let l=Nu;if(l){for(let u of i)l.tempSkipped.push(u);e&&(l.scheduleOn=l.scheduleOn?Promise.all([l.scheduleOn,e]):e)}return this.parsedPos=o,new en(fr.none,[],[],o-s)},stoppedAt:null,stopAt(){}}}}}isDone(e){e=Math.min(e,this.state.doc.length);let n=this.fragments;return this.treeLen>=e&&n.length&&n[0].from==0&&n[0].to>=e}static get(){return Nu}}function fE(t,e,n){return ra.applyChanges(t,[{fromA:e,toA:n,fromB:e,toB:n}])}class Rl{constructor(e){this.context=e,this.tree=e.tree}apply(e){if(!e.docChanged&&this.tree==this.context.tree)return this;let n=this.context.changes(e.changes,e.state),r=this.context.treeLen==e.startState.doc.length?void 0:Math.max(e.changes.mapPos(this.context.treeLen),n.viewport.to);return n.work(20,r)||n.takeTree(),new Rl(n)}static init(e){let n=Math.min(3e3,e.doc.length),r=Ip.create(e.facet(yo).parser,e,{from:0,to:n});return r.work(20,n)||r.takeTree(),new Rl(r)}}ai.state=Wt.define({create:Rl.init,update(t,e){for(let n of e.effects)if(n.is(ai.setState))return n.value;return e.startState.facet(yo)!=e.state.facet(yo)?Rl.init(e.state):t.apply(e)}});let jk=t=>{let e=setTimeout(()=>t(),500);return()=>clearTimeout(e)};typeof requestIdleCallback<"u"&&(jk=t=>{let e=-1,n=setTimeout(()=>{e=requestIdleCallback(t,{timeout:400})},100);return()=>e<0?clearTimeout(n):cancelIdleCallback(e)});const Og=typeof navigator<"u"&&(!((kg=navigator.scheduling)===null||kg===void 0)&&kg.isInputPending)?()=>navigator.scheduling.isInputPending():null,N$=$t.fromClass(class{constructor(e){this.view=e,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(e){let n=this.view.state.field(ai.state).context;(n.updateViewport(e.view.viewport)||this.view.viewport.to>n.treeLen)&&this.scheduleWork(),(e.docChanged||e.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(n)}scheduleWork(){if(this.working)return;let{state:e}=this.view,n=e.field(ai.state);(n.tree!=n.context.tree||!n.context.isDone(e.doc.length))&&(this.working=jk(this.work))}work(e){this.working=null;let n=Date.now();if(this.chunkEndi+1e3,l=s.context.work(()=>Og&&Og()||Date.now()>o,i+(a?0:1e5));this.chunkBudget-=Date.now()-n,(l||this.chunkBudget<=0)&&(s.context.takeTree(),this.view.dispatch({effects:ai.setState.of(new Rl(s.context))})),this.chunkBudget>0&&!(l&&!a)&&this.scheduleWork(),this.checkAsyncSchedule(s.context)}checkAsyncSchedule(e){e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(n=>qn(this.view.state,n)).then(()=>this.workScheduled--),e.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),yo=he.define({combine(t){return t.length?t[0]:null},enables:t=>[ai.state,N$,ce.contentAttributes.compute([t],e=>{let n=e.facet(t);return n&&n.name?{"data-language":n.name}:{}})]});class M${constructor(e,n=[]){this.language=e,this.support=n,this.extension=[e,n]}}const F$=he.define(),$f=he.define({combine:t=>{if(!t.length)return" ";let e=t[0];if(!e||/\S/.test(e)||Array.from(e).some(n=>n!=e[0]))throw new Error("Invalid indent unit: "+JSON.stringify(t[0]));return e}});function Pp(t){let e=t.facet($f);return e.charCodeAt(0)==9?t.tabSize*e.length:e.length}function Hc(t,e){let n="",r=t.tabSize,i=t.facet($f)[0];if(i==" "){for(;e>=r;)n+=" ",e-=r;i=" "}for(let s=0;s=e?L$(t,n,e):null}class Q0{constructor(e,n={}){this.state=e,this.options=n,this.unit=Pp(e)}lineAt(e,n=1){let r=this.state.doc.lineAt(e),{simulateBreak:i,simulateDoubleBreak:s}=this.options;return i!=null&&i>=r.from&&i<=r.to?s&&i==e?{text:"",from:e}:(n<0?i-1&&(s+=o-this.countColumn(r,r.search(/\S|$/))),s}countColumn(e,n=e.length){return ru(e,this.state.tabSize,n)}lineIndent(e,n=1){let{text:r,from:i}=this.lineAt(e,n),s=this.options.overrideIndentation;if(s){let o=s(i);if(o>-1)return o}return this.countColumn(r,r.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const Vk=new Ve;function L$(t,e,n){let r=e.resolveStack(n),i=e.resolveInner(n,-1).resolve(n,0).enterUnfinishedNodesBefore(n);if(i!=r.node){let s=[];for(let o=i;o&&!(o.fromr.node.to||o.from==r.node.from&&o.type==r.node.type);o=o.parent)s.push(o);for(let o=s.length-1;o>=0;o--)r={node:s[o],next:r}}return Uk(r,t,n)}function Uk(t,e,n){for(let r=t;r;r=r.next){let i=$$(r.node);if(i)return i(Nv.create(e,n,r))}return 0}function B$(t){return t.pos==t.options.simulateBreak&&t.options.simulateDoubleBreak}function $$(t){let e=t.type.prop(Vk);if(e)return e;let n=t.firstChild,r;if(n&&(r=n.type.prop(Ve.closedBy))){let i=t.lastChild,s=i&&r.indexOf(i.name)>-1;return o=>U$(o,!0,1,void 0,s&&!B$(o)?i.from:void 0)}return t.parent==null?z$:null}function z$(){return 0}class Nv extends Q0{constructor(e,n,r){super(e.state,e.options),this.base=e,this.pos=n,this.context=r}get node(){return this.context.node}static create(e,n,r){return new Nv(e,n,r)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(e){let n=this.state.doc.lineAt(e.from);for(;;){let r=e.resolve(n.from);for(;r.parent&&r.parent.from==r.from;)r=r.parent;if(j$(r,e))break;n=this.state.doc.lineAt(r.from)}return this.lineIndent(n.from)}continue(){return Uk(this.context.next,this.base,this.pos)}}function j$(t,e){for(let n=e;n;n=n.parent)if(t==n)return!0;return!1}function V$(t){let e=t.node,n=e.childAfter(e.from),r=e.lastChild;if(!n)return null;let i=t.options.simulateBreak,s=t.state.doc.lineAt(n.from),o=i==null||i<=s.from?s.to:Math.min(s.to,i);for(let a=n.to;;){let l=e.childAfter(a);if(!l||l==r)return null;if(!l.type.isSkipped){if(l.from>=o)return null;let u=/^ */.exec(s.text.slice(n.to-s.from))[0].length;return{from:n.from,to:n.to+u}}a=l.to}}function U$(t,e,n,r,i){let s=t.textAfter,o=s.match(/^\s*/)[0].length,a=r&&s.slice(o,o+r.length)==r||i==t.pos+o,l=V$(t);return l?a?t.column(l.from):t.column(l.to):t.baseIndent+(a?0:t.unit*n)}function dE({except:t,units:e=1}={}){return n=>{let r=t&&t.test(n.textAfter);return n.baseIndent+(r?0:e*n.unit)}}const H$=200;function q$(){return Ue.transactionFilter.of(t=>{if(!t.docChanged||!t.isUserEvent("input.type")&&!t.isUserEvent("input.complete"))return t;let e=t.startState.languageDataAt("indentOnInput",t.startState.selection.main.head);if(!e.length)return t;let n=t.newDoc,{head:r}=t.newSelection.main,i=n.lineAt(r);if(r>i.from+H$)return t;let s=n.sliceString(i.from,r);if(!e.some(u=>u.test(s)))return t;let{state:o}=t,a=-1,l=[];for(let{head:u}of o.selection.ranges){let c=o.doc.lineAt(u);if(c.from==a)continue;a=c.from;let f=Rv(o,c.from);if(f==null)continue;let d=/^\s*/.exec(c.text)[0],h=Hc(o,f);d!=h&&l.push({from:c.from,to:c.from+d.length,insert:h})}return l.length?[t,{changes:l,sequential:!0}]:t})}const G$=he.define(),Hk=new Ve;function W$(t){let e=t.firstChild,n=t.lastChild;return e&&e.ton)continue;if(s&&a.from=e&&u.to>n&&(s=u)}}return s}function X$(t){let e=t.lastChild;return e&&e.to==t.to&&e.type.isError}function Rp(t,e,n){for(let r of t.facet(G$)){let i=r(t,e,n);if(i)return i}return K$(t,e,n)}function qk(t,e){let n=e.mapPos(t.from,1),r=e.mapPos(t.to,-1);return n>=r?void 0:{from:n,to:r}}const em=De.define({map:qk}),zf=De.define({map:qk});function Gk(t){let e=[];for(let{head:n}of t.state.selection.ranges)e.some(r=>r.from<=n&&r.to>=n)||e.push(t.lineBlockAt(n));return e}const pa=Wt.define({create(){return ve.none},update(t,e){e.isUserEvent("delete")&&e.changes.iterChangedRanges((n,r)=>t=hE(t,n,r)),t=t.map(e.changes);for(let n of e.effects)if(n.is(em)&&!Y$(t,n.value.from,n.value.to)){let{preparePlaceholder:r}=e.state.facet(Xk),i=r?ve.replace({widget:new r7(r(e.state,n.value))}):pE;t=t.update({add:[i.range(n.value.from,n.value.to)]})}else n.is(zf)&&(t=t.update({filter:(r,i)=>n.value.from!=r||n.value.to!=i,filterFrom:n.value.from,filterTo:n.value.to}));return e.selection&&(t=hE(t,e.selection.main.head)),t},provide:t=>ce.decorations.from(t),toJSON(t,e){let n=[];return t.between(0,e.doc.length,(r,i)=>{n.push(r,i)}),n},fromJSON(t){if(!Array.isArray(t)||t.length%2)throw new RangeError("Invalid JSON for fold state");let e=[];for(let n=0;n{ie&&(r=!0)}),r?t.update({filterFrom:e,filterTo:n,filter:(i,s)=>i>=n||s<=e}):t}function Np(t,e,n){var r;let i=null;return(r=t.field(pa,!1))===null||r===void 0||r.between(e,n,(s,o)=>{(!i||i.from>s)&&(i={from:s,to:o})}),i}function Y$(t,e,n){let r=!1;return t.between(e,e,(i,s)=>{i==e&&s==n&&(r=!0)}),r}function Wk(t,e){return t.field(pa,!1)?e:e.concat(De.appendConfig.of(Yk()))}const J$=t=>{for(let e of Gk(t)){let n=Rp(t.state,e.from,e.to);if(n)return t.dispatch({effects:Wk(t.state,[em.of(n),Kk(t,n)])}),!0}return!1},Z$=t=>{if(!t.state.field(pa,!1))return!1;let e=[];for(let n of Gk(t)){let r=Np(t.state,n.from,n.to);r&&e.push(zf.of(r),Kk(t,r,!1))}return e.length&&t.dispatch({effects:e}),e.length>0};function Kk(t,e,n=!0){let r=t.state.doc.lineAt(e.from).number,i=t.state.doc.lineAt(e.to).number;return ce.announce.of(`${t.state.phrase(n?"Folded lines":"Unfolded lines")} ${r} ${t.state.phrase("to")} ${i}.`)}const Q$=t=>{let{state:e}=t,n=[];for(let r=0;r{let e=t.state.field(pa,!1);if(!e||!e.size)return!1;let n=[];return e.between(0,t.state.doc.length,(r,i)=>{n.push(zf.of({from:r,to:i}))}),t.dispatch({effects:n}),!0},t7=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:J$},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:Z$},{key:"Ctrl-Alt-[",run:Q$},{key:"Ctrl-Alt-]",run:e7}],n7={placeholderDOM:null,preparePlaceholder:null,placeholderText:"…"},Xk=he.define({combine(t){return fi(t,n7)}});function Yk(t){return[pa,o7]}function Jk(t,e){let{state:n}=t,r=n.facet(Xk),i=o=>{let a=t.lineBlockAt(t.posAtDOM(o.target)),l=Np(t.state,a.from,a.to);l&&t.dispatch({effects:zf.of(l)}),o.preventDefault()};if(r.placeholderDOM)return r.placeholderDOM(t,i,e);let s=document.createElement("span");return s.textContent=r.placeholderText,s.setAttribute("aria-label",n.phrase("folded code")),s.title=n.phrase("unfold"),s.className="cm-foldPlaceholder",s.onclick=i,s}const pE=ve.replace({widget:new class extends Yi{toDOM(t){return Jk(t,null)}}});class r7 extends Yi{constructor(e){super(),this.value=e}eq(e){return this.value==e.value}toDOM(e){return Jk(e,this.value)}}const i7={openText:"⌄",closedText:"›",markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1};class Tg extends Ui{constructor(e,n){super(),this.config=e,this.open=n}eq(e){return this.config==e.config&&this.open==e.open}toDOM(e){if(this.config.markerDOM)return this.config.markerDOM(this.open);let n=document.createElement("span");return n.textContent=this.open?this.config.openText:this.config.closedText,n.title=e.state.phrase(this.open?"Fold line":"Unfold line"),n}}function s7(t={}){let e={...i7,...t},n=new Tg(e,!0),r=new Tg(e,!1),i=$t.fromClass(class{constructor(o){this.from=o.viewport.from,this.markers=this.buildMarkers(o)}update(o){(o.docChanged||o.viewportChanged||o.startState.facet(yo)!=o.state.facet(yo)||o.startState.field(pa,!1)!=o.state.field(pa,!1)||tn(o.startState)!=tn(o.state)||e.foldingChanged(o))&&(this.markers=this.buildMarkers(o.view))}buildMarkers(o){let a=new _s;for(let l of o.viewportLineBlocks){let u=Np(o.state,l.from,l.to)?r:Rp(o.state,l.from,l.to)?n:null;u&&a.add(l.from,l.from,u)}return a.finish()}}),{domEventHandlers:s}=e;return[i,xk({class:"cm-foldGutter",markers(o){var a;return((a=o.plugin(i))===null||a===void 0?void 0:a.markers)||Xe.empty},initialSpacer(){return new Tg(e,!1)},domEventHandlers:{...s,click:(o,a,l)=>{if(s.click&&s.click(o,a,l))return!0;let u=Np(o.state,a.from,a.to);if(u)return o.dispatch({effects:zf.of(u)}),!0;let c=Rp(o.state,a.from,a.to);return c?(o.dispatch({effects:em.of(c)}),!0):!1}}}),Yk()]}const o7=ce.baseTheme({".cm-foldPlaceholder":{backgroundColor:"#eee",border:"1px solid #ddd",color:"#888",borderRadius:".2em",margin:"0 1px",padding:"0 1px",cursor:"pointer"},".cm-foldGutter span":{padding:"0 1px",cursor:"pointer"}});class tm{constructor(e,n){this.specs=e;let r;function i(a){let l=po.newName();return(r||(r=Object.create(null)))["."+l]=a,l}const s=typeof n.all=="string"?n.all:n.all?i(n.all):void 0,o=n.scope;this.scope=o instanceof ai?a=>a.prop(tl)==o.data:o?a=>a==o:void 0,this.style=zk(e.map(a=>({tag:a.tag,class:a.class||i(Object.assign({},a,{tag:null}))})),{all:s}).style,this.module=r?new po(r):null,this.themeType=n.themeType}static define(e,n){return new tm(e,n||{})}}const Vb=he.define(),Zk=he.define({combine(t){return t.length?[t[0]]:null}});function Ig(t){let e=t.facet(Vb);return e.length?e:t.facet(Zk)}function a7(t,e){let n=[u7],r;return t instanceof tm&&(t.module&&n.push(ce.styleModule.of(t.module)),r=t.themeType),e!=null&&e.fallback?n.push(Zk.of(t)):r?n.push(Vb.computeN([ce.darkTheme],i=>i.facet(ce.darkTheme)==(r=="dark")?[t]:[])):n.push(Vb.of(t)),n}class l7{constructor(e){this.markCache=Object.create(null),this.tree=tn(e.state),this.decorations=this.buildDeco(e,Ig(e.state)),this.decoratedTo=e.viewport.to}update(e){let n=tn(e.state),r=Ig(e.state),i=r!=Ig(e.startState),{viewport:s}=e.view,o=e.changes.mapPos(this.decoratedTo,1);n.length=s.to?(this.decorations=this.decorations.map(e.changes),this.decoratedTo=o):(n!=this.tree||e.viewportChanged||i)&&(this.tree=n,this.decorations=this.buildDeco(e.view,r),this.decoratedTo=s.to)}buildDeco(e,n){if(!n||!this.tree.length)return ve.none;let r=new _s;for(let{from:i,to:s}of e.visibleRanges)A$(this.tree,n,(o,a,l)=>{r.add(o,a,this.markCache[l]||(this.markCache[l]=ve.mark({class:l})))},i,s);return r.finish()}}const u7=Ao.high($t.fromClass(l7,{decorations:t=>t.decorations})),c7=tm.define([{tag:oe.meta,color:"#404740"},{tag:oe.link,textDecoration:"underline"},{tag:oe.heading,textDecoration:"underline",fontWeight:"bold"},{tag:oe.emphasis,fontStyle:"italic"},{tag:oe.strong,fontWeight:"bold"},{tag:oe.strikethrough,textDecoration:"line-through"},{tag:oe.keyword,color:"#708"},{tag:[oe.atom,oe.bool,oe.url,oe.contentSeparator,oe.labelName],color:"#219"},{tag:[oe.literal,oe.inserted],color:"#164"},{tag:[oe.string,oe.deleted],color:"#a11"},{tag:[oe.regexp,oe.escape,oe.special(oe.string)],color:"#e40"},{tag:oe.definition(oe.variableName),color:"#00f"},{tag:oe.local(oe.variableName),color:"#30a"},{tag:[oe.typeName,oe.namespace],color:"#085"},{tag:oe.className,color:"#167"},{tag:[oe.special(oe.variableName),oe.macroName],color:"#256"},{tag:oe.definition(oe.propertyName),color:"#00c"},{tag:oe.comment,color:"#940"},{tag:oe.invalid,color:"#f00"}]),f7=ce.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),Qk=1e4,e3="()[]{}",t3=he.define({combine(t){return fi(t,{afterCursor:!0,brackets:e3,maxScanDistance:Qk,renderMatch:p7})}}),d7=ve.mark({class:"cm-matchingBracket"}),h7=ve.mark({class:"cm-nonmatchingBracket"});function p7(t){let e=[],n=t.matched?d7:h7;return e.push(n.range(t.start.from,t.start.to)),t.end&&e.push(n.range(t.end.from,t.end.to)),e}const m7=Wt.define({create(){return ve.none},update(t,e){if(!e.docChanged&&!e.selection)return t;let n=[],r=e.state.facet(t3);for(let i of e.state.selection.ranges){if(!i.empty)continue;let s=Ri(e.state,i.head,-1,r)||i.head>0&&Ri(e.state,i.head-1,1,r)||r.afterCursor&&(Ri(e.state,i.head,1,r)||i.headce.decorations.from(t)}),g7=[m7,f7];function b7(t={}){return[t3.of(t),g7]}const y7=new Ve;function Ub(t,e,n){let r=t.prop(e<0?Ve.openedBy:Ve.closedBy);if(r)return r;if(t.name.length==1){let i=n.indexOf(t.name);if(i>-1&&i%2==(e<0?1:0))return[n[i+e]]}return null}function Hb(t){let e=t.type.prop(y7);return e?e(t.node):t}function Ri(t,e,n,r={}){let i=r.maxScanDistance||Qk,s=r.brackets||e3,o=tn(t),a=o.resolveInner(e,n);for(let l=a;l;l=l.parent){let u=Ub(l.type,n,s);if(u&&l.from0?e>=c.from&&ec.from&&e<=c.to))return v7(t,e,n,l,c,u,s)}}return x7(t,e,n,o,a.type,i,s)}function v7(t,e,n,r,i,s,o){let a=r.parent,l={from:i.from,to:i.to},u=0,c=a==null?void 0:a.cursor();if(c&&(n<0?c.childBefore(r.from):c.childAfter(r.to)))do if(n<0?c.to<=r.from:c.from>=r.to){if(u==0&&s.indexOf(c.type.name)>-1&&c.from0)return null;let u={from:n<0?e-1:e,to:n>0?e+1:e},c=t.doc.iterRange(e,n>0?t.doc.length:0),f=0;for(let d=0;!c.next().done&&d<=s;){let h=c.value;n<0&&(d+=h.length);let p=e+d*n;for(let m=n>0?0:h.length-1,g=n>0?h.length:-1;m!=g;m+=n){let b=o.indexOf(h[m]);if(!(b<0||r.resolveInner(p+m,1).type!=i))if(b%2==0==n>0)f++;else{if(f==1)return{start:u,end:{from:p+m,to:p+m+1},matched:b>>1==l>>1};f--}}n>0&&(d+=h.length)}return c.done?{start:u,matched:!1}:null}const S7=Object.create(null),mE=[fr.none],gE=[],bE=Object.create(null),E7=Object.create(null);for(let[t,e]of[["variable","variableName"],["variable-2","variableName.special"],["string-2","string.special"],["def","variableName.definition"],["tag","tagName"],["attribute","attributeName"],["type","typeName"],["builtin","variableName.standard"],["qualifier","modifier"],["error","invalid"],["header","heading"],["property","propertyName"]])E7[t]=w7(S7,e);function Pg(t,e){gE.indexOf(t)>-1||(gE.push(t),console.warn(e))}function w7(t,e){let n=[];for(let a of e.split(" ")){let l=[];for(let u of a.split(".")){let c=t[u]||oe[u];c?typeof c=="function"?l.length?l=l.map(c):Pg(u,`Modifier ${u} used at start of tag`):l.length?Pg(u,`Tag ${u} used as modifier`):l=Array.isArray(c)?c:[c]:Pg(u,`Unknown highlighting tag ${u}`)}for(let u of l)n.push(u)}if(!n.length)return 0;let r=e.replace(/ /g,"_"),i=r+" "+n.map(a=>a.id),s=bE[i];if(s)return s.id;let o=bE[i]=fr.define({id:mE.length,name:r,props:[Bk({[r]:n})]});return mE.push(o),o.id}Et.RTL,Et.LTR;const _7=()=>t=>{try{JSON.parse(t.state.doc.toString())}catch(e){if(!(e instanceof SyntaxError))throw e;const n=C7(e,t.state.doc);return[{from:n,message:e.message,severity:"error",to:n}]}return[]};function C7(t,e){let n;return(n=t.message.match(/at position (\d+)/))?Math.min(+n[1],e.length):(n=t.message.match(/at line (\d+) column (\d+)/))?Math.min(e.line(+n[1]).from+ +n[2]-1,e.length):0}const n3=Tp.define({name:"json",parser:T$.configure({props:[Vk.add({Object:dE({except:/^\s*\}/}),Array:dE({except:/^\s*\]/})}),Hk.add({"Object Array":W$})]}),languageData:{closeBrackets:{brackets:["[","{",'"']},indentOnInput:/^\s*[\}\]]$/}});function r3(){return new M$(n3)}class i3{constructor(e,n,r,i){this.state=e,this.pos=n,this.explicit=r,this.view=i,this.abortListeners=[],this.abortOnDocChange=!1}tokenBefore(e){let n=tn(this.state).resolveInner(this.pos,-1);for(;n&&e.indexOf(n.name)<0;)n=n.parent;return n?{from:n.from,to:this.pos,text:this.state.sliceDoc(n.from,this.pos),type:n.type}:null}matchBefore(e){let n=this.state.doc.lineAt(this.pos),r=Math.max(n.from,this.pos-250),i=n.text.slice(r-n.from,this.pos-n.from),s=i.search(s3(e,!1));return s<0?null:{from:r+s,to:this.pos,text:i.slice(s)}}get aborted(){return this.abortListeners==null}addEventListener(e,n,r){e=="abort"&&this.abortListeners&&(this.abortListeners.push(n),r&&r.onDocChange&&(this.abortOnDocChange=!0))}}function yE(t){let e=Object.keys(t).join(""),n=/\w/.test(e);return n&&(e=e.replace(/\w/g,"")),`[${n?"\\w":""}${e.replace(/[^\w\s]/g,"\\$&")}]`}function A7(t){let e=Object.create(null),n=Object.create(null);for(let{label:i}of t){e[i[0]]=!0;for(let s=1;stypeof i=="string"?{label:i}:i),[n,r]=e.every(i=>/^\w+$/.test(i.label))?[/\w*$/,/\w+$/]:A7(e);return i=>{let s=i.matchBefore(r);return s||i.explicit?{from:s?s.from:i.pos,options:e,validFor:n}:null}}class vE{constructor(e,n,r,i){this.completion=e,this.source=n,this.match=r,this.score=i}}function ia(t){return t.selection.main.from}function s3(t,e){var n;let{source:r}=t,i=e&&r[0]!="^",s=r[r.length-1]!="$";return!i&&!s?t:new RegExp(`${i?"^":""}(?:${r})${s?"$":""}`,(n=t.flags)!==null&&n!==void 0?n:t.ignoreCase?"i":"")}const Mv=As.define();function k7(t,e,n,r){let{main:i}=t.selection,s=n-i.from,o=r-i.from;return{...t.changeByRange(a=>{if(a!=i&&n!=r&&t.sliceDoc(a.from+s,a.from+o)!=t.sliceDoc(n,r))return{range:a};let l=t.toText(e);return{changes:{from:a.from+s,to:r==i.from?a.to:a.from+o,insert:l},range:Y.cursor(a.from+s+l.length)}}),scrollIntoView:!0,userEvent:"input.complete"}}const xE=new WeakMap;function O7(t){if(!Array.isArray(t))return t;let e=xE.get(t);return e||xE.set(t,e=D7(t)),e}const Mp=De.define(),qc=De.define();class T7{constructor(e){this.pattern=e,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[],this.score=0,this.matched=[];for(let n=0;n=48&&E<=57||E>=97&&E<=122?2:E>=65&&E<=90?1:0:(C=hv(E))!=C.toLowerCase()?1:C!=C.toUpperCase()?2:0;(!y||w==1&&g||S==0&&w!=0)&&(n[f]==E||r[f]==E&&(d=!0)?o[f++]=y:o.length&&(b=!1)),S=w,y+=Di(E)}return f==l&&o[0]==0&&b?this.result(-100+(d?-200:0),o,e):h==l&&p==0?this.ret(-200-e.length+(m==e.length?0:-100),[0,m]):a>-1?this.ret(-700-e.length,[a,a+this.pattern.length]):h==l?this.ret(-900-e.length,[p,m]):f==l?this.result(-100+(d?-200:0)+-700+(b?0:-1100),o,e):n.length==2?null:this.result((i[0]?-700:0)+-200+-1100,i,e)}result(e,n,r){let i=[],s=0;for(let o of n){let a=o+(this.astral?Di(ir(r,o)):1);s&&i[s-1]==o?i[s-1]=a:(i[s++]=o,i[s++]=a)}return this.ret(e-r.length,i)}}class I7{constructor(e){this.pattern=e,this.matched=[],this.score=0,this.folded=e.toLowerCase()}match(e){if(e.length!1,activateOnTypingDelay:100,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,tooltipClass:()=>"",optionClass:()=>"",aboveCursor:!1,icons:!0,addToOptions:[],positionInfo:P7,filterStrict:!1,compareCompletions:(e,n)=>e.label.localeCompare(n.label),interactionDelay:75,updateSyncTime:100},{defaultKeymap:(e,n)=>e&&n,closeOnBlur:(e,n)=>e&&n,icons:(e,n)=>e&&n,tooltipClass:(e,n)=>r=>SE(e(r),n(r)),optionClass:(e,n)=>r=>SE(e(r),n(r)),addToOptions:(e,n)=>e.concat(n),filterStrict:(e,n)=>e||n})}});function SE(t,e){return t?e?t+" "+e:t:e}function P7(t,e,n,r,i,s){let o=t.textDirection==Et.RTL,a=o,l=!1,u="top",c,f,d=e.left-i.left,h=i.right-e.right,p=r.right-r.left,m=r.bottom-r.top;if(a&&d=m||y>e.top?c=n.bottom-e.top:(u="bottom",c=e.bottom-n.top)}let g=(e.bottom-e.top)/s.offsetHeight,b=(e.right-e.left)/s.offsetWidth;return{style:`${u}: ${c/g}px; max-width: ${f/b}px`,class:"cm-completionInfo-"+(l?o?"left-narrow":"right-narrow":a?"left":"right")}}function R7(t){let e=t.addToOptions.slice();return t.icons&&e.push({render(n){let r=document.createElement("div");return r.classList.add("cm-completionIcon"),n.type&&r.classList.add(...n.type.split(/\s+/g).map(i=>"cm-completionIcon-"+i)),r.setAttribute("aria-hidden","true"),r},position:20}),e.push({render(n,r,i,s){let o=document.createElement("span");o.className="cm-completionLabel";let a=n.displayLabel||n.label,l=0;for(let u=0;ul&&o.appendChild(document.createTextNode(a.slice(l,c)));let d=o.appendChild(document.createElement("span"));d.appendChild(document.createTextNode(a.slice(c,f))),d.className="cm-completionMatchedText",l=f}return ln.position-r.position).map(n=>n.render)}function Rg(t,e,n){if(t<=n)return{from:0,to:t};if(e<0&&(e=0),e<=t>>1){let i=Math.floor(e/n);return{from:i*n,to:(i+1)*n}}let r=Math.floor((t-e)/n);return{from:t-(r+1)*n,to:t-r*n}}class N7{constructor(e,n,r){this.view=e,this.stateField=n,this.applyCompletion=r,this.info=null,this.infoDestroy=null,this.placeInfoReq={read:()=>this.measureInfo(),write:l=>this.placeInfo(l),key:this},this.space=null,this.currentClass="";let i=e.state.field(n),{options:s,selected:o}=i.open,a=e.state.facet(pn);this.optionContent=R7(a),this.optionClass=a.optionClass,this.tooltipClass=a.tooltipClass,this.range=Rg(s.length,o,a.maxRenderedOptions),this.dom=document.createElement("div"),this.dom.className="cm-tooltip-autocomplete",this.updateTooltipClass(e.state),this.dom.addEventListener("mousedown",l=>{let{options:u}=e.state.field(n).open;for(let c=l.target,f;c&&c!=this.dom;c=c.parentNode)if(c.nodeName=="LI"&&(f=/-(\d+)$/.exec(c.id))&&+f[1]{let u=e.state.field(this.stateField,!1);u&&u.tooltip&&e.state.facet(pn).closeOnBlur&&l.relatedTarget!=e.contentDOM&&e.dispatch({effects:qc.of(null)})}),this.showOptions(s,i.id)}mount(){this.updateSel()}showOptions(e,n){this.list&&this.list.remove(),this.list=this.dom.appendChild(this.createListBox(e,n,this.range)),this.list.addEventListener("scroll",()=>{this.info&&this.view.requestMeasure(this.placeInfoReq)})}update(e){var n;let r=e.state.field(this.stateField),i=e.startState.field(this.stateField);if(this.updateTooltipClass(e.state),r!=i){let{options:s,selected:o,disabled:a}=r.open;(!i.open||i.open.options!=s)&&(this.range=Rg(s.length,o,e.state.facet(pn).maxRenderedOptions),this.showOptions(s,r.id)),this.updateSel(),a!=((n=i.open)===null||n===void 0?void 0:n.disabled)&&this.dom.classList.toggle("cm-tooltip-autocomplete-disabled",!!a)}}updateTooltipClass(e){let n=this.tooltipClass(e);if(n!=this.currentClass){for(let r of this.currentClass.split(" "))r&&this.dom.classList.remove(r);for(let r of n.split(" "))r&&this.dom.classList.add(r);this.currentClass=n}}positioned(e){this.space=e,this.info&&this.view.requestMeasure(this.placeInfoReq)}updateSel(){let e=this.view.state.field(this.stateField),n=e.open;if((n.selected>-1&&n.selected=this.range.to)&&(this.range=Rg(n.options.length,n.selected,this.view.state.facet(pn).maxRenderedOptions),this.showOptions(n.options,e.id)),this.updateSelectedOption(n.selected)){this.destroyInfo();let{completion:r}=n.options[n.selected],{info:i}=r;if(!i)return;let s=typeof i=="string"?document.createTextNode(i):i(r);if(!s)return;"then"in s?s.then(o=>{o&&this.view.state.field(this.stateField,!1)==e&&this.addInfoPane(o,r)}).catch(o=>qn(this.view.state,o,"completion info")):this.addInfoPane(s,r)}}addInfoPane(e,n){this.destroyInfo();let r=this.info=document.createElement("div");if(r.className="cm-tooltip cm-completionInfo",e.nodeType!=null)r.appendChild(e),this.infoDestroy=null;else{let{dom:i,destroy:s}=e;r.appendChild(i),this.infoDestroy=s||null}this.dom.appendChild(r),this.view.requestMeasure(this.placeInfoReq)}updateSelectedOption(e){let n=null;for(let r=this.list.firstChild,i=this.range.from;r;r=r.nextSibling,i++)r.nodeName!="LI"||!r.id?i--:i==e?r.hasAttribute("aria-selected")||(r.setAttribute("aria-selected","true"),n=r):r.hasAttribute("aria-selected")&&r.removeAttribute("aria-selected");return n&&F7(this.list,n),n}measureInfo(){let e=this.dom.querySelector("[aria-selected]");if(!e||!this.info)return null;let n=this.dom.getBoundingClientRect(),r=this.info.getBoundingClientRect(),i=e.getBoundingClientRect(),s=this.space;if(!s){let o=this.dom.ownerDocument.documentElement;s={left:0,top:0,right:o.clientWidth,bottom:o.clientHeight}}return i.top>Math.min(s.bottom,n.bottom)-10||i.bottom{o.target==i&&o.preventDefault()});let s=null;for(let o=r.from;or.from||r.from==0))if(s=d,typeof u!="string"&&u.header)i.appendChild(u.header(u));else{let h=i.appendChild(document.createElement("completion-section"));h.textContent=d}}const c=i.appendChild(document.createElement("li"));c.id=n+"-"+o,c.setAttribute("role","option");let f=this.optionClass(a);f&&(c.className=f);for(let d of this.optionContent){let h=d(a,this.view.state,this.view,l);h&&c.appendChild(h)}}return r.from&&i.classList.add("cm-completionListIncompleteTop"),r.tonew N7(n,t,e)}function F7(t,e){let n=t.getBoundingClientRect(),r=e.getBoundingClientRect(),i=n.height/t.offsetHeight;r.topn.bottom&&(t.scrollTop+=(r.bottom-n.bottom)/i)}function EE(t){return(t.boost||0)*100+(t.apply?10:0)+(t.info?5:0)+(t.type?1:0)}function L7(t,e){let n=[],r=null,i=null,s=c=>{n.push(c);let{section:f}=c.completion;if(f){r||(r=[]);let d=typeof f=="string"?f:f.name;r.some(h=>h.name==d)||r.push(typeof f=="string"?{name:d}:f)}},o=e.facet(pn);for(let c of t)if(c.hasResult()){let f=c.result.getMatch;if(c.result.filter===!1)for(let d of c.result.options)s(new vE(d,c.source,f?f(d):[],1e9-n.length));else{let d=e.sliceDoc(c.from,c.to),h,p=o.filterStrict?new I7(d):new T7(d);for(let m of c.result.options)if(h=p.match(m.label)){let g=m.displayLabel?f?f(m,h.matched):[]:h.matched,b=h.score+(m.boost||0);if(s(new vE(m,c.source,g,b)),typeof m.section=="object"&&m.section.rank==="dynamic"){let{name:y}=m.section;i||(i=Object.create(null)),i[y]=Math.max(b,i[y]||-1e9)}}}}if(r){let c=Object.create(null),f=0,d=(h,p)=>(h.rank==="dynamic"&&p.rank==="dynamic"?i[p.name]-i[h.name]:0)||(typeof h.rank=="number"?h.rank:1e9)-(typeof p.rank=="number"?p.rank:1e9)||(h.named.score-f.score||u(f.completion,d.completion))){let f=c.completion;!l||l.label!=f.label||l.detail!=f.detail||l.type!=null&&f.type!=null&&l.type!=f.type||l.apply!=f.apply||l.boost!=f.boost?a.push(c):EE(c.completion)>EE(l)&&(a[a.length-1]=c),l=c.completion}return a}class nl{constructor(e,n,r,i,s,o){this.options=e,this.attrs=n,this.tooltip=r,this.timestamp=i,this.selected=s,this.disabled=o}setSelected(e,n){return e==this.selected||e>=this.options.length?this:new nl(this.options,wE(n,e),this.tooltip,this.timestamp,e,this.disabled)}static build(e,n,r,i,s,o){if(i&&!o&&e.some(u=>u.isPending))return i.setDisabled();let a=L7(e,n);if(!a.length)return i&&e.some(u=>u.isPending)?i.setDisabled():null;let l=n.facet(pn).selectOnOpen?0:-1;if(i&&i.selected!=l&&i.selected!=-1){let u=i.options[i.selected].completion;for(let c=0;cc.hasResult()?Math.min(u,c.from):u,1e8),create:U7,above:s.aboveCursor},i?i.timestamp:Date.now(),l,!1)}map(e){return new nl(this.options,this.attrs,{...this.tooltip,pos:e.mapPos(this.tooltip.pos)},this.timestamp,this.selected,this.disabled)}setDisabled(){return new nl(this.options,this.attrs,this.tooltip,this.timestamp,this.selected,!0)}}class Fp{constructor(e,n,r){this.active=e,this.id=n,this.open=r}static start(){return new Fp(j7,"cm-ac-"+Math.floor(Math.random()*2e6).toString(36),null)}update(e){let{state:n}=e,r=n.facet(pn),s=(r.override||n.languageDataAt("autocomplete",ia(n)).map(O7)).map(l=>(this.active.find(c=>c.source==l)||new $r(l,this.active.some(c=>c.state!=0)?1:0)).update(e,r));s.length==this.active.length&&s.every((l,u)=>l==this.active[u])&&(s=this.active);let o=this.open,a=e.effects.some(l=>l.is(Fv));o&&e.docChanged&&(o=o.map(e.changes)),e.selection||s.some(l=>l.hasResult()&&e.changes.touchesRange(l.from,l.to))||!B7(s,this.active)||a?o=nl.build(s,n,this.id,o,r,a):o&&o.disabled&&!s.some(l=>l.isPending)&&(o=null),!o&&s.every(l=>!l.isPending)&&s.some(l=>l.hasResult())&&(s=s.map(l=>l.hasResult()?new $r(l.source,0):l));for(let l of e.effects)l.is(a3)&&(o=o&&o.setSelected(l.value,this.id));return s==this.active&&o==this.open?this:new Fp(s,this.id,o)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:this.active.length?$7:z7}}function B7(t,e){if(t==e)return!0;for(let n=0,r=0;;){for(;n-1&&(n["aria-activedescendant"]=t+"-"+e),n}const j7=[];function o3(t,e){if(t.isUserEvent("input.complete")){let r=t.annotation(Mv);if(r&&e.activateOnCompletion(r))return 12}let n=t.isUserEvent("input.type");return n&&e.activateOnTyping?5:n?1:t.isUserEvent("delete.backward")?2:t.selection?8:t.docChanged?16:0}class $r{constructor(e,n,r=!1){this.source=e,this.state=n,this.explicit=r}hasResult(){return!1}get isPending(){return this.state==1}update(e,n){let r=o3(e,n),i=this;(r&8||r&16&&this.touches(e))&&(i=new $r(i.source,0)),r&4&&i.state==0&&(i=new $r(this.source,1)),i=i.updateFor(e,r);for(let s of e.effects)if(s.is(Mp))i=new $r(i.source,1,s.value);else if(s.is(qc))i=new $r(i.source,0);else if(s.is(Fv))for(let o of s.value)o.source==i.source&&(i=o);return i}updateFor(e,n){return this.map(e.changes)}map(e){return this}touches(e){return e.changes.touchesRange(ia(e.state))}}class hl extends $r{constructor(e,n,r,i,s,o){super(e,3,n),this.limit=r,this.result=i,this.from=s,this.to=o}hasResult(){return!0}updateFor(e,n){var r;if(!(n&3))return this.map(e.changes);let i=this.result;i.map&&!e.changes.empty&&(i=i.map(i,e.changes));let s=e.changes.mapPos(this.from),o=e.changes.mapPos(this.to,1),a=ia(e.state);if(a>o||!i||n&2&&(ia(e.startState)==this.from||an.map(e))}}),a3=De.define(),sr=Wt.define({create(){return Fp.start()},update(t,e){return t.update(e)},provide:t=>[X0.from(t,e=>e.tooltip),ce.contentAttributes.from(t,e=>e.attrs)]});function Lv(t,e){const n=e.completion.apply||e.completion.label;let r=t.state.field(sr).active.find(i=>i.source==e.source);return r instanceof hl?(typeof n=="string"?t.dispatch({...k7(t.state,n,r.from,r.to),annotations:Mv.of(e.completion)}):n(t,e.completion,r.from,r.to),!0):!1}const U7=M7(sr,Lv);function zd(t,e="option"){return n=>{let r=n.state.field(sr,!1);if(!r||!r.open||r.open.disabled||Date.now()-r.open.timestamp-1?r.open.selected+i*(t?1:-1):t?0:o-1;return a<0?a=e=="page"?0:o-1:a>=o&&(a=e=="page"?o-1:0),n.dispatch({effects:a3.of(a)}),!0}}const H7=t=>{let e=t.state.field(sr,!1);return t.state.readOnly||!e||!e.open||e.open.selected<0||e.open.disabled||Date.now()-e.open.timestampt.state.field(sr,!1)?(t.dispatch({effects:Mp.of(!0)}),!0):!1,q7=t=>{let e=t.state.field(sr,!1);return!e||!e.active.some(n=>n.state!=0)?!1:(t.dispatch({effects:qc.of(null)}),!0)};class G7{constructor(e,n){this.active=e,this.context=n,this.time=Date.now(),this.updates=[],this.done=void 0}}const W7=50,K7=1e3,X7=$t.fromClass(class{constructor(t){this.view=t,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.pendingStart=!1,this.composing=0;for(let e of t.state.field(sr).active)e.isPending&&this.startQuery(e)}update(t){let e=t.state.field(sr),n=t.state.facet(pn);if(!t.selectionSet&&!t.docChanged&&t.startState.field(sr)==e)return;let r=t.transactions.some(s=>{let o=o3(s,n);return o&8||(s.selection||s.docChanged)&&!(o&3)});for(let s=0;sW7&&Date.now()-o.time>K7){for(let a of o.context.abortListeners)try{a()}catch(l){qn(this.view.state,l)}o.context.abortListeners=null,this.running.splice(s--,1)}else o.updates.push(...t.transactions)}this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),t.transactions.some(s=>s.effects.some(o=>o.is(Mp)))&&(this.pendingStart=!0);let i=this.pendingStart?50:n.activateOnTypingDelay;if(this.debounceUpdate=e.active.some(s=>s.isPending&&!this.running.some(o=>o.active.source==s.source))?setTimeout(()=>this.startUpdate(),i):-1,this.composing!=0)for(let s of t.transactions)s.isUserEvent("input.type")?this.composing=2:this.composing==2&&s.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1,this.pendingStart=!1;let{state:t}=this.view,e=t.field(sr);for(let n of e.active)n.isPending&&!this.running.some(r=>r.active.source==n.source)&&this.startQuery(n);this.running.length&&e.open&&e.open.disabled&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(pn).updateSyncTime))}startQuery(t){let{state:e}=this.view,n=ia(e),r=new i3(e,n,t.explicit,this.view),i=new G7(t,r);this.running.push(i),Promise.resolve(t.source(r)).then(s=>{i.context.aborted||(i.done=s||null,this.scheduleAccept())},s=>{this.view.dispatch({effects:qc.of(null)}),qn(this.view.state,s)})}scheduleAccept(){this.running.every(t=>t.done!==void 0)?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(pn).updateSyncTime))}accept(){var t;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let e=[],n=this.view.state.facet(pn),r=this.view.state.field(sr);for(let i=0;ia.source==s.active.source);if(o&&o.isPending)if(s.done==null){let a=new $r(s.active.source,0);for(let l of s.updates)a=a.update(l,n);a.isPending||e.push(a)}else this.startQuery(o)}(e.length||r.open&&r.open.disabled)&&this.view.dispatch({effects:Fv.of(e)})}},{eventHandlers:{blur(t){let e=this.view.state.field(sr,!1);if(e&&e.tooltip&&this.view.state.facet(pn).closeOnBlur){let n=e.open&&yk(this.view,e.open.tooltip);(!n||!n.dom.contains(t.relatedTarget))&&setTimeout(()=>this.view.dispatch({effects:qc.of(null)}),10)}},compositionstart(){this.composing=1},compositionend(){this.composing==3&&setTimeout(()=>this.view.dispatch({effects:Mp.of(!1)}),20),this.composing=0}}}),Y7=typeof navigator=="object"&&/Win/.test(navigator.platform),J7=Ao.highest(ce.domEventHandlers({keydown(t,e){let n=e.state.field(sr,!1);if(!n||!n.open||n.open.disabled||n.open.selected<0||t.key.length>1||t.ctrlKey&&!(Y7&&t.altKey)||t.metaKey)return!1;let r=n.open.options[n.open.selected],i=n.active.find(o=>o.source==r.source),s=r.completion.commitCharacters||i.result.commitCharacters;return s&&s.indexOf(t.key)>-1&&Lv(e,r),!1}})),l3=ce.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:"monospace",whiteSpace:"nowrap",overflow:"hidden auto",maxWidth_fallback:"700px",maxWidth:"min(700px, 95vw)",minWidth:"250px",maxHeight:"10em",height:"100%",listStyle:"none",margin:0,padding:0,"& > li, & > completion-section":{padding:"1px 3px",lineHeight:1.2},"& > li":{overflowX:"hidden",textOverflow:"ellipsis",cursor:"pointer"},"& > completion-section":{display:"list-item",borderBottom:"1px solid silver",paddingLeft:"0.5em",opacity:.7}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#17c",color:"white"},"&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#777"},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#347",color:"white"},"&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#444"},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:'"···"',opacity:.5,display:"block",textAlign:"center"},".cm-tooltip.cm-completionInfo":{position:"absolute",padding:"3px 9px",width:"max-content",maxWidth:"400px",boxSizing:"border-box",whiteSpace:"pre-line"},".cm-completionInfo.cm-completionInfo-left":{right:"100%"},".cm-completionInfo.cm-completionInfo-right":{left:"100%"},".cm-completionInfo.cm-completionInfo-left-narrow":{right:"30px"},".cm-completionInfo.cm-completionInfo-right-narrow":{left:"30px"},"&light .cm-snippetField":{backgroundColor:"#00000022"},"&dark .cm-snippetField":{backgroundColor:"#ffffff22"},".cm-snippetFieldPosition":{verticalAlign:"text-top",width:0,height:"1.15em",display:"inline-block",margin:"0 -0.7px -.7em",borderLeft:"1.4px dotted #888"},".cm-completionMatchedText":{textDecoration:"underline"},".cm-completionDetail":{marginLeft:"0.5em",fontStyle:"italic"},".cm-completionIcon":{fontSize:"90%",width:".8em",display:"inline-block",textAlign:"center",paddingRight:".6em",opacity:"0.6",boxSizing:"content-box"},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:"'ƒ'"}},".cm-completionIcon-class":{"&:after":{content:"'○'"}},".cm-completionIcon-interface":{"&:after":{content:"'◌'"}},".cm-completionIcon-variable":{"&:after":{content:"'𝑥'"}},".cm-completionIcon-constant":{"&:after":{content:"'𝐶'"}},".cm-completionIcon-type":{"&:after":{content:"'𝑡'"}},".cm-completionIcon-enum":{"&:after":{content:"'∪'"}},".cm-completionIcon-property":{"&:after":{content:"'□'"}},".cm-completionIcon-keyword":{"&:after":{content:"'🔑︎'"}},".cm-completionIcon-namespace":{"&:after":{content:"'▢'"}},".cm-completionIcon-text":{"&:after":{content:"'abc'",fontSize:"50%",verticalAlign:"middle"}}});class Z7{constructor(e,n,r,i){this.field=e,this.line=n,this.from=r,this.to=i}}class Bv{constructor(e,n,r){this.field=e,this.from=n,this.to=r}map(e){let n=e.mapPos(this.from,-1,En.TrackDel),r=e.mapPos(this.to,1,En.TrackDel);return n==null||r==null?null:new Bv(this.field,n,r)}}class $v{constructor(e,n){this.lines=e,this.fieldPositions=n}instantiate(e,n){let r=[],i=[n],s=e.doc.lineAt(n),o=/^\s*/.exec(s.text)[0];for(let l of this.lines){if(r.length){let u=o,c=/^\t*/.exec(l)[0].length;for(let f=0;fnew Bv(l.field,i[l.line]+l.from,i[l.line]+l.to));return{text:r,ranges:a}}static parse(e){let n=[],r=[],i=[],s;for(let o of e.split(/\r\n?|\n/)){for(;s=/[#$]\{(?:(\d+)(?::([^{}]*))?|((?:\\[{}]|[^{}])*))\}/.exec(o);){let a=s[1]?+s[1]:null,l=s[2]||s[3]||"",u=-1,c=l.replace(/\\[{}]/g,f=>f[1]);for(let f=0;f=u&&d.field++}for(let f of i)if(f.line==r.length&&f.from>s.index){let d=s[2]?3+(s[1]||"").length:2;f.from-=d,f.to-=d}i.push(new Z7(u,r.length,s.index,s.index+c.length)),o=o.slice(0,s.index)+l+o.slice(s.index+s[0].length)}o=o.replace(/\\([{}])/g,(a,l,u)=>{for(let c of i)c.line==r.length&&c.from>u&&(c.from--,c.to--);return l}),r.push(o)}return new $v(r,i)}}let Q7=ve.widget({widget:new class extends Yi{toDOM(){let t=document.createElement("span");return t.className="cm-snippetFieldPosition",t}ignoreEvent(){return!1}}}),ez=ve.mark({class:"cm-snippetField"});class iu{constructor(e,n){this.ranges=e,this.active=n,this.deco=ve.set(e.map(r=>(r.from==r.to?Q7:ez).range(r.from,r.to)),!0)}map(e){let n=[];for(let r of this.ranges){let i=r.map(e);if(!i)return null;n.push(i)}return new iu(n,this.active)}selectionInsideField(e){return e.ranges.every(n=>this.ranges.some(r=>r.field==this.active&&r.from<=n.from&&r.to>=n.to))}}const jf=De.define({map(t,e){return t&&t.map(e)}}),tz=De.define(),Gc=Wt.define({create(){return null},update(t,e){for(let n of e.effects){if(n.is(jf))return n.value;if(n.is(tz)&&t)return new iu(t.ranges,n.value)}return t&&e.docChanged&&(t=t.map(e.changes)),t&&e.selection&&!t.selectionInsideField(e.selection)&&(t=null),t},provide:t=>ce.decorations.from(t,e=>e?e.deco:ve.none)});function zv(t,e){return Y.create(t.filter(n=>n.field==e).map(n=>Y.range(n.from,n.to)))}function nz(t){let e=$v.parse(t);return(n,r,i,s)=>{let{text:o,ranges:a}=e.instantiate(n.state,i),{main:l}=n.state.selection,u={changes:{from:i,to:s==l.from?l.to:s,insert:Ze.of(o)},scrollIntoView:!0,annotations:r?[Mv.of(r),Qt.userEvent.of("input.complete")]:void 0};if(a.length&&(u.selection=zv(a,0)),a.some(c=>c.field>0)){let c=new iu(a,0),f=u.effects=[jf.of(c)];n.state.field(Gc,!1)===void 0&&f.push(De.appendConfig.of([Gc,az,uz,l3]))}n.dispatch(n.state.update(u))}}function u3(t){return({state:e,dispatch:n})=>{let r=e.field(Gc,!1);if(!r||t<0&&r.active==0)return!1;let i=r.active+t,s=t>0&&!r.ranges.some(o=>o.field==i+t);return n(e.update({selection:zv(r.ranges,i),effects:jf.of(s?null:new iu(r.ranges,i)),scrollIntoView:!0})),!0}}const rz=({state:t,dispatch:e})=>t.field(Gc,!1)?(e(t.update({effects:jf.of(null)})),!0):!1,iz=u3(1),sz=u3(-1),oz=[{key:"Tab",run:iz,shift:sz},{key:"Escape",run:rz}],_E=he.define({combine(t){return t.length?t[0]:oz}}),az=Ao.highest(Lf.compute([_E],t=>t.facet(_E)));function lz(t,e){return{...e,apply:nz(t)}}const uz=ce.domEventHandlers({mousedown(t,e){let n=e.state.field(Gc,!1),r;if(!n||(r=e.posAtCoords({x:t.clientX,y:t.clientY}))==null)return!1;let i=n.ranges.find(s=>s.from<=r&&s.to>=r);return!i||i.field==n.active?!1:(e.dispatch({selection:zv(n.ranges,i.field),effects:jf.of(n.ranges.some(s=>s.field>i.field)?new iu(n.ranges,i.field):null),scrollIntoView:!0}),!0)}}),Wc={brackets:["(","[","{","'",'"'],before:")]}:;>",stringPrefixes:[]},Go=De.define({map(t,e){let n=e.mapPos(t,-1,En.TrackAfter);return n??void 0}}),jv=new class extends ca{};jv.startSide=1;jv.endSide=-1;const c3=Wt.define({create(){return Xe.empty},update(t,e){if(t=t.map(e.changes),e.selection){let n=e.state.doc.lineAt(e.selection.main.head);t=t.update({filter:r=>r>=n.from&&r<=n.to})}for(let n of e.effects)n.is(Go)&&(t=t.update({add:[jv.range(n.value,n.value+1)]}));return t}});function cz(){return[dz,c3]}const Mg="()[]{}<>«»»«[]{}";function f3(t){for(let e=0;e{if((fz?t.composing:t.compositionStarted)||t.state.readOnly)return!1;let i=t.state.selection.main;if(r.length>2||r.length==2&&Di(ir(r,0))==1||e!=i.from||n!=i.to)return!1;let s=mz(t.state,r);return s?(t.dispatch(s),!0):!1}),hz=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let r=d3(t,t.selection.main.head).brackets||Wc.brackets,i=null,s=t.changeByRange(o=>{if(o.empty){let a=gz(t.doc,o.head);for(let l of r)if(l==a&&nm(t.doc,o.head)==f3(ir(l,0)))return{changes:{from:o.head-l.length,to:o.head+l.length},range:Y.cursor(o.head-l.length)}}return{range:i=o}});return i||e(t.update(s,{scrollIntoView:!0,userEvent:"delete.backward"})),!i},pz=[{key:"Backspace",run:hz}];function mz(t,e){let n=d3(t,t.selection.main.head),r=n.brackets||Wc.brackets;for(let i of r){let s=f3(ir(i,0));if(e==i)return s==i?vz(t,i,r.indexOf(i+i+i)>-1,n):bz(t,i,s,n.before||Wc.before);if(e==s&&h3(t,t.selection.main.from))return yz(t,i,s)}return null}function h3(t,e){let n=!1;return t.field(c3).between(0,t.doc.length,r=>{r==e&&(n=!0)}),n}function nm(t,e){let n=t.sliceString(e,e+2);return n.slice(0,Di(ir(n,0)))}function gz(t,e){let n=t.sliceString(e-2,e);return Di(ir(n,0))==n.length?n:n.slice(1)}function bz(t,e,n,r){let i=null,s=t.changeByRange(o=>{if(!o.empty)return{changes:[{insert:e,from:o.from},{insert:n,from:o.to}],effects:Go.of(o.to+e.length),range:Y.range(o.anchor+e.length,o.head+e.length)};let a=nm(t.doc,o.head);return!a||/\s/.test(a)||r.indexOf(a)>-1?{changes:{insert:e+n,from:o.head},effects:Go.of(o.head+e.length),range:Y.cursor(o.head+e.length)}:{range:i=o}});return i?null:t.update(s,{scrollIntoView:!0,userEvent:"input.type"})}function yz(t,e,n){let r=null,i=t.changeByRange(s=>s.empty&&nm(t.doc,s.head)==n?{changes:{from:s.head,to:s.head+n.length,insert:n},range:Y.cursor(s.head+n.length)}:r={range:s});return r?null:t.update(i,{scrollIntoView:!0,userEvent:"input.type"})}function vz(t,e,n,r){let i=r.stringPrefixes||Wc.stringPrefixes,s=null,o=t.changeByRange(a=>{if(!a.empty)return{changes:[{insert:e,from:a.from},{insert:e,from:a.to}],effects:Go.of(a.to+e.length),range:Y.range(a.anchor+e.length,a.head+e.length)};let l=a.head,u=nm(t.doc,l),c;if(u==e){if(CE(t,l))return{changes:{insert:e+e,from:l},effects:Go.of(l+e.length),range:Y.cursor(l+e.length)};if(h3(t,l)){let d=n&&t.sliceDoc(l,l+e.length*3)==e+e+e?e+e+e:e;return{changes:{from:l,to:l+d.length,insert:d},range:Y.cursor(l+d.length)}}}else{if(n&&t.sliceDoc(l-2*e.length,l)==e+e&&(c=AE(t,l-2*e.length,i))>-1&&CE(t,c))return{changes:{insert:e+e+e+e,from:l},effects:Go.of(l+e.length),range:Y.cursor(l+e.length)};if(t.charCategorizer(l)(u)!=kt.Word&&AE(t,l,i)>-1&&!xz(t,l,e,i))return{changes:{insert:e+e,from:l},effects:Go.of(l+e.length),range:Y.cursor(l+e.length)}}return{range:s=a}});return s?null:t.update(o,{scrollIntoView:!0,userEvent:"input.type"})}function CE(t,e){let n=tn(t).resolveInner(e+1);return n.parent&&n.from==e}function xz(t,e,n,r){let i=tn(t).resolveInner(e,-1),s=r.reduce((o,a)=>Math.max(o,a.length),0);for(let o=0;o<5;o++){let a=t.sliceDoc(i.from,Math.min(i.to,i.from+n.length+s)),l=a.indexOf(n);if(!l||l>-1&&r.indexOf(a.slice(0,l))>-1){let c=i.firstChild;for(;c&&c.from==i.from&&c.to-c.from>n.length+l;){if(t.sliceDoc(c.to-n.length,c.to)==n)return!1;c=c.firstChild}return!0}let u=i.to==e&&i.parent;if(!u)break;i=u}return!1}function AE(t,e,n){let r=t.charCategorizer(e);if(r(t.sliceDoc(e-1,e))!=kt.Word)return e;for(let i of n){let s=e-i.length;if(t.sliceDoc(s,e)==i&&r(t.sliceDoc(s-1,s))!=kt.Word)return s}return-1}function Sz(t={}){return[J7,sr,pn.of(t),X7,Ez,l3]}const p3=[{key:"Ctrl-Space",run:Ng},{mac:"Alt-`",run:Ng},{mac:"Alt-i",run:Ng},{key:"Escape",run:q7},{key:"ArrowDown",run:zd(!0)},{key:"ArrowUp",run:zd(!1)},{key:"PageDown",run:zd(!0,"page")},{key:"PageUp",run:zd(!1,"page")},{key:"Enter",run:H7}],Ez=Ao.highest(Lf.computeN([pn],t=>t.facet(pn).defaultKeymap?[p3]:[]));function Ta(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function rm(t){if(Object.prototype.hasOwnProperty.call(t,"__esModule"))return t;var e=t.default;if(typeof e=="function"){var n=function r(){return this instanceof r?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};n.prototype=e.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(t).forEach(function(r){var i=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return t[r]}})}),n}var Mh={exports:{}},wz=Mh.exports,DE;function _z(){return DE||(DE=1,(function(t){(function(e,n){t.exports?t.exports=n():e.log=n()})(wz,function(){var e=function(){},n="undefined",r=typeof window!==n&&typeof window.navigator!==n&&/Trident\/|MSIE /.test(window.navigator.userAgent),i=["trace","debug","info","warn","error"],s={},o=null;function a(m,g){var b=m[g];if(typeof b.bind=="function")return b.bind(m);try{return Function.prototype.bind.call(b,m)}catch{return function(){return Function.prototype.apply.apply(b,[m,arguments])}}}function l(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}function u(m){return m==="debug"&&(m="log"),typeof console===n?!1:m==="trace"&&r?l:console[m]!==void 0?a(console,m):console.log!==void 0?a(console,"log"):e}function c(){for(var m=this.getLevel(),g=0;g=0&&N<=b.levels.SILENT)return N;throw new TypeError("log.setLevel() called with invalid level: "+I)}b.name=m,b.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},b.methodFactory=g||d,b.getLevel=function(){return S??x??y},b.setLevel=function(I,N){return S=_(I),N!==!1&&C(S),c.call(b)},b.setDefaultLevel=function(I){x=_(I),w()||b.setLevel(I,!1)},b.resetLevel=function(){S=null,A(),c.call(b)},b.enableAll=function(I){b.setLevel(b.levels.TRACE,I)},b.disableAll=function(I){b.setLevel(b.levels.SILENT,I)},b.rebuild=function(){if(o!==b&&(y=_(o.getLevel())),c.call(b),o===b)for(var I in s)s[I].rebuild()},y=_(o?o.getLevel():"WARN");var O=w();O!=null&&(S=_(O)),c.call(b)}o=new h,o.getLogger=function(g){if(typeof g!="symbol"&&typeof g!="string"||g==="")throw new TypeError("You must supply a name when creating a logger.");var b=s[g];return b||(b=s[g]=new h(g,o.methodFactory)),b};var p=typeof window!==n?window.log:void 0;return o.noConflict=function(){return typeof window!==n&&window.log===o&&(window.log=p),o},o.getLoggers=function(){return s},o.default=o,o})})(Mh)),Mh.exports}var Cz=_z();const m3=Ta(Cz);m3.setLevel("silent");const Tt=m3,Ne={STRING:"String",NUMBER:"Number",TRUE:"True",FALSE:"False",NULL:"Null",OBJECT:"Object",ARRAY:"Array",PROPERTY:"Property",PROPERTY_NAME:"PropertyName",PROPERTY_COLON:"PropertyColon",ITEM:"Item",JSON_TEXT:"JsonText",INVALID:"⚠"},Az={Pair:Ne.PROPERTY,Key:Ne.PROPERTY_NAME,BlockSequence:Ne.ARRAY,BlockMapping:Ne.OBJECT,FlowSequence:Ne.ARRAY,FlowMapping:Ne.OBJECT,QuotedLiteral:Ne.STRING,Literal:Ne.STRING,Stream:Ne.JSON_TEXT,Document:Ne.OBJECT},Dz={File:Ne.JSON_TEXT},Vv=[Ne.STRING,Ne.NUMBER,Ne.TRUE,Ne.FALSE,Ne.NULL],g3=[Ne.OBJECT,Ne.ARRAY,Ne.ITEM],At={JSON5:"json5",JSON:"json4",YAML:"yaml"},qt=(t,e)=>{var n,r;switch(e){case At.YAML:return(n=Az[t])!==null&&n!==void 0?n:t;case At.JSON5:return(r=Dz[t])!==null&&r!==void 0?r:t;default:return t}};function b3(t,e,n){const r=[];for(let i=e;i!=null&&i.parent;i=i.parent)switch(qt(i.parent.name,n)){case Ne.PROPERTY:{const s=qb(i.parent,Ne.PROPERTY_NAME,n);if(s){let o=Wa(t,s).replace(/[/~]/g,a=>a==="~"?"~0":"~1");r.unshift(o)}break}case Ne.ARRAY:{if(Oz(i,n)){const s=x3(i.parent,i,n);r.unshift(`${s}`)}break}}return r.length===0?"":"/"+r.join("/")}const y3=(t,e,n=-1,r)=>b3(t.doc,tn(t).resolve(e,n),r),Uv=(t,e)=>{const n=tn(t),r=new Map;return n.iterate({enter:i=>{var s,o,a,l,u,c,f,d;if([Ne.PROPERTY_NAME,Ne.OBJECT].includes(qt(i.name,e))){const h=b3(t.doc,i.node,e),{from:p,to:m}=i.node;if(!(!((o=(s=i.node)===null||s===void 0?void 0:s.nextSibling)===null||o===void 0)&&o.node))return r.set(h,{keyFrom:p,keyTo:m}),!0;const g=e===At.JSON?(l=(a=i.node)===null||a===void 0?void 0:a.nextSibling)===null||l===void 0?void 0:l.node:(d=(f=(c=(u=i.node)===null||u===void 0?void 0:u.nextSibling)===null||c===void 0?void 0:c.node)===null||f===void 0?void 0:f.nextSibling)===null||d===void 0?void 0:d.node;if(!g)return r.set(h,{keyFrom:p,keyTo:m}),!0;const{from:b,to:y}=g;return r.set(h,{keyFrom:p,keyTo:m,valueFrom:b,valueTo:y}),!0}}}),r},Fg=(t,e,n=-1)=>tn(t).resolveInner(e,n),Fh=t=>t.replace(/^"(.*)"$/,"$1").replace(/^'(.*)'$/,"$1"),kz=t=>t.replace(/^"(.*)"$/,"'$1'"),Wa=(t,e,n=!0,r=!0)=>{const i=e?t.sliceString(e.from,e.to):"";return n?r?Fh(i):i.replace(/(^["'])|(["']$)/g,""):i},v3=(t,e)=>{var n,r,i,s;return qt(t.name,e)===Ne.INVALID&&(qt((r=(n=t.prevSibling)===null||n===void 0?void 0:n.name)!==null&&r!==void 0?r:"",e)===Ne.PROPERTY_NAME||qt((s=(i=t.prevSibling)===null||i===void 0?void 0:i.name)!==null&&s!==void 0?s:"",e)===Ne.PROPERTY_COLON)},Lh=(t,e)=>Vv.includes(qt(t.name,e))||v3(t,e),Oz=(t,e)=>[...Vv,...g3].includes(qt(t.name,e))||v3(t,e),jd=(t,e)=>{var n,r,i,s,o,a;return qt(t.name,e)===Ne.PROPERTY_NAME||qt(t.name,e)===Ne.INVALID&&(qt((r=(n=t.prevSibling)===null||n===void 0?void 0:n.name)!==null&&r!==void 0?r:"",e)===Ne.PROPERTY||qt((s=(i=t.prevSibling)===null||i===void 0?void 0:i.name)!==null&&s!==void 0?s:"",e)==="{")||e===At.YAML&&qt((a=(o=t.parent)===null||o===void 0?void 0:o.name)!==null&&a!==void 0?a:"",e)===Ne.OBJECT},Vf=t=>{const e=[];let n=t.firstChild;for(;n;)n&&e.push(n),n=n==null?void 0:n.nextSibling;return e},Tz=(t,e,n)=>Vf(t).filter(r=>qt(r.name,n)===e),qb=(t,e,n)=>{var r;return(r=Vf(t).find(i=>qt(i.name,n)===e))!==null&&r!==void 0?r:null},kE=(t,e)=>Vf(t).find(n=>Lh(n,e)),Iz=(t,e)=>Vf(t).filter(n=>Vv.includes(qt(n.name,e))||g3.includes(qt(n.name,e))),x3=(t,e,n)=>Iz(t,n).findIndex(r=>r.from===e.from&&r.to===e.to),OE=(t,e,n,r=1/0)=>{let i=t;for(;i&&r>0;){if(qt(i.name,n)===e)return i;i=i.parent,r--}return null},Pz=De.define(),Lp=Wt.define({create(){},update(t,e){for(const n of e.effects)if(n.is(Pz))return n.value;return t}}),Hv=t=>t.field(Lp),Rz=t=>[Lp.init(()=>t)],Nz={AdditionalItemsError:"Array at `{{pointer}}` may not have an additional item `{{key}}`",AdditionalPropertiesError:"Additional property `{{property}}` on `{{pointer}}` does not match schema `{{schema}}`",AllOfError:"Value `{{value}}` at `{{pointer}}` does not match schema of `{{allOf}}`",AnyOfError:"Value `{{value}}` at `{{pointer}}` does not match any schema of `{{anyOf}}`",ConstError:"Expected value at `{{pointer}}` to be `{{expected}}`, but value given is `{{value}}`",containsAnyError:"The array at `{{pointer}}` must contain at least one item",ContainsArrayError:"The property at `{{pointer}}` must not be an array",ContainsError:"The array at `{{pointer}}` must contain an element that matches `{{schema}}`",EnumError:"Expected given value `{{value}}` in `{{pointer}}` to be one of `{{values}}`",ForbiddenPropertyError:"Property name `{{property}}` at `{{pointer}}` is not allowed",FormatDateError:"Value `{{value}}` at `{{pointer}}` is not a valid date",FormatDateTimeError:"Value `{{value}}` at `{{pointer}}` is not a valid date-time",FormatEmailError:"Value `{{value}}` at `{{pointer}}` is not a valid email",FormatHostnameError:"Value `{{value}}` at `{{pointer}}` is not a valid hostname",FormatIPV4Error:"Value `{{value}}` at `{{pointer}}` is not a valid IPv4 address",FormatIPV4LeadingZeroError:"IPv4 addresses starting with zero are invalid, since they are interpreted as octals",FormatIPV6Error:"Value `{{value}}` at `{{pointer}}` is not a valid IPv6 address",FormatIPV6LeadingZeroError:"IPv6 addresses starting with zero are invalid, since they are interpreted as octals",FormatJsonPointerError:"Value `{{value}}` at `{{pointer}}` is not a valid json-pointer",FormatRegExError:"Value `{{value}}` at `{{pointer}}` is not a valid regular expression",FormatTimeError:"Value `{{value}}` at `{{pointer}}` is not a valid time",FormatURIError:"Value `{{value}}` at `{{pointer}}` is not a valid uri",FormatURIReferenceError:"Value `{{value}}` at `{{pointer}}` is not a valid uri-reference",FormatURITemplateError:"Value `{{value}}` at `{{pointer}}` is not a valid uri-template",FormatURLError:"Value `{{value}}` at `{{pointer}}` is not a valid url",InvalidDataError:"No value may be specified in `{{pointer}}`",InvalidPropertyNameError:"Invalid property name `{{property}}` at `{{pointer}}`",MaximumError:"Value in `{{pointer}}` is `{{length}}`, but should be `{{maximum}}` at maximum",MaxItemsError:"Too many items in `{{pointer}}`, should be `{{maximum}}` at most, but got `{{length}}`",MaxLengthError:"Value `{{pointer}}` should have a maximum length of `{{maxLength}}`, but got `{{length}}`.",MaxPropertiesError:"Too many properties in `{{pointer}}`, should be `{{maximum}}` at most, but got `{{length}}`",MinimumError:"Value in `{{pointer}}` is `{{length}}`, but should be `{{minimum}}` at minimum",MinItemsError:"Too few items in `{{pointer}}`, should be at least `{{minItems}}`, but got `{{length}}`",MinItemsOneError:"At least one item is required in `{{pointer}}`",MinLengthError:"Value `{{pointer}}` should have a minimum length of `{{minLength}}`, but got `{{length}}`.",MinLengthOneError:"A value is required in `{{pointer}}`",MinPropertiesError:"Too few properties in `{{pointer}}`, should be at least `{{minimum}}`, but got `{{length}}`",MissingDependencyError:"The required propery '{{missingProperty}}' in `{{pointer}}` is missing",MissingOneOfPropertyError:"Value at `{{pointer}}` property: `{{property}}`",MultipleOfError:"Expected `{{value}}` in `{{pointer}}` to be multiple of `{{multipleOf}}`",MultipleOneOfError:"Value `{{value}}` should not match multiple schemas in oneOf `{{matches}}`",NoAdditionalPropertiesError:"Additional property `{{property}}` in `{{pointer}}` is not allowed",NotError:"Value `{{value}}` at pointer should not match schema `{{not}}`",OneOfError:"Value `{{value}}` in `{{pointer}}` does not match any given oneof schema",OneOfPropertyError:"Failed finding a matching oneOfProperty schema in `{{pointer}}` where `{{property}}` matches `{{value}}`",PatternError:"Value in `{{pointer}}` should match `{{description}}`, but received `{{received}}`",PatternPropertiesError:"Property `{{key}}` does not match any patterns in `{{pointer}}`. Valid patterns are: {{patterns}}",RequiredPropertyError:"The required property `{{key}}` is missing at `{{pointer}}`",SchemaWarning:"Failed retrieving a schema from '{{pointer}}' to key '{{key}}'",TypeError:"Expected `{{value}}` ({{received}}) in `{{pointer}}` to be of type `{{expected}}`",UndefinedValueError:"Value must not be undefined in `{{pointer}}`",UniqueItemsError:"Items in array must be unique. Value `{{value}}` in `{{pointer}}` is a duplicate of {{duplicatePointer}}.",UnknownPropertyError:"Could not find a valid schema for property `{{pointer}}` within object",ValueNotEmptyError:"A value for `{{property}}` is required at `{{pointer}}`"},Mz=Object.prototype.toString;function tt(t){const e=Mz.call(t).match(/\s([^\]]+)\]/).pop().toLowerCase();return e==="file"?"object":e}const Fz="object",Lz="array";function Bz(t,e={}){return t.replace(/\{\{\w+\}\}/g,n=>{const r=n.replace(/[{}]/g,""),i=e[r],s=tt(i);return s===Fz||s===Lz?JSON.stringify(i):i})}function $z(t,e,n=t){var r;const i=(r=Nz[t])!==null&&r!==void 0?r:n;return Bz(i,e)}function zz(t){return t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function jz(t,e){return{type:"error",name:t,code:zz(t),message:$z(t,e),data:e}}function xe(t){return jz.bind(null,t)}function Kc(t,e=[]){for(let n=0;n({index:n,schema:t})}),r}function Nn(t){return(t==null?void 0:t.type)==="error"}function Vz(t){return t instanceof Promise}function Bp(t){return Nn(t)||Vz(t)}const{DECLARATOR_ONEOF:pl}=su;function S3(t,e,n=t.rootSchema,r="#"){if(e!=null&&n[pl]){const o=[],a=n[pl],l=e[n[pl]];if(l===void 0)return t.errors.missingOneOfPropertyError({property:a,pointer:r,schema:n,value:e});for(let u=0;u0)o.push(...d);else return pc(n,c,u)}return t.errors.oneOfPropertyError({property:a,value:l,pointer:r,schema:n,errors:o})}const i=[],s=[];for(let o=0;o0?s.push(...l):i.push({index:o,schema:a})}return i.length===1?pc(n,i[0].schema,i[0].index):i.length>1?t.errors.multipleOneOfError({value:e,pointer:r,schema:n,matches:i}):t.errors.oneOfError({value:JSON.stringify(e),pointer:r,schema:n,oneOf:n.oneOf,errors:s})}function Uz(t,e,n,r){if(n==null||e.properties==null)return-1;let i=0;const s=Object.keys(e.properties);for(let o=0;o0)s.push(...f);else return pc(n,u,l)}return t.errors.oneOfPropertyError({property:o,value:a,pointer:r,schema:n,errors:s})}const i=[];for(let s=0;s1?t.errors.multipleOneOfError({matches:i,pointer:r,schema:n,value:e}):t.errors.oneOfError({value:JSON.stringify(e),pointer:r,schema:n,oneOf:n.oneOf})}const Hz=(t,e,n,r)=>{if(Array.isArray(e.oneOf)){const i=t.resolveOneOf(n,e,r);if(Nn(i))return i}};var Lg,TE;function qz(){if(TE)return Lg;TE=1;var t=function(y){return e(y)&&!n(y)};function e(b){return!!b&&typeof b=="object"}function n(b){var y=Object.prototype.toString.call(b);return y==="[object RegExp]"||y==="[object Date]"||s(b)}var r=typeof Symbol=="function"&&Symbol.for,i=r?Symbol.for("react.element"):60103;function s(b){return b.$$typeof===i}function o(b){return Array.isArray(b)?[]:{}}function a(b,y){return y.clone!==!1&&y.isMergeableObject(b)?m(o(b),b,y):b}function l(b,y,x){return b.concat(y).map(function(S){return a(S,x)})}function u(b,y){if(!y.customMerge)return m;var x=y.customMerge(b);return typeof x=="function"?x:m}function c(b){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(b).filter(function(y){return Object.propertyIsEnumerable.call(b,y)}):[]}function f(b){return Object.keys(b).concat(c(b))}function d(b,y){try{return y in b}catch{return!1}}function h(b,y){return d(b,y)&&!(Object.hasOwnProperty.call(b,y)&&Object.propertyIsEnumerable.call(b,y))}function p(b,y,x){var S={};return x.isMergeableObject(b)&&f(b).forEach(function(E){S[E]=a(b[E],x)}),f(y).forEach(function(E){h(b,E)||(d(b,E)&&x.isMergeableObject(y[E])?S[E]=u(E,x)(b[E],y[E],x):S[E]=a(y[E],x))}),S}function m(b,y,x){x=x||{},x.arrayMerge=x.arrayMerge||l,x.isMergeableObject=x.isMergeableObject||t,x.cloneUnlessOtherwiseSpecified=a;var S=Array.isArray(y),E=Array.isArray(b),C=S===E;return C?S?x.arrayMerge(b,y,x):p(b,y,x):a(y,x)}m.all=function(y,x){if(!Array.isArray(y))throw new Error("first argument should be an array");return y.reduce(function(S,E){return m(S,E,x)},{})};var g=m;return Lg=g,Lg}var Gz=qz();const E3=Ta(Gz),Wz=(t,e)=>e,Gv=(t,e)=>E3(t,e,{arrayMerge:Wz}),Kz=(t,e)=>{const n=t.concat(e);return n.filter((r,i)=>n.indexOf(r)===i)},Xz=(t,e)=>E3(t,e,{arrayMerge:Kz});function zn(t,e){const n=tt(t),r=tt(e);if(n!==r)return t;const i=Xz(t,e);return t.getOneOfOrigin?Object.defineProperty(i,"getOneOfOrigin",{enumerable:!1,value:t.getOneOfOrigin}):e.getOneOfOrigin&&Object.defineProperty(i,"getOneOfOrigin",{enumerable:!1,value:e.getOneOfOrigin}),i}function Xc(t,...e){const n={};return Object.keys(t).forEach(r=>{e.includes(r)||(n[r]=t[r])}),t.getOneOfOrigin&&Object.defineProperty(n,"getOneOfOrigin",{enumerable:!1,value:t.getOneOfOrigin}),n}var Yz=Function.prototype.toString,Bg=Object.create,Jz=Object.prototype.toString,Zz=(function(){function t(){this._keys=[],this._values=[]}return t.prototype.has=function(e){return!!~this._keys.indexOf(e)},t.prototype.get=function(e){return this._values[this._keys.indexOf(e)]},t.prototype.set=function(e,n){this._keys.push(e),this._values.push(n)},t})();function Qz(){return new Zz}function ej(){return new WeakMap}var tj=typeof WeakMap<"u"?ej:Qz;function Wv(t){if(!t)return Bg(null);var e=t.constructor;if(e===Object)return t===Object.prototype?{}:Bg(t);if(e&&~Yz.call(e).indexOf("[native code]"))try{return new e}catch{}return Bg(t)}function nj(t){var e="";return t.global&&(e+="g"),t.ignoreCase&&(e+="i"),t.multiline&&(e+="m"),t.unicode&&(e+="u"),t.sticky&&(e+="y"),e}function rj(t){return t.flags}var ij=/test/g.flags==="g"?rj:nj;function w3(t){var e=Jz.call(t);return e.substring(8,e.length-1)}function sj(t){return t[Symbol.toStringTag]||w3(t)}var oj=typeof Symbol<"u"?sj:w3,aj=Object.defineProperty,lj=Object.getOwnPropertyDescriptor,_3=Object.getOwnPropertyNames,Kv=Object.getOwnPropertySymbols,C3=Object.prototype,A3=C3.hasOwnProperty,uj=C3.propertyIsEnumerable,D3=typeof Kv=="function";function cj(t){return _3(t).concat(Kv(t))}var fj=D3?cj:_3;function im(t,e,n){for(var r=fj(t),i=0,s=r.length,o=void 0,a=void 0;i{const i=sm(t,e,n);if(i)return t.validate(n,i,r)};function R3(t,e,n){var r;const i={...(r=t.resolveRef(e))!==null&&r!==void 0?r:{}},s=sm(t,i,n);return s||Xc(i,"if","then","else")}function N3(t,e,n=t.rootSchema){let r=$p(n);for(let i=0;i{r=zn(r,t.resolveRef(i))}),r}const Tj=(t,e,n,r)=>{const{allOf:i}=e;if(!Array.isArray(i)||i.length===0)return;const s=[];return e.allOf.forEach(o=>{s.push(...t.validate(n,o,r))}),s};function F3(t,e){return t==null||t.$ref==null?t:t.getRoot?t.getRoot().getRef(t):e.getRef(t)}function Ij(t){return t.filter((e,n)=>t.indexOf(e)===n)}function no(t){return tt(t)==="object"}function L3(t,e,n){const{dependencies:r}=e;if(!no(r)||!no(n))return;let i=!1,s={required:[]};if(Object.keys(r).forEach(o=>{var a,l;if(n[o]==null&&!(!((a=e.required)===null||a===void 0)&&a.includes(o)||!((l=s.required)===null||l===void 0)&&l.includes(o)))return;const u=r[o];if(Array.isArray(u)){i=!0,s.required.push(...u);return}if(no(u)){i=!0,s=zn(s,t.resolveRef(u));return}}),i)return s.required=Ij(s.required),s}const Pj=(t,e,n,r)=>{if(tt(e.dependencies)!=="object")return;const i=[];return Object.keys(n).forEach(s=>{if(e.dependencies[s]===void 0||e.dependencies[s]===!0)return;if(e.dependencies[s]===!1){i.push(t.errors.missingDependencyError({pointer:r,schema:e,value:n}));return}let o;const a=tt(e.dependencies[s]);if(a==="array")o=e.dependencies[s].filter(l=>n[l]===void 0).map(l=>t.errors.missingDependencyError({missingProperty:l,pointer:r,schema:e,value:n}));else if(a==="object")o=t.validate(n,e.dependencies[s],r);else throw new Error(`Invalid dependency definition for ${r}/${s}. Must be string[] or schema`);i.push(...o)}),i.length>0?i:void 0};function B3(t,e,n){if(!Array.isArray(e.anyOf)||e.anyOf.length===0)return;let r;return e.anyOf.forEach(i=>{i=t.resolveRef(i),t.isValid(n,i)&&(r=r?zn(r,i):i)}),r}function $3(t,e,n=t.rootSchema,r="#"){const{anyOf:i}=n;if(!Array.isArray(i)||i.length===0)return n;const s=B3(t,n,e);if(s==null)return t.errors.anyOfError({pointer:r,schema:n,value:e,anyOf:JSON.stringify(i)});const o=zn(n,s);return Xc(o,"anyOf")}const Rj=(t,e,n,r)=>{if(!(!Array.isArray(e.anyOf)||e.anyOf.length===0)){for(let i=0;ie.includes(n))!==-1}function Gb(t,e,n,r){let i,s;if(e=t.resolveRef(e),e.oneOf){const c=qv(t,n,e,r);Nn(c)?s=c:c&&(i=zn(i??{},c))}if(Array.isArray(e.allOf)){const c=e.allOf.map(f=>{if(Mj(f)){let d=Gb(t,f,n,r);return d?(d=zn(f,d),Xc(d,...IE)):void 0}return f});if(c.length>0){const f=M3(t,{allOf:c});i=zn(i??{},f)}}const o=B3(t,e,n);o&&(i=zn(i??{},o));const a=L3(t,e,n);a&&(i=zn(i??{},a));const l=sm(t,e,n);if(l&&(i=zn(i??{},l)),i==null)return s;const u=Gb(t,i,n,r);return u&&(i=zn(i,u)),Xc(i,...IE)}const Fj=["allOf","anyOf","oneOf","dependencies","if","then","else"];function PE(t,e,n,r){let i=Gb(t,e,n,r);return i?(i=zn(e,i),Xc(i,...Fj)):e}class z3{constructor(e,n){this.remotes={},this.errors={},this.typeKeywords={},this.validateKeyword={},this.validateType={},this.validateFormat={},this.config=e,this.typeKeywords=$p(e.typeKeywords),this.validateKeyword=Object.assign({},e.validateKeyword),this.validateType=Object.assign({},e.validateType),this.validateFormat=Object.assign({},e.validateFormat),this.errors=Object.assign({},e.errors),this.setSchema(n)}get rootSchema(){return this.__rootSchema}set rootSchema(e){e!=null&&(this.__rootSchema=this.config.compileSchema(this,e))}addRemoteSchema(e,n){this.config.addRemoteSchema(this,e,n)}compileSchema(e){var n;return this.config.compileSchema(this,e,(n=this.rootSchema)!==null&&n!==void 0?n:e)}createSchemaOf(e){return this.config.createSchemaOf(e)}each(e,n,r,i){return this.config.each(this,e,n,r,i)}eachSchema(e,n=this.rootSchema){return this.config.eachSchema(n,e)}getChildSchemaSelection(e,n){return this.config.getChildSchemaSelection(this,e,n)}getSchema(e){return this.config.getSchema(this,e)}getTemplate(e,n,r=this.config.templateDefaultOptions){return this.config.getTemplate(this,e,n,r)}isValid(e,n,r){return this.config.isValid(this,e,n,r)}resolveAnyOf(e,n,r){return this.config.resolveAnyOf(this,e,n,r)}resolveAllOf(e,n){return this.config.resolveAllOf(this,e,n)}resolveRef(e){return this.config.resolveRef(e,this.rootSchema)}resolveOneOf(e,n,r){return this.config.resolveOneOf(this,e,n,r)}setSchema(e){this.rootSchema=e}step(e,n,r,i){return this.config.step(this,e,n,r,i)}validate(e,n,r){return this.config.validate(this,e,n,r)}}function j3(t,e,n){n.id=n.id||e,t.remotes[e]=t.compileSchema(n)}var $h={exports:{}},Lj=$h.exports,RE;function Bj(){return RE||(RE=1,(function(t,e){(function(n,r){t.exports=r()})(typeof self<"u"?self:Lj,(()=>(()=>{var n={d:(P,R)=>{for(var F in R)n.o(R,F)&&!n.o(P,F)&&Object.defineProperty(P,F,{enumerable:!0,get:R[F]})},o:(P,R)=>Object.prototype.hasOwnProperty.call(P,R),r:P=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(P,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(P,"__esModule",{value:!0})}},r={};function i(P){return P==="#"||P===""||Array.isArray(P)&&P.length===0||!1}n.r(r),n.d(r,{default:()=>N,get:()=>d,isRoot:()=>i,join:()=>O,remove:()=>E,removeUndefinedItems:()=>S,set:()=>b,split:()=>f,splitLast:()=>I});const s=/~1/g,o=/~0/g,a=/\/+/g,l=/(^[#/]*|\/+$)/g;function u(P){return P.replace(s,"/").replace(o,"~")}function c(P){return u(decodeURIComponent(P))}function f(P){if(P==null||typeof P!="string"||i(P))return Array.isArray(P)?P:[];const R=P.indexOf("#")>=0?c:u,F=(P=(P=P.replace(a,"/")).replace(l,"")).split("/");for(let V=0,B=F.length;V0&&R[0]=="prototype"}function b(P,R,F){if(R==null)return P;const V=f(R);if(V.length===0)return P;P==null&&(P=p.test(V[0])?[]:{});let B,G,H=P;for(;V.length>1;)B=V.shift(),G=p.test(V[0]),g(B,V)||(H=x(H,B,G));return B=V.pop(),y(H,B,F),P}function y(P,R,F){let V;const B=R.match(m);R==="[]"&&Array.isArray(P)?P.push(F):B?(V=B.pop(),P[V]=F):P[R]=F}function x(P,R,F){if(P[R]!=null)return P[R];const V=F?[]:{};return y(P,R,V),V}function S(P){let R=0,F=0;for(;R+F0?null:{type:null,text:b[0],rest:m.substr(b[0].length),start:0,end:b[0].length-1,fullText:b[0],errors:[],children:[],parent:null}:null}Qn.readToken=s;function o(m){return m.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}Qn.escapeRegExp=o;function a(m){m.rest="",m.children&&m.children.forEach(g=>a(g))}function l(m,g){m.start+=g,m.end+=g,m.children&&m.children.forEach(b=>l(b,m.start))}function u(m,g){g.errors&&g.errors.length&&g.errors.forEach(b=>m.push(b)),g.children&&g.children.forEach(b=>u(m,b))}function c(m){let g=e.exec(m),b=n.exec(m),y=g&&g[0]||"",x=b&&b[0]||"",S={raw:m,name:m.replace(e,"").replace(n,""),isOptional:y=="?"||y=="*",allowRepetition:y=="+"||y=="*",atLeastOne:y=="+",lookupPositive:x=="&",lookupNegative:x=="!",pinned:x=="@",lookup:!1,isLiteral:!1};return S.isLiteral=S.name[0]=="'"||S.name[0]=='"',S.lookup=S.lookupNegative||S.lookupPositive,S}Qn.parseRuleName=c;function f(m,g){let b=c(m);return g.cachedRules[b.name]||null}Qn.findRuleByName=f;function d(m,g){if(m.children){let b=m.children.filter(y=>y.type&&g.test(y.type));for(let y=0;yd(y,g))}}const h=["EOF"];class p{constructor(g,b){this.grammarRules=g,this.options=b,this.cachedRules={},this.debug=b?b.debug===!0:!1;let y=[],x=[];if(g.forEach(S=>{let E=c(S.name);if(E.name in this.cachedRules){y.push("Duplicated rule "+E.name);return}else this.cachedRules[E.name]=S;if(!S.bnf||!S.bnf.length){let C="Missing rule content, rule: "+S.name;y.indexOf(C)==-1&&y.push(C)}else S.bnf.forEach(C=>{if(typeof C[0]=="string"&&c(C[0]).name==S.name){let A="Left recursion is not allowed, rule: "+S.name;y.indexOf(A)==-1&&y.push(A)}C.forEach(w=>{if(typeof w=="string"){let A=c(w);!A.isLiteral&&x.indexOf(A.name)==-1&&h.indexOf(A.name)==-1&&x.push(A.name)}})});r==S.name&&(S.implicitWs=!1),S.implicitWs&&x.indexOf(r)==-1&&x.push(r),S.recover&&x.indexOf(S.recover)==-1&&x.push(S.recover)}),x.forEach(S=>{S in this.cachedRules||y.push("Missing rule "+S)}),y.length)throw new Error(y.join(` `))}getAST(g,b){b||(b=this.grammarRules.filter(x=>!x.fragment&&x.name.indexOf("%")!=0)[0].name);let y=this.parse(g,b);if(y){u(y.errors,y),l(y,0),d(y,/^%/),(!this.options||!this.options.keepUpperRules)&&d(y,t);let x=y.rest;x&&new i.TokenError(`Unexpected end of input: `+x,y),a(y),y.rest=x}return y}emitSource(){return"CANNOT EMIT SOURCE FROM BASE Parser"}parse(g,b,y=0){let x=null,S=c(b),E,C=this.debug&&!t.test(S.name);C&&console.log(new Array(y).join("│ ")+"Trying to get "+b+" from "+JSON.stringify(g.split(` -`)[0]));let w=S.name,A=f(S.name,this);if(S.name=="EOF"){if(g.length)return null;if(g.length==0)return{type:"EOF",text:"",rest:"",start:0,end:0,fullText:"",errors:[],children:[],parent:null}}try{if(!A&&S.isLiteral){let _=S.name.trim();if(_.startsWith('"')?_=JSON.parse(_):_.startsWith("'")&&(_=_.replace(/^'(.+)'$/,"$1").replace(/\\'/g,"'")),_==="")return{type:"%%EMPTY%%",text:"",rest:g,start:0,end:0,fullText:"",errors:[],children:[],parent:null};E=new RegExp(o(_)),w=null}}catch(_){return _ instanceof ReferenceError&&console.error(_),null}if(E){let _=s(g,E);if(_)return _.type=w,_}else{let _=A.bnf;_ instanceof Array&&_.forEach(D=>{if(x)return;let I=null,N={type:S.name,text:"",children:[],end:0,errors:[],fullText:"",parent:null,start:0,rest:g};A.fragment&&(N.fragment=!0);let P=g,R=0,F=D.length>0,V=!1;for(let B=0;B{se.start+=R,se.end+=R,se.parent=N,N.children.push(se)}):(H.parent=N,N.children.push(H))),G.lookup&&(H.lookup=!0),C&&console.log(new Array(y+1).join("│ ")+"└─ "+H.type+" "+JSON.stringify(H.text)),!G.lookup&&!H.lookup&&(N.text=N.text+H.text,N.end=N.text.length,P=P.substr(H.text.length),R+=H.text.length),N.rest=P}while(H&&G.allowRepetition&&P.length&&!H.lookup)}else{let G=s(P,D[B]);if(!G)return;C&&console.log(new Array(y+1).join("│ ")+"└> "+JSON.stringify(G.text)+D[B].source),V=!0,G.start+=R,G.end+=R,N.text=N.text+G.text,N.end=N.text.length,P=P.substr(G.text.length),R+=G.text.length,N.rest=P}V&&(x=N,C&&console.log(new Array(y).join("│ ")+"├<─┴< PUSHING "+x.type+" "+JSON.stringify(x.text)))}),x&&A.simplifyWhenOneChildren&&x.children.length==1&&(x=x.children[0])}return x||C&&console.log(b+" NOT RESOLVED FROM "+g),x}parseRecovery(g,b,y){if(g.recover&&b.length){let x=this.debug;x&&console.log(new Array(y+1).join("│ ")+"Trying to recover until token "+g.recover+" from "+JSON.stringify(b.split(` +`)[0]));let w=S.name,A=f(S.name,this);if(S.name=="EOF"){if(g.length)return null;if(g.length==0)return{type:"EOF",text:"",rest:"",start:0,end:0,fullText:"",errors:[],children:[],parent:null}}try{if(!A&&S.isLiteral){let _=S.name.trim();if(_.startsWith('"')?_=JSON.parse(_):_.startsWith("'")&&(_=_.replace(/^'(.+)'$/,"$1").replace(/\\'/g,"'")),_==="")return{type:"%%EMPTY%%",text:"",rest:g,start:0,end:0,fullText:"",errors:[],children:[],parent:null};E=new RegExp(o(_)),w=null}}catch(_){return _ instanceof ReferenceError&&console.error(_),null}if(E){let _=s(g,E);if(_)return _.type=w,_}else{let _=A.bnf;_ instanceof Array&&_.forEach(O=>{if(x)return;let I=null,N={type:S.name,text:"",children:[],end:0,errors:[],fullText:"",parent:null,start:0,rest:g};A.fragment&&(N.fragment=!0);let P=g,R=0,F=O.length>0,V=!1;for(let B=0;B{se.start+=R,se.end+=R,se.parent=N,N.children.push(se)}):(H.parent=N,N.children.push(H))),G.lookup&&(H.lookup=!0),C&&console.log(new Array(y+1).join("│ ")+"└─ "+H.type+" "+JSON.stringify(H.text)),!G.lookup&&!H.lookup&&(N.text=N.text+H.text,N.end=N.text.length,P=P.substr(H.text.length),R+=H.text.length),N.rest=P}while(H&&G.allowRepetition&&P.length&&!H.lookup)}else{let G=s(P,O[B]);if(!G)return;C&&console.log(new Array(y+1).join("│ ")+"└> "+JSON.stringify(G.text)+O[B].source),V=!0,G.start+=R,G.end+=R,N.text=N.text+G.text,N.end=N.text.length,P=P.substr(G.text.length),R+=G.text.length,N.rest=P}V&&(x=N,C&&console.log(new Array(y).join("│ ")+"├<─┴< PUSHING "+x.type+" "+JSON.stringify(x.text)))}),x&&A.simplifyWhenOneChildren&&x.children.length==1&&(x=x.children[0])}return x||C&&console.log(b+" NOT RESOLVED FROM "+g),x}parseRecovery(g,b,y){if(g.recover&&b.length){let x=this.debug;x&&console.log(new Array(y+1).join("│ ")+"Trying to recover until token "+g.recover+" from "+JSON.stringify(b.split(` `)[0]+b.split(` -`)[1]));let S={type:"SyntaxError",text:"",children:[],end:0,errors:[],fullText:"",parent:null,start:0,rest:""},E;do if(E=this.parse(b,g.recover,y+1),E){new i.TokenError('Unexpected input: "'+S.text+`" Expecting: ${g.name}`,S);break}else S.text=S.text+b[0],S.end=S.text.length,b=b.substr(1);while(!E&&b.length>0);if(S.text.length>0&&E)return x&&console.log(new Array(y+1).join("│ ")+"Recovered text: "+JSON.stringify(S.text)),S}return null}}return Qn.Parser=p,Qn.default=p,Qn}var ME;function $j(){if(ME)return jd;ME=1,Object.defineProperty(jd,"__esModule",{value:!0});const t=Bj();var e;return(function(n){n.RULES=[{name:"Grammar",bnf:[["RULE_S*","%Atomic*","EOF"]]},{name:"%Atomic",bnf:[["Production","RULE_S*"]],fragment:!0},{name:"Production",bnf:[["NCName","RULE_S*",'"::="',"RULE_WHITESPACE*","Choice","RULE_WHITESPACE*","RULE_EOL+","RULE_S*"]]},{name:"NCName",bnf:[[/[a-zA-Z][a-zA-Z_0-9]*/]]},{name:"Choice",bnf:[["SequenceOrDifference","%_Choice_1*"]],fragment:!0},{name:"%_Choice_1",bnf:[["RULE_WHITESPACE*",'"|"',"RULE_WHITESPACE*","SequenceOrDifference"]],fragment:!0},{name:"SequenceOrDifference",bnf:[["Item","RULE_WHITESPACE*","%_Item_1?"]]},{name:"%_Item_1",bnf:[["Minus","Item"],["Item*"]],fragment:!0},{name:"Minus",bnf:[['"-"']]},{name:"Item",bnf:[["RULE_WHITESPACE*","%Primary","PrimaryDecoration?"]],fragment:!0},{name:"PrimaryDecoration",bnf:[['"?"'],['"*"'],['"+"']]},{name:"DecorationName",bnf:[['"ebnf://"',/[^\x5D#]+/]]},{name:"%Primary",bnf:[["NCName"],["StringLiteral"],["CharCode"],["CharClass"],["SubItem"]],fragment:!0},{name:"SubItem",bnf:[['"("',"RULE_WHITESPACE*","Choice","RULE_WHITESPACE*",'")"']]},{name:"StringLiteral",bnf:[[`'"'`,/[^"]*/,`'"'`],[`"'"`,/[^']*/,`"'"`]],pinned:1},{name:"CharCode",bnf:[['"#x"',/[0-9a-zA-Z]+/]]},{name:"CharClass",bnf:[["'['","'^'?","%RULE_CharClass_1+",'"]"']]},{name:"%RULE_CharClass_1",bnf:[["CharCodeRange"],["CharRange"],["CharCode"],["RULE_Char"]],fragment:!0},{name:"RULE_Char",bnf:[[/\x09/],[/\x0A/],[/\x0D/],[/[\x20-\x5c]/],[/[\x5e-\uD7FF]/],[/[\uE000-\uFFFD]/]]},{name:"CharRange",bnf:[["RULE_Char",'"-"',"RULE_Char"]]},{name:"CharCodeRange",bnf:[["CharCode",'"-"',"CharCode"]]},{name:"RULE_WHITESPACE",bnf:[["%RULE_WHITESPACE_CHAR*"],["Comment","RULE_WHITESPACE*"]]},{name:"RULE_S",bnf:[["RULE_WHITESPACE","RULE_S*"],["RULE_EOL","RULE_S*"]]},{name:"%RULE_WHITESPACE_CHAR",bnf:[[/\x09/],[/\x20/]],fragment:!0},{name:"Comment",bnf:[['"/*"',"%RULE_Comment_Body*",'"*/"']]},{name:"%RULE_Comment_Body",bnf:[['!"*/"',/[^*]/]],fragment:!0},{name:"RULE_EOL",bnf:[[/\x0D/,/\x0A/],[/\x0A/],[/\x0D/]]},{name:"Link",bnf:[["'['","Url","']'"]]},{name:"Url",bnf:[[/[^\x5D:/?#]/,'"://"',/[^\x5D#]+/,"%Url1?"]]},{name:"%Url1",bnf:[['"#"',"NCName"]],fragment:!0}],n.defaultParser=new t.Parser(n.RULES,{debug:!1});const r=/^(!|&)/,i=/(\?|\+|\*)$/,s=/^%/;function o(x,S){if(typeof x=="string"){if(r.test(x))return"";if(s.test(x)){let C=i.exec(x),w=C?C[0]+" ":"";return a(x,S)?u(x,S)+w:"("+u(x,S)+")"+w}return x}else return x.source.replace(/\\(?:x|u)([a-zA-Z0-9]+)/g,"#x$1").replace(/\[\\(?:x|u)([a-zA-Z0-9]+)-\\(?:x|u)([a-zA-Z0-9]+)\]/g,"[#x$1-#x$2]")}function a(x,S){let E=t.findRuleByName(x,S);return E&&E.bnf.length==1&&E.bnf[0].length==1&&(E.bnf[0][0]instanceof RegExp||E.bnf[0][0][0]=='"'||E.bnf[0][0][0]=="'")}function l(x,S){return x.map(E=>o(E,S)).join(" ")}function u(x,S){let E=t.findRuleByName(x,S);return E?E.bnf.map(C=>l(C,S)).join(" | "):"RULE_NOT_FOUND {"+x+"}"}function c(x){let S=[];return x.grammarRules.forEach(E=>{if(!/^%/.test(E.name)){let C=E.recover?" /* { recoverUntil="+E.recover+" } */":"";S.push(E.name+" ::= "+u(E.name,x)+C)}}),S.join(` -`)}n.emit=c;let f=0;function d(x,S){throw console.log("reberia restar "+S+" a "+x),new Error("Difference not supported yet")}function h(x){return new RegExp(x.replace(/#x([a-zA-Z0-9]{4})/g,"\\u$1").replace(/#x([a-zA-Z0-9]{3})/g,"\\u0$1").replace(/#x([a-zA-Z0-9]{2})/g,"\\x$1").replace(/#x([a-zA-Z0-9]{1})/g,"\\x0$1"))}function p(x,S,E){let C=null,w=[];return S.children.forEach((A,_)=>{A.type=="Minus"&&d(C,A);let D=S.children[_+1];D=D&&D.type=="PrimaryDecoration"&&D.text||"";let I="";switch(A.type){case"SubItem":let N="%"+(E+f++);m(x,A,N),w.push(I+N+D);break;case"NCName":case"StringLiteral":w.push(I+A.text+D);break;case"CharCode":case"CharClass":if(D||I){let P={name:"%"+(E+f++),bnf:[[h(A.text)]]};x.push(P),w.push(I+P.name+D)}else w.push(h(A.text));break;case"PrimaryDecoration":break;default:throw new Error(" HOW SHOULD I PARSE THIS? "+A.type+" -> "+JSON.stringify(A.text))}C=A}),w}function m(x,S,E){let C=S.children.filter(_=>_.type=="SequenceOrDifference").map(_=>p(x,_,E)),w={name:E,bnf:C},A=null;C.forEach(_=>{A=A||_.recover,delete _.recover}),E.indexOf("%")==0&&(w.fragment=!0),A&&(w.recover=A),x.push(w)}function g(x,S=n.defaultParser){let E=S.getAST(x);if(!E)throw new Error("Could not parse "+x);if(E.errors&&E.errors.length)throw E.errors[0];let C=[];return E.children.filter(w=>w.type=="Production").map(w=>{let A=w.children.filter(_=>_.type=="NCName")[0].text;m(C,w,A)}),C}n.getRules=g;function b(x,S=n.defaultParser){return g(x.join(""),S)}n.Transform=b;class y extends t.Parser{constructor(S,E){const C=E&&E.debugRulesParser===!0?new t.Parser(n.RULES,{debug:!0}):n.defaultParser;super(g(S,C),E)}emitSource(){return c(this)}}n.Parser=y})(e||(e={})),jd.default=e,jd}var zj=$j();const jj=Ta(zj),Vj="[^?/{}*,()#]+",Uj=` +`)[1]));let S={type:"SyntaxError",text:"",children:[],end:0,errors:[],fullText:"",parent:null,start:0,rest:""},E;do if(E=this.parse(b,g.recover,y+1),E){new i.TokenError('Unexpected input: "'+S.text+`" Expecting: ${g.name}`,S);break}else S.text=S.text+b[0],S.end=S.text.length,b=b.substr(1);while(!E&&b.length>0);if(S.text.length>0&&E)return x&&console.log(new Array(y+1).join("│ ")+"Recovered text: "+JSON.stringify(S.text)),S}return null}}return Qn.Parser=p,Qn.default=p,Qn}var FE;function jj(){if(FE)return Vd;FE=1,Object.defineProperty(Vd,"__esModule",{value:!0});const t=zj();var e;return(function(n){n.RULES=[{name:"Grammar",bnf:[["RULE_S*","%Atomic*","EOF"]]},{name:"%Atomic",bnf:[["Production","RULE_S*"]],fragment:!0},{name:"Production",bnf:[["NCName","RULE_S*",'"::="',"RULE_WHITESPACE*","Choice","RULE_WHITESPACE*","RULE_EOL+","RULE_S*"]]},{name:"NCName",bnf:[[/[a-zA-Z][a-zA-Z_0-9]*/]]},{name:"Choice",bnf:[["SequenceOrDifference","%_Choice_1*"]],fragment:!0},{name:"%_Choice_1",bnf:[["RULE_WHITESPACE*",'"|"',"RULE_WHITESPACE*","SequenceOrDifference"]],fragment:!0},{name:"SequenceOrDifference",bnf:[["Item","RULE_WHITESPACE*","%_Item_1?"]]},{name:"%_Item_1",bnf:[["Minus","Item"],["Item*"]],fragment:!0},{name:"Minus",bnf:[['"-"']]},{name:"Item",bnf:[["RULE_WHITESPACE*","%Primary","PrimaryDecoration?"]],fragment:!0},{name:"PrimaryDecoration",bnf:[['"?"'],['"*"'],['"+"']]},{name:"DecorationName",bnf:[['"ebnf://"',/[^\x5D#]+/]]},{name:"%Primary",bnf:[["NCName"],["StringLiteral"],["CharCode"],["CharClass"],["SubItem"]],fragment:!0},{name:"SubItem",bnf:[['"("',"RULE_WHITESPACE*","Choice","RULE_WHITESPACE*",'")"']]},{name:"StringLiteral",bnf:[[`'"'`,/[^"]*/,`'"'`],[`"'"`,/[^']*/,`"'"`]],pinned:1},{name:"CharCode",bnf:[['"#x"',/[0-9a-zA-Z]+/]]},{name:"CharClass",bnf:[["'['","'^'?","%RULE_CharClass_1+",'"]"']]},{name:"%RULE_CharClass_1",bnf:[["CharCodeRange"],["CharRange"],["CharCode"],["RULE_Char"]],fragment:!0},{name:"RULE_Char",bnf:[[/\x09/],[/\x0A/],[/\x0D/],[/[\x20-\x5c]/],[/[\x5e-\uD7FF]/],[/[\uE000-\uFFFD]/]]},{name:"CharRange",bnf:[["RULE_Char",'"-"',"RULE_Char"]]},{name:"CharCodeRange",bnf:[["CharCode",'"-"',"CharCode"]]},{name:"RULE_WHITESPACE",bnf:[["%RULE_WHITESPACE_CHAR*"],["Comment","RULE_WHITESPACE*"]]},{name:"RULE_S",bnf:[["RULE_WHITESPACE","RULE_S*"],["RULE_EOL","RULE_S*"]]},{name:"%RULE_WHITESPACE_CHAR",bnf:[[/\x09/],[/\x20/]],fragment:!0},{name:"Comment",bnf:[['"/*"',"%RULE_Comment_Body*",'"*/"']]},{name:"%RULE_Comment_Body",bnf:[['!"*/"',/[^*]/]],fragment:!0},{name:"RULE_EOL",bnf:[[/\x0D/,/\x0A/],[/\x0A/],[/\x0D/]]},{name:"Link",bnf:[["'['","Url","']'"]]},{name:"Url",bnf:[[/[^\x5D:/?#]/,'"://"',/[^\x5D#]+/,"%Url1?"]]},{name:"%Url1",bnf:[['"#"',"NCName"]],fragment:!0}],n.defaultParser=new t.Parser(n.RULES,{debug:!1});const r=/^(!|&)/,i=/(\?|\+|\*)$/,s=/^%/;function o(x,S){if(typeof x=="string"){if(r.test(x))return"";if(s.test(x)){let C=i.exec(x),w=C?C[0]+" ":"";return a(x,S)?u(x,S)+w:"("+u(x,S)+")"+w}return x}else return x.source.replace(/\\(?:x|u)([a-zA-Z0-9]+)/g,"#x$1").replace(/\[\\(?:x|u)([a-zA-Z0-9]+)-\\(?:x|u)([a-zA-Z0-9]+)\]/g,"[#x$1-#x$2]")}function a(x,S){let E=t.findRuleByName(x,S);return E&&E.bnf.length==1&&E.bnf[0].length==1&&(E.bnf[0][0]instanceof RegExp||E.bnf[0][0][0]=='"'||E.bnf[0][0][0]=="'")}function l(x,S){return x.map(E=>o(E,S)).join(" ")}function u(x,S){let E=t.findRuleByName(x,S);return E?E.bnf.map(C=>l(C,S)).join(" | "):"RULE_NOT_FOUND {"+x+"}"}function c(x){let S=[];return x.grammarRules.forEach(E=>{if(!/^%/.test(E.name)){let C=E.recover?" /* { recoverUntil="+E.recover+" } */":"";S.push(E.name+" ::= "+u(E.name,x)+C)}}),S.join(` +`)}n.emit=c;let f=0;function d(x,S){throw console.log("reberia restar "+S+" a "+x),new Error("Difference not supported yet")}function h(x){return new RegExp(x.replace(/#x([a-zA-Z0-9]{4})/g,"\\u$1").replace(/#x([a-zA-Z0-9]{3})/g,"\\u0$1").replace(/#x([a-zA-Z0-9]{2})/g,"\\x$1").replace(/#x([a-zA-Z0-9]{1})/g,"\\x0$1"))}function p(x,S,E){let C=null,w=[];return S.children.forEach((A,_)=>{A.type=="Minus"&&d(C,A);let O=S.children[_+1];O=O&&O.type=="PrimaryDecoration"&&O.text||"";let I="";switch(A.type){case"SubItem":let N="%"+(E+f++);m(x,A,N),w.push(I+N+O);break;case"NCName":case"StringLiteral":w.push(I+A.text+O);break;case"CharCode":case"CharClass":if(O||I){let P={name:"%"+(E+f++),bnf:[[h(A.text)]]};x.push(P),w.push(I+P.name+O)}else w.push(h(A.text));break;case"PrimaryDecoration":break;default:throw new Error(" HOW SHOULD I PARSE THIS? "+A.type+" -> "+JSON.stringify(A.text))}C=A}),w}function m(x,S,E){let C=S.children.filter(_=>_.type=="SequenceOrDifference").map(_=>p(x,_,E)),w={name:E,bnf:C},A=null;C.forEach(_=>{A=A||_.recover,delete _.recover}),E.indexOf("%")==0&&(w.fragment=!0),A&&(w.recover=A),x.push(w)}function g(x,S=n.defaultParser){let E=S.getAST(x);if(!E)throw new Error("Could not parse "+x);if(E.errors&&E.errors.length)throw E.errors[0];let C=[];return E.children.filter(w=>w.type=="Production").map(w=>{let A=w.children.filter(_=>_.type=="NCName")[0].text;m(C,w,A)}),C}n.getRules=g;function b(x,S=n.defaultParser){return g(x.join(""),S)}n.Transform=b;class y extends t.Parser{constructor(S,E){const C=E&&E.debugRulesParser===!0?new t.Parser(n.RULES,{debug:!0}):n.defaultParser;super(g(S,C),E)}emitSource(){return c(this)}}n.Parser=y})(e||(e={})),Vd.default=e,Vd}var Vj=jj();const Uj=Ta(Vj),Hj="[^?/{}*,()#]+",qj=` root ::= ("#" recursion | recursion | (query | pattern) recursion* | "#" SEP? | SEP) recursion ::= (SEP query | pattern)* query ::= (ESC escaped ESC | property | all | any | regex) typecheck? lookahead? -property ::= ${Vj} +property ::= ${Hj} regex ::= "{" [^}]+ "}" SEP ::= "/" all ::= "**" @@ -211,7 +211,7 @@ quantifier ::= "+" | "*" | [0-9]+ orPattern ::= S? "," S? S ::= [ ]* -`,Hj=new jj.Parser(Uj),qj=t=>Hj.getAST(t),rr=0,Nl=3,$p=(t,e)=>`${t}/${e}`,j3=Object.prototype.toString,Gj=/Object|Array/,Gb=t=>Gj.test(j3.call(t)),Wj=t=>j3.call(t).match(/\s([^\]]+)\]/).pop().toLowerCase();function V3(t){return new RegExp(t.text.replace(/(^{|}$)/g,""))}function Kj(t,e){Array.isArray(t)?t.forEach(e):Object.prototype.toString.call(t)==="[object Object]"&&Object.keys(t).forEach(function(n){e(t[n],n,t)})}function FE(t){return Array.isArray(t)?t.map(function(e,n){return`${n}`}):Object.prototype.toString.call(t)==="[object Object]"?Object.keys(t):[]}const ro={mem:[],get(t,e){const n=t[rr][e];if(!ro.mem.includes(n))return Gb(n)&&ro.mem.push(n),[n,e,t[rr],$p(t[Nl],e)]},reset(){ro.mem.length=0}},Wb={any(t,e){const n=e[rr];return FE(n).map(r=>[n[r],r,n,$p(e[Nl],r)])},all(t,e){const n=[e];return Kj(e[rr],(r,i)=>{const s=ro.get(e,i);s&&n.push(...Wb.all(t,s))}),n},regex(t,e){const n=V3(t),r=e[rr];return FE(r).filter(i=>n.test(i)).map(i=>[r[i],i,r,$p(e[Nl],i)])}},zp={escaped:(t,e)=>zp.property(t,e),property:(t,e)=>{const n=t.text;if(e[rr]&&e[rr][n]!==void 0)return[e[rr][n],n,e[rr],$p(e[Nl],n)]},typecheck:(t,e)=>{const n=t.text.replace(/^\?:/,"");if(n==="value")return Gb(e[rr])?void 0:e;if(Wj(e[rr])===n)return e},lookahead:(t,e)=>{let n=!0,r=!1;return t.children.forEach(i=>{if(i.type==="expression"){const s=zp.expression(i,e)!==void 0;n=r===!0?n||s:n&&s}else r=i.type==="orExpr"}),n?e:void 0},expression:(t,e)=>{const n=t.children[0].text,r=t.children[1],i=t.children[2],s=e[rr];if(Gb(s)!==!1)return Xj(s[n],r,i)?e:void 0}};function Xj(t,e,n){if(e===void 0)return t!==void 0;let r;const i=`${t}`;return n.type==="regex"?r=V3(n).test(i):r=i===n.text,e.type==="isnot"&&(r=r===!1&&t!==void 0),r}function Yj(t,e,n,r){const i=[];for(let s=0,o=e.length;s{if(Wb[i.type])r=Yj(Wb[i.type],r,i,n);else if(zp[i.type])r=Jj(zp[i.type],r,i,n);else throw new Error(`Unknown filter ${i.type}`)}),r}function Qj(t,e,n){const r=[];let i=t;return e.children.forEach(s=>{if(s.type==="orPattern"){r.push(...i),i=t;return}i=Xv(i,s,n)}),r.push(...i),r}function eV(t){if(t==null)return 1;if(t==="*"||t==="+")return 1/0;const e=parseInt(t);return isNaN(e)?1:e}function tV(t,e,n){const r=[],i=e.children.find(l=>l.type==="quantifier"),s=eV(i&&i.text);let o=t;i&&i.text==="*"&&r.push(...o);let a=0;for(;o.length>0&&ar=Xv(r,i,n)),r}function Xv(t,e,n){let r;return e.type==="query"?r=Zj(t,e,n):e.type==="pattern"?r=tV(t,e,n):r=nV(t,e,n),ro.reset(),ro.mem.push(t),r}function rV(t,e){return ro.reset(),ro.mem.push(t),Xv([[t,null,null,"#"]],e)}const LE={value:t=>t.map(e=>e[rr]),pointer:t=>t.map(e=>e[Nl]),all:t=>t,map:t=>{const e={};return t.forEach(n=>e[n[Nl]]=n[rr]),e}};var pa;(function(t){t.POINTER="pointer",t.VALUE="value",t.ALL="all",t.MAP="map"})(pa||(pa={}));Vf.POINTER=pa.POINTER;Vf.VALUE=pa.VALUE;Vf.ALL=pa.ALL;Vf.MAP=pa.MAP;function Vf(t,e,n=pa.VALUE){if(e==null)return[];e=e.replace(/(\/$)/g,""),e===""&&(e="#");const r=qj(e);if(r==null)throw new Error(`empty ast for '${e}'`);if(r.rest!=="")throw new Error(`Failed parsing queryString from: '${r.rest}'`);const i=rV(t,r);return typeof n=="function"?i.map(s=>n(...s)):LE[n]?LE[n](i):i}var jp;(function(t){t.REPLACE_ITEMS="replace",t.INSERT_ITEMS="insert"})(jp||(jp={}));jp.REPLACE_ITEMS;jp.INSERT_ITEMS;const us={$ref:{type:!1},allOf:{type:!1,definitions:["allOf/*"]},anyOf:{type:!1,definitions:["anyOf/*"]},array:{type:!0,definitions:["allOf/*","anyOf/*","oneOf/*","not","items","items/*","additionalItems"],validationKeywords:["minItems","maxItems","uniqueItems"],keywords:["items","additionalItems","minItems","maxItems","uniqueItems"]},boolean:{type:!0},enum:{type:!1},integer:{type:!0,definitions:["allOf/*","anyOf/*","oneOf/*","not"],validationKeywords:["minimum","maximum","multipleOf"]},not:{type:!1,definitions:["not"]},number:{type:!0,definitions:["allOf/*","anyOf/*","oneOf/*","not"],validationKeywords:["minimum","maximum","multipleOf"]},null:{type:!0},object:{type:!0,definitions:["allOf/*","anyOf/*","oneOf/*","not","properties/*","additionalProperties","patternProperties/*","dependencies/*"],validationKeywords:["minProperties","maxProperties","required"],keywords:["properties","additionalProperties","patternProperties","dependencies","minProperties","maxProperties","required"]},oneOf:{type:!1,definitions:["oneOf/*"]},string:{type:!0,definitions:["allOf/*","anyOf/*","oneOf/*","not"],validationKeywords:["minLength","maxLength","pattern"]}},iV=Object.keys(us).filter(t=>us[t].type===!1),BE=Object.prototype.hasOwnProperty;function $E(t){if(no(t)===!1)return;if(t.enum)return"enum";const e=t.type;if(Array.isArray(e)||us[e])return e;const n=iV.filter(r=>t[r]);if(n.length===1)return n[0];if(n.length===0){for(let r=0,i=us.object.keywords.length;r{Vf(t,i,(s,o,a,l)=>{no(s)&&$E(s)&&e.push({pointer:Yc.join(Yc.split(l),!1),def:s})})}),e}function oV(t,e){if(this.callback(t,e)===!0)return;sV(t).forEach(r=>this.nextTypeDefs(r.def,Yc.join(e,r.pointer,!1)))}function Vd(t,e,n,r="definitions"){const i=e[r];Object.keys(i).forEach(s=>{if(i[s]===!1||no(i[s])){t.nextTypeDefs(i[s],Yc.join(n,r,s,!1));return}})}function sm(t,e,n="#"){const r={callback:e,nextTypeDefs:oV};r.nextTypeDefs(t,n),t.definitions!=null&&(r.callback=(i,s)=>{e(i,s),i.definitions!=null&&Vd(r,i,s)},Vd(r,t,n)),t.$defs!=null&&(r.callback=(i,s)=>{e(i,s),i.definitions!=null&&Vd(r,i,s)},Vd(r,t,n,"$defs"))}const aV=/(#|\/)+$/,Ud=/#$/,lV=/^[^:]+:\/\/[^/]+\//,uV=/\/[^/]*$/,cV=/#.*$/;function Vp(t,e){return t==null&&e==null?"#":e==null?t.replace(Ud,""):t==null?e.replace(Ud,""):e[0]==="#"?`${t.replace(cV,"")}${e.replace(aV,"")}`:lV.test(e)?e.replace(Ud,""):`${t.replace(uV,"")}/${e.replace(Ud,"")}`}const Fu=/(#|\/)+$/g,fV=["",null,"#"];function dV(t){if(fV.includes(t))return[];if(t=t.replace(Fu,""),t.indexOf("#")===-1)return[t.replace(Fu,"")];if(t.indexOf("#")===0)return[t.replace(Fu,"")];const e=t.split("#");return e[0]=e[0].replace(Fu,""),e[1]=`#${e[1].replace(Fu,"")}`,e}const hV=/(#|\/)+$/g,pV=t=>tt(t)==="object";function is(t,e,n){if(pV(n)&&(n=n.__ref||n.$ref),n==null)return e;let r;const i=n.replace(hV,"");if(t.remotes[i])return r=t.remotes[i],r&&r.$ref?is(t,e,r.$ref):r;if(t.ids[n])return r=Go.get(e,t.ids[n]),r&&r.$ref?is(t,e,r.$ref):r;const s=dV(n);if(s.length===0)return e;if(s.length===1){if(n=s[0],t.remotes[n])return r=t.remotes[n],is(t,e,r.$ref);if(t.ids[n])return r=Go.get(e,t.ids[n]),r&&r.$ref?is(t,e,r.$ref):r}if(s.length===2){const o=s[0];if(n=s[1],t.remotes[o])return t.remotes[o].getRef?t.remotes[o].getRef(n):is(t,t.remotes[o],n);if(t.ids[o])return is(t,Go.get(e,t.ids[o]),n)}return r=Go.get(e,t.ids[n]||n),r&&r.$ref?is(t,e,r.$ref):r}const zE="__compiled",jE="__ref",mV="getRef",gV="getRoot",bV=/(#|\/)+$/g;function yV(t,e,n=e,r=!1){if(!e||e[zE]!==void 0)return e;const i={ids:{},remotes:t.remotes},s=JSON.stringify(e),o=JSON.parse(s);if(Object.defineProperty(o,zE,{enumerable:!1,value:!0}),Object.defineProperty(o,mV,{enumerable:!1,value:is.bind(null,i,o)}),r===!1&&s.includes("$ref")===!1)return o;e!==n&&Object.defineProperty(o,"definitions",{enumerable:!1,value:Object.assign({},n.definitions,n.$defs,e.definitions,e.$defs)});const a={},l=()=>o;return sm(o,(u,c)=>{var f;if(u.id){if(u.id.startsWith("http")&&/(allOf|anyOf|oneOf)\/\d+$/.test(c)){const g=c.replace(/\/(allOf|anyOf|oneOf)\/\d+$/,""),b=Go.get(o,g);u.id=(f=b.id)!==null&&f!==void 0?f:u.id}i.ids[u.id.replace(bV,"")]=c}c=`#${c}`.replace(/##+/,"#");const d=c.replace(/\/[^/]+$/,""),h=c.replace(/\/[^/]+\/[^/]+$/,""),p=a[d]||a[h],m=Vp(p,u.id);a[c]=m,i.ids[m]==null&&(i.ids[m]=c),u.$ref&&!u[jE]&&(Object.defineProperty(u,jE,{enumerable:!1,value:Vp(m,u.$ref)}),Object.defineProperty(u,gV,{enumerable:!1,value:l}))}),o}function U3(t,e,n,r=t.rootSchema,i="#"){r=t.resolveRef(r),n(r,e,i);const s=tt(e);s==="object"?Object.keys(e).forEach(o=>{const a=t.step(o,r,e,i),l=e[o];t.each(l,n,a,`${i}/${o}`)}):s==="array"&&e.forEach((o,a)=>{const l=t.step(a,r,e,i);t.each(o,n,l,`${i}/${a}`)})}const H3={additionalItemsError:xe("AdditionalItemsError"),additionalPropertiesError:xe("AdditionalPropertiesError"),anyOfError:xe("AnyOfError"),allOfError:xe("AllOfError"),constError:xe("ConstError"),containsError:xe("ContainsError"),containsArrayError:xe("ContainsArrayError"),containsAnyError:xe("ContainsAnyError"),enumError:xe("EnumError"),forbiddenPropertyError:xe("ForbiddenPropertyError"),formatURLError:xe("FormatURLError"),formatURIError:xe("FormatURIError"),formatURIReferenceError:xe("FormatURIReferenceError"),formatURITemplateError:xe("FormatURITemplateError"),formatDateError:xe("FormatDateError"),formatDateTimeError:xe("FormatDateTimeError"),formatEmailError:xe("FormatEmailError"),formatHostnameError:xe("FormatHostnameError"),formatIPV4Error:xe("FormatIPV4Error"),formatIPV4LeadingZeroError:xe("FormatIPV4LeadingZeroError"),formatIPV6Error:xe("FormatIPV6Error"),formatIPV6LeadingZeroError:xe("FormatIPV6LeadingZeroError"),formatJsonPointerError:xe("FormatJsonPointerError"),formatRegExError:xe("FormatRegExError"),formatTimeError:xe("FormatTimeError"),invalidSchemaError:xe("InvalidSchemaError"),invalidDataError:xe("InvalidDataError"),invalidTypeError:xe("InvalidTypeError"),invalidPropertyNameError:xe("InvalidPropertyNameError"),maximumError:xe("MaximumError"),maxItemsError:xe("MaxItemsError"),maxLengthError:xe("MaxLengthError"),maxPropertiesError:xe("MaxPropertiesError"),minimumError:xe("MinimumError"),minItemsError:xe("MinItemsError"),minItemsOneError:xe("MinItemsOneError"),minLengthError:xe("MinLengthError"),minLengthOneError:xe("MinLengthOneError"),minPropertiesError:xe("MinPropertiesError"),missingDependencyError:xe("MissingDependencyError"),missingOneOfPropertyError:xe("MissingOneOfPropertyError"),multipleOfError:xe("MultipleOfError"),multipleOneOfError:xe("MultipleOneOfError"),noAdditionalPropertiesError:xe("NoAdditionalPropertiesError"),notError:xe("NotError"),oneOfError:xe("OneOfError"),oneOfPropertyError:xe("OneOfPropertyError"),patternError:xe("PatternError"),patternPropertiesError:xe("PatternPropertiesError"),requiredPropertyError:xe("RequiredPropertyError"),schemaWarning:xe("SchemaWarning"),typeError:xe("TypeError"),undefinedValueError:xe("UndefinedValueError"),uniqueItemsError:xe("UniqueItemsError"),unknownPropertyError:xe("UnknownPropertyError"),valueNotEmptyError:xe("ValueNotEmptyError")};var $g={exports:{}},VE;function vV(){return VE||(VE=1,(function(t){(function(e){e.exports.is_uri=r,e.exports.is_http_uri=i,e.exports.is_https_uri=s,e.exports.is_web_uri=o,e.exports.isUri=r,e.exports.isHttpUri=i,e.exports.isHttpsUri=s,e.exports.isWebUri=o;var n=function(a){var l=a.match(/(?:([^:\/?#]+):)?(?:\/\/([^\/?#]*))?([^?#]*)(?:\?([^#]*))?(?:#(.*))?/);return l};function r(a){if(a&&!/[^a-z0-9\:\/\?\#\[\]\@\!\$\&\'\(\)\*\+\,\;\=\.\-\_\~\%]/i.test(a)&&!/%[^0-9a-f]/i.test(a)&&!/%[0-9a-f](:?[^0-9a-f]|$)/i.test(a)){var l=[],u="",c="",f="",d="",h="",p="";if(l=n(a),u=l[1],c=l[2],f=l[3],d=l[4],h=l[5],!!(u&&u.length&&f.length>=0)){if(c&&c.length){if(!(f.length===0||/^\//.test(f)))return}else if(/^\/\//.test(f))return;if(/^[a-z][a-z0-9\+\-\.]*$/.test(u.toLowerCase()))return p+=u+":",c&&c.length&&(p+="//"+c),p+=f,d&&d.length&&(p+="?"+d),h&&h.length&&(p+="#"+h),p}}}function i(a,l){if(r(a)){var u=[],c="",f="",d="",h="",p="",m="",g="";if(u=n(a),c=u[1],f=u[2],d=u[3],p=u[4],m=u[5],!!c){if(l){if(c.toLowerCase()!="https")return}else if(c.toLowerCase()!="http")return;if(f)return/:(\d+)$/.test(f)&&(h=f.match(/:(\d+)$/)[0],f=f.replace(/:\d+$/,"")),g+=c+":",g+="//"+f,h&&(g+=h),g+=d,p&&p.length&&(g+="?"+p),m&&m.length&&(g+="#"+m),g}}}function s(a){return i(a,!0)}function o(a){return i(a)||s(a)}})(t)})($g)),$g.exports}var xV=vV();const UE=Ta(xV);var Fn={},$h={exports:{}},SV=$h.exports,HE;function EV(){return HE||(HE=1,(function(t){(function(e,n){t.exports?t.exports=n():e.nearley=n()})(SV,function(){function e(u,c,f){return this.id=++e.highestId,this.name=u,this.symbols=c,this.postprocess=f,this}e.highestId=0,e.prototype.toString=function(u){var c=typeof u>"u"?this.symbols.map(l).join(" "):this.symbols.slice(0,u).map(l).join(" ")+" ● "+this.symbols.slice(u).map(l).join(" ");return this.name+" → "+c};function n(u,c,f,d){this.rule=u,this.dot=c,this.reference=f,this.data=[],this.wantedBy=d,this.isComplete=this.dot===u.symbols.length}n.prototype.toString=function(){return"{"+this.rule.toString(this.dot)+"}, from: "+(this.reference||0)},n.prototype.nextState=function(u){var c=new n(this.rule,this.dot+1,this.reference,this.wantedBy);return c.left=this,c.right=u,c.isComplete&&(c.data=c.build(),c.right=void 0),c},n.prototype.build=function(){var u=[],c=this;do u.push(c.right.data),c=c.left;while(c.left);return u.reverse(),u},n.prototype.finish=function(){this.rule.postprocess&&(this.data=this.rule.postprocess(this.data,this.reference,o.fail))};function r(u,c){this.grammar=u,this.index=c,this.states=[],this.wants={},this.scannable=[],this.completed={}}r.prototype.process=function(u){for(var c=this.states,f=this.wants,d=this.completed,h=0;hGj.getAST(t),rr=0,Nl=3,zp=(t,e)=>`${t}/${e}`,V3=Object.prototype.toString,Kj=/Object|Array/,Wb=t=>Kj.test(V3.call(t)),Xj=t=>V3.call(t).match(/\s([^\]]+)\]/).pop().toLowerCase();function U3(t){return new RegExp(t.text.replace(/(^{|}$)/g,""))}function Yj(t,e){Array.isArray(t)?t.forEach(e):Object.prototype.toString.call(t)==="[object Object]"&&Object.keys(t).forEach(function(n){e(t[n],n,t)})}function LE(t){return Array.isArray(t)?t.map(function(e,n){return`${n}`}):Object.prototype.toString.call(t)==="[object Object]"?Object.keys(t):[]}const ro={mem:[],get(t,e){const n=t[rr][e];if(!ro.mem.includes(n))return Wb(n)&&ro.mem.push(n),[n,e,t[rr],zp(t[Nl],e)]},reset(){ro.mem.length=0}},Kb={any(t,e){const n=e[rr];return LE(n).map(r=>[n[r],r,n,zp(e[Nl],r)])},all(t,e){const n=[e];return Yj(e[rr],(r,i)=>{const s=ro.get(e,i);s&&n.push(...Kb.all(t,s))}),n},regex(t,e){const n=U3(t),r=e[rr];return LE(r).filter(i=>n.test(i)).map(i=>[r[i],i,r,zp(e[Nl],i)])}},jp={escaped:(t,e)=>jp.property(t,e),property:(t,e)=>{const n=t.text;if(e[rr]&&e[rr][n]!==void 0)return[e[rr][n],n,e[rr],zp(e[Nl],n)]},typecheck:(t,e)=>{const n=t.text.replace(/^\?:/,"");if(n==="value")return Wb(e[rr])?void 0:e;if(Xj(e[rr])===n)return e},lookahead:(t,e)=>{let n=!0,r=!1;return t.children.forEach(i=>{if(i.type==="expression"){const s=jp.expression(i,e)!==void 0;n=r===!0?n||s:n&&s}else r=i.type==="orExpr"}),n?e:void 0},expression:(t,e)=>{const n=t.children[0].text,r=t.children[1],i=t.children[2],s=e[rr];if(Wb(s)!==!1)return Jj(s[n],r,i)?e:void 0}};function Jj(t,e,n){if(e===void 0)return t!==void 0;let r;const i=`${t}`;return n.type==="regex"?r=U3(n).test(i):r=i===n.text,e.type==="isnot"&&(r=r===!1&&t!==void 0),r}function Zj(t,e,n,r){const i=[];for(let s=0,o=e.length;s{if(Kb[i.type])r=Zj(Kb[i.type],r,i,n);else if(jp[i.type])r=Qj(jp[i.type],r,i,n);else throw new Error(`Unknown filter ${i.type}`)}),r}function tV(t,e,n){const r=[];let i=t;return e.children.forEach(s=>{if(s.type==="orPattern"){r.push(...i),i=t;return}i=Yv(i,s,n)}),r.push(...i),r}function nV(t){if(t==null)return 1;if(t==="*"||t==="+")return 1/0;const e=parseInt(t);return isNaN(e)?1:e}function rV(t,e,n){const r=[],i=e.children.find(l=>l.type==="quantifier"),s=nV(i&&i.text);let o=t;i&&i.text==="*"&&r.push(...o);let a=0;for(;o.length>0&&ar=Yv(r,i,n)),r}function Yv(t,e,n){let r;return e.type==="query"?r=eV(t,e,n):e.type==="pattern"?r=rV(t,e,n):r=iV(t,e,n),ro.reset(),ro.mem.push(t),r}function sV(t,e){return ro.reset(),ro.mem.push(t),Yv([[t,null,null,"#"]],e)}const BE={value:t=>t.map(e=>e[rr]),pointer:t=>t.map(e=>e[Nl]),all:t=>t,map:t=>{const e={};return t.forEach(n=>e[n[Nl]]=n[rr]),e}};var ma;(function(t){t.POINTER="pointer",t.VALUE="value",t.ALL="all",t.MAP="map"})(ma||(ma={}));Uf.POINTER=ma.POINTER;Uf.VALUE=ma.VALUE;Uf.ALL=ma.ALL;Uf.MAP=ma.MAP;function Uf(t,e,n=ma.VALUE){if(e==null)return[];e=e.replace(/(\/$)/g,""),e===""&&(e="#");const r=Wj(e);if(r==null)throw new Error(`empty ast for '${e}'`);if(r.rest!=="")throw new Error(`Failed parsing queryString from: '${r.rest}'`);const i=sV(t,r);return typeof n=="function"?i.map(s=>n(...s)):BE[n]?BE[n](i):i}var Vp;(function(t){t.REPLACE_ITEMS="replace",t.INSERT_ITEMS="insert"})(Vp||(Vp={}));Vp.REPLACE_ITEMS;Vp.INSERT_ITEMS;const us={$ref:{type:!1},allOf:{type:!1,definitions:["allOf/*"]},anyOf:{type:!1,definitions:["anyOf/*"]},array:{type:!0,definitions:["allOf/*","anyOf/*","oneOf/*","not","items","items/*","additionalItems"],validationKeywords:["minItems","maxItems","uniqueItems"],keywords:["items","additionalItems","minItems","maxItems","uniqueItems"]},boolean:{type:!0},enum:{type:!1},integer:{type:!0,definitions:["allOf/*","anyOf/*","oneOf/*","not"],validationKeywords:["minimum","maximum","multipleOf"]},not:{type:!1,definitions:["not"]},number:{type:!0,definitions:["allOf/*","anyOf/*","oneOf/*","not"],validationKeywords:["minimum","maximum","multipleOf"]},null:{type:!0},object:{type:!0,definitions:["allOf/*","anyOf/*","oneOf/*","not","properties/*","additionalProperties","patternProperties/*","dependencies/*"],validationKeywords:["minProperties","maxProperties","required"],keywords:["properties","additionalProperties","patternProperties","dependencies","minProperties","maxProperties","required"]},oneOf:{type:!1,definitions:["oneOf/*"]},string:{type:!0,definitions:["allOf/*","anyOf/*","oneOf/*","not"],validationKeywords:["minLength","maxLength","pattern"]}},oV=Object.keys(us).filter(t=>us[t].type===!1),$E=Object.prototype.hasOwnProperty;function zE(t){if(no(t)===!1)return;if(t.enum)return"enum";const e=t.type;if(Array.isArray(e)||us[e])return e;const n=oV.filter(r=>t[r]);if(n.length===1)return n[0];if(n.length===0){for(let r=0,i=us.object.keywords.length;r{Uf(t,i,(s,o,a,l)=>{no(s)&&zE(s)&&e.push({pointer:Yc.join(Yc.split(l),!1),def:s})})}),e}function lV(t,e){if(this.callback(t,e)===!0)return;aV(t).forEach(r=>this.nextTypeDefs(r.def,Yc.join(e,r.pointer,!1)))}function Ud(t,e,n,r="definitions"){const i=e[r];Object.keys(i).forEach(s=>{if(i[s]===!1||no(i[s])){t.nextTypeDefs(i[s],Yc.join(n,r,s,!1));return}})}function om(t,e,n="#"){const r={callback:e,nextTypeDefs:lV};r.nextTypeDefs(t,n),t.definitions!=null&&(r.callback=(i,s)=>{e(i,s),i.definitions!=null&&Ud(r,i,s)},Ud(r,t,n)),t.$defs!=null&&(r.callback=(i,s)=>{e(i,s),i.definitions!=null&&Ud(r,i,s)},Ud(r,t,n,"$defs"))}const uV=/(#|\/)+$/,Hd=/#$/,cV=/^[^:]+:\/\/[^/]+\//,fV=/\/[^/]*$/,dV=/#.*$/;function Up(t,e){return t==null&&e==null?"#":e==null?t.replace(Hd,""):t==null?e.replace(Hd,""):e[0]==="#"?`${t.replace(dV,"")}${e.replace(uV,"")}`:cV.test(e)?e.replace(Hd,""):`${t.replace(fV,"")}/${e.replace(Hd,"")}`}const Fu=/(#|\/)+$/g,hV=["",null,"#"];function pV(t){if(hV.includes(t))return[];if(t=t.replace(Fu,""),t.indexOf("#")===-1)return[t.replace(Fu,"")];if(t.indexOf("#")===0)return[t.replace(Fu,"")];const e=t.split("#");return e[0]=e[0].replace(Fu,""),e[1]=`#${e[1].replace(Fu,"")}`,e}const mV=/(#|\/)+$/g,gV=t=>tt(t)==="object";function is(t,e,n){if(gV(n)&&(n=n.__ref||n.$ref),n==null)return e;let r;const i=n.replace(mV,"");if(t.remotes[i])return r=t.remotes[i],r&&r.$ref?is(t,e,r.$ref):r;if(t.ids[n])return r=Wo.get(e,t.ids[n]),r&&r.$ref?is(t,e,r.$ref):r;const s=pV(n);if(s.length===0)return e;if(s.length===1){if(n=s[0],t.remotes[n])return r=t.remotes[n],is(t,e,r.$ref);if(t.ids[n])return r=Wo.get(e,t.ids[n]),r&&r.$ref?is(t,e,r.$ref):r}if(s.length===2){const o=s[0];if(n=s[1],t.remotes[o])return t.remotes[o].getRef?t.remotes[o].getRef(n):is(t,t.remotes[o],n);if(t.ids[o])return is(t,Wo.get(e,t.ids[o]),n)}return r=Wo.get(e,t.ids[n]||n),r&&r.$ref?is(t,e,r.$ref):r}const jE="__compiled",VE="__ref",bV="getRef",yV="getRoot",vV=/(#|\/)+$/g;function xV(t,e,n=e,r=!1){if(!e||e[jE]!==void 0)return e;const i={ids:{},remotes:t.remotes},s=JSON.stringify(e),o=JSON.parse(s);if(Object.defineProperty(o,jE,{enumerable:!1,value:!0}),Object.defineProperty(o,bV,{enumerable:!1,value:is.bind(null,i,o)}),r===!1&&s.includes("$ref")===!1)return o;e!==n&&Object.defineProperty(o,"definitions",{enumerable:!1,value:Object.assign({},n.definitions,n.$defs,e.definitions,e.$defs)});const a={},l=()=>o;return om(o,(u,c)=>{var f;if(u.id){if(u.id.startsWith("http")&&/(allOf|anyOf|oneOf)\/\d+$/.test(c)){const g=c.replace(/\/(allOf|anyOf|oneOf)\/\d+$/,""),b=Wo.get(o,g);u.id=(f=b.id)!==null&&f!==void 0?f:u.id}i.ids[u.id.replace(vV,"")]=c}c=`#${c}`.replace(/##+/,"#");const d=c.replace(/\/[^/]+$/,""),h=c.replace(/\/[^/]+\/[^/]+$/,""),p=a[d]||a[h],m=Up(p,u.id);a[c]=m,i.ids[m]==null&&(i.ids[m]=c),u.$ref&&!u[VE]&&(Object.defineProperty(u,VE,{enumerable:!1,value:Up(m,u.$ref)}),Object.defineProperty(u,yV,{enumerable:!1,value:l}))}),o}function H3(t,e,n,r=t.rootSchema,i="#"){r=t.resolveRef(r),n(r,e,i);const s=tt(e);s==="object"?Object.keys(e).forEach(o=>{const a=t.step(o,r,e,i),l=e[o];t.each(l,n,a,`${i}/${o}`)}):s==="array"&&e.forEach((o,a)=>{const l=t.step(a,r,e,i);t.each(o,n,l,`${i}/${a}`)})}const q3={additionalItemsError:xe("AdditionalItemsError"),additionalPropertiesError:xe("AdditionalPropertiesError"),anyOfError:xe("AnyOfError"),allOfError:xe("AllOfError"),constError:xe("ConstError"),containsError:xe("ContainsError"),containsArrayError:xe("ContainsArrayError"),containsAnyError:xe("ContainsAnyError"),enumError:xe("EnumError"),forbiddenPropertyError:xe("ForbiddenPropertyError"),formatURLError:xe("FormatURLError"),formatURIError:xe("FormatURIError"),formatURIReferenceError:xe("FormatURIReferenceError"),formatURITemplateError:xe("FormatURITemplateError"),formatDateError:xe("FormatDateError"),formatDateTimeError:xe("FormatDateTimeError"),formatEmailError:xe("FormatEmailError"),formatHostnameError:xe("FormatHostnameError"),formatIPV4Error:xe("FormatIPV4Error"),formatIPV4LeadingZeroError:xe("FormatIPV4LeadingZeroError"),formatIPV6Error:xe("FormatIPV6Error"),formatIPV6LeadingZeroError:xe("FormatIPV6LeadingZeroError"),formatJsonPointerError:xe("FormatJsonPointerError"),formatRegExError:xe("FormatRegExError"),formatTimeError:xe("FormatTimeError"),invalidSchemaError:xe("InvalidSchemaError"),invalidDataError:xe("InvalidDataError"),invalidTypeError:xe("InvalidTypeError"),invalidPropertyNameError:xe("InvalidPropertyNameError"),maximumError:xe("MaximumError"),maxItemsError:xe("MaxItemsError"),maxLengthError:xe("MaxLengthError"),maxPropertiesError:xe("MaxPropertiesError"),minimumError:xe("MinimumError"),minItemsError:xe("MinItemsError"),minItemsOneError:xe("MinItemsOneError"),minLengthError:xe("MinLengthError"),minLengthOneError:xe("MinLengthOneError"),minPropertiesError:xe("MinPropertiesError"),missingDependencyError:xe("MissingDependencyError"),missingOneOfPropertyError:xe("MissingOneOfPropertyError"),multipleOfError:xe("MultipleOfError"),multipleOneOfError:xe("MultipleOneOfError"),noAdditionalPropertiesError:xe("NoAdditionalPropertiesError"),notError:xe("NotError"),oneOfError:xe("OneOfError"),oneOfPropertyError:xe("OneOfPropertyError"),patternError:xe("PatternError"),patternPropertiesError:xe("PatternPropertiesError"),requiredPropertyError:xe("RequiredPropertyError"),schemaWarning:xe("SchemaWarning"),typeError:xe("TypeError"),undefinedValueError:xe("UndefinedValueError"),uniqueItemsError:xe("UniqueItemsError"),unknownPropertyError:xe("UnknownPropertyError"),valueNotEmptyError:xe("ValueNotEmptyError")};var zg={exports:{}},UE;function SV(){return UE||(UE=1,(function(t){(function(e){e.exports.is_uri=r,e.exports.is_http_uri=i,e.exports.is_https_uri=s,e.exports.is_web_uri=o,e.exports.isUri=r,e.exports.isHttpUri=i,e.exports.isHttpsUri=s,e.exports.isWebUri=o;var n=function(a){var l=a.match(/(?:([^:\/?#]+):)?(?:\/\/([^\/?#]*))?([^?#]*)(?:\?([^#]*))?(?:#(.*))?/);return l};function r(a){if(a&&!/[^a-z0-9\:\/\?\#\[\]\@\!\$\&\'\(\)\*\+\,\;\=\.\-\_\~\%]/i.test(a)&&!/%[^0-9a-f]/i.test(a)&&!/%[0-9a-f](:?[^0-9a-f]|$)/i.test(a)){var l=[],u="",c="",f="",d="",h="",p="";if(l=n(a),u=l[1],c=l[2],f=l[3],d=l[4],h=l[5],!!(u&&u.length&&f.length>=0)){if(c&&c.length){if(!(f.length===0||/^\//.test(f)))return}else if(/^\/\//.test(f))return;if(/^[a-z][a-z0-9\+\-\.]*$/.test(u.toLowerCase()))return p+=u+":",c&&c.length&&(p+="//"+c),p+=f,d&&d.length&&(p+="?"+d),h&&h.length&&(p+="#"+h),p}}}function i(a,l){if(r(a)){var u=[],c="",f="",d="",h="",p="",m="",g="";if(u=n(a),c=u[1],f=u[2],d=u[3],p=u[4],m=u[5],!!c){if(l){if(c.toLowerCase()!="https")return}else if(c.toLowerCase()!="http")return;if(f)return/:(\d+)$/.test(f)&&(h=f.match(/:(\d+)$/)[0],f=f.replace(/:\d+$/,"")),g+=c+":",g+="//"+f,h&&(g+=h),g+=d,p&&p.length&&(g+="?"+p),m&&m.length&&(g+="#"+m),g}}}function s(a){return i(a,!0)}function o(a){return i(a)||s(a)}})(t)})(zg)),zg.exports}var EV=SV();const HE=Ta(EV);var Fn={},zh={exports:{}},wV=zh.exports,qE;function _V(){return qE||(qE=1,(function(t){(function(e,n){t.exports?t.exports=n():e.nearley=n()})(wV,function(){function e(u,c,f){return this.id=++e.highestId,this.name=u,this.symbols=c,this.postprocess=f,this}e.highestId=0,e.prototype.toString=function(u){var c=typeof u>"u"?this.symbols.map(l).join(" "):this.symbols.slice(0,u).map(l).join(" ")+" ● "+this.symbols.slice(u).map(l).join(" ");return this.name+" → "+c};function n(u,c,f,d){this.rule=u,this.dot=c,this.reference=f,this.data=[],this.wantedBy=d,this.isComplete=this.dot===u.symbols.length}n.prototype.toString=function(){return"{"+this.rule.toString(this.dot)+"}, from: "+(this.reference||0)},n.prototype.nextState=function(u){var c=new n(this.rule,this.dot+1,this.reference,this.wantedBy);return c.left=this,c.right=u,c.isComplete&&(c.data=c.build(),c.right=void 0),c},n.prototype.build=function(){var u=[],c=this;do u.push(c.right.data),c=c.left;while(c.left);return u.reverse(),u},n.prototype.finish=function(){this.rule.postprocess&&(this.data=this.rule.postprocess(this.data,this.reference,o.fail))};function r(u,c){this.grammar=u,this.index=c,this.states=[],this.wants={},this.scannable=[],this.completed={}}r.prototype.process=function(u){for(var c=this.states,f=this.wants,d=this.completed,h=0;h0&&c.push(" ^ "+d+" more lines identical to this"),d=0,c.push(" "+m)),f=m}},o.prototype.getSymbolDisplay=function(u){return a(u)},o.prototype.buildFirstStateStack=function(u,c){if(c.indexOf(u)!==-1)return null;if(u.wantedBy.length===0)return[u];var f=u.wantedBy[0],d=[u].concat(c),h=this.buildFirstStateStack(f,d);return h===null?null:[u].concat(h)},o.prototype.save=function(){var u=this.table[this.current];return u.lexerState=this.lexerState,u},o.prototype.restore=function(u){var c=u.index;this.current=c,this.table[c]=u,this.table.splice(c+1),this.lexerState=u.lexerState,this.results=this.finish()},o.prototype.rewind=function(u){if(!this.options.keepHistory)throw new Error("set option `keepHistory` to enable rewinding");this.restore(this.table[u])},o.prototype.finish=function(){var u=[],c=this.grammar.start,f=this.table[this.table.length-1];return f.states.forEach(function(d){d.rule.name===c&&d.dot===d.rule.symbols.length&&d.reference===0&&d.data!==o.fail&&u.push(d)}),u.map(function(d){return d.data})};function a(u){var c=typeof u;if(c==="string")return u;if(c==="object"){if(u.literal)return JSON.stringify(u.literal);if(u instanceof RegExp)return"character matching "+u;if(u.type)return u.type+" token";if(u.test)return"token matching "+String(u.test);throw new Error("Unknown symbol type: "+u)}}function l(u){var c=typeof u;if(c==="string")return u;if(c==="object"){if(u.literal)return JSON.stringify(u.literal);if(u instanceof RegExp)return u.toString();if(u.type)return"%"+u.type;if(u.test)return"<"+String(u.test)+">";throw new Error("Unknown symbol type: "+u)}}return{Parser:o,Grammar:i,Rule:e}})})($h)),$h.exports}var Hd={},qE;function wV(){if(qE)return Hd;qE=1,Object.defineProperty(Hd,"__esModule",{value:!0});function t(i){return i[0]}const e=i=>[].concat(...i.map(s=>Array.isArray(s)?e(s):s));function n(i){return i?Array.isArray(i)?e(i).join(""):i:""}const r={Lexer:void 0,ParserRules:[{name:"Reverse_path",symbols:["Path"]},{name:"Reverse_path$string$1",symbols:[{literal:"<"},{literal:">"}],postprocess:i=>i.join("")},{name:"Reverse_path",symbols:["Reverse_path$string$1"]},{name:"Forward_path$subexpression$1$subexpression$1",symbols:[{literal:"<"},/[pP]/,/[oO]/,/[sS]/,/[tT]/,/[mM]/,/[aA]/,/[sS]/,/[tT]/,/[eE]/,/[rR]/,{literal:"@"}],postprocess:function(i){return i.join("")}},{name:"Forward_path$subexpression$1",symbols:["Forward_path$subexpression$1$subexpression$1","Domain",{literal:">"}]},{name:"Forward_path",symbols:["Forward_path$subexpression$1"]},{name:"Forward_path$subexpression$2",symbols:[{literal:"<"},/[pP]/,/[oO]/,/[sS]/,/[tT]/,/[mM]/,/[aA]/,/[sS]/,/[tT]/,/[eE]/,/[rR]/,{literal:">"}],postprocess:function(i){return i.join("")}},{name:"Forward_path",symbols:["Forward_path$subexpression$2"]},{name:"Forward_path",symbols:["Path"]},{name:"Path$ebnf$1$subexpression$1",symbols:["A_d_l",{literal:":"}]},{name:"Path$ebnf$1",symbols:["Path$ebnf$1$subexpression$1"],postprocess:t},{name:"Path$ebnf$1",symbols:[],postprocess:()=>null},{name:"Path",symbols:[{literal:"<"},"Path$ebnf$1","Mailbox",{literal:">"}]},{name:"A_d_l$ebnf$1",symbols:[]},{name:"A_d_l$ebnf$1$subexpression$1",symbols:[{literal:","},"At_domain"]},{name:"A_d_l$ebnf$1",symbols:["A_d_l$ebnf$1","A_d_l$ebnf$1$subexpression$1"],postprocess:i=>i[0].concat([i[1]])},{name:"A_d_l",symbols:["At_domain","A_d_l$ebnf$1"]},{name:"At_domain",symbols:[{literal:"@"},"Domain"]},{name:"Domain$ebnf$1",symbols:[]},{name:"Domain$ebnf$1$subexpression$1",symbols:[{literal:"."},"sub_domain"]},{name:"Domain$ebnf$1",symbols:["Domain$ebnf$1","Domain$ebnf$1$subexpression$1"],postprocess:i=>i[0].concat([i[1]])},{name:"Domain",symbols:["sub_domain","Domain$ebnf$1"]},{name:"sub_domain",symbols:["U_label"]},{name:"Let_dig",symbols:["ALPHA_DIGIT"],postprocess:t},{name:"Ldh_str$ebnf$1",symbols:[]},{name:"Ldh_str$ebnf$1",symbols:["Ldh_str$ebnf$1","ALPHA_DIG_DASH"],postprocess:i=>i[0].concat([i[1]])},{name:"Ldh_str",symbols:["Ldh_str$ebnf$1","Let_dig"]},{name:"U_Let_dig",symbols:["ALPHA_DIGIT_U"],postprocess:t},{name:"U_Ldh_str$ebnf$1",symbols:[]},{name:"U_Ldh_str$ebnf$1",symbols:["U_Ldh_str$ebnf$1","ALPHA_DIG_DASH_U"],postprocess:i=>i[0].concat([i[1]])},{name:"U_Ldh_str",symbols:["U_Ldh_str$ebnf$1","U_Let_dig"]},{name:"U_label$ebnf$1$subexpression$1",symbols:["U_Ldh_str"]},{name:"U_label$ebnf$1",symbols:["U_label$ebnf$1$subexpression$1"],postprocess:t},{name:"U_label$ebnf$1",symbols:[],postprocess:()=>null},{name:"U_label",symbols:["U_Let_dig","U_label$ebnf$1"]},{name:"address_literal$subexpression$1",symbols:["IPv4_address_literal"]},{name:"address_literal$subexpression$1",symbols:["IPv6_address_literal"]},{name:"address_literal$subexpression$1",symbols:["General_address_literal"]},{name:"address_literal",symbols:[{literal:"["},"address_literal$subexpression$1",{literal:"]"}]},{name:"non_local_part",symbols:["Domain"],postprocess:function(i){return{DomainName:n(i[0])}}},{name:"non_local_part",symbols:["address_literal"],postprocess:function(i){return{AddressLiteral:n(i[0])}}},{name:"Mailbox",symbols:["Local_part",{literal:"@"},"non_local_part"],postprocess:function(i){return{localPart:n(i[0]),domainPart:n(i[2])}}},{name:"Local_part",symbols:["Dot_string"],postprocess:function(i){return{DotString:n(i[0])}}},{name:"Local_part",symbols:["Quoted_string"],postprocess:function(i){return{QuotedString:n(i[0])}}},{name:"Dot_string$ebnf$1",symbols:[]},{name:"Dot_string$ebnf$1$subexpression$1",symbols:[{literal:"."},"Atom"]},{name:"Dot_string$ebnf$1",symbols:["Dot_string$ebnf$1","Dot_string$ebnf$1$subexpression$1"],postprocess:i=>i[0].concat([i[1]])},{name:"Dot_string",symbols:["Atom","Dot_string$ebnf$1"]},{name:"Atom$ebnf$1",symbols:[/[0-9A-Za-z!#$%&'*+\-/=?^_`{|}~\u0080-\uFFFF/]/]},{name:"Atom$ebnf$1",symbols:["Atom$ebnf$1",/[0-9A-Za-z!#$%&'*+\-/=?^_`{|}~\u0080-\uFFFF/]/],postprocess:i=>i[0].concat([i[1]])},{name:"Atom",symbols:["Atom$ebnf$1"]},{name:"Quoted_string$ebnf$1",symbols:[]},{name:"Quoted_string$ebnf$1",symbols:["Quoted_string$ebnf$1","QcontentSMTP"],postprocess:i=>i[0].concat([i[1]])},{name:"Quoted_string",symbols:["DQUOTE","Quoted_string$ebnf$1","DQUOTE"]},{name:"QcontentSMTP",symbols:["qtextSMTP"]},{name:"QcontentSMTP",symbols:["quoted_pairSMTP"]},{name:"quoted_pairSMTP",symbols:[{literal:"\\"},/[\x20-\x7e]/]},{name:"qtextSMTP",symbols:[/[\x20-\x21\x23-\x5b\x5d-\x7e\u0080-\uFFFF]/],postprocess:t},{name:"IPv4_address_literal$macrocall$2",symbols:[{literal:"."},"Snum"]},{name:"IPv4_address_literal$macrocall$1",symbols:["IPv4_address_literal$macrocall$2","IPv4_address_literal$macrocall$2","IPv4_address_literal$macrocall$2"]},{name:"IPv4_address_literal",symbols:["Snum","IPv4_address_literal$macrocall$1"]},{name:"IPv6_address_literal$subexpression$1",symbols:[/[iI]/,/[pP]/,/[vV]/,{literal:"6"},{literal:":"}],postprocess:function(i){return i.join("")}},{name:"IPv6_address_literal",symbols:["IPv6_address_literal$subexpression$1","IPv6_addr"]},{name:"General_address_literal$ebnf$1",symbols:["dcontent"]},{name:"General_address_literal$ebnf$1",symbols:["General_address_literal$ebnf$1","dcontent"],postprocess:i=>i[0].concat([i[1]])},{name:"General_address_literal",symbols:["Standardized_tag",{literal:":"},"General_address_literal$ebnf$1"]},{name:"Standardized_tag",symbols:["Ldh_str"]},{name:"dcontent",symbols:[/[\x21-\x5a\x5e-\x7e]/],postprocess:t},{name:"Snum",symbols:["DIGIT"]},{name:"Snum$subexpression$1",symbols:[/[1-9]/,"DIGIT"]},{name:"Snum",symbols:["Snum$subexpression$1"]},{name:"Snum$subexpression$2",symbols:[{literal:"1"},"DIGIT","DIGIT"]},{name:"Snum",symbols:["Snum$subexpression$2"]},{name:"Snum$subexpression$3",symbols:[{literal:"2"},/[0-4]/,"DIGIT"]},{name:"Snum",symbols:["Snum$subexpression$3"]},{name:"Snum$subexpression$4",symbols:[{literal:"2"},{literal:"5"},/[0-5]/]},{name:"Snum",symbols:["Snum$subexpression$4"]},{name:"IPv6_addr",symbols:["IPv6_full"]},{name:"IPv6_addr",symbols:["IPv6_comp"]},{name:"IPv6_addr",symbols:["IPv6v4_full"]},{name:"IPv6_addr",symbols:["IPv6v4_comp"]},{name:"IPv6_hex",symbols:["HEXDIG"]},{name:"IPv6_hex$subexpression$1",symbols:["HEXDIG","HEXDIG"]},{name:"IPv6_hex",symbols:["IPv6_hex$subexpression$1"]},{name:"IPv6_hex$subexpression$2",symbols:["HEXDIG","HEXDIG","HEXDIG"]},{name:"IPv6_hex",symbols:["IPv6_hex$subexpression$2"]},{name:"IPv6_hex$subexpression$3",symbols:["HEXDIG","HEXDIG","HEXDIG","HEXDIG"]},{name:"IPv6_hex",symbols:["IPv6_hex$subexpression$3"]},{name:"IPv6_full$macrocall$2",symbols:[{literal:":"},"IPv6_hex"]},{name:"IPv6_full$macrocall$1",symbols:["IPv6_full$macrocall$2","IPv6_full$macrocall$2","IPv6_full$macrocall$2","IPv6_full$macrocall$2","IPv6_full$macrocall$2","IPv6_full$macrocall$2","IPv6_full$macrocall$2"]},{name:"IPv6_full",symbols:["IPv6_hex","IPv6_full$macrocall$1"]},{name:"IPv6_comp$ebnf$1$subexpression$1$macrocall$2",symbols:[{literal:":"},"IPv6_hex"]},{name:"IPv6_comp$ebnf$1$subexpression$1$macrocall$1",symbols:["IPv6_comp$ebnf$1$subexpression$1$macrocall$2","IPv6_comp$ebnf$1$subexpression$1$macrocall$2","IPv6_comp$ebnf$1$subexpression$1$macrocall$2","IPv6_comp$ebnf$1$subexpression$1$macrocall$2","IPv6_comp$ebnf$1$subexpression$1$macrocall$2"]},{name:"IPv6_comp$ebnf$1$subexpression$1",symbols:["IPv6_hex","IPv6_comp$ebnf$1$subexpression$1$macrocall$1"]},{name:"IPv6_comp$ebnf$1",symbols:["IPv6_comp$ebnf$1$subexpression$1"],postprocess:t},{name:"IPv6_comp$ebnf$1",symbols:[],postprocess:()=>null},{name:"IPv6_comp$string$1",symbols:[{literal:":"},{literal:":"}],postprocess:i=>i.join("")},{name:"IPv6_comp$ebnf$2$subexpression$1$macrocall$2",symbols:[{literal:":"},"IPv6_hex"]},{name:"IPv6_comp$ebnf$2$subexpression$1$macrocall$1",symbols:["IPv6_comp$ebnf$2$subexpression$1$macrocall$2","IPv6_comp$ebnf$2$subexpression$1$macrocall$2","IPv6_comp$ebnf$2$subexpression$1$macrocall$2","IPv6_comp$ebnf$2$subexpression$1$macrocall$2","IPv6_comp$ebnf$2$subexpression$1$macrocall$2"]},{name:"IPv6_comp$ebnf$2$subexpression$1",symbols:["IPv6_hex","IPv6_comp$ebnf$2$subexpression$1$macrocall$1"]},{name:"IPv6_comp$ebnf$2",symbols:["IPv6_comp$ebnf$2$subexpression$1"],postprocess:t},{name:"IPv6_comp$ebnf$2",symbols:[],postprocess:()=>null},{name:"IPv6_comp",symbols:["IPv6_comp$ebnf$1","IPv6_comp$string$1","IPv6_comp$ebnf$2"]},{name:"IPv6v4_full$macrocall$2",symbols:[{literal:":"},"IPv6_hex"]},{name:"IPv6v4_full$macrocall$1",symbols:["IPv6v4_full$macrocall$2","IPv6v4_full$macrocall$2","IPv6v4_full$macrocall$2","IPv6v4_full$macrocall$2","IPv6v4_full$macrocall$2"]},{name:"IPv6v4_full",symbols:["IPv6_hex","IPv6v4_full$macrocall$1",{literal:":"},"IPv4_address_literal"]},{name:"IPv6v4_comp$ebnf$1$subexpression$1$macrocall$2",symbols:[{literal:":"},"IPv6_hex"]},{name:"IPv6v4_comp$ebnf$1$subexpression$1$macrocall$1",symbols:["IPv6v4_comp$ebnf$1$subexpression$1$macrocall$2","IPv6v4_comp$ebnf$1$subexpression$1$macrocall$2","IPv6v4_comp$ebnf$1$subexpression$1$macrocall$2"]},{name:"IPv6v4_comp$ebnf$1$subexpression$1",symbols:["IPv6_hex","IPv6v4_comp$ebnf$1$subexpression$1$macrocall$1"]},{name:"IPv6v4_comp$ebnf$1",symbols:["IPv6v4_comp$ebnf$1$subexpression$1"],postprocess:t},{name:"IPv6v4_comp$ebnf$1",symbols:[],postprocess:()=>null},{name:"IPv6v4_comp$string$1",symbols:[{literal:":"},{literal:":"}],postprocess:i=>i.join("")},{name:"IPv6v4_comp$ebnf$2$subexpression$1$macrocall$2",symbols:[{literal:":"},"IPv6_hex"]},{name:"IPv6v4_comp$ebnf$2$subexpression$1$macrocall$1",symbols:["IPv6v4_comp$ebnf$2$subexpression$1$macrocall$2","IPv6v4_comp$ebnf$2$subexpression$1$macrocall$2","IPv6v4_comp$ebnf$2$subexpression$1$macrocall$2"]},{name:"IPv6v4_comp$ebnf$2$subexpression$1",symbols:["IPv6_hex","IPv6v4_comp$ebnf$2$subexpression$1$macrocall$1",{literal:":"}]},{name:"IPv6v4_comp$ebnf$2",symbols:["IPv6v4_comp$ebnf$2$subexpression$1"],postprocess:t},{name:"IPv6v4_comp$ebnf$2",symbols:[],postprocess:()=>null},{name:"IPv6v4_comp",symbols:["IPv6v4_comp$ebnf$1","IPv6v4_comp$string$1","IPv6v4_comp$ebnf$2","IPv4_address_literal"]},{name:"DIGIT",symbols:[/[0-9]/],postprocess:t},{name:"ALPHA_DIGIT_U",symbols:[/[0-9A-Za-z\u0080-\uFFFF]/],postprocess:t},{name:"ALPHA_DIGIT",symbols:[/[0-9A-Za-z]/],postprocess:t},{name:"ALPHA_DIG_DASH",symbols:[/[-0-9A-Za-z]/],postprocess:t},{name:"ALPHA_DIG_DASH_U",symbols:[/[-0-9A-Za-z\u0080-\uFFFF]/],postprocess:t},{name:"HEXDIG",symbols:[/[0-9A-Fa-f]/],postprocess:t},{name:"DQUOTE",symbols:[{literal:'"'}],postprocess:t}],ParserStart:"Reverse_path"};return Hd.default=r,Hd}var GE;function _V(){if(GE)return Fn;GE=1;var t=Fn&&Fn.__importDefault||function(u){return u&&u.__esModule?u:{default:u}};Object.defineProperty(Fn,"__esModule",{value:!0}),Fn.canonicalize=Fn.canonicalize_quoted_string=Fn.normalize=Fn.normalize_dot_string=Fn.parse=void 0;const e=EV(),n=t(wV());n.default.ParserStart="Mailbox";const r=e.Grammar.fromCompiled(n.default);function i(u){const c=new e.Parser(r);if(c.feed(u),c.results.length!==1)throw new Error("address parsing failed: ambiguous grammar");return c.results[0]}Fn.parse=i;function s(u){return(function(){const d=u.indexOf("+");return d===-1?u:u.substr(0,d)})().replace(/\./g,"").toLowerCase()}Fn.normalize_dot_string=s;function o(u){var c,f;const d=i(u),h=(c=d.domainPart.AddressLiteral)!==null&&c!==void 0?c:d.domainPart.DomainName.toLowerCase();return`${(f=d.localPart.QuotedString)!==null&&f!==void 0?f:s(d.localPart.DotString)}@${h}`}Fn.normalize=o;function a(u){return`"${u.substr(1).substr(0,u.length-2).replace(/(?:\\(.))/g,"$1").replace(/(?:(["\\]))/g,"\\$1")}"`}Fn.canonicalize_quoted_string=a;function l(u){var c;const f=i(u),d=(c=f.domainPart.AddressLiteral)!==null&&c!==void 0?c:f.domainPart.DomainName.toLowerCase();return`${f.localPart.QuotedString?a(f.localPart.QuotedString):f.localPart.DotString}@${d}`}return Fn.canonicalize=l,Fn}var CV=_V();const AV=new RegExp("^([0-9]+)-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])[Tt]([01][0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9]|60)(\\.[0-9]+)?(([Zz])|([\\+|\\-]([01][0-9]|2[0-3]):[0-5][0-9]))$"),DV=/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,kV=/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,OV=/^(?=.{1,255}$)[0-9A-Za-z](?:(?:[0-9A-Za-z]|-){0,61}[0-9A-Za-z])?(?:\.[0-9A-Za-z](?:(?:[0-9A-Za-z]|-){0,61}[0-9A-Za-z])?)*\.?$/,TV=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,IV=/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,PV=[0,31,28,31,30,31,30,31,31,30,31,30,31],RV=/^(?:\/(?:[^~/]|~0|~1)*)*$/,NV=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,MV=/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,FV=/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,q3={date:(t,e,n,r)=>{if(typeof n!="string"||n==="")return;const i=n.match(TV);if(!i)return t.errors.formatDateTimeError({value:n,pointer:r,schema:e});const s=+i[1],o=+i[2],a=+i[3],l=s%4===0&&(s%100!==0||s%400===0);if(!(o>=1&&o<=12&&a>=1&&a<=(o==2&&l?29:PV[o])))return t.errors.formatDateError({value:n,pointer:r,schema:e})},"date-time":(t,e,n,r)=>{if(!(typeof n!="string"||n===""))return n===""||AV.test(n)?new Date(n).toString()==="Invalid Date"?t.errors.formatDateTimeError({value:n,pointer:r,schema:e}):void 0:t.errors.formatDateTimeError({value:n,pointer:r,schema:e})},email:(t,e,n,r)=>{if(typeof n!="string"||n==="")return;if(n[0]==='"')return t.errors.formatEmailError({value:n,pointer:r,schema:e});const[i,s,...o]=n.split("@");if(!i||!s||o.length!==0||i.length>64||s.length>253)return t.errors.formatEmailError({value:n,pointer:r,schema:e});if(i[0]==="."||i.endsWith(".")||i.includes(".."))return t.errors.formatEmailError({value:n,pointer:r,schema:e});if(!/^[a-z0-9.-]+$/i.test(s)||!/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+$/i.test(i))return t.errors.formatEmailError({value:n,pointer:r,schema:e});if(!s.split(".").every(a=>/^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$/i.test(a)))return t.errors.formatEmailError({value:n,pointer:r,schema:e})},"idn-email":(t,e,n,r)=>{if(!(typeof n!="string"||n===""))try{CV.parse(n);return}catch{return t.errors.formatEmailError({value:n,pointer:r,schema:e})}},hostname:(t,e,n,r)=>{if(typeof n=="string"&&!(n===""||OV.test(n)))return t.errors.formatHostnameError({value:n,pointer:r,schema:e})},ipv4:(t,e,n,r)=>{if(!(typeof n!="string"||n==="")){if(n&&n[0]==="0")return t.errors.formatIPV4LeadingZeroError({value:n,pointer:r,schema:e});if(!(n.length<=15&&DV.test(n)))return t.errors.formatIPV4Error({value:n,pointer:r,schema:e})}},ipv6:(t,e,n,r)=>{if(!(typeof n!="string"||n==="")){if(n&&n[0]==="0")return t.errors.formatIPV6LeadingZeroError({value:n,pointer:r,schema:e});if(!(n.length<=45&&kV.test(n)))return t.errors.formatIPV6Error({value:n,pointer:r,schema:e})}},"json-pointer":(t,e,n,r)=>{if(!(typeof n!="string"||n==="")&&!RV.test(n))return t.errors.formatJsonPointerError({value:n,pointer:r,schema:e})},"relative-json-pointer":(t,e,n,r)=>{if(!(typeof n!="string"||n==="")&&!NV.test(n))return t.errors.formatJsonPointerError({value:n,pointer:r,schema:e})},regex:(t,e,n,r)=>{if(typeof n=="string"&&/\\Z$/.test(n)===!1){try{new RegExp(n);return}catch{}return t.errors.formatRegExError({value:n,pointer:r,schema:e})}if(!(typeof n=="object"||typeof n=="number"||Array.isArray(n)))return t.errors.formatRegExError({value:n,pointer:r,schema:e})},time:(t,e,n,r)=>typeof n!="string"||n===""||n.match(IV)?void 0:t.errors.formatDateTimeError({value:n,pointer:r,schema:e}),uri:(t,e,n,r)=>{if(!(typeof n!="string"||n==="")&&!UE.isUri(n))return t.errors.formatURIError({value:n,pointer:r,schema:e})},"uri-reference":(t,e,n,r)=>{if(!(typeof n!="string"||n==="")&&!MV.test(n))return t.errors.formatURIReferenceError({value:n,pointer:r,schema:e})},"uri-template":(t,e,n,r)=>{if(!(typeof n!="string"||n==="")&&!FV.test(n))return t.errors.formatURITemplateError({value:n,pointer:r,schema:e})},url:(t,e,n,r)=>{if(!(n===""||UE.isWebUri(n)))return t.errors.formatURLError({value:n,pointer:r,schema:e})}},G3={};function W3(t,e=G3){const{pointer:n="#",data:r,schema:i=t.rootSchema,withSchemaWarning:s=!1}=e,o=Yc.split(n),a=K3(t,t.resolveRef(i),o,"#",r);if(!(!s&&(a==null?void 0:a.code)==="schema-warning"))return a}function K3(t,e,n,r,i=G3){if(n.length===0)return t.resolveRef(e);const s=n.shift();return e=t.step(s,e,i,r),Nn(e)?e:(i=i[s],K3(t,e,n,`${r}/${s}`,i))}function LV(t){switch(tt(t)){case"string":case"array":return(t==null?void 0:t.length)===0;case"null":case"undefined":return!0;case"object":return Object.keys(t).length===0;default:return!1}}const WE=su.templateDefaultOptions;let cs;function zg(t,e){const{$ref:n}=t;return n==null?!0:(cs[e]==null||cs[e][n]==null?0:cs[e][n])0){if(zg(e.anyOf[0],`${r}/anyOf/0`)){const o=KE(t,e.anyOf[0],`${r}/anyOf/0`);s=qv(s,o),s.pointer=e.anyOf[0].$ref||s.pointer}delete s.anyOf}if(Array.isArray(e.allOf)&&e.allOf.map((a,l)=>zg(a,`${r}/allOf/${l}`)).reduceRight((a,l)=>a&&l,!0)){const a=[];let l=Bp(n);for(let c=0;ct&&typeof t=="object";function si(t,e,n,r,i){var s;if(n==null)throw new Error(`getTemplate: missing schema for data: ${JSON.stringify(e)}`);if(r==null)throw new Error("Missing pointer");let o=X3(t,n,e,r,i);if(!XE(o))return;if(r=o.pointer,o!=null&&o.const)return o.const;if(Array.isArray(o.oneOf))if(LV(e)){const c=o.oneOf[0].type||o.type||o.const&&typeof o.const||tt(e);o={...o.oneOf[0],type:c}}else{const c=Hv(t,e,o);if(Nn(c)){if(e!=null&&i.removeInvalidData!==!0)return e;o=o.oneOf[0],e=void 0}else c.type=(s=c.type)!==null&&s!==void 0?s:o.type,o=c}if(!XE(o)||o.type==null)return;if(e instanceof File)return e;const a=Array.isArray(o.type)?$V(o.type,e,o.default):o.type,l=tt(e);return e!=null&&l!==a&&!(l==="number"&&a==="integer")&&(e=BV(a,e)),YE[a]==null?i.removeInvalidData?void 0:e:YE[a](t,o,e,r,i)}function $V(t,e,n){if(e==null){if(n!=null){const i=tt(n);if(t.includes(i))return i}return t[0]}const r=tt(e);return t.includes(r)?r:t[0]}const YE={null:(t,e,n)=>Lu(e,n,null),string:(t,e,n)=>Lu(e,n,""),number:(t,e,n)=>Lu(e,n,0),integer:(t,e,n)=>Lu(e,n,0),boolean:(t,e,n)=>Lu(e,n,!1),object:(t,e,n,r,i)=>{var s;const o=e.default===void 0?{}:e.default,a={},l=i.extendDefaults===!1&&e.default!==void 0?[]:(s=e.required)!==null&&s!==void 0?s:[];e.properties&&Object.keys(e.properties).forEach(f=>{const d=n==null||n[f]==null?o[f]:n[f],h=l.includes(f);(d!=null||h||i.addOptionalProps)&&(a[f]=si(t,d,e.properties[f],`${r}/properties/${f}`,i))});let u=F3(t,e,a);if(u){u=zn(e,u),delete u.dependencies;const f=si(t,n,u,`${r}/dependencies`,i);Object.assign(a,f)}n&&(i.removeInvalidData===!0&&(e.additionalProperties===!1||tt(e.additionalProperties)==="object")?tt(e.additionalProperties)==="object"&&Object.keys(n).forEach(f=>{a[f]==null&&t.isValid(n[f],e.additionalProperties)&&(a[f]=n[f])}):Object.keys(n).forEach(f=>a[f]==null&&(a[f]=n[f])));const c=im(t,e,a);if(c){const f=si(t,a,{type:"object",...c},r,i);Object.assign(a,f)}return a},array:(t,e,n,r,i)=>{var s,o;if(e.items==null)return n||[];const a=e.default===void 0?[]:e.default,l=n||a,u=i.extendDefaults===!1&&e.default!==void 0?0:e.minItems||0;if(Array.isArray(e.items)){for(let f=0,d=Math.max(u??0,(o=(s=e.items)===null||s===void 0?void 0:s.length)!==null&&o!==void 0?o:0);f0){const f=Math.max(u,l.length);for(let d=0;d(cs={},r?si(t,e,n,"#",{...WE,...r}):si(t,e,n,"#",WE));function J3(t,e,n=t.rootSchema,r="#"){return t.validate(e,n,r).length===0}function JE(t){const e=[];let n=0;const r=t.length;for(;n=55296&&i<=56319&&n!(t[e]===void 0||!VV.call(t,e)),Q3={additionalProperties:(t,e,n,r)=>{if(e.additionalProperties===!0||e.additionalProperties==null||tt(e.patternProperties)==="object"&&e.additionalProperties===!1)return;const i=[];let s=Object.keys(n).filter(a=>su.propertyBlacklist.includes(a)===!1);const o=Object.keys(e.properties||{});if(tt(e.patternProperties)==="object"){const a=Object.keys(e.patternProperties).map(l=>new RegExp(l));s=s.filter(l=>{for(let u=0;u{const i=tt(n);if(i==="object"||i==="array"){const s=JSON.stringify(n);for(let o=0;o{if(t.validateFormat[e.format])return t.validateFormat[e.format](t,e,n,r)},items:(t,e,n,r)=>{if(e.items===!1)return Array.isArray(n)&&n.length===0?void 0:t.errors.invalidDataError({pointer:r,value:n,schema:e});const i=[];for(let s=0;s{if(!isNaN(e.maximum)){if(e.maximum&&e.maximum{if(!isNaN(e.maxItems)&&e.maxItems{if(isNaN(e.maxLength))return;const i=JE(n).length;if(e.maxLength{const i=Object.keys(n).length;if(isNaN(e.maxProperties)===!1&&e.maxProperties{if(isNaN(e.minLength))return;const i=JE(n).length;if(e.minLength>i)return e.minLength===1?t.errors.minLengthOneError({minLength:e.minLength,length:i,pointer:r,schema:e,value:n}):t.errors.minLengthError({minLength:e.minLength,length:i,pointer:r,schema:e,value:n})},minimum:(t,e,n,r)=>{if(!isNaN(e.minimum)){if(e.minimum>n)return t.errors.minimumError({minimum:e.minimum,length:n,pointer:r,schema:e,value:n});if(e.exclusiveMinimum===!0&&e.minimum===n)return t.errors.minimumError({minimum:e.minimum,length:n,pointer:r,schema:e,value:n})}},minItems:(t,e,n,r)=>{if(!isNaN(e.minItems)&&e.minItems>n.length)return e.minItems===1?t.errors.minItemsOneError({minItems:e.minItems,length:n.length,pointer:r,schema:e,value:n}):t.errors.minItemsError({minItems:e.minItems,length:n.length,pointer:r,schema:e,value:n})},minProperties:(t,e,n,r)=>{if(isNaN(e.minProperties))return;const i=Object.keys(n).length;if(e.minProperties>i)return t.errors.minPropertiesError({minProperties:e.minProperties,length:i,pointer:r,schema:e,value:n})},multipleOf:(t,e,n,r)=>{if(isNaN(e.multipleOf)||typeof n!="number")return;const i=ZE(n),s=ZE(e.multipleOf);if(i>s)return t.errors.multipleOfError({multipleOf:e.multipleOf,value:n,pointer:r,schema:e});const o=Math.pow(10,s),a=Math.round(n*o),l=Math.round(e.multipleOf*o);if(a%l/o!==0)return t.errors.multipleOfError({multipleOf:e.multipleOf,value:n,pointer:r,schema:e})},not:(t,e,n,r)=>{const i=[];return t.validate(n,e.not,r).length===0&&i.push(t.errors.notError({value:n,not:e.not,pointer:r,schema:e})),i},oneOf:Vz,pattern:(t,e,n,r)=>{if(new RegExp(e.pattern,"u").test(n)===!1)return t.errors.patternError({pattern:e.pattern,description:e.patternExample||e.pattern,received:n,schema:e,value:n,pointer:r})},patternProperties:(t,e,n,r)=>{const i=e.properties||{},s=e.patternProperties;if(tt(s)!=="object")return;const o=[],a=Object.keys(n),l=Object.keys(s).map(u=>({regex:new RegExp(u),patternSchema:s[u]}));return a.forEach(u=>{let c=!1;for(let f=0,d=l.length;f0&&o.push(...h)}i[u]||c===!1&&e.additionalProperties===!1&&o.push(t.errors.patternPropertiesError({key:u,pointer:r,schema:e,value:n,patterns:Object.keys(s).join(",")}))}),o},properties:(t,e,n,r)=>{const i=[],s=Object.keys(e.properties||{});for(let o=0;o{const i=[],s=Object.keys(e.properties||{});for(let o=0;o{if(Array.isArray(e.required)!==!1)return e.required.map(i=>{if(!ew(n,i))return t.errors.requiredPropertyError({key:i,pointer:r,schema:e,value:n})})},requiredNotEmpty:(t,e,n,r)=>{if(Array.isArray(e.required)!==!1)return e.required.map(i=>{if(n[i]==null||n[i]==="")return t.errors.valueNotEmptyError({property:i,pointer:`${r}/${i}`,schema:e,value:n})})},uniqueItems:(t,e,n,r)=>{if((Array.isArray(n)&&e.uniqueItems)===!1)return;const i=[],s=[];return n.forEach((o,a)=>{for(let l=a+1;le.properties[n]=Oi(t[n]))),e.type==="array"&&Array.isArray(t)&&(t.length===1?e.items=Oi(t[0]):e.items=t.map(Oi)),e}const UV={array:(t,e,n,r,i)=>{const s=r==null?void 0:r[e],o=tt(n.items);if(o==="object")return IE(t,n.items,s,`${i}/${e}`)||t.resolveRef(n.items);if(o==="array"){if(n.items[e]===!0)return Oi(s);if(n.items[e]===!1)return t.errors.invalidDataError({key:e,value:s,pointer:i,schema:n});if(n.items[e])return t.resolveRef(n.items[e]);if(n.additionalItems===!1)return t.errors.additionalItemsError({key:e,value:s,pointer:i,schema:n});if(n.additionalItems===!0||n.additionalItems===void 0)return Oi(s);if(tt(n.additionalItems)==="object")return n.additionalItems;throw new Error(`Invalid schema ${JSON.stringify(n,null,2)} for ${JSON.stringify(r,null,2)}`)}return n.additionalItems!==!1&&s?Oi(s):new Error(`Invalid array schema for ${e} at ${i}`)},object:(t,e,n,r,i)=>{var s;n=IE(t,n,r,i);const o=(s=n==null?void 0:n.properties)===null||s===void 0?void 0:s[e];if(o!==void 0){if(o===!1)return t.errors.forbiddenPropertyError({property:e,value:r,pointer:i,schema:n});if(o===!0)return Oi(r==null?void 0:r[e]);const u=t.resolveRef(o);if(Nn(u))return u;if(u&&Array.isArray(u.oneOf)){const c=t.resolveOneOf(r[e],u,`${i}/${e}`);for(const f in u)f!=="oneOf"&&c[f]===void 0&&(c[f]=u[f]);return c}if(u)return u}const{patternProperties:a}=n;if(tt(a)==="object"){let u;const c=Object.keys(a);for(let f=0,d=c.length;ft.resolveRef(s));if(!((r=n.items)===null||r===void 0)&&r.oneOf)return n.items.oneOf.map(s=>t.resolveRef(s));const i=t.step(e,n,{},"#");return Nn(i)?i:[i]}const HV={array:(t,e,n,r)=>t.typeKeywords.array.filter(i=>e&&e[i]!=null).map(i=>t.validateKeyword[i](t,e,n,r)),object:(t,e,n,r)=>t.typeKeywords.object.filter(i=>e&&e[i]!=null).map(i=>t.validateKeyword[i](t,e,n,r)),string:(t,e,n,r)=>t.typeKeywords.string.filter(i=>e&&e[i]!=null).map(i=>t.validateKeyword[i](t,e,n,r)),integer:(t,e,n,r)=>t.typeKeywords.number.filter(i=>e&&e[i]!=null).map(i=>t.validateKeyword[i](t,e,n,r)),number:(t,e,n,r)=>t.typeKeywords.number.filter(i=>e&&e[i]!=null).map(i=>t.validateKeyword[i](t,e,n,r)),boolean:(t,e,n,r)=>t.typeKeywords.boolean.filter(i=>e&&e[i]!=null).map(i=>t.validateKeyword[i](t,e,n,r)),null:(t,e,n,r)=>t.typeKeywords.null.filter(i=>e&&e[i]!=null).map(i=>t.validateKeyword[i](t,e,n,r))};function qV(t,e){const n=tt(t);return n==="number"&&(e==="integer"||Array.isArray(e)&&e.includes("integer"))?Number.isInteger(t)||isNaN(t)?"integer":"number":n}function nO(t,e,n=t.rootSchema,r="#"){if(n=t.resolveRef(n),tt(n)==="boolean")return n?[]:[t.errors.invalidDataError({pointer:r,schema:n,value:e})];if(Nn(n))return[n];if(n.const!==void 0)return Z3(n.const,e)?[]:[t.errors.constError({pointer:r,schema:n,value:e,expected:n.const})];const i=qV(e,n.type),s=n.type||i;return i!==s&&(!Array.isArray(s)||!s.includes(i))?[t.errors.typeError({pointer:r,schema:n,value:e,received:i,expected:s})]:t.validateType[i]==null?[t.errors.invalidTypeError({pointer:r,schema:n,value:e,receivedType:i})]:Kc(t.validateType[i](t,n,e,r)).filter(Lp)}const GV={typeKeywords:{array:["allOf","anyOf","enum","items","maxItems","minItems","not","oneOf","uniqueItems"],boolean:["enum","not","allOf","anyOf","oneOf"],object:["additionalProperties","dependencies","enum","format","minProperties","maxProperties","patternProperties","properties","required","not","oneOf","allOf","anyOf"],string:["allOf","anyOf","enum","format","maxLength","minLength","not","oneOf","pattern"],number:["allOf","anyOf","enum","format","maximum","minimum","multipleOf","not","oneOf"],null:["allOf","anyOf","enum","format","not","oneOf"]},validateKeyword:Q3,validateType:HV,validateFormat:q3,errors:H3,addRemoteSchema:z3,compileSchema:yV,createSchemaOf:Oi,each:U3,eachSchema:sm,getChildSchemaSelection:tO,getSchema:W3,getTemplate:Y3,isValid:J3,resolveAllOf:R3,resolveAnyOf:B3,resolveOneOf:x3,resolveRef:M3,step:eO,validate:nO,templateDefaultOptions:su.templateDefaultOptions};class rO extends $3{constructor(e,n={}){super(qv(GV,n),e)}}const tw="__compiled",nw="__ref",WV="getRef",KV="getRoot",XV=/(#|\/)+$/g;function YV(t,e,n=e,r=!1){if(e===!0||e===!1||e===void 0||e[tw]!==void 0)return e;const i={ids:{},remotes:t.remotes},s=JSON.stringify(e),o=JSON.parse(s);if(Object.defineProperty(o,tw,{enumerable:!1,value:!0}),Object.defineProperty(o,WV,{enumerable:!1,value:is.bind(null,i,o)}),r===!1&&s.includes("$ref")===!1)return o;o!==n&&Object.defineProperty(o,"$defs",{enumerable:!0,value:Object.assign({},n.definitions,n.$defs,o.definitions,o.$defs)});const a={},l=()=>o;return sm(o,(u,c)=>{var f;if(u.$id){if(u.$id.startsWith("http")&&/(allOf|anyOf|oneOf)\/\d+$/.test(c)){const g=c.replace(/\/(allOf|anyOf|oneOf)\/\d+$/,""),b=Go.get(o,g);u.$id=(f=b.$id)!==null&&f!==void 0?f:u.$id}i.ids[u.$id.replace(XV,"")]=c}c=`#${c}`.replace(/##+/,"#");const d=c.replace(/\/[^/]+$/,""),h=c.replace(/\/[^/]+\/[^/]+$/,""),p=a[d]||a[h],m=Vp(p,u.$id);a[c]=m,i.ids[m]==null&&(i.ids[m]=c),u.$ref&&!u[nw]&&(Object.defineProperty(u,nw,{enumerable:!1,value:Vp(m,u.$ref)}),Object.defineProperty(u,KV,{enumerable:!1,value:l}))}),o}const JV={...Q3,contains:(t,e,n,r)=>{if(e.contains===!1)return t.errors.containsArrayError({pointer:r,value:n,schema:e});if(e.contains===!0)return Array.isArray(n)&&n.length===0?t.errors.containsAnyError({pointer:r,value:n,schema:e}):void 0;if(tt(e.contains)==="object"){for(let i=0;i{if(!isNaN(e.exclusiveMaximum)&&e.exclusiveMaximum<=n)return t.errors.maximumError({maximum:e.exclusiveMaximum,length:n,pointer:r,schema:e,value:n})},exclusiveMinimum:(t,e,n,r)=>{if(!isNaN(e.exclusiveMinimum)&&e.exclusiveMinimum>=n)return t.errors.minimumError({minimum:e.exclusiveMinimum,length:n,pointer:r,schema:e,value:n})},if:Dj,maximum:(t,e,n,r)=>{if(!isNaN(e.maximum)&&e.maximum&&e.maximum{if(!isNaN(e.minimum)&&e.minimum>n)return t.errors.minimumError({minimum:e.minimum,length:n,pointer:r,schema:e,value:n})},patternProperties:(t,e,n,r)=>{const i=e.properties||{},s=e.patternProperties;if(tt(s)!=="object")return;const o=[],a=Object.keys(n),l=Object.keys(s).map(u=>({regex:new RegExp(u),patternSchema:s[u]}));return a.forEach(u=>{let c=!1;for(let f=0,d=l.length;f0&&o.push(...h)}i[u]||c===!1&&e.additionalProperties===!1&&o.push(t.errors.patternPropertiesError({key:u,pointer:r,patterns:Object.keys(s).join(","),schema:e,value:n}))}),o},propertyNames:(t,e,n,r)=>{if(e.propertyNames===!1)return Object.keys(n).length===0?void 0:t.errors.invalidPropertyNameError({property:Object.keys(n),pointer:r,value:n,schema:e});if(e.propertyNames===!0||tt(e.propertyNames)!=="object")return;const i=[],s=Object.keys(n),o={...e.propertyNames,type:"string"};return s.forEach(a=>{const l=t.validate(a,o,`${r}/${a}`);l.length>0&&i.push(t.errors.invalidPropertyNameError({property:a,pointer:r,validationError:l[0],value:n[a],schema:e}))}),i}},ZV={array:(t,e,n,r)=>t.typeKeywords.array.filter(i=>e&&e[i]!=null).map(i=>t.validateKeyword[i](t,e,n,r)),object:(t,e,n,r)=>t.typeKeywords.object.filter(i=>e&&e[i]!=null).map(i=>t.validateKeyword[i](t,e,n,r)),string:(t,e,n,r)=>t.typeKeywords.string.filter(i=>e&&e[i]!=null).map(i=>t.validateKeyword[i](t,e,n,r)),integer:(t,e,n,r)=>t.typeKeywords.number.filter(i=>e&&e[i]!=null).map(i=>t.validateKeyword[i](t,e,n,r)),number:(t,e,n,r)=>t.typeKeywords.number.filter(i=>e&&e[i]!=null).map(i=>t.validateKeyword[i](t,e,n,r)),boolean:(t,e,n,r)=>t.typeKeywords.boolean.filter(i=>e&&e[i]!=null).map(i=>t.validateKeyword[i](t,e,n,r)),null:(t,e,n,r)=>t.typeKeywords.null.filter(i=>e&&e[i]!=null).map(i=>t.validateKeyword[i](t,e,n,r))},iO={typeKeywords:{array:["allOf","anyOf","contains","enum","if","items","maxItems","minItems","not","oneOf","uniqueItems"],boolean:["allOf","anyOf","enum","not","oneOf"],object:["additionalProperties","allOf","anyOf","dependencies","enum","format","if","maxProperties","minProperties","not","oneOf","patternProperties","properties","propertyNames","required"],string:["allOf","anyOf","enum","format","if","maxLength","minLength","not","oneOf","pattern"],number:["allOf","anyOf","enum","exclusiveMaximum","exclusiveMinimum","format","if","maximum","minimum","multipleOf","not","oneOf"],null:["allOf","anyOf","enum","format","not","oneOf"]},validateKeyword:JV,validateType:ZV,validateFormat:q3,errors:H3,addRemoteSchema:z3,compileSchema:YV,createSchemaOf:Oi,each:U3,eachSchema:sm,getChildSchemaSelection:tO,getSchema:W3,getTemplate:Y3,isValid:J3,resolveAllOf:R3,resolveAnyOf:B3,resolveOneOf:x3,resolveRef:M3,step:eO,validate:nO,templateDefaultOptions:su.templateDefaultOptions};class sO extends $3{constructor(e,n={}){super(qv(iO,n),e)}}({...iO});function Ci(t,e,n=[]){const r=document.createElement(t);return Object.entries(e).forEach(([i,s])=>{if(i==="text"){r.innerText=s;return}if(i==="inner"){r.innerHTML=s;return}r.setAttribute(i,s)}),n.forEach(i=>r.appendChild(i)),r}const rw={};function QV(t){let e=rw[t];if(e)return e;e=rw[t]=[];for(let n=0;n<128;n++){const r=String.fromCharCode(n);e.push(r)}for(let n=0;n=55296&&c<=57343?i+="���":i+=String.fromCharCode(c),s+=6;continue}}if((a&248)===240&&s+91114111?i+="����":(f-=65536,i+=String.fromCharCode(55296+(f>>10),56320+(f&1023))),s+=9;continue}}i+="�"}return i})}Ml.defaultChars=";/?:@&=+$,#";Ml.componentChars="";const iw={};function eU(t){let e=iw[t];if(e)return e;e=iw[t]=[];for(let n=0;n<128;n++){const r=String.fromCharCode(n);/^[0-9a-z]$/i.test(r)?e.push(r):e.push("%"+("0"+n.toString(16).toUpperCase()).slice(-2))}for(let n=0;n"u"&&(n=!0);const r=eU(e);let i="";for(let s=0,o=t.length;s=55296&&a<=57343){if(a>=55296&&a<=56319&&s+1=56320&&l<=57343){i+=encodeURIComponent(t[s]+t[s+1]),s++;continue}}i+="%EF%BF%BD";continue}i+=encodeURIComponent(t[s])}return i}Uf.defaultChars=";/?:@&=+$,-_.!~*'()#";Uf.componentChars="-_.!~*'()";function Yv(t){let e="";return e+=t.protocol||"",e+=t.slashes?"//":"",e+=t.auth?t.auth+"@":"",t.hostname&&t.hostname.indexOf(":")!==-1?e+="["+t.hostname+"]":e+=t.hostname||"",e+=t.port?":"+t.port:"",e+=t.pathname||"",e+=t.search||"",e+=t.hash||"",e}function Up(){this.protocol=null,this.slashes=null,this.auth=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.pathname=null}const tU=/^([a-z0-9.+-]+:)/i,nU=/:[0-9]*$/,rU=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,iU=["<",">",'"',"`"," ","\r",` -`," "],sU=["{","}","|","\\","^","`"].concat(iU),oU=["'"].concat(sU),sw=["%","/","?",";","#"].concat(oU),ow=["/","?","#"],aU=255,aw=/^[+a-z0-9A-Z_-]{0,63}$/,lU=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,lw={javascript:!0,"javascript:":!0},uw={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function Jv(t,e){if(t&&t instanceof Up)return t;const n=new Up;return n.parse(t,e),n}Up.prototype.parse=function(t,e){let n,r,i,s=t;if(s=s.trim(),!e&&t.split("#").length===1){const u=rU.exec(s);if(u)return this.pathname=u[1],u[2]&&(this.search=u[2]),this}let o=tU.exec(s);if(o&&(o=o[0],n=o.toLowerCase(),this.protocol=o,s=s.substr(o.length)),(e||o||s.match(/^\/\/[^@\/]+@[^@\/]+/))&&(i=s.substr(0,2)==="//",i&&!(o&&lw[o])&&(s=s.substr(2),this.slashes=!0)),!lw[o]&&(i||o&&!uw[o])){let u=-1;for(let p=0;p127?y+="x":y+=b[x];if(!y.match(aw)){const x=p.slice(0,m),S=p.slice(m+1),E=b.match(lU);E&&(x.push(E[1]),S.unshift(E[2])),S.length&&(s=S.join(".")+s),this.hostname=x.join(".");break}}}}this.hostname.length>aU&&(this.hostname=""),h&&(this.hostname=this.hostname.substr(1,this.hostname.length-2))}const a=s.indexOf("#");a!==-1&&(this.hash=s.substr(a),s=s.slice(0,a));const l=s.indexOf("?");return l!==-1&&(this.search=s.substr(l),s=s.slice(0,l)),s&&(this.pathname=s),uw[n]&&this.hostname&&!this.pathname&&(this.pathname=""),this};Up.prototype.parseHost=function(t){let e=nU.exec(t);e&&(e=e[0],e!==":"&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)};const uU=Object.freeze(Object.defineProperty({__proto__:null,decode:Ml,encode:Uf,format:Yv,parse:Jv},Symbol.toStringTag,{value:"Module"})),oO=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,aO=/[\0-\x1F\x7F-\x9F]/,cU=/[\xAD\u0600-\u0605\u061C\u06DD\u070F\u0890\u0891\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB]|\uD804[\uDCBD\uDCCD]|\uD80D[\uDC30-\uDC3F]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]/,Zv=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061D-\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1B7D\u1B7E\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDEAD\uDF55-\uDF59\uDF86-\uDF89]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5A\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDEB9\uDF3C-\uDF3E]|\uD806[\uDC3B\uDD44-\uDD46\uDDE2\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2\uDF00-\uDF09]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8\uDF43-\uDF4F\uDFFF]|\uD809[\uDC70-\uDC74]|\uD80B[\uDFF1\uDFF2]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A\uDFE2]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]/,lO=/[\$\+<->\^`\|~\xA2-\xA6\xA8\xA9\xAC\xAE-\xB1\xB4\xB8\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0384\u0385\u03F6\u0482\u058D-\u058F\u0606-\u0608\u060B\u060E\u060F\u06DE\u06E9\u06FD\u06FE\u07F6\u07FE\u07FF\u0888\u09F2\u09F3\u09FA\u09FB\u0AF1\u0B70\u0BF3-\u0BFA\u0C7F\u0D4F\u0D79\u0E3F\u0F01-\u0F03\u0F13\u0F15-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE\u0FCF\u0FD5-\u0FD8\u109E\u109F\u1390-\u1399\u166D\u17DB\u1940\u19DE-\u19FF\u1B61-\u1B6A\u1B74-\u1B7C\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2044\u2052\u207A-\u207C\u208A-\u208C\u20A0-\u20C0\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u218A\u218B\u2190-\u2307\u230C-\u2328\u232B-\u2426\u2440-\u244A\u249C-\u24E9\u2500-\u2767\u2794-\u27C4\u27C7-\u27E5\u27F0-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2B73\u2B76-\u2B95\u2B97-\u2BFF\u2CE5-\u2CEA\u2E50\u2E51\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFF\u3004\u3012\u3013\u3020\u3036\u3037\u303E\u303F\u309B\u309C\u3190\u3191\u3196-\u319F\u31C0-\u31E3\u31EF\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA700-\uA716\uA720\uA721\uA789\uA78A\uA828-\uA82B\uA836-\uA839\uAA77-\uAA79\uAB5B\uAB6A\uAB6B\uFB29\uFBB2-\uFBC2\uFD40-\uFD4F\uFDCF\uFDFC-\uFDFF\uFE62\uFE64-\uFE66\uFE69\uFF04\uFF0B\uFF1C-\uFF1E\uFF3E\uFF40\uFF5C\uFF5E\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFFC\uFFFD]|\uD800[\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9C\uDDA0\uDDD0-\uDDFC]|\uD802[\uDC77\uDC78\uDEC8]|\uD805\uDF3F|\uD807[\uDFD5-\uDFF1]|\uD81A[\uDF3C-\uDF3F\uDF45]|\uD82F\uDC9C|\uD833[\uDF50-\uDFC3]|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDEA\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85\uDE86]|\uD838[\uDD4F\uDEFF]|\uD83B[\uDCAC\uDCB0\uDD2E\uDEF0\uDEF1]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD0D-\uDDAD\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED7\uDEDC-\uDEEC\uDEF0-\uDEFC\uDF00-\uDF76\uDF7B-\uDFD9\uDFE0-\uDFEB\uDFF0]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDCB0\uDCB1\uDD00-\uDE53\uDE60-\uDE6D\uDE70-\uDE7C\uDE80-\uDE88\uDE90-\uDEBD\uDEBF-\uDEC5\uDECE-\uDEDB\uDEE0-\uDEE8\uDEF0-\uDEF8\uDF00-\uDF92\uDF94-\uDFCA]/,uO=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/,fU=Object.freeze(Object.defineProperty({__proto__:null,Any:oO,Cc:aO,Cf:cU,P:Zv,S:lO,Z:uO},Symbol.toStringTag,{value:"Module"})),dU=new Uint16Array('ᵁ<Õıʊҝջאٵ۞ޢߖࠏ੊ઑඡ๭༉༦჊ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ὾⁠↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms„‹•˜¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲ΂ϏϢϸontourIntegraìȹoɴ͹\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՗՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲ׌y;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱cò׋؀JTabcdfgorstר׬ׯ׺؀ؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d׷׸䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇܎ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ޷޼߂ߐĀiyޱ޵rc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄΀HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶߻dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣ঳সে্਷ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗ࡜ࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४Ānrࢃ࢏gleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpw৔ਖਛgȀLRlr৞৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼੝੠੷੼અઋ઎p;椅y;䐜Ādl੥੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑ඗ඞcy;䐊cute;䅃ƀaey઴હાron;䅇dil;䅅;䐝ƀgswે૰଎ativeƀMTV૓૟૨ediumSpace;怋hiĀcn૦૘ë૙eryThiî૙tedĀGL૸ଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷ଺reak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪୼஡௫ఄ౞಄ದ೘ൡඅ櫬Āou୛୤ngruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊ஛ement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater΀;EFGLSTஶஷ஽௉௓௘௥扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲௽ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ೒拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨೹setĀ;E೰ೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂ෉෕ෛ෠෧෼ขภยา฿ไlig;䅒cute耻Ó䃓Āiy෎ීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲ෶cr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬื฼de耻Õ䃕es;樷ml耻Ö䃖erĀBP๋๠Āar๐๓r;怾acĀek๚๜;揞et;掴arenthesis;揜Ҁacfhilors๿ງຊຏຒດຝະ໼rtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ໠໤檻cedesȀ;EST່້໏໚扺qual;檯lantEqual;扼ilde;找me;怳Ādp໩໮uct;戏ortionĀ;aȥ໹l;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬؀BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁࿫࿳ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL࿜࿝࿡憒ar;懥eftArrow;懄eiling;按oǵ࿹\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»࿝pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄ቉ቕ቞ቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHc቎ቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗Āeiቻ኉Dzኀ\0ኇefore;戴a;䎘Ācn኎ኘkSpace;쀀  Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0᏿ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0጖y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻፿on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtè૙a;䎖r;愨pf;愤cr;쀀𝒵௡ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚΀;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒΀;Eaeiop዁ᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;e዁ᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;e዁ᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰ᜼ᝃᝈ᝸᝽០៦ᠹᡐᜍ᤽᥈ᥰot;櫭Ācrᛶ᜞kȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e᜚᜛戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;t፜᜷brk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓ᝛ᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯ᝱ᝳ;䎲;愶een;扬r;쀀𝔟g΀costuvwឍឝឳេ៕៛៞ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀako៭ᠦᠵĀcn៲ᠣkƀlst៺֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘᠝斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈؀DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬ᣿ᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教΀;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ᣷᣹᣻᣽;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ᤟;敛;敘;攘;攔΀;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģ᥂bar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;e᜚᜜lƀ;bhᥨᥩᥫ䁜;槅sub;柈Ŭᥴ᥾lĀ;e᥹᥺怢t»᥺pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭍᭒\0᯽\0ᰌƀcpr᦭ᦲ᧝ute;䄇̀;abcdsᦿᧀᧄ᧊᧕᧙戩nd;橄rcup;橉Āau᧏᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r΀;Ecefms᩟᩠ᩢᩫ᪤᪪᪮旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖᪚᪟»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇᫔᫺\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ᫙\0\0᫢aĀ;t᫞᫟䀬;䁀ƀ;fl᫨᫩᫫戁îᅠeĀmx᫱᫶ent»᫩eóɍǧ᫾\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯΀delprvw᭠᭬᭷ᮂᮬᯔ᯹arrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;p᭿ᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰸᰻᰿ᱝᱩᱵᲊᲞᲬᲷ᳻᳿ᴍᵻᶑᶫᶻ᷆᷍rò΁ar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂͸᳖᳜᳠mƀ;oș᳊᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄ὎὚ĀDoḆᴴoôᲉĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»Ṻƀaeiἒ἖Ἒls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙ῜ῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao‌⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧‪‬\0‮耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₟₥₰₴⃰⃵⃺⃿℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕ₝ute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽⃉ƀ;qsؾٌ⃄lanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqr׮ⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0↎proø₞r;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢␧␭␱␵␻ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀஀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼rò৆òΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonó྘quigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d྘➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ᠛旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐௏쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop඄⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roø඄urĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻 ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓΀;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨í஘istĀ;s஠டr;쀀𝔫ȀEest௅⩦⩹⩼ƀ;qs஼⩭௡ƀ;qs஼௅⩴lanô௢ií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚΀AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs఻⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs఻⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast୻⭕⭚⭟lleì୻l;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖ΀chimpqu⮽⯍⯙⬄୸⯤⯯Ȁ;cerല⯆ഷ⯉uå൅;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭å೸åഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñ೗Ā;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰⳴ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥ⵲ⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;c᪞ⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācr⵩⵭ir;榿;쀀𝔬ͯ⵹\0\0⵼\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕ⶘ⶥⶨrò᪀Āir⶝ⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔ⷗ǒr;榷rp;榹΀;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ⹞\0⹽\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ⹧⹲຅脀¶;l⹭⹮䂶leìЃɩ⹸\0\0⹻m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳⻴ᤈ⻹⻽⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp໬⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t໻⾴ï໻rel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⿚⋢⿟⿥⿫⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei⿾々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔઀ABHabcdefhilmnoprstux぀けさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤΀cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstw࿜ガクシスゼゾダッデナp;極Ā;f࿠ゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes㄂㄄;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ì࿲âヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘㇤㇮rrowĀ;t࿜ㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowó࿪arpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓rò࿪aòՑ;怏oustĀ;a㈞㈟掱che»㈟mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦΀Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼਴t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì⹯耻­䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;q኱ኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫ਩war;椪lig耻ß䃟௡㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rë๟ƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproø዁im»ኬsðኞĀas㚺㚮ð዁rn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈ΀adempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xô᝷headĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜΀eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roð໻tré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚΀cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜ៟tré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌'.split("").map(t=>t.charCodeAt(0))),hU=new Uint16Array("Ȁaglq \x1Bɭ\0\0p;䀦os;䀧t;䀾t;䀼uot;䀢".split("").map(t=>t.charCodeAt(0)));var Vg;const pU=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]),mU=(Vg=String.fromCodePoint)!==null&&Vg!==void 0?Vg:function(t){let e="";return t>65535&&(t-=65536,e+=String.fromCharCode(t>>>10&1023|55296),t=56320|t&1023),e+=String.fromCharCode(t),e};function gU(t){var e;return t>=55296&&t<=57343||t>1114111?65533:(e=pU.get(t))!==null&&e!==void 0?e:t}var mn;(function(t){t[t.NUM=35]="NUM",t[t.SEMI=59]="SEMI",t[t.EQUALS=61]="EQUALS",t[t.ZERO=48]="ZERO",t[t.NINE=57]="NINE",t[t.LOWER_A=97]="LOWER_A",t[t.LOWER_F=102]="LOWER_F",t[t.LOWER_X=120]="LOWER_X",t[t.LOWER_Z=122]="LOWER_Z",t[t.UPPER_A=65]="UPPER_A",t[t.UPPER_F=70]="UPPER_F",t[t.UPPER_Z=90]="UPPER_Z"})(mn||(mn={}));const bU=32;var Ys;(function(t){t[t.VALUE_LENGTH=49152]="VALUE_LENGTH",t[t.BRANCH_LENGTH=16256]="BRANCH_LENGTH",t[t.JUMP_TABLE=127]="JUMP_TABLE"})(Ys||(Ys={}));function Kb(t){return t>=mn.ZERO&&t<=mn.NINE}function yU(t){return t>=mn.UPPER_A&&t<=mn.UPPER_F||t>=mn.LOWER_A&&t<=mn.LOWER_F}function vU(t){return t>=mn.UPPER_A&&t<=mn.UPPER_Z||t>=mn.LOWER_A&&t<=mn.LOWER_Z||Kb(t)}function xU(t){return t===mn.EQUALS||vU(t)}var un;(function(t){t[t.EntityStart=0]="EntityStart",t[t.NumericStart=1]="NumericStart",t[t.NumericDecimal=2]="NumericDecimal",t[t.NumericHex=3]="NumericHex",t[t.NamedEntity=4]="NamedEntity"})(un||(un={}));var Vs;(function(t){t[t.Legacy=0]="Legacy",t[t.Strict=1]="Strict",t[t.Attribute=2]="Attribute"})(Vs||(Vs={}));class SU{constructor(e,n,r){this.decodeTree=e,this.emitCodePoint=n,this.errors=r,this.state=un.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=Vs.Strict}startEntity(e){this.decodeMode=e,this.state=un.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(e,n){switch(this.state){case un.EntityStart:return e.charCodeAt(n)===mn.NUM?(this.state=un.NumericStart,this.consumed+=1,this.stateNumericStart(e,n+1)):(this.state=un.NamedEntity,this.stateNamedEntity(e,n));case un.NumericStart:return this.stateNumericStart(e,n);case un.NumericDecimal:return this.stateNumericDecimal(e,n);case un.NumericHex:return this.stateNumericHex(e,n);case un.NamedEntity:return this.stateNamedEntity(e,n)}}stateNumericStart(e,n){return n>=e.length?-1:(e.charCodeAt(n)|bU)===mn.LOWER_X?(this.state=un.NumericHex,this.consumed+=1,this.stateNumericHex(e,n+1)):(this.state=un.NumericDecimal,this.stateNumericDecimal(e,n))}addToNumericResult(e,n,r,i){if(n!==r){const s=r-n;this.result=this.result*Math.pow(i,s)+parseInt(e.substr(n,s),i),this.consumed+=s}}stateNumericHex(e,n){const r=n;for(;n>14;for(;n>14,s!==0){if(o===mn.SEMI)return this.emitNamedEntityData(this.treeIndex,s,this.consumed+this.excess);this.decodeMode!==Vs.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var e;const{result:n,decodeTree:r}=this,i=(r[n]&Ys.VALUE_LENGTH)>>14;return this.emitNamedEntityData(n,i,this.consumed),(e=this.errors)===null||e===void 0||e.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(e,n,r){const{decodeTree:i}=this;return this.emitCodePoint(n===1?i[e]&~Ys.VALUE_LENGTH:i[e+1],r),n===3&&this.emitCodePoint(i[e+2],r),r}end(){var e;switch(this.state){case un.NamedEntity:return this.result!==0&&(this.decodeMode!==Vs.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case un.NumericDecimal:return this.emitNumericEntity(0,2);case un.NumericHex:return this.emitNumericEntity(0,3);case un.NumericStart:return(e=this.errors)===null||e===void 0||e.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case un.EntityStart:return 0}}}function cO(t){let e="";const n=new SU(t,r=>e+=mU(r));return function(i,s){let o=0,a=0;for(;(a=i.indexOf("&",a))>=0;){e+=i.slice(o,a),n.startEntity(s);const u=n.write(i,a+1);if(u<0){o=a+n.end();break}o=a+u,a=u===0?o+1:o}const l=e+i.slice(o);return e="",l}}function EU(t,e,n,r){const i=(e&Ys.BRANCH_LENGTH)>>7,s=e&Ys.JUMP_TABLE;if(i===0)return s!==0&&r===s?n:-1;if(s){const l=r-s;return l<0||l>=i?-1:t[n+l]-1}let o=n,a=o+i-1;for(;o<=a;){const l=o+a>>>1,u=t[l];if(ur)a=l-1;else return t[l+i]}return-1}const wU=cO(dU);cO(hU);function fO(t,e=Vs.Legacy){return wU(t,e)}function _U(t){return Object.prototype.toString.call(t)}function Qv(t){return _U(t)==="[object String]"}const CU=Object.prototype.hasOwnProperty;function AU(t,e){return CU.call(t,e)}function om(t){return Array.prototype.slice.call(arguments,1).forEach(function(n){if(n){if(typeof n!="object")throw new TypeError(n+"must be object");Object.keys(n).forEach(function(r){t[r]=n[r]})}}),t}function dO(t,e,n){return[].concat(t.slice(0,e),n,t.slice(e+1))}function e2(t){return!(t>=55296&&t<=57343||t>=64976&&t<=65007||(t&65535)===65535||(t&65535)===65534||t>=0&&t<=8||t===11||t>=14&&t<=31||t>=127&&t<=159||t>1114111)}function Hp(t){if(t>65535){t-=65536;const e=55296+(t>>10),n=56320+(t&1023);return String.fromCharCode(e,n)}return String.fromCharCode(t)}const hO=/\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g,DU=/&([a-z#][a-z0-9]{1,31});/gi,kU=new RegExp(hO.source+"|"+DU.source,"gi"),OU=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))$/i;function TU(t,e){if(e.charCodeAt(0)===35&&OU.test(e)){const r=e[1].toLowerCase()==="x"?parseInt(e.slice(2),16):parseInt(e.slice(1),10);return e2(r)?Hp(r):t}const n=fO(t);return n!==t?n:t}function IU(t){return t.indexOf("\\")<0?t:t.replace(hO,"$1")}function Fl(t){return t.indexOf("\\")<0&&t.indexOf("&")<0?t:t.replace(kU,function(e,n,r){return n||TU(e,r)})}const PU=/[&<>"]/,RU=/[&<>"]/g,NU={"&":"&","<":"<",">":">",'"':"""};function MU(t){return NU[t]}function vo(t){return PU.test(t)?t.replace(RU,MU):t}const FU=/[.?*+^$[\]\\(){}|-]/g;function LU(t){return t.replace(FU,"\\$&")}function mt(t){switch(t){case 9:case 32:return!0}return!1}function Jc(t){if(t>=8192&&t<=8202)return!0;switch(t){case 9:case 10:case 11:case 12:case 13:case 32:case 160:case 5760:case 8239:case 8287:case 12288:return!0}return!1}function Zc(t){return Zv.test(t)||lO.test(t)}function Qc(t){switch(t){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 58:case 59:case 60:case 61:case 62:case 63:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 124:case 125:case 126:return!0;default:return!1}}function am(t){return t=t.trim().replace(/\s+/g," "),"ẞ".toLowerCase()==="Ṿ"&&(t=t.replace(/ẞ/g,"ß")),t.toLowerCase().toUpperCase()}const BU={mdurl:uU,ucmicro:fU},$U=Object.freeze(Object.defineProperty({__proto__:null,arrayReplaceAt:dO,assign:om,escapeHtml:vo,escapeRE:LU,fromCodePoint:Hp,has:AU,isMdAsciiPunct:Qc,isPunctChar:Zc,isSpace:mt,isString:Qv,isValidEntityCode:e2,isWhiteSpace:Jc,lib:BU,normalizeReference:am,unescapeAll:Fl,unescapeMd:IU},Symbol.toStringTag,{value:"Module"}));function zU(t,e,n){let r,i,s,o;const a=t.posMax,l=t.pos;for(t.pos=e+1,r=1;t.pos32))return s;if(r===41){if(o===0)break;o--}i++}return e===i||o!==0||(s.str=Fl(t.slice(e,i)),s.pos=i,s.ok=!0),s}function VU(t,e,n,r){let i,s=e;const o={ok:!1,can_continue:!1,pos:0,str:"",marker:0};if(r)o.str=r.str,o.marker=r.marker;else{if(s>=n)return o;let a=t.charCodeAt(s);if(a!==34&&a!==39&&a!==40)return o;e++,s++,a===40&&(a=41),o.marker=a}for(;s"+vo(s.content)+""};Ji.code_block=function(t,e,n,r,i){const s=t[e];return""+vo(t[e].content)+` +`)},o.prototype.displayStateStack=function(u,c){for(var f,d=0,h=0;h0&&c.push(" ^ "+d+" more lines identical to this"),d=0,c.push(" "+m)),f=m}},o.prototype.getSymbolDisplay=function(u){return a(u)},o.prototype.buildFirstStateStack=function(u,c){if(c.indexOf(u)!==-1)return null;if(u.wantedBy.length===0)return[u];var f=u.wantedBy[0],d=[u].concat(c),h=this.buildFirstStateStack(f,d);return h===null?null:[u].concat(h)},o.prototype.save=function(){var u=this.table[this.current];return u.lexerState=this.lexerState,u},o.prototype.restore=function(u){var c=u.index;this.current=c,this.table[c]=u,this.table.splice(c+1),this.lexerState=u.lexerState,this.results=this.finish()},o.prototype.rewind=function(u){if(!this.options.keepHistory)throw new Error("set option `keepHistory` to enable rewinding");this.restore(this.table[u])},o.prototype.finish=function(){var u=[],c=this.grammar.start,f=this.table[this.table.length-1];return f.states.forEach(function(d){d.rule.name===c&&d.dot===d.rule.symbols.length&&d.reference===0&&d.data!==o.fail&&u.push(d)}),u.map(function(d){return d.data})};function a(u){var c=typeof u;if(c==="string")return u;if(c==="object"){if(u.literal)return JSON.stringify(u.literal);if(u instanceof RegExp)return"character matching "+u;if(u.type)return u.type+" token";if(u.test)return"token matching "+String(u.test);throw new Error("Unknown symbol type: "+u)}}function l(u){var c=typeof u;if(c==="string")return u;if(c==="object"){if(u.literal)return JSON.stringify(u.literal);if(u instanceof RegExp)return u.toString();if(u.type)return"%"+u.type;if(u.test)return"<"+String(u.test)+">";throw new Error("Unknown symbol type: "+u)}}return{Parser:o,Grammar:i,Rule:e}})})(zh)),zh.exports}var qd={},GE;function CV(){if(GE)return qd;GE=1,Object.defineProperty(qd,"__esModule",{value:!0});function t(i){return i[0]}const e=i=>[].concat(...i.map(s=>Array.isArray(s)?e(s):s));function n(i){return i?Array.isArray(i)?e(i).join(""):i:""}const r={Lexer:void 0,ParserRules:[{name:"Reverse_path",symbols:["Path"]},{name:"Reverse_path$string$1",symbols:[{literal:"<"},{literal:">"}],postprocess:i=>i.join("")},{name:"Reverse_path",symbols:["Reverse_path$string$1"]},{name:"Forward_path$subexpression$1$subexpression$1",symbols:[{literal:"<"},/[pP]/,/[oO]/,/[sS]/,/[tT]/,/[mM]/,/[aA]/,/[sS]/,/[tT]/,/[eE]/,/[rR]/,{literal:"@"}],postprocess:function(i){return i.join("")}},{name:"Forward_path$subexpression$1",symbols:["Forward_path$subexpression$1$subexpression$1","Domain",{literal:">"}]},{name:"Forward_path",symbols:["Forward_path$subexpression$1"]},{name:"Forward_path$subexpression$2",symbols:[{literal:"<"},/[pP]/,/[oO]/,/[sS]/,/[tT]/,/[mM]/,/[aA]/,/[sS]/,/[tT]/,/[eE]/,/[rR]/,{literal:">"}],postprocess:function(i){return i.join("")}},{name:"Forward_path",symbols:["Forward_path$subexpression$2"]},{name:"Forward_path",symbols:["Path"]},{name:"Path$ebnf$1$subexpression$1",symbols:["A_d_l",{literal:":"}]},{name:"Path$ebnf$1",symbols:["Path$ebnf$1$subexpression$1"],postprocess:t},{name:"Path$ebnf$1",symbols:[],postprocess:()=>null},{name:"Path",symbols:[{literal:"<"},"Path$ebnf$1","Mailbox",{literal:">"}]},{name:"A_d_l$ebnf$1",symbols:[]},{name:"A_d_l$ebnf$1$subexpression$1",symbols:[{literal:","},"At_domain"]},{name:"A_d_l$ebnf$1",symbols:["A_d_l$ebnf$1","A_d_l$ebnf$1$subexpression$1"],postprocess:i=>i[0].concat([i[1]])},{name:"A_d_l",symbols:["At_domain","A_d_l$ebnf$1"]},{name:"At_domain",symbols:[{literal:"@"},"Domain"]},{name:"Domain$ebnf$1",symbols:[]},{name:"Domain$ebnf$1$subexpression$1",symbols:[{literal:"."},"sub_domain"]},{name:"Domain$ebnf$1",symbols:["Domain$ebnf$1","Domain$ebnf$1$subexpression$1"],postprocess:i=>i[0].concat([i[1]])},{name:"Domain",symbols:["sub_domain","Domain$ebnf$1"]},{name:"sub_domain",symbols:["U_label"]},{name:"Let_dig",symbols:["ALPHA_DIGIT"],postprocess:t},{name:"Ldh_str$ebnf$1",symbols:[]},{name:"Ldh_str$ebnf$1",symbols:["Ldh_str$ebnf$1","ALPHA_DIG_DASH"],postprocess:i=>i[0].concat([i[1]])},{name:"Ldh_str",symbols:["Ldh_str$ebnf$1","Let_dig"]},{name:"U_Let_dig",symbols:["ALPHA_DIGIT_U"],postprocess:t},{name:"U_Ldh_str$ebnf$1",symbols:[]},{name:"U_Ldh_str$ebnf$1",symbols:["U_Ldh_str$ebnf$1","ALPHA_DIG_DASH_U"],postprocess:i=>i[0].concat([i[1]])},{name:"U_Ldh_str",symbols:["U_Ldh_str$ebnf$1","U_Let_dig"]},{name:"U_label$ebnf$1$subexpression$1",symbols:["U_Ldh_str"]},{name:"U_label$ebnf$1",symbols:["U_label$ebnf$1$subexpression$1"],postprocess:t},{name:"U_label$ebnf$1",symbols:[],postprocess:()=>null},{name:"U_label",symbols:["U_Let_dig","U_label$ebnf$1"]},{name:"address_literal$subexpression$1",symbols:["IPv4_address_literal"]},{name:"address_literal$subexpression$1",symbols:["IPv6_address_literal"]},{name:"address_literal$subexpression$1",symbols:["General_address_literal"]},{name:"address_literal",symbols:[{literal:"["},"address_literal$subexpression$1",{literal:"]"}]},{name:"non_local_part",symbols:["Domain"],postprocess:function(i){return{DomainName:n(i[0])}}},{name:"non_local_part",symbols:["address_literal"],postprocess:function(i){return{AddressLiteral:n(i[0])}}},{name:"Mailbox",symbols:["Local_part",{literal:"@"},"non_local_part"],postprocess:function(i){return{localPart:n(i[0]),domainPart:n(i[2])}}},{name:"Local_part",symbols:["Dot_string"],postprocess:function(i){return{DotString:n(i[0])}}},{name:"Local_part",symbols:["Quoted_string"],postprocess:function(i){return{QuotedString:n(i[0])}}},{name:"Dot_string$ebnf$1",symbols:[]},{name:"Dot_string$ebnf$1$subexpression$1",symbols:[{literal:"."},"Atom"]},{name:"Dot_string$ebnf$1",symbols:["Dot_string$ebnf$1","Dot_string$ebnf$1$subexpression$1"],postprocess:i=>i[0].concat([i[1]])},{name:"Dot_string",symbols:["Atom","Dot_string$ebnf$1"]},{name:"Atom$ebnf$1",symbols:[/[0-9A-Za-z!#$%&'*+\-/=?^_`{|}~\u0080-\uFFFF/]/]},{name:"Atom$ebnf$1",symbols:["Atom$ebnf$1",/[0-9A-Za-z!#$%&'*+\-/=?^_`{|}~\u0080-\uFFFF/]/],postprocess:i=>i[0].concat([i[1]])},{name:"Atom",symbols:["Atom$ebnf$1"]},{name:"Quoted_string$ebnf$1",symbols:[]},{name:"Quoted_string$ebnf$1",symbols:["Quoted_string$ebnf$1","QcontentSMTP"],postprocess:i=>i[0].concat([i[1]])},{name:"Quoted_string",symbols:["DQUOTE","Quoted_string$ebnf$1","DQUOTE"]},{name:"QcontentSMTP",symbols:["qtextSMTP"]},{name:"QcontentSMTP",symbols:["quoted_pairSMTP"]},{name:"quoted_pairSMTP",symbols:[{literal:"\\"},/[\x20-\x7e]/]},{name:"qtextSMTP",symbols:[/[\x20-\x21\x23-\x5b\x5d-\x7e\u0080-\uFFFF]/],postprocess:t},{name:"IPv4_address_literal$macrocall$2",symbols:[{literal:"."},"Snum"]},{name:"IPv4_address_literal$macrocall$1",symbols:["IPv4_address_literal$macrocall$2","IPv4_address_literal$macrocall$2","IPv4_address_literal$macrocall$2"]},{name:"IPv4_address_literal",symbols:["Snum","IPv4_address_literal$macrocall$1"]},{name:"IPv6_address_literal$subexpression$1",symbols:[/[iI]/,/[pP]/,/[vV]/,{literal:"6"},{literal:":"}],postprocess:function(i){return i.join("")}},{name:"IPv6_address_literal",symbols:["IPv6_address_literal$subexpression$1","IPv6_addr"]},{name:"General_address_literal$ebnf$1",symbols:["dcontent"]},{name:"General_address_literal$ebnf$1",symbols:["General_address_literal$ebnf$1","dcontent"],postprocess:i=>i[0].concat([i[1]])},{name:"General_address_literal",symbols:["Standardized_tag",{literal:":"},"General_address_literal$ebnf$1"]},{name:"Standardized_tag",symbols:["Ldh_str"]},{name:"dcontent",symbols:[/[\x21-\x5a\x5e-\x7e]/],postprocess:t},{name:"Snum",symbols:["DIGIT"]},{name:"Snum$subexpression$1",symbols:[/[1-9]/,"DIGIT"]},{name:"Snum",symbols:["Snum$subexpression$1"]},{name:"Snum$subexpression$2",symbols:[{literal:"1"},"DIGIT","DIGIT"]},{name:"Snum",symbols:["Snum$subexpression$2"]},{name:"Snum$subexpression$3",symbols:[{literal:"2"},/[0-4]/,"DIGIT"]},{name:"Snum",symbols:["Snum$subexpression$3"]},{name:"Snum$subexpression$4",symbols:[{literal:"2"},{literal:"5"},/[0-5]/]},{name:"Snum",symbols:["Snum$subexpression$4"]},{name:"IPv6_addr",symbols:["IPv6_full"]},{name:"IPv6_addr",symbols:["IPv6_comp"]},{name:"IPv6_addr",symbols:["IPv6v4_full"]},{name:"IPv6_addr",symbols:["IPv6v4_comp"]},{name:"IPv6_hex",symbols:["HEXDIG"]},{name:"IPv6_hex$subexpression$1",symbols:["HEXDIG","HEXDIG"]},{name:"IPv6_hex",symbols:["IPv6_hex$subexpression$1"]},{name:"IPv6_hex$subexpression$2",symbols:["HEXDIG","HEXDIG","HEXDIG"]},{name:"IPv6_hex",symbols:["IPv6_hex$subexpression$2"]},{name:"IPv6_hex$subexpression$3",symbols:["HEXDIG","HEXDIG","HEXDIG","HEXDIG"]},{name:"IPv6_hex",symbols:["IPv6_hex$subexpression$3"]},{name:"IPv6_full$macrocall$2",symbols:[{literal:":"},"IPv6_hex"]},{name:"IPv6_full$macrocall$1",symbols:["IPv6_full$macrocall$2","IPv6_full$macrocall$2","IPv6_full$macrocall$2","IPv6_full$macrocall$2","IPv6_full$macrocall$2","IPv6_full$macrocall$2","IPv6_full$macrocall$2"]},{name:"IPv6_full",symbols:["IPv6_hex","IPv6_full$macrocall$1"]},{name:"IPv6_comp$ebnf$1$subexpression$1$macrocall$2",symbols:[{literal:":"},"IPv6_hex"]},{name:"IPv6_comp$ebnf$1$subexpression$1$macrocall$1",symbols:["IPv6_comp$ebnf$1$subexpression$1$macrocall$2","IPv6_comp$ebnf$1$subexpression$1$macrocall$2","IPv6_comp$ebnf$1$subexpression$1$macrocall$2","IPv6_comp$ebnf$1$subexpression$1$macrocall$2","IPv6_comp$ebnf$1$subexpression$1$macrocall$2"]},{name:"IPv6_comp$ebnf$1$subexpression$1",symbols:["IPv6_hex","IPv6_comp$ebnf$1$subexpression$1$macrocall$1"]},{name:"IPv6_comp$ebnf$1",symbols:["IPv6_comp$ebnf$1$subexpression$1"],postprocess:t},{name:"IPv6_comp$ebnf$1",symbols:[],postprocess:()=>null},{name:"IPv6_comp$string$1",symbols:[{literal:":"},{literal:":"}],postprocess:i=>i.join("")},{name:"IPv6_comp$ebnf$2$subexpression$1$macrocall$2",symbols:[{literal:":"},"IPv6_hex"]},{name:"IPv6_comp$ebnf$2$subexpression$1$macrocall$1",symbols:["IPv6_comp$ebnf$2$subexpression$1$macrocall$2","IPv6_comp$ebnf$2$subexpression$1$macrocall$2","IPv6_comp$ebnf$2$subexpression$1$macrocall$2","IPv6_comp$ebnf$2$subexpression$1$macrocall$2","IPv6_comp$ebnf$2$subexpression$1$macrocall$2"]},{name:"IPv6_comp$ebnf$2$subexpression$1",symbols:["IPv6_hex","IPv6_comp$ebnf$2$subexpression$1$macrocall$1"]},{name:"IPv6_comp$ebnf$2",symbols:["IPv6_comp$ebnf$2$subexpression$1"],postprocess:t},{name:"IPv6_comp$ebnf$2",symbols:[],postprocess:()=>null},{name:"IPv6_comp",symbols:["IPv6_comp$ebnf$1","IPv6_comp$string$1","IPv6_comp$ebnf$2"]},{name:"IPv6v4_full$macrocall$2",symbols:[{literal:":"},"IPv6_hex"]},{name:"IPv6v4_full$macrocall$1",symbols:["IPv6v4_full$macrocall$2","IPv6v4_full$macrocall$2","IPv6v4_full$macrocall$2","IPv6v4_full$macrocall$2","IPv6v4_full$macrocall$2"]},{name:"IPv6v4_full",symbols:["IPv6_hex","IPv6v4_full$macrocall$1",{literal:":"},"IPv4_address_literal"]},{name:"IPv6v4_comp$ebnf$1$subexpression$1$macrocall$2",symbols:[{literal:":"},"IPv6_hex"]},{name:"IPv6v4_comp$ebnf$1$subexpression$1$macrocall$1",symbols:["IPv6v4_comp$ebnf$1$subexpression$1$macrocall$2","IPv6v4_comp$ebnf$1$subexpression$1$macrocall$2","IPv6v4_comp$ebnf$1$subexpression$1$macrocall$2"]},{name:"IPv6v4_comp$ebnf$1$subexpression$1",symbols:["IPv6_hex","IPv6v4_comp$ebnf$1$subexpression$1$macrocall$1"]},{name:"IPv6v4_comp$ebnf$1",symbols:["IPv6v4_comp$ebnf$1$subexpression$1"],postprocess:t},{name:"IPv6v4_comp$ebnf$1",symbols:[],postprocess:()=>null},{name:"IPv6v4_comp$string$1",symbols:[{literal:":"},{literal:":"}],postprocess:i=>i.join("")},{name:"IPv6v4_comp$ebnf$2$subexpression$1$macrocall$2",symbols:[{literal:":"},"IPv6_hex"]},{name:"IPv6v4_comp$ebnf$2$subexpression$1$macrocall$1",symbols:["IPv6v4_comp$ebnf$2$subexpression$1$macrocall$2","IPv6v4_comp$ebnf$2$subexpression$1$macrocall$2","IPv6v4_comp$ebnf$2$subexpression$1$macrocall$2"]},{name:"IPv6v4_comp$ebnf$2$subexpression$1",symbols:["IPv6_hex","IPv6v4_comp$ebnf$2$subexpression$1$macrocall$1",{literal:":"}]},{name:"IPv6v4_comp$ebnf$2",symbols:["IPv6v4_comp$ebnf$2$subexpression$1"],postprocess:t},{name:"IPv6v4_comp$ebnf$2",symbols:[],postprocess:()=>null},{name:"IPv6v4_comp",symbols:["IPv6v4_comp$ebnf$1","IPv6v4_comp$string$1","IPv6v4_comp$ebnf$2","IPv4_address_literal"]},{name:"DIGIT",symbols:[/[0-9]/],postprocess:t},{name:"ALPHA_DIGIT_U",symbols:[/[0-9A-Za-z\u0080-\uFFFF]/],postprocess:t},{name:"ALPHA_DIGIT",symbols:[/[0-9A-Za-z]/],postprocess:t},{name:"ALPHA_DIG_DASH",symbols:[/[-0-9A-Za-z]/],postprocess:t},{name:"ALPHA_DIG_DASH_U",symbols:[/[-0-9A-Za-z\u0080-\uFFFF]/],postprocess:t},{name:"HEXDIG",symbols:[/[0-9A-Fa-f]/],postprocess:t},{name:"DQUOTE",symbols:[{literal:'"'}],postprocess:t}],ParserStart:"Reverse_path"};return qd.default=r,qd}var WE;function AV(){if(WE)return Fn;WE=1;var t=Fn&&Fn.__importDefault||function(u){return u&&u.__esModule?u:{default:u}};Object.defineProperty(Fn,"__esModule",{value:!0}),Fn.canonicalize=Fn.canonicalize_quoted_string=Fn.normalize=Fn.normalize_dot_string=Fn.parse=void 0;const e=_V(),n=t(CV());n.default.ParserStart="Mailbox";const r=e.Grammar.fromCompiled(n.default);function i(u){const c=new e.Parser(r);if(c.feed(u),c.results.length!==1)throw new Error("address parsing failed: ambiguous grammar");return c.results[0]}Fn.parse=i;function s(u){return(function(){const d=u.indexOf("+");return d===-1?u:u.substr(0,d)})().replace(/\./g,"").toLowerCase()}Fn.normalize_dot_string=s;function o(u){var c,f;const d=i(u),h=(c=d.domainPart.AddressLiteral)!==null&&c!==void 0?c:d.domainPart.DomainName.toLowerCase();return`${(f=d.localPart.QuotedString)!==null&&f!==void 0?f:s(d.localPart.DotString)}@${h}`}Fn.normalize=o;function a(u){return`"${u.substr(1).substr(0,u.length-2).replace(/(?:\\(.))/g,"$1").replace(/(?:(["\\]))/g,"\\$1")}"`}Fn.canonicalize_quoted_string=a;function l(u){var c;const f=i(u),d=(c=f.domainPart.AddressLiteral)!==null&&c!==void 0?c:f.domainPart.DomainName.toLowerCase();return`${f.localPart.QuotedString?a(f.localPart.QuotedString):f.localPart.DotString}@${d}`}return Fn.canonicalize=l,Fn}var DV=AV();const kV=new RegExp("^([0-9]+)-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])[Tt]([01][0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9]|60)(\\.[0-9]+)?(([Zz])|([\\+|\\-]([01][0-9]|2[0-3]):[0-5][0-9]))$"),OV=/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,TV=/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,IV=/^(?=.{1,255}$)[0-9A-Za-z](?:(?:[0-9A-Za-z]|-){0,61}[0-9A-Za-z])?(?:\.[0-9A-Za-z](?:(?:[0-9A-Za-z]|-){0,61}[0-9A-Za-z])?)*\.?$/,PV=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,RV=/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,NV=[0,31,28,31,30,31,30,31,31,30,31,30,31],MV=/^(?:\/(?:[^~/]|~0|~1)*)*$/,FV=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,LV=/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,BV=/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,G3={date:(t,e,n,r)=>{if(typeof n!="string"||n==="")return;const i=n.match(PV);if(!i)return t.errors.formatDateTimeError({value:n,pointer:r,schema:e});const s=+i[1],o=+i[2],a=+i[3],l=s%4===0&&(s%100!==0||s%400===0);if(!(o>=1&&o<=12&&a>=1&&a<=(o==2&&l?29:NV[o])))return t.errors.formatDateError({value:n,pointer:r,schema:e})},"date-time":(t,e,n,r)=>{if(!(typeof n!="string"||n===""))return n===""||kV.test(n)?new Date(n).toString()==="Invalid Date"?t.errors.formatDateTimeError({value:n,pointer:r,schema:e}):void 0:t.errors.formatDateTimeError({value:n,pointer:r,schema:e})},email:(t,e,n,r)=>{if(typeof n!="string"||n==="")return;if(n[0]==='"')return t.errors.formatEmailError({value:n,pointer:r,schema:e});const[i,s,...o]=n.split("@");if(!i||!s||o.length!==0||i.length>64||s.length>253)return t.errors.formatEmailError({value:n,pointer:r,schema:e});if(i[0]==="."||i.endsWith(".")||i.includes(".."))return t.errors.formatEmailError({value:n,pointer:r,schema:e});if(!/^[a-z0-9.-]+$/i.test(s)||!/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+$/i.test(i))return t.errors.formatEmailError({value:n,pointer:r,schema:e});if(!s.split(".").every(a=>/^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$/i.test(a)))return t.errors.formatEmailError({value:n,pointer:r,schema:e})},"idn-email":(t,e,n,r)=>{if(!(typeof n!="string"||n===""))try{DV.parse(n);return}catch{return t.errors.formatEmailError({value:n,pointer:r,schema:e})}},hostname:(t,e,n,r)=>{if(typeof n=="string"&&!(n===""||IV.test(n)))return t.errors.formatHostnameError({value:n,pointer:r,schema:e})},ipv4:(t,e,n,r)=>{if(!(typeof n!="string"||n==="")){if(n&&n[0]==="0")return t.errors.formatIPV4LeadingZeroError({value:n,pointer:r,schema:e});if(!(n.length<=15&&OV.test(n)))return t.errors.formatIPV4Error({value:n,pointer:r,schema:e})}},ipv6:(t,e,n,r)=>{if(!(typeof n!="string"||n==="")){if(n&&n[0]==="0")return t.errors.formatIPV6LeadingZeroError({value:n,pointer:r,schema:e});if(!(n.length<=45&&TV.test(n)))return t.errors.formatIPV6Error({value:n,pointer:r,schema:e})}},"json-pointer":(t,e,n,r)=>{if(!(typeof n!="string"||n==="")&&!MV.test(n))return t.errors.formatJsonPointerError({value:n,pointer:r,schema:e})},"relative-json-pointer":(t,e,n,r)=>{if(!(typeof n!="string"||n==="")&&!FV.test(n))return t.errors.formatJsonPointerError({value:n,pointer:r,schema:e})},regex:(t,e,n,r)=>{if(typeof n=="string"&&/\\Z$/.test(n)===!1){try{new RegExp(n);return}catch{}return t.errors.formatRegExError({value:n,pointer:r,schema:e})}if(!(typeof n=="object"||typeof n=="number"||Array.isArray(n)))return t.errors.formatRegExError({value:n,pointer:r,schema:e})},time:(t,e,n,r)=>typeof n!="string"||n===""||n.match(RV)?void 0:t.errors.formatDateTimeError({value:n,pointer:r,schema:e}),uri:(t,e,n,r)=>{if(!(typeof n!="string"||n==="")&&!HE.isUri(n))return t.errors.formatURIError({value:n,pointer:r,schema:e})},"uri-reference":(t,e,n,r)=>{if(!(typeof n!="string"||n==="")&&!LV.test(n))return t.errors.formatURIReferenceError({value:n,pointer:r,schema:e})},"uri-template":(t,e,n,r)=>{if(!(typeof n!="string"||n==="")&&!BV.test(n))return t.errors.formatURITemplateError({value:n,pointer:r,schema:e})},url:(t,e,n,r)=>{if(!(n===""||HE.isWebUri(n)))return t.errors.formatURLError({value:n,pointer:r,schema:e})}},W3={};function K3(t,e=W3){const{pointer:n="#",data:r,schema:i=t.rootSchema,withSchemaWarning:s=!1}=e,o=Yc.split(n),a=X3(t,t.resolveRef(i),o,"#",r);if(!(!s&&(a==null?void 0:a.code)==="schema-warning"))return a}function X3(t,e,n,r,i=W3){if(n.length===0)return t.resolveRef(e);const s=n.shift();return e=t.step(s,e,i,r),Nn(e)?e:(i=i[s],X3(t,e,n,`${r}/${s}`,i))}function $V(t){switch(tt(t)){case"string":case"array":return(t==null?void 0:t.length)===0;case"null":case"undefined":return!0;case"object":return Object.keys(t).length===0;default:return!1}}const KE=su.templateDefaultOptions;let cs;function jg(t,e){const{$ref:n}=t;return n==null?!0:(cs[e]==null||cs[e][n]==null?0:cs[e][n])0){if(jg(e.anyOf[0],`${r}/anyOf/0`)){const o=XE(t,e.anyOf[0],`${r}/anyOf/0`);s=Gv(s,o),s.pointer=e.anyOf[0].$ref||s.pointer}delete s.anyOf}if(Array.isArray(e.allOf)&&e.allOf.map((a,l)=>jg(a,`${r}/allOf/${l}`)).reduceRight((a,l)=>a&&l,!0)){const a=[];let l=$p(n);for(let c=0;ct&&typeof t=="object";function si(t,e,n,r,i){var s;if(n==null)throw new Error(`getTemplate: missing schema for data: ${JSON.stringify(e)}`);if(r==null)throw new Error("Missing pointer");let o=Y3(t,n,e,r,i);if(!YE(o))return;if(r=o.pointer,o!=null&&o.const)return o.const;if(Array.isArray(o.oneOf))if($V(e)){const c=o.oneOf[0].type||o.type||o.const&&typeof o.const||tt(e);o={...o.oneOf[0],type:c}}else{const c=qv(t,e,o);if(Nn(c)){if(e!=null&&i.removeInvalidData!==!0)return e;o=o.oneOf[0],e=void 0}else c.type=(s=c.type)!==null&&s!==void 0?s:o.type,o=c}if(!YE(o)||o.type==null)return;if(e instanceof File)return e;const a=Array.isArray(o.type)?jV(o.type,e,o.default):o.type,l=tt(e);return e!=null&&l!==a&&!(l==="number"&&a==="integer")&&(e=zV(a,e)),JE[a]==null?i.removeInvalidData?void 0:e:JE[a](t,o,e,r,i)}function jV(t,e,n){if(e==null){if(n!=null){const i=tt(n);if(t.includes(i))return i}return t[0]}const r=tt(e);return t.includes(r)?r:t[0]}const JE={null:(t,e,n)=>Lu(e,n,null),string:(t,e,n)=>Lu(e,n,""),number:(t,e,n)=>Lu(e,n,0),integer:(t,e,n)=>Lu(e,n,0),boolean:(t,e,n)=>Lu(e,n,!1),object:(t,e,n,r,i)=>{var s;const o=e.default===void 0?{}:e.default,a={},l=i.extendDefaults===!1&&e.default!==void 0?[]:(s=e.required)!==null&&s!==void 0?s:[];e.properties&&Object.keys(e.properties).forEach(f=>{const d=n==null||n[f]==null?o[f]:n[f],h=l.includes(f);(d!=null||h||i.addOptionalProps)&&(a[f]=si(t,d,e.properties[f],`${r}/properties/${f}`,i))});let u=L3(t,e,a);if(u){u=zn(e,u),delete u.dependencies;const f=si(t,n,u,`${r}/dependencies`,i);Object.assign(a,f)}n&&(i.removeInvalidData===!0&&(e.additionalProperties===!1||tt(e.additionalProperties)==="object")?tt(e.additionalProperties)==="object"&&Object.keys(n).forEach(f=>{a[f]==null&&t.isValid(n[f],e.additionalProperties)&&(a[f]=n[f])}):Object.keys(n).forEach(f=>a[f]==null&&(a[f]=n[f])));const c=sm(t,e,a);if(c){const f=si(t,a,{type:"object",...c},r,i);Object.assign(a,f)}return a},array:(t,e,n,r,i)=>{var s,o;if(e.items==null)return n||[];const a=e.default===void 0?[]:e.default,l=n||a,u=i.extendDefaults===!1&&e.default!==void 0?0:e.minItems||0;if(Array.isArray(e.items)){for(let f=0,d=Math.max(u??0,(o=(s=e.items)===null||s===void 0?void 0:s.length)!==null&&o!==void 0?o:0);f0){const f=Math.max(u,l.length);for(let d=0;d(cs={},r?si(t,e,n,"#",{...KE,...r}):si(t,e,n,"#",KE));function Z3(t,e,n=t.rootSchema,r="#"){return t.validate(e,n,r).length===0}function ZE(t){const e=[];let n=0;const r=t.length;for(;n=55296&&i<=56319&&n!(t[e]===void 0||!HV.call(t,e)),eO={additionalProperties:(t,e,n,r)=>{if(e.additionalProperties===!0||e.additionalProperties==null||tt(e.patternProperties)==="object"&&e.additionalProperties===!1)return;const i=[];let s=Object.keys(n).filter(a=>su.propertyBlacklist.includes(a)===!1);const o=Object.keys(e.properties||{});if(tt(e.patternProperties)==="object"){const a=Object.keys(e.patternProperties).map(l=>new RegExp(l));s=s.filter(l=>{for(let u=0;u{const i=tt(n);if(i==="object"||i==="array"){const s=JSON.stringify(n);for(let o=0;o{if(t.validateFormat[e.format])return t.validateFormat[e.format](t,e,n,r)},items:(t,e,n,r)=>{if(e.items===!1)return Array.isArray(n)&&n.length===0?void 0:t.errors.invalidDataError({pointer:r,value:n,schema:e});const i=[];for(let s=0;s{if(!isNaN(e.maximum)){if(e.maximum&&e.maximum{if(!isNaN(e.maxItems)&&e.maxItems{if(isNaN(e.maxLength))return;const i=ZE(n).length;if(e.maxLength{const i=Object.keys(n).length;if(isNaN(e.maxProperties)===!1&&e.maxProperties{if(isNaN(e.minLength))return;const i=ZE(n).length;if(e.minLength>i)return e.minLength===1?t.errors.minLengthOneError({minLength:e.minLength,length:i,pointer:r,schema:e,value:n}):t.errors.minLengthError({minLength:e.minLength,length:i,pointer:r,schema:e,value:n})},minimum:(t,e,n,r)=>{if(!isNaN(e.minimum)){if(e.minimum>n)return t.errors.minimumError({minimum:e.minimum,length:n,pointer:r,schema:e,value:n});if(e.exclusiveMinimum===!0&&e.minimum===n)return t.errors.minimumError({minimum:e.minimum,length:n,pointer:r,schema:e,value:n})}},minItems:(t,e,n,r)=>{if(!isNaN(e.minItems)&&e.minItems>n.length)return e.minItems===1?t.errors.minItemsOneError({minItems:e.minItems,length:n.length,pointer:r,schema:e,value:n}):t.errors.minItemsError({minItems:e.minItems,length:n.length,pointer:r,schema:e,value:n})},minProperties:(t,e,n,r)=>{if(isNaN(e.minProperties))return;const i=Object.keys(n).length;if(e.minProperties>i)return t.errors.minPropertiesError({minProperties:e.minProperties,length:i,pointer:r,schema:e,value:n})},multipleOf:(t,e,n,r)=>{if(isNaN(e.multipleOf)||typeof n!="number")return;const i=QE(n),s=QE(e.multipleOf);if(i>s)return t.errors.multipleOfError({multipleOf:e.multipleOf,value:n,pointer:r,schema:e});const o=Math.pow(10,s),a=Math.round(n*o),l=Math.round(e.multipleOf*o);if(a%l/o!==0)return t.errors.multipleOfError({multipleOf:e.multipleOf,value:n,pointer:r,schema:e})},not:(t,e,n,r)=>{const i=[];return t.validate(n,e.not,r).length===0&&i.push(t.errors.notError({value:n,not:e.not,pointer:r,schema:e})),i},oneOf:Hz,pattern:(t,e,n,r)=>{if(new RegExp(e.pattern,"u").test(n)===!1)return t.errors.patternError({pattern:e.pattern,description:e.patternExample||e.pattern,received:n,schema:e,value:n,pointer:r})},patternProperties:(t,e,n,r)=>{const i=e.properties||{},s=e.patternProperties;if(tt(s)!=="object")return;const o=[],a=Object.keys(n),l=Object.keys(s).map(u=>({regex:new RegExp(u),patternSchema:s[u]}));return a.forEach(u=>{let c=!1;for(let f=0,d=l.length;f0&&o.push(...h)}i[u]||c===!1&&e.additionalProperties===!1&&o.push(t.errors.patternPropertiesError({key:u,pointer:r,schema:e,value:n,patterns:Object.keys(s).join(",")}))}),o},properties:(t,e,n,r)=>{const i=[],s=Object.keys(e.properties||{});for(let o=0;o{const i=[],s=Object.keys(e.properties||{});for(let o=0;o{if(Array.isArray(e.required)!==!1)return e.required.map(i=>{if(!tw(n,i))return t.errors.requiredPropertyError({key:i,pointer:r,schema:e,value:n})})},requiredNotEmpty:(t,e,n,r)=>{if(Array.isArray(e.required)!==!1)return e.required.map(i=>{if(n[i]==null||n[i]==="")return t.errors.valueNotEmptyError({property:i,pointer:`${r}/${i}`,schema:e,value:n})})},uniqueItems:(t,e,n,r)=>{if((Array.isArray(n)&&e.uniqueItems)===!1)return;const i=[],s=[];return n.forEach((o,a)=>{for(let l=a+1;le.properties[n]=Oi(t[n]))),e.type==="array"&&Array.isArray(t)&&(t.length===1?e.items=Oi(t[0]):e.items=t.map(Oi)),e}const qV={array:(t,e,n,r,i)=>{const s=r==null?void 0:r[e],o=tt(n.items);if(o==="object")return PE(t,n.items,s,`${i}/${e}`)||t.resolveRef(n.items);if(o==="array"){if(n.items[e]===!0)return Oi(s);if(n.items[e]===!1)return t.errors.invalidDataError({key:e,value:s,pointer:i,schema:n});if(n.items[e])return t.resolveRef(n.items[e]);if(n.additionalItems===!1)return t.errors.additionalItemsError({key:e,value:s,pointer:i,schema:n});if(n.additionalItems===!0||n.additionalItems===void 0)return Oi(s);if(tt(n.additionalItems)==="object")return n.additionalItems;throw new Error(`Invalid schema ${JSON.stringify(n,null,2)} for ${JSON.stringify(r,null,2)}`)}return n.additionalItems!==!1&&s?Oi(s):new Error(`Invalid array schema for ${e} at ${i}`)},object:(t,e,n,r,i)=>{var s;n=PE(t,n,r,i);const o=(s=n==null?void 0:n.properties)===null||s===void 0?void 0:s[e];if(o!==void 0){if(o===!1)return t.errors.forbiddenPropertyError({property:e,value:r,pointer:i,schema:n});if(o===!0)return Oi(r==null?void 0:r[e]);const u=t.resolveRef(o);if(Nn(u))return u;if(u&&Array.isArray(u.oneOf)){const c=t.resolveOneOf(r[e],u,`${i}/${e}`);for(const f in u)f!=="oneOf"&&c[f]===void 0&&(c[f]=u[f]);return c}if(u)return u}const{patternProperties:a}=n;if(tt(a)==="object"){let u;const c=Object.keys(a);for(let f=0,d=c.length;ft.resolveRef(s));if(!((r=n.items)===null||r===void 0)&&r.oneOf)return n.items.oneOf.map(s=>t.resolveRef(s));const i=t.step(e,n,{},"#");return Nn(i)?i:[i]}const GV={array:(t,e,n,r)=>t.typeKeywords.array.filter(i=>e&&e[i]!=null).map(i=>t.validateKeyword[i](t,e,n,r)),object:(t,e,n,r)=>t.typeKeywords.object.filter(i=>e&&e[i]!=null).map(i=>t.validateKeyword[i](t,e,n,r)),string:(t,e,n,r)=>t.typeKeywords.string.filter(i=>e&&e[i]!=null).map(i=>t.validateKeyword[i](t,e,n,r)),integer:(t,e,n,r)=>t.typeKeywords.number.filter(i=>e&&e[i]!=null).map(i=>t.validateKeyword[i](t,e,n,r)),number:(t,e,n,r)=>t.typeKeywords.number.filter(i=>e&&e[i]!=null).map(i=>t.validateKeyword[i](t,e,n,r)),boolean:(t,e,n,r)=>t.typeKeywords.boolean.filter(i=>e&&e[i]!=null).map(i=>t.validateKeyword[i](t,e,n,r)),null:(t,e,n,r)=>t.typeKeywords.null.filter(i=>e&&e[i]!=null).map(i=>t.validateKeyword[i](t,e,n,r))};function WV(t,e){const n=tt(t);return n==="number"&&(e==="integer"||Array.isArray(e)&&e.includes("integer"))?Number.isInteger(t)||isNaN(t)?"integer":"number":n}function rO(t,e,n=t.rootSchema,r="#"){if(n=t.resolveRef(n),tt(n)==="boolean")return n?[]:[t.errors.invalidDataError({pointer:r,schema:n,value:e})];if(Nn(n))return[n];if(n.const!==void 0)return Q3(n.const,e)?[]:[t.errors.constError({pointer:r,schema:n,value:e,expected:n.const})];const i=WV(e,n.type),s=n.type||i;return i!==s&&(!Array.isArray(s)||!s.includes(i))?[t.errors.typeError({pointer:r,schema:n,value:e,received:i,expected:s})]:t.validateType[i]==null?[t.errors.invalidTypeError({pointer:r,schema:n,value:e,receivedType:i})]:Kc(t.validateType[i](t,n,e,r)).filter(Bp)}const KV={typeKeywords:{array:["allOf","anyOf","enum","items","maxItems","minItems","not","oneOf","uniqueItems"],boolean:["enum","not","allOf","anyOf","oneOf"],object:["additionalProperties","dependencies","enum","format","minProperties","maxProperties","patternProperties","properties","required","not","oneOf","allOf","anyOf"],string:["allOf","anyOf","enum","format","maxLength","minLength","not","oneOf","pattern"],number:["allOf","anyOf","enum","format","maximum","minimum","multipleOf","not","oneOf"],null:["allOf","anyOf","enum","format","not","oneOf"]},validateKeyword:eO,validateType:GV,validateFormat:G3,errors:q3,addRemoteSchema:j3,compileSchema:xV,createSchemaOf:Oi,each:H3,eachSchema:om,getChildSchemaSelection:nO,getSchema:K3,getTemplate:J3,isValid:Z3,resolveAllOf:N3,resolveAnyOf:$3,resolveOneOf:S3,resolveRef:F3,step:tO,validate:rO,templateDefaultOptions:su.templateDefaultOptions};class iO extends z3{constructor(e,n={}){super(Gv(KV,n),e)}}const nw="__compiled",rw="__ref",XV="getRef",YV="getRoot",JV=/(#|\/)+$/g;function ZV(t,e,n=e,r=!1){if(e===!0||e===!1||e===void 0||e[nw]!==void 0)return e;const i={ids:{},remotes:t.remotes},s=JSON.stringify(e),o=JSON.parse(s);if(Object.defineProperty(o,nw,{enumerable:!1,value:!0}),Object.defineProperty(o,XV,{enumerable:!1,value:is.bind(null,i,o)}),r===!1&&s.includes("$ref")===!1)return o;o!==n&&Object.defineProperty(o,"$defs",{enumerable:!0,value:Object.assign({},n.definitions,n.$defs,o.definitions,o.$defs)});const a={},l=()=>o;return om(o,(u,c)=>{var f;if(u.$id){if(u.$id.startsWith("http")&&/(allOf|anyOf|oneOf)\/\d+$/.test(c)){const g=c.replace(/\/(allOf|anyOf|oneOf)\/\d+$/,""),b=Wo.get(o,g);u.$id=(f=b.$id)!==null&&f!==void 0?f:u.$id}i.ids[u.$id.replace(JV,"")]=c}c=`#${c}`.replace(/##+/,"#");const d=c.replace(/\/[^/]+$/,""),h=c.replace(/\/[^/]+\/[^/]+$/,""),p=a[d]||a[h],m=Up(p,u.$id);a[c]=m,i.ids[m]==null&&(i.ids[m]=c),u.$ref&&!u[rw]&&(Object.defineProperty(u,rw,{enumerable:!1,value:Up(m,u.$ref)}),Object.defineProperty(u,YV,{enumerable:!1,value:l}))}),o}const QV={...eO,contains:(t,e,n,r)=>{if(e.contains===!1)return t.errors.containsArrayError({pointer:r,value:n,schema:e});if(e.contains===!0)return Array.isArray(n)&&n.length===0?t.errors.containsAnyError({pointer:r,value:n,schema:e}):void 0;if(tt(e.contains)==="object"){for(let i=0;i{if(!isNaN(e.exclusiveMaximum)&&e.exclusiveMaximum<=n)return t.errors.maximumError({maximum:e.exclusiveMaximum,length:n,pointer:r,schema:e,value:n})},exclusiveMinimum:(t,e,n,r)=>{if(!isNaN(e.exclusiveMinimum)&&e.exclusiveMinimum>=n)return t.errors.minimumError({minimum:e.exclusiveMinimum,length:n,pointer:r,schema:e,value:n})},if:Oj,maximum:(t,e,n,r)=>{if(!isNaN(e.maximum)&&e.maximum&&e.maximum{if(!isNaN(e.minimum)&&e.minimum>n)return t.errors.minimumError({minimum:e.minimum,length:n,pointer:r,schema:e,value:n})},patternProperties:(t,e,n,r)=>{const i=e.properties||{},s=e.patternProperties;if(tt(s)!=="object")return;const o=[],a=Object.keys(n),l=Object.keys(s).map(u=>({regex:new RegExp(u),patternSchema:s[u]}));return a.forEach(u=>{let c=!1;for(let f=0,d=l.length;f0&&o.push(...h)}i[u]||c===!1&&e.additionalProperties===!1&&o.push(t.errors.patternPropertiesError({key:u,pointer:r,patterns:Object.keys(s).join(","),schema:e,value:n}))}),o},propertyNames:(t,e,n,r)=>{if(e.propertyNames===!1)return Object.keys(n).length===0?void 0:t.errors.invalidPropertyNameError({property:Object.keys(n),pointer:r,value:n,schema:e});if(e.propertyNames===!0||tt(e.propertyNames)!=="object")return;const i=[],s=Object.keys(n),o={...e.propertyNames,type:"string"};return s.forEach(a=>{const l=t.validate(a,o,`${r}/${a}`);l.length>0&&i.push(t.errors.invalidPropertyNameError({property:a,pointer:r,validationError:l[0],value:n[a],schema:e}))}),i}},eU={array:(t,e,n,r)=>t.typeKeywords.array.filter(i=>e&&e[i]!=null).map(i=>t.validateKeyword[i](t,e,n,r)),object:(t,e,n,r)=>t.typeKeywords.object.filter(i=>e&&e[i]!=null).map(i=>t.validateKeyword[i](t,e,n,r)),string:(t,e,n,r)=>t.typeKeywords.string.filter(i=>e&&e[i]!=null).map(i=>t.validateKeyword[i](t,e,n,r)),integer:(t,e,n,r)=>t.typeKeywords.number.filter(i=>e&&e[i]!=null).map(i=>t.validateKeyword[i](t,e,n,r)),number:(t,e,n,r)=>t.typeKeywords.number.filter(i=>e&&e[i]!=null).map(i=>t.validateKeyword[i](t,e,n,r)),boolean:(t,e,n,r)=>t.typeKeywords.boolean.filter(i=>e&&e[i]!=null).map(i=>t.validateKeyword[i](t,e,n,r)),null:(t,e,n,r)=>t.typeKeywords.null.filter(i=>e&&e[i]!=null).map(i=>t.validateKeyword[i](t,e,n,r))},sO={typeKeywords:{array:["allOf","anyOf","contains","enum","if","items","maxItems","minItems","not","oneOf","uniqueItems"],boolean:["allOf","anyOf","enum","not","oneOf"],object:["additionalProperties","allOf","anyOf","dependencies","enum","format","if","maxProperties","minProperties","not","oneOf","patternProperties","properties","propertyNames","required"],string:["allOf","anyOf","enum","format","if","maxLength","minLength","not","oneOf","pattern"],number:["allOf","anyOf","enum","exclusiveMaximum","exclusiveMinimum","format","if","maximum","minimum","multipleOf","not","oneOf"],null:["allOf","anyOf","enum","format","not","oneOf"]},validateKeyword:QV,validateType:eU,validateFormat:G3,errors:q3,addRemoteSchema:j3,compileSchema:ZV,createSchemaOf:Oi,each:H3,eachSchema:om,getChildSchemaSelection:nO,getSchema:K3,getTemplate:J3,isValid:Z3,resolveAllOf:N3,resolveAnyOf:$3,resolveOneOf:S3,resolveRef:F3,step:tO,validate:rO,templateDefaultOptions:su.templateDefaultOptions};class oO extends z3{constructor(e,n={}){super(Gv(sO,n),e)}}({...sO});function Ci(t,e,n=[]){const r=document.createElement(t);return Object.entries(e).forEach(([i,s])=>{if(i==="text"){r.innerText=s;return}if(i==="inner"){r.innerHTML=s;return}r.setAttribute(i,s)}),n.forEach(i=>r.appendChild(i)),r}const iw={};function tU(t){let e=iw[t];if(e)return e;e=iw[t]=[];for(let n=0;n<128;n++){const r=String.fromCharCode(n);e.push(r)}for(let n=0;n=55296&&c<=57343?i+="���":i+=String.fromCharCode(c),s+=6;continue}}if((a&248)===240&&s+91114111?i+="����":(f-=65536,i+=String.fromCharCode(55296+(f>>10),56320+(f&1023))),s+=9;continue}}i+="�"}return i})}Ml.defaultChars=";/?:@&=+$,#";Ml.componentChars="";const sw={};function nU(t){let e=sw[t];if(e)return e;e=sw[t]=[];for(let n=0;n<128;n++){const r=String.fromCharCode(n);/^[0-9a-z]$/i.test(r)?e.push(r):e.push("%"+("0"+n.toString(16).toUpperCase()).slice(-2))}for(let n=0;n"u"&&(n=!0);const r=nU(e);let i="";for(let s=0,o=t.length;s=55296&&a<=57343){if(a>=55296&&a<=56319&&s+1=56320&&l<=57343){i+=encodeURIComponent(t[s]+t[s+1]),s++;continue}}i+="%EF%BF%BD";continue}i+=encodeURIComponent(t[s])}return i}Hf.defaultChars=";/?:@&=+$,-_.!~*'()#";Hf.componentChars="-_.!~*'()";function Jv(t){let e="";return e+=t.protocol||"",e+=t.slashes?"//":"",e+=t.auth?t.auth+"@":"",t.hostname&&t.hostname.indexOf(":")!==-1?e+="["+t.hostname+"]":e+=t.hostname||"",e+=t.port?":"+t.port:"",e+=t.pathname||"",e+=t.search||"",e+=t.hash||"",e}function Hp(){this.protocol=null,this.slashes=null,this.auth=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.pathname=null}const rU=/^([a-z0-9.+-]+:)/i,iU=/:[0-9]*$/,sU=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,oU=["<",">",'"',"`"," ","\r",` +`," "],aU=["{","}","|","\\","^","`"].concat(oU),lU=["'"].concat(aU),ow=["%","/","?",";","#"].concat(lU),aw=["/","?","#"],uU=255,lw=/^[+a-z0-9A-Z_-]{0,63}$/,cU=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,uw={javascript:!0,"javascript:":!0},cw={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function Zv(t,e){if(t&&t instanceof Hp)return t;const n=new Hp;return n.parse(t,e),n}Hp.prototype.parse=function(t,e){let n,r,i,s=t;if(s=s.trim(),!e&&t.split("#").length===1){const u=sU.exec(s);if(u)return this.pathname=u[1],u[2]&&(this.search=u[2]),this}let o=rU.exec(s);if(o&&(o=o[0],n=o.toLowerCase(),this.protocol=o,s=s.substr(o.length)),(e||o||s.match(/^\/\/[^@\/]+@[^@\/]+/))&&(i=s.substr(0,2)==="//",i&&!(o&&uw[o])&&(s=s.substr(2),this.slashes=!0)),!uw[o]&&(i||o&&!cw[o])){let u=-1;for(let p=0;p127?y+="x":y+=b[x];if(!y.match(lw)){const x=p.slice(0,m),S=p.slice(m+1),E=b.match(cU);E&&(x.push(E[1]),S.unshift(E[2])),S.length&&(s=S.join(".")+s),this.hostname=x.join(".");break}}}}this.hostname.length>uU&&(this.hostname=""),h&&(this.hostname=this.hostname.substr(1,this.hostname.length-2))}const a=s.indexOf("#");a!==-1&&(this.hash=s.substr(a),s=s.slice(0,a));const l=s.indexOf("?");return l!==-1&&(this.search=s.substr(l),s=s.slice(0,l)),s&&(this.pathname=s),cw[n]&&this.hostname&&!this.pathname&&(this.pathname=""),this};Hp.prototype.parseHost=function(t){let e=iU.exec(t);e&&(e=e[0],e!==":"&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)};const fU=Object.freeze(Object.defineProperty({__proto__:null,decode:Ml,encode:Hf,format:Jv,parse:Zv},Symbol.toStringTag,{value:"Module"})),aO=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,lO=/[\0-\x1F\x7F-\x9F]/,dU=/[\xAD\u0600-\u0605\u061C\u06DD\u070F\u0890\u0891\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB]|\uD804[\uDCBD\uDCCD]|\uD80D[\uDC30-\uDC3F]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]/,Qv=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061D-\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1B7D\u1B7E\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDEAD\uDF55-\uDF59\uDF86-\uDF89]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5A\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDEB9\uDF3C-\uDF3E]|\uD806[\uDC3B\uDD44-\uDD46\uDDE2\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2\uDF00-\uDF09]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8\uDF43-\uDF4F\uDFFF]|\uD809[\uDC70-\uDC74]|\uD80B[\uDFF1\uDFF2]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A\uDFE2]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]/,uO=/[\$\+<->\^`\|~\xA2-\xA6\xA8\xA9\xAC\xAE-\xB1\xB4\xB8\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0384\u0385\u03F6\u0482\u058D-\u058F\u0606-\u0608\u060B\u060E\u060F\u06DE\u06E9\u06FD\u06FE\u07F6\u07FE\u07FF\u0888\u09F2\u09F3\u09FA\u09FB\u0AF1\u0B70\u0BF3-\u0BFA\u0C7F\u0D4F\u0D79\u0E3F\u0F01-\u0F03\u0F13\u0F15-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE\u0FCF\u0FD5-\u0FD8\u109E\u109F\u1390-\u1399\u166D\u17DB\u1940\u19DE-\u19FF\u1B61-\u1B6A\u1B74-\u1B7C\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2044\u2052\u207A-\u207C\u208A-\u208C\u20A0-\u20C0\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u218A\u218B\u2190-\u2307\u230C-\u2328\u232B-\u2426\u2440-\u244A\u249C-\u24E9\u2500-\u2767\u2794-\u27C4\u27C7-\u27E5\u27F0-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2B73\u2B76-\u2B95\u2B97-\u2BFF\u2CE5-\u2CEA\u2E50\u2E51\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFF\u3004\u3012\u3013\u3020\u3036\u3037\u303E\u303F\u309B\u309C\u3190\u3191\u3196-\u319F\u31C0-\u31E3\u31EF\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA700-\uA716\uA720\uA721\uA789\uA78A\uA828-\uA82B\uA836-\uA839\uAA77-\uAA79\uAB5B\uAB6A\uAB6B\uFB29\uFBB2-\uFBC2\uFD40-\uFD4F\uFDCF\uFDFC-\uFDFF\uFE62\uFE64-\uFE66\uFE69\uFF04\uFF0B\uFF1C-\uFF1E\uFF3E\uFF40\uFF5C\uFF5E\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFFC\uFFFD]|\uD800[\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9C\uDDA0\uDDD0-\uDDFC]|\uD802[\uDC77\uDC78\uDEC8]|\uD805\uDF3F|\uD807[\uDFD5-\uDFF1]|\uD81A[\uDF3C-\uDF3F\uDF45]|\uD82F\uDC9C|\uD833[\uDF50-\uDFC3]|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDEA\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85\uDE86]|\uD838[\uDD4F\uDEFF]|\uD83B[\uDCAC\uDCB0\uDD2E\uDEF0\uDEF1]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD0D-\uDDAD\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED7\uDEDC-\uDEEC\uDEF0-\uDEFC\uDF00-\uDF76\uDF7B-\uDFD9\uDFE0-\uDFEB\uDFF0]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDCB0\uDCB1\uDD00-\uDE53\uDE60-\uDE6D\uDE70-\uDE7C\uDE80-\uDE88\uDE90-\uDEBD\uDEBF-\uDEC5\uDECE-\uDEDB\uDEE0-\uDEE8\uDEF0-\uDEF8\uDF00-\uDF92\uDF94-\uDFCA]/,cO=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/,hU=Object.freeze(Object.defineProperty({__proto__:null,Any:aO,Cc:lO,Cf:dU,P:Qv,S:uO,Z:cO},Symbol.toStringTag,{value:"Module"})),pU=new Uint16Array('ᵁ<Õıʊҝջאٵ۞ޢߖࠏ੊ઑඡ๭༉༦჊ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ὾⁠↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms„‹•˜¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲ΂ϏϢϸontourIntegraìȹoɴ͹\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՗՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲ׌y;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱cò׋؀JTabcdfgorstר׬ׯ׺؀ؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d׷׸䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇܎ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ޷޼߂ߐĀiyޱ޵rc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄΀HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶߻dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣ঳সে্਷ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗ࡜ࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४Ānrࢃ࢏gleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpw৔ਖਛgȀLRlr৞৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼੝੠੷੼અઋ઎p;椅y;䐜Ādl੥੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑ඗ඞcy;䐊cute;䅃ƀaey઴હાron;䅇dil;䅅;䐝ƀgswે૰଎ativeƀMTV૓૟૨ediumSpace;怋hiĀcn૦૘ë૙eryThiî૙tedĀGL૸ଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷ଺reak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪୼஡௫ఄ౞಄ದ೘ൡඅ櫬Āou୛୤ngruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊ஛ement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater΀;EFGLSTஶஷ஽௉௓௘௥扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲௽ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ೒拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨೹setĀ;E೰ೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂ෉෕ෛ෠෧෼ขภยา฿ไlig;䅒cute耻Ó䃓Āiy෎ීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲ෶cr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬื฼de耻Õ䃕es;樷ml耻Ö䃖erĀBP๋๠Āar๐๓r;怾acĀek๚๜;揞et;掴arenthesis;揜Ҁacfhilors๿ງຊຏຒດຝະ໼rtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ໠໤檻cedesȀ;EST່້໏໚扺qual;檯lantEqual;扼ilde;找me;怳Ādp໩໮uct;戏ortionĀ;aȥ໹l;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬؀BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁࿫࿳ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL࿜࿝࿡憒ar;懥eftArrow;懄eiling;按oǵ࿹\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»࿝pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄ቉ቕ቞ቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHc቎ቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗Āeiቻ኉Dzኀ\0ኇefore;戴a;䎘Ācn኎ኘkSpace;쀀  Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0᏿ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0጖y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻፿on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtè૙a;䎖r;愨pf;愤cr;쀀𝒵௡ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚΀;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒΀;Eaeiop዁ᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;e዁ᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;e዁ᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰ᜼ᝃᝈ᝸᝽០៦ᠹᡐᜍ᤽᥈ᥰot;櫭Ācrᛶ᜞kȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e᜚᜛戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;t፜᜷brk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓ᝛ᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯ᝱ᝳ;䎲;愶een;扬r;쀀𝔟g΀costuvwឍឝឳេ៕៛៞ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀako៭ᠦᠵĀcn៲ᠣkƀlst៺֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘᠝斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈؀DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬ᣿ᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教΀;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ᣷᣹᣻᣽;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ᤟;敛;敘;攘;攔΀;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģ᥂bar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;e᜚᜜lƀ;bhᥨᥩᥫ䁜;槅sub;柈Ŭᥴ᥾lĀ;e᥹᥺怢t»᥺pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭍᭒\0᯽\0ᰌƀcpr᦭ᦲ᧝ute;䄇̀;abcdsᦿᧀᧄ᧊᧕᧙戩nd;橄rcup;橉Āau᧏᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r΀;Ecefms᩟᩠ᩢᩫ᪤᪪᪮旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖᪚᪟»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇᫔᫺\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ᫙\0\0᫢aĀ;t᫞᫟䀬;䁀ƀ;fl᫨᫩᫫戁îᅠeĀmx᫱᫶ent»᫩eóɍǧ᫾\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯΀delprvw᭠᭬᭷ᮂᮬᯔ᯹arrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;p᭿ᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰸᰻᰿ᱝᱩᱵᲊᲞᲬᲷ᳻᳿ᴍᵻᶑᶫᶻ᷆᷍rò΁ar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂͸᳖᳜᳠mƀ;oș᳊᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄ὎὚ĀDoḆᴴoôᲉĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»Ṻƀaeiἒ἖Ἒls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙ῜ῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao‌⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧‪‬\0‮耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₟₥₰₴⃰⃵⃺⃿℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕ₝ute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽⃉ƀ;qsؾٌ⃄lanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqr׮ⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0↎proø₞r;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢␧␭␱␵␻ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀஀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼rò৆òΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonó྘quigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d྘➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ᠛旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐௏쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop඄⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roø඄urĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻 ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓΀;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨í஘istĀ;s஠டr;쀀𝔫ȀEest௅⩦⩹⩼ƀ;qs஼⩭௡ƀ;qs஼௅⩴lanô௢ií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚΀AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs఻⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs఻⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast୻⭕⭚⭟lleì୻l;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖ΀chimpqu⮽⯍⯙⬄୸⯤⯯Ȁ;cerല⯆ഷ⯉uå൅;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭å೸åഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñ೗Ā;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰⳴ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥ⵲ⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;c᪞ⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācr⵩⵭ir;榿;쀀𝔬ͯ⵹\0\0⵼\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕ⶘ⶥⶨrò᪀Āir⶝ⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔ⷗ǒr;榷rp;榹΀;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ⹞\0⹽\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ⹧⹲຅脀¶;l⹭⹮䂶leìЃɩ⹸\0\0⹻m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳⻴ᤈ⻹⻽⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp໬⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t໻⾴ï໻rel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⿚⋢⿟⿥⿫⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei⿾々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔઀ABHabcdefhilmnoprstux぀けさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤΀cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstw࿜ガクシスゼゾダッデナp;極Ā;f࿠ゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes㄂㄄;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ì࿲âヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘㇤㇮rrowĀ;t࿜ㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowó࿪arpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓rò࿪aòՑ;怏oustĀ;a㈞㈟掱che»㈟mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦΀Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼਴t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì⹯耻­䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;q኱ኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫ਩war;椪lig耻ß䃟௡㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rë๟ƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproø዁im»ኬsðኞĀas㚺㚮ð዁rn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈ΀adempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xô᝷headĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜΀eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roð໻tré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚΀cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜ៟tré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌'.split("").map(t=>t.charCodeAt(0))),mU=new Uint16Array("Ȁaglq \x1Bɭ\0\0p;䀦os;䀧t;䀾t;䀼uot;䀢".split("").map(t=>t.charCodeAt(0)));var Ug;const gU=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]),bU=(Ug=String.fromCodePoint)!==null&&Ug!==void 0?Ug:function(t){let e="";return t>65535&&(t-=65536,e+=String.fromCharCode(t>>>10&1023|55296),t=56320|t&1023),e+=String.fromCharCode(t),e};function yU(t){var e;return t>=55296&&t<=57343||t>1114111?65533:(e=gU.get(t))!==null&&e!==void 0?e:t}var mn;(function(t){t[t.NUM=35]="NUM",t[t.SEMI=59]="SEMI",t[t.EQUALS=61]="EQUALS",t[t.ZERO=48]="ZERO",t[t.NINE=57]="NINE",t[t.LOWER_A=97]="LOWER_A",t[t.LOWER_F=102]="LOWER_F",t[t.LOWER_X=120]="LOWER_X",t[t.LOWER_Z=122]="LOWER_Z",t[t.UPPER_A=65]="UPPER_A",t[t.UPPER_F=70]="UPPER_F",t[t.UPPER_Z=90]="UPPER_Z"})(mn||(mn={}));const vU=32;var Ys;(function(t){t[t.VALUE_LENGTH=49152]="VALUE_LENGTH",t[t.BRANCH_LENGTH=16256]="BRANCH_LENGTH",t[t.JUMP_TABLE=127]="JUMP_TABLE"})(Ys||(Ys={}));function Xb(t){return t>=mn.ZERO&&t<=mn.NINE}function xU(t){return t>=mn.UPPER_A&&t<=mn.UPPER_F||t>=mn.LOWER_A&&t<=mn.LOWER_F}function SU(t){return t>=mn.UPPER_A&&t<=mn.UPPER_Z||t>=mn.LOWER_A&&t<=mn.LOWER_Z||Xb(t)}function EU(t){return t===mn.EQUALS||SU(t)}var un;(function(t){t[t.EntityStart=0]="EntityStart",t[t.NumericStart=1]="NumericStart",t[t.NumericDecimal=2]="NumericDecimal",t[t.NumericHex=3]="NumericHex",t[t.NamedEntity=4]="NamedEntity"})(un||(un={}));var Vs;(function(t){t[t.Legacy=0]="Legacy",t[t.Strict=1]="Strict",t[t.Attribute=2]="Attribute"})(Vs||(Vs={}));class wU{constructor(e,n,r){this.decodeTree=e,this.emitCodePoint=n,this.errors=r,this.state=un.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=Vs.Strict}startEntity(e){this.decodeMode=e,this.state=un.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(e,n){switch(this.state){case un.EntityStart:return e.charCodeAt(n)===mn.NUM?(this.state=un.NumericStart,this.consumed+=1,this.stateNumericStart(e,n+1)):(this.state=un.NamedEntity,this.stateNamedEntity(e,n));case un.NumericStart:return this.stateNumericStart(e,n);case un.NumericDecimal:return this.stateNumericDecimal(e,n);case un.NumericHex:return this.stateNumericHex(e,n);case un.NamedEntity:return this.stateNamedEntity(e,n)}}stateNumericStart(e,n){return n>=e.length?-1:(e.charCodeAt(n)|vU)===mn.LOWER_X?(this.state=un.NumericHex,this.consumed+=1,this.stateNumericHex(e,n+1)):(this.state=un.NumericDecimal,this.stateNumericDecimal(e,n))}addToNumericResult(e,n,r,i){if(n!==r){const s=r-n;this.result=this.result*Math.pow(i,s)+parseInt(e.substr(n,s),i),this.consumed+=s}}stateNumericHex(e,n){const r=n;for(;n>14;for(;n>14,s!==0){if(o===mn.SEMI)return this.emitNamedEntityData(this.treeIndex,s,this.consumed+this.excess);this.decodeMode!==Vs.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var e;const{result:n,decodeTree:r}=this,i=(r[n]&Ys.VALUE_LENGTH)>>14;return this.emitNamedEntityData(n,i,this.consumed),(e=this.errors)===null||e===void 0||e.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(e,n,r){const{decodeTree:i}=this;return this.emitCodePoint(n===1?i[e]&~Ys.VALUE_LENGTH:i[e+1],r),n===3&&this.emitCodePoint(i[e+2],r),r}end(){var e;switch(this.state){case un.NamedEntity:return this.result!==0&&(this.decodeMode!==Vs.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case un.NumericDecimal:return this.emitNumericEntity(0,2);case un.NumericHex:return this.emitNumericEntity(0,3);case un.NumericStart:return(e=this.errors)===null||e===void 0||e.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case un.EntityStart:return 0}}}function fO(t){let e="";const n=new wU(t,r=>e+=bU(r));return function(i,s){let o=0,a=0;for(;(a=i.indexOf("&",a))>=0;){e+=i.slice(o,a),n.startEntity(s);const u=n.write(i,a+1);if(u<0){o=a+n.end();break}o=a+u,a=u===0?o+1:o}const l=e+i.slice(o);return e="",l}}function _U(t,e,n,r){const i=(e&Ys.BRANCH_LENGTH)>>7,s=e&Ys.JUMP_TABLE;if(i===0)return s!==0&&r===s?n:-1;if(s){const l=r-s;return l<0||l>=i?-1:t[n+l]-1}let o=n,a=o+i-1;for(;o<=a;){const l=o+a>>>1,u=t[l];if(ur)a=l-1;else return t[l+i]}return-1}const CU=fO(pU);fO(mU);function dO(t,e=Vs.Legacy){return CU(t,e)}function AU(t){return Object.prototype.toString.call(t)}function e2(t){return AU(t)==="[object String]"}const DU=Object.prototype.hasOwnProperty;function kU(t,e){return DU.call(t,e)}function am(t){return Array.prototype.slice.call(arguments,1).forEach(function(n){if(n){if(typeof n!="object")throw new TypeError(n+"must be object");Object.keys(n).forEach(function(r){t[r]=n[r]})}}),t}function hO(t,e,n){return[].concat(t.slice(0,e),n,t.slice(e+1))}function t2(t){return!(t>=55296&&t<=57343||t>=64976&&t<=65007||(t&65535)===65535||(t&65535)===65534||t>=0&&t<=8||t===11||t>=14&&t<=31||t>=127&&t<=159||t>1114111)}function qp(t){if(t>65535){t-=65536;const e=55296+(t>>10),n=56320+(t&1023);return String.fromCharCode(e,n)}return String.fromCharCode(t)}const pO=/\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g,OU=/&([a-z#][a-z0-9]{1,31});/gi,TU=new RegExp(pO.source+"|"+OU.source,"gi"),IU=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))$/i;function PU(t,e){if(e.charCodeAt(0)===35&&IU.test(e)){const r=e[1].toLowerCase()==="x"?parseInt(e.slice(2),16):parseInt(e.slice(1),10);return t2(r)?qp(r):t}const n=dO(t);return n!==t?n:t}function RU(t){return t.indexOf("\\")<0?t:t.replace(pO,"$1")}function Fl(t){return t.indexOf("\\")<0&&t.indexOf("&")<0?t:t.replace(TU,function(e,n,r){return n||PU(e,r)})}const NU=/[&<>"]/,MU=/[&<>"]/g,FU={"&":"&","<":"<",">":">",'"':"""};function LU(t){return FU[t]}function vo(t){return NU.test(t)?t.replace(MU,LU):t}const BU=/[.?*+^$[\]\\(){}|-]/g;function $U(t){return t.replace(BU,"\\$&")}function mt(t){switch(t){case 9:case 32:return!0}return!1}function Jc(t){if(t>=8192&&t<=8202)return!0;switch(t){case 9:case 10:case 11:case 12:case 13:case 32:case 160:case 5760:case 8239:case 8287:case 12288:return!0}return!1}function Zc(t){return Qv.test(t)||uO.test(t)}function Qc(t){switch(t){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 58:case 59:case 60:case 61:case 62:case 63:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 124:case 125:case 126:return!0;default:return!1}}function lm(t){return t=t.trim().replace(/\s+/g," "),"ẞ".toLowerCase()==="Ṿ"&&(t=t.replace(/ẞ/g,"ß")),t.toLowerCase().toUpperCase()}const zU={mdurl:fU,ucmicro:hU},jU=Object.freeze(Object.defineProperty({__proto__:null,arrayReplaceAt:hO,assign:am,escapeHtml:vo,escapeRE:$U,fromCodePoint:qp,has:kU,isMdAsciiPunct:Qc,isPunctChar:Zc,isSpace:mt,isString:e2,isValidEntityCode:t2,isWhiteSpace:Jc,lib:zU,normalizeReference:lm,unescapeAll:Fl,unescapeMd:RU},Symbol.toStringTag,{value:"Module"}));function VU(t,e,n){let r,i,s,o;const a=t.posMax,l=t.pos;for(t.pos=e+1,r=1;t.pos32))return s;if(r===41){if(o===0)break;o--}i++}return e===i||o!==0||(s.str=Fl(t.slice(e,i)),s.pos=i,s.ok=!0),s}function HU(t,e,n,r){let i,s=e;const o={ok:!1,can_continue:!1,pos:0,str:"",marker:0};if(r)o.str=r.str,o.marker=r.marker;else{if(s>=n)return o;let a=t.charCodeAt(s);if(a!==34&&a!==39&&a!==40)return o;e++,s++,a===40&&(a=41),o.marker=a}for(;s"+vo(s.content)+""};Ji.code_block=function(t,e,n,r,i){const s=t[e];return""+vo(t[e].content)+` `};Ji.fence=function(t,e,n,r,i){const s=t[e],o=s.info?Fl(s.info).trim():"";let a="",l="";if(o){const c=o.split(/(\s+)/g);a=c[0],l=c.slice(2).join("")}let u;if(n.highlight?u=n.highlight(s.content,a,l)||vo(s.content):u=vo(s.content),u.indexOf("${u} `}return`
${u}
@@ -232,15 +232,15 @@ S ::= [ ]* `};Ji.softbreak=function(t,e,n){return n.breaks?n.xhtmlOut?`
`:`
`:` -`};Ji.text=function(t,e){return vo(t[e].content)};Ji.html_block=function(t,e){return t[e].content};Ji.html_inline=function(t,e){return t[e].content};function ou(){this.rules=om({},Ji)}ou.prototype.renderAttrs=function(e){let n,r,i;if(!e.attrs)return"";for(i="",n=0,r=e.attrs.length;n `:">",s};ou.prototype.renderInline=function(t,e,n){let r="";const i=this.rules;for(let s=0,o=t.length;s=0&&(r=this.attrs[n][1]),r};di.prototype.attrJoin=function(e,n){const r=this.attrIndex(e);r<0?this.attrPush([e,n]):this.attrs[r][1]=this.attrs[r][1]+" "+n};function pO(t,e,n){this.src=t,this.env=n,this.tokens=[],this.inlineMode=!1,this.md=e}pO.prototype.Token=di;const HU=/\r\n?|\n/g,qU=/\0/g;function GU(t){let e;e=t.src.replace(HU,` -`),e=e.replace(qU,"�"),t.src=e}function WU(t){let e;t.inlineMode?(e=new t.Token("inline","",0),e.content=t.src,e.map=[0,1],e.children=[],t.tokens.push(e)):t.md.block.parse(t.src,t.md,t.env,t.tokens)}function KU(t){const e=t.tokens;for(let n=0,r=e.length;n\s]/i.test(t)}function YU(t){return/^<\/a\s*>/i.test(t)}function JU(t){const e=t.tokens;if(t.md.options.linkify)for(let n=0,r=e.length;n=0;o--){const a=i[o];if(a.type==="link_close"){for(o--;i[o].level!==a.level&&i[o].type!=="link_open";)o--;continue}if(a.type==="html_inline"&&(XU(a.content)&&s>0&&s--,YU(a.content)&&s++),!(s>0)&&a.type==="text"&&t.md.linkify.test(a.content)){const l=a.content;let u=t.md.linkify.match(l);const c=[];let f=a.level,d=0;u.length>0&&u[0].index===0&&o>0&&i[o-1].type==="text_special"&&(u=u.slice(1));for(let h=0;hd){const E=new t.Token("text","",0);E.content=l.slice(d,b),E.level=f,c.push(E)}const y=new t.Token("link_open","a",1);y.attrs=[["href",m]],y.level=f++,y.markup="linkify",y.info="auto",c.push(y);const x=new t.Token("text","",0);x.content=g,x.level=f,c.push(x);const S=new t.Token("link_close","a",-1);S.level=--f,S.markup="linkify",S.info="auto",c.push(S),d=u[h].lastIndex}if(d=0;n--){const r=t[n];r.type==="text"&&!e&&(r.content=r.content.replace(QU,tH)),r.type==="link_open"&&r.info==="auto"&&e--,r.type==="link_close"&&r.info==="auto"&&e++}}function rH(t){let e=0;for(let n=t.length-1;n>=0;n--){const r=t[n];r.type==="text"&&!e&&mO.test(r.content)&&(r.content=r.content.replace(/\+-/g,"±").replace(/\.{2,}/g,"…").replace(/([?!])…/g,"$1..").replace(/([?!]){4,}/g,"$1$1$1").replace(/,{2,}/g,",").replace(/(^|[^-])---(?=[^-]|$)/mg,"$1—").replace(/(^|\s)--(?=\s|$)/mg,"$1–").replace(/(^|[^-\s])--(?=[^-\s]|$)/mg,"$1–")),r.type==="link_open"&&r.info==="auto"&&e--,r.type==="link_close"&&r.info==="auto"&&e++}}function iH(t){let e;if(t.md.options.typographer)for(e=t.tokens.length-1;e>=0;e--)t.tokens[e].type==="inline"&&(ZU.test(t.tokens[e].content)&&nH(t.tokens[e].children),mO.test(t.tokens[e].content)&&rH(t.tokens[e].children))}const sH=/['"]/,cw=/['"]/g,fw="’";function qd(t,e,n){return t.slice(0,e)+n+t.slice(e+1)}function oH(t,e){let n;const r=[];for(let i=0;i=0&&!(r[n].level<=o);n--);if(r.length=n+1,s.type!=="text")continue;let a=s.content,l=0,u=a.length;e:for(;l=0)p=a.charCodeAt(c.index-1);else for(n=i-1;n>=0&&!(t[n].type==="softbreak"||t[n].type==="hardbreak");n--)if(t[n].content){p=t[n].content.charCodeAt(t[n].content.length-1);break}let m=32;if(l=48&&p<=57&&(d=f=!1),f&&d&&(f=g,d=b),!f&&!d){h&&(s.content=qd(s.content,c.index,fw));continue}if(d)for(n=r.length-1;n>=0;n--){let S=r[n];if(r[n].level=0;e--)t.tokens[e].type!=="inline"||!sH.test(t.tokens[e].content)||oH(t.tokens[e].children,t)}function lH(t){let e,n;const r=t.tokens,i=r.length;for(let s=0;s0&&this.level++,this.tokens.push(r),r};Zi.prototype.isEmpty=function(e){return this.bMarks[e]+this.tShift[e]>=this.eMarks[e]};Zi.prototype.skipEmptyLines=function(e){for(let n=this.lineMax;en;)if(!mt(this.src.charCodeAt(--e)))return e+1;return e};Zi.prototype.skipChars=function(e,n){for(let r=this.src.length;er;)if(n!==this.src.charCodeAt(--e))return e+1;return e};Zi.prototype.getLines=function(e,n,r,i){if(e>=n)return"";const s=new Array(n-e);for(let o=0,a=e;ar?s[o]=new Array(l-r+1).join(" ")+this.src.slice(c,f):s[o]=this.src.slice(c,f)}return s.join("")};Zi.prototype.Token=di;const uH=65536;function Hg(t,e){const n=t.bMarks[e]+t.tShift[e],r=t.eMarks[e];return t.src.slice(n,r)}function dw(t){const e=[],n=t.length;let r=0,i=t.charCodeAt(r),s=!1,o=0,a="";for(;rn)return!1;let i=e+1;if(t.sCount[i]=4)return!1;let s=t.bMarks[i]+t.tShift[i];if(s>=t.eMarks[i])return!1;const o=t.src.charCodeAt(s++);if(o!==124&&o!==45&&o!==58||s>=t.eMarks[i])return!1;const a=t.src.charCodeAt(s++);if(a!==124&&a!==45&&a!==58&&!mt(a)||o===45&&mt(a))return!1;for(;s=4)return!1;u=dw(l),u.length&&u[0]===""&&u.shift(),u.length&&u[u.length-1]===""&&u.pop();const f=u.length;if(f===0||f!==c.length)return!1;if(r)return!0;const d=t.parentType;t.parentType="table";const h=t.md.block.ruler.getRules("blockquote"),p=t.push("table_open","table",1),m=[e,0];p.map=m;const g=t.push("thead_open","thead",1);g.map=[e,e+1];const b=t.push("tr_open","tr",1);b.map=[e,e+1];for(let S=0;S=4||(u=dw(l),u.length&&u[0]===""&&u.shift(),u.length&&u[u.length-1]===""&&u.pop(),x+=f-u.length,x>uH))break;if(i===e+2){const C=t.push("tbody_open","tbody",1);C.map=y=[e+2,0]}const E=t.push("tr_open","tr",1);E.map=[i,i+1];for(let C=0;C=4){r++,i=r;continue}break}t.line=i;const s=t.push("code_block","code",0);return s.content=t.getLines(e,i,4+t.blkIndent,!1)+` -`,s.map=[e,t.line],!0}function dH(t,e,n,r){let i=t.bMarks[e]+t.tShift[e],s=t.eMarks[e];if(t.sCount[e]-t.blkIndent>=4||i+3>s)return!1;const o=t.src.charCodeAt(i);if(o!==126&&o!==96)return!1;let a=i;i=t.skipChars(i,o);let l=i-a;if(l<3)return!1;const u=t.src.slice(a,i),c=t.src.slice(i,s);if(o===96&&c.indexOf(String.fromCharCode(o))>=0)return!1;if(r)return!0;let f=e,d=!1;for(;f++,!(f>=n||(i=a=t.bMarks[f]+t.tShift[f],s=t.eMarks[f],i=4)&&(i=t.skipChars(i,o),!(i-a=4||t.src.charCodeAt(i)!==62)return!1;if(r)return!0;const a=[],l=[],u=[],c=[],f=t.md.block.ruler.getRules("blockquote"),d=t.parentType;t.parentType="blockquote";let h=!1,p;for(p=e;p=s)break;if(t.src.charCodeAt(i++)===62&&!x){let E=t.sCount[p]+1,C,w;t.src.charCodeAt(i)===32?(i++,E++,w=!1,C=!0):t.src.charCodeAt(i)===9?(C=!0,(t.bsCount[p]+E)%4===3?(i++,E++,w=!1):w=!0):C=!1;let A=E;for(a.push(t.bMarks[p]),t.bMarks[p]=i;i=s,l.push(t.bsCount[p]),t.bsCount[p]=t.sCount[p]+1+(C?1:0),u.push(t.sCount[p]),t.sCount[p]=A-E,c.push(t.tShift[p]),t.tShift[p]=i-t.bMarks[p];continue}if(h)break;let S=!1;for(let E=0,C=f.length;E";const b=[e,0];g.map=b,t.md.block.tokenize(t,e,p);const y=t.push("blockquote_close","blockquote",-1);y.markup=">",t.lineMax=o,t.parentType=d,b[1]=t.line;for(let x=0;x=4)return!1;let s=t.bMarks[e]+t.tShift[e];const o=t.src.charCodeAt(s++);if(o!==42&&o!==45&&o!==95)return!1;let a=1;for(;s=r)return-1;let s=t.src.charCodeAt(i++);if(s<48||s>57)return-1;for(;;){if(i>=r)return-1;if(s=t.src.charCodeAt(i++),s>=48&&s<=57){if(i-n>=10)return-1;continue}if(s===41||s===46)break;return-1}return i=4||t.listIndent>=0&&t.sCount[l]-t.listIndent>=4&&t.sCount[l]=t.blkIndent&&(c=!0);let f,d,h;if((h=pw(t,l))>=0){if(f=!0,o=t.bMarks[l]+t.tShift[l],d=Number(t.src.slice(o,h-1)),c&&d!==1)return!1}else if((h=hw(t,l))>=0)f=!1;else return!1;if(c&&t.skipSpaces(h)>=t.eMarks[l])return!1;if(r)return!0;const p=t.src.charCodeAt(h-1),m=t.tokens.length;f?(a=t.push("ordered_list_open","ol",1),d!==1&&(a.attrs=[["start",d]])):a=t.push("bullet_list_open","ul",1);const g=[l,0];a.map=g,a.markup=String.fromCharCode(p);let b=!1;const y=t.md.block.ruler.getRules("list"),x=t.parentType;for(t.parentType="list";l=i?w=1:w=E-S,w>4&&(w=1);const A=S+w;a=t.push("list_item_open","li",1),a.markup=String.fromCharCode(p);const _=[l,0];a.map=_,f&&(a.info=t.src.slice(o,h-1));const D=t.tight,I=t.tShift[l],N=t.sCount[l],P=t.listIndent;if(t.listIndent=t.blkIndent,t.blkIndent=A,t.tight=!0,t.tShift[l]=C-t.bMarks[l],t.sCount[l]=E,C>=i&&t.isEmpty(l+1)?t.line=Math.min(t.line+2,n):t.md.block.tokenize(t,l,n,!0),(!t.tight||b)&&(u=!1),b=t.line-l>1&&t.isEmpty(t.line-1),t.blkIndent=t.listIndent,t.listIndent=P,t.tShift[l]=I,t.sCount[l]=N,t.tight=D,a=t.push("list_item_close","li",-1),a.markup=String.fromCharCode(p),l=t.line,_[1]=l,l>=n||t.sCount[l]=4)break;let R=!1;for(let F=0,V=y.length;F=4||t.src.charCodeAt(i)!==91)return!1;function a(y){const x=t.lineMax;if(y>=x||t.isEmpty(y))return null;let S=!1;if(t.sCount[y]-t.blkIndent>3&&(S=!0),t.sCount[y]<0&&(S=!0),!S){const w=t.md.block.ruler.getRules("reference"),A=t.parentType;t.parentType="reference";let _=!1;for(let D=0,I=w.length;D"u"&&(t.env.references={}),typeof t.env.references[b]>"u"&&(t.env.references[b]={title:g,href:f}),t.line=o),!0):!1}const yH=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],vH="[a-zA-Z_:][a-zA-Z0-9:._-]*",xH="[^\"'=<>`\\x00-\\x20]+",SH="'[^']*'",EH='"[^"]*"',wH="(?:"+xH+"|"+SH+"|"+EH+")",_H="(?:\\s+"+vH+"(?:\\s*=\\s*"+wH+")?)",gO="<[A-Za-z][A-Za-z0-9\\-]*"+_H+"*\\s*\\/?>",bO="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>",CH="",AH="<[?][\\s\\S]*?[?]>",DH="]*>",kH="",OH=new RegExp("^(?:"+gO+"|"+bO+"|"+CH+"|"+AH+"|"+DH+"|"+kH+")"),TH=new RegExp("^(?:"+gO+"|"+bO+")"),Ba=[[/^<(script|pre|style|textarea)(?=(\s|>|$))/i,/<\/(script|pre|style|textarea)>/i,!0],[/^/,!0],[/^<\?/,/\?>/,!0],[/^/,!0],[/^/,!0],[new RegExp("^|$))","i"),/^$/,!0],[new RegExp(TH.source+"\\s*$"),/^$/,!1]];function IH(t,e,n,r){let i=t.bMarks[e]+t.tShift[e],s=t.eMarks[e];if(t.sCount[e]-t.blkIndent>=4||!t.md.options.html||t.src.charCodeAt(i)!==60)return!1;let o=t.src.slice(i,s),a=0;for(;a=4)return!1;let o=t.src.charCodeAt(i);if(o!==35||i>=s)return!1;let a=1;for(o=t.src.charCodeAt(++i);o===35&&i6||ii&&mt(t.src.charCodeAt(l-1))&&(s=l),t.line=e+1;const u=t.push("heading_open","h"+String(a),1);u.markup="########".slice(0,a),u.map=[e,t.line];const c=t.push("inline","",0);c.content=t.src.slice(i,s).trim(),c.map=[e,t.line],c.children=[];const f=t.push("heading_close","h"+String(a),-1);return f.markup="########".slice(0,a),!0}function RH(t,e,n){const r=t.md.block.ruler.getRules("paragraph");if(t.sCount[e]-t.blkIndent>=4)return!1;const i=t.parentType;t.parentType="paragraph";let s=0,o,a=e+1;for(;a3)continue;if(t.sCount[a]>=t.blkIndent){let h=t.bMarks[a]+t.tShift[a];const p=t.eMarks[a];if(h=p))){s=o===61?1:2;break}}if(t.sCount[a]<0)continue;let d=!1;for(let h=0,p=r.length;h3||t.sCount[s]<0)continue;let u=!1;for(let c=0,f=r.length;c=n||t.sCount[o]=s){t.line=n;break}const l=t.line;let u=!1;for(let c=0;c=t.line)throw new Error("block rule didn't increment state.line");break}if(!u)throw new Error("none of the block rules matched");t.tight=!a,t.isEmpty(t.line-1)&&(a=!0),o=t.line,o0&&(this.level++,this._prev_delimiters.push(this.delimiters),this.delimiters=[],i={delimiters:this.delimiters}),this.pendingLevel=this.level,this.tokens.push(r),this.tokens_meta.push(i),r};Hf.prototype.scanDelims=function(t,e){const n=this.posMax,r=this.src.charCodeAt(t),i=t>0?this.src.charCodeAt(t-1):32;let s=t;for(;s0)return!1;const n=t.pos,r=t.posMax;if(n+3>r||t.src.charCodeAt(n)!==58||t.src.charCodeAt(n+1)!==47||t.src.charCodeAt(n+2)!==47)return!1;const i=t.pending.match(LH);if(!i)return!1;const s=i[1],o=t.md.linkify.matchAtStart(t.src.slice(n-s.length));if(!o)return!1;let a=o.url;if(a.length<=s.length)return!1;a=a.replace(/\*+$/,"");const l=t.md.normalizeLink(a);if(!t.md.validateLink(l))return!1;if(!e){t.pending=t.pending.slice(0,-s.length);const u=t.push("link_open","a",1);u.attrs=[["href",l]],u.markup="linkify",u.info="auto";const c=t.push("text","",0);c.content=t.md.normalizeLinkText(a);const f=t.push("link_close","a",-1);f.markup="linkify",f.info="auto"}return t.pos+=a.length-s.length,!0}function $H(t,e){let n=t.pos;if(t.src.charCodeAt(n)!==10)return!1;const r=t.pending.length-1,i=t.posMax;if(!e)if(r>=0&&t.pending.charCodeAt(r)===32)if(r>=1&&t.pending.charCodeAt(r-1)===32){let s=r-1;for(;s>=1&&t.pending.charCodeAt(s-1)===32;)s--;t.pending=t.pending.slice(0,s),t.push("hardbreak","br",0)}else t.pending=t.pending.slice(0,-1),t.push("softbreak","br",0);else t.push("softbreak","br",0);for(n++;n?@[]^_`{|}~-".split("").forEach(function(t){n2[t.charCodeAt(0)]=1});function zH(t,e){let n=t.pos;const r=t.posMax;if(t.src.charCodeAt(n)!==92||(n++,n>=r))return!1;let i=t.src.charCodeAt(n);if(i===10){for(e||t.push("hardbreak","br",0),n++;n=55296&&i<=56319&&n+1=56320&&a<=57343&&(s+=t.src[n+1],n++)}const o="\\"+s;if(!e){const a=t.push("text_special","",0);i<256&&n2[i]!==0?a.content=s:a.content=o,a.markup=o,a.info="escape"}return t.pos=n+1,!0}function jH(t,e){let n=t.pos;if(t.src.charCodeAt(n)!==96)return!1;const i=n;n++;const s=t.posMax;for(;n=0;r--){const i=e[r];if(i.marker!==95&&i.marker!==42||i.end===-1)continue;const s=e[i.end],o=r>0&&e[r-1].end===i.end+1&&e[r-1].marker===i.marker&&e[r-1].token===i.token-1&&e[i.end+1].token===s.token+1,a=String.fromCharCode(i.marker),l=t.tokens[i.token];l.type=o?"strong_open":"em_open",l.tag=o?"strong":"em",l.nesting=1,l.markup=o?a+a:a,l.content="";const u=t.tokens[s.token];u.type=o?"strong_close":"em_close",u.tag=o?"strong":"em",u.nesting=-1,u.markup=o?a+a:a,u.content="",o&&(t.tokens[e[r-1].token].content="",t.tokens[e[i.end+1].token].content="",r--)}}function qH(t){const e=t.tokens_meta,n=t.tokens_meta.length;gw(t,t.delimiters);for(let r=0;r=f)return!1;if(l=p,i=t.md.helpers.parseLinkDestination(t.src,p,t.posMax),i.ok){for(o=t.md.normalizeLink(i.str),t.md.validateLink(o)?p=i.pos:o="",l=p;p=f||t.src.charCodeAt(p)!==41)&&(u=!0),p++}if(u){if(typeof t.env.references>"u")return!1;if(p=0?r=t.src.slice(l,p++):p=h+1):p=h+1,r||(r=t.src.slice(d,h)),s=t.env.references[am(r)],!s)return t.pos=c,!1;o=s.href,a=s.title}if(!e){t.pos=d,t.posMax=h;const m=t.push("link_open","a",1),g=[["href",o]];m.attrs=g,a&&g.push(["title",a]),t.linkLevel++,t.md.inline.tokenize(t),t.linkLevel--,t.push("link_close","a",-1)}return t.pos=p,t.posMax=f,!0}function WH(t,e){let n,r,i,s,o,a,l,u,c="";const f=t.pos,d=t.posMax;if(t.src.charCodeAt(t.pos)!==33||t.src.charCodeAt(t.pos+1)!==91)return!1;const h=t.pos+2,p=t.md.helpers.parseLinkLabel(t,t.pos+1,!1);if(p<0)return!1;if(s=p+1,s=d)return!1;for(u=s,a=t.md.helpers.parseLinkDestination(t.src,s,t.posMax),a.ok&&(c=t.md.normalizeLink(a.str),t.md.validateLink(c)?s=a.pos:c=""),u=s;s=d||t.src.charCodeAt(s)!==41)return t.pos=f,!1;s++}else{if(typeof t.env.references>"u")return!1;if(s=0?i=t.src.slice(u,s++):s=p+1):s=p+1,i||(i=t.src.slice(h,p)),o=t.env.references[am(i)],!o)return t.pos=f,!1;c=o.href,l=o.title}if(!e){r=t.src.slice(h,p);const m=[];t.md.inline.parse(r,t.md,t.env,m);const g=t.push("image","img",0),b=[["src",c],["alt",""]];g.attrs=b,g.children=m,g.content=r,l&&b.push(["title",l])}return t.pos=s,t.posMax=d,!0}const KH=/^([a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)$/,XH=/^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^<>\x00-\x20]*)$/;function YH(t,e){let n=t.pos;if(t.src.charCodeAt(n)!==60)return!1;const r=t.pos,i=t.posMax;for(;;){if(++n>=i)return!1;const o=t.src.charCodeAt(n);if(o===60)return!1;if(o===62)break}const s=t.src.slice(r+1,n);if(XH.test(s)){const o=t.md.normalizeLink(s);if(!t.md.validateLink(o))return!1;if(!e){const a=t.push("link_open","a",1);a.attrs=[["href",o]],a.markup="autolink",a.info="auto";const l=t.push("text","",0);l.content=t.md.normalizeLinkText(s);const u=t.push("link_close","a",-1);u.markup="autolink",u.info="auto"}return t.pos+=s.length+2,!0}if(KH.test(s)){const o=t.md.normalizeLink("mailto:"+s);if(!t.md.validateLink(o))return!1;if(!e){const a=t.push("link_open","a",1);a.attrs=[["href",o]],a.markup="autolink",a.info="auto";const l=t.push("text","",0);l.content=t.md.normalizeLinkText(s);const u=t.push("link_close","a",-1);u.markup="autolink",u.info="auto"}return t.pos+=s.length+2,!0}return!1}function JH(t){return/^\s]/i.test(t)}function ZH(t){return/^<\/a\s*>/i.test(t)}function QH(t){const e=t|32;return e>=97&&e<=122}function eq(t,e){if(!t.md.options.html)return!1;const n=t.posMax,r=t.pos;if(t.src.charCodeAt(r)!==60||r+2>=n)return!1;const i=t.src.charCodeAt(r+1);if(i!==33&&i!==63&&i!==47&&!QH(i))return!1;const s=t.src.slice(r).match(OH);if(!s)return!1;if(!e){const o=t.push("html_inline","",0);o.content=s[0],JH(o.content)&&t.linkLevel++,ZH(o.content)&&t.linkLevel--}return t.pos+=s[0].length,!0}const tq=/^&#((?:x[a-f0-9]{1,6}|[0-9]{1,7}));/i,nq=/^&([a-z][a-z0-9]{1,31});/i;function rq(t,e){const n=t.pos,r=t.posMax;if(t.src.charCodeAt(n)!==38||n+1>=r)return!1;if(t.src.charCodeAt(n+1)===35){const s=t.src.slice(n).match(tq);if(s){if(!e){const o=s[1][0].toLowerCase()==="x"?parseInt(s[1].slice(1),16):parseInt(s[1],10),a=t.push("text_special","",0);a.content=e2(o)?Hp(o):Hp(65533),a.markup=s[0],a.info="entity"}return t.pos+=s[0].length,!0}}else{const s=t.src.slice(n).match(nq);if(s){const o=fO(s[0]);if(o!==s[0]){if(!e){const a=t.push("text_special","",0);a.content=o,a.markup=s[0],a.info="entity"}return t.pos+=s[0].length,!0}}}return!1}function bw(t){const e={},n=t.length;if(!n)return;let r=0,i=-2;const s=[];for(let o=0;ol;u-=s[u]+1){const f=t[u];if(f.marker===a.marker&&f.open&&f.end<0){let d=!1;if((f.close||a.open)&&(f.length+a.length)%3===0&&(f.length%3!==0||a.length%3!==0)&&(d=!0),!d){const h=u>0&&!t[u-1].open?s[u-1]+1:0;s[o]=o-u+h,s[u]=h,a.open=!1,f.end=o,f.close=!1,c=-1,i=-2;break}}}c!==-1&&(e[a.marker][(a.open?3:0)+(a.length||0)%3]=c)}}function iq(t){const e=t.tokens_meta,n=t.tokens_meta.length;bw(t.delimiters);for(let r=0;r0&&r++,i[e].type==="text"&&e+1=t.pos)throw new Error("inline rule didn't increment state.pos");break}}else t.pos=t.posMax;o||t.pos++,s[e]=t.pos};qf.prototype.tokenize=function(t){const e=this.ruler.getRules(""),n=e.length,r=t.posMax,i=t.md.options.maxNesting;for(;t.pos=t.pos)throw new Error("inline rule didn't increment state.pos");break}}if(o){if(t.pos>=r)break;continue}t.pending+=t.src[t.pos++]}t.pending&&t.pushPending()};qf.prototype.parse=function(t,e,n,r){const i=new this.State(t,e,n,r);this.tokenize(i);const s=this.ruler2.getRules(""),o=s.length;for(let a=0;a|$))",e.tpl_email_fuzzy="(^|"+n+'|"|\\(|'+e.src_ZCc+")("+e.src_email_name+"@"+e.tpl_host_fuzzy_strict+")",e.tpl_link_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+e.src_ZPCc+"))((?![$+<=>^`||])"+e.tpl_host_port_fuzzy_strict+e.src_path+")",e.tpl_link_no_ip_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+e.src_ZPCc+"))((?![$+<=>^`||])"+e.tpl_host_port_no_ip_fuzzy_strict+e.src_path+")",e}function Xb(t){return Array.prototype.slice.call(arguments,1).forEach(function(n){n&&Object.keys(n).forEach(function(r){t[r]=n[r]})}),t}function um(t){return Object.prototype.toString.call(t)}function aq(t){return um(t)==="[object String]"}function lq(t){return um(t)==="[object Object]"}function uq(t){return um(t)==="[object RegExp]"}function yw(t){return um(t)==="[object Function]"}function cq(t){return t.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}const xO={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1};function fq(t){return Object.keys(t||{}).reduce(function(e,n){return e||xO.hasOwnProperty(n)},!1)}const dq={"http:":{validate:function(t,e,n){const r=t.slice(e);return n.re.http||(n.re.http=new RegExp("^\\/\\/"+n.re.src_auth+n.re.src_host_port_strict+n.re.src_path,"i")),n.re.http.test(r)?r.match(n.re.http)[0].length:0}},"https:":"http:","ftp:":"http:","//":{validate:function(t,e,n){const r=t.slice(e);return n.re.no_http||(n.re.no_http=new RegExp("^"+n.re.src_auth+"(?:localhost|(?:(?:"+n.re.src_domain+")\\.)+"+n.re.src_domain_root+")"+n.re.src_port+n.re.src_host_terminator+n.re.src_path,"i")),n.re.no_http.test(r)?e>=3&&t[e-3]===":"||e>=3&&t[e-3]==="/"?0:r.match(n.re.no_http)[0].length:0}},"mailto:":{validate:function(t,e,n){const r=t.slice(e);return n.re.mailto||(n.re.mailto=new RegExp("^"+n.re.src_email_name+"@"+n.re.src_host_strict,"i")),n.re.mailto.test(r)?r.match(n.re.mailto)[0].length:0}}},hq="a[cdefgilmnoqrstuwxz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvwxyz]|d[ejkmoz]|e[cegrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdeghklmnopqrstuvwxyz]|n[acefgilopruz]|om|p[aefghklmnrstwy]|qa|r[eosuw]|s[abcdeghijklmnortuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]",pq="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф".split("|");function mq(t){t.__index__=-1,t.__text_cache__=""}function gq(t){return function(e,n){const r=e.slice(n);return t.test(r)?r.match(t)[0].length:0}}function vw(){return function(t,e){e.normalize(t)}}function qp(t){const e=t.re=oq(t.__opts__),n=t.__tlds__.slice();t.onCompile(),t.__tlds_replaced__||n.push(hq),n.push(e.src_xn),e.src_tlds=n.join("|");function r(a){return a.replace("%TLDS%",e.src_tlds)}e.email_fuzzy=RegExp(r(e.tpl_email_fuzzy),"i"),e.link_fuzzy=RegExp(r(e.tpl_link_fuzzy),"i"),e.link_no_ip_fuzzy=RegExp(r(e.tpl_link_no_ip_fuzzy),"i"),e.host_fuzzy_test=RegExp(r(e.tpl_host_fuzzy_test),"i");const i=[];t.__compiled__={};function s(a,l){throw new Error('(LinkifyIt) Invalid schema "'+a+'": '+l)}Object.keys(t.__schemas__).forEach(function(a){const l=t.__schemas__[a];if(l===null)return;const u={validate:null,link:null};if(t.__compiled__[a]=u,lq(l)){uq(l.validate)?u.validate=gq(l.validate):yw(l.validate)?u.validate=l.validate:s(a,l),yw(l.normalize)?u.normalize=l.normalize:l.normalize?s(a,l):u.normalize=vw();return}if(aq(l)){i.push(a);return}s(a,l)}),i.forEach(function(a){t.__compiled__[t.__schemas__[a]]&&(t.__compiled__[a].validate=t.__compiled__[t.__schemas__[a]].validate,t.__compiled__[a].normalize=t.__compiled__[t.__schemas__[a]].normalize)}),t.__compiled__[""]={validate:null,normalize:vw()};const o=Object.keys(t.__compiled__).filter(function(a){return a.length>0&&t.__compiled__[a]}).map(cq).join("|");t.re.schema_test=RegExp("(^|(?!_)(?:[><|]|"+e.src_ZPCc+"))("+o+")","i"),t.re.schema_search=RegExp("(^|(?!_)(?:[><|]|"+e.src_ZPCc+"))("+o+")","ig"),t.re.schema_at_start=RegExp("^"+t.re.schema_search.source,"i"),t.re.pretest=RegExp("("+t.re.schema_test.source+")|("+t.re.host_fuzzy_test.source+")|@","i"),mq(t)}function bq(t,e){const n=t.__index__,r=t.__last_index__,i=t.__text_cache__.slice(n,r);this.schema=t.__schema__.toLowerCase(),this.index=n+e,this.lastIndex=r+e,this.raw=i,this.text=i,this.url=i}function Yb(t,e){const n=new bq(t,e);return t.__compiled__[n.schema].normalize(n,t),n}function Tr(t,e){if(!(this instanceof Tr))return new Tr(t,e);e||fq(t)&&(e=t,t={}),this.__opts__=Xb({},xO,e),this.__index__=-1,this.__last_index__=-1,this.__schema__="",this.__text_cache__="",this.__schemas__=Xb({},dq,t),this.__compiled__={},this.__tlds__=pq,this.__tlds_replaced__=!1,this.re={},qp(this)}Tr.prototype.add=function(e,n){return this.__schemas__[e]=n,qp(this),this};Tr.prototype.set=function(e){return this.__opts__=Xb(this.__opts__,e),this};Tr.prototype.test=function(e){if(this.__text_cache__=e,this.__index__=-1,!e.length)return!1;let n,r,i,s,o,a,l,u,c;if(this.re.schema_test.test(e)){for(l=this.re.schema_search,l.lastIndex=0;(n=l.exec(e))!==null;)if(s=this.testSchemaAt(e,n[2],l.lastIndex),s){this.__schema__=n[2],this.__index__=n.index+n[1].length,this.__last_index__=n.index+n[0].length+s;break}}return this.__opts__.fuzzyLink&&this.__compiled__["http:"]&&(u=e.search(this.re.host_fuzzy_test),u>=0&&(this.__index__<0||u=0&&(i=e.match(this.re.email_fuzzy))!==null&&(o=i.index+i[1].length,a=i.index+i[0].length,(this.__index__<0||othis.__last_index__)&&(this.__schema__="mailto:",this.__index__=o,this.__last_index__=a))),this.__index__>=0};Tr.prototype.pretest=function(e){return this.re.pretest.test(e)};Tr.prototype.testSchemaAt=function(e,n,r){return this.__compiled__[n.toLowerCase()]?this.__compiled__[n.toLowerCase()].validate(e,r,this):0};Tr.prototype.match=function(e){const n=[];let r=0;this.__index__>=0&&this.__text_cache__===e&&(n.push(Yb(this,r)),r=this.__last_index__);let i=r?e.slice(r):e;for(;this.test(i);)n.push(Yb(this,r)),i=i.slice(this.__last_index__),r+=this.__last_index__;return n.length?n:null};Tr.prototype.matchAtStart=function(e){if(this.__text_cache__=e,this.__index__=-1,!e.length)return null;const n=this.re.schema_at_start.exec(e);if(!n)return null;const r=this.testSchemaAt(e,n[2],n[0].length);return r?(this.__schema__=n[2],this.__index__=n.index+n[1].length,this.__last_index__=n.index+n[0].length+r,Yb(this,0)):null};Tr.prototype.tlds=function(e,n){return e=Array.isArray(e)?e:[e],n?(this.__tlds__=this.__tlds__.concat(e).sort().filter(function(r,i,s){return r!==s[i-1]}).reverse(),qp(this),this):(this.__tlds__=e.slice(),this.__tlds_replaced__=!0,qp(this),this)};Tr.prototype.normalize=function(e){e.schema||(e.url="http://"+e.url),e.schema==="mailto:"&&!/^mailto:/i.test(e.url)&&(e.url="mailto:"+e.url)};Tr.prototype.onCompile=function(){};const ml=2147483647,Ni=36,r2=1,ef=26,yq=38,vq=700,SO=72,EO=128,wO="-",xq=/^xn--/,Sq=/[^\0-\x7F]/,Eq=/[\x2E\u3002\uFF0E\uFF61]/g,wq={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},Wg=Ni-r2,Mi=Math.floor,Kg=String.fromCharCode;function Ms(t){throw new RangeError(wq[t])}function _q(t,e){const n=[];let r=t.length;for(;r--;)n[r]=e(t[r]);return n}function _O(t,e){const n=t.split("@");let r="";n.length>1&&(r=n[0]+"@",t=n[1]),t=t.replace(Eq,".");const i=t.split("."),s=_q(i,e).join(".");return r+s}function CO(t){const e=[];let n=0;const r=t.length;for(;n=55296&&i<=56319&&nString.fromCodePoint(...t),Aq=function(t){return t>=48&&t<58?26+(t-48):t>=65&&t<91?t-65:t>=97&&t<123?t-97:Ni},xw=function(t,e){return t+22+75*(t<26)-((e!=0)<<5)},AO=function(t,e,n){let r=0;for(t=n?Mi(t/vq):t>>1,t+=Mi(t/e);t>Wg*ef>>1;r+=Ni)t=Mi(t/Wg);return Mi(r+(Wg+1)*t/(t+yq))},DO=function(t){const e=[],n=t.length;let r=0,i=EO,s=SO,o=t.lastIndexOf(wO);o<0&&(o=0);for(let a=0;a=128&&Ms("not-basic"),e.push(t.charCodeAt(a));for(let a=o>0?o+1:0;a=n&&Ms("invalid-input");const d=Aq(t.charCodeAt(a++));d>=Ni&&Ms("invalid-input"),d>Mi((ml-r)/c)&&Ms("overflow"),r+=d*c;const h=f<=s?r2:f>=s+ef?ef:f-s;if(dMi(ml/p)&&Ms("overflow"),c*=p}const u=e.length+1;s=AO(r-l,u,l==0),Mi(r/u)>ml-i&&Ms("overflow"),i+=Mi(r/u),r%=u,e.splice(r++,0,i)}return String.fromCodePoint(...e)},kO=function(t){const e=[];t=CO(t);const n=t.length;let r=EO,i=0,s=SO;for(const l of t)l<128&&e.push(Kg(l));const o=e.length;let a=o;for(o&&e.push(wO);a=r&&cMi((ml-i)/u)&&Ms("overflow"),i+=(l-r)*u,r=l;for(const c of t)if(cml&&Ms("overflow"),c===r){let f=i;for(let d=Ni;;d+=Ni){const h=d<=s?r2:d>=s+ef?ef:d-s;if(f=0))try{e.hostname=OO.toASCII(e.hostname)}catch{}return Uf(Yv(e))}function Lq(t){const e=Jv(t,!0);if(e.hostname&&(!e.protocol||TO.indexOf(e.protocol)>=0))try{e.hostname=OO.toUnicode(e.hostname)}catch{}return Ml(Yv(e),Ml.defaultChars+"%")}function Gr(t,e){if(!(this instanceof Gr))return new Gr(t,e);e||Qv(t)||(e=t||{},t="default"),this.inline=new qf,this.block=new lm,this.core=new t2,this.renderer=new ou,this.linkify=new Tr,this.validateLink=Mq,this.normalizeLink=Fq,this.normalizeLinkText=Lq,this.utils=$U,this.helpers=om({},UU),this.options={},this.configure(t),e&&this.set(e)}Gr.prototype.set=function(t){return om(this.options,t),this};Gr.prototype.configure=function(t){const e=this;if(Qv(t)){const n=t;if(t=Pq[n],!t)throw new Error('Wrong `markdown-it` preset "'+n+'", check name')}if(!t)throw new Error("Wrong `markdown-it` preset, can't be empty");return t.options&&e.set(t.options),t.components&&Object.keys(t.components).forEach(function(n){t.components[n].rules&&e[n].ruler.enableOnly(t.components[n].rules),t.components[n].rules2&&e[n].ruler2.enableOnly(t.components[n].rules2)}),this};Gr.prototype.enable=function(t,e){let n=[];Array.isArray(t)||(t=[t]),["core","block","inline"].forEach(function(i){n=n.concat(this[i].ruler.enable(t,!0))},this),n=n.concat(this.inline.ruler2.enable(t,!0));const r=t.filter(function(i){return n.indexOf(i)<0});if(r.length&&!e)throw new Error("MarkdownIt. Failed to enable unknown rule(s): "+r);return this};Gr.prototype.disable=function(t,e){let n=[];Array.isArray(t)||(t=[t]),["core","block","inline"].forEach(function(i){n=n.concat(this[i].ruler.disable(t,!0))},this),n=n.concat(this.inline.ruler2.disable(t,!0));const r=t.filter(function(i){return n.indexOf(i)<0});if(r.length&&!e)throw new Error("MarkdownIt. Failed to disable unknown rule(s): "+r);return this};Gr.prototype.use=function(t){const e=[this].concat(Array.prototype.slice.call(arguments,1));return t.apply(t,e),this};Gr.prototype.parse=function(t,e){if(typeof t!="string")throw new Error("Input data should be a String");const n=new this.core.State(t,this,e);return this.core.process(n),n.tokens};Gr.prototype.render=function(t,e){return e=e||{},this.renderer.render(this.parse(t,e),this.options,e)};Gr.prototype.parseInline=function(t,e){const n=new this.core.State(t,this,e);return n.inlineMode=!0,this.core.process(n),n.tokens};Gr.prototype.renderInline=function(t,e){return e=e||{},this.renderer.render(this.parseInline(t,e),this.options,e)};function Bq(t,e,n){const{parseMetaString:r,trimEndingNewline:i=!0,defaultLanguage:s="text",fallbackLanguage:o}=n,a=e.getLoadedLanguages();t.options.highlight=(l,u="text",c)=>{u===""&&(u=s),o&&!a.includes(u)&&(u=o);const f=(r==null?void 0:r(c,l,u))||{},d={...n,lang:u,meta:{...n.meta,...f,__raw:c}},h=[];return h.push({name:"@shikijs/markdown-it:block-class",code(p){p.properties.class=`language-${u}`}}),i&&l.endsWith(` -`)&&(l=l.slice(0,-1)),e.codeToHtml(l,{...d,transformers:[...h,...d.transformers||[]]})}}function $q(t,e){return function(n){Bq(n,t,e)}}let ia=class extends Error{constructor(e){super(e),this.name="ShikiError"}},i2=class extends Error{constructor(e){super(e),this.name="ShikiError"}};function zq(){return 2147483648}function jq(){return typeof performance<"u"?performance.now():Date.now()}const Vq=(t,e)=>t+(e-t%e)%e;async function Uq(t){let e,n;const r={};function i(h){n=h,r.HEAPU8=new Uint8Array(h),r.HEAPU32=new Uint32Array(h)}function s(h,p,m){r.HEAPU8.copyWithin(h,p,p+m)}function o(h){try{return e.grow(h-n.byteLength+65535>>>16),i(e.buffer),1}catch{}}function a(h){const p=r.HEAPU8.length;h=h>>>0;const m=zq();if(h>m)return!1;for(let g=1;g<=4;g*=2){let b=p*(1+.2/g);b=Math.min(b,h+100663296);const y=Math.min(m,Vq(Math.max(h,b),65536));if(o(y))return!0}return!1}const l=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0;function u(h,p,m=1024){const g=p+m;let b=p;for(;h[b]&&!(b>=g);)++b;if(b-p>16&&h.buffer&&l)return l.decode(h.subarray(p,b));let y="";for(;p>10,56320|C&1023)}}return y}function c(h,p){return h?u(r.HEAPU8,h,p):""}const f={emscripten_get_now:jq,emscripten_memcpy_big:s,emscripten_resize_heap:a,fd_write:()=>0};async function d(){const p=await t({env:f,wasi_snapshot_preview1:f});e=p.memory,i(e.buffer),Object.assign(r,p),r.UTF8ToString=c}return await d(),r}var Hq=Object.defineProperty,qq=(t,e,n)=>e in t?Hq(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,rn=(t,e,n)=>(qq(t,typeof e!="symbol"?e+"":e,n),n);let cn=null;function Gq(t){throw new i2(t.UTF8ToString(t.getLastOnigError()))}class cm{constructor(e){rn(this,"utf16Length"),rn(this,"utf8Length"),rn(this,"utf16Value"),rn(this,"utf8Value"),rn(this,"utf16OffsetToUtf8"),rn(this,"utf8OffsetToUtf16");const n=e.length,r=cm._utf8ByteLength(e),i=r!==n,s=i?new Uint32Array(n+1):null;i&&(s[n]=r);const o=i?new Uint32Array(r+1):null;i&&(o[r]=n);const a=new Uint8Array(r);let l=0;for(let u=0;u=55296&&c<=56319&&u+1=56320&&h<=57343&&(f=(c-55296<<10)+65536|h-56320,d=!0)}i&&(s[u]=l,d&&(s[u+1]=l),f<=127?o[l+0]=u:f<=2047?(o[l+0]=u,o[l+1]=u):f<=65535?(o[l+0]=u,o[l+1]=u,o[l+2]=u):(o[l+0]=u,o[l+1]=u,o[l+2]=u,o[l+3]=u)),f<=127?a[l++]=f:f<=2047?(a[l++]=192|(f&1984)>>>6,a[l++]=128|(f&63)>>>0):f<=65535?(a[l++]=224|(f&61440)>>>12,a[l++]=128|(f&4032)>>>6,a[l++]=128|(f&63)>>>0):(a[l++]=240|(f&1835008)>>>18,a[l++]=128|(f&258048)>>>12,a[l++]=128|(f&4032)>>>6,a[l++]=128|(f&63)>>>0),d&&u++}this.utf16Length=n,this.utf8Length=r,this.utf16Value=e,this.utf8Value=a,this.utf16OffsetToUtf8=s,this.utf8OffsetToUtf16=o}static _utf8ByteLength(e){let n=0;for(let r=0,i=e.length;r=55296&&s<=56319&&r+1=56320&&l<=57343&&(o=(s-55296<<10)+65536|l-56320,a=!0)}o<=127?n+=1:o<=2047?n+=2:o<=65535?n+=3:n+=4,a&&r++}return n}createString(e){const n=e.omalloc(this.utf8Length);return e.HEAPU8.set(this.utf8Value,n),n}}const wi=class{constructor(t){if(rn(this,"id",++wi.LAST_ID),rn(this,"_onigBinding"),rn(this,"content"),rn(this,"utf16Length"),rn(this,"utf8Length"),rn(this,"utf16OffsetToUtf8"),rn(this,"utf8OffsetToUtf16"),rn(this,"ptr"),!cn)throw new i2("Must invoke loadWasm first.");this._onigBinding=cn,this.content=t;const e=new cm(t);this.utf16Length=e.utf16Length,this.utf8Length=e.utf8Length,this.utf16OffsetToUtf8=e.utf16OffsetToUtf8,this.utf8OffsetToUtf16=e.utf8OffsetToUtf16,this.utf8Length<1e4&&!wi._sharedPtrInUse?(wi._sharedPtr||(wi._sharedPtr=cn.omalloc(1e4)),wi._sharedPtrInUse=!0,cn.HEAPU8.set(e.utf8Value,wi._sharedPtr),this.ptr=wi._sharedPtr):this.ptr=e.createString(cn)}convertUtf8OffsetToUtf16(t){return this.utf8OffsetToUtf16?t<0?0:t>this.utf8Length?this.utf16Length:this.utf8OffsetToUtf16[t]:t}convertUtf16OffsetToUtf8(t){return this.utf16OffsetToUtf8?t<0?0:t>this.utf16Length?this.utf8Length:this.utf16OffsetToUtf8[t]:t}dispose(){this.ptr===wi._sharedPtr?wi._sharedPtrInUse=!1:this._onigBinding.ofree(this.ptr)}};let Gf=wi;rn(Gf,"LAST_ID",0);rn(Gf,"_sharedPtr",0);rn(Gf,"_sharedPtrInUse",!1);class Wq{constructor(e){if(rn(this,"_onigBinding"),rn(this,"_ptr"),!cn)throw new i2("Must invoke loadWasm first.");const n=[],r=[];for(let a=0,l=e.length;a{let r=t;return r=await r,typeof r=="function"&&(r=await r(n)),typeof r=="function"&&(r=await r(n)),Kq(r)?r=await r.instantiator(n):Xq(r)?r=await r.default(n):(Yq(r)&&(r=r.data),Jq(r)?typeof WebAssembly.instantiateStreaming=="function"?r=await eG(r)(n):r=await tG(r)(n):Zq(r)?r=await Xg(r)(n):r instanceof WebAssembly.Module?r=await Xg(r)(n):"default"in r&&r.default instanceof WebAssembly.Module&&(r=await Xg(r.default)(n))),"instance"in r&&(r=r.instance),"exports"in r&&(r=r.exports),r})}return Wd=e(),Wd}function Xg(t){return e=>WebAssembly.instantiate(t,e)}function eG(t){return e=>WebAssembly.instantiateStreaming(t,e)}function tG(t){return async e=>{const n=await t.arrayBuffer();return WebAssembly.instantiate(n,e)}}let nG;function rG(){return nG}async function iG(t){return t&&await Qq(t),{createScanner(e){return new Wq(e.map(n=>typeof n=="string"?n:n.source))},createString(e){return new Gf(e)}}}function sG(t){return s2(t)}function s2(t){return Array.isArray(t)?oG(t):t instanceof RegExp?t:typeof t=="object"?aG(t):t}function oG(t){let e=[];for(let n=0,r=t.length;n{for(let r in n)t[r]=n[r]}),t}function PO(t){const e=~t.lastIndexOf("/")||~t.lastIndexOf("\\");return e===0?t:~e===t.length-1?PO(t.substring(0,t.length-1)):t.substr(~e+1)}var Yg=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,Kd=class{static hasCaptures(t){return t===null?!1:(Yg.lastIndex=0,Yg.test(t))}static replaceCaptures(t,e,n){return t.replace(Yg,(r,i,s,o)=>{let a=n[parseInt(i||s,10)];if(a){let l=e.substring(a.start,a.end);for(;l[0]===".";)l=l.substring(1);switch(o){case"downcase":return l.toLowerCase();case"upcase":return l.toUpperCase();default:return l}}else return r})}};function RO(t,e){return te?1:0}function NO(t,e){if(t===null&&e===null)return 0;if(!t)return-1;if(!e)return 1;let n=t.length,r=e.length;if(n===r){for(let i=0;ithis._root.match(t)));this._colorMap=t,this._defaults=e,this._root=n}static createFromRawTheme(t,e){return this.createFromParsedTheme(cG(t),e)}static createFromParsedTheme(t,e){return dG(t,e)}getColorMap(){return this._colorMap.getColorMap()}getDefaults(){return this._defaults}match(t){if(t===null)return this._defaults;const e=t.scopeName,r=this._cachedMatchRoot.get(e).find(i=>lG(t.parent,i.parentScopes));return r?new LO(r.fontStyle,r.foreground,r.background):null}},Jg=class zh{constructor(e,n){this.parent=e,this.scopeName=n}static push(e,n){for(const r of n)e=new zh(e,r);return e}static from(...e){let n=null;for(let r=0;r"){if(n===e.length-1)return!1;r=e[++n],i=!0}for(;t&&!uG(t.scopeName,r);){if(i)return!1;t=t.parent}if(!t)return!1;t=t.parent}return!0}function uG(t,e){return e===t||t.startsWith(e)&&t[e.length]==="."}var LO=class{constructor(t,e,n){this.fontStyle=t,this.foregroundId=e,this.backgroundId=n}};function cG(t){if(!t)return[];if(!t.settings||!Array.isArray(t.settings))return[];let e=t.settings,n=[],r=0;for(let i=0,s=e.length;i1&&(g=p.slice(0,p.length-1),g.reverse()),n[r++]=new fG(m,g,i,l,u,c)}}return n}var fG=class{constructor(t,e,n,r,i,s){this.scope=t,this.parentScopes=e,this.index=n,this.fontStyle=r,this.foreground=i,this.background=s}},hs=(t=>(t[t.NotSet=-1]="NotSet",t[t.None=0]="None",t[t.Italic=1]="Italic",t[t.Bold=2]="Bold",t[t.Underline=4]="Underline",t[t.Strikethrough=8]="Strikethrough",t))(hs||{});function dG(t,e){t.sort((l,u)=>{let c=RO(l.scope,u.scope);return c!==0||(c=NO(l.parentScopes,u.parentScopes),c!==0)?c:l.index-u.index});let n=0,r="#000000",i="#ffffff";for(;t.length>=1&&t[0].scope==="";){let l=t.shift();l.fontStyle!==-1&&(n=l.fontStyle),l.foreground!==null&&(r=l.foreground),l.background!==null&&(i=l.background)}let s=new hG(e),o=new LO(n,s.getId(r),s.getId(i)),a=new mG(new Jb(0,null,-1,0,0),[]);for(let l=0,u=t.length;le?console.log("how did this happen?"):this.scopeDepth=e,n!==-1&&(this.fontStyle=n),r!==0&&(this.foreground=r),i!==0&&(this.background=i)}},mG=class Zb{constructor(e,n=[],r={}){X(this,"_rulesWithParentScopes");this._mainRule=e,this._children=r,this._rulesWithParentScopes=n}static _cmpBySpecificity(e,n){if(e.scopeDepth!==n.scopeDepth)return n.scopeDepth-e.scopeDepth;let r=0,i=0;for(;e.parentScopes[r]===">"&&r++,n.parentScopes[i]===">"&&i++,!(r>=e.parentScopes.length||i>=n.parentScopes.length);){const s=n.parentScopes[i].length-e.parentScopes[r].length;if(s!==0)return s;r++,i++}return n.parentScopes.length-e.parentScopes.length}match(e){if(e!==""){let r=e.indexOf("."),i,s;if(r===-1?(i=e,s=""):(i=e.substring(0,r),s=e.substring(r+1)),this._children.hasOwnProperty(i))return this._children[i].match(s)}const n=this._rulesWithParentScopes.concat(this._mainRule);return n.sort(Zb._cmpBySpecificity),n}insert(e,n,r,i,s,o){if(n===""){this._doInsertHere(e,r,i,s,o);return}let a=n.indexOf("."),l,u;a===-1?(l=n,u=""):(l=n.substring(0,a),u=n.substring(a+1));let c;this._children.hasOwnProperty(l)?c=this._children[l]:(c=new Zb(this._mainRule.clone(),Jb.cloneArr(this._rulesWithParentScopes)),this._children[l]=c),c.insert(e+1,u,r,i,s,o)}_doInsertHere(e,n,r,i,s){if(n===null){this._mainRule.acceptOverwrite(e,r,i,s);return}for(let o=0,a=this._rulesWithParentScopes.length;o>>0}static getTokenType(e){return(e&768)>>>8}static containsBalancedBrackets(e){return(e&1024)!==0}static getFontStyle(e){return(e&30720)>>>11}static getForeground(e){return(e&16744448)>>>15}static getBackground(e){return(e&4278190080)>>>24}static set(e,n,r,i,s,o,a){let l=Mr.getLanguageId(e),u=Mr.getTokenType(e),c=Mr.containsBalancedBrackets(e)?1:0,f=Mr.getFontStyle(e),d=Mr.getForeground(e),h=Mr.getBackground(e);return n!==0&&(l=n),r!==8&&(u=r),i!==null&&(c=i?1:0),s!==-1&&(f=s),o!==0&&(d=o),a!==0&&(h=a),(l<<0|u<<8|c<<10|f<<11|d<<15|h<<24)>>>0}};function Wp(t,e){const n=[],r=gG(t);let i=r.next();for(;i!==null;){let l=0;if(i.length===2&&i.charAt(1)===":"){switch(i.charAt(0)){case"R":l=1;break;case"L":l=-1;break;default:console.log(`Unknown priority ${i} in scope selector`)}i=r.next()}let u=o();if(n.push({matcher:u,priority:l}),i!==",")break;i=r.next()}return n;function s(){if(i==="-"){i=r.next();const l=s();return u=>!!l&&!l(u)}if(i==="("){i=r.next();const l=a();return i===")"&&(i=r.next()),l}if(Ew(i)){const l=[];do l.push(i),i=r.next();while(Ew(i));return u=>e(l,u)}return null}function o(){const l=[];let u=s();for(;u;)l.push(u),u=s();return c=>l.every(f=>f(c))}function a(){const l=[];let u=o();for(;u&&(l.push(u),i==="|"||i===",");){do i=r.next();while(i==="|"||i===",");u=o()}return c=>l.some(f=>f(c))}}function Ew(t){return!!t&&!!t.match(/[\w\.:]+/)}function gG(t){let e=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g,n=e.exec(t);return{next:()=>{if(!n)return null;const r=n[0];return n=e.exec(t),r}}}function $O(t){typeof t.dispose=="function"&&t.dispose()}var tf=class{constructor(t){this.scopeName=t}toKey(){return this.scopeName}},bG=class{constructor(t,e){this.scopeName=t,this.ruleName=e}toKey(){return`${this.scopeName}#${this.ruleName}`}},yG=class{constructor(){X(this,"_references",[]);X(this,"_seenReferenceKeys",new Set);X(this,"visitedRule",new Set)}get references(){return this._references}add(t){const e=t.toKey();this._seenReferenceKeys.has(e)||(this._seenReferenceKeys.add(e),this._references.push(t))}},vG=class{constructor(t,e){X(this,"seenFullScopeRequests",new Set);X(this,"seenPartialScopeRequests",new Set);X(this,"Q");this.repo=t,this.initialScopeName=e,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new tf(this.initialScopeName)]}processQueue(){const t=this.Q;this.Q=[];const e=new yG;for(const n of t)xG(n,this.initialScopeName,this.repo,e);for(const n of e.references)if(n instanceof tf){if(this.seenFullScopeRequests.has(n.scopeName))continue;this.seenFullScopeRequests.add(n.scopeName),this.Q.push(n)}else{if(this.seenFullScopeRequests.has(n.scopeName)||this.seenPartialScopeRequests.has(n.toKey()))continue;this.seenPartialScopeRequests.add(n.toKey()),this.Q.push(n)}}};function xG(t,e,n,r){const i=n.lookup(t.scopeName);if(!i){if(t.scopeName===e)throw new Error(`No grammar provided for <${e}>`);return}const s=n.lookup(e);t instanceof tf?jh({baseGrammar:s,selfGrammar:i},r):Qb(t.ruleName,{baseGrammar:s,selfGrammar:i,repository:i.repository},r);const o=n.injections(t.scopeName);if(o)for(const a of o)r.add(new tf(a))}function Qb(t,e,n){if(e.repository&&e.repository[t]){const r=e.repository[t];Kp([r],e,n)}}function jh(t,e){t.selfGrammar.patterns&&Array.isArray(t.selfGrammar.patterns)&&Kp(t.selfGrammar.patterns,{...t,repository:t.selfGrammar.repository},e),t.selfGrammar.injections&&Kp(Object.values(t.selfGrammar.injections),{...t,repository:t.selfGrammar.repository},e)}function Kp(t,e,n){for(const r of t){if(n.visitedRule.has(r))continue;n.visitedRule.add(r);const i=r.repository?IO({},e.repository,r.repository):e.repository;Array.isArray(r.patterns)&&Kp(r.patterns,{...e,repository:i},n);const s=r.include;if(!s)continue;const o=zO(s);switch(o.kind){case 0:jh({...e,selfGrammar:e.baseGrammar},n);break;case 1:jh(e,n);break;case 2:Qb(o.ruleName,{...e,repository:i},n);break;case 3:case 4:const a=o.scopeName===e.selfGrammar.scopeName?e.selfGrammar:o.scopeName===e.baseGrammar.scopeName?e.baseGrammar:void 0;if(a){const l={baseGrammar:e.baseGrammar,selfGrammar:a,repository:i};o.kind===4?Qb(o.ruleName,l,n):jh(l,n)}else o.kind===4?n.add(new bG(o.scopeName,o.ruleName)):n.add(new tf(o.scopeName));break}}}var SG=class{constructor(){X(this,"kind",0)}},EG=class{constructor(){X(this,"kind",1)}},wG=class{constructor(t){X(this,"kind",2);this.ruleName=t}},_G=class{constructor(t){X(this,"kind",3);this.scopeName=t}},CG=class{constructor(t,e){X(this,"kind",4);this.scopeName=t,this.ruleName=e}};function zO(t){if(t==="$base")return new SG;if(t==="$self")return new EG;const e=t.indexOf("#");if(e===-1)return new _G(t);if(e===0)return new wG(t.substring(1));{const n=t.substring(0,e),r=t.substring(e+1);return new CG(n,r)}}var AG=/\\(\d+)/,ww=/\\(\d+)/g,DG=-1,jO=-2;var Wf=class{constructor(t,e,n,r){X(this,"$location");X(this,"id");X(this,"_nameIsCapturing");X(this,"_name");X(this,"_contentNameIsCapturing");X(this,"_contentName");this.$location=t,this.id=e,this._name=n||null,this._nameIsCapturing=Kd.hasCaptures(this._name),this._contentName=r||null,this._contentNameIsCapturing=Kd.hasCaptures(this._contentName)}get debugName(){const t=this.$location?`${PO(this.$location.filename)}:${this.$location.line}`:"unknown";return`${this.constructor.name}#${this.id} @ ${t}`}getName(t,e){return!this._nameIsCapturing||this._name===null||t===null||e===null?this._name:Kd.replaceCaptures(this._name,t,e)}getContentName(t,e){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:Kd.replaceCaptures(this._contentName,t,e)}},kG=class extends Wf{constructor(e,n,r,i,s){super(e,n,r,i);X(this,"retokenizeCapturedWithRuleId");this.retokenizeCapturedWithRuleId=s}dispose(){}collectPatterns(e,n){throw new Error("Not supported!")}compile(e,n){throw new Error("Not supported!")}compileAG(e,n,r,i){throw new Error("Not supported!")}},OG=class extends Wf{constructor(e,n,r,i,s){super(e,n,r,null);X(this,"_match");X(this,"captures");X(this,"_cachedCompiledPatterns");this._match=new nf(i,this.id),this.captures=s,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugMatchRegExp(){return`${this._match.source}`}collectPatterns(e,n){n.push(this._match)}compile(e,n){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,n,r,i){return this._getCachedCompiledPatterns(e).compileAG(e,r,i)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new rf,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},_w=class extends Wf{constructor(e,n,r,i,s){super(e,n,r,i);X(this,"hasMissingPatterns");X(this,"patterns");X(this,"_cachedCompiledPatterns");this.patterns=s.patterns,this.hasMissingPatterns=s.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}collectPatterns(e,n){for(const r of this.patterns)e.getRule(r).collectPatterns(e,n)}compile(e,n){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,n,r,i){return this._getCachedCompiledPatterns(e).compileAG(e,r,i)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new rf,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},ey=class extends Wf{constructor(e,n,r,i,s,o,a,l,u,c){super(e,n,r,i);X(this,"_begin");X(this,"beginCaptures");X(this,"_end");X(this,"endHasBackReferences");X(this,"endCaptures");X(this,"applyEndPatternLast");X(this,"hasMissingPatterns");X(this,"patterns");X(this,"_cachedCompiledPatterns");this._begin=new nf(s,this.id),this.beginCaptures=o,this._end=new nf(a||"￿",-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=l,this.applyEndPatternLast=u||!1,this.patterns=c.patterns,this.hasMissingPatterns=c.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugEndRegExp(){return`${this._end.source}`}getEndWithResolvedBackReferences(e,n){return this._end.resolveBackReferences(e,n)}collectPatterns(e,n){n.push(this._begin)}compile(e,n){return this._getCachedCompiledPatterns(e,n).compile(e)}compileAG(e,n,r,i){return this._getCachedCompiledPatterns(e,n).compileAG(e,r,i)}_getCachedCompiledPatterns(e,n){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new rf;for(const r of this.patterns)e.getRule(r).collectPatterns(e,this._cachedCompiledPatterns);this.applyEndPatternLast?this._cachedCompiledPatterns.push(this._end.hasBackReferences?this._end.clone():this._end):this._cachedCompiledPatterns.unshift(this._end.hasBackReferences?this._end.clone():this._end)}return this._end.hasBackReferences&&(this.applyEndPatternLast?this._cachedCompiledPatterns.setSource(this._cachedCompiledPatterns.length()-1,n):this._cachedCompiledPatterns.setSource(0,n)),this._cachedCompiledPatterns}},Xp=class extends Wf{constructor(e,n,r,i,s,o,a,l,u){super(e,n,r,i);X(this,"_begin");X(this,"beginCaptures");X(this,"whileCaptures");X(this,"_while");X(this,"whileHasBackReferences");X(this,"hasMissingPatterns");X(this,"patterns");X(this,"_cachedCompiledPatterns");X(this,"_cachedCompiledWhilePatterns");this._begin=new nf(s,this.id),this.beginCaptures=o,this.whileCaptures=l,this._while=new nf(a,jO),this.whileHasBackReferences=this._while.hasBackReferences,this.patterns=u.patterns,this.hasMissingPatterns=u.hasMissingPatterns,this._cachedCompiledPatterns=null,this._cachedCompiledWhilePatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null),this._cachedCompiledWhilePatterns&&(this._cachedCompiledWhilePatterns.dispose(),this._cachedCompiledWhilePatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugWhileRegExp(){return`${this._while.source}`}getWhileWithResolvedBackReferences(e,n){return this._while.resolveBackReferences(e,n)}collectPatterns(e,n){n.push(this._begin)}compile(e,n){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,n,r,i){return this._getCachedCompiledPatterns(e).compileAG(e,r,i)}_getCachedCompiledPatterns(e){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new rf;for(const n of this.patterns)e.getRule(n).collectPatterns(e,this._cachedCompiledPatterns)}return this._cachedCompiledPatterns}compileWhile(e,n){return this._getCachedCompiledWhilePatterns(e,n).compile(e)}compileWhileAG(e,n,r,i){return this._getCachedCompiledWhilePatterns(e,n).compileAG(e,r,i)}_getCachedCompiledWhilePatterns(e,n){return this._cachedCompiledWhilePatterns||(this._cachedCompiledWhilePatterns=new rf,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,n||"￿"),this._cachedCompiledWhilePatterns}},VO=class Dn{static createCaptureRule(e,n,r,i,s){return e.registerRule(o=>new kG(n,o,r,i,s))}static getCompiledRuleId(e,n,r){return e.id||n.registerRule(i=>{if(e.id=i,e.match)return new OG(e.$vscodeTextmateLocation,e.id,e.name,e.match,Dn._compileCaptures(e.captures,n,r));if(typeof e.begin>"u"){e.repository&&(r=IO({},r,e.repository));let s=e.patterns;return typeof s>"u"&&e.include&&(s=[{include:e.include}]),new _w(e.$vscodeTextmateLocation,e.id,e.name,e.contentName,Dn._compilePatterns(s,n,r))}return e.while?new Xp(e.$vscodeTextmateLocation,e.id,e.name,e.contentName,e.begin,Dn._compileCaptures(e.beginCaptures||e.captures,n,r),e.while,Dn._compileCaptures(e.whileCaptures||e.captures,n,r),Dn._compilePatterns(e.patterns,n,r)):new ey(e.$vscodeTextmateLocation,e.id,e.name,e.contentName,e.begin,Dn._compileCaptures(e.beginCaptures||e.captures,n,r),e.end,Dn._compileCaptures(e.endCaptures||e.captures,n,r),e.applyEndPatternLast,Dn._compilePatterns(e.patterns,n,r))}),e.id}static _compileCaptures(e,n,r){let i=[];if(e){let s=0;for(const o in e){if(o==="$vscodeTextmateLocation")continue;const a=parseInt(o,10);a>s&&(s=a)}for(let o=0;o<=s;o++)i[o]=null;for(const o in e){if(o==="$vscodeTextmateLocation")continue;const a=parseInt(o,10);let l=0;e[o].patterns&&(l=Dn.getCompiledRuleId(e[o],n,r)),i[a]=Dn.createCaptureRule(n,e[o].$vscodeTextmateLocation,e[o].name,e[o].contentName,l)}}return i}static _compilePatterns(e,n,r){let i=[];if(e)for(let s=0,o=e.length;se.substring(i.start,i.end));return ww.lastIndex=0,this.source.replace(ww,(i,s)=>MO(r[parseInt(s,10)]||""))}_buildAnchorCache(){if(typeof this.source!="string")throw new Error("This method should only be called if the source is a string");let e=[],n=[],r=[],i=[],s,o,a,l;for(s=0,o=this.source.length;sn.source);this._cached=new Cw(t,e,this._items.map(n=>n.ruleId))}return this._cached}compileAG(t,e,n){return this._hasAnchors?e?n?(this._anchorCache.A1_G1||(this._anchorCache.A1_G1=this._resolveAnchors(t,e,n)),this._anchorCache.A1_G1):(this._anchorCache.A1_G0||(this._anchorCache.A1_G0=this._resolveAnchors(t,e,n)),this._anchorCache.A1_G0):n?(this._anchorCache.A0_G1||(this._anchorCache.A0_G1=this._resolveAnchors(t,e,n)),this._anchorCache.A0_G1):(this._anchorCache.A0_G0||(this._anchorCache.A0_G0=this._resolveAnchors(t,e,n)),this._anchorCache.A0_G0):this.compile(t)}_resolveAnchors(t,e,n){let r=this._items.map(i=>i.resolveAnchors(e,n));return new Cw(t,r,this._items.map(i=>i.ruleId))}},Cw=class{constructor(t,e,n){X(this,"scanner");this.regExps=e,this.rules=n,this.scanner=t.createOnigScanner(e)}dispose(){typeof this.scanner.dispose=="function"&&this.scanner.dispose()}toString(){const t=[];for(let e=0,n=this.rules.length;e{const n=this._scopeToLanguage(e),r=this._toStandardTokenType(e);return new Zg(n,r)}));this._defaultAttributes=new Zg(e,8),this._embeddedLanguagesMatcher=new IG(Object.entries(n||{}))}getDefaultAttributes(){return this._defaultAttributes}getBasicScopeAttributes(e){return e===null?ds._NULL_SCOPE_METADATA:this._getBasicScopeAttributes.get(e)}_scopeToLanguage(e){return this._embeddedLanguagesMatcher.match(e)||0}_toStandardTokenType(e){const n=e.match(ds.STANDARD_TOKEN_TYPE_REGEXP);if(!n)return 8;switch(n[1]){case"comment":return 1;case"string":return 2;case"regex":return 3;case"meta.embedded":return 0}throw new Error("Unexpected match for standard token type!")}},X(ds,"_NULL_SCOPE_METADATA",new Zg(0,0)),X(ds,"STANDARD_TOKEN_TYPE_REGEXP",/\b(comment|string|regex|meta\.embedded)\b/),ds),IG=class{constructor(t){X(this,"values");X(this,"scopesRegExp");if(t.length===0)this.values=null,this.scopesRegExp=null;else{this.values=new Map(t);const e=t.map(([n,r])=>MO(n));e.sort(),e.reverse(),this.scopesRegExp=new RegExp(`^((${e.join(")|(")}))($|\\.)`,"")}}match(t){if(!this.scopesRegExp)return;const e=t.match(this.scopesRegExp);if(e)return this.values.get(e[1])}},Aw=class{constructor(t,e){this.stack=t,this.stoppedEarly=e}};function HO(t,e,n,r,i,s,o,a){const l=e.content.length;let u=!1,c=-1;if(o){const h=PG(t,e,n,r,i,s);i=h.stack,r=h.linePos,n=h.isFirstLine,c=h.anchorPosition}const f=Date.now();for(;!u;){if(a!==0&&Date.now()-f>a)return new Aw(i,!0);d()}return new Aw(i,!1);function d(){const h=RG(t,e,n,r,i,c);if(!h){s.produce(i,l),u=!0;return}const p=h.captureIndices,m=h.matchedRuleId,g=p&&p.length>0?p[0].end>r:!1;if(m===DG){const b=i.getRule(t);s.produce(i,p[0].start),i=i.withContentNameScopesList(i.nameScopesList),Ju(t,e,n,i,s,b.endCaptures,p),s.produce(i,p[0].end);const y=i;if(i=i.parent,c=y.getAnchorPos(),!g&&y.getEnterPos()===r){i=y,s.produce(i,l),u=!0;return}}else{const b=t.getRule(m);s.produce(i,p[0].start);const y=i,x=b.getName(e.content,p),S=i.contentNameScopesList.pushAttributed(x,t);if(i=i.push(m,r,c,p[0].end===l,null,S,S),b instanceof ey){const E=b;Ju(t,e,n,i,s,E.beginCaptures,p),s.produce(i,p[0].end),c=p[0].end;const C=E.getContentName(e.content,p),w=S.pushAttributed(C,t);if(i=i.withContentNameScopesList(w),E.endHasBackReferences&&(i=i.withEndRule(E.getEndWithResolvedBackReferences(e.content,p))),!g&&y.hasSameRuleAs(i)){i=i.pop(),s.produce(i,l),u=!0;return}}else if(b instanceof Xp){const E=b;Ju(t,e,n,i,s,E.beginCaptures,p),s.produce(i,p[0].end),c=p[0].end;const C=E.getContentName(e.content,p),w=S.pushAttributed(C,t);if(i=i.withContentNameScopesList(w),E.whileHasBackReferences&&(i=i.withEndRule(E.getWhileWithResolvedBackReferences(e.content,p))),!g&&y.hasSameRuleAs(i)){i=i.pop(),s.produce(i,l),u=!0;return}}else if(Ju(t,e,n,i,s,b.captures,p),s.produce(i,p[0].end),i=i.pop(),!g){i=i.safePop(),s.produce(i,l),u=!0;return}}p[0].end>r&&(r=p[0].end,n=!1)}}function PG(t,e,n,r,i,s){let o=i.beginRuleCapturedEOL?0:-1;const a=[];for(let l=i;l;l=l.pop()){const u=l.getRule(t);u instanceof Xp&&a.push({rule:u,stack:l})}for(let l=a.pop();l;l=a.pop()){const{ruleScanner:u,findOptions:c}=FG(l.rule,t,l.stack.endRule,n,r===o),f=u.findNextMatchSync(e,r,c);if(f){if(f.ruleId!==jO){i=l.stack.pop();break}f.captureIndices&&f.captureIndices.length&&(s.produce(l.stack,f.captureIndices[0].start),Ju(t,e,n,l.stack,s,l.rule.whileCaptures,f.captureIndices),s.produce(l.stack,f.captureIndices[0].end),o=f.captureIndices[0].end,f.captureIndices[0].end>r&&(r=f.captureIndices[0].end,n=!1))}else{i=l.stack.pop();break}}return{stack:i,linePos:r,anchorPosition:o,isFirstLine:n}}function RG(t,e,n,r,i,s){const o=NG(t,e,n,r,i,s),a=t.getInjections();if(a.length===0)return o;const l=MG(a,t,e,n,r,i,s);if(!l)return o;if(!o)return l;const u=o.captureIndices[0].start,c=l.captureIndices[0].start;return c=a)&&(a=x,l=y.captureIndices,u=y.ruleId,c=p.priority,a===i))break}return l?{priorityMatch:c===-1,captureIndices:l,matchedRuleId:u}:null}function qO(t,e,n,r,i){return{ruleScanner:t.compileAG(e,n,r,i),findOptions:0}}function FG(t,e,n,r,i){return{ruleScanner:t.compileWhileAG(e,n,r,i),findOptions:0}}function Ju(t,e,n,r,i,s,o){if(s.length===0)return;const a=e.content,l=Math.min(s.length,o.length),u=[],c=o[0].end;for(let f=0;fc)break;for(;u.length>0&&u[u.length-1].endPos<=h.start;)i.produceFromScopes(u[u.length-1].scopes,u[u.length-1].endPos),u.pop();if(u.length>0?i.produceFromScopes(u[u.length-1].scopes,h.start):i.produce(r,h.start),d.retokenizeCapturedWithRuleId){const m=d.getName(a,o),g=r.contentNameScopesList.pushAttributed(m,t),b=d.getContentName(a,o),y=g.pushAttributed(b,t),x=r.push(d.retokenizeCapturedWithRuleId,h.start,-1,!1,null,g,y),S=t.createOnigString(a.substring(0,h.end));HO(t,S,n&&h.start===0,h.start,x,i,!1,0),$O(S);continue}const p=d.getName(a,o);if(p!==null){const g=(u.length>0?u[u.length-1].scopes:r.contentNameScopesList).pushAttributed(p,t);u.push(new LG(g,h.end))}}for(;u.length>0;)i.produceFromScopes(u[u.length-1].scopes,u[u.length-1].endPos),u.pop()}var LG=class{constructor(t,e){X(this,"scopes");X(this,"endPos");this.scopes=t,this.endPos=e}};function BG(t,e,n,r,i,s,o,a){return new zG(t,e,n,r,i,s,o,a)}function Dw(t,e,n,r,i){const s=Wp(e,Yp),o=VO.getCompiledRuleId(n,r,i.repository);for(const a of s)t.push({debugSelector:e,matcher:a.matcher,ruleId:o,grammar:i,priority:a.priority})}function Yp(t,e){if(e.length{for(let i=n;in&&t.substr(0,n)===e&&t[n]==="."}var zG=class{constructor(t,e,n,r,i,s,o,a){X(this,"_rootId");X(this,"_lastRuleId");X(this,"_ruleId2desc");X(this,"_includedGrammars");X(this,"_grammarRepository");X(this,"_grammar");X(this,"_injections");X(this,"_basicScopeAttributesProvider");X(this,"_tokenTypeMatchers");if(this._rootScopeName=t,this.balancedBracketSelectors=s,this._onigLib=a,this._basicScopeAttributesProvider=new TG(n,r),this._rootId=-1,this._lastRuleId=0,this._ruleId2desc=[null],this._includedGrammars={},this._grammarRepository=o,this._grammar=kw(e,null),this._injections=null,this._tokenTypeMatchers=[],i)for(const l of Object.keys(i)){const u=Wp(l,Yp);for(const c of u)this._tokenTypeMatchers.push({matcher:c.matcher,type:i[l]})}}get themeProvider(){return this._grammarRepository}dispose(){for(const t of this._ruleId2desc)t&&t.dispose()}createOnigScanner(t){return this._onigLib.createOnigScanner(t)}createOnigString(t){return this._onigLib.createOnigString(t)}getMetadataForScope(t){return this._basicScopeAttributesProvider.getBasicScopeAttributes(t)}_collectInjections(){const t={lookup:i=>i===this._rootScopeName?this._grammar:this.getExternalGrammar(i),injections:i=>this._grammarRepository.injections(i)},e=[],n=this._rootScopeName,r=t.lookup(n);if(r){const i=r.injections;if(i)for(let o in i)Dw(e,o,i[o],this,r);const s=this._grammarRepository.injections(n);s&&s.forEach(o=>{const a=this.getExternalGrammar(o);if(a){const l=a.injectionSelector;l&&Dw(e,l,a,this,a)}})}return e.sort((i,s)=>i.priority-s.priority),e}getInjections(){return this._injections===null&&(this._injections=this._collectInjections()),this._injections}registerRule(t){const e=++this._lastRuleId,n=t(e);return this._ruleId2desc[e]=n,n}getRule(t){return this._ruleId2desc[t]}getExternalGrammar(t,e){if(this._includedGrammars[t])return this._includedGrammars[t];if(this._grammarRepository){const n=this._grammarRepository.lookup(t);if(n)return this._includedGrammars[t]=kw(n,e&&e.$base),this._includedGrammars[t]}}tokenizeLine(t,e,n=0){const r=this._tokenize(t,e,!1,n);return{tokens:r.lineTokens.getResult(r.ruleStack,r.lineLength),ruleStack:r.ruleStack,stoppedEarly:r.stoppedEarly}}tokenizeLine2(t,e,n=0){const r=this._tokenize(t,e,!0,n);return{tokens:r.lineTokens.getBinaryResult(r.ruleStack,r.lineLength),ruleStack:r.ruleStack,stoppedEarly:r.stoppedEarly}}_tokenize(t,e,n,r){this._rootId===-1&&(this._rootId=VO.getCompiledRuleId(this._grammar.repository.$self,this,this._grammar.repository),this.getInjections());let i;if(!e||e===ty.NULL){i=!0;const u=this._basicScopeAttributesProvider.getDefaultAttributes(),c=this.themeProvider.getDefaults(),f=Ll.set(0,u.languageId,u.tokenType,null,c.fontStyle,c.foregroundId,c.backgroundId),d=this.getRule(this._rootId).getName(null,null);let h;d?h=mc.createRootAndLookUpScopeName(d,f,this):h=mc.createRoot("unknown",f),e=new ty(null,this._rootId,-1,-1,!1,null,h,h)}else i=!1,e.reset();t=t+` -`;const s=this.createOnigString(t),o=s.content.length,a=new VG(n,t,this._tokenTypeMatchers,this.balancedBracketSelectors),l=HO(this,s,i,0,e,a,!0,r);return $O(s),{lineLength:o,lineTokens:a,ruleStack:l.stack,stoppedEarly:l.stoppedEarly}}};function kw(t,e){return t=sG(t),t.repository=t.repository||{},t.repository.$self={$vscodeTextmateLocation:t.$vscodeTextmateLocation,patterns:t.patterns,name:t.scopeName},t.repository.$base=e||t.repository.$self,t}var mc=class _i{constructor(e,n,r){this.parent=e,this.scopePath=n,this.tokenAttributes=r}static fromExtension(e,n){let r=e,i=(e==null?void 0:e.scopePath)??null;for(const s of n)i=Jg.push(i,s.scopeNames),r=new _i(r,i,s.encodedTokenAttributes);return r}static createRoot(e,n){return new _i(null,new Jg(null,e),n)}static createRootAndLookUpScopeName(e,n,r){const i=r.getMetadataForScope(e),s=new Jg(null,e),o=r.themeProvider.themeMatch(s),a=_i.mergeAttributes(n,i,o);return new _i(null,s,a)}get scopeName(){return this.scopePath.scopeName}toString(){return this.getScopeNames().join(" ")}equals(e){return _i.equals(this,e)}static equals(e,n){do{if(e===n||!e&&!n)return!0;if(!e||!n||e.scopeName!==n.scopeName||e.tokenAttributes!==n.tokenAttributes)return!1;e=e.parent,n=n.parent}while(!0)}static mergeAttributes(e,n,r){let i=-1,s=0,o=0;return r!==null&&(i=r.fontStyle,s=r.foregroundId,o=r.backgroundId),Ll.set(e,n.languageId,n.tokenType,null,i,s,o)}pushAttributed(e,n){if(e===null)return this;if(e.indexOf(" ")===-1)return _i._pushAttributed(this,e,n);const r=e.split(/ /g);let i=this;for(const s of r)i=_i._pushAttributed(i,s,n);return i}static _pushAttributed(e,n,r){const i=r.getMetadataForScope(n),s=e.scopePath.push(n),o=r.themeProvider.themeMatch(s),a=_i.mergeAttributes(e.tokenAttributes,i,o);return new _i(e,s,a)}getScopeNames(){return this.scopePath.getSegments()}getExtensionIfDefined(e){var i;const n=[];let r=this;for(;r&&r!==e;)n.push({encodedTokenAttributes:r.tokenAttributes,scopeNames:r.scopePath.getExtensionIfDefined(((i=r.parent)==null?void 0:i.scopePath)??null)}),r=r.parent;return r===e?n.reverse():void 0}},Lr,ty=(Lr=class{constructor(e,n,r,i,s,o,a,l){X(this,"_stackElementBrand");X(this,"_enterPos");X(this,"_anchorPos");X(this,"depth");this.parent=e,this.ruleId=n,this.beginRuleCapturedEOL=s,this.endRule=o,this.nameScopesList=a,this.contentNameScopesList=l,this.depth=this.parent?this.parent.depth+1:1,this._enterPos=r,this._anchorPos=i}equals(e){return e===null?!1:Lr._equals(this,e)}static _equals(e,n){return e===n?!0:this._structuralEquals(e,n)?mc.equals(e.contentNameScopesList,n.contentNameScopesList):!1}static _structuralEquals(e,n){do{if(e===n||!e&&!n)return!0;if(!e||!n||e.depth!==n.depth||e.ruleId!==n.ruleId||e.endRule!==n.endRule)return!1;e=e.parent,n=n.parent}while(!0)}clone(){return this}static _reset(e){for(;e;)e._enterPos=-1,e._anchorPos=-1,e=e.parent}reset(){Lr._reset(this)}pop(){return this.parent}safePop(){return this.parent?this.parent:this}push(e,n,r,i,s,o,a){return new Lr(this,e,n,r,i,s,o,a)}getEnterPos(){return this._enterPos}getAnchorPos(){return this._anchorPos}getRule(e){return e.getRule(this.ruleId)}toString(){const e=[];return this._writeString(e,0),"["+e.join(",")+"]"}_writeString(e,n){var r,i;return this.parent&&(n=this.parent._writeString(e,n)),e[n++]=`(${this.ruleId}, ${(r=this.nameScopesList)==null?void 0:r.toString()}, ${(i=this.contentNameScopesList)==null?void 0:i.toString()})`,n}withContentNameScopesList(e){return this.contentNameScopesList===e?this:this.parent.push(this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,this.endRule,this.nameScopesList,e)}withEndRule(e){return this.endRule===e?this:new Lr(this.parent,this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,e,this.nameScopesList,this.contentNameScopesList)}hasSameRuleAs(e){let n=this;for(;n&&n._enterPos===e._enterPos;){if(n.ruleId===e.ruleId)return!0;n=n.parent}return!1}toStateStackFrame(){var e,n,r;return{ruleId:this.ruleId,beginRuleCapturedEOL:this.beginRuleCapturedEOL,endRule:this.endRule,nameScopesList:((n=this.nameScopesList)==null?void 0:n.getExtensionIfDefined(((e=this.parent)==null?void 0:e.nameScopesList)??null))??[],contentNameScopesList:((r=this.contentNameScopesList)==null?void 0:r.getExtensionIfDefined(this.nameScopesList))??[]}}static pushFrame(e,n){const r=mc.fromExtension((e==null?void 0:e.nameScopesList)??null,n.nameScopesList);return new Lr(e,n.ruleId,n.enterPos??-1,n.anchorPos??-1,n.beginRuleCapturedEOL,n.endRule,r,mc.fromExtension(r,n.contentNameScopesList))}},X(Lr,"NULL",new Lr(null,0,0,0,!1,null,null,null)),Lr),jG=class{constructor(t,e){X(this,"balancedBracketScopes");X(this,"unbalancedBracketScopes");X(this,"allowAny",!1);this.balancedBracketScopes=t.flatMap(n=>n==="*"?(this.allowAny=!0,[]):Wp(n,Yp).map(r=>r.matcher)),this.unbalancedBracketScopes=e.flatMap(n=>Wp(n,Yp).map(r=>r.matcher))}get matchesAlways(){return this.allowAny&&this.unbalancedBracketScopes.length===0}get matchesNever(){return this.balancedBracketScopes.length===0&&!this.allowAny}match(t){for(const e of this.unbalancedBracketScopes)if(e(t))return!1;for(const e of this.balancedBracketScopes)if(e(t))return!0;return this.allowAny}},VG=class{constructor(t,e,n,r){X(this,"_emitBinaryTokens");X(this,"_lineText");X(this,"_tokens");X(this,"_binaryTokens");X(this,"_lastTokenEndIndex");X(this,"_tokenTypeOverrides");this.balancedBracketSelectors=r,this._emitBinaryTokens=t,this._tokenTypeOverrides=n,this._lineText=null,this._tokens=[],this._binaryTokens=[],this._lastTokenEndIndex=0}produce(t,e){this.produceFromScopes(t.contentNameScopesList,e)}produceFromScopes(t,e){var r;if(this._lastTokenEndIndex>=e)return;if(this._emitBinaryTokens){let i=(t==null?void 0:t.tokenAttributes)??0,s=!1;if((r=this.balancedBracketSelectors)!=null&&r.matchesAlways&&(s=!0),this._tokenTypeOverrides.length>0||this.balancedBracketSelectors&&!this.balancedBracketSelectors.matchesAlways&&!this.balancedBracketSelectors.matchesNever){const o=(t==null?void 0:t.getScopeNames())??[];for(const a of this._tokenTypeOverrides)a.matcher(o)&&(i=Ll.set(i,0,a.type,null,-1,0,0));this.balancedBracketSelectors&&(s=this.balancedBracketSelectors.match(o))}if(s&&(i=Ll.set(i,0,8,s,-1,0,0)),this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-1]===i){this._lastTokenEndIndex=e;return}this._binaryTokens.push(this._lastTokenEndIndex),this._binaryTokens.push(i),this._lastTokenEndIndex=e;return}const n=(t==null?void 0:t.getScopeNames())??[];this._tokens.push({startIndex:this._lastTokenEndIndex,endIndex:e,scopes:n}),this._lastTokenEndIndex=e}getResult(t,e){return this._tokens.length>0&&this._tokens[this._tokens.length-1].startIndex===e-1&&this._tokens.pop(),this._tokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(t,e),this._tokens[this._tokens.length-1].startIndex=0),this._tokens}getBinaryResult(t,e){this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-2]===e-1&&(this._binaryTokens.pop(),this._binaryTokens.pop()),this._binaryTokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(t,e),this._binaryTokens[this._binaryTokens.length-2]=0);const n=new Uint32Array(this._binaryTokens.length);for(let r=0,i=this._binaryTokens.length;r0;)o.Q.map(a=>this._loadSingleGrammar(a.scopeName)),o.processQueue();return this._grammarForScopeName(e,n,r,i,s)}_loadSingleGrammar(e){this._ensureGrammarCache.has(e)||(this._doLoadSingleGrammar(e),this._ensureGrammarCache.set(e,!0))}_doLoadSingleGrammar(e){const n=this._options.loadGrammar(e);if(n){const r=typeof this._options.getInjections=="function"?this._options.getInjections(e):void 0;this._syncRegistry.addGrammar(n,r)}}addGrammar(e,n=[],r=0,i=null){return this._syncRegistry.addGrammar(e,n),this._grammarForScopeName(e.scopeName,r,i)}_grammarForScopeName(e,n=0,r=null,i=null,s=null){return this._syncRegistry.grammarForScopeName(e,n,r,i,s)}},ny=ty.NULL;const qG=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"];let Kf=class{constructor(e,n,r){this.normal=n,this.property=e,r&&(this.space=r)}};Kf.prototype.normal={};Kf.prototype.property={};Kf.prototype.space=void 0;function GO(t,e){const n={},r={};for(const i of t)Object.assign(n,i.property),Object.assign(r,i.normal);return new Kf(n,r,e)}function ry(t){return t.toLowerCase()}class hr{constructor(e,n){this.attribute=n,this.property=e}}hr.prototype.attribute="";hr.prototype.booleanish=!1;hr.prototype.boolean=!1;hr.prototype.commaOrSpaceSeparated=!1;hr.prototype.commaSeparated=!1;hr.prototype.defined=!1;hr.prototype.mustUseProperty=!1;hr.prototype.number=!1;hr.prototype.overloadedBoolean=!1;hr.prototype.property="";hr.prototype.spaceSeparated=!1;hr.prototype.space=void 0;let GG=0;const Be=Ia(),Yt=Ia(),iy=Ia(),re=Ia(),pt=Ia(),gl=Ia(),gr=Ia();function Ia(){return 2**++GG}const sy=Object.freeze(Object.defineProperty({__proto__:null,boolean:Be,booleanish:Yt,commaOrSpaceSeparated:gr,commaSeparated:gl,number:re,overloadedBoolean:iy,spaceSeparated:pt},Symbol.toStringTag,{value:"Module"})),Qg=Object.keys(sy);class o2 extends hr{constructor(e,n,r,i){let s=-1;if(super(e,n),Ow(this,"space",i),typeof r=="number")for(;++s4&&n.slice(0,4)==="data"&&YG.test(e)){if(e.charAt(4)==="-"){const s=e.slice(5).replace(Tw,QG);r="data"+s.charAt(0).toUpperCase()+s.slice(1)}else{const s=e.slice(4);if(!Tw.test(s)){let o=s.replace(XG,ZG);o.charAt(0)!=="-"&&(o="-"+o),e="data"+o}}i=o2}return new i(r,e)}function ZG(t){return"-"+t.toLowerCase()}function QG(t){return t.charAt(1).toUpperCase()}const eW=GO([WO,WG,YO,JO,ZO],"html"),QO=GO([WO,KG,YO,JO,ZO],"svg"),Iw={}.hasOwnProperty;function tW(t,e){const n=e||{};function r(i,...s){let o=r.invalid;const a=r.handlers;if(i&&Iw.call(i,t)){const l=String(i[t]);o=Iw.call(a,l)?a[l]:r.unknown}if(o)return o.call(this,i,...s)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}const nW=/["&'<>`]/g,rW=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,iW=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,sW=/[|\\{}()[\]^$+*?.]/g,Pw=new WeakMap;function oW(t,e){if(t=t.replace(e.subset?aW(e.subset):nW,r),e.subset||e.escapeOnly)return t;return t.replace(rW,n).replace(iW,r);function n(i,s,o){return e.format((i.charCodeAt(0)-55296)*1024+i.charCodeAt(1)-56320+65536,o.charCodeAt(s+2),e)}function r(i,s,o){return e.format(i.charCodeAt(0),o.charCodeAt(s+1),e)}}function aW(t){let e=Pw.get(t);return e||(e=lW(t),Pw.set(t,e)),e}function lW(t){const e=[];let n=-1;for(;++n",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",circ:"ˆ",tilde:"˜",ensp:" ",emsp:" ",thinsp:" ",zwnj:"‌",zwj:"‍",lrm:"‎",rlm:"‏",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",permil:"‰",lsaquo:"‹",rsaquo:"›",euro:"€"},pW=["cent","copy","divide","gt","lt","not","para","times"],e6={}.hasOwnProperty,oy={};let Xd;for(Xd in e1)e6.call(e1,Xd)&&(oy[e1[Xd]]=Xd);const mW=/[^\dA-Za-z]/;function gW(t,e,n,r){const i=String.fromCharCode(t);if(e6.call(oy,i)){const s=oy[i],o="&"+s;return n&&hW.includes(s)&&!pW.includes(s)&&(!r||e&&e!==61&&mW.test(String.fromCharCode(e)))?o:o+";"}return""}function bW(t,e,n){let r=cW(t,e,n.omitOptionalSemicolons),i;if((n.useNamedReferences||n.useShortestReferences)&&(i=gW(t,e,n.omitOptionalSemicolons,n.attribute)),(n.useShortestReferences||!i)&&n.useShortestReferences){const s=dW(t,e,n.omitOptionalSemicolons);s.length|^->||--!>|"],xW=["<",">"];function SW(t,e,n,r){return r.settings.bogusComments?"":"";function i(s){return bl(s,Object.assign({},r.settings.characterReferences,{subset:xW}))}}function EW(t,e,n,r){return""}function Rw(t,e){const n=String(t);if(typeof e!="string")throw new TypeError("Expected character");let r=0,i=n.indexOf(e);for(;i!==-1;)r++,i=n.indexOf(e,i+e.length);return r}function wW(t,e){const n=e||{};return(t[t.length-1]===""?[...t,""]:t).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}function _W(t){return t.join(" ").trim()}const CW=/[ \t\n\f\r]/g;function a2(t){return typeof t=="object"?t.type==="text"?Nw(t.value):!1:Nw(t)}function Nw(t){return t.replace(CW,"")===""}const an=n6(1),t6=n6(-1),AW=[];function n6(t){return e;function e(n,r,i){const s=n?n.children:AW;let o=(r||0)+t,a=s[o];if(!i)for(;a&&a2(a);)o+=t,a=s[o];return a}}const DW={}.hasOwnProperty;function r6(t){return e;function e(n,r,i){return DW.call(t,n.tagName)&&t[n.tagName](n,r,i)}}const l2=r6({body:OW,caption:t1,colgroup:t1,dd:RW,dt:PW,head:t1,html:kW,li:IW,optgroup:NW,option:MW,p:TW,rp:Mw,rt:Mw,tbody:LW,td:Fw,tfoot:BW,th:Fw,thead:FW,tr:$W});function t1(t,e,n){const r=an(n,e,!0);return!r||r.type!=="comment"&&!(r.type==="text"&&a2(r.value.charAt(0)))}function kW(t,e,n){const r=an(n,e);return!r||r.type!=="comment"}function OW(t,e,n){const r=an(n,e);return!r||r.type!=="comment"}function TW(t,e,n){const r=an(n,e);return r?r.type==="element"&&(r.tagName==="address"||r.tagName==="article"||r.tagName==="aside"||r.tagName==="blockquote"||r.tagName==="details"||r.tagName==="div"||r.tagName==="dl"||r.tagName==="fieldset"||r.tagName==="figcaption"||r.tagName==="figure"||r.tagName==="footer"||r.tagName==="form"||r.tagName==="h1"||r.tagName==="h2"||r.tagName==="h3"||r.tagName==="h4"||r.tagName==="h5"||r.tagName==="h6"||r.tagName==="header"||r.tagName==="hgroup"||r.tagName==="hr"||r.tagName==="main"||r.tagName==="menu"||r.tagName==="nav"||r.tagName==="ol"||r.tagName==="p"||r.tagName==="pre"||r.tagName==="section"||r.tagName==="table"||r.tagName==="ul"):!n||!(n.type==="element"&&(n.tagName==="a"||n.tagName==="audio"||n.tagName==="del"||n.tagName==="ins"||n.tagName==="map"||n.tagName==="noscript"||n.tagName==="video"))}function IW(t,e,n){const r=an(n,e);return!r||r.type==="element"&&r.tagName==="li"}function PW(t,e,n){const r=an(n,e);return!!(r&&r.type==="element"&&(r.tagName==="dt"||r.tagName==="dd"))}function RW(t,e,n){const r=an(n,e);return!r||r.type==="element"&&(r.tagName==="dt"||r.tagName==="dd")}function Mw(t,e,n){const r=an(n,e);return!r||r.type==="element"&&(r.tagName==="rp"||r.tagName==="rt")}function NW(t,e,n){const r=an(n,e);return!r||r.type==="element"&&r.tagName==="optgroup"}function MW(t,e,n){const r=an(n,e);return!r||r.type==="element"&&(r.tagName==="option"||r.tagName==="optgroup")}function FW(t,e,n){const r=an(n,e);return!!(r&&r.type==="element"&&(r.tagName==="tbody"||r.tagName==="tfoot"))}function LW(t,e,n){const r=an(n,e);return!r||r.type==="element"&&(r.tagName==="tbody"||r.tagName==="tfoot")}function BW(t,e,n){return!an(n,e)}function $W(t,e,n){const r=an(n,e);return!r||r.type==="element"&&r.tagName==="tr"}function Fw(t,e,n){const r=an(n,e);return!r||r.type==="element"&&(r.tagName==="td"||r.tagName==="th")}const zW=r6({body:UW,colgroup:HW,head:VW,html:jW,tbody:qW});function jW(t){const e=an(t,-1);return!e||e.type!=="comment"}function VW(t){const e=new Set;for(const r of t.children)if(r.type==="element"&&(r.tagName==="base"||r.tagName==="title")){if(e.has(r.tagName))return!1;e.add(r.tagName)}const n=t.children[0];return!n||n.type==="element"}function UW(t){const e=an(t,-1,!0);return!e||e.type!=="comment"&&!(e.type==="text"&&a2(e.value.charAt(0)))&&!(e.type==="element"&&(e.tagName==="meta"||e.tagName==="link"||e.tagName==="script"||e.tagName==="style"||e.tagName==="template"))}function HW(t,e,n){const r=t6(n,e),i=an(t,-1,!0);return n&&r&&r.type==="element"&&r.tagName==="colgroup"&&l2(r,n.children.indexOf(r),n)?!1:!!(i&&i.type==="element"&&i.tagName==="col")}function qW(t,e,n){const r=t6(n,e),i=an(t,-1);return n&&r&&r.type==="element"&&(r.tagName==="thead"||r.tagName==="tbody")&&l2(r,n.children.indexOf(r),n)?!1:!!(i&&i.type==="element"&&i.tagName==="tr")}const Yd={name:[[` +`;break}return r};ou.prototype.render=function(t,e,n){let r="";const i=this.rules;for(let s=0,o=t.length;s=0&&(r=this.attrs[n][1]),r};di.prototype.attrJoin=function(e,n){const r=this.attrIndex(e);r<0?this.attrPush([e,n]):this.attrs[r][1]=this.attrs[r][1]+" "+n};function mO(t,e,n){this.src=t,this.env=n,this.tokens=[],this.inlineMode=!1,this.md=e}mO.prototype.Token=di;const GU=/\r\n?|\n/g,WU=/\0/g;function KU(t){let e;e=t.src.replace(GU,` +`),e=e.replace(WU,"�"),t.src=e}function XU(t){let e;t.inlineMode?(e=new t.Token("inline","",0),e.content=t.src,e.map=[0,1],e.children=[],t.tokens.push(e)):t.md.block.parse(t.src,t.md,t.env,t.tokens)}function YU(t){const e=t.tokens;for(let n=0,r=e.length;n\s]/i.test(t)}function ZU(t){return/^<\/a\s*>/i.test(t)}function QU(t){const e=t.tokens;if(t.md.options.linkify)for(let n=0,r=e.length;n=0;o--){const a=i[o];if(a.type==="link_close"){for(o--;i[o].level!==a.level&&i[o].type!=="link_open";)o--;continue}if(a.type==="html_inline"&&(JU(a.content)&&s>0&&s--,ZU(a.content)&&s++),!(s>0)&&a.type==="text"&&t.md.linkify.test(a.content)){const l=a.content;let u=t.md.linkify.match(l);const c=[];let f=a.level,d=0;u.length>0&&u[0].index===0&&o>0&&i[o-1].type==="text_special"&&(u=u.slice(1));for(let h=0;hd){const E=new t.Token("text","",0);E.content=l.slice(d,b),E.level=f,c.push(E)}const y=new t.Token("link_open","a",1);y.attrs=[["href",m]],y.level=f++,y.markup="linkify",y.info="auto",c.push(y);const x=new t.Token("text","",0);x.content=g,x.level=f,c.push(x);const S=new t.Token("link_close","a",-1);S.level=--f,S.markup="linkify",S.info="auto",c.push(S),d=u[h].lastIndex}if(d=0;n--){const r=t[n];r.type==="text"&&!e&&(r.content=r.content.replace(tH,rH)),r.type==="link_open"&&r.info==="auto"&&e--,r.type==="link_close"&&r.info==="auto"&&e++}}function sH(t){let e=0;for(let n=t.length-1;n>=0;n--){const r=t[n];r.type==="text"&&!e&&gO.test(r.content)&&(r.content=r.content.replace(/\+-/g,"±").replace(/\.{2,}/g,"…").replace(/([?!])…/g,"$1..").replace(/([?!]){4,}/g,"$1$1$1").replace(/,{2,}/g,",").replace(/(^|[^-])---(?=[^-]|$)/mg,"$1—").replace(/(^|\s)--(?=\s|$)/mg,"$1–").replace(/(^|[^-\s])--(?=[^-\s]|$)/mg,"$1–")),r.type==="link_open"&&r.info==="auto"&&e--,r.type==="link_close"&&r.info==="auto"&&e++}}function oH(t){let e;if(t.md.options.typographer)for(e=t.tokens.length-1;e>=0;e--)t.tokens[e].type==="inline"&&(eH.test(t.tokens[e].content)&&iH(t.tokens[e].children),gO.test(t.tokens[e].content)&&sH(t.tokens[e].children))}const aH=/['"]/,fw=/['"]/g,dw="’";function Gd(t,e,n){return t.slice(0,e)+n+t.slice(e+1)}function lH(t,e){let n;const r=[];for(let i=0;i=0&&!(r[n].level<=o);n--);if(r.length=n+1,s.type!=="text")continue;let a=s.content,l=0,u=a.length;e:for(;l=0)p=a.charCodeAt(c.index-1);else for(n=i-1;n>=0&&!(t[n].type==="softbreak"||t[n].type==="hardbreak");n--)if(t[n].content){p=t[n].content.charCodeAt(t[n].content.length-1);break}let m=32;if(l=48&&p<=57&&(d=f=!1),f&&d&&(f=g,d=b),!f&&!d){h&&(s.content=Gd(s.content,c.index,dw));continue}if(d)for(n=r.length-1;n>=0;n--){let S=r[n];if(r[n].level=0;e--)t.tokens[e].type!=="inline"||!aH.test(t.tokens[e].content)||lH(t.tokens[e].children,t)}function cH(t){let e,n;const r=t.tokens,i=r.length;for(let s=0;s0&&this.level++,this.tokens.push(r),r};Zi.prototype.isEmpty=function(e){return this.bMarks[e]+this.tShift[e]>=this.eMarks[e]};Zi.prototype.skipEmptyLines=function(e){for(let n=this.lineMax;en;)if(!mt(this.src.charCodeAt(--e)))return e+1;return e};Zi.prototype.skipChars=function(e,n){for(let r=this.src.length;er;)if(n!==this.src.charCodeAt(--e))return e+1;return e};Zi.prototype.getLines=function(e,n,r,i){if(e>=n)return"";const s=new Array(n-e);for(let o=0,a=e;ar?s[o]=new Array(l-r+1).join(" ")+this.src.slice(c,f):s[o]=this.src.slice(c,f)}return s.join("")};Zi.prototype.Token=di;const fH=65536;function qg(t,e){const n=t.bMarks[e]+t.tShift[e],r=t.eMarks[e];return t.src.slice(n,r)}function hw(t){const e=[],n=t.length;let r=0,i=t.charCodeAt(r),s=!1,o=0,a="";for(;rn)return!1;let i=e+1;if(t.sCount[i]=4)return!1;let s=t.bMarks[i]+t.tShift[i];if(s>=t.eMarks[i])return!1;const o=t.src.charCodeAt(s++);if(o!==124&&o!==45&&o!==58||s>=t.eMarks[i])return!1;const a=t.src.charCodeAt(s++);if(a!==124&&a!==45&&a!==58&&!mt(a)||o===45&&mt(a))return!1;for(;s=4)return!1;u=hw(l),u.length&&u[0]===""&&u.shift(),u.length&&u[u.length-1]===""&&u.pop();const f=u.length;if(f===0||f!==c.length)return!1;if(r)return!0;const d=t.parentType;t.parentType="table";const h=t.md.block.ruler.getRules("blockquote"),p=t.push("table_open","table",1),m=[e,0];p.map=m;const g=t.push("thead_open","thead",1);g.map=[e,e+1];const b=t.push("tr_open","tr",1);b.map=[e,e+1];for(let S=0;S=4||(u=hw(l),u.length&&u[0]===""&&u.shift(),u.length&&u[u.length-1]===""&&u.pop(),x+=f-u.length,x>fH))break;if(i===e+2){const C=t.push("tbody_open","tbody",1);C.map=y=[e+2,0]}const E=t.push("tr_open","tr",1);E.map=[i,i+1];for(let C=0;C=4){r++,i=r;continue}break}t.line=i;const s=t.push("code_block","code",0);return s.content=t.getLines(e,i,4+t.blkIndent,!1)+` +`,s.map=[e,t.line],!0}function pH(t,e,n,r){let i=t.bMarks[e]+t.tShift[e],s=t.eMarks[e];if(t.sCount[e]-t.blkIndent>=4||i+3>s)return!1;const o=t.src.charCodeAt(i);if(o!==126&&o!==96)return!1;let a=i;i=t.skipChars(i,o);let l=i-a;if(l<3)return!1;const u=t.src.slice(a,i),c=t.src.slice(i,s);if(o===96&&c.indexOf(String.fromCharCode(o))>=0)return!1;if(r)return!0;let f=e,d=!1;for(;f++,!(f>=n||(i=a=t.bMarks[f]+t.tShift[f],s=t.eMarks[f],i=4)&&(i=t.skipChars(i,o),!(i-a=4||t.src.charCodeAt(i)!==62)return!1;if(r)return!0;const a=[],l=[],u=[],c=[],f=t.md.block.ruler.getRules("blockquote"),d=t.parentType;t.parentType="blockquote";let h=!1,p;for(p=e;p=s)break;if(t.src.charCodeAt(i++)===62&&!x){let E=t.sCount[p]+1,C,w;t.src.charCodeAt(i)===32?(i++,E++,w=!1,C=!0):t.src.charCodeAt(i)===9?(C=!0,(t.bsCount[p]+E)%4===3?(i++,E++,w=!1):w=!0):C=!1;let A=E;for(a.push(t.bMarks[p]),t.bMarks[p]=i;i=s,l.push(t.bsCount[p]),t.bsCount[p]=t.sCount[p]+1+(C?1:0),u.push(t.sCount[p]),t.sCount[p]=A-E,c.push(t.tShift[p]),t.tShift[p]=i-t.bMarks[p];continue}if(h)break;let S=!1;for(let E=0,C=f.length;E";const b=[e,0];g.map=b,t.md.block.tokenize(t,e,p);const y=t.push("blockquote_close","blockquote",-1);y.markup=">",t.lineMax=o,t.parentType=d,b[1]=t.line;for(let x=0;x=4)return!1;let s=t.bMarks[e]+t.tShift[e];const o=t.src.charCodeAt(s++);if(o!==42&&o!==45&&o!==95)return!1;let a=1;for(;s=r)return-1;let s=t.src.charCodeAt(i++);if(s<48||s>57)return-1;for(;;){if(i>=r)return-1;if(s=t.src.charCodeAt(i++),s>=48&&s<=57){if(i-n>=10)return-1;continue}if(s===41||s===46)break;return-1}return i=4||t.listIndent>=0&&t.sCount[l]-t.listIndent>=4&&t.sCount[l]=t.blkIndent&&(c=!0);let f,d,h;if((h=mw(t,l))>=0){if(f=!0,o=t.bMarks[l]+t.tShift[l],d=Number(t.src.slice(o,h-1)),c&&d!==1)return!1}else if((h=pw(t,l))>=0)f=!1;else return!1;if(c&&t.skipSpaces(h)>=t.eMarks[l])return!1;if(r)return!0;const p=t.src.charCodeAt(h-1),m=t.tokens.length;f?(a=t.push("ordered_list_open","ol",1),d!==1&&(a.attrs=[["start",d]])):a=t.push("bullet_list_open","ul",1);const g=[l,0];a.map=g,a.markup=String.fromCharCode(p);let b=!1;const y=t.md.block.ruler.getRules("list"),x=t.parentType;for(t.parentType="list";l=i?w=1:w=E-S,w>4&&(w=1);const A=S+w;a=t.push("list_item_open","li",1),a.markup=String.fromCharCode(p);const _=[l,0];a.map=_,f&&(a.info=t.src.slice(o,h-1));const O=t.tight,I=t.tShift[l],N=t.sCount[l],P=t.listIndent;if(t.listIndent=t.blkIndent,t.blkIndent=A,t.tight=!0,t.tShift[l]=C-t.bMarks[l],t.sCount[l]=E,C>=i&&t.isEmpty(l+1)?t.line=Math.min(t.line+2,n):t.md.block.tokenize(t,l,n,!0),(!t.tight||b)&&(u=!1),b=t.line-l>1&&t.isEmpty(t.line-1),t.blkIndent=t.listIndent,t.listIndent=P,t.tShift[l]=I,t.sCount[l]=N,t.tight=O,a=t.push("list_item_close","li",-1),a.markup=String.fromCharCode(p),l=t.line,_[1]=l,l>=n||t.sCount[l]=4)break;let R=!1;for(let F=0,V=y.length;F=4||t.src.charCodeAt(i)!==91)return!1;function a(y){const x=t.lineMax;if(y>=x||t.isEmpty(y))return null;let S=!1;if(t.sCount[y]-t.blkIndent>3&&(S=!0),t.sCount[y]<0&&(S=!0),!S){const w=t.md.block.ruler.getRules("reference"),A=t.parentType;t.parentType="reference";let _=!1;for(let O=0,I=w.length;O"u"&&(t.env.references={}),typeof t.env.references[b]>"u"&&(t.env.references[b]={title:g,href:f}),t.line=o),!0):!1}const xH=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],SH="[a-zA-Z_:][a-zA-Z0-9:._-]*",EH="[^\"'=<>`\\x00-\\x20]+",wH="'[^']*'",_H='"[^"]*"',CH="(?:"+EH+"|"+wH+"|"+_H+")",AH="(?:\\s+"+SH+"(?:\\s*=\\s*"+CH+")?)",bO="<[A-Za-z][A-Za-z0-9\\-]*"+AH+"*\\s*\\/?>",yO="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>",DH="",kH="<[?][\\s\\S]*?[?]>",OH="]*>",TH="",IH=new RegExp("^(?:"+bO+"|"+yO+"|"+DH+"|"+kH+"|"+OH+"|"+TH+")"),PH=new RegExp("^(?:"+bO+"|"+yO+")"),Ba=[[/^<(script|pre|style|textarea)(?=(\s|>|$))/i,/<\/(script|pre|style|textarea)>/i,!0],[/^/,!0],[/^<\?/,/\?>/,!0],[/^/,!0],[/^/,!0],[new RegExp("^|$))","i"),/^$/,!0],[new RegExp(PH.source+"\\s*$"),/^$/,!1]];function RH(t,e,n,r){let i=t.bMarks[e]+t.tShift[e],s=t.eMarks[e];if(t.sCount[e]-t.blkIndent>=4||!t.md.options.html||t.src.charCodeAt(i)!==60)return!1;let o=t.src.slice(i,s),a=0;for(;a=4)return!1;let o=t.src.charCodeAt(i);if(o!==35||i>=s)return!1;let a=1;for(o=t.src.charCodeAt(++i);o===35&&i6||ii&&mt(t.src.charCodeAt(l-1))&&(s=l),t.line=e+1;const u=t.push("heading_open","h"+String(a),1);u.markup="########".slice(0,a),u.map=[e,t.line];const c=t.push("inline","",0);c.content=t.src.slice(i,s).trim(),c.map=[e,t.line],c.children=[];const f=t.push("heading_close","h"+String(a),-1);return f.markup="########".slice(0,a),!0}function MH(t,e,n){const r=t.md.block.ruler.getRules("paragraph");if(t.sCount[e]-t.blkIndent>=4)return!1;const i=t.parentType;t.parentType="paragraph";let s=0,o,a=e+1;for(;a3)continue;if(t.sCount[a]>=t.blkIndent){let h=t.bMarks[a]+t.tShift[a];const p=t.eMarks[a];if(h=p))){s=o===61?1:2;break}}if(t.sCount[a]<0)continue;let d=!1;for(let h=0,p=r.length;h3||t.sCount[s]<0)continue;let u=!1;for(let c=0,f=r.length;c=n||t.sCount[o]=s){t.line=n;break}const l=t.line;let u=!1;for(let c=0;c=t.line)throw new Error("block rule didn't increment state.line");break}if(!u)throw new Error("none of the block rules matched");t.tight=!a,t.isEmpty(t.line-1)&&(a=!0),o=t.line,o0&&(this.level++,this._prev_delimiters.push(this.delimiters),this.delimiters=[],i={delimiters:this.delimiters}),this.pendingLevel=this.level,this.tokens.push(r),this.tokens_meta.push(i),r};qf.prototype.scanDelims=function(t,e){const n=this.posMax,r=this.src.charCodeAt(t),i=t>0?this.src.charCodeAt(t-1):32;let s=t;for(;s0)return!1;const n=t.pos,r=t.posMax;if(n+3>r||t.src.charCodeAt(n)!==58||t.src.charCodeAt(n+1)!==47||t.src.charCodeAt(n+2)!==47)return!1;const i=t.pending.match($H);if(!i)return!1;const s=i[1],o=t.md.linkify.matchAtStart(t.src.slice(n-s.length));if(!o)return!1;let a=o.url;if(a.length<=s.length)return!1;a=a.replace(/\*+$/,"");const l=t.md.normalizeLink(a);if(!t.md.validateLink(l))return!1;if(!e){t.pending=t.pending.slice(0,-s.length);const u=t.push("link_open","a",1);u.attrs=[["href",l]],u.markup="linkify",u.info="auto";const c=t.push("text","",0);c.content=t.md.normalizeLinkText(a);const f=t.push("link_close","a",-1);f.markup="linkify",f.info="auto"}return t.pos+=a.length-s.length,!0}function jH(t,e){let n=t.pos;if(t.src.charCodeAt(n)!==10)return!1;const r=t.pending.length-1,i=t.posMax;if(!e)if(r>=0&&t.pending.charCodeAt(r)===32)if(r>=1&&t.pending.charCodeAt(r-1)===32){let s=r-1;for(;s>=1&&t.pending.charCodeAt(s-1)===32;)s--;t.pending=t.pending.slice(0,s),t.push("hardbreak","br",0)}else t.pending=t.pending.slice(0,-1),t.push("softbreak","br",0);else t.push("softbreak","br",0);for(n++;n?@[]^_`{|}~-".split("").forEach(function(t){r2[t.charCodeAt(0)]=1});function VH(t,e){let n=t.pos;const r=t.posMax;if(t.src.charCodeAt(n)!==92||(n++,n>=r))return!1;let i=t.src.charCodeAt(n);if(i===10){for(e||t.push("hardbreak","br",0),n++;n=55296&&i<=56319&&n+1=56320&&a<=57343&&(s+=t.src[n+1],n++)}const o="\\"+s;if(!e){const a=t.push("text_special","",0);i<256&&r2[i]!==0?a.content=s:a.content=o,a.markup=o,a.info="escape"}return t.pos=n+1,!0}function UH(t,e){let n=t.pos;if(t.src.charCodeAt(n)!==96)return!1;const i=n;n++;const s=t.posMax;for(;n=0;r--){const i=e[r];if(i.marker!==95&&i.marker!==42||i.end===-1)continue;const s=e[i.end],o=r>0&&e[r-1].end===i.end+1&&e[r-1].marker===i.marker&&e[r-1].token===i.token-1&&e[i.end+1].token===s.token+1,a=String.fromCharCode(i.marker),l=t.tokens[i.token];l.type=o?"strong_open":"em_open",l.tag=o?"strong":"em",l.nesting=1,l.markup=o?a+a:a,l.content="";const u=t.tokens[s.token];u.type=o?"strong_close":"em_close",u.tag=o?"strong":"em",u.nesting=-1,u.markup=o?a+a:a,u.content="",o&&(t.tokens[e[r-1].token].content="",t.tokens[e[i.end+1].token].content="",r--)}}function WH(t){const e=t.tokens_meta,n=t.tokens_meta.length;bw(t,t.delimiters);for(let r=0;r=f)return!1;if(l=p,i=t.md.helpers.parseLinkDestination(t.src,p,t.posMax),i.ok){for(o=t.md.normalizeLink(i.str),t.md.validateLink(o)?p=i.pos:o="",l=p;p=f||t.src.charCodeAt(p)!==41)&&(u=!0),p++}if(u){if(typeof t.env.references>"u")return!1;if(p=0?r=t.src.slice(l,p++):p=h+1):p=h+1,r||(r=t.src.slice(d,h)),s=t.env.references[lm(r)],!s)return t.pos=c,!1;o=s.href,a=s.title}if(!e){t.pos=d,t.posMax=h;const m=t.push("link_open","a",1),g=[["href",o]];m.attrs=g,a&&g.push(["title",a]),t.linkLevel++,t.md.inline.tokenize(t),t.linkLevel--,t.push("link_close","a",-1)}return t.pos=p,t.posMax=f,!0}function XH(t,e){let n,r,i,s,o,a,l,u,c="";const f=t.pos,d=t.posMax;if(t.src.charCodeAt(t.pos)!==33||t.src.charCodeAt(t.pos+1)!==91)return!1;const h=t.pos+2,p=t.md.helpers.parseLinkLabel(t,t.pos+1,!1);if(p<0)return!1;if(s=p+1,s=d)return!1;for(u=s,a=t.md.helpers.parseLinkDestination(t.src,s,t.posMax),a.ok&&(c=t.md.normalizeLink(a.str),t.md.validateLink(c)?s=a.pos:c=""),u=s;s=d||t.src.charCodeAt(s)!==41)return t.pos=f,!1;s++}else{if(typeof t.env.references>"u")return!1;if(s=0?i=t.src.slice(u,s++):s=p+1):s=p+1,i||(i=t.src.slice(h,p)),o=t.env.references[lm(i)],!o)return t.pos=f,!1;c=o.href,l=o.title}if(!e){r=t.src.slice(h,p);const m=[];t.md.inline.parse(r,t.md,t.env,m);const g=t.push("image","img",0),b=[["src",c],["alt",""]];g.attrs=b,g.children=m,g.content=r,l&&b.push(["title",l])}return t.pos=s,t.posMax=d,!0}const YH=/^([a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)$/,JH=/^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^<>\x00-\x20]*)$/;function ZH(t,e){let n=t.pos;if(t.src.charCodeAt(n)!==60)return!1;const r=t.pos,i=t.posMax;for(;;){if(++n>=i)return!1;const o=t.src.charCodeAt(n);if(o===60)return!1;if(o===62)break}const s=t.src.slice(r+1,n);if(JH.test(s)){const o=t.md.normalizeLink(s);if(!t.md.validateLink(o))return!1;if(!e){const a=t.push("link_open","a",1);a.attrs=[["href",o]],a.markup="autolink",a.info="auto";const l=t.push("text","",0);l.content=t.md.normalizeLinkText(s);const u=t.push("link_close","a",-1);u.markup="autolink",u.info="auto"}return t.pos+=s.length+2,!0}if(YH.test(s)){const o=t.md.normalizeLink("mailto:"+s);if(!t.md.validateLink(o))return!1;if(!e){const a=t.push("link_open","a",1);a.attrs=[["href",o]],a.markup="autolink",a.info="auto";const l=t.push("text","",0);l.content=t.md.normalizeLinkText(s);const u=t.push("link_close","a",-1);u.markup="autolink",u.info="auto"}return t.pos+=s.length+2,!0}return!1}function QH(t){return/^\s]/i.test(t)}function eq(t){return/^<\/a\s*>/i.test(t)}function tq(t){const e=t|32;return e>=97&&e<=122}function nq(t,e){if(!t.md.options.html)return!1;const n=t.posMax,r=t.pos;if(t.src.charCodeAt(r)!==60||r+2>=n)return!1;const i=t.src.charCodeAt(r+1);if(i!==33&&i!==63&&i!==47&&!tq(i))return!1;const s=t.src.slice(r).match(IH);if(!s)return!1;if(!e){const o=t.push("html_inline","",0);o.content=s[0],QH(o.content)&&t.linkLevel++,eq(o.content)&&t.linkLevel--}return t.pos+=s[0].length,!0}const rq=/^&#((?:x[a-f0-9]{1,6}|[0-9]{1,7}));/i,iq=/^&([a-z][a-z0-9]{1,31});/i;function sq(t,e){const n=t.pos,r=t.posMax;if(t.src.charCodeAt(n)!==38||n+1>=r)return!1;if(t.src.charCodeAt(n+1)===35){const s=t.src.slice(n).match(rq);if(s){if(!e){const o=s[1][0].toLowerCase()==="x"?parseInt(s[1].slice(1),16):parseInt(s[1],10),a=t.push("text_special","",0);a.content=t2(o)?qp(o):qp(65533),a.markup=s[0],a.info="entity"}return t.pos+=s[0].length,!0}}else{const s=t.src.slice(n).match(iq);if(s){const o=dO(s[0]);if(o!==s[0]){if(!e){const a=t.push("text_special","",0);a.content=o,a.markup=s[0],a.info="entity"}return t.pos+=s[0].length,!0}}}return!1}function yw(t){const e={},n=t.length;if(!n)return;let r=0,i=-2;const s=[];for(let o=0;ol;u-=s[u]+1){const f=t[u];if(f.marker===a.marker&&f.open&&f.end<0){let d=!1;if((f.close||a.open)&&(f.length+a.length)%3===0&&(f.length%3!==0||a.length%3!==0)&&(d=!0),!d){const h=u>0&&!t[u-1].open?s[u-1]+1:0;s[o]=o-u+h,s[u]=h,a.open=!1,f.end=o,f.close=!1,c=-1,i=-2;break}}}c!==-1&&(e[a.marker][(a.open?3:0)+(a.length||0)%3]=c)}}function oq(t){const e=t.tokens_meta,n=t.tokens_meta.length;yw(t.delimiters);for(let r=0;r0&&r++,i[e].type==="text"&&e+1=t.pos)throw new Error("inline rule didn't increment state.pos");break}}else t.pos=t.posMax;o||t.pos++,s[e]=t.pos};Gf.prototype.tokenize=function(t){const e=this.ruler.getRules(""),n=e.length,r=t.posMax,i=t.md.options.maxNesting;for(;t.pos=t.pos)throw new Error("inline rule didn't increment state.pos");break}}if(o){if(t.pos>=r)break;continue}t.pending+=t.src[t.pos++]}t.pending&&t.pushPending()};Gf.prototype.parse=function(t,e,n,r){const i=new this.State(t,e,n,r);this.tokenize(i);const s=this.ruler2.getRules(""),o=s.length;for(let a=0;a|$))",e.tpl_email_fuzzy="(^|"+n+'|"|\\(|'+e.src_ZCc+")("+e.src_email_name+"@"+e.tpl_host_fuzzy_strict+")",e.tpl_link_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+e.src_ZPCc+"))((?![$+<=>^`||])"+e.tpl_host_port_fuzzy_strict+e.src_path+")",e.tpl_link_no_ip_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+e.src_ZPCc+"))((?![$+<=>^`||])"+e.tpl_host_port_no_ip_fuzzy_strict+e.src_path+")",e}function Yb(t){return Array.prototype.slice.call(arguments,1).forEach(function(n){n&&Object.keys(n).forEach(function(r){t[r]=n[r]})}),t}function cm(t){return Object.prototype.toString.call(t)}function uq(t){return cm(t)==="[object String]"}function cq(t){return cm(t)==="[object Object]"}function fq(t){return cm(t)==="[object RegExp]"}function vw(t){return cm(t)==="[object Function]"}function dq(t){return t.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}const SO={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1};function hq(t){return Object.keys(t||{}).reduce(function(e,n){return e||SO.hasOwnProperty(n)},!1)}const pq={"http:":{validate:function(t,e,n){const r=t.slice(e);return n.re.http||(n.re.http=new RegExp("^\\/\\/"+n.re.src_auth+n.re.src_host_port_strict+n.re.src_path,"i")),n.re.http.test(r)?r.match(n.re.http)[0].length:0}},"https:":"http:","ftp:":"http:","//":{validate:function(t,e,n){const r=t.slice(e);return n.re.no_http||(n.re.no_http=new RegExp("^"+n.re.src_auth+"(?:localhost|(?:(?:"+n.re.src_domain+")\\.)+"+n.re.src_domain_root+")"+n.re.src_port+n.re.src_host_terminator+n.re.src_path,"i")),n.re.no_http.test(r)?e>=3&&t[e-3]===":"||e>=3&&t[e-3]==="/"?0:r.match(n.re.no_http)[0].length:0}},"mailto:":{validate:function(t,e,n){const r=t.slice(e);return n.re.mailto||(n.re.mailto=new RegExp("^"+n.re.src_email_name+"@"+n.re.src_host_strict,"i")),n.re.mailto.test(r)?r.match(n.re.mailto)[0].length:0}}},mq="a[cdefgilmnoqrstuwxz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvwxyz]|d[ejkmoz]|e[cegrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdeghklmnopqrstuvwxyz]|n[acefgilopruz]|om|p[aefghklmnrstwy]|qa|r[eosuw]|s[abcdeghijklmnortuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]",gq="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф".split("|");function bq(t){t.__index__=-1,t.__text_cache__=""}function yq(t){return function(e,n){const r=e.slice(n);return t.test(r)?r.match(t)[0].length:0}}function xw(){return function(t,e){e.normalize(t)}}function Gp(t){const e=t.re=lq(t.__opts__),n=t.__tlds__.slice();t.onCompile(),t.__tlds_replaced__||n.push(mq),n.push(e.src_xn),e.src_tlds=n.join("|");function r(a){return a.replace("%TLDS%",e.src_tlds)}e.email_fuzzy=RegExp(r(e.tpl_email_fuzzy),"i"),e.link_fuzzy=RegExp(r(e.tpl_link_fuzzy),"i"),e.link_no_ip_fuzzy=RegExp(r(e.tpl_link_no_ip_fuzzy),"i"),e.host_fuzzy_test=RegExp(r(e.tpl_host_fuzzy_test),"i");const i=[];t.__compiled__={};function s(a,l){throw new Error('(LinkifyIt) Invalid schema "'+a+'": '+l)}Object.keys(t.__schemas__).forEach(function(a){const l=t.__schemas__[a];if(l===null)return;const u={validate:null,link:null};if(t.__compiled__[a]=u,cq(l)){fq(l.validate)?u.validate=yq(l.validate):vw(l.validate)?u.validate=l.validate:s(a,l),vw(l.normalize)?u.normalize=l.normalize:l.normalize?s(a,l):u.normalize=xw();return}if(uq(l)){i.push(a);return}s(a,l)}),i.forEach(function(a){t.__compiled__[t.__schemas__[a]]&&(t.__compiled__[a].validate=t.__compiled__[t.__schemas__[a]].validate,t.__compiled__[a].normalize=t.__compiled__[t.__schemas__[a]].normalize)}),t.__compiled__[""]={validate:null,normalize:xw()};const o=Object.keys(t.__compiled__).filter(function(a){return a.length>0&&t.__compiled__[a]}).map(dq).join("|");t.re.schema_test=RegExp("(^|(?!_)(?:[><|]|"+e.src_ZPCc+"))("+o+")","i"),t.re.schema_search=RegExp("(^|(?!_)(?:[><|]|"+e.src_ZPCc+"))("+o+")","ig"),t.re.schema_at_start=RegExp("^"+t.re.schema_search.source,"i"),t.re.pretest=RegExp("("+t.re.schema_test.source+")|("+t.re.host_fuzzy_test.source+")|@","i"),bq(t)}function vq(t,e){const n=t.__index__,r=t.__last_index__,i=t.__text_cache__.slice(n,r);this.schema=t.__schema__.toLowerCase(),this.index=n+e,this.lastIndex=r+e,this.raw=i,this.text=i,this.url=i}function Jb(t,e){const n=new vq(t,e);return t.__compiled__[n.schema].normalize(n,t),n}function Tr(t,e){if(!(this instanceof Tr))return new Tr(t,e);e||hq(t)&&(e=t,t={}),this.__opts__=Yb({},SO,e),this.__index__=-1,this.__last_index__=-1,this.__schema__="",this.__text_cache__="",this.__schemas__=Yb({},pq,t),this.__compiled__={},this.__tlds__=gq,this.__tlds_replaced__=!1,this.re={},Gp(this)}Tr.prototype.add=function(e,n){return this.__schemas__[e]=n,Gp(this),this};Tr.prototype.set=function(e){return this.__opts__=Yb(this.__opts__,e),this};Tr.prototype.test=function(e){if(this.__text_cache__=e,this.__index__=-1,!e.length)return!1;let n,r,i,s,o,a,l,u,c;if(this.re.schema_test.test(e)){for(l=this.re.schema_search,l.lastIndex=0;(n=l.exec(e))!==null;)if(s=this.testSchemaAt(e,n[2],l.lastIndex),s){this.__schema__=n[2],this.__index__=n.index+n[1].length,this.__last_index__=n.index+n[0].length+s;break}}return this.__opts__.fuzzyLink&&this.__compiled__["http:"]&&(u=e.search(this.re.host_fuzzy_test),u>=0&&(this.__index__<0||u=0&&(i=e.match(this.re.email_fuzzy))!==null&&(o=i.index+i[1].length,a=i.index+i[0].length,(this.__index__<0||othis.__last_index__)&&(this.__schema__="mailto:",this.__index__=o,this.__last_index__=a))),this.__index__>=0};Tr.prototype.pretest=function(e){return this.re.pretest.test(e)};Tr.prototype.testSchemaAt=function(e,n,r){return this.__compiled__[n.toLowerCase()]?this.__compiled__[n.toLowerCase()].validate(e,r,this):0};Tr.prototype.match=function(e){const n=[];let r=0;this.__index__>=0&&this.__text_cache__===e&&(n.push(Jb(this,r)),r=this.__last_index__);let i=r?e.slice(r):e;for(;this.test(i);)n.push(Jb(this,r)),i=i.slice(this.__last_index__),r+=this.__last_index__;return n.length?n:null};Tr.prototype.matchAtStart=function(e){if(this.__text_cache__=e,this.__index__=-1,!e.length)return null;const n=this.re.schema_at_start.exec(e);if(!n)return null;const r=this.testSchemaAt(e,n[2],n[0].length);return r?(this.__schema__=n[2],this.__index__=n.index+n[1].length,this.__last_index__=n.index+n[0].length+r,Jb(this,0)):null};Tr.prototype.tlds=function(e,n){return e=Array.isArray(e)?e:[e],n?(this.__tlds__=this.__tlds__.concat(e).sort().filter(function(r,i,s){return r!==s[i-1]}).reverse(),Gp(this),this):(this.__tlds__=e.slice(),this.__tlds_replaced__=!0,Gp(this),this)};Tr.prototype.normalize=function(e){e.schema||(e.url="http://"+e.url),e.schema==="mailto:"&&!/^mailto:/i.test(e.url)&&(e.url="mailto:"+e.url)};Tr.prototype.onCompile=function(){};const ml=2147483647,Ni=36,i2=1,ef=26,xq=38,Sq=700,EO=72,wO=128,_O="-",Eq=/^xn--/,wq=/[^\0-\x7F]/,_q=/[\x2E\u3002\uFF0E\uFF61]/g,Cq={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},Kg=Ni-i2,Mi=Math.floor,Xg=String.fromCharCode;function Ms(t){throw new RangeError(Cq[t])}function Aq(t,e){const n=[];let r=t.length;for(;r--;)n[r]=e(t[r]);return n}function CO(t,e){const n=t.split("@");let r="";n.length>1&&(r=n[0]+"@",t=n[1]),t=t.replace(_q,".");const i=t.split("."),s=Aq(i,e).join(".");return r+s}function AO(t){const e=[];let n=0;const r=t.length;for(;n=55296&&i<=56319&&nString.fromCodePoint(...t),kq=function(t){return t>=48&&t<58?26+(t-48):t>=65&&t<91?t-65:t>=97&&t<123?t-97:Ni},Sw=function(t,e){return t+22+75*(t<26)-((e!=0)<<5)},DO=function(t,e,n){let r=0;for(t=n?Mi(t/Sq):t>>1,t+=Mi(t/e);t>Kg*ef>>1;r+=Ni)t=Mi(t/Kg);return Mi(r+(Kg+1)*t/(t+xq))},kO=function(t){const e=[],n=t.length;let r=0,i=wO,s=EO,o=t.lastIndexOf(_O);o<0&&(o=0);for(let a=0;a=128&&Ms("not-basic"),e.push(t.charCodeAt(a));for(let a=o>0?o+1:0;a=n&&Ms("invalid-input");const d=kq(t.charCodeAt(a++));d>=Ni&&Ms("invalid-input"),d>Mi((ml-r)/c)&&Ms("overflow"),r+=d*c;const h=f<=s?i2:f>=s+ef?ef:f-s;if(dMi(ml/p)&&Ms("overflow"),c*=p}const u=e.length+1;s=DO(r-l,u,l==0),Mi(r/u)>ml-i&&Ms("overflow"),i+=Mi(r/u),r%=u,e.splice(r++,0,i)}return String.fromCodePoint(...e)},OO=function(t){const e=[];t=AO(t);const n=t.length;let r=wO,i=0,s=EO;for(const l of t)l<128&&e.push(Xg(l));const o=e.length;let a=o;for(o&&e.push(_O);a=r&&cMi((ml-i)/u)&&Ms("overflow"),i+=(l-r)*u,r=l;for(const c of t)if(cml&&Ms("overflow"),c===r){let f=i;for(let d=Ni;;d+=Ni){const h=d<=s?i2:d>=s+ef?ef:d-s;if(f=0))try{e.hostname=TO.toASCII(e.hostname)}catch{}return Hf(Jv(e))}function $q(t){const e=Zv(t,!0);if(e.hostname&&(!e.protocol||IO.indexOf(e.protocol)>=0))try{e.hostname=TO.toUnicode(e.hostname)}catch{}return Ml(Jv(e),Ml.defaultChars+"%")}function Gr(t,e){if(!(this instanceof Gr))return new Gr(t,e);e||e2(t)||(e=t||{},t="default"),this.inline=new Gf,this.block=new um,this.core=new n2,this.renderer=new ou,this.linkify=new Tr,this.validateLink=Lq,this.normalizeLink=Bq,this.normalizeLinkText=$q,this.utils=jU,this.helpers=am({},qU),this.options={},this.configure(t),e&&this.set(e)}Gr.prototype.set=function(t){return am(this.options,t),this};Gr.prototype.configure=function(t){const e=this;if(e2(t)){const n=t;if(t=Nq[n],!t)throw new Error('Wrong `markdown-it` preset "'+n+'", check name')}if(!t)throw new Error("Wrong `markdown-it` preset, can't be empty");return t.options&&e.set(t.options),t.components&&Object.keys(t.components).forEach(function(n){t.components[n].rules&&e[n].ruler.enableOnly(t.components[n].rules),t.components[n].rules2&&e[n].ruler2.enableOnly(t.components[n].rules2)}),this};Gr.prototype.enable=function(t,e){let n=[];Array.isArray(t)||(t=[t]),["core","block","inline"].forEach(function(i){n=n.concat(this[i].ruler.enable(t,!0))},this),n=n.concat(this.inline.ruler2.enable(t,!0));const r=t.filter(function(i){return n.indexOf(i)<0});if(r.length&&!e)throw new Error("MarkdownIt. Failed to enable unknown rule(s): "+r);return this};Gr.prototype.disable=function(t,e){let n=[];Array.isArray(t)||(t=[t]),["core","block","inline"].forEach(function(i){n=n.concat(this[i].ruler.disable(t,!0))},this),n=n.concat(this.inline.ruler2.disable(t,!0));const r=t.filter(function(i){return n.indexOf(i)<0});if(r.length&&!e)throw new Error("MarkdownIt. Failed to disable unknown rule(s): "+r);return this};Gr.prototype.use=function(t){const e=[this].concat(Array.prototype.slice.call(arguments,1));return t.apply(t,e),this};Gr.prototype.parse=function(t,e){if(typeof t!="string")throw new Error("Input data should be a String");const n=new this.core.State(t,this,e);return this.core.process(n),n.tokens};Gr.prototype.render=function(t,e){return e=e||{},this.renderer.render(this.parse(t,e),this.options,e)};Gr.prototype.parseInline=function(t,e){const n=new this.core.State(t,this,e);return n.inlineMode=!0,this.core.process(n),n.tokens};Gr.prototype.renderInline=function(t,e){return e=e||{},this.renderer.render(this.parseInline(t,e),this.options,e)};function zq(t,e,n){const{parseMetaString:r,trimEndingNewline:i=!0,defaultLanguage:s="text",fallbackLanguage:o}=n,a=e.getLoadedLanguages();t.options.highlight=(l,u="text",c)=>{u===""&&(u=s),o&&!a.includes(u)&&(u=o);const f=(r==null?void 0:r(c,l,u))||{},d={...n,lang:u,meta:{...n.meta,...f,__raw:c}},h=[];return h.push({name:"@shikijs/markdown-it:block-class",code(p){p.properties.class=`language-${u}`}}),i&&l.endsWith(` +`)&&(l=l.slice(0,-1)),e.codeToHtml(l,{...d,transformers:[...h,...d.transformers||[]]})}}function jq(t,e){return function(n){zq(n,t,e)}}let sa=class extends Error{constructor(e){super(e),this.name="ShikiError"}},s2=class extends Error{constructor(e){super(e),this.name="ShikiError"}};function Vq(){return 2147483648}function Uq(){return typeof performance<"u"?performance.now():Date.now()}const Hq=(t,e)=>t+(e-t%e)%e;async function qq(t){let e,n;const r={};function i(h){n=h,r.HEAPU8=new Uint8Array(h),r.HEAPU32=new Uint32Array(h)}function s(h,p,m){r.HEAPU8.copyWithin(h,p,p+m)}function o(h){try{return e.grow(h-n.byteLength+65535>>>16),i(e.buffer),1}catch{}}function a(h){const p=r.HEAPU8.length;h=h>>>0;const m=Vq();if(h>m)return!1;for(let g=1;g<=4;g*=2){let b=p*(1+.2/g);b=Math.min(b,h+100663296);const y=Math.min(m,Hq(Math.max(h,b),65536));if(o(y))return!0}return!1}const l=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0;function u(h,p,m=1024){const g=p+m;let b=p;for(;h[b]&&!(b>=g);)++b;if(b-p>16&&h.buffer&&l)return l.decode(h.subarray(p,b));let y="";for(;p>10,56320|C&1023)}}return y}function c(h,p){return h?u(r.HEAPU8,h,p):""}const f={emscripten_get_now:Uq,emscripten_memcpy_big:s,emscripten_resize_heap:a,fd_write:()=>0};async function d(){const p=await t({env:f,wasi_snapshot_preview1:f});e=p.memory,i(e.buffer),Object.assign(r,p),r.UTF8ToString=c}return await d(),r}var Gq=Object.defineProperty,Wq=(t,e,n)=>e in t?Gq(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,rn=(t,e,n)=>(Wq(t,typeof e!="symbol"?e+"":e,n),n);let cn=null;function Kq(t){throw new s2(t.UTF8ToString(t.getLastOnigError()))}class fm{constructor(e){rn(this,"utf16Length"),rn(this,"utf8Length"),rn(this,"utf16Value"),rn(this,"utf8Value"),rn(this,"utf16OffsetToUtf8"),rn(this,"utf8OffsetToUtf16");const n=e.length,r=fm._utf8ByteLength(e),i=r!==n,s=i?new Uint32Array(n+1):null;i&&(s[n]=r);const o=i?new Uint32Array(r+1):null;i&&(o[r]=n);const a=new Uint8Array(r);let l=0;for(let u=0;u=55296&&c<=56319&&u+1=56320&&h<=57343&&(f=(c-55296<<10)+65536|h-56320,d=!0)}i&&(s[u]=l,d&&(s[u+1]=l),f<=127?o[l+0]=u:f<=2047?(o[l+0]=u,o[l+1]=u):f<=65535?(o[l+0]=u,o[l+1]=u,o[l+2]=u):(o[l+0]=u,o[l+1]=u,o[l+2]=u,o[l+3]=u)),f<=127?a[l++]=f:f<=2047?(a[l++]=192|(f&1984)>>>6,a[l++]=128|(f&63)>>>0):f<=65535?(a[l++]=224|(f&61440)>>>12,a[l++]=128|(f&4032)>>>6,a[l++]=128|(f&63)>>>0):(a[l++]=240|(f&1835008)>>>18,a[l++]=128|(f&258048)>>>12,a[l++]=128|(f&4032)>>>6,a[l++]=128|(f&63)>>>0),d&&u++}this.utf16Length=n,this.utf8Length=r,this.utf16Value=e,this.utf8Value=a,this.utf16OffsetToUtf8=s,this.utf8OffsetToUtf16=o}static _utf8ByteLength(e){let n=0;for(let r=0,i=e.length;r=55296&&s<=56319&&r+1=56320&&l<=57343&&(o=(s-55296<<10)+65536|l-56320,a=!0)}o<=127?n+=1:o<=2047?n+=2:o<=65535?n+=3:n+=4,a&&r++}return n}createString(e){const n=e.omalloc(this.utf8Length);return e.HEAPU8.set(this.utf8Value,n),n}}const wi=class{constructor(t){if(rn(this,"id",++wi.LAST_ID),rn(this,"_onigBinding"),rn(this,"content"),rn(this,"utf16Length"),rn(this,"utf8Length"),rn(this,"utf16OffsetToUtf8"),rn(this,"utf8OffsetToUtf16"),rn(this,"ptr"),!cn)throw new s2("Must invoke loadWasm first.");this._onigBinding=cn,this.content=t;const e=new fm(t);this.utf16Length=e.utf16Length,this.utf8Length=e.utf8Length,this.utf16OffsetToUtf8=e.utf16OffsetToUtf8,this.utf8OffsetToUtf16=e.utf8OffsetToUtf16,this.utf8Length<1e4&&!wi._sharedPtrInUse?(wi._sharedPtr||(wi._sharedPtr=cn.omalloc(1e4)),wi._sharedPtrInUse=!0,cn.HEAPU8.set(e.utf8Value,wi._sharedPtr),this.ptr=wi._sharedPtr):this.ptr=e.createString(cn)}convertUtf8OffsetToUtf16(t){return this.utf8OffsetToUtf16?t<0?0:t>this.utf8Length?this.utf16Length:this.utf8OffsetToUtf16[t]:t}convertUtf16OffsetToUtf8(t){return this.utf16OffsetToUtf8?t<0?0:t>this.utf16Length?this.utf8Length:this.utf16OffsetToUtf8[t]:t}dispose(){this.ptr===wi._sharedPtr?wi._sharedPtrInUse=!1:this._onigBinding.ofree(this.ptr)}};let Wf=wi;rn(Wf,"LAST_ID",0);rn(Wf,"_sharedPtr",0);rn(Wf,"_sharedPtrInUse",!1);class Xq{constructor(e){if(rn(this,"_onigBinding"),rn(this,"_ptr"),!cn)throw new s2("Must invoke loadWasm first.");const n=[],r=[];for(let a=0,l=e.length;a{let r=t;return r=await r,typeof r=="function"&&(r=await r(n)),typeof r=="function"&&(r=await r(n)),Yq(r)?r=await r.instantiator(n):Jq(r)?r=await r.default(n):(Zq(r)&&(r=r.data),Qq(r)?typeof WebAssembly.instantiateStreaming=="function"?r=await nG(r)(n):r=await rG(r)(n):eG(r)?r=await Yg(r)(n):r instanceof WebAssembly.Module?r=await Yg(r)(n):"default"in r&&r.default instanceof WebAssembly.Module&&(r=await Yg(r.default)(n))),"instance"in r&&(r=r.instance),"exports"in r&&(r=r.exports),r})}return Kd=e(),Kd}function Yg(t){return e=>WebAssembly.instantiate(t,e)}function nG(t){return e=>WebAssembly.instantiateStreaming(t,e)}function rG(t){return async e=>{const n=await t.arrayBuffer();return WebAssembly.instantiate(n,e)}}let iG;function sG(){return iG}async function oG(t){return t&&await tG(t),{createScanner(e){return new Xq(e.map(n=>typeof n=="string"?n:n.source))},createString(e){return new Wf(e)}}}function aG(t){return o2(t)}function o2(t){return Array.isArray(t)?lG(t):t instanceof RegExp?t:typeof t=="object"?uG(t):t}function lG(t){let e=[];for(let n=0,r=t.length;n{for(let r in n)t[r]=n[r]}),t}function RO(t){const e=~t.lastIndexOf("/")||~t.lastIndexOf("\\");return e===0?t:~e===t.length-1?RO(t.substring(0,t.length-1)):t.substr(~e+1)}var Jg=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,Xd=class{static hasCaptures(t){return t===null?!1:(Jg.lastIndex=0,Jg.test(t))}static replaceCaptures(t,e,n){return t.replace(Jg,(r,i,s,o)=>{let a=n[parseInt(i||s,10)];if(a){let l=e.substring(a.start,a.end);for(;l[0]===".";)l=l.substring(1);switch(o){case"downcase":return l.toLowerCase();case"upcase":return l.toUpperCase();default:return l}}else return r})}};function NO(t,e){return te?1:0}function MO(t,e){if(t===null&&e===null)return 0;if(!t)return-1;if(!e)return 1;let n=t.length,r=e.length;if(n===r){for(let i=0;ithis._root.match(t)));this._colorMap=t,this._defaults=e,this._root=n}static createFromRawTheme(t,e){return this.createFromParsedTheme(dG(t),e)}static createFromParsedTheme(t,e){return pG(t,e)}getColorMap(){return this._colorMap.getColorMap()}getDefaults(){return this._defaults}match(t){if(t===null)return this._defaults;const e=t.scopeName,r=this._cachedMatchRoot.get(e).find(i=>cG(t.parent,i.parentScopes));return r?new BO(r.fontStyle,r.foreground,r.background):null}},Zg=class jh{constructor(e,n){this.parent=e,this.scopeName=n}static push(e,n){for(const r of n)e=new jh(e,r);return e}static from(...e){let n=null;for(let r=0;r"){if(n===e.length-1)return!1;r=e[++n],i=!0}for(;t&&!fG(t.scopeName,r);){if(i)return!1;t=t.parent}if(!t)return!1;t=t.parent}return!0}function fG(t,e){return e===t||t.startsWith(e)&&t[e.length]==="."}var BO=class{constructor(t,e,n){this.fontStyle=t,this.foregroundId=e,this.backgroundId=n}};function dG(t){if(!t)return[];if(!t.settings||!Array.isArray(t.settings))return[];let e=t.settings,n=[],r=0;for(let i=0,s=e.length;i1&&(g=p.slice(0,p.length-1),g.reverse()),n[r++]=new hG(m,g,i,l,u,c)}}return n}var hG=class{constructor(t,e,n,r,i,s){this.scope=t,this.parentScopes=e,this.index=n,this.fontStyle=r,this.foreground=i,this.background=s}},hs=(t=>(t[t.NotSet=-1]="NotSet",t[t.None=0]="None",t[t.Italic=1]="Italic",t[t.Bold=2]="Bold",t[t.Underline=4]="Underline",t[t.Strikethrough=8]="Strikethrough",t))(hs||{});function pG(t,e){t.sort((l,u)=>{let c=NO(l.scope,u.scope);return c!==0||(c=MO(l.parentScopes,u.parentScopes),c!==0)?c:l.index-u.index});let n=0,r="#000000",i="#ffffff";for(;t.length>=1&&t[0].scope==="";){let l=t.shift();l.fontStyle!==-1&&(n=l.fontStyle),l.foreground!==null&&(r=l.foreground),l.background!==null&&(i=l.background)}let s=new mG(e),o=new BO(n,s.getId(r),s.getId(i)),a=new bG(new Zb(0,null,-1,0,0),[]);for(let l=0,u=t.length;le?console.log("how did this happen?"):this.scopeDepth=e,n!==-1&&(this.fontStyle=n),r!==0&&(this.foreground=r),i!==0&&(this.background=i)}},bG=class Qb{constructor(e,n=[],r={}){X(this,"_rulesWithParentScopes");this._mainRule=e,this._children=r,this._rulesWithParentScopes=n}static _cmpBySpecificity(e,n){if(e.scopeDepth!==n.scopeDepth)return n.scopeDepth-e.scopeDepth;let r=0,i=0;for(;e.parentScopes[r]===">"&&r++,n.parentScopes[i]===">"&&i++,!(r>=e.parentScopes.length||i>=n.parentScopes.length);){const s=n.parentScopes[i].length-e.parentScopes[r].length;if(s!==0)return s;r++,i++}return n.parentScopes.length-e.parentScopes.length}match(e){if(e!==""){let r=e.indexOf("."),i,s;if(r===-1?(i=e,s=""):(i=e.substring(0,r),s=e.substring(r+1)),this._children.hasOwnProperty(i))return this._children[i].match(s)}const n=this._rulesWithParentScopes.concat(this._mainRule);return n.sort(Qb._cmpBySpecificity),n}insert(e,n,r,i,s,o){if(n===""){this._doInsertHere(e,r,i,s,o);return}let a=n.indexOf("."),l,u;a===-1?(l=n,u=""):(l=n.substring(0,a),u=n.substring(a+1));let c;this._children.hasOwnProperty(l)?c=this._children[l]:(c=new Qb(this._mainRule.clone(),Zb.cloneArr(this._rulesWithParentScopes)),this._children[l]=c),c.insert(e+1,u,r,i,s,o)}_doInsertHere(e,n,r,i,s){if(n===null){this._mainRule.acceptOverwrite(e,r,i,s);return}for(let o=0,a=this._rulesWithParentScopes.length;o>>0}static getTokenType(e){return(e&768)>>>8}static containsBalancedBrackets(e){return(e&1024)!==0}static getFontStyle(e){return(e&30720)>>>11}static getForeground(e){return(e&16744448)>>>15}static getBackground(e){return(e&4278190080)>>>24}static set(e,n,r,i,s,o,a){let l=Mr.getLanguageId(e),u=Mr.getTokenType(e),c=Mr.containsBalancedBrackets(e)?1:0,f=Mr.getFontStyle(e),d=Mr.getForeground(e),h=Mr.getBackground(e);return n!==0&&(l=n),r!==8&&(u=r),i!==null&&(c=i?1:0),s!==-1&&(f=s),o!==0&&(d=o),a!==0&&(h=a),(l<<0|u<<8|c<<10|f<<11|d<<15|h<<24)>>>0}};function Kp(t,e){const n=[],r=yG(t);let i=r.next();for(;i!==null;){let l=0;if(i.length===2&&i.charAt(1)===":"){switch(i.charAt(0)){case"R":l=1;break;case"L":l=-1;break;default:console.log(`Unknown priority ${i} in scope selector`)}i=r.next()}let u=o();if(n.push({matcher:u,priority:l}),i!==",")break;i=r.next()}return n;function s(){if(i==="-"){i=r.next();const l=s();return u=>!!l&&!l(u)}if(i==="("){i=r.next();const l=a();return i===")"&&(i=r.next()),l}if(ww(i)){const l=[];do l.push(i),i=r.next();while(ww(i));return u=>e(l,u)}return null}function o(){const l=[];let u=s();for(;u;)l.push(u),u=s();return c=>l.every(f=>f(c))}function a(){const l=[];let u=o();for(;u&&(l.push(u),i==="|"||i===",");){do i=r.next();while(i==="|"||i===",");u=o()}return c=>l.some(f=>f(c))}}function ww(t){return!!t&&!!t.match(/[\w\.:]+/)}function yG(t){let e=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g,n=e.exec(t);return{next:()=>{if(!n)return null;const r=n[0];return n=e.exec(t),r}}}function zO(t){typeof t.dispose=="function"&&t.dispose()}var tf=class{constructor(t){this.scopeName=t}toKey(){return this.scopeName}},vG=class{constructor(t,e){this.scopeName=t,this.ruleName=e}toKey(){return`${this.scopeName}#${this.ruleName}`}},xG=class{constructor(){X(this,"_references",[]);X(this,"_seenReferenceKeys",new Set);X(this,"visitedRule",new Set)}get references(){return this._references}add(t){const e=t.toKey();this._seenReferenceKeys.has(e)||(this._seenReferenceKeys.add(e),this._references.push(t))}},SG=class{constructor(t,e){X(this,"seenFullScopeRequests",new Set);X(this,"seenPartialScopeRequests",new Set);X(this,"Q");this.repo=t,this.initialScopeName=e,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new tf(this.initialScopeName)]}processQueue(){const t=this.Q;this.Q=[];const e=new xG;for(const n of t)EG(n,this.initialScopeName,this.repo,e);for(const n of e.references)if(n instanceof tf){if(this.seenFullScopeRequests.has(n.scopeName))continue;this.seenFullScopeRequests.add(n.scopeName),this.Q.push(n)}else{if(this.seenFullScopeRequests.has(n.scopeName)||this.seenPartialScopeRequests.has(n.toKey()))continue;this.seenPartialScopeRequests.add(n.toKey()),this.Q.push(n)}}};function EG(t,e,n,r){const i=n.lookup(t.scopeName);if(!i){if(t.scopeName===e)throw new Error(`No grammar provided for <${e}>`);return}const s=n.lookup(e);t instanceof tf?Vh({baseGrammar:s,selfGrammar:i},r):ey(t.ruleName,{baseGrammar:s,selfGrammar:i,repository:i.repository},r);const o=n.injections(t.scopeName);if(o)for(const a of o)r.add(new tf(a))}function ey(t,e,n){if(e.repository&&e.repository[t]){const r=e.repository[t];Xp([r],e,n)}}function Vh(t,e){t.selfGrammar.patterns&&Array.isArray(t.selfGrammar.patterns)&&Xp(t.selfGrammar.patterns,{...t,repository:t.selfGrammar.repository},e),t.selfGrammar.injections&&Xp(Object.values(t.selfGrammar.injections),{...t,repository:t.selfGrammar.repository},e)}function Xp(t,e,n){for(const r of t){if(n.visitedRule.has(r))continue;n.visitedRule.add(r);const i=r.repository?PO({},e.repository,r.repository):e.repository;Array.isArray(r.patterns)&&Xp(r.patterns,{...e,repository:i},n);const s=r.include;if(!s)continue;const o=jO(s);switch(o.kind){case 0:Vh({...e,selfGrammar:e.baseGrammar},n);break;case 1:Vh(e,n);break;case 2:ey(o.ruleName,{...e,repository:i},n);break;case 3:case 4:const a=o.scopeName===e.selfGrammar.scopeName?e.selfGrammar:o.scopeName===e.baseGrammar.scopeName?e.baseGrammar:void 0;if(a){const l={baseGrammar:e.baseGrammar,selfGrammar:a,repository:i};o.kind===4?ey(o.ruleName,l,n):Vh(l,n)}else o.kind===4?n.add(new vG(o.scopeName,o.ruleName)):n.add(new tf(o.scopeName));break}}}var wG=class{constructor(){X(this,"kind",0)}},_G=class{constructor(){X(this,"kind",1)}},CG=class{constructor(t){X(this,"kind",2);this.ruleName=t}},AG=class{constructor(t){X(this,"kind",3);this.scopeName=t}},DG=class{constructor(t,e){X(this,"kind",4);this.scopeName=t,this.ruleName=e}};function jO(t){if(t==="$base")return new wG;if(t==="$self")return new _G;const e=t.indexOf("#");if(e===-1)return new AG(t);if(e===0)return new CG(t.substring(1));{const n=t.substring(0,e),r=t.substring(e+1);return new DG(n,r)}}var kG=/\\(\d+)/,_w=/\\(\d+)/g,OG=-1,VO=-2;var Kf=class{constructor(t,e,n,r){X(this,"$location");X(this,"id");X(this,"_nameIsCapturing");X(this,"_name");X(this,"_contentNameIsCapturing");X(this,"_contentName");this.$location=t,this.id=e,this._name=n||null,this._nameIsCapturing=Xd.hasCaptures(this._name),this._contentName=r||null,this._contentNameIsCapturing=Xd.hasCaptures(this._contentName)}get debugName(){const t=this.$location?`${RO(this.$location.filename)}:${this.$location.line}`:"unknown";return`${this.constructor.name}#${this.id} @ ${t}`}getName(t,e){return!this._nameIsCapturing||this._name===null||t===null||e===null?this._name:Xd.replaceCaptures(this._name,t,e)}getContentName(t,e){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:Xd.replaceCaptures(this._contentName,t,e)}},TG=class extends Kf{constructor(e,n,r,i,s){super(e,n,r,i);X(this,"retokenizeCapturedWithRuleId");this.retokenizeCapturedWithRuleId=s}dispose(){}collectPatterns(e,n){throw new Error("Not supported!")}compile(e,n){throw new Error("Not supported!")}compileAG(e,n,r,i){throw new Error("Not supported!")}},IG=class extends Kf{constructor(e,n,r,i,s){super(e,n,r,null);X(this,"_match");X(this,"captures");X(this,"_cachedCompiledPatterns");this._match=new nf(i,this.id),this.captures=s,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugMatchRegExp(){return`${this._match.source}`}collectPatterns(e,n){n.push(this._match)}compile(e,n){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,n,r,i){return this._getCachedCompiledPatterns(e).compileAG(e,r,i)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new rf,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},Cw=class extends Kf{constructor(e,n,r,i,s){super(e,n,r,i);X(this,"hasMissingPatterns");X(this,"patterns");X(this,"_cachedCompiledPatterns");this.patterns=s.patterns,this.hasMissingPatterns=s.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}collectPatterns(e,n){for(const r of this.patterns)e.getRule(r).collectPatterns(e,n)}compile(e,n){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,n,r,i){return this._getCachedCompiledPatterns(e).compileAG(e,r,i)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new rf,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},ty=class extends Kf{constructor(e,n,r,i,s,o,a,l,u,c){super(e,n,r,i);X(this,"_begin");X(this,"beginCaptures");X(this,"_end");X(this,"endHasBackReferences");X(this,"endCaptures");X(this,"applyEndPatternLast");X(this,"hasMissingPatterns");X(this,"patterns");X(this,"_cachedCompiledPatterns");this._begin=new nf(s,this.id),this.beginCaptures=o,this._end=new nf(a||"￿",-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=l,this.applyEndPatternLast=u||!1,this.patterns=c.patterns,this.hasMissingPatterns=c.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugEndRegExp(){return`${this._end.source}`}getEndWithResolvedBackReferences(e,n){return this._end.resolveBackReferences(e,n)}collectPatterns(e,n){n.push(this._begin)}compile(e,n){return this._getCachedCompiledPatterns(e,n).compile(e)}compileAG(e,n,r,i){return this._getCachedCompiledPatterns(e,n).compileAG(e,r,i)}_getCachedCompiledPatterns(e,n){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new rf;for(const r of this.patterns)e.getRule(r).collectPatterns(e,this._cachedCompiledPatterns);this.applyEndPatternLast?this._cachedCompiledPatterns.push(this._end.hasBackReferences?this._end.clone():this._end):this._cachedCompiledPatterns.unshift(this._end.hasBackReferences?this._end.clone():this._end)}return this._end.hasBackReferences&&(this.applyEndPatternLast?this._cachedCompiledPatterns.setSource(this._cachedCompiledPatterns.length()-1,n):this._cachedCompiledPatterns.setSource(0,n)),this._cachedCompiledPatterns}},Yp=class extends Kf{constructor(e,n,r,i,s,o,a,l,u){super(e,n,r,i);X(this,"_begin");X(this,"beginCaptures");X(this,"whileCaptures");X(this,"_while");X(this,"whileHasBackReferences");X(this,"hasMissingPatterns");X(this,"patterns");X(this,"_cachedCompiledPatterns");X(this,"_cachedCompiledWhilePatterns");this._begin=new nf(s,this.id),this.beginCaptures=o,this.whileCaptures=l,this._while=new nf(a,VO),this.whileHasBackReferences=this._while.hasBackReferences,this.patterns=u.patterns,this.hasMissingPatterns=u.hasMissingPatterns,this._cachedCompiledPatterns=null,this._cachedCompiledWhilePatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null),this._cachedCompiledWhilePatterns&&(this._cachedCompiledWhilePatterns.dispose(),this._cachedCompiledWhilePatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugWhileRegExp(){return`${this._while.source}`}getWhileWithResolvedBackReferences(e,n){return this._while.resolveBackReferences(e,n)}collectPatterns(e,n){n.push(this._begin)}compile(e,n){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,n,r,i){return this._getCachedCompiledPatterns(e).compileAG(e,r,i)}_getCachedCompiledPatterns(e){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new rf;for(const n of this.patterns)e.getRule(n).collectPatterns(e,this._cachedCompiledPatterns)}return this._cachedCompiledPatterns}compileWhile(e,n){return this._getCachedCompiledWhilePatterns(e,n).compile(e)}compileWhileAG(e,n,r,i){return this._getCachedCompiledWhilePatterns(e,n).compileAG(e,r,i)}_getCachedCompiledWhilePatterns(e,n){return this._cachedCompiledWhilePatterns||(this._cachedCompiledWhilePatterns=new rf,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,n||"￿"),this._cachedCompiledWhilePatterns}},UO=class Dn{static createCaptureRule(e,n,r,i,s){return e.registerRule(o=>new TG(n,o,r,i,s))}static getCompiledRuleId(e,n,r){return e.id||n.registerRule(i=>{if(e.id=i,e.match)return new IG(e.$vscodeTextmateLocation,e.id,e.name,e.match,Dn._compileCaptures(e.captures,n,r));if(typeof e.begin>"u"){e.repository&&(r=PO({},r,e.repository));let s=e.patterns;return typeof s>"u"&&e.include&&(s=[{include:e.include}]),new Cw(e.$vscodeTextmateLocation,e.id,e.name,e.contentName,Dn._compilePatterns(s,n,r))}return e.while?new Yp(e.$vscodeTextmateLocation,e.id,e.name,e.contentName,e.begin,Dn._compileCaptures(e.beginCaptures||e.captures,n,r),e.while,Dn._compileCaptures(e.whileCaptures||e.captures,n,r),Dn._compilePatterns(e.patterns,n,r)):new ty(e.$vscodeTextmateLocation,e.id,e.name,e.contentName,e.begin,Dn._compileCaptures(e.beginCaptures||e.captures,n,r),e.end,Dn._compileCaptures(e.endCaptures||e.captures,n,r),e.applyEndPatternLast,Dn._compilePatterns(e.patterns,n,r))}),e.id}static _compileCaptures(e,n,r){let i=[];if(e){let s=0;for(const o in e){if(o==="$vscodeTextmateLocation")continue;const a=parseInt(o,10);a>s&&(s=a)}for(let o=0;o<=s;o++)i[o]=null;for(const o in e){if(o==="$vscodeTextmateLocation")continue;const a=parseInt(o,10);let l=0;e[o].patterns&&(l=Dn.getCompiledRuleId(e[o],n,r)),i[a]=Dn.createCaptureRule(n,e[o].$vscodeTextmateLocation,e[o].name,e[o].contentName,l)}}return i}static _compilePatterns(e,n,r){let i=[];if(e)for(let s=0,o=e.length;se.substring(i.start,i.end));return _w.lastIndex=0,this.source.replace(_w,(i,s)=>FO(r[parseInt(s,10)]||""))}_buildAnchorCache(){if(typeof this.source!="string")throw new Error("This method should only be called if the source is a string");let e=[],n=[],r=[],i=[],s,o,a,l;for(s=0,o=this.source.length;sn.source);this._cached=new Aw(t,e,this._items.map(n=>n.ruleId))}return this._cached}compileAG(t,e,n){return this._hasAnchors?e?n?(this._anchorCache.A1_G1||(this._anchorCache.A1_G1=this._resolveAnchors(t,e,n)),this._anchorCache.A1_G1):(this._anchorCache.A1_G0||(this._anchorCache.A1_G0=this._resolveAnchors(t,e,n)),this._anchorCache.A1_G0):n?(this._anchorCache.A0_G1||(this._anchorCache.A0_G1=this._resolveAnchors(t,e,n)),this._anchorCache.A0_G1):(this._anchorCache.A0_G0||(this._anchorCache.A0_G0=this._resolveAnchors(t,e,n)),this._anchorCache.A0_G0):this.compile(t)}_resolveAnchors(t,e,n){let r=this._items.map(i=>i.resolveAnchors(e,n));return new Aw(t,r,this._items.map(i=>i.ruleId))}},Aw=class{constructor(t,e,n){X(this,"scanner");this.regExps=e,this.rules=n,this.scanner=t.createOnigScanner(e)}dispose(){typeof this.scanner.dispose=="function"&&this.scanner.dispose()}toString(){const t=[];for(let e=0,n=this.rules.length;e{const n=this._scopeToLanguage(e),r=this._toStandardTokenType(e);return new Qg(n,r)}));this._defaultAttributes=new Qg(e,8),this._embeddedLanguagesMatcher=new RG(Object.entries(n||{}))}getDefaultAttributes(){return this._defaultAttributes}getBasicScopeAttributes(e){return e===null?ds._NULL_SCOPE_METADATA:this._getBasicScopeAttributes.get(e)}_scopeToLanguage(e){return this._embeddedLanguagesMatcher.match(e)||0}_toStandardTokenType(e){const n=e.match(ds.STANDARD_TOKEN_TYPE_REGEXP);if(!n)return 8;switch(n[1]){case"comment":return 1;case"string":return 2;case"regex":return 3;case"meta.embedded":return 0}throw new Error("Unexpected match for standard token type!")}},X(ds,"_NULL_SCOPE_METADATA",new Qg(0,0)),X(ds,"STANDARD_TOKEN_TYPE_REGEXP",/\b(comment|string|regex|meta\.embedded)\b/),ds),RG=class{constructor(t){X(this,"values");X(this,"scopesRegExp");if(t.length===0)this.values=null,this.scopesRegExp=null;else{this.values=new Map(t);const e=t.map(([n,r])=>FO(n));e.sort(),e.reverse(),this.scopesRegExp=new RegExp(`^((${e.join(")|(")}))($|\\.)`,"")}}match(t){if(!this.scopesRegExp)return;const e=t.match(this.scopesRegExp);if(e)return this.values.get(e[1])}},Dw=class{constructor(t,e){this.stack=t,this.stoppedEarly=e}};function qO(t,e,n,r,i,s,o,a){const l=e.content.length;let u=!1,c=-1;if(o){const h=NG(t,e,n,r,i,s);i=h.stack,r=h.linePos,n=h.isFirstLine,c=h.anchorPosition}const f=Date.now();for(;!u;){if(a!==0&&Date.now()-f>a)return new Dw(i,!0);d()}return new Dw(i,!1);function d(){const h=MG(t,e,n,r,i,c);if(!h){s.produce(i,l),u=!0;return}const p=h.captureIndices,m=h.matchedRuleId,g=p&&p.length>0?p[0].end>r:!1;if(m===OG){const b=i.getRule(t);s.produce(i,p[0].start),i=i.withContentNameScopesList(i.nameScopesList),Ju(t,e,n,i,s,b.endCaptures,p),s.produce(i,p[0].end);const y=i;if(i=i.parent,c=y.getAnchorPos(),!g&&y.getEnterPos()===r){i=y,s.produce(i,l),u=!0;return}}else{const b=t.getRule(m);s.produce(i,p[0].start);const y=i,x=b.getName(e.content,p),S=i.contentNameScopesList.pushAttributed(x,t);if(i=i.push(m,r,c,p[0].end===l,null,S,S),b instanceof ty){const E=b;Ju(t,e,n,i,s,E.beginCaptures,p),s.produce(i,p[0].end),c=p[0].end;const C=E.getContentName(e.content,p),w=S.pushAttributed(C,t);if(i=i.withContentNameScopesList(w),E.endHasBackReferences&&(i=i.withEndRule(E.getEndWithResolvedBackReferences(e.content,p))),!g&&y.hasSameRuleAs(i)){i=i.pop(),s.produce(i,l),u=!0;return}}else if(b instanceof Yp){const E=b;Ju(t,e,n,i,s,E.beginCaptures,p),s.produce(i,p[0].end),c=p[0].end;const C=E.getContentName(e.content,p),w=S.pushAttributed(C,t);if(i=i.withContentNameScopesList(w),E.whileHasBackReferences&&(i=i.withEndRule(E.getWhileWithResolvedBackReferences(e.content,p))),!g&&y.hasSameRuleAs(i)){i=i.pop(),s.produce(i,l),u=!0;return}}else if(Ju(t,e,n,i,s,b.captures,p),s.produce(i,p[0].end),i=i.pop(),!g){i=i.safePop(),s.produce(i,l),u=!0;return}}p[0].end>r&&(r=p[0].end,n=!1)}}function NG(t,e,n,r,i,s){let o=i.beginRuleCapturedEOL?0:-1;const a=[];for(let l=i;l;l=l.pop()){const u=l.getRule(t);u instanceof Yp&&a.push({rule:u,stack:l})}for(let l=a.pop();l;l=a.pop()){const{ruleScanner:u,findOptions:c}=BG(l.rule,t,l.stack.endRule,n,r===o),f=u.findNextMatchSync(e,r,c);if(f){if(f.ruleId!==VO){i=l.stack.pop();break}f.captureIndices&&f.captureIndices.length&&(s.produce(l.stack,f.captureIndices[0].start),Ju(t,e,n,l.stack,s,l.rule.whileCaptures,f.captureIndices),s.produce(l.stack,f.captureIndices[0].end),o=f.captureIndices[0].end,f.captureIndices[0].end>r&&(r=f.captureIndices[0].end,n=!1))}else{i=l.stack.pop();break}}return{stack:i,linePos:r,anchorPosition:o,isFirstLine:n}}function MG(t,e,n,r,i,s){const o=FG(t,e,n,r,i,s),a=t.getInjections();if(a.length===0)return o;const l=LG(a,t,e,n,r,i,s);if(!l)return o;if(!o)return l;const u=o.captureIndices[0].start,c=l.captureIndices[0].start;return c=a)&&(a=x,l=y.captureIndices,u=y.ruleId,c=p.priority,a===i))break}return l?{priorityMatch:c===-1,captureIndices:l,matchedRuleId:u}:null}function GO(t,e,n,r,i){return{ruleScanner:t.compileAG(e,n,r,i),findOptions:0}}function BG(t,e,n,r,i){return{ruleScanner:t.compileWhileAG(e,n,r,i),findOptions:0}}function Ju(t,e,n,r,i,s,o){if(s.length===0)return;const a=e.content,l=Math.min(s.length,o.length),u=[],c=o[0].end;for(let f=0;fc)break;for(;u.length>0&&u[u.length-1].endPos<=h.start;)i.produceFromScopes(u[u.length-1].scopes,u[u.length-1].endPos),u.pop();if(u.length>0?i.produceFromScopes(u[u.length-1].scopes,h.start):i.produce(r,h.start),d.retokenizeCapturedWithRuleId){const m=d.getName(a,o),g=r.contentNameScopesList.pushAttributed(m,t),b=d.getContentName(a,o),y=g.pushAttributed(b,t),x=r.push(d.retokenizeCapturedWithRuleId,h.start,-1,!1,null,g,y),S=t.createOnigString(a.substring(0,h.end));qO(t,S,n&&h.start===0,h.start,x,i,!1,0),zO(S);continue}const p=d.getName(a,o);if(p!==null){const g=(u.length>0?u[u.length-1].scopes:r.contentNameScopesList).pushAttributed(p,t);u.push(new $G(g,h.end))}}for(;u.length>0;)i.produceFromScopes(u[u.length-1].scopes,u[u.length-1].endPos),u.pop()}var $G=class{constructor(t,e){X(this,"scopes");X(this,"endPos");this.scopes=t,this.endPos=e}};function zG(t,e,n,r,i,s,o,a){return new VG(t,e,n,r,i,s,o,a)}function kw(t,e,n,r,i){const s=Kp(e,Jp),o=UO.getCompiledRuleId(n,r,i.repository);for(const a of s)t.push({debugSelector:e,matcher:a.matcher,ruleId:o,grammar:i,priority:a.priority})}function Jp(t,e){if(e.length{for(let i=n;in&&t.substr(0,n)===e&&t[n]==="."}var VG=class{constructor(t,e,n,r,i,s,o,a){X(this,"_rootId");X(this,"_lastRuleId");X(this,"_ruleId2desc");X(this,"_includedGrammars");X(this,"_grammarRepository");X(this,"_grammar");X(this,"_injections");X(this,"_basicScopeAttributesProvider");X(this,"_tokenTypeMatchers");if(this._rootScopeName=t,this.balancedBracketSelectors=s,this._onigLib=a,this._basicScopeAttributesProvider=new PG(n,r),this._rootId=-1,this._lastRuleId=0,this._ruleId2desc=[null],this._includedGrammars={},this._grammarRepository=o,this._grammar=Ow(e,null),this._injections=null,this._tokenTypeMatchers=[],i)for(const l of Object.keys(i)){const u=Kp(l,Jp);for(const c of u)this._tokenTypeMatchers.push({matcher:c.matcher,type:i[l]})}}get themeProvider(){return this._grammarRepository}dispose(){for(const t of this._ruleId2desc)t&&t.dispose()}createOnigScanner(t){return this._onigLib.createOnigScanner(t)}createOnigString(t){return this._onigLib.createOnigString(t)}getMetadataForScope(t){return this._basicScopeAttributesProvider.getBasicScopeAttributes(t)}_collectInjections(){const t={lookup:i=>i===this._rootScopeName?this._grammar:this.getExternalGrammar(i),injections:i=>this._grammarRepository.injections(i)},e=[],n=this._rootScopeName,r=t.lookup(n);if(r){const i=r.injections;if(i)for(let o in i)kw(e,o,i[o],this,r);const s=this._grammarRepository.injections(n);s&&s.forEach(o=>{const a=this.getExternalGrammar(o);if(a){const l=a.injectionSelector;l&&kw(e,l,a,this,a)}})}return e.sort((i,s)=>i.priority-s.priority),e}getInjections(){return this._injections===null&&(this._injections=this._collectInjections()),this._injections}registerRule(t){const e=++this._lastRuleId,n=t(e);return this._ruleId2desc[e]=n,n}getRule(t){return this._ruleId2desc[t]}getExternalGrammar(t,e){if(this._includedGrammars[t])return this._includedGrammars[t];if(this._grammarRepository){const n=this._grammarRepository.lookup(t);if(n)return this._includedGrammars[t]=Ow(n,e&&e.$base),this._includedGrammars[t]}}tokenizeLine(t,e,n=0){const r=this._tokenize(t,e,!1,n);return{tokens:r.lineTokens.getResult(r.ruleStack,r.lineLength),ruleStack:r.ruleStack,stoppedEarly:r.stoppedEarly}}tokenizeLine2(t,e,n=0){const r=this._tokenize(t,e,!0,n);return{tokens:r.lineTokens.getBinaryResult(r.ruleStack,r.lineLength),ruleStack:r.ruleStack,stoppedEarly:r.stoppedEarly}}_tokenize(t,e,n,r){this._rootId===-1&&(this._rootId=UO.getCompiledRuleId(this._grammar.repository.$self,this,this._grammar.repository),this.getInjections());let i;if(!e||e===ny.NULL){i=!0;const u=this._basicScopeAttributesProvider.getDefaultAttributes(),c=this.themeProvider.getDefaults(),f=Ll.set(0,u.languageId,u.tokenType,null,c.fontStyle,c.foregroundId,c.backgroundId),d=this.getRule(this._rootId).getName(null,null);let h;d?h=mc.createRootAndLookUpScopeName(d,f,this):h=mc.createRoot("unknown",f),e=new ny(null,this._rootId,-1,-1,!1,null,h,h)}else i=!1,e.reset();t=t+` +`;const s=this.createOnigString(t),o=s.content.length,a=new HG(n,t,this._tokenTypeMatchers,this.balancedBracketSelectors),l=qO(this,s,i,0,e,a,!0,r);return zO(s),{lineLength:o,lineTokens:a,ruleStack:l.stack,stoppedEarly:l.stoppedEarly}}};function Ow(t,e){return t=aG(t),t.repository=t.repository||{},t.repository.$self={$vscodeTextmateLocation:t.$vscodeTextmateLocation,patterns:t.patterns,name:t.scopeName},t.repository.$base=e||t.repository.$self,t}var mc=class _i{constructor(e,n,r){this.parent=e,this.scopePath=n,this.tokenAttributes=r}static fromExtension(e,n){let r=e,i=(e==null?void 0:e.scopePath)??null;for(const s of n)i=Zg.push(i,s.scopeNames),r=new _i(r,i,s.encodedTokenAttributes);return r}static createRoot(e,n){return new _i(null,new Zg(null,e),n)}static createRootAndLookUpScopeName(e,n,r){const i=r.getMetadataForScope(e),s=new Zg(null,e),o=r.themeProvider.themeMatch(s),a=_i.mergeAttributes(n,i,o);return new _i(null,s,a)}get scopeName(){return this.scopePath.scopeName}toString(){return this.getScopeNames().join(" ")}equals(e){return _i.equals(this,e)}static equals(e,n){do{if(e===n||!e&&!n)return!0;if(!e||!n||e.scopeName!==n.scopeName||e.tokenAttributes!==n.tokenAttributes)return!1;e=e.parent,n=n.parent}while(!0)}static mergeAttributes(e,n,r){let i=-1,s=0,o=0;return r!==null&&(i=r.fontStyle,s=r.foregroundId,o=r.backgroundId),Ll.set(e,n.languageId,n.tokenType,null,i,s,o)}pushAttributed(e,n){if(e===null)return this;if(e.indexOf(" ")===-1)return _i._pushAttributed(this,e,n);const r=e.split(/ /g);let i=this;for(const s of r)i=_i._pushAttributed(i,s,n);return i}static _pushAttributed(e,n,r){const i=r.getMetadataForScope(n),s=e.scopePath.push(n),o=r.themeProvider.themeMatch(s),a=_i.mergeAttributes(e.tokenAttributes,i,o);return new _i(e,s,a)}getScopeNames(){return this.scopePath.getSegments()}getExtensionIfDefined(e){var i;const n=[];let r=this;for(;r&&r!==e;)n.push({encodedTokenAttributes:r.tokenAttributes,scopeNames:r.scopePath.getExtensionIfDefined(((i=r.parent)==null?void 0:i.scopePath)??null)}),r=r.parent;return r===e?n.reverse():void 0}},Lr,ny=(Lr=class{constructor(e,n,r,i,s,o,a,l){X(this,"_stackElementBrand");X(this,"_enterPos");X(this,"_anchorPos");X(this,"depth");this.parent=e,this.ruleId=n,this.beginRuleCapturedEOL=s,this.endRule=o,this.nameScopesList=a,this.contentNameScopesList=l,this.depth=this.parent?this.parent.depth+1:1,this._enterPos=r,this._anchorPos=i}equals(e){return e===null?!1:Lr._equals(this,e)}static _equals(e,n){return e===n?!0:this._structuralEquals(e,n)?mc.equals(e.contentNameScopesList,n.contentNameScopesList):!1}static _structuralEquals(e,n){do{if(e===n||!e&&!n)return!0;if(!e||!n||e.depth!==n.depth||e.ruleId!==n.ruleId||e.endRule!==n.endRule)return!1;e=e.parent,n=n.parent}while(!0)}clone(){return this}static _reset(e){for(;e;)e._enterPos=-1,e._anchorPos=-1,e=e.parent}reset(){Lr._reset(this)}pop(){return this.parent}safePop(){return this.parent?this.parent:this}push(e,n,r,i,s,o,a){return new Lr(this,e,n,r,i,s,o,a)}getEnterPos(){return this._enterPos}getAnchorPos(){return this._anchorPos}getRule(e){return e.getRule(this.ruleId)}toString(){const e=[];return this._writeString(e,0),"["+e.join(",")+"]"}_writeString(e,n){var r,i;return this.parent&&(n=this.parent._writeString(e,n)),e[n++]=`(${this.ruleId}, ${(r=this.nameScopesList)==null?void 0:r.toString()}, ${(i=this.contentNameScopesList)==null?void 0:i.toString()})`,n}withContentNameScopesList(e){return this.contentNameScopesList===e?this:this.parent.push(this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,this.endRule,this.nameScopesList,e)}withEndRule(e){return this.endRule===e?this:new Lr(this.parent,this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,e,this.nameScopesList,this.contentNameScopesList)}hasSameRuleAs(e){let n=this;for(;n&&n._enterPos===e._enterPos;){if(n.ruleId===e.ruleId)return!0;n=n.parent}return!1}toStateStackFrame(){var e,n,r;return{ruleId:this.ruleId,beginRuleCapturedEOL:this.beginRuleCapturedEOL,endRule:this.endRule,nameScopesList:((n=this.nameScopesList)==null?void 0:n.getExtensionIfDefined(((e=this.parent)==null?void 0:e.nameScopesList)??null))??[],contentNameScopesList:((r=this.contentNameScopesList)==null?void 0:r.getExtensionIfDefined(this.nameScopesList))??[]}}static pushFrame(e,n){const r=mc.fromExtension((e==null?void 0:e.nameScopesList)??null,n.nameScopesList);return new Lr(e,n.ruleId,n.enterPos??-1,n.anchorPos??-1,n.beginRuleCapturedEOL,n.endRule,r,mc.fromExtension(r,n.contentNameScopesList))}},X(Lr,"NULL",new Lr(null,0,0,0,!1,null,null,null)),Lr),UG=class{constructor(t,e){X(this,"balancedBracketScopes");X(this,"unbalancedBracketScopes");X(this,"allowAny",!1);this.balancedBracketScopes=t.flatMap(n=>n==="*"?(this.allowAny=!0,[]):Kp(n,Jp).map(r=>r.matcher)),this.unbalancedBracketScopes=e.flatMap(n=>Kp(n,Jp).map(r=>r.matcher))}get matchesAlways(){return this.allowAny&&this.unbalancedBracketScopes.length===0}get matchesNever(){return this.balancedBracketScopes.length===0&&!this.allowAny}match(t){for(const e of this.unbalancedBracketScopes)if(e(t))return!1;for(const e of this.balancedBracketScopes)if(e(t))return!0;return this.allowAny}},HG=class{constructor(t,e,n,r){X(this,"_emitBinaryTokens");X(this,"_lineText");X(this,"_tokens");X(this,"_binaryTokens");X(this,"_lastTokenEndIndex");X(this,"_tokenTypeOverrides");this.balancedBracketSelectors=r,this._emitBinaryTokens=t,this._tokenTypeOverrides=n,this._lineText=null,this._tokens=[],this._binaryTokens=[],this._lastTokenEndIndex=0}produce(t,e){this.produceFromScopes(t.contentNameScopesList,e)}produceFromScopes(t,e){var r;if(this._lastTokenEndIndex>=e)return;if(this._emitBinaryTokens){let i=(t==null?void 0:t.tokenAttributes)??0,s=!1;if((r=this.balancedBracketSelectors)!=null&&r.matchesAlways&&(s=!0),this._tokenTypeOverrides.length>0||this.balancedBracketSelectors&&!this.balancedBracketSelectors.matchesAlways&&!this.balancedBracketSelectors.matchesNever){const o=(t==null?void 0:t.getScopeNames())??[];for(const a of this._tokenTypeOverrides)a.matcher(o)&&(i=Ll.set(i,0,a.type,null,-1,0,0));this.balancedBracketSelectors&&(s=this.balancedBracketSelectors.match(o))}if(s&&(i=Ll.set(i,0,8,s,-1,0,0)),this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-1]===i){this._lastTokenEndIndex=e;return}this._binaryTokens.push(this._lastTokenEndIndex),this._binaryTokens.push(i),this._lastTokenEndIndex=e;return}const n=(t==null?void 0:t.getScopeNames())??[];this._tokens.push({startIndex:this._lastTokenEndIndex,endIndex:e,scopes:n}),this._lastTokenEndIndex=e}getResult(t,e){return this._tokens.length>0&&this._tokens[this._tokens.length-1].startIndex===e-1&&this._tokens.pop(),this._tokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(t,e),this._tokens[this._tokens.length-1].startIndex=0),this._tokens}getBinaryResult(t,e){this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-2]===e-1&&(this._binaryTokens.pop(),this._binaryTokens.pop()),this._binaryTokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(t,e),this._binaryTokens[this._binaryTokens.length-2]=0);const n=new Uint32Array(this._binaryTokens.length);for(let r=0,i=this._binaryTokens.length;r0;)o.Q.map(a=>this._loadSingleGrammar(a.scopeName)),o.processQueue();return this._grammarForScopeName(e,n,r,i,s)}_loadSingleGrammar(e){this._ensureGrammarCache.has(e)||(this._doLoadSingleGrammar(e),this._ensureGrammarCache.set(e,!0))}_doLoadSingleGrammar(e){const n=this._options.loadGrammar(e);if(n){const r=typeof this._options.getInjections=="function"?this._options.getInjections(e):void 0;this._syncRegistry.addGrammar(n,r)}}addGrammar(e,n=[],r=0,i=null){return this._syncRegistry.addGrammar(e,n),this._grammarForScopeName(e.scopeName,r,i)}_grammarForScopeName(e,n=0,r=null,i=null,s=null){return this._syncRegistry.grammarForScopeName(e,n,r,i,s)}},ry=ny.NULL;const WG=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"];let Xf=class{constructor(e,n,r){this.normal=n,this.property=e,r&&(this.space=r)}};Xf.prototype.normal={};Xf.prototype.property={};Xf.prototype.space=void 0;function WO(t,e){const n={},r={};for(const i of t)Object.assign(n,i.property),Object.assign(r,i.normal);return new Xf(n,r,e)}function iy(t){return t.toLowerCase()}class hr{constructor(e,n){this.attribute=n,this.property=e}}hr.prototype.attribute="";hr.prototype.booleanish=!1;hr.prototype.boolean=!1;hr.prototype.commaOrSpaceSeparated=!1;hr.prototype.commaSeparated=!1;hr.prototype.defined=!1;hr.prototype.mustUseProperty=!1;hr.prototype.number=!1;hr.prototype.overloadedBoolean=!1;hr.prototype.property="";hr.prototype.spaceSeparated=!1;hr.prototype.space=void 0;let KG=0;const Be=Ia(),Yt=Ia(),sy=Ia(),re=Ia(),pt=Ia(),gl=Ia(),gr=Ia();function Ia(){return 2**++KG}const oy=Object.freeze(Object.defineProperty({__proto__:null,boolean:Be,booleanish:Yt,commaOrSpaceSeparated:gr,commaSeparated:gl,number:re,overloadedBoolean:sy,spaceSeparated:pt},Symbol.toStringTag,{value:"Module"})),e1=Object.keys(oy);class a2 extends hr{constructor(e,n,r,i){let s=-1;if(super(e,n),Tw(this,"space",i),typeof r=="number")for(;++s4&&n.slice(0,4)==="data"&&ZG.test(e)){if(e.charAt(4)==="-"){const s=e.slice(5).replace(Iw,tW);r="data"+s.charAt(0).toUpperCase()+s.slice(1)}else{const s=e.slice(4);if(!Iw.test(s)){let o=s.replace(JG,eW);o.charAt(0)!=="-"&&(o="-"+o),e="data"+o}}i=a2}return new i(r,e)}function eW(t){return"-"+t.toLowerCase()}function tW(t){return t.charAt(1).toUpperCase()}const nW=WO([KO,XG,JO,ZO,QO],"html"),e6=WO([KO,YG,JO,ZO,QO],"svg"),Pw={}.hasOwnProperty;function rW(t,e){const n=e||{};function r(i,...s){let o=r.invalid;const a=r.handlers;if(i&&Pw.call(i,t)){const l=String(i[t]);o=Pw.call(a,l)?a[l]:r.unknown}if(o)return o.call(this,i,...s)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}const iW=/["&'<>`]/g,sW=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,oW=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,aW=/[|\\{}()[\]^$+*?.]/g,Rw=new WeakMap;function lW(t,e){if(t=t.replace(e.subset?uW(e.subset):iW,r),e.subset||e.escapeOnly)return t;return t.replace(sW,n).replace(oW,r);function n(i,s,o){return e.format((i.charCodeAt(0)-55296)*1024+i.charCodeAt(1)-56320+65536,o.charCodeAt(s+2),e)}function r(i,s,o){return e.format(i.charCodeAt(0),o.charCodeAt(s+1),e)}}function uW(t){let e=Rw.get(t);return e||(e=cW(t),Rw.set(t,e)),e}function cW(t){const e=[];let n=-1;for(;++n",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",circ:"ˆ",tilde:"˜",ensp:" ",emsp:" ",thinsp:" ",zwnj:"‌",zwj:"‍",lrm:"‎",rlm:"‏",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",permil:"‰",lsaquo:"‹",rsaquo:"›",euro:"€"},gW=["cent","copy","divide","gt","lt","not","para","times"],t6={}.hasOwnProperty,ay={};let Yd;for(Yd in t1)t6.call(t1,Yd)&&(ay[t1[Yd]]=Yd);const bW=/[^\dA-Za-z]/;function yW(t,e,n,r){const i=String.fromCharCode(t);if(t6.call(ay,i)){const s=ay[i],o="&"+s;return n&&mW.includes(s)&&!gW.includes(s)&&(!r||e&&e!==61&&bW.test(String.fromCharCode(e)))?o:o+";"}return""}function vW(t,e,n){let r=dW(t,e,n.omitOptionalSemicolons),i;if((n.useNamedReferences||n.useShortestReferences)&&(i=yW(t,e,n.omitOptionalSemicolons,n.attribute)),(n.useShortestReferences||!i)&&n.useShortestReferences){const s=pW(t,e,n.omitOptionalSemicolons);s.length|^->||--!>|"],EW=["<",">"];function wW(t,e,n,r){return r.settings.bogusComments?"":"";function i(s){return bl(s,Object.assign({},r.settings.characterReferences,{subset:EW}))}}function _W(t,e,n,r){return""}function Nw(t,e){const n=String(t);if(typeof e!="string")throw new TypeError("Expected character");let r=0,i=n.indexOf(e);for(;i!==-1;)r++,i=n.indexOf(e,i+e.length);return r}function CW(t,e){const n=e||{};return(t[t.length-1]===""?[...t,""]:t).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}function AW(t){return t.join(" ").trim()}const DW=/[ \t\n\f\r]/g;function l2(t){return typeof t=="object"?t.type==="text"?Mw(t.value):!1:Mw(t)}function Mw(t){return t.replace(DW,"")===""}const an=r6(1),n6=r6(-1),kW=[];function r6(t){return e;function e(n,r,i){const s=n?n.children:kW;let o=(r||0)+t,a=s[o];if(!i)for(;a&&l2(a);)o+=t,a=s[o];return a}}const OW={}.hasOwnProperty;function i6(t){return e;function e(n,r,i){return OW.call(t,n.tagName)&&t[n.tagName](n,r,i)}}const u2=i6({body:IW,caption:n1,colgroup:n1,dd:MW,dt:NW,head:n1,html:TW,li:RW,optgroup:FW,option:LW,p:PW,rp:Fw,rt:Fw,tbody:$W,td:Lw,tfoot:zW,th:Lw,thead:BW,tr:jW});function n1(t,e,n){const r=an(n,e,!0);return!r||r.type!=="comment"&&!(r.type==="text"&&l2(r.value.charAt(0)))}function TW(t,e,n){const r=an(n,e);return!r||r.type!=="comment"}function IW(t,e,n){const r=an(n,e);return!r||r.type!=="comment"}function PW(t,e,n){const r=an(n,e);return r?r.type==="element"&&(r.tagName==="address"||r.tagName==="article"||r.tagName==="aside"||r.tagName==="blockquote"||r.tagName==="details"||r.tagName==="div"||r.tagName==="dl"||r.tagName==="fieldset"||r.tagName==="figcaption"||r.tagName==="figure"||r.tagName==="footer"||r.tagName==="form"||r.tagName==="h1"||r.tagName==="h2"||r.tagName==="h3"||r.tagName==="h4"||r.tagName==="h5"||r.tagName==="h6"||r.tagName==="header"||r.tagName==="hgroup"||r.tagName==="hr"||r.tagName==="main"||r.tagName==="menu"||r.tagName==="nav"||r.tagName==="ol"||r.tagName==="p"||r.tagName==="pre"||r.tagName==="section"||r.tagName==="table"||r.tagName==="ul"):!n||!(n.type==="element"&&(n.tagName==="a"||n.tagName==="audio"||n.tagName==="del"||n.tagName==="ins"||n.tagName==="map"||n.tagName==="noscript"||n.tagName==="video"))}function RW(t,e,n){const r=an(n,e);return!r||r.type==="element"&&r.tagName==="li"}function NW(t,e,n){const r=an(n,e);return!!(r&&r.type==="element"&&(r.tagName==="dt"||r.tagName==="dd"))}function MW(t,e,n){const r=an(n,e);return!r||r.type==="element"&&(r.tagName==="dt"||r.tagName==="dd")}function Fw(t,e,n){const r=an(n,e);return!r||r.type==="element"&&(r.tagName==="rp"||r.tagName==="rt")}function FW(t,e,n){const r=an(n,e);return!r||r.type==="element"&&r.tagName==="optgroup"}function LW(t,e,n){const r=an(n,e);return!r||r.type==="element"&&(r.tagName==="option"||r.tagName==="optgroup")}function BW(t,e,n){const r=an(n,e);return!!(r&&r.type==="element"&&(r.tagName==="tbody"||r.tagName==="tfoot"))}function $W(t,e,n){const r=an(n,e);return!r||r.type==="element"&&(r.tagName==="tbody"||r.tagName==="tfoot")}function zW(t,e,n){return!an(n,e)}function jW(t,e,n){const r=an(n,e);return!r||r.type==="element"&&r.tagName==="tr"}function Lw(t,e,n){const r=an(n,e);return!r||r.type==="element"&&(r.tagName==="td"||r.tagName==="th")}const VW=i6({body:qW,colgroup:GW,head:HW,html:UW,tbody:WW});function UW(t){const e=an(t,-1);return!e||e.type!=="comment"}function HW(t){const e=new Set;for(const r of t.children)if(r.type==="element"&&(r.tagName==="base"||r.tagName==="title")){if(e.has(r.tagName))return!1;e.add(r.tagName)}const n=t.children[0];return!n||n.type==="element"}function qW(t){const e=an(t,-1,!0);return!e||e.type!=="comment"&&!(e.type==="text"&&l2(e.value.charAt(0)))&&!(e.type==="element"&&(e.tagName==="meta"||e.tagName==="link"||e.tagName==="script"||e.tagName==="style"||e.tagName==="template"))}function GW(t,e,n){const r=n6(n,e),i=an(t,-1,!0);return n&&r&&r.type==="element"&&r.tagName==="colgroup"&&u2(r,n.children.indexOf(r),n)?!1:!!(i&&i.type==="element"&&i.tagName==="col")}function WW(t,e,n){const r=n6(n,e),i=an(t,-1);return n&&r&&r.type==="element"&&(r.tagName==="thead"||r.tagName==="tbody")&&u2(r,n.children.indexOf(r),n)?!1:!!(i&&i.type==="element"&&i.tagName==="tr")}const Jd={name:[[` \f\r &/=>`.split(""),` \f\r "&'/=>\``.split("")],[`\0 \f\r "&'/<=>`.split(""),`\0 @@ -248,90 +248,90 @@ S ::= [ ]* \f\r &>`.split(""),`\0 \f\r "&'<=>\``.split("")],[`\0 \f\r "&'<=>\``.split(""),`\0 -\f\r "&'<=>\``.split("")]],single:[["&'".split(""),"\"&'`".split("")],["\0&'".split(""),"\0\"&'`".split("")]],double:[['"&'.split(""),"\"&'`".split("")],['\0"&'.split(""),"\0\"&'`".split("")]]};function GW(t,e,n,r){const i=r.schema,s=i.space==="svg"?!1:r.settings.omitOptionalTags;let o=i.space==="svg"?r.settings.closeEmptyElements:r.settings.voids.includes(t.tagName.toLowerCase());const a=[];let l;i.space==="html"&&t.tagName==="svg"&&(r.schema=QO);const u=WW(r,t.properties),c=r.all(i.space==="html"&&t.tagName==="template"?t.content:t);return r.schema=i,c&&(o=!1),(u||!s||!zW(t,e,n))&&(a.push("<",t.tagName,u?" "+u:""),o&&(i.space==="svg"||r.settings.closeSelfClosing)&&(l=u.charAt(u.length-1),(!r.settings.tightSelfClosing||l==="/"||l&&l!=='"'&&l!=="'")&&a.push(" "),a.push("/")),a.push(">")),a.push(c),!o&&(!s||!l2(t,e,n))&&a.push(""),a.join("")}function WW(t,e){const n=[];let r=-1,i;if(e){for(i in e)if(e[i]!==null&&e[i]!==void 0){const s=KW(t,i,e[i]);s&&n.push(s)}}for(;++rRw(n,t.alternative)&&(o=t.alternative),a=o+bl(n,Object.assign({},t.settings.characterReferences,{subset:(o==="'"?Yd.single:Yd.double)[i][s],attribute:!0}))+o),l+(a&&"="+a))}const XW=["<","&"];function i6(t,e,n,r){return n&&n.type==="element"&&(n.tagName==="script"||n.tagName==="style")?t.value:bl(t.value,Object.assign({},r.settings.characterReferences,{subset:XW}))}function YW(t,e,n,r){return r.settings.allowDangerousHtml?t.value:i6(t,e,n,r)}function JW(t,e,n,r){return r.all(t)}const ZW=tW("type",{invalid:QW,unknown:eK,handlers:{comment:SW,doctype:EW,element:GW,raw:YW,root:JW,text:i6}});function QW(t){throw new Error("Expected node, not `"+t+"`")}function eK(t){const e=t;throw new Error("Cannot compile unknown node `"+e.type+"`")}const tK={},nK={},rK=[];function iK(t,e){const n=tK,r=n.quote||'"',i=r==='"'?"'":'"';if(r!=='"'&&r!=="'")throw new Error("Invalid quote `"+r+"`, expected `'` or `\"`");return{one:sK,all:oK,settings:{omitOptionalTags:n.omitOptionalTags||!1,allowParseErrors:n.allowParseErrors||!1,allowDangerousCharacters:n.allowDangerousCharacters||!1,quoteSmart:n.quoteSmart||!1,preferUnquoted:n.preferUnquoted||!1,tightAttributes:n.tightAttributes||!1,upperDoctype:n.upperDoctype||!1,tightDoctype:n.tightDoctype||!1,bogusComments:n.bogusComments||!1,tightCommaSeparatedLists:n.tightCommaSeparatedLists||!1,tightSelfClosing:n.tightSelfClosing||!1,collapseEmptyAttributes:n.collapseEmptyAttributes||!1,allowDangerousHtml:n.allowDangerousHtml||!1,voids:n.voids||qG,characterReferences:n.characterReferences||nK,closeSelfClosing:n.closeSelfClosing||!1,closeEmptyElements:n.closeEmptyElements||!1},schema:n.space==="svg"?QO:eW,quote:r,alternative:i}.one(Array.isArray(t)?{type:"root",children:t}:t,void 0,void 0)}function sK(t,e,n){return ZW(t,e,n,this)}function oK(t){const e=[],n=t&&t.children||rK;let r=-1;for(;++rn&&r.push({...t,content:t.content.slice(n,i),offset:t.offset+n}),n=i;return nr-i);return n.length?t.map(r=>r.flatMap(i=>{const s=n.filter(o=>i.offseto-i.offset).sort((o,a)=>o-a);return s.length?cK(i,s):i})):t}async function o6(t){return Promise.resolve(typeof t=="function"?t():t).then(e=>e.default||e)}function Jp(t,e){const n=typeof t=="string"?{}:{...t.colorReplacements},r=typeof t=="string"?t:t.name;for(const[i,s]of Object.entries((e==null?void 0:e.colorReplacements)||{}))typeof s=="string"?n[i]=s:i===r&&Object.assign(n,s);return n}function Wo(t,e){return t&&((e==null?void 0:e[t==null?void 0:t.toLowerCase()])||t)}function a6(t){const e={};return t.color&&(e.color=t.color),t.bgColor&&(e["background-color"]=t.bgColor),t.fontStyle&&(t.fontStyle&hs.Italic&&(e["font-style"]="italic"),t.fontStyle&hs.Bold&&(e["font-weight"]="bold"),t.fontStyle&hs.Underline&&(e["text-decoration"]="underline")),e}function dK(t){return typeof t=="string"?t:Object.entries(t).map(([e,n])=>`${e}:${n}`).join(";")}function hK(t){const e=fm(t,!0).map(([i])=>i);function n(i){if(i===t.length)return{line:e.length-1,character:e[e.length-1].length};let s=i,o=0;for(const a of e){if(s[r,ny])),e)}getInternalStack(e=this.theme){return this._stacks[e]}get scopes(){return Lw(this._stacks[this.theme])}getScopes(e=this.theme){return Lw(this._stacks[e])}toJSON(){return{lang:this.lang,theme:this.theme,themes:this.themes,scopes:this.scopes}}}function Lw(t){const e=[],n=new Set;function r(i){var o;if(n.has(i))return;n.add(i);const s=(o=i==null?void 0:i.nameScopesList)==null?void 0:o.scopeName;s&&e.push(s),i.parent&&r(i.parent)}return r(t),e}function pK(t,e){if(!(t instanceof lu))throw new jn("Invalid grammar state");return t.getInternalStack(e)}function mK(){const t=new WeakMap;function e(n){if(!t.has(n.meta)){let r=function(o){if(typeof o=="number"){if(o<0||o>n.source.length)throw new jn(`Invalid decoration offset: ${o}. Code length: ${n.source.length}`);return{...i.indexToPos(o),offset:o}}else{const a=i.lines[o.line];if(a===void 0)throw new jn(`Invalid decoration position ${JSON.stringify(o)}. Lines length: ${i.lines.length}`);if(o.character<0||o.character>a.length)throw new jn(`Invalid decoration position ${JSON.stringify(o)}. Line ${o.line} length: ${a.length}`);return{...o,offset:i.posToIndex(o.line,o.character)}}};const i=hK(n.source),s=(n.options.decorations||[]).map(o=>({...o,start:r(o.start),end:r(o.end)}));gK(s),t.set(n.meta,{decorations:s,converter:i,source:n.source})}return t.get(n.meta)}return{name:"shiki:decorations",tokens(n){var o;if(!((o=this.options.decorations)!=null&&o.length))return;const i=e(this).decorations.flatMap(a=>[a.start.offset,a.end.offset]);return fK(n,i)},code(n){var c;if(!((c=this.options.decorations)!=null&&c.length))return;const r=e(this),i=Array.from(n.children).filter(f=>f.type==="element"&&f.tagName==="span");if(i.length!==r.converter.lines.length)throw new jn(`Number of lines in code element (${i.length}) does not match the number of lines in the source (${r.converter.lines.length}). Failed to apply decorations.`);function s(f,d,h,p){const m=i[f];let g="",b=-1,y=-1;if(d===0&&(b=0),h===0&&(y=0),h===Number.POSITIVE_INFINITY&&(y=m.children.length),b===-1||y===-1)for(let S=0;Sb);return f.tagName=d.tagName||"span",f.properties={...f.properties,...p,class:f.properties.class},(g=d.properties)!=null&&g.class&&s6(f,d.properties.class),f=m(f,h)||f,f}const l=[],u=r.decorations.sort((f,d)=>d.start.offset-f.start.offset);for(const f of u){const{start:d,end:h}=f;if(d.line===h.line)s(d.line,d.character,h.character,f);else if(d.lineo(p,f));s(h.line,0,h.character,f)}}l.forEach(f=>f())}}}function gK(t){for(let e=0;en.end.offset)throw new jn(`Invalid decoration range: ${JSON.stringify(n.start)} - ${JSON.stringify(n.end)}`);for(let r=e+1;rNumber.parseInt(o));s.length===3&&!s.some(o=>Number.isNaN(o))&&(i={type:"rgb",rgb:s})}else if(r==="5"){const s=Number.parseInt(t[e+n]);Number.isNaN(s)||(i={type:"table",index:Number(s)})}return[n,i]}function vK(t){const e=[];for(let n=0;n=90&&i<=97?e.push({type:"setForegroundColor",value:{type:"named",name:Ko[i-90+8]}}):i>=100&&i<=107&&e.push({type:"setBackgroundColor",value:{type:"named",name:Ko[i-100+8]}})}return e}function xK(){let t=null,e=null,n=new Set;return{parse(r){const i=[];let s=0;do{const o=yK(r,s),a=o.sequence?r.substring(s,o.startPosition):r.substring(s);if(a.length>0&&i.push({value:a,foreground:t,background:e,decorations:new Set(n)}),o.sequence){const l=vK(o.sequence);for(const u of l)u.type==="resetAll"?(t=null,e=null,n.clear()):u.type==="resetForegroundColor"?t=null:u.type==="resetBackgroundColor"?e=null:u.type==="resetDecoration"&&n.delete(u.value);for(const u of l)u.type==="setForegroundColor"?t=u.value:u.type==="setBackgroundColor"?e=u.value:u.type==="setDecoration"&&n.add(u.value)}s=o.position}while(sMath.max(0,Math.min(l,255)).toString(16).padStart(2,"0")).join("")}`}let r;function i(){if(r)return r;r=[];for(let u=0;u{var l;return[a,(l=t.colors)==null?void 0:l[`terminal.ansi${a[0].toUpperCase()}${a.substring(1)}`]]}))),o=xK();return i.map(a=>o.parse(a[0]).map(l=>{let u,c;l.decorations.has("reverse")?(u=l.background?s.value(l.background):t.bg,c=l.foreground?s.value(l.foreground):t.fg):(u=l.foreground?s.value(l.foreground):t.fg,c=l.background?s.value(l.background):void 0),u=Wo(u,r),c=Wo(c,r),l.decorations.has("dim")&&(u=_K(u));let f=hs.None;return l.decorations.has("bold")&&(f|=hs.Bold),l.decorations.has("italic")&&(f|=hs.Italic),l.decorations.has("underline")&&(f|=hs.Underline),{content:l.value,offset:a[1],color:u,bgColor:c,fontStyle:f}}))}function _K(t){const e=t.match(/#([0-9a-f]{3})([0-9a-f]{3})?([0-9a-f]{2})?/);if(e)if(e[3]){const r=Math.round(Number.parseInt(e[3],16)/2).toString(16).padStart(2,"0");return`#${e[1]}${e[2]}${r}`}else return e[2]?`#${e[1]}${e[2]}80`:`#${Array.from(e[1]).map(r=>`${r}${r}`).join("")}80`;const n=t.match(/var\((--[\w-]+-ansi-[\w-]+)\)/);return n?`var(${n[1]}-dim)`:t}function f2(t,e,n={}){const{lang:r="text",theme:i=t.getLoadedThemes()[0]}=n;if(u2(r)||c2(i))return fm(e).map(l=>[{content:l[0],offset:l[1]}]);const{theme:s,colorMap:o}=t.setTheme(i);if(r==="ansi")return wK(s,e,n);const a=t.getLanguage(r);if(n.grammarState){if(n.grammarState.lang!==a.name)throw new ia(`Grammar state language "${n.grammarState.lang}" does not match highlight language "${a.name}"`);if(!n.grammarState.themes.includes(s.name))throw new ia(`Grammar state themes "${n.grammarState.themes}" do not contain highlight theme "${s.name}"`)}return AK(e,a,s,o,n)}function CK(...t){if(t.length===2)return sf(t[1]);const[e,n,r={}]=t,{lang:i="text",theme:s=e.getLoadedThemes()[0]}=r;if(u2(i)||c2(s))throw new ia("Plain language does not have grammar state");if(i==="ansi")throw new ia("ANSI language does not have grammar state");const{theme:o,colorMap:a}=e.setTheme(s),l=e.getLanguage(i);return new lu(Qp(n,l,o,a,r).stateStack,l.name,o.name)}function AK(t,e,n,r,i){const s=Qp(t,e,n,r,i),o=new lu(Qp(t,e,n,r,i).stateStack,e.name,n.name);return dm(s.tokens,o),s.tokens}function Qp(t,e,n,r,i){const s=Jp(n,i),{tokenizeMaxLineLength:o=0,tokenizeTimeLimit:a=500}=i,l=fm(t);let u=i.grammarState?pK(i.grammarState,n.name)??ny:i.grammarContextCode!=null?Qp(i.grammarContextCode,e,n,r,{...i,grammarState:void 0,grammarContextCode:void 0}).stateStack:ny,c=[];const f=[];for(let d=0,h=l.length;d0&&p.length>=o){c=[],f.push([{content:p,offset:m,color:"",fontStyle:0}]);continue}let g,b,y;i.includeExplanation&&(g=e.tokenizeLine(p,u),b=g.tokens,y=0);const x=e.tokenizeLine2(p,u,a),S=x.tokens.length/2;for(let E=0;EV.trim());break;case"object":F=R.scope;break;default:continue}N.push({settings:R,selectors:F.map(V=>V.split(/ /))})}I.explanation=[];let P=0;for(;C+P({scopeName:e}))}function kK(t,e){const n=[];for(let r=0,i=e.length;r=0&&i>=0;)$w(t[r],n[i])&&(r-=1),i-=1;return r===-1}function TK(t,e,n){const r=[];for(const{selectors:i,settings:s}of t)for(const o of i)if(OK(o,e,n)){r.push(s);break}return r}function c6(t,e,n){const r=Object.entries(n.themes).filter(l=>l[1]).map(l=>({color:l[0],theme:l[1]})),i=r.map(l=>{const u=f2(t,e,{...n,theme:l.theme}),c=sf(u),f=typeof l.theme=="string"?l.theme:l.theme.name;return{tokens:u,state:c,theme:f}}),s=IK(...i.map(l=>l.tokens)),o=s[0].map((l,u)=>l.map((c,f)=>{const d={content:c.content,variants:{},offset:c.offset};return"includeExplanation"in n&&n.includeExplanation&&(d.explanation=c.explanation),s.forEach((h,p)=>{const{content:m,explanation:g,offset:b,...y}=h[u][f];d.variants[r[p].color]=y}),d})),a=i[0].state?new lu(Object.fromEntries(i.map(l=>{var u;return[l.theme,(u=l.state)==null?void 0:u.getInternalStack(l.theme)]})),i[0].state.lang):void 0;return a&&dm(o,a),o}function IK(...t){const e=t.map(()=>[]),n=t.length;for(let r=0;rl[r]),s=e.map(()=>[]);e.forEach((l,u)=>l.push(s[u]));const o=i.map(()=>0),a=i.map(l=>l[0]);for(;a.every(l=>l);){const l=Math.min(...a.map(u=>u.content.length));for(let u=0;ug[1]).map(g=>({color:g[0],theme:g[1]})).sort((g,b)=>g.color===u?-1:b.color===u?1:0);if(f.length===0)throw new ia("`themes` option must not be empty");const d=c6(t,e,n);if(l=sf(d),u&&!f.find(g=>g.color===u))throw new ia(`\`themes\` option must contain the defaultColor key \`${u}\``);const h=f.map(g=>t.getTheme(g.theme)),p=f.map(g=>g.color);s=d.map(g=>g.map(b=>PK(b,p,c,u))),l&&dm(s,l);const m=f.map(g=>Jp(g.theme,n));i=f.map((g,b)=>(b===0&&u?"":`${c+g.color}:`)+(Wo(h[b].fg,m[b])||"inherit")).join(";"),r=f.map((g,b)=>(b===0&&u?"":`${c+g.color}-bg:`)+(Wo(h[b].bg,m[b])||"inherit")).join(";"),o=`shiki-themes ${h.map(g=>g.name).join(" ")}`,a=u?void 0:[i,r].join(";")}else if("theme"in n){const u=Jp(n.theme,n);s=f2(t,e,n);const c=t.getTheme(n.theme);r=Wo(c.bg,u),i=Wo(c.fg,u),o=c.name,l=sf(s)}else throw new ia("Invalid options, either `theme` or `themes` must be provided");return{tokens:s,fg:i,bg:r,themeName:o,rootStyle:a,grammarState:l}}function PK(t,e,n,r){const i={content:t.content,explanation:t.explanation,offset:t.offset},s=e.map(l=>a6(t.variants[l])),o=new Set(s.flatMap(l=>Object.keys(l))),a={};return s.forEach((l,u)=>{for(const c of o){const f=l[c]||"inherit";if(u===0&&r)a[c]=f;else{const d=c==="color"?"":c==="background-color"?"-bg":`-${c}`,h=n+e[u]+(c==="color"?"":d);a[h]=f}}}),i.htmlStyle=a,i}function t0(t,e,n,r={meta:{},options:n,codeToHast:(i,s)=>t0(t,i,s),codeToTokens:(i,s)=>e0(t,i,s)}){var h,p;let i=e;for(const m of Zp(n))i=((h=m.preprocess)==null?void 0:h.call(r,i,n))||i;let{tokens:s,fg:o,bg:a,themeName:l,rootStyle:u,grammarState:c}=e0(t,i,n);const{mergeWhitespaces:f=!0}=n;f===!0?s=NK(s):f==="never"&&(s=MK(s));const d={...r,get source(){return i}};for(const m of Zp(n))s=((p=m.tokens)==null?void 0:p.call(d,s))||s;return RK(s,{...n,fg:o,bg:a,themeName:l,rootStyle:u},d,c)}function RK(t,e,n,r=sf(t)){var p,m,g;const i=Zp(e),s=[],o={type:"root",children:[]},{structure:a="classic",tabindex:l="0"}=e;let u={type:"element",tagName:"pre",properties:{class:`shiki ${e.themeName||""}`,style:e.rootStyle||`background-color:${e.bg};color:${e.fg}`,...l!==!1&&l!=null?{tabindex:l.toString()}:{},...Object.fromEntries(Array.from(Object.entries(e.meta||{})).filter(([b])=>!b.startsWith("_")))},children:[]},c={type:"element",tagName:"code",properties:{},children:s};const f=[],d={...n,structure:a,addClassToHast:s6,get source(){return n.source},get tokens(){return t},get options(){return e},get root(){return o},get pre(){return u},get code(){return c},get lines(){return f}};if(t.forEach((b,y)=>{var E,C;y&&(a==="inline"?o.children.push({type:"element",tagName:"br",properties:{},children:[]}):a==="classic"&&s.push({type:"text",value:` -`}));let x={type:"element",tagName:"span",properties:{class:"line"},children:[]},S=0;for(const w of b){let A={type:"element",tagName:"span",properties:{...w.htmlAttrs},children:[{type:"text",value:w.content}]};w.htmlStyle;const _=dK(w.htmlStyle||a6(w));_&&(A.properties.style=_);for(const D of i)A=((E=D==null?void 0:D.span)==null?void 0:E.call(d,A,y+1,S,x,w))||A;a==="inline"?o.children.push(A):a==="classic"&&x.children.push(A),S+=w.content.length}if(a==="classic"){for(const w of i)x=((C=w==null?void 0:w.line)==null?void 0:C.call(d,x,y+1))||x;f.push(x),s.push(x)}}),a==="classic"){for(const b of i)c=((p=b==null?void 0:b.code)==null?void 0:p.call(d,c))||c;u.children.push(c);for(const b of i)u=((m=b==null?void 0:b.pre)==null?void 0:m.call(d,u))||u;o.children.push(u)}let h=o;for(const b of i)h=((g=b==null?void 0:b.root)==null?void 0:g.call(d,h))||h;return r&&dm(h,r),h}function NK(t){return t.map(e=>{const n=[];let r="",i=0;return e.forEach((s,o)=>{const l=!(s.fontStyle&&s.fontStyle&hs.Underline);l&&s.content.match(/^\s+$/)&&e[o+1]?(i||(i=s.offset),r+=s.content):r?(l?n.push({...s,offset:i,content:r+s.content}):n.push({content:r,offset:i},s),i=0,r=""):n.push(s)}),n})}function MK(t){return t.map(e=>e.flatMap(n=>{if(n.content.match(/^\s+$/))return n;const r=n.content.match(/^(\s*)(.*?)(\s*)$/);if(!r)return n;const[,i,s,o]=r;if(!i&&!o)return n;const a=[{...n,offset:n.offset+i.length,content:s}];return i&&a.unshift({content:i,offset:n.offset}),o&&a.push({content:o,offset:n.offset+i.length+s.length}),a}))}function FK(t,e,n){var s;const r={meta:{},options:n,codeToHast:(o,a)=>t0(t,o,a),codeToTokens:(o,a)=>e0(t,o,a)};let i=iK(t0(t,e,n,r));for(const o of Zp(n))i=((s=o.postprocess)==null?void 0:s.call(r,i,n))||i;return i}const zw={light:"#333333",dark:"#bbbbbb"},jw={light:"#fffffe",dark:"#1e1e1e"},Vw="__shiki_resolved";function d2(t){var a,l,u,c,f;if(t!=null&&t[Vw])return t;const e={...t};e.tokenColors&&!e.settings&&(e.settings=e.tokenColors,delete e.tokenColors),e.type||(e.type="dark"),e.colorReplacements={...e.colorReplacements},e.settings||(e.settings=[]);let{bg:n,fg:r}=e;if(!n||!r){const d=e.settings?e.settings.find(h=>!h.name&&!h.scope):void 0;(a=d==null?void 0:d.settings)!=null&&a.foreground&&(r=d.settings.foreground),(l=d==null?void 0:d.settings)!=null&&l.background&&(n=d.settings.background),!r&&((u=e==null?void 0:e.colors)!=null&&u["editor.foreground"])&&(r=e.colors["editor.foreground"]),!n&&((c=e==null?void 0:e.colors)!=null&&c["editor.background"])&&(n=e.colors["editor.background"]),r||(r=e.type==="light"?zw.light:zw.dark),n||(n=e.type==="light"?jw.light:jw.dark),e.fg=r,e.bg=n}e.settings[0]&&e.settings[0].settings&&!e.settings[0].scope||e.settings.unshift({settings:{foreground:e.fg,background:e.bg}});let i=0;const s=new Map;function o(d){var p;if(s.has(d))return s.get(d);i+=1;const h=`#${i.toString(16).padStart(8,"0").toLowerCase()}`;return(p=e.colorReplacements)!=null&&p[`#${h}`]?o(d):(s.set(d,h),h)}e.settings=e.settings.map(d=>{var g,b;const h=((g=d.settings)==null?void 0:g.foreground)&&!d.settings.foreground.startsWith("#"),p=((b=d.settings)==null?void 0:b.background)&&!d.settings.background.startsWith("#");if(!h&&!p)return d;const m={...d,settings:{...d.settings}};if(h){const y=o(d.settings.foreground);e.colorReplacements[y]=d.settings.foreground,m.settings.foreground=y}if(p){const y=o(d.settings.background);e.colorReplacements[y]=d.settings.background,m.settings.background=y}return m});for(const d of Object.keys(e.colors||{}))if((d==="editor.foreground"||d==="editor.background"||d.startsWith("terminal.ansi"))&&!((f=e.colors[d])!=null&&f.startsWith("#"))){const h=o(e.colors[d]);e.colorReplacements[h]=e.colors[d],e.colors[d]=h}return Object.defineProperty(e,Vw,{enumerable:!1,writable:!1,value:!0}),e}async function f6(t){return Array.from(new Set((await Promise.all(t.filter(e=>!lK(e)).map(async e=>await o6(e).then(n=>Array.isArray(n)?n:[n])))).flat()))}async function d6(t){return(await Promise.all(t.map(async n=>uK(n)?null:d2(await o6(n))))).filter(n=>!!n)}class LK extends HG{constructor(n,r,i,s={}){super(n);X(this,"_resolvedThemes",new Map);X(this,"_resolvedGrammars",new Map);X(this,"_langMap",new Map);X(this,"_langGraph",new Map);X(this,"_textmateThemeCache",new WeakMap);X(this,"_loadedThemesCache",null);X(this,"_loadedLanguagesCache",null);this._resolver=n,this._themes=r,this._langs=i,this._alias=s,this._themes.map(o=>this.loadTheme(o)),this.loadLanguages(this._langs)}getTheme(n){return typeof n=="string"?this._resolvedThemes.get(n):this.loadTheme(n)}loadTheme(n){const r=d2(n);return r.name&&(this._resolvedThemes.set(r.name,r),this._loadedThemesCache=null),r}getLoadedThemes(){return this._loadedThemesCache||(this._loadedThemesCache=[...this._resolvedThemes.keys()]),this._loadedThemesCache}setTheme(n){let r=this._textmateThemeCache.get(n);r||(r=Gp.createFromRawTheme(n),this._textmateThemeCache.set(n,r)),this._syncRegistry.setTheme(r)}getGrammar(n){if(this._alias[n]){const r=new Set([n]);for(;this._alias[n];){if(n=this._alias[n],r.has(n))throw new jn(`Circular alias \`${Array.from(r).join(" -> ")} -> ${n}\``);r.add(n)}}return this._resolvedGrammars.get(n)}loadLanguage(n){var o,a,l,u;if(this.getGrammar(n.name))return;const r=new Set([...this._langMap.values()].filter(c=>{var f;return(f=c.embeddedLangsLazy)==null?void 0:f.includes(n.name)}));this._resolver.addLanguage(n);const i={balancedBracketSelectors:n.balancedBracketSelectors||["*"],unbalancedBracketSelectors:n.unbalancedBracketSelectors||[]};this._syncRegistry._rawGrammars.set(n.scopeName,n);const s=this.loadGrammarWithConfiguration(n.scopeName,1,i);if(s.name=n.name,this._resolvedGrammars.set(n.name,s),n.aliases&&n.aliases.forEach(c=>{this._alias[c]=n.name}),this._loadedLanguagesCache=null,r.size)for(const c of r)this._resolvedGrammars.delete(c.name),this._loadedLanguagesCache=null,(a=(o=this._syncRegistry)==null?void 0:o._injectionGrammars)==null||a.delete(c.scopeName),(u=(l=this._syncRegistry)==null?void 0:l._grammars)==null||u.delete(c.scopeName),this.loadLanguage(this._langMap.get(c.name))}dispose(){super.dispose(),this._resolvedThemes.clear(),this._resolvedGrammars.clear(),this._langMap.clear(),this._langGraph.clear(),this._loadedThemesCache=null}loadLanguages(n){for(const s of n)this.resolveEmbeddedLanguages(s);const r=Array.from(this._langGraph.entries()),i=r.filter(([s,o])=>!o);if(i.length){const s=r.filter(([o,a])=>{var l;return a&&((l=a.embeddedLangs)==null?void 0:l.some(u=>i.map(([c])=>c).includes(u)))}).filter(o=>!i.includes(o));throw new jn(`Missing languages ${i.map(([o])=>`\`${o}\``).join(", ")}, required by ${s.map(([o])=>`\`${o}\``).join(", ")}`)}for(const[s,o]of r)this._resolver.addLanguage(o);for(const[s,o]of r)this.loadLanguage(o)}getLoadedLanguages(){return this._loadedLanguagesCache||(this._loadedLanguagesCache=[...new Set([...this._resolvedGrammars.keys(),...Object.keys(this._alias)])]),this._loadedLanguagesCache}resolveEmbeddedLanguages(n){if(this._langMap.set(n.name,n),this._langGraph.set(n.name,n),n.embeddedLangs)for(const r of n.embeddedLangs)this._langGraph.set(r,this._langMap.get(r))}}class BK{constructor(e,n){X(this,"_langs",new Map);X(this,"_scopeToLang",new Map);X(this,"_injections",new Map);X(this,"_onigLib");this._onigLib={createOnigScanner:r=>e.createScanner(r),createOnigString:r=>e.createString(r)},n.forEach(r=>this.addLanguage(r))}get onigLib(){return this._onigLib}getLangRegistration(e){return this._langs.get(e)}loadGrammar(e){return this._scopeToLang.get(e)}addLanguage(e){this._langs.set(e.name,e),e.aliases&&e.aliases.forEach(n=>{this._langs.set(n,e)}),this._scopeToLang.set(e.scopeName,e),e.injectTo&&e.injectTo.forEach(n=>{this._injections.get(n)||this._injections.set(n,[]),this._injections.get(n).push(e.scopeName)})}getInjections(e){const n=e.split(".");let r=[];for(let i=1;i<=n.length;i++){const s=n.slice(0,i).join(".");r=[...r,...this._injections.get(s)||[]]}return r}}let Bu=0;function $K(t){Bu+=1,t.warnings!==!1&&Bu>=10&&Bu%10===0&&console.warn(`[Shiki] ${Bu} instances have been created. Shiki is supposed to be used as a singleton, consider refactoring your code to cache your highlighter instance; Or call \`highlighter.dispose()\` to release unused instances.`);let e=!1;if(!t.engine)throw new jn("`engine` option is required for synchronous mode");const n=(t.langs||[]).flat(1),r=(t.themes||[]).flat(1).map(d2),i=new BK(t.engine,n),s=new LK(i,r,n,t.langAlias);let o;function a(y){g();const x=s.getGrammar(typeof y=="string"?y:y.name);if(!x)throw new jn(`Language \`${y}\` not found, you may need to load it first`);return x}function l(y){if(y==="none")return{bg:"",fg:"",name:"none",settings:[],type:"dark"};g();const x=s.getTheme(y);if(!x)throw new jn(`Theme \`${y}\` not found, you may need to load it first`);return x}function u(y){g();const x=l(y);o!==y&&(s.setTheme(x),o=y);const S=s.getColorMap();return{theme:x,colorMap:S}}function c(){return g(),s.getLoadedThemes()}function f(){return g(),s.getLoadedLanguages()}function d(...y){g(),s.loadLanguages(y.flat(1))}async function h(...y){return d(await f6(y))}function p(...y){g();for(const x of y.flat(1))s.loadTheme(x)}async function m(...y){return g(),p(await d6(y))}function g(){if(e)throw new jn("Shiki instance has been disposed")}function b(){e||(e=!0,s.dispose(),Bu-=1)}return{setTheme:u,getTheme:l,getLanguage:a,getLoadedThemes:c,getLoadedLanguages:f,loadLanguage:h,loadLanguageSync:d,loadTheme:m,loadThemeSync:p,dispose:b,[Symbol.dispose]:b}}async function zK(t={}){t.loadWasm;const[e,n,r]=await Promise.all([d6(t.themes||[]),f6(t.langs||[]),t.engine||iG(t.loadWasm||rG())]);return $K({...t,themes:e,langs:n,engine:r})}async function jK(t={}){const e=await zK(t);return{getLastGrammarState:(...n)=>CK(e,...n),codeToTokensBase:(n,r)=>f2(e,n,r),codeToTokensWithThemes:(n,r)=>c6(e,n,r),codeToTokens:(n,r)=>e0(e,n,r),codeToHast:(n,r)=>t0(e,n,r),codeToHtml:(n,r)=>FK(e,n,r),...e,getInternalContext:()=>e}}const ay=Gr({linkify:!0,typographer:!0});(async()=>{const t=await jK({themes:[sg(()=>import("./vitesse-light-CVO1_9PV.js"),[]),sg(()=>import("./vitesse-dark-D0r3Knsf.js"),[])],langs:[sg(()=>import("./javascript-ySlJ1b_l.js"),[])]});ay.use($q(t,{themes:{light:"vitesse-light",dark:"vitesse-dark"}}))})();function yl(t,e=!0){return e?ay.renderInline(t):ay.render(t)}var r1={},Uw;function VK(){return Uw||(Uw=1,(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.parse=t.enableErrorLogging=t.disableErrorLogging=t.setErrorLogger=void 0;let e=console.error;function n(w){e=w}t.setErrorLogger=n;function r(){e=()=>{}}t.disableErrorLogging=r;function i(){e=console.error}t.enableErrorLogging=i;function s(w){if(w!==void 0){if(w===null)return null;if(w==="")return"";w=w.replace(/\\+$/,A=>A.length%2===0?A:A.slice(0,-1));try{return JSON.parse(w)}catch(A){const[_,D]=w.trimLeft()[0]===":"?o(w,A):o(w,A,b);if(s.lastParseReminding=D,s.onExtraToken&&D.length>0){const I=D.trimRight();s.lastParseReminding=I,I.length>0&&s.onExtraToken(w,_,I)}return _}}}t.parse=s,(function(w){w.onExtraToken=(A,_,D)=>{e("parsed json with extra tokens:",{text:A,data:_,reminding:D})}})(s=t.parse||(t.parse={}));function o(w,A,_){const D=l[w[0]]||_;if(!D)throw e(`no parser registered for ${JSON.stringify(w[0])}:`,{s:w}),A;return D(w,A)}function a(w,A,_){return w[0]==='"'?p(w):w[0]==="'"?g(w):b(w,A,_)}const l={};function u(w){return w.trimLeft()}l[" "]=c,l["\r"]=c,l[` -`]=c,l[" "]=c;function c(w,A){return w=u(w),o(w,A)}l["["]=f;function f(w,A){w=w.substr(1);const _=[];for(w=u(w);w.length>0;){if(w[0]==="]"){w=w.substr(1);break}const D=o(w,A,(I,N)=>b(I,N,[",","]"]));_.push(D[0]),w=D[1],w=u(w),w[0]===","&&(w=w.substring(1),w=u(w))}return[_,w]}for(const w of"0123456789.-".slice())l[w]=d;function d(w){for(let A=0;A{const R=w.indexOf(P);return R===-1?w.length:R})),I=w.substring(0,D).trim(),N=w.substring(D);return[I,N]}l["{"]=y;function y(w,A){w=w.substr(1);const _={};for(w=u(w);w.length>0;){if(w[0]==="}"){w=w.substr(1);break}const D=a(w,A,[":","}"]),I=D[0];if(w=D[1],w=u(w),w[0]!==":"){_[I]=void 0;break}if(w=w.substr(1),w=u(w),w.length===0){_[I]=void 0;break}const N=o(w,A);_[I]=N[0],w=N[1],w=u(w),w[0]===","&&(w=w.substr(1),w=u(w))}return[_,w]}l.t=x;function x(w,A){return C(w,"true",!0,A)}l.f=S;function S(w,A){return C(w,"false",!1,A)}l.n=E;function E(w,A){return C(w,"null",null,A)}function C(w,A,_,D){for(let I=A.length;I>=1;I--)if(w.startsWith(A.slice(0,I)))return[_,w.slice(I)];{const I=JSON.stringify(w.slice(0,A.length));throw e(`unknown token starting with ${I}:`,{s:w}),D}}})(r1)),r1}var h6=VK();function UK(t){let e=null;try{e=JSON.parse(t.doc.toString())}catch{try{e=h6.parse(t.doc.toString())}catch{}}const n=Vv(t,At.JSON);return{data:e,pointers:n}}var HK=/[\u1680\u2000-\u200A\u202F\u205F\u3000]/,qK=/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE83\uDE86-\uDE89\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]/,GK=/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u09FC\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9-\u0AFF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D00-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19D9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1CD0-\u1CD2\u1CD4-\u1CF9\u1D00-\u1DF9\u1DFB-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE3E\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC00-\uDC4A\uDC50-\uDC59\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDE00-\uDE3E\uDE47\uDE50-\uDE83\uDE86-\uDE99\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC40\uDC50-\uDC59\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD47\uDD50-\uDD59]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6\uDD00-\uDD4A\uDD50-\uDD59]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/,i1={Space_Separator:HK,ID_Start:qK,ID_Continue:GK},Vt={isSpaceSeparator(t){return typeof t=="string"&&i1.Space_Separator.test(t)},isIdStartChar(t){return typeof t=="string"&&(t>="a"&&t<="z"||t>="A"&&t<="Z"||t==="$"||t==="_"||i1.ID_Start.test(t))},isIdContinueChar(t){return typeof t=="string"&&(t>="a"&&t<="z"||t>="A"&&t<="Z"||t>="0"&&t<="9"||t==="$"||t==="_"||t==="‌"||t==="‍"||i1.ID_Continue.test(t))},isDigit(t){return typeof t=="string"&&/[0-9]/.test(t)},isHexDigit(t){return typeof t=="string"&&/[0-9A-Fa-f]/.test(t)}};let ly,Hn,fs,n0,xo,li,fn,h2,gc;var WK=function(e,n){ly=String(e),Hn="start",fs=[],n0=0,xo=1,li=0,fn=void 0,h2=void 0,gc=void 0;do fn=KK(),JK[Hn]();while(fn.type!=="eof");return typeof n=="function"?uy({"":gc},"",n):gc};function uy(t,e,n){const r=t[e];if(r!=null&&typeof r=="object")if(Array.isArray(r))for(let i=0;i\``.split("")]],single:[["&'".split(""),"\"&'`".split("")],["\0&'".split(""),"\0\"&'`".split("")]],double:[['"&'.split(""),"\"&'`".split("")],['\0"&'.split(""),"\0\"&'`".split("")]]};function KW(t,e,n,r){const i=r.schema,s=i.space==="svg"?!1:r.settings.omitOptionalTags;let o=i.space==="svg"?r.settings.closeEmptyElements:r.settings.voids.includes(t.tagName.toLowerCase());const a=[];let l;i.space==="html"&&t.tagName==="svg"&&(r.schema=e6);const u=XW(r,t.properties),c=r.all(i.space==="html"&&t.tagName==="template"?t.content:t);return r.schema=i,c&&(o=!1),(u||!s||!VW(t,e,n))&&(a.push("<",t.tagName,u?" "+u:""),o&&(i.space==="svg"||r.settings.closeSelfClosing)&&(l=u.charAt(u.length-1),(!r.settings.tightSelfClosing||l==="/"||l&&l!=='"'&&l!=="'")&&a.push(" "),a.push("/")),a.push(">")),a.push(c),!o&&(!s||!u2(t,e,n))&&a.push(""),a.join("")}function XW(t,e){const n=[];let r=-1,i;if(e){for(i in e)if(e[i]!==null&&e[i]!==void 0){const s=YW(t,i,e[i]);s&&n.push(s)}}for(;++rNw(n,t.alternative)&&(o=t.alternative),a=o+bl(n,Object.assign({},t.settings.characterReferences,{subset:(o==="'"?Jd.single:Jd.double)[i][s],attribute:!0}))+o),l+(a&&"="+a))}const JW=["<","&"];function s6(t,e,n,r){return n&&n.type==="element"&&(n.tagName==="script"||n.tagName==="style")?t.value:bl(t.value,Object.assign({},r.settings.characterReferences,{subset:JW}))}function ZW(t,e,n,r){return r.settings.allowDangerousHtml?t.value:s6(t,e,n,r)}function QW(t,e,n,r){return r.all(t)}const eK=rW("type",{invalid:tK,unknown:nK,handlers:{comment:wW,doctype:_W,element:KW,raw:ZW,root:QW,text:s6}});function tK(t){throw new Error("Expected node, not `"+t+"`")}function nK(t){const e=t;throw new Error("Cannot compile unknown node `"+e.type+"`")}const rK={},iK={},sK=[];function oK(t,e){const n=rK,r=n.quote||'"',i=r==='"'?"'":'"';if(r!=='"'&&r!=="'")throw new Error("Invalid quote `"+r+"`, expected `'` or `\"`");return{one:aK,all:lK,settings:{omitOptionalTags:n.omitOptionalTags||!1,allowParseErrors:n.allowParseErrors||!1,allowDangerousCharacters:n.allowDangerousCharacters||!1,quoteSmart:n.quoteSmart||!1,preferUnquoted:n.preferUnquoted||!1,tightAttributes:n.tightAttributes||!1,upperDoctype:n.upperDoctype||!1,tightDoctype:n.tightDoctype||!1,bogusComments:n.bogusComments||!1,tightCommaSeparatedLists:n.tightCommaSeparatedLists||!1,tightSelfClosing:n.tightSelfClosing||!1,collapseEmptyAttributes:n.collapseEmptyAttributes||!1,allowDangerousHtml:n.allowDangerousHtml||!1,voids:n.voids||WG,characterReferences:n.characterReferences||iK,closeSelfClosing:n.closeSelfClosing||!1,closeEmptyElements:n.closeEmptyElements||!1},schema:n.space==="svg"?e6:nW,quote:r,alternative:i}.one(Array.isArray(t)?{type:"root",children:t}:t,void 0,void 0)}function aK(t,e,n){return eK(t,e,n,this)}function lK(t){const e=[],n=t&&t.children||sK;let r=-1;for(;++rn&&r.push({...t,content:t.content.slice(n,i),offset:t.offset+n}),n=i;return nr-i);return n.length?t.map(r=>r.flatMap(i=>{const s=n.filter(o=>i.offseto-i.offset).sort((o,a)=>o-a);return s.length?dK(i,s):i})):t}async function a6(t){return Promise.resolve(typeof t=="function"?t():t).then(e=>e.default||e)}function Zp(t,e){const n=typeof t=="string"?{}:{...t.colorReplacements},r=typeof t=="string"?t:t.name;for(const[i,s]of Object.entries((e==null?void 0:e.colorReplacements)||{}))typeof s=="string"?n[i]=s:i===r&&Object.assign(n,s);return n}function Ko(t,e){return t&&((e==null?void 0:e[t==null?void 0:t.toLowerCase()])||t)}function l6(t){const e={};return t.color&&(e.color=t.color),t.bgColor&&(e["background-color"]=t.bgColor),t.fontStyle&&(t.fontStyle&hs.Italic&&(e["font-style"]="italic"),t.fontStyle&hs.Bold&&(e["font-weight"]="bold"),t.fontStyle&hs.Underline&&(e["text-decoration"]="underline")),e}function pK(t){return typeof t=="string"?t:Object.entries(t).map(([e,n])=>`${e}:${n}`).join(";")}function mK(t){const e=dm(t,!0).map(([i])=>i);function n(i){if(i===t.length)return{line:e.length-1,character:e[e.length-1].length};let s=i,o=0;for(const a of e){if(s[r,ry])),e)}getInternalStack(e=this.theme){return this._stacks[e]}get scopes(){return Bw(this._stacks[this.theme])}getScopes(e=this.theme){return Bw(this._stacks[e])}toJSON(){return{lang:this.lang,theme:this.theme,themes:this.themes,scopes:this.scopes}}}function Bw(t){const e=[],n=new Set;function r(i){var o;if(n.has(i))return;n.add(i);const s=(o=i==null?void 0:i.nameScopesList)==null?void 0:o.scopeName;s&&e.push(s),i.parent&&r(i.parent)}return r(t),e}function gK(t,e){if(!(t instanceof lu))throw new jn("Invalid grammar state");return t.getInternalStack(e)}function bK(){const t=new WeakMap;function e(n){if(!t.has(n.meta)){let r=function(o){if(typeof o=="number"){if(o<0||o>n.source.length)throw new jn(`Invalid decoration offset: ${o}. Code length: ${n.source.length}`);return{...i.indexToPos(o),offset:o}}else{const a=i.lines[o.line];if(a===void 0)throw new jn(`Invalid decoration position ${JSON.stringify(o)}. Lines length: ${i.lines.length}`);if(o.character<0||o.character>a.length)throw new jn(`Invalid decoration position ${JSON.stringify(o)}. Line ${o.line} length: ${a.length}`);return{...o,offset:i.posToIndex(o.line,o.character)}}};const i=mK(n.source),s=(n.options.decorations||[]).map(o=>({...o,start:r(o.start),end:r(o.end)}));yK(s),t.set(n.meta,{decorations:s,converter:i,source:n.source})}return t.get(n.meta)}return{name:"shiki:decorations",tokens(n){var o;if(!((o=this.options.decorations)!=null&&o.length))return;const i=e(this).decorations.flatMap(a=>[a.start.offset,a.end.offset]);return hK(n,i)},code(n){var c;if(!((c=this.options.decorations)!=null&&c.length))return;const r=e(this),i=Array.from(n.children).filter(f=>f.type==="element"&&f.tagName==="span");if(i.length!==r.converter.lines.length)throw new jn(`Number of lines in code element (${i.length}) does not match the number of lines in the source (${r.converter.lines.length}). Failed to apply decorations.`);function s(f,d,h,p){const m=i[f];let g="",b=-1,y=-1;if(d===0&&(b=0),h===0&&(y=0),h===Number.POSITIVE_INFINITY&&(y=m.children.length),b===-1||y===-1)for(let S=0;Sb);return f.tagName=d.tagName||"span",f.properties={...f.properties,...p,class:f.properties.class},(g=d.properties)!=null&&g.class&&o6(f,d.properties.class),f=m(f,h)||f,f}const l=[],u=r.decorations.sort((f,d)=>d.start.offset-f.start.offset);for(const f of u){const{start:d,end:h}=f;if(d.line===h.line)s(d.line,d.character,h.character,f);else if(d.lineo(p,f));s(h.line,0,h.character,f)}}l.forEach(f=>f())}}}function yK(t){for(let e=0;en.end.offset)throw new jn(`Invalid decoration range: ${JSON.stringify(n.start)} - ${JSON.stringify(n.end)}`);for(let r=e+1;rNumber.parseInt(o));s.length===3&&!s.some(o=>Number.isNaN(o))&&(i={type:"rgb",rgb:s})}else if(r==="5"){const s=Number.parseInt(t[e+n]);Number.isNaN(s)||(i={type:"table",index:Number(s)})}return[n,i]}function SK(t){const e=[];for(let n=0;n=90&&i<=97?e.push({type:"setForegroundColor",value:{type:"named",name:Xo[i-90+8]}}):i>=100&&i<=107&&e.push({type:"setBackgroundColor",value:{type:"named",name:Xo[i-100+8]}})}return e}function EK(){let t=null,e=null,n=new Set;return{parse(r){const i=[];let s=0;do{const o=xK(r,s),a=o.sequence?r.substring(s,o.startPosition):r.substring(s);if(a.length>0&&i.push({value:a,foreground:t,background:e,decorations:new Set(n)}),o.sequence){const l=SK(o.sequence);for(const u of l)u.type==="resetAll"?(t=null,e=null,n.clear()):u.type==="resetForegroundColor"?t=null:u.type==="resetBackgroundColor"?e=null:u.type==="resetDecoration"&&n.delete(u.value);for(const u of l)u.type==="setForegroundColor"?t=u.value:u.type==="setBackgroundColor"?e=u.value:u.type==="setDecoration"&&n.add(u.value)}s=o.position}while(sMath.max(0,Math.min(l,255)).toString(16).padStart(2,"0")).join("")}`}let r;function i(){if(r)return r;r=[];for(let u=0;u{var l;return[a,(l=t.colors)==null?void 0:l[`terminal.ansi${a[0].toUpperCase()}${a.substring(1)}`]]}))),o=EK();return i.map(a=>o.parse(a[0]).map(l=>{let u,c;l.decorations.has("reverse")?(u=l.background?s.value(l.background):t.bg,c=l.foreground?s.value(l.foreground):t.fg):(u=l.foreground?s.value(l.foreground):t.fg,c=l.background?s.value(l.background):void 0),u=Ko(u,r),c=Ko(c,r),l.decorations.has("dim")&&(u=AK(u));let f=hs.None;return l.decorations.has("bold")&&(f|=hs.Bold),l.decorations.has("italic")&&(f|=hs.Italic),l.decorations.has("underline")&&(f|=hs.Underline),{content:l.value,offset:a[1],color:u,bgColor:c,fontStyle:f}}))}function AK(t){const e=t.match(/#([0-9a-f]{3})([0-9a-f]{3})?([0-9a-f]{2})?/);if(e)if(e[3]){const r=Math.round(Number.parseInt(e[3],16)/2).toString(16).padStart(2,"0");return`#${e[1]}${e[2]}${r}`}else return e[2]?`#${e[1]}${e[2]}80`:`#${Array.from(e[1]).map(r=>`${r}${r}`).join("")}80`;const n=t.match(/var\((--[\w-]+-ansi-[\w-]+)\)/);return n?`var(${n[1]}-dim)`:t}function d2(t,e,n={}){const{lang:r="text",theme:i=t.getLoadedThemes()[0]}=n;if(c2(r)||f2(i))return dm(e).map(l=>[{content:l[0],offset:l[1]}]);const{theme:s,colorMap:o}=t.setTheme(i);if(r==="ansi")return CK(s,e,n);const a=t.getLanguage(r);if(n.grammarState){if(n.grammarState.lang!==a.name)throw new sa(`Grammar state language "${n.grammarState.lang}" does not match highlight language "${a.name}"`);if(!n.grammarState.themes.includes(s.name))throw new sa(`Grammar state themes "${n.grammarState.themes}" do not contain highlight theme "${s.name}"`)}return kK(e,a,s,o,n)}function DK(...t){if(t.length===2)return sf(t[1]);const[e,n,r={}]=t,{lang:i="text",theme:s=e.getLoadedThemes()[0]}=r;if(c2(i)||f2(s))throw new sa("Plain language does not have grammar state");if(i==="ansi")throw new sa("ANSI language does not have grammar state");const{theme:o,colorMap:a}=e.setTheme(s),l=e.getLanguage(i);return new lu(e0(n,l,o,a,r).stateStack,l.name,o.name)}function kK(t,e,n,r,i){const s=e0(t,e,n,r,i),o=new lu(e0(t,e,n,r,i).stateStack,e.name,n.name);return hm(s.tokens,o),s.tokens}function e0(t,e,n,r,i){const s=Zp(n,i),{tokenizeMaxLineLength:o=0,tokenizeTimeLimit:a=500}=i,l=dm(t);let u=i.grammarState?gK(i.grammarState,n.name)??ry:i.grammarContextCode!=null?e0(i.grammarContextCode,e,n,r,{...i,grammarState:void 0,grammarContextCode:void 0}).stateStack:ry,c=[];const f=[];for(let d=0,h=l.length;d0&&p.length>=o){c=[],f.push([{content:p,offset:m,color:"",fontStyle:0}]);continue}let g,b,y;i.includeExplanation&&(g=e.tokenizeLine(p,u),b=g.tokens,y=0);const x=e.tokenizeLine2(p,u,a),S=x.tokens.length/2;for(let E=0;EV.trim());break;case"object":F=R.scope;break;default:continue}N.push({settings:R,selectors:F.map(V=>V.split(/ /))})}I.explanation=[];let P=0;for(;C+P({scopeName:e}))}function TK(t,e){const n=[];for(let r=0,i=e.length;r=0&&i>=0;)zw(t[r],n[i])&&(r-=1),i-=1;return r===-1}function PK(t,e,n){const r=[];for(const{selectors:i,settings:s}of t)for(const o of i)if(IK(o,e,n)){r.push(s);break}return r}function f6(t,e,n){const r=Object.entries(n.themes).filter(l=>l[1]).map(l=>({color:l[0],theme:l[1]})),i=r.map(l=>{const u=d2(t,e,{...n,theme:l.theme}),c=sf(u),f=typeof l.theme=="string"?l.theme:l.theme.name;return{tokens:u,state:c,theme:f}}),s=RK(...i.map(l=>l.tokens)),o=s[0].map((l,u)=>l.map((c,f)=>{const d={content:c.content,variants:{},offset:c.offset};return"includeExplanation"in n&&n.includeExplanation&&(d.explanation=c.explanation),s.forEach((h,p)=>{const{content:m,explanation:g,offset:b,...y}=h[u][f];d.variants[r[p].color]=y}),d})),a=i[0].state?new lu(Object.fromEntries(i.map(l=>{var u;return[l.theme,(u=l.state)==null?void 0:u.getInternalStack(l.theme)]})),i[0].state.lang):void 0;return a&&hm(o,a),o}function RK(...t){const e=t.map(()=>[]),n=t.length;for(let r=0;rl[r]),s=e.map(()=>[]);e.forEach((l,u)=>l.push(s[u]));const o=i.map(()=>0),a=i.map(l=>l[0]);for(;a.every(l=>l);){const l=Math.min(...a.map(u=>u.content.length));for(let u=0;ug[1]).map(g=>({color:g[0],theme:g[1]})).sort((g,b)=>g.color===u?-1:b.color===u?1:0);if(f.length===0)throw new sa("`themes` option must not be empty");const d=f6(t,e,n);if(l=sf(d),u&&!f.find(g=>g.color===u))throw new sa(`\`themes\` option must contain the defaultColor key \`${u}\``);const h=f.map(g=>t.getTheme(g.theme)),p=f.map(g=>g.color);s=d.map(g=>g.map(b=>NK(b,p,c,u))),l&&hm(s,l);const m=f.map(g=>Zp(g.theme,n));i=f.map((g,b)=>(b===0&&u?"":`${c+g.color}:`)+(Ko(h[b].fg,m[b])||"inherit")).join(";"),r=f.map((g,b)=>(b===0&&u?"":`${c+g.color}-bg:`)+(Ko(h[b].bg,m[b])||"inherit")).join(";"),o=`shiki-themes ${h.map(g=>g.name).join(" ")}`,a=u?void 0:[i,r].join(";")}else if("theme"in n){const u=Zp(n.theme,n);s=d2(t,e,n);const c=t.getTheme(n.theme);r=Ko(c.bg,u),i=Ko(c.fg,u),o=c.name,l=sf(s)}else throw new sa("Invalid options, either `theme` or `themes` must be provided");return{tokens:s,fg:i,bg:r,themeName:o,rootStyle:a,grammarState:l}}function NK(t,e,n,r){const i={content:t.content,explanation:t.explanation,offset:t.offset},s=e.map(l=>l6(t.variants[l])),o=new Set(s.flatMap(l=>Object.keys(l))),a={};return s.forEach((l,u)=>{for(const c of o){const f=l[c]||"inherit";if(u===0&&r)a[c]=f;else{const d=c==="color"?"":c==="background-color"?"-bg":`-${c}`,h=n+e[u]+(c==="color"?"":d);a[h]=f}}}),i.htmlStyle=a,i}function n0(t,e,n,r={meta:{},options:n,codeToHast:(i,s)=>n0(t,i,s),codeToTokens:(i,s)=>t0(t,i,s)}){var h,p;let i=e;for(const m of Qp(n))i=((h=m.preprocess)==null?void 0:h.call(r,i,n))||i;let{tokens:s,fg:o,bg:a,themeName:l,rootStyle:u,grammarState:c}=t0(t,i,n);const{mergeWhitespaces:f=!0}=n;f===!0?s=FK(s):f==="never"&&(s=LK(s));const d={...r,get source(){return i}};for(const m of Qp(n))s=((p=m.tokens)==null?void 0:p.call(d,s))||s;return MK(s,{...n,fg:o,bg:a,themeName:l,rootStyle:u},d,c)}function MK(t,e,n,r=sf(t)){var p,m,g;const i=Qp(e),s=[],o={type:"root",children:[]},{structure:a="classic",tabindex:l="0"}=e;let u={type:"element",tagName:"pre",properties:{class:`shiki ${e.themeName||""}`,style:e.rootStyle||`background-color:${e.bg};color:${e.fg}`,...l!==!1&&l!=null?{tabindex:l.toString()}:{},...Object.fromEntries(Array.from(Object.entries(e.meta||{})).filter(([b])=>!b.startsWith("_")))},children:[]},c={type:"element",tagName:"code",properties:{},children:s};const f=[],d={...n,structure:a,addClassToHast:o6,get source(){return n.source},get tokens(){return t},get options(){return e},get root(){return o},get pre(){return u},get code(){return c},get lines(){return f}};if(t.forEach((b,y)=>{var E,C;y&&(a==="inline"?o.children.push({type:"element",tagName:"br",properties:{},children:[]}):a==="classic"&&s.push({type:"text",value:` +`}));let x={type:"element",tagName:"span",properties:{class:"line"},children:[]},S=0;for(const w of b){let A={type:"element",tagName:"span",properties:{...w.htmlAttrs},children:[{type:"text",value:w.content}]};w.htmlStyle;const _=pK(w.htmlStyle||l6(w));_&&(A.properties.style=_);for(const O of i)A=((E=O==null?void 0:O.span)==null?void 0:E.call(d,A,y+1,S,x,w))||A;a==="inline"?o.children.push(A):a==="classic"&&x.children.push(A),S+=w.content.length}if(a==="classic"){for(const w of i)x=((C=w==null?void 0:w.line)==null?void 0:C.call(d,x,y+1))||x;f.push(x),s.push(x)}}),a==="classic"){for(const b of i)c=((p=b==null?void 0:b.code)==null?void 0:p.call(d,c))||c;u.children.push(c);for(const b of i)u=((m=b==null?void 0:b.pre)==null?void 0:m.call(d,u))||u;o.children.push(u)}let h=o;for(const b of i)h=((g=b==null?void 0:b.root)==null?void 0:g.call(d,h))||h;return r&&hm(h,r),h}function FK(t){return t.map(e=>{const n=[];let r="",i=0;return e.forEach((s,o)=>{const l=!(s.fontStyle&&s.fontStyle&hs.Underline);l&&s.content.match(/^\s+$/)&&e[o+1]?(i||(i=s.offset),r+=s.content):r?(l?n.push({...s,offset:i,content:r+s.content}):n.push({content:r,offset:i},s),i=0,r=""):n.push(s)}),n})}function LK(t){return t.map(e=>e.flatMap(n=>{if(n.content.match(/^\s+$/))return n;const r=n.content.match(/^(\s*)(.*?)(\s*)$/);if(!r)return n;const[,i,s,o]=r;if(!i&&!o)return n;const a=[{...n,offset:n.offset+i.length,content:s}];return i&&a.unshift({content:i,offset:n.offset}),o&&a.push({content:o,offset:n.offset+i.length+s.length}),a}))}function BK(t,e,n){var s;const r={meta:{},options:n,codeToHast:(o,a)=>n0(t,o,a),codeToTokens:(o,a)=>t0(t,o,a)};let i=oK(n0(t,e,n,r));for(const o of Qp(n))i=((s=o.postprocess)==null?void 0:s.call(r,i,n))||i;return i}const jw={light:"#333333",dark:"#bbbbbb"},Vw={light:"#fffffe",dark:"#1e1e1e"},Uw="__shiki_resolved";function h2(t){var a,l,u,c,f;if(t!=null&&t[Uw])return t;const e={...t};e.tokenColors&&!e.settings&&(e.settings=e.tokenColors,delete e.tokenColors),e.type||(e.type="dark"),e.colorReplacements={...e.colorReplacements},e.settings||(e.settings=[]);let{bg:n,fg:r}=e;if(!n||!r){const d=e.settings?e.settings.find(h=>!h.name&&!h.scope):void 0;(a=d==null?void 0:d.settings)!=null&&a.foreground&&(r=d.settings.foreground),(l=d==null?void 0:d.settings)!=null&&l.background&&(n=d.settings.background),!r&&((u=e==null?void 0:e.colors)!=null&&u["editor.foreground"])&&(r=e.colors["editor.foreground"]),!n&&((c=e==null?void 0:e.colors)!=null&&c["editor.background"])&&(n=e.colors["editor.background"]),r||(r=e.type==="light"?jw.light:jw.dark),n||(n=e.type==="light"?Vw.light:Vw.dark),e.fg=r,e.bg=n}e.settings[0]&&e.settings[0].settings&&!e.settings[0].scope||e.settings.unshift({settings:{foreground:e.fg,background:e.bg}});let i=0;const s=new Map;function o(d){var p;if(s.has(d))return s.get(d);i+=1;const h=`#${i.toString(16).padStart(8,"0").toLowerCase()}`;return(p=e.colorReplacements)!=null&&p[`#${h}`]?o(d):(s.set(d,h),h)}e.settings=e.settings.map(d=>{var g,b;const h=((g=d.settings)==null?void 0:g.foreground)&&!d.settings.foreground.startsWith("#"),p=((b=d.settings)==null?void 0:b.background)&&!d.settings.background.startsWith("#");if(!h&&!p)return d;const m={...d,settings:{...d.settings}};if(h){const y=o(d.settings.foreground);e.colorReplacements[y]=d.settings.foreground,m.settings.foreground=y}if(p){const y=o(d.settings.background);e.colorReplacements[y]=d.settings.background,m.settings.background=y}return m});for(const d of Object.keys(e.colors||{}))if((d==="editor.foreground"||d==="editor.background"||d.startsWith("terminal.ansi"))&&!((f=e.colors[d])!=null&&f.startsWith("#"))){const h=o(e.colors[d]);e.colorReplacements[h]=e.colors[d],e.colors[d]=h}return Object.defineProperty(e,Uw,{enumerable:!1,writable:!1,value:!0}),e}async function d6(t){return Array.from(new Set((await Promise.all(t.filter(e=>!cK(e)).map(async e=>await a6(e).then(n=>Array.isArray(n)?n:[n])))).flat()))}async function h6(t){return(await Promise.all(t.map(async n=>fK(n)?null:h2(await a6(n))))).filter(n=>!!n)}class $K extends GG{constructor(n,r,i,s={}){super(n);X(this,"_resolvedThemes",new Map);X(this,"_resolvedGrammars",new Map);X(this,"_langMap",new Map);X(this,"_langGraph",new Map);X(this,"_textmateThemeCache",new WeakMap);X(this,"_loadedThemesCache",null);X(this,"_loadedLanguagesCache",null);this._resolver=n,this._themes=r,this._langs=i,this._alias=s,this._themes.map(o=>this.loadTheme(o)),this.loadLanguages(this._langs)}getTheme(n){return typeof n=="string"?this._resolvedThemes.get(n):this.loadTheme(n)}loadTheme(n){const r=h2(n);return r.name&&(this._resolvedThemes.set(r.name,r),this._loadedThemesCache=null),r}getLoadedThemes(){return this._loadedThemesCache||(this._loadedThemesCache=[...this._resolvedThemes.keys()]),this._loadedThemesCache}setTheme(n){let r=this._textmateThemeCache.get(n);r||(r=Wp.createFromRawTheme(n),this._textmateThemeCache.set(n,r)),this._syncRegistry.setTheme(r)}getGrammar(n){if(this._alias[n]){const r=new Set([n]);for(;this._alias[n];){if(n=this._alias[n],r.has(n))throw new jn(`Circular alias \`${Array.from(r).join(" -> ")} -> ${n}\``);r.add(n)}}return this._resolvedGrammars.get(n)}loadLanguage(n){var o,a,l,u;if(this.getGrammar(n.name))return;const r=new Set([...this._langMap.values()].filter(c=>{var f;return(f=c.embeddedLangsLazy)==null?void 0:f.includes(n.name)}));this._resolver.addLanguage(n);const i={balancedBracketSelectors:n.balancedBracketSelectors||["*"],unbalancedBracketSelectors:n.unbalancedBracketSelectors||[]};this._syncRegistry._rawGrammars.set(n.scopeName,n);const s=this.loadGrammarWithConfiguration(n.scopeName,1,i);if(s.name=n.name,this._resolvedGrammars.set(n.name,s),n.aliases&&n.aliases.forEach(c=>{this._alias[c]=n.name}),this._loadedLanguagesCache=null,r.size)for(const c of r)this._resolvedGrammars.delete(c.name),this._loadedLanguagesCache=null,(a=(o=this._syncRegistry)==null?void 0:o._injectionGrammars)==null||a.delete(c.scopeName),(u=(l=this._syncRegistry)==null?void 0:l._grammars)==null||u.delete(c.scopeName),this.loadLanguage(this._langMap.get(c.name))}dispose(){super.dispose(),this._resolvedThemes.clear(),this._resolvedGrammars.clear(),this._langMap.clear(),this._langGraph.clear(),this._loadedThemesCache=null}loadLanguages(n){for(const s of n)this.resolveEmbeddedLanguages(s);const r=Array.from(this._langGraph.entries()),i=r.filter(([s,o])=>!o);if(i.length){const s=r.filter(([o,a])=>{var l;return a&&((l=a.embeddedLangs)==null?void 0:l.some(u=>i.map(([c])=>c).includes(u)))}).filter(o=>!i.includes(o));throw new jn(`Missing languages ${i.map(([o])=>`\`${o}\``).join(", ")}, required by ${s.map(([o])=>`\`${o}\``).join(", ")}`)}for(const[s,o]of r)this._resolver.addLanguage(o);for(const[s,o]of r)this.loadLanguage(o)}getLoadedLanguages(){return this._loadedLanguagesCache||(this._loadedLanguagesCache=[...new Set([...this._resolvedGrammars.keys(),...Object.keys(this._alias)])]),this._loadedLanguagesCache}resolveEmbeddedLanguages(n){if(this._langMap.set(n.name,n),this._langGraph.set(n.name,n),n.embeddedLangs)for(const r of n.embeddedLangs)this._langGraph.set(r,this._langMap.get(r))}}class zK{constructor(e,n){X(this,"_langs",new Map);X(this,"_scopeToLang",new Map);X(this,"_injections",new Map);X(this,"_onigLib");this._onigLib={createOnigScanner:r=>e.createScanner(r),createOnigString:r=>e.createString(r)},n.forEach(r=>this.addLanguage(r))}get onigLib(){return this._onigLib}getLangRegistration(e){return this._langs.get(e)}loadGrammar(e){return this._scopeToLang.get(e)}addLanguage(e){this._langs.set(e.name,e),e.aliases&&e.aliases.forEach(n=>{this._langs.set(n,e)}),this._scopeToLang.set(e.scopeName,e),e.injectTo&&e.injectTo.forEach(n=>{this._injections.get(n)||this._injections.set(n,[]),this._injections.get(n).push(e.scopeName)})}getInjections(e){const n=e.split(".");let r=[];for(let i=1;i<=n.length;i++){const s=n.slice(0,i).join(".");r=[...r,...this._injections.get(s)||[]]}return r}}let Bu=0;function jK(t){Bu+=1,t.warnings!==!1&&Bu>=10&&Bu%10===0&&console.warn(`[Shiki] ${Bu} instances have been created. Shiki is supposed to be used as a singleton, consider refactoring your code to cache your highlighter instance; Or call \`highlighter.dispose()\` to release unused instances.`);let e=!1;if(!t.engine)throw new jn("`engine` option is required for synchronous mode");const n=(t.langs||[]).flat(1),r=(t.themes||[]).flat(1).map(h2),i=new zK(t.engine,n),s=new $K(i,r,n,t.langAlias);let o;function a(y){g();const x=s.getGrammar(typeof y=="string"?y:y.name);if(!x)throw new jn(`Language \`${y}\` not found, you may need to load it first`);return x}function l(y){if(y==="none")return{bg:"",fg:"",name:"none",settings:[],type:"dark"};g();const x=s.getTheme(y);if(!x)throw new jn(`Theme \`${y}\` not found, you may need to load it first`);return x}function u(y){g();const x=l(y);o!==y&&(s.setTheme(x),o=y);const S=s.getColorMap();return{theme:x,colorMap:S}}function c(){return g(),s.getLoadedThemes()}function f(){return g(),s.getLoadedLanguages()}function d(...y){g(),s.loadLanguages(y.flat(1))}async function h(...y){return d(await d6(y))}function p(...y){g();for(const x of y.flat(1))s.loadTheme(x)}async function m(...y){return g(),p(await h6(y))}function g(){if(e)throw new jn("Shiki instance has been disposed")}function b(){e||(e=!0,s.dispose(),Bu-=1)}return{setTheme:u,getTheme:l,getLanguage:a,getLoadedThemes:c,getLoadedLanguages:f,loadLanguage:h,loadLanguageSync:d,loadTheme:m,loadThemeSync:p,dispose:b,[Symbol.dispose]:b}}async function VK(t={}){t.loadWasm;const[e,n,r]=await Promise.all([h6(t.themes||[]),d6(t.langs||[]),t.engine||oG(t.loadWasm||sG())]);return jK({...t,themes:e,langs:n,engine:r})}async function UK(t={}){const e=await VK(t);return{getLastGrammarState:(...n)=>DK(e,...n),codeToTokensBase:(n,r)=>d2(e,n,r),codeToTokensWithThemes:(n,r)=>f6(e,n,r),codeToTokens:(n,r)=>t0(e,n,r),codeToHast:(n,r)=>n0(e,n,r),codeToHtml:(n,r)=>BK(e,n,r),...e,getInternalContext:()=>e}}const ly=Gr({linkify:!0,typographer:!0});(async()=>{const t=await UK({themes:[og(()=>import("./vitesse-light-CVO1_9PV.js"),[]),og(()=>import("./vitesse-dark-D0r3Knsf.js"),[])],langs:[og(()=>import("./javascript-ySlJ1b_l.js"),[])]});ly.use(jq(t,{themes:{light:"vitesse-light",dark:"vitesse-dark"}}))})();function yl(t,e=!0){return e?ly.renderInline(t):ly.render(t)}var i1={},Hw;function HK(){return Hw||(Hw=1,(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.parse=t.enableErrorLogging=t.disableErrorLogging=t.setErrorLogger=void 0;let e=console.error;function n(w){e=w}t.setErrorLogger=n;function r(){e=()=>{}}t.disableErrorLogging=r;function i(){e=console.error}t.enableErrorLogging=i;function s(w){if(w!==void 0){if(w===null)return null;if(w==="")return"";w=w.replace(/\\+$/,A=>A.length%2===0?A:A.slice(0,-1));try{return JSON.parse(w)}catch(A){const[_,O]=w.trimLeft()[0]===":"?o(w,A):o(w,A,b);if(s.lastParseReminding=O,s.onExtraToken&&O.length>0){const I=O.trimRight();s.lastParseReminding=I,I.length>0&&s.onExtraToken(w,_,I)}return _}}}t.parse=s,(function(w){w.onExtraToken=(A,_,O)=>{e("parsed json with extra tokens:",{text:A,data:_,reminding:O})}})(s=t.parse||(t.parse={}));function o(w,A,_){const O=l[w[0]]||_;if(!O)throw e(`no parser registered for ${JSON.stringify(w[0])}:`,{s:w}),A;return O(w,A)}function a(w,A,_){return w[0]==='"'?p(w):w[0]==="'"?g(w):b(w,A,_)}const l={};function u(w){return w.trimLeft()}l[" "]=c,l["\r"]=c,l[` +`]=c,l[" "]=c;function c(w,A){return w=u(w),o(w,A)}l["["]=f;function f(w,A){w=w.substr(1);const _=[];for(w=u(w);w.length>0;){if(w[0]==="]"){w=w.substr(1);break}const O=o(w,A,(I,N)=>b(I,N,[",","]"]));_.push(O[0]),w=O[1],w=u(w),w[0]===","&&(w=w.substring(1),w=u(w))}return[_,w]}for(const w of"0123456789.-".slice())l[w]=d;function d(w){for(let A=0;A{const R=w.indexOf(P);return R===-1?w.length:R})),I=w.substring(0,O).trim(),N=w.substring(O);return[I,N]}l["{"]=y;function y(w,A){w=w.substr(1);const _={};for(w=u(w);w.length>0;){if(w[0]==="}"){w=w.substr(1);break}const O=a(w,A,[":","}"]),I=O[0];if(w=O[1],w=u(w),w[0]!==":"){_[I]=void 0;break}if(w=w.substr(1),w=u(w),w.length===0){_[I]=void 0;break}const N=o(w,A);_[I]=N[0],w=N[1],w=u(w),w[0]===","&&(w=w.substr(1),w=u(w))}return[_,w]}l.t=x;function x(w,A){return C(w,"true",!0,A)}l.f=S;function S(w,A){return C(w,"false",!1,A)}l.n=E;function E(w,A){return C(w,"null",null,A)}function C(w,A,_,O){for(let I=A.length;I>=1;I--)if(w.startsWith(A.slice(0,I)))return[_,w.slice(I)];{const I=JSON.stringify(w.slice(0,A.length));throw e(`unknown token starting with ${I}:`,{s:w}),O}}})(i1)),i1}var p6=HK();function qK(t){let e=null;try{e=JSON.parse(t.doc.toString())}catch{try{e=p6.parse(t.doc.toString())}catch{}}const n=Uv(t,At.JSON);return{data:e,pointers:n}}var GK=/[\u1680\u2000-\u200A\u202F\u205F\u3000]/,WK=/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE83\uDE86-\uDE89\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]/,KK=/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u09FC\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9-\u0AFF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D00-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19D9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1CD0-\u1CD2\u1CD4-\u1CF9\u1D00-\u1DF9\u1DFB-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE3E\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC00-\uDC4A\uDC50-\uDC59\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDE00-\uDE3E\uDE47\uDE50-\uDE83\uDE86-\uDE99\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC40\uDC50-\uDC59\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD47\uDD50-\uDD59]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6\uDD00-\uDD4A\uDD50-\uDD59]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/,s1={Space_Separator:GK,ID_Start:WK,ID_Continue:KK},Vt={isSpaceSeparator(t){return typeof t=="string"&&s1.Space_Separator.test(t)},isIdStartChar(t){return typeof t=="string"&&(t>="a"&&t<="z"||t>="A"&&t<="Z"||t==="$"||t==="_"||s1.ID_Start.test(t))},isIdContinueChar(t){return typeof t=="string"&&(t>="a"&&t<="z"||t>="A"&&t<="Z"||t>="0"&&t<="9"||t==="$"||t==="_"||t==="‌"||t==="‍"||s1.ID_Continue.test(t))},isDigit(t){return typeof t=="string"&&/[0-9]/.test(t)},isHexDigit(t){return typeof t=="string"&&/[0-9A-Fa-f]/.test(t)}};let uy,Hn,fs,r0,xo,li,fn,p2,gc;var XK=function(e,n){uy=String(e),Hn="start",fs=[],r0=0,xo=1,li=0,fn=void 0,p2=void 0,gc=void 0;do fn=YK(),QK[Hn]();while(fn.type!=="eof");return typeof n=="function"?cy({"":gc},"",n):gc};function cy(t,e,n){const r=t[e];if(r!=null&&typeof r=="object")if(Array.isArray(r))for(let i=0;i0;){const n=bs();if(!Vt.isHexDigit(n))throw yt(J());t+=J()}return String.fromCodePoint(parseInt(t,16))}const JK={start(){if(fn.type==="eof")throw Io();s1()},beforePropertyName(){switch(fn.type){case"identifier":case"string":h2=fn.value,Hn="afterPropertyName";return;case"punctuator":Jd();return;case"eof":throw Io()}},afterPropertyName(){if(fn.type==="eof")throw Io();Hn="beforePropertyValue"},beforePropertyValue(){if(fn.type==="eof")throw Io();s1()},beforeArrayValue(){if(fn.type==="eof")throw Io();if(fn.type==="punctuator"&&fn.value==="]"){Jd();return}s1()},afterPropertyValue(){if(fn.type==="eof")throw Io();switch(fn.value){case",":Hn="beforePropertyName";return;case"}":Jd()}},afterArrayValue(){if(fn.type==="eof")throw Io();switch(fn.value){case",":Hn="beforeArrayValue";return;case"]":Jd()}},end(){}};function s1(){let t;switch(fn.type){case"punctuator":switch(fn.value){case"{":t={};break;case"[":t=[];break}break;case"null":case"boolean":case"numeric":case"string":t=fn.value;break}if(gc===void 0)gc=t;else{const e=fs[fs.length-1];Array.isArray(e)?e.push(t):Object.defineProperty(e,h2,{value:t,writable:!0,enumerable:!0,configurable:!0})}if(t!==null&&typeof t=="object")fs.push(t),Array.isArray(t)?Hn="beforeArrayValue":Hn="beforePropertyName";else{const e=fs[fs.length-1];e==null?Hn="end":Array.isArray(e)?Hn="afterArrayValue":Hn="afterPropertyValue"}}function Jd(){fs.pop();const t=fs[fs.length-1];t==null?Hn="end":Array.isArray(t)?Hn="afterArrayValue":Hn="afterPropertyValue"}function yt(t){return r0(t===void 0?`JSON5: invalid end of input at ${xo}:${li}`:`JSON5: invalid character '${m6(t)}' at ${xo}:${li}`)}function Io(){return r0(`JSON5: invalid end of input at ${xo}:${li}`)}function Hw(){return li-=5,r0(`JSON5: invalid identifier character at ${xo}:${li}`)}function ZK(t){console.warn(`JSON5: '${m6(t)}' in strings is not valid ECMAScript; consider escaping`)}function m6(t){const e={"'":"\\'",'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t","\v":"\\v","\0":"\\0","\u2028":"\\u2028","\u2029":"\\u2029"};if(e[t])return e[t];if(t<" "){const n=t.charCodeAt(0).toString(16);return"\\x"+("00"+n).substring(n.length)}return t}function r0(t){const e=new SyntaxError(t);return e.lineNumber=xo,e.columnNumber=li,e}var QK=function(e,n,r){const i=[];let s="",o,a,l="",u;if(n!=null&&typeof n=="object"&&!Array.isArray(n)&&(r=n.space,u=n.quote,n=n.replacer),typeof n=="function")a=n;else if(Array.isArray(n)){o=[];for(const m of n){let g;typeof m=="string"?g=m:(typeof m=="number"||m instanceof String||m instanceof Number)&&(g=String(m)),g!==void 0&&o.indexOf(g)<0&&o.push(g)}}return r instanceof Number?r=Number(r):r instanceof String&&(r=String(r)),typeof r=="number"?r>0&&(r=Math.min(10,Math.floor(r)),l=" ".substr(0,r)):typeof r=="string"&&(l=r.substr(0,10)),c("",{"":e});function c(m,g){let b=g[m];switch(b!=null&&(typeof b.toJSON5=="function"?b=b.toJSON5(m):typeof b.toJSON=="function"&&(b=b.toJSON(m))),a&&(b=a.call(g,m,b)),b instanceof Number?b=Number(b):b instanceof String?b=String(b):b instanceof Boolean&&(b=b.valueOf()),b){case null:return"null";case!0:return"true";case!1:return"false"}if(typeof b=="string")return f(b);if(typeof b=="number")return String(b);if(typeof b=="object")return Array.isArray(b)?p(b):d(b)}function f(m){const g={"'":.1,'"':.2},b={"'":"\\'",'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t","\v":"\\v","\0":"\\0","\u2028":"\\u2028","\u2029":"\\u2029"};let y="";for(let S=0;Sg[S]=0)throw TypeError("Converting circular structure to JSON5");i.push(m);let g=s;s=s+l;let b=o||Object.keys(m),y=[];for(const S of b){const E=c(S,m);if(E!==void 0){let C=h(S)+":";l!==""&&(C+=" "),C+=E,y.push(C)}}let x;if(y.length===0)x="{}";else{let S;if(l==="")S=y.join(","),x="{"+S+"}";else{let E=`, +`&&J(),"";case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":throw yt(J());case void 0:throw yt(J())}return J()}function ZK(){let t="",e=bs();if(!Vt.isHexDigit(e)||(t+=J(),e=bs(),!Vt.isHexDigit(e)))throw yt(J());return t+=J(),String.fromCodePoint(parseInt(t,16))}function fy(){let t="",e=4;for(;e-- >0;){const n=bs();if(!Vt.isHexDigit(n))throw yt(J());t+=J()}return String.fromCodePoint(parseInt(t,16))}const QK={start(){if(fn.type==="eof")throw Po();o1()},beforePropertyName(){switch(fn.type){case"identifier":case"string":p2=fn.value,Hn="afterPropertyName";return;case"punctuator":Zd();return;case"eof":throw Po()}},afterPropertyName(){if(fn.type==="eof")throw Po();Hn="beforePropertyValue"},beforePropertyValue(){if(fn.type==="eof")throw Po();o1()},beforeArrayValue(){if(fn.type==="eof")throw Po();if(fn.type==="punctuator"&&fn.value==="]"){Zd();return}o1()},afterPropertyValue(){if(fn.type==="eof")throw Po();switch(fn.value){case",":Hn="beforePropertyName";return;case"}":Zd()}},afterArrayValue(){if(fn.type==="eof")throw Po();switch(fn.value){case",":Hn="beforeArrayValue";return;case"]":Zd()}},end(){}};function o1(){let t;switch(fn.type){case"punctuator":switch(fn.value){case"{":t={};break;case"[":t=[];break}break;case"null":case"boolean":case"numeric":case"string":t=fn.value;break}if(gc===void 0)gc=t;else{const e=fs[fs.length-1];Array.isArray(e)?e.push(t):Object.defineProperty(e,p2,{value:t,writable:!0,enumerable:!0,configurable:!0})}if(t!==null&&typeof t=="object")fs.push(t),Array.isArray(t)?Hn="beforeArrayValue":Hn="beforePropertyName";else{const e=fs[fs.length-1];e==null?Hn="end":Array.isArray(e)?Hn="afterArrayValue":Hn="afterPropertyValue"}}function Zd(){fs.pop();const t=fs[fs.length-1];t==null?Hn="end":Array.isArray(t)?Hn="afterArrayValue":Hn="afterPropertyValue"}function yt(t){return i0(t===void 0?`JSON5: invalid end of input at ${xo}:${li}`:`JSON5: invalid character '${g6(t)}' at ${xo}:${li}`)}function Po(){return i0(`JSON5: invalid end of input at ${xo}:${li}`)}function qw(){return li-=5,i0(`JSON5: invalid identifier character at ${xo}:${li}`)}function eX(t){console.warn(`JSON5: '${g6(t)}' in strings is not valid ECMAScript; consider escaping`)}function g6(t){const e={"'":"\\'",'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t","\v":"\\v","\0":"\\0","\u2028":"\\u2028","\u2029":"\\u2029"};if(e[t])return e[t];if(t<" "){const n=t.charCodeAt(0).toString(16);return"\\x"+("00"+n).substring(n.length)}return t}function i0(t){const e=new SyntaxError(t);return e.lineNumber=xo,e.columnNumber=li,e}var tX=function(e,n,r){const i=[];let s="",o,a,l="",u;if(n!=null&&typeof n=="object"&&!Array.isArray(n)&&(r=n.space,u=n.quote,n=n.replacer),typeof n=="function")a=n;else if(Array.isArray(n)){o=[];for(const m of n){let g;typeof m=="string"?g=m:(typeof m=="number"||m instanceof String||m instanceof Number)&&(g=String(m)),g!==void 0&&o.indexOf(g)<0&&o.push(g)}}return r instanceof Number?r=Number(r):r instanceof String&&(r=String(r)),typeof r=="number"?r>0&&(r=Math.min(10,Math.floor(r)),l=" ".substr(0,r)):typeof r=="string"&&(l=r.substr(0,10)),c("",{"":e});function c(m,g){let b=g[m];switch(b!=null&&(typeof b.toJSON5=="function"?b=b.toJSON5(m):typeof b.toJSON=="function"&&(b=b.toJSON(m))),a&&(b=a.call(g,m,b)),b instanceof Number?b=Number(b):b instanceof String?b=String(b):b instanceof Boolean&&(b=b.valueOf()),b){case null:return"null";case!0:return"true";case!1:return"false"}if(typeof b=="string")return f(b);if(typeof b=="number")return String(b);if(typeof b=="object")return Array.isArray(b)?p(b):d(b)}function f(m){const g={"'":.1,'"':.2},b={"'":"\\'",'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t","\v":"\\v","\0":"\\0","\u2028":"\\u2028","\u2029":"\\u2029"};let y="";for(let S=0;Sg[S]=0)throw TypeError("Converting circular structure to JSON5");i.push(m);let g=s;s=s+l;let b=o||Object.keys(m),y=[];for(const S of b){const E=c(S,m);if(E!==void 0){let C=h(S)+":";l!==""&&(C+=" "),C+=E,y.push(C)}}let x;if(y.length===0)x="{}";else{let S;if(l==="")S=y.join(","),x="{"+S+"}";else{let E=`, `+s;S=y.join(E),x=`{ `+s+S+`, `+g+"}"}}return i.pop(),s=g,x}function h(m){if(m.length===0)return f(m);const g=String.fromCodePoint(m.codePointAt(0));if(!Vt.isIdStartChar(g))return f(m);for(let b=g.length;b=0)throw TypeError("Converting circular structure to JSON5");i.push(m);let g=s;s=s+l;let b=[];for(let x=0;x!!t&&typeof t=="object"&&t[Wr]===p2,Pa=t=>!!t&&typeof t=="object"&&t[Wr]===fy,cu=t=>!!t&&typeof t=="object"&&t[Wr]===io,Ot=t=>!!t&&typeof t=="object"&&t[Wr]===g6,dt=t=>!!t&&typeof t=="object"&&t[Wr]===Hi,fu=t=>!!t&&typeof t=="object"&&t[Wr]===uu;function Pt(t){if(t&&typeof t=="object")switch(t[Wr]){case io:case uu:return!0}return!1}function Rt(t){if(t&&typeof t=="object")switch(t[Wr]){case p2:case io:case Hi:case uu:return!0}return!1}const b6=t=>(dt(t)||Pt(t))&&!!t.anchor,or=Symbol("break visit"),y6=Symbol("skip children"),Bi=Symbol("remove node");function Ra(t,e){const n=v6(e);Pa(t)?rl(null,t.contents,n,Object.freeze([t]))===Bi&&(t.contents=null):rl(null,t,n,Object.freeze([]))}Ra.BREAK=or;Ra.SKIP=y6;Ra.REMOVE=Bi;function rl(t,e,n,r){const i=x6(t,e,n,r);if(Rt(i)||Ot(i))return S6(t,r,i),rl(t,i,n,r);if(typeof i!="symbol"){if(Pt(e)){r=Object.freeze(r.concat(e));for(let s=0;st.replace(/[!,[\]{}]/g,e=>rX[e]);class Bn{constructor(e,n){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},Bn.defaultYaml,e),this.tags=Object.assign({},Bn.defaultTags,n)}clone(){const e=new Bn(this.yaml,this.tags);return e.docStart=this.docStart,e}atDocument(){const e=new Bn(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:Bn.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},Bn.defaultTags);break}return e}add(e,n){this.atNextDocument&&(this.yaml={explicit:Bn.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},Bn.defaultTags),this.atNextDocument=!1);const r=e.trim().split(/[ \t]+/),i=r.shift();switch(i){case"%TAG":{if(r.length!==2&&(n(0,"%TAG directive should contain exactly two parts"),r.length<2))return!1;const[s,o]=r;return this.tags[s]=o,!0}case"%YAML":{if(this.yaml.explicit=!0,r.length!==1)return n(0,"%YAML directive should contain exactly one part"),!1;const[s]=r;if(s==="1.1"||s==="1.2")return this.yaml.version=s,!0;{const o=/^\d+\.\d+$/.test(s);return n(6,`Unsupported YAML version ${s}`,o),!1}}default:return n(0,`Unknown directive ${i}`,!0),!1}}tagName(e,n){if(e==="!")return"!";if(e[0]!=="!")return n(`Not a valid tag: ${e}`),null;if(e[1]==="<"){const o=e.slice(2,-1);return o==="!"||o==="!!"?(n(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==">"&&n("Verbatim tags must end with a >"),o)}const[,r,i]=e.match(/^(.*!)([^!]*)$/s);i||n(`The ${e} tag has no suffix`);const s=this.tags[r];if(s)try{return s+decodeURIComponent(i)}catch(o){return n(String(o)),null}return r==="!"?e:(n(`Could not resolve tag: ${e}`),null)}tagString(e){for(const[n,r]of Object.entries(this.tags))if(e.startsWith(r))return n+iX(e.substring(r.length));return e[0]==="!"?e:`!<${e}>`}toString(e){const n=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],r=Object.entries(this.tags);let i;if(e&&r.length>0&&Rt(e.contents)){const s={};Ra(e.contents,(o,a)=>{Rt(a)&&a.tag&&(s[a.tag]=!0)}),i=Object.keys(s)}else i=[];for(const[s,o]of r)s==="!!"&&o==="tag:yaml.org,2002:"||(!e||i.some(a=>a.startsWith(o)))&&n.push(`%TAG ${s} ${o}`);return n.join(` -`)}}Bn.defaultYaml={explicit:!1,version:"1.2"};Bn.defaultTags={"!!":"tag:yaml.org,2002:"};function E6(t){if(/[\x00-\x19\s,[\]{}]/.test(t)){const n=`Anchor must not contain whitespace or control characters: ${JSON.stringify(t)}`;throw new Error(n)}return!0}function w6(t){const e=new Set;return Ra(t,{Value(n,r){r.anchor&&e.add(r.anchor)}}),e}function _6(t,e){for(let n=1;;++n){const r=`${t}${n}`;if(!e.has(r))return r}}function sX(t,e){const n=[],r=new Map;let i=null;return{onAnchor:s=>{n.push(s),i??(i=w6(t));const o=_6(e,i);return i.add(o),o},setAnchors:()=>{for(const s of n){const o=r.get(s);if(typeof o=="object"&&o.anchor&&(dt(o.node)||Pt(o.node)))o.node.anchor=o.anchor;else{const a=new Error("Failed to resolve repeated object (this should not happen)");throw a.source=s,a}}},sourceObjects:r}}function sl(t,e,n,r){if(r&&typeof r=="object")if(Array.isArray(r))for(let i=0,s=r.length;iUr(r,String(i),n));if(t&&typeof t.toJSON=="function"){if(!n||!b6(t))return t.toJSON(e,n);const r={aliasCount:0,count:1,res:void 0};n.anchors.set(t,r),n.onCreate=s=>{r.res=s,delete n.onCreate};const i=t.toJSON(e,n);return n.onCreate&&n.onCreate(i),i}return typeof t=="bigint"&&!(n!=null&&n.keep)?Number(t):t}class m2{constructor(e){Object.defineProperty(this,Wr,{value:e})}clone(){const e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:n,maxAliasCount:r,onAnchor:i,reviver:s}={}){if(!Pa(e))throw new TypeError("A document argument is required");const o={anchors:new Map,doc:e,keep:!0,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof r=="number"?r:100},a=Ur(this,"",o);if(typeof i=="function")for(const{count:l,res:u}of o.anchors.values())i(u,l);return typeof s=="function"?sl(s,{"":a},"",a):a}}class pm extends m2{constructor(e){super(p2),this.source=e,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(e,n){let r;n!=null&&n.aliasResolveCache?r=n.aliasResolveCache:(r=[],Ra(e,{Node:(s,o)=>{(Ao(o)||b6(o))&&r.push(o)}}),n&&(n.aliasResolveCache=r));let i;for(const s of r){if(s===this)break;s.anchor===this.source&&(i=s)}return i}toJSON(e,n){if(!n)return{source:this.source};const{anchors:r,doc:i,maxAliasCount:s}=n,o=this.resolve(i,n);if(!o){const l=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(l)}let a=r.get(o);if(a||(Ur(o,null,n),a=r.get(o)),!a||a.res===void 0){const l="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(l)}if(s>=0&&(a.count+=1,a.aliasCount===0&&(a.aliasCount=Vh(i,o,r)),a.count*a.aliasCount>s)){const l="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(l)}return a.res}toString(e,n,r){const i=`*${this.source}`;if(e){if(E6(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){const s=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(s)}if(e.implicitKey)return`${i} `}return i}}function Vh(t,e,n){if(Ao(e)){const r=e.resolve(t),i=n&&r&&n.get(r);return i?i.count*i.aliasCount:0}else if(Pt(e)){let r=0;for(const i of e.items){const s=Vh(t,i,n);s>r&&(r=s)}return r}else if(Ot(e)){const r=Vh(t,e.key,n),i=Vh(t,e.value,n);return Math.max(r,i)}return 1}const C6=t=>!t||typeof t!="function"&&typeof t!="object";class Ie extends m2{constructor(e){super(Hi),this.value=e}toJSON(e,n){return n!=null&&n.keep?this.value:Ur(this.value,e,n)}toString(){return String(this.value)}}Ie.BLOCK_FOLDED="BLOCK_FOLDED";Ie.BLOCK_LITERAL="BLOCK_LITERAL";Ie.PLAIN="PLAIN";Ie.QUOTE_DOUBLE="QUOTE_DOUBLE";Ie.QUOTE_SINGLE="QUOTE_SINGLE";const oX="tag:yaml.org,2002:";function aX(t,e,n){if(e){const r=n.filter(s=>s.tag===e),i=r.find(s=>!s.format)??r[0];if(!i)throw new Error(`Tag ${e} not found`);return i}return n.find(r=>{var i;return((i=r.identify)==null?void 0:i.call(r,t))&&!r.format})}function of(t,e,n){var f,d,h;if(Pa(t)&&(t=t.contents),Rt(t))return t;if(Ot(t)){const p=(d=(f=n.schema[io]).createNode)==null?void 0:d.call(f,n.schema,null,n);return p.items.push(t),p}(t instanceof String||t instanceof Number||t instanceof Boolean||typeof BigInt<"u"&&t instanceof BigInt)&&(t=t.valueOf());const{aliasDuplicateObjects:r,onAnchor:i,onTagObj:s,schema:o,sourceObjects:a}=n;let l;if(r&&t&&typeof t=="object"){if(l=a.get(t),l)return l.anchor??(l.anchor=i(t)),new pm(l.anchor);l={anchor:null,node:null},a.set(t,l)}e!=null&&e.startsWith("!!")&&(e=oX+e.slice(2));let u=aX(t,e,o.tags);if(!u){if(t&&typeof t.toJSON=="function"&&(t=t.toJSON()),!t||typeof t!="object"){const p=new Ie(t);return l&&(l.node=p),p}u=t instanceof Map?o[io]:Symbol.iterator in Object(t)?o[uu]:o[io]}s&&(s(u),delete n.onTagObj);const c=u!=null&&u.createNode?u.createNode(n.schema,t,n):typeof((h=u==null?void 0:u.nodeClass)==null?void 0:h.from)=="function"?u.nodeClass.from(n.schema,t,n):new Ie(t);return e?c.tag=e:u.default||(c.tag=u.tag),l&&(l.node=c),c}function i0(t,e,n){let r=n;for(let i=e.length-1;i>=0;--i){const s=e[i];if(typeof s=="number"&&Number.isInteger(s)&&s>=0){const o=[];o[s]=r,r=o}else r=new Map([[s,r]])}return of(r,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:t,sourceObjects:new Map})}const Qu=t=>t==null||typeof t=="object"&&!!t[Symbol.iterator]().next().done;class A6 extends m2{constructor(e,n){super(e),Object.defineProperty(this,"schema",{value:n,configurable:!0,enumerable:!1,writable:!0})}clone(e){const n=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(n.schema=e),n.items=n.items.map(r=>Rt(r)||Ot(r)?r.clone(e):r),this.range&&(n.range=this.range.slice()),n}addIn(e,n){if(Qu(e))this.add(n);else{const[r,...i]=e,s=this.get(r,!0);if(Pt(s))s.addIn(i,n);else if(s===void 0&&this.schema)this.set(r,i0(this.schema,i,n));else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${i}`)}}deleteIn(e){const[n,...r]=e;if(r.length===0)return this.delete(n);const i=this.get(n,!0);if(Pt(i))return i.deleteIn(r);throw new Error(`Expected YAML collection at ${n}. Remaining path: ${r}`)}getIn(e,n){const[r,...i]=e,s=this.get(r,!0);return i.length===0?!n&&dt(s)?s.value:s:Pt(s)?s.getIn(i,n):void 0}hasAllNullValues(e){return this.items.every(n=>{if(!Ot(n))return!1;const r=n.value;return r==null||e&&dt(r)&&r.value==null&&!r.commentBefore&&!r.comment&&!r.tag})}hasIn(e){const[n,...r]=e;if(r.length===0)return this.has(n);const i=this.get(n,!0);return Pt(i)?i.hasIn(r):!1}setIn(e,n){const[r,...i]=e;if(i.length===0)this.set(r,n);else{const s=this.get(r,!0);if(Pt(s))s.setIn(i,n);else if(s===void 0&&this.schema)this.set(r,i0(this.schema,i,n));else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${i}`)}}}const lX=t=>t.replace(/^(?!$)(?: $)?/gm,"#");function ps(t,e){return/^\n+$/.test(t)?t.substring(1):e?t.replace(/^(?! *$)/gm,e):t}const Xo=(t,e,n)=>t.endsWith(` +`+g+"]"}return i.pop(),s=g,y}};const nX={parse:XK,stringify:tX};var rX=nX;function iX(t){const e=t.doc.toString();let n=null;try{n=rX.parse(e)}catch{try{n=p6.parse(e)}catch{}}const r=Uv(t,At.JSON5);return{data:n,pointers:r}}const m2=Symbol.for("yaml.alias"),dy=Symbol.for("yaml.document"),io=Symbol.for("yaml.map"),b6=Symbol.for("yaml.pair"),Hi=Symbol.for("yaml.scalar"),uu=Symbol.for("yaml.seq"),Wr=Symbol.for("yaml.node.type"),Do=t=>!!t&&typeof t=="object"&&t[Wr]===m2,Pa=t=>!!t&&typeof t=="object"&&t[Wr]===dy,cu=t=>!!t&&typeof t=="object"&&t[Wr]===io,Ot=t=>!!t&&typeof t=="object"&&t[Wr]===b6,dt=t=>!!t&&typeof t=="object"&&t[Wr]===Hi,fu=t=>!!t&&typeof t=="object"&&t[Wr]===uu;function Pt(t){if(t&&typeof t=="object")switch(t[Wr]){case io:case uu:return!0}return!1}function Rt(t){if(t&&typeof t=="object")switch(t[Wr]){case m2:case io:case Hi:case uu:return!0}return!1}const y6=t=>(dt(t)||Pt(t))&&!!t.anchor,or=Symbol("break visit"),v6=Symbol("skip children"),Bi=Symbol("remove node");function Ra(t,e){const n=x6(e);Pa(t)?rl(null,t.contents,n,Object.freeze([t]))===Bi&&(t.contents=null):rl(null,t,n,Object.freeze([]))}Ra.BREAK=or;Ra.SKIP=v6;Ra.REMOVE=Bi;function rl(t,e,n,r){const i=S6(t,e,n,r);if(Rt(i)||Ot(i))return E6(t,r,i),rl(t,i,n,r);if(typeof i!="symbol"){if(Pt(e)){r=Object.freeze(r.concat(e));for(let s=0;st.replace(/[!,[\]{}]/g,e=>sX[e]);class Bn{constructor(e,n){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},Bn.defaultYaml,e),this.tags=Object.assign({},Bn.defaultTags,n)}clone(){const e=new Bn(this.yaml,this.tags);return e.docStart=this.docStart,e}atDocument(){const e=new Bn(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:Bn.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},Bn.defaultTags);break}return e}add(e,n){this.atNextDocument&&(this.yaml={explicit:Bn.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},Bn.defaultTags),this.atNextDocument=!1);const r=e.trim().split(/[ \t]+/),i=r.shift();switch(i){case"%TAG":{if(r.length!==2&&(n(0,"%TAG directive should contain exactly two parts"),r.length<2))return!1;const[s,o]=r;return this.tags[s]=o,!0}case"%YAML":{if(this.yaml.explicit=!0,r.length!==1)return n(0,"%YAML directive should contain exactly one part"),!1;const[s]=r;if(s==="1.1"||s==="1.2")return this.yaml.version=s,!0;{const o=/^\d+\.\d+$/.test(s);return n(6,`Unsupported YAML version ${s}`,o),!1}}default:return n(0,`Unknown directive ${i}`,!0),!1}}tagName(e,n){if(e==="!")return"!";if(e[0]!=="!")return n(`Not a valid tag: ${e}`),null;if(e[1]==="<"){const o=e.slice(2,-1);return o==="!"||o==="!!"?(n(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==">"&&n("Verbatim tags must end with a >"),o)}const[,r,i]=e.match(/^(.*!)([^!]*)$/s);i||n(`The ${e} tag has no suffix`);const s=this.tags[r];if(s)try{return s+decodeURIComponent(i)}catch(o){return n(String(o)),null}return r==="!"?e:(n(`Could not resolve tag: ${e}`),null)}tagString(e){for(const[n,r]of Object.entries(this.tags))if(e.startsWith(r))return n+oX(e.substring(r.length));return e[0]==="!"?e:`!<${e}>`}toString(e){const n=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],r=Object.entries(this.tags);let i;if(e&&r.length>0&&Rt(e.contents)){const s={};Ra(e.contents,(o,a)=>{Rt(a)&&a.tag&&(s[a.tag]=!0)}),i=Object.keys(s)}else i=[];for(const[s,o]of r)s==="!!"&&o==="tag:yaml.org,2002:"||(!e||i.some(a=>a.startsWith(o)))&&n.push(`%TAG ${s} ${o}`);return n.join(` +`)}}Bn.defaultYaml={explicit:!1,version:"1.2"};Bn.defaultTags={"!!":"tag:yaml.org,2002:"};function w6(t){if(/[\x00-\x19\s,[\]{}]/.test(t)){const n=`Anchor must not contain whitespace or control characters: ${JSON.stringify(t)}`;throw new Error(n)}return!0}function _6(t){const e=new Set;return Ra(t,{Value(n,r){r.anchor&&e.add(r.anchor)}}),e}function C6(t,e){for(let n=1;;++n){const r=`${t}${n}`;if(!e.has(r))return r}}function aX(t,e){const n=[],r=new Map;let i=null;return{onAnchor:s=>{n.push(s),i??(i=_6(t));const o=C6(e,i);return i.add(o),o},setAnchors:()=>{for(const s of n){const o=r.get(s);if(typeof o=="object"&&o.anchor&&(dt(o.node)||Pt(o.node)))o.node.anchor=o.anchor;else{const a=new Error("Failed to resolve repeated object (this should not happen)");throw a.source=s,a}}},sourceObjects:r}}function sl(t,e,n,r){if(r&&typeof r=="object")if(Array.isArray(r))for(let i=0,s=r.length;iUr(r,String(i),n));if(t&&typeof t.toJSON=="function"){if(!n||!y6(t))return t.toJSON(e,n);const r={aliasCount:0,count:1,res:void 0};n.anchors.set(t,r),n.onCreate=s=>{r.res=s,delete n.onCreate};const i=t.toJSON(e,n);return n.onCreate&&n.onCreate(i),i}return typeof t=="bigint"&&!(n!=null&&n.keep)?Number(t):t}class g2{constructor(e){Object.defineProperty(this,Wr,{value:e})}clone(){const e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:n,maxAliasCount:r,onAnchor:i,reviver:s}={}){if(!Pa(e))throw new TypeError("A document argument is required");const o={anchors:new Map,doc:e,keep:!0,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof r=="number"?r:100},a=Ur(this,"",o);if(typeof i=="function")for(const{count:l,res:u}of o.anchors.values())i(u,l);return typeof s=="function"?sl(s,{"":a},"",a):a}}class mm extends g2{constructor(e){super(m2),this.source=e,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(e,n){let r;n!=null&&n.aliasResolveCache?r=n.aliasResolveCache:(r=[],Ra(e,{Node:(s,o)=>{(Do(o)||y6(o))&&r.push(o)}}),n&&(n.aliasResolveCache=r));let i;for(const s of r){if(s===this)break;s.anchor===this.source&&(i=s)}return i}toJSON(e,n){if(!n)return{source:this.source};const{anchors:r,doc:i,maxAliasCount:s}=n,o=this.resolve(i,n);if(!o){const l=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(l)}let a=r.get(o);if(a||(Ur(o,null,n),a=r.get(o)),!a||a.res===void 0){const l="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(l)}if(s>=0&&(a.count+=1,a.aliasCount===0&&(a.aliasCount=Uh(i,o,r)),a.count*a.aliasCount>s)){const l="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(l)}return a.res}toString(e,n,r){const i=`*${this.source}`;if(e){if(w6(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){const s=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(s)}if(e.implicitKey)return`${i} `}return i}}function Uh(t,e,n){if(Do(e)){const r=e.resolve(t),i=n&&r&&n.get(r);return i?i.count*i.aliasCount:0}else if(Pt(e)){let r=0;for(const i of e.items){const s=Uh(t,i,n);s>r&&(r=s)}return r}else if(Ot(e)){const r=Uh(t,e.key,n),i=Uh(t,e.value,n);return Math.max(r,i)}return 1}const A6=t=>!t||typeof t!="function"&&typeof t!="object";class Ie extends g2{constructor(e){super(Hi),this.value=e}toJSON(e,n){return n!=null&&n.keep?this.value:Ur(this.value,e,n)}toString(){return String(this.value)}}Ie.BLOCK_FOLDED="BLOCK_FOLDED";Ie.BLOCK_LITERAL="BLOCK_LITERAL";Ie.PLAIN="PLAIN";Ie.QUOTE_DOUBLE="QUOTE_DOUBLE";Ie.QUOTE_SINGLE="QUOTE_SINGLE";const lX="tag:yaml.org,2002:";function uX(t,e,n){if(e){const r=n.filter(s=>s.tag===e),i=r.find(s=>!s.format)??r[0];if(!i)throw new Error(`Tag ${e} not found`);return i}return n.find(r=>{var i;return((i=r.identify)==null?void 0:i.call(r,t))&&!r.format})}function of(t,e,n){var f,d,h;if(Pa(t)&&(t=t.contents),Rt(t))return t;if(Ot(t)){const p=(d=(f=n.schema[io]).createNode)==null?void 0:d.call(f,n.schema,null,n);return p.items.push(t),p}(t instanceof String||t instanceof Number||t instanceof Boolean||typeof BigInt<"u"&&t instanceof BigInt)&&(t=t.valueOf());const{aliasDuplicateObjects:r,onAnchor:i,onTagObj:s,schema:o,sourceObjects:a}=n;let l;if(r&&t&&typeof t=="object"){if(l=a.get(t),l)return l.anchor??(l.anchor=i(t)),new mm(l.anchor);l={anchor:null,node:null},a.set(t,l)}e!=null&&e.startsWith("!!")&&(e=lX+e.slice(2));let u=uX(t,e,o.tags);if(!u){if(t&&typeof t.toJSON=="function"&&(t=t.toJSON()),!t||typeof t!="object"){const p=new Ie(t);return l&&(l.node=p),p}u=t instanceof Map?o[io]:Symbol.iterator in Object(t)?o[uu]:o[io]}s&&(s(u),delete n.onTagObj);const c=u!=null&&u.createNode?u.createNode(n.schema,t,n):typeof((h=u==null?void 0:u.nodeClass)==null?void 0:h.from)=="function"?u.nodeClass.from(n.schema,t,n):new Ie(t);return e?c.tag=e:u.default||(c.tag=u.tag),l&&(l.node=c),c}function s0(t,e,n){let r=n;for(let i=e.length-1;i>=0;--i){const s=e[i];if(typeof s=="number"&&Number.isInteger(s)&&s>=0){const o=[];o[s]=r,r=o}else r=new Map([[s,r]])}return of(r,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:t,sourceObjects:new Map})}const Qu=t=>t==null||typeof t=="object"&&!!t[Symbol.iterator]().next().done;class D6 extends g2{constructor(e,n){super(e),Object.defineProperty(this,"schema",{value:n,configurable:!0,enumerable:!1,writable:!0})}clone(e){const n=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(n.schema=e),n.items=n.items.map(r=>Rt(r)||Ot(r)?r.clone(e):r),this.range&&(n.range=this.range.slice()),n}addIn(e,n){if(Qu(e))this.add(n);else{const[r,...i]=e,s=this.get(r,!0);if(Pt(s))s.addIn(i,n);else if(s===void 0&&this.schema)this.set(r,s0(this.schema,i,n));else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${i}`)}}deleteIn(e){const[n,...r]=e;if(r.length===0)return this.delete(n);const i=this.get(n,!0);if(Pt(i))return i.deleteIn(r);throw new Error(`Expected YAML collection at ${n}. Remaining path: ${r}`)}getIn(e,n){const[r,...i]=e,s=this.get(r,!0);return i.length===0?!n&&dt(s)?s.value:s:Pt(s)?s.getIn(i,n):void 0}hasAllNullValues(e){return this.items.every(n=>{if(!Ot(n))return!1;const r=n.value;return r==null||e&&dt(r)&&r.value==null&&!r.commentBefore&&!r.comment&&!r.tag})}hasIn(e){const[n,...r]=e;if(r.length===0)return this.has(n);const i=this.get(n,!0);return Pt(i)?i.hasIn(r):!1}setIn(e,n){const[r,...i]=e;if(i.length===0)this.set(r,n);else{const s=this.get(r,!0);if(Pt(s))s.setIn(i,n);else if(s===void 0&&this.schema)this.set(r,s0(this.schema,i,n));else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${i}`)}}}const cX=t=>t.replace(/^(?!$)(?: $)?/gm,"#");function ps(t,e){return/^\n+$/.test(t)?t.substring(1):e?t.replace(/^(?! *$)/gm,e):t}const Yo=(t,e,n)=>t.endsWith(` `)?ps(n,e):n.includes(` `)?` -`+ps(n,e):(t.endsWith(" ")?"":" ")+n,D6="flow",dy="block",Uh="quoted";function mm(t,e,n="flow",{indentAtStart:r,lineWidth:i=80,minContentWidth:s=20,onFold:o,onOverflow:a}={}){if(!i||i<0)return t;ii-Math.max(2,s)?u.push(0):f=i-r);let d,h,p=!1,m=-1,g=-1,b=-1;n===dy&&(m=qw(t,m,e.length),m!==-1&&(f=m+l));for(let x;x=t[m+=1];){if(n===Uh&&x==="\\"){switch(g=m,t[m+1]){case"x":m+=3;break;case"u":m+=5;break;case"U":m+=9;break;default:m+=1}b=m}if(x===` -`)n===dy&&(m=qw(t,m,e.length)),f=m+e.length+l,d=void 0;else{if(x===" "&&h&&h!==" "&&h!==` +`+ps(n,e):(t.endsWith(" ")?"":" ")+n,k6="flow",hy="block",Hh="quoted";function gm(t,e,n="flow",{indentAtStart:r,lineWidth:i=80,minContentWidth:s=20,onFold:o,onOverflow:a}={}){if(!i||i<0)return t;ii-Math.max(2,s)?u.push(0):f=i-r);let d,h,p=!1,m=-1,g=-1,b=-1;n===hy&&(m=Gw(t,m,e.length),m!==-1&&(f=m+l));for(let x;x=t[m+=1];){if(n===Hh&&x==="\\"){switch(g=m,t[m+1]){case"x":m+=3;break;case"u":m+=5;break;case"U":m+=9;break;default:m+=1}b=m}if(x===` +`)n===hy&&(m=Gw(t,m,e.length)),f=m+e.length+l,d=void 0;else{if(x===" "&&h&&h!==" "&&h!==` `&&h!==" "){const S=t[m+1];S&&S!==" "&&S!==` -`&&S!==" "&&(d=m)}if(m>=f)if(d)u.push(d),f=d+l,d=void 0;else if(n===Uh){for(;h===" "||h===" ";)h=x,x=t[m+=1],p=!0;const S=m>b+1?m-2:g-1;if(c[S])return t;u.push(S),c[S]=!0,f=S+l,d=void 0}else p=!0}h=x}if(p&&a&&a(),u.length===0)return t;o&&o();let y=t.slice(0,u[0]);for(let x=0;x({indentAtStart:e?t.indent.length:t.indentAtStart,lineWidth:t.options.lineWidth,minContentWidth:t.options.minContentWidth}),bm=t=>/^(%|---|\.\.\.)/m.test(t);function uX(t,e,n){if(!e||e<0)return!1;const r=e-n,i=t.length;if(i<=r)return!1;for(let s=0,o=0;sr)return!0;if(o=s+1,i-o<=r)return!1}return!0}function bc(t,e){const n=JSON.stringify(t);if(e.options.doubleQuotedAsJSON)return n;const{implicitKey:r}=e,i=e.options.doubleQuotedMinMultiLineLength,s=e.indent||(bm(t)?" ":"");let o="",a=0;for(let l=0,u=n[l];u;u=n[++l])if(u===" "&&n[l+1]==="\\"&&n[l+2]==="n"&&(o+=n.slice(a,l)+"\\ ",l+=1,a=l,u="\\"),u==="\\")switch(n[l+1]){case"u":{o+=n.slice(a,l);const c=n.substr(l+2,4);switch(c){case"0000":o+="\\0";break;case"0007":o+="\\a";break;case"000b":o+="\\v";break;case"001b":o+="\\e";break;case"0085":o+="\\N";break;case"00a0":o+="\\_";break;case"2028":o+="\\L";break;case"2029":o+="\\P";break;default:c.substr(0,2)==="00"?o+="\\x"+c.substr(2):o+=n.substr(l,6)}l+=5,a=l+1}break;case"n":if(r||n[l+2]==='"'||n.length=f)if(d)u.push(d),f=d+l,d=void 0;else if(n===Hh){for(;h===" "||h===" ";)h=x,x=t[m+=1],p=!0;const S=m>b+1?m-2:g-1;if(c[S])return t;u.push(S),c[S]=!0,f=S+l,d=void 0}else p=!0}h=x}if(p&&a&&a(),u.length===0)return t;o&&o();let y=t.slice(0,u[0]);for(let x=0;x({indentAtStart:e?t.indent.length:t.indentAtStart,lineWidth:t.options.lineWidth,minContentWidth:t.options.minContentWidth}),ym=t=>/^(%|---|\.\.\.)/m.test(t);function fX(t,e,n){if(!e||e<0)return!1;const r=e-n,i=t.length;if(i<=r)return!1;for(let s=0,o=0;sr)return!0;if(o=s+1,i-o<=r)return!1}return!0}function bc(t,e){const n=JSON.stringify(t);if(e.options.doubleQuotedAsJSON)return n;const{implicitKey:r}=e,i=e.options.doubleQuotedMinMultiLineLength,s=e.indent||(ym(t)?" ":"");let o="",a=0;for(let l=0,u=n[l];u;u=n[++l])if(u===" "&&n[l+1]==="\\"&&n[l+2]==="n"&&(o+=n.slice(a,l)+"\\ ",l+=1,a=l,u="\\"),u==="\\")switch(n[l+1]){case"u":{o+=n.slice(a,l);const c=n.substr(l+2,4);switch(c){case"0000":o+="\\0";break;case"0007":o+="\\a";break;case"000b":o+="\\v";break;case"001b":o+="\\e";break;case"0085":o+="\\N";break;case"00a0":o+="\\_";break;case"2028":o+="\\L";break;case"2029":o+="\\P";break;default:c.substr(0,2)==="00"?o+="\\x"+c.substr(2):o+=n.substr(l,6)}l+=5,a=l+1}break;case"n":if(r||n[l+2]==='"'||n.length `;let f,d;for(d=n.length;d>0;--d){const E=n[d-1];if(E!==` `&&E!==" "&&E!==" ")break}let h=n.substring(d);const p=h.indexOf(` `);p===-1?f="-":n===h||p!==h.length-1?(f="+",s&&s()):f="",h&&(n=n.slice(0,-h.length),h[h.length-1]===` -`&&(h=h.slice(0,-1)),h=h.replace(py,`$&${u}`));let m=!1,g,b=-1;for(g=0;g{C=!0});const A=mm(`${y}${E}${h}`,u,dy,w);if(!C)return`>${S} +$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${u}`);let C=!1;const w=bm(r,!0);o!=="folded"&&e!==Ie.BLOCK_FOLDED&&(w.onOverflow=()=>{C=!0});const A=gm(`${y}${E}${h}`,u,hy,w);if(!C)return`>${S} ${u}${A}`}return n=n.replace(/\n+/g,`$&${u}`),`|${S} -${u}${y}${n}${h}`}function cX(t,e,n,r){const{type:i,value:s}=t,{actualString:o,implicitKey:a,indent:l,indentStep:u,inFlow:c}=e;if(a&&s.includes(` +${u}${y}${n}${h}`}function dX(t,e,n,r){const{type:i,value:s}=t,{actualString:o,implicitKey:a,indent:l,indentStep:u,inFlow:c}=e;if(a&&s.includes(` `)||c&&/[[\]{},]/.test(s))return ol(s,e);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(s))return a||c||!s.includes(` -`)?ol(s,e):Hh(t,e,n,r);if(!a&&!c&&i!==Ie.PLAIN&&s.includes(` -`))return Hh(t,e,n,r);if(bm(s)){if(l==="")return e.forceBlockIndent=!0,Hh(t,e,n,r);if(a&&l===u)return ol(s,e)}const f=s.replace(/\n+/g,`$& -${l}`);if(o){const d=m=>{var g;return m.default&&m.tag!=="tag:yaml.org,2002:str"&&((g=m.test)==null?void 0:g.test(f))},{compat:h,tags:p}=e.doc.schema;if(p.some(d)||h!=null&&h.some(d))return ol(s,e)}return a?f:mm(f,l,D6,gm(e,!1))}function Xf(t,e,n,r){const{implicitKey:i,inFlow:s}=e,o=typeof t.value=="string"?t:Object.assign({},t,{value:String(t.value)});let{type:a}=t;a!==Ie.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(a=Ie.QUOTE_DOUBLE);const l=c=>{switch(c){case Ie.BLOCK_FOLDED:case Ie.BLOCK_LITERAL:return i||s?ol(o.value,e):Hh(o,e,n,r);case Ie.QUOTE_DOUBLE:return bc(o.value,e);case Ie.QUOTE_SINGLE:return hy(o.value,e);case Ie.PLAIN:return cX(o,e,n,r);default:return null}};let u=l(a);if(u===null){const{defaultKeyType:c,defaultStringType:f}=e.options,d=i&&c||f;if(u=l(d),u===null)throw new Error(`Unsupported default string type ${d}`)}return u}function k6(t,e){const n=Object.assign({blockQuote:!0,commentString:lX,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trueStr:"true",verifyAliasOrder:!0},t.schema.toStringOptions,e);let r;switch(n.collectionStyle){case"block":r=!1;break;case"flow":r=!0;break;default:r=null}return{anchors:new Set,doc:t,flowCollectionPadding:n.flowCollectionPadding?" ":"",indent:"",indentStep:typeof n.indent=="number"?" ".repeat(n.indent):" ",inFlow:r,options:n}}function fX(t,e){var i;if(e.tag){const s=t.filter(o=>o.tag===e.tag);if(s.length>0)return s.find(o=>o.format===e.format)??s[0]}let n,r;if(dt(e)){r=e.value;let s=t.filter(o=>{var a;return(a=o.identify)==null?void 0:a.call(o,r)});if(s.length>1){const o=s.filter(a=>a.test);o.length>0&&(s=o)}n=s.find(o=>o.format===e.format)??s.find(o=>!o.format)}else r=e,n=t.find(s=>s.nodeClass&&r instanceof s.nodeClass);if(!n){const s=((i=r==null?void 0:r.constructor)==null?void 0:i.name)??(r===null?"null":typeof r);throw new Error(`Tag not resolved for ${s} value`)}return n}function dX(t,e,{anchors:n,doc:r}){if(!r.directives)return"";const i=[],s=(dt(t)||Pt(t))&&t.anchor;s&&E6(s)&&(n.add(s),i.push(`&${s}`));const o=t.tag??(e.default?null:e.tag);return o&&i.push(r.directives.tagString(o)),i.join(" ")}function Bl(t,e,n,r){var l;if(Ot(t))return t.toString(e,n,r);if(Ao(t)){if(e.doc.directives)return t.toString(e);if((l=e.resolvedAliases)!=null&&l.has(t))throw new TypeError("Cannot stringify circular structure without alias nodes");e.resolvedAliases?e.resolvedAliases.add(t):e.resolvedAliases=new Set([t]),t=t.resolve(e.doc)}let i;const s=Rt(t)?t:e.doc.createNode(t,{onTagObj:u=>i=u});i??(i=fX(e.doc.schema.tags,s));const o=dX(s,i,e);o.length>0&&(e.indentAtStart=(e.indentAtStart??0)+o.length+1);const a=typeof i.stringify=="function"?i.stringify(s,e,n,r):dt(s)?Xf(s,e,n,r):s.toString(e,n,r);return o?dt(s)||a[0]==="{"||a[0]==="["?`${o} ${a}`:`${o} -${e.indent}${a}`:a}function hX({key:t,value:e},n,r,i){const{allNullValues:s,doc:o,indent:a,indentStep:l,options:{commentString:u,indentSeq:c,simpleKeys:f}}=n;let d=Rt(t)&&t.comment||null;if(f){if(d)throw new Error("With simple keys, key nodes cannot have comments");if(Pt(t)||!Rt(t)&&typeof t=="object"){const w="With simple keys, collection cannot be used as a key value";throw new Error(w)}}let h=!f&&(!t||d&&e==null&&!n.inFlow||Pt(t)||(dt(t)?t.type===Ie.BLOCK_FOLDED||t.type===Ie.BLOCK_LITERAL:typeof t=="object"));n=Object.assign({},n,{allNullValues:!1,implicitKey:!h&&(f||!s),indent:a+l});let p=!1,m=!1,g=Bl(t,n,()=>p=!0,()=>m=!0);if(!h&&!n.inFlow&&g.length>1024){if(f)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");h=!0}if(n.inFlow){if(s||e==null)return p&&r&&r(),g===""?"?":h?`? ${g}`:g}else if(s&&!f||e==null&&h)return g=`? ${g}`,d&&!p?g+=Xo(g,n.indent,u(d)):m&&i&&i(),g;p&&(d=null),h?(d&&(g+=Xo(g,n.indent,u(d))),g=`? ${g} -${a}:`):(g=`${g}:`,d&&(g+=Xo(g,n.indent,u(d))));let b,y,x;Rt(e)?(b=!!e.spaceBefore,y=e.commentBefore,x=e.comment):(b=!1,y=null,x=null,e&&typeof e=="object"&&(e=o.createNode(e))),n.implicitKey=!1,!h&&!d&&dt(e)&&(n.indentAtStart=g.length+1),m=!1,!c&&l.length>=2&&!n.inFlow&&!h&&fu(e)&&!e.flow&&!e.tag&&!e.anchor&&(n.indent=n.indent.substring(2));let S=!1;const E=Bl(e,n,()=>S=!0,()=>m=!0);let C=" ";if(d||b||y){if(C=b?` +`)?ol(s,e):qh(t,e,n,r);if(!a&&!c&&i!==Ie.PLAIN&&s.includes(` +`))return qh(t,e,n,r);if(ym(s)){if(l==="")return e.forceBlockIndent=!0,qh(t,e,n,r);if(a&&l===u)return ol(s,e)}const f=s.replace(/\n+/g,`$& +${l}`);if(o){const d=m=>{var g;return m.default&&m.tag!=="tag:yaml.org,2002:str"&&((g=m.test)==null?void 0:g.test(f))},{compat:h,tags:p}=e.doc.schema;if(p.some(d)||h!=null&&h.some(d))return ol(s,e)}return a?f:gm(f,l,k6,bm(e,!1))}function Yf(t,e,n,r){const{implicitKey:i,inFlow:s}=e,o=typeof t.value=="string"?t:Object.assign({},t,{value:String(t.value)});let{type:a}=t;a!==Ie.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(a=Ie.QUOTE_DOUBLE);const l=c=>{switch(c){case Ie.BLOCK_FOLDED:case Ie.BLOCK_LITERAL:return i||s?ol(o.value,e):qh(o,e,n,r);case Ie.QUOTE_DOUBLE:return bc(o.value,e);case Ie.QUOTE_SINGLE:return py(o.value,e);case Ie.PLAIN:return dX(o,e,n,r);default:return null}};let u=l(a);if(u===null){const{defaultKeyType:c,defaultStringType:f}=e.options,d=i&&c||f;if(u=l(d),u===null)throw new Error(`Unsupported default string type ${d}`)}return u}function O6(t,e){const n=Object.assign({blockQuote:!0,commentString:cX,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trueStr:"true",verifyAliasOrder:!0},t.schema.toStringOptions,e);let r;switch(n.collectionStyle){case"block":r=!1;break;case"flow":r=!0;break;default:r=null}return{anchors:new Set,doc:t,flowCollectionPadding:n.flowCollectionPadding?" ":"",indent:"",indentStep:typeof n.indent=="number"?" ".repeat(n.indent):" ",inFlow:r,options:n}}function hX(t,e){var i;if(e.tag){const s=t.filter(o=>o.tag===e.tag);if(s.length>0)return s.find(o=>o.format===e.format)??s[0]}let n,r;if(dt(e)){r=e.value;let s=t.filter(o=>{var a;return(a=o.identify)==null?void 0:a.call(o,r)});if(s.length>1){const o=s.filter(a=>a.test);o.length>0&&(s=o)}n=s.find(o=>o.format===e.format)??s.find(o=>!o.format)}else r=e,n=t.find(s=>s.nodeClass&&r instanceof s.nodeClass);if(!n){const s=((i=r==null?void 0:r.constructor)==null?void 0:i.name)??(r===null?"null":typeof r);throw new Error(`Tag not resolved for ${s} value`)}return n}function pX(t,e,{anchors:n,doc:r}){if(!r.directives)return"";const i=[],s=(dt(t)||Pt(t))&&t.anchor;s&&w6(s)&&(n.add(s),i.push(`&${s}`));const o=t.tag??(e.default?null:e.tag);return o&&i.push(r.directives.tagString(o)),i.join(" ")}function Bl(t,e,n,r){var l;if(Ot(t))return t.toString(e,n,r);if(Do(t)){if(e.doc.directives)return t.toString(e);if((l=e.resolvedAliases)!=null&&l.has(t))throw new TypeError("Cannot stringify circular structure without alias nodes");e.resolvedAliases?e.resolvedAliases.add(t):e.resolvedAliases=new Set([t]),t=t.resolve(e.doc)}let i;const s=Rt(t)?t:e.doc.createNode(t,{onTagObj:u=>i=u});i??(i=hX(e.doc.schema.tags,s));const o=pX(s,i,e);o.length>0&&(e.indentAtStart=(e.indentAtStart??0)+o.length+1);const a=typeof i.stringify=="function"?i.stringify(s,e,n,r):dt(s)?Yf(s,e,n,r):s.toString(e,n,r);return o?dt(s)||a[0]==="{"||a[0]==="["?`${o} ${a}`:`${o} +${e.indent}${a}`:a}function mX({key:t,value:e},n,r,i){const{allNullValues:s,doc:o,indent:a,indentStep:l,options:{commentString:u,indentSeq:c,simpleKeys:f}}=n;let d=Rt(t)&&t.comment||null;if(f){if(d)throw new Error("With simple keys, key nodes cannot have comments");if(Pt(t)||!Rt(t)&&typeof t=="object"){const w="With simple keys, collection cannot be used as a key value";throw new Error(w)}}let h=!f&&(!t||d&&e==null&&!n.inFlow||Pt(t)||(dt(t)?t.type===Ie.BLOCK_FOLDED||t.type===Ie.BLOCK_LITERAL:typeof t=="object"));n=Object.assign({},n,{allNullValues:!1,implicitKey:!h&&(f||!s),indent:a+l});let p=!1,m=!1,g=Bl(t,n,()=>p=!0,()=>m=!0);if(!h&&!n.inFlow&&g.length>1024){if(f)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");h=!0}if(n.inFlow){if(s||e==null)return p&&r&&r(),g===""?"?":h?`? ${g}`:g}else if(s&&!f||e==null&&h)return g=`? ${g}`,d&&!p?g+=Yo(g,n.indent,u(d)):m&&i&&i(),g;p&&(d=null),h?(d&&(g+=Yo(g,n.indent,u(d))),g=`? ${g} +${a}:`):(g=`${g}:`,d&&(g+=Yo(g,n.indent,u(d))));let b,y,x;Rt(e)?(b=!!e.spaceBefore,y=e.commentBefore,x=e.comment):(b=!1,y=null,x=null,e&&typeof e=="object"&&(e=o.createNode(e))),n.implicitKey=!1,!h&&!d&&dt(e)&&(n.indentAtStart=g.length+1),m=!1,!c&&l.length>=2&&!n.inFlow&&!h&&fu(e)&&!e.flow&&!e.tag&&!e.anchor&&(n.indent=n.indent.substring(2));let S=!1;const E=Bl(e,n,()=>S=!0,()=>m=!0);let C=" ";if(d||b||y){if(C=b?` `:"",y){const w=u(y);C+=` ${ps(w,n.indent)}`}E===""&&!n.inFlow?C===` `&&(C=` `):C+=` ${n.indent}`}else if(!h&&Pt(e)){const w=E[0],A=E.indexOf(` -`),_=A!==-1,D=n.inFlow??e.flow??e.items.length===0;if(_||!D){let I=!1;if(_&&(w==="&"||w==="!")){let N=E.indexOf(" ");w==="&"&&N!==-1&&Nt===Zd||typeof t=="symbol"&&t.description===Zd,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new Ie(Symbol(Zd)),{addToJSMap:T6}),stringify:()=>Zd},pX=(t,e)=>(ys.identify(e)||dt(e)&&(!e.type||e.type===Ie.PLAIN)&&ys.identify(e.value))&&(t==null?void 0:t.doc.schema.tags.some(n=>n.tag===ys.tag&&n.default));function T6(t,e,n){if(n=t&&Ao(n)?n.resolve(t.doc):n,fu(n))for(const r of n.items)o1(t,e,r);else if(Array.isArray(n))for(const r of n)o1(t,e,r);else o1(t,e,n)}function o1(t,e,n){const r=t&&Ao(n)?n.resolve(t.doc):n;if(!cu(r))throw new Error("Merge sources must be maps or map aliases");const i=r.toJSON(null,t,Map);for(const[s,o]of i)e instanceof Map?e.has(s)||e.set(s,o):e instanceof Set?e.add(s):Object.prototype.hasOwnProperty.call(e,s)||Object.defineProperty(e,s,{value:o,writable:!0,enumerable:!0,configurable:!0});return e}function I6(t,e,{key:n,value:r}){if(Rt(n)&&n.addToJSMap)n.addToJSMap(t,e,r);else if(pX(t,n))T6(t,e,r);else{const i=Ur(n,"",t);if(e instanceof Map)e.set(i,Ur(r,i,t));else if(e instanceof Set)e.add(i);else{const s=mX(n,i,t),o=Ur(r,s,t);s in e?Object.defineProperty(e,s,{value:o,writable:!0,enumerable:!0,configurable:!0}):e[s]=o}}return e}function mX(t,e,n){if(e===null)return"";if(typeof e!="object")return String(e);if(Rt(t)&&(n!=null&&n.doc)){const r=k6(n.doc,{});r.anchors=new Set;for(const s of n.anchors.keys())r.anchors.add(s.anchor);r.inFlow=!0,r.inStringifyKey=!0;const i=t.toString(r);if(!n.mapKeyWarned){let s=JSON.stringify(i);s.length>40&&(s=s.substring(0,36)+'..."'),O6(n.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${s}. Set mapAsMap: true to use object keys.`),n.mapKeyWarned=!0}return i}return JSON.stringify(e)}function g2(t,e,n){const r=of(t,void 0,n),i=of(e,void 0,n);return new Pn(r,i)}class Pn{constructor(e,n=null){Object.defineProperty(this,Wr,{value:g6}),this.key=e,this.value=n}clone(e){let{key:n,value:r}=this;return Rt(n)&&(n=n.clone(e)),Rt(r)&&(r=r.clone(e)),new Pn(n,r)}toJSON(e,n){const r=n!=null&&n.mapAsMap?new Map:{};return I6(n,r,this)}toString(e,n,r){return e!=null&&e.doc?hX(this,e,n,r):JSON.stringify(this)}}function P6(t,e,n){return(e.inFlow??t.flow?bX:gX)(t,e,n)}function gX({comment:t,items:e},n,{blockItemPrefix:r,flowChars:i,itemIndent:s,onChompKeep:o,onComment:a}){const{indent:l,options:{commentString:u}}=n,c=Object.assign({},n,{indent:s,type:null});let f=!1;const d=[];for(let p=0;pg=null,()=>f=!0);g&&(b+=Xo(b,s,u(g))),f&&g&&(f=!1),d.push(r+b)}let h;if(d.length===0)h=i.start+i.end;else{h=d[0];for(let p=1;pt===Qd||typeof t=="symbol"&&t.description===Qd,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new Ie(Symbol(Qd)),{addToJSMap:I6}),stringify:()=>Qd},gX=(t,e)=>(ys.identify(e)||dt(e)&&(!e.type||e.type===Ie.PLAIN)&&ys.identify(e.value))&&(t==null?void 0:t.doc.schema.tags.some(n=>n.tag===ys.tag&&n.default));function I6(t,e,n){if(n=t&&Do(n)?n.resolve(t.doc):n,fu(n))for(const r of n.items)a1(t,e,r);else if(Array.isArray(n))for(const r of n)a1(t,e,r);else a1(t,e,n)}function a1(t,e,n){const r=t&&Do(n)?n.resolve(t.doc):n;if(!cu(r))throw new Error("Merge sources must be maps or map aliases");const i=r.toJSON(null,t,Map);for(const[s,o]of i)e instanceof Map?e.has(s)||e.set(s,o):e instanceof Set?e.add(s):Object.prototype.hasOwnProperty.call(e,s)||Object.defineProperty(e,s,{value:o,writable:!0,enumerable:!0,configurable:!0});return e}function P6(t,e,{key:n,value:r}){if(Rt(n)&&n.addToJSMap)n.addToJSMap(t,e,r);else if(gX(t,n))I6(t,e,r);else{const i=Ur(n,"",t);if(e instanceof Map)e.set(i,Ur(r,i,t));else if(e instanceof Set)e.add(i);else{const s=bX(n,i,t),o=Ur(r,s,t);s in e?Object.defineProperty(e,s,{value:o,writable:!0,enumerable:!0,configurable:!0}):e[s]=o}}return e}function bX(t,e,n){if(e===null)return"";if(typeof e!="object")return String(e);if(Rt(t)&&(n!=null&&n.doc)){const r=O6(n.doc,{});r.anchors=new Set;for(const s of n.anchors.keys())r.anchors.add(s.anchor);r.inFlow=!0,r.inStringifyKey=!0;const i=t.toString(r);if(!n.mapKeyWarned){let s=JSON.stringify(i);s.length>40&&(s=s.substring(0,36)+'..."'),T6(n.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${s}. Set mapAsMap: true to use object keys.`),n.mapKeyWarned=!0}return i}return JSON.stringify(e)}function b2(t,e,n){const r=of(t,void 0,n),i=of(e,void 0,n);return new Pn(r,i)}class Pn{constructor(e,n=null){Object.defineProperty(this,Wr,{value:b6}),this.key=e,this.value=n}clone(e){let{key:n,value:r}=this;return Rt(n)&&(n=n.clone(e)),Rt(r)&&(r=r.clone(e)),new Pn(n,r)}toJSON(e,n){const r=n!=null&&n.mapAsMap?new Map:{};return P6(n,r,this)}toString(e,n,r){return e!=null&&e.doc?mX(this,e,n,r):JSON.stringify(this)}}function R6(t,e,n){return(e.inFlow??t.flow?vX:yX)(t,e,n)}function yX({comment:t,items:e},n,{blockItemPrefix:r,flowChars:i,itemIndent:s,onChompKeep:o,onComment:a}){const{indent:l,options:{commentString:u}}=n,c=Object.assign({},n,{indent:s,type:null});let f=!1;const d=[];for(let p=0;pg=null,()=>f=!0);g&&(b+=Yo(b,s,u(g))),f&&g&&(f=!1),d.push(r+b)}let h;if(d.length===0)h=i.start+i.end;else{h=d[0];for(let p=1;pg=null);pc||b.includes(` +`+ps(u(t),l),a&&a()):f&&o&&o(),h}function vX({items:t},e,{flowChars:n,itemIndent:r}){const{indent:i,indentStep:s,flowCollectionPadding:o,options:{commentString:a}}=e;r+=s;const l=Object.assign({},e,{indent:r,inFlow:!0,type:null});let u=!1,c=0;const f=[];for(let p=0;pg=null);pc||b.includes(` `))&&(u=!0),f.push(b),c=f.length}const{start:d,end:h}=n;if(f.length===0)return d+h;if(!u){const p=f.reduce((m,g)=>m+g.length+2,2);u=e.options.lineWidth>0&&p>e.options.lineWidth}if(u){let p=d;for(const m of f)p+=m?` ${s}${i}${m}`:` `;return`${p} -${i}${h}`}else return`${d}${o}${f.join(" ")}${o}${h}`}function s0({indent:t,options:{commentString:e}},n,r,i){if(r&&i&&(r=r.replace(/^\n+/,"")),r){const s=ps(e(r),t);n.push(s.trimStart())}}function Yo(t,e){const n=dt(e)?e.value:e;for(const r of t)if(Ot(r)&&(r.key===e||r.key===n||dt(r.key)&&r.key.value===n))return r}class wr extends A6{static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(io,e),this.items=[]}static from(e,n,r){const{keepUndefined:i,replacer:s}=r,o=new this(e),a=(l,u)=>{if(typeof s=="function")u=s.call(n,l,u);else if(Array.isArray(s)&&!s.includes(l))return;(u!==void 0||i)&&o.items.push(g2(l,u,r))};if(n instanceof Map)for(const[l,u]of n)a(l,u);else if(n&&typeof n=="object")for(const l of Object.keys(n))a(l,n[l]);return typeof e.sortMapEntries=="function"&&o.items.sort(e.sortMapEntries),o}add(e,n){var o;let r;Ot(e)?r=e:!e||typeof e!="object"||!("key"in e)?r=new Pn(e,e==null?void 0:e.value):r=new Pn(e.key,e.value);const i=Yo(this.items,r.key),s=(o=this.schema)==null?void 0:o.sortMapEntries;if(i){if(!n)throw new Error(`Key ${r.key} already set`);dt(i.value)&&C6(r.value)?i.value.value=r.value:i.value=r.value}else if(s){const a=this.items.findIndex(l=>s(r,l)<0);a===-1?this.items.push(r):this.items.splice(a,0,r)}else this.items.push(r)}delete(e){const n=Yo(this.items,e);return n?this.items.splice(this.items.indexOf(n),1).length>0:!1}get(e,n){const r=Yo(this.items,e),i=r==null?void 0:r.value;return(!n&&dt(i)?i.value:i)??void 0}has(e){return!!Yo(this.items,e)}set(e,n){this.add(new Pn(e,n),!0)}toJSON(e,n,r){const i=r?new r:n!=null&&n.mapAsMap?new Map:{};n!=null&&n.onCreate&&n.onCreate(i);for(const s of this.items)I6(n,i,s);return i}toString(e,n,r){if(!e)return JSON.stringify(this);for(const i of this.items)if(!Ot(i))throw new Error(`Map items must all be pairs; found ${JSON.stringify(i)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),P6(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:r,onComment:n})}}const du={collection:"map",default:!0,nodeClass:wr,tag:"tag:yaml.org,2002:map",resolve(t,e){return cu(t)||e("Expected a mapping for this tag"),t},createNode:(t,e,n)=>wr.from(t,e,n)};class So extends A6{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(uu,e),this.items=[]}add(e){this.items.push(e)}delete(e){const n=Qd(e);return typeof n!="number"?!1:this.items.splice(n,1).length>0}get(e,n){const r=Qd(e);if(typeof r!="number")return;const i=this.items[r];return!n&&dt(i)?i.value:i}has(e){const n=Qd(e);return typeof n=="number"&&n=0?e:null}const hu={collection:"seq",default:!0,nodeClass:So,tag:"tag:yaml.org,2002:seq",resolve(t,e){return fu(t)||e("Expected a sequence for this tag"),t},createNode:(t,e,n)=>So.from(t,e,n)},ym={identify:t=>typeof t=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:t=>t,stringify(t,e,n,r){return e=Object.assign({actualString:!0},e),Xf(t,e,n,r)}},vm={identify:t=>t==null,createNode:()=>new Ie(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new Ie(null),stringify:({source:t},e)=>typeof t=="string"&&vm.test.test(t)?t:e.options.nullStr},b2={identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:t=>new Ie(t[0]==="t"||t[0]==="T"),stringify({source:t,value:e},n){if(t&&b2.test.test(t)){const r=t[0]==="t"||t[0]==="T";if(e===r)return t}return e?n.options.trueStr:n.options.falseStr}};function hi({format:t,minFractionDigits:e,tag:n,value:r}){if(typeof r=="bigint")return String(r);const i=typeof r=="number"?r:Number(r);if(!isFinite(i))return isNaN(i)?".nan":i<0?"-.inf":".inf";let s=JSON.stringify(r);if(!t&&e&&(!n||n==="tag:yaml.org,2002:float")&&/^\d/.test(s)){let o=s.indexOf(".");o<0&&(o=s.length,s+=".");let a=e-(s.length-o-1);for(;a-- >0;)s+="0"}return s}const R6={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:t=>t.slice(-3).toLowerCase()==="nan"?NaN:t[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:hi},N6={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:t=>parseFloat(t),stringify(t){const e=Number(t.value);return isFinite(e)?e.toExponential():hi(t)}},M6={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(t){const e=new Ie(parseFloat(t)),n=t.indexOf(".");return n!==-1&&t[t.length-1]==="0"&&(e.minFractionDigits=t.length-n-1),e},stringify:hi},xm=t=>typeof t=="bigint"||Number.isInteger(t),y2=(t,e,n,{intAsBigInt:r})=>r?BigInt(t):parseInt(t.substring(e),n);function F6(t,e,n){const{value:r}=t;return xm(r)&&r>=0?n+r.toString(e):hi(t)}const L6={identify:t=>xm(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(t,e,n)=>y2(t,2,8,n),stringify:t=>F6(t,8,"0o")},B6={identify:xm,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(t,e,n)=>y2(t,0,10,n),stringify:hi},$6={identify:t=>xm(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(t,e,n)=>y2(t,2,16,n),stringify:t=>F6(t,16,"0x")},yX=[du,hu,ym,vm,b2,L6,B6,$6,R6,N6,M6];function Gw(t){return typeof t=="bigint"||Number.isInteger(t)}const eh=({value:t})=>JSON.stringify(t),vX=[{identify:t=>typeof t=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:t=>t,stringify:eh},{identify:t=>t==null,createNode:()=>new Ie(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:eh},{identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:t=>t==="true",stringify:eh},{identify:Gw,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(t,e,{intAsBigInt:n})=>n?BigInt(t):parseInt(t,10),stringify:({value:t})=>Gw(t)?t.toString():JSON.stringify(t)},{identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:t=>parseFloat(t),stringify:eh}],xX={default:!0,tag:"",test:/^/,resolve(t,e){return e(`Unresolved plain scalar ${JSON.stringify(t)}`),t}},SX=[du,hu].concat(vX,xX),v2={identify:t=>t instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(t,e){if(typeof atob=="function"){const n=atob(t.replace(/[\n\r]/g,"")),r=new Uint8Array(n.length);for(let i=0;i1&&e("Each pair must have its own sequence indicator");const i=r.items[0]||new Pn(new Ie(null));if(r.commentBefore&&(i.key.commentBefore=i.key.commentBefore?`${r.commentBefore} +${i}${h}`}else return`${d}${o}${f.join(" ")}${o}${h}`}function o0({indent:t,options:{commentString:e}},n,r,i){if(r&&i&&(r=r.replace(/^\n+/,"")),r){const s=ps(e(r),t);n.push(s.trimStart())}}function Jo(t,e){const n=dt(e)?e.value:e;for(const r of t)if(Ot(r)&&(r.key===e||r.key===n||dt(r.key)&&r.key.value===n))return r}class wr extends D6{static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(io,e),this.items=[]}static from(e,n,r){const{keepUndefined:i,replacer:s}=r,o=new this(e),a=(l,u)=>{if(typeof s=="function")u=s.call(n,l,u);else if(Array.isArray(s)&&!s.includes(l))return;(u!==void 0||i)&&o.items.push(b2(l,u,r))};if(n instanceof Map)for(const[l,u]of n)a(l,u);else if(n&&typeof n=="object")for(const l of Object.keys(n))a(l,n[l]);return typeof e.sortMapEntries=="function"&&o.items.sort(e.sortMapEntries),o}add(e,n){var o;let r;Ot(e)?r=e:!e||typeof e!="object"||!("key"in e)?r=new Pn(e,e==null?void 0:e.value):r=new Pn(e.key,e.value);const i=Jo(this.items,r.key),s=(o=this.schema)==null?void 0:o.sortMapEntries;if(i){if(!n)throw new Error(`Key ${r.key} already set`);dt(i.value)&&A6(r.value)?i.value.value=r.value:i.value=r.value}else if(s){const a=this.items.findIndex(l=>s(r,l)<0);a===-1?this.items.push(r):this.items.splice(a,0,r)}else this.items.push(r)}delete(e){const n=Jo(this.items,e);return n?this.items.splice(this.items.indexOf(n),1).length>0:!1}get(e,n){const r=Jo(this.items,e),i=r==null?void 0:r.value;return(!n&&dt(i)?i.value:i)??void 0}has(e){return!!Jo(this.items,e)}set(e,n){this.add(new Pn(e,n),!0)}toJSON(e,n,r){const i=r?new r:n!=null&&n.mapAsMap?new Map:{};n!=null&&n.onCreate&&n.onCreate(i);for(const s of this.items)P6(n,i,s);return i}toString(e,n,r){if(!e)return JSON.stringify(this);for(const i of this.items)if(!Ot(i))throw new Error(`Map items must all be pairs; found ${JSON.stringify(i)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),R6(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:r,onComment:n})}}const du={collection:"map",default:!0,nodeClass:wr,tag:"tag:yaml.org,2002:map",resolve(t,e){return cu(t)||e("Expected a mapping for this tag"),t},createNode:(t,e,n)=>wr.from(t,e,n)};class So extends D6{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(uu,e),this.items=[]}add(e){this.items.push(e)}delete(e){const n=eh(e);return typeof n!="number"?!1:this.items.splice(n,1).length>0}get(e,n){const r=eh(e);if(typeof r!="number")return;const i=this.items[r];return!n&&dt(i)?i.value:i}has(e){const n=eh(e);return typeof n=="number"&&n=0?e:null}const hu={collection:"seq",default:!0,nodeClass:So,tag:"tag:yaml.org,2002:seq",resolve(t,e){return fu(t)||e("Expected a sequence for this tag"),t},createNode:(t,e,n)=>So.from(t,e,n)},vm={identify:t=>typeof t=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:t=>t,stringify(t,e,n,r){return e=Object.assign({actualString:!0},e),Yf(t,e,n,r)}},xm={identify:t=>t==null,createNode:()=>new Ie(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new Ie(null),stringify:({source:t},e)=>typeof t=="string"&&xm.test.test(t)?t:e.options.nullStr},y2={identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:t=>new Ie(t[0]==="t"||t[0]==="T"),stringify({source:t,value:e},n){if(t&&y2.test.test(t)){const r=t[0]==="t"||t[0]==="T";if(e===r)return t}return e?n.options.trueStr:n.options.falseStr}};function hi({format:t,minFractionDigits:e,tag:n,value:r}){if(typeof r=="bigint")return String(r);const i=typeof r=="number"?r:Number(r);if(!isFinite(i))return isNaN(i)?".nan":i<0?"-.inf":".inf";let s=JSON.stringify(r);if(!t&&e&&(!n||n==="tag:yaml.org,2002:float")&&/^\d/.test(s)){let o=s.indexOf(".");o<0&&(o=s.length,s+=".");let a=e-(s.length-o-1);for(;a-- >0;)s+="0"}return s}const N6={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:t=>t.slice(-3).toLowerCase()==="nan"?NaN:t[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:hi},M6={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:t=>parseFloat(t),stringify(t){const e=Number(t.value);return isFinite(e)?e.toExponential():hi(t)}},F6={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(t){const e=new Ie(parseFloat(t)),n=t.indexOf(".");return n!==-1&&t[t.length-1]==="0"&&(e.minFractionDigits=t.length-n-1),e},stringify:hi},Sm=t=>typeof t=="bigint"||Number.isInteger(t),v2=(t,e,n,{intAsBigInt:r})=>r?BigInt(t):parseInt(t.substring(e),n);function L6(t,e,n){const{value:r}=t;return Sm(r)&&r>=0?n+r.toString(e):hi(t)}const B6={identify:t=>Sm(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(t,e,n)=>v2(t,2,8,n),stringify:t=>L6(t,8,"0o")},$6={identify:Sm,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(t,e,n)=>v2(t,0,10,n),stringify:hi},z6={identify:t=>Sm(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(t,e,n)=>v2(t,2,16,n),stringify:t=>L6(t,16,"0x")},xX=[du,hu,vm,xm,y2,B6,$6,z6,N6,M6,F6];function Ww(t){return typeof t=="bigint"||Number.isInteger(t)}const th=({value:t})=>JSON.stringify(t),SX=[{identify:t=>typeof t=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:t=>t,stringify:th},{identify:t=>t==null,createNode:()=>new Ie(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:th},{identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:t=>t==="true",stringify:th},{identify:Ww,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(t,e,{intAsBigInt:n})=>n?BigInt(t):parseInt(t,10),stringify:({value:t})=>Ww(t)?t.toString():JSON.stringify(t)},{identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:t=>parseFloat(t),stringify:th}],EX={default:!0,tag:"",test:/^/,resolve(t,e){return e(`Unresolved plain scalar ${JSON.stringify(t)}`),t}},wX=[du,hu].concat(SX,EX),x2={identify:t=>t instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(t,e){if(typeof atob=="function"){const n=atob(t.replace(/[\n\r]/g,"")),r=new Uint8Array(n.length);for(let i=0;i1&&e("Each pair must have its own sequence indicator");const i=r.items[0]||new Pn(new Ie(null));if(r.commentBefore&&(i.key.commentBefore=i.key.commentBefore?`${r.commentBefore} ${i.key.commentBefore}`:r.commentBefore),r.comment){const s=i.value??i.key;s.comment=s.comment?`${r.comment} -${s.comment}`:r.comment}r=i}t.items[n]=Ot(r)?r:new Pn(r)}}else e("Expected a sequence for this tag");return t}function j6(t,e,n){const{replacer:r}=n,i=new So(t);i.tag="tag:yaml.org,2002:pairs";let s=0;if(e&&Symbol.iterator in Object(e))for(let o of e){typeof r=="function"&&(o=r.call(e,String(s++),o));let a,l;if(Array.isArray(o))if(o.length===2)a=o[0],l=o[1];else throw new TypeError(`Expected [key, value] tuple: ${o}`);else if(o&&o instanceof Object){const u=Object.keys(o);if(u.length===1)a=u[0],l=o[a];else throw new TypeError(`Expected tuple with one key, not ${u.length} keys`)}else a=o;i.items.push(g2(a,l,n))}return i}const x2={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:z6,createNode:j6};class vl extends So{constructor(){super(),this.add=wr.prototype.add.bind(this),this.delete=wr.prototype.delete.bind(this),this.get=wr.prototype.get.bind(this),this.has=wr.prototype.has.bind(this),this.set=wr.prototype.set.bind(this),this.tag=vl.tag}toJSON(e,n){if(!n)return super.toJSON(e);const r=new Map;n!=null&&n.onCreate&&n.onCreate(r);for(const i of this.items){let s,o;if(Ot(i)?(s=Ur(i.key,"",n),o=Ur(i.value,s,n)):s=Ur(i,"",n),r.has(s))throw new Error("Ordered maps must not include duplicate keys");r.set(s,o)}return r}static from(e,n,r){const i=j6(e,n,r),s=new this;return s.items=i.items,s}}vl.tag="tag:yaml.org,2002:omap";const S2={collection:"seq",identify:t=>t instanceof Map,nodeClass:vl,default:!1,tag:"tag:yaml.org,2002:omap",resolve(t,e){const n=z6(t,e),r=[];for(const{key:i}of n.items)dt(i)&&(r.includes(i.value)?e(`Ordered maps must not include duplicate keys: ${i.value}`):r.push(i.value));return Object.assign(new vl,n)},createNode:(t,e,n)=>vl.from(t,e,n)};function V6({value:t,source:e},n){return e&&(t?U6:H6).test.test(e)?e:t?n.options.trueStr:n.options.falseStr}const U6={identify:t=>t===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new Ie(!0),stringify:V6},H6={identify:t=>t===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new Ie(!1),stringify:V6},EX={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:t=>t.slice(-3).toLowerCase()==="nan"?NaN:t[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:hi},wX={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:t=>parseFloat(t.replace(/_/g,"")),stringify(t){const e=Number(t.value);return isFinite(e)?e.toExponential():hi(t)}},_X={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(t){const e=new Ie(parseFloat(t.replace(/_/g,""))),n=t.indexOf(".");if(n!==-1){const r=t.substring(n+1).replace(/_/g,"");r[r.length-1]==="0"&&(e.minFractionDigits=r.length)}return e},stringify:hi},Yf=t=>typeof t=="bigint"||Number.isInteger(t);function Sm(t,e,n,{intAsBigInt:r}){const i=t[0];if((i==="-"||i==="+")&&(e+=1),t=t.substring(e).replace(/_/g,""),r){switch(n){case 2:t=`0b${t}`;break;case 8:t=`0o${t}`;break;case 16:t=`0x${t}`;break}const o=BigInt(t);return i==="-"?BigInt(-1)*o:o}const s=parseInt(t,n);return i==="-"?-1*s:s}function E2(t,e,n){const{value:r}=t;if(Yf(r)){const i=r.toString(e);return r<0?"-"+n+i.substr(1):n+i}return hi(t)}const CX={identify:Yf,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(t,e,n)=>Sm(t,2,2,n),stringify:t=>E2(t,2,"0b")},AX={identify:Yf,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(t,e,n)=>Sm(t,1,8,n),stringify:t=>E2(t,8,"0")},DX={identify:Yf,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(t,e,n)=>Sm(t,0,10,n),stringify:hi},kX={identify:Yf,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(t,e,n)=>Sm(t,2,16,n),stringify:t=>E2(t,16,"0x")};class xl extends wr{constructor(e){super(e),this.tag=xl.tag}add(e){let n;Ot(e)?n=e:e&&typeof e=="object"&&"key"in e&&"value"in e&&e.value===null?n=new Pn(e.key,null):n=new Pn(e,null),Yo(this.items,n.key)||this.items.push(n)}get(e,n){const r=Yo(this.items,e);return!n&&Ot(r)?dt(r.key)?r.key.value:r.key:r}set(e,n){if(typeof n!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof n}`);const r=Yo(this.items,e);r&&!n?this.items.splice(this.items.indexOf(r),1):!r&&n&&this.items.push(new Pn(e))}toJSON(e,n){return super.toJSON(e,n,Set)}toString(e,n,r){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),n,r);throw new Error("Set items must all have null values")}static from(e,n,r){const{replacer:i}=r,s=new this(e);if(n&&Symbol.iterator in Object(n))for(let o of n)typeof i=="function"&&(o=i.call(n,o,o)),s.items.push(g2(o,null,r));return s}}xl.tag="tag:yaml.org,2002:set";const w2={collection:"map",identify:t=>t instanceof Set,nodeClass:xl,default:!1,tag:"tag:yaml.org,2002:set",createNode:(t,e,n)=>xl.from(t,e,n),resolve(t,e){if(cu(t)){if(t.hasAllNullValues(!0))return Object.assign(new xl,t);e("Set items must all have null values")}else e("Expected a mapping for this tag");return t}};function _2(t,e){const n=t[0],r=n==="-"||n==="+"?t.substring(1):t,i=o=>e?BigInt(o):Number(o),s=r.replace(/_/g,"").split(":").reduce((o,a)=>o*i(60)+i(a),i(0));return n==="-"?i(-1)*s:s}function q6(t){let{value:e}=t,n=o=>o;if(typeof e=="bigint")n=o=>BigInt(o);else if(isNaN(e)||!isFinite(e))return hi(t);let r="";e<0&&(r="-",e*=n(-1));const i=n(60),s=[e%i];return e<60?s.unshift(0):(e=(e-s[0])/i,s.unshift(e%i),e>=60&&(e=(e-s[0])/i,s.unshift(e))),r+s.map(o=>String(o).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}const G6={identify:t=>typeof t=="bigint"||Number.isInteger(t),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(t,e,{intAsBigInt:n})=>_2(t,n),stringify:q6},W6={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:t=>_2(t,!1),stringify:q6},Em={identify:t=>t instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(t){const e=t.match(Em.test);if(!e)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");const[,n,r,i,s,o,a]=e.map(Number),l=e[7]?Number((e[7]+"00").substr(1,3)):0;let u=Date.UTC(n,r-1,i,s||0,o||0,a||0,l);const c=e[8];if(c&&c!=="Z"){let f=_2(c,!1);Math.abs(f)<30&&(f*=60),u-=6e4*f}return new Date(u)},stringify:({value:t})=>(t==null?void 0:t.toISOString().replace(/(T00:00:00)?\.000Z$/,""))??""},Ww=[du,hu,ym,vm,U6,H6,CX,AX,DX,kX,EX,wX,_X,v2,ys,S2,x2,w2,G6,W6,Em],Kw=new Map([["core",yX],["failsafe",[du,hu,ym]],["json",SX],["yaml11",Ww],["yaml-1.1",Ww]]),Xw={binary:v2,bool:b2,float:M6,floatExp:N6,floatNaN:R6,floatTime:W6,int:B6,intHex:$6,intOct:L6,intTime:G6,map:du,merge:ys,null:vm,omap:S2,pairs:x2,seq:hu,set:w2,timestamp:Em},OX={"tag:yaml.org,2002:binary":v2,"tag:yaml.org,2002:merge":ys,"tag:yaml.org,2002:omap":S2,"tag:yaml.org,2002:pairs":x2,"tag:yaml.org,2002:set":w2,"tag:yaml.org,2002:timestamp":Em};function a1(t,e,n){const r=Kw.get(e);if(r&&!t)return n&&!r.includes(ys)?r.concat(ys):r.slice();let i=r;if(!i)if(Array.isArray(t))i=[];else{const s=Array.from(Kw.keys()).filter(o=>o!=="yaml11").map(o=>JSON.stringify(o)).join(", ");throw new Error(`Unknown schema "${e}"; use one of ${s} or define customTags array`)}if(Array.isArray(t))for(const s of t)i=i.concat(s);else typeof t=="function"&&(i=t(i.slice()));return n&&(i=i.concat(ys)),i.reduce((s,o)=>{const a=typeof o=="string"?Xw[o]:o;if(!a){const l=JSON.stringify(o),u=Object.keys(Xw).map(c=>JSON.stringify(c)).join(", ");throw new Error(`Unknown custom tag ${l}; use one of ${u}`)}return s.includes(a)||s.push(a),s},[])}const TX=(t,e)=>t.keye.key?1:0;class wm{constructor({compat:e,customTags:n,merge:r,resolveKnownTags:i,schema:s,sortMapEntries:o,toStringDefaults:a}){this.compat=Array.isArray(e)?a1(e,"compat"):e?a1(null,e):null,this.name=typeof s=="string"&&s||"core",this.knownTags=i?OX:{},this.tags=a1(n,this.name,r),this.toStringOptions=a??null,Object.defineProperty(this,io,{value:du}),Object.defineProperty(this,Hi,{value:ym}),Object.defineProperty(this,uu,{value:hu}),this.sortMapEntries=typeof o=="function"?o:o===!0?TX:null}clone(){const e=Object.create(wm.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}}function IX(t,e){var l;const n=[];let r=e.directives===!0;if(e.directives!==!1&&t.directives){const u=t.directives.toString(t);u?(n.push(u),r=!0):t.directives.docStart&&(r=!0)}r&&n.push("---");const i=k6(t,e),{commentString:s}=i.options;if(t.commentBefore){n.length!==1&&n.unshift("");const u=s(t.commentBefore);n.unshift(ps(u,""))}let o=!1,a=null;if(t.contents){if(Rt(t.contents)){if(t.contents.spaceBefore&&r&&n.push(""),t.contents.commentBefore){const f=s(t.contents.commentBefore);n.push(ps(f,""))}i.forceBlockIndent=!!t.comment,a=t.contents.comment}const u=a?void 0:()=>o=!0;let c=Bl(t.contents,i,()=>a=null,u);a&&(c+=Xo(c,"",s(a))),(c[0]==="|"||c[0]===">")&&n[n.length-1]==="---"?n[n.length-1]=`--- ${c}`:n.push(c)}else n.push(Bl(t.contents,i));if((l=t.directives)!=null&&l.docEnd)if(t.comment){const u=s(t.comment);u.includes(` +${s.comment}`:r.comment}r=i}t.items[n]=Ot(r)?r:new Pn(r)}}else e("Expected a sequence for this tag");return t}function V6(t,e,n){const{replacer:r}=n,i=new So(t);i.tag="tag:yaml.org,2002:pairs";let s=0;if(e&&Symbol.iterator in Object(e))for(let o of e){typeof r=="function"&&(o=r.call(e,String(s++),o));let a,l;if(Array.isArray(o))if(o.length===2)a=o[0],l=o[1];else throw new TypeError(`Expected [key, value] tuple: ${o}`);else if(o&&o instanceof Object){const u=Object.keys(o);if(u.length===1)a=u[0],l=o[a];else throw new TypeError(`Expected tuple with one key, not ${u.length} keys`)}else a=o;i.items.push(b2(a,l,n))}return i}const S2={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:j6,createNode:V6};class vl extends So{constructor(){super(),this.add=wr.prototype.add.bind(this),this.delete=wr.prototype.delete.bind(this),this.get=wr.prototype.get.bind(this),this.has=wr.prototype.has.bind(this),this.set=wr.prototype.set.bind(this),this.tag=vl.tag}toJSON(e,n){if(!n)return super.toJSON(e);const r=new Map;n!=null&&n.onCreate&&n.onCreate(r);for(const i of this.items){let s,o;if(Ot(i)?(s=Ur(i.key,"",n),o=Ur(i.value,s,n)):s=Ur(i,"",n),r.has(s))throw new Error("Ordered maps must not include duplicate keys");r.set(s,o)}return r}static from(e,n,r){const i=V6(e,n,r),s=new this;return s.items=i.items,s}}vl.tag="tag:yaml.org,2002:omap";const E2={collection:"seq",identify:t=>t instanceof Map,nodeClass:vl,default:!1,tag:"tag:yaml.org,2002:omap",resolve(t,e){const n=j6(t,e),r=[];for(const{key:i}of n.items)dt(i)&&(r.includes(i.value)?e(`Ordered maps must not include duplicate keys: ${i.value}`):r.push(i.value));return Object.assign(new vl,n)},createNode:(t,e,n)=>vl.from(t,e,n)};function U6({value:t,source:e},n){return e&&(t?H6:q6).test.test(e)?e:t?n.options.trueStr:n.options.falseStr}const H6={identify:t=>t===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new Ie(!0),stringify:U6},q6={identify:t=>t===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new Ie(!1),stringify:U6},_X={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:t=>t.slice(-3).toLowerCase()==="nan"?NaN:t[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:hi},CX={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:t=>parseFloat(t.replace(/_/g,"")),stringify(t){const e=Number(t.value);return isFinite(e)?e.toExponential():hi(t)}},AX={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(t){const e=new Ie(parseFloat(t.replace(/_/g,""))),n=t.indexOf(".");if(n!==-1){const r=t.substring(n+1).replace(/_/g,"");r[r.length-1]==="0"&&(e.minFractionDigits=r.length)}return e},stringify:hi},Jf=t=>typeof t=="bigint"||Number.isInteger(t);function Em(t,e,n,{intAsBigInt:r}){const i=t[0];if((i==="-"||i==="+")&&(e+=1),t=t.substring(e).replace(/_/g,""),r){switch(n){case 2:t=`0b${t}`;break;case 8:t=`0o${t}`;break;case 16:t=`0x${t}`;break}const o=BigInt(t);return i==="-"?BigInt(-1)*o:o}const s=parseInt(t,n);return i==="-"?-1*s:s}function w2(t,e,n){const{value:r}=t;if(Jf(r)){const i=r.toString(e);return r<0?"-"+n+i.substr(1):n+i}return hi(t)}const DX={identify:Jf,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(t,e,n)=>Em(t,2,2,n),stringify:t=>w2(t,2,"0b")},kX={identify:Jf,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(t,e,n)=>Em(t,1,8,n),stringify:t=>w2(t,8,"0")},OX={identify:Jf,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(t,e,n)=>Em(t,0,10,n),stringify:hi},TX={identify:Jf,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(t,e,n)=>Em(t,2,16,n),stringify:t=>w2(t,16,"0x")};class xl extends wr{constructor(e){super(e),this.tag=xl.tag}add(e){let n;Ot(e)?n=e:e&&typeof e=="object"&&"key"in e&&"value"in e&&e.value===null?n=new Pn(e.key,null):n=new Pn(e,null),Jo(this.items,n.key)||this.items.push(n)}get(e,n){const r=Jo(this.items,e);return!n&&Ot(r)?dt(r.key)?r.key.value:r.key:r}set(e,n){if(typeof n!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof n}`);const r=Jo(this.items,e);r&&!n?this.items.splice(this.items.indexOf(r),1):!r&&n&&this.items.push(new Pn(e))}toJSON(e,n){return super.toJSON(e,n,Set)}toString(e,n,r){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),n,r);throw new Error("Set items must all have null values")}static from(e,n,r){const{replacer:i}=r,s=new this(e);if(n&&Symbol.iterator in Object(n))for(let o of n)typeof i=="function"&&(o=i.call(n,o,o)),s.items.push(b2(o,null,r));return s}}xl.tag="tag:yaml.org,2002:set";const _2={collection:"map",identify:t=>t instanceof Set,nodeClass:xl,default:!1,tag:"tag:yaml.org,2002:set",createNode:(t,e,n)=>xl.from(t,e,n),resolve(t,e){if(cu(t)){if(t.hasAllNullValues(!0))return Object.assign(new xl,t);e("Set items must all have null values")}else e("Expected a mapping for this tag");return t}};function C2(t,e){const n=t[0],r=n==="-"||n==="+"?t.substring(1):t,i=o=>e?BigInt(o):Number(o),s=r.replace(/_/g,"").split(":").reduce((o,a)=>o*i(60)+i(a),i(0));return n==="-"?i(-1)*s:s}function G6(t){let{value:e}=t,n=o=>o;if(typeof e=="bigint")n=o=>BigInt(o);else if(isNaN(e)||!isFinite(e))return hi(t);let r="";e<0&&(r="-",e*=n(-1));const i=n(60),s=[e%i];return e<60?s.unshift(0):(e=(e-s[0])/i,s.unshift(e%i),e>=60&&(e=(e-s[0])/i,s.unshift(e))),r+s.map(o=>String(o).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}const W6={identify:t=>typeof t=="bigint"||Number.isInteger(t),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(t,e,{intAsBigInt:n})=>C2(t,n),stringify:G6},K6={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:t=>C2(t,!1),stringify:G6},wm={identify:t=>t instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(t){const e=t.match(wm.test);if(!e)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");const[,n,r,i,s,o,a]=e.map(Number),l=e[7]?Number((e[7]+"00").substr(1,3)):0;let u=Date.UTC(n,r-1,i,s||0,o||0,a||0,l);const c=e[8];if(c&&c!=="Z"){let f=C2(c,!1);Math.abs(f)<30&&(f*=60),u-=6e4*f}return new Date(u)},stringify:({value:t})=>(t==null?void 0:t.toISOString().replace(/(T00:00:00)?\.000Z$/,""))??""},Kw=[du,hu,vm,xm,H6,q6,DX,kX,OX,TX,_X,CX,AX,x2,ys,E2,S2,_2,W6,K6,wm],Xw=new Map([["core",xX],["failsafe",[du,hu,vm]],["json",wX],["yaml11",Kw],["yaml-1.1",Kw]]),Yw={binary:x2,bool:y2,float:F6,floatExp:M6,floatNaN:N6,floatTime:K6,int:$6,intHex:z6,intOct:B6,intTime:W6,map:du,merge:ys,null:xm,omap:E2,pairs:S2,seq:hu,set:_2,timestamp:wm},IX={"tag:yaml.org,2002:binary":x2,"tag:yaml.org,2002:merge":ys,"tag:yaml.org,2002:omap":E2,"tag:yaml.org,2002:pairs":S2,"tag:yaml.org,2002:set":_2,"tag:yaml.org,2002:timestamp":wm};function l1(t,e,n){const r=Xw.get(e);if(r&&!t)return n&&!r.includes(ys)?r.concat(ys):r.slice();let i=r;if(!i)if(Array.isArray(t))i=[];else{const s=Array.from(Xw.keys()).filter(o=>o!=="yaml11").map(o=>JSON.stringify(o)).join(", ");throw new Error(`Unknown schema "${e}"; use one of ${s} or define customTags array`)}if(Array.isArray(t))for(const s of t)i=i.concat(s);else typeof t=="function"&&(i=t(i.slice()));return n&&(i=i.concat(ys)),i.reduce((s,o)=>{const a=typeof o=="string"?Yw[o]:o;if(!a){const l=JSON.stringify(o),u=Object.keys(Yw).map(c=>JSON.stringify(c)).join(", ");throw new Error(`Unknown custom tag ${l}; use one of ${u}`)}return s.includes(a)||s.push(a),s},[])}const PX=(t,e)=>t.keye.key?1:0;class _m{constructor({compat:e,customTags:n,merge:r,resolveKnownTags:i,schema:s,sortMapEntries:o,toStringDefaults:a}){this.compat=Array.isArray(e)?l1(e,"compat"):e?l1(null,e):null,this.name=typeof s=="string"&&s||"core",this.knownTags=i?IX:{},this.tags=l1(n,this.name,r),this.toStringOptions=a??null,Object.defineProperty(this,io,{value:du}),Object.defineProperty(this,Hi,{value:vm}),Object.defineProperty(this,uu,{value:hu}),this.sortMapEntries=typeof o=="function"?o:o===!0?PX:null}clone(){const e=Object.create(_m.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}}function RX(t,e){var l;const n=[];let r=e.directives===!0;if(e.directives!==!1&&t.directives){const u=t.directives.toString(t);u?(n.push(u),r=!0):t.directives.docStart&&(r=!0)}r&&n.push("---");const i=O6(t,e),{commentString:s}=i.options;if(t.commentBefore){n.length!==1&&n.unshift("");const u=s(t.commentBefore);n.unshift(ps(u,""))}let o=!1,a=null;if(t.contents){if(Rt(t.contents)){if(t.contents.spaceBefore&&r&&n.push(""),t.contents.commentBefore){const f=s(t.contents.commentBefore);n.push(ps(f,""))}i.forceBlockIndent=!!t.comment,a=t.contents.comment}const u=a?void 0:()=>o=!0;let c=Bl(t.contents,i,()=>a=null,u);a&&(c+=Yo(c,"",s(a))),(c[0]==="|"||c[0]===">")&&n[n.length-1]==="---"?n[n.length-1]=`--- ${c}`:n.push(c)}else n.push(Bl(t.contents,i));if((l=t.directives)!=null&&l.docEnd)if(t.comment){const u=s(t.comment);u.includes(` `)?(n.push("..."),n.push(ps(u,""))):n.push(`... ${u}`)}else n.push("...");else{let u=t.comment;u&&o&&(u=u.replace(/^\n+/,"")),u&&((!o||a)&&n[n.length-1]!==""&&n.push(""),n.push(ps(s(u),"")))}return n.join(` `)+` -`}class pu{constructor(e,n,r){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,Wr,{value:fy});let i=null;typeof n=="function"||Array.isArray(n)?i=n:r===void 0&&n&&(r=n,n=void 0);const s=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},r);this.options=s;let{version:o}=s;r!=null&&r._directives?(this.directives=r._directives.atDocument(),this.directives.yaml.explicit&&(o=this.directives.yaml.version)):this.directives=new Bn({version:o}),this.setSchema(o,r),this.contents=e===void 0?null:this.createNode(e,i,r)}clone(){const e=Object.create(pu.prototype,{[Wr]:{value:fy}});return e.commentBefore=this.commentBefore,e.comment=this.comment,e.errors=this.errors.slice(),e.warnings=this.warnings.slice(),e.options=Object.assign({},this.options),this.directives&&(e.directives=this.directives.clone()),e.schema=this.schema.clone(),e.contents=Rt(this.contents)?this.contents.clone(e.schema):this.contents,this.range&&(e.range=this.range.slice()),e}add(e){$a(this.contents)&&this.contents.add(e)}addIn(e,n){$a(this.contents)&&this.contents.addIn(e,n)}createAlias(e,n){if(!e.anchor){const r=w6(this);e.anchor=!n||r.has(n)?_6(n||"a",r):n}return new pm(e.anchor)}createNode(e,n,r){let i;if(typeof n=="function")e=n.call({"":e},"",e),i=n;else if(Array.isArray(n)){const g=y=>typeof y=="number"||y instanceof String||y instanceof Number,b=n.filter(g).map(String);b.length>0&&(n=n.concat(b)),i=n}else r===void 0&&n&&(r=n,n=void 0);const{aliasDuplicateObjects:s,anchorPrefix:o,flow:a,keepUndefined:l,onTagObj:u,tag:c}=r??{},{onAnchor:f,setAnchors:d,sourceObjects:h}=sX(this,o||"a"),p={aliasDuplicateObjects:s??!0,keepUndefined:l??!1,onAnchor:f,onTagObj:u,replacer:i,schema:this.schema,sourceObjects:h},m=of(e,c,p);return a&&Pt(m)&&(m.flow=!0),d(),m}createPair(e,n,r={}){const i=this.createNode(e,null,r),s=this.createNode(n,null,r);return new Pn(i,s)}delete(e){return $a(this.contents)?this.contents.delete(e):!1}deleteIn(e){return Qu(e)?this.contents==null?!1:(this.contents=null,!0):$a(this.contents)?this.contents.deleteIn(e):!1}get(e,n){return Pt(this.contents)?this.contents.get(e,n):void 0}getIn(e,n){return Qu(e)?!n&&dt(this.contents)?this.contents.value:this.contents:Pt(this.contents)?this.contents.getIn(e,n):void 0}has(e){return Pt(this.contents)?this.contents.has(e):!1}hasIn(e){return Qu(e)?this.contents!==void 0:Pt(this.contents)?this.contents.hasIn(e):!1}set(e,n){this.contents==null?this.contents=i0(this.schema,[e],n):$a(this.contents)&&this.contents.set(e,n)}setIn(e,n){Qu(e)?this.contents=n:this.contents==null?this.contents=i0(this.schema,Array.from(e),n):$a(this.contents)&&this.contents.setIn(e,n)}setSchema(e,n={}){typeof e=="number"&&(e=String(e));let r;switch(e){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new Bn({version:"1.1"}),r={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=e:this.directives=new Bn({version:e}),r={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,r=null;break;default:{const i=JSON.stringify(e);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${i}`)}}if(n.schema instanceof Object)this.schema=n.schema;else if(r)this.schema=new wm(Object.assign(r,n));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:e,jsonArg:n,mapAsMap:r,maxAliasCount:i,onAnchor:s,reviver:o}={}){const a={anchors:new Map,doc:this,keep:!e,mapAsMap:r===!0,mapKeyWarned:!1,maxAliasCount:typeof i=="number"?i:100},l=Ur(this.contents,n??"",a);if(typeof s=="function")for(const{count:u,res:c}of a.anchors.values())s(c,u);return typeof o=="function"?sl(o,{"":l},"",l):l}toJSON(e,n){return this.toJS({json:!0,jsonArg:e,mapAsMap:!1,onAnchor:n})}toString(e={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in e&&(!Number.isInteger(e.indent)||Number(e.indent)<=0)){const n=JSON.stringify(e.indent);throw new Error(`"indent" option must be a positive integer, not ${n}`)}return IX(this,e)}}function $a(t){if(Pt(t))return!0;throw new Error("Expected a YAML collection as document contents")}class C2 extends Error{constructor(e,n,r,i){super(),this.name=e,this.code=r,this.message=i,this.pos=n}}class Jo extends C2{constructor(e,n,r){super("YAMLParseError",e,n,r)}}class K6 extends C2{constructor(e,n,r){super("YAMLWarning",e,n,r)}}const o0=(t,e)=>n=>{if(n.pos[0]===-1)return;n.linePos=n.pos.map(a=>e.linePos(a));const{line:r,col:i}=n.linePos[0];n.message+=` at line ${r}, column ${i}`;let s=i-1,o=t.substring(e.lineStarts[r-1],e.lineStarts[r]).replace(/[\n\r]+$/,"");if(s>=60&&o.length>80){const a=Math.min(s-39,o.length-79);o="…"+o.substring(a),s-=a-1}if(o.length>80&&(o=o.substring(0,79)+"…"),r>1&&/^ *$/.test(o.substring(0,s))){let a=t.substring(e.lineStarts[r-2],e.lineStarts[r-1]);a.length>80&&(a=a.substring(0,79)+`… +`}class pu{constructor(e,n,r){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,Wr,{value:dy});let i=null;typeof n=="function"||Array.isArray(n)?i=n:r===void 0&&n&&(r=n,n=void 0);const s=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},r);this.options=s;let{version:o}=s;r!=null&&r._directives?(this.directives=r._directives.atDocument(),this.directives.yaml.explicit&&(o=this.directives.yaml.version)):this.directives=new Bn({version:o}),this.setSchema(o,r),this.contents=e===void 0?null:this.createNode(e,i,r)}clone(){const e=Object.create(pu.prototype,{[Wr]:{value:dy}});return e.commentBefore=this.commentBefore,e.comment=this.comment,e.errors=this.errors.slice(),e.warnings=this.warnings.slice(),e.options=Object.assign({},this.options),this.directives&&(e.directives=this.directives.clone()),e.schema=this.schema.clone(),e.contents=Rt(this.contents)?this.contents.clone(e.schema):this.contents,this.range&&(e.range=this.range.slice()),e}add(e){$a(this.contents)&&this.contents.add(e)}addIn(e,n){$a(this.contents)&&this.contents.addIn(e,n)}createAlias(e,n){if(!e.anchor){const r=_6(this);e.anchor=!n||r.has(n)?C6(n||"a",r):n}return new mm(e.anchor)}createNode(e,n,r){let i;if(typeof n=="function")e=n.call({"":e},"",e),i=n;else if(Array.isArray(n)){const g=y=>typeof y=="number"||y instanceof String||y instanceof Number,b=n.filter(g).map(String);b.length>0&&(n=n.concat(b)),i=n}else r===void 0&&n&&(r=n,n=void 0);const{aliasDuplicateObjects:s,anchorPrefix:o,flow:a,keepUndefined:l,onTagObj:u,tag:c}=r??{},{onAnchor:f,setAnchors:d,sourceObjects:h}=aX(this,o||"a"),p={aliasDuplicateObjects:s??!0,keepUndefined:l??!1,onAnchor:f,onTagObj:u,replacer:i,schema:this.schema,sourceObjects:h},m=of(e,c,p);return a&&Pt(m)&&(m.flow=!0),d(),m}createPair(e,n,r={}){const i=this.createNode(e,null,r),s=this.createNode(n,null,r);return new Pn(i,s)}delete(e){return $a(this.contents)?this.contents.delete(e):!1}deleteIn(e){return Qu(e)?this.contents==null?!1:(this.contents=null,!0):$a(this.contents)?this.contents.deleteIn(e):!1}get(e,n){return Pt(this.contents)?this.contents.get(e,n):void 0}getIn(e,n){return Qu(e)?!n&&dt(this.contents)?this.contents.value:this.contents:Pt(this.contents)?this.contents.getIn(e,n):void 0}has(e){return Pt(this.contents)?this.contents.has(e):!1}hasIn(e){return Qu(e)?this.contents!==void 0:Pt(this.contents)?this.contents.hasIn(e):!1}set(e,n){this.contents==null?this.contents=s0(this.schema,[e],n):$a(this.contents)&&this.contents.set(e,n)}setIn(e,n){Qu(e)?this.contents=n:this.contents==null?this.contents=s0(this.schema,Array.from(e),n):$a(this.contents)&&this.contents.setIn(e,n)}setSchema(e,n={}){typeof e=="number"&&(e=String(e));let r;switch(e){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new Bn({version:"1.1"}),r={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=e:this.directives=new Bn({version:e}),r={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,r=null;break;default:{const i=JSON.stringify(e);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${i}`)}}if(n.schema instanceof Object)this.schema=n.schema;else if(r)this.schema=new _m(Object.assign(r,n));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:e,jsonArg:n,mapAsMap:r,maxAliasCount:i,onAnchor:s,reviver:o}={}){const a={anchors:new Map,doc:this,keep:!e,mapAsMap:r===!0,mapKeyWarned:!1,maxAliasCount:typeof i=="number"?i:100},l=Ur(this.contents,n??"",a);if(typeof s=="function")for(const{count:u,res:c}of a.anchors.values())s(c,u);return typeof o=="function"?sl(o,{"":l},"",l):l}toJSON(e,n){return this.toJS({json:!0,jsonArg:e,mapAsMap:!1,onAnchor:n})}toString(e={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in e&&(!Number.isInteger(e.indent)||Number(e.indent)<=0)){const n=JSON.stringify(e.indent);throw new Error(`"indent" option must be a positive integer, not ${n}`)}return RX(this,e)}}function $a(t){if(Pt(t))return!0;throw new Error("Expected a YAML collection as document contents")}class A2 extends Error{constructor(e,n,r,i){super(),this.name=e,this.code=r,this.message=i,this.pos=n}}class Zo extends A2{constructor(e,n,r){super("YAMLParseError",e,n,r)}}class X6 extends A2{constructor(e,n,r){super("YAMLWarning",e,n,r)}}const a0=(t,e)=>n=>{if(n.pos[0]===-1)return;n.linePos=n.pos.map(a=>e.linePos(a));const{line:r,col:i}=n.linePos[0];n.message+=` at line ${r}, column ${i}`;let s=i-1,o=t.substring(e.lineStarts[r-1],e.lineStarts[r]).replace(/[\n\r]+$/,"");if(s>=60&&o.length>80){const a=Math.min(s-39,o.length-79);o="…"+o.substring(a),s-=a-1}if(o.length>80&&(o=o.substring(0,79)+"…"),r>1&&/^ *$/.test(o.substring(0,s))){let a=t.substring(e.lineStarts[r-2],e.lineStarts[r-1]);a.length>80&&(a=a.substring(0,79)+`… `),o=a+o}if(/[^ ]/.test(o)){let a=1;const l=n.linePos[1];l&&l.line===r&&l.col>i&&(a=Math.max(1,Math.min(l.col-i,80-s)));const u=" ".repeat(s)+"^".repeat(a);n.message+=`: ${o} ${u} `}};function $l(t,{flow:e,indicator:n,next:r,offset:i,onError:s,parentIndent:o,startOnNewline:a}){let l=!1,u=a,c=a,f="",d="",h=!1,p=!1,m=null,g=null,b=null,y=null,x=null,S=null,E=null;for(const A of t)switch(p&&(A.type!=="space"&&A.type!=="newline"&&A.type!=="comma"&&s(A.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),p=!1),m&&(u&&A.type!=="comment"&&A.type!=="newline"&&s(m,"TAB_AS_INDENT","Tabs are not allowed as indentation"),m=null),A.type){case"space":!e&&(n!=="doc-start"||(r==null?void 0:r.type)!=="flow-collection")&&A.source.includes(" ")&&(m=A),c=!0;break;case"comment":{c||s(A,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const _=A.source.substring(1)||" ";f?f+=d+_:f=_,d="",u=!1;break}case"newline":u?f?f+=A.source:(!S||n!=="seq-item-ind")&&(l=!0):d+=A.source,u=!0,h=!0,(g||b)&&(y=A),c=!0;break;case"anchor":g&&s(A,"MULTIPLE_ANCHORS","A node can have at most one anchor"),A.source.endsWith(":")&&s(A.offset+A.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),g=A,E??(E=A.offset),u=!1,c=!1,p=!0;break;case"tag":{b&&s(A,"MULTIPLE_TAGS","A node can have at most one tag"),b=A,E??(E=A.offset),u=!1,c=!1,p=!0;break}case n:(g||b)&&s(A,"BAD_PROP_ORDER",`Anchors and tags must be after the ${A.source} indicator`),S&&s(A,"UNEXPECTED_TOKEN",`Unexpected ${A.source} in ${e??"collection"}`),S=A,u=n==="seq-item-ind"||n==="explicit-key-ind",c=!1;break;case"comma":if(e){x&&s(A,"UNEXPECTED_TOKEN",`Unexpected , in ${e}`),x=A,u=!1,c=!1;break}default:s(A,"UNEXPECTED_TOKEN",`Unexpected ${A.type} token`),u=!1,c=!1}const C=t[t.length-1],w=C?C.offset+C.source.length:i;return p&&r&&r.type!=="space"&&r.type!=="newline"&&r.type!=="comma"&&(r.type!=="scalar"||r.source!=="")&&s(r.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),m&&(u&&m.indent<=o||(r==null?void 0:r.type)==="block-map"||(r==null?void 0:r.type)==="block-seq")&&s(m,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:x,found:S,spaceBefore:l,comment:f,hasNewline:h,anchor:g,tag:b,newlineAfterProp:y,end:w,start:E??w}}function af(t){if(!t)return null;switch(t.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(t.source.includes(` -`))return!0;if(t.end){for(const e of t.end)if(e.type==="newline")return!0}return!1;case"flow-collection":for(const e of t.items){for(const n of e.start)if(n.type==="newline")return!0;if(e.sep){for(const n of e.sep)if(n.type==="newline")return!0}if(af(e.key)||af(e.value))return!0}return!1;default:return!0}}function my(t,e,n){if((e==null?void 0:e.type)==="flow-collection"){const r=e.end[0];r.indent===t&&(r.source==="]"||r.source==="}")&&af(e)&&n(r,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}function X6(t,e,n){const{uniqueKeys:r}=t.options;if(r===!1)return!1;const i=typeof r=="function"?r:(s,o)=>s===o||dt(s)&&dt(o)&&s.value===o.value;return e.some(s=>i(s.key,n))}const Yw="All mapping items must start at the same column";function PX({composeNode:t,composeEmptyNode:e},n,r,i,s){var c;const o=(s==null?void 0:s.nodeClass)??wr,a=new o(n.schema);n.atRoot&&(n.atRoot=!1);let l=r.offset,u=null;for(const f of r.items){const{start:d,key:h,sep:p,value:m}=f,g=$l(d,{indicator:"explicit-key-ind",next:h??(p==null?void 0:p[0]),offset:l,onError:i,parentIndent:r.indent,startOnNewline:!0}),b=!g.found;if(b){if(h&&(h.type==="block-seq"?i(l,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in h&&h.indent!==r.indent&&i(l,"BAD_INDENT",Yw)),!g.anchor&&!g.tag&&!p){u=g.end,g.comment&&(a.comment?a.comment+=` -`+g.comment:a.comment=g.comment);continue}(g.newlineAfterProp||af(h))&&i(h??d[d.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else((c=g.found)==null?void 0:c.indent)!==r.indent&&i(l,"BAD_INDENT",Yw);n.atKey=!0;const y=g.end,x=h?t(n,h,g,i):e(n,y,d,null,g,i);n.schema.compat&&my(r.indent,h,i),n.atKey=!1,X6(n,a.items,x)&&i(y,"DUPLICATE_KEY","Map keys must be unique");const S=$l(p??[],{indicator:"map-value-ind",next:m,offset:x.range[2],onError:i,parentIndent:r.indent,startOnNewline:!h||h.type==="block-scalar"});if(l=S.end,S.found){b&&((m==null?void 0:m.type)==="block-map"&&!S.hasNewline&&i(l,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),n.options.strict&&g.startt&&(t.type==="block-map"||t.type==="block-seq");function NX({composeNode:t,composeEmptyNode:e},n,r,i,s){const o=r.start.source==="{",a=o?"flow map":"flow sequence",l=(s==null?void 0:s.nodeClass)??(o?wr:So),u=new l(n.schema);u.flow=!0;const c=n.atRoot;c&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let f=r.offset+r.start.source.length;for(let g=0;gs===o||dt(s)&&dt(o)&&s.value===o.value;return e.some(s=>i(s.key,n))}const Jw="All mapping items must start at the same column";function NX({composeNode:t,composeEmptyNode:e},n,r,i,s){var c;const o=(s==null?void 0:s.nodeClass)??wr,a=new o(n.schema);n.atRoot&&(n.atRoot=!1);let l=r.offset,u=null;for(const f of r.items){const{start:d,key:h,sep:p,value:m}=f,g=$l(d,{indicator:"explicit-key-ind",next:h??(p==null?void 0:p[0]),offset:l,onError:i,parentIndent:r.indent,startOnNewline:!0}),b=!g.found;if(b){if(h&&(h.type==="block-seq"?i(l,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in h&&h.indent!==r.indent&&i(l,"BAD_INDENT",Jw)),!g.anchor&&!g.tag&&!p){u=g.end,g.comment&&(a.comment?a.comment+=` +`+g.comment:a.comment=g.comment);continue}(g.newlineAfterProp||af(h))&&i(h??d[d.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else((c=g.found)==null?void 0:c.indent)!==r.indent&&i(l,"BAD_INDENT",Jw);n.atKey=!0;const y=g.end,x=h?t(n,h,g,i):e(n,y,d,null,g,i);n.schema.compat&&gy(r.indent,h,i),n.atKey=!1,Y6(n,a.items,x)&&i(y,"DUPLICATE_KEY","Map keys must be unique");const S=$l(p??[],{indicator:"map-value-ind",next:m,offset:x.range[2],onError:i,parentIndent:r.indent,startOnNewline:!h||h.type==="block-scalar"});if(l=S.end,S.found){b&&((m==null?void 0:m.type)==="block-map"&&!S.hasNewline&&i(l,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),n.options.strict&&g.startt&&(t.type==="block-map"||t.type==="block-seq");function FX({composeNode:t,composeEmptyNode:e},n,r,i,s){const o=r.start.source==="{",a=o?"flow map":"flow sequence",l=(s==null?void 0:s.nodeClass)??(o?wr:So),u=new l(n.schema);u.flow=!0;const c=n.atRoot;c&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let f=r.offset+r.start.source.length;for(let g=0;g0){const g=Jf(p,m,n.options.strict,i);g.comment&&(u.comment?u.comment+=` -`+g.comment:u.comment=g.comment),u.range=[r.offset,m,g.offset]}else u.range=[r.offset,m,m];return u}function c1(t,e,n,r,i,s){const o=n.type==="block-map"?PX(t,e,n,r,s):n.type==="block-seq"?RX(t,e,n,r,s):NX(t,e,n,r,s),a=o.constructor;return i==="!"||i===a.tagName?(o.tag=a.tagName,o):(i&&(o.tag=i),o)}function MX(t,e,n,r,i){var d;const s=r.tag,o=s?e.directives.tagName(s.source,h=>i(s,"TAG_RESOLVE_FAILED",h)):null;if(n.type==="block-seq"){const{anchor:h,newlineAfterProp:p}=r,m=h&&s?h.offset>s.offset?h:s:h??s;m&&(!p||p.offseth.tag===o&&h.collection===a);if(!l){const h=e.schema.knownTags[o];if(h&&h.collection===a)e.schema.tags.push(Object.assign({},h,{default:!1})),l=h;else return h?i(s,"BAD_COLLECTION_TYPE",`${h.tag} used for ${a} collection, but expects ${h.collection??"scalar"}`,!0):i(s,"TAG_RESOLVE_FAILED",`Unresolved tag: ${o}`,!0),c1(t,e,n,i,o)}const u=c1(t,e,n,i,o,l),c=((d=l.resolve)==null?void 0:d.call(l,u,h=>i(s,"TAG_RESOLVE_FAILED",h),e.options))??u,f=Rt(c)?c:new Ie(c);return f.range=u.range,f.tag=o,l!=null&&l.format&&(f.format=l.format),f}function Y6(t,e,n){const r=e.offset,i=FX(e,t.options.strict,n);if(!i)return{value:"",type:null,comment:"",range:[r,r,r]};const s=i.mode===">"?Ie.BLOCK_FOLDED:Ie.BLOCK_LITERAL,o=e.source?LX(e.source):[];let a=o.length;for(let m=o.length-1;m>=0;--m){const g=o[m][1];if(g===""||g==="\r")a=m;else break}if(a===0){const m=i.chomp==="+"&&o.length>0?` +`+w:A.comment=w,C.comment=C.comment.substring(w.length+1)}}if(!o&&!S&&!C.found){const w=E?t(n,E,C,i):e(n,C.end,S,null,C,i);u.items.push(w),f=w.range[2],c1(E)&&i(w.range,"BLOCK_IN_FLOW",u1)}else{n.atKey=!0;const w=C.end,A=x?t(n,x,C,i):e(n,w,y,null,C,i);c1(x)&&i(A.range,"BLOCK_IN_FLOW",u1),n.atKey=!1;const _=$l(S??[],{flow:a,indicator:"map-value-ind",next:E,offset:A.range[2],onError:i,parentIndent:r.indent,startOnNewline:!1});if(_.found){if(!o&&!C.found&&n.options.strict){if(S)for(const N of S){if(N===_.found)break;if(N.type==="newline"){i(N,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}C.start<_.found.offset-1024&&i(_.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else E&&("source"in E&&E.source&&E.source[0]===":"?i(E,"MISSING_CHAR",`Missing space after : in ${a}`):i(_.start,"MISSING_CHAR",`Missing , or : between ${a} items`));const O=E?t(n,E,_,i):_.found?e(n,_.end,S,null,_,i):null;O?c1(E)&&i(O.range,"BLOCK_IN_FLOW",u1):_.comment&&(A.comment?A.comment+=` +`+_.comment:A.comment=_.comment);const I=new Pn(A,O);if(n.options.keepSourceTokens&&(I.srcToken=b),o){const N=u;Y6(n,N.items,A)&&i(w,"DUPLICATE_KEY","Map keys must be unique"),N.items.push(I)}else{const N=new wr(n.schema);N.flow=!0,N.items.push(I);const P=(O??A).range;N.range=[A.range[0],P[1],P[2]],u.items.push(N)}f=O?O.range[2]:_.end}}const d=o?"}":"]",[h,...p]=r.end;let m=f;if(h&&h.source===d)m=h.offset+h.source.length;else{const g=a[0].toUpperCase()+a.substring(1),b=c?`${g} must end with a ${d}`:`${g} in block collection must be sufficiently indented and end with a ${d}`;i(f,c?"MISSING_CHAR":"BAD_INDENT",b),h&&h.source.length!==1&&p.unshift(h)}if(p.length>0){const g=Zf(p,m,n.options.strict,i);g.comment&&(u.comment?u.comment+=` +`+g.comment:u.comment=g.comment),u.range=[r.offset,m,g.offset]}else u.range=[r.offset,m,m];return u}function f1(t,e,n,r,i,s){const o=n.type==="block-map"?NX(t,e,n,r,s):n.type==="block-seq"?MX(t,e,n,r,s):FX(t,e,n,r,s),a=o.constructor;return i==="!"||i===a.tagName?(o.tag=a.tagName,o):(i&&(o.tag=i),o)}function LX(t,e,n,r,i){var d;const s=r.tag,o=s?e.directives.tagName(s.source,h=>i(s,"TAG_RESOLVE_FAILED",h)):null;if(n.type==="block-seq"){const{anchor:h,newlineAfterProp:p}=r,m=h&&s?h.offset>s.offset?h:s:h??s;m&&(!p||p.offseth.tag===o&&h.collection===a);if(!l){const h=e.schema.knownTags[o];if(h&&h.collection===a)e.schema.tags.push(Object.assign({},h,{default:!1})),l=h;else return h?i(s,"BAD_COLLECTION_TYPE",`${h.tag} used for ${a} collection, but expects ${h.collection??"scalar"}`,!0):i(s,"TAG_RESOLVE_FAILED",`Unresolved tag: ${o}`,!0),f1(t,e,n,i,o)}const u=f1(t,e,n,i,o,l),c=((d=l.resolve)==null?void 0:d.call(l,u,h=>i(s,"TAG_RESOLVE_FAILED",h),e.options))??u,f=Rt(c)?c:new Ie(c);return f.range=u.range,f.tag=o,l!=null&&l.format&&(f.format=l.format),f}function J6(t,e,n){const r=e.offset,i=BX(e,t.options.strict,n);if(!i)return{value:"",type:null,comment:"",range:[r,r,r]};const s=i.mode===">"?Ie.BLOCK_FOLDED:Ie.BLOCK_LITERAL,o=e.source?$X(e.source):[];let a=o.length;for(let m=o.length-1;m>=0;--m){const g=o[m][1];if(g===""||g==="\r")a=m;else break}if(a===0){const m=i.chomp==="+"&&o.length>0?` `.repeat(Math.max(1,o.length-1)):"";let g=r+i.length;return e.source&&(g+=e.source.length),{value:m,type:s,comment:i.comment,range:[r,g,g]}}let l=e.indent+i.indent,u=e.offset+i.length,c=0;for(let m=0;ml&&(l=g.length);else{g.length=a;--m)o[m][0].length>l&&(a=m+1);let f="",d="",h=!1;for(let m=0;ml||b[0]===" "?(d===" "?d=` @@ -346,98 +346,98 @@ ${u} `+o[m][0].slice(l);f[f.length-1]!==` `&&(f+=` `);break;default:f+=` -`}const p=r+i.length+e.source.length;return{value:f,type:s,comment:i.comment,range:[r,p,p]}}function FX({offset:t,props:e},n,r){if(e[0].type!=="block-scalar-header")return r(e[0],"IMPOSSIBLE","Block scalar header not found"),null;const{source:i}=e[0],s=i[0];let o=0,a="",l=-1;for(let d=1;dn(r+d,h,p);switch(i){case"scalar":a=Ie.PLAIN,l=BX(s,u);break;case"single-quoted-scalar":a=Ie.QUOTE_SINGLE,l=$X(s,u);break;case"double-quoted-scalar":a=Ie.QUOTE_DOUBLE,l=zX(s,u);break;default:return n(t,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${i}`),{value:"",type:null,comment:"",range:[r,r+s.length,r+s.length]}}const c=r+s.length,f=Jf(o,c,e,n);return{value:l,type:a,comment:f.comment,range:[r,c,f.offset]}}function BX(t,e){let n="";switch(t[0]){case" ":n="a tab character";break;case",":n="flow indicator character ,";break;case"%":n="directive indicator character %";break;case"|":case">":{n=`block scalar indicator ${t[0]}`;break}case"@":case"`":{n=`reserved character ${t[0]}`;break}}return n&&e(0,"BAD_SCALAR_START",`Plain value cannot start with ${n}`),Z6(t)}function $X(t,e){return(t[t.length-1]!=="'"||t.length===1)&&e(t.length,"MISSING_CHAR","Missing closing 'quote"),Z6(t.slice(1,-1)).replace(/''/g,"'")}function Z6(t){let e,n;try{e=new RegExp(`(.*?)(?n(r+d,h,p);switch(i){case"scalar":a=Ie.PLAIN,l=zX(s,u);break;case"single-quoted-scalar":a=Ie.QUOTE_SINGLE,l=jX(s,u);break;case"double-quoted-scalar":a=Ie.QUOTE_DOUBLE,l=VX(s,u);break;default:return n(t,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${i}`),{value:"",type:null,comment:"",range:[r,r+s.length,r+s.length]}}const c=r+s.length,f=Zf(o,c,e,n);return{value:l,type:a,comment:f.comment,range:[r,c,f.offset]}}function zX(t,e){let n="";switch(t[0]){case" ":n="a tab character";break;case",":n="flow indicator character ,";break;case"%":n="directive indicator character %";break;case"|":case">":{n=`block scalar indicator ${t[0]}`;break}case"@":case"`":{n=`reserved character ${t[0]}`;break}}return n&&e(0,"BAD_SCALAR_START",`Plain value cannot start with ${n}`),Q6(t)}function jX(t,e){return(t[t.length-1]!=="'"||t.length===1)&&e(t.length,"MISSING_CHAR","Missing closing 'quote"),Q6(t.slice(1,-1)).replace(/''/g,"'")}function Q6(t){let e,n;try{e=new RegExp(`(.*?)(?s?t.slice(s,r+1):i)}else n+=i}return(t[t.length-1]!=='"'||t.length===1)&&e(t.length,"MISSING_CHAR",'Missing closing "quote'),n}function jX(t,e){let n="",r=t[e+1];for(;(r===" "||r===" "||r===` +`)&&(n+=r>s?t.slice(s,r+1):i)}else n+=i}return(t[t.length-1]!=='"'||t.length===1)&&e(t.length,"MISSING_CHAR",'Missing closing "quote'),n}function UX(t,e){let n="",r=t[e+1];for(;(r===" "||r===" "||r===` `||r==="\r")&&!(r==="\r"&&t[e+2]!==` `);)r===` `&&(n+=` -`),e+=1,r=t[e+1];return n||(n=" "),{fold:n,offset:e}}const VX={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:` -`,r:"\r",t:" ",v:"\v",N:"…",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function UX(t,e,n,r){const i=t.substr(e,n),o=i.length===n&&/^[0-9a-fA-F]+$/.test(i)?parseInt(i,16):NaN;if(isNaN(o)){const a=t.substr(e-2,n+2);return r(e-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${a}`),a}return String.fromCodePoint(o)}function Q6(t,e,n,r){const{value:i,type:s,comment:o,range:a}=e.type==="block-scalar"?Y6(t,e,r):J6(e,t.options.strict,r),l=n?t.directives.tagName(n.source,f=>r(n,"TAG_RESOLVE_FAILED",f)):null;let u;t.options.stringKeys&&t.atKey?u=t.schema[Hi]:l?u=HX(t.schema,i,l,n,r):e.type==="scalar"?u=qX(t,i,e,r):u=t.schema[Hi];let c;try{const f=u.resolve(i,d=>r(n??e,"TAG_RESOLVE_FAILED",d),t.options);c=dt(f)?f:new Ie(f)}catch(f){const d=f instanceof Error?f.message:String(f);r(n??e,"TAG_RESOLVE_FAILED",d),c=new Ie(i)}return c.range=a,c.source=i,s&&(c.type=s),l&&(c.tag=l),u.format&&(c.format=u.format),o&&(c.comment=o),c}function HX(t,e,n,r,i){var a;if(n==="!")return t[Hi];const s=[];for(const l of t.tags)if(!l.collection&&l.tag===n)if(l.default&&l.test)s.push(l);else return l;for(const l of s)if((a=l.test)!=null&&a.test(e))return l;const o=t.knownTags[n];return o&&!o.collection?(t.tags.push(Object.assign({},o,{default:!1,test:void 0})),o):(i(r,"TAG_RESOLVE_FAILED",`Unresolved tag: ${n}`,n!=="tag:yaml.org,2002:str"),t[Hi])}function qX({atKey:t,directives:e,schema:n},r,i,s){const o=n.tags.find(a=>{var l;return(a.default===!0||t&&a.default==="key")&&((l=a.test)==null?void 0:l.test(r))})||n[Hi];if(n.compat){const a=n.compat.find(l=>{var u;return l.default&&((u=l.test)==null?void 0:u.test(r))})??n[Hi];if(o.tag!==a.tag){const l=e.tagString(o.tag),u=e.tagString(a.tag),c=`Value may be parsed as either ${l} or ${u}`;s(i,"TAG_RESOLVE_FAILED",c,!0)}}return o}function GX(t,e,n){if(e){n??(n=e.length);for(let r=n-1;r>=0;--r){let i=e[r];switch(i.type){case"space":case"comment":case"newline":t-=i.source.length;continue}for(i=e[++r];(i==null?void 0:i.type)==="space";)t+=i.source.length,i=e[++r];break}}return t}const WX={composeNode:eT,composeEmptyNode:A2};function eT(t,e,n,r){const i=t.atKey,{spaceBefore:s,comment:o,anchor:a,tag:l}=n;let u,c=!0;switch(e.type){case"alias":u=KX(t,e,r),(a||l)&&r(e,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":u=Q6(t,e,l,r),a&&(u.anchor=a.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":u=MX(WX,t,e,n,r),a&&(u.anchor=a.source.substring(1));break;default:{const f=e.type==="error"?e.message:`Unsupported token (type: ${e.type})`;r(e,"UNEXPECTED_TOKEN",f),u=A2(t,e.offset,void 0,null,n,r),c=!1}}return a&&u.anchor===""&&r(a,"BAD_ALIAS","Anchor cannot be an empty string"),i&&t.options.stringKeys&&(!dt(u)||typeof u.value!="string"||u.tag&&u.tag!=="tag:yaml.org,2002:str")&&r(l??e,"NON_STRING_KEY","With stringKeys, all keys must be strings"),s&&(u.spaceBefore=!0),o&&(e.type==="scalar"&&e.source===""?u.comment=o:u.commentBefore=o),t.options.keepSourceTokens&&c&&(u.srcToken=e),u}function A2(t,e,n,r,{spaceBefore:i,comment:s,anchor:o,tag:a,end:l},u){const c={type:"scalar",offset:GX(e,n,r),indent:-1,source:""},f=Q6(t,c,a,u);return o&&(f.anchor=o.source.substring(1),f.anchor===""&&u(o,"BAD_ALIAS","Anchor cannot be an empty string")),i&&(f.spaceBefore=!0),s&&(f.comment=s,f.range[2]=l),f}function KX({options:t},{offset:e,source:n,end:r},i){const s=new pm(n.substring(1));s.source===""&&i(e,"BAD_ALIAS","Alias cannot be an empty string"),s.source.endsWith(":")&&i(e+n.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);const o=e+n.length,a=Jf(r,o,t.strict,i);return s.range=[e,o,a.offset],a.comment&&(s.comment=a.comment),s}function XX(t,e,{offset:n,start:r,value:i,end:s},o){const a=Object.assign({_directives:e},t),l=new pu(void 0,a),u={atKey:!1,atRoot:!0,directives:l.directives,options:l.options,schema:l.schema},c=$l(r,{indicator:"doc-start",next:i??(s==null?void 0:s[0]),offset:n,onError:o,parentIndent:0,startOnNewline:!0});c.found&&(l.directives.docStart=!0,i&&(i.type==="block-map"||i.type==="block-seq")&&!c.hasNewline&&o(c.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),l.contents=i?eT(u,i,c,o):A2(u,c.end,r,null,c,o);const f=l.contents.range[2],d=Jf(s,f,!1,o);return d.comment&&(l.comment=d.comment),l.range=[n,f,d.offset],l}function $u(t){if(typeof t=="number")return[t,t+1];if(Array.isArray(t))return t.length===2?t:[t[0],t[1]];const{offset:e,source:n}=t;return[e,e+(typeof n=="string"?n.length:1)]}function Jw(t){var i;let e="",n=!1,r=!1;for(let s=0;sr(n,"TAG_RESOLVE_FAILED",f)):null;let u;t.options.stringKeys&&t.atKey?u=t.schema[Hi]:l?u=GX(t.schema,i,l,n,r):e.type==="scalar"?u=WX(t,i,e,r):u=t.schema[Hi];let c;try{const f=u.resolve(i,d=>r(n??e,"TAG_RESOLVE_FAILED",d),t.options);c=dt(f)?f:new Ie(f)}catch(f){const d=f instanceof Error?f.message:String(f);r(n??e,"TAG_RESOLVE_FAILED",d),c=new Ie(i)}return c.range=a,c.source=i,s&&(c.type=s),l&&(c.tag=l),u.format&&(c.format=u.format),o&&(c.comment=o),c}function GX(t,e,n,r,i){var a;if(n==="!")return t[Hi];const s=[];for(const l of t.tags)if(!l.collection&&l.tag===n)if(l.default&&l.test)s.push(l);else return l;for(const l of s)if((a=l.test)!=null&&a.test(e))return l;const o=t.knownTags[n];return o&&!o.collection?(t.tags.push(Object.assign({},o,{default:!1,test:void 0})),o):(i(r,"TAG_RESOLVE_FAILED",`Unresolved tag: ${n}`,n!=="tag:yaml.org,2002:str"),t[Hi])}function WX({atKey:t,directives:e,schema:n},r,i,s){const o=n.tags.find(a=>{var l;return(a.default===!0||t&&a.default==="key")&&((l=a.test)==null?void 0:l.test(r))})||n[Hi];if(n.compat){const a=n.compat.find(l=>{var u;return l.default&&((u=l.test)==null?void 0:u.test(r))})??n[Hi];if(o.tag!==a.tag){const l=e.tagString(o.tag),u=e.tagString(a.tag),c=`Value may be parsed as either ${l} or ${u}`;s(i,"TAG_RESOLVE_FAILED",c,!0)}}return o}function KX(t,e,n){if(e){n??(n=e.length);for(let r=n-1;r>=0;--r){let i=e[r];switch(i.type){case"space":case"comment":case"newline":t-=i.source.length;continue}for(i=e[++r];(i==null?void 0:i.type)==="space";)t+=i.source.length,i=e[++r];break}}return t}const XX={composeNode:tT,composeEmptyNode:D2};function tT(t,e,n,r){const i=t.atKey,{spaceBefore:s,comment:o,anchor:a,tag:l}=n;let u,c=!0;switch(e.type){case"alias":u=YX(t,e,r),(a||l)&&r(e,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":u=eT(t,e,l,r),a&&(u.anchor=a.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":u=LX(XX,t,e,n,r),a&&(u.anchor=a.source.substring(1));break;default:{const f=e.type==="error"?e.message:`Unsupported token (type: ${e.type})`;r(e,"UNEXPECTED_TOKEN",f),u=D2(t,e.offset,void 0,null,n,r),c=!1}}return a&&u.anchor===""&&r(a,"BAD_ALIAS","Anchor cannot be an empty string"),i&&t.options.stringKeys&&(!dt(u)||typeof u.value!="string"||u.tag&&u.tag!=="tag:yaml.org,2002:str")&&r(l??e,"NON_STRING_KEY","With stringKeys, all keys must be strings"),s&&(u.spaceBefore=!0),o&&(e.type==="scalar"&&e.source===""?u.comment=o:u.commentBefore=o),t.options.keepSourceTokens&&c&&(u.srcToken=e),u}function D2(t,e,n,r,{spaceBefore:i,comment:s,anchor:o,tag:a,end:l},u){const c={type:"scalar",offset:KX(e,n,r),indent:-1,source:""},f=eT(t,c,a,u);return o&&(f.anchor=o.source.substring(1),f.anchor===""&&u(o,"BAD_ALIAS","Anchor cannot be an empty string")),i&&(f.spaceBefore=!0),s&&(f.comment=s,f.range[2]=l),f}function YX({options:t},{offset:e,source:n,end:r},i){const s=new mm(n.substring(1));s.source===""&&i(e,"BAD_ALIAS","Alias cannot be an empty string"),s.source.endsWith(":")&&i(e+n.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);const o=e+n.length,a=Zf(r,o,t.strict,i);return s.range=[e,o,a.offset],a.comment&&(s.comment=a.comment),s}function JX(t,e,{offset:n,start:r,value:i,end:s},o){const a=Object.assign({_directives:e},t),l=new pu(void 0,a),u={atKey:!1,atRoot:!0,directives:l.directives,options:l.options,schema:l.schema},c=$l(r,{indicator:"doc-start",next:i??(s==null?void 0:s[0]),offset:n,onError:o,parentIndent:0,startOnNewline:!0});c.found&&(l.directives.docStart=!0,i&&(i.type==="block-map"||i.type==="block-seq")&&!c.hasNewline&&o(c.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),l.contents=i?tT(u,i,c,o):D2(u,c.end,r,null,c,o);const f=l.contents.range[2],d=Zf(s,f,!1,o);return d.comment&&(l.comment=d.comment),l.range=[n,f,d.offset],l}function $u(t){if(typeof t=="number")return[t,t+1];if(Array.isArray(t))return t.length===2?t:[t[0],t[1]];const{offset:e,source:n}=t;return[e,e+(typeof n=="string"?n.length:1)]}function Zw(t){var i;let e="",n=!1,r=!1;for(let s=0;s{const o=$u(n);s?this.warnings.push(new K6(o,r,i)):this.errors.push(new Jo(o,r,i))},this.directives=new Bn({version:e.version||"1.2"}),this.options=e}decorate(e,n){const{comment:r,afterEmptyLine:i}=Jw(this.prelude);if(r){const s=e.contents;if(n)e.comment=e.comment?`${e.comment} +`)+(o.substring(1)||" "),n=!0,r=!1;break;case"%":((i=t[s+1])==null?void 0:i[0])!=="#"&&(s+=1),n=!1;break;default:n||(r=!0),n=!1}}return{comment:e,afterEmptyLine:r}}class k2{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(n,r,i,s)=>{const o=$u(n);s?this.warnings.push(new X6(o,r,i)):this.errors.push(new Zo(o,r,i))},this.directives=new Bn({version:e.version||"1.2"}),this.options=e}decorate(e,n){const{comment:r,afterEmptyLine:i}=Zw(this.prelude);if(r){const s=e.contents;if(n)e.comment=e.comment?`${e.comment} ${r}`:r;else if(i||e.directives.docStart||!s)e.commentBefore=r;else if(Pt(s)&&!s.flow&&s.items.length>0){let o=s.items[0];Ot(o)&&(o=o.key);const a=o.commentBefore;o.commentBefore=a?`${r} ${a}`:r}else{const o=s.commentBefore;s.commentBefore=o?`${r} -${o}`:r}}n?(Array.prototype.push.apply(e.errors,this.errors),Array.prototype.push.apply(e.warnings,this.warnings)):(e.errors=this.errors,e.warnings=this.warnings),this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:Jw(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,n=!1,r=-1){for(const i of e)yield*this.next(i);yield*this.end(n,r)}*next(e){switch(e.type){case"directive":this.directives.add(e.source,(n,r,i)=>{const s=$u(e);s[0]+=n,this.onError(s,"BAD_DIRECTIVE",r,i)}),this.prelude.push(e.source),this.atDirectives=!0;break;case"document":{const n=XX(this.options,this.directives,e,this.onError);this.atDirectives&&!n.directives.docStart&&this.onError(e,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(n,!1),this.doc&&(yield this.doc),this.doc=n,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(e.source);break;case"error":{const n=e.source?`${e.message}: ${JSON.stringify(e.source)}`:e.message,r=new Jo($u(e),"UNEXPECTED_TOKEN",n);this.atDirectives||!this.doc?this.errors.push(r):this.doc.errors.push(r);break}case"doc-end":{if(!this.doc){const r="Unexpected doc-end without preceding document";this.errors.push(new Jo($u(e),"UNEXPECTED_TOKEN",r));break}this.doc.directives.docEnd=!0;const n=Jf(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),n.comment){const r=this.doc.comment;this.doc.comment=r?`${r} -${n.comment}`:n.comment}this.doc.range[2]=n.offset;break}default:this.errors.push(new Jo($u(e),"UNEXPECTED_TOKEN",`Unsupported token ${e.type}`))}}*end(e=!1,n=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(e){const r=Object.assign({_directives:this.directives},this.options),i=new pu(void 0,r);this.atDirectives&&this.onError(n,"MISSING_CHAR","Missing directives-end indicator line"),i.range=[0,n,n],this.decorate(i,!1),yield i}}}function YX(t,e=!0,n){if(t){const r=(i,s,o)=>{const a=typeof i=="number"?i:Array.isArray(i)?i[0]:i.offset;if(n)n(a,s,o);else throw new Jo([a,a+1],s,o)};switch(t.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return J6(t,e,r);case"block-scalar":return Y6({options:{strict:e}},t,r)}}return null}function JX(t,e){const{implicitKey:n=!1,indent:r,inFlow:i=!1,offset:s=-1,type:o="PLAIN"}=e,a=Xf({type:o,value:t},{implicitKey:n,indent:r>0?" ".repeat(r):"",inFlow:i,options:{blockQuote:!0,lineWidth:-1}}),l=e.end??[{type:"newline",offset:-1,indent:r,source:` +${o}`:r}}n?(Array.prototype.push.apply(e.errors,this.errors),Array.prototype.push.apply(e.warnings,this.warnings)):(e.errors=this.errors,e.warnings=this.warnings),this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:Zw(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,n=!1,r=-1){for(const i of e)yield*this.next(i);yield*this.end(n,r)}*next(e){switch(e.type){case"directive":this.directives.add(e.source,(n,r,i)=>{const s=$u(e);s[0]+=n,this.onError(s,"BAD_DIRECTIVE",r,i)}),this.prelude.push(e.source),this.atDirectives=!0;break;case"document":{const n=JX(this.options,this.directives,e,this.onError);this.atDirectives&&!n.directives.docStart&&this.onError(e,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(n,!1),this.doc&&(yield this.doc),this.doc=n,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(e.source);break;case"error":{const n=e.source?`${e.message}: ${JSON.stringify(e.source)}`:e.message,r=new Zo($u(e),"UNEXPECTED_TOKEN",n);this.atDirectives||!this.doc?this.errors.push(r):this.doc.errors.push(r);break}case"doc-end":{if(!this.doc){const r="Unexpected doc-end without preceding document";this.errors.push(new Zo($u(e),"UNEXPECTED_TOKEN",r));break}this.doc.directives.docEnd=!0;const n=Zf(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),n.comment){const r=this.doc.comment;this.doc.comment=r?`${r} +${n.comment}`:n.comment}this.doc.range[2]=n.offset;break}default:this.errors.push(new Zo($u(e),"UNEXPECTED_TOKEN",`Unsupported token ${e.type}`))}}*end(e=!1,n=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(e){const r=Object.assign({_directives:this.directives},this.options),i=new pu(void 0,r);this.atDirectives&&this.onError(n,"MISSING_CHAR","Missing directives-end indicator line"),i.range=[0,n,n],this.decorate(i,!1),yield i}}}function ZX(t,e=!0,n){if(t){const r=(i,s,o)=>{const a=typeof i=="number"?i:Array.isArray(i)?i[0]:i.offset;if(n)n(a,s,o);else throw new Zo([a,a+1],s,o)};switch(t.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return Z6(t,e,r);case"block-scalar":return J6({options:{strict:e}},t,r)}}return null}function QX(t,e){const{implicitKey:n=!1,indent:r,inFlow:i=!1,offset:s=-1,type:o="PLAIN"}=e,a=Yf({type:o,value:t},{implicitKey:n,indent:r>0?" ".repeat(r):"",inFlow:i,options:{blockQuote:!0,lineWidth:-1}}),l=e.end??[{type:"newline",offset:-1,indent:r,source:` `}];switch(a[0]){case"|":case">":{const u=a.indexOf(` `),c=a.substring(0,u),f=a.substring(u+1)+` -`,d=[{type:"block-scalar-header",offset:s,indent:r,source:c}];return tT(d,l)||d.push({type:"newline",offset:-1,indent:r,source:` -`}),{type:"block-scalar",offset:s,indent:r,props:d,source:f}}case'"':return{type:"double-quoted-scalar",offset:s,indent:r,source:a,end:l};case"'":return{type:"single-quoted-scalar",offset:s,indent:r,source:a,end:l};default:return{type:"scalar",offset:s,indent:r,source:a,end:l}}}function ZX(t,e,n={}){let{afterKey:r=!1,implicitKey:i=!1,inFlow:s=!1,type:o}=n,a="indent"in t?t.indent:null;if(r&&typeof a=="number"&&(a+=2),!o)switch(t.type){case"single-quoted-scalar":o="QUOTE_SINGLE";break;case"double-quoted-scalar":o="QUOTE_DOUBLE";break;case"block-scalar":{const u=t.props[0];if(u.type!=="block-scalar-header")throw new Error("Invalid block scalar header");o=u.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:o="PLAIN"}const l=Xf({type:o,value:e},{implicitKey:i||a===null,indent:a!==null&&a>0?" ".repeat(a):"",inFlow:s,options:{blockQuote:!0,lineWidth:-1}});switch(l[0]){case"|":case">":QX(t,l);break;case'"':f1(t,l,"double-quoted-scalar");break;case"'":f1(t,l,"single-quoted-scalar");break;default:f1(t,l,"scalar")}}function QX(t,e){const n=e.indexOf(` +`,d=[{type:"block-scalar-header",offset:s,indent:r,source:c}];return nT(d,l)||d.push({type:"newline",offset:-1,indent:r,source:` +`}),{type:"block-scalar",offset:s,indent:r,props:d,source:f}}case'"':return{type:"double-quoted-scalar",offset:s,indent:r,source:a,end:l};case"'":return{type:"single-quoted-scalar",offset:s,indent:r,source:a,end:l};default:return{type:"scalar",offset:s,indent:r,source:a,end:l}}}function eY(t,e,n={}){let{afterKey:r=!1,implicitKey:i=!1,inFlow:s=!1,type:o}=n,a="indent"in t?t.indent:null;if(r&&typeof a=="number"&&(a+=2),!o)switch(t.type){case"single-quoted-scalar":o="QUOTE_SINGLE";break;case"double-quoted-scalar":o="QUOTE_DOUBLE";break;case"block-scalar":{const u=t.props[0];if(u.type!=="block-scalar-header")throw new Error("Invalid block scalar header");o=u.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:o="PLAIN"}const l=Yf({type:o,value:e},{implicitKey:i||a===null,indent:a!==null&&a>0?" ".repeat(a):"",inFlow:s,options:{blockQuote:!0,lineWidth:-1}});switch(l[0]){case"|":case">":tY(t,l);break;case'"':d1(t,l,"double-quoted-scalar");break;case"'":d1(t,l,"single-quoted-scalar");break;default:d1(t,l,"scalar")}}function tY(t,e){const n=e.indexOf(` `),r=e.substring(0,n),i=e.substring(n+1)+` -`;if(t.type==="block-scalar"){const s=t.props[0];if(s.type!=="block-scalar-header")throw new Error("Invalid block scalar header");s.source=r,t.source=i}else{const{offset:s}=t,o="indent"in t?t.indent:-1,a=[{type:"block-scalar-header",offset:s,indent:o,source:r}];tT(a,"end"in t?t.end:void 0)||a.push({type:"newline",offset:-1,indent:o,source:` -`});for(const l of Object.keys(t))l!=="type"&&l!=="offset"&&delete t[l];Object.assign(t,{type:"block-scalar",indent:o,props:a,source:i})}}function tT(t,e){if(e)for(const n of e)switch(n.type){case"space":case"comment":t.push(n);break;case"newline":return t.push(n),!0}return!1}function f1(t,e,n){switch(t.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":t.type=n,t.source=e;break;case"block-scalar":{const r=t.props.slice(1);let i=e.length;t.props[0].type==="block-scalar-header"&&(i-=t.props[0].source.length);for(const s of r)s.offset+=i;delete t.props,Object.assign(t,{type:n,source:e,end:r});break}case"block-map":case"block-seq":{const i={type:"newline",offset:t.offset+e.length,indent:t.indent,source:` -`};delete t.items,Object.assign(t,{type:n,source:e,end:[i]});break}default:{const r="indent"in t?t.indent:-1,i="end"in t&&Array.isArray(t.end)?t.end.filter(s=>s.type==="space"||s.type==="comment"||s.type==="newline"):[];for(const s of Object.keys(t))s!=="type"&&s!=="offset"&&delete t[s];Object.assign(t,{type:n,indent:r,source:e,end:i})}}}const eY=t=>"type"in t?a0(t):qh(t);function a0(t){switch(t.type){case"block-scalar":{let e="";for(const n of t.props)e+=a0(n);return e+t.source}case"block-map":case"block-seq":{let e="";for(const n of t.items)e+=qh(n);return e}case"flow-collection":{let e=t.start.source;for(const n of t.items)e+=qh(n);for(const n of t.end)e+=n.source;return e}case"document":{let e=qh(t);if(t.end)for(const n of t.end)e+=n.source;return e}default:{let e=t.source;if("end"in t&&t.end)for(const n of t.end)e+=n.source;return e}}}function qh({start:t,key:e,sep:n,value:r}){let i="";for(const s of t)i+=s.source;if(e&&(i+=a0(e)),n)for(const s of n)i+=s.source;return r&&(i+=a0(r)),i}const gy=Symbol("break visit"),tY=Symbol("skip children"),nT=Symbol("remove item");function ma(t,e){"type"in t&&t.type==="document"&&(t={start:t.start,value:t.value}),rT(Object.freeze([]),t,e)}ma.BREAK=gy;ma.SKIP=tY;ma.REMOVE=nT;ma.itemAtPath=(t,e)=>{let n=t;for(const[r,i]of e){const s=n==null?void 0:n[r];if(s&&"items"in s)n=s.items[i];else return}return n};ma.parentCollection=(t,e)=>{const n=ma.itemAtPath(t,e.slice(0,-1)),r=e[e.length-1][0],i=n==null?void 0:n[r];if(i&&"items"in i)return i;throw new Error("Parent collection not found")};function rT(t,e,n){let r=n(e,t);if(typeof r=="symbol")return r;for(const i of["key","value"]){const s=e[i];if(s&&"items"in s){for(let o=0;o!!t&&"items"in t,rY=t=>!!t&&(t.type==="scalar"||t.type==="single-quoted-scalar"||t.type==="double-quoted-scalar"||t.type==="block-scalar");function iY(t){switch(t){case _m:return"";case Cm:return"";case Am:return"";case lf:return"";default:return JSON.stringify(t)}}function iT(t){switch(t){case _m:return"byte-order-mark";case Cm:return"doc-mode";case Am:return"flow-error-end";case lf:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case` +`;if(t.type==="block-scalar"){const s=t.props[0];if(s.type!=="block-scalar-header")throw new Error("Invalid block scalar header");s.source=r,t.source=i}else{const{offset:s}=t,o="indent"in t?t.indent:-1,a=[{type:"block-scalar-header",offset:s,indent:o,source:r}];nT(a,"end"in t?t.end:void 0)||a.push({type:"newline",offset:-1,indent:o,source:` +`});for(const l of Object.keys(t))l!=="type"&&l!=="offset"&&delete t[l];Object.assign(t,{type:"block-scalar",indent:o,props:a,source:i})}}function nT(t,e){if(e)for(const n of e)switch(n.type){case"space":case"comment":t.push(n);break;case"newline":return t.push(n),!0}return!1}function d1(t,e,n){switch(t.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":t.type=n,t.source=e;break;case"block-scalar":{const r=t.props.slice(1);let i=e.length;t.props[0].type==="block-scalar-header"&&(i-=t.props[0].source.length);for(const s of r)s.offset+=i;delete t.props,Object.assign(t,{type:n,source:e,end:r});break}case"block-map":case"block-seq":{const i={type:"newline",offset:t.offset+e.length,indent:t.indent,source:` +`};delete t.items,Object.assign(t,{type:n,source:e,end:[i]});break}default:{const r="indent"in t?t.indent:-1,i="end"in t&&Array.isArray(t.end)?t.end.filter(s=>s.type==="space"||s.type==="comment"||s.type==="newline"):[];for(const s of Object.keys(t))s!=="type"&&s!=="offset"&&delete t[s];Object.assign(t,{type:n,indent:r,source:e,end:i})}}}const nY=t=>"type"in t?l0(t):Gh(t);function l0(t){switch(t.type){case"block-scalar":{let e="";for(const n of t.props)e+=l0(n);return e+t.source}case"block-map":case"block-seq":{let e="";for(const n of t.items)e+=Gh(n);return e}case"flow-collection":{let e=t.start.source;for(const n of t.items)e+=Gh(n);for(const n of t.end)e+=n.source;return e}case"document":{let e=Gh(t);if(t.end)for(const n of t.end)e+=n.source;return e}default:{let e=t.source;if("end"in t&&t.end)for(const n of t.end)e+=n.source;return e}}}function Gh({start:t,key:e,sep:n,value:r}){let i="";for(const s of t)i+=s.source;if(e&&(i+=l0(e)),n)for(const s of n)i+=s.source;return r&&(i+=l0(r)),i}const by=Symbol("break visit"),rY=Symbol("skip children"),rT=Symbol("remove item");function ga(t,e){"type"in t&&t.type==="document"&&(t={start:t.start,value:t.value}),iT(Object.freeze([]),t,e)}ga.BREAK=by;ga.SKIP=rY;ga.REMOVE=rT;ga.itemAtPath=(t,e)=>{let n=t;for(const[r,i]of e){const s=n==null?void 0:n[r];if(s&&"items"in s)n=s.items[i];else return}return n};ga.parentCollection=(t,e)=>{const n=ga.itemAtPath(t,e.slice(0,-1)),r=e[e.length-1][0],i=n==null?void 0:n[r];if(i&&"items"in i)return i;throw new Error("Parent collection not found")};function iT(t,e,n){let r=n(e,t);if(typeof r=="symbol")return r;for(const i of["key","value"]){const s=e[i];if(s&&"items"in s){for(let o=0;o!!t&&"items"in t,sY=t=>!!t&&(t.type==="scalar"||t.type==="single-quoted-scalar"||t.type==="double-quoted-scalar"||t.type==="block-scalar");function oY(t){switch(t){case Cm:return"";case Am:return"";case Dm:return"";case lf:return"";default:return JSON.stringify(t)}}function sT(t){switch(t){case Cm:return"byte-order-mark";case Am:return"doc-mode";case Dm:return"flow-error-end";case lf:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case` `:case`\r -`:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(t[0]){case" ":case" ":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}const sY=Object.freeze(Object.defineProperty({__proto__:null,BOM:_m,DOCUMENT:Cm,FLOW_END:Am,SCALAR:lf,createScalarToken:JX,isCollection:nY,isScalar:rY,prettyToken:iY,resolveAsScalar:YX,setScalarValue:ZX,stringify:eY,tokenType:iT,visit:ma},Symbol.toStringTag,{value:"Module"}));function ti(t){switch(t){case void 0:case" ":case` -`:case"\r":case" ":return!0;default:return!1}}const Zw=new Set("0123456789ABCDEFabcdef"),oY=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),th=new Set(",[]{}"),aY=new Set(` ,[]{} -\r `),d1=t=>!t||aY.has(t);class sT{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(e,n=!1){if(e){if(typeof e!="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+e:e,this.lineEndPos=null}this.atEnd=!n;let r=this.next??"stream";for(;r&&(n||this.hasChars(1));)r=yield*this.parseNext(r)}atLineEnd(){let e=this.pos,n=this.buffer[e];for(;n===" "||n===" ";)n=this.buffer[++e];return!n||n==="#"||n===` +`:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(t[0]){case" ":case" ":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}const aY=Object.freeze(Object.defineProperty({__proto__:null,BOM:Cm,DOCUMENT:Am,FLOW_END:Dm,SCALAR:lf,createScalarToken:QX,isCollection:iY,isScalar:sY,prettyToken:oY,resolveAsScalar:ZX,setScalarValue:eY,stringify:nY,tokenType:sT,visit:ga},Symbol.toStringTag,{value:"Module"}));function ti(t){switch(t){case void 0:case" ":case` +`:case"\r":case" ":return!0;default:return!1}}const Qw=new Set("0123456789ABCDEFabcdef"),lY=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),nh=new Set(",[]{}"),uY=new Set(` ,[]{} +\r `),h1=t=>!t||uY.has(t);class oT{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(e,n=!1){if(e){if(typeof e!="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+e:e,this.lineEndPos=null}this.atEnd=!n;let r=this.next??"stream";for(;r&&(n||this.hasChars(1));)r=yield*this.parseNext(r)}atLineEnd(){let e=this.pos,n=this.buffer[e];for(;n===" "||n===" ";)n=this.buffer[++e];return!n||n==="#"||n===` `?!0:n==="\r"?this.buffer[e+1]===` `:!1}charAt(e){return this.buffer[this.pos+e]}continueScalar(e){let n=this.buffer[e];if(this.indentNext>0){let r=0;for(;n===" ";)n=this.buffer[++r+e];if(n==="\r"){const i=this.buffer[r+e+1];if(i===` `||!i&&!this.atEnd)return e+r+1}return n===` `||r>=this.indentNext||!n&&!this.atEnd?e+r:-1}if(n==="-"||n==="."){const r=this.buffer.substr(e,3);if((r==="---"||r==="...")&&ti(this.buffer[e+3]))return-1}return e}getLine(){let e=this.lineEndPos;return(typeof e!="number"||e!==-1&&ethis.indentValue&&!ti(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){const[e,n]=this.peek(2);if(!n&&!this.atEnd)return this.setNext("block-start");if((e==="-"||e==="?"||e===":")&&ti(n)){const r=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=r,yield*this.parseBlockStart()}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);const e=this.getLine();if(e===null)return this.setNext("doc");let n=yield*this.pushIndicators();switch(e[n]){case"#":yield*this.pushCount(e.length-n);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(d1),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return n+=yield*this.parseBlockScalarHeader(),n+=yield*this.pushSpaces(!0),yield*this.pushCount(e.length-n),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let e,n,r=-1;do e=yield*this.pushNewline(),e>0?(n=yield*this.pushSpaces(!1),this.indentValue=r=n):n=0,n+=yield*this.pushSpaces(!0);while(e+n>0);const i=this.getLine();if(i===null)return this.setNext("flow");if((r!==-1&&rthis.indentValue&&!ti(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){const[e,n]=this.peek(2);if(!n&&!this.atEnd)return this.setNext("block-start");if((e==="-"||e==="?"||e===":")&&ti(n)){const r=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=r,yield*this.parseBlockStart()}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);const e=this.getLine();if(e===null)return this.setNext("doc");let n=yield*this.pushIndicators();switch(e[n]){case"#":yield*this.pushCount(e.length-n);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(h1),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return n+=yield*this.parseBlockScalarHeader(),n+=yield*this.pushSpaces(!0),yield*this.pushCount(e.length-n),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let e,n,r=-1;do e=yield*this.pushNewline(),e>0?(n=yield*this.pushSpaces(!1),this.indentValue=r=n):n=0,n+=yield*this.pushSpaces(!0);while(e+n>0);const i=this.getLine();if(i===null)return this.setNext("flow");if((r!==-1&&r"0"&&n<="9")this.blockScalarIndent=Number(n)-1;else if(n!=="-")break}return yield*this.pushUntil(n=>ti(n)||n==="#")}*parseBlockScalar(){let e=this.pos-1,n=0,r;e:for(let s=this.pos;r=this.buffer[s];++s)switch(r){case" ":n+=1;break;case` `:e=s,n=0;break;case"\r":{const o=this.buffer[s+1];if(!o&&!this.atEnd)return this.setNext("block-scalar");if(o===` `)break}default:break e}if(!r&&!this.atEnd)return this.setNext("block-scalar");if(n>=this.indentNext){this.blockScalarIndent===-1?this.indentNext=n:this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{const s=this.continueScalar(e+1);if(s===-1)break;e=this.buffer.indexOf(` `,s)}while(e!==-1);if(e===-1){if(!this.atEnd)return this.setNext("block-scalar");e=this.buffer.length}}let i=e+1;for(r=this.buffer[i];r===" ";)r=this.buffer[++i];if(r===" "){for(;r===" "||r===" "||r==="\r"||r===` `;)r=this.buffer[++i];e=i-1}else if(!this.blockScalarKeep)do{let s=e-1,o=this.buffer[s];o==="\r"&&(o=this.buffer[--s]);const a=s;for(;o===" ";)o=this.buffer[--s];if(o===` -`&&s>=this.pos&&s+1+n>a)e=s;else break}while(!0);return yield lf,yield*this.pushToIndex(e+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){const e=this.flowLevel>0;let n=this.pos-1,r=this.pos-1,i;for(;i=this.buffer[++r];)if(i===":"){const s=this.buffer[r+1];if(ti(s)||e&&th.has(s))break;n=r}else if(ti(i)){let s=this.buffer[r+1];if(i==="\r"&&(s===` +`&&s>=this.pos&&s+1+n>a)e=s;else break}while(!0);return yield lf,yield*this.pushToIndex(e+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){const e=this.flowLevel>0;let n=this.pos-1,r=this.pos-1,i;for(;i=this.buffer[++r];)if(i===":"){const s=this.buffer[r+1];if(ti(s)||e&&nh.has(s))break;n=r}else if(ti(i)){let s=this.buffer[r+1];if(i==="\r"&&(s===` `?(r+=1,i=` -`,s=this.buffer[r+1]):n=r),s==="#"||e&&th.has(s))break;if(i===` -`){const o=this.continueScalar(r+1);if(o===-1)break;r=Math.max(r,o-2)}}else{if(e&&th.has(i))break;n=r}return!i&&!this.atEnd?this.setNext("plain-scalar"):(yield lf,yield*this.pushToIndex(n+1,!0),e?"flow":"doc")}*pushCount(e){return e>0?(yield this.buffer.substr(this.pos,e),this.pos+=e,e):0}*pushToIndex(e,n){const r=this.buffer.slice(this.pos,e);return r?(yield r,this.pos+=r.length,r.length):(n&&(yield""),0)}*pushIndicators(){switch(this.charAt(0)){case"!":return(yield*this.pushTag())+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"&":return(yield*this.pushUntil(d1))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{const e=this.flowLevel>0,n=this.charAt(1);if(ti(n)||e&&th.has(n))return e?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,(yield*this.pushCount(1))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators())}}return 0}*pushTag(){if(this.charAt(1)==="<"){let e=this.pos+2,n=this.buffer[e];for(;!ti(n)&&n!==">";)n=this.buffer[++e];return yield*this.pushToIndex(n===">"?e+1:e,!1)}else{let e=this.pos+1,n=this.buffer[e];for(;n;)if(oY.has(n))n=this.buffer[++e];else if(n==="%"&&Zw.has(this.buffer[e+1])&&Zw.has(this.buffer[e+2]))n=this.buffer[e+=3];else break;return yield*this.pushToIndex(e,!1)}}*pushNewline(){const e=this.buffer[this.pos];return e===` +`,s=this.buffer[r+1]):n=r),s==="#"||e&&nh.has(s))break;if(i===` +`){const o=this.continueScalar(r+1);if(o===-1)break;r=Math.max(r,o-2)}}else{if(e&&nh.has(i))break;n=r}return!i&&!this.atEnd?this.setNext("plain-scalar"):(yield lf,yield*this.pushToIndex(n+1,!0),e?"flow":"doc")}*pushCount(e){return e>0?(yield this.buffer.substr(this.pos,e),this.pos+=e,e):0}*pushToIndex(e,n){const r=this.buffer.slice(this.pos,e);return r?(yield r,this.pos+=r.length,r.length):(n&&(yield""),0)}*pushIndicators(){switch(this.charAt(0)){case"!":return(yield*this.pushTag())+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"&":return(yield*this.pushUntil(h1))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{const e=this.flowLevel>0,n=this.charAt(1);if(ti(n)||e&&nh.has(n))return e?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,(yield*this.pushCount(1))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators())}}return 0}*pushTag(){if(this.charAt(1)==="<"){let e=this.pos+2,n=this.buffer[e];for(;!ti(n)&&n!==">";)n=this.buffer[++e];return yield*this.pushToIndex(n===">"?e+1:e,!1)}else{let e=this.pos+1,n=this.buffer[e];for(;n;)if(lY.has(n))n=this.buffer[++e];else if(n==="%"&&Qw.has(this.buffer[e+1])&&Qw.has(this.buffer[e+2]))n=this.buffer[e+=3];else break;return yield*this.pushToIndex(e,!1)}}*pushNewline(){const e=this.buffer[this.pos];return e===` `?yield*this.pushCount(1):e==="\r"&&this.charAt(1)===` -`?yield*this.pushCount(2):0}*pushSpaces(e){let n=this.pos-1,r;do r=this.buffer[++n];while(r===" "||e&&r===" ");const i=n-this.pos;return i>0&&(yield this.buffer.substr(this.pos,i),this.pos=n),i}*pushUntil(e){let n=this.pos,r=this.buffer[n];for(;!e(r);)r=this.buffer[++n];return yield*this.pushToIndex(n,!1)}}class oT{constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let n=0,r=this.lineStarts.length;for(;n>1;this.lineStarts[s]=0;)switch(t[e].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;((n=t[++e])==null?void 0:n.type)==="space";);return t.splice(e,t.length)}function e_(t){if(t.start.type==="flow-seq-start")for(const e of t.items)e.sep&&!e.value&&!Fs(e.start,"explicit-key-ind")&&!Fs(e.sep,"map-value-ind")&&(e.key&&(e.value=e.key),delete e.key,aT(e.value)?e.value.end?Array.prototype.push.apply(e.value.end,e.sep):e.value.end=e.sep:Array.prototype.push.apply(e.start,e.sep),delete e.sep)}class k2{constructor(e){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new sT,this.onNewLine=e}*parse(e,n=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(const r of this.lexer.lex(e,n))yield*this.next(r);n||(yield*this.end())}*next(e){if(this.source=e,this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=e.length;return}const n=iT(e);if(n)if(n==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=n,yield*this.step(),n){case"newline":this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+e.length);break;case"space":this.atNewLine&&e[0]===" "&&(this.indent+=e.length);break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":this.atNewLine&&(this.indent+=e.length);break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=e.length}else{const r=`Not a YAML token: ${e}`;yield*this.pop({type:"error",offset:this.offset,message:r,source:e}),this.offset+=e.length}}*end(){for(;this.stack.length>0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){const e=this.peek(1);if(this.type==="doc-end"&&(!e||e.type!=="doc-end")){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!e)return yield*this.stream();switch(e.type){case"document":return yield*this.document(e);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(e);case"block-scalar":return yield*this.blockScalar(e);case"block-map":return yield*this.blockMap(e);case"block-seq":return yield*this.blockSequence(e);case"flow-collection":return yield*this.flowCollection(e);case"doc-end":return yield*this.documentEnd(e)}yield*this.pop()}peek(e){return this.stack[this.stack.length-e]}*pop(e){const n=e??this.stack.pop();if(!n)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield n;else{const r=this.peek(1);switch(n.type==="block-scalar"?n.indent="indent"in r?r.indent:0:n.type==="flow-collection"&&r.type==="document"&&(n.indent=0),n.type==="flow-collection"&&e_(n),r.type){case"document":r.value=n;break;case"block-scalar":r.props.push(n);break;case"block-map":{const i=r.items[r.items.length-1];if(i.value){r.items.push({start:[],key:n,sep:[]}),this.onKeyLine=!0;return}else if(i.sep)i.value=n;else{Object.assign(i,{key:n,sep:[]}),this.onKeyLine=!i.explicitKey;return}break}case"block-seq":{const i=r.items[r.items.length-1];i.value?r.items.push({start:[],value:n}):i.value=n;break}case"flow-collection":{const i=r.items[r.items.length-1];!i||i.value?r.items.push({start:[],key:n,sep:[]}):i.sep?i.value=n:Object.assign(i,{key:n,sep:[]});return}default:yield*this.pop(),yield*this.pop(n)}if((r.type==="document"||r.type==="block-map"||r.type==="block-seq")&&(n.type==="block-map"||n.type==="block-seq")){const i=n.items[n.items.length-1];i&&!i.sep&&!i.value&&i.start.length>0&&Qw(i.start)===-1&&(n.indent===0||i.start.every(s=>s.type!=="comment"||s.indent0&&(yield this.buffer.substr(this.pos,i),this.pos=n),i}*pushUntil(e){let n=this.pos,r=this.buffer[n];for(;!e(r);)r=this.buffer[++n];return yield*this.pushToIndex(n,!1)}}class aT{constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let n=0,r=this.lineStarts.length;for(;n>1;this.lineStarts[s]=0;)switch(t[e].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;((n=t[++e])==null?void 0:n.type)==="space";);return t.splice(e,t.length)}function t_(t){if(t.start.type==="flow-seq-start")for(const e of t.items)e.sep&&!e.value&&!Fs(e.start,"explicit-key-ind")&&!Fs(e.sep,"map-value-ind")&&(e.key&&(e.value=e.key),delete e.key,lT(e.value)?e.value.end?Array.prototype.push.apply(e.value.end,e.sep):e.value.end=e.sep:Array.prototype.push.apply(e.start,e.sep),delete e.sep)}class O2{constructor(e){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new oT,this.onNewLine=e}*parse(e,n=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(const r of this.lexer.lex(e,n))yield*this.next(r);n||(yield*this.end())}*next(e){if(this.source=e,this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=e.length;return}const n=sT(e);if(n)if(n==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=n,yield*this.step(),n){case"newline":this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+e.length);break;case"space":this.atNewLine&&e[0]===" "&&(this.indent+=e.length);break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":this.atNewLine&&(this.indent+=e.length);break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=e.length}else{const r=`Not a YAML token: ${e}`;yield*this.pop({type:"error",offset:this.offset,message:r,source:e}),this.offset+=e.length}}*end(){for(;this.stack.length>0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){const e=this.peek(1);if(this.type==="doc-end"&&(!e||e.type!=="doc-end")){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!e)return yield*this.stream();switch(e.type){case"document":return yield*this.document(e);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(e);case"block-scalar":return yield*this.blockScalar(e);case"block-map":return yield*this.blockMap(e);case"block-seq":return yield*this.blockSequence(e);case"flow-collection":return yield*this.flowCollection(e);case"doc-end":return yield*this.documentEnd(e)}yield*this.pop()}peek(e){return this.stack[this.stack.length-e]}*pop(e){const n=e??this.stack.pop();if(!n)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield n;else{const r=this.peek(1);switch(n.type==="block-scalar"?n.indent="indent"in r?r.indent:0:n.type==="flow-collection"&&r.type==="document"&&(n.indent=0),n.type==="flow-collection"&&t_(n),r.type){case"document":r.value=n;break;case"block-scalar":r.props.push(n);break;case"block-map":{const i=r.items[r.items.length-1];if(i.value){r.items.push({start:[],key:n,sep:[]}),this.onKeyLine=!0;return}else if(i.sep)i.value=n;else{Object.assign(i,{key:n,sep:[]}),this.onKeyLine=!i.explicitKey;return}break}case"block-seq":{const i=r.items[r.items.length-1];i.value?r.items.push({start:[],value:n}):i.value=n;break}case"flow-collection":{const i=r.items[r.items.length-1];!i||i.value?r.items.push({start:[],key:n,sep:[]}):i.sep?i.value=n:Object.assign(i,{key:n,sep:[]});return}default:yield*this.pop(),yield*this.pop(n)}if((r.type==="document"||r.type==="block-map"||r.type==="block-seq")&&(n.type==="block-map"||n.type==="block-seq")){const i=n.items[n.items.length-1];i&&!i.sep&&!i.value&&i.start.length>0&&e_(i.start)===-1&&(n.indent===0||i.start.every(s=>s.type!=="comment"||s.indent=e.indent){const i=!this.onKeyLine&&this.indent===e.indent,s=i&&(n.sep||n.explicitKey)&&this.type!=="seq-item-ind";let o=[];if(s&&n.sep&&!n.value){const a=[];for(let l=0;le.indent&&(a.length=0);break;default:a.length=0}}a.length>=2&&(o=n.sep.splice(a[1]))}switch(this.type){case"anchor":case"tag":s||n.value?(o.push(this.sourceToken),e.items.push({start:o}),this.onKeyLine=!0):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"explicit-key-ind":!n.sep&&!n.explicitKey?(n.start.push(this.sourceToken),n.explicitKey=!0):s||n.value?(o.push(this.sourceToken),e.items.push({start:o,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case"map-value-ind":if(n.explicitKey)if(n.sep)if(n.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(Fs(n.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:null,sep:[this.sourceToken]}]});else if(aT(n.key)&&!Fs(n.sep,"newline")){const a=za(n.start),l=n.key,u=n.sep;u.push(this.sourceToken),delete n.key,delete n.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:a,key:l,sep:u}]})}else o.length>0?n.sep=n.sep.concat(o,this.sourceToken):n.sep.push(this.sourceToken);else if(Fs(n.start,"newline"))Object.assign(n,{key:null,sep:[this.sourceToken]});else{const a=za(n.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:a,key:null,sep:[this.sourceToken]}]})}else n.sep?n.value||s?e.items.push({start:o,key:null,sep:[this.sourceToken]}):Fs(n.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):n.sep.push(this.sourceToken):Object.assign(n,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const a=this.flowScalar(this.type);s||n.value?(e.items.push({start:o,key:a,sep:[]}),this.onKeyLine=!0):n.sep?this.stack.push(a):(Object.assign(n,{key:a,sep:[]}),this.onKeyLine=!0);return}default:{const a=this.startBlockValue(e);if(a){if(a.type==="block-seq"){if(!n.explicitKey&&n.sep&&!Fs(n.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else i&&e.items.push({start:o});this.stack.push(a);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(e){var r;const n=e.items[e.items.length-1];switch(this.type){case"newline":if(n.value){const i="end"in n.value?n.value.end:void 0,s=Array.isArray(i)?i[i.length-1]:void 0;(s==null?void 0:s.type)==="comment"?i==null||i.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(n.start,e.indent)){const i=e.items[e.items.length-2],s=(r=i==null?void 0:i.value)==null?void 0:r.end;if(Array.isArray(s)){Array.prototype.push.apply(s,n.start),s.push(this.sourceToken),e.items.pop();return}}n.start.push(this.sourceToken)}return;case"anchor":case"tag":if(n.value||this.indent<=e.indent)break;n.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==e.indent)break;n.value||Fs(n.start,"seq-item-ind")?e.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken);return}if(this.indent>e.indent){const i=this.startBlockValue(e);if(i){this.stack.push(i);return}}yield*this.pop(),yield*this.step()}*flowCollection(e){const n=e.items[e.items.length-1];if(this.type==="flow-error-end"){let r;do yield*this.pop(),r=this.peek(1);while(r&&r.type==="flow-collection")}else if(e.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!n||n.sep?e.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken);return;case"map-value-ind":!n||n.value?e.items.push({start:[],key:null,sep:[this.sourceToken]}):n.sep?n.sep.push(this.sourceToken):Object.assign(n,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!n||n.value?e.items.push({start:[this.sourceToken]}):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const i=this.flowScalar(this.type);!n||n.value?e.items.push({start:[],key:i,sep:[]}):n.sep?this.stack.push(i):Object.assign(n,{key:i,sep:[]});return}case"flow-map-end":case"flow-seq-end":e.end.push(this.sourceToken);return}const r=this.startBlockValue(e);r?this.stack.push(r):(yield*this.pop(),yield*this.step())}else{const r=this.peek(2);if(r.type==="block-map"&&(this.type==="map-value-ind"&&r.indent===e.indent||this.type==="newline"&&!r.items[r.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&r.type!=="flow-collection"){const i=nh(r),s=za(i);e_(e);const o=e.end.splice(1,e.end.length);o.push(this.sourceToken);const a={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:s,key:e,sep:o}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=a}else yield*this.lineEnd(e)}}flowScalar(e){if(this.onNewLine){let n=this.source.indexOf(` +`,n)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){var r;const n=e.items[e.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,n.value){const i="end"in n.value?n.value.end:void 0,s=Array.isArray(i)?i[i.length-1]:void 0;(s==null?void 0:s.type)==="comment"?i==null||i.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)e.items.push({start:[this.sourceToken]});else if(n.sep)n.sep.push(this.sourceToken);else{if(this.atIndentedComment(n.start,e.indent)){const i=e.items[e.items.length-2],s=(r=i==null?void 0:i.value)==null?void 0:r.end;if(Array.isArray(s)){Array.prototype.push.apply(s,n.start),s.push(this.sourceToken),e.items.pop();return}}n.start.push(this.sourceToken)}return}if(this.indent>=e.indent){const i=!this.onKeyLine&&this.indent===e.indent,s=i&&(n.sep||n.explicitKey)&&this.type!=="seq-item-ind";let o=[];if(s&&n.sep&&!n.value){const a=[];for(let l=0;le.indent&&(a.length=0);break;default:a.length=0}}a.length>=2&&(o=n.sep.splice(a[1]))}switch(this.type){case"anchor":case"tag":s||n.value?(o.push(this.sourceToken),e.items.push({start:o}),this.onKeyLine=!0):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"explicit-key-ind":!n.sep&&!n.explicitKey?(n.start.push(this.sourceToken),n.explicitKey=!0):s||n.value?(o.push(this.sourceToken),e.items.push({start:o,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case"map-value-ind":if(n.explicitKey)if(n.sep)if(n.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(Fs(n.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:null,sep:[this.sourceToken]}]});else if(lT(n.key)&&!Fs(n.sep,"newline")){const a=za(n.start),l=n.key,u=n.sep;u.push(this.sourceToken),delete n.key,delete n.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:a,key:l,sep:u}]})}else o.length>0?n.sep=n.sep.concat(o,this.sourceToken):n.sep.push(this.sourceToken);else if(Fs(n.start,"newline"))Object.assign(n,{key:null,sep:[this.sourceToken]});else{const a=za(n.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:a,key:null,sep:[this.sourceToken]}]})}else n.sep?n.value||s?e.items.push({start:o,key:null,sep:[this.sourceToken]}):Fs(n.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):n.sep.push(this.sourceToken):Object.assign(n,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const a=this.flowScalar(this.type);s||n.value?(e.items.push({start:o,key:a,sep:[]}),this.onKeyLine=!0):n.sep?this.stack.push(a):(Object.assign(n,{key:a,sep:[]}),this.onKeyLine=!0);return}default:{const a=this.startBlockValue(e);if(a){if(a.type==="block-seq"){if(!n.explicitKey&&n.sep&&!Fs(n.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else i&&e.items.push({start:o});this.stack.push(a);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(e){var r;const n=e.items[e.items.length-1];switch(this.type){case"newline":if(n.value){const i="end"in n.value?n.value.end:void 0,s=Array.isArray(i)?i[i.length-1]:void 0;(s==null?void 0:s.type)==="comment"?i==null||i.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(n.start,e.indent)){const i=e.items[e.items.length-2],s=(r=i==null?void 0:i.value)==null?void 0:r.end;if(Array.isArray(s)){Array.prototype.push.apply(s,n.start),s.push(this.sourceToken),e.items.pop();return}}n.start.push(this.sourceToken)}return;case"anchor":case"tag":if(n.value||this.indent<=e.indent)break;n.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==e.indent)break;n.value||Fs(n.start,"seq-item-ind")?e.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken);return}if(this.indent>e.indent){const i=this.startBlockValue(e);if(i){this.stack.push(i);return}}yield*this.pop(),yield*this.step()}*flowCollection(e){const n=e.items[e.items.length-1];if(this.type==="flow-error-end"){let r;do yield*this.pop(),r=this.peek(1);while(r&&r.type==="flow-collection")}else if(e.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!n||n.sep?e.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken);return;case"map-value-ind":!n||n.value?e.items.push({start:[],key:null,sep:[this.sourceToken]}):n.sep?n.sep.push(this.sourceToken):Object.assign(n,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!n||n.value?e.items.push({start:[this.sourceToken]}):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const i=this.flowScalar(this.type);!n||n.value?e.items.push({start:[],key:i,sep:[]}):n.sep?this.stack.push(i):Object.assign(n,{key:i,sep:[]});return}case"flow-map-end":case"flow-seq-end":e.end.push(this.sourceToken);return}const r=this.startBlockValue(e);r?this.stack.push(r):(yield*this.pop(),yield*this.step())}else{const r=this.peek(2);if(r.type==="block-map"&&(this.type==="map-value-ind"&&r.indent===e.indent||this.type==="newline"&&!r.items[r.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&r.type!=="flow-collection"){const i=rh(r),s=za(i);t_(e);const o=e.end.splice(1,e.end.length);o.push(this.sourceToken);const a={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:s,key:e,sep:o}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=a}else yield*this.lineEnd(e)}}flowScalar(e){if(this.onNewLine){let n=this.source.indexOf(` `)+1;for(;n!==0;)this.onNewLine(this.offset+n),n=this.source.indexOf(` -`,n)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;const n=nh(e),r=za(n);return r.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;const n=nh(e),r=za(n);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,n){return this.type!=="comment"||this.indent<=n?!1:e.every(r=>r.type==="newline"||r.type==="space")}*documentEnd(e){this.type!=="doc-mode"&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(e){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;case"space":case"comment":default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}}function lT(t){const e=t.prettyErrors!==!1;return{lineCounter:t.lineCounter||e&&new oT||null,prettyErrors:e}}function lY(t,e={}){const{lineCounter:n,prettyErrors:r}=lT(e),i=new k2(n==null?void 0:n.addNewLine),s=new D2(e),o=Array.from(s.compose(i.parse(t)));if(r&&n)for(const a of o)a.errors.forEach(o0(t,n)),a.warnings.forEach(o0(t,n));return o.length>0?o:Object.assign([],{empty:!0},s.streamInfo())}function uT(t,e={}){const{lineCounter:n,prettyErrors:r}=lT(e),i=new k2(n==null?void 0:n.addNewLine),s=new D2(e);let o=null;for(const a of s.compose(i.parse(t),!0,t.length))if(!o)o=a;else if(o.options.logLevel!=="silent"){o.errors.push(new Jo(a.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return r&&n&&(o.errors.forEach(o0(t,n)),o.warnings.forEach(o0(t,n))),o}function uY(t,e,n){let r;typeof e=="function"?r=e:n===void 0&&e&&typeof e=="object"&&(n=e);const i=uT(t,n);if(!i)return null;if(i.warnings.forEach(s=>O6(i.options.logLevel,s)),i.errors.length>0){if(i.options.logLevel!=="silent")throw i.errors[0];i.errors=[]}return i.toJS(Object.assign({reviver:r},n))}function cY(t,e,n){let r=null;if(typeof e=="function"||Array.isArray(e)?r=e:n===void 0&&e&&(n=e),typeof n=="string"&&(n=n.length),typeof n=="number"){const i=Math.round(n);n=i<1?void 0:i>8?{indent:8}:{indent:i}}if(t===void 0){const{keepUndefined:i}=n??e??{};if(!i)return}return Pa(t)&&!r?t.toString(n):new pu(t,r,n).toString(n)}const fY=Object.freeze(Object.defineProperty({__proto__:null,Alias:pm,CST:sY,Composer:D2,Document:pu,Lexer:sT,LineCounter:oT,Pair:Pn,Parser:k2,Scalar:Ie,Schema:wm,YAMLError:C2,YAMLMap:wr,YAMLParseError:Jo,YAMLSeq:So,YAMLWarning:K6,isAlias:Ao,isCollection:Pt,isDocument:Pa,isMap:cu,isNode:Rt,isPair:Ot,isScalar:dt,isSeq:fu,parse:uY,parseAllDocuments:lY,parseDocument:uT,stringify:cY,visit:Ra,visitAsync:hm},Symbol.toStringTag,{value:"Module"}));function dY(t){let e=null;try{e=fY.parse(t.doc.toString())}catch{}const n=Vv(t,At.YAML);return{data:e,pointers:n}}const cT=t=>{switch(t){case At.JSON:return UK;case At.JSON5:return nX;case At.YAML:return dY}};function hY(t){return Object.entries(t)}function ec(t,e){if(typeof t=="string"||typeof t!="object"||t===null)return t;if(Array.isArray(t))return t.map(i=>ec(i,e));if(t instanceof Map){const i=new Map;for(const[s,o]of t){const a=s,l=ec(o,e);i.set(a,l)}return i}if(t instanceof Set){const i=new Set;for(const s of t){const o=ec(s,e);i.add(o)}return i}const n={};function r(i,s,o,a){o===i&&a===s?n[o]=ec(s,e):n[o]=a}for(const[i,s]of hY(t)){const o=e(i,s);if(o.length===2&&typeof o[0]=="string")r(i,s,o[0],o[1]);else for(const[a,l]of o)r(i,s,a,l)}return n}var pY=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i",o[m-1],"..",o[m],"..",o),s.from=a.name===Ne.INVALID?(r=p==null?void 0:p.from)!==null&&r!==void 0?r:e.pos:m,s.to=e.pos}const f=new mY;let d=!0;const h=kE(a,Ne.PROPERTY_NAME,this.mode);if(h&&(Tt.log("xxx","closestPropertyNameNode",h,"node",a),a=h),zd(a,this.mode)){Tt.log("xxx","isPropertyNameNode",a);const p=a.parent;if(p){const m=DE(p,this.mode);d=!m||m.name===Ne.INVALID&&m.from-m.to===0||(m.parent?jf(m.parent).length<=1:!1),Tt.log("xxx","addValue",d,DE(p,this.mode),a),a=(i=kE(p,Ne.OBJECT,this.mode))!==null&&i!==void 0?i:null}}if(Tt.log("xxx",a,u,e,"node at pos",Mg(e.state,e.pos)),a&&[Ne.OBJECT,Ne.JSON_TEXT].includes(qt(a.name,this.mode))&&(zd(Mg(e.state,e.pos),this.mode)||h)){if(a.from===e.pos)return Tt.log("xxx","no completions for just before opening brace"),s;this.getPropertyCompletions(n,e,a,f,d,c)}else{const p={},m=this.getValueCompletions(n,e,p,f);Tt.log("xxx","getValueCompletions res",m)}return s.options=Array.from(f.completions.values()).filter(p=>Mh(p.label).startsWith(l)),Tt.log("xxx","result",s,"prefix",l,"collector.completions",f.completions,"reservedKeys",f.reservedKeys),s}applySnippetCompletion(e){return oz(typeof e.apply!="string"?e.label:e.apply,e)}getPropertyCompletions(e,n,r,i,s,o){const a=kz(r,Ne.PROPERTY,this.mode);Tt.log("xxx","getPropertyCompletions",r,n,a),a.forEach(u=>{const c=Wa(n.state.doc,Hb(u,Ne.PROPERTY_NAME,this.mode));i.reserve(Mh(c))});const l=this.getSchemas(e,n);Tt.log("xxx","propertyCompletion schemas",l),l.forEach(u=>{if(typeof u!="object")return;const c=u.properties;c&&Object.entries(c).forEach(([d,h])=>{var p,m;if(typeof h=="object"){const g=(p=h.description)!==null&&p!==void 0?p:"",b=(m=h.type)!==null&&m!==void 0?m:"",y=Array.isArray(b)?b.toString():b,x={label:d,apply:this.getInsertTextForProperty(d,s,o,e,h),type:"property",detail:y,info:()=>Ci("div",{inner:yl(g)})};i.add(this.applySnippetCompletion(x))}});const f=u.propertyNames;if(typeof f=="object"&&(f.enum&&f.enum.forEach(d=>{const h=d==null?void 0:d.toString();if(h){const p={label:h,apply:this.getInsertTextForProperty(h,s,o,e),type:"property"};i.add(this.applySnippetCompletion(p))}}),f.const)){const d=f.const.toString(),h={label:d,apply:this.getInsertTextForProperty(d,s,o,e),type:"property"};i.add(this.applySnippetCompletion(h))}})}getInsertTextForProperty(e,n,r,i,s){s=s&&Mo(s,i);let o=this.getInsertTextForPropertyName(e,r);if(!n)return o;o+=": ";let a,l=0;if(typeof s=="object"){if(typeof s.default<"u")a||(a=this.getInsertTextForGuessedValue(s.default,"")),l++;else if(s.enum&&(!a&&s.enum.length===1&&(a=this.getInsertTextForGuessedValue(s.enum[0],"")),l+=s.enum.length),typeof s.const<"u"&&(a||(a=this.getInsertTextForGuessedValue(s.const,"")),l++),Array.isArray(s.examples)&&s.examples.length&&(a||(a=this.getInsertTextForGuessedValue(s.examples[0],"")),l+=s.examples.length),a===void 0&&l===0){let u=Array.isArray(s.type)?s.type[0]:s.type;switch(u||(s.properties?u="object":s.items&&(u="array")),u){case"boolean":a="#{}";break;case"string":a=this.getInsertTextForString("");break;case"object":switch(this.mode){case At.JSON5:a="{#{}}";break;case At.YAML:a="#{}";break;default:a="{#{}}";break}break;case"array":a="[#{}]";break;case"number":case"integer":a="#{0}";break;case"null":a="#{null}";break;default:a="#{}";break}}}return(!a||l>1)&&(Tt.log("xxx","value",a,"nValueProposals",l,s),a="#{}"),o+a}getInsertTextForPropertyName(e,n){switch(this.mode){case At.JSON5:case At.YAML:return n.startsWith('"')?`"${e}"`:n.startsWith("'")?`'${e}'`:e;default:return`"${e}"`}}getInsertTextForString(e,n="#"){switch(this.mode){case At.JSON5:return`'${n}{${e}}'`;case At.YAML:return`${n}{${e}}`;default:return`"${n}{${e}}"`}}getInsertTextForGuessedValue(e,n=""){switch(typeof e){case"object":return e===null?"${null}"+n:this.getInsertTextForValue(e,n);case"string":{let r=JSON.stringify(e);return r=r.substr(1,r.length-2),r=this.getInsertTextForPlainText(r),this.getInsertTextForString(r,"$")+n}case"number":case"boolean":return"${"+JSON.stringify(e)+"}"+n}return this.getInsertTextForValue(e,n)}getInsertTextForPlainText(e){return e.replace(/[\\$}]/g,"\\$&")}getInsertTextForValue(e,n){const r=JSON.stringify(e,null," ");return r==="{}"?"{#{}}"+n:r==="[]"?"[#{}]"+n:this.getInsertTextForPlainText(r+n)}getValueCompletions(e,n,r,i){let s=tn(n.state).resolveInner(n.pos,-1),o=null,a;if(Tt.log("xxx","getValueCompletions",s,n),s&&Fh(s,this.mode)&&(o=s,s=s.parent),!s){this.addSchemaValueCompletions(e,r,i);return}if(qt(s.name,this.mode)===Ne.PROPERTY){const u=Hb(s,Ne.PROPERTY_NAME,this.mode);u&&(a=Wa(n.state.doc,u),s=s.parent)}if(Tt.log("xxx","node",s,"parentKey",a),s&&(a!==void 0||qt(s.name,this.mode)===Ne.ARRAY)){const u=this.getSchemas(e,n);for(const c of u){if(typeof c!="object")return;if(qt(s.name,this.mode)===Ne.ARRAY&&c.items){let f=i;if(c.uniqueItems&&(f=Object.assign(Object.assign({},f),{add(d){f.completions.has(d.label)||i.add(d)},reserve(d){i.reserve(d)}})),Array.isArray(c.items)){let d=0;if(o){const p=v3(s,o,this.mode);p>=0&&(d=p)}const h=c.items[d];h&&this.addSchemaValueCompletions(h,r,f)}else this.addSchemaValueCompletions(c.items,r,f)}if((c.type==null||c.type!=="object")&&this.addSchemaValueCompletions(c,r,i),a!==void 0){let f=!1;if(c.properties){const d=c.properties[a];d&&(f=!0,this.addSchemaValueCompletions(d,r,i))}if(c.patternProperties&&!f)for(const d of Object.keys(c.patternProperties)){const h=this.extendedRegExp(d);if(h!=null&&h.test(a)){f=!0;const p=c.patternProperties[d];p&&this.addSchemaValueCompletions(p,r,i)}}if(c.additionalProperties&&!f){const d=c.additionalProperties;this.addSchemaValueCompletions(d,r,i)}}r.boolean&&(this.addBooleanValueCompletion(!0,i),this.addBooleanValueCompletion(!1,i)),r.null&&this.addNullValueCompletion(i)}}return{valuePrefix:o?Wa(n.state.doc,o,!0,!1):""}}addSchemaValueCompletions(e,n,r){typeof e=="object"&&(this.addEnumValueCompletions(e,r),this.addDefaultValueCompletions(e,r),this.collectTypes(e,n),Array.isArray(e.allOf)&&e.allOf.forEach(i=>this.addSchemaValueCompletions(i,n,r)),Array.isArray(e.anyOf)&&e.anyOf.forEach(i=>this.addSchemaValueCompletions(i,n,r)),Array.isArray(e.oneOf)&&e.oneOf.forEach(i=>this.addSchemaValueCompletions(i,n,r)))}addDefaultValueCompletions(e,n,r=0){let i=!1;if(typeof e.default<"u"){let s=e.type,o=e.default;for(let l=r;l>0;l--)o=[o],s="array";const a=Object.assign(Object.assign({type:s==null?void 0:s.toString()},this.getAppliedValue(o)),{detail:"Default value"});n.add(a),i=!0}Array.isArray(e.examples)&&e.examples.forEach(s=>{let o=e.type,a=s;for(let l=r;l>0;l--)a=[a],o="array";n.add(Object.assign({type:o==null?void 0:o.toString()},this.getAppliedValue(a))),i=!0}),!i&&typeof e.items=="object"&&!Array.isArray(e.items)&&r<5&&this.addDefaultValueCompletions(e.items,n,r+1)}addEnumValueCompletions(e,n){var r,i;if(typeof e.const<"u"&&n.add(Object.assign(Object.assign({type:(r=e.type)===null||r===void 0?void 0:r.toString()},this.getAppliedValue(e.const)),{info:e.description})),Array.isArray(e.enum))for(let s=0,o=e.enum.length;sn[i]=!0):r&&(n[r]=!0)}getSchemas(e,n){var r,i,s;const{data:o}=this.parser(n.state),a=new sO(e);let l=b3(n.state,n.pos,-1,this.mode);if(l===""&&(l=void 0),l!=null&&l.endsWith("/")){l=l.substring(0,l.length-1);const p=t_(e,o,l);if(p!=null)return[p]}let u=l!=null?l.replace(/\/[^/]*$/,""):void 0;u===""&&(u=void 0);const c=t_(e,o,u),f=l==null?void 0:l.split("/").pop(),d=f==null||f in((r=c==null?void 0:c.properties)!==null&&r!==void 0?r:{});let h=a.getSchema({pointer:l,data:o??void 0});return!d&&(h==null?void 0:h.type)==="null"&&this.mode==="yaml"&&(h=void 0),Tt.log("xxxx","draft.getSchema",h,"data",o,"pointer",l,"pointerPointsToKnownProperty",d),Nn(h)&&(h=(i=h.data)===null||i===void 0?void 0:i.schema),!yc(h)&&c?[c]:(yc(h)||(h=a.getSchema({pointer:u}),l=u),Tt.log("xxx","pointer..",JSON.stringify(l)),!yc(h)&&(!l||l==="/")&&(h=(s=Mo(e,e))!==null&&s!==void 0?s:e),Tt.log("xxx","subSchema..",h),h?Array.isArray(h.allOf)?[h,...h.allOf.map(p=>Mo(p,e))]:Array.isArray(h.oneOf)?[h,...h.oneOf.map(p=>Mo(p,e))]:Array.isArray(h.anyOf)?[h,...h.anyOf.map(p=>Mo(p,e))]:[h]:[])}getAppliedValue(e){const n=Mh(JSON.stringify(e));switch(this.mode){case At.JSON5:return{label:n,apply:Az(JSON.stringify(e))};case At.YAML:return{label:n,apply:n};default:return{label:n,apply:JSON.stringify(e)}}}getValueFromLabel(e){return JSON.parse(e)}extendedRegExp(e){let n="";e.startsWith("(?i)")&&(e=e.substring(4),n="i");try{return new RegExp(e,n+"u")}catch{try{return new RegExp(e,n)}catch{return}}}}function bY(t={}){const e=new gY(t);return function(r){return e.doComplete(r)}}function yY(t){return ec(t,(e,n)=>e==="additionalProperties"&&n===!1?[]:e==="required"&&Array.isArray(n)?[]:e==="unevaluatedProperties"&&n===!1?[]:e==="unevaluatedItems"&&n===!1?[]:[e,n])}function t_(t,e,n){const r=new sO(t),i=r.getSchema({pointer:n,data:e??void 0});if(!yc(i))return;const s=fT(r,i),o={};for(let d of s){let h=xY(n,d);const p=r.getSchema({pointer:h,data:e??void 0});yc(p)&&Object.assign(o,{[d]:p})}if(s.length===0||Object.keys(o).length===0)return;const a=i,{allOf:l,anyOf:u,oneOf:c}=a,f=pY(a,["allOf","anyOf","oneOf"]);return Object.assign(Object.assign({},f),{properties:o})}function fT(t,e){if(e=Mo(e,t.rootSchema),typeof e!="object"||e==null)return[];const n=[];function r(i){const s=fT(t,i);n.push(...s)}if(typeof e.properties=="object"&&e.properties!=null&&n.push(...Object.keys(e.properties)),typeof e.then=="object"&&e.then!=null&&r(e.then),Array.isArray(e.allOf))for(const i of e.allOf)r(i);if(Array.isArray(e.anyOf))for(const i of e.anyOf)r(i);if(Array.isArray(e.oneOf))for(const i of e.oneOf)r(i);return n}function Mo(t,e){if(typeof t=="object"&&t.$ref){const n=vY(e,t.$ref);if(typeof n=="object"){const r=Object.assign(Object.assign({},t),n);return Reflect.deleteProperty(r,"$ref"),r}}return t}function vY(t,e){const n=e.split("/");let r=t;return n.forEach(i=>{if(i){if(i==="#"){r=t;return}typeof r=="object"&&(r=r[i])}}),r}function xY(t,e){return t===void 0?`/${e}`:`${t}/${e}`}const uf=(t,e)=>{const n=t.length>2;let r=t.map((i,s)=>{const o="`"+(e?e(i):i)+"`";return s===t.length-1?"or "+o:o});return n?r.join(", "):r.join(" ")},SY=t=>{var e,n,r;return!((e=t==null?void 0:t.data)===null||e===void 0)&&e.pointer&&((n=t==null?void 0:t.data)===null||n===void 0?void 0:n.pointer)!=="#"?t.data.pointer.slice(1):!((r=t==null?void 0:t.data)===null||r===void 0)&&r.property?`/${t.data.property}`:""},EY=t=>t.startState.field(Fp)!==t.state.field(Fp);function wY(t){const e=new CY(t);return n=>e.doValidation(n)}const _Y=["NoAdditionalPropertiesError","RequiredPropertyError","InvalidPropertyNameError","ForbiddenPropertyError","UndefinedValueError"];class CY{constructor(e){var n,r,i,s;this.options=e,this.schema=null,this.mode=At.JSON,this.rewriteError=o=>{var a,l,u,c,f;const d=o==null?void 0:o.data,h=d==null?void 0:d.errors;return o.code==="one-of-error"&&(h!=null&&h.length)?`Expected one of ${uf(h,m=>m.data.expected)}`:o.code==="type-error"?`Expected \`${!((a=o==null?void 0:o.data)===null||a===void 0)&&a.expected&&Array.isArray((l=o==null?void 0:o.data)===null||l===void 0?void 0:l.expected)?uf((u=o==null?void 0:o.data)===null||u===void 0?void 0:u.expected):(c=o==null?void 0:o.data)===null||c===void 0?void 0:c.expected}\` but received \`${(f=o==null?void 0:o.data)===null||f===void 0?void 0:f.received}\``:o.message.replaceAll("in `#` ","").replaceAll("at `#`","").replaceAll("/",".").replaceAll("#.","")},this.mode=(r=(n=this.options)===null||n===void 0?void 0:n.mode)!==null&&r!==void 0?r:At.JSON,this.parser=(s=(i=this.options)===null||i===void 0?void 0:i.jsonParser)!==null&&s!==void 0?s:cT(this.mode)}get schemaTitle(){var e,n,r;return(r=(n=(e=this.schema)===null||e===void 0?void 0:e.getSchema())===null||n===void 0?void 0:n.title)!==null&&r!==void 0?r:"json-schema"}doValidation(e){const n=Uv(e.state);if(!n)return[];if(this.schema=new rO(n),!this.schema)return[];const r=e.state.doc.toString();if(!(r!=null&&r.length))return[];const i=this.parser(e.state);if(i.data==null)return[];let s=[];try{s=this.schema.validate(i.data)}catch{}return Tt.log("xxx","validation errors",s,i.data),s.length?s.reduce((o,a)=>{const l=()=>{const f=this.rewriteError(a);o.push({from:0,to:0,message:f,severity:"error",source:this.schemaTitle,renderMessage:()=>{const d=Ci("div",{});return d.innerHTML=yl(f),d}})},u=SY(a),c=i.pointers.get(u);if(a.name==="MaxPropertiesError"||a.name==="MinPropertiesError"||u==="")l();else if(c){const f=_Y.includes(a.name),d=this.rewriteError(a),h=f?c.keyFrom:c.valueFrom,p=f?c.keyTo:c.valueTo;p!==void 0&&h!==void 0&&o.push({from:h,to:p,message:d,renderMessage:()=>{const m=Ci("div",{});return m.innerHTML=yl(d),m},severity:"error",source:this.schemaTitle})}else l();return o},[]):[]}}function AY(t){const e=new DY(t);return async function(r,i,s){return e.doHover(r,i,s)}}function n_(t){if(t.type)return t.$ref?`${t.$ref} (${t.type})`:t.type;if(t.$ref)return`${t.$ref}`}function h1(t,e,n){return`${e}: ${uf(t[e].map(r=>{try{const{data:i}=n.resolveRef({data:r,pointer:r.$ref});return n_(i||r)}catch{return r.type}}))}`}class DY{constructor(e){var n,r;this.opts=e,this.schema=null,this.mode=At.JSON,this.opts=Object.assign({parser:JSON.parse},this.opts),this.mode=(r=(n=this.opts)===null||n===void 0?void 0:n.mode)!==null&&r!==void 0?r:At.JSON}getDataForCursor(e,n,r){const i=Uv(e.state);if(!i)return null;this.schema=new rO(i);const s=b3(e.state,n,r,this.mode);let o;try{o=this.opts.parser(e.state.doc.toString())}catch{}if(!s)return null;let a=this.schema.getSchema({pointer:s,data:o,withSchemaWarning:!0});return Nn(a)&&(a!=null&&a.data.schema.$ref?a=this.schema.resolveRef(a):a=a==null?void 0:a.data.schema),{schema:a,pointer:s}}formatMessage(e){const{message:n,typeInfo:r}=e;return n?Ci("div",{class:"cm6-json-schema-hover"},[Ci("div",{class:"cm6-json-schema-hover--description",inner:yl(n,!1)}),Ci("div",{class:"cm6-json-schema-hover--code-wrapper"},[Ci("div",{class:"cm6-json-schema-hover--code",inner:yl(r,!1)})])]):Ci("div",{class:"cm6-json-schema-hover"},[Ci("div",{class:"cm6-json-schema-hover--code-wrapper"},[Ci("code",{class:"cm6-json-schema-hover--code",inner:yl(r,!1)})])])}getHoverTexts(e,n){let r="",i=null;const{schema:s}=e;return s.oneOf&&(r=h1(s,"oneOf",n)),s.anyOf&&(r=h1(s,"anyOf",n)),s.allOf&&(r=h1(s,"allOf",n)),s.type&&(r=Array.isArray(s.type)?uf(s.type):s.type),s.$ref&&(r=` Reference: ${s.$ref}`),s.enum&&(r=`\`enum\`: ${uf(s.enum)}`),s.format&&(r+=`\`format\`: ${s.format}`),s.pattern&&(r+=`\`pattern\`: ${s.pattern}`),s.description&&(i=s.description),{message:i,typeInfo:r}}async doHover(e,n,r){var i,s,o,a;const l=n,u=n;try{const c=this.getDataForCursor(e,n,r);if(Tt.log("cursorData",c),!(c!=null&&c.schema))return null;const d=((s=(i=this.opts)===null||i===void 0?void 0:i.getHoverTexts)!==null&&s!==void 0?s:this.getHoverTexts)(c,this.schema),p=((a=(o=this.opts)===null||o===void 0?void 0:o.formatHover)!==null&&a!==void 0?a:this.formatMessage)(d);return{pos:l,end:u,arrow:!0,above:!0,create:m=>({dom:p})}}catch(c){return Tt.log(c),null}}}function kY(t){return[n3(),Fb(E7()),Fb(wY(),{needsRefresh:EY}),t3.data.of({autocomplete:bY()}),gk(AY()),Iz(t)]}const OY=(t,e)=>{const n=dT(t);return n.push(n3()),e!==void 0&&n.push(kY(e)),t||n.push(n$),n},dT=t=>{const e=[YB()];return t&&e.push(Ue.readOnly.of(!0)),e},TY=t=>dT(t),IY=t=>{let{state:e}=t,n=e.doc.lineAt(e.selection.main.from),r=T2(t.state,n.from);return r.line?PY(t):r.block?NY(t):!1};function O2(t,e){return({state:n,dispatch:r})=>{if(n.readOnly)return!1;let i=t(e,n);return i?(r(n.update(i)),!0):!1}}const PY=O2(LY,0),RY=O2(hT,0),NY=O2((t,e)=>hT(t,e,FY(e)),0);function T2(t,e){let n=t.languageDataAt("commentTokens",e,1);return n.length?n[0]:{}}const zu=50;function MY(t,{open:e,close:n},r,i){let s=t.sliceDoc(r-zu,r),o=t.sliceDoc(i,i+zu),a=/\s*$/.exec(s)[0].length,l=/^\s*/.exec(o)[0].length,u=s.length-a;if(s.slice(u-e.length,u)==e&&o.slice(l,l+n.length)==n)return{open:{pos:r-a,margin:a&&1},close:{pos:i+l,margin:l&&1}};let c,f;i-r<=2*zu?c=f=t.sliceDoc(r,i):(c=t.sliceDoc(r,r+zu),f=t.sliceDoc(i-zu,i));let d=/^\s*/.exec(c)[0].length,h=/\s*$/.exec(f)[0].length,p=f.length-h-n.length;return c.slice(d,d+e.length)==e&&f.slice(p,p+n.length)==n?{open:{pos:r+d+e.length,margin:/\s/.test(c.charAt(d+e.length))?1:0},close:{pos:i-h-n.length,margin:/\s/.test(f.charAt(p-1))?1:0}}:null}function FY(t){let e=[];for(let n of t.selection.ranges){let r=t.doc.lineAt(n.from),i=n.to<=r.to?r:t.doc.lineAt(n.to);i.from>r.from&&i.from==n.to&&(i=n.to==r.to+1?r:t.doc.lineAt(n.to-1));let s=e.length-1;s>=0&&e[s].to>r.from?e[s].to=i.to:e.push({from:r.from+/^\s*/.exec(r.text)[0].length,to:i.to})}return e}function hT(t,e,n=e.selection.ranges){let r=n.map(s=>T2(e,s.from).block);if(!r.every(s=>s))return null;let i=n.map((s,o)=>MY(e,r[o],s.from,s.to));if(t!=2&&!i.every(s=>s))return{changes:e.changes(n.map((s,o)=>i[o]?[]:[{from:s.from,insert:r[o].open+" "},{from:s.to,insert:" "+r[o].close}]))};if(t!=1&&i.some(s=>s)){let s=[];for(let o=0,a;oi&&(s==o||o>f.from)){i=f.from;let d=/^\s*/.exec(f.text)[0].length,h=d==f.length,p=f.text.slice(d,d+u.length)==u?d:-1;ds.comment<0&&(!s.empty||s.single))){let s=[];for(let{line:a,token:l,indent:u,empty:c,single:f}of r)(f||!c)&&s.push({from:a.from+u,insert:l+" "});let o=e.changes(s);return{changes:o,selection:e.selection.map(o,1)}}else if(t!=1&&r.some(s=>s.comment>=0)){let s=[];for(let{line:o,comment:a,token:l}of r)if(a>=0){let u=o.from+a,c=u+l.length;o.text[c-o.from]==" "&&c++,s.push({from:u,to:c})}return{changes:s}}return null}const by=As.define(),BY=As.define(),$Y=he.define(),pT=he.define({combine(t){return fi(t,{minDepth:100,newGroupDelay:500,joinToEvent:(e,n)=>n},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,n)=>(r,i)=>e(r,i)||n(r,i)})}}),mT=Wt.define({create(){return Fi.empty},update(t,e){let n=e.state.facet(pT),r=e.annotation(by);if(r){let l=ar.fromTransaction(e,r.selection),u=r.side,c=u==0?t.undone:t.done;return l?c=l0(c,c.length,n.minDepth,l):c=yT(c,e.startState.selection),new Fi(u==0?r.rest:c,u==0?c:r.rest)}let i=e.annotation(BY);if((i=="full"||i=="before")&&(t=t.isolate()),e.annotation(Qt.addToHistory)===!1)return e.changes.empty?t:t.addMapping(e.changes.desc);let s=ar.fromTransaction(e),o=e.annotation(Qt.time),a=e.annotation(Qt.userEvent);return s?t=t.addChanges(s,o,a,n,e):e.selection&&(t=t.addSelection(e.startState.selection,o,a,n.newGroupDelay)),(i=="full"||i=="after")&&(t=t.isolate()),t},toJSON(t){return{done:t.done.map(e=>e.toJSON()),undone:t.undone.map(e=>e.toJSON())}},fromJSON(t){return new Fi(t.done.map(ar.fromJSON),t.undone.map(ar.fromJSON))}});function zY(t={}){return[mT,pT.of(t),ce.domEventHandlers({beforeinput(e,n){let r=e.inputType=="historyUndo"?gT:e.inputType=="historyRedo"?yy:null;return r?(e.preventDefault(),r(n)):!1}})]}function Dm(t,e){return function({state:n,dispatch:r}){if(!e&&n.readOnly)return!1;let i=n.field(mT,!1);if(!i)return!1;let s=i.pop(t,n,e);return s?(r(s),!0):!1}}const gT=Dm(0,!1),yy=Dm(1,!1),jY=Dm(0,!0),VY=Dm(1,!0);class ar{constructor(e,n,r,i,s){this.changes=e,this.effects=n,this.mapped=r,this.startSelection=i,this.selectionsAfter=s}setSelAfter(e){return new ar(this.changes,this.effects,this.mapped,this.startSelection,e)}toJSON(){var e,n,r;return{changes:(e=this.changes)===null||e===void 0?void 0:e.toJSON(),mapped:(n=this.mapped)===null||n===void 0?void 0:n.toJSON(),startSelection:(r=this.startSelection)===null||r===void 0?void 0:r.toJSON(),selectionsAfter:this.selectionsAfter.map(i=>i.toJSON())}}static fromJSON(e){return new ar(e.changes&&sn.fromJSON(e.changes),[],e.mapped&&Li.fromJSON(e.mapped),e.startSelection&&Y.fromJSON(e.startSelection),e.selectionsAfter.map(Y.fromJSON))}static fromTransaction(e,n){let r=zr;for(let i of e.startState.facet($Y)){let s=i(e);s.length&&(r=r.concat(s))}return!r.length&&e.changes.empty?null:new ar(e.changes.invert(e.startState.doc),r,void 0,n||e.startState.selection,zr)}static selection(e){return new ar(void 0,zr,void 0,void 0,e)}}function l0(t,e,n,r){let i=e+1>n+20?e-n-1:0,s=t.slice(i,e);return s.push(r),s}function UY(t,e){let n=[],r=!1;return t.iterChangedRanges((i,s)=>n.push(i,s)),e.iterChangedRanges((i,s,o,a)=>{for(let l=0;l=u&&o<=c&&(r=!0)}}),r}function HY(t,e){return t.ranges.length==e.ranges.length&&t.ranges.filter((n,r)=>n.empty!=e.ranges[r].empty).length===0}function bT(t,e){return t.length?e.length?t.concat(e):t:e}const zr=[],qY=200;function yT(t,e){if(t.length){let n=t[t.length-1],r=n.selectionsAfter.slice(Math.max(0,n.selectionsAfter.length-qY));return r.length&&r[r.length-1].eq(e)?t:(r.push(e),l0(t,t.length-1,1e9,n.setSelAfter(r)))}else return[ar.selection([e])]}function GY(t){let e=t[t.length-1],n=t.slice();return n[t.length-1]=e.setSelAfter(e.selectionsAfter.slice(0,e.selectionsAfter.length-1)),n}function p1(t,e){if(!t.length)return t;let n=t.length,r=zr;for(;n;){let i=WY(t[n-1],e,r);if(i.changes&&!i.changes.empty||i.effects.length){let s=t.slice(0,n);return s[n-1]=i,s}else e=i.mapped,n--,r=i.selectionsAfter}return r.length?[ar.selection(r)]:zr}function WY(t,e,n){let r=bT(t.selectionsAfter.length?t.selectionsAfter.map(a=>a.map(e)):zr,n);if(!t.changes)return ar.selection(r);let i=t.changes.map(e),s=e.mapDesc(t.changes,!0),o=t.mapped?t.mapped.composeDesc(s):s;return new ar(i,De.mapEffects(t.effects,e),o,t.startSelection.map(s),r)}const KY=/^(input\.type|delete)($|\.)/;class Fi{constructor(e,n,r=0,i=void 0){this.done=e,this.undone=n,this.prevTime=r,this.prevUserEvent=i}isolate(){return this.prevTime?new Fi(this.done,this.undone):this}addChanges(e,n,r,i,s){let o=this.done,a=o[o.length-1];return a&&a.changes&&!a.changes.empty&&e.changes&&(!r||KY.test(r))&&(!a.selectionsAfter.length&&n-this.prevTime0&&n-this.prevTimen.empty?t.moveByChar(n,e):km(n,e))}function Mn(t){return t.textDirectionAt(t.state.selection.main.head)==Et.LTR}const xT=t=>vT(t,!Mn(t)),ST=t=>vT(t,Mn(t));function ET(t,e){return mi(t,n=>n.empty?t.moveByGroup(n,e):km(n,e))}const YY=t=>ET(t,!Mn(t)),JY=t=>ET(t,Mn(t));function ZY(t,e,n){if(e.type.prop(n))return!0;let r=e.to-e.from;return r&&(r>2||/[^\s,.;:]/.test(t.sliceDoc(e.from,e.to)))||e.firstChild}function Om(t,e,n){let r=tn(t).resolveInner(e.head),i=n?Ve.closedBy:Ve.openedBy;for(let l=e.head;;){let u=n?r.childAfter(l):r.childBefore(l);if(!u)break;ZY(t,u,i)?r=u:l=n?u.to:u.from}let s=r.type.prop(i),o,a;return s&&(o=n?Ri(t,r.from,1):Ri(t,r.to,-1))&&o.matched?a=n?o.end.to:o.end.from:a=n?r.to:r.from,Y.cursor(a,n?-1:1)}const QY=t=>mi(t,e=>Om(t.state,e,!Mn(t))),eJ=t=>mi(t,e=>Om(t.state,e,Mn(t)));function wT(t,e){return mi(t,n=>{if(!n.empty)return km(n,e);let r=t.moveVertically(n,e);return r.head!=n.head?r:t.moveToLineBoundary(n,e)})}const _T=t=>wT(t,!1),CT=t=>wT(t,!0);function AT(t){let e=t.scrollDOM.clientHeighto.empty?t.moveVertically(o,e,n.height):km(o,e));if(i.eq(r.selection))return!1;let s;if(n.selfScroll){let o=t.coordsAtPos(r.selection.main.head),a=t.scrollDOM.getBoundingClientRect(),l=a.top+n.marginTop,u=a.bottom-n.marginBottom;o&&o.top>l&&o.bottomDT(t,!1),vy=t=>DT(t,!0);function Do(t,e,n){let r=t.lineBlockAt(e.head),i=t.moveToLineBoundary(e,n);if(i.head==e.head&&i.head!=(n?r.to:r.from)&&(i=t.moveToLineBoundary(e,n,!1)),!n&&i.head==r.from&&r.length){let s=/^\s*/.exec(t.state.sliceDoc(r.from,Math.min(r.from+100,r.to)))[0].length;s&&e.head!=r.from+s&&(i=Y.cursor(r.from+s))}return i}const tJ=t=>mi(t,e=>Do(t,e,!0)),nJ=t=>mi(t,e=>Do(t,e,!1)),rJ=t=>mi(t,e=>Do(t,e,!Mn(t))),iJ=t=>mi(t,e=>Do(t,e,Mn(t))),sJ=t=>mi(t,e=>Y.cursor(t.lineBlockAt(e.head).from,1)),oJ=t=>mi(t,e=>Y.cursor(t.lineBlockAt(e.head).to,-1));function aJ(t,e,n){let r=!1,i=mu(t.selection,s=>{let o=Ri(t,s.head,-1)||Ri(t,s.head,1)||s.head>0&&Ri(t,s.head-1,1)||s.headaJ(t,e);function Zr(t,e){let n=mu(t.state.selection,r=>{let i=e(r);return Y.range(r.anchor,i.head,i.goalColumn,i.bidiLevel||void 0)});return n.eq(t.state.selection)?!1:(t.dispatch(pi(t.state,n)),!0)}function kT(t,e){return Zr(t,n=>t.moveByChar(n,e))}const OT=t=>kT(t,!Mn(t)),TT=t=>kT(t,Mn(t));function IT(t,e){return Zr(t,n=>t.moveByGroup(n,e))}const uJ=t=>IT(t,!Mn(t)),cJ=t=>IT(t,Mn(t)),fJ=t=>Zr(t,e=>Om(t.state,e,!Mn(t))),dJ=t=>Zr(t,e=>Om(t.state,e,Mn(t)));function PT(t,e){return Zr(t,n=>t.moveVertically(n,e))}const RT=t=>PT(t,!1),NT=t=>PT(t,!0);function MT(t,e){return Zr(t,n=>t.moveVertically(n,e,AT(t).height))}const i_=t=>MT(t,!1),s_=t=>MT(t,!0),hJ=t=>Zr(t,e=>Do(t,e,!0)),pJ=t=>Zr(t,e=>Do(t,e,!1)),mJ=t=>Zr(t,e=>Do(t,e,!Mn(t))),gJ=t=>Zr(t,e=>Do(t,e,Mn(t))),bJ=t=>Zr(t,e=>Y.cursor(t.lineBlockAt(e.head).from)),yJ=t=>Zr(t,e=>Y.cursor(t.lineBlockAt(e.head).to)),o_=({state:t,dispatch:e})=>(e(pi(t,{anchor:0})),!0),a_=({state:t,dispatch:e})=>(e(pi(t,{anchor:t.doc.length})),!0),l_=({state:t,dispatch:e})=>(e(pi(t,{anchor:t.selection.main.anchor,head:0})),!0),u_=({state:t,dispatch:e})=>(e(pi(t,{anchor:t.selection.main.anchor,head:t.doc.length})),!0),vJ=({state:t,dispatch:e})=>(e(t.update({selection:{anchor:0,head:t.doc.length},userEvent:"select"})),!0),xJ=({state:t,dispatch:e})=>{let n=Tm(t).map(({from:r,to:i})=>Y.range(r,Math.min(i+1,t.doc.length)));return e(t.update({selection:Y.create(n),userEvent:"select"})),!0},SJ=({state:t,dispatch:e})=>{let n=mu(t.selection,r=>{let i=tn(t),s=i.resolveStack(r.from,1);if(r.empty){let o=i.resolveStack(r.from,-1);o.node.from>=s.node.from&&o.node.to<=s.node.to&&(s=o)}for(let o=s;o;o=o.next){let{node:a}=o;if((a.from=r.to||a.to>r.to&&a.from<=r.from)&&o.next)return Y.range(a.to,a.from)}return r});return n.eq(t.selection)?!1:(e(pi(t,n)),!0)};function FT(t,e){let{state:n}=t,r=n.selection,i=n.selection.ranges.slice();for(let s of n.selection.ranges){let o=n.doc.lineAt(s.head);if(e?o.to0)for(let a=s;;){let l=t.moveVertically(a,e);if(l.heado.to){i.some(u=>u.head==l.head)||i.push(l);break}else{if(l.head==a.head)break;a=l}}}return i.length==r.ranges.length?!1:(t.dispatch(pi(n,Y.create(i,i.length-1))),!0)}const EJ=t=>FT(t,!1),wJ=t=>FT(t,!0),_J=({state:t,dispatch:e})=>{let n=t.selection,r=null;return n.ranges.length>1?r=Y.create([n.main]):n.main.empty||(r=Y.create([Y.cursor(n.main.head)])),r?(e(pi(t,r)),!0):!1};function Zf(t,e){if(t.state.readOnly)return!1;let n="delete.selection",{state:r}=t,i=r.changeByRange(s=>{let{from:o,to:a}=s;if(o==a){let l=e(s);lo&&(n="delete.forward",l=rh(t,l,!0)),o=Math.min(o,l),a=Math.max(a,l)}else o=rh(t,o,!1),a=rh(t,a,!0);return o==a?{range:s}:{changes:{from:o,to:a},range:Y.cursor(o,oi(t)))r.between(e,e,(i,s)=>{ie&&(e=n?s:i)});return e}const LT=(t,e,n)=>Zf(t,r=>{let i=r.from,{state:s}=t,o=s.doc.lineAt(i),a,l;if(n&&!e&&i>o.from&&iLT(t,!1,!0),BT=t=>LT(t,!0,!1),$T=(t,e)=>Zf(t,n=>{let r=n.head,{state:i}=t,s=i.doc.lineAt(r),o=i.charCategorizer(r);for(let a=null;;){if(r==(e?s.to:s.from)){r==n.head&&s.number!=(e?i.doc.lines:1)&&(r+=e?1:-1);break}let l=wn(s.text,r-s.from,e)+s.from,u=s.text.slice(Math.min(r,l)-s.from,Math.max(r,l)-s.from),c=o(u);if(a!=null&&c!=a)break;(u!=" "||r!=n.head)&&(a=c),r=l}return r}),zT=t=>$T(t,!1),CJ=t=>$T(t,!0),AJ=t=>Zf(t,e=>{let n=t.lineBlockAt(e.head).to;return e.headZf(t,e=>{let n=t.moveToLineBoundary(e,!1).head;return e.head>n?n:Math.max(0,e.head-1)}),kJ=t=>Zf(t,e=>{let n=t.moveToLineBoundary(e,!0).head;return e.head{if(t.readOnly)return!1;let n=t.changeByRange(r=>({changes:{from:r.from,to:r.to,insert:Ze.of(["",""])},range:Y.cursor(r.from)}));return e(t.update(n,{scrollIntoView:!0,userEvent:"input"})),!0},TJ=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let n=t.changeByRange(r=>{if(!r.empty||r.from==0||r.from==t.doc.length)return{range:r};let i=r.from,s=t.doc.lineAt(i),o=i==s.from?i-1:wn(s.text,i-s.from,!1)+s.from,a=i==s.to?i+1:wn(s.text,i-s.from,!0)+s.from;return{changes:{from:o,to:a,insert:t.doc.slice(i,a).append(t.doc.slice(o,i))},range:Y.cursor(a)}});return n.changes.empty?!1:(e(t.update(n,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function Tm(t){let e=[],n=-1;for(let r of t.selection.ranges){let i=t.doc.lineAt(r.from),s=t.doc.lineAt(r.to);if(!r.empty&&r.to==s.from&&(s=t.doc.lineAt(r.to-1)),n>=i.number){let o=e[e.length-1];o.to=s.to,o.ranges.push(r)}else e.push({from:i.from,to:s.to,ranges:[r]});n=s.number+1}return e}function jT(t,e,n){if(t.readOnly)return!1;let r=[],i=[];for(let s of Tm(t)){if(n?s.to==t.doc.length:s.from==0)continue;let o=t.doc.lineAt(n?s.to+1:s.from-1),a=o.length+1;if(n){r.push({from:s.to,to:o.to},{from:s.from,insert:o.text+t.lineBreak});for(let l of s.ranges)i.push(Y.range(Math.min(t.doc.length,l.anchor+a),Math.min(t.doc.length,l.head+a)))}else{r.push({from:o.from,to:s.from},{from:s.to,insert:t.lineBreak+o.text});for(let l of s.ranges)i.push(Y.range(l.anchor-a,l.head-a))}}return r.length?(e(t.update({changes:r,scrollIntoView:!0,selection:Y.create(i,t.selection.mainIndex),userEvent:"move.line"})),!0):!1}const IJ=({state:t,dispatch:e})=>jT(t,e,!1),PJ=({state:t,dispatch:e})=>jT(t,e,!0);function VT(t,e,n){if(t.readOnly)return!1;let r=[];for(let i of Tm(t))n?r.push({from:i.from,insert:t.doc.slice(i.from,i.to)+t.lineBreak}):r.push({from:i.to,insert:t.lineBreak+t.doc.slice(i.from,i.to)});return e(t.update({changes:r,scrollIntoView:!0,userEvent:"input.copyline"})),!0}const RJ=({state:t,dispatch:e})=>VT(t,e,!1),NJ=({state:t,dispatch:e})=>VT(t,e,!0),MJ=t=>{if(t.state.readOnly)return!1;let{state:e}=t,n=e.changes(Tm(e).map(({from:i,to:s})=>(i>0?i--:s{let s;if(t.lineWrapping){let o=t.lineBlockAt(i.head),a=t.coordsAtPos(i.head,i.assoc||1);a&&(s=o.bottom+t.documentTop-a.bottom+t.defaultLineHeight/2)}return t.moveVertically(i,!0,s)}).map(n);return t.dispatch({changes:n,selection:r,scrollIntoView:!0,userEvent:"delete.line"}),!0};function FJ(t,e){if(/\(\)|\[\]|\{\}/.test(t.sliceDoc(e-1,e+1)))return{from:e,to:e};let n=tn(t).resolveInner(e),r=n.childBefore(e),i=n.childAfter(e),s;return r&&i&&r.to<=e&&i.from>=e&&(s=r.type.prop(Ve.closedBy))&&s.indexOf(i.name)>-1&&t.doc.lineAt(r.to).from==t.doc.lineAt(i.from).from&&!/\S/.test(t.sliceDoc(r.to,i.from))?{from:r.to,to:i.from}:null}const c_=UT(!1),LJ=UT(!0);function UT(t){return({state:e,dispatch:n})=>{if(e.readOnly)return!1;let r=e.changeByRange(i=>{let{from:s,to:o}=i,a=e.doc.lineAt(s),l=!t&&s==o&&FJ(e,s);t&&(s=o=(o<=a.to?a:e.doc.lineAt(o)).to);let u=new Z0(e,{simulateBreak:s,simulateDoubleBreak:!!l}),c=Pv(u,s);for(c==null&&(c=ru(/^\s*/.exec(e.doc.lineAt(s).text)[0],e.tabSize));oa.from&&s{let i=[];for(let o=r.from;o<=r.to;){let a=t.doc.lineAt(o);a.number>n&&(r.empty||r.to>a.from)&&(e(a,i,r),n=a.number),o=a.to+1}let s=t.changes(i);return{changes:i,range:Y.range(s.mapPos(r.anchor,1),s.mapPos(r.head,1))}})}const BJ=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let n=Object.create(null),r=new Z0(t,{overrideIndentation:s=>{let o=n[s];return o??-1}}),i=I2(t,(s,o,a)=>{let l=Pv(r,s.from);if(l==null)return;/\S/.test(s.text)||(l=0);let u=/^\s*/.exec(s.text)[0],c=Hc(t,l);(u!=c||a.fromt.readOnly?!1:(e(t.update(I2(t,(n,r)=>{r.push({from:n.from,insert:t.facet(Bf)})}),{userEvent:"input.indent"})),!0),qT=({state:t,dispatch:e})=>t.readOnly?!1:(e(t.update(I2(t,(n,r)=>{let i=/^\s*/.exec(n.text)[0];if(!i)return;let s=ru(i,t.tabSize),o=0,a=Hc(t,Math.max(0,s-Ip(t)));for(;o(t.setTabFocusMode(),!0),zJ=[{key:"Ctrl-b",run:xT,shift:OT,preventDefault:!0},{key:"Ctrl-f",run:ST,shift:TT},{key:"Ctrl-p",run:_T,shift:RT},{key:"Ctrl-n",run:CT,shift:NT},{key:"Ctrl-a",run:sJ,shift:bJ},{key:"Ctrl-e",run:oJ,shift:yJ},{key:"Ctrl-d",run:BT},{key:"Ctrl-h",run:xy},{key:"Ctrl-k",run:AJ},{key:"Ctrl-Alt-h",run:zT},{key:"Ctrl-o",run:OJ},{key:"Ctrl-t",run:TJ},{key:"Ctrl-v",run:vy}],jJ=[{key:"ArrowLeft",run:xT,shift:OT,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:YY,shift:uJ,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:rJ,shift:mJ,preventDefault:!0},{key:"ArrowRight",run:ST,shift:TT,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:JY,shift:cJ,preventDefault:!0},{mac:"Cmd-ArrowRight",run:iJ,shift:gJ,preventDefault:!0},{key:"ArrowUp",run:_T,shift:RT,preventDefault:!0},{mac:"Cmd-ArrowUp",run:o_,shift:l_},{mac:"Ctrl-ArrowUp",run:r_,shift:i_},{key:"ArrowDown",run:CT,shift:NT,preventDefault:!0},{mac:"Cmd-ArrowDown",run:a_,shift:u_},{mac:"Ctrl-ArrowDown",run:vy,shift:s_},{key:"PageUp",run:r_,shift:i_},{key:"PageDown",run:vy,shift:s_},{key:"Home",run:nJ,shift:pJ,preventDefault:!0},{key:"Mod-Home",run:o_,shift:l_},{key:"End",run:tJ,shift:hJ,preventDefault:!0},{key:"Mod-End",run:a_,shift:u_},{key:"Enter",run:c_,shift:c_},{key:"Mod-a",run:vJ},{key:"Backspace",run:xy,shift:xy,preventDefault:!0},{key:"Delete",run:BT,preventDefault:!0},{key:"Mod-Backspace",mac:"Alt-Backspace",run:zT,preventDefault:!0},{key:"Mod-Delete",mac:"Alt-Delete",run:CJ,preventDefault:!0},{mac:"Mod-Backspace",run:DJ,preventDefault:!0},{mac:"Mod-Delete",run:kJ,preventDefault:!0}].concat(zJ.map(t=>({mac:t.key,run:t.run,shift:t.shift}))),VJ=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:QY,shift:fJ},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:eJ,shift:dJ},{key:"Alt-ArrowUp",run:IJ},{key:"Shift-Alt-ArrowUp",run:RJ},{key:"Alt-ArrowDown",run:PJ},{key:"Shift-Alt-ArrowDown",run:NJ},{key:"Mod-Alt-ArrowUp",run:EJ},{key:"Mod-Alt-ArrowDown",run:wJ},{key:"Escape",run:_J},{key:"Mod-Enter",run:LJ},{key:"Alt-l",mac:"Ctrl-l",run:xJ},{key:"Mod-i",run:SJ,preventDefault:!0},{key:"Mod-[",run:qT},{key:"Mod-]",run:HT},{key:"Mod-Alt-\\",run:BJ},{key:"Shift-Mod-k",run:MJ},{key:"Shift-Mod-\\",run:lJ},{key:"Mod-/",run:IY},{key:"Alt-A",run:RY},{key:"Ctrl-m",mac:"Shift-Alt-m",run:$J}].concat(jJ),UJ={key:"Tab",run:HT,shift:qT},f_=typeof String.prototype.normalize=="function"?t=>t.normalize("NFKD"):t=>t;class zl{constructor(e,n,r=0,i=e.length,s,o){this.test=o,this.value={from:0,to:0},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=e.iterRange(r,i),this.bufferStart=r,this.normalize=s?a=>s(f_(a)):f_,this.query=this.normalize(n)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return ir(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let e=this.peek();if(e<0)return this.done=!0,this;let n=dv(e),r=this.bufferStart+this.bufferPos;this.bufferPos+=Di(e);let i=this.normalize(n);if(i.length)for(let s=0,o=r;;s++){let a=i.charCodeAt(s),l=this.match(a,o,this.bufferPos+this.bufferStart);if(s==i.length-1){if(l)return this.value=l,this;break}o==r&&sthis.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine="":this.getLine(0)}next(){for(let e=this.matchPos-this.curLineStart;;){this.re.lastIndex=e;let n=this.matchPos<=this.to&&this.re.exec(this.curLine);if(n){let r=this.curLineStart+n.index,i=r+n[0].length;if(this.matchPos=u0(this.text,i+(r==i?1:0)),r==this.curLineStart+this.curLine.length&&this.nextLine(),(rthis.value.to)&&(!this.test||this.test(r,i,n)))return this.value={from:r,to:i,match:n},this;e=this.matchPos-this.curLineStart}else if(this.curLineStart+this.curLine.length=r||i.to<=n){let a=new Sl(n,e.sliceString(n,r));return m1.set(e,a),a}if(i.from==n&&i.to==r)return i;let{text:s,from:o}=i;return o>n&&(s=e.sliceString(n,o)+s,o=n),i.to=this.to?this.to:this.text.lineAt(e).to}next(){for(;;){let e=this.re.lastIndex=this.matchPos-this.flat.from,n=this.re.exec(this.flat.text);if(n&&!n[0]&&n.index==e&&(this.re.lastIndex=e+1,n=this.re.exec(this.flat.text)),n){let r=this.flat.from+n.index,i=r+n[0].length;if((this.flat.to>=this.to||n.index+n[0].length<=this.flat.text.length-10)&&(!this.test||this.test(r,i,n)))return this.value={from:r,to:i,match:n},this.matchPos=u0(this.text,i+(r==i?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=Sl.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}}typeof Symbol<"u"&&(WT.prototype[Symbol.iterator]=KT.prototype[Symbol.iterator]=function(){return this});function HJ(t){try{return new RegExp(t,P2),!0}catch{return!1}}function u0(t,e){if(e>=t.length)return e;let n=t.lineAt(e),r;for(;e=56320&&r<57344;)e++;return e}function Sy(t){let e=String(t.state.doc.lineAt(t.state.selection.main.head).number),n=ct("input",{class:"cm-textfield",name:"line",value:e}),r=ct("form",{class:"cm-gotoLine",onkeydown:s=>{s.keyCode==27?(s.preventDefault(),t.dispatch({effects:vc.of(!1)}),t.focus()):s.keyCode==13&&(s.preventDefault(),i())},onsubmit:s=>{s.preventDefault(),i()}},ct("label",t.state.phrase("Go to line"),": ",n)," ",ct("button",{class:"cm-button",type:"submit"},t.state.phrase("go")),ct("button",{name:"close",onclick:()=>{t.dispatch({effects:vc.of(!1)}),t.focus()},"aria-label":t.state.phrase("close"),type:"button"},["×"]));function i(){let s=/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(n.value);if(!s)return;let{state:o}=t,a=o.doc.lineAt(o.selection.main.head),[,l,u,c,f]=s,d=c?+c.slice(1):0,h=u?+u:a.number;if(u&&f){let g=h/100;l&&(g=g*(l=="-"?-1:1)+a.number/o.doc.lines),h=Math.round(o.doc.lines*g)}else u&&l&&(h=h*(l=="-"?-1:1)+a.number);let p=o.doc.line(Math.max(1,Math.min(o.doc.lines,h))),m=Y.cursor(p.from+Math.max(0,Math.min(d,p.length)));t.dispatch({effects:[vc.of(!1),ce.scrollIntoView(m.from,{y:"center"})],selection:m}),t.focus()}return{dom:r}}const vc=De.define(),d_=Wt.define({create(){return!0},update(t,e){for(let n of e.effects)n.is(vc)&&(t=n.value);return t},provide:t=>jc.from(t,e=>e?Sy:null)}),qJ=t=>{let e=zc(t,Sy);if(!e){let n=[vc.of(!0)];t.state.field(d_,!1)==null&&n.push(De.appendConfig.of([d_,GJ])),t.dispatch({effects:n}),e=zc(t,Sy)}return e&&e.dom.querySelector("input").select(),!0},GJ=ce.baseTheme({".cm-panel.cm-gotoLine":{padding:"2px 6px 4px",position:"relative","& label":{fontSize:"80%"},"& [name=close]":{position:"absolute",top:"0",bottom:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:"0"}}}),WJ={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},KJ=he.define({combine(t){return fi(t,WJ,{highlightWordAroundCursor:(e,n)=>e||n,minSelectionLength:Math.min,maxMatches:Math.min})}});function XJ(t){return[eZ,QJ]}const YJ=ve.mark({class:"cm-selectionMatch"}),JJ=ve.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function h_(t,e,n,r){return(n==0||t(e.sliceDoc(n-1,n))!=kt.Word)&&(r==e.doc.length||t(e.sliceDoc(r,r+1))!=kt.Word)}function ZJ(t,e,n,r){return t(e.sliceDoc(n,n+1))==kt.Word&&t(e.sliceDoc(r-1,r))==kt.Word}const QJ=$t.fromClass(class{constructor(t){this.decorations=this.getDeco(t)}update(t){(t.selectionSet||t.docChanged||t.viewportChanged)&&(this.decorations=this.getDeco(t.view))}getDeco(t){let e=t.state.facet(KJ),{state:n}=t,r=n.selection;if(r.ranges.length>1)return ve.none;let i=r.main,s,o=null;if(i.empty){if(!e.highlightWordAroundCursor)return ve.none;let l=n.wordAt(i.head);if(!l)return ve.none;o=n.charCategorizer(i.head),s=n.sliceDoc(l.from,l.to)}else{let l=i.to-i.from;if(l200)return ve.none;if(e.wholeWords){if(s=n.sliceDoc(i.from,i.to),o=n.charCategorizer(i.head),!(h_(o,n,i.from,i.to)&&ZJ(o,n,i.from,i.to)))return ve.none}else if(s=n.sliceDoc(i.from,i.to),!s)return ve.none}let a=[];for(let l of t.visibleRanges){let u=new zl(n.doc,s,l.from,l.to);for(;!u.next().done;){let{from:c,to:f}=u.value;if((!o||h_(o,n,c,f))&&(i.empty&&c<=i.from&&f>=i.to?a.push(JJ.range(c,f)):(c>=i.to||f<=i.from)&&a.push(YJ.range(c,f)),a.length>e.maxMatches))return ve.none}}return ve.set(a)}},{decorations:t=>t.decorations}),eZ=ce.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),tZ=({state:t,dispatch:e})=>{let{selection:n}=t,r=Y.create(n.ranges.map(i=>t.wordAt(i.head)||Y.cursor(i.head)),n.mainIndex);return r.eq(n)?!1:(e(t.update({selection:r})),!0)};function nZ(t,e){let{main:n,ranges:r}=t.selection,i=t.wordAt(n.head),s=i&&i.from==n.from&&i.to==n.to;for(let o=!1,a=new zl(t.doc,e,r[r.length-1].to);;)if(a.next(),a.done){if(o)return null;a=new zl(t.doc,e,0,Math.max(0,r[r.length-1].from-1)),o=!0}else{if(o&&r.some(l=>l.from==a.value.from))continue;if(s){let l=t.wordAt(a.value.from);if(!l||l.from!=a.value.from||l.to!=a.value.to)continue}return a.value}}const rZ=({state:t,dispatch:e})=>{let{ranges:n}=t.selection;if(n.some(s=>s.from===s.to))return tZ({state:t,dispatch:e});let r=t.sliceDoc(n[0].from,n[0].to);if(t.selection.ranges.some(s=>t.sliceDoc(s.from,s.to)!=r))return!1;let i=nZ(t,r);return i?(e(t.update({selection:t.selection.addRange(Y.range(i.from,i.to),!1),effects:ce.scrollIntoView(i.to)})),!0):!1},gu=he.define({combine(t){return fi(t,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:e=>new mZ(e),scrollToMatch:e=>ce.scrollIntoView(e)})}});class XT{constructor(e){this.search=e.search,this.caseSensitive=!!e.caseSensitive,this.literal=!!e.literal,this.regexp=!!e.regexp,this.replace=e.replace||"",this.valid=!!this.search&&(!this.regexp||HJ(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!e.wholeWord}unquote(e){return this.literal?e:e.replace(/\\([nrt\\])/g,(n,r)=>r=="n"?` -`:r=="r"?"\r":r=="t"?" ":"\\")}eq(e){return this.search==e.search&&this.replace==e.replace&&this.caseSensitive==e.caseSensitive&&this.regexp==e.regexp&&this.wholeWord==e.wholeWord}create(){return this.regexp?new aZ(this):new sZ(this)}getCursor(e,n=0,r){let i=e.doc?e:Ue.create({doc:e});return r==null&&(r=i.doc.length),this.regexp?Xa(this,i,n,r):Ka(this,i,n,r)}}class YT{constructor(e){this.spec=e}}function Ka(t,e,n,r){return new zl(e.doc,t.unquoted,n,r,t.caseSensitive?void 0:i=>i.toLowerCase(),t.wholeWord?iZ(e.doc,e.charCategorizer(e.selection.main.head)):void 0)}function iZ(t,e){return(n,r,i,s)=>((s>n||s+i.length=n)return null;i.push(r.value)}return i}highlight(e,n,r,i){let s=Ka(this.spec,e,Math.max(0,n-this.spec.unquoted.length),Math.min(r+this.spec.unquoted.length,e.doc.length));for(;!s.next().done;)i(s.value.from,s.value.to)}}function Xa(t,e,n,r){return new WT(e.doc,t.search,{ignoreCase:!t.caseSensitive,test:t.wholeWord?oZ(e.charCategorizer(e.selection.main.head)):void 0},n,r)}function c0(t,e){return t.slice(wn(t,e,!1),e)}function f0(t,e){return t.slice(e,wn(t,e))}function oZ(t){return(e,n,r)=>!r[0].length||(t(c0(r.input,r.index))!=kt.Word||t(f0(r.input,r.index))!=kt.Word)&&(t(f0(r.input,r.index+r[0].length))!=kt.Word||t(c0(r.input,r.index+r[0].length))!=kt.Word)}class aZ extends YT{nextMatch(e,n,r){let i=Xa(this.spec,e,r,e.doc.length).next();return i.done&&(i=Xa(this.spec,e,0,n).next()),i.done?null:i.value}prevMatchInRange(e,n,r){for(let i=1;;i++){let s=Math.max(n,r-i*1e4),o=Xa(this.spec,e,s,r),a=null;for(;!o.next().done;)a=o.value;if(a&&(s==n||a.from>s+10))return a;if(s==n)return null}}prevMatch(e,n,r){return this.prevMatchInRange(e,0,n)||this.prevMatchInRange(e,r,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace).replace(/\$([$&]|\d+)/g,(n,r)=>{if(r=="&")return e.match[0];if(r=="$")return"$";for(let i=r.length;i>0;i--){let s=+r.slice(0,i);if(s>0&&s=n)return null;i.push(r.value)}return i}highlight(e,n,r,i){let s=Xa(this.spec,e,Math.max(0,n-250),Math.min(r+250,e.doc.length));for(;!s.next().done;)i(s.value.from,s.value.to)}}const cf=De.define(),R2=De.define(),so=Wt.define({create(t){return new g1(Ey(t).create(),null)},update(t,e){for(let n of e.effects)n.is(cf)?t=new g1(n.value.create(),t.panel):n.is(R2)&&(t=new g1(t.query,n.value?N2:null));return t},provide:t=>jc.from(t,e=>e.panel)});class g1{constructor(e,n){this.query=e,this.panel=n}}const lZ=ve.mark({class:"cm-searchMatch"}),uZ=ve.mark({class:"cm-searchMatch cm-searchMatch-selected"}),cZ=$t.fromClass(class{constructor(t){this.view=t,this.decorations=this.highlight(t.state.field(so))}update(t){let e=t.state.field(so);(e!=t.startState.field(so)||t.docChanged||t.selectionSet||t.viewportChanged)&&(this.decorations=this.highlight(e))}highlight({query:t,panel:e}){if(!e||!t.spec.valid)return ve.none;let{view:n}=this,r=new _s;for(let i=0,s=n.visibleRanges,o=s.length;is[i+1].from-500;)l=s[++i].to;t.highlight(n.state,a,l,(u,c)=>{let f=n.state.selection.ranges.some(d=>d.from==u&&d.to==c);r.add(u,c,f?uZ:lZ)})}return r.finish()}},{decorations:t=>t.decorations});function Qf(t){return e=>{let n=e.state.field(so,!1);return n&&n.query.spec.valid?t(e,n):QT(e)}}const d0=Qf((t,{query:e})=>{let{to:n}=t.state.selection.main,r=e.nextMatch(t.state,n,n);if(!r)return!1;let i=Y.single(r.from,r.to),s=t.state.facet(gu);return t.dispatch({selection:i,effects:[M2(t,r),s.scrollToMatch(i.main,t)],userEvent:"select.search"}),ZT(t),!0}),h0=Qf((t,{query:e})=>{let{state:n}=t,{from:r}=n.selection.main,i=e.prevMatch(n,r,r);if(!i)return!1;let s=Y.single(i.from,i.to),o=t.state.facet(gu);return t.dispatch({selection:s,effects:[M2(t,i),o.scrollToMatch(s.main,t)],userEvent:"select.search"}),ZT(t),!0}),fZ=Qf((t,{query:e})=>{let n=e.matchAll(t.state,1e3);return!n||!n.length?!1:(t.dispatch({selection:Y.create(n.map(r=>Y.range(r.from,r.to))),userEvent:"select.search.matches"}),!0)}),dZ=({state:t,dispatch:e})=>{let n=t.selection;if(n.ranges.length>1||n.main.empty)return!1;let{from:r,to:i}=n.main,s=[],o=0;for(let a=new zl(t.doc,t.sliceDoc(r,i));!a.next().done;){if(s.length>1e3)return!1;a.value.from==r&&(o=s.length),s.push(Y.range(a.value.from,a.value.to))}return e(t.update({selection:Y.create(s,o),userEvent:"select.search.matches"})),!0},p_=Qf((t,{query:e})=>{let{state:n}=t,{from:r,to:i}=n.selection.main;if(n.readOnly)return!1;let s=e.nextMatch(n,r,r);if(!s)return!1;let o=s,a=[],l,u,c=[];o.from==r&&o.to==i&&(u=n.toText(e.getReplacement(o)),a.push({from:o.from,to:o.to,insert:u}),o=e.nextMatch(n,o.from,o.to),c.push(ce.announce.of(n.phrase("replaced match on line $",n.doc.lineAt(r).number)+".")));let f=t.state.changes(a);return o&&(l=Y.single(o.from,o.to).map(f),c.push(M2(t,o)),c.push(n.facet(gu).scrollToMatch(l.main,t))),t.dispatch({changes:f,selection:l,effects:c,userEvent:"input.replace"}),!0}),hZ=Qf((t,{query:e})=>{if(t.state.readOnly)return!1;let n=e.matchAll(t.state,1e9).map(i=>{let{from:s,to:o}=i;return{from:s,to:o,insert:e.getReplacement(i)}});if(!n.length)return!1;let r=t.state.phrase("replaced $ matches",n.length)+".";return t.dispatch({changes:n,effects:ce.announce.of(r),userEvent:"input.replace.all"}),!0});function N2(t){return t.state.facet(gu).createPanel(t)}function Ey(t,e){var n,r,i,s,o;let a=t.selection.main,l=a.empty||a.to>a.from+100?"":t.sliceDoc(a.from,a.to);if(e&&!l)return e;let u=t.facet(gu);return new XT({search:((n=e==null?void 0:e.literal)!==null&&n!==void 0?n:u.literal)?l:l.replace(/\n/g,"\\n"),caseSensitive:(r=e==null?void 0:e.caseSensitive)!==null&&r!==void 0?r:u.caseSensitive,literal:(i=e==null?void 0:e.literal)!==null&&i!==void 0?i:u.literal,regexp:(s=e==null?void 0:e.regexp)!==null&&s!==void 0?s:u.regexp,wholeWord:(o=e==null?void 0:e.wholeWord)!==null&&o!==void 0?o:u.wholeWord})}function JT(t){let e=zc(t,N2);return e&&e.dom.querySelector("[main-field]")}function ZT(t){let e=JT(t);e&&e==t.root.activeElement&&e.select()}const QT=t=>{let e=t.state.field(so,!1);if(e&&e.panel){let n=JT(t);if(n&&n!=t.root.activeElement){let r=Ey(t.state,e.query.spec);r.valid&&t.dispatch({effects:cf.of(r)}),n.focus(),n.select()}}else t.dispatch({effects:[R2.of(!0),e?cf.of(Ey(t.state,e.query.spec)):De.appendConfig.of(bZ)]});return!0},e8=t=>{let e=t.state.field(so,!1);if(!e||!e.panel)return!1;let n=zc(t,N2);return n&&n.dom.contains(t.root.activeElement)&&t.focus(),t.dispatch({effects:R2.of(!1)}),!0},pZ=[{key:"Mod-f",run:QT,scope:"editor search-panel"},{key:"F3",run:d0,shift:h0,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:d0,shift:h0,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:e8,scope:"editor search-panel"},{key:"Mod-Shift-l",run:dZ},{key:"Mod-Alt-g",run:qJ},{key:"Mod-d",run:rZ,preventDefault:!0}];class mZ{constructor(e){this.view=e;let n=this.query=e.state.field(so).query.spec;this.commit=this.commit.bind(this),this.searchField=ct("input",{value:n.search,placeholder:mr(e,"Find"),"aria-label":mr(e,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=ct("input",{value:n.replace,placeholder:mr(e,"Replace"),"aria-label":mr(e,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=ct("input",{type:"checkbox",name:"case",form:"",checked:n.caseSensitive,onchange:this.commit}),this.reField=ct("input",{type:"checkbox",name:"re",form:"",checked:n.regexp,onchange:this.commit}),this.wordField=ct("input",{type:"checkbox",name:"word",form:"",checked:n.wholeWord,onchange:this.commit});function r(i,s,o){return ct("button",{class:"cm-button",name:i,onclick:s,type:"button"},o)}this.dom=ct("div",{onkeydown:i=>this.keydown(i),class:"cm-search"},[this.searchField,r("next",()=>d0(e),[mr(e,"next")]),r("prev",()=>h0(e),[mr(e,"previous")]),r("select",()=>fZ(e),[mr(e,"all")]),ct("label",null,[this.caseField,mr(e,"match case")]),ct("label",null,[this.reField,mr(e,"regexp")]),ct("label",null,[this.wordField,mr(e,"by word")]),...e.state.readOnly?[]:[ct("br"),this.replaceField,r("replace",()=>p_(e),[mr(e,"replace")]),r("replaceAll",()=>hZ(e),[mr(e,"replace all")])],ct("button",{name:"close",onclick:()=>e8(e),"aria-label":mr(e,"close"),type:"button"},["×"])])}commit(){let e=new XT({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,wholeWord:this.wordField.checked,replace:this.replaceField.value});e.eq(this.query)||(this.query=e,this.view.dispatch({effects:cf.of(e)}))}keydown(e){RL(this.view,e,"search-panel")?e.preventDefault():e.keyCode==13&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?h0:d0)(this.view)):e.keyCode==13&&e.target==this.replaceField&&(e.preventDefault(),p_(this.view))}update(e){for(let n of e.transactions)for(let r of n.effects)r.is(cf)&&!r.value.eq(this.query)&&this.setQuery(r.value)}setQuery(e){this.query=e,this.searchField.value=e.search,this.replaceField.value=e.replace,this.caseField.checked=e.caseSensitive,this.reField.checked=e.regexp,this.wordField.checked=e.wholeWord}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(gu).top}}function mr(t,e){return t.state.phrase(e)}const ih=30,sh=/[\s\.,:;?!]/;function M2(t,{from:e,to:n}){let r=t.state.doc.lineAt(e),i=t.state.doc.lineAt(n).to,s=Math.max(r.from,e-ih),o=Math.min(i,n+ih),a=t.state.sliceDoc(s,o);if(s!=r.from){for(let l=0;la.length-ih;l--)if(!sh.test(a[l-1])&&sh.test(a[l])){a=a.slice(0,l);break}}return ce.announce.of(`${t.state.phrase("current match")}. ${a} ${t.state.phrase("on line")} ${r.number}.`)}const gZ=ce.baseTheme({".cm-panel.cm-search":{padding:"2px 6px 4px",position:"relative","& [name=close]":{position:"absolute",top:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:0,margin:0},"& input, & button, & label":{margin:".2em .6em .2em 0"},"& input[type=checkbox]":{marginRight:".2em"},"& label":{fontSize:"80%",whiteSpace:"pre"}},"&light .cm-searchMatch":{backgroundColor:"#ffff0054"},"&dark .cm-searchMatch":{backgroundColor:"#00ffff8a"},"&light .cm-searchMatch-selected":{backgroundColor:"#ff6a0054"},"&dark .cm-searchMatch-selected":{backgroundColor:"#ff00ff8a"}}),bZ=[so,Co.low(cZ),gZ],yZ=[TB(),RB(),YL(),zY(),r7(),$L(),HL(),Ue.allowMultipleSelections.of(!0),U$(),s7(l7,{fallback:!0}),m7(),lz(),vz(),cB(),hB(),nB(),XJ(),Ff.of([...dz,...VJ,...pZ,...XY,...Q$,...h3,...$B])];/*! +`,n)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;const n=rh(e),r=za(n);return r.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;const n=rh(e),r=za(n);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,n){return this.type!=="comment"||this.indent<=n?!1:e.every(r=>r.type==="newline"||r.type==="space")}*documentEnd(e){this.type!=="doc-mode"&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(e){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;case"space":case"comment":default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}}function uT(t){const e=t.prettyErrors!==!1;return{lineCounter:t.lineCounter||e&&new aT||null,prettyErrors:e}}function cY(t,e={}){const{lineCounter:n,prettyErrors:r}=uT(e),i=new O2(n==null?void 0:n.addNewLine),s=new k2(e),o=Array.from(s.compose(i.parse(t)));if(r&&n)for(const a of o)a.errors.forEach(a0(t,n)),a.warnings.forEach(a0(t,n));return o.length>0?o:Object.assign([],{empty:!0},s.streamInfo())}function cT(t,e={}){const{lineCounter:n,prettyErrors:r}=uT(e),i=new O2(n==null?void 0:n.addNewLine),s=new k2(e);let o=null;for(const a of s.compose(i.parse(t),!0,t.length))if(!o)o=a;else if(o.options.logLevel!=="silent"){o.errors.push(new Zo(a.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return r&&n&&(o.errors.forEach(a0(t,n)),o.warnings.forEach(a0(t,n))),o}function fY(t,e,n){let r;typeof e=="function"?r=e:n===void 0&&e&&typeof e=="object"&&(n=e);const i=cT(t,n);if(!i)return null;if(i.warnings.forEach(s=>T6(i.options.logLevel,s)),i.errors.length>0){if(i.options.logLevel!=="silent")throw i.errors[0];i.errors=[]}return i.toJS(Object.assign({reviver:r},n))}function dY(t,e,n){let r=null;if(typeof e=="function"||Array.isArray(e)?r=e:n===void 0&&e&&(n=e),typeof n=="string"&&(n=n.length),typeof n=="number"){const i=Math.round(n);n=i<1?void 0:i>8?{indent:8}:{indent:i}}if(t===void 0){const{keepUndefined:i}=n??e??{};if(!i)return}return Pa(t)&&!r?t.toString(n):new pu(t,r,n).toString(n)}const hY=Object.freeze(Object.defineProperty({__proto__:null,Alias:mm,CST:aY,Composer:k2,Document:pu,Lexer:oT,LineCounter:aT,Pair:Pn,Parser:O2,Scalar:Ie,Schema:_m,YAMLError:A2,YAMLMap:wr,YAMLParseError:Zo,YAMLSeq:So,YAMLWarning:X6,isAlias:Do,isCollection:Pt,isDocument:Pa,isMap:cu,isNode:Rt,isPair:Ot,isScalar:dt,isSeq:fu,parse:fY,parseAllDocuments:cY,parseDocument:cT,stringify:dY,visit:Ra,visitAsync:pm},Symbol.toStringTag,{value:"Module"}));function pY(t){let e=null;try{e=hY.parse(t.doc.toString())}catch{}const n=Uv(t,At.YAML);return{data:e,pointers:n}}const fT=t=>{switch(t){case At.JSON:return qK;case At.JSON5:return iX;case At.YAML:return pY}};function mY(t){return Object.entries(t)}function ec(t,e){if(typeof t=="string"||typeof t!="object"||t===null)return t;if(Array.isArray(t))return t.map(i=>ec(i,e));if(t instanceof Map){const i=new Map;for(const[s,o]of t){const a=s,l=ec(o,e);i.set(a,l)}return i}if(t instanceof Set){const i=new Set;for(const s of t){const o=ec(s,e);i.add(o)}return i}const n={};function r(i,s,o,a){o===i&&a===s?n[o]=ec(s,e):n[o]=a}for(const[i,s]of mY(t)){const o=e(i,s);if(o.length===2&&typeof o[0]=="string")r(i,s,o[0],o[1]);else for(const[a,l]of o)r(i,s,a,l)}return n}var gY=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i",o[m-1],"..",o[m],"..",o),s.from=a.name===Ne.INVALID?(r=p==null?void 0:p.from)!==null&&r!==void 0?r:e.pos:m,s.to=e.pos}const f=new bY;let d=!0;const h=OE(a,Ne.PROPERTY_NAME,this.mode);if(h&&(Tt.log("xxx","closestPropertyNameNode",h,"node",a),a=h),jd(a,this.mode)){Tt.log("xxx","isPropertyNameNode",a);const p=a.parent;if(p){const m=kE(p,this.mode);d=!m||m.name===Ne.INVALID&&m.from-m.to===0||(m.parent?Vf(m.parent).length<=1:!1),Tt.log("xxx","addValue",d,kE(p,this.mode),a),a=(i=OE(p,Ne.OBJECT,this.mode))!==null&&i!==void 0?i:null}}if(Tt.log("xxx",a,u,e,"node at pos",Fg(e.state,e.pos)),a&&[Ne.OBJECT,Ne.JSON_TEXT].includes(qt(a.name,this.mode))&&(jd(Fg(e.state,e.pos),this.mode)||h)){if(a.from===e.pos)return Tt.log("xxx","no completions for just before opening brace"),s;this.getPropertyCompletions(n,e,a,f,d,c)}else{const p={},m=this.getValueCompletions(n,e,p,f);Tt.log("xxx","getValueCompletions res",m)}return s.options=Array.from(f.completions.values()).filter(p=>Fh(p.label).startsWith(l)),Tt.log("xxx","result",s,"prefix",l,"collector.completions",f.completions,"reservedKeys",f.reservedKeys),s}applySnippetCompletion(e){return lz(typeof e.apply!="string"?e.label:e.apply,e)}getPropertyCompletions(e,n,r,i,s,o){const a=Tz(r,Ne.PROPERTY,this.mode);Tt.log("xxx","getPropertyCompletions",r,n,a),a.forEach(u=>{const c=Wa(n.state.doc,qb(u,Ne.PROPERTY_NAME,this.mode));i.reserve(Fh(c))});const l=this.getSchemas(e,n);Tt.log("xxx","propertyCompletion schemas",l),l.forEach(u=>{if(typeof u!="object")return;const c=u.properties;c&&Object.entries(c).forEach(([d,h])=>{var p,m;if(typeof h=="object"){const g=(p=h.description)!==null&&p!==void 0?p:"",b=(m=h.type)!==null&&m!==void 0?m:"",y=Array.isArray(b)?b.toString():b,x={label:d,apply:this.getInsertTextForProperty(d,s,o,e,h),type:"property",detail:y,info:()=>Ci("div",{inner:yl(g)})};i.add(this.applySnippetCompletion(x))}});const f=u.propertyNames;if(typeof f=="object"&&(f.enum&&f.enum.forEach(d=>{const h=d==null?void 0:d.toString();if(h){const p={label:h,apply:this.getInsertTextForProperty(h,s,o,e),type:"property"};i.add(this.applySnippetCompletion(p))}}),f.const)){const d=f.const.toString(),h={label:d,apply:this.getInsertTextForProperty(d,s,o,e),type:"property"};i.add(this.applySnippetCompletion(h))}})}getInsertTextForProperty(e,n,r,i,s){s=s&&Fo(s,i);let o=this.getInsertTextForPropertyName(e,r);if(!n)return o;o+=": ";let a,l=0;if(typeof s=="object"){if(typeof s.default<"u")a||(a=this.getInsertTextForGuessedValue(s.default,"")),l++;else if(s.enum&&(!a&&s.enum.length===1&&(a=this.getInsertTextForGuessedValue(s.enum[0],"")),l+=s.enum.length),typeof s.const<"u"&&(a||(a=this.getInsertTextForGuessedValue(s.const,"")),l++),Array.isArray(s.examples)&&s.examples.length&&(a||(a=this.getInsertTextForGuessedValue(s.examples[0],"")),l+=s.examples.length),a===void 0&&l===0){let u=Array.isArray(s.type)?s.type[0]:s.type;switch(u||(s.properties?u="object":s.items&&(u="array")),u){case"boolean":a="#{}";break;case"string":a=this.getInsertTextForString("");break;case"object":switch(this.mode){case At.JSON5:a="{#{}}";break;case At.YAML:a="#{}";break;default:a="{#{}}";break}break;case"array":a="[#{}]";break;case"number":case"integer":a="#{0}";break;case"null":a="#{null}";break;default:a="#{}";break}}}return(!a||l>1)&&(Tt.log("xxx","value",a,"nValueProposals",l,s),a="#{}"),o+a}getInsertTextForPropertyName(e,n){switch(this.mode){case At.JSON5:case At.YAML:return n.startsWith('"')?`"${e}"`:n.startsWith("'")?`'${e}'`:e;default:return`"${e}"`}}getInsertTextForString(e,n="#"){switch(this.mode){case At.JSON5:return`'${n}{${e}}'`;case At.YAML:return`${n}{${e}}`;default:return`"${n}{${e}}"`}}getInsertTextForGuessedValue(e,n=""){switch(typeof e){case"object":return e===null?"${null}"+n:this.getInsertTextForValue(e,n);case"string":{let r=JSON.stringify(e);return r=r.substr(1,r.length-2),r=this.getInsertTextForPlainText(r),this.getInsertTextForString(r,"$")+n}case"number":case"boolean":return"${"+JSON.stringify(e)+"}"+n}return this.getInsertTextForValue(e,n)}getInsertTextForPlainText(e){return e.replace(/[\\$}]/g,"\\$&")}getInsertTextForValue(e,n){const r=JSON.stringify(e,null," ");return r==="{}"?"{#{}}"+n:r==="[]"?"[#{}]"+n:this.getInsertTextForPlainText(r+n)}getValueCompletions(e,n,r,i){let s=tn(n.state).resolveInner(n.pos,-1),o=null,a;if(Tt.log("xxx","getValueCompletions",s,n),s&&Lh(s,this.mode)&&(o=s,s=s.parent),!s){this.addSchemaValueCompletions(e,r,i);return}if(qt(s.name,this.mode)===Ne.PROPERTY){const u=qb(s,Ne.PROPERTY_NAME,this.mode);u&&(a=Wa(n.state.doc,u),s=s.parent)}if(Tt.log("xxx","node",s,"parentKey",a),s&&(a!==void 0||qt(s.name,this.mode)===Ne.ARRAY)){const u=this.getSchemas(e,n);for(const c of u){if(typeof c!="object")return;if(qt(s.name,this.mode)===Ne.ARRAY&&c.items){let f=i;if(c.uniqueItems&&(f=Object.assign(Object.assign({},f),{add(d){f.completions.has(d.label)||i.add(d)},reserve(d){i.reserve(d)}})),Array.isArray(c.items)){let d=0;if(o){const p=x3(s,o,this.mode);p>=0&&(d=p)}const h=c.items[d];h&&this.addSchemaValueCompletions(h,r,f)}else this.addSchemaValueCompletions(c.items,r,f)}if((c.type==null||c.type!=="object")&&this.addSchemaValueCompletions(c,r,i),a!==void 0){let f=!1;if(c.properties){const d=c.properties[a];d&&(f=!0,this.addSchemaValueCompletions(d,r,i))}if(c.patternProperties&&!f)for(const d of Object.keys(c.patternProperties)){const h=this.extendedRegExp(d);if(h!=null&&h.test(a)){f=!0;const p=c.patternProperties[d];p&&this.addSchemaValueCompletions(p,r,i)}}if(c.additionalProperties&&!f){const d=c.additionalProperties;this.addSchemaValueCompletions(d,r,i)}}r.boolean&&(this.addBooleanValueCompletion(!0,i),this.addBooleanValueCompletion(!1,i)),r.null&&this.addNullValueCompletion(i)}}return{valuePrefix:o?Wa(n.state.doc,o,!0,!1):""}}addSchemaValueCompletions(e,n,r){typeof e=="object"&&(this.addEnumValueCompletions(e,r),this.addDefaultValueCompletions(e,r),this.collectTypes(e,n),Array.isArray(e.allOf)&&e.allOf.forEach(i=>this.addSchemaValueCompletions(i,n,r)),Array.isArray(e.anyOf)&&e.anyOf.forEach(i=>this.addSchemaValueCompletions(i,n,r)),Array.isArray(e.oneOf)&&e.oneOf.forEach(i=>this.addSchemaValueCompletions(i,n,r)))}addDefaultValueCompletions(e,n,r=0){let i=!1;if(typeof e.default<"u"){let s=e.type,o=e.default;for(let l=r;l>0;l--)o=[o],s="array";const a=Object.assign(Object.assign({type:s==null?void 0:s.toString()},this.getAppliedValue(o)),{detail:"Default value"});n.add(a),i=!0}Array.isArray(e.examples)&&e.examples.forEach(s=>{let o=e.type,a=s;for(let l=r;l>0;l--)a=[a],o="array";n.add(Object.assign({type:o==null?void 0:o.toString()},this.getAppliedValue(a))),i=!0}),!i&&typeof e.items=="object"&&!Array.isArray(e.items)&&r<5&&this.addDefaultValueCompletions(e.items,n,r+1)}addEnumValueCompletions(e,n){var r,i;if(typeof e.const<"u"&&n.add(Object.assign(Object.assign({type:(r=e.type)===null||r===void 0?void 0:r.toString()},this.getAppliedValue(e.const)),{info:e.description})),Array.isArray(e.enum))for(let s=0,o=e.enum.length;sn[i]=!0):r&&(n[r]=!0)}getSchemas(e,n){var r,i,s;const{data:o}=this.parser(n.state),a=new oO(e);let l=y3(n.state,n.pos,-1,this.mode);if(l===""&&(l=void 0),l!=null&&l.endsWith("/")){l=l.substring(0,l.length-1);const p=n_(e,o,l);if(p!=null)return[p]}let u=l!=null?l.replace(/\/[^/]*$/,""):void 0;u===""&&(u=void 0);const c=n_(e,o,u),f=l==null?void 0:l.split("/").pop(),d=f==null||f in((r=c==null?void 0:c.properties)!==null&&r!==void 0?r:{});let h=a.getSchema({pointer:l,data:o??void 0});return!d&&(h==null?void 0:h.type)==="null"&&this.mode==="yaml"&&(h=void 0),Tt.log("xxxx","draft.getSchema",h,"data",o,"pointer",l,"pointerPointsToKnownProperty",d),Nn(h)&&(h=(i=h.data)===null||i===void 0?void 0:i.schema),!yc(h)&&c?[c]:(yc(h)||(h=a.getSchema({pointer:u}),l=u),Tt.log("xxx","pointer..",JSON.stringify(l)),!yc(h)&&(!l||l==="/")&&(h=(s=Fo(e,e))!==null&&s!==void 0?s:e),Tt.log("xxx","subSchema..",h),h?Array.isArray(h.allOf)?[h,...h.allOf.map(p=>Fo(p,e))]:Array.isArray(h.oneOf)?[h,...h.oneOf.map(p=>Fo(p,e))]:Array.isArray(h.anyOf)?[h,...h.anyOf.map(p=>Fo(p,e))]:[h]:[])}getAppliedValue(e){const n=Fh(JSON.stringify(e));switch(this.mode){case At.JSON5:return{label:n,apply:kz(JSON.stringify(e))};case At.YAML:return{label:n,apply:n};default:return{label:n,apply:JSON.stringify(e)}}}getValueFromLabel(e){return JSON.parse(e)}extendedRegExp(e){let n="";e.startsWith("(?i)")&&(e=e.substring(4),n="i");try{return new RegExp(e,n+"u")}catch{try{return new RegExp(e,n)}catch{return}}}}function vY(t={}){const e=new yY(t);return function(r){return e.doComplete(r)}}function xY(t){return ec(t,(e,n)=>e==="additionalProperties"&&n===!1?[]:e==="required"&&Array.isArray(n)?[]:e==="unevaluatedProperties"&&n===!1?[]:e==="unevaluatedItems"&&n===!1?[]:[e,n])}function n_(t,e,n){const r=new oO(t),i=r.getSchema({pointer:n,data:e??void 0});if(!yc(i))return;const s=dT(r,i),o={};for(let d of s){let h=EY(n,d);const p=r.getSchema({pointer:h,data:e??void 0});yc(p)&&Object.assign(o,{[d]:p})}if(s.length===0||Object.keys(o).length===0)return;const a=i,{allOf:l,anyOf:u,oneOf:c}=a,f=gY(a,["allOf","anyOf","oneOf"]);return Object.assign(Object.assign({},f),{properties:o})}function dT(t,e){if(e=Fo(e,t.rootSchema),typeof e!="object"||e==null)return[];const n=[];function r(i){const s=dT(t,i);n.push(...s)}if(typeof e.properties=="object"&&e.properties!=null&&n.push(...Object.keys(e.properties)),typeof e.then=="object"&&e.then!=null&&r(e.then),Array.isArray(e.allOf))for(const i of e.allOf)r(i);if(Array.isArray(e.anyOf))for(const i of e.anyOf)r(i);if(Array.isArray(e.oneOf))for(const i of e.oneOf)r(i);return n}function Fo(t,e){if(typeof t=="object"&&t.$ref){const n=SY(e,t.$ref);if(typeof n=="object"){const r=Object.assign(Object.assign({},t),n);return Reflect.deleteProperty(r,"$ref"),r}}return t}function SY(t,e){const n=e.split("/");let r=t;return n.forEach(i=>{if(i){if(i==="#"){r=t;return}typeof r=="object"&&(r=r[i])}}),r}function EY(t,e){return t===void 0?`/${e}`:`${t}/${e}`}const uf=(t,e)=>{const n=t.length>2;let r=t.map((i,s)=>{const o="`"+(e?e(i):i)+"`";return s===t.length-1?"or "+o:o});return n?r.join(", "):r.join(" ")},wY=t=>{var e,n,r;return!((e=t==null?void 0:t.data)===null||e===void 0)&&e.pointer&&((n=t==null?void 0:t.data)===null||n===void 0?void 0:n.pointer)!=="#"?t.data.pointer.slice(1):!((r=t==null?void 0:t.data)===null||r===void 0)&&r.property?`/${t.data.property}`:""},_Y=t=>t.startState.field(Lp)!==t.state.field(Lp);function CY(t){const e=new DY(t);return n=>e.doValidation(n)}const AY=["NoAdditionalPropertiesError","RequiredPropertyError","InvalidPropertyNameError","ForbiddenPropertyError","UndefinedValueError"];class DY{constructor(e){var n,r,i,s;this.options=e,this.schema=null,this.mode=At.JSON,this.rewriteError=o=>{var a,l,u,c,f;const d=o==null?void 0:o.data,h=d==null?void 0:d.errors;return o.code==="one-of-error"&&(h!=null&&h.length)?`Expected one of ${uf(h,m=>m.data.expected)}`:o.code==="type-error"?`Expected \`${!((a=o==null?void 0:o.data)===null||a===void 0)&&a.expected&&Array.isArray((l=o==null?void 0:o.data)===null||l===void 0?void 0:l.expected)?uf((u=o==null?void 0:o.data)===null||u===void 0?void 0:u.expected):(c=o==null?void 0:o.data)===null||c===void 0?void 0:c.expected}\` but received \`${(f=o==null?void 0:o.data)===null||f===void 0?void 0:f.received}\``:o.message.replaceAll("in `#` ","").replaceAll("at `#`","").replaceAll("/",".").replaceAll("#.","")},this.mode=(r=(n=this.options)===null||n===void 0?void 0:n.mode)!==null&&r!==void 0?r:At.JSON,this.parser=(s=(i=this.options)===null||i===void 0?void 0:i.jsonParser)!==null&&s!==void 0?s:fT(this.mode)}get schemaTitle(){var e,n,r;return(r=(n=(e=this.schema)===null||e===void 0?void 0:e.getSchema())===null||n===void 0?void 0:n.title)!==null&&r!==void 0?r:"json-schema"}doValidation(e){const n=Hv(e.state);if(!n)return[];if(this.schema=new iO(n),!this.schema)return[];const r=e.state.doc.toString();if(!(r!=null&&r.length))return[];const i=this.parser(e.state);if(i.data==null)return[];let s=[];try{s=this.schema.validate(i.data)}catch{}return Tt.log("xxx","validation errors",s,i.data),s.length?s.reduce((o,a)=>{const l=()=>{const f=this.rewriteError(a);o.push({from:0,to:0,message:f,severity:"error",source:this.schemaTitle,renderMessage:()=>{const d=Ci("div",{});return d.innerHTML=yl(f),d}})},u=wY(a),c=i.pointers.get(u);if(a.name==="MaxPropertiesError"||a.name==="MinPropertiesError"||u==="")l();else if(c){const f=AY.includes(a.name),d=this.rewriteError(a),h=f?c.keyFrom:c.valueFrom,p=f?c.keyTo:c.valueTo;p!==void 0&&h!==void 0&&o.push({from:h,to:p,message:d,renderMessage:()=>{const m=Ci("div",{});return m.innerHTML=yl(d),m},severity:"error",source:this.schemaTitle})}else l();return o},[]):[]}}function kY(t){const e=new OY(t);return async function(r,i,s){return e.doHover(r,i,s)}}function r_(t){if(t.type)return t.$ref?`${t.$ref} (${t.type})`:t.type;if(t.$ref)return`${t.$ref}`}function p1(t,e,n){return`${e}: ${uf(t[e].map(r=>{try{const{data:i}=n.resolveRef({data:r,pointer:r.$ref});return r_(i||r)}catch{return r.type}}))}`}class OY{constructor(e){var n,r;this.opts=e,this.schema=null,this.mode=At.JSON,this.opts=Object.assign({parser:JSON.parse},this.opts),this.mode=(r=(n=this.opts)===null||n===void 0?void 0:n.mode)!==null&&r!==void 0?r:At.JSON}getDataForCursor(e,n,r){const i=Hv(e.state);if(!i)return null;this.schema=new iO(i);const s=y3(e.state,n,r,this.mode);let o;try{o=this.opts.parser(e.state.doc.toString())}catch{}if(!s)return null;let a=this.schema.getSchema({pointer:s,data:o,withSchemaWarning:!0});return Nn(a)&&(a!=null&&a.data.schema.$ref?a=this.schema.resolveRef(a):a=a==null?void 0:a.data.schema),{schema:a,pointer:s}}formatMessage(e){const{message:n,typeInfo:r}=e;return n?Ci("div",{class:"cm6-json-schema-hover"},[Ci("div",{class:"cm6-json-schema-hover--description",inner:yl(n,!1)}),Ci("div",{class:"cm6-json-schema-hover--code-wrapper"},[Ci("div",{class:"cm6-json-schema-hover--code",inner:yl(r,!1)})])]):Ci("div",{class:"cm6-json-schema-hover"},[Ci("div",{class:"cm6-json-schema-hover--code-wrapper"},[Ci("code",{class:"cm6-json-schema-hover--code",inner:yl(r,!1)})])])}getHoverTexts(e,n){let r="",i=null;const{schema:s}=e;return s.oneOf&&(r=p1(s,"oneOf",n)),s.anyOf&&(r=p1(s,"anyOf",n)),s.allOf&&(r=p1(s,"allOf",n)),s.type&&(r=Array.isArray(s.type)?uf(s.type):s.type),s.$ref&&(r=` Reference: ${s.$ref}`),s.enum&&(r=`\`enum\`: ${uf(s.enum)}`),s.format&&(r+=`\`format\`: ${s.format}`),s.pattern&&(r+=`\`pattern\`: ${s.pattern}`),s.description&&(i=s.description),{message:i,typeInfo:r}}async doHover(e,n,r){var i,s,o,a;const l=n,u=n;try{const c=this.getDataForCursor(e,n,r);if(Tt.log("cursorData",c),!(c!=null&&c.schema))return null;const d=((s=(i=this.opts)===null||i===void 0?void 0:i.getHoverTexts)!==null&&s!==void 0?s:this.getHoverTexts)(c,this.schema),p=((a=(o=this.opts)===null||o===void 0?void 0:o.formatHover)!==null&&a!==void 0?a:this.formatMessage)(d);return{pos:l,end:u,arrow:!0,above:!0,create:m=>({dom:p})}}catch(c){return Tt.log(c),null}}}function TY(t){return[r3(),Lb(_7()),Lb(CY(),{needsRefresh:_Y}),n3.data.of({autocomplete:vY()}),bk(kY()),Rz(t)]}const IY=(t,e)=>{const n=hT(t);return n.push(r3()),e!==void 0&&n.push(TY(e)),t||n.push(i$),n},hT=t=>{const e=[ZB()];return t&&e.push(Ue.readOnly.of(!0)),e},PY=t=>hT(t),RY=t=>{let{state:e}=t,n=e.doc.lineAt(e.selection.main.from),r=I2(t.state,n.from);return r.line?NY(t):r.block?FY(t):!1};function T2(t,e){return({state:n,dispatch:r})=>{if(n.readOnly)return!1;let i=t(e,n);return i?(r(n.update(i)),!0):!1}}const NY=T2($Y,0),MY=T2(pT,0),FY=T2((t,e)=>pT(t,e,BY(e)),0);function I2(t,e){let n=t.languageDataAt("commentTokens",e,1);return n.length?n[0]:{}}const zu=50;function LY(t,{open:e,close:n},r,i){let s=t.sliceDoc(r-zu,r),o=t.sliceDoc(i,i+zu),a=/\s*$/.exec(s)[0].length,l=/^\s*/.exec(o)[0].length,u=s.length-a;if(s.slice(u-e.length,u)==e&&o.slice(l,l+n.length)==n)return{open:{pos:r-a,margin:a&&1},close:{pos:i+l,margin:l&&1}};let c,f;i-r<=2*zu?c=f=t.sliceDoc(r,i):(c=t.sliceDoc(r,r+zu),f=t.sliceDoc(i-zu,i));let d=/^\s*/.exec(c)[0].length,h=/\s*$/.exec(f)[0].length,p=f.length-h-n.length;return c.slice(d,d+e.length)==e&&f.slice(p,p+n.length)==n?{open:{pos:r+d+e.length,margin:/\s/.test(c.charAt(d+e.length))?1:0},close:{pos:i-h-n.length,margin:/\s/.test(f.charAt(p-1))?1:0}}:null}function BY(t){let e=[];for(let n of t.selection.ranges){let r=t.doc.lineAt(n.from),i=n.to<=r.to?r:t.doc.lineAt(n.to);i.from>r.from&&i.from==n.to&&(i=n.to==r.to+1?r:t.doc.lineAt(n.to-1));let s=e.length-1;s>=0&&e[s].to>r.from?e[s].to=i.to:e.push({from:r.from+/^\s*/.exec(r.text)[0].length,to:i.to})}return e}function pT(t,e,n=e.selection.ranges){let r=n.map(s=>I2(e,s.from).block);if(!r.every(s=>s))return null;let i=n.map((s,o)=>LY(e,r[o],s.from,s.to));if(t!=2&&!i.every(s=>s))return{changes:e.changes(n.map((s,o)=>i[o]?[]:[{from:s.from,insert:r[o].open+" "},{from:s.to,insert:" "+r[o].close}]))};if(t!=1&&i.some(s=>s)){let s=[];for(let o=0,a;oi&&(s==o||o>f.from)){i=f.from;let d=/^\s*/.exec(f.text)[0].length,h=d==f.length,p=f.text.slice(d,d+u.length)==u?d:-1;ds.comment<0&&(!s.empty||s.single))){let s=[];for(let{line:a,token:l,indent:u,empty:c,single:f}of r)(f||!c)&&s.push({from:a.from+u,insert:l+" "});let o=e.changes(s);return{changes:o,selection:e.selection.map(o,1)}}else if(t!=1&&r.some(s=>s.comment>=0)){let s=[];for(let{line:o,comment:a,token:l}of r)if(a>=0){let u=o.from+a,c=u+l.length;o.text[c-o.from]==" "&&c++,s.push({from:u,to:c})}return{changes:s}}return null}const yy=As.define(),zY=As.define(),jY=he.define(),mT=he.define({combine(t){return fi(t,{minDepth:100,newGroupDelay:500,joinToEvent:(e,n)=>n},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,n)=>(r,i)=>e(r,i)||n(r,i)})}}),gT=Wt.define({create(){return Fi.empty},update(t,e){let n=e.state.facet(mT),r=e.annotation(yy);if(r){let l=ar.fromTransaction(e,r.selection),u=r.side,c=u==0?t.undone:t.done;return l?c=u0(c,c.length,n.minDepth,l):c=vT(c,e.startState.selection),new Fi(u==0?r.rest:c,u==0?c:r.rest)}let i=e.annotation(zY);if((i=="full"||i=="before")&&(t=t.isolate()),e.annotation(Qt.addToHistory)===!1)return e.changes.empty?t:t.addMapping(e.changes.desc);let s=ar.fromTransaction(e),o=e.annotation(Qt.time),a=e.annotation(Qt.userEvent);return s?t=t.addChanges(s,o,a,n,e):e.selection&&(t=t.addSelection(e.startState.selection,o,a,n.newGroupDelay)),(i=="full"||i=="after")&&(t=t.isolate()),t},toJSON(t){return{done:t.done.map(e=>e.toJSON()),undone:t.undone.map(e=>e.toJSON())}},fromJSON(t){return new Fi(t.done.map(ar.fromJSON),t.undone.map(ar.fromJSON))}});function VY(t={}){return[gT,mT.of(t),ce.domEventHandlers({beforeinput(e,n){let r=e.inputType=="historyUndo"?bT:e.inputType=="historyRedo"?vy:null;return r?(e.preventDefault(),r(n)):!1}})]}function km(t,e){return function({state:n,dispatch:r}){if(!e&&n.readOnly)return!1;let i=n.field(gT,!1);if(!i)return!1;let s=i.pop(t,n,e);return s?(r(s),!0):!1}}const bT=km(0,!1),vy=km(1,!1),UY=km(0,!0),HY=km(1,!0);class ar{constructor(e,n,r,i,s){this.changes=e,this.effects=n,this.mapped=r,this.startSelection=i,this.selectionsAfter=s}setSelAfter(e){return new ar(this.changes,this.effects,this.mapped,this.startSelection,e)}toJSON(){var e,n,r;return{changes:(e=this.changes)===null||e===void 0?void 0:e.toJSON(),mapped:(n=this.mapped)===null||n===void 0?void 0:n.toJSON(),startSelection:(r=this.startSelection)===null||r===void 0?void 0:r.toJSON(),selectionsAfter:this.selectionsAfter.map(i=>i.toJSON())}}static fromJSON(e){return new ar(e.changes&&sn.fromJSON(e.changes),[],e.mapped&&Li.fromJSON(e.mapped),e.startSelection&&Y.fromJSON(e.startSelection),e.selectionsAfter.map(Y.fromJSON))}static fromTransaction(e,n){let r=zr;for(let i of e.startState.facet(jY)){let s=i(e);s.length&&(r=r.concat(s))}return!r.length&&e.changes.empty?null:new ar(e.changes.invert(e.startState.doc),r,void 0,n||e.startState.selection,zr)}static selection(e){return new ar(void 0,zr,void 0,void 0,e)}}function u0(t,e,n,r){let i=e+1>n+20?e-n-1:0,s=t.slice(i,e);return s.push(r),s}function qY(t,e){let n=[],r=!1;return t.iterChangedRanges((i,s)=>n.push(i,s)),e.iterChangedRanges((i,s,o,a)=>{for(let l=0;l=u&&o<=c&&(r=!0)}}),r}function GY(t,e){return t.ranges.length==e.ranges.length&&t.ranges.filter((n,r)=>n.empty!=e.ranges[r].empty).length===0}function yT(t,e){return t.length?e.length?t.concat(e):t:e}const zr=[],WY=200;function vT(t,e){if(t.length){let n=t[t.length-1],r=n.selectionsAfter.slice(Math.max(0,n.selectionsAfter.length-WY));return r.length&&r[r.length-1].eq(e)?t:(r.push(e),u0(t,t.length-1,1e9,n.setSelAfter(r)))}else return[ar.selection([e])]}function KY(t){let e=t[t.length-1],n=t.slice();return n[t.length-1]=e.setSelAfter(e.selectionsAfter.slice(0,e.selectionsAfter.length-1)),n}function m1(t,e){if(!t.length)return t;let n=t.length,r=zr;for(;n;){let i=XY(t[n-1],e,r);if(i.changes&&!i.changes.empty||i.effects.length){let s=t.slice(0,n);return s[n-1]=i,s}else e=i.mapped,n--,r=i.selectionsAfter}return r.length?[ar.selection(r)]:zr}function XY(t,e,n){let r=yT(t.selectionsAfter.length?t.selectionsAfter.map(a=>a.map(e)):zr,n);if(!t.changes)return ar.selection(r);let i=t.changes.map(e),s=e.mapDesc(t.changes,!0),o=t.mapped?t.mapped.composeDesc(s):s;return new ar(i,De.mapEffects(t.effects,e),o,t.startSelection.map(s),r)}const YY=/^(input\.type|delete)($|\.)/;class Fi{constructor(e,n,r=0,i=void 0){this.done=e,this.undone=n,this.prevTime=r,this.prevUserEvent=i}isolate(){return this.prevTime?new Fi(this.done,this.undone):this}addChanges(e,n,r,i,s){let o=this.done,a=o[o.length-1];return a&&a.changes&&!a.changes.empty&&e.changes&&(!r||YY.test(r))&&(!a.selectionsAfter.length&&n-this.prevTime0&&n-this.prevTimen.empty?t.moveByChar(n,e):Om(n,e))}function Mn(t){return t.textDirectionAt(t.state.selection.main.head)==Et.LTR}const ST=t=>xT(t,!Mn(t)),ET=t=>xT(t,Mn(t));function wT(t,e){return mi(t,n=>n.empty?t.moveByGroup(n,e):Om(n,e))}const ZY=t=>wT(t,!Mn(t)),QY=t=>wT(t,Mn(t));function eJ(t,e,n){if(e.type.prop(n))return!0;let r=e.to-e.from;return r&&(r>2||/[^\s,.;:]/.test(t.sliceDoc(e.from,e.to)))||e.firstChild}function Tm(t,e,n){let r=tn(t).resolveInner(e.head),i=n?Ve.closedBy:Ve.openedBy;for(let l=e.head;;){let u=n?r.childAfter(l):r.childBefore(l);if(!u)break;eJ(t,u,i)?r=u:l=n?u.to:u.from}let s=r.type.prop(i),o,a;return s&&(o=n?Ri(t,r.from,1):Ri(t,r.to,-1))&&o.matched?a=n?o.end.to:o.end.from:a=n?r.to:r.from,Y.cursor(a,n?-1:1)}const tJ=t=>mi(t,e=>Tm(t.state,e,!Mn(t))),nJ=t=>mi(t,e=>Tm(t.state,e,Mn(t)));function _T(t,e){return mi(t,n=>{if(!n.empty)return Om(n,e);let r=t.moveVertically(n,e);return r.head!=n.head?r:t.moveToLineBoundary(n,e)})}const CT=t=>_T(t,!1),AT=t=>_T(t,!0);function DT(t){let e=t.scrollDOM.clientHeighto.empty?t.moveVertically(o,e,n.height):Om(o,e));if(i.eq(r.selection))return!1;let s;if(n.selfScroll){let o=t.coordsAtPos(r.selection.main.head),a=t.scrollDOM.getBoundingClientRect(),l=a.top+n.marginTop,u=a.bottom-n.marginBottom;o&&o.top>l&&o.bottomkT(t,!1),xy=t=>kT(t,!0);function ko(t,e,n){let r=t.lineBlockAt(e.head),i=t.moveToLineBoundary(e,n);if(i.head==e.head&&i.head!=(n?r.to:r.from)&&(i=t.moveToLineBoundary(e,n,!1)),!n&&i.head==r.from&&r.length){let s=/^\s*/.exec(t.state.sliceDoc(r.from,Math.min(r.from+100,r.to)))[0].length;s&&e.head!=r.from+s&&(i=Y.cursor(r.from+s))}return i}const rJ=t=>mi(t,e=>ko(t,e,!0)),iJ=t=>mi(t,e=>ko(t,e,!1)),sJ=t=>mi(t,e=>ko(t,e,!Mn(t))),oJ=t=>mi(t,e=>ko(t,e,Mn(t))),aJ=t=>mi(t,e=>Y.cursor(t.lineBlockAt(e.head).from,1)),lJ=t=>mi(t,e=>Y.cursor(t.lineBlockAt(e.head).to,-1));function uJ(t,e,n){let r=!1,i=mu(t.selection,s=>{let o=Ri(t,s.head,-1)||Ri(t,s.head,1)||s.head>0&&Ri(t,s.head-1,1)||s.headuJ(t,e);function Zr(t,e){let n=mu(t.state.selection,r=>{let i=e(r);return Y.range(r.anchor,i.head,i.goalColumn,i.bidiLevel||void 0)});return n.eq(t.state.selection)?!1:(t.dispatch(pi(t.state,n)),!0)}function OT(t,e){return Zr(t,n=>t.moveByChar(n,e))}const TT=t=>OT(t,!Mn(t)),IT=t=>OT(t,Mn(t));function PT(t,e){return Zr(t,n=>t.moveByGroup(n,e))}const fJ=t=>PT(t,!Mn(t)),dJ=t=>PT(t,Mn(t)),hJ=t=>Zr(t,e=>Tm(t.state,e,!Mn(t))),pJ=t=>Zr(t,e=>Tm(t.state,e,Mn(t)));function RT(t,e){return Zr(t,n=>t.moveVertically(n,e))}const NT=t=>RT(t,!1),MT=t=>RT(t,!0);function FT(t,e){return Zr(t,n=>t.moveVertically(n,e,DT(t).height))}const s_=t=>FT(t,!1),o_=t=>FT(t,!0),mJ=t=>Zr(t,e=>ko(t,e,!0)),gJ=t=>Zr(t,e=>ko(t,e,!1)),bJ=t=>Zr(t,e=>ko(t,e,!Mn(t))),yJ=t=>Zr(t,e=>ko(t,e,Mn(t))),vJ=t=>Zr(t,e=>Y.cursor(t.lineBlockAt(e.head).from)),xJ=t=>Zr(t,e=>Y.cursor(t.lineBlockAt(e.head).to)),a_=({state:t,dispatch:e})=>(e(pi(t,{anchor:0})),!0),l_=({state:t,dispatch:e})=>(e(pi(t,{anchor:t.doc.length})),!0),u_=({state:t,dispatch:e})=>(e(pi(t,{anchor:t.selection.main.anchor,head:0})),!0),c_=({state:t,dispatch:e})=>(e(pi(t,{anchor:t.selection.main.anchor,head:t.doc.length})),!0),SJ=({state:t,dispatch:e})=>(e(t.update({selection:{anchor:0,head:t.doc.length},userEvent:"select"})),!0),EJ=({state:t,dispatch:e})=>{let n=Im(t).map(({from:r,to:i})=>Y.range(r,Math.min(i+1,t.doc.length)));return e(t.update({selection:Y.create(n),userEvent:"select"})),!0},wJ=({state:t,dispatch:e})=>{let n=mu(t.selection,r=>{let i=tn(t),s=i.resolveStack(r.from,1);if(r.empty){let o=i.resolveStack(r.from,-1);o.node.from>=s.node.from&&o.node.to<=s.node.to&&(s=o)}for(let o=s;o;o=o.next){let{node:a}=o;if((a.from=r.to||a.to>r.to&&a.from<=r.from)&&o.next)return Y.range(a.to,a.from)}return r});return n.eq(t.selection)?!1:(e(pi(t,n)),!0)};function LT(t,e){let{state:n}=t,r=n.selection,i=n.selection.ranges.slice();for(let s of n.selection.ranges){let o=n.doc.lineAt(s.head);if(e?o.to0)for(let a=s;;){let l=t.moveVertically(a,e);if(l.heado.to){i.some(u=>u.head==l.head)||i.push(l);break}else{if(l.head==a.head)break;a=l}}}return i.length==r.ranges.length?!1:(t.dispatch(pi(n,Y.create(i,i.length-1))),!0)}const _J=t=>LT(t,!1),CJ=t=>LT(t,!0),AJ=({state:t,dispatch:e})=>{let n=t.selection,r=null;return n.ranges.length>1?r=Y.create([n.main]):n.main.empty||(r=Y.create([Y.cursor(n.main.head)])),r?(e(pi(t,r)),!0):!1};function Qf(t,e){if(t.state.readOnly)return!1;let n="delete.selection",{state:r}=t,i=r.changeByRange(s=>{let{from:o,to:a}=s;if(o==a){let l=e(s);lo&&(n="delete.forward",l=ih(t,l,!0)),o=Math.min(o,l),a=Math.max(a,l)}else o=ih(t,o,!1),a=ih(t,a,!0);return o==a?{range:s}:{changes:{from:o,to:a},range:Y.cursor(o,oi(t)))r.between(e,e,(i,s)=>{ie&&(e=n?s:i)});return e}const BT=(t,e,n)=>Qf(t,r=>{let i=r.from,{state:s}=t,o=s.doc.lineAt(i),a,l;if(n&&!e&&i>o.from&&iBT(t,!1,!0),$T=t=>BT(t,!0,!1),zT=(t,e)=>Qf(t,n=>{let r=n.head,{state:i}=t,s=i.doc.lineAt(r),o=i.charCategorizer(r);for(let a=null;;){if(r==(e?s.to:s.from)){r==n.head&&s.number!=(e?i.doc.lines:1)&&(r+=e?1:-1);break}let l=wn(s.text,r-s.from,e)+s.from,u=s.text.slice(Math.min(r,l)-s.from,Math.max(r,l)-s.from),c=o(u);if(a!=null&&c!=a)break;(u!=" "||r!=n.head)&&(a=c),r=l}return r}),jT=t=>zT(t,!1),DJ=t=>zT(t,!0),kJ=t=>Qf(t,e=>{let n=t.lineBlockAt(e.head).to;return e.headQf(t,e=>{let n=t.moveToLineBoundary(e,!1).head;return e.head>n?n:Math.max(0,e.head-1)}),TJ=t=>Qf(t,e=>{let n=t.moveToLineBoundary(e,!0).head;return e.head{if(t.readOnly)return!1;let n=t.changeByRange(r=>({changes:{from:r.from,to:r.to,insert:Ze.of(["",""])},range:Y.cursor(r.from)}));return e(t.update(n,{scrollIntoView:!0,userEvent:"input"})),!0},PJ=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let n=t.changeByRange(r=>{if(!r.empty||r.from==0||r.from==t.doc.length)return{range:r};let i=r.from,s=t.doc.lineAt(i),o=i==s.from?i-1:wn(s.text,i-s.from,!1)+s.from,a=i==s.to?i+1:wn(s.text,i-s.from,!0)+s.from;return{changes:{from:o,to:a,insert:t.doc.slice(i,a).append(t.doc.slice(o,i))},range:Y.cursor(a)}});return n.changes.empty?!1:(e(t.update(n,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function Im(t){let e=[],n=-1;for(let r of t.selection.ranges){let i=t.doc.lineAt(r.from),s=t.doc.lineAt(r.to);if(!r.empty&&r.to==s.from&&(s=t.doc.lineAt(r.to-1)),n>=i.number){let o=e[e.length-1];o.to=s.to,o.ranges.push(r)}else e.push({from:i.from,to:s.to,ranges:[r]});n=s.number+1}return e}function VT(t,e,n){if(t.readOnly)return!1;let r=[],i=[];for(let s of Im(t)){if(n?s.to==t.doc.length:s.from==0)continue;let o=t.doc.lineAt(n?s.to+1:s.from-1),a=o.length+1;if(n){r.push({from:s.to,to:o.to},{from:s.from,insert:o.text+t.lineBreak});for(let l of s.ranges)i.push(Y.range(Math.min(t.doc.length,l.anchor+a),Math.min(t.doc.length,l.head+a)))}else{r.push({from:o.from,to:s.from},{from:s.to,insert:t.lineBreak+o.text});for(let l of s.ranges)i.push(Y.range(l.anchor-a,l.head-a))}}return r.length?(e(t.update({changes:r,scrollIntoView:!0,selection:Y.create(i,t.selection.mainIndex),userEvent:"move.line"})),!0):!1}const RJ=({state:t,dispatch:e})=>VT(t,e,!1),NJ=({state:t,dispatch:e})=>VT(t,e,!0);function UT(t,e,n){if(t.readOnly)return!1;let r=[];for(let i of Im(t))n?r.push({from:i.from,insert:t.doc.slice(i.from,i.to)+t.lineBreak}):r.push({from:i.to,insert:t.lineBreak+t.doc.slice(i.from,i.to)});return e(t.update({changes:r,scrollIntoView:!0,userEvent:"input.copyline"})),!0}const MJ=({state:t,dispatch:e})=>UT(t,e,!1),FJ=({state:t,dispatch:e})=>UT(t,e,!0),LJ=t=>{if(t.state.readOnly)return!1;let{state:e}=t,n=e.changes(Im(e).map(({from:i,to:s})=>(i>0?i--:s{let s;if(t.lineWrapping){let o=t.lineBlockAt(i.head),a=t.coordsAtPos(i.head,i.assoc||1);a&&(s=o.bottom+t.documentTop-a.bottom+t.defaultLineHeight/2)}return t.moveVertically(i,!0,s)}).map(n);return t.dispatch({changes:n,selection:r,scrollIntoView:!0,userEvent:"delete.line"}),!0};function BJ(t,e){if(/\(\)|\[\]|\{\}/.test(t.sliceDoc(e-1,e+1)))return{from:e,to:e};let n=tn(t).resolveInner(e),r=n.childBefore(e),i=n.childAfter(e),s;return r&&i&&r.to<=e&&i.from>=e&&(s=r.type.prop(Ve.closedBy))&&s.indexOf(i.name)>-1&&t.doc.lineAt(r.to).from==t.doc.lineAt(i.from).from&&!/\S/.test(t.sliceDoc(r.to,i.from))?{from:r.to,to:i.from}:null}const f_=HT(!1),$J=HT(!0);function HT(t){return({state:e,dispatch:n})=>{if(e.readOnly)return!1;let r=e.changeByRange(i=>{let{from:s,to:o}=i,a=e.doc.lineAt(s),l=!t&&s==o&&BJ(e,s);t&&(s=o=(o<=a.to?a:e.doc.lineAt(o)).to);let u=new Q0(e,{simulateBreak:s,simulateDoubleBreak:!!l}),c=Rv(u,s);for(c==null&&(c=ru(/^\s*/.exec(e.doc.lineAt(s).text)[0],e.tabSize));oa.from&&s{let i=[];for(let o=r.from;o<=r.to;){let a=t.doc.lineAt(o);a.number>n&&(r.empty||r.to>a.from)&&(e(a,i,r),n=a.number),o=a.to+1}let s=t.changes(i);return{changes:i,range:Y.range(s.mapPos(r.anchor,1),s.mapPos(r.head,1))}})}const zJ=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let n=Object.create(null),r=new Q0(t,{overrideIndentation:s=>{let o=n[s];return o??-1}}),i=P2(t,(s,o,a)=>{let l=Rv(r,s.from);if(l==null)return;/\S/.test(s.text)||(l=0);let u=/^\s*/.exec(s.text)[0],c=Hc(t,l);(u!=c||a.fromt.readOnly?!1:(e(t.update(P2(t,(n,r)=>{r.push({from:n.from,insert:t.facet($f)})}),{userEvent:"input.indent"})),!0),GT=({state:t,dispatch:e})=>t.readOnly?!1:(e(t.update(P2(t,(n,r)=>{let i=/^\s*/.exec(n.text)[0];if(!i)return;let s=ru(i,t.tabSize),o=0,a=Hc(t,Math.max(0,s-Pp(t)));for(;o(t.setTabFocusMode(),!0),VJ=[{key:"Ctrl-b",run:ST,shift:TT,preventDefault:!0},{key:"Ctrl-f",run:ET,shift:IT},{key:"Ctrl-p",run:CT,shift:NT},{key:"Ctrl-n",run:AT,shift:MT},{key:"Ctrl-a",run:aJ,shift:vJ},{key:"Ctrl-e",run:lJ,shift:xJ},{key:"Ctrl-d",run:$T},{key:"Ctrl-h",run:Sy},{key:"Ctrl-k",run:kJ},{key:"Ctrl-Alt-h",run:jT},{key:"Ctrl-o",run:IJ},{key:"Ctrl-t",run:PJ},{key:"Ctrl-v",run:xy}],UJ=[{key:"ArrowLeft",run:ST,shift:TT,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:ZY,shift:fJ,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:sJ,shift:bJ,preventDefault:!0},{key:"ArrowRight",run:ET,shift:IT,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:QY,shift:dJ,preventDefault:!0},{mac:"Cmd-ArrowRight",run:oJ,shift:yJ,preventDefault:!0},{key:"ArrowUp",run:CT,shift:NT,preventDefault:!0},{mac:"Cmd-ArrowUp",run:a_,shift:u_},{mac:"Ctrl-ArrowUp",run:i_,shift:s_},{key:"ArrowDown",run:AT,shift:MT,preventDefault:!0},{mac:"Cmd-ArrowDown",run:l_,shift:c_},{mac:"Ctrl-ArrowDown",run:xy,shift:o_},{key:"PageUp",run:i_,shift:s_},{key:"PageDown",run:xy,shift:o_},{key:"Home",run:iJ,shift:gJ,preventDefault:!0},{key:"Mod-Home",run:a_,shift:u_},{key:"End",run:rJ,shift:mJ,preventDefault:!0},{key:"Mod-End",run:l_,shift:c_},{key:"Enter",run:f_,shift:f_},{key:"Mod-a",run:SJ},{key:"Backspace",run:Sy,shift:Sy,preventDefault:!0},{key:"Delete",run:$T,preventDefault:!0},{key:"Mod-Backspace",mac:"Alt-Backspace",run:jT,preventDefault:!0},{key:"Mod-Delete",mac:"Alt-Delete",run:DJ,preventDefault:!0},{mac:"Mod-Backspace",run:OJ,preventDefault:!0},{mac:"Mod-Delete",run:TJ,preventDefault:!0}].concat(VJ.map(t=>({mac:t.key,run:t.run,shift:t.shift}))),HJ=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:tJ,shift:hJ},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:nJ,shift:pJ},{key:"Alt-ArrowUp",run:RJ},{key:"Shift-Alt-ArrowUp",run:MJ},{key:"Alt-ArrowDown",run:NJ},{key:"Shift-Alt-ArrowDown",run:FJ},{key:"Mod-Alt-ArrowUp",run:_J},{key:"Mod-Alt-ArrowDown",run:CJ},{key:"Escape",run:AJ},{key:"Mod-Enter",run:$J},{key:"Alt-l",mac:"Ctrl-l",run:EJ},{key:"Mod-i",run:wJ,preventDefault:!0},{key:"Mod-[",run:GT},{key:"Mod-]",run:qT},{key:"Mod-Alt-\\",run:zJ},{key:"Shift-Mod-k",run:LJ},{key:"Shift-Mod-\\",run:cJ},{key:"Mod-/",run:RY},{key:"Alt-A",run:MY},{key:"Ctrl-m",mac:"Shift-Alt-m",run:jJ}].concat(UJ),qJ={key:"Tab",run:qT,shift:GT},d_=typeof String.prototype.normalize=="function"?t=>t.normalize("NFKD"):t=>t;class zl{constructor(e,n,r=0,i=e.length,s,o){this.test=o,this.value={from:0,to:0},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=e.iterRange(r,i),this.bufferStart=r,this.normalize=s?a=>s(d_(a)):d_,this.query=this.normalize(n)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return ir(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let e=this.peek();if(e<0)return this.done=!0,this;let n=hv(e),r=this.bufferStart+this.bufferPos;this.bufferPos+=Di(e);let i=this.normalize(n);if(i.length)for(let s=0,o=r;;s++){let a=i.charCodeAt(s),l=this.match(a,o,this.bufferPos+this.bufferStart);if(s==i.length-1){if(l)return this.value=l,this;break}o==r&&sthis.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine="":this.getLine(0)}next(){for(let e=this.matchPos-this.curLineStart;;){this.re.lastIndex=e;let n=this.matchPos<=this.to&&this.re.exec(this.curLine);if(n){let r=this.curLineStart+n.index,i=r+n[0].length;if(this.matchPos=c0(this.text,i+(r==i?1:0)),r==this.curLineStart+this.curLine.length&&this.nextLine(),(rthis.value.to)&&(!this.test||this.test(r,i,n)))return this.value={from:r,to:i,match:n},this;e=this.matchPos-this.curLineStart}else if(this.curLineStart+this.curLine.length=r||i.to<=n){let a=new Sl(n,e.sliceString(n,r));return g1.set(e,a),a}if(i.from==n&&i.to==r)return i;let{text:s,from:o}=i;return o>n&&(s=e.sliceString(n,o)+s,o=n),i.to=this.to?this.to:this.text.lineAt(e).to}next(){for(;;){let e=this.re.lastIndex=this.matchPos-this.flat.from,n=this.re.exec(this.flat.text);if(n&&!n[0]&&n.index==e&&(this.re.lastIndex=e+1,n=this.re.exec(this.flat.text)),n){let r=this.flat.from+n.index,i=r+n[0].length;if((this.flat.to>=this.to||n.index+n[0].length<=this.flat.text.length-10)&&(!this.test||this.test(r,i,n)))return this.value={from:r,to:i,match:n},this.matchPos=c0(this.text,i+(r==i?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=Sl.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}}typeof Symbol<"u"&&(KT.prototype[Symbol.iterator]=XT.prototype[Symbol.iterator]=function(){return this});function GJ(t){try{return new RegExp(t,R2),!0}catch{return!1}}function c0(t,e){if(e>=t.length)return e;let n=t.lineAt(e),r;for(;e=56320&&r<57344;)e++;return e}function Ey(t){let e=String(t.state.doc.lineAt(t.state.selection.main.head).number),n=ct("input",{class:"cm-textfield",name:"line",value:e}),r=ct("form",{class:"cm-gotoLine",onkeydown:s=>{s.keyCode==27?(s.preventDefault(),t.dispatch({effects:vc.of(!1)}),t.focus()):s.keyCode==13&&(s.preventDefault(),i())},onsubmit:s=>{s.preventDefault(),i()}},ct("label",t.state.phrase("Go to line"),": ",n)," ",ct("button",{class:"cm-button",type:"submit"},t.state.phrase("go")),ct("button",{name:"close",onclick:()=>{t.dispatch({effects:vc.of(!1)}),t.focus()},"aria-label":t.state.phrase("close"),type:"button"},["×"]));function i(){let s=/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(n.value);if(!s)return;let{state:o}=t,a=o.doc.lineAt(o.selection.main.head),[,l,u,c,f]=s,d=c?+c.slice(1):0,h=u?+u:a.number;if(u&&f){let g=h/100;l&&(g=g*(l=="-"?-1:1)+a.number/o.doc.lines),h=Math.round(o.doc.lines*g)}else u&&l&&(h=h*(l=="-"?-1:1)+a.number);let p=o.doc.line(Math.max(1,Math.min(o.doc.lines,h))),m=Y.cursor(p.from+Math.max(0,Math.min(d,p.length)));t.dispatch({effects:[vc.of(!1),ce.scrollIntoView(m.from,{y:"center"})],selection:m}),t.focus()}return{dom:r}}const vc=De.define(),h_=Wt.define({create(){return!0},update(t,e){for(let n of e.effects)n.is(vc)&&(t=n.value);return t},provide:t=>jc.from(t,e=>e?Ey:null)}),WJ=t=>{let e=zc(t,Ey);if(!e){let n=[vc.of(!0)];t.state.field(h_,!1)==null&&n.push(De.appendConfig.of([h_,KJ])),t.dispatch({effects:n}),e=zc(t,Ey)}return e&&e.dom.querySelector("input").select(),!0},KJ=ce.baseTheme({".cm-panel.cm-gotoLine":{padding:"2px 6px 4px",position:"relative","& label":{fontSize:"80%"},"& [name=close]":{position:"absolute",top:"0",bottom:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:"0"}}}),XJ={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},YJ=he.define({combine(t){return fi(t,XJ,{highlightWordAroundCursor:(e,n)=>e||n,minSelectionLength:Math.min,maxMatches:Math.min})}});function JJ(t){return[nZ,tZ]}const ZJ=ve.mark({class:"cm-selectionMatch"}),QJ=ve.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function p_(t,e,n,r){return(n==0||t(e.sliceDoc(n-1,n))!=kt.Word)&&(r==e.doc.length||t(e.sliceDoc(r,r+1))!=kt.Word)}function eZ(t,e,n,r){return t(e.sliceDoc(n,n+1))==kt.Word&&t(e.sliceDoc(r-1,r))==kt.Word}const tZ=$t.fromClass(class{constructor(t){this.decorations=this.getDeco(t)}update(t){(t.selectionSet||t.docChanged||t.viewportChanged)&&(this.decorations=this.getDeco(t.view))}getDeco(t){let e=t.state.facet(YJ),{state:n}=t,r=n.selection;if(r.ranges.length>1)return ve.none;let i=r.main,s,o=null;if(i.empty){if(!e.highlightWordAroundCursor)return ve.none;let l=n.wordAt(i.head);if(!l)return ve.none;o=n.charCategorizer(i.head),s=n.sliceDoc(l.from,l.to)}else{let l=i.to-i.from;if(l200)return ve.none;if(e.wholeWords){if(s=n.sliceDoc(i.from,i.to),o=n.charCategorizer(i.head),!(p_(o,n,i.from,i.to)&&eZ(o,n,i.from,i.to)))return ve.none}else if(s=n.sliceDoc(i.from,i.to),!s)return ve.none}let a=[];for(let l of t.visibleRanges){let u=new zl(n.doc,s,l.from,l.to);for(;!u.next().done;){let{from:c,to:f}=u.value;if((!o||p_(o,n,c,f))&&(i.empty&&c<=i.from&&f>=i.to?a.push(QJ.range(c,f)):(c>=i.to||f<=i.from)&&a.push(ZJ.range(c,f)),a.length>e.maxMatches))return ve.none}}return ve.set(a)}},{decorations:t=>t.decorations}),nZ=ce.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),rZ=({state:t,dispatch:e})=>{let{selection:n}=t,r=Y.create(n.ranges.map(i=>t.wordAt(i.head)||Y.cursor(i.head)),n.mainIndex);return r.eq(n)?!1:(e(t.update({selection:r})),!0)};function iZ(t,e){let{main:n,ranges:r}=t.selection,i=t.wordAt(n.head),s=i&&i.from==n.from&&i.to==n.to;for(let o=!1,a=new zl(t.doc,e,r[r.length-1].to);;)if(a.next(),a.done){if(o)return null;a=new zl(t.doc,e,0,Math.max(0,r[r.length-1].from-1)),o=!0}else{if(o&&r.some(l=>l.from==a.value.from))continue;if(s){let l=t.wordAt(a.value.from);if(!l||l.from!=a.value.from||l.to!=a.value.to)continue}return a.value}}const sZ=({state:t,dispatch:e})=>{let{ranges:n}=t.selection;if(n.some(s=>s.from===s.to))return rZ({state:t,dispatch:e});let r=t.sliceDoc(n[0].from,n[0].to);if(t.selection.ranges.some(s=>t.sliceDoc(s.from,s.to)!=r))return!1;let i=iZ(t,r);return i?(e(t.update({selection:t.selection.addRange(Y.range(i.from,i.to),!1),effects:ce.scrollIntoView(i.to)})),!0):!1},gu=he.define({combine(t){return fi(t,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:e=>new bZ(e),scrollToMatch:e=>ce.scrollIntoView(e)})}});class YT{constructor(e){this.search=e.search,this.caseSensitive=!!e.caseSensitive,this.literal=!!e.literal,this.regexp=!!e.regexp,this.replace=e.replace||"",this.valid=!!this.search&&(!this.regexp||GJ(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!e.wholeWord}unquote(e){return this.literal?e:e.replace(/\\([nrt\\])/g,(n,r)=>r=="n"?` +`:r=="r"?"\r":r=="t"?" ":"\\")}eq(e){return this.search==e.search&&this.replace==e.replace&&this.caseSensitive==e.caseSensitive&&this.regexp==e.regexp&&this.wholeWord==e.wholeWord}create(){return this.regexp?new uZ(this):new aZ(this)}getCursor(e,n=0,r){let i=e.doc?e:Ue.create({doc:e});return r==null&&(r=i.doc.length),this.regexp?Xa(this,i,n,r):Ka(this,i,n,r)}}class JT{constructor(e){this.spec=e}}function Ka(t,e,n,r){return new zl(e.doc,t.unquoted,n,r,t.caseSensitive?void 0:i=>i.toLowerCase(),t.wholeWord?oZ(e.doc,e.charCategorizer(e.selection.main.head)):void 0)}function oZ(t,e){return(n,r,i,s)=>((s>n||s+i.length=n)return null;i.push(r.value)}return i}highlight(e,n,r,i){let s=Ka(this.spec,e,Math.max(0,n-this.spec.unquoted.length),Math.min(r+this.spec.unquoted.length,e.doc.length));for(;!s.next().done;)i(s.value.from,s.value.to)}}function Xa(t,e,n,r){return new KT(e.doc,t.search,{ignoreCase:!t.caseSensitive,test:t.wholeWord?lZ(e.charCategorizer(e.selection.main.head)):void 0},n,r)}function f0(t,e){return t.slice(wn(t,e,!1),e)}function d0(t,e){return t.slice(e,wn(t,e))}function lZ(t){return(e,n,r)=>!r[0].length||(t(f0(r.input,r.index))!=kt.Word||t(d0(r.input,r.index))!=kt.Word)&&(t(d0(r.input,r.index+r[0].length))!=kt.Word||t(f0(r.input,r.index+r[0].length))!=kt.Word)}class uZ extends JT{nextMatch(e,n,r){let i=Xa(this.spec,e,r,e.doc.length).next();return i.done&&(i=Xa(this.spec,e,0,n).next()),i.done?null:i.value}prevMatchInRange(e,n,r){for(let i=1;;i++){let s=Math.max(n,r-i*1e4),o=Xa(this.spec,e,s,r),a=null;for(;!o.next().done;)a=o.value;if(a&&(s==n||a.from>s+10))return a;if(s==n)return null}}prevMatch(e,n,r){return this.prevMatchInRange(e,0,n)||this.prevMatchInRange(e,r,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace).replace(/\$([$&]|\d+)/g,(n,r)=>{if(r=="&")return e.match[0];if(r=="$")return"$";for(let i=r.length;i>0;i--){let s=+r.slice(0,i);if(s>0&&s=n)return null;i.push(r.value)}return i}highlight(e,n,r,i){let s=Xa(this.spec,e,Math.max(0,n-250),Math.min(r+250,e.doc.length));for(;!s.next().done;)i(s.value.from,s.value.to)}}const cf=De.define(),N2=De.define(),so=Wt.define({create(t){return new b1(wy(t).create(),null)},update(t,e){for(let n of e.effects)n.is(cf)?t=new b1(n.value.create(),t.panel):n.is(N2)&&(t=new b1(t.query,n.value?M2:null));return t},provide:t=>jc.from(t,e=>e.panel)});class b1{constructor(e,n){this.query=e,this.panel=n}}const cZ=ve.mark({class:"cm-searchMatch"}),fZ=ve.mark({class:"cm-searchMatch cm-searchMatch-selected"}),dZ=$t.fromClass(class{constructor(t){this.view=t,this.decorations=this.highlight(t.state.field(so))}update(t){let e=t.state.field(so);(e!=t.startState.field(so)||t.docChanged||t.selectionSet||t.viewportChanged)&&(this.decorations=this.highlight(e))}highlight({query:t,panel:e}){if(!e||!t.spec.valid)return ve.none;let{view:n}=this,r=new _s;for(let i=0,s=n.visibleRanges,o=s.length;is[i+1].from-500;)l=s[++i].to;t.highlight(n.state,a,l,(u,c)=>{let f=n.state.selection.ranges.some(d=>d.from==u&&d.to==c);r.add(u,c,f?fZ:cZ)})}return r.finish()}},{decorations:t=>t.decorations});function ed(t){return e=>{let n=e.state.field(so,!1);return n&&n.query.spec.valid?t(e,n):e8(e)}}const h0=ed((t,{query:e})=>{let{to:n}=t.state.selection.main,r=e.nextMatch(t.state,n,n);if(!r)return!1;let i=Y.single(r.from,r.to),s=t.state.facet(gu);return t.dispatch({selection:i,effects:[F2(t,r),s.scrollToMatch(i.main,t)],userEvent:"select.search"}),QT(t),!0}),p0=ed((t,{query:e})=>{let{state:n}=t,{from:r}=n.selection.main,i=e.prevMatch(n,r,r);if(!i)return!1;let s=Y.single(i.from,i.to),o=t.state.facet(gu);return t.dispatch({selection:s,effects:[F2(t,i),o.scrollToMatch(s.main,t)],userEvent:"select.search"}),QT(t),!0}),hZ=ed((t,{query:e})=>{let n=e.matchAll(t.state,1e3);return!n||!n.length?!1:(t.dispatch({selection:Y.create(n.map(r=>Y.range(r.from,r.to))),userEvent:"select.search.matches"}),!0)}),pZ=({state:t,dispatch:e})=>{let n=t.selection;if(n.ranges.length>1||n.main.empty)return!1;let{from:r,to:i}=n.main,s=[],o=0;for(let a=new zl(t.doc,t.sliceDoc(r,i));!a.next().done;){if(s.length>1e3)return!1;a.value.from==r&&(o=s.length),s.push(Y.range(a.value.from,a.value.to))}return e(t.update({selection:Y.create(s,o),userEvent:"select.search.matches"})),!0},m_=ed((t,{query:e})=>{let{state:n}=t,{from:r,to:i}=n.selection.main;if(n.readOnly)return!1;let s=e.nextMatch(n,r,r);if(!s)return!1;let o=s,a=[],l,u,c=[];o.from==r&&o.to==i&&(u=n.toText(e.getReplacement(o)),a.push({from:o.from,to:o.to,insert:u}),o=e.nextMatch(n,o.from,o.to),c.push(ce.announce.of(n.phrase("replaced match on line $",n.doc.lineAt(r).number)+".")));let f=t.state.changes(a);return o&&(l=Y.single(o.from,o.to).map(f),c.push(F2(t,o)),c.push(n.facet(gu).scrollToMatch(l.main,t))),t.dispatch({changes:f,selection:l,effects:c,userEvent:"input.replace"}),!0}),mZ=ed((t,{query:e})=>{if(t.state.readOnly)return!1;let n=e.matchAll(t.state,1e9).map(i=>{let{from:s,to:o}=i;return{from:s,to:o,insert:e.getReplacement(i)}});if(!n.length)return!1;let r=t.state.phrase("replaced $ matches",n.length)+".";return t.dispatch({changes:n,effects:ce.announce.of(r),userEvent:"input.replace.all"}),!0});function M2(t){return t.state.facet(gu).createPanel(t)}function wy(t,e){var n,r,i,s,o;let a=t.selection.main,l=a.empty||a.to>a.from+100?"":t.sliceDoc(a.from,a.to);if(e&&!l)return e;let u=t.facet(gu);return new YT({search:((n=e==null?void 0:e.literal)!==null&&n!==void 0?n:u.literal)?l:l.replace(/\n/g,"\\n"),caseSensitive:(r=e==null?void 0:e.caseSensitive)!==null&&r!==void 0?r:u.caseSensitive,literal:(i=e==null?void 0:e.literal)!==null&&i!==void 0?i:u.literal,regexp:(s=e==null?void 0:e.regexp)!==null&&s!==void 0?s:u.regexp,wholeWord:(o=e==null?void 0:e.wholeWord)!==null&&o!==void 0?o:u.wholeWord})}function ZT(t){let e=zc(t,M2);return e&&e.dom.querySelector("[main-field]")}function QT(t){let e=ZT(t);e&&e==t.root.activeElement&&e.select()}const e8=t=>{let e=t.state.field(so,!1);if(e&&e.panel){let n=ZT(t);if(n&&n!=t.root.activeElement){let r=wy(t.state,e.query.spec);r.valid&&t.dispatch({effects:cf.of(r)}),n.focus(),n.select()}}else t.dispatch({effects:[N2.of(!0),e?cf.of(wy(t.state,e.query.spec)):De.appendConfig.of(vZ)]});return!0},t8=t=>{let e=t.state.field(so,!1);if(!e||!e.panel)return!1;let n=zc(t,M2);return n&&n.dom.contains(t.root.activeElement)&&t.focus(),t.dispatch({effects:N2.of(!1)}),!0},gZ=[{key:"Mod-f",run:e8,scope:"editor search-panel"},{key:"F3",run:h0,shift:p0,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:h0,shift:p0,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:t8,scope:"editor search-panel"},{key:"Mod-Shift-l",run:pZ},{key:"Mod-Alt-g",run:WJ},{key:"Mod-d",run:sZ,preventDefault:!0}];class bZ{constructor(e){this.view=e;let n=this.query=e.state.field(so).query.spec;this.commit=this.commit.bind(this),this.searchField=ct("input",{value:n.search,placeholder:mr(e,"Find"),"aria-label":mr(e,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=ct("input",{value:n.replace,placeholder:mr(e,"Replace"),"aria-label":mr(e,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=ct("input",{type:"checkbox",name:"case",form:"",checked:n.caseSensitive,onchange:this.commit}),this.reField=ct("input",{type:"checkbox",name:"re",form:"",checked:n.regexp,onchange:this.commit}),this.wordField=ct("input",{type:"checkbox",name:"word",form:"",checked:n.wholeWord,onchange:this.commit});function r(i,s,o){return ct("button",{class:"cm-button",name:i,onclick:s,type:"button"},o)}this.dom=ct("div",{onkeydown:i=>this.keydown(i),class:"cm-search"},[this.searchField,r("next",()=>h0(e),[mr(e,"next")]),r("prev",()=>p0(e),[mr(e,"previous")]),r("select",()=>hZ(e),[mr(e,"all")]),ct("label",null,[this.caseField,mr(e,"match case")]),ct("label",null,[this.reField,mr(e,"regexp")]),ct("label",null,[this.wordField,mr(e,"by word")]),...e.state.readOnly?[]:[ct("br"),this.replaceField,r("replace",()=>m_(e),[mr(e,"replace")]),r("replaceAll",()=>mZ(e),[mr(e,"replace all")])],ct("button",{name:"close",onclick:()=>t8(e),"aria-label":mr(e,"close"),type:"button"},["×"])])}commit(){let e=new YT({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,wholeWord:this.wordField.checked,replace:this.replaceField.value});e.eq(this.query)||(this.query=e,this.view.dispatch({effects:cf.of(e)}))}keydown(e){ML(this.view,e,"search-panel")?e.preventDefault():e.keyCode==13&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?p0:h0)(this.view)):e.keyCode==13&&e.target==this.replaceField&&(e.preventDefault(),m_(this.view))}update(e){for(let n of e.transactions)for(let r of n.effects)r.is(cf)&&!r.value.eq(this.query)&&this.setQuery(r.value)}setQuery(e){this.query=e,this.searchField.value=e.search,this.replaceField.value=e.replace,this.caseField.checked=e.caseSensitive,this.reField.checked=e.regexp,this.wordField.checked=e.wholeWord}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(gu).top}}function mr(t,e){return t.state.phrase(e)}const sh=30,oh=/[\s\.,:;?!]/;function F2(t,{from:e,to:n}){let r=t.state.doc.lineAt(e),i=t.state.doc.lineAt(n).to,s=Math.max(r.from,e-sh),o=Math.min(i,n+sh),a=t.state.sliceDoc(s,o);if(s!=r.from){for(let l=0;la.length-sh;l--)if(!oh.test(a[l-1])&&oh.test(a[l])){a=a.slice(0,l);break}}return ce.announce.of(`${t.state.phrase("current match")}. ${a} ${t.state.phrase("on line")} ${r.number}.`)}const yZ=ce.baseTheme({".cm-panel.cm-search":{padding:"2px 6px 4px",position:"relative","& [name=close]":{position:"absolute",top:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:0,margin:0},"& input, & button, & label":{margin:".2em .6em .2em 0"},"& input[type=checkbox]":{marginRight:".2em"},"& label":{fontSize:"80%",whiteSpace:"pre"}},"&light .cm-searchMatch":{backgroundColor:"#ffff0054"},"&dark .cm-searchMatch":{backgroundColor:"#00ffff8a"},"&light .cm-searchMatch-selected":{backgroundColor:"#ff6a0054"},"&dark .cm-searchMatch-selected":{backgroundColor:"#ff00ff8a"}}),vZ=[so,Ao.low(dZ),yZ],xZ=[PB(),MB(),ZL(),VY(),s7(),jL(),GL(),Ue.allowMultipleSelections.of(!0),q$(),a7(c7,{fallback:!0}),b7(),cz(),Sz(),dB(),mB(),iB(),JJ(),Lf.of([...pz,...HJ,...gZ,...JY,...t7,...p3,...jB])];/*! * VueCodemirror v6.1.1 * Copyright (c) Surmon. All rights reserved. * Released under the MIT License. * Surmon -*/var vZ=Object.freeze({autofocus:!1,disabled:!1,indentWithTab:!0,tabSize:2,placeholder:"",autoDestroy:!0,extensions:[yZ]}),xZ=Symbol("vue-codemirror-global-config"),Vn,SZ=function(t){var e=t.onUpdate,n=t.onChange,r=t.onFocus,i=t.onBlur,s=(function(o,a){var l={};for(var u in o)Object.prototype.hasOwnProperty.call(o,u)&&a.indexOf(u)<0&&(l[u]=o[u]);if(o!=null&&typeof Object.getOwnPropertySymbols=="function"){var c=0;for(u=Object.getOwnPropertySymbols(o);c""},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const e=t,n=Ki(t,"modelValue"),r=q(()=>e.language==="json"?OY(e.readonly,e.validationSchema):TY(e.readonly)),i=s=>{n.value=s};return(s,o)=>(T(),L(v(DZ),{placeholder:t.placeholder,style:{height:"100%"},extensions:r.value,"indent-with-tab":!0,"tab-size":4,"model-value":n.value,disabled:t.disabled,onChange:i},null,8,["placeholder","extensions","model-value","disabled"]))}}),kZ=z({__name:"RequestBodyJson",props:Da({schema:{}},{modelValue:{default:()=>""},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const e=Ki(t,"modelValue");return(n,r)=>(T(),L(Im,{modelValue:e.value,"onUpdate:modelValue":r[0]||(r[0]=i=>e.value=i),language:"json",readonly:!1,placeholder:"Your JSON Payload","validation-schema":t.schema},null,8,["modelValue","validation-schema"]))}}),OZ=z({__name:"RequestBodyPlainText",setup(t){return(e,n)=>(T(),L(Im,{language:"plain",readonly:!1,placeholder:"Your Plain Text Content"}))}}),TZ={class:"min-h-0 w-full flex-1"},IZ=z({__name:"RequestBodyContent",props:{payloadType:{},payload:{},schema:{}},emits:["update:payload"],setup(t,{emit:e}){const n=e,r=i=>{n("update:payload",i)};return(i,s)=>(T(),K("div",TZ,[t.payloadType===v(Or).JSON?(T(),L(kZ,{key:0,"model-value":t.payload,schema:t.schema,"onUpdate:modelValue":r},null,8,["model-value","schema"])):t.payloadType===v(Or).FORM_DATA?(T(),L(PF,{key:1,"model-value":t.payload,"onUpdate:modelValue":r},null,8,["model-value"])):t.payloadType===v(Or).PLAIN_TEXT?(T(),L(OZ,{key:2,"model-value":t.payload,"onUpdate:modelValue":r},null,8,["model-value"])):(T(),L(NF,{key:3,"onUpdate:modelValue":r}))]))}}),PZ={class:"flex min-h-0 flex-1 flex-col"},RZ=z({__name:"RequestBody",setup(t){const e=Rr(),n=av(),{payloadType:r,payload:i,pendingRequestData:s,supportsAutoFill:o,autofill:a,types:l}=oF(),u=q(()=>{var h;return(h=e.pendingRequestData)==null?void 0:h.routeDefinition}),c=q(()=>u.value?n.isMissingImplementation(u.value):!1),f=q(()=>c.value),d=q(function(){var p;const h=(p=e.pendingRequestData)==null?void 0:p.routeDefinition;return h?n.isUndocumented(h):!1});return(h,p)=>{var m,g,b,y,x,S;return T(),K("div",PZ,[k(Oa,{class:"border-b"},{toolbox:O(()=>[k(v(FZ),{disabled:!v(o),onClick:v(a)},null,8,["disabled","onClick"])]),default:O(()=>[k(v(BZ),{modelValue:v(r),"onUpdate:modelValue":p[0]||(p[0]=E=>_l(r)?r.value=E:null),types:v(l)},null,8,["modelValue","types"])]),_:1}),f.value?(T(),L(gF,{key:0})):we("",!0),d.value?(T(),L(_F,{key:1})):we("",!0),((g=(m=v(s))==null?void 0:m.schema)==null?void 0:g.extractionErrors)!=null?(T(),L(IF,{key:2,"extraction-error":(y=(b=v(s))==null?void 0:b.schema)==null?void 0:y.extractionErrors},null,8,["extraction-error"])):we("",!0),k(IZ,{"payload-type":v(r),payload:v(i),schema:(S=(x=v(s))==null?void 0:x.schema)==null?void 0:S.shape,"onUpdate:payload":p[1]||(p[1]=E=>i.value=E)},null,8,["payload-type","payload","schema"])])}}}),NZ=z({__name:"AppBorderBeam",props:{class:{default:""},size:{default:200},duration:{default:15e3},borderWidth:{default:1.5},anchor:{default:10},colorFrom:{default:"#ffaa40"},colorTo:{default:"#9c40ff"},delay:{default:0}},setup(t){UC(i=>({v72a84cbc:i.size,v46fc34ea:n.value,v4b4cecb0:i.anchor,v55e45fdf:i.borderWidth,v4557a1d2:i.colorFrom,eb57faba:i.colorTo,v01f91a52:r.value}));const e=t,n=q(()=>`${e.duration}s`),r=q(()=>`${e.delay}s`);return(i,s)=>(T(),K("div",{class:Se(v(ke)("border-beam","pointer-events-none absolute inset-0 rounded-[inherit] [border:calc(var(--border-width)*1px)_solid_transparent]","![mask-composite:intersect] ![mask-clip:padding-box,border-box] [mask:linear-gradient(transparent,transparent),linear-gradient(white,white)]","animate-border-beam after:absolute after:aspect-square after:w-[calc(var(--size)*1px)] after:[animation-delay:var(--delay)] after:[background:linear-gradient(to_left,var(--color-from),var(--color-to),transparent)] after:[offset-anchor:calc(var(--anchor)*1%)_50%] after:[offset-path:rect(0_auto_auto_0_round_calc(var(--size)*1px))]",e.class))},null,2))}}),Pm=(t,e)=>{const n=t.__vccOpts||t;for(const[r,i]of e)n[r]=i;return n},MZ=Pm(NZ,[["__scopeId","data-v-5b422e07"]]),n8=z({__name:"AppGlowingButton",props:{duration:{default:10},beamSize:{default:200},variant:{default:"secondary"},size:{default:"xs"},class:{},asChild:{type:Boolean},as:{}},setup(t){const e=t;return(n,r)=>(T(),L(v(gt),{size:t.size,variant:t.variant,class:Se(v(ke)("group relative",e.class))},{default:O(()=>[k(MZ,{size:t.beamSize,duration:t.duration,delay:0,"border-width":1,class:"group-disabled:hidden"},null,8,["size","duration"]),Q(n.$slots,"default")]),_:3},8,["size","variant","class"]))}}),FZ=z({__name:"RequestBodyAutoFillButton",setup(t){return(e,n)=>(T(),L(n8,null,{default:O(()=>[k(v(LN),{class:"transition-all will-change-transform group-hover:rotate-12"}),n[0]||(n[0]=ne(" Auto Fill ",-1))]),_:1}))}}),LZ={class:"flex items-center"},BZ=z({__name:"RequestBodySelector",props:Da({types:{}},{modelValue:{default:()=>""},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const e=t,n=Ki(t,"modelValue");return(r,i)=>(T(),K("div",LZ,[i[1]||(i[1]=M("span",{class:"text-subtle-foreground w-[80px] text-xs"},"Payload Type:",-1)),k(v(tu),{modelValue:n.value,"onUpdate:modelValue":i[0]||(i[0]=s=>n.value=s)},{default:O(()=>[k(v(Zl),{variant:"toolbar",class:"min-w-[120px] text-xs"},{default:O(()=>[k(v(Ql))]),_:1}),k(v(eu),null,{default:O(()=>[(T(!0),K(Qe,null,_n(e.types,s=>(T(),L(v(Es),{key:s.id,value:s.id},{default:O(()=>[ne(de(s.label),1)]),_:2},1032,["value"]))),128))]),_:1})]),_:1},8,["modelValue"])]))}});function $Z(t){const{endpoint:e}=t,n=Z([]),r=p=>{const m=p.split("/"),g=[];return m.forEach((b,y)=>{b.startsWith("{")&&b.endsWith("}")&&g.push(y)}),g},i=p=>p==="{",s=p=>p==="}",o=(p,m)=>{for(let g=m;g>=0;g--){if(i(p[g]))return g;if(s(p[g]))return-1}return-1},a=(p,m)=>{for(let g=m;g{const g=o(p,m);if(g===-1)return null;const b=a(p,m);return b===-1?null:{start:g,end:b}},u=(p,m)=>{const g=p.split("/");let b=0;for(let y=0;y=S&&m<=E)return y;b+=x+1}return null},c=(p,m)=>{const g=p.split("/");if(m>=g.length)return null;let b=0;for(let y=0;y{const g=u(p,m);return g===null||!n.value.includes(g)?null:c(p,g)},d=(p,m)=>{kr(()=>{p.setSelectionRange(m.start,m.end)})},h=p=>{const m=p.target;if(!m||m.selectionStart===null)return;const g=m.selectionStart,b=m.value,y=l(b,g);if(y){d(m,y);return}const x=f(b,g);x&&d(m,x)};return at(e,p=>{(p==null?void 0:p.includes("{"))&&(n.value=r(p))},{immediate:!0}),{handleClick:h,identifyVariableSegments:r,variableSegmentIndices:kc(n)}}const zZ={class:"flex flex-1 items-center"},jZ={class:"flex gap-2 pr-2"},VZ=z({__name:"RequestBuilderEndpointInput",setup(t){const e=Rr(),n=q(()=>e.pendingRequestData),r=q({get:()=>{var a;return((a=n.value)==null?void 0:a.endpoint)??""},set:a=>e.updateRequestEndpoint(a)}),{handleClick:i}=$Z({endpoint:r}),s=async function(){e.pendingRequestData&&await e.executeCurrentRequest()},o=a=>{a.key==="Enter"&&(a.preventDefault(),s())};return(a,l)=>{var u;return T(),K("div",zZ,[k(v(ws),{modelValue:r.value,"onUpdate:modelValue":l[0]||(l[0]=c=>r.value=c),variant:"toolbar",class:"h-full flex-1 text-xs",placeholder:"","data-testid":"endpoint-input",onClick:v(i),onKeydown:o},null,8,["modelValue","onClick"]),M("div",jZ,[k(v(gt),{size:"xs",disabled:!n.value||((u=n.value)==null?void 0:u.isProcessing),class:"gap-0",onClick:s},{default:O(()=>[l[1]||(l[1]=ne(" Send ( ",-1)),k(v(vN),{class:"size-3 px-0"}),l[2]||(l[2]=ne(" ) ",-1))]),_:1},8,["disabled"]),Q(a.$slots,"options-menu")])])}}}),UZ=z({__name:"RequestBuilderMethodSelector",setup(t){const e=Rr(),n=["GET","POST","PUT","PATCH","DELETE"],r=q({get:()=>{var o,a;return((a=(o=e.pendingRequestData)==null?void 0:o.method)==null?void 0:a.toUpperCase())??"GET"},set:o=>e.updateRequestMethod(o.toUpperCase())}),i=q(()=>{var l;const o=(l=e.pendingRequestData)==null?void 0:l.supportedRoutes,a=(o==null?void 0:o.map(u=>u.method))??[];return n.filter(u=>a.includes(u))}),s=q(()=>n.filter(o=>!i.value.includes(o)));return(o,a)=>(T(),L(v(tu),{modelValue:r.value,"onUpdate:modelValue":a[0]||(a[0]=l=>r.value=l)},{default:O(()=>[k(v(Zl),{variant:"toolbar",class:"h-full w-[95px] border-r pr-1.5 pl-5 text-xs"},{default:O(()=>[k(v(Ql),{placeholder:r.value?"":"Select a Method"},{default:O(()=>[ne(de(r.value||"Select a Method"),1)]),_:1},8,["placeholder"])]),_:1}),k(v(eu),{"align-offset":2},{default:O(()=>[i.value.length?(T(),L(v(Pc),{key:0},{default:O(()=>[k(v(Rc),null,{default:O(()=>[...a[1]||(a[1]=[ne("Supported",-1)])]),_:1}),(T(!0),K(Qe,null,_n(i.value,l=>(T(),L(v(Es),{key:l,value:l},{default:O(()=>[ne(de(l),1)]),_:2},1032,["value"]))),128))]),_:1})):we("",!0),s.value.length!==0?(T(),L(v(Pc),{key:1},{default:O(()=>[i.value.length?(T(),K(Qe,{key:0},[k(v(PM)),k(v(Rc),null,{default:O(()=>[...a[2]||(a[2]=[ne("Other",-1)])]),_:1})],64)):we("",!0),(T(!0),K(Qe,null,_n(s.value,l=>(T(),L(v(Es),{key:l,value:l},{default:O(()=>[ne(de(l),1)]),_:2},1032,["value"]))),128))]),_:1})):we("",!0)]),_:1})]),_:1},8,["modelValue"]))}}),r8=z({__name:"AppDropdownMenu",props:{defaultOpen:{type:Boolean},open:{type:Boolean},dir:{},modal:{type:Boolean}},emits:["update:open"],setup(t,{emit:e}){const i=Yr(t,e);return(s,o)=>(T(),L(v(w5),Yn(Pr(v(i))),{default:O(()=>[Q(s.$slots,"default")]),_:3},16))}}),i8=z({__name:"AppDropdownMenuContent",props:{class:{default:""},forceMount:{type:Boolean},loop:{type:Boolean},side:{},sideOffset:{default:4},sideFlip:{type:Boolean},align:{},alignOffset:{},alignFlip:{type:Boolean},avoidCollisions:{type:Boolean},collisionBoundary:{},collisionPadding:{},arrowPadding:{},sticky:{},hideWhenDetached:{type:Boolean},positionStrategy:{},updatePositionStrategy:{},disableUpdateOnLayoutShift:{type:Boolean},prioritizePosition:{type:Boolean},reference:{},asChild:{type:Boolean},as:{}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","closeAutoFocus"],setup(t,{emit:e}){const n=t,r=e,i=q(()=>{const{class:o,...a}=n;return a}),s=Yr(i,r);return(o,a)=>(T(),L(v(R5),null,{default:O(()=>[k(v(C5),Ce(v(s),{class:v(ke)("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-32 overflow-hidden rounded-md border border-zinc-200 bg-white p-1 text-zinc-950 shadow-md dark:border-zinc-800 dark:bg-zinc-950 dark:text-zinc-50",n.class)}),{default:O(()=>[Q(o.$slots,"default")]),_:3},16,["class"])]),_:3}))}}),g_=z({__name:"AppDropdownMenuGroup",props:{asChild:{type:Boolean},as:{}},setup(t){const e=t;return(n,r)=>(T(),L(v(D5),Yn(Pr(e)),{default:O(()=>[Q(n.$slots,"default")]),_:3},16))}}),Gh=z({__name:"AppDropdownMenuItem",props:{class:{},inset:{type:Boolean},disabled:{type:Boolean},textValue:{},asChild:{type:Boolean},as:{}},setup(t){const e=t,n=q(()=>{const{class:i,...s}=e;return s}),r=I0(n);return(i,s)=>(T(),L(v(O5),Ce(v(r),{class:v(ke)("relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm transition-colors outline-none select-none focus:bg-zinc-100 focus:text-zinc-900 data-[disabled]:pointer-events-none data-[disabled]:opacity-50 dark:focus:bg-zinc-800 dark:focus:text-zinc-50 [&>svg]:size-4 [&>svg]:shrink-0",t.inset&&"pl-8",e.class)}),{default:O(()=>[Q(i.$slots,"default")]),_:3},16,["class"]))}}),b_=z({__name:"AppDropdownMenuLabel",props:{class:{},inset:{type:Boolean},asChild:{type:Boolean},as:{}},setup(t){const e=t,n=q(()=>{const{class:i,...s}=e;return s}),r=I0(n);return(i,s)=>(T(),L(v(I5),Ce(v(r),{class:v(ke)("px-2 py-1.5 text-xs",t.inset&&"pl-8",e.class)}),{default:O(()=>[Q(i.$slots,"default")]),_:3},16,["class"]))}}),wy=z({__name:"AppDropdownMenuSeparator",props:{class:{},asChild:{type:Boolean},as:{}},setup(t){const e=t,n=q(()=>{const{class:r,...i}=e;return i});return(r,i)=>(T(),L(v(M5),Ce(n.value,{class:v(ke)("-mx-1 my-1 h-px bg-zinc-100 dark:bg-zinc-800",e.class)}),null,16,["class"]))}}),s8=z({__name:"AppDropdownMenuTrigger",props:{disabled:{type:Boolean},asChild:{type:Boolean},as:{}},setup(t){const n=I0(t);return(r,i)=>(T(),L(v(L5),Ce({class:"outline-none"},v(n)),{default:O(()=>[Q(r.$slots,"default")]),_:3},16))}});/*! pako 2.1.0 https://github.com/nodeca/pako @license (MIT AND Zlib) */const HZ=4,y_=0,v_=1,qZ=2;function bu(t){let e=t.length;for(;--e>=0;)t[e]=0}const GZ=0,o8=1,WZ=2,KZ=3,XZ=258,F2=29,ed=256,ff=ed+1+F2,El=30,L2=19,a8=2*ff+1,Zo=15,b1=16,YZ=7,B2=256,l8=16,u8=17,c8=18,_y=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),Wh=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),JZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),f8=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),ZZ=512,os=new Array((ff+2)*2);bu(os);const xc=new Array(El*2);bu(xc);const df=new Array(ZZ);bu(df);const hf=new Array(XZ-KZ+1);bu(hf);const $2=new Array(F2);bu($2);const p0=new Array(El);bu(p0);function y1(t,e,n,r,i){this.static_tree=t,this.extra_bits=e,this.extra_base=n,this.elems=r,this.max_length=i,this.has_stree=t&&t.length}let d8,h8,p8;function v1(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}const m8=t=>t<256?df[t]:df[256+(t>>>7)],pf=(t,e)=>{t.pending_buf[t.pending++]=e&255,t.pending_buf[t.pending++]=e>>>8&255},lr=(t,e,n)=>{t.bi_valid>b1-n?(t.bi_buf|=e<>b1-t.bi_valid,t.bi_valid+=n-b1):(t.bi_buf|=e<{lr(t,n[e*2],n[e*2+1])},g8=(t,e)=>{let n=0;do n|=t&1,t>>>=1,n<<=1;while(--e>0);return n>>>1},QZ=t=>{t.bi_valid===16?(pf(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=t.bi_buf&255,t.bi_buf>>=8,t.bi_valid-=8)},eQ=(t,e)=>{const n=e.dyn_tree,r=e.max_code,i=e.stat_desc.static_tree,s=e.stat_desc.has_stree,o=e.stat_desc.extra_bits,a=e.stat_desc.extra_base,l=e.stat_desc.max_length;let u,c,f,d,h,p,m=0;for(d=0;d<=Zo;d++)t.bl_count[d]=0;for(n[t.heap[t.heap_max]*2+1]=0,u=t.heap_max+1;ul&&(d=l,m++),n[c*2+1]=d,!(c>r)&&(t.bl_count[d]++,h=0,c>=a&&(h=o[c-a]),p=n[c*2],t.opt_len+=p*(d+h),s&&(t.static_len+=p*(i[c*2+1]+h)));if(m!==0){do{for(d=l-1;t.bl_count[d]===0;)d--;t.bl_count[d]--,t.bl_count[d+1]+=2,t.bl_count[l]--,m-=2}while(m>0);for(d=l;d!==0;d--)for(c=t.bl_count[d];c!==0;)f=t.heap[--u],!(f>r)&&(n[f*2+1]!==d&&(t.opt_len+=(d-n[f*2+1])*n[f*2],n[f*2+1]=d),c--)}},b8=(t,e,n)=>{const r=new Array(Zo+1);let i=0,s,o;for(s=1;s<=Zo;s++)i=i+n[s-1]<<1,r[s]=i;for(o=0;o<=e;o++){let a=t[o*2+1];a!==0&&(t[o*2]=g8(r[a]++,a))}},tQ=()=>{let t,e,n,r,i;const s=new Array(Zo+1);for(n=0,r=0;r>=7;r{let e;for(e=0;e{t.bi_valid>8?pf(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0},x_=(t,e,n,r)=>{const i=e*2,s=n*2;return t[i]{const r=t.heap[n];let i=n<<1;for(;i<=t.heap_len&&(i{let r,i,s=0,o,a;if(t.sym_next!==0)do r=t.pending_buf[t.sym_buf+s++]&255,r+=(t.pending_buf[t.sym_buf+s++]&255)<<8,i=t.pending_buf[t.sym_buf+s++],r===0?Ti(t,i,e):(o=hf[i],Ti(t,o+ed+1,e),a=_y[o],a!==0&&(i-=$2[o],lr(t,i,a)),r--,o=m8(r),Ti(t,o,n),a=Wh[o],a!==0&&(r-=p0[o],lr(t,r,a)));while(s{const n=e.dyn_tree,r=e.stat_desc.static_tree,i=e.stat_desc.has_stree,s=e.stat_desc.elems;let o,a,l=-1,u;for(t.heap_len=0,t.heap_max=a8,o=0;o>1;o>=1;o--)x1(t,n,o);u=s;do o=t.heap[1],t.heap[1]=t.heap[t.heap_len--],x1(t,n,1),a=t.heap[1],t.heap[--t.heap_max]=o,t.heap[--t.heap_max]=a,n[u*2]=n[o*2]+n[a*2],t.depth[u]=(t.depth[o]>=t.depth[a]?t.depth[o]:t.depth[a])+1,n[o*2+1]=n[a*2+1]=u,t.heap[1]=u++,x1(t,n,1);while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],eQ(t,e),b8(n,l,t.bl_count)},E_=(t,e,n)=>{let r,i=-1,s,o=e[1],a=0,l=7,u=4;for(o===0&&(l=138,u=3),e[(n+1)*2+1]=65535,r=0;r<=n;r++)s=o,o=e[(r+1)*2+1],!(++a{let r,i=-1,s,o=e[1],a=0,l=7,u=4;for(o===0&&(l=138,u=3),r=0;r<=n;r++)if(s=o,o=e[(r+1)*2+1],!(++a{let e;for(E_(t,t.dyn_ltree,t.l_desc.max_code),E_(t,t.dyn_dtree,t.d_desc.max_code),Cy(t,t.bl_desc),e=L2-1;e>=3&&t.bl_tree[f8[e]*2+1]===0;e--);return t.opt_len+=3*(e+1)+5+5+4,e},rQ=(t,e,n,r)=>{let i;for(lr(t,e-257,5),lr(t,n-1,5),lr(t,r-4,4),i=0;i{let e=4093624447,n;for(n=0;n<=31;n++,e>>>=1)if(e&1&&t.dyn_ltree[n*2]!==0)return y_;if(t.dyn_ltree[18]!==0||t.dyn_ltree[20]!==0||t.dyn_ltree[26]!==0)return v_;for(n=32;n{__||(tQ(),__=!0),t.l_desc=new v1(t.dyn_ltree,d8),t.d_desc=new v1(t.dyn_dtree,h8),t.bl_desc=new v1(t.bl_tree,p8),t.bi_buf=0,t.bi_valid=0,y8(t)},x8=(t,e,n,r)=>{lr(t,(GZ<<1)+(r?1:0),3),v8(t),pf(t,n),pf(t,~n),n&&t.pending_buf.set(t.window.subarray(e,e+n),t.pending),t.pending+=n},oQ=t=>{lr(t,o8<<1,3),Ti(t,B2,os),QZ(t)},aQ=(t,e,n,r)=>{let i,s,o=0;t.level>0?(t.strm.data_type===qZ&&(t.strm.data_type=iQ(t)),Cy(t,t.l_desc),Cy(t,t.d_desc),o=nQ(t),i=t.opt_len+3+7>>>3,s=t.static_len+3+7>>>3,s<=i&&(i=s)):i=s=n+5,n+4<=i&&e!==-1?x8(t,e,n,r):t.strategy===HZ||s===i?(lr(t,(o8<<1)+(r?1:0),3),S_(t,os,xc)):(lr(t,(WZ<<1)+(r?1:0),3),rQ(t,t.l_desc.max_code+1,t.d_desc.max_code+1,o+1),S_(t,t.dyn_ltree,t.dyn_dtree)),y8(t),r&&v8(t)},lQ=(t,e,n)=>(t.pending_buf[t.sym_buf+t.sym_next++]=e,t.pending_buf[t.sym_buf+t.sym_next++]=e>>8,t.pending_buf[t.sym_buf+t.sym_next++]=n,e===0?t.dyn_ltree[n*2]++:(t.matches++,e--,t.dyn_ltree[(hf[n]+ed+1)*2]++,t.dyn_dtree[m8(e)*2]++),t.sym_next===t.sym_end);var uQ=sQ,cQ=x8,fQ=aQ,dQ=lQ,hQ=oQ,pQ={_tr_init:uQ,_tr_stored_block:cQ,_tr_flush_block:fQ,_tr_tally:dQ,_tr_align:hQ};const mQ=(t,e,n,r)=>{let i=t&65535|0,s=t>>>16&65535|0,o=0;for(;n!==0;){o=n>2e3?2e3:n,n-=o;do i=i+e[r++]|0,s=s+i|0;while(--o);i%=65521,s%=65521}return i|s<<16|0};var mf=mQ;const gQ=()=>{let t,e=[];for(var n=0;n<256;n++){t=n;for(var r=0;r<8;r++)t=t&1?3988292384^t>>>1:t>>>1;e[n]=t}return e},bQ=new Uint32Array(gQ()),yQ=(t,e,n,r)=>{const i=bQ,s=r+n;t^=-1;for(let o=r;o>>8^i[(t^e[o])&255];return t^-1};var dn=yQ,ga={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},td={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8};const{_tr_init:vQ,_tr_stored_block:Ay,_tr_flush_block:xQ,_tr_tally:oo,_tr_align:SQ}=pQ,{Z_NO_FLUSH:ao,Z_PARTIAL_FLUSH:EQ,Z_FULL_FLUSH:wQ,Z_FINISH:Br,Z_BLOCK:C_,Z_OK:vn,Z_STREAM_END:A_,Z_STREAM_ERROR:$i,Z_DATA_ERROR:_Q,Z_BUF_ERROR:S1,Z_DEFAULT_COMPRESSION:CQ,Z_FILTERED:AQ,Z_HUFFMAN_ONLY:ah,Z_RLE:DQ,Z_FIXED:kQ,Z_DEFAULT_STRATEGY:OQ,Z_UNKNOWN:TQ,Z_DEFLATED:Rm}=td,IQ=9,PQ=15,RQ=8,NQ=29,MQ=256,Dy=MQ+1+NQ,FQ=30,LQ=19,BQ=2*Dy+1,$Q=15,Ke=3,Js=258,zi=Js+Ke+1,zQ=32,jl=42,z2=57,ky=69,Oy=73,Ty=91,Iy=103,Qo=113,tc=666,Gn=1,yu=2,ba=3,vu=4,jQ=3,ea=(t,e)=>(t.msg=ga[e],e),D_=t=>t*2-(t>4?9:0),Us=t=>{let e=t.length;for(;--e>=0;)t[e]=0},VQ=t=>{let e,n,r,i=t.w_size;e=t.hash_size,r=e;do n=t.head[--r],t.head[r]=n>=i?n-i:0;while(--e);e=i,r=e;do n=t.prev[--r],t.prev[r]=n>=i?n-i:0;while(--e)};let UQ=(t,e,n)=>(e<{const e=t.state;let n=e.pending;n>t.avail_out&&(n=t.avail_out),n!==0&&(t.output.set(e.pending_buf.subarray(e.pending_out,e.pending_out+n),t.next_out),t.next_out+=n,e.pending_out+=n,t.total_out+=n,t.avail_out-=n,e.pending-=n,e.pending===0&&(e.pending_out=0))},Ar=(t,e)=>{xQ(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,vr(t.strm)},it=(t,e)=>{t.pending_buf[t.pending++]=e},ju=(t,e)=>{t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=e&255},Py=(t,e,n,r)=>{let i=t.avail_in;return i>r&&(i=r),i===0?0:(t.avail_in-=i,e.set(t.input.subarray(t.next_in,t.next_in+i),n),t.state.wrap===1?t.adler=mf(t.adler,e,i,n):t.state.wrap===2&&(t.adler=dn(t.adler,e,i,n)),t.next_in+=i,t.total_in+=i,i)},S8=(t,e)=>{let n=t.max_chain_length,r=t.strstart,i,s,o=t.prev_length,a=t.nice_match;const l=t.strstart>t.w_size-zi?t.strstart-(t.w_size-zi):0,u=t.window,c=t.w_mask,f=t.prev,d=t.strstart+Js;let h=u[r+o-1],p=u[r+o];t.prev_length>=t.good_match&&(n>>=2),a>t.lookahead&&(a=t.lookahead);do if(i=e,!(u[i+o]!==p||u[i+o-1]!==h||u[i]!==u[r]||u[++i]!==u[r+1])){r+=2,i++;do;while(u[++r]===u[++i]&&u[++r]===u[++i]&&u[++r]===u[++i]&&u[++r]===u[++i]&&u[++r]===u[++i]&&u[++r]===u[++i]&&u[++r]===u[++i]&&u[++r]===u[++i]&&ro){if(t.match_start=e,o=s,s>=a)break;h=u[r+o-1],p=u[r+o]}}while((e=f[e&c])>l&&--n!==0);return o<=t.lookahead?o:t.lookahead},Vl=t=>{const e=t.w_size;let n,r,i;do{if(r=t.window_size-t.lookahead-t.strstart,t.strstart>=e+(e-zi)&&(t.window.set(t.window.subarray(e,e+e-r),0),t.match_start-=e,t.strstart-=e,t.block_start-=e,t.insert>t.strstart&&(t.insert=t.strstart),VQ(t),r+=e),t.strm.avail_in===0)break;if(n=Py(t.strm,t.window,t.strstart+t.lookahead,r),t.lookahead+=n,t.lookahead+t.insert>=Ke)for(i=t.strstart-t.insert,t.ins_h=t.window[i],t.ins_h=lo(t,t.ins_h,t.window[i+1]);t.insert&&(t.ins_h=lo(t,t.ins_h,t.window[i+Ke-1]),t.prev[i&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=i,i++,t.insert--,!(t.lookahead+t.insert{let n=t.pending_buf_size-5>t.w_size?t.w_size:t.pending_buf_size-5,r,i,s,o=0,a=t.strm.avail_in;do{if(r=65535,s=t.bi_valid+42>>3,t.strm.avail_outi+t.strm.avail_in&&(r=i+t.strm.avail_in),r>s&&(r=s),r>8,t.pending_buf[t.pending-2]=~r,t.pending_buf[t.pending-1]=~r>>8,vr(t.strm),i&&(i>r&&(i=r),t.strm.output.set(t.window.subarray(t.block_start,t.block_start+i),t.strm.next_out),t.strm.next_out+=i,t.strm.avail_out-=i,t.strm.total_out+=i,t.block_start+=i,r-=i),r&&(Py(t.strm,t.strm.output,t.strm.next_out,r),t.strm.next_out+=r,t.strm.avail_out-=r,t.strm.total_out+=r)}while(o===0);return a-=t.strm.avail_in,a&&(a>=t.w_size?(t.matches=2,t.window.set(t.strm.input.subarray(t.strm.next_in-t.w_size,t.strm.next_in),0),t.strstart=t.w_size,t.insert=t.strstart):(t.window_size-t.strstart<=a&&(t.strstart-=t.w_size,t.window.set(t.window.subarray(t.w_size,t.w_size+t.strstart),0),t.matches<2&&t.matches++,t.insert>t.strstart&&(t.insert=t.strstart)),t.window.set(t.strm.input.subarray(t.strm.next_in-a,t.strm.next_in),t.strstart),t.strstart+=a,t.insert+=a>t.w_size-t.insert?t.w_size-t.insert:a),t.block_start=t.strstart),t.high_waters&&t.block_start>=t.w_size&&(t.block_start-=t.w_size,t.strstart-=t.w_size,t.window.set(t.window.subarray(t.w_size,t.w_size+t.strstart),0),t.matches<2&&t.matches++,s+=t.w_size,t.insert>t.strstart&&(t.insert=t.strstart)),s>t.strm.avail_in&&(s=t.strm.avail_in),s&&(Py(t.strm,t.window,t.strstart,s),t.strstart+=s,t.insert+=s>t.w_size-t.insert?t.w_size-t.insert:s),t.high_water>3,s=t.pending_buf_size-s>65535?65535:t.pending_buf_size-s,n=s>t.w_size?t.w_size:s,i=t.strstart-t.block_start,(i>=n||(i||e===Br)&&e!==ao&&t.strm.avail_in===0&&i<=s)&&(r=i>s?s:i,o=e===Br&&t.strm.avail_in===0&&r===i?1:0,Ay(t,t.block_start,r,o),t.block_start+=r,vr(t.strm)),o?ba:Gn)},E1=(t,e)=>{let n,r;for(;;){if(t.lookahead=Ke&&(t.ins_h=lo(t,t.ins_h,t.window[t.strstart+Ke-1]),n=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),n!==0&&t.strstart-n<=t.w_size-zi&&(t.match_length=S8(t,n)),t.match_length>=Ke)if(r=oo(t,t.strstart-t.match_start,t.match_length-Ke),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=Ke){t.match_length--;do t.strstart++,t.ins_h=lo(t,t.ins_h,t.window[t.strstart+Ke-1]),n=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart;while(--t.match_length!==0);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=lo(t,t.ins_h,t.window[t.strstart+1]);else r=oo(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(r&&(Ar(t,!1),t.strm.avail_out===0))return Gn}return t.insert=t.strstart{let n,r,i;for(;;){if(t.lookahead=Ke&&(t.ins_h=lo(t,t.ins_h,t.window[t.strstart+Ke-1]),n=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=Ke-1,n!==0&&t.prev_length4096)&&(t.match_length=Ke-1)),t.prev_length>=Ke&&t.match_length<=t.prev_length){i=t.strstart+t.lookahead-Ke,r=oo(t,t.strstart-1-t.prev_match,t.prev_length-Ke),t.lookahead-=t.prev_length-1,t.prev_length-=2;do++t.strstart<=i&&(t.ins_h=lo(t,t.ins_h,t.window[t.strstart+Ke-1]),n=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart);while(--t.prev_length!==0);if(t.match_available=0,t.match_length=Ke-1,t.strstart++,r&&(Ar(t,!1),t.strm.avail_out===0))return Gn}else if(t.match_available){if(r=oo(t,0,t.window[t.strstart-1]),r&&Ar(t,!1),t.strstart++,t.lookahead--,t.strm.avail_out===0)return Gn}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(r=oo(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart{let n,r,i,s;const o=t.window;for(;;){if(t.lookahead<=Js){if(Vl(t),t.lookahead<=Js&&e===ao)return Gn;if(t.lookahead===0)break}if(t.match_length=0,t.lookahead>=Ke&&t.strstart>0&&(i=t.strstart-1,r=o[i],r===o[++i]&&r===o[++i]&&r===o[++i])){s=t.strstart+Js;do;while(r===o[++i]&&r===o[++i]&&r===o[++i]&&r===o[++i]&&r===o[++i]&&r===o[++i]&&r===o[++i]&&r===o[++i]&&it.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=Ke?(n=oo(t,1,t.match_length-Ke),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(n=oo(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),n&&(Ar(t,!1),t.strm.avail_out===0))return Gn}return t.insert=0,e===Br?(Ar(t,!0),t.strm.avail_out===0?ba:vu):t.sym_next&&(Ar(t,!1),t.strm.avail_out===0)?Gn:yu},qQ=(t,e)=>{let n;for(;;){if(t.lookahead===0&&(Vl(t),t.lookahead===0)){if(e===ao)return Gn;break}if(t.match_length=0,n=oo(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,n&&(Ar(t,!1),t.strm.avail_out===0))return Gn}return t.insert=0,e===Br?(Ar(t,!0),t.strm.avail_out===0?ba:vu):t.sym_next&&(Ar(t,!1),t.strm.avail_out===0)?Gn:yu};function Si(t,e,n,r,i){this.good_length=t,this.max_lazy=e,this.nice_length=n,this.max_chain=r,this.func=i}const nc=[new Si(0,0,0,0,E8),new Si(4,4,8,4,E1),new Si(4,5,16,8,E1),new Si(4,6,32,32,E1),new Si(4,4,16,16,ja),new Si(8,16,32,32,ja),new Si(8,16,128,128,ja),new Si(8,32,128,256,ja),new Si(32,128,258,1024,ja),new Si(32,258,258,4096,ja)],GQ=t=>{t.window_size=2*t.w_size,Us(t.head),t.max_lazy_match=nc[t.level].max_lazy,t.good_match=nc[t.level].good_length,t.nice_match=nc[t.level].nice_length,t.max_chain_length=nc[t.level].max_chain,t.strstart=0,t.block_start=0,t.lookahead=0,t.insert=0,t.match_length=t.prev_length=Ke-1,t.match_available=0,t.ins_h=0};function WQ(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=Rm,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(BQ*2),this.dyn_dtree=new Uint16Array((2*FQ+1)*2),this.bl_tree=new Uint16Array((2*LQ+1)*2),Us(this.dyn_ltree),Us(this.dyn_dtree),Us(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array($Q+1),this.heap=new Uint16Array(2*Dy+1),Us(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(2*Dy+1),Us(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}const nd=t=>{if(!t)return 1;const e=t.state;return!e||e.strm!==t||e.status!==jl&&e.status!==z2&&e.status!==ky&&e.status!==Oy&&e.status!==Ty&&e.status!==Iy&&e.status!==Qo&&e.status!==tc?1:0},w8=t=>{if(nd(t))return ea(t,$i);t.total_in=t.total_out=0,t.data_type=TQ;const e=t.state;return e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap===2?z2:e.wrap?jl:Qo,t.adler=e.wrap===2?0:1,e.last_flush=-2,vQ(e),vn},_8=t=>{const e=w8(t);return e===vn&&GQ(t.state),e},KQ=(t,e)=>nd(t)||t.state.wrap!==2?$i:(t.state.gzhead=e,vn),C8=(t,e,n,r,i,s)=>{if(!t)return $i;let o=1;if(e===CQ&&(e=6),r<0?(o=0,r=-r):r>15&&(o=2,r-=16),i<1||i>IQ||n!==Rm||r<8||r>15||e<0||e>9||s<0||s>kQ||r===8&&o!==1)return ea(t,$i);r===8&&(r=9);const a=new WQ;return t.state=a,a.strm=t,a.status=jl,a.wrap=o,a.gzhead=null,a.w_bits=r,a.w_size=1<C8(t,e,Rm,PQ,RQ,OQ),YQ=(t,e)=>{if(nd(t)||e>C_||e<0)return t?ea(t,$i):$i;const n=t.state;if(!t.output||t.avail_in!==0&&!t.input||n.status===tc&&e!==Br)return ea(t,t.avail_out===0?S1:$i);const r=n.last_flush;if(n.last_flush=e,n.pending!==0){if(vr(t),t.avail_out===0)return n.last_flush=-1,vn}else if(t.avail_in===0&&D_(e)<=D_(r)&&e!==Br)return ea(t,S1);if(n.status===tc&&t.avail_in!==0)return ea(t,S1);if(n.status===jl&&n.wrap===0&&(n.status=Qo),n.status===jl){let i=Rm+(n.w_bits-8<<4)<<8,s=-1;if(n.strategy>=ah||n.level<2?s=0:n.level<6?s=1:n.level===6?s=2:s=3,i|=s<<6,n.strstart!==0&&(i|=zQ),i+=31-i%31,ju(n,i),n.strstart!==0&&(ju(n,t.adler>>>16),ju(n,t.adler&65535)),t.adler=1,n.status=Qo,vr(t),n.pending!==0)return n.last_flush=-1,vn}if(n.status===z2){if(t.adler=0,it(n,31),it(n,139),it(n,8),n.gzhead)it(n,(n.gzhead.text?1:0)+(n.gzhead.hcrc?2:0)+(n.gzhead.extra?4:0)+(n.gzhead.name?8:0)+(n.gzhead.comment?16:0)),it(n,n.gzhead.time&255),it(n,n.gzhead.time>>8&255),it(n,n.gzhead.time>>16&255),it(n,n.gzhead.time>>24&255),it(n,n.level===9?2:n.strategy>=ah||n.level<2?4:0),it(n,n.gzhead.os&255),n.gzhead.extra&&n.gzhead.extra.length&&(it(n,n.gzhead.extra.length&255),it(n,n.gzhead.extra.length>>8&255)),n.gzhead.hcrc&&(t.adler=dn(t.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=ky;else if(it(n,0),it(n,0),it(n,0),it(n,0),it(n,0),it(n,n.level===9?2:n.strategy>=ah||n.level<2?4:0),it(n,jQ),n.status=Qo,vr(t),n.pending!==0)return n.last_flush=-1,vn}if(n.status===ky){if(n.gzhead.extra){let i=n.pending,s=(n.gzhead.extra.length&65535)-n.gzindex;for(;n.pending+s>n.pending_buf_size;){let a=n.pending_buf_size-n.pending;if(n.pending_buf.set(n.gzhead.extra.subarray(n.gzindex,n.gzindex+a),n.pending),n.pending=n.pending_buf_size,n.gzhead.hcrc&&n.pending>i&&(t.adler=dn(t.adler,n.pending_buf,n.pending-i,i)),n.gzindex+=a,vr(t),n.pending!==0)return n.last_flush=-1,vn;i=0,s-=a}let o=new Uint8Array(n.gzhead.extra);n.pending_buf.set(o.subarray(n.gzindex,n.gzindex+s),n.pending),n.pending+=s,n.gzhead.hcrc&&n.pending>i&&(t.adler=dn(t.adler,n.pending_buf,n.pending-i,i)),n.gzindex=0}n.status=Oy}if(n.status===Oy){if(n.gzhead.name){let i=n.pending,s;do{if(n.pending===n.pending_buf_size){if(n.gzhead.hcrc&&n.pending>i&&(t.adler=dn(t.adler,n.pending_buf,n.pending-i,i)),vr(t),n.pending!==0)return n.last_flush=-1,vn;i=0}n.gzindexi&&(t.adler=dn(t.adler,n.pending_buf,n.pending-i,i)),n.gzindex=0}n.status=Ty}if(n.status===Ty){if(n.gzhead.comment){let i=n.pending,s;do{if(n.pending===n.pending_buf_size){if(n.gzhead.hcrc&&n.pending>i&&(t.adler=dn(t.adler,n.pending_buf,n.pending-i,i)),vr(t),n.pending!==0)return n.last_flush=-1,vn;i=0}n.gzindexi&&(t.adler=dn(t.adler,n.pending_buf,n.pending-i,i))}n.status=Iy}if(n.status===Iy){if(n.gzhead.hcrc){if(n.pending+2>n.pending_buf_size&&(vr(t),n.pending!==0))return n.last_flush=-1,vn;it(n,t.adler&255),it(n,t.adler>>8&255),t.adler=0}if(n.status=Qo,vr(t),n.pending!==0)return n.last_flush=-1,vn}if(t.avail_in!==0||n.lookahead!==0||e!==ao&&n.status!==tc){let i=n.level===0?E8(n,e):n.strategy===ah?qQ(n,e):n.strategy===DQ?HQ(n,e):nc[n.level].func(n,e);if((i===ba||i===vu)&&(n.status=tc),i===Gn||i===ba)return t.avail_out===0&&(n.last_flush=-1),vn;if(i===yu&&(e===EQ?SQ(n):e!==C_&&(Ay(n,0,0,!1),e===wQ&&(Us(n.head),n.lookahead===0&&(n.strstart=0,n.block_start=0,n.insert=0))),vr(t),t.avail_out===0))return n.last_flush=-1,vn}return e!==Br?vn:n.wrap<=0?A_:(n.wrap===2?(it(n,t.adler&255),it(n,t.adler>>8&255),it(n,t.adler>>16&255),it(n,t.adler>>24&255),it(n,t.total_in&255),it(n,t.total_in>>8&255),it(n,t.total_in>>16&255),it(n,t.total_in>>24&255)):(ju(n,t.adler>>>16),ju(n,t.adler&65535)),vr(t),n.wrap>0&&(n.wrap=-n.wrap),n.pending!==0?vn:A_)},JQ=t=>{if(nd(t))return $i;const e=t.state.status;return t.state=null,e===Qo?ea(t,_Q):vn},ZQ=(t,e)=>{let n=e.length;if(nd(t))return $i;const r=t.state,i=r.wrap;if(i===2||i===1&&r.status!==jl||r.lookahead)return $i;if(i===1&&(t.adler=mf(t.adler,e,n,0)),r.wrap=0,n>=r.w_size){i===0&&(Us(r.head),r.strstart=0,r.block_start=0,r.insert=0);let l=new Uint8Array(r.w_size);l.set(e.subarray(n-r.w_size,n),0),e=l,n=r.w_size}const s=t.avail_in,o=t.next_in,a=t.input;for(t.avail_in=n,t.next_in=0,t.input=e,Vl(r);r.lookahead>=Ke;){let l=r.strstart,u=r.lookahead-(Ke-1);do r.ins_h=lo(r,r.ins_h,r.window[l+Ke-1]),r.prev[l&r.w_mask]=r.head[r.ins_h],r.head[r.ins_h]=l,l++;while(--u);r.strstart=l,r.lookahead=Ke-1,Vl(r)}return r.strstart+=r.lookahead,r.block_start=r.strstart,r.insert=r.lookahead,r.lookahead=0,r.match_length=r.prev_length=Ke-1,r.match_available=0,t.next_in=o,t.input=a,t.avail_in=s,r.wrap=i,vn};var QQ=XQ,eee=C8,tee=_8,nee=w8,ree=KQ,iee=YQ,see=JQ,oee=ZQ,aee="pako deflate (from Nodeca project)",Sc={deflateInit:QQ,deflateInit2:eee,deflateReset:tee,deflateResetKeep:nee,deflateSetHeader:ree,deflate:iee,deflateEnd:see,deflateSetDictionary:oee,deflateInfo:aee};const lee=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);var uee=function(t){const e=Array.prototype.slice.call(arguments,1);for(;e.length;){const n=e.shift();if(n){if(typeof n!="object")throw new TypeError(n+"must be non-object");for(const r in n)lee(n,r)&&(t[r]=n[r])}}return t},cee=t=>{let e=0;for(let r=0,i=t.length;r=252?6:t>=248?5:t>=240?4:t>=224?3:t>=192?2:1;gf[254]=gf[254]=1;var fee=t=>{if(typeof TextEncoder=="function"&&TextEncoder.prototype.encode)return new TextEncoder().encode(t);let e,n,r,i,s,o=t.length,a=0;for(i=0;i>>6,e[s++]=128|n&63):n<65536?(e[s++]=224|n>>>12,e[s++]=128|n>>>6&63,e[s++]=128|n&63):(e[s++]=240|n>>>18,e[s++]=128|n>>>12&63,e[s++]=128|n>>>6&63,e[s++]=128|n&63);return e};const dee=(t,e)=>{if(e<65534&&t.subarray&&A8)return String.fromCharCode.apply(null,t.length===e?t:t.subarray(0,e));let n="";for(let r=0;r{const n=e||t.length;if(typeof TextDecoder=="function"&&TextDecoder.prototype.decode)return new TextDecoder().decode(t.subarray(0,e));let r,i;const s=new Array(n*2);for(i=0,r=0;r4){s[i++]=65533,r+=a-1;continue}for(o&=a===2?31:a===3?15:7;a>1&&r1){s[i++]=65533;continue}o<65536?s[i++]=o:(o-=65536,s[i++]=55296|o>>10&1023,s[i++]=56320|o&1023)}return dee(s,i)},pee=(t,e)=>{e=e||t.length,e>t.length&&(e=t.length);let n=e-1;for(;n>=0&&(t[n]&192)===128;)n--;return n<0||n===0?e:n+gf[t[n]]>e?n:e},bf={string2buf:fee,buf2string:hee,utf8border:pee};function mee(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}var D8=mee;const k8=Object.prototype.toString,{Z_NO_FLUSH:gee,Z_SYNC_FLUSH:bee,Z_FULL_FLUSH:yee,Z_FINISH:vee,Z_OK:m0,Z_STREAM_END:xee,Z_DEFAULT_COMPRESSION:See,Z_DEFAULT_STRATEGY:Eee,Z_DEFLATED:wee}=td;function rd(t){this.options=Nm.assign({level:See,method:wee,chunkSize:16384,windowBits:15,memLevel:8,strategy:Eee},t||{});let e=this.options;e.raw&&e.windowBits>0?e.windowBits=-e.windowBits:e.gzip&&e.windowBits>0&&e.windowBits<16&&(e.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new D8,this.strm.avail_out=0;let n=Sc.deflateInit2(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(n!==m0)throw new Error(ga[n]);if(e.header&&Sc.deflateSetHeader(this.strm,e.header),e.dictionary){let r;if(typeof e.dictionary=="string"?r=bf.string2buf(e.dictionary):k8.call(e.dictionary)==="[object ArrayBuffer]"?r=new Uint8Array(e.dictionary):r=e.dictionary,n=Sc.deflateSetDictionary(this.strm,r),n!==m0)throw new Error(ga[n]);this._dict_set=!0}}rd.prototype.push=function(t,e){const n=this.strm,r=this.options.chunkSize;let i,s;if(this.ended)return!1;for(e===~~e?s=e:s=e===!0?vee:gee,typeof t=="string"?n.input=bf.string2buf(t):k8.call(t)==="[object ArrayBuffer]"?n.input=new Uint8Array(t):n.input=t,n.next_in=0,n.avail_in=n.input.length;;){if(n.avail_out===0&&(n.output=new Uint8Array(r),n.next_out=0,n.avail_out=r),(s===bee||s===yee)&&n.avail_out<=6){this.onData(n.output.subarray(0,n.next_out)),n.avail_out=0;continue}if(i=Sc.deflate(n,s),i===xee)return n.next_out>0&&this.onData(n.output.subarray(0,n.next_out)),i=Sc.deflateEnd(this.strm),this.onEnd(i),this.ended=!0,i===m0;if(n.avail_out===0){this.onData(n.output);continue}if(s>0&&n.next_out>0){this.onData(n.output.subarray(0,n.next_out)),n.avail_out=0;continue}if(n.avail_in===0)break}return!0};rd.prototype.onData=function(t){this.chunks.push(t)};rd.prototype.onEnd=function(t){t===m0&&(this.result=Nm.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};function j2(t,e){const n=new rd(e);if(n.push(t,!0),n.err)throw n.msg||ga[n.err];return n.result}function _ee(t,e){return e=e||{},e.raw=!0,j2(t,e)}function Cee(t,e){return e=e||{},e.gzip=!0,j2(t,e)}var Aee=rd,Dee=j2,kee=_ee,Oee=Cee,Tee={Deflate:Aee,deflate:Dee,deflateRaw:kee,gzip:Oee};const lh=16209,Iee=16191;var Pee=function(e,n){let r,i,s,o,a,l,u,c,f,d,h,p,m,g,b,y,x,S,E,C,w,A,_,D;const I=e.state;r=e.next_in,_=e.input,i=r+(e.avail_in-5),s=e.next_out,D=e.output,o=s-(n-e.avail_out),a=s+(e.avail_out-257),l=I.dmax,u=I.wsize,c=I.whave,f=I.wnext,d=I.window,h=I.hold,p=I.bits,m=I.lencode,g=I.distcode,b=(1<>>24,h>>>=S,p-=S,S=x>>>16&255,S===0)D[s++]=x&65535;else if(S&16){E=x&65535,S&=15,S&&(p>>=S,p-=S),p<15&&(h+=_[r++]<>>24,h>>>=S,p-=S,S=x>>>16&255,S&16){if(C=x&65535,S&=15,pl){e.msg="invalid distance too far back",I.mode=lh;break e}if(h>>>=S,p-=S,S=s-o,C>S){if(S=C-S,S>c&&I.sane){e.msg="invalid distance too far back",I.mode=lh;break e}if(w=0,A=d,f===0){if(w+=u-S,S2;)D[s++]=A[w++],D[s++]=A[w++],D[s++]=A[w++],E-=3;E&&(D[s++]=A[w++],E>1&&(D[s++]=A[w++]))}else{w=s-C;do D[s++]=D[w++],D[s++]=D[w++],D[s++]=D[w++],E-=3;while(E>2);E&&(D[s++]=D[w++],E>1&&(D[s++]=D[w++]))}}else if((S&64)===0){x=g[(x&65535)+(h&(1<>3,r-=E,p-=E<<3,h&=(1<{const l=a.bits;let u=0,c=0,f=0,d=0,h=0,p=0,m=0,g=0,b=0,y=0,x,S,E,C,w,A=null,_;const D=new Uint16Array(Va+1),I=new Uint16Array(Va+1);let N=null,P,R,F;for(u=0;u<=Va;u++)D[u]=0;for(c=0;c=1&&D[d]===0;d--);if(h>d&&(h=d),d===0)return i[s++]=1<<24|64<<16|0,i[s++]=1<<24|64<<16|0,a.bits=1,0;for(f=1;f0&&(t===T_||d!==1))return-1;for(I[1]=0,u=1;uk_||t===I_&&b>O_)return 1;for(;;){P=u-m,o[c]+1<_?(R=0,F=o[c]):o[c]>=_?(R=N[o[c]-_],F=A[o[c]-_]):(R=96,F=0),x=1<>m)+S]=P<<24|R<<16|F|0;while(S!==0);for(x=1<>=1;if(x!==0?(y&=x-1,y+=x):y=0,c++,--D[u]===0){if(u===d)break;u=e[n+o[c]]}if(u>h&&(y&C)!==E){for(m===0&&(m=h),w+=f,p=u-m,g=1<k_||t===I_&&b>O_)return 1;E=y&C,i[E]=h<<24|p<<16|w-s|0}}return y!==0&&(i[w+y]=u-m<<24|64<<16|0),a.bits=h,0};var Ec=Lee;const Bee=0,O8=1,T8=2,{Z_FINISH:P_,Z_BLOCK:$ee,Z_TREES:uh,Z_OK:ya,Z_STREAM_END:zee,Z_NEED_DICT:jee,Z_STREAM_ERROR:Kr,Z_DATA_ERROR:I8,Z_MEM_ERROR:P8,Z_BUF_ERROR:Vee,Z_DEFLATED:R_}=td,Mm=16180,N_=16181,M_=16182,F_=16183,L_=16184,B_=16185,$_=16186,z_=16187,j_=16188,V_=16189,g0=16190,es=16191,_1=16192,U_=16193,C1=16194,H_=16195,q_=16196,G_=16197,W_=16198,ch=16199,fh=16200,K_=16201,X_=16202,Y_=16203,J_=16204,Z_=16205,A1=16206,Q_=16207,eC=16208,wt=16209,R8=16210,N8=16211,Uee=852,Hee=592,qee=15,Gee=qee,tC=t=>(t>>>24&255)+(t>>>8&65280)+((t&65280)<<8)+((t&255)<<24);function Wee(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}const Na=t=>{if(!t)return 1;const e=t.state;return!e||e.strm!==t||e.modeN8?1:0},M8=t=>{if(Na(t))return Kr;const e=t.state;return t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=e.wrap&1),e.mode=Mm,e.last=0,e.havedict=0,e.flags=-1,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new Int32Array(Uee),e.distcode=e.distdyn=new Int32Array(Hee),e.sane=1,e.back=-1,ya},F8=t=>{if(Na(t))return Kr;const e=t.state;return e.wsize=0,e.whave=0,e.wnext=0,M8(t)},L8=(t,e)=>{let n;if(Na(t))return Kr;const r=t.state;return e<0?(n=0,e=-e):(n=(e>>4)+5,e<48&&(e&=15)),e&&(e<8||e>15)?Kr:(r.window!==null&&r.wbits!==e&&(r.window=null),r.wrap=n,r.wbits=e,F8(t))},B8=(t,e)=>{if(!t)return Kr;const n=new Wee;t.state=n,n.strm=t,n.window=null,n.mode=Mm;const r=L8(t,e);return r!==ya&&(t.state=null),r},Kee=t=>B8(t,Gee);let nC=!0,D1,k1;const Xee=t=>{if(nC){D1=new Int32Array(512),k1=new Int32Array(32);let e=0;for(;e<144;)t.lens[e++]=8;for(;e<256;)t.lens[e++]=9;for(;e<280;)t.lens[e++]=7;for(;e<288;)t.lens[e++]=8;for(Ec(O8,t.lens,0,288,D1,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;Ec(T8,t.lens,0,32,k1,0,t.work,{bits:5}),nC=!1}t.lencode=D1,t.lenbits=9,t.distcode=k1,t.distbits=5},$8=(t,e,n,r)=>{let i;const s=t.state;return s.window===null&&(s.wsize=1<=s.wsize?(s.window.set(e.subarray(n-s.wsize,n),0),s.wnext=0,s.whave=s.wsize):(i=s.wsize-s.wnext,i>r&&(i=r),s.window.set(e.subarray(n-r,n-r+i),s.wnext),r-=i,r?(s.window.set(e.subarray(n-r,n),0),s.wnext=r,s.whave=s.wsize):(s.wnext+=i,s.wnext===s.wsize&&(s.wnext=0),s.whave{let n,r,i,s,o,a,l,u,c,f,d,h,p,m,g=0,b,y,x,S,E,C,w,A;const _=new Uint8Array(4);let D,I;const N=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(Na(t)||!t.output||!t.input&&t.avail_in!==0)return Kr;n=t.state,n.mode===es&&(n.mode=_1),o=t.next_out,i=t.output,l=t.avail_out,s=t.next_in,r=t.input,a=t.avail_in,u=n.hold,c=n.bits,f=a,d=l,A=ya;e:for(;;)switch(n.mode){case Mm:if(n.wrap===0){n.mode=_1;break}for(;c<16;){if(a===0)break e;a--,u+=r[s++]<>>8&255,n.check=dn(n.check,_,2,0),u=0,c=0,n.mode=N_;break}if(n.head&&(n.head.done=!1),!(n.wrap&1)||(((u&255)<<8)+(u>>8))%31){t.msg="incorrect header check",n.mode=wt;break}if((u&15)!==R_){t.msg="unknown compression method",n.mode=wt;break}if(u>>>=4,c-=4,w=(u&15)+8,n.wbits===0&&(n.wbits=w),w>15||w>n.wbits){t.msg="invalid window size",n.mode=wt;break}n.dmax=1<>8&1),n.flags&512&&n.wrap&4&&(_[0]=u&255,_[1]=u>>>8&255,n.check=dn(n.check,_,2,0)),u=0,c=0,n.mode=M_;case M_:for(;c<32;){if(a===0)break e;a--,u+=r[s++]<>>8&255,_[2]=u>>>16&255,_[3]=u>>>24&255,n.check=dn(n.check,_,4,0)),u=0,c=0,n.mode=F_;case F_:for(;c<16;){if(a===0)break e;a--,u+=r[s++]<>8),n.flags&512&&n.wrap&4&&(_[0]=u&255,_[1]=u>>>8&255,n.check=dn(n.check,_,2,0)),u=0,c=0,n.mode=L_;case L_:if(n.flags&1024){for(;c<16;){if(a===0)break e;a--,u+=r[s++]<>>8&255,n.check=dn(n.check,_,2,0)),u=0,c=0}else n.head&&(n.head.extra=null);n.mode=B_;case B_:if(n.flags&1024&&(h=n.length,h>a&&(h=a),h&&(n.head&&(w=n.head.extra_len-n.length,n.head.extra||(n.head.extra=new Uint8Array(n.head.extra_len)),n.head.extra.set(r.subarray(s,s+h),w)),n.flags&512&&n.wrap&4&&(n.check=dn(n.check,r,h,s)),a-=h,s+=h,n.length-=h),n.length))break e;n.length=0,n.mode=$_;case $_:if(n.flags&2048){if(a===0)break e;h=0;do w=r[s+h++],n.head&&w&&n.length<65536&&(n.head.name+=String.fromCharCode(w));while(w&&h>9&1,n.head.done=!0),t.adler=n.check=0,n.mode=es;break;case V_:for(;c<32;){if(a===0)break e;a--,u+=r[s++]<>>=c&7,c-=c&7,n.mode=A1;break}for(;c<3;){if(a===0)break e;a--,u+=r[s++]<>>=1,c-=1,u&3){case 0:n.mode=U_;break;case 1:if(Xee(n),n.mode=ch,e===uh){u>>>=2,c-=2;break e}break;case 2:n.mode=q_;break;case 3:t.msg="invalid block type",n.mode=wt}u>>>=2,c-=2;break;case U_:for(u>>>=c&7,c-=c&7;c<32;){if(a===0)break e;a--,u+=r[s++]<>>16^65535)){t.msg="invalid stored block lengths",n.mode=wt;break}if(n.length=u&65535,u=0,c=0,n.mode=C1,e===uh)break e;case C1:n.mode=H_;case H_:if(h=n.length,h){if(h>a&&(h=a),h>l&&(h=l),h===0)break e;i.set(r.subarray(s,s+h),o),a-=h,s+=h,l-=h,o+=h,n.length-=h;break}n.mode=es;break;case q_:for(;c<14;){if(a===0)break e;a--,u+=r[s++]<>>=5,c-=5,n.ndist=(u&31)+1,u>>>=5,c-=5,n.ncode=(u&15)+4,u>>>=4,c-=4,n.nlen>286||n.ndist>30){t.msg="too many length or distance symbols",n.mode=wt;break}n.have=0,n.mode=G_;case G_:for(;n.have>>=3,c-=3}for(;n.have<19;)n.lens[N[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,D={bits:n.lenbits},A=Ec(Bee,n.lens,0,19,n.lencode,0,n.work,D),n.lenbits=D.bits,A){t.msg="invalid code lengths set",n.mode=wt;break}n.have=0,n.mode=W_;case W_:for(;n.have>>24,y=g>>>16&255,x=g&65535,!(b<=c);){if(a===0)break e;a--,u+=r[s++]<>>=b,c-=b,n.lens[n.have++]=x;else{if(x===16){for(I=b+2;c>>=b,c-=b,n.have===0){t.msg="invalid bit length repeat",n.mode=wt;break}w=n.lens[n.have-1],h=3+(u&3),u>>>=2,c-=2}else if(x===17){for(I=b+3;c>>=b,c-=b,w=0,h=3+(u&7),u>>>=3,c-=3}else{for(I=b+7;c>>=b,c-=b,w=0,h=11+(u&127),u>>>=7,c-=7}if(n.have+h>n.nlen+n.ndist){t.msg="invalid bit length repeat",n.mode=wt;break}for(;h--;)n.lens[n.have++]=w}}if(n.mode===wt)break;if(n.lens[256]===0){t.msg="invalid code -- missing end-of-block",n.mode=wt;break}if(n.lenbits=9,D={bits:n.lenbits},A=Ec(O8,n.lens,0,n.nlen,n.lencode,0,n.work,D),n.lenbits=D.bits,A){t.msg="invalid literal/lengths set",n.mode=wt;break}if(n.distbits=6,n.distcode=n.distdyn,D={bits:n.distbits},A=Ec(T8,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,D),n.distbits=D.bits,A){t.msg="invalid distances set",n.mode=wt;break}if(n.mode=ch,e===uh)break e;case ch:n.mode=fh;case fh:if(a>=6&&l>=258){t.next_out=o,t.avail_out=l,t.next_in=s,t.avail_in=a,n.hold=u,n.bits=c,Pee(t,d),o=t.next_out,i=t.output,l=t.avail_out,s=t.next_in,r=t.input,a=t.avail_in,u=n.hold,c=n.bits,n.mode===es&&(n.back=-1);break}for(n.back=0;g=n.lencode[u&(1<>>24,y=g>>>16&255,x=g&65535,!(b<=c);){if(a===0)break e;a--,u+=r[s++]<>S)],b=g>>>24,y=g>>>16&255,x=g&65535,!(S+b<=c);){if(a===0)break e;a--,u+=r[s++]<>>=S,c-=S,n.back+=S}if(u>>>=b,c-=b,n.back+=b,n.length=x,y===0){n.mode=Z_;break}if(y&32){n.back=-1,n.mode=es;break}if(y&64){t.msg="invalid literal/length code",n.mode=wt;break}n.extra=y&15,n.mode=K_;case K_:if(n.extra){for(I=n.extra;c>>=n.extra,c-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=X_;case X_:for(;g=n.distcode[u&(1<>>24,y=g>>>16&255,x=g&65535,!(b<=c);){if(a===0)break e;a--,u+=r[s++]<>S)],b=g>>>24,y=g>>>16&255,x=g&65535,!(S+b<=c);){if(a===0)break e;a--,u+=r[s++]<>>=S,c-=S,n.back+=S}if(u>>>=b,c-=b,n.back+=b,y&64){t.msg="invalid distance code",n.mode=wt;break}n.offset=x,n.extra=y&15,n.mode=Y_;case Y_:if(n.extra){for(I=n.extra;c>>=n.extra,c-=n.extra,n.back+=n.extra}if(n.offset>n.dmax){t.msg="invalid distance too far back",n.mode=wt;break}n.mode=J_;case J_:if(l===0)break e;if(h=d-l,n.offset>h){if(h=n.offset-h,h>n.whave&&n.sane){t.msg="invalid distance too far back",n.mode=wt;break}h>n.wnext?(h-=n.wnext,p=n.wsize-h):p=n.wnext-h,h>n.length&&(h=n.length),m=n.window}else m=i,p=o-n.offset,h=n.length;h>l&&(h=l),l-=h,n.length-=h;do i[o++]=m[p++];while(--h);n.length===0&&(n.mode=fh);break;case Z_:if(l===0)break e;i[o++]=n.length,l--,n.mode=fh;break;case A1:if(n.wrap){for(;c<32;){if(a===0)break e;a--,u|=r[s++]<{if(Na(t))return Kr;let e=t.state;return e.window&&(e.window=null),t.state=null,ya},Zee=(t,e)=>{if(Na(t))return Kr;const n=t.state;return(n.wrap&2)===0?Kr:(n.head=e,e.done=!1,ya)},Qee=(t,e)=>{const n=e.length;let r,i,s;return Na(t)||(r=t.state,r.wrap!==0&&r.mode!==g0)?Kr:r.mode===g0&&(i=1,i=mf(i,e,n,0),i!==r.check)?I8:(s=$8(t,e,n,n),s?(r.mode=R8,P8):(r.havedict=1,ya))};var ete=F8,tte=L8,nte=M8,rte=Kee,ite=B8,ste=Yee,ote=Jee,ate=Zee,lte=Qee,ute="pako inflate (from Nodeca project)",as={inflateReset:ete,inflateReset2:tte,inflateResetKeep:nte,inflateInit:rte,inflateInit2:ite,inflate:ste,inflateEnd:ote,inflateGetHeader:ate,inflateSetDictionary:lte,inflateInfo:ute};function cte(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}var fte=cte;const z8=Object.prototype.toString,{Z_NO_FLUSH:dte,Z_FINISH:hte,Z_OK:yf,Z_STREAM_END:O1,Z_NEED_DICT:T1,Z_STREAM_ERROR:pte,Z_DATA_ERROR:rC,Z_MEM_ERROR:mte}=td;function id(t){this.options=Nm.assign({chunkSize:1024*64,windowBits:15,to:""},t||{});const e=this.options;e.raw&&e.windowBits>=0&&e.windowBits<16&&(e.windowBits=-e.windowBits,e.windowBits===0&&(e.windowBits=-15)),e.windowBits>=0&&e.windowBits<16&&!(t&&t.windowBits)&&(e.windowBits+=32),e.windowBits>15&&e.windowBits<48&&(e.windowBits&15)===0&&(e.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new D8,this.strm.avail_out=0;let n=as.inflateInit2(this.strm,e.windowBits);if(n!==yf)throw new Error(ga[n]);if(this.header=new fte,as.inflateGetHeader(this.strm,this.header),e.dictionary&&(typeof e.dictionary=="string"?e.dictionary=bf.string2buf(e.dictionary):z8.call(e.dictionary)==="[object ArrayBuffer]"&&(e.dictionary=new Uint8Array(e.dictionary)),e.raw&&(n=as.inflateSetDictionary(this.strm,e.dictionary),n!==yf)))throw new Error(ga[n])}id.prototype.push=function(t,e){const n=this.strm,r=this.options.chunkSize,i=this.options.dictionary;let s,o,a;if(this.ended)return!1;for(e===~~e?o=e:o=e===!0?hte:dte,z8.call(t)==="[object ArrayBuffer]"?n.input=new Uint8Array(t):n.input=t,n.next_in=0,n.avail_in=n.input.length;;){for(n.avail_out===0&&(n.output=new Uint8Array(r),n.next_out=0,n.avail_out=r),s=as.inflate(n,o),s===T1&&i&&(s=as.inflateSetDictionary(n,i),s===yf?s=as.inflate(n,o):s===rC&&(s=T1));n.avail_in>0&&s===O1&&n.state.wrap>0&&t[n.next_in]!==0;)as.inflateReset(n),s=as.inflate(n,o);switch(s){case pte:case rC:case T1:case mte:return this.onEnd(s),this.ended=!0,!1}if(a=n.avail_out,n.next_out&&(n.avail_out===0||s===O1))if(this.options.to==="string"){let l=bf.utf8border(n.output,n.next_out),u=n.next_out-l,c=bf.buf2string(n.output,l);n.next_out=u,n.avail_out=r-u,u&&n.output.set(n.output.subarray(l,l+u),0),this.onData(c)}else this.onData(n.output.length===n.next_out?n.output:n.output.subarray(0,n.next_out));if(!(s===yf&&a===0)){if(s===O1)return s=as.inflateEnd(this.strm),this.onEnd(s),this.ended=!0,!0;if(n.avail_in===0)break}}return!0};id.prototype.onData=function(t){this.chunks.push(t)};id.prototype.onEnd=function(t){t===yf&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=Nm.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};function V2(t,e){const n=new id(e);if(n.push(t),n.err)throw n.msg||ga[n.err];return n.result}function gte(t,e){return e=e||{},e.raw=!0,V2(t,e)}var bte=id,yte=V2,vte=gte,xte=V2,Ste={Inflate:bte,inflate:yte,inflateRaw:vte,ungzip:xte};const{Deflate:Ete,deflate:wte,deflateRaw:_te,gzip:Cte}=Tee,{Inflate:Ate,inflate:Dte,inflateRaw:kte,ungzip:Ote}=Ste;var Tte=Ete,Ite=wte,Pte=_te,Rte=Cte,Nte=Ate,Mte=Dte,Fte=kte,Lte=Ote,Bte=td,$te={Deflate:Tte,deflate:Ite,deflateRaw:Pte,gzip:Rte,Inflate:Nte,inflate:Mte,inflateRaw:Fte,ungzip:Lte,constants:Bte};function zte(t,e,n,r){const i={method:t.method,endpoint:t.endpoint,headers:t.headers.map(u=>({key:u.key,value:u.value})),queryParameters:t.queryParameters.map(u=>({key:u.key,value:u.value,type:u.type})),body:t.body,payloadType:t.payloadType,authorization:{type:t.authorization.type,value:t.authorization.value},applicationKey:r};e&&(i.response={status:e.status,statusCode:e.statusCode,statusText:e.statusText,body:e.body,sizeInBytes:e.sizeInBytes,headers:e.headers.map(u=>({key:u.key,value:u.value})),cookies:e.cookies.map(u=>({key:u.key,value:u.value})),timestamp:e.timestamp,durationInMs:(n==null?void 0:n.durationInMs)??0}),n&&(i.requestLog=n);const s=JSON.stringify(i),o=$te.deflate(s);return btoa(String.fromCharCode.apply(null,Array.from(o))).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}function jte(t,e){const n=window.location.origin,r=t.startsWith("/")?t:`/${t}`;return`${n}${r}?share=${e}`}const Vte={class:"flex min-h-0 flex-1 flex-col space-y-2.5"},Ute={key:0,class:"bg-warning/10 dark:bg-warning/20 rounded-md p-2.5"},Hte={class:"flex min-h-0 flex-1 flex-col space-y-2.5"},qte={class:"flex items-center justify-end"},Gte={class:"bg-subtle text-foreground h-full min-h-0 flex-1 overflow-auto rounded-md border p-2.5 font-mono text-xs leading-relaxed break-all whitespace-break-spaces"},Wte={class:"flex justify-end border-t pt-2.5"},Kte=z({__name:"CurlExportDialog",props:{open:{type:Boolean},command:{},hasSpecialAuth:{type:Boolean}},emits:["update:open"],setup(t,{emit:e}){const n=t,r=e,{copy:i,copied:s}=_o(),o=()=>{i(n.command)},a=()=>{r("update:open",!1)};return(l,u)=>(T(),L(v(Cf),{open:t.open,"onUpdate:open":u[0]||(u[0]=c=>r("update:open",c))},{default:O(()=>[k(v(Af),{class:"flex max-h-[90vh] max-w-2xl flex-col overflow-hidden sm:max-w-2xl"},{default:O(()=>[k(v(Df),null,{default:O(()=>[k(v(kf),null,{default:O(()=>[...u[1]||(u[1]=[ne("cURL Command",-1)])]),_:1}),k(v(R0),null,{default:O(()=>[...u[2]||(u[2]=[ne(" Copy the generated cURL command to use in your terminal or scripts. ",-1)])]),_:1})]),_:1}),M("div",Vte,[t.hasSpecialAuth?(T(),K("div",Ute,[...u[3]||(u[3]=[M("p",{class:"text-warning text-xs"}," Authorization has been dropped as special authorization types (Current User, Impersonate) are not supported in cURL commands. ",-1)])])):we("",!0),M("div",Hte,[M("div",qte,[k(v(gt),{variant:"outline",size:"sm",class:"flex items-center gap-2",onClick:o},{default:O(()=>[v(s)?(T(),L(v(ZC),{key:0,class:"h-4 w-4"})):(T(),L(v(QC),{key:1,class:"h-4 w-4"})),ne(" "+de(v(s)?"Copied!":"Copy"),1)]),_:1})]),M("pre",Gte,de(t.command),1)])]),M("div",Wte,[k(v(gt),{variant:"outline",onClick:a},{default:O(()=>[...u[4]||(u[4]=[ne("Close",-1)])]),_:1})])]),_:1})]),_:1},8,["open"]))}}),Xte={class:"flex flex-1 flex-col space-y-4 overflow-hidden"},Yte={class:"flex min-h-0 flex-1 flex-col space-y-3"},Jte={class:"mb-2 flex items-center justify-between"},Zte={class:"bg-subtle-background text-foreground flex-1 overflow-auto rounded-md border p-4 font-mono text-sm leading-relaxed break-all whitespace-break-spaces","data-testid":"shareable-link-content"},Qte={class:"flex justify-end border-t pt-4 dark:border-gray-700"},ene=z({__name:"ShareableLinkDialog",props:{open:{type:Boolean},link:{}},emits:["update:open"],setup(t,{emit:e}){const n=t,r=e,{copy:i,copied:s}=_o(),o=()=>{i(n.link)},a=()=>{r("update:open",!1)};return(l,u)=>(T(),L(v(Cf),{open:t.open,"onUpdate:open":u[0]||(u[0]=c=>r("update:open",c))},{default:O(()=>[k(v(Af),{class:"flex max-h-[90vh] max-w-2xl flex-col overflow-hidden sm:max-w-2xl"},{default:O(()=>[k(v(Df),null,{default:O(()=>[k(v(kf),{class:"flex items-center gap-2"},{default:O(()=>[k(v(IA),{class:"size-5"}),u[1]||(u[1]=ne(" Shareable Link ",-1))]),_:1}),k(v(R0),null,{default:O(()=>[...u[2]||(u[2]=[ne(" Share this link with your teammates to restore the exact request state and response. ",-1)])]),_:1})]),_:1}),M("div",Xte,[u[4]||(u[4]=M("div",{class:"rounded-md bg-indigo-50 p-3 dark:bg-indigo-900/20"},[M("p",{class:"text-sm text-indigo-800 dark:text-indigo-200"}," This link contains the full request configuration and the latest response. Anyone with this link can restore the exact state in their Nimbus instance. ")],-1)),M("div",Yte,[M("div",Jte,[u[3]||(u[3]=M("h4",{class:"text-sm font-medium text-gray-700 dark:text-gray-300"}," Link ",-1)),k(v(gt),{variant:"outline",size:"sm",class:"flex items-center gap-2",onClick:o},{default:O(()=>[v(s)?(T(),L(v(ZC),{key:0,class:"h-4 w-4"})):(T(),L(v(QC),{key:1,class:"h-4 w-4"})),ne(" "+de(v(s)?"Copied!":"Copy"),1)]),_:1})]),M("pre",Zte,de(t.link),1)])]),M("div",Qte,[k(v(gt),{variant:"outline",onClick:a},{default:O(()=>[...u[5]||(u[5]=[ne("Close",-1)])]),_:1})])]),_:1})]),_:1},8,["open"]))}}),tne={class:"flex w-full items-center justify-between"},nne={class:"flex items-center gap-1.5 font-normal"},rne=z({__name:"RequestBuilderOptionsMenu",setup(t){const e=Rr(),n=Xi(),r=q0(),i=Z(!1),s=Z(""),o=Z(!1),a=Z(!1),l=Z(""),u=q(()=>e.pendingRequestData),c=q({get:()=>{var h;return((h=u.value)==null?void 0:h.transactionMode)??!1},set:h=>e.updateTransactionMode(h)}),f=()=>{if(!e.pendingRequestData)return;const h=iM(e.pendingRequestData,n.apiUrl);s.value=h.command,o.value=h.hasSpecialAuth,i.value=!0},d=()=>{if(e.pendingRequestData)try{const h=r.lastLog,p=h==null?void 0:h.response,m=n.activeApplication??void 0,g=zte(e.pendingRequestData,p,h??void 0,m);l.value=jte(n.appBasePath,g),a.value=!0}catch(h){console.error("Failed to generate shareable link:",h),Sh.error("Failed to generate shareable link",{description:"An unexpected error occurred."})}};return(h,p)=>(T(),K(Qe,null,[k(v(r8),null,{default:O(()=>[k(v(s8),{"as-child":""},{default:O(()=>[k(v(gt),{variant:"outline",size:"xs",disabled:!u.value,"data-testid":"request-options-button",title:"Request Options"},{default:O(()=>[k(v(Xy),{class:"size-4"})]),_:1},8,["disabled"])]),_:1}),k(v(i8),{align:"end",class:"w-48"},{default:O(()=>[k(v(b_),null,{default:O(()=>[...p[6]||(p[6]=[ne("Options",-1)])]),_:1}),k(v(g_),null,{default:O(()=>[k(v(Gh),{class:"cursor-pointer text-xs","data-testid":"transaction-mode-option",onSelect:p[3]||(p[3]=eo(()=>{},["prevent"]))},{default:O(()=>[M("div",tne,[M("div",nne,[p[8]||(p[8]=M("span",null,"Transaction Mode",-1)),k(v(DP),null,{default:O(()=>[k(v(kP),{ref:"transaction-mode-option","as-child":"",onClick:p[0]||(p[0]=eo(()=>{},["stop","prevent"]))},{default:O(()=>[k(v(gN),{class:"h-3.5 w-3.5 cursor-help text-zinc-500 hover:text-zinc-700 dark:text-zinc-400 dark:hover:text-zinc-200"})]),_:1},512),k(v(OP),{class:"w-80",side:"right","side-offset":5},{default:O(()=>[...p[7]||(p[7]=[M("div",{class:"space-y-2"},[M("h4",{class:"text-sm leading-none font-medium"}," Transaction Mode "),M("p",{class:"text-muted-foreground text-xs leading-relaxed"}," Executes the request within a database transaction that is automatically rolled back after completion. This allows you to test operations without affecting your persistent data. ")],-1)])]),_:1})]),_:1})]),k(v(HA),{modelValue:c.value,"onUpdate:modelValue":p[1]||(p[1]=m=>c.value=m),variant:{type:"compact",default:"default"},class:"ml-2",onClick:p[2]||(p[2]=eo(()=>{},["stop"]))},null,8,["modelValue"])])]),_:1})]),_:1}),k(v(wy)),k(v(b_),null,{default:O(()=>[...p[9]||(p[9]=[ne("Export",-1)])]),_:1}),k(v(g_),null,{default:O(()=>[k(v(Gh),{class:"cursor-pointer text-xs","data-testid":"export-curl-option",onSelect:f},{default:O(()=>[k(v(yN),{class:"mr-2 size-4"}),p[10]||(p[10]=M("span",null,"Export to cURL",-1))]),_:1}),k(v(Gh),{class:"cursor-pointer text-xs","data-testid":"copy-shareable-link-option",onSelect:d},{default:O(()=>[k(v(IA),{class:"mr-2 size-4"}),p[11]||(p[11]=M("span",null,"Copy Shareable Link",-1))]),_:1})]),_:1})]),_:1})]),_:1}),k(Kte,{open:i.value,"onUpdate:open":p[4]||(p[4]=m=>i.value=m),command:s.value,"has-special-auth":o.value},null,8,["open","command","has-special-auth"]),k(ene,{open:a.value,"onUpdate:open":p[5]||(p[5]=m=>a.value=m),link:l.value},null,8,["open","link"])],64))}}),ine=z({__name:"RequestBuilderEndpoint",props:{class:{}},setup(t){const e=t;return(n,r)=>(T(),K("div",{class:Se(v(ke)("flex",e.class)),"data-testid":"request-builder-endpoint"},[k(UZ),k(VZ,null,{"options-menu":O(()=>[k(rne)]),_:1})],2))}}),sne={class:"px-panel bg-subtle flex border-b py-2 text-xs"},one={class:"flex-1"},ane={key:0},lne={key:1,class:"text-subtle-foreground"},une=z({__name:"RequestParameters",setup(t){const e=Rr(),{copy:n,copied:r}=_o(),i=q(()=>e.pendingRequestData),s=q(()=>{var u;return((u=i.value)==null?void 0:u.queryParameters)??[]}),o=q(()=>i.value?e.getRequestUrl(i.value):""),a=u=>{e.updateQueryParameters(u)},l=()=>n(o.value);return(u,c)=>(T(),K(Qe,null,[k(Oa,{class:"border-b"},{default:O(()=>[...c[0]||(c[0]=[ne("Query Parameters",-1)])]),_:1}),M("div",sne,[M("div",one,[c[1]||(c[1]=M("small",{class:"font-medium"},"URL Preview",-1)),o.value.length?(T(),K("p",ane,de(o.value),1)):(T(),K("p",lne,"Pick an endpoint to start"))]),M("div",null,[k(nu,{"on-click":l,copied:v(r)},null,8,["copied"])])]),k(cv,{"model-value":s.value,class:"flex-1","onUpdate:parameters":a},null,8,["model-value"])],64))}}),cne={class:"relative flex h-full max-h-full flex-1 flex-col","data-testid":"request-builder-root"},fne={class:"bg-subtle border-b"},dne={class:"relative"},hne={class:"from-subtle via-subtle/80 pointer-events-none absolute top-0 bottom-0 left-0 w-8 bg-gradient-to-r to-transparent transition-opacity duration-200"},pne={class:"from-subtle via-subtle/80 pointer-events-none absolute top-0 right-0 bottom-0 w-8 bg-gradient-to-l to-transparent transition-opacity duration-200"},mne=z({__name:"RequestBuilder",setup(t){const e=Cl(Tf("request-builder-tab"),"body"),{scrollContainer:n,showLeftMask:r,showRightMask:i,updateScrollMasks:s,scrollTabIntoView:o}=HC(),a=l=>{o(l.currentTarget)};return(l,u)=>(T(),K("div",cne,[k(v(ine),{class:"h-toolbar border-b"}),k(v(VA),{"default-value":v(e),class:"mt-0 flex flex-1 flex-col overflow-hidden","data-testid":"app-tabs-container","onUpdate:modelValue":u[1]||(u[1]=c=>e.value=c)},{default:O(()=>[M("div",fne,[M("div",dne,[M("div",{ref_key:"scrollContainer",ref:n,class:"scrollbar-hide overflow-x-auto",style:{"scrollbar-width":"none","-ms-overflow-style":"none"},onScroll:u[0]||(u[0]=(...c)=>v(s)&&v(s)(...c))},[k(v(UA),{class:"h-toolbar px-panel rounded-none"},{default:O(()=>[k(v(Uo),{value:"parameters",label:"Parameters",onClick:a}),k(v(Uo),{value:"body",label:"Body",onClick:a}),k(v(Uo),{value:"authorization",label:"Authorization",onClick:a}),k(v(Uo),{value:"headers",label:"Headers",onClick:a})]),_:1})],544),la(M("div",hne,null,512),[[Al,v(r)]]),la(M("div",pne,null,512),[[Al,v(i)]])])]),k(v(Vo),{value:"parameters",class:"mt-0 flex max-h-full min-h-0 flex-1 flex-col","data-testid":"request-parameters"},{default:O(()=>[k(v(une))]),_:1}),k(v(Vo),{value:"body",class:"mt-0 flex max-h-full min-h-0 flex-1 flex-col","data-testid":"request-body"},{default:O(()=>[k(v(RZ))]),_:1}),k(v(Vo),{value:"authorization",class:"mt-0 flex max-h-full min-h-0 flex-1 flex-col","data-testid":"request-authorization"},{default:O(()=>[k(v(sF))]),_:1}),k(v(Vo),{value:"headers",class:"mt-0 flex max-h-full min-h-0 flex-1 flex-col","data-testid":"request-headers"},{default:O(()=>[k(v(zM))]),_:1})]),_:1},8,["default-value"])]))}}),gne=z({__name:"AppInputGroup",props:{class:{}},setup(t){const e=t;return(n,r)=>(T(),K("div",{"data-slot":"input-group",role:"group",class:Se(v(ke)("group/input-group relative flex w-full items-center rounded-sm border border-zinc-200 outline-none dark:border-zinc-800 dark:bg-zinc-200/30 dark:dark:bg-zinc-800/30","h-9 min-w-0 has-[>textarea]:h-auto","has-[>[data-align=inline-start]]:[&>input]:pl-2","has-[>[data-align=inline-end]]:[&>input]:pr-2","has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>[data-align=block-start]]:[&>input]:pb-3","has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-end]]:[&>input]:pt-3","has-[[data-slot=input-group-control]:focus-visible]:ring-1 has-[[data-slot=input-group-control]:focus-visible]:ring-zinc-950 dark:has-[[data-slot=input-group-control]:focus-visible]:ring-zinc-300",e.class))},[Q(n.$slots,"default")],2))}}),bne=["data-align"],yne=z({__name:"AppInputGroupAddon",props:{align:{default:"inline-start"},class:{default:void 0}},setup(t){const e=t;function n(r){var o,a;const i=r.currentTarget,s=r.target;s&&s.closest("button")||i&&(i!=null&&i.parentElement)&&((a=(o=i.parentElement)==null?void 0:o.querySelector("input"))==null||a.focus())}return(r,i)=>(T(),K("div",{role:"group","data-slot":"input-group-addon","data-align":e.align,class:Se(v(ke)(v(xne)({align:e.align}),e.class)),onClick:n},[Q(r.$slots,"default")],10,bne))}}),vne=z({__name:"AppInputGroupInput",props:{class:{}},setup(t,{expose:e}){const n=t,r=Z(null);return e({focus:()=>{var s;const i=(s=r.value)==null?void 0:s.$el;i==null||i.focus()}}),(i,s)=>(T(),L(v(ws),{ref_key:"inputRef",ref:r,"data-slot":"input-group-control",class:Se(v(ke)("flex-1 rounded-none border-0 bg-transparent shadow-none ring-offset-transparent focus-visible:ring-0 focus-visible:ring-transparent dark:bg-transparent",n.class))},null,8,["class"]))}}),xne=jC("text-zinc-500 flex h-auto cursor-text items-center justify-center gap-2 py-1.5 text-sm font-medium select-none [&>svg:not([class*='size-'])]:size-4 [&>kbd]:rounded-[calc(var(--radius)-5px)] group-data-[disabled=true]/input-group:opacity-50 dark:text-zinc-400",{variants:{align:{"inline-start":"order-first pl-3 has-[>button]:ml-[-0.45rem] has-[>kbd]:ml-[-0.35rem]","inline-end":"order-last pr-3 has-[>button]:mr-[-0.45rem] has-[>kbd]:mr-[-0.35rem]","block-start":"order-first w-full justify-start px-3 pt-3 [.border-b]:pb-3 group-has-[>input]/input-group:pt-2.5","block-end":"order-last w-full justify-start px-3 pb-3 [.border-t]:pt-3 group-has-[>input]/input-group:pb-2.5"}},defaultVariants:{align:"inline-start"}}),Sne=z({__name:"AppScrollBar",props:{class:{default:void 0},orientation:{default:"vertical"},forceMount:{type:Boolean},asChild:{type:Boolean},as:{}},setup(t){const e=t,n=Aa(e,"class");return(r,i)=>(T(),L(v(iR),Ce({"data-slot":"scroll-area-scrollbar"},v(n),{class:v(ke)("flex touch-none p-px transition-colors select-none",t.orientation==="vertical"&&"h-full w-2.5 border-l border-l-transparent",t.orientation==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent",e.class)}),{default:O(()=>[k(v(uR),{"data-slot":"scroll-area-thumb",class:"relative flex-1 rounded-full bg-gray-400 dark:bg-gray-600"})]),_:1},16,["class"]))}}),Ene=z({__name:"AppScrollArea",props:{class:{},type:{},dir:{},scrollHideDelay:{},asChild:{type:Boolean},as:{}},setup(t){const e=t,n=Aa(e,"class");return(r,i)=>(T(),L(v(z5),Ce({"data-slot":"scroll-area"},v(n),{class:v(ke)("relative",e.class)}),{default:O(()=>[k(v(fR),{"data-slot":"scroll-area-viewport",class:"focus-visible:ring-ring/50 size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:outline-1 [&>div]:h-full"},{default:O(()=>[Q(r.$slots,"default")]),_:3}),k(Sne),k(v(H5))]),_:3},16,["class"]))}}),wne=z({__name:"AppSpinner",props:{class:{}},setup(t){const e=t;return(n,r)=>(T(),K("svg",{class:Se(v(ke)("size-4 text-zinc-900",e.class)),xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},[...r[0]||(r[0]=[M("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"},null,-1),M("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"},null,-1)])],2))}}),Kh=z({__name:"AppRoundIndicator",props:{class:{}},setup(t){const e=t;return(n,r)=>(T(),K("div",{class:Se(v(ke)(e.class,"bg-background relative z-10 flex size-[12px] items-center justify-center rounded-full"))},[...r[0]||(r[0]=[M("div",{class:"size-[8px] rounded-full border-[1px] border-[currentColor] bg-[radial-gradient(circle_at_bottom,currentColor_75%,rgb(255,255,255)_100%)]"},null,-1),M("div",{class:"absolute z-[-1] size-[5px] rounded-full opacity-40 shadow-[5px_0_5px_currentColor,-5px_0_5px_currentColor]"},null,-1)])],2))}}),j8=z({__name:"StatusIndicator",props:{status:{}},setup(t){const e=t,n={[xt.INFORMATION]:"text-zinc-500",[xt.SUCCESS]:"text-emerald-600",[xt.REDIRECT]:"text-blue-500",[xt.CLIENT_ERROR]:"text-amber-500",[xt.SERVER_ERROR]:"text-rose-500",[xt.OTHER]:"text-zinc-500",[xt.EMPTY]:"text-zinc-900",[xt.DUMP_AND_DIE]:"text-violet-600",[xt.PENDING]:""},r=q(()=>n[e.status]);return(i,s)=>e.status===v(xt).PENDING?(T(),L(wne,{key:0,"data-testid":"pending-request-spinner",class:"text-accent-foreground size-4 animate-spin"})):(T(),L(Kh,{key:1,class:Se(r.value)},null,8,["class"]))}}),Fm=z({__name:"HttpVerbLabel",props:{method:{},size:{default:"sm"},variant:{default:"outline"}},setup(t){const e=t,n=q(()=>({POST:"text-success",PUT:"text-success",DELETE:"text-destructive"})[e.method]??null),r=q(()=>({sm:"min-w-[50px] text-xxs",md:"min-w-[60px] text-xs",lg:"min-w-[70px] text-sm"})[e.size]);return(i,s)=>(T(),L(v(fo),{variant:t.variant,class:Se(v(ke)("justify-center",r.value))},{default:O(()=>[M("span",{class:Se(n.value)},de(t.method),3)]),_:1},8,["variant","class"]))}}),_ne=["B","kB","MB","GB","TB","PB","EB","ZB","YB"],Cne=["B","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"],Ane=["b","kbit","Mbit","Gbit","Tbit","Pbit","Ebit","Zbit","Ybit"],Dne=["b","kibit","Mibit","Gibit","Tibit","Pibit","Eibit","Zibit","Yibit"],iC=(t,e,n)=>{let r=t;return typeof e=="string"||Array.isArray(e)?r=t.toLocaleString(e,n):(e===!0||n!==void 0)&&(r=t.toLocaleString(void 0,n)),r},V8=t=>{if(typeof t=="number")return Math.log10(t);const e=t.toString(10);return e.length+Math.log10(`0.${e.slice(0,15)}`)},kne=t=>typeof t=="number"?Math.log(t):V8(t)*Math.log(10),One=(t,e)=>{if(typeof t=="number")return t/e;const n=t/BigInt(e),r=t%BigInt(e);return Number(n)+Number(r)/e},sC=(t,e)=>{if(e===void 0)return t;if(typeof e!="number"||!Number.isSafeInteger(e)||e<0)throw new TypeError(`Expected fixedWidth to be a non-negative integer, got ${typeof e}: ${e}`);return e===0?t:t.length{const{minimumFractionDigits:e,maximumFractionDigits:n}=t;if(!(e===void 0&&n===void 0))return{...e!==void 0&&{minimumFractionDigits:e},...n!==void 0&&{maximumFractionDigits:n},roundingMode:"trunc"}};function U8(t,e){if(typeof t!="bigint"&&!Number.isFinite(t))throw new TypeError(`Expected a finite number, got ${typeof t}: ${t}`);e={bits:!1,binary:!1,space:!0,nonBreakingSpace:!1,...e};const n=e.bits?e.binary?Dne:Ane:e.binary?Cne:_ne,r=e.space?e.nonBreakingSpace?" ":" ":"",i=typeof t=="number"?t===0:t===0n;if(e.signed&&i){const u=` 0${r}${n[0]}`;return sC(u,e.fixedWidth)}const s=t<0,o=s?"-":e.signed?"+":"";s&&(t=-t);const a=Tne(e);let l;if(t<1){const u=iC(t,e.locale,a);l=o+u+r+n[0]}else{const u=Math.min(Math.floor(e.binary?kne(t)/Math.log(1024):V8(t)/3),n.length-1);if(t=One(t,(e.binary?1024:1e3)**u),!a){const d=Math.max(3,Math.floor(t).toString().length);t=t.toPrecision(d)}const c=iC(Number(t),e.locale,a),f=n[u];l=o+c+r+f}return sC(l,e.fixedWidth)}const oC=t=>Number.isFinite(t)?t:0;function Ine(t){return{days:Math.trunc(t/864e5),hours:Math.trunc(t/36e5%24),minutes:Math.trunc(t/6e4%60),seconds:Math.trunc(t/1e3%60),milliseconds:Math.trunc(t%1e3),microseconds:Math.trunc(oC(t*1e3)%1e3),nanoseconds:Math.trunc(oC(t*1e6)%1e3)}}function Pne(t){return{days:t/86400000n,hours:t/3600000n%24n,minutes:t/60000n%60n,seconds:t/1000n%60n,milliseconds:t%1000n,microseconds:0n,nanoseconds:0n}}function Rne(t){switch(typeof t){case"number":{if(Number.isFinite(t))return Ine(t);break}case"bigint":return Pne(t)}throw new TypeError("Expected a finite number or bigint")}const Nne=t=>t===0||t===0n,Mne=(t,e)=>e===1||e===1n?t:`${t}s`,Fne=1e-7,Lne=24n*60n*60n*1000n;function H8(t,e){const n=typeof t=="bigint";if(!n&&!Number.isFinite(t))throw new TypeError("Expected a finite number or bigint");e={...e};const r=t<0?"-":"";t=t<0?-t:t,e.colonNotation&&(e.compact=!1,e.formatSubMilliseconds=!1,e.separateMilliseconds=!1,e.verbose=!1),e.compact&&(e.unitCount=1,e.secondsDecimalDigits=0,e.millisecondsDecimalDigits=0);let i=[];const s=(c,f)=>{const d=Math.floor(c*10**f+Fne);return(Math.round(d)/10**f).toFixed(f)},o=(c,f,d,h)=>{if(!((i.length===0||!e.colonNotation)&&Nne(c)&&!(e.colonNotation&&d==="m"))){if(h??(h=String(c)),e.colonNotation){const p=h.includes(".")?h.split(".")[0].length:h.length,m=i.length>0?2:1;h="0".repeat(Math.max(0,m-p))+h}else h+=e.verbose?" "+Mne(f,c):d;i.push(h)}},a=Rne(t),l=BigInt(a.days);if(e.hideYearAndDays?o(BigInt(l)*24n+BigInt(a.hours),"hour","h"):(e.hideYear?o(l,"day","d"):(o(l/365n,"year","y"),o(l%365n,"day","d")),o(Number(a.hours),"hour","h")),o(Number(a.minutes),"minute","m"),!e.hideSeconds)if(e.separateMilliseconds||e.formatSubMilliseconds||!e.colonNotation&&t<1e3&&!e.subSecondsAsDecimals){const c=Number(a.seconds),f=Number(a.milliseconds),d=Number(a.microseconds),h=Number(a.nanoseconds);if(o(c,"second","s"),e.formatSubMilliseconds)o(f,"millisecond","ms"),o(d,"microsecond","µs"),o(h,"nanosecond","ns");else{const p=f+d/1e3+h/1e6,m=typeof e.millisecondsDecimalDigits=="number"?e.millisecondsDecimalDigits:0,g=p>=1?Math.round(p):Math.ceil(p),b=m?p.toFixed(m):g;o(Number.parseFloat(b),"millisecond","ms",b)}}else{const c=(n?Number(t%Lne):t)/1e3%60,f=typeof e.secondsDecimalDigits=="number"?e.secondsDecimalDigits:1,d=s(c,f),h=e.keepDecimalsOnWholeSeconds?d:d.replace(/\.0+$/,"");o(Number.parseFloat(h),"second","s",h)}if(i.length===0)return r+"0"+(e.verbose?" milliseconds":"ms");const u=e.colonNotation?":":" ";return typeof e.unitCount=="number"&&(i=i.slice(0,Math.max(e.unitCount,1))),r+i.join(u)}const Bne={class:"flex w-full gap-2"},$ne={class:"flex flex-1 flex-col gap-2"},zne=["title"],jne={class:"flex-1 truncate"},Vne={class:"ml-1 text-xs","data-testid":"history-item-endpoint"},Une={class:"text-xxs flex min-w-0 flex-1 items-center gap-2"},Hne={class:"text-nowrap","data-testid":"response-status-badge"},qne={class:"flex w-full items-center justify-between"},Gne={class:"text-subtle-foreground whitespace-nowrap"},Wne={key:0,class:"text-subtle-foreground text-xxs whitespace-nowrap"},Kne={class:"text-subtle-foreground text-xxs whitespace-nowrap"},Xne=z({__name:"HistoryItem",props:{log:{},index:{}},emits:["select"],setup(t,{emit:e}){const n=t,r=e,i=s=>qC(new Date(s*1e3)).value;return(s,o)=>(T(),L(v(Gh),{class:"p-panel p-panel flex cursor-pointer flex-col items-start transition-colors",onSelect:o[0]||(o[0]=a=>r("select",n.index))},{default:O(()=>[M("div",Bne,[M("div",$ne,[M("div",{class:"flex w-full justify-between gap-1 leading-tight",title:n.log.request.endpoint},[M("div",jne,[k(Fm,{method:n.log.request.method,"data-testid":"history-item-method"},null,8,["method"]),M("span",Vne,de(n.log.request.endpoint),1)]),k(j8,{status:n.log.response.status??v(xt).EMPTY,"data-testid":"history-item-status"},null,8,["status"])],8,zne),M("div",Une,[M("span",Hne,de(n.log.response.statusCode)+" - "+de(n.log.response.statusText),1),o[1]||(o[1]=M("div",{class:"border-border w-8 border-b"},null,-1)),M("div",qne,[M("div",null,[M("span",Gne,de(v(H8)(n.log.durationInMs,{compact:!0})),1),n.log.response?(T(),K("span",Wne,"  / "+de(v(U8)(n.log.response.sizeInBytes)),1)):we("",!0)]),M("small",Kne,de(i(n.log.response.timestamp)),1)])])])])]),_:1}))}}),Yne=["title"],Jne={class:"px-panel my-2 flex gap-2"},Zne={key:1,class:"text-subtle-foreground flex flex-col items-center justify-center gap-2 py-8 text-center text-sm","data-testid":"history-empty-state"},Qne=z({__name:"RequestHistory",setup(t){const e=Rr(),n=q0(),r=Z(!1),i=Z(""),s=Z(null),o=Z(!1),a=Z(null),l=q(()=>n.lastLog),u=y=>qC(new Date(y*1e3)).value,c=q(()=>{var y;return((y=l.value)==null?void 0:y.response)===void 0?"":u(l.value.response.timestamp)}),f=q(()=>{var x;return((x=l.value)==null?void 0:x.response)===void 0?"":new Date(l.value.response.timestamp*1e3).toLocaleString("en-US",{year:"numeric",month:"long",day:"numeric",hour:"2-digit",minute:"2-digit"})}),d=y=>{const x=n.allLogs[y];x&&(n.setActiveLog(y),e.restoreFromHistory(x))},h=q(()=>[...n.allLogs].filter(y=>y.response!==void 0).reverse()),p=q(()=>{if(!i.value.trim())return h.value;const y=i.value.toLowerCase();return h.value.filter(x=>x.request.endpoint.toLowerCase().includes(y))}),m=y=>{const x=n.allLogs.filter(E=>E.response!==void 0),S=x[x.length-1-y];return n.allLogs.indexOf(S)},g=()=>{o.value=!1,a.value&&(window.clearTimeout(a.value),a.value=null)},b=()=>{if(o.value){n.clearLogs(),g(),r.value=!1;return}o.value=!0,a.value&&window.clearTimeout(a.value),a.value=window.setTimeout(()=>{g()},1e3)};return at(r,async y=>{var x;y?(await kr(),(x=s.value)==null||x.focus()):i.value=""}),(y,x)=>h.value.length?(T(),L(v(r8),{key:0,open:r.value,"onUpdate:open":x[1]||(x[1]=S=>r.value=S)},{default:O(()=>[k(v(s8),{"as-child":""},{default:O(()=>[k(v(gt),{variant:"ghost",size:"xs",class:"rounded px-1 transition-colors hover:bg-zinc-100 focus:outline-none focus-visible:ring-0 dark:hover:bg-zinc-800 dark:focus-visible:ring-0","data-testid":"response-history-trigger"},{default:O(()=>[M("small",{class:"text-subtle-foreground text-xs",title:f.value},de(c.value),9,Yne),k(v(AN),{class:"size-3"})]),_:1})]),_:1}),k(v(i8),{align:"end",class:"w-sm p-0"},{default:O(()=>[k(v(Ene),{class:"max-h-96 overflow-y-auto"},{default:O(()=>[M("div",Jne,[k(v(gt),{variant:"outline",size:"xs",class:Se(["h-sub-toolbar justify-start shadow-none transition-colors",v(ke)(o.value&&"text-rose-500 hover:text-rose-600 dark:text-rose-400 dark:hover:text-rose-300")]),"data-testid":"clear-history-button",onClick:b},{default:O(()=>[k(v(up),{class:"size-3"}),x[2]||(x[2]=ne(" Clear History ",-1))]),_:1},8,["class"]),k(v(gne),{class:"h-sub-toolbar"},{default:O(()=>[k(v(vne),{ref_key:"searchInputRef",ref:s,modelValue:i.value,"onUpdate:modelValue":x[0]||(x[0]=S=>i.value=S),placeholder:"Type to search","data-testid":"history-search-input"},null,8,["modelValue"]),k(v(yne),null,{default:O(()=>[k(v(kx),{class:"size-3"})]),_:1})]),_:1})]),k(v(wy)),p.value.length?(T(!0),K(Qe,{key:0},_n(p.value,(S,E)=>(T(),K(Qe,{key:S.request.endpoint+S.response.timestamp},[k(Xne,{log:S,index:m(h.value.indexOf(S)),"data-testid":"history-item","data-endpoint":S.request.endpoint,"data-method":S.request.method,onSelect:d},null,8,["log","index","data-endpoint","data-method"]),E(T(),K("div",ere,[k(j8,{status:e.status,"data-testid":"response-status-indicator"},null,8,["status"]),M("span",tre,de(e.status),1),e.response&&e.status!==v(xt).DUMP_AND_DIE?(T(),L(v(fo),{key:0,variant:"outline",class:"text-nowrap","data-testid":"response-status-badge"},{default:O(()=>[ne(de(e.response.statusCode)+" - "+de(e.response.statusText),1)]),_:1})):e.status===v(xt).PENDING?(T(),L(v(fo),{key:1,variant:"outline",class:"text-nowrap"},{default:O(()=>[...r[0]||(r[0]=[ne(" - ",-1)])]),_:1})):we("",!0)]))}}),rre={class:"relative flex h-full flex-1 items-center justify-between p-2"},ire={class:"flex w-full items-center justify-between gap-1"},sre={class:"flex items-center space-x-2"},ore={class:"text-xs"},are={"data-testid":"response-status-duration"},lre={"data-testid":"response-status-size"},ure={key:0,class:"flex items-center"},cre={key:0},fre={class:"flex h-full items-center gap-1 rounded-none border-indigo-500/50 bg-indigo-500/5 p-3.5 text-xs text-indigo-600 dark:text-indigo-400","data-testid":"imported-badge"},dre=z({__name:"ResponseStatus",props:{class:{},response:{},asChild:{type:Boolean},as:{}},setup(t){const e=t,n=Rr(),r=q(()=>n.pendingRequestData),i=q(()=>e.response),s=q(()=>{var c;return(c=r.value)!=null&&c.isProcessing?xt.PENDING:!i.value||!i.value.response?xt.EMPTY:i.value.response.status??xt.EMPTY}),o=q(()=>{var c,f;return U8(((f=(c=i.value)==null?void 0:c.response)==null?void 0:f.sizeInBytes)??0,{space:!1})}),a=q(()=>{var c,f,d;return H8((c=r.value)!=null&&c.isProcessing?((f=r.value)==null?void 0:f.durationInMs)??0:((d=i.value)==null?void 0:d.durationInMs)??0,{verbose:!1,secondsDecimalDigits:2,keepDecimalsOnWholeSeconds:!0})}),l=()=>{n.cancelCurrentRequest()},u=q(()=>{var c;return((c=i.value)==null?void 0:c.importedFromShare)===!0});return(c,f)=>{var d,h,p,m,g;return T(),K("div",{class:Se(v(ke)("h-toolbar flex",e.class))},[M("div",rre,[M("div",ire,[M("div",sre,[k(nre,{status:s.value,response:(d=r.value)!=null&&d.isProcessing||(h=i.value)==null?void 0:h.response},null,8,["status","response"]),f[1]||(f[1]=M("div",{class:"w-8 border-b border-zinc-200"},null,-1)),M("span",ore,[M("span",are,de(a.value),1),(p=r.value)!=null&&p.isProcessing?we("",!0):(T(),K(Qe,{key:0},[f[0]||(f[0]=M("span",{class:"text-color-muted mx-1 text-xs"},"/",-1)),M("span",lre,de(o.value),1)],64))])]),(m=r.value)!=null&&m.isProcessing?we("",!0):(T(),K("div",ure,[k(Qne)]))]),(g=r.value)!=null&&g.isProcessing?(T(),K("div",cre,[k(v(gt),{variant:"outline",size:"xs",onClick:l},{default:O(()=>[k(v(NN)),f[2]||(f[2]=ne(" Cancel ",-1))]),_:1})])):we("",!0)]),u.value?(T(),L(fp,{key:0,value:"This response was imported from a shareable link"},{default:O(()=>[M("div",fre,[k(v(DN),{class:"size-4"})])]),_:1})):we("",!0)],2)}}}),hre=z({__name:"AppRippleCircle",props:{size:{default:210},class:{default:""},opacity:{default:.24},animationDelay:{default:0},borderStyle:{default:""}},setup(t){UC(n=>({v732789d8:e.size+"px",v4c367f18:e.animationDelay+"ms",v7e87f0da:e.opacity,v511a806d:e.borderStyle}));const e=t;return(n,r)=>(T(),K("div",{class:Se(v(ke)("absolute shadow-xl","animate-ripple-circle",e.class))},null,2))}}),pre=Pm(hre,[["__scopeId","data-v-91da32f6"]]),mre={class:"absolute inset-0"},gre=z({__name:"AppRipple",props:{baseCircleSize:{default:210},baseCircleOpacity:{default:.24},spaceBetweenCircle:{default:70},circleOpacityDowngradeRatio:{default:.03},circleClass:{default:""},waveSpeed:{default:80},numberOfCircles:{default:7}},setup(t){return(e,n)=>(T(),K("div",mre,[(T(!0),K(Qe,null,_n(t.numberOfCircles,r=>(T(),L(pre,{key:r,opacity:t.baseCircleOpacity-r*t.circleOpacityDowngradeRatio,size:t.baseCircleSize+r*t.spaceBetweenCircle,"animation-delay":r*t.waveSpeed,"border-style":r===t.numberOfCircles-1?"dashed":"solid",class:Se(t.circleClass)},null,8,["opacity","size","animation-delay","border-style","class"]))),128))]))}}),bre=z({__name:"AppPanelRipple",setup(t){return(e,n)=>(T(),L(gre,{class:"bottom-0 translate-x-2/5 translate-y-1/2 scale-150 bg-white/5 opacity-25 dark:bg-zinc-950/5","circle-class":"border-[hsl(var(--primary))] bg-primary/25 blobed"}))}}),Lm=Pm(bre,[["__scopeId","data-v-b3bb6b43"]]),yre={class:"max-w-md"},vre=z({__name:"AppPanelStateContainer",props:{class:{}},setup(t){const e=t;return(n,r)=>(T(),K("div",{class:Se(v(ke)("relative h-full flex-1 overflow-hidden p-2",e.class))},[M("div",yre,[Q(n.$slots,"default")]),k(Lm)],2))}}),xre=z({__name:"ResponseViewerEmptyState",setup(t){return(e,n)=>(T(),L(vre,null,{default:O(()=>[n[0]||(n[0]=M("h2",{class:"text-lg font-medium"},"You didn't perform any requests yet",-1)),n[1]||(n[1]=M("p",{class:"mb-2 text-sm"}," Make request and the result will appear here. Make sure to check the Wiki in case of doubts. ",-1)),k(qA)]),_:1}))}}),Sre={class:"via-background from-destructive/10 dark:from-destructive/15 relative max-h-full flex-1 overflow-hidden bg-gradient-to-br from-10% p-4"},Ere={class:"relative z-10 flex max-h-full flex-col p-2"},wre={class:"text-destructive text-lg font-medium"},_re={class:"text-sm"},Cre={key:0},Are={key:1},Dre={key:0,class:"bg-background mt-2 ml-0.5 overflow-scroll rounded-sm p-2 text-sm shadow-[0_0_0_5px_rgba(0,0,0,0.2)]"},kre=z({__name:"ResponseViewerErrorState",props:{error:{}},setup(t){const e=t,n=q({get:()=>e.error.body,set:()=>{}});return(r,i)=>(T(),K("div",Sre,[M("div",Ere,[M("div",null,[k(v(fo),{variant:"outline",class:"p-0 px-1 text-xs"},{default:O(()=>[...i[1]||(i[1]=[ne(" Internal Error ",-1)])]),_:1}),M("h2",wre,de(e.error.message),1)]),M("p",_re,[i[2]||(i[2]=ne(" It wasn't possible to relay the request via the internal proxy. ",-1)),e.error.message?(T(),K("span",Cre," The below information might help, otherwise, check the console for more details. ")):(T(),K("span",Are,"Check the console for more details."))]),e.error.body?(T(),K("div",Dre,[k(Im,{modelValue:n.value,"onUpdate:modelValue":i[0]||(i[0]=s=>n.value=s),language:"json",readonly:!0},null,8,["modelValue"])])):we("",!0)]),k(Lm)]))}}),Ore=z({__name:"ResponseBody",props:{content:{}},setup(t){return(e,n)=>(T(),L(Im,{language:"json",readonly:!0,placeholder:t.content===""?"Empty":"Response JSON Payload","model-value":t.content,disabled:t.content===""},null,8,["placeholder","model-value","disabled"]))}}),Tre=z({__name:"ConstDumpRenderer",props:{dump:{}},setup(t){return(e,n)=>(T(),K("span",{class:Se(v(ke)(v(qi).value,"italic"))},de(String(t.dump.value)),3))}}),Ire=z({__name:"NumberDumpRenderer",props:{dump:{}},setup(t){return(e,n)=>(T(),K("span",{class:Se(v(qi).value)},de(t.dump.value),3))}}),U2=z({__name:"AppCollapsible",props:{defaultOpen:{type:Boolean},open:{type:Boolean},disabled:{type:Boolean},unmountOnHide:{type:Boolean},asChild:{type:Boolean},as:{}},emits:["update:open"],setup(t,{emit:e}){const i=Yr(t,e);return(s,o)=>(T(),L(v(MP),Yn(Pr(v(i))),{default:O(({open:a})=>[Q(s.$slots,"default",{open:a})]),_:3},16))}}),H2=z({__name:"AppCollapsibleContent",props:{forceMount:{type:Boolean},asChild:{type:Boolean},as:{}},setup(t){const e=t;return(n,r)=>(T(),L(v(LP),Ce(e,{class:"data-[state=closed]:animate-collapsible-up data-[state=open]:animate-collapsible-down transition-all"}),{default:O(()=>[Q(n.$slots,"default")]),_:3},16))}}),q2=z({__name:"AppCollapsibleTrigger",props:{asChild:{type:Boolean},as:{}},setup(t){const e=t;return(n,r)=>(T(),L(v($P),Yn(Pr(e)),{default:O(()=>[Q(n.$slots,"default")]),_:3},16))}}),aC=z({__name:"DumpKeyRenderer",props:{keyName:{},numerical:{type:Boolean,default:!1}},setup(t){return(e,n)=>t.keyName&&!t.numerical?(T(),K("span",{key:0,class:Se(v(qi).key)},'"'+de(t.keyName)+'": ',3)):t.keyName?(T(),K("span",{key:1,class:Se(v(qi).numericalKey)},de(String(t.keyName))+":  ",3)):we("",!0)}}),Pre=z({__name:"ObjectDumpValuePropertyKey",props:{property:{},keyName:{}},setup(t){const e=r=>({public:"text-emerald-600 dark:text-emerald-500",protected:"text-amber-600 dark:text-amber-500",private:"text-zinc-500 dark:text-zinc-400"})[r],n=r=>({public:"+",protected:"#",private:"-"})[r];return(r,i)=>(T(),K("span",{class:Se(v(qi).key)},[M("span",{class:Se(v(ke)("text-xs",e(t.property.visibility)))},de(n(t.property.visibility)),3),M("span",{class:Se(v(qi).objectProperty)},de(t.keyName)+":",3)],2))}}),Rre=z({__name:"UninitializedDumpRenderer",props:{dump:{}},setup(t){return(e,n)=>(T(),K("span",{class:Se(v(ke)(v(qi).value,"italic"))},[ne(de(String(t.dump.value))+" ",1),n[0]||(n[0]=M("i",{class:"text-xs"},"(Uninitialized Prop)",-1))],2))}}),Nre={key:0,class:"flex gap-0.5"},Mre={key:4},Fre={class:"text-rose-500 dark:text-rose-700"},Lre={class:"flex w-full items-center text-left"},Bre={class:"ml-1 text-xs text-zinc-500 dark:text-zinc-400"},$re={class:"ml-2 border-l border-zinc-200 pl-2 dark:border-zinc-800"},zre={key:2},jre={class:"text-rose-500 dark:text-rose-700"},Vre=z({__name:"SingleDumpRenderer",props:{dump:{},depth:{default:0},keyName:{default:void 0},numericalKey:{type:Boolean,default:!1}},setup(t){const e=t,n=q(()=>e.dump.type===jt.Object||e.dump.type===jt.Closure||e.dump.type===jt.Array),r=q(()=>{if(e.dump.type===jt.Closure)return e.dump.value.signature;if(e.dump.type===jt.Object){const s=e.dump.value.class,o=e.dump.value.propertiesCount;return o===0?"{}":`${s}: ${o} ${o===1?"property":"properties"}`}if(e.dump.type===jt.Array){const s=e.dump.value.length;return s===0?"[]":`array: ${s} ${s===1?"item":"items"}`}throw new Error("Node is not nestable")}),i=q(()=>{if(e.dump.type===jt.Closure){const s=e.dump.value.this,o=e.dump.value.class;return{class:{type:o?jt.String:jt.Constant,value:o||"null"},this:{type:s?jt.String:jt.Constant,value:s||"null"}}}return e.dump.type===jt.Object?e.dump.value.properties:e.dump.type===jt.Array?e.dump.value.items:[]});return(s,o)=>{const a=WI("SingleDumpRenderer",!0);return n.value?(T(),L(v(U2),{key:1,class:"flex flex-col","default-open":t.depth===0,"data-testid":"app-collapsible"},{default:O(()=>[k(v(q2),{class:"group/collapsible-trigger -mx-1 flex items-center gap-1 rounded-sm px-1 text-sm hover:bg-zinc-100/50 dark:hover:bg-zinc-800/50","data-testid":"collapsible-trigger",disabled:i.value.length===0},{default:O(()=>[Q(s.$slots,"key",{},()=>[t.keyName!==void 0?(T(),L(aC,{key:0,"key-name":t.keyName,numerical:t.numericalKey},null,8,["key-name","numerical"])):we("",!0)]),M("span",Lre,[k(v(V0),{class:"size-3 text-zinc-500 transition-transform group-data-[state=open]/collapsible-trigger:rotate-90"}),M("span",Bre,de(r.value),1)])]),_:3},8,["disabled"]),k(v(H2),null,{default:O(()=>[M("div",$re,[(T(!0),K(Qe,null,_n(i.value,(l,u)=>(T(),K("div",{key:`${t.keyName??"root"}-${u}`,class:"flex items-center gap-1 py-0.5"},[t.dump.type===v(jt).Object?(T(),L(a,{key:0,dump:l.value,depth:t.depth+1},{key:O(()=>[k(Pre,{"key-name":u,property:l},null,8,["key-name","property"])]),_:2},1032,["dump","depth"])):t.dump.type===v(jt).Array||t.dump.type===v(jt).Closure?(T(),L(a,{key:1,dump:l,"key-name":String(u),"numerical-key":t.dump.value.numericallyIndexed,depth:t.depth+1},null,8,["dump","key-name","numerical-key","depth"])):(T(),K("div",zre,[M("small",jre,[ne(" Invalid nested value type `"+de(t.dump.type)+"` received. Please create a ",1),o[2]||(o[2]=M("a",{class:"underline",href:"https://github.com/sunchayn/nimbus/issues/new/choose"}," Bug ",-1)),o[3]||(o[3]=ne(" card. ",-1))])]))]))),128))])]),_:1})]),_:3},8,["default-open"])):(T(),K("div",Nre,[Q(s.$slots,"key",{},()=>[t.keyName!==void 0?(T(),L(aC,{key:0,"key-name":t.keyName,numerical:t.numericalKey},null,8,["key-name","numerical"])):we("",!0)]),M("div",{class:Se(v(qi).value)},[t.dump.type===v(jt).String?(T(),L(v(Ure),{key:0,dump:t.dump},null,8,["dump"])):t.dump.type===v(jt).Number?(T(),L(v(Ire),{key:1,dump:t.dump},null,8,["dump"])):t.dump.type===v(jt).Constant?(T(),L(v(Tre),{key:2,dump:t.dump},null,8,["dump"])):t.dump.type===v(jt).Uninitialized?(T(),L(Rre,{key:3,dump:t.dump},null,8,["dump"])):(T(),K("div",Mre,[M("small",Fre,[ne(" Invalid dump value type `"+de(t.dump.type)+"` received. Please create a ",1),o[0]||(o[0]=M("a",{class:"underline",href:"https://github.com/sunchayn/nimbus/issues/new/choose"}," Bug ",-1)),o[1]||(o[1]=ne(" card. ",-1))])]))],2)]))}}}),Ure=z({__name:"StringDumpRenderer",props:{dump:{}},setup(t){return(e,n)=>(T(),K("span",{class:Se(v(qi).stringValue)},[ne(' "'+de(t.dump.value)+'" ',1),M("span",{class:Se(v(qi).meta)},"("+de(t.dump.value.length)+")",3)],2))}}),qi={key:"text-success font-mono text-xs",numericalKey:"text-info font-mono text-xs",objectProperty:"text-subtle-foreground font-mono text-xs",value:"text-foreground font-mono text-xs",stringValue:"text-success font-mono text-xs",meta:"text-subtle-foreground"},Hre={class:"gap-.5 flex flex-col"},qre={class:"text-foreground text-xs"},Gre={class:"flex items-center gap-2"},Wre={key:0,class:"flex items-center gap-1"},Kre={class:"text-xxs text-subtle-foreground select-none"},Xre={class:"p-panel bg-subtle flex h-full min-h-0 flex-1 flex-col gap-1 overflow-y-auto"},Yre={key:0,class:"text-xxs text-subtle-foreground my-1"},Jre={key:1,class:"border-subtle bg-card rounded-md border text-sm"},Zre={class:"px-panel flex items-center gap-1.5 border-b py-1"},Qre={key:2,class:"border-subtle bg-card rounded-md border text-sm"},eie={class:"px-panel flex items-center gap-1.5 border-b py-1"},tie=["data-testid"],nie={class:"px-panel relative z-10 flex gap-1.5 border-b py-1"},rie={class:"inline-flex flex-col","data-testid":"dump-value-title"},iie={class:"text-xs"},sie={class:"p-panel w-full overflow-x-auto whitespace-nowrap","data-testid":"dump-value-content"},oie=1200,aie=z({__name:"ResponseDumpAndDie",props:{rawContent:{}},emits:["update:dumps"],setup(t,{emit:e}){const n=t,r=e,i=Z([]),s=Z(0),o=VC(new Map),a=q(()=>i.value.length===0?null:i.value[s.value]??null),l=q(()=>i.value.length>1),u=q(()=>s.value>0),c=q(()=>s.value{const x=o.get(y);x!=null&&x.timeoutId&&clearTimeout(x.timeoutId),o.delete(y)},d=y=>{const x=window.setTimeout(()=>{o.delete(y)},oie);o.set(y,{deleting:!0,timeoutId:x})},h=y=>{const x=o.get(y);return x!=null&&x.deleting?(f(y),!0):(d(y),!1)},p=y=>{var x;return((x=o.get(y))==null?void 0:x.deleting)??!1},m=()=>{const y=a.value;if(!y||!h(y.id))return;const S=s.value,E=[...i.value];E.splice(S,1),i.value=E,r("update:dumps",E),E.length>0?s.value=Math.min(S,E.length-1):s.value=0,f(y.id)},g=()=>{u.value&&s.value--},b=()=>{c.value&&s.value++};return at(()=>n.rawContent,y=>{if(y)try{const x=JSON.parse(String(y)),S=i.value.findIndex(E=>E.id===x.id);if(S!==-1){s.value=S;return}i.value=[x,...i.value],s.value=0}catch(x){console.error("Failed to parse dump snapshot:",x)}},{immediate:!0}),(y,x)=>{var S,E,C;return T(),K(Qe,null,[k(Oa,{class:"border-b"},{toolbox:O(()=>[M("div",Gre,[l.value?(T(),K("div",Wre,[k(v(gt),{variant:"ghost",size:"xs",disabled:!u.value,"data-testid":"previous-dump-button",onClick:g},{default:O(()=>[k(v(pN),{class:"size-3"})]),_:1},8,["disabled"]),M("span",Kre,de(s.value+1)+" / "+de(i.value.length),1),k(v(gt),{variant:"ghost",size:"xs",disabled:!c.value,"data-testid":"next-dump-button",onClick:b},{default:O(()=>[k(v(V0),{class:"size-3"})]),_:1},8,["disabled"]),a.value?(T(),L(v(gt),{key:0,variant:"outline",size:"xs",class:"shadow-none","data-testid":"delete-dump-button",onClick:m},{default:O(()=>[k(v(up),{class:Se(["size-3",{"text-destructive":p(a.value.id)}])},null,8,["class"])]),_:1})):we("",!0)])):we("",!0)])]),default:O(()=>{var w;return[M("div",Hre,[M("span",qre,de(((w=a.value)==null?void 0:w.source)??"Unknown Source"),1)])]}),_:1}),M("div",Xre,[(S=a.value)!=null&&S.timestamp?(T(),K("div",Yre," Dumped At: "+de(((E=a.value)==null?void 0:E.timestamp)??""),1)):we("",!0),a.value===void 0||a.value===null?(T(),K("div",Jre,[M("div",Zre,[k(Kh,{class:"text-subtle-foreground"}),x[0]||(x[0]=ne(" Info ",-1))]),x[1]||(x[1]=M("div",{class:"p-panel"},"Please make sure one dump snapshot is selected.",-1))])):a.value.dumps.length===0?(T(),K("div",Qre,[M("div",eie,[k(Kh,{class:"text-destructive"}),x[2]||(x[2]=ne(" Error ",-1))]),x[3]||(x[3]=M("div",{class:"p-panel"},[M("p",null," Something Went Wrong! Die and Dump is detected but there is no dumps. "),M("small",null,[ne(" If you think this is a bug, please open a "),M("a",{class:"underline",href:"https://github.com/sunchayn/nimbus/issues/new/choose"}," Bug "),ne(" card. ")])],-1))])):(T(),K("div",{key:a.value.id,class:"flex flex-col gap-2.5"},[(T(!0),K(Qe,null,_n(((C=a.value)==null?void 0:C.dumps)??[],(w,A)=>(T(),K("div",{key:A,class:"border-subtle bg-card rounded-md border","data-testid":`dump-value-${A}`},[M("div",nie,[k(Kh,{class:"text-subtle-foreground pt-1"}),M("span",rie,[M("span",iie,"Dump #"+de(A+1),1)])]),M("div",sie,[a.value?(T(),L(v(Vre),{key:0,class:"w-full max-w-full",dump:w},null,8,["dump"])):we("",!0)])],8,tie))),128))]))])],64)}}}),lie={class:"relative w-full overflow-auto"},uie=z({__name:"AppTable",props:{class:{}},setup(t){const e=t;return(n,r)=>(T(),K("div",lie,[M("table",{class:Se(v(ke)("w-full caption-bottom text-sm",e.class))},[Q(n.$slots,"default")],2)]))}}),cie=z({__name:"AppTableBody",props:{class:{}},setup(t){const e=t;return(n,r)=>(T(),K("tbody",{class:Se(v(ke)("[&_tr:last-child]:border-0",e.class))},[Q(n.$slots,"default")],2))}}),I1=z({__name:"AppTableCell",props:{class:{}},setup(t){const e=t;return(n,r)=>(T(),K("td",{class:Se(v(ke)("p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-0.5",e.class))},[Q(n.$slots,"default")],2))}}),fie=z({__name:"AppTableRow",props:{class:{}},setup(t){const e=t;return(n,r)=>(T(),K("tr",{class:Se(v(ke)("border-b transition-colors hover:bg-zinc-100/50 data-[state=selected]:bg-zinc-100 dark:hover:bg-zinc-800/50 dark:data-[state=selected]:bg-zinc-800",e.class))},[Q(n.$slots,"default")],2))}}),die=z({__name:"KeyValueDisplayListItem",props:{item:{}},setup(t){const e=t,{copy:n,copied:r}=_o(),i=()=>{n(String(e.item.value))};return(s,o)=>(T(),L(v(fie),{class:"flex-wrap border-0"},{default:O(()=>[k(v(I1),{class:"pl-panel w-1/4 border-b-1 border-b-transparent align-top font-medium"},{default:O(()=>[ne(de(t.item.key),1)]),_:1}),k(v(I1),{class:"border-border border-b-1 align-top break-words"},{default:O(()=>[Q(s.$slots,"value",{item:e.item},()=>[ne(de(t.item.value),1)])]),_:3}),k(v(I1),{class:"px-panel border-border w-10 border-b-1 align-top"},{default:O(()=>[k(nu,{"on-click":i,copied:v(r)},null,8,["copied"])]),_:1})]),_:3}))}}),q8=z({__name:"KeyValueDisplayList",props:{items:{}},setup(t){return(e,n)=>(T(),L(v(uie),{class:"table-fixed text-xs"},{default:O(()=>[k(v(cie),{class:"max-w-full"},{default:O(()=>[(T(!0),K(Qe,null,_n(t.items,(r,i)=>(T(),L(die,{key:i,item:r},{value:O(({item:s})=>[Q(e.$slots,"value",{item:s})]),_:3},8,["item"]))),128))]),_:3})]),_:3}))}}),hie={class:"flex translate-x-2 items-center space-x-2"},pie={class:"px-panel flex-start flex w-10 items-center"},mie={class:"min-h-0 flex-1 overflow-y-auto"},gie={key:0,class:"text-success mb-1 flex items-center gap-1"},bie=z({__name:"ResponseCookies",props:{cookies:{}},setup(t){var u;const e=t,n=ka(),r=Cl(Tf("response-viewer-cookies-decrypted-"+((u=n.activeTab)==null?void 0:u.id)),!1),{copy:i,copied:s}=_o(),o=q(()=>e.cookies.map(c=>{const f=c.value.decrypted!==null,d=r.value?c.value.decrypted??c.value.raw:c.value.raw;return{key:c.key,value:d,isDecryptable:f}})),a=q(()=>{var c;return((c=e.cookies)==null?void 0:c.length)??!1}),l=()=>{const c=o.value.reduce((f,d)=>`${f}${d.key}: ${d.value} -`,"");i(c)};return(c,f)=>(T(),K(Qe,null,[k(Oa,{class:"border-b"},{toolbox:O(()=>[M("div",hie,[k(n8,{disabled:!a.value,onClick:f[0]||(f[0]=()=>r.value=!v(r))},{default:O(()=>[v(r)?(T(),K(Qe,{key:0},[k(v(PN),{class:"size-5"}),f[1]||(f[1]=ne(" Encrypt ",-1))],64)):(T(),K(Qe,{key:1},[k(v(Fx),{class:"size-5"}),f[2]||(f[2]=ne(" Decrypt ",-1))],64))]),_:1},8,["disabled"]),M("div",pie,[k(nu,{disabled:!a.value,"on-click":l,copied:v(s)},null,8,["disabled","copied"])])])]),default:O(()=>[ne(" Cookies ("+de(o.value.length)+") ",1)]),_:1}),M("div",mie,[(T(),L(KI(q8),{items:o.value},{value:O(({item:d})=>[M("span",null,[d.isDecryptable?we("",!0):(T(),K("small",gie,[k(v(Fx),{size:10}),f[3]||(f[3]=ne(" Non-Encrypted Value ",-1))])),ne(" "+de(d.value),1)])]),_:1},8,["items"]))])],64))}}),yie={class:"px-panel flex-start flex w-10 translate-x-2 items-center"},vie={class:"min-h-0 flex-1 overflow-y-auto"},xie=z({__name:"ResponseHeaders",props:{headers:{}},setup(t){const e=t,{copy:n,copied:r}=_o(),i=q(()=>e.headers.map(o=>({key:o.key,value:o.value??""}))),s=()=>{const o=e.headers.reduce((a,l)=>`${a}${l.key}: ${l.value??""} -`,"");n(o)};return(o,a)=>(T(),K(Qe,null,[k(Oa,{class:"border-b"},{toolbox:O(()=>[M("div",yie,[k(nu,{"on-click":s,copied:v(r)},null,8,["copied"])])]),default:O(()=>[ne(" Headers ("+de(t.headers.length)+") ",1)]),_:1}),M("div",vie,[k(q8,{items:i.value},null,8,["items"])])],64))}}),Sie={class:"relative min-h-0 flex-1"},Eie={key:0,class:"bg-background absolute top-0 left-0 z-[100] h-full w-full animate-pulse opacity-75"},wie={class:"bg-subtle flex items-center justify-between border-b"},_ie={class:"relative min-w-0 flex-1"},Cie={class:"from-subtle via-subtle/80 pointer-events-none absolute top-0 bottom-0 left-0 w-8 bg-gradient-to-r to-transparent transition-opacity duration-200"},Aie={class:"from-subtle via-subtle/80 pointer-events-none absolute top-0 right-0 bottom-0 w-8 bg-gradient-to-l to-transparent transition-opacity duration-200"},Die={class:"pr-panel"},kie={class:"flex items-center"},Oie=z({__name:"ResponseViewerResponse",props:{response:{}},setup(t){const e=t,n=Rr(),r=Cl(Tf("response-viewer-tab"),"response"),{scrollContainer:i,showLeftMask:s,showRightMask:o,updateScrollMasks:a,scrollTabIntoView:l}=HC(),u=q(()=>e.response),c=q(()=>n.pendingRequestData),f=q(()=>{var h;return(h=u.value)==null?void 0:h.request.transactionMode}),d=h=>{l(h.currentTarget)};return(h,p)=>{var m;return T(),K("div",Sie,[(m=c.value)!=null&&m.isProcessing?(T(),K("div",Eie)):we("",!0),k(v(VA),{"default-value":v(r),class:"mt-0 flex h-full flex-col overflow-auto","onUpdate:modelValue":p[1]||(p[1]=g=>r.value=g)},{default:O(()=>[M("div",wie,[M("div",_ie,[M("div",{ref_key:"scrollContainer",ref:i,class:"scrollbar-hide flex items-center justify-between overflow-x-auto",style:{"scrollbar-width":"none","-ms-overflow-style":"none"},onScroll:p[0]||(p[0]=(...g)=>v(a)&&v(a)(...g))},[k(v(UA),{class:"h-toolbar px-panel rounded-none"},{default:O(()=>[k(v(Uo),{value:"response",label:"Response",onClick:d}),k(v(Uo),{value:"response-headers",label:"Headers",onClick:d}),k(v(Uo),{value:"response-cookies",label:"Cookies",onClick:d})]),_:1})],544),la(M("div",Cie,null,512),[[Al,v(s)]]),la(M("div",Aie,null,512),[[Al,v(o)]])]),M("div",Die,[f.value?(T(),L(v(fp),{key:0,value:"Changes were automatically rolled back for this request"},{default:O(()=>[M("div",kie,[k(v(fo),{variant:"outline",class:"gap-1"},{default:O(()=>[k(v(xN),{class:"size-3 min-w-3"}),p[2]||(p[2]=ne(" Transaction Mode ",-1))]),_:1})])]),_:1})):we("",!0)])]),k(v(Vo),{value:"response",class:"mt-0 flex min-h-0 flex-1 flex-col overflow-hidden"},{default:O(()=>{var g,b,y,x,S,E;return[((b=(g=u.value)==null?void 0:g.response)==null?void 0:b.status)!==v(xt).DUMP_AND_DIE?(T(),L(Ore,{key:0,class:"min-h-0 overflow-auto",content:((x=(y=u.value)==null?void 0:y.response)==null?void 0:x.body)??""},null,8,["content"])):(T(),L(aie,{key:1,"raw-content":((E=(S=u.value)==null?void 0:S.response)==null?void 0:E.body)??"[]"},null,8,["raw-content"]))]}),_:1}),k(v(Vo),{value:"response-headers",class:"mt-0 flex min-h-0 flex-1 flex-col overflow-hidden"},{default:O(()=>{var g,b;return[k(xie,{headers:((b=(g=u.value)==null?void 0:g.response)==null?void 0:b.headers)??[]},null,8,["headers"])]}),_:1}),k(v(Vo),{value:"response-cookies",class:"mt-0 flex min-h-0 flex-1 flex-col overflow-hidden"},{default:O(()=>{var g,b;return[k(bie,{cookies:((b=(g=u.value)==null?void 0:g.response)==null?void 0:b.cookies)??[]},null,8,["cookies"])]}),_:1})]),_:1},8,["default-value"])])}}}),Tie=z({__name:"ResponseViewer",props:{class:{},asChild:{type:Boolean},as:{}},setup(t){const e=t,n=ka(),r=q(()=>n.activeResponse);return(i,s)=>(T(),K("div",{class:Se(v(ke)("bg-background flex h-full flex-col",e.class)),"data-testid":"response-content"},[k(dre,{response:r.value,class:"border-b"},null,8,["response"]),r.value?r.value.error?(T(),L(kre,{key:1,"data-testid":"response-error",error:r.value.error},null,8,["error"])):(T(),L(Oie,{key:2,response:r.value},null,8,["response"])):(T(),L(xre,{key:0,"data-testid":"response-empty"}))],2))}}),Iie={class:"from-destructive/10 relative z-10 border-b bg-gradient-to-r to-transparent"},Pie={class:"flex"},Rie={class:"bg-destructive/10 dark:bg-destructive/20 flex items-center px-4"},Nie={class:"p-2.5"},Mie={class:"text-md leading-tight font-semibold"},G8=z({__name:"ErrorCardHeader",props:{message:{}},setup(t){const e=t;return(n,r)=>(T(),K("div",Iie,[M("div",Pie,[M("div",Rie,[k(v(U0),{class:"text-destructive dark:text-foreground size-4"})]),M("div",Nie,[M("h2",Mie,de(e.message),1),r[0]||(r[0]=M("p",{class:"text-subtle-foreground text-sm"},"Route extraction failed",-1))])])]))}}),Fie={class:"flex items-start gap-2.5"},Lie={class:"flex-1"},Bie=["innerHTML"],W8=z({__name:"SuggestedSolutionCallout",props:{solution:{},class:{}},setup(t){const e=t;return(n,r)=>(T(),K("div",{class:Se(v(ke)("bg-subtle rounded-lg border p-2",e.class))},[M("div",Fie,[k(v(ON),{class:"mt-1 size-5 flex-shrink-0"}),M("div",Lie,[r[0]||(r[0]=M("h3",{class:"font-semibold"},"Suggested Solution",-1)),M("p",{class:"text-sm",innerHTML:t.solution},null,8,Bie)])])],2))}}),$ie={class:"text-foreground mb-2 font-semibold"},zie={class:"bg-destructive/10 dark:bg-destructive/30 rounded-lg p-4"},jie={class:"text-destructive font-mono text-sm"},Vie={key:0,class:"text-destructive mt-2 text-sm wrap-break-word"},Uie={key:0,class:"mt-2"},Hie=["innerHTML"],K8=z({__name:"TechnicalDetailsSection",props:{previousError:{}},setup(t){const e=t,{copy:n,copied:r}=_o(),i=()=>{let s=e.previousError.message;e.previousError.file&&(s+=` +*/var SZ=Object.freeze({autofocus:!1,disabled:!1,indentWithTab:!0,tabSize:2,placeholder:"",autoDestroy:!0,extensions:[xZ]}),EZ=Symbol("vue-codemirror-global-config"),Vn,wZ=function(t){var e=t.onUpdate,n=t.onChange,r=t.onFocus,i=t.onBlur,s=(function(o,a){var l={};for(var u in o)Object.prototype.hasOwnProperty.call(o,u)&&a.indexOf(u)<0&&(l[u]=o[u]);if(o!=null&&typeof Object.getOwnPropertySymbols=="function"){var c=0;for(u=Object.getOwnPropertySymbols(o);c""},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const e=t,n=Ki(t,"modelValue"),r=q(()=>e.language==="json"?IY(e.readonly,e.validationSchema):PY(e.readonly)),i=s=>{n.value=s};return(s,o)=>(T(),L(v(OZ),{placeholder:t.placeholder,style:_o({height:t.autoHeight?"auto":"100%",minHeight:"100%"}),extensions:r.value,"indent-with-tab":!0,"tab-size":4,"model-value":n.value,disabled:t.disabled,onChange:i},null,8,["placeholder","style","extensions","model-value","disabled"]))}}),TZ=z({__name:"RequestBodyJson",props:Da({schema:{}},{modelValue:{default:()=>""},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const e=Ki(t,"modelValue");return(n,r)=>(T(),L(Pm,{modelValue:e.value,"onUpdate:modelValue":r[0]||(r[0]=i=>e.value=i),language:"json",readonly:!1,placeholder:"Your JSON Payload","validation-schema":t.schema},null,8,["modelValue","validation-schema"]))}}),IZ=z({__name:"RequestBodyPlainText",setup(t){return(e,n)=>(T(),L(Pm,{language:"plain",readonly:!1,placeholder:"Your Plain Text Content"}))}}),PZ=z({__name:"RequestBodyContent",props:{payloadType:{},payload:{},schema:{}},emits:["update:payload"],setup(t,{emit:e}){const n=e,r=i=>{n("update:payload",i)};return(i,s)=>(T(),L(v(If),{class:"min-h-0 w-full flex-1"},{default:D(()=>[t.payloadType===v(Or).JSON?(T(),L(TZ,{key:0,"model-value":t.payload,schema:t.schema,"onUpdate:modelValue":r},null,8,["model-value","schema"])):t.payloadType===v(Or).FORM_DATA?(T(),L(NF,{key:1,"model-value":t.payload,"onUpdate:modelValue":r},null,8,["model-value"])):t.payloadType===v(Or).PLAIN_TEXT?(T(),L(IZ,{key:2,"model-value":t.payload,"onUpdate:modelValue":r},null,8,["model-value"])):(T(),L(FF,{key:3,"onUpdate:modelValue":r}))]),_:1}))}}),RZ={class:"flex min-h-0 flex-1 flex-col"},NZ=z({__name:"RequestBody",setup(t){const e=Rr(),n=lv(),{payloadType:r,payload:i,pendingRequestData:s,supportsAutoFill:o,autofill:a,types:l}=aF(),u=q(()=>{var h;return(h=e.pendingRequestData)==null?void 0:h.routeDefinition}),c=q(()=>u.value?n.isMissingImplementation(u.value):!1),f=q(()=>c.value),d=q(function(){var p;const h=(p=e.pendingRequestData)==null?void 0:p.routeDefinition;return h?n.isUndocumented(h):!1});return(h,p)=>{var m,g,b,y,x,S;return T(),K("div",RZ,[k(Oa,{class:"border-b"},{toolbox:D(()=>[k(v(LZ),{disabled:!v(o),onClick:v(a)},null,8,["disabled","onClick"])]),default:D(()=>[k(v($Z),{modelValue:v(r),"onUpdate:modelValue":p[0]||(p[0]=E=>_l(r)?r.value=E:null),types:v(l)},null,8,["modelValue","types"])]),_:1}),f.value?(T(),L(bF,{key:0})):we("",!0),d.value?(T(),L(CF,{key:1})):we("",!0),((g=(m=v(s))==null?void 0:m.schema)==null?void 0:g.extractionErrors)!=null?(T(),L(PF,{key:2,"extraction-error":(y=(b=v(s))==null?void 0:b.schema)==null?void 0:y.extractionErrors},null,8,["extraction-error"])):we("",!0),k(PZ,{"payload-type":v(r),payload:v(i),schema:(S=(x=v(s))==null?void 0:x.schema)==null?void 0:S.shape,"onUpdate:payload":p[1]||(p[1]=E=>i.value=E)},null,8,["payload-type","payload","schema"])])}}}),MZ=z({__name:"AppBorderBeam",props:{class:{default:""},size:{default:200},duration:{default:15e3},borderWidth:{default:1.5},anchor:{default:10},colorFrom:{default:"#ffaa40"},colorTo:{default:"#9c40ff"},delay:{default:0}},setup(t){HC(i=>({v72a84cbc:i.size,v46fc34ea:n.value,v4b4cecb0:i.anchor,v55e45fdf:i.borderWidth,v4557a1d2:i.colorFrom,eb57faba:i.colorTo,v01f91a52:r.value}));const e=t,n=q(()=>`${e.duration}s`),r=q(()=>`${e.delay}s`);return(i,s)=>(T(),K("div",{class:Se(v(ke)("border-beam","pointer-events-none absolute inset-0 rounded-[inherit] [border:calc(var(--border-width)*1px)_solid_transparent]","![mask-composite:intersect] ![mask-clip:padding-box,border-box] [mask:linear-gradient(transparent,transparent),linear-gradient(white,white)]","animate-border-beam after:absolute after:aspect-square after:w-[calc(var(--size)*1px)] after:[animation-delay:var(--delay)] after:[background:linear-gradient(to_left,var(--color-from),var(--color-to),transparent)] after:[offset-anchor:calc(var(--anchor)*1%)_50%] after:[offset-path:rect(0_auto_auto_0_round_calc(var(--size)*1px))]",e.class))},null,2))}}),Rm=(t,e)=>{const n=t.__vccOpts||t;for(const[r,i]of e)n[r]=i;return n},FZ=Rm(MZ,[["__scopeId","data-v-5b422e07"]]),r8=z({__name:"AppGlowingButton",props:{duration:{default:10},beamSize:{default:200},variant:{default:"secondary"},size:{default:"xs"},class:{},asChild:{type:Boolean},as:{}},setup(t){const e=t;return(n,r)=>(T(),L(v(gt),{size:t.size,variant:t.variant,class:Se(v(ke)("group relative",e.class))},{default:D(()=>[k(FZ,{size:t.beamSize,duration:t.duration,delay:0,"border-width":1,class:"group-disabled:hidden"},null,8,["size","duration"]),Q(n.$slots,"default")]),_:3},8,["size","variant","class"]))}}),LZ=z({__name:"RequestBodyAutoFillButton",setup(t){return(e,n)=>(T(),L(r8,null,{default:D(()=>[k(v(BN),{class:"transition-all will-change-transform group-hover:rotate-12"}),n[0]||(n[0]=ne(" Auto Fill ",-1))]),_:1}))}}),BZ={class:"flex items-center"},$Z=z({__name:"RequestBodySelector",props:Da({types:{}},{modelValue:{default:()=>""},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const e=t,n=Ki(t,"modelValue");return(r,i)=>(T(),K("div",BZ,[i[1]||(i[1]=M("span",{class:"text-subtle-foreground w-[80px] text-xs"},"Payload Type:",-1)),k(v(tu),{modelValue:n.value,"onUpdate:modelValue":i[0]||(i[0]=s=>n.value=s)},{default:D(()=>[k(v(Zl),{variant:"toolbar",class:"min-w-[120px] text-xs"},{default:D(()=>[k(v(Ql))]),_:1}),k(v(eu),null,{default:D(()=>[(T(!0),K(Qe,null,_n(e.types,s=>(T(),L(v(Es),{key:s.id,value:s.id},{default:D(()=>[ne(de(s.label),1)]),_:2},1032,["value"]))),128))]),_:1})]),_:1},8,["modelValue"])]))}});function zZ(t){const{endpoint:e}=t,n=Z([]),r=p=>{const m=p.split("/"),g=[];return m.forEach((b,y)=>{b.startsWith("{")&&b.endsWith("}")&&g.push(y)}),g},i=p=>p==="{",s=p=>p==="}",o=(p,m)=>{for(let g=m;g>=0;g--){if(i(p[g]))return g;if(s(p[g]))return-1}return-1},a=(p,m)=>{for(let g=m;g{const g=o(p,m);if(g===-1)return null;const b=a(p,m);return b===-1?null:{start:g,end:b}},u=(p,m)=>{const g=p.split("/");let b=0;for(let y=0;y=S&&m<=E)return y;b+=x+1}return null},c=(p,m)=>{const g=p.split("/");if(m>=g.length)return null;let b=0;for(let y=0;y{const g=u(p,m);return g===null||!n.value.includes(g)?null:c(p,g)},d=(p,m)=>{kr(()=>{p.setSelectionRange(m.start,m.end)})},h=p=>{const m=p.target;if(!m||m.selectionStart===null)return;const g=m.selectionStart,b=m.value,y=l(b,g);if(y){d(m,y);return}const x=f(b,g);x&&d(m,x)};return nt(e,p=>{(p==null?void 0:p.includes("{"))&&(n.value=r(p))},{immediate:!0}),{handleClick:h,identifyVariableSegments:r,variableSegmentIndices:kc(n)}}const jZ={class:"flex flex-1 items-center"},VZ={class:"flex gap-2 pr-2"},UZ=z({__name:"RequestBuilderEndpointInput",setup(t){const e=Rr(),n=q(()=>e.pendingRequestData),r=q({get:()=>{var a;return((a=n.value)==null?void 0:a.endpoint)??""},set:a=>e.updateRequestEndpoint(a)}),{handleClick:i}=zZ({endpoint:r}),s=async function(){e.pendingRequestData&&await e.executeCurrentRequest()},o=a=>{a.key==="Enter"&&(a.preventDefault(),s())};return(a,l)=>{var u;return T(),K("div",jZ,[k(v(ws),{modelValue:r.value,"onUpdate:modelValue":l[0]||(l[0]=c=>r.value=c),variant:"toolbar",class:"h-full flex-1 text-xs",placeholder:"","data-testid":"endpoint-input",onClick:v(i),onKeydown:o},null,8,["modelValue","onClick"]),M("div",VZ,[k(v(gt),{size:"xs",disabled:!n.value||((u=n.value)==null?void 0:u.isProcessing),class:"gap-0",onClick:s},{default:D(()=>[l[1]||(l[1]=ne(" Send ( ",-1)),k(v(xN),{class:"size-3 px-0"}),l[2]||(l[2]=ne(" ) ",-1))]),_:1},8,["disabled"]),Q(a.$slots,"options-menu")])])}}}),HZ=z({__name:"RequestBuilderMethodSelector",setup(t){const e=Rr(),n=["GET","POST","PUT","PATCH","DELETE"],r=q({get:()=>{var o,a;return((a=(o=e.pendingRequestData)==null?void 0:o.method)==null?void 0:a.toUpperCase())??"GET"},set:o=>e.updateRequestMethod(o.toUpperCase())}),i=q(()=>{var l;const o=(l=e.pendingRequestData)==null?void 0:l.supportedRoutes,a=(o==null?void 0:o.map(u=>u.method))??[];return n.filter(u=>a.includes(u))}),s=q(()=>n.filter(o=>!i.value.includes(o)));return(o,a)=>(T(),L(v(tu),{modelValue:r.value,"onUpdate:modelValue":a[0]||(a[0]=l=>r.value=l)},{default:D(()=>[k(v(Zl),{variant:"toolbar",class:"h-full w-[95px] border-r pr-1.5 pl-5 text-xs"},{default:D(()=>[k(v(Ql),{placeholder:r.value?"":"Select a Method"},{default:D(()=>[ne(de(r.value||"Select a Method"),1)]),_:1},8,["placeholder"])]),_:1}),k(v(eu),{"align-offset":2},{default:D(()=>[i.value.length?(T(),L(v(Pc),{key:0},{default:D(()=>[k(v(Rc),null,{default:D(()=>[...a[1]||(a[1]=[ne("Supported",-1)])]),_:1}),(T(!0),K(Qe,null,_n(i.value,l=>(T(),L(v(Es),{key:l,value:l},{default:D(()=>[ne(de(l),1)]),_:2},1032,["value"]))),128))]),_:1})):we("",!0),s.value.length!==0?(T(),L(v(Pc),{key:1},{default:D(()=>[i.value.length?(T(),K(Qe,{key:0},[k(v(RM)),k(v(Rc),null,{default:D(()=>[...a[2]||(a[2]=[ne("Other",-1)])]),_:1})],64)):we("",!0),(T(!0),K(Qe,null,_n(s.value,l=>(T(),L(v(Es),{key:l,value:l},{default:D(()=>[ne(de(l),1)]),_:2},1032,["value"]))),128))]),_:1})):we("",!0)]),_:1})]),_:1},8,["modelValue"]))}}),i8=z({__name:"AppDropdownMenu",props:{defaultOpen:{type:Boolean},open:{type:Boolean},dir:{},modal:{type:Boolean}},emits:["update:open"],setup(t,{emit:e}){const i=Yr(t,e);return(s,o)=>(T(),L(v(_5),Yn(Pr(v(i))),{default:D(()=>[Q(s.$slots,"default")]),_:3},16))}}),s8=z({__name:"AppDropdownMenuContent",props:{class:{default:""},forceMount:{type:Boolean},loop:{type:Boolean},side:{},sideOffset:{default:4},sideFlip:{type:Boolean},align:{},alignOffset:{},alignFlip:{type:Boolean},avoidCollisions:{type:Boolean},collisionBoundary:{},collisionPadding:{},arrowPadding:{},sticky:{},hideWhenDetached:{type:Boolean},positionStrategy:{},updatePositionStrategy:{},disableUpdateOnLayoutShift:{type:Boolean},prioritizePosition:{type:Boolean},reference:{},asChild:{type:Boolean},as:{}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","closeAutoFocus"],setup(t,{emit:e}){const n=t,r=e,i=q(()=>{const{class:o,...a}=n;return a}),s=Yr(i,r);return(o,a)=>(T(),L(v(N5),null,{default:D(()=>[k(v(A5),Ce(v(s),{class:v(ke)("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-32 overflow-hidden rounded-md border border-zinc-200 bg-white p-1 text-zinc-950 shadow-md dark:border-zinc-800 dark:bg-zinc-950 dark:text-zinc-50",n.class)}),{default:D(()=>[Q(o.$slots,"default")]),_:3},16,["class"])]),_:3}))}}),b_=z({__name:"AppDropdownMenuGroup",props:{asChild:{type:Boolean},as:{}},setup(t){const e=t;return(n,r)=>(T(),L(v(k5),Yn(Pr(e)),{default:D(()=>[Q(n.$slots,"default")]),_:3},16))}}),Wh=z({__name:"AppDropdownMenuItem",props:{class:{},inset:{type:Boolean},disabled:{type:Boolean},textValue:{},asChild:{type:Boolean},as:{}},setup(t){const e=t,n=q(()=>{const{class:i,...s}=e;return s}),r=P0(n);return(i,s)=>(T(),L(v(T5),Ce(v(r),{class:v(ke)("relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm transition-colors outline-none select-none focus:bg-zinc-100 focus:text-zinc-900 data-[disabled]:pointer-events-none data-[disabled]:opacity-50 dark:focus:bg-zinc-800 dark:focus:text-zinc-50 [&>svg]:size-4 [&>svg]:shrink-0",t.inset&&"pl-8",e.class)}),{default:D(()=>[Q(i.$slots,"default")]),_:3},16,["class"]))}}),y_=z({__name:"AppDropdownMenuLabel",props:{class:{},inset:{type:Boolean},asChild:{type:Boolean},as:{}},setup(t){const e=t,n=q(()=>{const{class:i,...s}=e;return s}),r=P0(n);return(i,s)=>(T(),L(v(P5),Ce(v(r),{class:v(ke)("px-2 py-1.5 text-xs",t.inset&&"pl-8",e.class)}),{default:D(()=>[Q(i.$slots,"default")]),_:3},16,["class"]))}}),_y=z({__name:"AppDropdownMenuSeparator",props:{class:{},asChild:{type:Boolean},as:{}},setup(t){const e=t,n=q(()=>{const{class:r,...i}=e;return i});return(r,i)=>(T(),L(v(F5),Ce(n.value,{class:v(ke)("-mx-1 my-1 h-px bg-zinc-100 dark:bg-zinc-800",e.class)}),null,16,["class"]))}}),o8=z({__name:"AppDropdownMenuTrigger",props:{disabled:{type:Boolean},asChild:{type:Boolean},as:{}},setup(t){const n=P0(t);return(r,i)=>(T(),L(v(B5),Ce({class:"outline-none"},v(n)),{default:D(()=>[Q(r.$slots,"default")]),_:3},16))}});/*! pako 2.1.0 https://github.com/nodeca/pako @license (MIT AND Zlib) */const qZ=4,v_=0,x_=1,GZ=2;function bu(t){let e=t.length;for(;--e>=0;)t[e]=0}const WZ=0,a8=1,KZ=2,XZ=3,YZ=258,L2=29,td=256,ff=td+1+L2,El=30,B2=19,l8=2*ff+1,Qo=15,y1=16,JZ=7,$2=256,u8=16,c8=17,f8=18,Cy=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),Kh=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),ZZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),d8=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),QZ=512,os=new Array((ff+2)*2);bu(os);const xc=new Array(El*2);bu(xc);const df=new Array(QZ);bu(df);const hf=new Array(YZ-XZ+1);bu(hf);const z2=new Array(L2);bu(z2);const m0=new Array(El);bu(m0);function v1(t,e,n,r,i){this.static_tree=t,this.extra_bits=e,this.extra_base=n,this.elems=r,this.max_length=i,this.has_stree=t&&t.length}let h8,p8,m8;function x1(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}const g8=t=>t<256?df[t]:df[256+(t>>>7)],pf=(t,e)=>{t.pending_buf[t.pending++]=e&255,t.pending_buf[t.pending++]=e>>>8&255},lr=(t,e,n)=>{t.bi_valid>y1-n?(t.bi_buf|=e<>y1-t.bi_valid,t.bi_valid+=n-y1):(t.bi_buf|=e<{lr(t,n[e*2],n[e*2+1])},b8=(t,e)=>{let n=0;do n|=t&1,t>>>=1,n<<=1;while(--e>0);return n>>>1},eQ=t=>{t.bi_valid===16?(pf(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=t.bi_buf&255,t.bi_buf>>=8,t.bi_valid-=8)},tQ=(t,e)=>{const n=e.dyn_tree,r=e.max_code,i=e.stat_desc.static_tree,s=e.stat_desc.has_stree,o=e.stat_desc.extra_bits,a=e.stat_desc.extra_base,l=e.stat_desc.max_length;let u,c,f,d,h,p,m=0;for(d=0;d<=Qo;d++)t.bl_count[d]=0;for(n[t.heap[t.heap_max]*2+1]=0,u=t.heap_max+1;ul&&(d=l,m++),n[c*2+1]=d,!(c>r)&&(t.bl_count[d]++,h=0,c>=a&&(h=o[c-a]),p=n[c*2],t.opt_len+=p*(d+h),s&&(t.static_len+=p*(i[c*2+1]+h)));if(m!==0){do{for(d=l-1;t.bl_count[d]===0;)d--;t.bl_count[d]--,t.bl_count[d+1]+=2,t.bl_count[l]--,m-=2}while(m>0);for(d=l;d!==0;d--)for(c=t.bl_count[d];c!==0;)f=t.heap[--u],!(f>r)&&(n[f*2+1]!==d&&(t.opt_len+=(d-n[f*2+1])*n[f*2],n[f*2+1]=d),c--)}},y8=(t,e,n)=>{const r=new Array(Qo+1);let i=0,s,o;for(s=1;s<=Qo;s++)i=i+n[s-1]<<1,r[s]=i;for(o=0;o<=e;o++){let a=t[o*2+1];a!==0&&(t[o*2]=b8(r[a]++,a))}},nQ=()=>{let t,e,n,r,i;const s=new Array(Qo+1);for(n=0,r=0;r>=7;r{let e;for(e=0;e{t.bi_valid>8?pf(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0},S_=(t,e,n,r)=>{const i=e*2,s=n*2;return t[i]{const r=t.heap[n];let i=n<<1;for(;i<=t.heap_len&&(i{let r,i,s=0,o,a;if(t.sym_next!==0)do r=t.pending_buf[t.sym_buf+s++]&255,r+=(t.pending_buf[t.sym_buf+s++]&255)<<8,i=t.pending_buf[t.sym_buf+s++],r===0?Ti(t,i,e):(o=hf[i],Ti(t,o+td+1,e),a=Cy[o],a!==0&&(i-=z2[o],lr(t,i,a)),r--,o=g8(r),Ti(t,o,n),a=Kh[o],a!==0&&(r-=m0[o],lr(t,r,a)));while(s{const n=e.dyn_tree,r=e.stat_desc.static_tree,i=e.stat_desc.has_stree,s=e.stat_desc.elems;let o,a,l=-1,u;for(t.heap_len=0,t.heap_max=l8,o=0;o>1;o>=1;o--)S1(t,n,o);u=s;do o=t.heap[1],t.heap[1]=t.heap[t.heap_len--],S1(t,n,1),a=t.heap[1],t.heap[--t.heap_max]=o,t.heap[--t.heap_max]=a,n[u*2]=n[o*2]+n[a*2],t.depth[u]=(t.depth[o]>=t.depth[a]?t.depth[o]:t.depth[a])+1,n[o*2+1]=n[a*2+1]=u,t.heap[1]=u++,S1(t,n,1);while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],tQ(t,e),y8(n,l,t.bl_count)},w_=(t,e,n)=>{let r,i=-1,s,o=e[1],a=0,l=7,u=4;for(o===0&&(l=138,u=3),e[(n+1)*2+1]=65535,r=0;r<=n;r++)s=o,o=e[(r+1)*2+1],!(++a{let r,i=-1,s,o=e[1],a=0,l=7,u=4;for(o===0&&(l=138,u=3),r=0;r<=n;r++)if(s=o,o=e[(r+1)*2+1],!(++a{let e;for(w_(t,t.dyn_ltree,t.l_desc.max_code),w_(t,t.dyn_dtree,t.d_desc.max_code),Ay(t,t.bl_desc),e=B2-1;e>=3&&t.bl_tree[d8[e]*2+1]===0;e--);return t.opt_len+=3*(e+1)+5+5+4,e},iQ=(t,e,n,r)=>{let i;for(lr(t,e-257,5),lr(t,n-1,5),lr(t,r-4,4),i=0;i{let e=4093624447,n;for(n=0;n<=31;n++,e>>>=1)if(e&1&&t.dyn_ltree[n*2]!==0)return v_;if(t.dyn_ltree[18]!==0||t.dyn_ltree[20]!==0||t.dyn_ltree[26]!==0)return x_;for(n=32;n{C_||(nQ(),C_=!0),t.l_desc=new x1(t.dyn_ltree,h8),t.d_desc=new x1(t.dyn_dtree,p8),t.bl_desc=new x1(t.bl_tree,m8),t.bi_buf=0,t.bi_valid=0,v8(t)},S8=(t,e,n,r)=>{lr(t,(WZ<<1)+(r?1:0),3),x8(t),pf(t,n),pf(t,~n),n&&t.pending_buf.set(t.window.subarray(e,e+n),t.pending),t.pending+=n},aQ=t=>{lr(t,a8<<1,3),Ti(t,$2,os),eQ(t)},lQ=(t,e,n,r)=>{let i,s,o=0;t.level>0?(t.strm.data_type===GZ&&(t.strm.data_type=sQ(t)),Ay(t,t.l_desc),Ay(t,t.d_desc),o=rQ(t),i=t.opt_len+3+7>>>3,s=t.static_len+3+7>>>3,s<=i&&(i=s)):i=s=n+5,n+4<=i&&e!==-1?S8(t,e,n,r):t.strategy===qZ||s===i?(lr(t,(a8<<1)+(r?1:0),3),E_(t,os,xc)):(lr(t,(KZ<<1)+(r?1:0),3),iQ(t,t.l_desc.max_code+1,t.d_desc.max_code+1,o+1),E_(t,t.dyn_ltree,t.dyn_dtree)),v8(t),r&&x8(t)},uQ=(t,e,n)=>(t.pending_buf[t.sym_buf+t.sym_next++]=e,t.pending_buf[t.sym_buf+t.sym_next++]=e>>8,t.pending_buf[t.sym_buf+t.sym_next++]=n,e===0?t.dyn_ltree[n*2]++:(t.matches++,e--,t.dyn_ltree[(hf[n]+td+1)*2]++,t.dyn_dtree[g8(e)*2]++),t.sym_next===t.sym_end);var cQ=oQ,fQ=S8,dQ=lQ,hQ=uQ,pQ=aQ,mQ={_tr_init:cQ,_tr_stored_block:fQ,_tr_flush_block:dQ,_tr_tally:hQ,_tr_align:pQ};const gQ=(t,e,n,r)=>{let i=t&65535|0,s=t>>>16&65535|0,o=0;for(;n!==0;){o=n>2e3?2e3:n,n-=o;do i=i+e[r++]|0,s=s+i|0;while(--o);i%=65521,s%=65521}return i|s<<16|0};var mf=gQ;const bQ=()=>{let t,e=[];for(var n=0;n<256;n++){t=n;for(var r=0;r<8;r++)t=t&1?3988292384^t>>>1:t>>>1;e[n]=t}return e},yQ=new Uint32Array(bQ()),vQ=(t,e,n,r)=>{const i=yQ,s=r+n;t^=-1;for(let o=r;o>>8^i[(t^e[o])&255];return t^-1};var dn=vQ,ba={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},nd={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8};const{_tr_init:xQ,_tr_stored_block:Dy,_tr_flush_block:SQ,_tr_tally:oo,_tr_align:EQ}=mQ,{Z_NO_FLUSH:ao,Z_PARTIAL_FLUSH:wQ,Z_FULL_FLUSH:_Q,Z_FINISH:Br,Z_BLOCK:A_,Z_OK:vn,Z_STREAM_END:D_,Z_STREAM_ERROR:$i,Z_DATA_ERROR:CQ,Z_BUF_ERROR:E1,Z_DEFAULT_COMPRESSION:AQ,Z_FILTERED:DQ,Z_HUFFMAN_ONLY:lh,Z_RLE:kQ,Z_FIXED:OQ,Z_DEFAULT_STRATEGY:TQ,Z_UNKNOWN:IQ,Z_DEFLATED:Nm}=nd,PQ=9,RQ=15,NQ=8,MQ=29,FQ=256,ky=FQ+1+MQ,LQ=30,BQ=19,$Q=2*ky+1,zQ=15,Ke=3,Js=258,zi=Js+Ke+1,jQ=32,jl=42,j2=57,Oy=69,Ty=73,Iy=91,Py=103,ea=113,tc=666,Gn=1,yu=2,ya=3,vu=4,VQ=3,ta=(t,e)=>(t.msg=ba[e],e),k_=t=>t*2-(t>4?9:0),Us=t=>{let e=t.length;for(;--e>=0;)t[e]=0},UQ=t=>{let e,n,r,i=t.w_size;e=t.hash_size,r=e;do n=t.head[--r],t.head[r]=n>=i?n-i:0;while(--e);e=i,r=e;do n=t.prev[--r],t.prev[r]=n>=i?n-i:0;while(--e)};let HQ=(t,e,n)=>(e<{const e=t.state;let n=e.pending;n>t.avail_out&&(n=t.avail_out),n!==0&&(t.output.set(e.pending_buf.subarray(e.pending_out,e.pending_out+n),t.next_out),t.next_out+=n,e.pending_out+=n,t.total_out+=n,t.avail_out-=n,e.pending-=n,e.pending===0&&(e.pending_out=0))},Ar=(t,e)=>{SQ(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,vr(t.strm)},st=(t,e)=>{t.pending_buf[t.pending++]=e},ju=(t,e)=>{t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=e&255},Ry=(t,e,n,r)=>{let i=t.avail_in;return i>r&&(i=r),i===0?0:(t.avail_in-=i,e.set(t.input.subarray(t.next_in,t.next_in+i),n),t.state.wrap===1?t.adler=mf(t.adler,e,i,n):t.state.wrap===2&&(t.adler=dn(t.adler,e,i,n)),t.next_in+=i,t.total_in+=i,i)},E8=(t,e)=>{let n=t.max_chain_length,r=t.strstart,i,s,o=t.prev_length,a=t.nice_match;const l=t.strstart>t.w_size-zi?t.strstart-(t.w_size-zi):0,u=t.window,c=t.w_mask,f=t.prev,d=t.strstart+Js;let h=u[r+o-1],p=u[r+o];t.prev_length>=t.good_match&&(n>>=2),a>t.lookahead&&(a=t.lookahead);do if(i=e,!(u[i+o]!==p||u[i+o-1]!==h||u[i]!==u[r]||u[++i]!==u[r+1])){r+=2,i++;do;while(u[++r]===u[++i]&&u[++r]===u[++i]&&u[++r]===u[++i]&&u[++r]===u[++i]&&u[++r]===u[++i]&&u[++r]===u[++i]&&u[++r]===u[++i]&&u[++r]===u[++i]&&ro){if(t.match_start=e,o=s,s>=a)break;h=u[r+o-1],p=u[r+o]}}while((e=f[e&c])>l&&--n!==0);return o<=t.lookahead?o:t.lookahead},Vl=t=>{const e=t.w_size;let n,r,i;do{if(r=t.window_size-t.lookahead-t.strstart,t.strstart>=e+(e-zi)&&(t.window.set(t.window.subarray(e,e+e-r),0),t.match_start-=e,t.strstart-=e,t.block_start-=e,t.insert>t.strstart&&(t.insert=t.strstart),UQ(t),r+=e),t.strm.avail_in===0)break;if(n=Ry(t.strm,t.window,t.strstart+t.lookahead,r),t.lookahead+=n,t.lookahead+t.insert>=Ke)for(i=t.strstart-t.insert,t.ins_h=t.window[i],t.ins_h=lo(t,t.ins_h,t.window[i+1]);t.insert&&(t.ins_h=lo(t,t.ins_h,t.window[i+Ke-1]),t.prev[i&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=i,i++,t.insert--,!(t.lookahead+t.insert{let n=t.pending_buf_size-5>t.w_size?t.w_size:t.pending_buf_size-5,r,i,s,o=0,a=t.strm.avail_in;do{if(r=65535,s=t.bi_valid+42>>3,t.strm.avail_outi+t.strm.avail_in&&(r=i+t.strm.avail_in),r>s&&(r=s),r>8,t.pending_buf[t.pending-2]=~r,t.pending_buf[t.pending-1]=~r>>8,vr(t.strm),i&&(i>r&&(i=r),t.strm.output.set(t.window.subarray(t.block_start,t.block_start+i),t.strm.next_out),t.strm.next_out+=i,t.strm.avail_out-=i,t.strm.total_out+=i,t.block_start+=i,r-=i),r&&(Ry(t.strm,t.strm.output,t.strm.next_out,r),t.strm.next_out+=r,t.strm.avail_out-=r,t.strm.total_out+=r)}while(o===0);return a-=t.strm.avail_in,a&&(a>=t.w_size?(t.matches=2,t.window.set(t.strm.input.subarray(t.strm.next_in-t.w_size,t.strm.next_in),0),t.strstart=t.w_size,t.insert=t.strstart):(t.window_size-t.strstart<=a&&(t.strstart-=t.w_size,t.window.set(t.window.subarray(t.w_size,t.w_size+t.strstart),0),t.matches<2&&t.matches++,t.insert>t.strstart&&(t.insert=t.strstart)),t.window.set(t.strm.input.subarray(t.strm.next_in-a,t.strm.next_in),t.strstart),t.strstart+=a,t.insert+=a>t.w_size-t.insert?t.w_size-t.insert:a),t.block_start=t.strstart),t.high_waters&&t.block_start>=t.w_size&&(t.block_start-=t.w_size,t.strstart-=t.w_size,t.window.set(t.window.subarray(t.w_size,t.w_size+t.strstart),0),t.matches<2&&t.matches++,s+=t.w_size,t.insert>t.strstart&&(t.insert=t.strstart)),s>t.strm.avail_in&&(s=t.strm.avail_in),s&&(Ry(t.strm,t.window,t.strstart,s),t.strstart+=s,t.insert+=s>t.w_size-t.insert?t.w_size-t.insert:s),t.high_water>3,s=t.pending_buf_size-s>65535?65535:t.pending_buf_size-s,n=s>t.w_size?t.w_size:s,i=t.strstart-t.block_start,(i>=n||(i||e===Br)&&e!==ao&&t.strm.avail_in===0&&i<=s)&&(r=i>s?s:i,o=e===Br&&t.strm.avail_in===0&&r===i?1:0,Dy(t,t.block_start,r,o),t.block_start+=r,vr(t.strm)),o?ya:Gn)},w1=(t,e)=>{let n,r;for(;;){if(t.lookahead=Ke&&(t.ins_h=lo(t,t.ins_h,t.window[t.strstart+Ke-1]),n=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),n!==0&&t.strstart-n<=t.w_size-zi&&(t.match_length=E8(t,n)),t.match_length>=Ke)if(r=oo(t,t.strstart-t.match_start,t.match_length-Ke),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=Ke){t.match_length--;do t.strstart++,t.ins_h=lo(t,t.ins_h,t.window[t.strstart+Ke-1]),n=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart;while(--t.match_length!==0);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=lo(t,t.ins_h,t.window[t.strstart+1]);else r=oo(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(r&&(Ar(t,!1),t.strm.avail_out===0))return Gn}return t.insert=t.strstart{let n,r,i;for(;;){if(t.lookahead=Ke&&(t.ins_h=lo(t,t.ins_h,t.window[t.strstart+Ke-1]),n=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=Ke-1,n!==0&&t.prev_length4096)&&(t.match_length=Ke-1)),t.prev_length>=Ke&&t.match_length<=t.prev_length){i=t.strstart+t.lookahead-Ke,r=oo(t,t.strstart-1-t.prev_match,t.prev_length-Ke),t.lookahead-=t.prev_length-1,t.prev_length-=2;do++t.strstart<=i&&(t.ins_h=lo(t,t.ins_h,t.window[t.strstart+Ke-1]),n=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart);while(--t.prev_length!==0);if(t.match_available=0,t.match_length=Ke-1,t.strstart++,r&&(Ar(t,!1),t.strm.avail_out===0))return Gn}else if(t.match_available){if(r=oo(t,0,t.window[t.strstart-1]),r&&Ar(t,!1),t.strstart++,t.lookahead--,t.strm.avail_out===0)return Gn}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(r=oo(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart{let n,r,i,s;const o=t.window;for(;;){if(t.lookahead<=Js){if(Vl(t),t.lookahead<=Js&&e===ao)return Gn;if(t.lookahead===0)break}if(t.match_length=0,t.lookahead>=Ke&&t.strstart>0&&(i=t.strstart-1,r=o[i],r===o[++i]&&r===o[++i]&&r===o[++i])){s=t.strstart+Js;do;while(r===o[++i]&&r===o[++i]&&r===o[++i]&&r===o[++i]&&r===o[++i]&&r===o[++i]&&r===o[++i]&&r===o[++i]&&it.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=Ke?(n=oo(t,1,t.match_length-Ke),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(n=oo(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),n&&(Ar(t,!1),t.strm.avail_out===0))return Gn}return t.insert=0,e===Br?(Ar(t,!0),t.strm.avail_out===0?ya:vu):t.sym_next&&(Ar(t,!1),t.strm.avail_out===0)?Gn:yu},GQ=(t,e)=>{let n;for(;;){if(t.lookahead===0&&(Vl(t),t.lookahead===0)){if(e===ao)return Gn;break}if(t.match_length=0,n=oo(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,n&&(Ar(t,!1),t.strm.avail_out===0))return Gn}return t.insert=0,e===Br?(Ar(t,!0),t.strm.avail_out===0?ya:vu):t.sym_next&&(Ar(t,!1),t.strm.avail_out===0)?Gn:yu};function Si(t,e,n,r,i){this.good_length=t,this.max_lazy=e,this.nice_length=n,this.max_chain=r,this.func=i}const nc=[new Si(0,0,0,0,w8),new Si(4,4,8,4,w1),new Si(4,5,16,8,w1),new Si(4,6,32,32,w1),new Si(4,4,16,16,ja),new Si(8,16,32,32,ja),new Si(8,16,128,128,ja),new Si(8,32,128,256,ja),new Si(32,128,258,1024,ja),new Si(32,258,258,4096,ja)],WQ=t=>{t.window_size=2*t.w_size,Us(t.head),t.max_lazy_match=nc[t.level].max_lazy,t.good_match=nc[t.level].good_length,t.nice_match=nc[t.level].nice_length,t.max_chain_length=nc[t.level].max_chain,t.strstart=0,t.block_start=0,t.lookahead=0,t.insert=0,t.match_length=t.prev_length=Ke-1,t.match_available=0,t.ins_h=0};function KQ(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=Nm,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array($Q*2),this.dyn_dtree=new Uint16Array((2*LQ+1)*2),this.bl_tree=new Uint16Array((2*BQ+1)*2),Us(this.dyn_ltree),Us(this.dyn_dtree),Us(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(zQ+1),this.heap=new Uint16Array(2*ky+1),Us(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(2*ky+1),Us(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}const rd=t=>{if(!t)return 1;const e=t.state;return!e||e.strm!==t||e.status!==jl&&e.status!==j2&&e.status!==Oy&&e.status!==Ty&&e.status!==Iy&&e.status!==Py&&e.status!==ea&&e.status!==tc?1:0},_8=t=>{if(rd(t))return ta(t,$i);t.total_in=t.total_out=0,t.data_type=IQ;const e=t.state;return e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap===2?j2:e.wrap?jl:ea,t.adler=e.wrap===2?0:1,e.last_flush=-2,xQ(e),vn},C8=t=>{const e=_8(t);return e===vn&&WQ(t.state),e},XQ=(t,e)=>rd(t)||t.state.wrap!==2?$i:(t.state.gzhead=e,vn),A8=(t,e,n,r,i,s)=>{if(!t)return $i;let o=1;if(e===AQ&&(e=6),r<0?(o=0,r=-r):r>15&&(o=2,r-=16),i<1||i>PQ||n!==Nm||r<8||r>15||e<0||e>9||s<0||s>OQ||r===8&&o!==1)return ta(t,$i);r===8&&(r=9);const a=new KQ;return t.state=a,a.strm=t,a.status=jl,a.wrap=o,a.gzhead=null,a.w_bits=r,a.w_size=1<A8(t,e,Nm,RQ,NQ,TQ),JQ=(t,e)=>{if(rd(t)||e>A_||e<0)return t?ta(t,$i):$i;const n=t.state;if(!t.output||t.avail_in!==0&&!t.input||n.status===tc&&e!==Br)return ta(t,t.avail_out===0?E1:$i);const r=n.last_flush;if(n.last_flush=e,n.pending!==0){if(vr(t),t.avail_out===0)return n.last_flush=-1,vn}else if(t.avail_in===0&&k_(e)<=k_(r)&&e!==Br)return ta(t,E1);if(n.status===tc&&t.avail_in!==0)return ta(t,E1);if(n.status===jl&&n.wrap===0&&(n.status=ea),n.status===jl){let i=Nm+(n.w_bits-8<<4)<<8,s=-1;if(n.strategy>=lh||n.level<2?s=0:n.level<6?s=1:n.level===6?s=2:s=3,i|=s<<6,n.strstart!==0&&(i|=jQ),i+=31-i%31,ju(n,i),n.strstart!==0&&(ju(n,t.adler>>>16),ju(n,t.adler&65535)),t.adler=1,n.status=ea,vr(t),n.pending!==0)return n.last_flush=-1,vn}if(n.status===j2){if(t.adler=0,st(n,31),st(n,139),st(n,8),n.gzhead)st(n,(n.gzhead.text?1:0)+(n.gzhead.hcrc?2:0)+(n.gzhead.extra?4:0)+(n.gzhead.name?8:0)+(n.gzhead.comment?16:0)),st(n,n.gzhead.time&255),st(n,n.gzhead.time>>8&255),st(n,n.gzhead.time>>16&255),st(n,n.gzhead.time>>24&255),st(n,n.level===9?2:n.strategy>=lh||n.level<2?4:0),st(n,n.gzhead.os&255),n.gzhead.extra&&n.gzhead.extra.length&&(st(n,n.gzhead.extra.length&255),st(n,n.gzhead.extra.length>>8&255)),n.gzhead.hcrc&&(t.adler=dn(t.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=Oy;else if(st(n,0),st(n,0),st(n,0),st(n,0),st(n,0),st(n,n.level===9?2:n.strategy>=lh||n.level<2?4:0),st(n,VQ),n.status=ea,vr(t),n.pending!==0)return n.last_flush=-1,vn}if(n.status===Oy){if(n.gzhead.extra){let i=n.pending,s=(n.gzhead.extra.length&65535)-n.gzindex;for(;n.pending+s>n.pending_buf_size;){let a=n.pending_buf_size-n.pending;if(n.pending_buf.set(n.gzhead.extra.subarray(n.gzindex,n.gzindex+a),n.pending),n.pending=n.pending_buf_size,n.gzhead.hcrc&&n.pending>i&&(t.adler=dn(t.adler,n.pending_buf,n.pending-i,i)),n.gzindex+=a,vr(t),n.pending!==0)return n.last_flush=-1,vn;i=0,s-=a}let o=new Uint8Array(n.gzhead.extra);n.pending_buf.set(o.subarray(n.gzindex,n.gzindex+s),n.pending),n.pending+=s,n.gzhead.hcrc&&n.pending>i&&(t.adler=dn(t.adler,n.pending_buf,n.pending-i,i)),n.gzindex=0}n.status=Ty}if(n.status===Ty){if(n.gzhead.name){let i=n.pending,s;do{if(n.pending===n.pending_buf_size){if(n.gzhead.hcrc&&n.pending>i&&(t.adler=dn(t.adler,n.pending_buf,n.pending-i,i)),vr(t),n.pending!==0)return n.last_flush=-1,vn;i=0}n.gzindexi&&(t.adler=dn(t.adler,n.pending_buf,n.pending-i,i)),n.gzindex=0}n.status=Iy}if(n.status===Iy){if(n.gzhead.comment){let i=n.pending,s;do{if(n.pending===n.pending_buf_size){if(n.gzhead.hcrc&&n.pending>i&&(t.adler=dn(t.adler,n.pending_buf,n.pending-i,i)),vr(t),n.pending!==0)return n.last_flush=-1,vn;i=0}n.gzindexi&&(t.adler=dn(t.adler,n.pending_buf,n.pending-i,i))}n.status=Py}if(n.status===Py){if(n.gzhead.hcrc){if(n.pending+2>n.pending_buf_size&&(vr(t),n.pending!==0))return n.last_flush=-1,vn;st(n,t.adler&255),st(n,t.adler>>8&255),t.adler=0}if(n.status=ea,vr(t),n.pending!==0)return n.last_flush=-1,vn}if(t.avail_in!==0||n.lookahead!==0||e!==ao&&n.status!==tc){let i=n.level===0?w8(n,e):n.strategy===lh?GQ(n,e):n.strategy===kQ?qQ(n,e):nc[n.level].func(n,e);if((i===ya||i===vu)&&(n.status=tc),i===Gn||i===ya)return t.avail_out===0&&(n.last_flush=-1),vn;if(i===yu&&(e===wQ?EQ(n):e!==A_&&(Dy(n,0,0,!1),e===_Q&&(Us(n.head),n.lookahead===0&&(n.strstart=0,n.block_start=0,n.insert=0))),vr(t),t.avail_out===0))return n.last_flush=-1,vn}return e!==Br?vn:n.wrap<=0?D_:(n.wrap===2?(st(n,t.adler&255),st(n,t.adler>>8&255),st(n,t.adler>>16&255),st(n,t.adler>>24&255),st(n,t.total_in&255),st(n,t.total_in>>8&255),st(n,t.total_in>>16&255),st(n,t.total_in>>24&255)):(ju(n,t.adler>>>16),ju(n,t.adler&65535)),vr(t),n.wrap>0&&(n.wrap=-n.wrap),n.pending!==0?vn:D_)},ZQ=t=>{if(rd(t))return $i;const e=t.state.status;return t.state=null,e===ea?ta(t,CQ):vn},QQ=(t,e)=>{let n=e.length;if(rd(t))return $i;const r=t.state,i=r.wrap;if(i===2||i===1&&r.status!==jl||r.lookahead)return $i;if(i===1&&(t.adler=mf(t.adler,e,n,0)),r.wrap=0,n>=r.w_size){i===0&&(Us(r.head),r.strstart=0,r.block_start=0,r.insert=0);let l=new Uint8Array(r.w_size);l.set(e.subarray(n-r.w_size,n),0),e=l,n=r.w_size}const s=t.avail_in,o=t.next_in,a=t.input;for(t.avail_in=n,t.next_in=0,t.input=e,Vl(r);r.lookahead>=Ke;){let l=r.strstart,u=r.lookahead-(Ke-1);do r.ins_h=lo(r,r.ins_h,r.window[l+Ke-1]),r.prev[l&r.w_mask]=r.head[r.ins_h],r.head[r.ins_h]=l,l++;while(--u);r.strstart=l,r.lookahead=Ke-1,Vl(r)}return r.strstart+=r.lookahead,r.block_start=r.strstart,r.insert=r.lookahead,r.lookahead=0,r.match_length=r.prev_length=Ke-1,r.match_available=0,t.next_in=o,t.input=a,t.avail_in=s,r.wrap=i,vn};var eee=YQ,tee=A8,nee=C8,ree=_8,iee=XQ,see=JQ,oee=ZQ,aee=QQ,lee="pako deflate (from Nodeca project)",Sc={deflateInit:eee,deflateInit2:tee,deflateReset:nee,deflateResetKeep:ree,deflateSetHeader:iee,deflate:see,deflateEnd:oee,deflateSetDictionary:aee,deflateInfo:lee};const uee=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);var cee=function(t){const e=Array.prototype.slice.call(arguments,1);for(;e.length;){const n=e.shift();if(n){if(typeof n!="object")throw new TypeError(n+"must be non-object");for(const r in n)uee(n,r)&&(t[r]=n[r])}}return t},fee=t=>{let e=0;for(let r=0,i=t.length;r=252?6:t>=248?5:t>=240?4:t>=224?3:t>=192?2:1;gf[254]=gf[254]=1;var dee=t=>{if(typeof TextEncoder=="function"&&TextEncoder.prototype.encode)return new TextEncoder().encode(t);let e,n,r,i,s,o=t.length,a=0;for(i=0;i>>6,e[s++]=128|n&63):n<65536?(e[s++]=224|n>>>12,e[s++]=128|n>>>6&63,e[s++]=128|n&63):(e[s++]=240|n>>>18,e[s++]=128|n>>>12&63,e[s++]=128|n>>>6&63,e[s++]=128|n&63);return e};const hee=(t,e)=>{if(e<65534&&t.subarray&&D8)return String.fromCharCode.apply(null,t.length===e?t:t.subarray(0,e));let n="";for(let r=0;r{const n=e||t.length;if(typeof TextDecoder=="function"&&TextDecoder.prototype.decode)return new TextDecoder().decode(t.subarray(0,e));let r,i;const s=new Array(n*2);for(i=0,r=0;r4){s[i++]=65533,r+=a-1;continue}for(o&=a===2?31:a===3?15:7;a>1&&r1){s[i++]=65533;continue}o<65536?s[i++]=o:(o-=65536,s[i++]=55296|o>>10&1023,s[i++]=56320|o&1023)}return hee(s,i)},mee=(t,e)=>{e=e||t.length,e>t.length&&(e=t.length);let n=e-1;for(;n>=0&&(t[n]&192)===128;)n--;return n<0||n===0?e:n+gf[t[n]]>e?n:e},bf={string2buf:dee,buf2string:pee,utf8border:mee};function gee(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}var k8=gee;const O8=Object.prototype.toString,{Z_NO_FLUSH:bee,Z_SYNC_FLUSH:yee,Z_FULL_FLUSH:vee,Z_FINISH:xee,Z_OK:g0,Z_STREAM_END:See,Z_DEFAULT_COMPRESSION:Eee,Z_DEFAULT_STRATEGY:wee,Z_DEFLATED:_ee}=nd;function id(t){this.options=Mm.assign({level:Eee,method:_ee,chunkSize:16384,windowBits:15,memLevel:8,strategy:wee},t||{});let e=this.options;e.raw&&e.windowBits>0?e.windowBits=-e.windowBits:e.gzip&&e.windowBits>0&&e.windowBits<16&&(e.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new k8,this.strm.avail_out=0;let n=Sc.deflateInit2(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(n!==g0)throw new Error(ba[n]);if(e.header&&Sc.deflateSetHeader(this.strm,e.header),e.dictionary){let r;if(typeof e.dictionary=="string"?r=bf.string2buf(e.dictionary):O8.call(e.dictionary)==="[object ArrayBuffer]"?r=new Uint8Array(e.dictionary):r=e.dictionary,n=Sc.deflateSetDictionary(this.strm,r),n!==g0)throw new Error(ba[n]);this._dict_set=!0}}id.prototype.push=function(t,e){const n=this.strm,r=this.options.chunkSize;let i,s;if(this.ended)return!1;for(e===~~e?s=e:s=e===!0?xee:bee,typeof t=="string"?n.input=bf.string2buf(t):O8.call(t)==="[object ArrayBuffer]"?n.input=new Uint8Array(t):n.input=t,n.next_in=0,n.avail_in=n.input.length;;){if(n.avail_out===0&&(n.output=new Uint8Array(r),n.next_out=0,n.avail_out=r),(s===yee||s===vee)&&n.avail_out<=6){this.onData(n.output.subarray(0,n.next_out)),n.avail_out=0;continue}if(i=Sc.deflate(n,s),i===See)return n.next_out>0&&this.onData(n.output.subarray(0,n.next_out)),i=Sc.deflateEnd(this.strm),this.onEnd(i),this.ended=!0,i===g0;if(n.avail_out===0){this.onData(n.output);continue}if(s>0&&n.next_out>0){this.onData(n.output.subarray(0,n.next_out)),n.avail_out=0;continue}if(n.avail_in===0)break}return!0};id.prototype.onData=function(t){this.chunks.push(t)};id.prototype.onEnd=function(t){t===g0&&(this.result=Mm.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};function V2(t,e){const n=new id(e);if(n.push(t,!0),n.err)throw n.msg||ba[n.err];return n.result}function Cee(t,e){return e=e||{},e.raw=!0,V2(t,e)}function Aee(t,e){return e=e||{},e.gzip=!0,V2(t,e)}var Dee=id,kee=V2,Oee=Cee,Tee=Aee,Iee={Deflate:Dee,deflate:kee,deflateRaw:Oee,gzip:Tee};const uh=16209,Pee=16191;var Ree=function(e,n){let r,i,s,o,a,l,u,c,f,d,h,p,m,g,b,y,x,S,E,C,w,A,_,O;const I=e.state;r=e.next_in,_=e.input,i=r+(e.avail_in-5),s=e.next_out,O=e.output,o=s-(n-e.avail_out),a=s+(e.avail_out-257),l=I.dmax,u=I.wsize,c=I.whave,f=I.wnext,d=I.window,h=I.hold,p=I.bits,m=I.lencode,g=I.distcode,b=(1<>>24,h>>>=S,p-=S,S=x>>>16&255,S===0)O[s++]=x&65535;else if(S&16){E=x&65535,S&=15,S&&(p>>=S,p-=S),p<15&&(h+=_[r++]<>>24,h>>>=S,p-=S,S=x>>>16&255,S&16){if(C=x&65535,S&=15,pl){e.msg="invalid distance too far back",I.mode=uh;break e}if(h>>>=S,p-=S,S=s-o,C>S){if(S=C-S,S>c&&I.sane){e.msg="invalid distance too far back",I.mode=uh;break e}if(w=0,A=d,f===0){if(w+=u-S,S2;)O[s++]=A[w++],O[s++]=A[w++],O[s++]=A[w++],E-=3;E&&(O[s++]=A[w++],E>1&&(O[s++]=A[w++]))}else{w=s-C;do O[s++]=O[w++],O[s++]=O[w++],O[s++]=O[w++],E-=3;while(E>2);E&&(O[s++]=O[w++],E>1&&(O[s++]=O[w++]))}}else if((S&64)===0){x=g[(x&65535)+(h&(1<>3,r-=E,p-=E<<3,h&=(1<{const l=a.bits;let u=0,c=0,f=0,d=0,h=0,p=0,m=0,g=0,b=0,y=0,x,S,E,C,w,A=null,_;const O=new Uint16Array(Va+1),I=new Uint16Array(Va+1);let N=null,P,R,F;for(u=0;u<=Va;u++)O[u]=0;for(c=0;c=1&&O[d]===0;d--);if(h>d&&(h=d),d===0)return i[s++]=1<<24|64<<16|0,i[s++]=1<<24|64<<16|0,a.bits=1,0;for(f=1;f0&&(t===I_||d!==1))return-1;for(I[1]=0,u=1;uO_||t===P_&&b>T_)return 1;for(;;){P=u-m,o[c]+1<_?(R=0,F=o[c]):o[c]>=_?(R=N[o[c]-_],F=A[o[c]-_]):(R=96,F=0),x=1<>m)+S]=P<<24|R<<16|F|0;while(S!==0);for(x=1<>=1;if(x!==0?(y&=x-1,y+=x):y=0,c++,--O[u]===0){if(u===d)break;u=e[n+o[c]]}if(u>h&&(y&C)!==E){for(m===0&&(m=h),w+=f,p=u-m,g=1<O_||t===P_&&b>T_)return 1;E=y&C,i[E]=h<<24|p<<16|w-s|0}}return y!==0&&(i[w+y]=u-m<<24|64<<16|0),a.bits=h,0};var Ec=Bee;const $ee=0,T8=1,I8=2,{Z_FINISH:R_,Z_BLOCK:zee,Z_TREES:ch,Z_OK:va,Z_STREAM_END:jee,Z_NEED_DICT:Vee,Z_STREAM_ERROR:Kr,Z_DATA_ERROR:P8,Z_MEM_ERROR:R8,Z_BUF_ERROR:Uee,Z_DEFLATED:N_}=nd,Fm=16180,M_=16181,F_=16182,L_=16183,B_=16184,$_=16185,z_=16186,j_=16187,V_=16188,U_=16189,b0=16190,es=16191,C1=16192,H_=16193,A1=16194,q_=16195,G_=16196,W_=16197,K_=16198,fh=16199,dh=16200,X_=16201,Y_=16202,J_=16203,Z_=16204,Q_=16205,D1=16206,eC=16207,tC=16208,wt=16209,N8=16210,M8=16211,Hee=852,qee=592,Gee=15,Wee=Gee,nC=t=>(t>>>24&255)+(t>>>8&65280)+((t&65280)<<8)+((t&255)<<24);function Kee(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}const Na=t=>{if(!t)return 1;const e=t.state;return!e||e.strm!==t||e.modeM8?1:0},F8=t=>{if(Na(t))return Kr;const e=t.state;return t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=e.wrap&1),e.mode=Fm,e.last=0,e.havedict=0,e.flags=-1,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new Int32Array(Hee),e.distcode=e.distdyn=new Int32Array(qee),e.sane=1,e.back=-1,va},L8=t=>{if(Na(t))return Kr;const e=t.state;return e.wsize=0,e.whave=0,e.wnext=0,F8(t)},B8=(t,e)=>{let n;if(Na(t))return Kr;const r=t.state;return e<0?(n=0,e=-e):(n=(e>>4)+5,e<48&&(e&=15)),e&&(e<8||e>15)?Kr:(r.window!==null&&r.wbits!==e&&(r.window=null),r.wrap=n,r.wbits=e,L8(t))},$8=(t,e)=>{if(!t)return Kr;const n=new Kee;t.state=n,n.strm=t,n.window=null,n.mode=Fm;const r=B8(t,e);return r!==va&&(t.state=null),r},Xee=t=>$8(t,Wee);let rC=!0,k1,O1;const Yee=t=>{if(rC){k1=new Int32Array(512),O1=new Int32Array(32);let e=0;for(;e<144;)t.lens[e++]=8;for(;e<256;)t.lens[e++]=9;for(;e<280;)t.lens[e++]=7;for(;e<288;)t.lens[e++]=8;for(Ec(T8,t.lens,0,288,k1,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;Ec(I8,t.lens,0,32,O1,0,t.work,{bits:5}),rC=!1}t.lencode=k1,t.lenbits=9,t.distcode=O1,t.distbits=5},z8=(t,e,n,r)=>{let i;const s=t.state;return s.window===null&&(s.wsize=1<=s.wsize?(s.window.set(e.subarray(n-s.wsize,n),0),s.wnext=0,s.whave=s.wsize):(i=s.wsize-s.wnext,i>r&&(i=r),s.window.set(e.subarray(n-r,n-r+i),s.wnext),r-=i,r?(s.window.set(e.subarray(n-r,n),0),s.wnext=r,s.whave=s.wsize):(s.wnext+=i,s.wnext===s.wsize&&(s.wnext=0),s.whave{let n,r,i,s,o,a,l,u,c,f,d,h,p,m,g=0,b,y,x,S,E,C,w,A;const _=new Uint8Array(4);let O,I;const N=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(Na(t)||!t.output||!t.input&&t.avail_in!==0)return Kr;n=t.state,n.mode===es&&(n.mode=C1),o=t.next_out,i=t.output,l=t.avail_out,s=t.next_in,r=t.input,a=t.avail_in,u=n.hold,c=n.bits,f=a,d=l,A=va;e:for(;;)switch(n.mode){case Fm:if(n.wrap===0){n.mode=C1;break}for(;c<16;){if(a===0)break e;a--,u+=r[s++]<>>8&255,n.check=dn(n.check,_,2,0),u=0,c=0,n.mode=M_;break}if(n.head&&(n.head.done=!1),!(n.wrap&1)||(((u&255)<<8)+(u>>8))%31){t.msg="incorrect header check",n.mode=wt;break}if((u&15)!==N_){t.msg="unknown compression method",n.mode=wt;break}if(u>>>=4,c-=4,w=(u&15)+8,n.wbits===0&&(n.wbits=w),w>15||w>n.wbits){t.msg="invalid window size",n.mode=wt;break}n.dmax=1<>8&1),n.flags&512&&n.wrap&4&&(_[0]=u&255,_[1]=u>>>8&255,n.check=dn(n.check,_,2,0)),u=0,c=0,n.mode=F_;case F_:for(;c<32;){if(a===0)break e;a--,u+=r[s++]<>>8&255,_[2]=u>>>16&255,_[3]=u>>>24&255,n.check=dn(n.check,_,4,0)),u=0,c=0,n.mode=L_;case L_:for(;c<16;){if(a===0)break e;a--,u+=r[s++]<>8),n.flags&512&&n.wrap&4&&(_[0]=u&255,_[1]=u>>>8&255,n.check=dn(n.check,_,2,0)),u=0,c=0,n.mode=B_;case B_:if(n.flags&1024){for(;c<16;){if(a===0)break e;a--,u+=r[s++]<>>8&255,n.check=dn(n.check,_,2,0)),u=0,c=0}else n.head&&(n.head.extra=null);n.mode=$_;case $_:if(n.flags&1024&&(h=n.length,h>a&&(h=a),h&&(n.head&&(w=n.head.extra_len-n.length,n.head.extra||(n.head.extra=new Uint8Array(n.head.extra_len)),n.head.extra.set(r.subarray(s,s+h),w)),n.flags&512&&n.wrap&4&&(n.check=dn(n.check,r,h,s)),a-=h,s+=h,n.length-=h),n.length))break e;n.length=0,n.mode=z_;case z_:if(n.flags&2048){if(a===0)break e;h=0;do w=r[s+h++],n.head&&w&&n.length<65536&&(n.head.name+=String.fromCharCode(w));while(w&&h>9&1,n.head.done=!0),t.adler=n.check=0,n.mode=es;break;case U_:for(;c<32;){if(a===0)break e;a--,u+=r[s++]<>>=c&7,c-=c&7,n.mode=D1;break}for(;c<3;){if(a===0)break e;a--,u+=r[s++]<>>=1,c-=1,u&3){case 0:n.mode=H_;break;case 1:if(Yee(n),n.mode=fh,e===ch){u>>>=2,c-=2;break e}break;case 2:n.mode=G_;break;case 3:t.msg="invalid block type",n.mode=wt}u>>>=2,c-=2;break;case H_:for(u>>>=c&7,c-=c&7;c<32;){if(a===0)break e;a--,u+=r[s++]<>>16^65535)){t.msg="invalid stored block lengths",n.mode=wt;break}if(n.length=u&65535,u=0,c=0,n.mode=A1,e===ch)break e;case A1:n.mode=q_;case q_:if(h=n.length,h){if(h>a&&(h=a),h>l&&(h=l),h===0)break e;i.set(r.subarray(s,s+h),o),a-=h,s+=h,l-=h,o+=h,n.length-=h;break}n.mode=es;break;case G_:for(;c<14;){if(a===0)break e;a--,u+=r[s++]<>>=5,c-=5,n.ndist=(u&31)+1,u>>>=5,c-=5,n.ncode=(u&15)+4,u>>>=4,c-=4,n.nlen>286||n.ndist>30){t.msg="too many length or distance symbols",n.mode=wt;break}n.have=0,n.mode=W_;case W_:for(;n.have>>=3,c-=3}for(;n.have<19;)n.lens[N[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,O={bits:n.lenbits},A=Ec($ee,n.lens,0,19,n.lencode,0,n.work,O),n.lenbits=O.bits,A){t.msg="invalid code lengths set",n.mode=wt;break}n.have=0,n.mode=K_;case K_:for(;n.have>>24,y=g>>>16&255,x=g&65535,!(b<=c);){if(a===0)break e;a--,u+=r[s++]<>>=b,c-=b,n.lens[n.have++]=x;else{if(x===16){for(I=b+2;c>>=b,c-=b,n.have===0){t.msg="invalid bit length repeat",n.mode=wt;break}w=n.lens[n.have-1],h=3+(u&3),u>>>=2,c-=2}else if(x===17){for(I=b+3;c>>=b,c-=b,w=0,h=3+(u&7),u>>>=3,c-=3}else{for(I=b+7;c>>=b,c-=b,w=0,h=11+(u&127),u>>>=7,c-=7}if(n.have+h>n.nlen+n.ndist){t.msg="invalid bit length repeat",n.mode=wt;break}for(;h--;)n.lens[n.have++]=w}}if(n.mode===wt)break;if(n.lens[256]===0){t.msg="invalid code -- missing end-of-block",n.mode=wt;break}if(n.lenbits=9,O={bits:n.lenbits},A=Ec(T8,n.lens,0,n.nlen,n.lencode,0,n.work,O),n.lenbits=O.bits,A){t.msg="invalid literal/lengths set",n.mode=wt;break}if(n.distbits=6,n.distcode=n.distdyn,O={bits:n.distbits},A=Ec(I8,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,O),n.distbits=O.bits,A){t.msg="invalid distances set",n.mode=wt;break}if(n.mode=fh,e===ch)break e;case fh:n.mode=dh;case dh:if(a>=6&&l>=258){t.next_out=o,t.avail_out=l,t.next_in=s,t.avail_in=a,n.hold=u,n.bits=c,Ree(t,d),o=t.next_out,i=t.output,l=t.avail_out,s=t.next_in,r=t.input,a=t.avail_in,u=n.hold,c=n.bits,n.mode===es&&(n.back=-1);break}for(n.back=0;g=n.lencode[u&(1<>>24,y=g>>>16&255,x=g&65535,!(b<=c);){if(a===0)break e;a--,u+=r[s++]<>S)],b=g>>>24,y=g>>>16&255,x=g&65535,!(S+b<=c);){if(a===0)break e;a--,u+=r[s++]<>>=S,c-=S,n.back+=S}if(u>>>=b,c-=b,n.back+=b,n.length=x,y===0){n.mode=Q_;break}if(y&32){n.back=-1,n.mode=es;break}if(y&64){t.msg="invalid literal/length code",n.mode=wt;break}n.extra=y&15,n.mode=X_;case X_:if(n.extra){for(I=n.extra;c>>=n.extra,c-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=Y_;case Y_:for(;g=n.distcode[u&(1<>>24,y=g>>>16&255,x=g&65535,!(b<=c);){if(a===0)break e;a--,u+=r[s++]<>S)],b=g>>>24,y=g>>>16&255,x=g&65535,!(S+b<=c);){if(a===0)break e;a--,u+=r[s++]<>>=S,c-=S,n.back+=S}if(u>>>=b,c-=b,n.back+=b,y&64){t.msg="invalid distance code",n.mode=wt;break}n.offset=x,n.extra=y&15,n.mode=J_;case J_:if(n.extra){for(I=n.extra;c>>=n.extra,c-=n.extra,n.back+=n.extra}if(n.offset>n.dmax){t.msg="invalid distance too far back",n.mode=wt;break}n.mode=Z_;case Z_:if(l===0)break e;if(h=d-l,n.offset>h){if(h=n.offset-h,h>n.whave&&n.sane){t.msg="invalid distance too far back",n.mode=wt;break}h>n.wnext?(h-=n.wnext,p=n.wsize-h):p=n.wnext-h,h>n.length&&(h=n.length),m=n.window}else m=i,p=o-n.offset,h=n.length;h>l&&(h=l),l-=h,n.length-=h;do i[o++]=m[p++];while(--h);n.length===0&&(n.mode=dh);break;case Q_:if(l===0)break e;i[o++]=n.length,l--,n.mode=dh;break;case D1:if(n.wrap){for(;c<32;){if(a===0)break e;a--,u|=r[s++]<{if(Na(t))return Kr;let e=t.state;return e.window&&(e.window=null),t.state=null,va},Qee=(t,e)=>{if(Na(t))return Kr;const n=t.state;return(n.wrap&2)===0?Kr:(n.head=e,e.done=!1,va)},ete=(t,e)=>{const n=e.length;let r,i,s;return Na(t)||(r=t.state,r.wrap!==0&&r.mode!==b0)?Kr:r.mode===b0&&(i=1,i=mf(i,e,n,0),i!==r.check)?P8:(s=z8(t,e,n,n),s?(r.mode=N8,R8):(r.havedict=1,va))};var tte=L8,nte=B8,rte=F8,ite=Xee,ste=$8,ote=Jee,ate=Zee,lte=Qee,ute=ete,cte="pako inflate (from Nodeca project)",as={inflateReset:tte,inflateReset2:nte,inflateResetKeep:rte,inflateInit:ite,inflateInit2:ste,inflate:ote,inflateEnd:ate,inflateGetHeader:lte,inflateSetDictionary:ute,inflateInfo:cte};function fte(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}var dte=fte;const j8=Object.prototype.toString,{Z_NO_FLUSH:hte,Z_FINISH:pte,Z_OK:yf,Z_STREAM_END:T1,Z_NEED_DICT:I1,Z_STREAM_ERROR:mte,Z_DATA_ERROR:iC,Z_MEM_ERROR:gte}=nd;function sd(t){this.options=Mm.assign({chunkSize:1024*64,windowBits:15,to:""},t||{});const e=this.options;e.raw&&e.windowBits>=0&&e.windowBits<16&&(e.windowBits=-e.windowBits,e.windowBits===0&&(e.windowBits=-15)),e.windowBits>=0&&e.windowBits<16&&!(t&&t.windowBits)&&(e.windowBits+=32),e.windowBits>15&&e.windowBits<48&&(e.windowBits&15)===0&&(e.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new k8,this.strm.avail_out=0;let n=as.inflateInit2(this.strm,e.windowBits);if(n!==yf)throw new Error(ba[n]);if(this.header=new dte,as.inflateGetHeader(this.strm,this.header),e.dictionary&&(typeof e.dictionary=="string"?e.dictionary=bf.string2buf(e.dictionary):j8.call(e.dictionary)==="[object ArrayBuffer]"&&(e.dictionary=new Uint8Array(e.dictionary)),e.raw&&(n=as.inflateSetDictionary(this.strm,e.dictionary),n!==yf)))throw new Error(ba[n])}sd.prototype.push=function(t,e){const n=this.strm,r=this.options.chunkSize,i=this.options.dictionary;let s,o,a;if(this.ended)return!1;for(e===~~e?o=e:o=e===!0?pte:hte,j8.call(t)==="[object ArrayBuffer]"?n.input=new Uint8Array(t):n.input=t,n.next_in=0,n.avail_in=n.input.length;;){for(n.avail_out===0&&(n.output=new Uint8Array(r),n.next_out=0,n.avail_out=r),s=as.inflate(n,o),s===I1&&i&&(s=as.inflateSetDictionary(n,i),s===yf?s=as.inflate(n,o):s===iC&&(s=I1));n.avail_in>0&&s===T1&&n.state.wrap>0&&t[n.next_in]!==0;)as.inflateReset(n),s=as.inflate(n,o);switch(s){case mte:case iC:case I1:case gte:return this.onEnd(s),this.ended=!0,!1}if(a=n.avail_out,n.next_out&&(n.avail_out===0||s===T1))if(this.options.to==="string"){let l=bf.utf8border(n.output,n.next_out),u=n.next_out-l,c=bf.buf2string(n.output,l);n.next_out=u,n.avail_out=r-u,u&&n.output.set(n.output.subarray(l,l+u),0),this.onData(c)}else this.onData(n.output.length===n.next_out?n.output:n.output.subarray(0,n.next_out));if(!(s===yf&&a===0)){if(s===T1)return s=as.inflateEnd(this.strm),this.onEnd(s),this.ended=!0,!0;if(n.avail_in===0)break}}return!0};sd.prototype.onData=function(t){this.chunks.push(t)};sd.prototype.onEnd=function(t){t===yf&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=Mm.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};function U2(t,e){const n=new sd(e);if(n.push(t),n.err)throw n.msg||ba[n.err];return n.result}function bte(t,e){return e=e||{},e.raw=!0,U2(t,e)}var yte=sd,vte=U2,xte=bte,Ste=U2,Ete={Inflate:yte,inflate:vte,inflateRaw:xte,ungzip:Ste};const{Deflate:wte,deflate:_te,deflateRaw:Cte,gzip:Ate}=Iee,{Inflate:Dte,inflate:kte,inflateRaw:Ote,ungzip:Tte}=Ete;var Ite=wte,Pte=_te,Rte=Cte,Nte=Ate,Mte=Dte,Fte=kte,Lte=Ote,Bte=Tte,$te=nd,zte={Deflate:Ite,deflate:Pte,deflateRaw:Rte,gzip:Nte,Inflate:Mte,inflate:Fte,inflateRaw:Lte,ungzip:Bte,constants:$te};function jte(t,e,n,r){const i={method:t.method,endpoint:t.endpoint,headers:t.headers.map(u=>({key:u.key,value:u.value})),queryParameters:t.queryParameters.map(u=>({key:u.key,value:u.value,type:u.type})),body:t.body,payloadType:t.payloadType,authorization:{type:t.authorization.type,value:t.authorization.value},applicationKey:r};e&&(i.response={status:e.status,statusCode:e.statusCode,statusText:e.statusText,body:e.body,sizeInBytes:e.sizeInBytes,headers:e.headers.map(u=>({key:u.key,value:u.value})),cookies:e.cookies.map(u=>({key:u.key,value:u.value})),timestamp:e.timestamp,durationInMs:(n==null?void 0:n.durationInMs)??0}),n&&(i.requestLog=n);const s=JSON.stringify(i),o=zte.deflate(s);return btoa(String.fromCharCode.apply(null,Array.from(o))).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}function Vte(t,e){const n=window.location.origin,r=t.startsWith("/")?t:`/${t}`;return`${n}${r}?share=${e}`}const Ute={class:"flex min-h-0 flex-1 flex-col space-y-2.5"},Hte={key:0,class:"bg-warning/10 dark:bg-warning/20 rounded-md p-2.5"},qte={class:"flex min-h-0 flex-1 flex-col space-y-2.5"},Gte={class:"flex items-center justify-end"},Wte={class:"bg-subtle text-foreground h-full min-h-0 flex-1 overflow-auto rounded-md border p-2.5 font-mono text-xs leading-relaxed break-all whitespace-break-spaces"},Kte={class:"flex justify-end border-t pt-2.5"},Xte=z({__name:"CurlExportDialog",props:{open:{type:Boolean},command:{},hasSpecialAuth:{type:Boolean}},emits:["update:open"],setup(t,{emit:e}){const n=t,r=e,{copy:i,copied:s}=Co(),o=()=>{i(n.command)},a=()=>{r("update:open",!1)};return(l,u)=>(T(),L(v(Cf),{open:t.open,"onUpdate:open":u[0]||(u[0]=c=>r("update:open",c))},{default:D(()=>[k(v(Af),{class:"flex max-h-[90vh] max-w-2xl flex-col overflow-hidden sm:max-w-2xl"},{default:D(()=>[k(v(Df),null,{default:D(()=>[k(v(kf),null,{default:D(()=>[...u[1]||(u[1]=[ne("cURL Command",-1)])]),_:1}),k(v(N0),null,{default:D(()=>[...u[2]||(u[2]=[ne(" Copy the generated cURL command to use in your terminal or scripts. ",-1)])]),_:1})]),_:1}),M("div",Ute,[t.hasSpecialAuth?(T(),K("div",Hte,[...u[3]||(u[3]=[M("p",{class:"text-warning text-xs"}," Authorization has been dropped as special authorization types (Current User, Impersonate) are not supported in cURL commands. ",-1)])])):we("",!0),M("div",qte,[M("div",Gte,[k(v(gt),{variant:"outline",size:"sm",class:"flex items-center gap-2",onClick:o},{default:D(()=>[v(s)?(T(),L(v(QC),{key:0,class:"h-4 w-4"})):(T(),L(v(eA),{key:1,class:"h-4 w-4"})),ne(" "+de(v(s)?"Copied!":"Copy"),1)]),_:1})]),M("pre",Wte,de(t.command),1)])]),M("div",Kte,[k(v(gt),{variant:"outline",onClick:a},{default:D(()=>[...u[4]||(u[4]=[ne("Close",-1)])]),_:1})])]),_:1})]),_:1},8,["open"]))}}),Yte={class:"flex flex-1 flex-col space-y-4 overflow-hidden"},Jte={class:"flex min-h-0 flex-1 flex-col space-y-3"},Zte={class:"mb-2 flex items-center justify-between"},Qte={class:"bg-subtle-background text-foreground flex-1 overflow-auto rounded-md border p-4 font-mono text-sm leading-relaxed break-all whitespace-break-spaces","data-testid":"shareable-link-content"},ene={class:"flex justify-end border-t pt-4 dark:border-gray-700"},tne=z({__name:"ShareableLinkDialog",props:{open:{type:Boolean},link:{}},emits:["update:open"],setup(t,{emit:e}){const n=t,r=e,{copy:i,copied:s}=Co(),o=()=>{i(n.link)},a=()=>{r("update:open",!1)};return(l,u)=>(T(),L(v(Cf),{open:t.open,"onUpdate:open":u[0]||(u[0]=c=>r("update:open",c))},{default:D(()=>[k(v(Af),{class:"flex max-h-[90vh] max-w-2xl flex-col overflow-hidden sm:max-w-2xl"},{default:D(()=>[k(v(Df),null,{default:D(()=>[k(v(kf),{class:"flex items-center gap-2"},{default:D(()=>[k(v(PA),{class:"size-5"}),u[1]||(u[1]=ne(" Shareable Link ",-1))]),_:1}),k(v(N0),null,{default:D(()=>[...u[2]||(u[2]=[ne(" Share this link with your teammates to restore the exact request state and response. ",-1)])]),_:1})]),_:1}),M("div",Yte,[u[4]||(u[4]=M("div",{class:"rounded-md bg-indigo-50 p-3 dark:bg-indigo-900/20"},[M("p",{class:"text-sm text-indigo-800 dark:text-indigo-200"}," This link contains the full request configuration and the latest response. Anyone with this link can restore the exact state in their Nimbus instance. ")],-1)),M("div",Jte,[M("div",Zte,[u[3]||(u[3]=M("h4",{class:"text-sm font-medium text-gray-700 dark:text-gray-300"}," Link ",-1)),k(v(gt),{variant:"outline",size:"sm",class:"flex items-center gap-2",onClick:o},{default:D(()=>[v(s)?(T(),L(v(QC),{key:0,class:"h-4 w-4"})):(T(),L(v(eA),{key:1,class:"h-4 w-4"})),ne(" "+de(v(s)?"Copied!":"Copy"),1)]),_:1})]),M("pre",Qte,de(t.link),1)])]),M("div",ene,[k(v(gt),{variant:"outline",onClick:a},{default:D(()=>[...u[5]||(u[5]=[ne("Close",-1)])]),_:1})])]),_:1})]),_:1},8,["open"]))}}),nne={class:"flex w-full items-center justify-between"},rne={class:"flex items-center gap-1.5 font-normal"},ine=z({__name:"RequestBuilderOptionsMenu",setup(t){const e=Rr(),n=Xi(),r=G0(),i=Z(!1),s=Z(""),o=Z(!1),a=Z(!1),l=Z(""),u=q(()=>e.pendingRequestData),c=q({get:()=>{var h;return((h=u.value)==null?void 0:h.transactionMode)??!1},set:h=>e.updateTransactionMode(h)}),f=()=>{if(!e.pendingRequestData)return;const h=sM(e.pendingRequestData,n.apiUrl);s.value=h.command,o.value=h.hasSpecialAuth,i.value=!0},d=()=>{if(e.pendingRequestData)try{const h=r.lastLog,p=h==null?void 0:h.response,m=n.activeApplication??void 0,g=jte(e.pendingRequestData,p,h??void 0,m);l.value=Vte(n.appBasePath,g),a.value=!0}catch(h){console.error("Failed to generate shareable link:",h),Eh.error("Failed to generate shareable link",{description:"An unexpected error occurred."})}};return(h,p)=>(T(),K(Qe,null,[k(v(i8),null,{default:D(()=>[k(v(o8),{"as-child":""},{default:D(()=>[k(v(gt),{variant:"outline",size:"xs",disabled:!u.value,"data-testid":"request-options-button",title:"Request Options"},{default:D(()=>[k(v(Yy),{class:"size-4"})]),_:1},8,["disabled"])]),_:1}),k(v(s8),{align:"end",class:"w-48"},{default:D(()=>[k(v(y_),null,{default:D(()=>[...p[6]||(p[6]=[ne("Options",-1)])]),_:1}),k(v(b_),null,{default:D(()=>[k(v(Wh),{class:"cursor-pointer text-xs","data-testid":"transaction-mode-option",onSelect:p[3]||(p[3]=eo(()=>{},["prevent"]))},{default:D(()=>[M("div",nne,[M("div",rne,[p[8]||(p[8]=M("span",null,"Transaction Mode",-1)),k(v(kP),null,{default:D(()=>[k(v(OP),{ref:"transaction-mode-option","as-child":"",onClick:p[0]||(p[0]=eo(()=>{},["stop","prevent"]))},{default:D(()=>[k(v(bN),{class:"h-3.5 w-3.5 cursor-help text-zinc-500 hover:text-zinc-700 dark:text-zinc-400 dark:hover:text-zinc-200"})]),_:1},512),k(v(TP),{class:"w-80",side:"right","side-offset":5},{default:D(()=>[...p[7]||(p[7]=[M("div",{class:"space-y-2"},[M("h4",{class:"text-sm leading-none font-medium"}," Transaction Mode "),M("p",{class:"text-muted-foreground text-xs leading-relaxed"}," Executes the request within a database transaction that is automatically rolled back after completion. This allows you to test operations without affecting your persistent data. ")],-1)])]),_:1})]),_:1})]),k(v(qA),{modelValue:c.value,"onUpdate:modelValue":p[1]||(p[1]=m=>c.value=m),variant:{type:"compact",default:"default"},class:"ml-2",onClick:p[2]||(p[2]=eo(()=>{},["stop"]))},null,8,["modelValue"])])]),_:1})]),_:1}),k(v(_y)),k(v(y_),null,{default:D(()=>[...p[9]||(p[9]=[ne("Export",-1)])]),_:1}),k(v(b_),null,{default:D(()=>[k(v(Wh),{class:"cursor-pointer text-xs","data-testid":"export-curl-option",onSelect:f},{default:D(()=>[k(v(vN),{class:"mr-2 size-4"}),p[10]||(p[10]=M("span",null,"Export to cURL",-1))]),_:1}),k(v(Wh),{class:"cursor-pointer text-xs","data-testid":"copy-shareable-link-option",onSelect:d},{default:D(()=>[k(v(PA),{class:"mr-2 size-4"}),p[11]||(p[11]=M("span",null,"Copy Shareable Link",-1))]),_:1})]),_:1})]),_:1})]),_:1}),k(Xte,{open:i.value,"onUpdate:open":p[4]||(p[4]=m=>i.value=m),command:s.value,"has-special-auth":o.value},null,8,["open","command","has-special-auth"]),k(tne,{open:a.value,"onUpdate:open":p[5]||(p[5]=m=>a.value=m),link:l.value},null,8,["open","link"])],64))}}),sne=z({__name:"RequestBuilderEndpoint",props:{class:{}},setup(t){const e=t;return(n,r)=>(T(),K("div",{class:Se(v(ke)("flex",e.class)),"data-testid":"request-builder-endpoint"},[k(HZ),k(UZ,null,{"options-menu":D(()=>[k(ine)]),_:1})],2))}}),one={class:"px-panel bg-subtle flex border-b py-2 text-xs"},ane={class:"flex-1"},lne={key:0},une={key:1,class:"text-subtle-foreground"},cne=z({__name:"RequestParameters",setup(t){const e=Rr(),{copy:n,copied:r}=Co(),i=q(()=>e.pendingRequestData),s=q(()=>{var u;return((u=i.value)==null?void 0:u.queryParameters)??[]}),o=q(()=>i.value?e.getRequestUrl(i.value):""),a=u=>{e.updateQueryParameters(u)},l=()=>n(o.value);return(u,c)=>(T(),K(Qe,null,[k(Oa,{class:"border-b"},{default:D(()=>[...c[0]||(c[0]=[ne("Query Parameters",-1)])]),_:1}),M("div",one,[M("div",ane,[c[1]||(c[1]=M("small",{class:"font-medium"},"URL Preview",-1)),o.value.length?(T(),K("p",lne,de(o.value),1)):(T(),K("p",une,"Pick an endpoint to start"))]),M("div",null,[k(nu,{"on-click":l,copied:v(r)},null,8,["copied"])])]),k(fv,{"model-value":s.value,class:"flex-1","onUpdate:parameters":a},null,8,["model-value"])],64))}}),fne={class:"relative flex h-full max-h-full flex-1 flex-col","data-testid":"request-builder-root"},dne={class:"bg-subtle border-b"},hne={class:"relative"},pne={class:"from-subtle via-subtle/80 pointer-events-none absolute top-0 bottom-0 left-0 w-8 bg-gradient-to-r to-transparent transition-opacity duration-200"},mne={class:"from-subtle via-subtle/80 pointer-events-none absolute top-0 right-0 bottom-0 w-8 bg-gradient-to-l to-transparent transition-opacity duration-200"},gne=z({__name:"RequestBuilder",setup(t){const e=Cl(Tf("request-builder-tab"),"body"),{scrollContainer:n,showLeftMask:r,showRightMask:i,updateScrollMasks:s,scrollTabIntoView:o}=qC(),a=l=>{o(l.currentTarget)};return(l,u)=>(T(),K("div",fne,[k(v(sne),{class:"h-toolbar border-b"}),k(v(UA),{"default-value":v(e),class:"mt-0 flex flex-1 flex-col overflow-hidden","data-testid":"app-tabs-container","onUpdate:modelValue":u[1]||(u[1]=c=>e.value=c)},{default:D(()=>[M("div",dne,[M("div",hne,[M("div",{ref_key:"scrollContainer",ref:n,class:"scrollbar-hide overflow-x-auto",style:{"scrollbar-width":"none","-ms-overflow-style":"none"},onScroll:u[0]||(u[0]=(...c)=>v(s)&&v(s)(...c))},[k(v(HA),{class:"h-toolbar px-panel rounded-none"},{default:D(()=>[k(v(Ho),{value:"parameters",label:"Parameters",onClick:a}),k(v(Ho),{value:"body",label:"Body",onClick:a}),k(v(Ho),{value:"authorization",label:"Authorization",onClick:a}),k(v(Ho),{value:"headers",label:"Headers",onClick:a})]),_:1})],544),ua(M("div",pne,null,512),[[Al,v(r)]]),ua(M("div",mne,null,512),[[Al,v(i)]])])]),k(v(Uo),{value:"parameters",class:"mt-0 flex max-h-full min-h-0 flex-1 flex-col","data-testid":"request-parameters"},{default:D(()=>[k(v(cne))]),_:1}),k(v(Uo),{value:"body",class:"mt-0 flex max-h-full min-h-0 flex-1 flex-col","data-testid":"request-body"},{default:D(()=>[k(v(NZ))]),_:1}),k(v(Uo),{value:"authorization",class:"mt-0 flex max-h-full min-h-0 flex-1 flex-col","data-testid":"request-authorization"},{default:D(()=>[k(v(oF))]),_:1}),k(v(Uo),{value:"headers",class:"mt-0 flex max-h-full min-h-0 flex-1 flex-col","data-testid":"request-headers"},{default:D(()=>[k(v(jM))]),_:1})]),_:1},8,["default-value"])]))}}),bne=z({__name:"AppInputGroup",props:{class:{}},setup(t){const e=t;return(n,r)=>(T(),K("div",{"data-slot":"input-group",role:"group",class:Se(v(ke)("group/input-group relative flex w-full items-center rounded-sm border border-zinc-200 outline-none dark:border-zinc-800 dark:bg-zinc-200/30 dark:dark:bg-zinc-800/30","h-9 min-w-0 has-[>textarea]:h-auto","has-[>[data-align=inline-start]]:[&>input]:pl-2","has-[>[data-align=inline-end]]:[&>input]:pr-2","has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>[data-align=block-start]]:[&>input]:pb-3","has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-end]]:[&>input]:pt-3","has-[[data-slot=input-group-control]:focus-visible]:ring-1 has-[[data-slot=input-group-control]:focus-visible]:ring-zinc-950 dark:has-[[data-slot=input-group-control]:focus-visible]:ring-zinc-300",e.class))},[Q(n.$slots,"default")],2))}}),yne=["data-align"],vne=z({__name:"AppInputGroupAddon",props:{align:{default:"inline-start"},class:{default:void 0}},setup(t){const e=t;function n(r){var o,a;const i=r.currentTarget,s=r.target;s&&s.closest("button")||i&&(i!=null&&i.parentElement)&&((a=(o=i.parentElement)==null?void 0:o.querySelector("input"))==null||a.focus())}return(r,i)=>(T(),K("div",{role:"group","data-slot":"input-group-addon","data-align":e.align,class:Se(v(ke)(v(Sne)({align:e.align}),e.class)),onClick:n},[Q(r.$slots,"default")],10,yne))}}),xne=z({__name:"AppInputGroupInput",props:{class:{}},setup(t,{expose:e}){const n=t,r=Z(null);return e({focus:()=>{var s;const i=(s=r.value)==null?void 0:s.$el;i==null||i.focus()}}),(i,s)=>(T(),L(v(ws),{ref_key:"inputRef",ref:r,"data-slot":"input-group-control",class:Se(v(ke)("flex-1 rounded-none border-0 bg-transparent shadow-none ring-offset-transparent focus-visible:ring-0 focus-visible:ring-transparent dark:bg-transparent",n.class))},null,8,["class"]))}}),Sne=VC("text-zinc-500 flex h-auto cursor-text items-center justify-center gap-2 py-1.5 text-sm font-medium select-none [&>svg:not([class*='size-'])]:size-4 [&>kbd]:rounded-[calc(var(--radius)-5px)] group-data-[disabled=true]/input-group:opacity-50 dark:text-zinc-400",{variants:{align:{"inline-start":"order-first pl-3 has-[>button]:ml-[-0.45rem] has-[>kbd]:ml-[-0.35rem]","inline-end":"order-last pr-3 has-[>button]:mr-[-0.45rem] has-[>kbd]:mr-[-0.35rem]","block-start":"order-first w-full justify-start px-3 pt-3 [.border-b]:pb-3 group-has-[>input]/input-group:pt-2.5","block-end":"order-last w-full justify-start px-3 pb-3 [.border-t]:pt-3 group-has-[>input]/input-group:pb-2.5"}},defaultVariants:{align:"inline-start"}}),Ene=z({__name:"AppSpinner",props:{class:{}},setup(t){const e=t;return(n,r)=>(T(),K("svg",{class:Se(v(ke)("size-4 text-zinc-900",e.class)),xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},[...r[0]||(r[0]=[M("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"},null,-1),M("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"},null,-1)])],2))}}),Xh=z({__name:"AppRoundIndicator",props:{class:{}},setup(t){const e=t;return(n,r)=>(T(),K("div",{class:Se(v(ke)(e.class,"bg-background relative z-10 flex size-[12px] items-center justify-center rounded-full"))},[...r[0]||(r[0]=[M("div",{class:"size-[8px] rounded-full border-[1px] border-[currentColor] bg-[radial-gradient(circle_at_bottom,currentColor_75%,rgb(255,255,255)_100%)]"},null,-1),M("div",{class:"absolute z-[-1] size-[5px] rounded-full opacity-40 shadow-[5px_0_5px_currentColor,-5px_0_5px_currentColor]"},null,-1)])],2))}}),V8=z({__name:"StatusIndicator",props:{status:{}},setup(t){const e=t,n={[xt.INFORMATION]:"text-zinc-500",[xt.SUCCESS]:"text-emerald-600",[xt.REDIRECT]:"text-blue-500",[xt.CLIENT_ERROR]:"text-amber-500",[xt.SERVER_ERROR]:"text-rose-500",[xt.OTHER]:"text-zinc-500",[xt.EMPTY]:"text-zinc-900",[xt.DUMP_AND_DIE]:"text-violet-600",[xt.PENDING]:""},r=q(()=>n[e.status]);return(i,s)=>e.status===v(xt).PENDING?(T(),L(Ene,{key:0,"data-testid":"pending-request-spinner",class:"text-accent-foreground size-4 animate-spin"})):(T(),L(Xh,{key:1,class:Se(r.value)},null,8,["class"]))}}),Lm=z({__name:"HttpVerbLabel",props:{method:{},size:{default:"sm"},variant:{default:"outline"}},setup(t){const e=t,n=q(()=>({POST:"text-success",PUT:"text-success",DELETE:"text-destructive"})[e.method]??null),r=q(()=>({sm:"min-w-[50px] text-xxs",md:"min-w-[60px] text-xs",lg:"min-w-[70px] text-sm"})[e.size]);return(i,s)=>(T(),L(v(fo),{variant:t.variant,class:Se(v(ke)("justify-center",r.value))},{default:D(()=>[M("span",{class:Se(n.value)},de(t.method),3)]),_:1},8,["variant","class"]))}}),wne=["B","kB","MB","GB","TB","PB","EB","ZB","YB"],_ne=["B","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"],Cne=["b","kbit","Mbit","Gbit","Tbit","Pbit","Ebit","Zbit","Ybit"],Ane=["b","kibit","Mibit","Gibit","Tibit","Pibit","Eibit","Zibit","Yibit"],sC=(t,e,n)=>{let r=t;return typeof e=="string"||Array.isArray(e)?r=t.toLocaleString(e,n):(e===!0||n!==void 0)&&(r=t.toLocaleString(void 0,n)),r},U8=t=>{if(typeof t=="number")return Math.log10(t);const e=t.toString(10);return e.length+Math.log10(`0.${e.slice(0,15)}`)},Dne=t=>typeof t=="number"?Math.log(t):U8(t)*Math.log(10),kne=(t,e)=>{if(typeof t=="number")return t/e;const n=t/BigInt(e),r=t%BigInt(e);return Number(n)+Number(r)/e},oC=(t,e)=>{if(e===void 0)return t;if(typeof e!="number"||!Number.isSafeInteger(e)||e<0)throw new TypeError(`Expected fixedWidth to be a non-negative integer, got ${typeof e}: ${e}`);return e===0?t:t.length{const{minimumFractionDigits:e,maximumFractionDigits:n}=t;if(!(e===void 0&&n===void 0))return{...e!==void 0&&{minimumFractionDigits:e},...n!==void 0&&{maximumFractionDigits:n},roundingMode:"trunc"}};function H8(t,e){if(typeof t!="bigint"&&!Number.isFinite(t))throw new TypeError(`Expected a finite number, got ${typeof t}: ${t}`);e={bits:!1,binary:!1,space:!0,nonBreakingSpace:!1,...e};const n=e.bits?e.binary?Ane:Cne:e.binary?_ne:wne,r=e.space?e.nonBreakingSpace?" ":" ":"",i=typeof t=="number"?t===0:t===0n;if(e.signed&&i){const u=` 0${r}${n[0]}`;return oC(u,e.fixedWidth)}const s=t<0,o=s?"-":e.signed?"+":"";s&&(t=-t);const a=One(e);let l;if(t<1){const u=sC(t,e.locale,a);l=o+u+r+n[0]}else{const u=Math.min(Math.floor(e.binary?Dne(t)/Math.log(1024):U8(t)/3),n.length-1);if(t=kne(t,(e.binary?1024:1e3)**u),!a){const d=Math.max(3,Math.floor(t).toString().length);t=t.toPrecision(d)}const c=sC(Number(t),e.locale,a),f=n[u];l=o+c+r+f}return oC(l,e.fixedWidth)}const aC=t=>Number.isFinite(t)?t:0;function Tne(t){return{days:Math.trunc(t/864e5),hours:Math.trunc(t/36e5%24),minutes:Math.trunc(t/6e4%60),seconds:Math.trunc(t/1e3%60),milliseconds:Math.trunc(t%1e3),microseconds:Math.trunc(aC(t*1e3)%1e3),nanoseconds:Math.trunc(aC(t*1e6)%1e3)}}function Ine(t){return{days:t/86400000n,hours:t/3600000n%24n,minutes:t/60000n%60n,seconds:t/1000n%60n,milliseconds:t%1000n,microseconds:0n,nanoseconds:0n}}function Pne(t){switch(typeof t){case"number":{if(Number.isFinite(t))return Tne(t);break}case"bigint":return Ine(t)}throw new TypeError("Expected a finite number or bigint")}const Rne=t=>t===0||t===0n,Nne=(t,e)=>e===1||e===1n?t:`${t}s`,Mne=1e-7,Fne=24n*60n*60n*1000n;function q8(t,e){const n=typeof t=="bigint";if(!n&&!Number.isFinite(t))throw new TypeError("Expected a finite number or bigint");e={...e};const r=t<0?"-":"";t=t<0?-t:t,e.colonNotation&&(e.compact=!1,e.formatSubMilliseconds=!1,e.separateMilliseconds=!1,e.verbose=!1),e.compact&&(e.unitCount=1,e.secondsDecimalDigits=0,e.millisecondsDecimalDigits=0);let i=[];const s=(c,f)=>{const d=Math.floor(c*10**f+Mne);return(Math.round(d)/10**f).toFixed(f)},o=(c,f,d,h)=>{if(!((i.length===0||!e.colonNotation)&&Rne(c)&&!(e.colonNotation&&d==="m"))){if(h??(h=String(c)),e.colonNotation){const p=h.includes(".")?h.split(".")[0].length:h.length,m=i.length>0?2:1;h="0".repeat(Math.max(0,m-p))+h}else h+=e.verbose?" "+Nne(f,c):d;i.push(h)}},a=Pne(t),l=BigInt(a.days);if(e.hideYearAndDays?o(BigInt(l)*24n+BigInt(a.hours),"hour","h"):(e.hideYear?o(l,"day","d"):(o(l/365n,"year","y"),o(l%365n,"day","d")),o(Number(a.hours),"hour","h")),o(Number(a.minutes),"minute","m"),!e.hideSeconds)if(e.separateMilliseconds||e.formatSubMilliseconds||!e.colonNotation&&t<1e3&&!e.subSecondsAsDecimals){const c=Number(a.seconds),f=Number(a.milliseconds),d=Number(a.microseconds),h=Number(a.nanoseconds);if(o(c,"second","s"),e.formatSubMilliseconds)o(f,"millisecond","ms"),o(d,"microsecond","µs"),o(h,"nanosecond","ns");else{const p=f+d/1e3+h/1e6,m=typeof e.millisecondsDecimalDigits=="number"?e.millisecondsDecimalDigits:0,g=p>=1?Math.round(p):Math.ceil(p),b=m?p.toFixed(m):g;o(Number.parseFloat(b),"millisecond","ms",b)}}else{const c=(n?Number(t%Fne):t)/1e3%60,f=typeof e.secondsDecimalDigits=="number"?e.secondsDecimalDigits:1,d=s(c,f),h=e.keepDecimalsOnWholeSeconds?d:d.replace(/\.0+$/,"");o(Number.parseFloat(h),"second","s",h)}if(i.length===0)return r+"0"+(e.verbose?" milliseconds":"ms");const u=e.colonNotation?":":" ";return typeof e.unitCount=="number"&&(i=i.slice(0,Math.max(e.unitCount,1))),r+i.join(u)}const Lne={class:"flex w-full gap-2"},Bne={class:"flex flex-1 flex-col gap-2"},$ne=["title"],zne={class:"flex-1 truncate"},jne={class:"ml-1 text-xs","data-testid":"history-item-endpoint"},Vne={class:"text-xxs flex min-w-0 flex-1 items-center gap-2"},Une={class:"text-nowrap","data-testid":"response-status-badge"},Hne={class:"flex w-full items-center justify-between"},qne={class:"text-subtle-foreground whitespace-nowrap"},Gne={key:0,class:"text-subtle-foreground text-xxs whitespace-nowrap"},Wne={class:"text-subtle-foreground text-xxs whitespace-nowrap"},Kne=z({__name:"HistoryItem",props:{log:{},index:{}},emits:["select"],setup(t,{emit:e}){const n=t,r=e,i=s=>GC(new Date(s*1e3)).value;return(s,o)=>(T(),L(v(Wh),{class:"p-panel p-panel flex cursor-pointer flex-col items-start transition-colors",onSelect:o[0]||(o[0]=a=>r("select",n.index))},{default:D(()=>[M("div",Lne,[M("div",Bne,[M("div",{class:"flex w-full justify-between gap-1 leading-tight",title:n.log.request.endpoint},[M("div",zne,[k(Lm,{method:n.log.request.method,"data-testid":"history-item-method"},null,8,["method"]),M("span",jne,de(n.log.request.endpoint),1)]),k(V8,{status:n.log.response.status??v(xt).EMPTY,"data-testid":"history-item-status"},null,8,["status"])],8,$ne),M("div",Vne,[M("span",Une,de(n.log.response.statusCode)+" - "+de(n.log.response.statusText),1),o[1]||(o[1]=M("div",{class:"border-border w-8 border-b"},null,-1)),M("div",Hne,[M("div",null,[M("span",qne,de(v(q8)(n.log.durationInMs,{compact:!0})),1),n.log.response?(T(),K("span",Gne,"  / "+de(v(H8)(n.log.response.sizeInBytes)),1)):we("",!0)]),M("small",Wne,de(i(n.log.response.timestamp)),1)])])])])]),_:1}))}}),Xne=["title"],Yne={class:"px-panel my-2 flex gap-2"},Jne={key:1,class:"text-subtle-foreground flex flex-col items-center justify-center gap-2 py-8 text-center text-sm","data-testid":"history-empty-state"},Zne=z({__name:"RequestHistory",setup(t){const e=Rr(),n=G0(),r=Z(!1),i=Z(""),s=Z(null),o=Z(!1),a=Z(null),l=q(()=>n.lastLog),u=y=>GC(new Date(y*1e3)).value,c=q(()=>{var y;return((y=l.value)==null?void 0:y.response)===void 0?"":u(l.value.response.timestamp)}),f=q(()=>{var x;return((x=l.value)==null?void 0:x.response)===void 0?"":new Date(l.value.response.timestamp*1e3).toLocaleString("en-US",{year:"numeric",month:"long",day:"numeric",hour:"2-digit",minute:"2-digit"})}),d=y=>{const x=n.allLogs[y];x&&(n.setActiveLog(y),e.restoreFromHistory(x))},h=q(()=>[...n.allLogs].filter(y=>y.response!==void 0).reverse()),p=q(()=>{if(!i.value.trim())return h.value;const y=i.value.toLowerCase();return h.value.filter(x=>x.request.endpoint.toLowerCase().includes(y))}),m=y=>{const x=n.allLogs.filter(E=>E.response!==void 0),S=x[x.length-1-y];return n.allLogs.indexOf(S)},g=()=>{o.value=!1,a.value&&(window.clearTimeout(a.value),a.value=null)},b=()=>{if(o.value){n.clearLogs(),g(),r.value=!1;return}o.value=!0,a.value&&window.clearTimeout(a.value),a.value=window.setTimeout(()=>{g()},1e3)};return nt(r,async y=>{var x;y?(await kr(),(x=s.value)==null||x.focus()):i.value=""}),(y,x)=>h.value.length?(T(),L(v(i8),{key:0,open:r.value,"onUpdate:open":x[1]||(x[1]=S=>r.value=S)},{default:D(()=>[k(v(o8),{"as-child":""},{default:D(()=>[k(v(gt),{variant:"ghost",size:"xs",class:"rounded px-1 transition-colors hover:bg-zinc-100 focus:outline-none focus-visible:ring-0 dark:hover:bg-zinc-800 dark:focus-visible:ring-0","data-testid":"response-history-trigger"},{default:D(()=>[M("small",{class:"text-subtle-foreground text-xs",title:f.value},de(c.value),9,Xne),k(v(DN),{class:"size-3"})]),_:1})]),_:1}),k(v(s8),{align:"end",class:"w-sm p-0"},{default:D(()=>[k(v(If),{class:"max-h-96 overflow-y-auto"},{default:D(()=>[M("div",Yne,[k(v(gt),{variant:"outline",size:"xs",class:Se(["h-sub-toolbar justify-start shadow-none transition-colors",v(ke)(o.value&&"text-rose-500 hover:text-rose-600 dark:text-rose-400 dark:hover:text-rose-300")]),"data-testid":"clear-history-button",onClick:b},{default:D(()=>[k(v(cp),{class:"size-3"}),x[2]||(x[2]=ne(" Clear History ",-1))]),_:1},8,["class"]),k(v(bne),{class:"h-sub-toolbar"},{default:D(()=>[k(v(xne),{ref_key:"searchInputRef",ref:s,modelValue:i.value,"onUpdate:modelValue":x[0]||(x[0]=S=>i.value=S),placeholder:"Type to search","data-testid":"history-search-input"},null,8,["modelValue"]),k(v(vne),null,{default:D(()=>[k(v(Ox),{class:"size-3"})]),_:1})]),_:1})]),k(v(_y)),p.value.length?(T(!0),K(Qe,{key:0},_n(p.value,(S,E)=>(T(),K(Qe,{key:S.request.endpoint+S.response.timestamp},[k(Kne,{log:S,index:m(h.value.indexOf(S)),"data-testid":"history-item","data-endpoint":S.request.endpoint,"data-method":S.request.method,onSelect:d},null,8,["log","index","data-endpoint","data-method"]),E(T(),K("div",Qne,[k(V8,{status:e.status,"data-testid":"response-status-indicator"},null,8,["status"]),M("span",ere,de(e.status),1),e.response&&e.status!==v(xt).DUMP_AND_DIE?(T(),L(v(fo),{key:0,variant:"outline",class:"text-nowrap","data-testid":"response-status-badge"},{default:D(()=>[ne(de(e.response.statusCode)+" - "+de(e.response.statusText),1)]),_:1})):e.status===v(xt).PENDING?(T(),L(v(fo),{key:1,variant:"outline",class:"text-nowrap"},{default:D(()=>[...r[0]||(r[0]=[ne(" - ",-1)])]),_:1})):we("",!0)]))}}),nre={class:"relative flex h-full flex-1 items-center justify-between p-2"},rre={class:"flex w-full items-center justify-between gap-1"},ire={class:"flex items-center space-x-2"},sre={class:"text-xs"},ore={"data-testid":"response-status-duration"},are={"data-testid":"response-status-size"},lre={key:0,class:"flex items-center"},ure={key:0},cre={class:"flex h-full items-center gap-1 rounded-none border-indigo-500/50 bg-indigo-500/5 p-3.5 text-xs text-indigo-600 dark:text-indigo-400","data-testid":"imported-badge"},fre=z({__name:"ResponseStatus",props:{class:{},response:{},asChild:{type:Boolean},as:{}},setup(t){const e=t,n=Rr(),r=q(()=>n.pendingRequestData),i=q(()=>e.response),s=q(()=>{var c;return(c=r.value)!=null&&c.isProcessing?xt.PENDING:!i.value||!i.value.response?xt.EMPTY:i.value.response.status??xt.EMPTY}),o=q(()=>{var c,f;return H8(((f=(c=i.value)==null?void 0:c.response)==null?void 0:f.sizeInBytes)??0,{space:!1})}),a=q(()=>{var c,f,d;return q8((c=r.value)!=null&&c.isProcessing?((f=r.value)==null?void 0:f.durationInMs)??0:((d=i.value)==null?void 0:d.durationInMs)??0,{verbose:!1,secondsDecimalDigits:2,keepDecimalsOnWholeSeconds:!0})}),l=()=>{n.cancelCurrentRequest()},u=q(()=>{var c;return((c=i.value)==null?void 0:c.importedFromShare)===!0});return(c,f)=>{var d,h,p,m,g;return T(),K("div",{class:Se(v(ke)("h-toolbar flex",e.class))},[M("div",nre,[M("div",rre,[M("div",ire,[k(tre,{status:s.value,response:(d=r.value)!=null&&d.isProcessing||(h=i.value)==null?void 0:h.response},null,8,["status","response"]),f[1]||(f[1]=M("div",{class:"w-8 border-b border-zinc-200"},null,-1)),M("span",sre,[M("span",ore,de(a.value),1),(p=r.value)!=null&&p.isProcessing?we("",!0):(T(),K(Qe,{key:0},[f[0]||(f[0]=M("span",{class:"text-color-muted mx-1 text-xs"},"/",-1)),M("span",are,de(o.value),1)],64))])]),(m=r.value)!=null&&m.isProcessing?we("",!0):(T(),K("div",lre,[k(Zne)]))]),(g=r.value)!=null&&g.isProcessing?(T(),K("div",ure,[k(v(gt),{variant:"outline",size:"xs",onClick:l},{default:D(()=>[k(v(MN)),f[2]||(f[2]=ne(" Cancel ",-1))]),_:1})])):we("",!0)]),u.value?(T(),L(dp,{key:0,value:"This response was imported from a shareable link"},{default:D(()=>[M("div",cre,[k(v(kN),{class:"size-4"})])]),_:1})):we("",!0)],2)}}}),dre=z({__name:"AppRippleCircle",props:{size:{default:210},class:{default:""},opacity:{default:.24},animationDelay:{default:0},borderStyle:{default:""}},setup(t){HC(n=>({v732789d8:e.size+"px",v4c367f18:e.animationDelay+"ms",v7e87f0da:e.opacity,v511a806d:e.borderStyle}));const e=t;return(n,r)=>(T(),K("div",{class:Se(v(ke)("absolute shadow-xl","animate-ripple-circle",e.class))},null,2))}}),hre=Rm(dre,[["__scopeId","data-v-91da32f6"]]),pre={class:"absolute inset-0"},mre=z({__name:"AppRipple",props:{baseCircleSize:{default:210},baseCircleOpacity:{default:.24},spaceBetweenCircle:{default:70},circleOpacityDowngradeRatio:{default:.03},circleClass:{default:""},waveSpeed:{default:80},numberOfCircles:{default:7}},setup(t){return(e,n)=>(T(),K("div",pre,[(T(!0),K(Qe,null,_n(t.numberOfCircles,r=>(T(),L(hre,{key:r,opacity:t.baseCircleOpacity-r*t.circleOpacityDowngradeRatio,size:t.baseCircleSize+r*t.spaceBetweenCircle,"animation-delay":r*t.waveSpeed,"border-style":r===t.numberOfCircles-1?"dashed":"solid",class:Se(t.circleClass)},null,8,["opacity","size","animation-delay","border-style","class"]))),128))]))}}),gre=z({__name:"AppPanelRipple",setup(t){return(e,n)=>(T(),L(mre,{class:"bottom-0 translate-x-2/5 translate-y-1/2 scale-150 bg-white/5 opacity-25 dark:bg-zinc-950/5","circle-class":"border-[hsl(var(--primary))] bg-primary/25 blobed"}))}}),Bm=Rm(gre,[["__scopeId","data-v-b3bb6b43"]]),bre={class:"max-w-md"},yre=z({__name:"AppPanelStateContainer",props:{class:{}},setup(t){const e=t;return(n,r)=>(T(),K("div",{class:Se(v(ke)("relative h-full flex-1 overflow-hidden p-2",e.class))},[M("div",bre,[Q(n.$slots,"default")]),k(Bm)],2))}}),vre=z({__name:"ResponseViewerEmptyState",setup(t){return(e,n)=>(T(),L(yre,null,{default:D(()=>[n[0]||(n[0]=M("h2",{class:"text-lg font-medium"},"You didn't perform any requests yet",-1)),n[1]||(n[1]=M("p",{class:"mb-2 text-sm"}," Make request and the result will appear here. Make sure to check the Wiki in case of doubts. ",-1)),k(GA)]),_:1}))}}),xre={class:"via-background from-destructive/10 dark:from-destructive/15 relative max-h-full flex-1 overflow-hidden bg-gradient-to-br from-10% p-4"},Sre={class:"relative z-10 flex max-h-full flex-col p-2"},Ere={class:"text-destructive text-lg font-medium"},wre={class:"text-sm"},_re={key:0},Cre={key:1},Are={key:0,class:"bg-background mt-2 ml-0.5 overflow-scroll rounded-sm p-2 text-sm shadow-[0_0_0_5px_rgba(0,0,0,0.2)]"},Dre=z({__name:"ResponseViewerErrorState",props:{error:{}},setup(t){const e=t,n=q({get:()=>e.error.body,set:()=>{}});return(r,i)=>(T(),K("div",xre,[M("div",Sre,[M("div",null,[k(v(fo),{variant:"outline",class:"p-0 px-1 text-xs"},{default:D(()=>[...i[1]||(i[1]=[ne(" Internal Error ",-1)])]),_:1}),M("h2",Ere,de(e.error.message),1)]),M("p",wre,[i[2]||(i[2]=ne(" It wasn't possible to relay the request via the internal proxy. ",-1)),e.error.message?(T(),K("span",_re," The below information might help, otherwise, check the console for more details. ")):(T(),K("span",Cre,"Check the console for more details."))]),e.error.body?(T(),K("div",Are,[k(Pm,{modelValue:n.value,"onUpdate:modelValue":i[0]||(i[0]=s=>n.value=s),language:"json",readonly:!0},null,8,["modelValue"])])):we("",!0)]),k(Bm)]))}}),kre=z({__name:"ResponseBody",props:{content:{}},setup(t){return(e,n)=>(T(),L(Pm,{language:"json",readonly:!0,placeholder:t.content===""?"Empty":"Response JSON Payload","model-value":t.content,disabled:t.content==="","auto-height":!1},null,8,["placeholder","model-value","disabled"]))}}),Ore=z({__name:"ConstDumpRenderer",props:{dump:{}},setup(t){return(e,n)=>(T(),K("span",{class:Se(v(ke)(v(qi).value,"italic"))},de(String(t.dump.value)),3))}}),Tre=z({__name:"NumberDumpRenderer",props:{dump:{}},setup(t){return(e,n)=>(T(),K("span",{class:Se(v(qi).value)},de(t.dump.value),3))}}),H2=z({__name:"AppCollapsible",props:{defaultOpen:{type:Boolean},open:{type:Boolean},disabled:{type:Boolean},unmountOnHide:{type:Boolean},asChild:{type:Boolean},as:{}},emits:["update:open"],setup(t,{emit:e}){const i=Yr(t,e);return(s,o)=>(T(),L(v(FP),Yn(Pr(v(i))),{default:D(({open:a})=>[Q(s.$slots,"default",{open:a})]),_:3},16))}}),q2=z({__name:"AppCollapsibleContent",props:{forceMount:{type:Boolean},asChild:{type:Boolean},as:{}},setup(t){const e=t;return(n,r)=>(T(),L(v(BP),Ce(e,{class:"data-[state=closed]:animate-collapsible-up data-[state=open]:animate-collapsible-down transition-all"}),{default:D(()=>[Q(n.$slots,"default")]),_:3},16))}}),G2=z({__name:"AppCollapsibleTrigger",props:{asChild:{type:Boolean},as:{}},setup(t){const e=t;return(n,r)=>(T(),L(v(zP),Yn(Pr(e)),{default:D(()=>[Q(n.$slots,"default")]),_:3},16))}}),lC=z({__name:"DumpKeyRenderer",props:{keyName:{},numerical:{type:Boolean,default:!1}},setup(t){return(e,n)=>t.keyName&&!t.numerical?(T(),K("span",{key:0,class:Se(v(qi).key)},'"'+de(t.keyName)+'": ',3)):t.keyName?(T(),K("span",{key:1,class:Se(v(qi).numericalKey)},de(String(t.keyName))+":  ",3)):we("",!0)}}),Ire=z({__name:"ObjectDumpValuePropertyKey",props:{property:{},keyName:{}},setup(t){const e=r=>({public:"text-emerald-600 dark:text-emerald-500",protected:"text-amber-600 dark:text-amber-500",private:"text-zinc-500 dark:text-zinc-400"})[r],n=r=>({public:"+",protected:"#",private:"-"})[r];return(r,i)=>(T(),K("span",{class:Se(v(qi).key)},[M("span",{class:Se(v(ke)("text-xs",e(t.property.visibility)))},de(n(t.property.visibility)),3),M("span",{class:Se(v(qi).objectProperty)},de(t.keyName)+":",3)],2))}}),Pre=z({__name:"UninitializedDumpRenderer",props:{dump:{}},setup(t){return(e,n)=>(T(),K("span",{class:Se(v(ke)(v(qi).value,"italic"))},[ne(de(String(t.dump.value))+" ",1),n[0]||(n[0]=M("i",{class:"text-xs"},"(Uninitialized Prop)",-1))],2))}}),Rre={key:0,class:"flex gap-0.5"},Nre={key:4},Mre={class:"text-rose-500 dark:text-rose-700"},Fre={class:"flex w-full items-center text-left"},Lre={class:"ml-1 text-xs text-zinc-500 dark:text-zinc-400"},Bre={class:"ml-2 border-l border-zinc-200 pl-2 dark:border-zinc-800"},$re={key:2},zre={class:"text-rose-500 dark:text-rose-700"},jre=z({__name:"SingleDumpRenderer",props:{dump:{},depth:{default:0},keyName:{default:void 0},numericalKey:{type:Boolean,default:!1}},setup(t){const e=t,n=q(()=>e.dump.type===jt.Object||e.dump.type===jt.Closure||e.dump.type===jt.Array),r=q(()=>{if(e.dump.type===jt.Closure)return e.dump.value.signature;if(e.dump.type===jt.Object){const s=e.dump.value.class,o=e.dump.value.propertiesCount;return o===0?"{}":`${s}: ${o} ${o===1?"property":"properties"}`}if(e.dump.type===jt.Array){const s=e.dump.value.length;return s===0?"[]":`array: ${s} ${s===1?"item":"items"}`}throw new Error("Node is not nestable")}),i=q(()=>{if(e.dump.type===jt.Closure){const s=e.dump.value.this,o=e.dump.value.class;return{class:{type:o?jt.String:jt.Constant,value:o||"null"},this:{type:s?jt.String:jt.Constant,value:s||"null"}}}return e.dump.type===jt.Object?e.dump.value.properties:e.dump.type===jt.Array?e.dump.value.items:[]});return(s,o)=>{const a=KI("SingleDumpRenderer",!0);return n.value?(T(),L(v(H2),{key:1,class:"flex flex-col","default-open":t.depth===0,"data-testid":"app-collapsible"},{default:D(()=>[k(v(G2),{class:"group/collapsible-trigger -mx-1 flex items-center gap-1 rounded-sm px-1 text-sm hover:bg-zinc-100/50 dark:hover:bg-zinc-800/50","data-testid":"collapsible-trigger",disabled:i.value.length===0},{default:D(()=>[Q(s.$slots,"key",{},()=>[t.keyName!==void 0?(T(),L(lC,{key:0,"key-name":t.keyName,numerical:t.numericalKey},null,8,["key-name","numerical"])):we("",!0)]),M("span",Fre,[k(v(U0),{class:"size-3 text-zinc-500 transition-transform group-data-[state=open]/collapsible-trigger:rotate-90"}),M("span",Lre,de(r.value),1)])]),_:3},8,["disabled"]),k(v(q2),null,{default:D(()=>[M("div",Bre,[(T(!0),K(Qe,null,_n(i.value,(l,u)=>(T(),K("div",{key:`${t.keyName??"root"}-${u}`,class:"flex items-center gap-1 py-0.5"},[t.dump.type===v(jt).Object?(T(),L(a,{key:0,dump:l.value,depth:t.depth+1},{key:D(()=>[k(Ire,{"key-name":u,property:l},null,8,["key-name","property"])]),_:2},1032,["dump","depth"])):t.dump.type===v(jt).Array||t.dump.type===v(jt).Closure?(T(),L(a,{key:1,dump:l,"key-name":String(u),"numerical-key":t.dump.value.numericallyIndexed,depth:t.depth+1},null,8,["dump","key-name","numerical-key","depth"])):(T(),K("div",$re,[M("small",zre,[ne(" Invalid nested value type `"+de(t.dump.type)+"` received. Please create a ",1),o[2]||(o[2]=M("a",{class:"underline",href:"https://github.com/sunchayn/nimbus/issues/new/choose"}," Bug ",-1)),o[3]||(o[3]=ne(" card. ",-1))])]))]))),128))])]),_:1})]),_:3},8,["default-open"])):(T(),K("div",Rre,[Q(s.$slots,"key",{},()=>[t.keyName!==void 0?(T(),L(lC,{key:0,"key-name":t.keyName,numerical:t.numericalKey},null,8,["key-name","numerical"])):we("",!0)]),M("div",{class:Se(v(qi).value)},[t.dump.type===v(jt).String?(T(),L(v(Vre),{key:0,dump:t.dump},null,8,["dump"])):t.dump.type===v(jt).Number?(T(),L(v(Tre),{key:1,dump:t.dump},null,8,["dump"])):t.dump.type===v(jt).Constant?(T(),L(v(Ore),{key:2,dump:t.dump},null,8,["dump"])):t.dump.type===v(jt).Uninitialized?(T(),L(Pre,{key:3,dump:t.dump},null,8,["dump"])):(T(),K("div",Nre,[M("small",Mre,[ne(" Invalid dump value type `"+de(t.dump.type)+"` received. Please create a ",1),o[0]||(o[0]=M("a",{class:"underline",href:"https://github.com/sunchayn/nimbus/issues/new/choose"}," Bug ",-1)),o[1]||(o[1]=ne(" card. ",-1))])]))],2)]))}}}),Vre=z({__name:"StringDumpRenderer",props:{dump:{}},setup(t){return(e,n)=>(T(),K("span",{class:Se(v(qi).stringValue)},[ne(' "'+de(t.dump.value)+'" ',1),M("span",{class:Se(v(qi).meta)},"("+de(t.dump.value.length)+")",3)],2))}}),qi={key:"text-success font-mono text-xs",numericalKey:"text-info font-mono text-xs",objectProperty:"text-subtle-foreground font-mono text-xs",value:"text-foreground font-mono text-xs",stringValue:"text-success font-mono text-xs",meta:"text-subtle-foreground"},Ure={class:"gap-.5 flex flex-col"},Hre={class:"text-foreground text-xs"},qre={class:"flex items-center gap-2"},Gre={key:0,class:"flex items-center gap-1"},Wre={class:"text-xxs text-subtle-foreground select-none"},Kre={class:"p-panel bg-subtle flex h-full min-h-0 flex-1 flex-col gap-1 overflow-y-auto"},Xre={key:0,class:"text-xxs text-subtle-foreground my-1"},Yre={key:1,class:"border-subtle bg-card rounded-md border text-sm"},Jre={class:"px-panel flex items-center gap-1.5 border-b py-1"},Zre={key:2,class:"border-subtle bg-card rounded-md border text-sm"},Qre={class:"px-panel flex items-center gap-1.5 border-b py-1"},eie=["data-testid"],tie={class:"px-panel relative z-10 flex gap-1.5 border-b py-1"},nie={class:"inline-flex flex-col","data-testid":"dump-value-title"},rie={class:"text-xs"},iie={class:"p-panel w-full overflow-x-auto whitespace-nowrap","data-testid":"dump-value-content"},sie=1200,oie=z({__name:"ResponseDumpAndDie",props:{rawContent:{}},emits:["update:dumps"],setup(t,{emit:e}){const n=t,r=e,i=Z([]),s=Z(0),o=UC(new Map),a=q(()=>i.value.length===0?null:i.value[s.value]??null),l=q(()=>i.value.length>1),u=q(()=>s.value>0),c=q(()=>s.value{const x=o.get(y);x!=null&&x.timeoutId&&clearTimeout(x.timeoutId),o.delete(y)},d=y=>{const x=window.setTimeout(()=>{o.delete(y)},sie);o.set(y,{deleting:!0,timeoutId:x})},h=y=>{const x=o.get(y);return x!=null&&x.deleting?(f(y),!0):(d(y),!1)},p=y=>{var x;return((x=o.get(y))==null?void 0:x.deleting)??!1},m=()=>{const y=a.value;if(!y||!h(y.id))return;const S=s.value,E=[...i.value];E.splice(S,1),i.value=E,r("update:dumps",E),E.length>0?s.value=Math.min(S,E.length-1):s.value=0,f(y.id)},g=()=>{u.value&&s.value--},b=()=>{c.value&&s.value++};return nt(()=>n.rawContent,y=>{if(y)try{const x=JSON.parse(String(y)),S=i.value.findIndex(E=>E.id===x.id);if(S!==-1){s.value=S;return}i.value=[x,...i.value],s.value=0}catch(x){console.error("Failed to parse dump snapshot:",x)}},{immediate:!0}),(y,x)=>{var S,E,C;return T(),K(Qe,null,[k(Oa,{class:"border-b"},{toolbox:D(()=>[M("div",qre,[l.value?(T(),K("div",Gre,[k(v(gt),{variant:"ghost",size:"xs",disabled:!u.value,"data-testid":"previous-dump-button",onClick:g},{default:D(()=>[k(v(mN),{class:"size-3"})]),_:1},8,["disabled"]),M("span",Wre,de(s.value+1)+" / "+de(i.value.length),1),k(v(gt),{variant:"ghost",size:"xs",disabled:!c.value,"data-testid":"next-dump-button",onClick:b},{default:D(()=>[k(v(U0),{class:"size-3"})]),_:1},8,["disabled"]),a.value?(T(),L(v(gt),{key:0,variant:"outline",size:"xs",class:"shadow-none","data-testid":"delete-dump-button",onClick:m},{default:D(()=>[k(v(cp),{class:Se(["size-3",{"text-destructive":p(a.value.id)}])},null,8,["class"])]),_:1})):we("",!0)])):we("",!0)])]),default:D(()=>{var w;return[M("div",Ure,[M("span",Hre,de(((w=a.value)==null?void 0:w.source)??"Unknown Source"),1)])]}),_:1}),M("div",Kre,[(S=a.value)!=null&&S.timestamp?(T(),K("div",Xre," Dumped At: "+de(((E=a.value)==null?void 0:E.timestamp)??""),1)):we("",!0),a.value===void 0||a.value===null?(T(),K("div",Yre,[M("div",Jre,[k(Xh,{class:"text-subtle-foreground"}),x[0]||(x[0]=ne(" Info ",-1))]),x[1]||(x[1]=M("div",{class:"p-panel"},"Please make sure one dump snapshot is selected.",-1))])):a.value.dumps.length===0?(T(),K("div",Zre,[M("div",Qre,[k(Xh,{class:"text-destructive"}),x[2]||(x[2]=ne(" Error ",-1))]),x[3]||(x[3]=M("div",{class:"p-panel"},[M("p",null," Something Went Wrong! Die and Dump is detected but there is no dumps. "),M("small",null,[ne(" If you think this is a bug, please open a "),M("a",{class:"underline",href:"https://github.com/sunchayn/nimbus/issues/new/choose"}," Bug "),ne(" card. ")])],-1))])):(T(),K("div",{key:a.value.id,class:"flex flex-col gap-2.5"},[(T(!0),K(Qe,null,_n(((C=a.value)==null?void 0:C.dumps)??[],(w,A)=>(T(),K("div",{key:A,class:"border-subtle bg-card rounded-md border","data-testid":`dump-value-${A}`},[M("div",tie,[k(Xh,{class:"text-subtle-foreground pt-1"}),M("span",nie,[M("span",rie,"Dump #"+de(A+1),1)])]),M("div",iie,[a.value?(T(),L(v(jre),{key:0,class:"w-full max-w-full",dump:w},null,8,["dump"])):we("",!0)])],8,eie))),128))]))])],64)}}}),aie={class:"relative w-full overflow-auto"},lie=z({__name:"AppTable",props:{class:{}},setup(t){const e=t;return(n,r)=>(T(),K("div",aie,[M("table",{class:Se(v(ke)("w-full caption-bottom text-sm",e.class))},[Q(n.$slots,"default")],2)]))}}),uie=z({__name:"AppTableBody",props:{class:{}},setup(t){const e=t;return(n,r)=>(T(),K("tbody",{class:Se(v(ke)("[&_tr:last-child]:border-0",e.class))},[Q(n.$slots,"default")],2))}}),P1=z({__name:"AppTableCell",props:{class:{}},setup(t){const e=t;return(n,r)=>(T(),K("td",{class:Se(v(ke)("p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-0.5",e.class))},[Q(n.$slots,"default")],2))}}),cie=z({__name:"AppTableRow",props:{class:{}},setup(t){const e=t;return(n,r)=>(T(),K("tr",{class:Se(v(ke)("border-b transition-colors hover:bg-zinc-100/50 data-[state=selected]:bg-zinc-100 dark:hover:bg-zinc-800/50 dark:data-[state=selected]:bg-zinc-800",e.class))},[Q(n.$slots,"default")],2))}}),fie=z({__name:"KeyValueDisplayListItem",props:{item:{}},setup(t){const e=t,{copy:n,copied:r}=Co(),i=()=>{n(String(e.item.value))};return(s,o)=>(T(),L(v(cie),{class:"flex-wrap border-0"},{default:D(()=>[k(v(P1),{class:"pl-panel w-1/4 border-b-1 border-b-transparent align-top font-medium"},{default:D(()=>[ne(de(t.item.key),1)]),_:1}),k(v(P1),{class:"border-border border-b-1 align-top break-words"},{default:D(()=>[Q(s.$slots,"value",{item:e.item},()=>[ne(de(t.item.value),1)])]),_:3}),k(v(P1),{class:"px-panel border-border w-10 border-b-1 align-top"},{default:D(()=>[k(nu,{"on-click":i,copied:v(r)},null,8,["copied"])]),_:1})]),_:3}))}}),G8=z({__name:"KeyValueDisplayList",props:{items:{}},setup(t){return(e,n)=>(T(),L(v(lie),{class:"table-fixed text-xs"},{default:D(()=>[k(v(uie),{class:"max-w-full"},{default:D(()=>[(T(!0),K(Qe,null,_n(t.items,(r,i)=>(T(),L(fie,{key:i,item:r},{value:D(({item:s})=>[Q(e.$slots,"value",{item:s})]),_:3},8,["item"]))),128))]),_:3})]),_:3}))}}),die={class:"flex translate-x-2 items-center space-x-2"},hie={class:"px-panel flex-start flex w-10 items-center"},pie={class:"min-h-0 flex-1 overflow-y-auto"},mie={key:0,class:"text-success mb-1 flex items-center gap-1"},gie=z({__name:"ResponseCookies",props:{cookies:{}},setup(t){var u;const e=t,n=ka(),r=Cl(Tf("response-viewer-cookies-decrypted-"+((u=n.activeTab)==null?void 0:u.id)),!1),{copy:i,copied:s}=Co(),o=q(()=>e.cookies.map(c=>{const f=c.value.decrypted!==null,d=r.value?c.value.decrypted??c.value.raw:c.value.raw;return{key:c.key,value:d,isDecryptable:f}})),a=q(()=>{var c;return((c=e.cookies)==null?void 0:c.length)??!1}),l=()=>{const c=o.value.reduce((f,d)=>`${f}${d.key}: ${d.value} +`,"");i(c)};return(c,f)=>(T(),K(Qe,null,[k(Oa,{class:"border-b"},{toolbox:D(()=>[M("div",die,[k(r8,{disabled:!a.value,onClick:f[0]||(f[0]=()=>r.value=!v(r))},{default:D(()=>[v(r)?(T(),K(Qe,{key:0},[k(v(RN),{class:"size-5"}),f[1]||(f[1]=ne(" Encrypt ",-1))],64)):(T(),K(Qe,{key:1},[k(v(Lx),{class:"size-5"}),f[2]||(f[2]=ne(" Decrypt ",-1))],64))]),_:1},8,["disabled"]),M("div",hie,[k(nu,{disabled:!a.value,"on-click":l,copied:v(s)},null,8,["disabled","copied"])])])]),default:D(()=>[ne(" Cookies ("+de(o.value.length)+") ",1)]),_:1}),M("div",pie,[(T(),L(XI(G8),{items:o.value},{value:D(({item:d})=>[M("span",null,[d.isDecryptable?we("",!0):(T(),K("small",mie,[k(v(Lx),{size:10}),f[3]||(f[3]=ne(" Non-Encrypted Value ",-1))])),ne(" "+de(d.value),1)])]),_:1},8,["items"]))])],64))}}),bie={class:"px-panel flex-start flex w-10 translate-x-2 items-center"},yie={class:"min-h-0 flex-1 overflow-y-auto"},vie=z({__name:"ResponseHeaders",props:{headers:{}},setup(t){const e=t,{copy:n,copied:r}=Co(),i=q(()=>e.headers.map(o=>({key:o.key,value:o.value??""}))),s=()=>{const o=e.headers.reduce((a,l)=>`${a}${l.key}: ${l.value??""} +`,"");n(o)};return(o,a)=>(T(),K(Qe,null,[k(Oa,{class:"border-b"},{toolbox:D(()=>[M("div",bie,[k(nu,{"on-click":s,copied:v(r)},null,8,["copied"])])]),default:D(()=>[ne(" Headers ("+de(t.headers.length)+") ",1)]),_:1}),M("div",yie,[k(G8,{items:i.value},null,8,["items"])])],64))}}),xie={class:"relative min-h-0 flex-1"},Sie={key:0,class:"bg-background absolute top-0 left-0 z-[100] h-full w-full animate-pulse opacity-75"},Eie={class:"bg-subtle flex items-center justify-between border-b"},wie={class:"relative min-w-0 flex-1"},_ie={class:"from-subtle via-subtle/80 pointer-events-none absolute top-0 bottom-0 left-0 w-8 bg-gradient-to-r to-transparent transition-opacity duration-200"},Cie={class:"from-subtle via-subtle/80 pointer-events-none absolute top-0 right-0 bottom-0 w-8 bg-gradient-to-l to-transparent transition-opacity duration-200"},Aie={class:"pr-panel"},Die={class:"flex items-center"},kie=z({__name:"ResponseViewerResponse",props:{response:{}},setup(t){const e=t,n=Rr(),r=Cl(Tf("response-viewer-tab"),"response"),{scrollContainer:i,showLeftMask:s,showRightMask:o,updateScrollMasks:a,scrollTabIntoView:l}=qC(),u=q(()=>e.response),c=q(()=>n.pendingRequestData),f=q(()=>{var h;return(h=u.value)==null?void 0:h.request.transactionMode}),d=h=>{l(h.currentTarget)};return(h,p)=>{var m;return T(),K("div",xie,[(m=c.value)!=null&&m.isProcessing?(T(),K("div",Sie)):we("",!0),k(v(UA),{"default-value":v(r),class:"mt-0 flex h-full flex-col overflow-auto","onUpdate:modelValue":p[1]||(p[1]=g=>r.value=g)},{default:D(()=>[M("div",Eie,[M("div",wie,[M("div",{ref_key:"scrollContainer",ref:i,class:"scrollbar-hide flex items-center justify-between overflow-x-auto",style:{"scrollbar-width":"none","-ms-overflow-style":"none"},onScroll:p[0]||(p[0]=(...g)=>v(a)&&v(a)(...g))},[k(v(HA),{class:"h-toolbar px-panel rounded-none"},{default:D(()=>[k(v(Ho),{value:"response",label:"Response",onClick:d}),k(v(Ho),{value:"response-headers",label:"Headers",onClick:d}),k(v(Ho),{value:"response-cookies",label:"Cookies",onClick:d})]),_:1})],544),ua(M("div",_ie,null,512),[[Al,v(s)]]),ua(M("div",Cie,null,512),[[Al,v(o)]])]),M("div",Aie,[f.value?(T(),L(v(dp),{key:0,value:"Changes were automatically rolled back for this request"},{default:D(()=>[M("div",Die,[k(v(fo),{variant:"outline",class:"gap-1"},{default:D(()=>[k(v(SN),{class:"size-3 min-w-3"}),p[2]||(p[2]=ne(" Transaction Mode ",-1))]),_:1})])]),_:1})):we("",!0)])]),k(v(Uo),{value:"response",class:"mt-0 flex min-h-0 flex-1 flex-col overflow-hidden"},{default:D(()=>{var g,b,y,x;return[((b=(g=u.value)==null?void 0:g.response)==null?void 0:b.status)!==v(xt).DUMP_AND_DIE?(T(),L(v(If),{key:0,class:"min-h-0 flex-1"},{default:D(()=>{var S,E;return[k(kre,{class:"min-h-0",content:((E=(S=u.value)==null?void 0:S.response)==null?void 0:E.body)??""},null,8,["content"])]}),_:1})):(T(),L(oie,{key:1,"raw-content":((x=(y=u.value)==null?void 0:y.response)==null?void 0:x.body)??"[]"},null,8,["raw-content"]))]}),_:1}),k(v(Uo),{value:"response-headers",class:"mt-0 flex min-h-0 flex-1 flex-col overflow-hidden"},{default:D(()=>{var g,b;return[k(vie,{headers:((b=(g=u.value)==null?void 0:g.response)==null?void 0:b.headers)??[]},null,8,["headers"])]}),_:1}),k(v(Uo),{value:"response-cookies",class:"mt-0 flex min-h-0 flex-1 flex-col overflow-hidden"},{default:D(()=>{var g,b;return[k(gie,{cookies:((b=(g=u.value)==null?void 0:g.response)==null?void 0:b.cookies)??[]},null,8,["cookies"])]}),_:1})]),_:1},8,["default-value"])])}}}),Oie=z({__name:"ResponseViewer",props:{class:{},asChild:{type:Boolean},as:{}},setup(t){const e=t,n=ka(),r=q(()=>n.activeResponse);return(i,s)=>(T(),K("div",{class:Se(v(ke)("bg-background flex h-full flex-col",e.class)),"data-testid":"response-content"},[k(fre,{response:r.value,class:"border-b"},null,8,["response"]),r.value?r.value.error?(T(),L(Dre,{key:1,"data-testid":"response-error",error:r.value.error},null,8,["error"])):(T(),L(kie,{key:2,response:r.value},null,8,["response"])):(T(),L(vre,{key:0,"data-testid":"response-empty"}))],2))}}),Tie={class:"from-destructive/10 relative z-10 border-b bg-gradient-to-r to-transparent"},Iie={class:"flex"},Pie={class:"bg-destructive/10 dark:bg-destructive/20 flex items-center px-4"},Rie={class:"p-2.5"},Nie={class:"text-md leading-tight font-semibold"},W8=z({__name:"ErrorCardHeader",props:{message:{}},setup(t){const e=t;return(n,r)=>(T(),K("div",Tie,[M("div",Iie,[M("div",Pie,[k(v(H0),{class:"text-destructive dark:text-foreground size-4"})]),M("div",Rie,[M("h2",Nie,de(e.message),1),r[0]||(r[0]=M("p",{class:"text-subtle-foreground text-sm"},"Route extraction failed",-1))])])]))}}),Mie={class:"flex items-start gap-2.5"},Fie={class:"flex-1"},Lie=["innerHTML"],K8=z({__name:"SuggestedSolutionCallout",props:{solution:{},class:{}},setup(t){const e=t;return(n,r)=>(T(),K("div",{class:Se(v(ke)("bg-subtle rounded-lg border p-2",e.class))},[M("div",Mie,[k(v(TN),{class:"mt-1 size-5 flex-shrink-0"}),M("div",Fie,[r[0]||(r[0]=M("h3",{class:"font-semibold"},"Suggested Solution",-1)),M("p",{class:"text-sm",innerHTML:t.solution},null,8,Lie)])])],2))}}),Bie={class:"text-foreground mb-2 font-semibold"},$ie={class:"bg-destructive/10 dark:bg-destructive/30 rounded-lg p-4"},zie={class:"text-destructive font-mono text-sm"},jie={key:0,class:"text-destructive mt-2 text-sm wrap-break-word"},Vie={key:0,class:"mt-2"},Uie=["innerHTML"],X8=z({__name:"TechnicalDetailsSection",props:{previousError:{}},setup(t){const e=t,{copy:n,copied:r}=Co(),i=()=>{let s=e.previousError.message;e.previousError.file&&(s+=` ${e.previousError.file}::${e.previousError.line}`),e.previousError.trace&&(s+=` -${e.previousError.trace}`),n(String(s))};return(s,o)=>(T(),K("div",null,[M("h3",$ie,[o[0]||(o[0]=ne(" Technical Details ",-1)),k(nu,{"on-click":i,copied:v(r)},null,8,["copied"])]),M("div",zie,[M("p",jie,de(t.previousError.message),1),t.previousError.file?(T(),K("div",Vie,[M("p",null,de(t.previousError.file)+":"+de(t.previousError.line),1),t.previousError.trace?(T(),K("div",Uie,[o[1]||(o[1]=ne(" Trace: ",-1)),o[2]||(o[2]=M("br",null,null,-1)),M("span",{class:"text-subtle-foreground block",innerHTML:t.previousError.trace},null,8,Hie)])):we("",!0)])):we("",!0)])]))}}),qie={class:"from-destructive/5 dark:from-destructive/15 relative h-full max-h-full w-full bg-gradient-to-br to-transparent p-4"},Gie={class:"relative z-10 flex h-full w-full items-center justify-center overflow-auto py-2"},Wie={class:"flex h-full flex-col space-y-4"},Kie={class:"space-y-2"},Xie={class:"bg-subtle/10 relative flex flex-col overflow-hidden rounded-md border-1 break-words backdrop-blur-md"},Yie={key:1,class:"relative z-10 flex flex-1 flex-col space-y-4 overflow-auto p-4"},Jie={class:"flex gap-4"},Zie=z({__name:"GlobalErrorRenderer",props:{error:{}},setup(t){const e=()=>{window.location.reload()};return(n,r)=>(T(),K("div",qie,[M("div",Gie,[M("div",Wie,[M("div",Kie,[k(v(fo),{variant:"outline",class:"p-0 px-1 text-xs"},{default:O(()=>[...r[0]||(r[0]=[ne(" Internal Error ",-1)])]),_:1}),r[1]||(r[1]=M("h1",{class:"text-destructive text-xl font-medium"}," An error occurred while processing your application routes ",-1))]),M("div",Xie,[k(G8,{message:t.error.exception.message},null,8,["message"]),t.error.suggestedSolution?(T(),L(W8,{key:0,solution:t.error.suggestedSolution,class:"rounded-none border-0"},null,8,["solution"])):we("",!0),t.error.exception.previous?(T(),K("div",Yie,[k(K8,{class:"flex-1","previous-error":t.error.exception.previous},null,8,["previous-error"])])):we("",!0)]),M("div",Jie,[k(v(gt),{variant:"outline",size:"xs",onClick:e},{default:O(()=>[k(v(PA)),r[2]||(r[2]=ne(" Retry ",-1))]),_:1})])])]),k(Lm)]))}}),Qie={class:"space-y-2 rounded-lg border p-4"},ese={key:0,class:"flex items-center gap-2"},tse={class:"bg-subtle rounded border px-2 py-1 text-sm"},nse={key:1,class:"flex items-center gap-2"},rse={class:"flex gap-1"},ise={key:2,class:"flex items-center gap-2"},sse={class:"bg-subtle rounded border px-2 py-1 text-sm"},ose={key:3,class:"flex items-center gap-2"},ase={class:"bg-subtle rounded border px-2 py-1 text-sm"},lse=z({__name:"RouteInformationSection",props:{routeContext:{}},setup(t){return(e,n)=>(T(),K("div",null,[n[4]||(n[4]=M("h3",{class:"mb-2 font-semibold"},"Route Information",-1)),M("div",Qie,[t.routeContext.uri?(T(),K("div",ese,[n[0]||(n[0]=M("span",{class:"text-subtle-foreground w-20 text-sm font-medium"},"URI:",-1)),M("code",tse,de(t.routeContext.uri),1)])):we("",!0),t.routeContext.methods?(T(),K("div",nse,[n[1]||(n[1]=M("span",{class:"text-subtle-foreground w-20 text-sm font-medium"}," Methods: ",-1)),M("div",rse,[(T(!0),K(Qe,null,_n(t.routeContext.methods,r=>(T(),L(Fm,{key:r,method:r},null,8,["method"]))),128))])])):we("",!0),t.routeContext.controllerClass?(T(),K("div",ise,[n[2]||(n[2]=M("span",{class:"text-subtle-foreground w-20 text-sm font-medium"}," Controller: ",-1)),M("code",sse,de(t.routeContext.controllerClass),1)])):we("",!0),t.routeContext.controllerMethod?(T(),K("div",ose,[n[3]||(n[3]=M("span",{class:"text-subtle-foreground w-20 text-sm font-medium"}," Method: ",-1)),M("code",ase,de(t.routeContext.controllerMethod),1)])):we("",!0)])]))}}),use={class:"from-destructive/5 dark:from-destructive/15 relative h-full max-h-full w-full bg-gradient-to-br to-transparent p-4"},cse={class:"relative z-10 flex h-full w-full justify-center overflow-auto py-2"},fse={class:"flex h-full flex-col space-y-4"},dse={class:"space-y-2"},hse={class:"bg-subtle/10 relative flex flex-1 flex-col overflow-hidden rounded-md border-1 break-words backdrop-blur-md"},pse={class:"relative z-10 flex flex-1 flex-col space-y-4 overflow-auto p-4"},mse={class:"flex gap-4 px-4 py-2"},gse=z({__name:"RouteSpecificExtractorExceptionRenderer",props:{error:{}},setup(t){const e=t,n=Z(!1),r=()=>{window.location.reload()},i=()=>{if(n.value||!e.error.ignoreData)return;n.value=!0;const s=new URL(window.location.href);s.searchParams.set("ignore",e.error.ignoreData),window.location.href=s.toString()};return(s,o)=>(T(),K("div",use,[M("div",cse,[M("div",fse,[M("div",dse,[k(v(fo),{variant:"outline",class:"p-0 px-1 text-xs"},{default:O(()=>[...o[0]||(o[0]=[ne(" Internal Error ",-1)])]),_:1}),o[1]||(o[1]=M("h1",{class:"text-destructive text-xl font-medium"}," An error occurred while processing your application routes ",-1))]),t.error.suggestedSolution?(T(),L(W8,{key:0,solution:t.error.suggestedSolution},null,8,["solution"])):we("",!0),M("div",hse,[k(G8,{message:t.error.exception.message},null,8,["message"]),M("div",pse,[k(lse,{"route-context":t.error.routeContext},null,8,["route-context"]),t.error.exception.previous?(T(),L(K8,{key:0,class:"flex-1","previous-error":t.error.exception.previous},null,8,["previous-error"])):we("",!0)]),M("div",mse,[k(v(gt),{variant:"outline",size:"xs",disabled:n.value,onClick:r},{default:O(()=>[k(v(PA)),o[2]||(o[2]=ne(" Retry ",-1))]),_:1},8,["disabled"]),k(v(gt),{variant:"default",disabled:n.value,size:"xs",onClick:i},{default:O(()=>[n.value?(T(),L(v(TN),{key:0,class:"animate-spin"})):(T(),L(v(MN),{key:1})),ne(" "+de(n.value?"Ignoring...":"Ignore this Endpoint"),1)]),_:1},8,["disabled"])])])])]),k(Lm)]))}}),bse=z({__name:"RouteExtractorExceptionRenderer",props:{error:{}},setup(t){return(e,n)=>(T(),L(gse,{error:t.error},null,8,["error"]))}}),yse={class:"w-full"},vse={class:"flex items-center gap-2 overflow-hidden"},xse=z({__name:"ApplicationSwitcher",setup(t){const e=Xi(),n=r=>{if(r===null)return;const i=new URL(window.location.href);i.searchParams.set("application",String(r)),window.location.href=i.toString()};return(r,i)=>(T(),K("div",yse,[k(v(tu),{"model-value":v(e).activeApplication||"","onUpdate:modelValue":n},{default:O(()=>[k(v(Zl),{class:"px-panel w-full border-none text-xs shadow-none focus:ring-0 active:ring-0"},{default:O(()=>[M("div",vse,[k(v(kN),{class:"text-subtle-foreground size-3.5 shrink-0"}),k(v(Ql),{placeholder:"Select an application",class:"truncate"})])]),_:1}),k(v(eu),{class:"min-w-52","align-offset":2},{default:O(()=>[k(v(Pc),null,{default:O(()=>[k(v(Rc),null,{default:O(()=>[...i[0]||(i[0]=[ne("Applications",-1)])]),_:1}),(T(!0),K(Qe,null,_n(v(e).applications,(s,o)=>(T(),L(v(Es),{key:o,value:o,class:"text-xs"},{default:O(()=>[ne(de(s),1)]),_:2},1032,["value"]))),128))]),_:1})]),_:1})]),_:1},8,["model-value"])]))}});function X8(t){const e=t.MASK_HEIGHT,n=t.MASK_HEIGHT,r=(t==null?void 0:t.SCROLL_THRESHOLD)??pd.SCROLL_THRESHOLD,i=(t==null?void 0:t.SCROLL_PADDING)??pd.SCROLL_PADDING,s=(t==null?void 0:t.ANIMATION_DURATION)??pd.ANIMATION_DURATION,o=(t==null?void 0:t.DEBOUNCE_DELAY)??pd.DEBOUNCE_DELAY,a=Z(null),l=Z(!1),u=Z(!1),c=q(()=>{if(!a.value)return null;const{scrollTop:S,scrollHeight:E,clientHeight:C}=a.value,w=Math.round(S),A=Math.max(0,Math.round(E)-Math.round(C));return{current:w,max:A,isAtStart:w<=r,isAtEnd:A<=r||w>=A-r}}),f=()=>{if(!a.value)return;const{scrollTop:S,scrollHeight:E,clientHeight:C}=a.value,w=Math.round(S),A=Math.round(E),_=Math.round(C),D=Math.max(0,A-_),I=D<=r,N=w<=r,P=I||w>=D-r;l.value=!N&&!I,u.value=!P&&!I},d=Gy(f,o),h=S=>{if(!a.value)return;const E=a.value,C=E.getBoundingClientRect(),w=S.getBoundingClientRect(),A=w.top-C.top+E.scrollTop,_=A+w.height,D=E.clientHeightP&&(R=_-E.clientHeight+I+i),R!==E.scrollTop&&(E.scrollTo({top:R,behavior:"smooth"}),setTimeout(()=>{f()},s))},p=()=>{if(a.value)return a.value.addEventListener("scroll",d,{passive:!0}),()=>{var S;(S=a.value)==null||S.removeEventListener("scroll",d)}},m=()=>co(a,d),g=()=>XI(a,d,{childList:!0,subtree:!0});let b=null,y=null,x=null;return gn(()=>{b=p()??null,y=m().stop,x=g().stop,kr(()=>{f()})}),wo(()=>{b==null||b(),y==null||y(),x==null||x()}),{scrollContainer:a,showTopMask:kc(l),showBottomMask:kc(u),scrollBounds:c,updateScrollMasks:f,scrollTabIntoView:h}}var Xh={exports:{}},P1={exports:{}},R1={};/** +${e.previousError.trace}`),n(String(s))};return(s,o)=>(T(),K("div",null,[M("h3",Bie,[o[0]||(o[0]=ne(" Technical Details ",-1)),k(nu,{"on-click":i,copied:v(r)},null,8,["copied"])]),M("div",$ie,[M("p",zie,de(t.previousError.message),1),t.previousError.file?(T(),K("div",jie,[M("p",null,de(t.previousError.file)+":"+de(t.previousError.line),1),t.previousError.trace?(T(),K("div",Vie,[o[1]||(o[1]=ne(" Trace: ",-1)),o[2]||(o[2]=M("br",null,null,-1)),M("span",{class:"text-subtle-foreground block",innerHTML:t.previousError.trace},null,8,Uie)])):we("",!0)])):we("",!0)])]))}}),Hie={class:"from-destructive/5 dark:from-destructive/15 relative h-full max-h-full w-full bg-gradient-to-br to-transparent p-4"},qie={class:"relative z-10 flex h-full w-full items-center justify-center overflow-auto py-2"},Gie={class:"flex h-full flex-col space-y-4"},Wie={class:"space-y-2"},Kie={class:"bg-subtle/10 relative flex flex-col overflow-hidden rounded-md border-1 break-words backdrop-blur-md"},Xie={key:1,class:"relative z-10 flex flex-1 flex-col space-y-4 overflow-auto p-4"},Yie={class:"flex gap-4"},Jie=z({__name:"GlobalErrorRenderer",props:{error:{}},setup(t){const e=()=>{window.location.reload()};return(n,r)=>(T(),K("div",Hie,[M("div",qie,[M("div",Gie,[M("div",Wie,[k(v(fo),{variant:"outline",class:"p-0 px-1 text-xs"},{default:D(()=>[...r[0]||(r[0]=[ne(" Internal Error ",-1)])]),_:1}),r[1]||(r[1]=M("h1",{class:"text-destructive text-xl font-medium"}," An error occurred while processing your application routes ",-1))]),M("div",Kie,[k(W8,{message:t.error.exception.message},null,8,["message"]),t.error.suggestedSolution?(T(),L(K8,{key:0,solution:t.error.suggestedSolution,class:"rounded-none border-0"},null,8,["solution"])):we("",!0),t.error.exception.previous?(T(),K("div",Xie,[k(X8,{class:"flex-1","previous-error":t.error.exception.previous},null,8,["previous-error"])])):we("",!0)]),M("div",Yie,[k(v(gt),{variant:"outline",size:"xs",onClick:e},{default:D(()=>[k(v(RA)),r[2]||(r[2]=ne(" Retry ",-1))]),_:1})])])]),k(Bm)]))}}),Zie={class:"space-y-2 rounded-lg border p-4"},Qie={key:0,class:"flex items-center gap-2"},ese={class:"bg-subtle rounded border px-2 py-1 text-sm"},tse={key:1,class:"flex items-center gap-2"},nse={class:"flex gap-1"},rse={key:2,class:"flex items-center gap-2"},ise={class:"bg-subtle rounded border px-2 py-1 text-sm"},sse={key:3,class:"flex items-center gap-2"},ose={class:"bg-subtle rounded border px-2 py-1 text-sm"},ase=z({__name:"RouteInformationSection",props:{routeContext:{}},setup(t){return(e,n)=>(T(),K("div",null,[n[4]||(n[4]=M("h3",{class:"mb-2 font-semibold"},"Route Information",-1)),M("div",Zie,[t.routeContext.uri?(T(),K("div",Qie,[n[0]||(n[0]=M("span",{class:"text-subtle-foreground w-20 text-sm font-medium"},"URI:",-1)),M("code",ese,de(t.routeContext.uri),1)])):we("",!0),t.routeContext.methods?(T(),K("div",tse,[n[1]||(n[1]=M("span",{class:"text-subtle-foreground w-20 text-sm font-medium"}," Methods: ",-1)),M("div",nse,[(T(!0),K(Qe,null,_n(t.routeContext.methods,r=>(T(),L(Lm,{key:r,method:r},null,8,["method"]))),128))])])):we("",!0),t.routeContext.controllerClass?(T(),K("div",rse,[n[2]||(n[2]=M("span",{class:"text-subtle-foreground w-20 text-sm font-medium"}," Controller: ",-1)),M("code",ise,de(t.routeContext.controllerClass),1)])):we("",!0),t.routeContext.controllerMethod?(T(),K("div",sse,[n[3]||(n[3]=M("span",{class:"text-subtle-foreground w-20 text-sm font-medium"}," Method: ",-1)),M("code",ose,de(t.routeContext.controllerMethod),1)])):we("",!0)])]))}}),lse={class:"from-destructive/5 dark:from-destructive/15 relative h-full max-h-full w-full bg-gradient-to-br to-transparent p-4"},use={class:"relative z-10 flex h-full w-full justify-center overflow-auto py-2"},cse={class:"flex h-full flex-col space-y-4"},fse={class:"space-y-2"},dse={class:"bg-subtle/10 relative flex flex-1 flex-col overflow-hidden rounded-md border-1 break-words backdrop-blur-md"},hse={class:"relative z-10 flex flex-1 flex-col space-y-4 overflow-auto p-4"},pse={class:"flex gap-4 px-4 py-2"},mse=z({__name:"RouteSpecificExtractorExceptionRenderer",props:{error:{}},setup(t){const e=t,n=Z(!1),r=()=>{window.location.reload()},i=()=>{if(n.value||!e.error.ignoreData)return;n.value=!0;const s=new URL(window.location.href);s.searchParams.set("ignore",e.error.ignoreData),window.location.href=s.toString()};return(s,o)=>(T(),K("div",lse,[M("div",use,[M("div",cse,[M("div",fse,[k(v(fo),{variant:"outline",class:"p-0 px-1 text-xs"},{default:D(()=>[...o[0]||(o[0]=[ne(" Internal Error ",-1)])]),_:1}),o[1]||(o[1]=M("h1",{class:"text-destructive text-xl font-medium"}," An error occurred while processing your application routes ",-1))]),t.error.suggestedSolution?(T(),L(K8,{key:0,solution:t.error.suggestedSolution},null,8,["solution"])):we("",!0),M("div",dse,[k(W8,{message:t.error.exception.message},null,8,["message"]),M("div",hse,[k(ase,{"route-context":t.error.routeContext},null,8,["route-context"]),t.error.exception.previous?(T(),L(X8,{key:0,class:"flex-1","previous-error":t.error.exception.previous},null,8,["previous-error"])):we("",!0)]),M("div",pse,[k(v(gt),{variant:"outline",size:"xs",disabled:n.value,onClick:r},{default:D(()=>[k(v(RA)),o[2]||(o[2]=ne(" Retry ",-1))]),_:1},8,["disabled"]),k(v(gt),{variant:"default",disabled:n.value,size:"xs",onClick:i},{default:D(()=>[n.value?(T(),L(v(IN),{key:0,class:"animate-spin"})):(T(),L(v(FN),{key:1})),ne(" "+de(n.value?"Ignoring...":"Ignore this Endpoint"),1)]),_:1},8,["disabled"])])])])]),k(Bm)]))}}),gse=z({__name:"RouteExtractorExceptionRenderer",props:{error:{}},setup(t){return(e,n)=>(T(),L(mse,{error:t.error},null,8,["error"]))}}),bse={class:"w-full"},yse={class:"flex items-center gap-2 overflow-hidden"},vse=z({__name:"ApplicationSwitcher",setup(t){const e=Xi(),n=r=>{if(r===null)return;const i=new URL(window.location.href);i.searchParams.set("application",String(r)),window.location.href=i.toString()};return(r,i)=>(T(),K("div",bse,[k(v(tu),{"model-value":v(e).activeApplication||"","onUpdate:modelValue":n},{default:D(()=>[k(v(Zl),{class:"px-panel w-full border-none text-xs shadow-none focus:ring-0 active:ring-0"},{default:D(()=>[M("div",yse,[k(v(ON),{class:"text-subtle-foreground size-3.5 shrink-0"}),k(v(Ql),{placeholder:"Select an application",class:"truncate"})])]),_:1}),k(v(eu),{class:"min-w-52","align-offset":2},{default:D(()=>[k(v(Pc),null,{default:D(()=>[k(v(Rc),null,{default:D(()=>[...i[0]||(i[0]=[ne("Applications",-1)])]),_:1}),(T(!0),K(Qe,null,_n(v(e).applications,(s,o)=>(T(),L(v(Es),{key:o,value:o,class:"text-xs"},{default:D(()=>[ne(de(s),1)]),_:2},1032,["value"]))),128))]),_:1})]),_:1})]),_:1},8,["model-value"])]))}});function Y8(t){const e=t.MASK_HEIGHT,n=t.MASK_HEIGHT,r=(t==null?void 0:t.SCROLL_THRESHOLD)??md.SCROLL_THRESHOLD,i=(t==null?void 0:t.SCROLL_PADDING)??md.SCROLL_PADDING,s=(t==null?void 0:t.ANIMATION_DURATION)??md.ANIMATION_DURATION,o=(t==null?void 0:t.DEBOUNCE_DELAY)??md.DEBOUNCE_DELAY,a=Z(null),l=Z(!1),u=Z(!1),c=q(()=>{if(!a.value)return null;const{scrollTop:S,scrollHeight:E,clientHeight:C}=a.value,w=Math.round(S),A=Math.max(0,Math.round(E)-Math.round(C));return{current:w,max:A,isAtStart:w<=r,isAtEnd:A<=r||w>=A-r}}),f=()=>{if(!a.value)return;const{scrollTop:S,scrollHeight:E,clientHeight:C}=a.value,w=Math.round(S),A=Math.round(E),_=Math.round(C),O=Math.max(0,A-_),I=O<=r,N=w<=r,P=I||w>=O-r;l.value=!N&&!I,u.value=!P&&!I},d=Wy(f,o),h=S=>{if(!a.value)return;const E=a.value,C=E.getBoundingClientRect(),w=S.getBoundingClientRect(),A=w.top-C.top+E.scrollTop,_=A+w.height,O=E.clientHeightP&&(R=_-E.clientHeight+I+i),R!==E.scrollTop&&(E.scrollTo({top:R,behavior:"smooth"}),setTimeout(()=>{f()},s))},p=()=>{if(a.value)return a.value.addEventListener("scroll",d,{passive:!0}),()=>{var S;(S=a.value)==null||S.removeEventListener("scroll",d)}},m=()=>co(a,d),g=()=>YI(a,d,{childList:!0,subtree:!0});let b=null,y=null,x=null;return gn(()=>{b=p()??null,y=m().stop,x=g().stop,kr(()=>{f()})}),wo(()=>{b==null||b(),y==null||y(),x==null||x()}),{scrollContainer:a,showTopMask:kc(l),showBottomMask:kc(u),scrollBounds:c,updateScrollMasks:f,scrollTabIntoView:h}}var Yh={exports:{}},R1={exports:{}},N1={};/** * @vue/compiler-core v3.5.22 * (c) 2018-present Yuxi (Evan) You and Vue contributors * @license MIT -**/const Ul=Symbol(""),wl=Symbol(""),Bm=Symbol(""),vf=Symbol(""),G2=Symbol(""),Eo=Symbol(""),W2=Symbol(""),K2=Symbol(""),$m=Symbol(""),zm=Symbol(""),xu=Symbol(""),jm=Symbol(""),X2=Symbol(""),Vm=Symbol(""),Um=Symbol(""),Hm=Symbol(""),qm=Symbol(""),Gm=Symbol(""),Wm=Symbol(""),Y2=Symbol(""),J2=Symbol(""),sd=Symbol(""),xf=Symbol(""),Km=Symbol(""),Xm=Symbol(""),Hl=Symbol(""),Su=Symbol(""),Ym=Symbol(""),b0=Symbol(""),Y8=Symbol(""),y0=Symbol(""),Sf=Symbol(""),J8=Symbol(""),Z8=Symbol(""),Jm=Symbol(""),Q8=Symbol(""),e4=Symbol(""),Zm=Symbol(""),Z2=Symbol(""),va={[Ul]:"Fragment",[wl]:"Teleport",[Bm]:"Suspense",[vf]:"KeepAlive",[G2]:"BaseTransition",[Eo]:"openBlock",[W2]:"createBlock",[K2]:"createElementBlock",[$m]:"createVNode",[zm]:"createElementVNode",[xu]:"createCommentVNode",[jm]:"createTextVNode",[X2]:"createStaticVNode",[Vm]:"resolveComponent",[Um]:"resolveDynamicComponent",[Hm]:"resolveDirective",[qm]:"resolveFilter",[Gm]:"withDirectives",[Wm]:"renderList",[Y2]:"renderSlot",[J2]:"createSlots",[sd]:"toDisplayString",[xf]:"mergeProps",[Km]:"normalizeClass",[Xm]:"normalizeStyle",[Hl]:"normalizeProps",[Su]:"guardReactiveProps",[Ym]:"toHandlers",[b0]:"camelize",[Y8]:"capitalize",[y0]:"toHandlerKey",[Sf]:"setBlockTracking",[J8]:"pushScopeId",[Z8]:"popScopeId",[Jm]:"withCtx",[Q8]:"unref",[e4]:"isRef",[Zm]:"withMemo",[Z2]:"isMemoSame"};function t4(t){Object.getOwnPropertySymbols(t).forEach(e=>{va[e]=t[e]})}const Sse={HTML:0,0:"HTML",SVG:1,1:"SVG",MATH_ML:2,2:"MATH_ML"},Ese={ROOT:0,0:"ROOT",ELEMENT:1,1:"ELEMENT",TEXT:2,2:"TEXT",COMMENT:3,3:"COMMENT",SIMPLE_EXPRESSION:4,4:"SIMPLE_EXPRESSION",INTERPOLATION:5,5:"INTERPOLATION",ATTRIBUTE:6,6:"ATTRIBUTE",DIRECTIVE:7,7:"DIRECTIVE",COMPOUND_EXPRESSION:8,8:"COMPOUND_EXPRESSION",IF:9,9:"IF",IF_BRANCH:10,10:"IF_BRANCH",FOR:11,11:"FOR",TEXT_CALL:12,12:"TEXT_CALL",VNODE_CALL:13,13:"VNODE_CALL",JS_CALL_EXPRESSION:14,14:"JS_CALL_EXPRESSION",JS_OBJECT_EXPRESSION:15,15:"JS_OBJECT_EXPRESSION",JS_PROPERTY:16,16:"JS_PROPERTY",JS_ARRAY_EXPRESSION:17,17:"JS_ARRAY_EXPRESSION",JS_FUNCTION_EXPRESSION:18,18:"JS_FUNCTION_EXPRESSION",JS_CONDITIONAL_EXPRESSION:19,19:"JS_CONDITIONAL_EXPRESSION",JS_CACHE_EXPRESSION:20,20:"JS_CACHE_EXPRESSION",JS_BLOCK_STATEMENT:21,21:"JS_BLOCK_STATEMENT",JS_TEMPLATE_LITERAL:22,22:"JS_TEMPLATE_LITERAL",JS_IF_STATEMENT:23,23:"JS_IF_STATEMENT",JS_ASSIGNMENT_EXPRESSION:24,24:"JS_ASSIGNMENT_EXPRESSION",JS_SEQUENCE_EXPRESSION:25,25:"JS_SEQUENCE_EXPRESSION",JS_RETURN_STATEMENT:26,26:"JS_RETURN_STATEMENT"},wse={ELEMENT:0,0:"ELEMENT",COMPONENT:1,1:"COMPONENT",SLOT:2,2:"SLOT",TEMPLATE:3,3:"TEMPLATE"},_se={NOT_CONSTANT:0,0:"NOT_CONSTANT",CAN_SKIP_PATCH:1,1:"CAN_SKIP_PATCH",CAN_CACHE:2,2:"CAN_CACHE",CAN_STRINGIFY:3,3:"CAN_STRINGIFY"},ln={start:{line:1,column:1,offset:0},end:{line:1,column:1,offset:0},source:""};function n4(t,e=""){return{type:0,source:e,children:t,helpers:new Set,components:[],directives:[],hoists:[],imports:[],cached:[],temps:0,codegenNode:void 0,loc:ln}}function ql(t,e,n,r,i,s,o,a=!1,l=!1,u=!1,c=ln){return t&&(a?(t.helper(Eo),t.helper(Ea(t.inSSR,u))):t.helper(Sa(t.inSSR,u)),o&&t.helper(Gm)),{type:13,tag:e,props:n,children:r,patchFlag:i,dynamicProps:s,directives:o,isBlock:a,disableTracking:l,isComponent:u,loc:c}}function uo(t,e=ln){return{type:17,loc:e,elements:t}}function Dr(t,e=ln){return{type:15,loc:e,properties:t}}function Gt(t,e){return{type:16,loc:ln,key:on(t)?Pe(t,!0):t,value:e}}function Pe(t,e=!1,n=ln,r=0){return{type:4,loc:n,content:t,isStatic:e,constType:e?3:r}}function Cse(t,e){return{type:5,loc:e,content:on(t)?Pe(t,!1,e):t}}function Hr(t,e=ln){return{type:8,loc:e,children:t}}function Zt(t,e=[],n=ln){return{type:14,loc:n,callee:t,arguments:e}}function xa(t,e=void 0,n=!1,r=!1,i=ln){return{type:18,params:t,returns:e,newline:n,isSlot:r,loc:i}}function v0(t,e,n,r=!0){return{type:19,test:t,consequent:e,alternate:n,newline:r,loc:ln}}function r4(t,e,n=!1,r=!1){return{type:20,index:t,value:e,needPauseTracking:n,inVOnce:r,needArraySpread:!1,loc:ln}}function i4(t){return{type:21,body:t,loc:ln}}function Ase(t){return{type:22,elements:t,loc:ln}}function Dse(t,e,n){return{type:23,test:t,consequent:e,alternate:n,loc:ln}}function kse(t,e){return{type:24,left:t,right:e,loc:ln}}function Ose(t){return{type:25,expressions:t,loc:ln}}function Tse(t){return{type:26,returns:t,loc:ln}}function Sa(t,e){return t||e?$m:zm}function Ea(t,e){return t||e?W2:K2}function Qm(t,{helper:e,removeHelper:n,inSSR:r}){t.isBlock||(t.isBlock=!0,n(Sa(r,t.isComponent)),e(Eo),e(Ea(r,t.isComponent)))}const lC=new Uint8Array([123,123]),uC=new Uint8Array([125,125]);function cC(t){return t>=97&&t<=122||t>=65&&t<=90}function Er(t){return t===32||t===10||t===9||t===12||t===13}function Is(t){return t===47||t===62||Er(t)}function x0(t){const e=new Uint8Array(t.length);for(let n=0;n=0;i--){const s=this.newlines[i];if(e>s){n=i+2,r=e-s;break}}return{column:r,line:n,offset:e}}peek(){return this.buffer.charCodeAt(this.index+1)}stateText(e){e===60?(this.index>this.sectionStart&&this.cbs.ontext(this.sectionStart,this.index),this.state=5,this.sectionStart=this.index):!this.inVPre&&e===this.delimiterOpen[0]&&(this.state=2,this.delimiterIndex=0,this.stateInterpolationOpen(e))}stateInterpolationOpen(e){if(e===this.delimiterOpen[this.delimiterIndex])if(this.delimiterIndex===this.delimiterOpen.length-1){const n=this.index+1-this.delimiterOpen.length;n>this.sectionStart&&this.cbs.ontext(this.sectionStart,n),this.state=3,this.sectionStart=n}else this.delimiterIndex++;else this.inRCDATA?(this.state=32,this.stateInRCDATA(e)):(this.state=1,this.stateText(e))}stateInterpolation(e){e===this.delimiterClose[0]&&(this.state=4,this.delimiterIndex=0,this.stateInterpolationClose(e))}stateInterpolationClose(e){e===this.delimiterClose[this.delimiterIndex]?this.delimiterIndex===this.delimiterClose.length-1?(this.cbs.oninterpolation(this.sectionStart,this.index+1),this.inRCDATA?this.state=32:this.state=1,this.sectionStart=this.index+1):this.delimiterIndex++:(this.state=3,this.stateInterpolation(e))}stateSpecialStartSequence(e){const n=this.sequenceIndex===this.currentSequence.length;if(!(n?Is(e):(e|32)===this.currentSequence[this.sequenceIndex]))this.inRCDATA=!1;else if(!n){this.sequenceIndex++;return}this.sequenceIndex=0,this.state=6,this.stateInTagName(e)}stateInRCDATA(e){if(this.sequenceIndex===this.currentSequence.length){if(e===62||Er(e)){const n=this.index-this.currentSequence.length;if(this.sectionStart=e||(this.state===28?this.currentSequence===Cn.CdataEnd?this.cbs.oncdata(this.sectionStart,e):this.cbs.oncomment(this.sectionStart,e):this.state===6||this.state===11||this.state===18||this.state===17||this.state===12||this.state===13||this.state===14||this.state===15||this.state===16||this.state===20||this.state===19||this.state===21||this.state===9||this.cbs.ontext(this.sectionStart,e))}emitCodePoint(e,n){}}const Pse={COMPILER_IS_ON_ELEMENT:"COMPILER_IS_ON_ELEMENT",COMPILER_V_BIND_SYNC:"COMPILER_V_BIND_SYNC",COMPILER_V_BIND_OBJECT_ORDER:"COMPILER_V_BIND_OBJECT_ORDER",COMPILER_V_ON_NATIVE:"COMPILER_V_ON_NATIVE",COMPILER_V_IF_V_FOR_PRECEDENCE:"COMPILER_V_IF_V_FOR_PRECEDENCE",COMPILER_NATIVE_TEMPLATE:"COMPILER_NATIVE_TEMPLATE",COMPILER_INLINE_TEMPLATE:"COMPILER_INLINE_TEMPLATE",COMPILER_FILTERS:"COMPILER_FILTERS"},Rse={COMPILER_IS_ON_ELEMENT:{message:'Platform-native elements with "is" prop will no longer be treated as components in Vue 3 unless the "is" value is explicitly prefixed with "vue:".',link:"https://v3-migration.vuejs.org/breaking-changes/custom-elements-interop.html"},COMPILER_V_BIND_SYNC:{message:t=>`.sync modifier for v-bind has been removed. Use v-model with argument instead. \`v-bind:${t}.sync\` should be changed to \`v-model:${t}\`.`,link:"https://v3-migration.vuejs.org/breaking-changes/v-model.html"},COMPILER_V_BIND_OBJECT_ORDER:{message:'v-bind="obj" usage is now order sensitive and behaves like JavaScript object spread: it will now overwrite an existing non-mergeable attribute that appears before v-bind in the case of conflict. To retain 2.x behavior, move v-bind to make it the first attribute. You can also suppress this warning if the usage is intended.',link:"https://v3-migration.vuejs.org/breaking-changes/v-bind.html"},COMPILER_V_ON_NATIVE:{message:".native modifier for v-on has been removed as is no longer necessary.",link:"https://v3-migration.vuejs.org/breaking-changes/v-on-native-modifier-removed.html"},COMPILER_V_IF_V_FOR_PRECEDENCE:{message:"v-if / v-for precedence when used on the same element has changed in Vue 3: v-if now takes higher precedence and will no longer have access to v-for scope variables. It is best to avoid the ambiguity with