@vitejs/devtools-vite 0.0.0-alpha.22 → 0.0.0-alpha.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +6 -3
- package/dist/index.mjs +19 -8
- package/dist/nitro.json +1 -1
- package/dist/public/200.html +1 -1
- package/dist/public/404.html +1 -1
- package/dist/public/_nuxt/{OEdZKRk6.js → B6S2Zyzx.js} +1 -1
- package/dist/public/_nuxt/BOqtjoUy.js +1 -0
- package/dist/public/_nuxt/C43a-rz2.js +4 -0
- package/dist/public/_nuxt/CSnXz0lV.js +1 -0
- package/dist/public/_nuxt/{jVJLbHmI.js → CaesVv62.js} +1 -1
- package/dist/public/_nuxt/{DDTVi-ZV.js → Cql23O0M.js} +1 -1
- package/dist/public/_nuxt/DKJ7Yb8n.js +1 -0
- package/dist/public/_nuxt/builds/latest.json +1 -1
- package/dist/public/_nuxt/builds/meta/d61b2fbd-b4b2-4f0d-9b46-a34c82edf808.json +1 -0
- package/dist/public/_nuxt/{entry.B7Ui_tQC.css → entry.CO9FV_5d.css} +1 -1
- package/dist/public/_nuxt/error-404.B9aEH8ms.css +1 -0
- package/dist/public/_nuxt/error-500.Bzg2DBFk.css +1 -0
- package/dist/public/index.html +1 -1
- package/package.json +9 -8
- package/dist/public/_nuxt/CDPpT6Cf.js +0 -1
- package/dist/public/_nuxt/D6Epdimc.js +0 -4
- package/dist/public/_nuxt/HyHtDydt.js +0 -1
- package/dist/public/_nuxt/NkHXFX5A.js +0 -1
- package/dist/public/_nuxt/builds/meta/26a4981b-f9f2-4e38-94f7-bf74f5a3019a.json +0 -1
- package/dist/public/_nuxt/error-404.DgDpC6Er.css +0 -1
- package/dist/public/_nuxt/error-500.CDOeHf8w.css +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{At as e,E as t,Et as n,G as r,Ht as i,Jt as a,K as o,Mt as s,Yt as c,an as l,at as u,c as d,ct as f,dt as p,g as m,ht as h,l as g,lt as _,mt as v,nn as y,p as b,pt as x,st as S,tn as C,ut as w,w as T,x as E,y as ee,zt as te}from"#entry";import{t as D}from"./s37iQDTO.js";import{r as O,t as k}from"./EZmie0b_.js";import{r as A,t as j}from"./CE23KUMI.js";import{n as M,r as N,t as P}from"./XY_il7uL.js";import{a as F,c as I,n as ne,t as re}from"./xtsFKyex.js";import{t as L}from"./C8YTjkYM.js";import{t as ie}from"./BwW8gZ6K.js";var R={flex:`~ row gap-1`,"of-hidden":``},z={flex:`~ row gap-1`,"ws-nowrap":``},B={p2:``,flex:`~ col gap-1`},V=h({__name:`Importers`,props:{package:{},session:{},showVersion:{type:Boolean}},setup(t){let r=t,a=S(()=>{let e=new Map;return r.package.files.filter(e=>!!e.importers).flatMap(e=>e.importers).filter(e=>!e.path.startsWith(r.package?.dir??``)).forEach(t=>{e.set(t.path,t)}),Array.from(e.values())});return(r,o)=>{let c=k,l=O,d=s(`VMenu`);return n(),p(`div`,R,[f(`div`,z,[v(c,{id:a.value[0].path,session:t.session,link:``},null,8,[`id`,`session`]),a.value[0].version&&t.showVersion?(n(),_(l,{key:0,text:a.value[0].version,as:`span`},null,8,[`text`])):w(``,!0)]),a.value.length>1?(n(),_(d,{key:0,delay:{show:200,hide:0},"flex-none":``},{popper:i(()=>[f(`div`,B,[(n(!0),p(u,null,e(a.value,e=>(n(),p(`div`,{key:e.path,flex:`~ row gap-1 items-center nowrap`,"w-max":``},[v(c,{id:e.path,session:t.session,"ws-nowrap":``,"flex-1":``,"disable-tooltip":``,link:``},null,8,[`id`,`session`]),e.version&&t.showVersion?(n(),_(l,{key:0,text:`v${e.version}`,as:`span`},null,8,[`text`])):w(``,!0)]))),128))])]),default:i(()=>[v(l,{text:`+${a.value.length}`,color:100,class:`text-xs rounded px1`},null,8,[`text`])]),_:1})):w(``,!0)])}}}),H=Object.assign(V,{__name:`PackagesImporters`}),U={role:`table`,"min-w-max":``,border:`~ base rounded-xl`},W={role:`row`,class:`border-b border-base`,flex:`~ row`},G=[`title`],K={key:0,"font-mono":``},q={key:0,title:`Package version`,role:`columnheader`,"rounded-tr-2":``,"flex-none":``,"min-w40":``,"ws-nowrap":``,"text-left":``,"py1.5":``,px2:``,"font-600":``},J={flex:`~ row gap1 items-center justify-end`,"w-full":``,relative:``,pr2:``},Y={key:0,role:`cell`,"font-mono":``,"flex-none":``,w80:``,"py1.5":``,px2:``,"ws-nowrap":``,"text-sm":``,"overflow-hidden":``,truncate:``},X={"font-mono":``,"text-sm":``},Z={role:`cell`,flex:`~ items-center justify-end`,"flex-none":``,"font-mono":``,"py1.5":``,px2:``,"text-sm":``,"min-w40":``,op80:``},ae={p2:``,flex:`~ col gap-1`},oe={w24:``,"inline-flex":``},se={role:`cell`,flex:`~ items-center`,"flex-1":``,"font-mono":``,"py1.5":``,pl20:``,pr2:``,"text-sm":``,op80:``},ce={key:1},le=h({__name:`Table`,props:{packages:{},session:{},disableSizeSort:{type:Boolean,default:!1},groupView:{type:Boolean,default:!1}},setup(a){let o=r(),{state:s,next:c}=g([``,`desc`,`asc`],{initialValue:j.value.packageSizeSortType});function d(){c(),j.value.packageSizeSortType=s.value}return(r,c)=>{let m=L,h=A,g=k,b=H,S=D,E=P;return n(),p(`div`,U,[f(`div`,W,[f(`div`,{title:a.groupView?`Package`:`Bundled packages`,role:`columnheader`,"rounded-tl-2":``,"flex-none":``,"ws-nowrap":``,"py1.5":``,px2:``,"font-600":``,class:y([a.groupView?`min-w40`:`min-w80`])},[a.groupView?(n(),p(`div`,K,[v(m,{name:a.packages?.[0]?.name},null,8,[`name`])])):(n(),p(u,{key:1},[x(` Package `)],64))],10,G),a.groupView?w(``,!0):(n(),p(`div`,q,` Version `)),f(`div`,{title:`Transformed code size`,role:`columnheader`,"rounded-tr-2":``,"flex-none":``,"ws-nowrap":``,"py1.5":``,"font-600":``,"min-w40":``,class:y([a.groupView?`px2`:`pl2`])},[f(`button`,J,[c[0]||=x(` Size `,-1),a.disableSizeSort?w(``,!0):(n(),p(`span`,{key:0,"w-6":``,"h-6":``,"rounded-full":``,"cursor-pointer":``,hover:`bg-active`,flex:`~ items-center justify-center`,onClick:d},[f(`i`,{"text-xs":``,class:y([C(s)===`asc`?`i-ph-arrow-up-duotone`:`i-ph-arrow-down-duotone`,C(s)?`op100 text-primary`:`op50`])},null,2)]))])],2),c[1]||=f(`div`,{title:`Importers`,role:`columnheader`,"rounded-tr-2":``,"flex-none":``,"ws-nowrap":``,"py1.5":``,pl20:``,pr2:``,"font-600":``,"min-w50":``},` Importers `,-1)]),a.packages.length?(n(),_(E,{key:0,role:`rowgroup`,items:a.packages,"key-prop":`dir`},{default:i(({item:r,index:s})=>[v(S,{role:`row`,flex:`~ row`,class:y([`border-base border-b-1 border-dashed`,[s===a.packages.length-1?`border-b-0`:``]]),to:{path:C(o).path,query:{package:`${r.name}@${r.version}`}}},{default:i(()=>[v(C(t),{triggers:[`hover`],delay:1200,disabled:r.name.length<30},{popper:i(()=>[f(`span`,X,l(r.name),1)]),default:i(()=>[a.groupView?w(``,!0):(n(),p(`div`,Y,[v(m,{name:r.name},null,8,[`name`])]))]),_:2},1032,[`disabled`]),f(`div`,{role:`cell`,flex:`~ items-center`,"text-left":``,"flex-none":``,"font-mono":``,"py1.5":``,px2:``,"text-sm":``,"min-w40":``,op80:``,class:y({"text-primary":r.duplicated})},l(r.version),3),f(`div`,Z,[v(C(T),{delay:{show:200,hide:0}},{popper:i(()=>[f(`div`,ae,[(n(!0),p(u,null,e(r.files.filter(e=>!!e.transformedCodeSize),e=>(n(),p(`div`,{key:e.path,flex:`~ row gap-1 items-center nowrap`,"w-max":``},[f(`span`,oe,[v(h,{bytes:e.transformedCodeSize},null,8,[`bytes`])]),v(g,{id:e.path,session:a.session,"ws-nowrap":``,"flex-1":``,"disable-tooltip":``,link:``,cwd:r.dir},null,8,[`id`,`session`,`cwd`])]))),128))])]),default:i(()=>[v(h,{bytes:r.transformedCodeSize},null,8,[`bytes`])]),_:2},1024)]),f(`div`,se,[v(b,{package:r,session:a.session,"show-version":a.groupView},null,8,[`package`,`session`,`show-version`])])]),_:2},1032,[`class`,`to`])]),_:1},8,[`items`])):(n(),p(`div`,ce,[...c[2]||=[f(`div`,{p4:``},[f(`div`,{"w-full":``,"h-48":``,flex:`~ items-center justify-center`,op50:``,italic:``},[f(`p`,null,` No data `)])],-1)]]))])}}}),Q=Object.assign(le,{__name:`PackagesTable`}),ue={key:1,p4:``},de=h({__name:`Duplicated`,props:{packages:{},session:{}},setup(t){let r=t,i=S(()=>r.packages.filter(e=>e.duplicated)),a=S(()=>i.value.reduce((e,t)=>(e[t.name]=[...e[t.name]||[],t],e),{}));return(r,o)=>{let s=Q;return i.value.length?(n(!0),p(u,{key:0},e(a.value,(e,r)=>(n(),p(`div`,{key:r},[v(s,{packages:e,session:t.session,"group-view":``,"disable-size-sort":``},null,8,[`packages`,`session`])]))),128)):(n(),p(`div`,ue,[...o[0]||=[f(`div`,{"w-full":``,"h-48":``,flex:`~ items-center justify-center`,op50:``,italic:``},` No duplicate packages `,-1)]]))}}}),fe=Object.assign(de,{__name:`PackagesDuplicated`}),pe={key:1,relative:``,"max-h-screen":``,"of-hidden":``},me={absolute:``,"left-4":``,"top-4":``,"z-panel-nav":``},he={flex:`~ gap-2 items-center`,p2:``,border:`t base`},ge=[`onClick`],_e={"of-auto":``,"h-screen":``,flex:`~ col gap-2`,pt44:``,px4:``,pb4:``},$={absolute:``,"bottom-4":``,"py-1":``,"px-2":``,"bg-glass":``,left:`1/2`,"translate-x":`-1/2`,border:`~ base rounded-full`,text:`center xs`},ve={op50:``},ye={key:1,"w-full":``,"h-48":``,flex:`~ items-center justify-center`,op50:``,italic:``},be={key:0,"bg-glass":``,border:`~ base rounded`,p2:``,"text-sm":``,flex:`~ col gap-2`},xe={flex:`~ gap-1 items-center`},Se={flex:`~ gap-1 items-center`},Ce=h({__name:`packages`,props:{session:{}},setup(t){let s=t,h=a(b()),g=r(),T=o(),D=[{match:/.*/,name:`direct`,description:`Direct Dependencies`,icon:`i-octicon:package-dependencies-24 light:filter-invert-30!`},{match:/.*/,name:`transitive`,description:`Transitive Dependencies`,icon:`i-octicon:package-24 light:filter-invert-30!`}],O=ee(),k=c({search:``,selected:[`direct`,`transitive`]}),{state:P,isLoading:L}=d(async()=>await O.value.call(`vite:rolldown:get-packages`,{session:s.session.id}),null),R=m(()=>P.value,()=>new N(P.value,{includeScore:!0,keys:[`name`],ignoreLocation:!0,threshold:.4})),z=S(()=>P.value?Object.values(P.value.reduce((e,t)=>(e[t.name]=(e[t.name]||0)+1,e),{})).filter(e=>e>1).length:0),B=S(()=>[{label:`Table`,value:`table`,icon:`i-ph-table-duotone`},{label:`Treemap`,value:`treemap`,icon:`i-ph-checkerboard-duotone`},{label:`Duplicate Packages${z.value>0?` (${z.value})`:``}`,value:`duplicate-packages`,icon:`i-ph-package-duotone`}]),V=S(()=>k.value.search?R.value.search(k.value.search).map(e=>e.item):[...P.value||[]]),H=S(()=>{let e=j.value.packageSizeSortType,t=[...V.value].sort((e,t)=>(e.name||``).localeCompare(t.name||``));return(e?t.sort((t,n)=>e===`asc`?t.transformedCodeSize-n.transformedCodeSize:n.transformedCodeSize-t.transformedCodeSize):t).filter(e=>!k.value.selected||k.value.selected.some(t=>t.match(e.type)))});function U(e){j.value.packageViewType=e}let{tree:W,chartOptions:G,graph:K,nodeHover:q,nodeSelected:J,selectedNode:Y,selectNode:X,buildGraph:Z}=re({data:H,nameKey:`name`,sizeKey:`transformedCodeSize`,rootText:`Packages`,nodeType:`package`,graphOptions:{onHover(e){e&&!g.query.package&&(q.value=e),e===null&&(q.value=void 0)},onClick(e){e.meta?.type===`package`&&T.replace({query:{...g.query,package:`${e.meta?.name}@${e.meta?.version}`}})},onLeave(){q.value=void 0},onSelect(e){J.value=e||W.value.root,Y.value=e?.meta}},onUpdate(){j.value.packageViewType===`treemap`&&(K.value=new F(W.value.root,{...G.value,selectedPaddingRatio:0}))}});return te(()=>j.value.packageViewType,()=>{Z()}),(r,a)=>{let o=E,s=M,c=Q,d=ne,m=fe,g=A,b=I;return C(L)?(n(),_(o,{key:0})):(n(),p(`div`,pe,[f(`div`,me,[v(s,{modelValue:k.value,"onUpdate:modelValue":a[0]||=e=>k.value=e,rules:D},{default:i(()=>[f(`div`,he,[a[2]||=f(`span`,{op50:``,pl2:``,"text-sm":``},`View as`,-1),(n(!0),p(u,null,e(B.value,e=>(n(),p(`button`,{key:e.value,"btn-action":``,class:y(C(j).packageViewType===e.value?`bg-active`:`grayscale op50`),onClick:t=>U(e.value)},[f(`div`,{class:y(e.icon)},null,2),x(` `+l(e.label),1)],10,ge))),128))])]),_:1},8,[`modelValue`])]),f(`div`,_e,[C(j).packageViewType===`table`?(n(),p(u,{key:0},[v(c,{packages:H.value,session:t.session},null,8,[`packages`,`session`]),f(`div`,$,[f(`span`,ve,l(V.value.length)+` of `+l(C(P)?.length||0),1)])],64)):C(j).packageViewType===`treemap`?(n(),p(u,{key:1},[C(K)&&H.value.length?(n(),_(ie,{key:0,graph:C(K),selected:C(J),onSelect:a[1]||=e=>C(X)(e)},{default:i(({selected:e,options:t,onSelect:n})=>[v(d,{border:`b base`,py2:``,"min-h-10":``,selected:e,options:t,onSelect:n},null,8,[`selected`,`options`,`onSelect`])]),_:1},8,[`graph`,`selected`])):(n(),p(`span`,ye,` No Data `))],64)):C(j).packageViewType===`duplicate-packages`?(n(),_(m,{key:2,packages:H.value,session:t.session},null,8,[`packages`,`session`])):w(``,!0)]),v(b,{"hover-x":h.x,"hover-y":h.y},{default:i(()=>[C(q)?.meta?(n(),p(`div`,be,[f(`div`,xe,l(C(q).text),1),f(`div`,Se,[v(g,{bytes:C(q).size,percent:!1},null,8,[`bytes`])])])):w(``,!0)]),_:1},8,[`hover-x`,`hover-y`])]))}}});export{Ce as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{C as e,Et as t,H as n,an as r,ct as i,dt as a}from"#entry";var o={class:`antialiased bg-white dark:bg-[#020420] dark:text-white font-sans grid min-h-screen overflow-hidden place-content-center text-[#020420] tracking-wide`},s={class:`max-w-520px text-center`},c=[`textContent`],l=[`textContent`],u=[`textContent`],d=e({__name:`error-500`,props:{appName:{type:String,default:`Nuxt`},statusCode:{type:Number,default:500},statusMessage:{type:String,default:`Internal server error`},description:{type:String,default:`This page is temporarily unavailable.`},refresh:{type:String,default:`Refresh this page`}},setup(e){let d=e;return n({title:`${d.statusCode} - ${d.statusMessage} | ${d.appName}`,script:[{innerHTML:`!function(){const e=document.createElement("link").relList;if(!(e&&e.supports&&e.supports("modulepreload"))){for(const e of document.querySelectorAll('link[rel="modulepreload"]'))r(e);new MutationObserver(e=>{for(const o of e)if("childList"===o.type)for(const e of o.addedNodes)"LINK"===e.tagName&&"modulepreload"===e.rel&&r(e)}).observe(document,{childList:!0,subtree:!0})}function r(e){if(e.ep)return;e.ep=!0;const r=function(e){const r={};return e.integrity&&(r.integrity=e.integrity),e.referrerPolicy&&(r.referrerPolicy=e.referrerPolicy),"use-credentials"===e.crossOrigin?r.credentials="include":"anonymous"===e.crossOrigin?r.credentials="omit":r.credentials="same-origin",r}(e);fetch(e.href,r)}}();`}],style:[{innerHTML:`*,:after,:before{border-color:var(--un-default-border-color,#e5e7eb);border-style:solid;border-width:0;box-sizing:border-box}:after,:before{--un-content:""}html{line-height:1.5;-webkit-text-size-adjust:100%;font-family:ui-sans-serif,system-ui,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-feature-settings:normal;font-variation-settings:normal;-moz-tab-size:4;tab-size:4;-webkit-tap-highlight-color:transparent}body{line-height:inherit;margin:0}h1,h2{font-size:inherit;font-weight:inherit}h1,h2,p{margin:0}*,:after,:before{--un-rotate:0;--un-rotate-x:0;--un-rotate-y:0;--un-rotate-z:0;--un-scale-x:1;--un-scale-y:1;--un-scale-z:1;--un-skew-x:0;--un-skew-y:0;--un-translate-x:0;--un-translate-y:0;--un-translate-z:0;--un-pan-x: ;--un-pan-y: ;--un-pinch-zoom: ;--un-scroll-snap-strictness:proximity;--un-ordinal: ;--un-slashed-zero: ;--un-numeric-figure: ;--un-numeric-spacing: ;--un-numeric-fraction: ;--un-border-spacing-x:0;--un-border-spacing-y:0;--un-ring-offset-shadow:0 0 transparent;--un-ring-shadow:0 0 transparent;--un-shadow-inset: ;--un-shadow:0 0 transparent;--un-ring-inset: ;--un-ring-offset-width:0px;--un-ring-offset-color:#fff;--un-ring-width:0px;--un-ring-color:rgba(147,197,253,.5);--un-blur: ;--un-brightness: ;--un-contrast: ;--un-drop-shadow: ;--un-grayscale: ;--un-hue-rotate: ;--un-invert: ;--un-saturate: ;--un-sepia: ;--un-backdrop-blur: ;--un-backdrop-brightness: ;--un-backdrop-contrast: ;--un-backdrop-grayscale: ;--un-backdrop-hue-rotate: ;--un-backdrop-invert: ;--un-backdrop-opacity: ;--un-backdrop-saturate: ;--un-backdrop-sepia: }`}]}),(n,d)=>(t(),a(`div`,o,[i(`div`,s,[i(`h1`,{class:`font-semibold leading-none mb-4 sm:text-[110px] tabular-nums text-[80px]`,textContent:r(e.statusCode)},null,8,c),i(`h2`,{class:`font-semibold mb-2 sm:text-3xl text-2xl`,textContent:r(e.statusMessage)},null,8,l),i(`p`,{class:`mb-4 px-2 text-[#64748B] text-md`,textContent:r(e.description)},null,8,u)])]))}},[[`__scopeId`,`data-v-
|
|
1
|
+
import{C as e,Et as t,H as n,an as r,ct as i,dt as a}from"#entry";var o={class:`antialiased bg-white dark:bg-[#020420] dark:text-white font-sans grid min-h-screen overflow-hidden place-content-center text-[#020420] tracking-wide`},s={class:`max-w-520px text-center`},c=[`textContent`],l=[`textContent`],u=[`textContent`],d=e({__name:`error-500`,props:{appName:{type:String,default:`Nuxt`},statusCode:{type:Number,default:500},statusMessage:{type:String,default:`Internal server error`},description:{type:String,default:`This page is temporarily unavailable.`},refresh:{type:String,default:`Refresh this page`}},setup(e){let d=e;return n({title:`${d.statusCode} - ${d.statusMessage} | ${d.appName}`,script:[{innerHTML:`!function(){const e=document.createElement("link").relList;if(!(e&&e.supports&&e.supports("modulepreload"))){for(const e of document.querySelectorAll('link[rel="modulepreload"]'))r(e);new MutationObserver(e=>{for(const o of e)if("childList"===o.type)for(const e of o.addedNodes)"LINK"===e.tagName&&"modulepreload"===e.rel&&r(e)}).observe(document,{childList:!0,subtree:!0})}function r(e){if(e.ep)return;e.ep=!0;const r=function(e){const r={};return e.integrity&&(r.integrity=e.integrity),e.referrerPolicy&&(r.referrerPolicy=e.referrerPolicy),"use-credentials"===e.crossOrigin?r.credentials="include":"anonymous"===e.crossOrigin?r.credentials="omit":r.credentials="same-origin",r}(e);fetch(e.href,r)}}();`}],style:[{innerHTML:`*,:after,:before{border-color:var(--un-default-border-color,#e5e7eb);border-style:solid;border-width:0;box-sizing:border-box}:after,:before{--un-content:""}html{line-height:1.5;-webkit-text-size-adjust:100%;font-family:ui-sans-serif,system-ui,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-feature-settings:normal;font-variation-settings:normal;-moz-tab-size:4;tab-size:4;-webkit-tap-highlight-color:transparent}body{line-height:inherit;margin:0}h1,h2{font-size:inherit;font-weight:inherit}h1,h2,p{margin:0}*,:after,:before{--un-rotate:0;--un-rotate-x:0;--un-rotate-y:0;--un-rotate-z:0;--un-scale-x:1;--un-scale-y:1;--un-scale-z:1;--un-skew-x:0;--un-skew-y:0;--un-translate-x:0;--un-translate-y:0;--un-translate-z:0;--un-pan-x: ;--un-pan-y: ;--un-pinch-zoom: ;--un-scroll-snap-strictness:proximity;--un-ordinal: ;--un-slashed-zero: ;--un-numeric-figure: ;--un-numeric-spacing: ;--un-numeric-fraction: ;--un-border-spacing-x:0;--un-border-spacing-y:0;--un-ring-offset-shadow:0 0 transparent;--un-ring-shadow:0 0 transparent;--un-shadow-inset: ;--un-shadow:0 0 transparent;--un-ring-inset: ;--un-ring-offset-width:0px;--un-ring-offset-color:#fff;--un-ring-width:0px;--un-ring-color:rgba(147,197,253,.5);--un-blur: ;--un-brightness: ;--un-contrast: ;--un-drop-shadow: ;--un-grayscale: ;--un-hue-rotate: ;--un-invert: ;--un-saturate: ;--un-sepia: ;--un-backdrop-blur: ;--un-backdrop-brightness: ;--un-backdrop-contrast: ;--un-backdrop-grayscale: ;--un-backdrop-hue-rotate: ;--un-backdrop-invert: ;--un-backdrop-opacity: ;--un-backdrop-saturate: ;--un-backdrop-sepia: }`}]}),(n,d)=>(t(),a(`div`,o,[i(`div`,s,[i(`h1`,{class:`font-semibold leading-none mb-4 sm:text-[110px] tabular-nums text-[80px]`,textContent:r(e.statusCode)},null,8,c),i(`h2`,{class:`font-semibold mb-2 sm:text-3xl text-2xl`,textContent:r(e.statusMessage)},null,8,l),i(`p`,{class:`mb-4 px-2 text-[#64748B] text-md`,textContent:r(e.description)},null,8,u)])]))}},[[`__scopeId`,`data-v-79c6343a`]]);export{d as default};
|
|
@@ -7,7 +7,7 @@ b`.split(/\n/).length==3?function(e){return e.split(/\r\n?|\n/)}:function(e){for
|
|
|
7
7
|
height: `+(r-t)+`px`))}function d(t,n,r){var a=Y(i,t),o=a.text.length,d,f;function p(n,r){return xr(e,Z(t,n),`div`,a,r)}function m(t,n,r){var i=Dr(e,a,null,t),o=n==`ltr`==(r==`after`)?`left`:`right`;return p(r==`after`?i.begin:i.end-(/\s/.test(a.text.charAt(i.end-1))?2:1),o)[o]}var h=K(a,i.direction);return xe(h,n||0,r??o,function(e,t,i,a){var g=i==`ltr`,_=p(e,g?`left`:`right`),v=p(t-1,g?`right`:`left`),y=n==null&&e==0,b=r==null&&t==o,x=a==0,S=!h||a==h.length-1;if(v.top-_.top<=3){var C=(l?y:b)&&x,w=(l?b:y)&&S,T=C?s:(g?_:v).left,E=w?c:(g?v:_).right;u(T,_.top,E-T,_.bottom)}else{var D,O,k,A;g?(D=l&&y&&x?s:_.left,O=l?c:m(e,i,`before`),k=l?s:m(t,i,`after`),A=l&&b&&S?c:v.right):(D=l?m(e,i,`before`):s,O=!l&&y&&x?c:_.right,k=!l&&b&&S?s:v.left,A=l?m(t,i,`after`):c),u(D,_.top,O-D,_.bottom),_.bottom<v.top&&u(s,_.bottom,null,v.top),u(k,v.top,A-k,v.bottom)}(!d||Xr(_,d)<0)&&(d=_),Xr(v,d)<0&&(d=v),(!f||Xr(_,f)<0)&&(f=_),Xr(v,f)<0&&(f=v)}),{start:d,end:f}}var f=t.from(),p=t.to();if(f.line==p.line)d(f.line,f.ch,p.ch);else{var m=Y(i,f.line),h=Y(i,p.line),g=nn(m)==nn(h),_=d(f.line,f.ch,g?m.text.length+1:null).end,v=d(p.line,g?0:null,p.ch).start;g&&(_.top<v.top-2?(u(_.right,_.top,null,_.bottom),u(s,v.top,v.left,v.bottom)):u(_.right,_.top,v.left-_.right,_.bottom)),_.bottom<v.top&&u(s,_.bottom,null,v.top)}n.appendChild(a)}function Qr(e){if(e.state.focused){var t=e.display;clearInterval(t.blinker);var n=!0;t.cursorDiv.style.visibility=``,e.options.cursorBlinkRate>0?t.blinker=setInterval(function(){e.hasFocus()||ni(e),t.cursorDiv.style.visibility=(n=!n)?``:`hidden`},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility=`hidden`)}}function $r(e){e.hasFocus()||(e.display.input.focus(),e.state.focused||ti(e))}function ei(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,e.state.focused&&ni(e))},100)}function ti(e,t){e.state.delayingBlurEvent&&!e.state.draggingText&&(e.state.delayingBlurEvent=!1),e.options.readOnly!=`nocursor`&&(e.state.focused||(Oe(e,`focus`,e,t),e.state.focused=!0,ee(e.display.wrapper,`CodeMirror-focused`),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(e.display.input.reset(),c&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),Qr(e))}function ni(e,t){e.state.delayingBlurEvent||(e.state.focused&&(Oe(e,`blur`,e,t),e.state.focused=!1,E(e.display.wrapper,`CodeMirror-focused`)),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150))}function ri(e){for(var t=e.display,n=t.lineDiv.offsetTop,r=Math.max(0,t.scroller.getBoundingClientRect().top),i=t.lineDiv.getBoundingClientRect().top,a=0,c=0;c<t.view.length;c++){var l=t.view[c],u=e.options.lineWrapping,d=void 0,f=0;if(!l.hidden){if(i+=l.line.height,o&&s<8){var p=l.node.offsetTop+l.node.offsetHeight;d=p-n,n=p}else{var m=l.node.getBoundingClientRect();d=m.bottom-m.top,!u&&l.text.firstChild&&(f=l.text.firstChild.getBoundingClientRect().right-m.left-1)}var h=l.line.height-d;if((h>.005||h<-.005)&&(i<r&&(a-=h),ct(l.line,d),ii(l.line),l.rest))for(var g=0;g<l.rest.length;g++)ii(l.rest[g]);if(f>e.display.sizerWidth){var _=Math.ceil(f/Pr(e.display));_>e.display.maxLineLength&&(e.display.maxLineLength=_,e.display.maxLine=l.line,e.display.maxLineChanged=!0)}}}Math.abs(a)>2&&(t.scroller.scrollTop+=a)}function ii(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t){var n=e.widgets[t],r=n.node.parentNode;r&&(n.height=r.offsetHeight)}}function ai(e,t,n){var r=n&&n.top!=null?Math.max(0,n.top):e.scroller.scrollTop;r=Math.floor(r-Yn(e));var i=n&&n.bottom!=null?n.bottom:r+e.wrapper.clientHeight,a=lt(t,r),o=lt(t,i);if(n&&n.ensure){var s=n.ensure.from.line,c=n.ensure.to.line;s<a?(a=s,o=lt(t,un(Y(t,s))+e.wrapper.clientHeight)):Math.min(c,t.lastLine())>=o&&(a=lt(t,un(Y(t,c))-e.wrapper.clientHeight),o=c)}return{from:a,to:Math.max(o,a+1)}}function oi(e,t){if(!ke(e,`scrollCursorIntoView`)){var n=e.display,r=n.sizer.getBoundingClientRect(),i=null,a=n.wrapper.ownerDocument;if(t.top+r.top<0?i=!0:t.bottom+r.top>(a.defaultView.innerHeight||a.documentElement.clientHeight)&&(i=!1),i!=null&&!h){var o=k(`div`,``,null,`position: absolute;
|
|
8
8
|
top: `+(t.top-n.viewOffset-Yn(e.display))+`px;
|
|
9
9
|
height: `+(t.bottom-t.top+Qn(e)+n.barHeight)+`px;
|
|
10
|
-
left: `+t.left+`px; width: `+Math.max(2,t.right-t.left)+`px;`);e.display.lineSpace.appendChild(o),o.scrollIntoView(i),e.display.lineSpace.removeChild(o)}}}function si(e,t,n,r){r??=0;var i;!e.options.lineWrapping&&t==n&&(n=t.sticky==`before`?Z(t.line,t.ch+1,`before`):t,t=t.ch?Z(t.line,t.sticky==`before`?t.ch-1:t.ch,`after`):t);for(var a=0;a<5;a++){var o=!1,s=Sr(e,t),c=!n||n==t?s:Sr(e,n);i={left:Math.min(s.left,c.left),top:Math.min(s.top,c.top)-r,right:Math.max(s.left,c.left),bottom:Math.max(s.bottom,c.bottom)+r};var l=li(e,i),u=e.doc.scrollTop,d=e.doc.scrollLeft;if(l.scrollTop!=null&&(gi(e,l.scrollTop),Math.abs(e.doc.scrollTop-u)>1&&(o=!0)),l.scrollLeft!=null&&(vi(e,l.scrollLeft),Math.abs(e.doc.scrollLeft-d)>1&&(o=!0)),!o)break}return i}function ci(e,t){var n=li(e,t);n.scrollTop!=null&&gi(e,n.scrollTop),n.scrollLeft!=null&&vi(e,n.scrollLeft)}function li(e,t){var n=e.display,r=Nr(e.display);t.top<0&&(t.top=0);var i=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:n.scroller.scrollTop,a=er(e),o={};t.bottom-t.top>a&&(t.bottom=t.top+a);var s=e.doc.height+Xn(n),c=t.top<r,l=t.bottom>s-r;if(t.top<i)o.scrollTop=c?0:t.top;else if(t.bottom>i+a){var u=Math.min(t.top,(l?s:t.bottom)-a);u!=i&&(o.scrollTop=u)}var d=e.options.fixedGutter?0:n.gutters.offsetWidth,f=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:n.scroller.scrollLeft-d,p=$n(e)-n.gutters.offsetWidth,m=t.right-t.left>p;return m&&(t.right=t.left+p),t.left<10?o.scrollLeft=0:t.left<f?o.scrollLeft=Math.max(0,t.left+d-(m?0:10)):t.right>p+f-3&&(o.scrollLeft=t.right+(m?0:10)-p),o}function ui(e,t){t!=null&&(mi(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+t)}function di(e){mi(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function fi(e,t,n){(t!=null||n!=null)&&mi(e),t!=null&&(e.curOp.scrollLeft=t),n!=null&&(e.curOp.scrollTop=n)}function pi(e,t){mi(e),e.curOp.scrollToPos=t}function mi(e){var t=e.curOp.scrollToPos;t&&(e.curOp.scrollToPos=null,hi(e,Cr(e,t.from),Cr(e,t.to),t.margin))}function hi(e,t,n,r){var i=li(e,{left:Math.min(t.left,n.left),top:Math.min(t.top,n.top)-r,right:Math.max(t.right,n.right),bottom:Math.max(t.bottom,n.bottom)+r});fi(e,i.scrollLeft,i.scrollTop)}function gi(e,t){Math.abs(e.doc.scrollTop-t)<2||(n||qi(e,{top:t}),_i(e,t,!0),n&&qi(e),zi(e,100))}function _i(e,t,n){t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),!(e.display.scroller.scrollTop==t&&!n)&&(e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t))}function vi(e,t,n,r){t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),!((n?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!r)&&(e.doc.scrollLeft=t,Zi(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function yi(e){var t=e.display,n=t.gutters.offsetWidth,r=Math.round(e.doc.height+Xn(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?n:0,docHeight:r,scrollHeight:r+Qn(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:n}}var bi=function(e,t,n){this.cm=n;var r=this.vert=k(`div`,[k(`div`,null,null,`min-width: 1px`)],`CodeMirror-vscrollbar`),i=this.horiz=k(`div`,[k(`div`,null,null,`height: 100%; min-height: 1px`)],`CodeMirror-hscrollbar`);r.tabIndex=i.tabIndex=-1,e(r),e(i),q(r,`scroll`,function(){r.clientHeight&&t(r.scrollTop,`vertical`)}),q(i,`scroll`,function(){i.clientWidth&&t(i.scrollLeft,`horizontal`)}),this.checkedZeroWidth=!1,o&&s<8&&(this.horiz.style.minHeight=this.vert.style.minWidth=`18px`)};bi.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,n=e.scrollHeight>e.clientHeight+1,r=e.nativeBarWidth;if(n){this.vert.style.display=`block`,this.vert.style.bottom=t?r+`px`:`0`;var i=e.viewHeight-(t?r:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+i)+`px`}else this.vert.scrollTop=0,this.vert.style.display=``,this.vert.firstChild.style.height=`0`;if(t){this.horiz.style.display=`block`,this.horiz.style.right=n?r+`px`:`0`,this.horiz.style.left=e.barLeft+`px`;var a=e.viewWidth-e.barLeft-(n?r:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+a)+`px`}else this.horiz.style.display=``,this.horiz.firstChild.style.width=`0`;return!this.checkedZeroWidth&&e.clientHeight>0&&(r==0&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:n?r:0,bottom:t?r:0}},bi.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,`horiz`)},bi.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,`vert`)},bi.prototype.zeroWidthHack=function(){var e=y&&!m?`12px`:`18px`;this.horiz.style.height=this.vert.style.width=e,this.horiz.style.visibility=this.vert.style.visibility=`hidden`,this.disableHoriz=new re,this.disableVert=new re},bi.prototype.enableZeroWidthBar=function(e,t,n){e.style.visibility=``;function r(){var i=e.getBoundingClientRect();(n==`vert`?document.elementFromPoint(i.right-1,(i.top+i.bottom)/2):document.elementFromPoint((i.right+i.left)/2,i.bottom-1))==e?t.set(1e3,r):e.style.visibility=`hidden`}t.set(1e3,r)},bi.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var xi=function(){};xi.prototype.update=function(){return{bottom:0,right:0}},xi.prototype.setScrollLeft=function(){},xi.prototype.setScrollTop=function(){},xi.prototype.clear=function(){};function Si(e,t){t||=yi(e);var n=e.display.barWidth,r=e.display.barHeight;Ci(e,t);for(var i=0;i<4&&n!=e.display.barWidth||r!=e.display.barHeight;i++)n!=e.display.barWidth&&e.options.lineWrapping&&ri(e),Ci(e,yi(e)),n=e.display.barWidth,r=e.display.barHeight}function Ci(e,t){var n=e.display,r=n.scrollbars.update(t);n.sizer.style.paddingRight=(n.barWidth=r.right)+`px`,n.sizer.style.paddingBottom=(n.barHeight=r.bottom)+`px`,n.heightForcer.style.borderBottom=r.bottom+`px solid transparent`,r.right&&r.bottom?(n.scrollbarFiller.style.display=`block`,n.scrollbarFiller.style.height=r.bottom+`px`,n.scrollbarFiller.style.width=r.right+`px`):n.scrollbarFiller.style.display=``,r.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(n.gutterFiller.style.display=`block`,n.gutterFiller.style.height=r.bottom+`px`,n.gutterFiller.style.width=t.gutterWidth+`px`):n.gutterFiller.style.display=``}var wi={native:bi,null:xi};function Ti(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&E(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new wi[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),q(t,`mousedown`,function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),t.setAttribute(`cm-not-content`,`true`)},function(t,n){n==`horizontal`?vi(e,t):gi(e,t)},e),e.display.scrollbars.addClass&&ee(e.display.wrapper,e.display.scrollbars.addClass)}var Ei=0;function Di(e){e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++Ei,markArrays:null},kn(e.curOp)}function Oi(e){var t=e.curOp;t&&jn(t,function(e){for(var t=0;t<e.ops.length;t++)e.ops[t].cm.curOp=null;ki(e)})}function ki(e){for(var t=e.ops,n=0;n<t.length;n++)Ai(t[n]);for(var r=0;r<t.length;r++)ji(t[r]);for(var i=0;i<t.length;i++)Mi(t[i]);for(var a=0;a<t.length;a++)Ni(t[a]);for(var o=0;o<t.length;o++)Pi(t[o])}function Ai(e){var t=e.cm,n=t.display;Hi(t),e.updateMaxLine&&fn(t),e.mustUpdate=e.viewChanged||e.forceUpdate||e.scrollTop!=null||e.scrollToPos&&(e.scrollToPos.from.line<n.viewFrom||e.scrollToPos.to.line>=n.viewTo)||n.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new Vi(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function ji(e){e.updatedDisplay=e.mustUpdate&&Gi(e.cm,e.update)}function Mi(e){var t=e.cm,n=t.display;e.updatedDisplay&&ri(t),e.barMeasure=yi(t),n.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=ir(t,n.maxLine,n.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(n.scroller.clientWidth,n.sizer.offsetLeft+e.adjustWidthTo+Qn(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,n.sizer.offsetLeft+e.adjustWidthTo-$n(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=n.input.prepareSelection())}function Ni(e){var t=e.cm;e.adjustWidthTo!=null&&(t.display.sizer.style.minWidth=e.adjustWidthTo+`px`,e.maxScrollLeft<t.doc.scrollLeft&&vi(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var n=e.focus&&e.focus==N(ne(t));e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,n),(e.updatedDisplay||e.startHeight!=t.doc.height)&&Si(t,e.barMeasure),e.updatedDisplay&&Xi(t,e.barMeasure),e.selectionChanged&&Qr(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),n&&$r(e.cm)}function Pi(e){var t=e.cm,n=t.display,r=t.doc;e.updatedDisplay&&Ki(t,e.update),n.wheelStartX!=null&&(e.scrollTop!=null||e.scrollLeft!=null||e.scrollToPos)&&(n.wheelStartX=n.wheelStartY=null),e.scrollTop!=null&&_i(t,e.scrollTop,e.forceScroll),e.scrollLeft!=null&&vi(t,e.scrollLeft,!0,!0),e.scrollToPos&&oi(t,si(t,$(r,e.scrollToPos.from),$(r,e.scrollToPos.to),e.scrollToPos.margin));var i=e.maybeHiddenMarkers,a=e.maybeUnhiddenMarkers;if(i)for(var o=0;o<i.length;++o)i[o].lines.length||Oe(i[o],`hide`);if(a)for(var s=0;s<a.length;++s)a[s].lines.length&&Oe(a[s],`unhide`);n.wrapper.offsetHeight&&(r.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&Oe(t,`changes`,t,e.changeObjs),e.update&&e.update.finish()}function Fi(e,t){if(e.curOp)return t();Di(e);try{return t()}finally{Oi(e)}}function Ii(e,t){return function(){if(e.curOp)return t.apply(e,arguments);Di(e);try{return t.apply(e,arguments)}finally{Oi(e)}}}function Li(e){return function(){if(this.curOp)return e.apply(this,arguments);Di(this);try{return e.apply(this,arguments)}finally{Oi(this)}}}function Ri(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);Di(t);try{return e.apply(this,arguments)}finally{Oi(t)}}}function zi(e,t){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(t,R(Bi,e))}function Bi(e){var t=e.doc;if(!(t.highlightFrontier>=e.display.viewTo)){var n=+new Date+e.options.workTime,r=Ct(e,t.highlightFrontier),i=[];t.iter(r.line,Math.min(t.first+t.size,e.display.viewTo+500),function(a){if(r.line>=e.display.viewFrom){var o=a.styles,s=a.text.length>e.options.maxHighlightLength?nt(t.mode,r.state):null,c=xt(e,a,r,!0);s&&(r.state=s),a.styles=c.styles;var l=a.styleClasses,u=c.classes;u?a.styleClasses=u:l&&(a.styleClasses=null);for(var d=!o||o.length!=a.styles.length||l!=u&&(!l||!u||l.bgClass!=u.bgClass||l.textClass!=u.textClass),f=0;!d&&f<o.length;++f)d=o[f]!=a.styles[f];d&&i.push(r.line),a.stateAfter=r.save(),r.nextLine()}else a.text.length<=e.options.maxHighlightLength&&wt(e,a.text,r),a.stateAfter=r.line%5==0?r.save():null,r.nextLine();if(+new Date>n)return zi(e,e.options.workDelay),!0}),t.highlightFrontier=r.line,t.modeFrontier=Math.max(t.modeFrontier,r.line),i.length&&Fi(e,function(){for(var t=0;t<i.length;t++)Hr(e,i[t],`text`)})}}var Vi=function(e,t,n){var r=e.display;this.viewport=t,this.visible=ai(r,e.doc,t),this.editorIsHidden=!r.wrapper.offsetWidth,this.wrapperHeight=r.wrapper.clientHeight,this.wrapperWidth=r.wrapper.clientWidth,this.oldDisplayWidth=$n(e),this.force=n,this.dims=Fr(e),this.events=[]};Vi.prototype.signal=function(e,t){J(e,t)&&this.events.push(arguments)},Vi.prototype.finish=function(){for(var e=0;e<this.events.length;e++)Oe.apply(null,this.events[e])};function Hi(e){var t=e.display;!t.scrollbarsClipped&&t.scroller.offsetWidth&&(t.nativeBarWidth=t.scroller.offsetWidth-t.scroller.clientWidth,t.heightForcer.style.height=Qn(e)+`px`,t.sizer.style.marginBottom=-t.nativeBarWidth+`px`,t.sizer.style.borderRightWidth=Qn(e)+`px`,t.scrollbarsClipped=!0)}function Ui(e){if(e.hasFocus())return null;var t=N(ne(e));if(!t||!M(e.display.lineDiv,t))return null;var n={activeElt:t};if(window.getSelection){var r=L(e).getSelection();r.anchorNode&&r.extend&&M(e.display.lineDiv,r.anchorNode)&&(n.anchorNode=r.anchorNode,n.anchorOffset=r.anchorOffset,n.focusNode=r.focusNode,n.focusOffset=r.focusOffset)}return n}function Wi(e){if(!(!e||!e.activeElt||e.activeElt==N(I(e.activeElt)))&&(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&M(document.body,e.anchorNode)&&M(document.body,e.focusNode))){var t=e.activeElt.ownerDocument,n=t.defaultView.getSelection(),r=t.createRange();r.setEnd(e.anchorNode,e.anchorOffset),r.collapse(!1),n.removeAllRanges(),n.addRange(r),n.extend(e.focusNode,e.focusOffset)}}function Gi(e,t){var n=e.display,r=e.doc;if(t.editorIsHidden)return Ur(e),!1;if(!t.force&&t.visible.from>=n.viewFrom&&t.visible.to<=n.viewTo&&(n.updateLineNumbers==null||n.updateLineNumbers>=n.viewTo)&&n.renderedView==n.view&&Kr(e)==0)return!1;Qi(e)&&(Ur(e),t.dims=Fr(e));var i=r.first+r.size,a=Math.max(t.visible.from-e.options.viewportMargin,r.first),o=Math.min(i,t.visible.to+e.options.viewportMargin);n.viewFrom<a&&a-n.viewFrom<20&&(a=Math.max(r.first,n.viewFrom)),n.viewTo>o&&n.viewTo-o<20&&(o=Math.min(i,n.viewTo)),Pt&&(a=on(e.doc,a),o=sn(e.doc,o));var s=a!=n.viewFrom||o!=n.viewTo||n.lastWrapHeight!=t.wrapperHeight||n.lastWrapWidth!=t.wrapperWidth;Gr(e,a,o),n.viewOffset=un(Y(e.doc,n.viewFrom)),e.display.mover.style.top=n.viewOffset+`px`;var c=Kr(e);if(!s&&c==0&&!t.force&&n.renderedView==n.view&&(n.updateLineNumbers==null||n.updateLineNumbers>=n.viewTo))return!1;var l=Ui(e);return c>4&&(n.lineDiv.style.display=`none`),Ji(e,n.updateLineNumbers,t.dims),c>4&&(n.lineDiv.style.display=``),n.renderedView=n.view,Wi(l),D(n.cursorDiv),D(n.selectionDiv),n.gutters.style.height=n.sizer.style.minHeight=0,s&&(n.lastWrapHeight=t.wrapperHeight,n.lastWrapWidth=t.wrapperWidth,zi(e,400)),n.updateLineNumbers=null,!0}function Ki(e,t){for(var n=t.viewport,r=!0;;r=!1){if(!r||!e.options.lineWrapping||t.oldDisplayWidth==$n(e)){if(n&&n.top!=null&&(n={top:Math.min(e.doc.height+Xn(e.display)-er(e),n.top)}),t.visible=ai(e.display,e.doc,n),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break}else r&&(t.visible=ai(e.display,e.doc,n));if(!Gi(e,t))break;ri(e);var i=yi(e);qr(e),Si(e,i),Xi(e,i),t.force=!1}t.signal(e,`update`,e),(e.display.viewFrom!=e.display.reportedViewFrom||e.display.viewTo!=e.display.reportedViewTo)&&(t.signal(e,`viewportChange`,e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function qi(e,t){var n=new Vi(e,t);if(Gi(e,n)){ri(e),Ki(e,n);var r=yi(e);qr(e),Si(e,r),Xi(e,r),n.finish()}}function Ji(e,t,n){var r=e.display,i=e.options.lineNumbers,a=r.lineDiv,o=a.firstChild;function s(t){var n=t.nextSibling;return c&&y&&e.display.currentWheelTarget==t?t.style.display=`none`:t.parentNode.removeChild(t),n}for(var l=r.view,u=r.viewFrom,d=0;d<l.length;d++){var f=l[d];if(!f.hidden)if(!f.node||f.node.parentNode!=a){var p=Un(e,f,u,n);a.insertBefore(p,o)}else{for(;o!=f.node;)o=s(o);var m=i&&t!=null&&t<=u&&f.lineNumber;f.changes&&(V(f.changes,`gutter`)>-1&&(m=!1),Fn(e,f,u,n)),m&&(D(f.lineNumber),f.lineNumber.appendChild(document.createTextNode(dt(e.options,u)))),o=f.node.nextSibling}u+=f.size}for(;o;)o=s(o)}function Yi(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+`px`,Nn(e,`gutterChanged`,e)}function Xi(e,t){e.display.sizer.style.minHeight=t.docHeight+`px`,e.display.heightForcer.style.top=t.docHeight+`px`,e.display.gutters.style.height=t.docHeight+e.display.barHeight+Qn(e)+`px`}function Zi(e){var t=e.display,n=t.view;if(!(!t.alignWidgets&&(!t.gutters.firstChild||!e.options.fixedGutter))){for(var r=Ir(t)-t.scroller.scrollLeft+e.doc.scrollLeft,i=t.gutters.offsetWidth,a=r+`px`,o=0;o<n.length;o++)if(!n[o].hidden){e.options.fixedGutter&&(n[o].gutter&&(n[o].gutter.style.left=a),n[o].gutterBackground&&(n[o].gutterBackground.style.left=a));var s=n[o].alignable;if(s)for(var c=0;c<s.length;c++)s[c].style.left=a}e.options.fixedGutter&&(t.gutters.style.left=r+i+`px`)}}function Qi(e){if(!e.options.lineNumbers)return!1;var t=e.doc,n=dt(e.options,t.first+t.size-1),r=e.display;if(n.length!=r.lineNumChars){var i=r.measure.appendChild(k(`div`,[k(`div`,n)],`CodeMirror-linenumber CodeMirror-gutter-elt`)),a=i.firstChild.offsetWidth,o=i.offsetWidth-a;return r.lineGutter.style.width=``,r.lineNumInnerWidth=Math.max(a,r.lineGutter.offsetWidth-o)+1,r.lineNumWidth=r.lineNumInnerWidth+o,r.lineNumChars=r.lineNumInnerWidth?n.length:-1,r.lineGutter.style.width=r.lineNumWidth+`px`,Yi(e.display),!0}return!1}function $i(e,t){for(var n=[],r=!1,i=0;i<e.length;i++){var a=e[i],o=null;if(typeof a!=`string`&&(o=a.style,a=a.className),a==`CodeMirror-linenumbers`)if(t)r=!0;else continue;n.push({className:a,style:o})}return t&&!r&&n.push({className:`CodeMirror-linenumbers`,style:null}),n}function ea(e){var t=e.gutters,n=e.gutterSpecs;D(t),e.lineGutter=null;for(var r=0;r<n.length;++r){var i=n[r],a=i.className,o=i.style,s=t.appendChild(k(`div`,null,`CodeMirror-gutter `+a));o&&(s.style.cssText=o),a==`CodeMirror-linenumbers`&&(e.lineGutter=s,s.style.width=(e.lineNumWidth||1)+`px`)}t.style.display=n.length?``:`none`,Yi(e)}function ta(e){ea(e.display),Vr(e),Zi(e)}function na(e,t,r,i){var a=this;this.input=r,a.scrollbarFiller=k(`div`,null,`CodeMirror-scrollbar-filler`),a.scrollbarFiller.setAttribute(`cm-not-content`,`true`),a.gutterFiller=k(`div`,null,`CodeMirror-gutter-filler`),a.gutterFiller.setAttribute(`cm-not-content`,`true`),a.lineDiv=A(`div`,null,`CodeMirror-code`),a.selectionDiv=k(`div`,null,null,`position: relative; z-index: 1`),a.cursorDiv=k(`div`,null,`CodeMirror-cursors`),a.measure=k(`div`,null,`CodeMirror-measure`),a.lineMeasure=k(`div`,null,`CodeMirror-measure`),a.lineSpace=A(`div`,[a.measure,a.lineMeasure,a.selectionDiv,a.cursorDiv,a.lineDiv],null,`position: relative; outline: none`),a.mover=k(`div`,[A(`div`,[a.lineSpace],`CodeMirror-lines`)],null,`position: relative`),a.sizer=k(`div`,[a.mover],`CodeMirror-sizer`),a.sizerWidth=null,a.heightForcer=k(`div`,null,null,`position: absolute; height: `+ie+`px; width: 1px;`),a.gutters=k(`div`,null,`CodeMirror-gutters`),a.lineGutter=null,a.scroller=k(`div`,[a.sizer,a.heightForcer,a.gutters],`CodeMirror-scroll`),a.scroller.setAttribute(`tabIndex`,`-1`),a.wrapper=k(`div`,[a.scrollbarFiller,a.gutterFiller,a.scroller],`CodeMirror`),u&&d===105&&(a.wrapper.style.clipPath=`inset(0px)`),a.wrapper.setAttribute(`translate`,`no`),o&&s<8&&(a.gutters.style.zIndex=-1,a.scroller.style.paddingRight=0),!c&&!(n&&v)&&(a.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(a.wrapper):e(a.wrapper)),a.viewFrom=a.viewTo=t.first,a.reportedViewFrom=a.reportedViewTo=t.first,a.view=[],a.renderedView=null,a.externalMeasured=null,a.viewOffset=0,a.lastWrapHeight=a.lastWrapWidth=0,a.updateLineNumbers=null,a.nativeBarWidth=a.barHeight=a.barWidth=0,a.scrollbarsClipped=!1,a.lineNumWidth=a.lineNumInnerWidth=a.lineNumChars=null,a.alignWidgets=!1,a.cachedCharWidth=a.cachedTextHeight=a.cachedPaddingH=null,a.maxLine=null,a.maxLineLength=0,a.maxLineChanged=!1,a.wheelDX=a.wheelDY=a.wheelStartX=a.wheelStartY=null,a.shift=!1,a.selForContextMenu=null,a.activeTouch=null,a.gutterSpecs=$i(i.gutters,i.lineNumbers),ea(a),r.init(a)}var ra=0,ia=null;o?ia=-.53:n?ia=15:u?ia=-.7:p&&(ia=-1/3);function aa(e){var t=e.wheelDeltaX,n=e.wheelDeltaY;return t==null&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),n==null&&e.detail&&e.axis==e.VERTICAL_AXIS?n=e.detail:n??=e.wheelDelta,{x:t,y:n}}function oa(e){var t=aa(e);return t.x*=ia,t.y*=ia,t}function sa(e,t){u&&d==102&&(e.display.chromeScrollHack==null?e.display.sizer.style.pointerEvents=`none`:clearTimeout(e.display.chromeScrollHack),e.display.chromeScrollHack=setTimeout(function(){e.display.chromeScrollHack=null,e.display.sizer.style.pointerEvents=``},100));var r=aa(t),i=r.x,a=r.y,o=ia;t.deltaMode===0&&(i=t.deltaX,a=t.deltaY,o=1);var s=e.display,l=s.scroller,p=l.scrollWidth>l.clientWidth,m=l.scrollHeight>l.clientHeight;if(i&&p||a&&m){if(a&&y&&c){outer:for(var h=t.target,g=s.view;h!=l;h=h.parentNode)for(var _=0;_<g.length;_++)if(g[_].node==h){e.display.currentWheelTarget=h;break outer}}if(i&&!n&&!f&&o!=null){a&&m&&gi(e,Math.max(0,l.scrollTop+a*o)),vi(e,Math.max(0,l.scrollLeft+i*o)),(!a||a&&m)&&Me(t),s.wheelStartX=null;return}if(a&&o!=null){var v=a*o,b=e.doc.scrollTop,x=b+s.wrapper.clientHeight;v<0?b=Math.max(0,b+v-50):x=Math.min(e.doc.height,x+v+50),qi(e,{top:b,bottom:x})}ra<20&&t.deltaMode!==0&&(s.wheelStartX==null?(s.wheelStartX=l.scrollLeft,s.wheelStartY=l.scrollTop,s.wheelDX=i,s.wheelDY=a,setTimeout(function(){if(s.wheelStartX!=null){var e=l.scrollLeft-s.wheelStartX,t=l.scrollTop-s.wheelStartY,n=t&&s.wheelDY&&t/s.wheelDY||e&&s.wheelDX&&e/s.wheelDX;s.wheelStartX=s.wheelStartY=null,n&&(ia=(ia*ra+n)/(ra+1),++ra)}},200)):(s.wheelDX+=i,s.wheelDY+=a))}}var ca=function(e,t){this.ranges=e,this.primIndex=t};ca.prototype.primary=function(){return this.ranges[this.primIndex]},ca.prototype.equals=function(e){if(e==this)return!0;if(e.primIndex!=this.primIndex||e.ranges.length!=this.ranges.length)return!1;for(var t=0;t<this.ranges.length;t++){var n=this.ranges[t],r=e.ranges[t];if(!ft(n.anchor,r.anchor)||!ft(n.head,r.head))return!1}return!0},ca.prototype.deepCopy=function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new la(pt(this.ranges[t].anchor),pt(this.ranges[t].head));return new ca(e,this.primIndex)},ca.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},ca.prototype.contains=function(e,t){t||=e;for(var n=0;n<this.ranges.length;n++){var r=this.ranges[n];if(Q(t,r.from())>=0&&Q(e,r.to())<=0)return n}return-1};var la=function(e,t){this.anchor=e,this.head=t};la.prototype.from=function(){return ht(this.anchor,this.head)},la.prototype.to=function(){return mt(this.anchor,this.head)},la.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function ua(e,t,n){var r=e&&e.options.selectionsMayTouch,i=t[n];t.sort(function(e,t){return Q(e.from(),t.from())}),n=V(t,i);for(var a=1;a<t.length;a++){var o=t[a],s=t[a-1],c=Q(s.to(),o.from());if(r&&!o.empty()?c>0:c>=0){var l=ht(s.from(),o.from()),u=mt(s.to(),o.to()),d=s.empty()?o.from()==o.head:s.from()==s.head;a<=n&&--n,t.splice(--a,2,new la(d?u:l,d?l:u))}}return new ca(t,n)}function da(e,t){return new ca([new la(e,t||e)],0)}function fa(e){return e.text?Z(e.from.line+e.text.length-1,G(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function pa(e,t){if(Q(e,t.from)<0)return e;if(Q(e,t.to)<=0)return fa(t);var n=e.line+t.text.length-(t.to.line-t.from.line)-1,r=e.ch;return e.line==t.to.line&&(r+=fa(t).ch-t.to.ch),Z(n,r)}function ma(e,t){for(var n=[],r=0;r<e.sel.ranges.length;r++){var i=e.sel.ranges[r];n.push(new la(pa(i.anchor,t),pa(i.head,t)))}return ua(e.cm,n,e.sel.primIndex)}function ha(e,t,n){return e.line==t.line?Z(n.line,e.ch-t.ch+n.ch):Z(n.line+(e.line-t.line),e.ch)}function ga(e,t,n){for(var r=[],i=Z(e.first,0),a=i,o=0;o<t.length;o++){var s=t[o],c=ha(s.from,i,a),l=ha(fa(s),i,a);if(i=s.to,a=l,n==`around`){var u=e.sel.ranges[o],d=Q(u.head,u.anchor)<0;r[o]=new la(d?l:c,d?c:l)}else r[o]=new la(c,c)}return new ca(r,e.sel.primIndex)}function _a(e){e.doc.mode=$e(e.options,e.doc.modeOption),va(e)}function va(e){e.doc.iter(function(e){e.stateAfter&&=null,e.styles&&=null}),e.doc.modeFrontier=e.doc.highlightFrontier=e.doc.first,zi(e,100),e.state.modeGen++,e.curOp&&Vr(e)}function ya(e,t){return t.from.ch==0&&t.to.ch==0&&G(t.text)==``&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function ba(e,t,n,r){function i(e){return n?n[e]:null}function a(e,n,i){mn(e,n,i,r),Nn(e,`change`,e,t)}function o(e,t){for(var n=[],a=e;a<t;++a)n.push(new pn(l[a],i(a),r));return n}var s=t.from,c=t.to,l=t.text,u=Y(e,s.line),d=Y(e,c.line),f=G(l),p=i(l.length-1),m=c.line-s.line;if(t.full)e.insert(0,o(0,l.length)),e.remove(l.length,e.size-l.length);else if(ya(e,t)){var h=o(0,l.length-1);a(d,d.text,p),m&&e.remove(s.line,m),h.length&&e.insert(s.line,h)}else if(u==d)if(l.length==1)a(u,u.text.slice(0,s.ch)+f+u.text.slice(c.ch),p);else{var g=o(1,l.length-1);g.push(new pn(f+u.text.slice(c.ch),p,r)),a(u,u.text.slice(0,s.ch)+l[0],i(0)),e.insert(s.line+1,g)}else if(l.length==1)a(u,u.text.slice(0,s.ch)+l[0]+d.text.slice(c.ch),i(0)),e.remove(s.line+1,m);else{a(u,u.text.slice(0,s.ch)+l[0],i(0)),a(d,f+d.text.slice(c.ch),p);var _=o(1,l.length-1);m>1&&e.remove(s.line+1,m-1),e.insert(s.line+1,_)}Nn(e,`change`,e,t)}function xa(e,t,n){function r(e,i,a){if(e.linked)for(var o=0;o<e.linked.length;++o){var s=e.linked[o];if(s.doc!=i){var c=a&&s.sharedHist;n&&!c||(t(s.doc,c),r(s.doc,e,c))}}}r(e,null,!0)}function Sa(e,t){if(t.cm)throw Error(`This document is already in use.`);e.doc=t,t.cm=e,Rr(e),_a(e),Ca(e),e.options.direction=t.direction,e.options.lineWrapping||fn(e),e.options.mode=t.modeOption,Vr(e)}function Ca(e){(e.doc.direction==`rtl`?ee:E)(e.display.lineDiv,`CodeMirror-rtl`)}function wa(e){Fi(e,function(){Ca(e),Vr(e)})}function Ta(e){this.done=[],this.undone=[],this.undoDepth=e?e.undoDepth:1/0,this.lastModTime=this.lastSelTime=0,this.lastOp=this.lastSelOp=null,this.lastOrigin=this.lastSelOrigin=null,this.generation=this.maxGeneration=e?e.maxGeneration:1}function Ea(e,t){var n={from:pt(t.from),to:fa(t),text:ot(e,t.from,t.to)};return Na(e,n,t.from.line,t.to.line+1),xa(e,function(e){return Na(e,n,t.from.line,t.to.line+1)},!0),n}function Da(e){for(;e.length&&G(e).ranges;)e.pop()}function Oa(e,t){if(t)return Da(e.done),G(e.done);if(e.done.length&&!G(e.done).ranges)return G(e.done);if(e.done.length>1&&!e.done[e.done.length-2].ranges)return e.done.pop(),G(e.done)}function ka(e,t,n,r){var i=e.history;i.undone.length=0;var a=+new Date,o,s;if((i.lastOp==r||i.lastOrigin==t.origin&&t.origin&&(t.origin.charAt(0)==`+`&&i.lastModTime>a-(e.cm?e.cm.options.historyEventDelay:500)||t.origin.charAt(0)==`*`))&&(o=Oa(i,i.lastOp==r)))s=G(o.changes),Q(t.from,t.to)==0&&Q(t.from,s.to)==0?s.to=fa(t):o.changes.push(Ea(e,t));else{var c=G(i.done);for((!c||!c.ranges)&&Ma(e.sel,i.done),o={changes:[Ea(e,t)],generation:i.generation},i.done.push(o);i.done.length>i.undoDepth;)i.done.shift(),i.done[0].ranges||i.done.shift()}i.done.push(n),i.generation=++i.maxGeneration,i.lastModTime=i.lastSelTime=a,i.lastOp=i.lastSelOp=r,i.lastOrigin=i.lastSelOrigin=t.origin,s||Oe(e,`historyAdded`)}function Aa(e,t,n,r){var i=t.charAt(0);return i==`*`||i==`+`&&n.ranges.length==r.ranges.length&&n.somethingSelected()==r.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function ja(e,t,n,r){var i=e.history,a=r&&r.origin;n==i.lastSelOp||a&&i.lastSelOrigin==a&&(i.lastModTime==i.lastSelTime&&i.lastOrigin==a||Aa(e,a,G(i.done),t))?i.done[i.done.length-1]=t:Ma(t,i.done),i.lastSelTime=+new Date,i.lastSelOrigin=a,i.lastSelOp=n,r&&r.clearRedo!==!1&&Da(i.undone)}function Ma(e,t){var n=G(t);n&&n.ranges&&n.equals(e)||t.push(e)}function Na(e,t,n,r){var i=t[`spans_`+e.id],a=0;e.iter(Math.max(e.first,n),Math.min(e.first+e.size,r),function(n){n.markedSpans&&((i||=t[`spans_`+e.id]={})[a]=n.markedSpans),++a})}function Pa(e){if(!e)return null;for(var t,n=0;n<e.length;++n)e[n].marker.explicitlyCleared?t||=e.slice(0,n):t&&t.push(e[n]);return t?t.length?t:null:e}function Fa(e,t){var n=t[`spans_`+e.id];if(!n)return null;for(var r=[],i=0;i<t.text.length;++i)r.push(Pa(n[i]));return r}function Ia(e,t){var n=Fa(e,t),r=Ut(e,t);if(!n)return r;if(!r)return n;for(var i=0;i<n.length;++i){var a=n[i],o=r[i];if(a&&o)spans:for(var s=0;s<o.length;++s){for(var c=o[s],l=0;l<a.length;++l)if(a[l].marker==c.marker)continue spans;a.push(c)}else o&&(n[i]=o)}return n}function La(e,t,n){for(var r=[],i=0;i<e.length;++i){var a=e[i];if(a.ranges){r.push(n?ca.prototype.deepCopy.call(a):a);continue}var o=a.changes,s=[];r.push({changes:s});for(var c=0;c<o.length;++c){var l=o[c],u=void 0;if(s.push({from:l.from,to:l.to,text:l.text}),t)for(var d in l)(u=d.match(/^spans_(\d+)$/))&&V(t,Number(u[1]))>-1&&(G(s)[d]=l[d],delete l[d])}}return r}function Ra(e,t,n,r){if(r){var i=e.anchor;if(n){var a=Q(t,i)<0;a==Q(n,i)<0?a!=Q(t,n)<0&&(t=n):(i=t,t=n)}return new la(i,t)}else return new la(n||t,t)}function za(e,t,n,r,i){i??=e.cm&&(e.cm.display.shift||e.extend),Ga(e,new ca([Ra(e.sel.primary(),t,n,i)],0),r)}function Ba(e,t,n){for(var r=[],i=e.cm&&(e.cm.display.shift||e.extend),a=0;a<e.sel.ranges.length;a++)r[a]=Ra(e.sel.ranges[a],t[a],null,i);Ga(e,ua(e.cm,r,e.sel.primIndex),n)}function Va(e,t,n,r){var i=e.sel.ranges.slice(0);i[t]=n,Ga(e,ua(e.cm,i,e.sel.primIndex),r)}function Ha(e,t,n,r){Ga(e,da(t,n),r)}function Ua(e,t,n){var r={ranges:t.ranges,update:function(t){this.ranges=[];for(var n=0;n<t.length;n++)this.ranges[n]=new la($(e,t[n].anchor),$(e,t[n].head))},origin:n&&n.origin};return Oe(e,`beforeSelectionChange`,e,r),e.cm&&Oe(e.cm,`beforeSelectionChange`,e.cm,r),r.ranges==t.ranges?t:ua(e.cm,r.ranges,r.ranges.length-1)}function Wa(e,t,n){var r=e.history.done,i=G(r);i&&i.ranges?(r[r.length-1]=t,Ka(e,t,n)):Ga(e,t,n)}function Ga(e,t,n){Ka(e,t,n),ja(e,e.sel,e.cm?e.cm.curOp.id:NaN,n)}function Ka(e,t,n){(J(e,`beforeSelectionChange`)||e.cm&&J(e.cm,`beforeSelectionChange`))&&(t=Ua(e,t,n));var r=n&&n.bias||(Q(t.primary().head,e.sel.primary().head)<0?-1:1);qa(e,Ya(e,t,r,!0)),!(n&&n.scroll===!1)&&e.cm&&e.cm.getOption(`readOnly`)!=`nocursor`&&di(e.cm)}function qa(e,t){t.equals(e.sel)||(e.sel=t,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,Ae(e.cm)),Nn(e,`cursorActivity`,e))}function Ja(e){qa(e,Ya(e,e.sel,null,!1))}function Ya(e,t,n,r){for(var i,a=0;a<t.ranges.length;a++){var o=t.ranges[a],s=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[a],c=Za(e,o.anchor,s&&s.anchor,n,r),l=o.head==o.anchor?c:Za(e,o.head,s&&s.head,n,r);(i||c!=o.anchor||l!=o.head)&&(i||=t.ranges.slice(0,a),i[a]=new la(c,l))}return i?ua(e.cm,i,t.primIndex):t}function Xa(e,t,n,r,i){var a=Y(e,t.line);if(a.markedSpans)for(var o=0;o<a.markedSpans.length;++o){var s=a.markedSpans[o],c=s.marker,l=`selectLeft`in c?!c.selectLeft:c.inclusiveLeft,u=`selectRight`in c?!c.selectRight:c.inclusiveRight;if((s.from==null||(l?s.from<=t.ch:s.from<t.ch))&&(s.to==null||(u?s.to>=t.ch:s.to>t.ch))){if(i&&(Oe(c,`beforeCursorEnter`),c.explicitlyCleared))if(a.markedSpans){--o;continue}else break;if(!c.atomic)continue;if(n){var d=c.find(r<0?1:-1),f=void 0;if((r<0?u:l)&&(d=Qa(e,d,-r,d&&d.line==t.line?a:null)),d&&d.line==t.line&&(f=Q(d,n))&&(r<0?f<0:f>0))return Xa(e,d,t,r,i)}var p=c.find(r<0?-1:1);return(r<0?l:u)&&(p=Qa(e,p,r,p.line==t.line?a:null)),p?Xa(e,p,t,r,i):null}}return t}function Za(e,t,n,r,i){var a=r||1;return Xa(e,t,n,a,i)||!i&&Xa(e,t,n,a,!0)||Xa(e,t,n,-a,i)||!i&&Xa(e,t,n,-a,!0)||(e.cantEdit=!0,Z(e.first,0))}function Qa(e,t,n,r){return n<0&&t.ch==0?t.line>e.first?$(e,Z(t.line-1)):null:n>0&&t.ch==(r||Y(e,t.line)).text.length?t.line<e.first+e.size-1?Z(t.line+1,0):null:new Z(t.line,t.ch+n)}function $a(e){e.setSelection(Z(e.firstLine(),0),Z(e.lastLine()),oe)}function eo(e,t,n){var r={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){return r.canceled=!0}};return n&&(r.update=function(t,n,i,a){t&&(r.from=$(e,t)),n&&(r.to=$(e,n)),i&&(r.text=i),a!==void 0&&(r.origin=a)}),Oe(e,`beforeChange`,e,r),e.cm&&Oe(e.cm,`beforeChange`,e.cm,r),r.canceled?(e.cm&&(e.cm.curOp.updateInput=2),null):{from:r.from,to:r.to,text:r.text,origin:r.origin}}function to(e,t,n){if(e.cm){if(!e.cm.curOp)return Ii(e.cm,to)(e,t,n);if(e.cm.state.suppressEdits)return}if(!((J(e,`beforeChange`)||e.cm&&J(e.cm,`beforeChange`))&&(t=eo(e,t,!0),!t))){var r=Nt&&!n&&Gt(e,t.from,t.to);if(r)for(var i=r.length-1;i>=0;--i)no(e,{from:r[i].from,to:r[i].to,text:i?[``]:t.text,origin:t.origin});else no(e,t)}}function no(e,t){if(!(t.text.length==1&&t.text[0]==``&&Q(t.from,t.to)==0)){var n=ma(e,t);ka(e,t,n,e.cm?e.cm.curOp.id:NaN),ao(e,t,n,Ut(e,t));var r=[];xa(e,function(e,n){!n&&V(r,e.history)==-1&&(uo(e.history,t),r.push(e.history)),ao(e,t,null,Ut(e,t))})}}function ro(e,t,n){var r=e.cm&&e.cm.state.suppressEdits;if(!(r&&!n)){for(var i=e.history,a,o=e.sel,s=t==`undo`?i.done:i.undone,c=t==`undo`?i.undone:i.done,l=0;l<s.length&&(a=s[l],!(n?a.ranges&&!a.equals(e.sel):!a.ranges));l++);if(l!=s.length){for(i.lastOrigin=i.lastSelOrigin=null;;)if(a=s.pop(),a.ranges){if(Ma(a,c),n&&!a.equals(e.sel)){Ga(e,a,{clearRedo:!1});return}o=a}else if(r){s.push(a);return}else break;var u=[];Ma(o,c),c.push({changes:u,generation:i.generation}),i.generation=a.generation||++i.maxGeneration;for(var d=J(e,`beforeChange`)||e.cm&&J(e.cm,`beforeChange`),f=function(n){var r=a.changes[n];if(r.origin=t,d&&!eo(e,r,!1))return s.length=0,{};u.push(Ea(e,r)),ao(e,r,n?ma(e,r):G(s),Ia(e,r)),!n&&e.cm&&e.cm.scrollIntoView({from:r.from,to:fa(r)});var i=[];xa(e,function(e,t){!t&&V(i,e.history)==-1&&(uo(e.history,r),i.push(e.history)),ao(e,r,null,Ia(e,r))})},p=a.changes.length-1;p>=0;--p){var m=f(p);if(m)return m.v}}}}function io(e,t){if(t!=0&&(e.first+=t,e.sel=new ca(le(e.sel.ranges,function(e){return new la(Z(e.anchor.line+t,e.anchor.ch),Z(e.head.line+t,e.head.ch))}),e.sel.primIndex),e.cm)){Vr(e.cm,e.first,e.first-t,t);for(var n=e.cm.display,r=n.viewFrom;r<n.viewTo;r++)Hr(e.cm,r,`gutter`)}}function ao(e,t,n,r){if(e.cm&&!e.cm.curOp)return Ii(e.cm,ao)(e,t,n,r);if(t.to.line<e.first){io(e,t.text.length-1-(t.to.line-t.from.line));return}if(!(t.from.line>e.lastLine())){if(t.from.line<e.first){var i=t.text.length-1-(e.first-t.from.line);io(e,i),t={from:Z(e.first,0),to:Z(t.to.line+i,t.to.ch),text:[G(t.text)],origin:t.origin}}var a=e.lastLine();t.to.line>a&&(t={from:t.from,to:Z(a,Y(e,a).text.length),text:[t.text[0]],origin:t.origin}),t.removed=ot(e,t.from,t.to),n||=ma(e,t),e.cm?oo(e.cm,t,r):ba(e,t,r),Ka(e,n,oe),e.cantEdit&&Za(e,Z(e.firstLine(),0))&&(e.cantEdit=!1)}}function oo(e,t,n){var r=e.doc,i=e.display,a=t.from,o=t.to,s=!1,c=a.line;e.options.lineWrapping||(c=X(nn(Y(r,a.line))),r.iter(c,o.line+1,function(e){if(e==i.maxLine)return s=!0,!0})),r.sel.contains(t.from,t.to)>-1&&Ae(e),ba(r,t,n,Lr(e)),e.options.lineWrapping||(r.iter(c,a.line+t.text.length,function(e){var t=dn(e);t>i.maxLineLength&&(i.maxLine=e,i.maxLineLength=t,i.maxLineChanged=!0,s=!1)}),s&&(e.curOp.updateMaxLine=!0)),Mt(r,a.line),zi(e,400);var l=t.text.length-(o.line-a.line)-1;t.full?Vr(e):a.line==o.line&&t.text.length==1&&!ya(e.doc,t)?Hr(e,a.line,`text`):Vr(e,a.line,o.line+1,l);var u=J(e,`changes`),d=J(e,`change`);if(d||u){var f={from:a,to:o,text:t.text,removed:t.removed,origin:t.origin};d&&Nn(e,`change`,e,f),u&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(f)}e.display.selForContextMenu=null}function so(e,t,n,r,i){var a;r||=n,Q(r,n)<0&&(a=[r,n],n=a[0],r=a[1]),typeof t==`string`&&(t=e.splitLines(t)),to(e,{from:n,to:r,text:t,origin:i})}function co(e,t,n,r){n<e.line?e.line+=r:t<e.line&&(e.line=t,e.ch=0)}function lo(e,t,n,r){for(var i=0;i<e.length;++i){var a=e[i],o=!0;if(a.ranges){a.copied||=(a=e[i]=a.deepCopy(),!0);for(var s=0;s<a.ranges.length;s++)co(a.ranges[s].anchor,t,n,r),co(a.ranges[s].head,t,n,r);continue}for(var c=0;c<a.changes.length;++c){var l=a.changes[c];if(n<l.from.line)l.from=Z(l.from.line+r,l.from.ch),l.to=Z(l.to.line+r,l.to.ch);else if(t<=l.to.line){o=!1;break}}o||(e.splice(0,i+1),i=0)}}function uo(e,t){var n=t.from.line,r=t.to.line,i=t.text.length-(r-n)-1;lo(e.done,n,r,i),lo(e.undone,n,r,i)}function fo(e,t,n,r){var i=t,a=t;return typeof t==`number`?a=Y(e,gt(e,t)):i=X(t),i==null?null:(r(a,i)&&e.cm&&Hr(e.cm,i,n),a)}function po(e){this.lines=e,this.parent=null;for(var t=0,n=0;n<e.length;++n)e[n].parent=this,t+=e[n].height;this.height=t}po.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var n=e,r=e+t;n<r;++n){var i=this.lines[n];this.height-=i.height,hn(i),Nn(i,`delete`)}this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,n){this.height+=n,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var r=0;r<t.length;++r)t[r].parent=this},iterN:function(e,t,n){for(var r=e+t;e<r;++e)if(n(this.lines[e]))return!0}};function mo(e){this.children=e;for(var t=0,n=0,r=0;r<e.length;++r){var i=e[r];t+=i.chunkSize(),n+=i.height,i.parent=this}this.size=t,this.height=n,this.parent=null}mo.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){this.size-=t;for(var n=0;n<this.children.length;++n){var r=this.children[n],i=r.chunkSize();if(e<i){var a=Math.min(t,i-e),o=r.height;if(r.removeInner(e,a),this.height-=o-r.height,i==a&&(this.children.splice(n--,1),r.parent=null),(t-=a)==0)break;e=0}else e-=i}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof po))){var s=[];this.collapse(s),this.children=[new po(s)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t<this.children.length;++t)this.children[t].collapse(e)},insertInner:function(e,t,n){this.size+=t.length,this.height+=n;for(var r=0;r<this.children.length;++r){var i=this.children[r],a=i.chunkSize();if(e<=a){if(i.insertInner(e,t,n),i.lines&&i.lines.length>50){for(var o=i.lines.length%25+25,s=o;s<i.lines.length;){var c=new po(i.lines.slice(s,s+=25));i.height-=c.height,this.children.splice(++r,0,c),c.parent=this}i.lines=i.lines.slice(0,o),this.maybeSpill()}break}e-=a}},maybeSpill:function(){if(!(this.children.length<=10)){var e=this;do{var t=new mo(e.children.splice(e.children.length-5,5));if(e.parent){e.size-=t.size,e.height-=t.height;var n=V(e.parent.children,e);e.parent.children.splice(n+1,0,t)}else{var r=new mo(e.children);r.parent=e,e.children=[r,t],e=r}t.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()}},iterN:function(e,t,n){for(var r=0;r<this.children.length;++r){var i=this.children[r],a=i.chunkSize();if(e<a){var o=Math.min(t,a-e);if(i.iterN(e,o,n))return!0;if((t-=o)==0)break;e=0}else e-=a}}};var ho=function(e,t,n){if(n)for(var r in n)n.hasOwnProperty(r)&&(this[r]=n[r]);this.doc=e,this.node=t};ho.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,n=this.line,r=X(n);if(!(r==null||!t)){for(var i=0;i<t.length;++i)t[i]==this&&t.splice(i--,1);t.length||(n.widgets=null);var a=qn(this);ct(n,Math.max(0,n.height-a)),e&&(Fi(e,function(){go(e,n,-a),Hr(e,r,`widget`)}),Nn(e,`lineWidgetCleared`,e,this,r))}},ho.prototype.changed=function(){var e=this,t=this.height,n=this.doc.cm,r=this.line;this.height=null;var i=qn(this)-t;i&&(cn(this.doc,r)||ct(r,r.height+i),n&&Fi(n,function(){n.curOp.forceUpdate=!0,go(n,r,i),Nn(n,`lineWidgetChanged`,n,e,X(r))}))},je(ho);function go(e,t,n){un(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&ui(e,n)}function _o(e,t,n,r){var i=new ho(e,n,r),a=e.cm;return a&&i.noHScroll&&(a.display.alignWidgets=!0),fo(e,t,`widget`,function(t){var n=t.widgets||=[];if(i.insertAt==null?n.push(i):n.splice(Math.min(n.length,Math.max(0,i.insertAt)),0,i),i.line=t,a&&!cn(e,t)){var r=un(t)<e.scrollTop;ct(t,t.height+qn(i)),r&&ui(a,i.height),a.curOp.forceUpdate=!0}return!0}),a&&Nn(a,`lineWidgetAdded`,a,i,typeof t==`number`?t:X(t)),i}var vo=0,yo=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++vo};yo.prototype.clear=function(){if(!this.explicitlyCleared){var e=this.doc.cm,t=e&&!e.curOp;if(t&&Di(e),J(this,`clear`)){var n=this.find();n&&Nn(this,`clear`,n.from,n.to)}for(var r=null,i=null,a=0;a<this.lines.length;++a){var o=this.lines[a],s=Rt(o.markedSpans,this);e&&!this.collapsed?Hr(e,X(o),`text`):e&&(s.to!=null&&(i=X(o)),s.from!=null&&(r=X(o))),o.markedSpans=zt(o.markedSpans,s),s.from==null&&this.collapsed&&!cn(this.doc,o)&&e&&ct(o,Nr(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var c=0;c<this.lines.length;++c){var l=nn(this.lines[c]),u=dn(l);u>e.display.maxLineLength&&(e.display.maxLine=l,e.display.maxLineLength=u,e.display.maxLineChanged=!0)}r!=null&&e&&this.collapsed&&Vr(e,r,i+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&Ja(e.doc)),e&&Nn(e,`markerCleared`,e,this,r,i),t&&Oi(e),this.parent&&this.parent.clear()}},yo.prototype.find=function(e,t){e==null&&this.type==`bookmark`&&(e=1);for(var n,r,i=0;i<this.lines.length;++i){var a=this.lines[i],o=Rt(a.markedSpans,this);if(o.from!=null&&(n=Z(t?a:X(a),o.from),e==-1))return n;if(o.to!=null&&(r=Z(t?a:X(a),o.to),e==1))return r}return n&&{from:n,to:r}},yo.prototype.changed=function(){var e=this,t=this.find(-1,!0),n=this,r=this.doc.cm;!t||!r||Fi(r,function(){var i=t.line,a=ar(r,X(t.line));if(a&&(pr(a),r.curOp.selectionChanged=r.curOp.forceUpdate=!0),r.curOp.updateMaxLine=!0,!cn(n.doc,i)&&n.height!=null){var o=n.height;n.height=null;var s=qn(n)-o;s&&ct(i,i.height+s)}Nn(r,`markerChanged`,r,e)})},yo.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(!t.maybeHiddenMarkers||V(t.maybeHiddenMarkers,this)==-1)&&(t.maybeUnhiddenMarkers||=[]).push(this)}this.lines.push(e)},yo.prototype.detachLine=function(e){if(this.lines.splice(V(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||=[]).push(this)}},je(yo);function bo(e,t,n,r,i){if(r&&r.shared)return So(e,t,n,r,i);if(e.cm&&!e.cm.curOp)return Ii(e.cm,bo)(e,t,n,r,i);var a=new yo(e,i),o=Q(t,n);if(r&&z(r,a,!1),o>0||o==0&&a.clearWhenEmpty!==!1)return a;if(a.replacedWith&&(a.collapsed=!0,a.widgetNode=A(`span`,[a.replacedWith],`CodeMirror-widget`),r.handleMouseEvents||a.widgetNode.setAttribute(`cm-ignore-events`,`true`),r.insertLeft&&(a.widgetNode.insertLeft=!0)),a.collapsed){if(tn(e,t.line,t,n,a)||t.line!=n.line&&tn(e,n.line,t,n,a))throw Error(`Inserting collapsed marker partially overlapping an existing one`);It()}a.addToHistory&&ka(e,{from:t,to:n,origin:`markText`},e.sel,NaN);var s=t.line,c=e.cm,l;if(e.iter(s,n.line+1,function(r){c&&a.collapsed&&!c.options.lineWrapping&&nn(r)==c.display.maxLine&&(l=!0),a.collapsed&&s!=t.line&&ct(r,0),Bt(r,new Lt(a,s==t.line?t.ch:null,s==n.line?n.ch:null),e.cm&&e.cm.curOp),++s}),a.collapsed&&e.iter(t.line,n.line+1,function(t){cn(e,t)&&ct(t,0)}),a.clearOnEnter&&q(a,`beforeCursorEnter`,function(){return a.clear()}),a.readOnly&&(Ft(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),a.collapsed&&(a.id=++vo,a.atomic=!0),c){if(l&&(c.curOp.updateMaxLine=!0),a.collapsed)Vr(c,t.line,n.line+1);else if(a.className||a.startStyle||a.endStyle||a.css||a.attributes||a.title)for(var u=t.line;u<=n.line;u++)Hr(c,u,`text`);a.atomic&&Ja(c.doc),Nn(c,`markerAdded`,c,a)}return a}var xo=function(e,t){this.markers=e,this.primary=t;for(var n=0;n<e.length;++n)e[n].parent=this};xo.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();Nn(this,`clear`)}},xo.prototype.find=function(e,t){return this.primary.find(e,t)},je(xo);function So(e,t,n,r,i){r=z(r),r.shared=!1;var a=[bo(e,t,n,r,i)],o=a[0],s=r.widgetNode;return xa(e,function(e){s&&(r.widgetNode=s.cloneNode(!0)),a.push(bo(e,$(e,t),$(e,n),r,i));for(var c=0;c<e.linked.length;++c)if(e.linked[c].isParent)return;o=G(a)}),new xo(a,o)}function Co(e){return e.findMarks(Z(e.first,0),e.clipPos(Z(e.lastLine())),function(e){return e.parent})}function wo(e,t){for(var n=0;n<t.length;n++){var r=t[n],i=r.find(),a=e.clipPos(i.from),o=e.clipPos(i.to);if(Q(a,o)){var s=bo(e,a,o,r.primary,r.primary.type);r.markers.push(s),s.parent=r}}}function To(e){for(var t=function(t){var n=e[t],r=[n.primary.doc];xa(n.primary.doc,function(e){return r.push(e)});for(var i=0;i<n.markers.length;i++){var a=n.markers[i];V(r,a.doc)==-1&&(a.parent=null,n.markers.splice(i--,1))}},n=0;n<e.length;n++)t(n)}var Eo=0,Do=function(e,t,n,r,i){if(!(this instanceof Do))return new Do(e,t,n,r,i);n??=0,mo.call(this,[new po([new pn(``,null)])]),this.first=n,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=n;var a=Z(n,0);this.sel=da(a),this.history=new Ta(null),this.id=++Eo,this.modeOption=t,this.lineSep=r,this.direction=i==`rtl`?`rtl`:`ltr`,this.extend=!1,typeof e==`string`&&(e=this.splitLines(e)),ba(this,{from:a,to:a,text:e}),Ga(this,da(a),oe)};Do.prototype=fe(mo.prototype,{constructor:Do,iter:function(e,t,n){n?this.iterN(e-this.first,t-e,n):this.iterN(this.first,this.first+this.size,e)},insert:function(e,t){for(var n=0,r=0;r<t.length;++r)n+=t[r].height;this.insertInner(e-this.first,t,n)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=st(this,this.first,this.first+this.size);return e===!1?t:t.join(e||this.lineSeparator())},setValue:Ri(function(e){var t=Z(this.first,0),n=this.first+this.size-1;to(this,{from:t,to:Z(n,Y(this,n).text.length),text:this.splitLines(e),origin:`setValue`,full:!0},!0),this.cm&&fi(this.cm,0,0),Ga(this,da(t),oe)}),replaceRange:function(e,t,n,r){t=$(this,t),n=n?$(this,n):t,so(this,e,t,n,r)},getRange:function(e,t,n){var r=ot(this,$(this,e),$(this,t));return n===!1?r:n===``?r.join(``):r.join(n||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){if(ut(this,e))return Y(this,e)},getLineNumber:function(e){return X(e)},getLineHandleVisualStart:function(e){return typeof e==`number`&&(e=Y(this,e)),nn(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return $(this,e)},getCursor:function(e){var t=this.sel.primary();return e==null||e==`head`?t.head:e==`anchor`?t.anchor:e==`end`||e==`to`||e===!1?t.to():t.from()},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:Ri(function(e,t,n){Ha(this,$(this,typeof e==`number`?Z(e,t||0):e),null,n)}),setSelection:Ri(function(e,t,n){Ha(this,$(this,e),$(this,t||e),n)}),extendSelection:Ri(function(e,t,n){za(this,$(this,e),t&&$(this,t),n)}),extendSelections:Ri(function(e,t){Ba(this,vt(this,e),t)}),extendSelectionsBy:Ri(function(e,t){var n=le(this.sel.ranges,e);Ba(this,vt(this,n),t)}),setSelections:Ri(function(e,t,n){if(e.length){for(var r=[],i=0;i<e.length;i++)r[i]=new la($(this,e[i].anchor),$(this,e[i].head||e[i].anchor));t??=Math.min(e.length-1,this.sel.primIndex),Ga(this,ua(this.cm,r,t),n)}}),addSelection:Ri(function(e,t,n){var r=this.sel.ranges.slice(0);r.push(new la($(this,e),$(this,t||e))),Ga(this,ua(this.cm,r,r.length-1),n)}),getSelection:function(e){for(var t=this.sel.ranges,n,r=0;r<t.length;r++){var i=ot(this,t[r].from(),t[r].to());n=n?n.concat(i):i}return e===!1?n:n.join(e||this.lineSeparator())},getSelections:function(e){for(var t=[],n=this.sel.ranges,r=0;r<n.length;r++){var i=ot(this,n[r].from(),n[r].to());e!==!1&&(i=i.join(e||this.lineSeparator())),t[r]=i}return t},replaceSelection:function(e,t,n){for(var r=[],i=0;i<this.sel.ranges.length;i++)r[i]=e;this.replaceSelections(r,t,n||`+input`)},replaceSelections:Ri(function(e,t,n){for(var r=[],i=this.sel,a=0;a<i.ranges.length;a++){var o=i.ranges[a];r[a]={from:o.from(),to:o.to(),text:this.splitLines(e[a]),origin:n}}for(var s=t&&t!=`end`&&ga(this,r,t),c=r.length-1;c>=0;c--)to(this,r[c]);s?Wa(this,s):this.cm&&di(this.cm)}),undo:Ri(function(){ro(this,`undo`)}),redo:Ri(function(){ro(this,`redo`)}),undoSelection:Ri(function(){ro(this,`undo`,!0)}),redoSelection:Ri(function(){ro(this,`redo`,!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,n=0,r=0;r<e.done.length;r++)e.done[r].ranges||++t;for(var i=0;i<e.undone.length;i++)e.undone[i].ranges||++n;return{undo:t,redo:n}},clearHistory:function(){var e=this;this.history=new Ta(this.history),xa(this,function(t){return t.history=e.history},!0)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(e){return e&&(this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null),this.history.generation},isClean:function(e){return this.history.generation==(e||this.cleanGeneration)},getHistory:function(){return{done:La(this.history.done),undone:La(this.history.undone)}},setHistory:function(e){var t=this.history=new Ta(this.history);t.done=La(e.done.slice(0),null,!0),t.undone=La(e.undone.slice(0),null,!0)},setGutterMarker:Ri(function(e,t,n){return fo(this,e,`gutter`,function(e){var r=e.gutterMarkers||={};return r[t]=n,!n&&ge(r)&&(e.gutterMarkers=null),!0})}),clearGutter:Ri(function(e){var t=this;this.iter(function(n){n.gutterMarkers&&n.gutterMarkers[e]&&fo(t,n,`gutter`,function(){return n.gutterMarkers[e]=null,ge(n.gutterMarkers)&&(n.gutterMarkers=null),!0})})}),lineInfo:function(e){var t;if(typeof e==`number`){if(!ut(this,e)||(t=e,e=Y(this,e),!e))return null}else if(t=X(e),t==null)return null;return{line:t,handle:e,text:e.text,gutterMarkers:e.gutterMarkers,textClass:e.textClass,bgClass:e.bgClass,wrapClass:e.wrapClass,widgets:e.widgets}},addLineClass:Ri(function(e,t,n){return fo(this,e,t==`gutter`?`gutter`:`class`,function(e){var r=t==`text`?`textClass`:t==`background`?`bgClass`:t==`gutter`?`gutterClass`:`wrapClass`;if(!e[r])e[r]=n;else if(T(n).test(e[r]))return!1;else e[r]+=` `+n;return!0})}),removeLineClass:Ri(function(e,t,n){return fo(this,e,t==`gutter`?`gutter`:`class`,function(e){var r=t==`text`?`textClass`:t==`background`?`bgClass`:t==`gutter`?`gutterClass`:`wrapClass`,i=e[r];if(i)if(n==null)e[r]=null;else{var a=i.match(T(n));if(!a)return!1;var o=a.index+a[0].length;e[r]=i.slice(0,a.index)+(!a.index||o==i.length?``:` `)+i.slice(o)||null}else return!1;return!0})}),addLineWidget:Ri(function(e,t,n){return _o(this,e,t,n)}),removeLineWidget:function(e){e.clear()},markText:function(e,t,n){return bo(this,$(this,e),$(this,t),n,n&&n.type||`range`)},setBookmark:function(e,t){var n={replacedWith:t&&(t.nodeType==null?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};return e=$(this,e),bo(this,e,e,n,`bookmark`)},findMarksAt:function(e){e=$(this,e);var t=[],n=Y(this,e.line).markedSpans;if(n)for(var r=0;r<n.length;++r){var i=n[r];(i.from==null||i.from<=e.ch)&&(i.to==null||i.to>=e.ch)&&t.push(i.marker.parent||i.marker)}return t},findMarks:function(e,t,n){e=$(this,e),t=$(this,t);var r=[],i=e.line;return this.iter(e.line,t.line+1,function(a){var o=a.markedSpans;if(o)for(var s=0;s<o.length;s++){var c=o[s];!(c.to!=null&&i==e.line&&e.ch>=c.to||c.from==null&&i!=e.line||c.from!=null&&i==t.line&&c.from>=t.ch)&&(!n||n(c.marker))&&r.push(c.marker.parent||c.marker)}++i}),r},getAllMarks:function(){var e=[];return this.iter(function(t){var n=t.markedSpans;if(n)for(var r=0;r<n.length;++r)n[r].from!=null&&e.push(n[r].marker)}),e},posFromIndex:function(e){var t,n=this.first,r=this.lineSeparator().length;return this.iter(function(i){var a=i.text.length+r;if(a>e)return t=e,!0;e-=a,++n}),$(this,Z(n,t))},indexFromPos:function(e){e=$(this,e);var t=e.ch;if(e.line<this.first||e.ch<0)return 0;var n=this.lineSeparator().length;return this.iter(this.first,e.line,function(e){t+=e.text.length+n}),t},copy:function(e){var t=new Do(st(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);return t.scrollTop=this.scrollTop,t.scrollLeft=this.scrollLeft,t.sel=this.sel,t.extend=!1,e&&(t.history.undoDepth=this.history.undoDepth,t.setHistory(this.getHistory())),t},linkedDoc:function(e){e||={};var t=this.first,n=this.first+this.size;e.from!=null&&e.from>t&&(t=e.from),e.to!=null&&e.to<n&&(n=e.to);var r=new Do(st(this,t,n),e.mode||this.modeOption,t,this.lineSep,this.direction);return e.sharedHist&&(r.history=this.history),(this.linked||=[]).push({doc:r,sharedHist:e.sharedHist}),r.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],wo(r,Co(this)),r},unlinkDoc:function(e){if(e instanceof Vs&&(e=e.doc),this.linked){for(var t=0;t<this.linked.length;++t)if(this.linked[t].doc==e){this.linked.splice(t,1),e.unlinkDoc(this),To(Co(this));break}}if(e.history==this.history){var n=[e.id];xa(e,function(e){return n.push(e.id)},!0),e.history=new Ta(null),e.history.done=La(this.history.done,n),e.history.undone=La(this.history.undone,n)}},iterLinkedDocs:function(e){xa(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):Ue(e)},lineSeparator:function(){return this.lineSep||`
|
|
10
|
+
left: `+t.left+`px; width: `+Math.max(2,t.right-t.left)+`px;`);e.display.lineSpace.appendChild(o),o.scrollIntoView(i),e.display.lineSpace.removeChild(o)}}}function si(e,t,n,r){r??=0;var i;!e.options.lineWrapping&&t==n&&(n=t.sticky==`before`?Z(t.line,t.ch+1,`before`):t,t=t.ch?Z(t.line,t.sticky==`before`?t.ch-1:t.ch,`after`):t);for(var a=0;a<5;a++){var o=!1,s=Sr(e,t),c=!n||n==t?s:Sr(e,n);i={left:Math.min(s.left,c.left),top:Math.min(s.top,c.top)-r,right:Math.max(s.left,c.left),bottom:Math.max(s.bottom,c.bottom)+r};var l=li(e,i),u=e.doc.scrollTop,d=e.doc.scrollLeft;if(l.scrollTop!=null&&(gi(e,l.scrollTop),Math.abs(e.doc.scrollTop-u)>1&&(o=!0)),l.scrollLeft!=null&&(vi(e,l.scrollLeft),Math.abs(e.doc.scrollLeft-d)>1&&(o=!0)),!o)break}return i}function ci(e,t){var n=li(e,t);n.scrollTop!=null&&gi(e,n.scrollTop),n.scrollLeft!=null&&vi(e,n.scrollLeft)}function li(e,t){var n=e.display,r=Nr(e.display);t.top<0&&(t.top=0);var i=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:n.scroller.scrollTop,a=er(e),o={};t.bottom-t.top>a&&(t.bottom=t.top+a);var s=e.doc.height+Xn(n),c=t.top<r,l=t.bottom>s-r;if(t.top<i)o.scrollTop=c?0:t.top;else if(t.bottom>i+a){var u=Math.min(t.top,(l?s:t.bottom)-a);u!=i&&(o.scrollTop=u)}var d=e.options.fixedGutter?0:n.gutters.offsetWidth,f=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:n.scroller.scrollLeft-d,p=$n(e)-n.gutters.offsetWidth,m=t.right-t.left>p;return m&&(t.right=t.left+p),t.left<10?o.scrollLeft=0:t.left<f?o.scrollLeft=Math.max(0,t.left+d-(m?0:10)):t.right>p+f-3&&(o.scrollLeft=t.right+(m?0:10)-p),o}function ui(e,t){t!=null&&(mi(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+t)}function di(e){mi(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function fi(e,t,n){(t!=null||n!=null)&&mi(e),t!=null&&(e.curOp.scrollLeft=t),n!=null&&(e.curOp.scrollTop=n)}function pi(e,t){mi(e),e.curOp.scrollToPos=t}function mi(e){var t=e.curOp.scrollToPos;t&&(e.curOp.scrollToPos=null,hi(e,Cr(e,t.from),Cr(e,t.to),t.margin))}function hi(e,t,n,r){var i=li(e,{left:Math.min(t.left,n.left),top:Math.min(t.top,n.top)-r,right:Math.max(t.right,n.right),bottom:Math.max(t.bottom,n.bottom)+r});fi(e,i.scrollLeft,i.scrollTop)}function gi(e,t){Math.abs(e.doc.scrollTop-t)<2||(n||qi(e,{top:t}),_i(e,t,!0),n&&qi(e),zi(e,100))}function _i(e,t,n){t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),!(e.display.scroller.scrollTop==t&&!n)&&(e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t))}function vi(e,t,n,r){t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),!((n?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!r)&&(e.doc.scrollLeft=t,Zi(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function yi(e){var t=e.display,n=t.gutters.offsetWidth,r=Math.round(e.doc.height+Xn(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?n:0,docHeight:r,scrollHeight:r+Qn(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:n}}var bi=function(e,t,n){this.cm=n;var r=this.vert=k(`div`,[k(`div`,null,null,`min-width: 1px`)],`CodeMirror-vscrollbar`),i=this.horiz=k(`div`,[k(`div`,null,null,`height: 100%; min-height: 1px`)],`CodeMirror-hscrollbar`);r.tabIndex=i.tabIndex=-1,e(r),e(i),q(r,`scroll`,function(){r.clientHeight&&t(r.scrollTop,`vertical`)}),q(i,`scroll`,function(){i.clientWidth&&t(i.scrollLeft,`horizontal`)}),this.checkedZeroWidth=!1,o&&s<8&&(this.horiz.style.minHeight=this.vert.style.minWidth=`18px`)};bi.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,n=e.scrollHeight>e.clientHeight+1,r=e.nativeBarWidth;if(n){this.vert.style.display=`block`,this.vert.style.bottom=t?r+`px`:`0`;var i=e.viewHeight-(t?r:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+i)+`px`}else this.vert.scrollTop=0,this.vert.style.display=``,this.vert.firstChild.style.height=`0`;if(t){this.horiz.style.display=`block`,this.horiz.style.right=n?r+`px`:`0`,this.horiz.style.left=e.barLeft+`px`;var a=e.viewWidth-e.barLeft-(n?r:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+a)+`px`}else this.horiz.style.display=``,this.horiz.firstChild.style.width=`0`;return!this.checkedZeroWidth&&e.clientHeight>0&&(r==0&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:n?r:0,bottom:t?r:0}},bi.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,`horiz`)},bi.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,`vert`)},bi.prototype.zeroWidthHack=function(){var e=y&&!m?`12px`:`18px`;this.horiz.style.height=this.vert.style.width=e,this.horiz.style.visibility=this.vert.style.visibility=`hidden`,this.disableHoriz=new re,this.disableVert=new re},bi.prototype.enableZeroWidthBar=function(e,t,n){e.style.visibility=``;function r(){var i=e.getBoundingClientRect();(n==`vert`?document.elementFromPoint(i.right-1,(i.top+i.bottom)/2):document.elementFromPoint((i.right+i.left)/2,i.bottom-1))==e?t.set(1e3,r):e.style.visibility=`hidden`}t.set(1e3,r)},bi.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var xi=function(){};xi.prototype.update=function(){return{bottom:0,right:0}},xi.prototype.setScrollLeft=function(){},xi.prototype.setScrollTop=function(){},xi.prototype.clear=function(){};function Si(e,t){t||=yi(e);var n=e.display.barWidth,r=e.display.barHeight;Ci(e,t);for(var i=0;i<4&&n!=e.display.barWidth||r!=e.display.barHeight;i++)n!=e.display.barWidth&&e.options.lineWrapping&&ri(e),Ci(e,yi(e)),n=e.display.barWidth,r=e.display.barHeight}function Ci(e,t){var n=e.display,r=n.scrollbars.update(t);n.sizer.style.paddingRight=(n.barWidth=r.right)+`px`,n.sizer.style.paddingBottom=(n.barHeight=r.bottom)+`px`,n.heightForcer.style.borderBottom=r.bottom+`px solid transparent`,r.right&&r.bottom?(n.scrollbarFiller.style.display=`block`,n.scrollbarFiller.style.height=r.bottom+`px`,n.scrollbarFiller.style.width=r.right+`px`):n.scrollbarFiller.style.display=``,r.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(n.gutterFiller.style.display=`block`,n.gutterFiller.style.height=r.bottom+`px`,n.gutterFiller.style.width=t.gutterWidth+`px`):n.gutterFiller.style.display=``}var wi={native:bi,null:xi};function Ti(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&E(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new wi[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),q(t,`mousedown`,function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),t.setAttribute(`cm-not-content`,`true`)},function(t,n){n==`horizontal`?vi(e,t):gi(e,t)},e),e.display.scrollbars.addClass&&ee(e.display.wrapper,e.display.scrollbars.addClass)}var Ei=0;function Di(e){e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++Ei,markArrays:null},kn(e.curOp)}function Oi(e){var t=e.curOp;t&&jn(t,function(e){for(var t=0;t<e.ops.length;t++)e.ops[t].cm.curOp=null;ki(e)})}function ki(e){for(var t=e.ops,n=0;n<t.length;n++)Ai(t[n]);for(var r=0;r<t.length;r++)ji(t[r]);for(var i=0;i<t.length;i++)Mi(t[i]);for(var a=0;a<t.length;a++)Ni(t[a]);for(var o=0;o<t.length;o++)Pi(t[o])}function Ai(e){var t=e.cm,n=t.display;Hi(t),e.updateMaxLine&&fn(t),e.mustUpdate=e.viewChanged||e.forceUpdate||e.scrollTop!=null||e.scrollToPos&&(e.scrollToPos.from.line<n.viewFrom||e.scrollToPos.to.line>=n.viewTo)||n.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new Vi(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function ji(e){e.updatedDisplay=e.mustUpdate&&Gi(e.cm,e.update)}function Mi(e){var t=e.cm,n=t.display;e.updatedDisplay&&ri(t),e.barMeasure=yi(t),n.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=ir(t,n.maxLine,n.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(n.scroller.clientWidth,n.sizer.offsetLeft+e.adjustWidthTo+Qn(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,n.sizer.offsetLeft+e.adjustWidthTo-$n(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=n.input.prepareSelection())}function Ni(e){var t=e.cm;e.adjustWidthTo!=null&&(t.display.sizer.style.minWidth=e.adjustWidthTo+`px`,e.maxScrollLeft<t.doc.scrollLeft&&vi(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var n=e.focus&&e.focus==N(ne(t));e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,n),(e.updatedDisplay||e.startHeight!=t.doc.height)&&Si(t,e.barMeasure),e.updatedDisplay&&Xi(t,e.barMeasure),e.selectionChanged&&Qr(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),n&&$r(e.cm)}function Pi(e){var t=e.cm,n=t.display,r=t.doc;e.updatedDisplay&&Ki(t,e.update),n.wheelStartX!=null&&(e.scrollTop!=null||e.scrollLeft!=null||e.scrollToPos)&&(n.wheelStartX=n.wheelStartY=null),e.scrollTop!=null&&_i(t,e.scrollTop,e.forceScroll),e.scrollLeft!=null&&vi(t,e.scrollLeft,!0,!0),e.scrollToPos&&oi(t,si(t,$(r,e.scrollToPos.from),$(r,e.scrollToPos.to),e.scrollToPos.margin));var i=e.maybeHiddenMarkers,a=e.maybeUnhiddenMarkers;if(i)for(var o=0;o<i.length;++o)i[o].lines.length||Oe(i[o],`hide`);if(a)for(var s=0;s<a.length;++s)a[s].lines.length&&Oe(a[s],`unhide`);n.wrapper.offsetHeight&&(r.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&Oe(t,`changes`,t,e.changeObjs),e.update&&e.update.finish()}function Fi(e,t){if(e.curOp)return t();Di(e);try{return t()}finally{Oi(e)}}function Ii(e,t){return function(){if(e.curOp)return t.apply(e,arguments);Di(e);try{return t.apply(e,arguments)}finally{Oi(e)}}}function Li(e){return function(){if(this.curOp)return e.apply(this,arguments);Di(this);try{return e.apply(this,arguments)}finally{Oi(this)}}}function Ri(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);Di(t);try{return e.apply(this,arguments)}finally{Oi(t)}}}function zi(e,t){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(t,R(Bi,e))}function Bi(e){var t=e.doc;if(!(t.highlightFrontier>=e.display.viewTo)){var n=+new Date+e.options.workTime,r=Ct(e,t.highlightFrontier),i=[];t.iter(r.line,Math.min(t.first+t.size,e.display.viewTo+500),function(a){if(r.line>=e.display.viewFrom){var o=a.styles,s=a.text.length>e.options.maxHighlightLength?nt(t.mode,r.state):null,c=xt(e,a,r,!0);s&&(r.state=s),a.styles=c.styles;var l=a.styleClasses,u=c.classes;u?a.styleClasses=u:l&&(a.styleClasses=null);for(var d=!o||o.length!=a.styles.length||l!=u&&(!l||!u||l.bgClass!=u.bgClass||l.textClass!=u.textClass),f=0;!d&&f<o.length;++f)d=o[f]!=a.styles[f];d&&i.push(r.line),a.stateAfter=r.save(),r.nextLine()}else a.text.length<=e.options.maxHighlightLength&&wt(e,a.text,r),a.stateAfter=r.line%5==0?r.save():null,r.nextLine();if(+new Date>n)return zi(e,e.options.workDelay),!0}),t.highlightFrontier=r.line,t.modeFrontier=Math.max(t.modeFrontier,r.line),i.length&&Fi(e,function(){for(var t=0;t<i.length;t++)Hr(e,i[t],`text`)})}}var Vi=function(e,t,n){var r=e.display;this.viewport=t,this.visible=ai(r,e.doc,t),this.editorIsHidden=!r.wrapper.offsetWidth,this.wrapperHeight=r.wrapper.clientHeight,this.wrapperWidth=r.wrapper.clientWidth,this.oldDisplayWidth=$n(e),this.force=n,this.dims=Fr(e),this.events=[]};Vi.prototype.signal=function(e,t){J(e,t)&&this.events.push(arguments)},Vi.prototype.finish=function(){for(var e=0;e<this.events.length;e++)Oe.apply(null,this.events[e])};function Hi(e){var t=e.display;!t.scrollbarsClipped&&t.scroller.offsetWidth&&(t.nativeBarWidth=t.scroller.offsetWidth-t.scroller.clientWidth,t.heightForcer.style.height=Qn(e)+`px`,t.sizer.style.marginBottom=-t.nativeBarWidth+`px`,t.sizer.style.borderRightWidth=Qn(e)+`px`,t.scrollbarsClipped=!0)}function Ui(e){if(e.hasFocus())return null;var t=N(ne(e));if(!t||!M(e.display.lineDiv,t))return null;var n={activeElt:t};if(window.getSelection){var r=L(e).getSelection();r.anchorNode&&r.extend&&M(e.display.lineDiv,r.anchorNode)&&(n.anchorNode=r.anchorNode,n.anchorOffset=r.anchorOffset,n.focusNode=r.focusNode,n.focusOffset=r.focusOffset)}return n}function Wi(e){if(!(!e||!e.activeElt||e.activeElt==N(I(e.activeElt)))&&(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&M(document.body,e.anchorNode)&&M(document.body,e.focusNode))){var t=e.activeElt.ownerDocument,n=t.defaultView.getSelection(),r=t.createRange();r.setEnd(e.anchorNode,e.anchorOffset),r.collapse(!1),n.removeAllRanges(),n.addRange(r),n.extend(e.focusNode,e.focusOffset)}}function Gi(e,t){var n=e.display,r=e.doc;if(t.editorIsHidden)return Ur(e),!1;if(!t.force&&t.visible.from>=n.viewFrom&&t.visible.to<=n.viewTo&&(n.updateLineNumbers==null||n.updateLineNumbers>=n.viewTo)&&n.renderedView==n.view&&Kr(e)==0)return!1;Qi(e)&&(Ur(e),t.dims=Fr(e));var i=r.first+r.size,a=Math.max(t.visible.from-e.options.viewportMargin,r.first),o=Math.min(i,t.visible.to+e.options.viewportMargin);n.viewFrom<a&&a-n.viewFrom<20&&(a=Math.max(r.first,n.viewFrom)),n.viewTo>o&&n.viewTo-o<20&&(o=Math.min(i,n.viewTo)),Pt&&(a=on(e.doc,a),o=sn(e.doc,o));var s=a!=n.viewFrom||o!=n.viewTo||n.lastWrapHeight!=t.wrapperHeight||n.lastWrapWidth!=t.wrapperWidth;Gr(e,a,o),n.viewOffset=un(Y(e.doc,n.viewFrom)),e.display.mover.style.top=n.viewOffset+`px`;var c=Kr(e);if(!s&&c==0&&!t.force&&n.renderedView==n.view&&(n.updateLineNumbers==null||n.updateLineNumbers>=n.viewTo))return!1;var l=Ui(e);return c>4&&(n.lineDiv.style.display=`none`),Ji(e,n.updateLineNumbers,t.dims),c>4&&(n.lineDiv.style.display=``),n.renderedView=n.view,Wi(l),D(n.cursorDiv),D(n.selectionDiv),n.gutters.style.height=n.sizer.style.minHeight=0,s&&(n.lastWrapHeight=t.wrapperHeight,n.lastWrapWidth=t.wrapperWidth,zi(e,400)),n.updateLineNumbers=null,!0}function Ki(e,t){for(var n=t.viewport,r=!0;;r=!1){if(!r||!e.options.lineWrapping||t.oldDisplayWidth==$n(e)){if(n&&n.top!=null&&(n={top:Math.min(e.doc.height+Xn(e.display)-er(e),n.top)}),t.visible=ai(e.display,e.doc,n),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break}else r&&(t.visible=ai(e.display,e.doc,n));if(!Gi(e,t))break;ri(e);var i=yi(e);qr(e),Si(e,i),Xi(e,i),t.force=!1}t.signal(e,`update`,e),(e.display.viewFrom!=e.display.reportedViewFrom||e.display.viewTo!=e.display.reportedViewTo)&&(t.signal(e,`viewportChange`,e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function qi(e,t){var n=new Vi(e,t);if(Gi(e,n)){ri(e),Ki(e,n);var r=yi(e);qr(e),Si(e,r),Xi(e,r),n.finish()}}function Ji(e,t,n){var r=e.display,i=e.options.lineNumbers,a=r.lineDiv,o=a.firstChild;function s(t){var n=t.nextSibling;return c&&y&&e.display.currentWheelTarget==t?t.style.display=`none`:t.parentNode.removeChild(t),n}for(var l=r.view,u=r.viewFrom,d=0;d<l.length;d++){var f=l[d];if(!f.hidden)if(!f.node||f.node.parentNode!=a){var p=Un(e,f,u,n);a.insertBefore(p,o)}else{for(;o!=f.node;)o=s(o);var m=i&&t!=null&&t<=u&&f.lineNumber;f.changes&&(V(f.changes,`gutter`)>-1&&(m=!1),Fn(e,f,u,n)),m&&(D(f.lineNumber),f.lineNumber.appendChild(document.createTextNode(dt(e.options,u)))),o=f.node.nextSibling}u+=f.size}for(;o;)o=s(o)}function Yi(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+`px`,Nn(e,`gutterChanged`,e)}function Xi(e,t){e.display.sizer.style.minHeight=t.docHeight+`px`,e.display.heightForcer.style.top=t.docHeight+`px`,e.display.gutters.style.height=t.docHeight+e.display.barHeight+Qn(e)+`px`}function Zi(e){var t=e.display,n=t.view;if(!(!t.alignWidgets&&(!t.gutters.firstChild||!e.options.fixedGutter))){for(var r=Ir(t)-t.scroller.scrollLeft+e.doc.scrollLeft,i=t.gutters.offsetWidth,a=r+`px`,o=0;o<n.length;o++)if(!n[o].hidden){e.options.fixedGutter&&(n[o].gutter&&(n[o].gutter.style.left=a),n[o].gutterBackground&&(n[o].gutterBackground.style.left=a));var s=n[o].alignable;if(s)for(var c=0;c<s.length;c++)s[c].style.left=a}e.options.fixedGutter&&(t.gutters.style.left=r+i+`px`)}}function Qi(e){if(!e.options.lineNumbers)return!1;var t=e.doc,n=dt(e.options,t.first+t.size-1),r=e.display;if(n.length!=r.lineNumChars){var i=r.measure.appendChild(k(`div`,[k(`div`,n)],`CodeMirror-linenumber CodeMirror-gutter-elt`)),a=i.firstChild.offsetWidth,o=i.offsetWidth-a;return r.lineGutter.style.width=``,r.lineNumInnerWidth=Math.max(a,r.lineGutter.offsetWidth-o)+1,r.lineNumWidth=r.lineNumInnerWidth+o,r.lineNumChars=r.lineNumInnerWidth?n.length:-1,r.lineGutter.style.width=r.lineNumWidth+`px`,Yi(e.display),!0}return!1}function $i(e,t){for(var n=[],r=!1,i=0;i<e.length;i++){var a=e[i],o=null;if(typeof a!=`string`&&(o=a.style,a=a.className),a==`CodeMirror-linenumbers`)if(t)r=!0;else continue;n.push({className:a,style:o})}return t&&!r&&n.push({className:`CodeMirror-linenumbers`,style:null}),n}function ea(e){var t=e.gutters,n=e.gutterSpecs;D(t),e.lineGutter=null;for(var r=0;r<n.length;++r){var i=n[r],a=i.className,o=i.style,s=t.appendChild(k(`div`,null,`CodeMirror-gutter `+a));o&&(s.style.cssText=o),a==`CodeMirror-linenumbers`&&(e.lineGutter=s,s.style.width=(e.lineNumWidth||1)+`px`)}t.style.display=n.length?``:`none`,Yi(e)}function ta(e){ea(e.display),Vr(e),Zi(e)}function na(e,t,r,i){var a=this;this.input=r,a.scrollbarFiller=k(`div`,null,`CodeMirror-scrollbar-filler`),a.scrollbarFiller.setAttribute(`cm-not-content`,`true`),a.gutterFiller=k(`div`,null,`CodeMirror-gutter-filler`),a.gutterFiller.setAttribute(`cm-not-content`,`true`),a.lineDiv=A(`div`,null,`CodeMirror-code`),a.selectionDiv=k(`div`,null,null,`position: relative; z-index: 1`),a.cursorDiv=k(`div`,null,`CodeMirror-cursors`),a.measure=k(`div`,null,`CodeMirror-measure`),a.lineMeasure=k(`div`,null,`CodeMirror-measure`),a.lineSpace=A(`div`,[a.measure,a.lineMeasure,a.selectionDiv,a.cursorDiv,a.lineDiv],null,`position: relative; outline: none`),a.mover=k(`div`,[A(`div`,[a.lineSpace],`CodeMirror-lines`)],null,`position: relative`),a.sizer=k(`div`,[a.mover],`CodeMirror-sizer`),a.sizerWidth=null,a.heightForcer=k(`div`,null,null,`position: absolute; height: `+ie+`px; width: 1px;`),a.gutters=k(`div`,null,`CodeMirror-gutters`),a.lineGutter=null,a.scroller=k(`div`,[a.sizer,a.heightForcer,a.gutters],`CodeMirror-scroll`),a.scroller.setAttribute(`tabIndex`,`-1`),a.wrapper=k(`div`,[a.scrollbarFiller,a.gutterFiller,a.scroller],`CodeMirror`),u&&d===105&&(a.wrapper.style.clipPath=`inset(0px)`),a.wrapper.setAttribute(`translate`,`no`),o&&s<8&&(a.gutters.style.zIndex=-1,a.scroller.style.paddingRight=0),!c&&!(n&&v)&&(a.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(a.wrapper):e(a.wrapper)),a.viewFrom=a.viewTo=t.first,a.reportedViewFrom=a.reportedViewTo=t.first,a.view=[],a.renderedView=null,a.externalMeasured=null,a.viewOffset=0,a.lastWrapHeight=a.lastWrapWidth=0,a.updateLineNumbers=null,a.nativeBarWidth=a.barHeight=a.barWidth=0,a.scrollbarsClipped=!1,a.lineNumWidth=a.lineNumInnerWidth=a.lineNumChars=null,a.alignWidgets=!1,a.cachedCharWidth=a.cachedTextHeight=a.cachedPaddingH=null,a.maxLine=null,a.maxLineLength=0,a.maxLineChanged=!1,a.wheelDX=a.wheelDY=a.wheelStartX=a.wheelStartY=null,a.shift=!1,a.selForContextMenu=null,a.activeTouch=null,a.gutterSpecs=$i(i.gutters,i.lineNumbers),ea(a),r.init(a)}var ra=0,ia=null;o?ia=-.53:n?ia=15:u?ia=-.7:p&&(ia=-1/3);function aa(e){var t=e.wheelDeltaX,n=e.wheelDeltaY;return t==null&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),n==null&&e.detail&&e.axis==e.VERTICAL_AXIS?n=e.detail:n??=e.wheelDelta,{x:t,y:n}}function oa(e){var t=aa(e);return t.x*=ia,t.y*=ia,t}function sa(e,t){u&&d==102&&(e.display.chromeScrollHack==null?e.display.sizer.style.pointerEvents=`none`:clearTimeout(e.display.chromeScrollHack),e.display.chromeScrollHack=setTimeout(function(){e.display.chromeScrollHack=null,e.display.sizer.style.pointerEvents=``},100));var r=aa(t),i=r.x,a=r.y,o=ia;t.deltaMode===0&&(i=t.deltaX,a=t.deltaY,o=1);var s=e.display,l=s.scroller,p=l.scrollWidth>l.clientWidth,m=l.scrollHeight>l.clientHeight;if(i&&p||a&&m){if(a&&y&&c){outer:for(var h=t.target,g=s.view;h!=l;h=h.parentNode)for(var _=0;_<g.length;_++)if(g[_].node==h){e.display.currentWheelTarget=h;break outer}}if(i&&!n&&!f&&o!=null){a&&m&&gi(e,Math.max(0,l.scrollTop+a*o)),vi(e,Math.max(0,l.scrollLeft+i*o)),(!a||a&&m)&&Me(t),s.wheelStartX=null;return}if(a&&o!=null){var v=a*o,b=e.doc.scrollTop,x=b+s.wrapper.clientHeight;v<0?b=Math.max(0,b+v-50):x=Math.min(e.doc.height,x+v+50),qi(e,{top:b,bottom:x})}ra<20&&t.deltaMode!==0&&(s.wheelStartX==null?(s.wheelStartX=l.scrollLeft,s.wheelStartY=l.scrollTop,s.wheelDX=i,s.wheelDY=a,setTimeout(function(){if(s.wheelStartX!=null){var e=l.scrollLeft-s.wheelStartX,t=l.scrollTop-s.wheelStartY,n=t&&s.wheelDY&&t/s.wheelDY||e&&s.wheelDX&&e/s.wheelDX;s.wheelStartX=s.wheelStartY=null,n&&(ia=(ia*ra+n)/(ra+1),++ra)}},200)):(s.wheelDX+=i,s.wheelDY+=a))}}var ca=function(e,t){this.ranges=e,this.primIndex=t};ca.prototype.primary=function(){return this.ranges[this.primIndex]},ca.prototype.equals=function(e){if(e==this)return!0;if(e.primIndex!=this.primIndex||e.ranges.length!=this.ranges.length)return!1;for(var t=0;t<this.ranges.length;t++){var n=this.ranges[t],r=e.ranges[t];if(!ft(n.anchor,r.anchor)||!ft(n.head,r.head))return!1}return!0},ca.prototype.deepCopy=function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new la(pt(this.ranges[t].anchor),pt(this.ranges[t].head));return new ca(e,this.primIndex)},ca.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},ca.prototype.contains=function(e,t){t||=e;for(var n=0;n<this.ranges.length;n++){var r=this.ranges[n];if(Q(t,r.from())>=0&&Q(e,r.to())<=0)return n}return-1};var la=function(e,t){this.anchor=e,this.head=t};la.prototype.from=function(){return ht(this.anchor,this.head)},la.prototype.to=function(){return mt(this.anchor,this.head)},la.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function ua(e,t,n){var r=e&&e.options.selectionsMayTouch,i=t[n];t.sort(function(e,t){return Q(e.from(),t.from())}),n=V(t,i);for(var a=1;a<t.length;a++){var o=t[a],s=t[a-1],c=Q(s.to(),o.from());if(r&&!o.empty()?c>0:c>=0){var l=ht(s.from(),o.from()),u=mt(s.to(),o.to()),d=s.empty()?o.from()==o.head:s.from()==s.head;a<=n&&--n,t.splice(--a,2,new la(d?u:l,d?l:u))}}return new ca(t,n)}function da(e,t){return new ca([new la(e,t||e)],0)}function fa(e){return e.text?Z(e.from.line+e.text.length-1,G(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function pa(e,t){if(Q(e,t.from)<0)return e;if(Q(e,t.to)<=0)return fa(t);var n=e.line+t.text.length-(t.to.line-t.from.line)-1,r=e.ch;return e.line==t.to.line&&(r+=fa(t).ch-t.to.ch),Z(n,r)}function ma(e,t){for(var n=[],r=0;r<e.sel.ranges.length;r++){var i=e.sel.ranges[r];n.push(new la(pa(i.anchor,t),pa(i.head,t)))}return ua(e.cm,n,e.sel.primIndex)}function ha(e,t,n){return e.line==t.line?Z(n.line,e.ch-t.ch+n.ch):Z(n.line+(e.line-t.line),e.ch)}function ga(e,t,n){for(var r=[],i=Z(e.first,0),a=i,o=0;o<t.length;o++){var s=t[o],c=ha(s.from,i,a),l=ha(fa(s),i,a);if(i=s.to,a=l,n==`around`){var u=e.sel.ranges[o],d=Q(u.head,u.anchor)<0;r[o]=new la(d?l:c,d?c:l)}else r[o]=new la(c,c)}return new ca(r,e.sel.primIndex)}function _a(e){e.doc.mode=$e(e.options,e.doc.modeOption),va(e)}function va(e){e.doc.iter(function(e){e.stateAfter&&=null,e.styles&&=null}),e.doc.modeFrontier=e.doc.highlightFrontier=e.doc.first,zi(e,100),e.state.modeGen++,e.curOp&&Vr(e)}function ya(e,t){return t.from.ch==0&&t.to.ch==0&&G(t.text)==``&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function ba(e,t,n,r){function i(e){return n?n[e]:null}function a(e,n,i){mn(e,n,i,r),Nn(e,`change`,e,t)}function o(e,t){for(var n=[],a=e;a<t;++a)n.push(new pn(l[a],i(a),r));return n}var s=t.from,c=t.to,l=t.text,u=Y(e,s.line),d=Y(e,c.line),f=G(l),p=i(l.length-1),m=c.line-s.line;if(t.full)e.insert(0,o(0,l.length)),e.remove(l.length,e.size-l.length);else if(ya(e,t)){var h=o(0,l.length-1);a(d,d.text,p),m&&e.remove(s.line,m),h.length&&e.insert(s.line,h)}else if(u==d)if(l.length==1)a(u,u.text.slice(0,s.ch)+f+u.text.slice(c.ch),p);else{var g=o(1,l.length-1);g.push(new pn(f+u.text.slice(c.ch),p,r)),a(u,u.text.slice(0,s.ch)+l[0],i(0)),e.insert(s.line+1,g)}else if(l.length==1)a(u,u.text.slice(0,s.ch)+l[0]+d.text.slice(c.ch),i(0)),e.remove(s.line+1,m);else{a(u,u.text.slice(0,s.ch)+l[0],i(0)),a(d,f+d.text.slice(c.ch),p);var _=o(1,l.length-1);m>1&&e.remove(s.line+1,m-1),e.insert(s.line+1,_)}Nn(e,`change`,e,t)}function xa(e,t,n){function r(e,i,a){if(e.linked)for(var o=0;o<e.linked.length;++o){var s=e.linked[o];if(s.doc!=i){var c=a&&s.sharedHist;n&&!c||(t(s.doc,c),r(s.doc,e,c))}}}r(e,null,!0)}function Sa(e,t){if(t.cm)throw Error(`This document is already in use.`);e.doc=t,t.cm=e,Rr(e),_a(e),Ca(e),e.options.direction=t.direction,e.options.lineWrapping||fn(e),e.options.mode=t.modeOption,Vr(e)}function Ca(e){(e.doc.direction==`rtl`?ee:E)(e.display.lineDiv,`CodeMirror-rtl`)}function wa(e){Fi(e,function(){Ca(e),Vr(e)})}function Ta(e){this.done=[],this.undone=[],this.undoDepth=e?e.undoDepth:1/0,this.lastModTime=this.lastSelTime=0,this.lastOp=this.lastSelOp=null,this.lastOrigin=this.lastSelOrigin=null,this.generation=this.maxGeneration=e?e.maxGeneration:1}function Ea(e,t){var n={from:pt(t.from),to:fa(t),text:ot(e,t.from,t.to)};return Na(e,n,t.from.line,t.to.line+1),xa(e,function(e){return Na(e,n,t.from.line,t.to.line+1)},!0),n}function Da(e){for(;e.length&&G(e).ranges;)e.pop()}function Oa(e,t){if(t)return Da(e.done),G(e.done);if(e.done.length&&!G(e.done).ranges)return G(e.done);if(e.done.length>1&&!e.done[e.done.length-2].ranges)return e.done.pop(),G(e.done)}function ka(e,t,n,r){var i=e.history;i.undone.length=0;var a=+new Date,o,s;if((i.lastOp==r||i.lastOrigin==t.origin&&t.origin&&(t.origin.charAt(0)==`+`&&i.lastModTime>a-(e.cm?e.cm.options.historyEventDelay:500)||t.origin.charAt(0)==`*`))&&(o=Oa(i,i.lastOp==r)))s=G(o.changes),Q(t.from,t.to)==0&&Q(t.from,s.to)==0?s.to=fa(t):o.changes.push(Ea(e,t));else{var c=G(i.done);for((!c||!c.ranges)&&Ma(e.sel,i.done),o={changes:[Ea(e,t)],generation:i.generation},i.done.push(o);i.done.length>i.undoDepth;)i.done.shift(),i.done[0].ranges||i.done.shift()}i.done.push(n),i.generation=++i.maxGeneration,i.lastModTime=i.lastSelTime=a,i.lastOp=i.lastSelOp=r,i.lastOrigin=i.lastSelOrigin=t.origin,s||Oe(e,`historyAdded`)}function Aa(e,t,n,r){var i=t.charAt(0);return i==`*`||i==`+`&&n.ranges.length==r.ranges.length&&n.somethingSelected()==r.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function ja(e,t,n,r){var i=e.history,a=r&&r.origin;n==i.lastSelOp||a&&i.lastSelOrigin==a&&(i.lastModTime==i.lastSelTime&&i.lastOrigin==a||Aa(e,a,G(i.done),t))?i.done[i.done.length-1]=t:Ma(t,i.done),i.lastSelTime=+new Date,i.lastSelOrigin=a,i.lastSelOp=n,r&&r.clearRedo!==!1&&Da(i.undone)}function Ma(e,t){var n=G(t);n&&n.ranges&&n.equals(e)||t.push(e)}function Na(e,t,n,r){var i=t[`spans_`+e.id],a=0;e.iter(Math.max(e.first,n),Math.min(e.first+e.size,r),function(n){n.markedSpans&&((i||=t[`spans_`+e.id]={})[a]=n.markedSpans),++a})}function Pa(e){if(!e)return null;for(var t,n=0;n<e.length;++n)e[n].marker.explicitlyCleared?t||=e.slice(0,n):t&&t.push(e[n]);return t?t.length?t:null:e}function Fa(e,t){var n=t[`spans_`+e.id];if(!n)return null;for(var r=[],i=0;i<t.text.length;++i)r.push(Pa(n[i]));return r}function Ia(e,t){var n=Fa(e,t),r=Ut(e,t);if(!n)return r;if(!r)return n;for(var i=0;i<n.length;++i){var a=n[i],o=r[i];if(a&&o)spans:for(var s=0;s<o.length;++s){for(var c=o[s],l=0;l<a.length;++l)if(a[l].marker==c.marker)continue spans;a.push(c)}else o&&(n[i]=o)}return n}function La(e,t,n){for(var r=[],i=0;i<e.length;++i){var a=e[i];if(a.ranges){r.push(n?ca.prototype.deepCopy.call(a):a);continue}var o=a.changes,s=[];r.push({changes:s});for(var c=0;c<o.length;++c){var l=o[c],u=void 0;if(s.push({from:l.from,to:l.to,text:l.text}),t)for(var d in l)(u=d.match(/^spans_(\d+)$/))&&V(t,Number(u[1]))>-1&&(G(s)[d]=l[d],delete l[d])}}return r}function Ra(e,t,n,r){if(r){var i=e.anchor;if(n){var a=Q(t,i)<0;a==Q(n,i)<0?a!=Q(t,n)<0&&(t=n):(i=t,t=n)}return new la(i,t)}else return new la(n||t,t)}function za(e,t,n,r,i){i??=e.cm&&(e.cm.display.shift||e.extend),Ga(e,new ca([Ra(e.sel.primary(),t,n,i)],0),r)}function Ba(e,t,n){for(var r=[],i=e.cm&&(e.cm.display.shift||e.extend),a=0;a<e.sel.ranges.length;a++)r[a]=Ra(e.sel.ranges[a],t[a],null,i);Ga(e,ua(e.cm,r,e.sel.primIndex),n)}function Va(e,t,n,r){var i=e.sel.ranges.slice(0);i[t]=n,Ga(e,ua(e.cm,i,e.sel.primIndex),r)}function Ha(e,t,n,r){Ga(e,da(t,n),r)}function Ua(e,t,n){var r={ranges:t.ranges,update:function(t){this.ranges=[];for(var n=0;n<t.length;n++)this.ranges[n]=new la($(e,t[n].anchor),$(e,t[n].head))},origin:n&&n.origin};return Oe(e,`beforeSelectionChange`,e,r),e.cm&&Oe(e.cm,`beforeSelectionChange`,e.cm,r),r.ranges==t.ranges?t:ua(e.cm,r.ranges,r.ranges.length-1)}function Wa(e,t,n){var r=e.history.done,i=G(r);i&&i.ranges?(r[r.length-1]=t,Ka(e,t,n)):Ga(e,t,n)}function Ga(e,t,n){Ka(e,t,n),ja(e,e.sel,e.cm?e.cm.curOp.id:NaN,n)}function Ka(e,t,n){(J(e,`beforeSelectionChange`)||e.cm&&J(e.cm,`beforeSelectionChange`))&&(t=Ua(e,t,n));var r=n&&n.bias||(Q(t.primary().head,e.sel.primary().head)<0?-1:1);qa(e,Ya(e,t,r,!0)),!(n&&n.scroll===!1)&&e.cm&&e.cm.getOption(`readOnly`)!=`nocursor`&&di(e.cm)}function qa(e,t){t.equals(e.sel)||(e.sel=t,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,Ae(e.cm)),Nn(e,`cursorActivity`,e))}function Ja(e){qa(e,Ya(e,e.sel,null,!1))}function Ya(e,t,n,r){for(var i,a=0;a<t.ranges.length;a++){var o=t.ranges[a],s=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[a],c=Za(e,o.anchor,s&&s.anchor,n,r),l=o.head==o.anchor?c:Za(e,o.head,s&&s.head,n,r);(i||c!=o.anchor||l!=o.head)&&(i||=t.ranges.slice(0,a),i[a]=new la(c,l))}return i?ua(e.cm,i,t.primIndex):t}function Xa(e,t,n,r,i){var a=Y(e,t.line);if(a.markedSpans)for(var o=0;o<a.markedSpans.length;++o){var s=a.markedSpans[o],c=s.marker,l=`selectLeft`in c?!c.selectLeft:c.inclusiveLeft,u=`selectRight`in c?!c.selectRight:c.inclusiveRight;if((s.from==null||(l?s.from<=t.ch:s.from<t.ch))&&(s.to==null||(u?s.to>=t.ch:s.to>t.ch))){if(i&&(Oe(c,`beforeCursorEnter`),c.explicitlyCleared))if(a.markedSpans){--o;continue}else break;if(!c.atomic)continue;if(n){var d=c.find(r<0?1:-1),f=void 0;if((r<0?u:l)&&(d=Qa(e,d,-r,d&&d.line==t.line?a:null)),d&&d.line==t.line&&(f=Q(d,n))&&(r<0?f<0:f>0))return Xa(e,d,t,r,i)}var p=c.find(r<0?-1:1);return(r<0?l:u)&&(p=Qa(e,p,r,p.line==t.line?a:null)),p?Xa(e,p,t,r,i):null}}return t}function Za(e,t,n,r,i){var a=r||1;return Xa(e,t,n,a,i)||!i&&Xa(e,t,n,a,!0)||Xa(e,t,n,-a,i)||!i&&Xa(e,t,n,-a,!0)||(e.cantEdit=!0,Z(e.first,0))}function Qa(e,t,n,r){return n<0&&t.ch==0?t.line>e.first?$(e,Z(t.line-1)):null:n>0&&t.ch==(r||Y(e,t.line)).text.length?t.line<e.first+e.size-1?Z(t.line+1,0):null:new Z(t.line,t.ch+n)}function $a(e){e.setSelection(Z(e.firstLine(),0),Z(e.lastLine()),oe)}function eo(e,t,n){var r={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){return r.canceled=!0}};return n&&(r.update=function(t,n,i,a){t&&(r.from=$(e,t)),n&&(r.to=$(e,n)),i&&(r.text=i),a!==void 0&&(r.origin=a)}),Oe(e,`beforeChange`,e,r),e.cm&&Oe(e.cm,`beforeChange`,e.cm,r),r.canceled?(e.cm&&(e.cm.curOp.updateInput=2),null):{from:r.from,to:r.to,text:r.text,origin:r.origin}}function to(e,t,n){if(e.cm){if(!e.cm.curOp)return Ii(e.cm,to)(e,t,n);if(e.cm.state.suppressEdits)return}if(!((J(e,`beforeChange`)||e.cm&&J(e.cm,`beforeChange`))&&(t=eo(e,t,!0),!t))){var r=Nt&&!n&&Gt(e,t.from,t.to);if(r)for(var i=r.length-1;i>=0;--i)no(e,{from:r[i].from,to:r[i].to,text:i?[``]:t.text,origin:t.origin});else no(e,t)}}function no(e,t){if(!(t.text.length==1&&t.text[0]==``&&Q(t.from,t.to)==0)){var n=ma(e,t);ka(e,t,n,e.cm?e.cm.curOp.id:NaN),ao(e,t,n,Ut(e,t));var r=[];xa(e,function(e,n){!n&&V(r,e.history)==-1&&(uo(e.history,t),r.push(e.history)),ao(e,t,null,Ut(e,t))})}}function ro(e,t,n){var r=e.cm&&e.cm.state.suppressEdits;if(!(r&&!n)){for(var i=e.history,a,o=e.sel,s=t==`undo`?i.done:i.undone,c=t==`undo`?i.undone:i.done,l=0;l<s.length&&(a=s[l],!(n?a.ranges&&!a.equals(e.sel):!a.ranges));l++);if(l!=s.length){for(i.lastOrigin=i.lastSelOrigin=null;;)if(a=s.pop(),a.ranges){if(Ma(a,c),n&&!a.equals(e.sel)){Ga(e,a,{clearRedo:!1});return}o=a}else if(r){s.push(a);return}else break;var u=[];Ma(o,c),c.push({changes:u,generation:i.generation}),i.generation=a.generation||++i.maxGeneration;for(var d=J(e,`beforeChange`)||e.cm&&J(e.cm,`beforeChange`),f=function(n){var r=a.changes[n];if(r.origin=t,d&&!eo(e,r,!1))return s.length=0,{};u.push(Ea(e,r)),ao(e,r,n?ma(e,r):G(s),Ia(e,r)),!n&&e.cm&&e.cm.scrollIntoView({from:r.from,to:fa(r)});var i=[];xa(e,function(e,t){!t&&V(i,e.history)==-1&&(uo(e.history,r),i.push(e.history)),ao(e,r,null,Ia(e,r))})},p=a.changes.length-1;p>=0;--p){var m=f(p);if(m)return m.v}}}}function io(e,t){if(t!=0&&(e.first+=t,e.sel=new ca(le(e.sel.ranges,function(e){return new la(Z(e.anchor.line+t,e.anchor.ch),Z(e.head.line+t,e.head.ch))}),e.sel.primIndex),e.cm)){Vr(e.cm,e.first,e.first-t,t);for(var n=e.cm.display,r=n.viewFrom;r<n.viewTo;r++)Hr(e.cm,r,`gutter`)}}function ao(e,t,n,r){if(e.cm&&!e.cm.curOp)return Ii(e.cm,ao)(e,t,n,r);if(t.to.line<e.first){io(e,t.text.length-1-(t.to.line-t.from.line));return}if(!(t.from.line>e.lastLine())){if(t.from.line<e.first){var i=t.text.length-1-(e.first-t.from.line);io(e,i),t={from:Z(e.first,0),to:Z(t.to.line+i,t.to.ch),text:[G(t.text)],origin:t.origin}}var a=e.lastLine();t.to.line>a&&(t={from:t.from,to:Z(a,Y(e,a).text.length),text:[t.text[0]],origin:t.origin}),t.removed=ot(e,t.from,t.to),n||=ma(e,t),e.cm?oo(e.cm,t,r):ba(e,t,r),Ka(e,n,oe),e.cantEdit&&Za(e,Z(e.firstLine(),0))&&(e.cantEdit=!1)}}function oo(e,t,n){var r=e.doc,i=e.display,a=t.from,o=t.to,s=!1,c=a.line;e.options.lineWrapping||(c=X(nn(Y(r,a.line))),r.iter(c,o.line+1,function(e){if(e==i.maxLine)return s=!0,!0})),r.sel.contains(t.from,t.to)>-1&&Ae(e),ba(r,t,n,Lr(e)),e.options.lineWrapping||(r.iter(c,a.line+t.text.length,function(e){var t=dn(e);t>i.maxLineLength&&(i.maxLine=e,i.maxLineLength=t,i.maxLineChanged=!0,s=!1)}),s&&(e.curOp.updateMaxLine=!0)),Mt(r,a.line),zi(e,400);var l=t.text.length-(o.line-a.line)-1;t.full?Vr(e):a.line==o.line&&t.text.length==1&&!ya(e.doc,t)?Hr(e,a.line,`text`):Vr(e,a.line,o.line+1,l);var u=J(e,`changes`),d=J(e,`change`);if(d||u){var f={from:a,to:o,text:t.text,removed:t.removed,origin:t.origin};d&&Nn(e,`change`,e,f),u&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(f)}e.display.selForContextMenu=null}function so(e,t,n,r,i){var a;r||=n,Q(r,n)<0&&(a=[r,n],n=a[0],r=a[1]),typeof t==`string`&&(t=e.splitLines(t)),to(e,{from:n,to:r,text:t,origin:i})}function co(e,t,n,r){n<e.line?e.line+=r:t<e.line&&(e.line=t,e.ch=0)}function lo(e,t,n,r){for(var i=0;i<e.length;++i){var a=e[i],o=!0;if(a.ranges){a.copied||(a=e[i]=a.deepCopy(),a.copied=!0);for(var s=0;s<a.ranges.length;s++)co(a.ranges[s].anchor,t,n,r),co(a.ranges[s].head,t,n,r);continue}for(var c=0;c<a.changes.length;++c){var l=a.changes[c];if(n<l.from.line)l.from=Z(l.from.line+r,l.from.ch),l.to=Z(l.to.line+r,l.to.ch);else if(t<=l.to.line){o=!1;break}}o||(e.splice(0,i+1),i=0)}}function uo(e,t){var n=t.from.line,r=t.to.line,i=t.text.length-(r-n)-1;lo(e.done,n,r,i),lo(e.undone,n,r,i)}function fo(e,t,n,r){var i=t,a=t;return typeof t==`number`?a=Y(e,gt(e,t)):i=X(t),i==null?null:(r(a,i)&&e.cm&&Hr(e.cm,i,n),a)}function po(e){this.lines=e,this.parent=null;for(var t=0,n=0;n<e.length;++n)e[n].parent=this,t+=e[n].height;this.height=t}po.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var n=e,r=e+t;n<r;++n){var i=this.lines[n];this.height-=i.height,hn(i),Nn(i,`delete`)}this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,n){this.height+=n,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var r=0;r<t.length;++r)t[r].parent=this},iterN:function(e,t,n){for(var r=e+t;e<r;++e)if(n(this.lines[e]))return!0}};function mo(e){this.children=e;for(var t=0,n=0,r=0;r<e.length;++r){var i=e[r];t+=i.chunkSize(),n+=i.height,i.parent=this}this.size=t,this.height=n,this.parent=null}mo.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){this.size-=t;for(var n=0;n<this.children.length;++n){var r=this.children[n],i=r.chunkSize();if(e<i){var a=Math.min(t,i-e),o=r.height;if(r.removeInner(e,a),this.height-=o-r.height,i==a&&(this.children.splice(n--,1),r.parent=null),(t-=a)==0)break;e=0}else e-=i}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof po))){var s=[];this.collapse(s),this.children=[new po(s)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t<this.children.length;++t)this.children[t].collapse(e)},insertInner:function(e,t,n){this.size+=t.length,this.height+=n;for(var r=0;r<this.children.length;++r){var i=this.children[r],a=i.chunkSize();if(e<=a){if(i.insertInner(e,t,n),i.lines&&i.lines.length>50){for(var o=i.lines.length%25+25,s=o;s<i.lines.length;){var c=new po(i.lines.slice(s,s+=25));i.height-=c.height,this.children.splice(++r,0,c),c.parent=this}i.lines=i.lines.slice(0,o),this.maybeSpill()}break}e-=a}},maybeSpill:function(){if(!(this.children.length<=10)){var e=this;do{var t=new mo(e.children.splice(e.children.length-5,5));if(e.parent){e.size-=t.size,e.height-=t.height;var n=V(e.parent.children,e);e.parent.children.splice(n+1,0,t)}else{var r=new mo(e.children);r.parent=e,e.children=[r,t],e=r}t.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()}},iterN:function(e,t,n){for(var r=0;r<this.children.length;++r){var i=this.children[r],a=i.chunkSize();if(e<a){var o=Math.min(t,a-e);if(i.iterN(e,o,n))return!0;if((t-=o)==0)break;e=0}else e-=a}}};var ho=function(e,t,n){if(n)for(var r in n)n.hasOwnProperty(r)&&(this[r]=n[r]);this.doc=e,this.node=t};ho.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,n=this.line,r=X(n);if(!(r==null||!t)){for(var i=0;i<t.length;++i)t[i]==this&&t.splice(i--,1);t.length||(n.widgets=null);var a=qn(this);ct(n,Math.max(0,n.height-a)),e&&(Fi(e,function(){go(e,n,-a),Hr(e,r,`widget`)}),Nn(e,`lineWidgetCleared`,e,this,r))}},ho.prototype.changed=function(){var e=this,t=this.height,n=this.doc.cm,r=this.line;this.height=null;var i=qn(this)-t;i&&(cn(this.doc,r)||ct(r,r.height+i),n&&Fi(n,function(){n.curOp.forceUpdate=!0,go(n,r,i),Nn(n,`lineWidgetChanged`,n,e,X(r))}))},je(ho);function go(e,t,n){un(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&ui(e,n)}function _o(e,t,n,r){var i=new ho(e,n,r),a=e.cm;return a&&i.noHScroll&&(a.display.alignWidgets=!0),fo(e,t,`widget`,function(t){var n=t.widgets||=[];if(i.insertAt==null?n.push(i):n.splice(Math.min(n.length,Math.max(0,i.insertAt)),0,i),i.line=t,a&&!cn(e,t)){var r=un(t)<e.scrollTop;ct(t,t.height+qn(i)),r&&ui(a,i.height),a.curOp.forceUpdate=!0}return!0}),a&&Nn(a,`lineWidgetAdded`,a,i,typeof t==`number`?t:X(t)),i}var vo=0,yo=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++vo};yo.prototype.clear=function(){if(!this.explicitlyCleared){var e=this.doc.cm,t=e&&!e.curOp;if(t&&Di(e),J(this,`clear`)){var n=this.find();n&&Nn(this,`clear`,n.from,n.to)}for(var r=null,i=null,a=0;a<this.lines.length;++a){var o=this.lines[a],s=Rt(o.markedSpans,this);e&&!this.collapsed?Hr(e,X(o),`text`):e&&(s.to!=null&&(i=X(o)),s.from!=null&&(r=X(o))),o.markedSpans=zt(o.markedSpans,s),s.from==null&&this.collapsed&&!cn(this.doc,o)&&e&&ct(o,Nr(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var c=0;c<this.lines.length;++c){var l=nn(this.lines[c]),u=dn(l);u>e.display.maxLineLength&&(e.display.maxLine=l,e.display.maxLineLength=u,e.display.maxLineChanged=!0)}r!=null&&e&&this.collapsed&&Vr(e,r,i+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&Ja(e.doc)),e&&Nn(e,`markerCleared`,e,this,r,i),t&&Oi(e),this.parent&&this.parent.clear()}},yo.prototype.find=function(e,t){e==null&&this.type==`bookmark`&&(e=1);for(var n,r,i=0;i<this.lines.length;++i){var a=this.lines[i],o=Rt(a.markedSpans,this);if(o.from!=null&&(n=Z(t?a:X(a),o.from),e==-1))return n;if(o.to!=null&&(r=Z(t?a:X(a),o.to),e==1))return r}return n&&{from:n,to:r}},yo.prototype.changed=function(){var e=this,t=this.find(-1,!0),n=this,r=this.doc.cm;!t||!r||Fi(r,function(){var i=t.line,a=ar(r,X(t.line));if(a&&(pr(a),r.curOp.selectionChanged=r.curOp.forceUpdate=!0),r.curOp.updateMaxLine=!0,!cn(n.doc,i)&&n.height!=null){var o=n.height;n.height=null;var s=qn(n)-o;s&&ct(i,i.height+s)}Nn(r,`markerChanged`,r,e)})},yo.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(!t.maybeHiddenMarkers||V(t.maybeHiddenMarkers,this)==-1)&&(t.maybeUnhiddenMarkers||=[]).push(this)}this.lines.push(e)},yo.prototype.detachLine=function(e){if(this.lines.splice(V(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||=[]).push(this)}},je(yo);function bo(e,t,n,r,i){if(r&&r.shared)return So(e,t,n,r,i);if(e.cm&&!e.cm.curOp)return Ii(e.cm,bo)(e,t,n,r,i);var a=new yo(e,i),o=Q(t,n);if(r&&z(r,a,!1),o>0||o==0&&a.clearWhenEmpty!==!1)return a;if(a.replacedWith&&(a.collapsed=!0,a.widgetNode=A(`span`,[a.replacedWith],`CodeMirror-widget`),r.handleMouseEvents||a.widgetNode.setAttribute(`cm-ignore-events`,`true`),r.insertLeft&&(a.widgetNode.insertLeft=!0)),a.collapsed){if(tn(e,t.line,t,n,a)||t.line!=n.line&&tn(e,n.line,t,n,a))throw Error(`Inserting collapsed marker partially overlapping an existing one`);It()}a.addToHistory&&ka(e,{from:t,to:n,origin:`markText`},e.sel,NaN);var s=t.line,c=e.cm,l;if(e.iter(s,n.line+1,function(r){c&&a.collapsed&&!c.options.lineWrapping&&nn(r)==c.display.maxLine&&(l=!0),a.collapsed&&s!=t.line&&ct(r,0),Bt(r,new Lt(a,s==t.line?t.ch:null,s==n.line?n.ch:null),e.cm&&e.cm.curOp),++s}),a.collapsed&&e.iter(t.line,n.line+1,function(t){cn(e,t)&&ct(t,0)}),a.clearOnEnter&&q(a,`beforeCursorEnter`,function(){return a.clear()}),a.readOnly&&(Ft(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),a.collapsed&&(a.id=++vo,a.atomic=!0),c){if(l&&(c.curOp.updateMaxLine=!0),a.collapsed)Vr(c,t.line,n.line+1);else if(a.className||a.startStyle||a.endStyle||a.css||a.attributes||a.title)for(var u=t.line;u<=n.line;u++)Hr(c,u,`text`);a.atomic&&Ja(c.doc),Nn(c,`markerAdded`,c,a)}return a}var xo=function(e,t){this.markers=e,this.primary=t;for(var n=0;n<e.length;++n)e[n].parent=this};xo.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();Nn(this,`clear`)}},xo.prototype.find=function(e,t){return this.primary.find(e,t)},je(xo);function So(e,t,n,r,i){r=z(r),r.shared=!1;var a=[bo(e,t,n,r,i)],o=a[0],s=r.widgetNode;return xa(e,function(e){s&&(r.widgetNode=s.cloneNode(!0)),a.push(bo(e,$(e,t),$(e,n),r,i));for(var c=0;c<e.linked.length;++c)if(e.linked[c].isParent)return;o=G(a)}),new xo(a,o)}function Co(e){return e.findMarks(Z(e.first,0),e.clipPos(Z(e.lastLine())),function(e){return e.parent})}function wo(e,t){for(var n=0;n<t.length;n++){var r=t[n],i=r.find(),a=e.clipPos(i.from),o=e.clipPos(i.to);if(Q(a,o)){var s=bo(e,a,o,r.primary,r.primary.type);r.markers.push(s),s.parent=r}}}function To(e){for(var t=function(t){var n=e[t],r=[n.primary.doc];xa(n.primary.doc,function(e){return r.push(e)});for(var i=0;i<n.markers.length;i++){var a=n.markers[i];V(r,a.doc)==-1&&(a.parent=null,n.markers.splice(i--,1))}},n=0;n<e.length;n++)t(n)}var Eo=0,Do=function(e,t,n,r,i){if(!(this instanceof Do))return new Do(e,t,n,r,i);n??=0,mo.call(this,[new po([new pn(``,null)])]),this.first=n,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=n;var a=Z(n,0);this.sel=da(a),this.history=new Ta(null),this.id=++Eo,this.modeOption=t,this.lineSep=r,this.direction=i==`rtl`?`rtl`:`ltr`,this.extend=!1,typeof e==`string`&&(e=this.splitLines(e)),ba(this,{from:a,to:a,text:e}),Ga(this,da(a),oe)};Do.prototype=fe(mo.prototype,{constructor:Do,iter:function(e,t,n){n?this.iterN(e-this.first,t-e,n):this.iterN(this.first,this.first+this.size,e)},insert:function(e,t){for(var n=0,r=0;r<t.length;++r)n+=t[r].height;this.insertInner(e-this.first,t,n)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=st(this,this.first,this.first+this.size);return e===!1?t:t.join(e||this.lineSeparator())},setValue:Ri(function(e){var t=Z(this.first,0),n=this.first+this.size-1;to(this,{from:t,to:Z(n,Y(this,n).text.length),text:this.splitLines(e),origin:`setValue`,full:!0},!0),this.cm&&fi(this.cm,0,0),Ga(this,da(t),oe)}),replaceRange:function(e,t,n,r){t=$(this,t),n=n?$(this,n):t,so(this,e,t,n,r)},getRange:function(e,t,n){var r=ot(this,$(this,e),$(this,t));return n===!1?r:n===``?r.join(``):r.join(n||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){if(ut(this,e))return Y(this,e)},getLineNumber:function(e){return X(e)},getLineHandleVisualStart:function(e){return typeof e==`number`&&(e=Y(this,e)),nn(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return $(this,e)},getCursor:function(e){var t=this.sel.primary();return e==null||e==`head`?t.head:e==`anchor`?t.anchor:e==`end`||e==`to`||e===!1?t.to():t.from()},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:Ri(function(e,t,n){Ha(this,$(this,typeof e==`number`?Z(e,t||0):e),null,n)}),setSelection:Ri(function(e,t,n){Ha(this,$(this,e),$(this,t||e),n)}),extendSelection:Ri(function(e,t,n){za(this,$(this,e),t&&$(this,t),n)}),extendSelections:Ri(function(e,t){Ba(this,vt(this,e),t)}),extendSelectionsBy:Ri(function(e,t){var n=le(this.sel.ranges,e);Ba(this,vt(this,n),t)}),setSelections:Ri(function(e,t,n){if(e.length){for(var r=[],i=0;i<e.length;i++)r[i]=new la($(this,e[i].anchor),$(this,e[i].head||e[i].anchor));t??=Math.min(e.length-1,this.sel.primIndex),Ga(this,ua(this.cm,r,t),n)}}),addSelection:Ri(function(e,t,n){var r=this.sel.ranges.slice(0);r.push(new la($(this,e),$(this,t||e))),Ga(this,ua(this.cm,r,r.length-1),n)}),getSelection:function(e){for(var t=this.sel.ranges,n,r=0;r<t.length;r++){var i=ot(this,t[r].from(),t[r].to());n=n?n.concat(i):i}return e===!1?n:n.join(e||this.lineSeparator())},getSelections:function(e){for(var t=[],n=this.sel.ranges,r=0;r<n.length;r++){var i=ot(this,n[r].from(),n[r].to());e!==!1&&(i=i.join(e||this.lineSeparator())),t[r]=i}return t},replaceSelection:function(e,t,n){for(var r=[],i=0;i<this.sel.ranges.length;i++)r[i]=e;this.replaceSelections(r,t,n||`+input`)},replaceSelections:Ri(function(e,t,n){for(var r=[],i=this.sel,a=0;a<i.ranges.length;a++){var o=i.ranges[a];r[a]={from:o.from(),to:o.to(),text:this.splitLines(e[a]),origin:n}}for(var s=t&&t!=`end`&&ga(this,r,t),c=r.length-1;c>=0;c--)to(this,r[c]);s?Wa(this,s):this.cm&&di(this.cm)}),undo:Ri(function(){ro(this,`undo`)}),redo:Ri(function(){ro(this,`redo`)}),undoSelection:Ri(function(){ro(this,`undo`,!0)}),redoSelection:Ri(function(){ro(this,`redo`,!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,n=0,r=0;r<e.done.length;r++)e.done[r].ranges||++t;for(var i=0;i<e.undone.length;i++)e.undone[i].ranges||++n;return{undo:t,redo:n}},clearHistory:function(){var e=this;this.history=new Ta(this.history),xa(this,function(t){return t.history=e.history},!0)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(e){return e&&(this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null),this.history.generation},isClean:function(e){return this.history.generation==(e||this.cleanGeneration)},getHistory:function(){return{done:La(this.history.done),undone:La(this.history.undone)}},setHistory:function(e){var t=this.history=new Ta(this.history);t.done=La(e.done.slice(0),null,!0),t.undone=La(e.undone.slice(0),null,!0)},setGutterMarker:Ri(function(e,t,n){return fo(this,e,`gutter`,function(e){var r=e.gutterMarkers||={};return r[t]=n,!n&&ge(r)&&(e.gutterMarkers=null),!0})}),clearGutter:Ri(function(e){var t=this;this.iter(function(n){n.gutterMarkers&&n.gutterMarkers[e]&&fo(t,n,`gutter`,function(){return n.gutterMarkers[e]=null,ge(n.gutterMarkers)&&(n.gutterMarkers=null),!0})})}),lineInfo:function(e){var t;if(typeof e==`number`){if(!ut(this,e)||(t=e,e=Y(this,e),!e))return null}else if(t=X(e),t==null)return null;return{line:t,handle:e,text:e.text,gutterMarkers:e.gutterMarkers,textClass:e.textClass,bgClass:e.bgClass,wrapClass:e.wrapClass,widgets:e.widgets}},addLineClass:Ri(function(e,t,n){return fo(this,e,t==`gutter`?`gutter`:`class`,function(e){var r=t==`text`?`textClass`:t==`background`?`bgClass`:t==`gutter`?`gutterClass`:`wrapClass`;if(!e[r])e[r]=n;else if(T(n).test(e[r]))return!1;else e[r]+=` `+n;return!0})}),removeLineClass:Ri(function(e,t,n){return fo(this,e,t==`gutter`?`gutter`:`class`,function(e){var r=t==`text`?`textClass`:t==`background`?`bgClass`:t==`gutter`?`gutterClass`:`wrapClass`,i=e[r];if(i)if(n==null)e[r]=null;else{var a=i.match(T(n));if(!a)return!1;var o=a.index+a[0].length;e[r]=i.slice(0,a.index)+(!a.index||o==i.length?``:` `)+i.slice(o)||null}else return!1;return!0})}),addLineWidget:Ri(function(e,t,n){return _o(this,e,t,n)}),removeLineWidget:function(e){e.clear()},markText:function(e,t,n){return bo(this,$(this,e),$(this,t),n,n&&n.type||`range`)},setBookmark:function(e,t){var n={replacedWith:t&&(t.nodeType==null?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};return e=$(this,e),bo(this,e,e,n,`bookmark`)},findMarksAt:function(e){e=$(this,e);var t=[],n=Y(this,e.line).markedSpans;if(n)for(var r=0;r<n.length;++r){var i=n[r];(i.from==null||i.from<=e.ch)&&(i.to==null||i.to>=e.ch)&&t.push(i.marker.parent||i.marker)}return t},findMarks:function(e,t,n){e=$(this,e),t=$(this,t);var r=[],i=e.line;return this.iter(e.line,t.line+1,function(a){var o=a.markedSpans;if(o)for(var s=0;s<o.length;s++){var c=o[s];!(c.to!=null&&i==e.line&&e.ch>=c.to||c.from==null&&i!=e.line||c.from!=null&&i==t.line&&c.from>=t.ch)&&(!n||n(c.marker))&&r.push(c.marker.parent||c.marker)}++i}),r},getAllMarks:function(){var e=[];return this.iter(function(t){var n=t.markedSpans;if(n)for(var r=0;r<n.length;++r)n[r].from!=null&&e.push(n[r].marker)}),e},posFromIndex:function(e){var t,n=this.first,r=this.lineSeparator().length;return this.iter(function(i){var a=i.text.length+r;if(a>e)return t=e,!0;e-=a,++n}),$(this,Z(n,t))},indexFromPos:function(e){e=$(this,e);var t=e.ch;if(e.line<this.first||e.ch<0)return 0;var n=this.lineSeparator().length;return this.iter(this.first,e.line,function(e){t+=e.text.length+n}),t},copy:function(e){var t=new Do(st(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);return t.scrollTop=this.scrollTop,t.scrollLeft=this.scrollLeft,t.sel=this.sel,t.extend=!1,e&&(t.history.undoDepth=this.history.undoDepth,t.setHistory(this.getHistory())),t},linkedDoc:function(e){e||={};var t=this.first,n=this.first+this.size;e.from!=null&&e.from>t&&(t=e.from),e.to!=null&&e.to<n&&(n=e.to);var r=new Do(st(this,t,n),e.mode||this.modeOption,t,this.lineSep,this.direction);return e.sharedHist&&(r.history=this.history),(this.linked||=[]).push({doc:r,sharedHist:e.sharedHist}),r.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],wo(r,Co(this)),r},unlinkDoc:function(e){if(e instanceof Vs&&(e=e.doc),this.linked){for(var t=0;t<this.linked.length;++t)if(this.linked[t].doc==e){this.linked.splice(t,1),e.unlinkDoc(this),To(Co(this));break}}if(e.history==this.history){var n=[e.id];xa(e,function(e){return n.push(e.id)},!0),e.history=new Ta(null),e.history.done=La(this.history.done,n),e.history.undone=La(this.history.undone,n)}},iterLinkedDocs:function(e){xa(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):Ue(e)},lineSeparator:function(){return this.lineSep||`
|
|
11
11
|
`},setDirection:Ri(function(e){e!=`rtl`&&(e=`ltr`),e!=this.direction&&(this.direction=e,this.iter(function(e){return e.order=null}),this.cm&&wa(this.cm))})}),Do.prototype.eachLine=Do.prototype.iter;var Oo=0;function ko(e){var t=this;if(Mo(t),!(ke(t,e)||Jn(t.display,e))){Me(e),o&&(Oo=+new Date);var n=zr(t,e,!0),r=e.dataTransfer.files;if(!(!n||t.isReadOnly()))if(r&&r.length&&window.FileReader&&window.File)for(var i=r.length,a=Array(i),s=0,c=function(){++s==i&&Ii(t,function(){n=$(t.doc,n);var e={from:n,to:n,text:t.doc.splitLines(a.filter(function(e){return e!=null}).join(t.doc.lineSeparator())),origin:`paste`};to(t.doc,e),Wa(t.doc,da($(t.doc,n),$(t.doc,fa(e))))})()},l=function(e,n){if(t.options.allowDropFileTypes&&V(t.options.allowDropFileTypes,e.type)==-1){c();return}var r=new FileReader;r.onerror=function(){return c()},r.onload=function(){var e=r.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(e)){c();return}a[n]=e,c()},r.readAsText(e)},u=0;u<r.length;u++)l(r[u],u);else{if(t.state.draggingText&&t.doc.sel.contains(n)>-1){t.state.draggingText(e),setTimeout(function(){return t.display.input.focus()},20);return}try{var d=e.dataTransfer.getData(`Text`);if(d){var f;if(t.state.draggingText&&!t.state.draggingText.copy&&(f=t.listSelections()),Ka(t.doc,da(n,n)),f)for(var p=0;p<f.length;++p)so(t.doc,``,f[p].anchor,f[p].head,`drag`);t.replaceSelection(d,`around`,`paste`),t.display.input.focus()}}catch{}}}}function Ao(e,t){if(o&&(!e.state.draggingText||+new Date-Oo<100)){Fe(t);return}if(!(ke(e,t)||Jn(e.display,t))&&(t.dataTransfer.setData(`Text`,e.getSelection()),t.dataTransfer.effectAllowed=`copyMove`,t.dataTransfer.setDragImage&&!p)){var n=k(`img`,null,null,`position: fixed; left: 0; top: 0;`);n.src=`data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==`,f&&(n.width=n.height=1,e.display.wrapper.appendChild(n),n._top=n.offsetTop),t.dataTransfer.setDragImage(n,0,0),f&&n.parentNode.removeChild(n)}}function jo(e,t){var n=zr(e,t);if(n){var r=document.createDocumentFragment();Yr(e,n,r),e.display.dragCursor||(e.display.dragCursor=k(`div`,null,`CodeMirror-cursors CodeMirror-dragcursors`),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),O(e.display.dragCursor,r)}}function Mo(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function No(e){if(document.getElementsByClassName){for(var t=document.getElementsByClassName(`CodeMirror`),n=[],r=0;r<t.length;r++){var i=t[r].CodeMirror;i&&n.push(i)}n.length&&n[0].operation(function(){for(var t=0;t<n.length;t++)e(n[t])})}}var Po=!1;function Fo(){Po||=(Io(),!0)}function Io(){q(window,`resize`,function(){setTimeout(function(){No(Lo)},100)}),q(window,`blur`,function(){return No(ni)})}function Lo(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}for(var Ro={3:`Pause`,8:`Backspace`,9:`Tab`,13:`Enter`,16:`Shift`,17:`Ctrl`,18:`Alt`,19:`Pause`,20:`CapsLock`,27:`Esc`,32:`Space`,33:`PageUp`,34:`PageDown`,35:`End`,36:`Home`,37:`Left`,38:`Up`,39:`Right`,40:`Down`,44:`PrintScrn`,45:`Insert`,46:`Delete`,59:`;`,61:`=`,91:`Mod`,92:`Mod`,93:`Mod`,106:`*`,107:`=`,109:`-`,110:`.`,111:`/`,145:`ScrollLock`,173:`-`,186:`;`,187:`=`,188:`,`,189:`-`,190:`.`,191:`/`,192:"`",219:`[`,220:`\\`,221:`]`,222:`'`,224:`Mod`,63232:`Up`,63233:`Down`,63234:`Left`,63235:`Right`,63272:`Delete`,63273:`Home`,63275:`End`,63276:`PageUp`,63277:`PageDown`,63302:`Insert`},zo=0;zo<10;zo++)Ro[zo+48]=Ro[zo+96]=String(zo);for(var Bo=65;Bo<=90;Bo++)Ro[Bo]=String.fromCharCode(Bo);for(var Vo=1;Vo<=12;Vo++)Ro[Vo+111]=Ro[Vo+63235]=`F`+Vo;var Ho={};Ho.basic={Left:`goCharLeft`,Right:`goCharRight`,Up:`goLineUp`,Down:`goLineDown`,End:`goLineEnd`,Home:`goLineStartSmart`,PageUp:`goPageUp`,PageDown:`goPageDown`,Delete:`delCharAfter`,Backspace:`delCharBefore`,"Shift-Backspace":`delCharBefore`,Tab:`defaultTab`,"Shift-Tab":`indentAuto`,Enter:`newlineAndIndent`,Insert:`toggleOverwrite`,Esc:`singleSelection`},Ho.pcDefault={"Ctrl-A":`selectAll`,"Ctrl-D":`deleteLine`,"Ctrl-Z":`undo`,"Shift-Ctrl-Z":`redo`,"Ctrl-Y":`redo`,"Ctrl-Home":`goDocStart`,"Ctrl-End":`goDocEnd`,"Ctrl-Up":`goLineUp`,"Ctrl-Down":`goLineDown`,"Ctrl-Left":`goGroupLeft`,"Ctrl-Right":`goGroupRight`,"Alt-Left":`goLineStart`,"Alt-Right":`goLineEnd`,"Ctrl-Backspace":`delGroupBefore`,"Ctrl-Delete":`delGroupAfter`,"Ctrl-S":`save`,"Ctrl-F":`find`,"Ctrl-G":`findNext`,"Shift-Ctrl-G":`findPrev`,"Shift-Ctrl-F":`replace`,"Shift-Ctrl-R":`replaceAll`,"Ctrl-[":`indentLess`,"Ctrl-]":`indentMore`,"Ctrl-U":`undoSelection`,"Shift-Ctrl-U":`redoSelection`,"Alt-U":`redoSelection`,fallthrough:`basic`},Ho.emacsy={"Ctrl-F":`goCharRight`,"Ctrl-B":`goCharLeft`,"Ctrl-P":`goLineUp`,"Ctrl-N":`goLineDown`,"Ctrl-A":`goLineStart`,"Ctrl-E":`goLineEnd`,"Ctrl-V":`goPageDown`,"Shift-Ctrl-V":`goPageUp`,"Ctrl-D":`delCharAfter`,"Ctrl-H":`delCharBefore`,"Alt-Backspace":`delWordBefore`,"Ctrl-K":`killLine`,"Ctrl-T":`transposeChars`,"Ctrl-O":`openLine`},Ho.macDefault={"Cmd-A":`selectAll`,"Cmd-D":`deleteLine`,"Cmd-Z":`undo`,"Shift-Cmd-Z":`redo`,"Cmd-Y":`redo`,"Cmd-Home":`goDocStart`,"Cmd-Up":`goDocStart`,"Cmd-End":`goDocEnd`,"Cmd-Down":`goDocEnd`,"Alt-Left":`goGroupLeft`,"Alt-Right":`goGroupRight`,"Cmd-Left":`goLineLeft`,"Cmd-Right":`goLineRight`,"Alt-Backspace":`delGroupBefore`,"Ctrl-Alt-Backspace":`delGroupAfter`,"Alt-Delete":`delGroupAfter`,"Cmd-S":`save`,"Cmd-F":`find`,"Cmd-G":`findNext`,"Shift-Cmd-G":`findPrev`,"Cmd-Alt-F":`replace`,"Shift-Cmd-Alt-F":`replaceAll`,"Cmd-[":`indentLess`,"Cmd-]":`indentMore`,"Cmd-Backspace":`delWrappedLineLeft`,"Cmd-Delete":`delWrappedLineRight`,"Cmd-U":`undoSelection`,"Shift-Cmd-U":`redoSelection`,"Ctrl-Up":`goDocStart`,"Ctrl-Down":`goDocEnd`,fallthrough:[`basic`,`emacsy`]},Ho.default=y?Ho.macDefault:Ho.pcDefault;function Uo(e){var t=e.split(/-(?!$)/);e=t[t.length-1];for(var n,r,i,a,o=0;o<t.length-1;o++){var s=t[o];if(/^(cmd|meta|m)$/i.test(s))a=!0;else if(/^a(lt)?$/i.test(s))n=!0;else if(/^(c|ctrl|control)$/i.test(s))r=!0;else if(/^s(hift)?$/i.test(s))i=!0;else throw Error(`Unrecognized modifier name: `+s)}return n&&(e=`Alt-`+e),r&&(e=`Ctrl-`+e),a&&(e=`Cmd-`+e),i&&(e=`Shift-`+e),e}function Wo(e){var t={};for(var n in e)if(e.hasOwnProperty(n)){var r=e[n];if(/^(name|fallthrough|(de|at)tach)$/.test(n))continue;if(r==`...`){delete e[n];continue}for(var i=le(n.split(` `),Uo),a=0;a<i.length;a++){var o=void 0,s=void 0;a==i.length-1?(s=i.join(` `),o=r):(s=i.slice(0,a+1).join(` `),o=`...`);var c=t[s];if(!c)t[s]=o;else if(c!=o)throw Error(`Inconsistent bindings for `+s)}delete e[n]}for(var l in t)e[l]=t[l];return e}function Go(e,t,n,r){t=Yo(t);var i=t.call?t.call(e,r):t[e];if(i===!1)return`nothing`;if(i===`...`)return`multi`;if(i!=null&&n(i))return`handled`;if(t.fallthrough){if(Object.prototype.toString.call(t.fallthrough)!=`[object Array]`)return Go(e,t.fallthrough,n,r);for(var a=0;a<t.fallthrough.length;a++){var o=Go(e,t.fallthrough[a],n,r);if(o)return o}}}function Ko(e){var t=typeof e==`string`?e:Ro[e.keyCode];return t==`Ctrl`||t==`Alt`||t==`Shift`||t==`Mod`}function qo(e,t,n){var r=e;return t.altKey&&r!=`Alt`&&(e=`Alt-`+e),(C?t.metaKey:t.ctrlKey)&&r!=`Ctrl`&&(e=`Ctrl-`+e),(C?t.ctrlKey:t.metaKey)&&r!=`Mod`&&(e=`Cmd-`+e),!n&&t.shiftKey&&r!=`Shift`&&(e=`Shift-`+e),e}function Jo(e,t){if(f&&e.keyCode==34&&e.char)return!1;var n=Ro[e.keyCode];return n==null||e.altGraphKey?!1:(e.keyCode==3&&e.code&&(n=e.code),qo(n,e,t))}function Yo(e){return typeof e==`string`?Ho[e]:e}function Xo(e,t){for(var n=e.doc.sel.ranges,r=[],i=0;i<n.length;i++){for(var a=t(n[i]);r.length&&Q(a.from,G(r).to)<=0;){var o=r.pop();if(Q(o.from,a.from)<0){a.from=o.from;break}}r.push(a)}Fi(e,function(){for(var t=r.length-1;t>=0;t--)so(e.doc,``,r[t].from,r[t].to,`+delete`);di(e)})}function Zo(e,t,n){var r=ye(e.text,t+n,n);return r<0||r>e.text.length?null:r}function Qo(e,t,n){var r=Zo(e,t.ch,n);return r==null?null:new Z(t.line,r,n<0?`after`:`before`)}function $o(e,t,n,r,i){if(e){t.doc.direction==`rtl`&&(i=-i);var a=K(n,t.doc.direction);if(a){var o=i<0?G(a):a[0],s=i<0==(o.level==1)?`after`:`before`,c;if(o.level>0||t.doc.direction==`rtl`){var l=or(t,n);c=i<0?n.text.length-1:0;var u=sr(t,l,c).top;c=be(function(e){return sr(t,l,e).top==u},i<0==(o.level==1)?o.from:o.to-1,c),s==`before`&&(c=Zo(n,c,1))}else c=i<0?o.to:o.from;return new Z(r,c,s)}}return new Z(r,i<0?n.text.length:0,i<0?`before`:`after`)}function es(e,t,n,r){var i=K(t,e.doc.direction);if(!i)return Qo(t,n,r);n.ch>=t.text.length?(n.ch=t.text.length,n.sticky=`before`):n.ch<=0&&(n.ch=0,n.sticky=`after`);var a=Ce(i,n.ch,n.sticky),o=i[a];if(e.doc.direction==`ltr`&&o.level%2==0&&(r>0?o.to>n.ch:o.from<n.ch))return Qo(t,n,r);var s=function(e,n){return Zo(t,e instanceof Z?e.ch:e,n)},c,l=function(n){return e.options.lineWrapping?(c||=or(e,t),Dr(e,t,c,n)):{begin:0,end:t.text.length}},u=l(n.sticky==`before`?s(n,-1):n.ch);if(e.doc.direction==`rtl`||o.level==1){var d=o.level==1==r<0,f=s(n,d?1:-1);if(f!=null&&(d?f<=o.to&&f<=u.end:f>=o.from&&f>=u.begin)){var p=d?`before`:`after`;return new Z(n.line,f,p)}}var m=function(e,t,r){for(var a=function(e,t){return t?new Z(n.line,s(e,1),`before`):new Z(n.line,e,`after`)};e>=0&&e<i.length;e+=t){var o=i[e],c=t>0==(o.level!=1),l=c?r.begin:s(r.end,-1);if(o.from<=l&&l<o.to||(l=c?o.from:s(o.to,-1),r.begin<=l&&l<r.end))return a(l,c)}},h=m(a+r,r,u);if(h)return h;var g=r>0?u.end:s(u.begin,-1);return g!=null&&!(r>0&&g==t.text.length)&&(h=m(r>0?0:i.length-1,r,l(g)),h)?h:null}var ts={selectAll:$a,singleSelection:function(e){return e.setSelection(e.getCursor(`anchor`),e.getCursor(`head`),oe)},killLine:function(e){return Xo(e,function(t){if(t.empty()){var n=Y(e.doc,t.head.line).text.length;return t.head.ch==n&&t.head.line<e.lastLine()?{from:t.head,to:Z(t.head.line+1,0)}:{from:t.head,to:Z(t.head.line,n)}}else return{from:t.from(),to:t.to()}})},deleteLine:function(e){return Xo(e,function(t){return{from:Z(t.from().line,0),to:$(e.doc,Z(t.to().line+1,0))}})},delLineLeft:function(e){return Xo(e,function(e){return{from:Z(e.from().line,0),to:e.from()}})},delWrappedLineLeft:function(e){return Xo(e,function(t){var n=e.charCoords(t.head,`div`).top+5;return{from:e.coordsChar({left:0,top:n},`div`),to:t.from()}})},delWrappedLineRight:function(e){return Xo(e,function(t){var n=e.charCoords(t.head,`div`).top+5,r=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:n},`div`);return{from:t.from(),to:r}})},undo:function(e){return e.undo()},redo:function(e){return e.redo()},undoSelection:function(e){return e.undoSelection()},redoSelection:function(e){return e.redoSelection()},goDocStart:function(e){return e.extendSelection(Z(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(Z(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy(function(t){return ns(e,t.head.line)},{origin:`+move`,bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy(function(t){return is(e,t.head)},{origin:`+move`,bias:1})},goLineEnd:function(e){return e.extendSelectionsBy(function(t){return rs(e,t.head.line)},{origin:`+move`,bias:-1})},goLineRight:function(e){return e.extendSelectionsBy(function(t){var n=e.cursorCoords(t.head,`div`).top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:n},`div`)},U)},goLineLeft:function(e){return e.extendSelectionsBy(function(t){var n=e.cursorCoords(t.head,`div`).top+5;return e.coordsChar({left:0,top:n},`div`)},U)},goLineLeftSmart:function(e){return e.extendSelectionsBy(function(t){var n=e.cursorCoords(t.head,`div`).top+5,r=e.coordsChar({left:0,top:n},`div`);return r.ch<e.getLine(r.line).search(/\S/)?is(e,t.head):r},U)},goLineUp:function(e){return e.moveV(-1,`line`)},goLineDown:function(e){return e.moveV(1,`line`)},goPageUp:function(e){return e.moveV(-1,`page`)},goPageDown:function(e){return e.moveV(1,`page`)},goCharLeft:function(e){return e.moveH(-1,`char`)},goCharRight:function(e){return e.moveH(1,`char`)},goColumnLeft:function(e){return e.moveH(-1,`column`)},goColumnRight:function(e){return e.moveH(1,`column`)},goWordLeft:function(e){return e.moveH(-1,`word`)},goGroupRight:function(e){return e.moveH(1,`group`)},goGroupLeft:function(e){return e.moveH(-1,`group`)},goWordRight:function(e){return e.moveH(1,`word`)},delCharBefore:function(e){return e.deleteH(-1,`codepoint`)},delCharAfter:function(e){return e.deleteH(1,`char`)},delWordBefore:function(e){return e.deleteH(-1,`word`)},delWordAfter:function(e){return e.deleteH(1,`word`)},delGroupBefore:function(e){return e.deleteH(-1,`group`)},delGroupAfter:function(e){return e.deleteH(1,`group`)},indentAuto:function(e){return e.indentSelection(`smart`)},indentMore:function(e){return e.indentSelection(`add`)},indentLess:function(e){return e.indentSelection(`subtract`)},insertTab:function(e){return e.replaceSelection(` `)},insertSoftTab:function(e){for(var t=[],n=e.listSelections(),r=e.options.tabSize,i=0;i<n.length;i++){var a=n[i].from(),o=B(e.getLine(a.line),a.ch,r);t.push(ce(r-o%r))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection(`add`):e.execCommand(`insertTab`)},transposeChars:function(e){return Fi(e,function(){for(var t=e.listSelections(),n=[],r=0;r<t.length;r++)if(t[r].empty()){var i=t[r].head,a=Y(e.doc,i.line).text;if(a){if(i.ch==a.length&&(i=new Z(i.line,i.ch-1)),i.ch>0)i=new Z(i.line,i.ch+1),e.replaceRange(a.charAt(i.ch-1)+a.charAt(i.ch-2),Z(i.line,i.ch-2),i,`+transpose`);else if(i.line>e.doc.first){var o=Y(e.doc,i.line-1).text;o&&(i=new Z(i.line,1),e.replaceRange(a.charAt(0)+e.doc.lineSeparator()+o.charAt(o.length-1),Z(i.line-1,o.length-1),i,`+transpose`))}}n.push(new la(i,i))}e.setSelections(n)})},newlineAndIndent:function(e){return Fi(e,function(){for(var t=e.listSelections(),n=t.length-1;n>=0;n--)e.replaceRange(e.doc.lineSeparator(),t[n].anchor,t[n].head,`+input`);t=e.listSelections();for(var r=0;r<t.length;r++)e.indentLine(t[r].from().line,null,!0);di(e)})},openLine:function(e){return e.replaceSelection(`
|
|
12
12
|
`,`start`)},toggleOverwrite:function(e){return e.toggleOverwrite()}};function ns(e,t){var n=Y(e.doc,t),r=nn(n);return r!=n&&(t=X(r)),$o(!0,e,r,t,1)}function rs(e,t){var n=Y(e.doc,t),r=rn(n);return r!=n&&(t=X(r)),$o(!0,e,n,t,-1)}function is(e,t){var n=ns(e,t.line),r=Y(e.doc,n.line),i=K(r,e.doc.direction);if(!i||i[0].level==0){var a=Math.max(n.ch,r.text.search(/\S/)),o=t.line==n.line&&t.ch<=a&&t.ch;return Z(n.line,o?0:a,n.sticky)}return n}function as(e,t,n){if(typeof t==`string`&&(t=ts[t],!t))return!1;e.display.input.ensurePolled();var r=e.display.shift,i=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),n&&(e.display.shift=!1),i=t(e)!=ae}finally{e.display.shift=r,e.state.suppressEdits=!1}return i}function os(e,t,n){for(var r=0;r<e.state.keyMaps.length;r++){var i=Go(t,e.state.keyMaps[r],n,e);if(i)return i}return e.options.extraKeys&&Go(t,e.options.extraKeys,n,e)||Go(t,e.options.keyMap,n,e)}var ss=new re;function cs(e,t,n,r){var i=e.state.keySeq;if(i){if(Ko(t))return`handled`;if(/\'$/.test(t)?e.state.keySeq=null:ss.set(50,function(){e.state.keySeq==i&&(e.state.keySeq=null,e.display.input.reset())}),ls(e,i+` `+t,n,r))return!0}return ls(e,t,n,r)}function ls(e,t,n,r){var i=os(e,t,r);return i==`multi`&&(e.state.keySeq=t),i==`handled`&&Nn(e,`keyHandled`,e,t,n),(i==`handled`||i==`multi`)&&(Me(n),Qr(e)),!!i}function us(e,t){var n=Jo(t,!0);return n?t.shiftKey&&!e.state.keySeq?cs(e,`Shift-`+n,t,function(t){return as(e,t,!0)})||cs(e,n,t,function(t){if(typeof t==`string`?/^go[A-Z]/.test(t):t.motion)return as(e,t)}):cs(e,n,t,function(t){return as(e,t)}):!1}function ds(e,t,n){return cs(e,`'`+n+`'`,t,function(t){return as(e,t,!0)})}var fs=null;function ps(e){var t=this;if(!(e.target&&e.target!=t.display.input.getField())&&(t.curOp.focus=N(ne(t)),!ke(t,e))){o&&s<11&&e.keyCode==27&&(e.returnValue=!1);var r=e.keyCode;t.display.shift=r==16||e.shiftKey;var i=us(t,e);f&&(fs=i?r:null,!i&&r==88&&!Ge&&(y?e.metaKey:e.ctrlKey)&&t.replaceSelection(``,null,`cut`)),n&&!y&&!i&&r==46&&e.shiftKey&&!e.ctrlKey&&document.execCommand&&document.execCommand(`cut`),r==18&&!/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)&&ms(t)}}function ms(e){var t=e.display.lineDiv;ee(t,`CodeMirror-crosshair`);function n(e){(e.keyCode==18||!e.altKey)&&(E(t,`CodeMirror-crosshair`),De(document,`keyup`,n),De(document,`mouseover`,n))}q(document,`keyup`,n),q(document,`mouseover`,n)}function hs(e){e.keyCode==16&&(this.doc.sel.shift=!1),ke(this,e)}function gs(e){var t=this;if(!(e.target&&e.target!=t.display.input.getField())&&!(Jn(t.display,e)||ke(t,e)||e.ctrlKey&&!e.altKey||y&&e.metaKey)){var n=e.keyCode,r=e.charCode;if(f&&n==fs){fs=null,Me(e);return}if(!(f&&(!e.which||e.which<10)&&us(t,e))){var i=String.fromCharCode(r??n);i!=`\b`&&(ds(t,e,i)||t.display.input.onKeyPress(e))}}}var _s=400,vs=function(e,t,n){this.time=e,this.pos=t,this.button=n};vs.prototype.compare=function(e,t,n){return this.time+_s>e&&Q(t,this.pos)==0&&n==this.button};var ys,bs;function xs(e,t){var n=+new Date;return bs&&bs.compare(n,e,t)?(ys=bs=null,`triple`):ys&&ys.compare(n,e,t)?(bs=new vs(n,e,t),ys=null,`double`):(ys=new vs(n,e,t),bs=null,`single`)}function Ss(e){var t=this,n=t.display;if(!(ke(t,e)||n.activeTouch&&n.input.supportsTouch())){if(n.input.ensurePolled(),n.shift=e.shiftKey,Jn(n,e)){c||(n.scroller.draggable=!1,setTimeout(function(){return n.scroller.draggable=!0},100));return}if(!js(t,e)){var r=zr(t,e),i=Le(e),a=r?xs(r,i):`single`;L(t).focus(),i==1&&t.state.selectingText&&t.state.selectingText(e),!(r&&Cs(t,i,r,a,e))&&(i==1?r?Ts(t,r,a,e):Ie(e)==n.scroller&&Me(e):i==2?(r&&za(t.doc,r),setTimeout(function(){return n.input.focus()},20)):i==3&&(w?t.display.input.onContextMenu(e):ei(t)))}}}function Cs(e,t,n,r,i){var a=`Click`;return r==`double`?a=`Double`+a:r==`triple`&&(a=`Triple`+a),a=(t==1?`Left`:t==2?`Middle`:`Right`)+a,cs(e,qo(a,i),i,function(t){if(typeof t==`string`&&(t=ts[t]),!t)return!1;var r=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),r=t(e,n)!=ae}finally{e.state.suppressEdits=!1}return r})}function ws(e,t,n){var r=e.getOption(`configureMouse`),i=r?r(e,t,n):{};return i.unit??=(b?n.shiftKey&&n.metaKey:n.altKey)?`rectangle`:t==`single`?`char`:t==`double`?`word`:`line`,(i.extend==null||e.doc.extend)&&(i.extend=e.doc.extend||n.shiftKey),i.addNew??=y?n.metaKey:n.ctrlKey,i.moveOnDrag??=!(y?n.altKey:n.ctrlKey),i}function Ts(e,t,n,r){o?setTimeout(R($r,e),0):e.curOp.focus=N(ne(e));var i=ws(e,n,r),a=e.doc.sel,s;e.options.dragDrop&&Re&&!e.isReadOnly()&&n==`single`&&(s=a.contains(t))>-1&&(Q((s=a.ranges[s]).from(),t)<0||t.xRel>0)&&(Q(s.to(),t)>0||t.xRel<0)?Es(e,r,t,i):Os(e,r,t,i)}function Es(e,t,n,r){var i=e.display,a=!1,l=Ii(e,function(t){c&&(i.scroller.draggable=!1),e.state.draggingText=!1,e.state.delayingBlurEvent&&(e.hasFocus()?e.state.delayingBlurEvent=!1:ei(e)),De(i.wrapper.ownerDocument,`mouseup`,l),De(i.wrapper.ownerDocument,`mousemove`,u),De(i.scroller,`dragstart`,d),De(i.scroller,`drop`,l),a||(Me(t),r.addNew||za(e.doc,n,null,null,r.extend),c&&!p||o&&s==9?setTimeout(function(){i.wrapper.ownerDocument.body.focus({preventScroll:!0}),i.input.focus()},20):i.input.focus())}),u=function(e){a||=Math.abs(t.clientX-e.clientX)+Math.abs(t.clientY-e.clientY)>=10},d=function(){return a=!0};c&&(i.scroller.draggable=!0),e.state.draggingText=l,l.copy=!r.moveOnDrag,q(i.wrapper.ownerDocument,`mouseup`,l),q(i.wrapper.ownerDocument,`mousemove`,u),q(i.scroller,`dragstart`,d),q(i.scroller,`drop`,l),e.state.delayingBlurEvent=!0,setTimeout(function(){return i.input.focus()},20),i.scroller.dragDrop&&i.scroller.dragDrop()}function Ds(e,t,n){if(n==`char`)return new la(t,t);if(n==`word`)return e.findWordAt(t);if(n==`line`)return new la(Z(t.line,0),$(e.doc,Z(t.line+1,0)));var r=n(e,t);return new la(r.from,r.to)}function Os(e,t,n,r){o&&ei(e);var i=e.display,a=e.doc;Me(t);var s,c,l=a.sel,u=l.ranges;if(r.addNew&&!r.extend?(c=a.sel.contains(n),s=c>-1?u[c]:new la(n,n)):(s=a.sel.primary(),c=a.sel.primIndex),r.unit==`rectangle`)r.addNew||(s=new la(n,n)),n=zr(e,t,!0,!0),c=-1;else{var d=Ds(e,n,r.unit);s=r.extend?Ra(s,d.anchor,d.head,r.extend):d}r.addNew?c==-1?(c=u.length,Ga(a,ua(e,u.concat([s]),c),{scroll:!1,origin:`*mouse`})):u.length>1&&u[c].empty()&&r.unit==`char`&&!r.extend?(Ga(a,ua(e,u.slice(0,c).concat(u.slice(c+1)),0),{scroll:!1,origin:`*mouse`}),l=a.sel):Va(a,c,s,H):(c=0,Ga(a,new ca([s],0),H),l=a.sel);var f=n;function p(t){if(Q(f,t)!=0)if(f=t,r.unit==`rectangle`){for(var i=[],o=e.options.tabSize,u=B(Y(a,n.line).text,n.ch,o),d=B(Y(a,t.line).text,t.ch,o),p=Math.min(u,d),m=Math.max(u,d),h=Math.min(n.line,t.line),g=Math.min(e.lastLine(),Math.max(n.line,t.line));h<=g;h++){var _=Y(a,h).text,v=se(_,p,o);p==m?i.push(new la(Z(h,v),Z(h,v))):_.length>v&&i.push(new la(Z(h,v),Z(h,se(_,m,o))))}i.length||i.push(new la(n,n)),Ga(a,ua(e,l.ranges.slice(0,c).concat(i),c),{origin:`*mouse`,scroll:!1}),e.scrollIntoView(t)}else{var y=s,b=Ds(e,t,r.unit),x=y.anchor,S;Q(b.anchor,x)>0?(S=b.head,x=ht(y.from(),b.anchor)):(S=b.anchor,x=mt(y.to(),b.head));var C=l.ranges.slice(0);C[c]=ks(e,new la($(a,x),S)),Ga(a,ua(e,C,c),H)}}var m=i.wrapper.getBoundingClientRect(),h=0;function g(t){var n=++h,o=zr(e,t,!0,r.unit==`rectangle`);if(o)if(Q(o,f)!=0){e.curOp.focus=N(ne(e)),p(o);var s=ai(i,a);(o.line>=s.to||o.line<s.from)&&setTimeout(Ii(e,function(){h==n&&g(t)}),150)}else{var c=t.clientY<m.top?-20:t.clientY>m.bottom?20:0;c&&setTimeout(Ii(e,function(){h==n&&(i.scroller.scrollTop+=c,g(t))}),50)}}function _(t){e.state.selectingText=!1,h=1/0,t&&(Me(t),i.input.focus()),De(i.wrapper.ownerDocument,`mousemove`,v),De(i.wrapper.ownerDocument,`mouseup`,y),a.history.lastSelOrigin=null}var v=Ii(e,function(e){e.buttons===0||!Le(e)?_(e):g(e)}),y=Ii(e,_);e.state.selectingText=y,q(i.wrapper.ownerDocument,`mousemove`,v),q(i.wrapper.ownerDocument,`mouseup`,y)}function ks(e,t){var n=t.anchor,r=t.head,i=Y(e.doc,n.line);if(Q(n,r)==0&&n.sticky==r.sticky)return t;var a=K(i);if(!a)return t;var o=Ce(a,n.ch,n.sticky),s=a[o];if(s.from!=n.ch&&s.to!=n.ch)return t;var c=o+(s.from==n.ch==(s.level!=1)?0:1);if(c==0||c==a.length)return t;var l;if(r.line!=n.line)l=(r.line-n.line)*(e.doc.direction==`ltr`?1:-1)>0;else{var u=Ce(a,r.ch,r.sticky),d=u-o||(r.ch-n.ch)*(s.level==1?-1:1);l=u==c-1||u==c?d<0:d>0}var f=a[c+(l?-1:0)],p=l==(f.level==1),m=p?f.from:f.to,h=p?`after`:`before`;return n.ch==m&&n.sticky==h?t:new la(new Z(n.line,m,h),r)}function As(e,t,n,r){var i,a;if(t.touches)i=t.touches[0].clientX,a=t.touches[0].clientY;else try{i=t.clientX,a=t.clientY}catch{return!1}if(i>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;r&&Me(t);var o=e.display,s=o.lineDiv.getBoundingClientRect();if(a>s.bottom||!J(e,n))return Pe(t);a-=s.top-o.viewOffset;for(var c=0;c<e.display.gutterSpecs.length;++c){var l=o.gutters.childNodes[c];if(l&&l.getBoundingClientRect().right>=i){var u=lt(e.doc,a),d=e.display.gutterSpecs[c];return Oe(e,n,e,u,d.className,t),Pe(t)}}}function js(e,t){return As(e,t,`gutterClick`,!0)}function Ms(e,t){Jn(e.display,t)||Ns(e,t)||ke(e,t,`contextmenu`)||w||e.display.input.onContextMenu(t)}function Ns(e,t){return J(e,`gutterContextMenu`)?As(e,t,`gutterContextMenu`,!1):!1}function Ps(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,``)+e.options.theme.replace(/(^|\s)\s*/g,` cm-s-`),hr(e)}var Fs={toString:function(){return`CodeMirror.Init`}},Is={},Ls={};function Rs(e){var t=e.optionHandlers;function n(n,r,i,a){e.defaults[n]=r,i&&(t[n]=a?function(e,t,n){n!=Fs&&i(e,t,n)}:i)}e.defineOption=n,e.Init=Fs,n(`value`,``,function(e,t){return e.setValue(t)},!0),n(`mode`,null,function(e,t){e.doc.modeOption=t,_a(e)},!0),n(`indentUnit`,2,_a,!0),n(`indentWithTabs`,!1),n(`smartIndent`,!0),n(`tabSize`,4,function(e){va(e),hr(e),Vr(e)},!0),n(`lineSeparator`,null,function(e,t){if(e.doc.lineSep=t,t){var n=[],r=e.doc.first;e.doc.iter(function(e){for(var i=0;;){var a=e.text.indexOf(t,i);if(a==-1)break;i=a+t.length,n.push(Z(r,a))}r++});for(var i=n.length-1;i>=0;i--)so(e.doc,t,n[i],Z(n[i].line,n[i].ch+t.length))}}),n(`specialChars`,/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b\u200e\u200f\u2028\u2029\u202d\u202e\u2066\u2067\u2069\ufeff\ufff9-\ufffc]/g,function(e,t,n){e.state.specialChars=RegExp(t.source+(t.test(` `)?``:`| `),`g`),n!=Fs&&e.refresh()}),n(`specialCharPlaceholder`,bn,function(e){return e.refresh()},!0),n(`electricChars`,!0),n(`inputStyle`,v?`contenteditable`:`textarea`,function(){throw Error(`inputStyle can not (yet) be changed in a running editor`)},!0),n(`spellcheck`,!1,function(e,t){return e.getInputField().spellcheck=t},!0),n(`autocorrect`,!1,function(e,t){return e.getInputField().autocorrect=t},!0),n(`autocapitalize`,!1,function(e,t){return e.getInputField().autocapitalize=t},!0),n(`rtlMoveVisually`,!x),n(`wholeLineUpdateBefore`,!0),n(`theme`,`default`,function(e){Ps(e),ta(e)},!0),n(`keyMap`,`default`,function(e,t,n){var r=Yo(t),i=n!=Fs&&Yo(n);i&&i.detach&&i.detach(e,r),r.attach&&r.attach(e,i||null)}),n(`extraKeys`,null),n(`configureMouse`,null),n(`lineWrapping`,!1,Bs,!0),n(`gutters`,[],function(e,t){e.display.gutterSpecs=$i(t,e.options.lineNumbers),ta(e)},!0),n(`fixedGutter`,!0,function(e,t){e.display.gutters.style.left=t?Ir(e.display)+`px`:`0`,e.refresh()},!0),n(`coverGutterNextToScrollbar`,!1,function(e){return Si(e)},!0),n(`scrollbarStyle`,`native`,function(e){Ti(e),Si(e),e.display.scrollbars.setScrollTop(e.doc.scrollTop),e.display.scrollbars.setScrollLeft(e.doc.scrollLeft)},!0),n(`lineNumbers`,!1,function(e,t){e.display.gutterSpecs=$i(e.options.gutters,t),ta(e)},!0),n(`firstLineNumber`,1,ta,!0),n(`lineNumberFormatter`,function(e){return e},ta,!0),n(`showCursorWhenSelecting`,!1,qr,!0),n(`resetSelectionOnContextMenu`,!0),n(`lineWiseCopyCut`,!0),n(`pasteLinesPerSelection`,!0),n(`selectionsMayTouch`,!1),n(`readOnly`,!1,function(e,t){t==`nocursor`&&(ni(e),e.display.input.blur()),e.display.input.readOnlyChanged(t)}),n(`screenReaderLabel`,null,function(e,t){t=t===``?null:t,e.display.input.screenReaderLabelChanged(t)}),n(`disableInput`,!1,function(e,t){t||e.display.input.reset()},!0),n(`dragDrop`,!0,zs),n(`allowDropFileTypes`,null),n(`cursorBlinkRate`,530),n(`cursorScrollMargin`,0),n(`cursorHeight`,1,qr,!0),n(`singleCursorHeightPerLine`,!0,qr,!0),n(`workTime`,100),n(`workDelay`,100),n(`flattenSpans`,!0,va,!0),n(`addModeClass`,!1,va,!0),n(`pollInterval`,100),n(`undoDepth`,200,function(e,t){return e.doc.history.undoDepth=t}),n(`historyEventDelay`,1250),n(`viewportMargin`,10,function(e){return e.refresh()},!0),n(`maxHighlightLength`,1e4,va,!0),n(`moveInputWithCursor`,!0,function(e,t){t||e.display.input.resetPosition()}),n(`tabindex`,null,function(e,t){return e.display.input.getField().tabIndex=t||``}),n(`autofocus`,null),n(`direction`,`ltr`,function(e,t){return e.doc.setDirection(t)},!0),n(`phrases`,null)}function zs(e,t,n){if(!t!=!(n&&n!=Fs)){var r=e.display.dragFunctions,i=t?q:De;i(e.display.scroller,`dragstart`,r.start),i(e.display.scroller,`dragenter`,r.enter),i(e.display.scroller,`dragover`,r.over),i(e.display.scroller,`dragleave`,r.leave),i(e.display.scroller,`drop`,r.drop)}}function Bs(e){e.options.lineWrapping?(ee(e.display.wrapper,`CodeMirror-wrap`),e.display.sizer.style.minWidth=``,e.display.sizerWidth=null):(E(e.display.wrapper,`CodeMirror-wrap`),fn(e)),Rr(e),Vr(e),hr(e),setTimeout(function(){return Si(e)},100)}function Vs(e,t){var n=this;if(!(this instanceof Vs))return new Vs(e,t);this.options=t=t?z(t):{},z(Is,t,!1);var r=t.value;typeof r==`string`?r=new Do(r,t.mode,null,t.lineSeparator,t.direction):t.mode&&(r.modeOption=t.mode),this.doc=r;var i=new Vs.inputStyles[t.inputStyle](this),a=this.display=new na(e,r,i,t);for(var l in a.wrapper.CodeMirror=this,Ps(this),t.lineWrapping&&(this.display.wrapper.className+=` CodeMirror-wrap`),Ti(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:-1,cutIncoming:-1,selectingText:!1,draggingText:!1,highlight:new re,keySeq:null,specialChars:null},t.autofocus&&!v&&a.input.focus(),o&&s<11&&setTimeout(function(){return n.display.input.reset(!0)},20),Hs(this),Fo(),Di(this),this.curOp.forceUpdate=!0,Sa(this,r),t.autofocus&&!v||this.hasFocus()?setTimeout(function(){n.hasFocus()&&!n.state.focused&&ti(n)},20):ni(this),Ls)Ls.hasOwnProperty(l)&&Ls[l](this,t[l],Fs);Qi(this),t.finishInit&&t.finishInit(this);for(var u=0;u<Us.length;++u)Us[u](this);Oi(this),c&&t.lineWrapping&&getComputedStyle(a.lineDiv).textRendering==`optimizelegibility`&&(a.lineDiv.style.textRendering=`auto`)}Vs.defaults=Is,Vs.optionHandlers=Ls;function Hs(e){var t=e.display;q(t.scroller,`mousedown`,Ii(e,Ss)),o&&s<11?q(t.scroller,`dblclick`,Ii(e,function(t){if(!ke(e,t)){var n=zr(e,t);if(!(!n||js(e,t)||Jn(e.display,t))){Me(t);var r=e.findWordAt(n);za(e.doc,r.anchor,r.head)}}})):q(t.scroller,`dblclick`,function(t){return ke(e,t)||Me(t)}),q(t.scroller,`contextmenu`,function(t){return Ms(e,t)}),q(t.input.getField(),`contextmenu`,function(n){t.scroller.contains(n.target)||Ms(e,n)});var n,r={end:0};function i(){t.activeTouch&&(n=setTimeout(function(){return t.activeTouch=null},1e3),r=t.activeTouch,r.end=+new Date)}function a(e){if(e.touches.length!=1)return!1;var t=e.touches[0];return t.radiusX<=1&&t.radiusY<=1}function c(e,t){if(t.left==null)return!0;var n=t.left-e.left,r=t.top-e.top;return n*n+r*r>400}q(t.scroller,`touchstart`,function(i){if(!ke(e,i)&&!a(i)&&!js(e,i)){t.input.ensurePolled(),clearTimeout(n);var o=+new Date;t.activeTouch={start:o,moved:!1,prev:o-r.end<=300?r:null},i.touches.length==1&&(t.activeTouch.left=i.touches[0].pageX,t.activeTouch.top=i.touches[0].pageY)}}),q(t.scroller,`touchmove`,function(){t.activeTouch&&(t.activeTouch.moved=!0)}),q(t.scroller,`touchend`,function(n){var r=t.activeTouch;if(r&&!Jn(t,n)&&r.left!=null&&!r.moved&&new Date-r.start<300){var a=e.coordsChar(t.activeTouch,`page`),o=!r.prev||c(r,r.prev)?new la(a,a):!r.prev.prev||c(r,r.prev.prev)?e.findWordAt(a):new la(Z(a.line,0),$(e.doc,Z(a.line+1,0)));e.setSelection(o.anchor,o.head),e.focus(),Me(n)}i()}),q(t.scroller,`touchcancel`,i),q(t.scroller,`scroll`,function(){t.scroller.clientHeight&&(gi(e,t.scroller.scrollTop),vi(e,t.scroller.scrollLeft,!0),Oe(e,`scroll`,e))}),q(t.scroller,`mousewheel`,function(t){return sa(e,t)}),q(t.scroller,`DOMMouseScroll`,function(t){return sa(e,t)}),q(t.wrapper,`scroll`,function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(t){ke(e,t)||Fe(t)},over:function(t){ke(e,t)||(jo(e,t),Fe(t))},start:function(t){return Ao(e,t)},drop:Ii(e,ko),leave:function(t){ke(e,t)||Mo(e)}};var l=t.input.getField();q(l,`keyup`,function(t){return hs.call(e,t)}),q(l,`keydown`,Ii(e,ps)),q(l,`keypress`,Ii(e,gs)),q(l,`focus`,function(t){return ti(e,t)}),q(l,`blur`,function(t){return ni(e,t)})}var Us=[];Vs.defineInitHook=function(e){return Us.push(e)};function Ws(e,t,n,r){var i=e.doc,a;n??=`add`,n==`smart`&&(i.mode.indent?a=Ct(e,t).state:n=`prev`);var o=e.options.tabSize,s=Y(i,t),c=B(s.text,null,o);s.stateAfter&&=null;var l=s.text.match(/^\s*/)[0],u;if(!r&&!/\S/.test(s.text))u=0,n=`not`;else if(n==`smart`&&(u=i.mode.indent(a,s.text.slice(l.length),s.text),u==ae||u>150)){if(!r)return;n=`prev`}n==`prev`?u=t>i.first?B(Y(i,t-1).text,null,o):0:n==`add`?u=c+e.options.indentUnit:n==`subtract`?u=c-e.options.indentUnit:typeof n==`number`&&(u=c+n),u=Math.max(0,u);var d=``,f=0;if(e.options.indentWithTabs)for(var p=Math.floor(u/o);p;--p)f+=o,d+=` `;if(f<u&&(d+=ce(u-f)),d!=l)return so(i,d,Z(t,0),Z(t,l.length),`+input`),s.stateAfter=null,!0;for(var m=0;m<i.sel.ranges.length;m++){var h=i.sel.ranges[m];if(h.head.line==t&&h.head.ch<l.length){var g=Z(t,l.length);Va(i,m,new la(g,g));break}}}var Gs=null;function Ks(e){Gs=e}function qs(e,t,n,r,i){var a=e.doc;e.display.shift=!1,r||=a.sel;var o=new Date-200,s=i==`paste`||e.state.pasteIncoming>o,c=Ue(t),l=null;if(s&&r.ranges.length>1)if(Gs&&Gs.text.join(`
|
|
13
13
|
`)==t){if(r.ranges.length%Gs.text.length==0){l=[];for(var u=0;u<Gs.text.length;u++)l.push(a.splitLines(Gs.text[u]))}}else c.length==r.ranges.length&&e.options.pasteLinesPerSelection&&(l=le(c,function(e){return[e]}));for(var d=e.curOp.updateInput,f=r.ranges.length-1;f>=0;f--){var p=r.ranges[f],m=p.from(),h=p.to();p.empty()&&(n&&n>0?m=Z(m.line,m.ch-n):e.state.overwrite&&!s?h=Z(h.line,Math.min(Y(a,h.line).text.length,h.ch+G(c).length)):s&&Gs&&Gs.lineWise&&Gs.text.join(`
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{At as e,Et as t,Ht as n,Pt as r,S as i,Vt as a,Yt as o,an as s,at as c,ct as l,dt as u,ht as d,lt as f,mt as p,nn as m,pt as h,st as g,tn as _,ut as v,y}from"#entry";import{t as b}from"./s37iQDTO.js";import{t as x}from"./DJFg8Mze.js";import{r as S,t as C}from"./EZmie0b_.js";import{t as w}from"./kgaOZT0B.js";import{t as T}from"./CEj_FX93.js";var E={flex:`~ col gap-2`},D={flex:`~ gap-1 items-center`,"font-mono":``,op50:``,"text-sm":``},O={"font-mono":``,"font-sm":``},k={key:0,flex:`~ gap-1 items-center`},A={key:0,op50:``,"text-xs":``,border:`~ base rounded-md`,px1:``,"font-mono":``},j=d({__name:`SessionSelector`,props:{sessionMode:{},sessions:{},selectedSessionIds:{},selectedSessions:{}},emits:[`select`],setup(i,{emit:a}){let o=i,d=a;function y(e){return T(e.meta.inputs[0]?.filename??``,e.meta.cwd).path}let x=g(()=>{let e=o.selectedSessions?.[0];return e?y(e):``});function j(e){return x.value&&x.value!==y(e)}function M(e){o.sessionMode===`compare`&&!j(e)&&d(`select`,e)}return(a,o)=>{let d=C,g=S,y=w;return t(),u(`div`,E,[(t(!0),u(c,null,e(i.sessions,e=>(t(),u(`div`,{key:e.id,flex:`~ row gap-2`,relative:``},[(t(),f(r(i.sessionMode===`list`?_(b):`div`),{to:`/session/${e.id}`,border:`~ rounded-md`,class:m(i.sessionMode===`list`?[`hover:bg-active`,`border-base`]:[i.selectedSessionIds.includes(e.id)?`border-active`:`border-base`,j(e)||i.selectedSessions.length===2&&!i.selectedSessionIds.includes(e.id)?`op50`:`hover:bg-active`]),flex:`~ col gap-1`,px4:``,py3:``,"w-full":``,onClick:t=>M(e)},{default:n(()=>[l(`div`,D,[o[0]||=l(`div`,{"i-ph-hash-duotone":``},null,-1),h(` `+s(e.id),1)]),l(`div`,O,s(e.meta.cwd),1),e.meta.inputs[0]?(t(),u(`div`,k,[p(d,{id:e.meta.inputs[0].filename,cwd:e.meta.cwd},null,8,[`id`,`cwd`]),p(g,{text:e.meta.inputs[0].name||`entry`},null,8,[`text`]),e.meta.inputs.length>1?(t(),u(`span`,A,` +`+s(e.meta.inputs.length-1),1)):v(``,!0)])):v(``,!0),p(y,{timestamp:e.timestamp,pt2:``,"text-sm":``,op50:``},null,8,[`timestamp`])]),_:2},1032,[`to`,`class`,`onClick`]))]))),128))])}}}),M=Object.assign(j,{__name:`PanelSessionSelector`}),N={p4:``,flex:`~ col gap-4`,"items-center":``,"justify-center":``,relative:``},P={key:0,op50:``},F={key:1,op50:``},I={relative:``,flex:`~ col gap3 items-center`},L={key:2,fixed:``,"top-5":``,"right-5":``,flex:`~ col gap2`},R={flex:`~ row justify-around`,w20:``,h8:``,border:`~ base rounded-8`,"of-hidden":``},z=[`title`,`onClick`],B={key:3,fixed:``,"bottom-5":``,"right-5":``,border:`~ base rounded-2`,w100:``,"max-lg:w85":``,"bg-glass":``,"z-panel-content":``},V={flex:`~ justify-center`,p2:``},H={key:1,op80:``,"text-sm":``},U=d({__name:`index`,async setup(r){let d,S,C=o(`list`),w=[{label:`Session List`,icon:`i-ph-list-bullets-duotone`,value:`list`},{label:`Session Compare`,icon:`i-ph-git-diff-duotone`,value:`compare`}],T=o([]),E=g(()=>T.value.map(e=>e.id).sort()),D=g(()=>[...T.value].sort((e,t)=>e.timestamp-t.timestamp).map((e,t)=>({...e,createdAt:new Date(e.timestamp),title:t===0?`Session A`:`Session B`}))),O=y(),k=([d,S]=a(()=>O.value.call(`vite:rolldown:list-sessions`)),d=await d,S(),d);function A(e){E.value.includes(e.id)?T.value=T.value.filter(t=>t.id!==e.id):T.value=[...T.value,e]}return(r,a)=>{let o=i,d=M,g=x,y=b;return t(),u(`div`,N,[p(o),_(k).length?(t(),u(`p`,P,s(C.value===`list`?`Select a build session to get started:`:`Select 2 build sessions to compare:`),1)):(t(),u(`p`,F,` No sessions yet, run a build to get started. `)),l(`div`,I,[p(d,{"session-mode":C.value,sessions:_(k),"selected-session-ids":E.value,"selected-sessions":T.value,onSelect:A},null,8,[`session-mode`,`sessions`,`selected-session-ids`,`selected-sessions`])]),_(k).length?(t(),u(`div`,L,[l(`div`,R,[(t(),u(c,null,e(w,e=>l(`button`,{key:e.value,title:e.label,"flex-1":``,op50:``,flex:`~ items-center justify-center`,class:m({"bg-active text-base op100!":C.value===e.value}),hover:`bg-active text-base op100!`,onClick:t=>C.value=e.value},[l(`span`,{class:m([e.icon,`text-sm`])},null,2)],10,z)),64))])])):v(``,!0),T.value.length>0&&C.value===`compare`?(t(),u(`div`,B,[p(g,{sessions:D.value,class:`flex-col gap0 [&>div]:border-none! [&>first-child]:border-b!`},null,8,[`sessions`]),l(`div`,V,[T.value.length===2?(t(),f(y,{key:0,tag:`button`,to:`/compare/${E.value.join(`,`)}`,"btn-action":``,"rounded-8":``,"text-3":``,flex:`~ justify-center`,w30:``,h8:``},{default:n(()=>[...a[0]||=[h(` Compare `,-1)]]),_:1},8,[`to`])):(t(),u(`div`,H,` Select one more session to compare. `))])])):v(``,!0)])}}});export{U as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"id":"
|
|
1
|
+
{"id":"d61b2fbd-b4b2-4f0d-9b46-a34c82edf808","timestamp":1767771516281}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"id":"d61b2fbd-b4b2-4f0d-9b46-a34c82edf808","timestamp":1767771516281,"matcher":{"static":{"/":{"prerender":true},"/200.html":{"prerender":true},"/404.html":{"prerender":true}},"wildcard":{},"dynamic":{}},"prerendered":[]}
|