@i14ks/ccv 0.9.5 → 0.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundle/ccv.mjs +64 -0
- package/package.json +1 -1
- package/web/assets/{codemirror-BrML4DhQ.js → codemirror-DKsnpugS.js} +1 -1
- package/web/assets/{index-CIOcaugJ.js → index-AUibZMHd.js} +1 -1
- package/web/assets/{index-BH51XSCv.js → index-B7Kjuy7B.js} +1 -1
- package/web/assets/{index-BMlMiQH4.js → index-BCiq-pRA.js} +1 -1
- package/web/assets/index-BVL_B_hC.js +132 -0
- package/web/assets/{index-kYR8PJFy.js → index-BaxFm2-f.js} +1 -1
- package/web/assets/{index-DueUeK4W.js → index-BwqyDurx.js} +1 -1
- package/web/assets/{index-CzJCmwIj.js → index-C3yVGgV2.js} +1 -1
- package/web/assets/{index-MEYLoAjh.js → index-CNmvdMxt.js} +1 -1
- package/web/assets/{index-BMtQHCPD.js → index-CT4Ig6AX.js} +1 -1
- package/web/assets/{index-CJJjf7QW.js → index-CZMbzOzb.js} +1 -1
- package/web/assets/{index-MtnHR_Fv.js → index-CiZ3hw4e.js} +1 -1
- package/web/assets/{index-B11vIedv.js → index-ClY-NTKp.js} +1 -1
- package/web/assets/{index-ZDWxlF_B.js → index-Cw4Jg8_d.js} +1 -1
- package/web/assets/{index-ZQEm-9IM.js → index-MFoRbG31.js} +1 -1
- package/web/assets/{index-BZMuV7wL.js → index-NZmn_bzd.js} +1 -1
- package/web/assets/index-c0zvhlqR.css +1 -0
- package/web/assets/{index-BmDgU61K.js → index-cSZKYcZu.js} +1 -1
- package/web/assets/{index-BCuOAg0C.js → index-nV6tsVmQ.js} +1 -1
- package/web/assets/{index-Cg-P0Yp1.js → index-u3kUuJkV.js} +1 -1
- package/web/assets/{index-TS7xklzI.js → index-vmz_RdEe.js} +1 -1
- package/web/assets/{index-BnX4KThz.js → index-yzGIJ5xe.js} +1 -1
- package/web/index.html +2 -2
- package/web/assets/index-D0UlXcXr.css +0 -1
- package/web/assets/index-DhmD70Mu.js +0 -132
|
@@ -1 +1 @@
|
|
|
1
|
-
import{EditorSelection as h,Text as ke,findClusterBreak as T,StateField as tt,Transaction as K,Facet as Ae,Annotation as Be,combineConfig as nt,StateEffect as Se,ChangeSet as rt,ChangeDesc as ot,countColumn as ee,CharCategory as D}from"./index-BHot-lnj.js";import{E as O,o as lt}from"./index-891wE-Rj.js";import{I as Ce,g as De,c as G,e as te,m as E,h as j,j as st}from"./index-DueUeK4W.js";import{N as Q}from"./index-DhmD70Mu.js";const ct=e=>{let{state:t}=e,n=t.doc.lineAt(t.selection.main.from),r=ne(e.state,n.from);return r.line?it(e):r.block?ft(e):!1};function L(e,t){return({state:n,dispatch:r})=>{if(n.readOnly)return!1;let l=e(t,n);return l?(r(n.update(l)),!0):!1}}const it=L(re,0),An=L(re,1),Bn=L(re,2),ut=L(V,0),Sn=L(V,1),Cn=L(V,2),ft=L((e,t)=>V(e,t,ht(t)),0);function ne(e,t){let n=e.languageDataAt("commentTokens",t,1);return n.length?n[0]:{}}const v=50;function at(e,{open:t,close:n},r,l){let o=e.sliceDoc(r-v,r),s=e.sliceDoc(l,l+v),c=/\s*$/.exec(o)[0].length,i=/^\s*/.exec(s)[0].length,f=o.length-c;if(o.slice(f-t.length,f)==t&&s.slice(i,i+n.length)==n)return{open:{pos:r-c,margin:c&&1},close:{pos:l+i,margin:i&&1}};let u,a;l-r<=2*v?u=a=e.sliceDoc(r,l):(u=e.sliceDoc(r,r+v),a=e.sliceDoc(l-v,l));let d=/^\s*/.exec(u)[0].length,B=/\s*$/.exec(a)[0].length,k=a.length-B-n.length;return u.slice(d,d+t.length)==t&&a.slice(k,k+n.length)==n?{open:{pos:r+d+t.length,margin:/\s/.test(u.charAt(d+t.length))?1:0},close:{pos:l-B-n.length,margin:/\s/.test(a.charAt(k-1))?1:0}}:null}function ht(e){let t=[];for(let n of e.selection.ranges){let r=e.doc.lineAt(n.from),l=n.to<=r.to?r:e.doc.lineAt(n.to);l.from>r.from&&l.from==n.to&&(l=n.to==r.to+1?r:e.doc.lineAt(n.to-1));let o=t.length-1;o>=0&&t[o].to>r.from?t[o].to=l.to:t.push({from:r.from+/^\s*/.exec(r.text)[0].length,to:l.to})}return t}function V(e,t,n=t.selection.ranges){let r=n.map(o=>ne(t,o.from).block);if(!r.every(o=>o))return null;let l=n.map((o,s)=>at(t,r[s],o.from,o.to));if(e!=2&&!l.every(o=>o))return{changes:t.changes(n.map((o,s)=>l[s]?[]:[{from:o.from,insert:r[s].open+" "},{from:o.to,insert:" "+r[s].close}]))};if(e!=1&&l.some(o=>o)){let o=[];for(let s=0,c;s<l.length;s++)if(c=l[s]){let i=r[s],{open:f,close:u}=c;o.push({from:f.pos-i.open.length,to:f.pos+f.margin},{from:u.pos-u.margin,to:u.pos+i.close.length})}return{changes:o}}return null}function re(e,t,n=t.selection.ranges){let r=[],l=-1;e:for(let{from:o,to:s}of n){let c=r.length,i=1e9,f;for(let u=o;u<=s;){let a=t.doc.lineAt(u);if(f==null&&(f=ne(t,a.from).line,!f))continue e;if(a.from>l&&(o==s||s>a.from)){l=a.from;let d=/^\s*/.exec(a.text)[0].length,B=d==a.length,k=a.text.slice(d,d+f.length)==f?d:-1;d<a.text.length&&d<i&&(i=d),r.push({line:a,comment:k,token:f,indent:d,empty:B,single:!1})}u=a.to+1}if(i<1e9)for(let u=c;u<r.length;u++)r[u].indent<r[u].line.text.length&&(r[u].indent=i);r.length==c+1&&(r[c].single=!0)}if(e!=2&&r.some(o=>o.comment<0&&(!o.empty||o.single))){let o=[];for(let{line:c,token:i,indent:f,empty:u,single:a}of r)(a||!u)&&o.push({from:c.from+f,insert:i+" "});let s=t.changes(o);return{changes:s,selection:t.selection.map(s,1)}}else if(e!=1&&r.some(o=>o.comment>=0)){let o=[];for(let{line:s,comment:c,token:i}of r)if(c>=0){let f=s.from+c,u=f+i.length;s.text[u-s.from]==" "&&u++,o.push({from:f,to:u})}return{changes:o}}return null}const X=Be.define(),dt=Be.define(),mt=Ae.define(),xe=Ae.define({combine(e){return nt(e,{minDepth:100,newGroupDelay:500,joinToEvent:(t,n)=>n},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(t,n)=>(r,l)=>t(r,l)||n(r,l)})}}),N=tt.define({create(){return C.empty},update(e,t){let n=t.state.facet(xe),r=t.annotation(X);if(r){let i=g.fromTransaction(t,r.selection),f=r.side,u=f==0?e.undone:e.done;return i?u=U(u,u.length,n.minDepth,i):u=Ee(u,t.startState.selection),new C(f==0?r.rest:u,f==0?u:r.rest)}let l=t.annotation(dt);if((l=="full"||l=="before")&&(e=e.isolate()),t.annotation(K.addToHistory)===!1)return t.changes.empty?e:e.addMapping(t.changes.desc);let o=g.fromTransaction(t),s=t.annotation(K.time),c=t.annotation(K.userEvent);return o?e=e.addChanges(o,s,c,n,t):t.selection&&(e=e.addSelection(t.startState.selection,s,c,n.newGroupDelay)),(l=="full"||l=="after")&&(e=e.isolate()),e},toJSON(e){return{done:e.done.map(t=>t.toJSON()),undone:e.undone.map(t=>t.toJSON())}},fromJSON(e){return new C(e.done.map(g.fromJSON),e.undone.map(g.fromJSON))}});function Dn(e={}){return[N,xe.of(e),O.domEventHandlers({beforeinput(t,n){let r=t.inputType=="historyUndo"?Le:t.inputType=="historyRedo"?Y:null;return r?(t.preventDefault(),r(n)):!1}})]}const xn=N;function P(e,t){return function({state:n,dispatch:r}){if(!t&&n.readOnly)return!1;let l=n.field(N,!1);if(!l)return!1;let o=l.pop(e,n,t);return o?(r(o),!0):!1}}const Le=P(0,!1),Y=P(1,!1),pt=P(0,!0),gt=P(1,!0);function Me(e){return function(t){let n=t.field(N,!1);if(!n)return 0;let r=e==0?n.done:n.undone;return r.length-(r.length&&!r[0].changes?1:0)}}const Ln=Me(0),Mn=Me(1);class g{constructor(t,n,r,l,o){this.changes=t,this.effects=n,this.mapped=r,this.startSelection=l,this.selectionsAfter=o}setSelAfter(t){return new g(this.changes,this.effects,this.mapped,this.startSelection,t)}toJSON(){var t,n,r;return{changes:(t=this.changes)===null||t===void 0?void 0:t.toJSON(),mapped:(n=this.mapped)===null||n===void 0?void 0:n.toJSON(),startSelection:(r=this.startSelection)===null||r===void 0?void 0:r.toJSON(),selectionsAfter:this.selectionsAfter.map(l=>l.toJSON())}}static fromJSON(t){return new g(t.changes&&rt.fromJSON(t.changes),[],t.mapped&&ot.fromJSON(t.mapped),t.startSelection&&h.fromJSON(t.startSelection),t.selectionsAfter.map(h.fromJSON))}static fromTransaction(t,n){let r=A;for(let l of t.startState.facet(mt)){let o=l(t);o.length&&(r=r.concat(o))}return!r.length&&t.changes.empty?null:new g(t.changes.invert(t.startState.doc),r,void 0,n||t.startState.selection,A)}static selection(t){return new g(void 0,A,void 0,void 0,t)}}function U(e,t,n,r){let l=t+1>n+20?t-n-1:0,o=e.slice(l,t);return o.push(r),o}function yt(e,t){let n=[],r=!1;return e.iterChangedRanges((l,o)=>n.push(l,o)),t.iterChangedRanges((l,o,s,c)=>{for(let i=0;i<n.length;){let f=n[i++],u=n[i++];c>=f&&s<=u&&(r=!0)}}),r}function kt(e,t){return e.ranges.length==t.ranges.length&&e.ranges.filter((n,r)=>n.empty!=t.ranges[r].empty).length===0}function be(e,t){return e.length?t.length?e.concat(t):e:t}const A=[],At=200;function Ee(e,t){if(e.length){let n=e[e.length-1],r=n.selectionsAfter.slice(Math.max(0,n.selectionsAfter.length-At));return r.length&&r[r.length-1].eq(t)?e:(r.push(t),U(e,e.length-1,1e9,n.setSelAfter(r)))}else return[g.selection([t])]}function Bt(e){let t=e[e.length-1],n=e.slice();return n[e.length-1]=t.setSelAfter(t.selectionsAfter.slice(0,t.selectionsAfter.length-1)),n}function $(e,t){if(!e.length)return e;let n=e.length,r=A;for(;n;){let l=St(e[n-1],t,r);if(l.changes&&!l.changes.empty||l.effects.length){let o=e.slice(0,n);return o[n-1]=l,o}else t=l.mapped,n--,r=l.selectionsAfter}return r.length?[g.selection(r)]:A}function St(e,t,n){let r=be(e.selectionsAfter.length?e.selectionsAfter.map(c=>c.map(t)):A,n);if(!e.changes)return g.selection(r);let l=e.changes.map(t),o=t.mapDesc(e.changes,!0),s=e.mapped?e.mapped.composeDesc(o):o;return new g(l,Se.mapEffects(e.effects,t),s,e.startSelection.map(o),r)}const Ct=/^(input\.type|delete)($|\.)/;class C{constructor(t,n,r=0,l=void 0){this.done=t,this.undone=n,this.prevTime=r,this.prevUserEvent=l}isolate(){return this.prevTime?new C(this.done,this.undone):this}addChanges(t,n,r,l,o){let s=this.done,c=s[s.length-1];return c&&c.changes&&!c.changes.empty&&t.changes&&(!r||Ct.test(r))&&(!c.selectionsAfter.length&&n-this.prevTime<l.newGroupDelay&&l.joinToEvent(o,yt(c.changes,t.changes))||r=="input.type.compose")?s=U(s,s.length-1,l.minDepth,new g(t.changes.compose(c.changes),be(Se.mapEffects(t.effects,c.changes),c.effects),c.mapped,c.startSelection,A)):s=U(s,s.length,l.minDepth,t),new C(s,A,n,r)}addSelection(t,n,r,l){let o=this.done.length?this.done[this.done.length-1].selectionsAfter:A;return o.length>0&&n-this.prevTime<l&&r==this.prevUserEvent&&r&&/^select($|\.)/.test(r)&&kt(o[o.length-1],t)?this:new C(Ee(this.done,t),this.undone,n,r)}addMapping(t){return new C($(this.done,t),$(this.undone,t),this.prevTime,this.prevUserEvent)}pop(t,n,r){let l=t==0?this.done:this.undone;if(l.length==0)return null;let o=l[l.length-1],s=o.selectionsAfter[0]||(o.startSelection?o.startSelection.map(o.changes.invertedDesc,1):n.selection);if(r&&o.selectionsAfter.length)return n.update({selection:o.selectionsAfter[o.selectionsAfter.length-1],annotations:X.of({side:t,rest:Bt(l),selection:s}),userEvent:t==0?"select.undo":"select.redo",scrollIntoView:!0});if(o.changes){let c=l.length==1?A:l.slice(0,l.length-1);return o.mapped&&(c=$(c,o.mapped)),n.update({changes:o.changes,selection:o.startSelection,effects:o.effects,annotations:X.of({side:t,rest:c,selection:s}),filter:!1,userEvent:t==0?"undo":"redo",scrollIntoView:!0})}else return null}}C.empty=new C(A,A);const bn=[{key:"Mod-z",run:Le,preventDefault:!0},{key:"Mod-y",mac:"Mod-Shift-z",run:Y,preventDefault:!0},{linux:"Ctrl-Shift-z",run:Y,preventDefault:!0},{key:"Mod-u",run:pt,preventDefault:!0},{key:"Alt-u",mac:"Mod-Shift-u",run:gt,preventDefault:!0}];function I(e,t){return h.create(e.ranges.map(t),e.mainIndex)}function S(e,t){return e.update({selection:t,scrollIntoView:!0,userEvent:"select"})}function y({state:e,dispatch:t},n){let r=I(e.selection,n);return r.eq(e.selection,!0)?!1:(t(S(e,r)),!0)}function M(e,t){return h.cursor(t?e.to:e.from)}function J(e,t){return y(e,n=>n.empty?e.moveByChar(n,t):M(n,t))}function m(e){return e.textDirectionAt(e.state.selection.main.head)==lt.LTR}const Te=e=>J(e,!m(e)),Oe=e=>J(e,m(e)),En=e=>J(e,!0),Tn=e=>J(e,!1);function oe(e,t,n){let r=t.head,l=e.doc.lineAt(r);return r==(n?l.to:l.from)?r=n?Math.min(e.doc.length,l.to+1):Math.max(0,l.from-1):r=l.from+T(l.text,r-l.from,n),h.cursor(r,n?-1:1)}function Ie(e,t){return y(e,n=>n.empty?oe(e.state,n,t):M(n,t))}const On=e=>Ie(e,!0),In=e=>Ie(e,!1);function w(e,t){return y(e,n=>n.empty?e.moveByGroup(n,t):M(n,t))}const Dt=e=>w(e,!m(e)),xt=e=>w(e,m(e)),vn=e=>w(e,!0),Rn=e=>w(e,!1);function le(e,t,n){let r=e.state.charCategorizer(t),l=r(n),o=l!=D.Space;return s=>{let c=r(s);return c!=D.Space?o&&c==l:(o=!1,!0)}}const Fn=e=>y(e,t=>t.empty?e.moveByChar(t,!0,n=>le(e,t.head,n)):M(t,!0)),ue=typeof Intl<"u"&&Intl.Segmenter?new Intl.Segmenter(void 0,{granularity:"word"}):null;function ve(e,t,n){let r=e.state.charCategorizer(t.from),l=D.Space,o=t.from,s=0,c=!1,i=!1,f=!1,u=d=>{if(c)return!1;o+=n?d.length:-d.length;let B=r(d),k;if(B==D.Word&&d.charCodeAt(0)<128&&/[\W_]/.test(d)&&(B=-1),l==D.Space&&(l=B),l!=B)return!1;if(l==D.Word)if(d.toLowerCase()==d){if(!n&&i)return!1;f=!0}else if(f){if(n)return!1;c=!0}else{if(i&&n&&r(k=e.state.sliceDoc(o,o+1))==D.Word&&k.toLowerCase()==k)return!1;i=!0}return s++,!0},a=e.moveByChar(t,n,d=>(u(d),u));if(ue&&l==D.Word&&a.from==t.from+s*(n?1:-1)){let d=Math.min(t.head,a.head),B=Math.max(t.head,a.head),k=e.state.sliceDoc(d,B);if(k.length>1&&/[\u4E00-\uffff]/.test(k)){let R=Array.from(ue.segment(k));if(R.length>1)return n?h.cursor(t.head+R[1].index,-1):h.cursor(a.head+R[R.length-1].index,1)}}return a}function Re(e,t){return y(e,n=>n.empty?ve(e,n,t):M(n,t))}const Gn=e=>Re(e,!0),Un=e=>Re(e,!1);function Lt(e,t,n){if(t.type.prop(n))return!0;let r=t.to-t.from;return r&&(r>2||/[^\s,.;:]/.test(e.sliceDoc(t.from,t.to)))||t.firstChild}function z(e,t,n){let r=te(e).resolveInner(t.head),l=n?Q.closedBy:Q.openedBy;for(let i=t.head;;){let f=n?r.childAfter(i):r.childBefore(i);if(!f)break;Lt(e,f,l)?r=f:i=n?f.to:f.from}let o=r.type.prop(l),s,c;return o&&(s=n?E(e,r.from,1):E(e,r.to,-1))&&s.matched?c=n?s.end.to:s.end.from:c=n?r.to:r.from,h.cursor(c,n?-1:1)}const Mt=e=>y(e,t=>z(e.state,t,!m(e))),bt=e=>y(e,t=>z(e.state,t,m(e)));function Fe(e,t){return y(e,n=>{if(!n.empty)return M(n,t);let r=e.moveVertically(n,t);return r.head!=n.head?r:e.moveToLineBoundary(n,t)})}const Ge=e=>Fe(e,!1),Ue=e=>Fe(e,!0);function Ve(e){let t=e.scrollDOM.clientHeight<e.scrollDOM.scrollHeight-2,n=0,r=0,l;if(t){for(let o of e.state.facet(O.scrollMargins)){let s=o(e);s!=null&&s.top&&(n=Math.max(s==null?void 0:s.top,n)),s!=null&&s.bottom&&(r=Math.max(s==null?void 0:s.bottom,r))}l=e.scrollDOM.clientHeight-n-r}else l=(e.dom.ownerDocument.defaultView||window).innerHeight;return{marginTop:n,marginBottom:r,selfScroll:t,height:Math.max(e.defaultLineHeight,l-5)}}function Ne(e,t){let n=Ve(e),{state:r}=e,l=I(r.selection,s=>s.empty?e.moveVertically(s,t,n.height):M(s,t));if(l.eq(r.selection))return!1;let o;if(n.selfScroll){let s=e.coordsAtPos(r.selection.main.head),c=e.scrollDOM.getBoundingClientRect(),i=c.top+n.marginTop,f=c.bottom-n.marginBottom;s&&s.top>i&&s.bottom<f&&(o=O.scrollIntoView(l.main.head,{y:"start",yMargin:s.top-i}))}return e.dispatch(S(r,l),{effects:o}),!0}const fe=e=>Ne(e,!1),Z=e=>Ne(e,!0);function x(e,t,n){let r=e.lineBlockAt(t.head),l=e.moveToLineBoundary(t,n);if(l.head==t.head&&l.head!=(n?r.to:r.from)&&(l=e.moveToLineBoundary(t,n,!1)),!n&&l.head==r.from&&r.length){let o=/^\s*/.exec(e.state.sliceDoc(r.from,Math.min(r.from+100,r.to)))[0].length;o&&t.head!=r.from+o&&(l=h.cursor(r.from+o))}return l}const Et=e=>y(e,t=>x(e,t,!0)),Tt=e=>y(e,t=>x(e,t,!1)),Ot=e=>y(e,t=>x(e,t,!m(e))),It=e=>y(e,t=>x(e,t,m(e))),vt=e=>y(e,t=>h.cursor(e.lineBlockAt(t.head).from,1)),Rt=e=>y(e,t=>h.cursor(e.lineBlockAt(t.head).to,-1));function Pe(e,t,n){let r=!1,l=I(e.selection,o=>{let s=E(e,o.head,-1)||E(e,o.head,1)||o.head>0&&E(e,o.head-1,1)||o.head<e.doc.length&&E(e,o.head+1,-1);if(!s||!s.end)return o;r=!0;let c=s.start.from==o.head?s.end.to:s.end.from;return n?h.range(o.anchor,c):h.cursor(c)});return r?(t(S(e,l)),!0):!1}const Ft=({state:e,dispatch:t})=>Pe(e,t,!1),Vn=({state:e,dispatch:t})=>Pe(e,t,!0);function p(e,t,n){let r=I(e.state.selection,l=>{l.undirectional&&l.head>=l.anchor!=t&&(l=h.range(l.head,l.anchor));let o=n(l);return h.range(l.anchor,o.head,o.goalColumn,o.bidiLevel||void 0,o.assoc)});return r.eq(e.state.selection)?!1:(e.dispatch(S(e.state,r)),!0)}function W(e,t){return p(e,t,n=>e.moveByChar(n,t))}const Je=e=>W(e,!m(e)),we=e=>W(e,m(e)),Nn=e=>W(e,!0),Pn=e=>W(e,!1),Jn=e=>p(e,!0,t=>oe(e.state,t,!0)),wn=e=>p(e,!1,t=>oe(e.state,t,!1));function H(e,t){return p(e,t,n=>e.moveByGroup(n,t))}const Gt=e=>H(e,!m(e)),Ut=e=>H(e,m(e)),zn=e=>H(e,!0),Wn=e=>H(e,!1),Hn=e=>p(e,!0,t=>e.moveByChar(t,!0,n=>le(e,t.head,n)));function ze(e,t){return p(e,t,n=>ve(e,n,t))}const qn=e=>ze(e,!0),Kn=e=>ze(e,!1),Vt=e=>{let t=!m(e);return p(e,t,n=>z(e.state,n,t))},Nt=e=>{let t=m(e);return p(e,t,n=>z(e.state,n,t))};function We(e,t){return p(e,t,n=>e.moveVertically(n,t))}const He=e=>We(e,!1),qe=e=>We(e,!0);function Ke(e,t){return p(e,t,n=>e.moveVertically(n,t,Ve(e).height))}const ae=e=>Ke(e,!1),he=e=>Ke(e,!0),Pt=e=>p(e,!0,t=>x(e,t,!0)),Jt=e=>p(e,!1,t=>x(e,t,!1)),wt=e=>{let t=!m(e);return p(e,t,n=>x(e,n,t))},zt=e=>{let t=m(e);return p(e,t,n=>x(e,n,t))},Wt=e=>p(e,!1,t=>h.cursor(e.lineBlockAt(t.head).from)),Ht=e=>p(e,!0,t=>h.cursor(e.lineBlockAt(t.head).to)),de=({state:e,dispatch:t})=>(t(S(e,{anchor:0})),!0),me=({state:e,dispatch:t})=>(t(S(e,{anchor:e.doc.length})),!0),pe=({state:e,dispatch:t})=>(t(S(e,{anchor:e.selection.main.anchor,head:0})),!0),ge=({state:e,dispatch:t})=>(t(S(e,{anchor:e.selection.main.anchor,head:e.doc.length})),!0),qt=({state:e,dispatch:t})=>(t(e.update({selection:{anchor:0,head:e.doc.length},userEvent:"select"})),!0),Kt=({state:e,dispatch:t})=>{let n=q(e).map(({from:r,to:l})=>h.range(r,Math.min(l+1,e.doc.length)));return t(e.update({selection:h.create(n),userEvent:"select"})),!0},$t=({state:e,dispatch:t})=>{let n=I(e.selection,r=>{let l=te(e),o=l.resolveStack(r.from,1);if(r.empty){let s=l.resolveStack(r.from,-1);s.node.from>=o.node.from&&s.node.to<=o.node.to&&(o=s)}for(let s=o;s;s=s.next){let{node:c}=s;if((c.from<r.from&&c.to>=r.to||c.to>r.to&&c.from<=r.from)&&s.next)return h.range(c.to,c.from)}return r});return n.eq(e.selection)?!1:(t(S(e,n)),!0)};function $e(e,t){let{state:n}=e,r=n.selection,l=n.selection.ranges.slice();for(let o of n.selection.ranges){let s=n.doc.lineAt(o.head);if(t?s.to<e.state.doc.length:s.from>0)for(let c=o;;){let i=e.moveVertically(c,t);if(i.head<s.from||i.head>s.to){l.some(f=>f.head==i.head)||l.push(i);break}else{if(i.head==c.head)break;c=i}}}return l.length==r.ranges.length?!1:(e.dispatch(S(n,h.create(l,l.length-1))),!0)}const jt=e=>$e(e,!1),Qt=e=>$e(e,!0),Xt=({state:e,dispatch:t})=>{let n=e.selection,r=null;return n.ranges.length>1?r=h.create([n.main]):n.main.empty||(r=h.create([h.cursor(n.main.head)])),r?(t(S(e,r)),!0):!1};function b(e,t){if(e.state.readOnly)return!1;let n="delete.selection",{state:r}=e,l=r.changeByRange(o=>{let{from:s,to:c}=o;if(s==c){let i=t(o);i<s?(n="delete.backward",i=F(e,i,!1)):i>s&&(n="delete.forward",i=F(e,i,!0)),s=Math.min(s,i),c=Math.max(c,i)}else s=F(e,s,!1),c=F(e,c,!0);return s==c?{range:o}:{changes:{from:s,to:c},range:h.cursor(s,s<o.head?-1:1)}});return l.changes.empty?!1:(e.dispatch(r.update(l,{scrollIntoView:!0,userEvent:n,effects:n=="delete.selection"?O.announce.of(r.phrase("Selection deleted")):void 0})),!0)}function F(e,t,n){if(e instanceof O)for(let r of e.state.facet(O.atomicRanges).map(l=>l(e)))r.between(t,t,(l,o)=>{l<t&&o>t&&(t=n?o:l)});return t}const se=(e,t,n)=>b(e,r=>{let l=r.from,{state:o}=e,s=o.doc.lineAt(l),c,i;if(n&&!t&&l>s.from&&l<s.from+200&&!/[^ \t]/.test(c=s.text.slice(0,l-s.from))){if(c[c.length-1]==" ")return l-1;let f=ee(c,o.tabSize),u=f%j(o)||j(o);for(let a=0;a<u&&c[c.length-1-a]==" ";a++)l--;i=l}else i=T(s.text,l-s.from,t,t)+s.from,i==l&&s.number!=(t?o.doc.lines:1)?i+=t?1:-1:!t&&/[\ufe00-\ufe0f]/.test(s.text.slice(i-s.from,l-s.from))&&(i=T(s.text,i-s.from,!1,!1)+s.from);return i}),_=e=>se(e,!1,!0),$n=e=>se(e,!1,!1),je=e=>se(e,!0,!1),Qe=(e,t)=>b(e,n=>{let r=n.head,{state:l}=e,o=l.doc.lineAt(r),s=l.charCategorizer(r);for(let c=null;;){if(r==(t?o.to:o.from)){r==n.head&&o.number!=(t?l.doc.lines:1)&&(r+=t?1:-1);break}let i=T(o.text,r-o.from,t)+o.from,f=o.text.slice(Math.min(r,i)-o.from,Math.max(r,i)-o.from),u=s(f);if(c!=null&&u!=c)break;(f!=" "||r!=n.head)&&(c=u),r=i}return r}),Xe=e=>Qe(e,!1),Yt=e=>Qe(e,!0),jn=e=>b(e,t=>e.moveByChar(t,!0,n=>le(e,t.head,n)).head),Zt=e=>b(e,t=>{let n=e.lineBlockAt(t.head).to;return t.head<n?n:Math.min(e.state.doc.length,t.head+1)}),Qn=e=>b(e,t=>{let n=e.lineBlockAt(t.head).from;return t.head>n?n:Math.max(0,t.head-1)}),_t=e=>b(e,t=>{let n=e.moveToLineBoundary(t,!1).head;return t.head>n?n:Math.max(0,t.head-1)}),en=e=>b(e,t=>{let n=e.moveToLineBoundary(t,!0).head;return t.head<n?n:Math.min(e.state.doc.length,t.head+1)}),Xn=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=[];for(let r=0,l="",o=e.doc.iter();;){if(o.next(),o.lineBreak||o.done){let s=l.search(/\s+$/);if(s>-1&&n.push({from:r-(l.length-s),to:r}),o.done)break;l=""}else l=o.value;r+=o.value.length}return n.length?(t(e.update({changes:n,userEvent:"delete"})),!0):!1},tn=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange(r=>({changes:{from:r.from,to:r.to,insert:ke.of(["",""])},range:h.cursor(r.from)}));return t(e.update(n,{scrollIntoView:!0,userEvent:"input"})),!0},nn=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange(r=>{if(!r.empty||r.from==0||r.from==e.doc.length)return{range:r};let l=r.from,o=e.doc.lineAt(l),s=l==o.from?l-1:T(o.text,l-o.from,!1)+o.from,c=l==o.to?l+1:T(o.text,l-o.from,!0)+o.from;return{changes:{from:s,to:c,insert:e.doc.slice(l,c).append(e.doc.slice(s,l))},range:h.cursor(c)}});return n.changes.empty?!1:(t(e.update(n,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function q(e){let t=[],n=-1;for(let r of e.selection.ranges){let l=e.doc.lineAt(r.from),o=e.doc.lineAt(r.to);if(!r.empty&&r.to==o.from&&(o=e.doc.lineAt(r.to-1)),n>=l.number){let s=t[t.length-1];s.to=o.to,s.ranges.push(r)}else t.push({from:l.from,to:o.to,ranges:[r]});n=o.number+1}return t}function Ye(e,t,n){if(e.readOnly)return!1;let r=[],l=[];for(let o of q(e)){if(n?o.to==e.doc.length:o.from==0)continue;let s=e.doc.lineAt(n?o.to+1:o.from-1),c=s.length+1;if(n){r.push({from:o.to,to:s.to},{from:o.from,insert:s.text+e.lineBreak});for(let i of o.ranges)l.push(h.range(Math.min(e.doc.length,i.anchor+c),Math.min(e.doc.length,i.head+c)))}else{r.push({from:s.from,to:o.from},{from:o.to,insert:e.lineBreak+s.text});for(let i of o.ranges)l.push(h.range(i.anchor-c,i.head-c))}}return r.length?(t(e.update({changes:r,scrollIntoView:!0,selection:h.create(l,e.selection.mainIndex),userEvent:"move.line"})),!0):!1}const rn=({state:e,dispatch:t})=>Ye(e,t,!1),on=({state:e,dispatch:t})=>Ye(e,t,!0);function Ze(e,t,n){if(e.readOnly)return!1;let r=[];for(let o of q(e))n?r.push({from:o.from,insert:e.doc.slice(o.from,o.to)+e.lineBreak}):r.push({from:o.to,insert:e.lineBreak+e.doc.slice(o.from,o.to)});let l=e.changes(r);return t(e.update({changes:l,selection:e.selection.map(l,n?1:-1),scrollIntoView:!0,userEvent:"input.copyline"})),!0}const ln=({state:e,dispatch:t})=>Ze(e,t,!1),sn=({state:e,dispatch:t})=>Ze(e,t,!0),cn=e=>{if(e.state.readOnly)return!1;let{state:t}=e,n=t.changes(q(t).map(({from:l,to:o})=>(l>0?l--:o<t.doc.length&&o++,{from:l,to:o}))),r=I(t.selection,l=>{let o;if(e.lineWrapping){let s=e.lineBlockAt(l.head),c=e.coordsAtPos(l.head,l.assoc||1);c&&(o=s.bottom+e.documentTop-c.bottom+e.defaultLineHeight/2)}return e.moveVertically(l,!0,o)}).map(n);return e.dispatch({changes:n,selection:r,scrollIntoView:!0,userEvent:"delete.line"}),!0},Yn=({state:e,dispatch:t})=>(t(e.update(e.replaceSelection(e.lineBreak),{scrollIntoView:!0,userEvent:"input"})),!0),Zn=({state:e,dispatch:t})=>(t(e.update(e.changeByRange(n=>{let r=/^\s*/.exec(e.doc.lineAt(n.from).text)[0];return{changes:{from:n.from,to:n.to,insert:e.lineBreak+r},range:h.cursor(n.from+r.length+1)}}),{scrollIntoView:!0,userEvent:"input"})),!0);function un(e,t){if(/\(\)|\[\]|\{\}/.test(e.sliceDoc(t-1,t+1)))return{from:t,to:t};let n=te(e).resolveInner(t),r=n.childBefore(t),l=n.childAfter(t),o;return r&&l&&r.to<=t&&l.from>=t&&(o=r.type.prop(Q.closedBy))&&o.indexOf(l.name)>-1&&e.doc.lineAt(r.to).from==e.doc.lineAt(l.from).from&&!/\S/.test(e.sliceDoc(r.to,l.from))?{from:r.to,to:l.from}:null}const ye=_e(!1),fn=_e(!0);function _e(e){return({state:t,dispatch:n})=>{if(t.readOnly)return!1;let r=t.changeByRange(l=>{let{from:o,to:s}=l,c=t.doc.lineAt(o),i=!e&&o==s&&un(t,o);e&&(o=s=(s<=c.to?c:t.doc.lineAt(s)).to);let f=new Ce(t,{simulateBreak:o,simulateDoubleBreak:!!i}),u=De(f,o);for(u==null&&(u=ee(/^\s*/.exec(t.doc.lineAt(o).text)[0],t.tabSize));s<c.to&&/\s/.test(c.text[s-c.from]);)s++;i?{from:o,to:s}=i:o>c.from&&o<c.from+100&&!/\S/.test(c.text.slice(0,o))&&(o=c.from);let a=["",G(t,u)];return i&&a.push(G(t,f.lineIndent(c.from,-1))),{changes:{from:o,to:s,insert:ke.of(a)},range:h.cursor(o+1+a[1].length)}});return n(t.update(r,{scrollIntoView:!0,userEvent:"input"})),!0}}function ce(e,t){let n=-1;return e.changeByRange(r=>{let l=[];for(let s=r.from;s<=r.to;){let c=e.doc.lineAt(s);c.number>n&&(r.empty||r.to>c.from)&&(t(c,l,r),n=c.number),s=c.to+1}let o=e.changes(l);return{changes:l,range:h.range(o.mapPos(r.anchor,1),o.mapPos(r.head,1))}})}const an=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=Object.create(null),r=new Ce(e,{overrideIndentation:o=>{let s=n[o];return s??-1}}),l=ce(e,(o,s,c)=>{let i=De(r,o.from);if(i==null)return;/\S/.test(o.text)||(i=0);let f=/^\s*/.exec(o.text)[0],u=G(e,i);(f!=u||c.from<o.from+f.length)&&(n[o.from]=i,s.push({from:o.from,to:o.from+f.length,insert:u}))});return l.changes.empty||t(e.update(l,{userEvent:"indent"})),!0},ie=({state:e,dispatch:t})=>e.readOnly?!1:(t(e.update(ce(e,(n,r)=>{r.push({from:n.from,insert:e.facet(st)})}),{userEvent:"input.indent"})),!0),et=({state:e,dispatch:t})=>e.readOnly?!1:(t(e.update(ce(e,(n,r)=>{let l=/^\s*/.exec(n.text)[0];if(!l)return;let o=ee(l,e.tabSize),s=0,c=G(e,Math.max(0,o-j(e)));for(;s<l.length&&s<c.length&&l.charCodeAt(s)==c.charCodeAt(s);)s++;r.push({from:n.from+s,to:n.from+l.length,insert:c.slice(s)})}),{userEvent:"delete.dedent"})),!0),hn=e=>(e.setTabFocusMode(),!0),_n=e=>(e.setTabFocusMode(2e3),!0),er=({state:e,dispatch:t})=>e.selection.ranges.some(n=>!n.empty)?ie({state:e,dispatch:t}):(t(e.update(e.replaceSelection(" "),{scrollIntoView:!0,userEvent:"input"})),!0),dn=[{key:"Ctrl-b",run:Te,shift:Je,preventDefault:!0},{key:"Ctrl-f",run:Oe,shift:we},{key:"Ctrl-p",run:Ge,shift:He},{key:"Ctrl-n",run:Ue,shift:qe},{key:"Ctrl-a",run:vt,shift:Wt},{key:"Ctrl-e",run:Rt,shift:Ht},{key:"Ctrl-d",run:je},{key:"Ctrl-h",run:_},{key:"Ctrl-k",run:Zt},{key:"Ctrl-Alt-h",run:Xe},{key:"Ctrl-o",run:tn},{key:"Ctrl-t",run:nn},{key:"Ctrl-v",run:Z}],mn=[{key:"ArrowLeft",run:Te,shift:Je,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:Dt,shift:Gt,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:Ot,shift:wt,preventDefault:!0},{key:"ArrowRight",run:Oe,shift:we,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:xt,shift:Ut,preventDefault:!0},{mac:"Cmd-ArrowRight",run:It,shift:zt,preventDefault:!0},{key:"ArrowUp",run:Ge,shift:He,preventDefault:!0},{mac:"Cmd-ArrowUp",run:de,shift:pe},{mac:"Ctrl-ArrowUp",run:fe,shift:ae},{key:"ArrowDown",run:Ue,shift:qe,preventDefault:!0},{mac:"Cmd-ArrowDown",run:me,shift:ge},{mac:"Ctrl-ArrowDown",run:Z,shift:he},{key:"PageUp",run:fe,shift:ae},{key:"PageDown",run:Z,shift:he},{key:"Home",run:Tt,shift:Jt,preventDefault:!0},{key:"Mod-Home",run:de,shift:pe},{key:"End",run:Et,shift:Pt,preventDefault:!0},{key:"Mod-End",run:me,shift:ge},{key:"Enter",run:ye,shift:ye},{key:"Mod-a",run:qt},{key:"Backspace",run:_,shift:_,preventDefault:!0},{key:"Delete",run:je,preventDefault:!0},{key:"Mod-Backspace",mac:"Alt-Backspace",run:Xe,preventDefault:!0},{key:"Mod-Delete",mac:"Alt-Delete",run:Yt,preventDefault:!0},{mac:"Mod-Backspace",run:_t,preventDefault:!0},{mac:"Mod-Delete",run:en,preventDefault:!0}].concat(dn.map(e=>({mac:e.key,run:e.run,shift:e.shift}))),tr=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:Mt,shift:Vt},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:bt,shift:Nt},{key:"Alt-ArrowUp",run:rn},{key:"Shift-Alt-ArrowUp",run:ln},{key:"Alt-ArrowDown",run:on},{key:"Shift-Alt-ArrowDown",run:sn},{key:"Mod-Alt-ArrowUp",run:jt},{key:"Mod-Alt-ArrowDown",run:Qt},{key:"Escape",run:Xt},{key:"Mod-Enter",run:fn},{key:"Alt-l",mac:"Ctrl-l",run:Kt},{key:"Mod-i",run:$t,preventDefault:!0},{key:"Mod-[",run:et},{key:"Mod-]",run:ie},{key:"Mod-Alt-\\",run:an},{key:"Shift-Mod-k",run:cn},{key:"Shift-Mod-\\",run:Ft},{key:"Mod-/",run:ct},{key:"Alt-A",run:ut},{key:"Ctrl-m",mac:"Shift-Alt-m",run:hn}].concat(mn),nr={key:"Tab",run:ie,shift:et};export{jt as addCursorAbove,Qt as addCursorBelow,Sn as blockComment,Cn as blockUncomment,sn as copyLineDown,ln as copyLineUp,Tn as cursorCharBackward,In as cursorCharBackwardLogical,En as cursorCharForward,On as cursorCharForwardLogical,Te as cursorCharLeft,Oe as cursorCharRight,me as cursorDocEnd,de as cursorDocStart,Rn as cursorGroupBackward,vn as cursorGroupForward,Fn as cursorGroupForwardWin,Dt as cursorGroupLeft,xt as cursorGroupRight,Tt as cursorLineBoundaryBackward,Et as cursorLineBoundaryForward,Ot as cursorLineBoundaryLeft,It as cursorLineBoundaryRight,Ue as cursorLineDown,Rt as cursorLineEnd,vt as cursorLineStart,Ge as cursorLineUp,Ft as cursorMatchingBracket,Z as cursorPageDown,fe as cursorPageUp,Un as cursorSubwordBackward,Gn as cursorSubwordForward,Mt as cursorSyntaxLeft,bt as cursorSyntaxRight,tr as defaultKeymap,_ as deleteCharBackward,$n as deleteCharBackwardStrict,je as deleteCharForward,Xe as deleteGroupBackward,Yt as deleteGroupForward,jn as deleteGroupForwardWin,cn as deleteLine,_t as deleteLineBoundaryBackward,en as deleteLineBoundaryForward,Zt as deleteToLineEnd,Qn as deleteToLineStart,Xn as deleteTrailingWhitespace,dn as emacsStyleKeymap,Dn as history,xn as historyField,bn as historyKeymap,et as indentLess,ie as indentMore,an as indentSelection,nr as indentWithTab,fn as insertBlankLine,Yn as insertNewline,ye as insertNewlineAndIndent,Zn as insertNewlineKeepIndent,er as insertTab,mt as invertedEffects,dt as isolateHistory,An as lineComment,Bn as lineUncomment,on as moveLineDown,rn as moveLineUp,Y as redo,Mn as redoDepth,gt as redoSelection,qt as selectAll,Pn as selectCharBackward,wn as selectCharBackwardLogical,Nn as selectCharForward,Jn as selectCharForwardLogical,Je as selectCharLeft,we as selectCharRight,ge as selectDocEnd,pe as selectDocStart,Wn as selectGroupBackward,zn as selectGroupForward,Hn as selectGroupForwardWin,Gt as selectGroupLeft,Ut as selectGroupRight,Kt as selectLine,Jt as selectLineBoundaryBackward,Pt as selectLineBoundaryForward,wt as selectLineBoundaryLeft,zt as selectLineBoundaryRight,qe as selectLineDown,Ht as selectLineEnd,Wt as selectLineStart,He as selectLineUp,Vn as selectMatchingBracket,he as selectPageDown,ae as selectPageUp,$t as selectParentSyntax,Kn as selectSubwordBackward,qn as selectSubwordForward,Vt as selectSyntaxLeft,Nt as selectSyntaxRight,Xt as simplifySelection,tn as splitLine,mn as standardKeymap,_n as temporarilySetTabFocusMode,ut as toggleBlockComment,ft as toggleBlockCommentByLine,ct as toggleComment,it as toggleLineComment,hn as toggleTabFocusMode,nn as transposeChars,Le as undo,Ln as undoDepth,pt as undoSelection};
|
|
1
|
+
import{EditorSelection as h,Text as ke,findClusterBreak as T,StateField as tt,Transaction as K,Facet as Ae,Annotation as Be,combineConfig as nt,StateEffect as Se,ChangeSet as rt,ChangeDesc as ot,countColumn as ee,CharCategory as D}from"./index-BHot-lnj.js";import{E as O,o as lt}from"./index-891wE-Rj.js";import{I as Ce,g as De,c as G,e as te,m as E,h as j,j as st}from"./index-BwqyDurx.js";import{N as Q}from"./index-BVL_B_hC.js";const ct=e=>{let{state:t}=e,n=t.doc.lineAt(t.selection.main.from),r=ne(e.state,n.from);return r.line?it(e):r.block?ft(e):!1};function L(e,t){return({state:n,dispatch:r})=>{if(n.readOnly)return!1;let l=e(t,n);return l?(r(n.update(l)),!0):!1}}const it=L(re,0),An=L(re,1),Bn=L(re,2),ut=L(V,0),Sn=L(V,1),Cn=L(V,2),ft=L((e,t)=>V(e,t,ht(t)),0);function ne(e,t){let n=e.languageDataAt("commentTokens",t,1);return n.length?n[0]:{}}const v=50;function at(e,{open:t,close:n},r,l){let o=e.sliceDoc(r-v,r),s=e.sliceDoc(l,l+v),c=/\s*$/.exec(o)[0].length,i=/^\s*/.exec(s)[0].length,f=o.length-c;if(o.slice(f-t.length,f)==t&&s.slice(i,i+n.length)==n)return{open:{pos:r-c,margin:c&&1},close:{pos:l+i,margin:i&&1}};let u,a;l-r<=2*v?u=a=e.sliceDoc(r,l):(u=e.sliceDoc(r,r+v),a=e.sliceDoc(l-v,l));let d=/^\s*/.exec(u)[0].length,B=/\s*$/.exec(a)[0].length,k=a.length-B-n.length;return u.slice(d,d+t.length)==t&&a.slice(k,k+n.length)==n?{open:{pos:r+d+t.length,margin:/\s/.test(u.charAt(d+t.length))?1:0},close:{pos:l-B-n.length,margin:/\s/.test(a.charAt(k-1))?1:0}}:null}function ht(e){let t=[];for(let n of e.selection.ranges){let r=e.doc.lineAt(n.from),l=n.to<=r.to?r:e.doc.lineAt(n.to);l.from>r.from&&l.from==n.to&&(l=n.to==r.to+1?r:e.doc.lineAt(n.to-1));let o=t.length-1;o>=0&&t[o].to>r.from?t[o].to=l.to:t.push({from:r.from+/^\s*/.exec(r.text)[0].length,to:l.to})}return t}function V(e,t,n=t.selection.ranges){let r=n.map(o=>ne(t,o.from).block);if(!r.every(o=>o))return null;let l=n.map((o,s)=>at(t,r[s],o.from,o.to));if(e!=2&&!l.every(o=>o))return{changes:t.changes(n.map((o,s)=>l[s]?[]:[{from:o.from,insert:r[s].open+" "},{from:o.to,insert:" "+r[s].close}]))};if(e!=1&&l.some(o=>o)){let o=[];for(let s=0,c;s<l.length;s++)if(c=l[s]){let i=r[s],{open:f,close:u}=c;o.push({from:f.pos-i.open.length,to:f.pos+f.margin},{from:u.pos-u.margin,to:u.pos+i.close.length})}return{changes:o}}return null}function re(e,t,n=t.selection.ranges){let r=[],l=-1;e:for(let{from:o,to:s}of n){let c=r.length,i=1e9,f;for(let u=o;u<=s;){let a=t.doc.lineAt(u);if(f==null&&(f=ne(t,a.from).line,!f))continue e;if(a.from>l&&(o==s||s>a.from)){l=a.from;let d=/^\s*/.exec(a.text)[0].length,B=d==a.length,k=a.text.slice(d,d+f.length)==f?d:-1;d<a.text.length&&d<i&&(i=d),r.push({line:a,comment:k,token:f,indent:d,empty:B,single:!1})}u=a.to+1}if(i<1e9)for(let u=c;u<r.length;u++)r[u].indent<r[u].line.text.length&&(r[u].indent=i);r.length==c+1&&(r[c].single=!0)}if(e!=2&&r.some(o=>o.comment<0&&(!o.empty||o.single))){let o=[];for(let{line:c,token:i,indent:f,empty:u,single:a}of r)(a||!u)&&o.push({from:c.from+f,insert:i+" "});let s=t.changes(o);return{changes:s,selection:t.selection.map(s,1)}}else if(e!=1&&r.some(o=>o.comment>=0)){let o=[];for(let{line:s,comment:c,token:i}of r)if(c>=0){let f=s.from+c,u=f+i.length;s.text[u-s.from]==" "&&u++,o.push({from:f,to:u})}return{changes:o}}return null}const X=Be.define(),dt=Be.define(),mt=Ae.define(),xe=Ae.define({combine(e){return nt(e,{minDepth:100,newGroupDelay:500,joinToEvent:(t,n)=>n},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(t,n)=>(r,l)=>t(r,l)||n(r,l)})}}),N=tt.define({create(){return C.empty},update(e,t){let n=t.state.facet(xe),r=t.annotation(X);if(r){let i=g.fromTransaction(t,r.selection),f=r.side,u=f==0?e.undone:e.done;return i?u=U(u,u.length,n.minDepth,i):u=Ee(u,t.startState.selection),new C(f==0?r.rest:u,f==0?u:r.rest)}let l=t.annotation(dt);if((l=="full"||l=="before")&&(e=e.isolate()),t.annotation(K.addToHistory)===!1)return t.changes.empty?e:e.addMapping(t.changes.desc);let o=g.fromTransaction(t),s=t.annotation(K.time),c=t.annotation(K.userEvent);return o?e=e.addChanges(o,s,c,n,t):t.selection&&(e=e.addSelection(t.startState.selection,s,c,n.newGroupDelay)),(l=="full"||l=="after")&&(e=e.isolate()),e},toJSON(e){return{done:e.done.map(t=>t.toJSON()),undone:e.undone.map(t=>t.toJSON())}},fromJSON(e){return new C(e.done.map(g.fromJSON),e.undone.map(g.fromJSON))}});function Dn(e={}){return[N,xe.of(e),O.domEventHandlers({beforeinput(t,n){let r=t.inputType=="historyUndo"?Le:t.inputType=="historyRedo"?Y:null;return r?(t.preventDefault(),r(n)):!1}})]}const xn=N;function P(e,t){return function({state:n,dispatch:r}){if(!t&&n.readOnly)return!1;let l=n.field(N,!1);if(!l)return!1;let o=l.pop(e,n,t);return o?(r(o),!0):!1}}const Le=P(0,!1),Y=P(1,!1),pt=P(0,!0),gt=P(1,!0);function Me(e){return function(t){let n=t.field(N,!1);if(!n)return 0;let r=e==0?n.done:n.undone;return r.length-(r.length&&!r[0].changes?1:0)}}const Ln=Me(0),Mn=Me(1);class g{constructor(t,n,r,l,o){this.changes=t,this.effects=n,this.mapped=r,this.startSelection=l,this.selectionsAfter=o}setSelAfter(t){return new g(this.changes,this.effects,this.mapped,this.startSelection,t)}toJSON(){var t,n,r;return{changes:(t=this.changes)===null||t===void 0?void 0:t.toJSON(),mapped:(n=this.mapped)===null||n===void 0?void 0:n.toJSON(),startSelection:(r=this.startSelection)===null||r===void 0?void 0:r.toJSON(),selectionsAfter:this.selectionsAfter.map(l=>l.toJSON())}}static fromJSON(t){return new g(t.changes&&rt.fromJSON(t.changes),[],t.mapped&&ot.fromJSON(t.mapped),t.startSelection&&h.fromJSON(t.startSelection),t.selectionsAfter.map(h.fromJSON))}static fromTransaction(t,n){let r=A;for(let l of t.startState.facet(mt)){let o=l(t);o.length&&(r=r.concat(o))}return!r.length&&t.changes.empty?null:new g(t.changes.invert(t.startState.doc),r,void 0,n||t.startState.selection,A)}static selection(t){return new g(void 0,A,void 0,void 0,t)}}function U(e,t,n,r){let l=t+1>n+20?t-n-1:0,o=e.slice(l,t);return o.push(r),o}function yt(e,t){let n=[],r=!1;return e.iterChangedRanges((l,o)=>n.push(l,o)),t.iterChangedRanges((l,o,s,c)=>{for(let i=0;i<n.length;){let f=n[i++],u=n[i++];c>=f&&s<=u&&(r=!0)}}),r}function kt(e,t){return e.ranges.length==t.ranges.length&&e.ranges.filter((n,r)=>n.empty!=t.ranges[r].empty).length===0}function be(e,t){return e.length?t.length?e.concat(t):e:t}const A=[],At=200;function Ee(e,t){if(e.length){let n=e[e.length-1],r=n.selectionsAfter.slice(Math.max(0,n.selectionsAfter.length-At));return r.length&&r[r.length-1].eq(t)?e:(r.push(t),U(e,e.length-1,1e9,n.setSelAfter(r)))}else return[g.selection([t])]}function Bt(e){let t=e[e.length-1],n=e.slice();return n[e.length-1]=t.setSelAfter(t.selectionsAfter.slice(0,t.selectionsAfter.length-1)),n}function $(e,t){if(!e.length)return e;let n=e.length,r=A;for(;n;){let l=St(e[n-1],t,r);if(l.changes&&!l.changes.empty||l.effects.length){let o=e.slice(0,n);return o[n-1]=l,o}else t=l.mapped,n--,r=l.selectionsAfter}return r.length?[g.selection(r)]:A}function St(e,t,n){let r=be(e.selectionsAfter.length?e.selectionsAfter.map(c=>c.map(t)):A,n);if(!e.changes)return g.selection(r);let l=e.changes.map(t),o=t.mapDesc(e.changes,!0),s=e.mapped?e.mapped.composeDesc(o):o;return new g(l,Se.mapEffects(e.effects,t),s,e.startSelection.map(o),r)}const Ct=/^(input\.type|delete)($|\.)/;class C{constructor(t,n,r=0,l=void 0){this.done=t,this.undone=n,this.prevTime=r,this.prevUserEvent=l}isolate(){return this.prevTime?new C(this.done,this.undone):this}addChanges(t,n,r,l,o){let s=this.done,c=s[s.length-1];return c&&c.changes&&!c.changes.empty&&t.changes&&(!r||Ct.test(r))&&(!c.selectionsAfter.length&&n-this.prevTime<l.newGroupDelay&&l.joinToEvent(o,yt(c.changes,t.changes))||r=="input.type.compose")?s=U(s,s.length-1,l.minDepth,new g(t.changes.compose(c.changes),be(Se.mapEffects(t.effects,c.changes),c.effects),c.mapped,c.startSelection,A)):s=U(s,s.length,l.minDepth,t),new C(s,A,n,r)}addSelection(t,n,r,l){let o=this.done.length?this.done[this.done.length-1].selectionsAfter:A;return o.length>0&&n-this.prevTime<l&&r==this.prevUserEvent&&r&&/^select($|\.)/.test(r)&&kt(o[o.length-1],t)?this:new C(Ee(this.done,t),this.undone,n,r)}addMapping(t){return new C($(this.done,t),$(this.undone,t),this.prevTime,this.prevUserEvent)}pop(t,n,r){let l=t==0?this.done:this.undone;if(l.length==0)return null;let o=l[l.length-1],s=o.selectionsAfter[0]||(o.startSelection?o.startSelection.map(o.changes.invertedDesc,1):n.selection);if(r&&o.selectionsAfter.length)return n.update({selection:o.selectionsAfter[o.selectionsAfter.length-1],annotations:X.of({side:t,rest:Bt(l),selection:s}),userEvent:t==0?"select.undo":"select.redo",scrollIntoView:!0});if(o.changes){let c=l.length==1?A:l.slice(0,l.length-1);return o.mapped&&(c=$(c,o.mapped)),n.update({changes:o.changes,selection:o.startSelection,effects:o.effects,annotations:X.of({side:t,rest:c,selection:s}),filter:!1,userEvent:t==0?"undo":"redo",scrollIntoView:!0})}else return null}}C.empty=new C(A,A);const bn=[{key:"Mod-z",run:Le,preventDefault:!0},{key:"Mod-y",mac:"Mod-Shift-z",run:Y,preventDefault:!0},{linux:"Ctrl-Shift-z",run:Y,preventDefault:!0},{key:"Mod-u",run:pt,preventDefault:!0},{key:"Alt-u",mac:"Mod-Shift-u",run:gt,preventDefault:!0}];function I(e,t){return h.create(e.ranges.map(t),e.mainIndex)}function S(e,t){return e.update({selection:t,scrollIntoView:!0,userEvent:"select"})}function y({state:e,dispatch:t},n){let r=I(e.selection,n);return r.eq(e.selection,!0)?!1:(t(S(e,r)),!0)}function M(e,t){return h.cursor(t?e.to:e.from)}function J(e,t){return y(e,n=>n.empty?e.moveByChar(n,t):M(n,t))}function m(e){return e.textDirectionAt(e.state.selection.main.head)==lt.LTR}const Te=e=>J(e,!m(e)),Oe=e=>J(e,m(e)),En=e=>J(e,!0),Tn=e=>J(e,!1);function oe(e,t,n){let r=t.head,l=e.doc.lineAt(r);return r==(n?l.to:l.from)?r=n?Math.min(e.doc.length,l.to+1):Math.max(0,l.from-1):r=l.from+T(l.text,r-l.from,n),h.cursor(r,n?-1:1)}function Ie(e,t){return y(e,n=>n.empty?oe(e.state,n,t):M(n,t))}const On=e=>Ie(e,!0),In=e=>Ie(e,!1);function w(e,t){return y(e,n=>n.empty?e.moveByGroup(n,t):M(n,t))}const Dt=e=>w(e,!m(e)),xt=e=>w(e,m(e)),vn=e=>w(e,!0),Rn=e=>w(e,!1);function le(e,t,n){let r=e.state.charCategorizer(t),l=r(n),o=l!=D.Space;return s=>{let c=r(s);return c!=D.Space?o&&c==l:(o=!1,!0)}}const Fn=e=>y(e,t=>t.empty?e.moveByChar(t,!0,n=>le(e,t.head,n)):M(t,!0)),ue=typeof Intl<"u"&&Intl.Segmenter?new Intl.Segmenter(void 0,{granularity:"word"}):null;function ve(e,t,n){let r=e.state.charCategorizer(t.from),l=D.Space,o=t.from,s=0,c=!1,i=!1,f=!1,u=d=>{if(c)return!1;o+=n?d.length:-d.length;let B=r(d),k;if(B==D.Word&&d.charCodeAt(0)<128&&/[\W_]/.test(d)&&(B=-1),l==D.Space&&(l=B),l!=B)return!1;if(l==D.Word)if(d.toLowerCase()==d){if(!n&&i)return!1;f=!0}else if(f){if(n)return!1;c=!0}else{if(i&&n&&r(k=e.state.sliceDoc(o,o+1))==D.Word&&k.toLowerCase()==k)return!1;i=!0}return s++,!0},a=e.moveByChar(t,n,d=>(u(d),u));if(ue&&l==D.Word&&a.from==t.from+s*(n?1:-1)){let d=Math.min(t.head,a.head),B=Math.max(t.head,a.head),k=e.state.sliceDoc(d,B);if(k.length>1&&/[\u4E00-\uffff]/.test(k)){let R=Array.from(ue.segment(k));if(R.length>1)return n?h.cursor(t.head+R[1].index,-1):h.cursor(a.head+R[R.length-1].index,1)}}return a}function Re(e,t){return y(e,n=>n.empty?ve(e,n,t):M(n,t))}const Gn=e=>Re(e,!0),Un=e=>Re(e,!1);function Lt(e,t,n){if(t.type.prop(n))return!0;let r=t.to-t.from;return r&&(r>2||/[^\s,.;:]/.test(e.sliceDoc(t.from,t.to)))||t.firstChild}function z(e,t,n){let r=te(e).resolveInner(t.head),l=n?Q.closedBy:Q.openedBy;for(let i=t.head;;){let f=n?r.childAfter(i):r.childBefore(i);if(!f)break;Lt(e,f,l)?r=f:i=n?f.to:f.from}let o=r.type.prop(l),s,c;return o&&(s=n?E(e,r.from,1):E(e,r.to,-1))&&s.matched?c=n?s.end.to:s.end.from:c=n?r.to:r.from,h.cursor(c,n?-1:1)}const Mt=e=>y(e,t=>z(e.state,t,!m(e))),bt=e=>y(e,t=>z(e.state,t,m(e)));function Fe(e,t){return y(e,n=>{if(!n.empty)return M(n,t);let r=e.moveVertically(n,t);return r.head!=n.head?r:e.moveToLineBoundary(n,t)})}const Ge=e=>Fe(e,!1),Ue=e=>Fe(e,!0);function Ve(e){let t=e.scrollDOM.clientHeight<e.scrollDOM.scrollHeight-2,n=0,r=0,l;if(t){for(let o of e.state.facet(O.scrollMargins)){let s=o(e);s!=null&&s.top&&(n=Math.max(s==null?void 0:s.top,n)),s!=null&&s.bottom&&(r=Math.max(s==null?void 0:s.bottom,r))}l=e.scrollDOM.clientHeight-n-r}else l=(e.dom.ownerDocument.defaultView||window).innerHeight;return{marginTop:n,marginBottom:r,selfScroll:t,height:Math.max(e.defaultLineHeight,l-5)}}function Ne(e,t){let n=Ve(e),{state:r}=e,l=I(r.selection,s=>s.empty?e.moveVertically(s,t,n.height):M(s,t));if(l.eq(r.selection))return!1;let o;if(n.selfScroll){let s=e.coordsAtPos(r.selection.main.head),c=e.scrollDOM.getBoundingClientRect(),i=c.top+n.marginTop,f=c.bottom-n.marginBottom;s&&s.top>i&&s.bottom<f&&(o=O.scrollIntoView(l.main.head,{y:"start",yMargin:s.top-i}))}return e.dispatch(S(r,l),{effects:o}),!0}const fe=e=>Ne(e,!1),Z=e=>Ne(e,!0);function x(e,t,n){let r=e.lineBlockAt(t.head),l=e.moveToLineBoundary(t,n);if(l.head==t.head&&l.head!=(n?r.to:r.from)&&(l=e.moveToLineBoundary(t,n,!1)),!n&&l.head==r.from&&r.length){let o=/^\s*/.exec(e.state.sliceDoc(r.from,Math.min(r.from+100,r.to)))[0].length;o&&t.head!=r.from+o&&(l=h.cursor(r.from+o))}return l}const Et=e=>y(e,t=>x(e,t,!0)),Tt=e=>y(e,t=>x(e,t,!1)),Ot=e=>y(e,t=>x(e,t,!m(e))),It=e=>y(e,t=>x(e,t,m(e))),vt=e=>y(e,t=>h.cursor(e.lineBlockAt(t.head).from,1)),Rt=e=>y(e,t=>h.cursor(e.lineBlockAt(t.head).to,-1));function Pe(e,t,n){let r=!1,l=I(e.selection,o=>{let s=E(e,o.head,-1)||E(e,o.head,1)||o.head>0&&E(e,o.head-1,1)||o.head<e.doc.length&&E(e,o.head+1,-1);if(!s||!s.end)return o;r=!0;let c=s.start.from==o.head?s.end.to:s.end.from;return n?h.range(o.anchor,c):h.cursor(c)});return r?(t(S(e,l)),!0):!1}const Ft=({state:e,dispatch:t})=>Pe(e,t,!1),Vn=({state:e,dispatch:t})=>Pe(e,t,!0);function p(e,t,n){let r=I(e.state.selection,l=>{l.undirectional&&l.head>=l.anchor!=t&&(l=h.range(l.head,l.anchor));let o=n(l);return h.range(l.anchor,o.head,o.goalColumn,o.bidiLevel||void 0,o.assoc)});return r.eq(e.state.selection)?!1:(e.dispatch(S(e.state,r)),!0)}function W(e,t){return p(e,t,n=>e.moveByChar(n,t))}const Je=e=>W(e,!m(e)),we=e=>W(e,m(e)),Nn=e=>W(e,!0),Pn=e=>W(e,!1),Jn=e=>p(e,!0,t=>oe(e.state,t,!0)),wn=e=>p(e,!1,t=>oe(e.state,t,!1));function H(e,t){return p(e,t,n=>e.moveByGroup(n,t))}const Gt=e=>H(e,!m(e)),Ut=e=>H(e,m(e)),zn=e=>H(e,!0),Wn=e=>H(e,!1),Hn=e=>p(e,!0,t=>e.moveByChar(t,!0,n=>le(e,t.head,n)));function ze(e,t){return p(e,t,n=>ve(e,n,t))}const qn=e=>ze(e,!0),Kn=e=>ze(e,!1),Vt=e=>{let t=!m(e);return p(e,t,n=>z(e.state,n,t))},Nt=e=>{let t=m(e);return p(e,t,n=>z(e.state,n,t))};function We(e,t){return p(e,t,n=>e.moveVertically(n,t))}const He=e=>We(e,!1),qe=e=>We(e,!0);function Ke(e,t){return p(e,t,n=>e.moveVertically(n,t,Ve(e).height))}const ae=e=>Ke(e,!1),he=e=>Ke(e,!0),Pt=e=>p(e,!0,t=>x(e,t,!0)),Jt=e=>p(e,!1,t=>x(e,t,!1)),wt=e=>{let t=!m(e);return p(e,t,n=>x(e,n,t))},zt=e=>{let t=m(e);return p(e,t,n=>x(e,n,t))},Wt=e=>p(e,!1,t=>h.cursor(e.lineBlockAt(t.head).from)),Ht=e=>p(e,!0,t=>h.cursor(e.lineBlockAt(t.head).to)),de=({state:e,dispatch:t})=>(t(S(e,{anchor:0})),!0),me=({state:e,dispatch:t})=>(t(S(e,{anchor:e.doc.length})),!0),pe=({state:e,dispatch:t})=>(t(S(e,{anchor:e.selection.main.anchor,head:0})),!0),ge=({state:e,dispatch:t})=>(t(S(e,{anchor:e.selection.main.anchor,head:e.doc.length})),!0),qt=({state:e,dispatch:t})=>(t(e.update({selection:{anchor:0,head:e.doc.length},userEvent:"select"})),!0),Kt=({state:e,dispatch:t})=>{let n=q(e).map(({from:r,to:l})=>h.range(r,Math.min(l+1,e.doc.length)));return t(e.update({selection:h.create(n),userEvent:"select"})),!0},$t=({state:e,dispatch:t})=>{let n=I(e.selection,r=>{let l=te(e),o=l.resolveStack(r.from,1);if(r.empty){let s=l.resolveStack(r.from,-1);s.node.from>=o.node.from&&s.node.to<=o.node.to&&(o=s)}for(let s=o;s;s=s.next){let{node:c}=s;if((c.from<r.from&&c.to>=r.to||c.to>r.to&&c.from<=r.from)&&s.next)return h.range(c.to,c.from)}return r});return n.eq(e.selection)?!1:(t(S(e,n)),!0)};function $e(e,t){let{state:n}=e,r=n.selection,l=n.selection.ranges.slice();for(let o of n.selection.ranges){let s=n.doc.lineAt(o.head);if(t?s.to<e.state.doc.length:s.from>0)for(let c=o;;){let i=e.moveVertically(c,t);if(i.head<s.from||i.head>s.to){l.some(f=>f.head==i.head)||l.push(i);break}else{if(i.head==c.head)break;c=i}}}return l.length==r.ranges.length?!1:(e.dispatch(S(n,h.create(l,l.length-1))),!0)}const jt=e=>$e(e,!1),Qt=e=>$e(e,!0),Xt=({state:e,dispatch:t})=>{let n=e.selection,r=null;return n.ranges.length>1?r=h.create([n.main]):n.main.empty||(r=h.create([h.cursor(n.main.head)])),r?(t(S(e,r)),!0):!1};function b(e,t){if(e.state.readOnly)return!1;let n="delete.selection",{state:r}=e,l=r.changeByRange(o=>{let{from:s,to:c}=o;if(s==c){let i=t(o);i<s?(n="delete.backward",i=F(e,i,!1)):i>s&&(n="delete.forward",i=F(e,i,!0)),s=Math.min(s,i),c=Math.max(c,i)}else s=F(e,s,!1),c=F(e,c,!0);return s==c?{range:o}:{changes:{from:s,to:c},range:h.cursor(s,s<o.head?-1:1)}});return l.changes.empty?!1:(e.dispatch(r.update(l,{scrollIntoView:!0,userEvent:n,effects:n=="delete.selection"?O.announce.of(r.phrase("Selection deleted")):void 0})),!0)}function F(e,t,n){if(e instanceof O)for(let r of e.state.facet(O.atomicRanges).map(l=>l(e)))r.between(t,t,(l,o)=>{l<t&&o>t&&(t=n?o:l)});return t}const se=(e,t,n)=>b(e,r=>{let l=r.from,{state:o}=e,s=o.doc.lineAt(l),c,i;if(n&&!t&&l>s.from&&l<s.from+200&&!/[^ \t]/.test(c=s.text.slice(0,l-s.from))){if(c[c.length-1]==" ")return l-1;let f=ee(c,o.tabSize),u=f%j(o)||j(o);for(let a=0;a<u&&c[c.length-1-a]==" ";a++)l--;i=l}else i=T(s.text,l-s.from,t,t)+s.from,i==l&&s.number!=(t?o.doc.lines:1)?i+=t?1:-1:!t&&/[\ufe00-\ufe0f]/.test(s.text.slice(i-s.from,l-s.from))&&(i=T(s.text,i-s.from,!1,!1)+s.from);return i}),_=e=>se(e,!1,!0),$n=e=>se(e,!1,!1),je=e=>se(e,!0,!1),Qe=(e,t)=>b(e,n=>{let r=n.head,{state:l}=e,o=l.doc.lineAt(r),s=l.charCategorizer(r);for(let c=null;;){if(r==(t?o.to:o.from)){r==n.head&&o.number!=(t?l.doc.lines:1)&&(r+=t?1:-1);break}let i=T(o.text,r-o.from,t)+o.from,f=o.text.slice(Math.min(r,i)-o.from,Math.max(r,i)-o.from),u=s(f);if(c!=null&&u!=c)break;(f!=" "||r!=n.head)&&(c=u),r=i}return r}),Xe=e=>Qe(e,!1),Yt=e=>Qe(e,!0),jn=e=>b(e,t=>e.moveByChar(t,!0,n=>le(e,t.head,n)).head),Zt=e=>b(e,t=>{let n=e.lineBlockAt(t.head).to;return t.head<n?n:Math.min(e.state.doc.length,t.head+1)}),Qn=e=>b(e,t=>{let n=e.lineBlockAt(t.head).from;return t.head>n?n:Math.max(0,t.head-1)}),_t=e=>b(e,t=>{let n=e.moveToLineBoundary(t,!1).head;return t.head>n?n:Math.max(0,t.head-1)}),en=e=>b(e,t=>{let n=e.moveToLineBoundary(t,!0).head;return t.head<n?n:Math.min(e.state.doc.length,t.head+1)}),Xn=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=[];for(let r=0,l="",o=e.doc.iter();;){if(o.next(),o.lineBreak||o.done){let s=l.search(/\s+$/);if(s>-1&&n.push({from:r-(l.length-s),to:r}),o.done)break;l=""}else l=o.value;r+=o.value.length}return n.length?(t(e.update({changes:n,userEvent:"delete"})),!0):!1},tn=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange(r=>({changes:{from:r.from,to:r.to,insert:ke.of(["",""])},range:h.cursor(r.from)}));return t(e.update(n,{scrollIntoView:!0,userEvent:"input"})),!0},nn=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange(r=>{if(!r.empty||r.from==0||r.from==e.doc.length)return{range:r};let l=r.from,o=e.doc.lineAt(l),s=l==o.from?l-1:T(o.text,l-o.from,!1)+o.from,c=l==o.to?l+1:T(o.text,l-o.from,!0)+o.from;return{changes:{from:s,to:c,insert:e.doc.slice(l,c).append(e.doc.slice(s,l))},range:h.cursor(c)}});return n.changes.empty?!1:(t(e.update(n,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function q(e){let t=[],n=-1;for(let r of e.selection.ranges){let l=e.doc.lineAt(r.from),o=e.doc.lineAt(r.to);if(!r.empty&&r.to==o.from&&(o=e.doc.lineAt(r.to-1)),n>=l.number){let s=t[t.length-1];s.to=o.to,s.ranges.push(r)}else t.push({from:l.from,to:o.to,ranges:[r]});n=o.number+1}return t}function Ye(e,t,n){if(e.readOnly)return!1;let r=[],l=[];for(let o of q(e)){if(n?o.to==e.doc.length:o.from==0)continue;let s=e.doc.lineAt(n?o.to+1:o.from-1),c=s.length+1;if(n){r.push({from:o.to,to:s.to},{from:o.from,insert:s.text+e.lineBreak});for(let i of o.ranges)l.push(h.range(Math.min(e.doc.length,i.anchor+c),Math.min(e.doc.length,i.head+c)))}else{r.push({from:s.from,to:o.from},{from:o.to,insert:e.lineBreak+s.text});for(let i of o.ranges)l.push(h.range(i.anchor-c,i.head-c))}}return r.length?(t(e.update({changes:r,scrollIntoView:!0,selection:h.create(l,e.selection.mainIndex),userEvent:"move.line"})),!0):!1}const rn=({state:e,dispatch:t})=>Ye(e,t,!1),on=({state:e,dispatch:t})=>Ye(e,t,!0);function Ze(e,t,n){if(e.readOnly)return!1;let r=[];for(let o of q(e))n?r.push({from:o.from,insert:e.doc.slice(o.from,o.to)+e.lineBreak}):r.push({from:o.to,insert:e.lineBreak+e.doc.slice(o.from,o.to)});let l=e.changes(r);return t(e.update({changes:l,selection:e.selection.map(l,n?1:-1),scrollIntoView:!0,userEvent:"input.copyline"})),!0}const ln=({state:e,dispatch:t})=>Ze(e,t,!1),sn=({state:e,dispatch:t})=>Ze(e,t,!0),cn=e=>{if(e.state.readOnly)return!1;let{state:t}=e,n=t.changes(q(t).map(({from:l,to:o})=>(l>0?l--:o<t.doc.length&&o++,{from:l,to:o}))),r=I(t.selection,l=>{let o;if(e.lineWrapping){let s=e.lineBlockAt(l.head),c=e.coordsAtPos(l.head,l.assoc||1);c&&(o=s.bottom+e.documentTop-c.bottom+e.defaultLineHeight/2)}return e.moveVertically(l,!0,o)}).map(n);return e.dispatch({changes:n,selection:r,scrollIntoView:!0,userEvent:"delete.line"}),!0},Yn=({state:e,dispatch:t})=>(t(e.update(e.replaceSelection(e.lineBreak),{scrollIntoView:!0,userEvent:"input"})),!0),Zn=({state:e,dispatch:t})=>(t(e.update(e.changeByRange(n=>{let r=/^\s*/.exec(e.doc.lineAt(n.from).text)[0];return{changes:{from:n.from,to:n.to,insert:e.lineBreak+r},range:h.cursor(n.from+r.length+1)}}),{scrollIntoView:!0,userEvent:"input"})),!0);function un(e,t){if(/\(\)|\[\]|\{\}/.test(e.sliceDoc(t-1,t+1)))return{from:t,to:t};let n=te(e).resolveInner(t),r=n.childBefore(t),l=n.childAfter(t),o;return r&&l&&r.to<=t&&l.from>=t&&(o=r.type.prop(Q.closedBy))&&o.indexOf(l.name)>-1&&e.doc.lineAt(r.to).from==e.doc.lineAt(l.from).from&&!/\S/.test(e.sliceDoc(r.to,l.from))?{from:r.to,to:l.from}:null}const ye=_e(!1),fn=_e(!0);function _e(e){return({state:t,dispatch:n})=>{if(t.readOnly)return!1;let r=t.changeByRange(l=>{let{from:o,to:s}=l,c=t.doc.lineAt(o),i=!e&&o==s&&un(t,o);e&&(o=s=(s<=c.to?c:t.doc.lineAt(s)).to);let f=new Ce(t,{simulateBreak:o,simulateDoubleBreak:!!i}),u=De(f,o);for(u==null&&(u=ee(/^\s*/.exec(t.doc.lineAt(o).text)[0],t.tabSize));s<c.to&&/\s/.test(c.text[s-c.from]);)s++;i?{from:o,to:s}=i:o>c.from&&o<c.from+100&&!/\S/.test(c.text.slice(0,o))&&(o=c.from);let a=["",G(t,u)];return i&&a.push(G(t,f.lineIndent(c.from,-1))),{changes:{from:o,to:s,insert:ke.of(a)},range:h.cursor(o+1+a[1].length)}});return n(t.update(r,{scrollIntoView:!0,userEvent:"input"})),!0}}function ce(e,t){let n=-1;return e.changeByRange(r=>{let l=[];for(let s=r.from;s<=r.to;){let c=e.doc.lineAt(s);c.number>n&&(r.empty||r.to>c.from)&&(t(c,l,r),n=c.number),s=c.to+1}let o=e.changes(l);return{changes:l,range:h.range(o.mapPos(r.anchor,1),o.mapPos(r.head,1))}})}const an=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=Object.create(null),r=new Ce(e,{overrideIndentation:o=>{let s=n[o];return s??-1}}),l=ce(e,(o,s,c)=>{let i=De(r,o.from);if(i==null)return;/\S/.test(o.text)||(i=0);let f=/^\s*/.exec(o.text)[0],u=G(e,i);(f!=u||c.from<o.from+f.length)&&(n[o.from]=i,s.push({from:o.from,to:o.from+f.length,insert:u}))});return l.changes.empty||t(e.update(l,{userEvent:"indent"})),!0},ie=({state:e,dispatch:t})=>e.readOnly?!1:(t(e.update(ce(e,(n,r)=>{r.push({from:n.from,insert:e.facet(st)})}),{userEvent:"input.indent"})),!0),et=({state:e,dispatch:t})=>e.readOnly?!1:(t(e.update(ce(e,(n,r)=>{let l=/^\s*/.exec(n.text)[0];if(!l)return;let o=ee(l,e.tabSize),s=0,c=G(e,Math.max(0,o-j(e)));for(;s<l.length&&s<c.length&&l.charCodeAt(s)==c.charCodeAt(s);)s++;r.push({from:n.from+s,to:n.from+l.length,insert:c.slice(s)})}),{userEvent:"delete.dedent"})),!0),hn=e=>(e.setTabFocusMode(),!0),_n=e=>(e.setTabFocusMode(2e3),!0),er=({state:e,dispatch:t})=>e.selection.ranges.some(n=>!n.empty)?ie({state:e,dispatch:t}):(t(e.update(e.replaceSelection(" "),{scrollIntoView:!0,userEvent:"input"})),!0),dn=[{key:"Ctrl-b",run:Te,shift:Je,preventDefault:!0},{key:"Ctrl-f",run:Oe,shift:we},{key:"Ctrl-p",run:Ge,shift:He},{key:"Ctrl-n",run:Ue,shift:qe},{key:"Ctrl-a",run:vt,shift:Wt},{key:"Ctrl-e",run:Rt,shift:Ht},{key:"Ctrl-d",run:je},{key:"Ctrl-h",run:_},{key:"Ctrl-k",run:Zt},{key:"Ctrl-Alt-h",run:Xe},{key:"Ctrl-o",run:tn},{key:"Ctrl-t",run:nn},{key:"Ctrl-v",run:Z}],mn=[{key:"ArrowLeft",run:Te,shift:Je,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:Dt,shift:Gt,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:Ot,shift:wt,preventDefault:!0},{key:"ArrowRight",run:Oe,shift:we,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:xt,shift:Ut,preventDefault:!0},{mac:"Cmd-ArrowRight",run:It,shift:zt,preventDefault:!0},{key:"ArrowUp",run:Ge,shift:He,preventDefault:!0},{mac:"Cmd-ArrowUp",run:de,shift:pe},{mac:"Ctrl-ArrowUp",run:fe,shift:ae},{key:"ArrowDown",run:Ue,shift:qe,preventDefault:!0},{mac:"Cmd-ArrowDown",run:me,shift:ge},{mac:"Ctrl-ArrowDown",run:Z,shift:he},{key:"PageUp",run:fe,shift:ae},{key:"PageDown",run:Z,shift:he},{key:"Home",run:Tt,shift:Jt,preventDefault:!0},{key:"Mod-Home",run:de,shift:pe},{key:"End",run:Et,shift:Pt,preventDefault:!0},{key:"Mod-End",run:me,shift:ge},{key:"Enter",run:ye,shift:ye},{key:"Mod-a",run:qt},{key:"Backspace",run:_,shift:_,preventDefault:!0},{key:"Delete",run:je,preventDefault:!0},{key:"Mod-Backspace",mac:"Alt-Backspace",run:Xe,preventDefault:!0},{key:"Mod-Delete",mac:"Alt-Delete",run:Yt,preventDefault:!0},{mac:"Mod-Backspace",run:_t,preventDefault:!0},{mac:"Mod-Delete",run:en,preventDefault:!0}].concat(dn.map(e=>({mac:e.key,run:e.run,shift:e.shift}))),tr=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:Mt,shift:Vt},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:bt,shift:Nt},{key:"Alt-ArrowUp",run:rn},{key:"Shift-Alt-ArrowUp",run:ln},{key:"Alt-ArrowDown",run:on},{key:"Shift-Alt-ArrowDown",run:sn},{key:"Mod-Alt-ArrowUp",run:jt},{key:"Mod-Alt-ArrowDown",run:Qt},{key:"Escape",run:Xt},{key:"Mod-Enter",run:fn},{key:"Alt-l",mac:"Ctrl-l",run:Kt},{key:"Mod-i",run:$t,preventDefault:!0},{key:"Mod-[",run:et},{key:"Mod-]",run:ie},{key:"Mod-Alt-\\",run:an},{key:"Shift-Mod-k",run:cn},{key:"Shift-Mod-\\",run:Ft},{key:"Mod-/",run:ct},{key:"Alt-A",run:ut},{key:"Ctrl-m",mac:"Shift-Alt-m",run:hn}].concat(mn),nr={key:"Tab",run:ie,shift:et};export{jt as addCursorAbove,Qt as addCursorBelow,Sn as blockComment,Cn as blockUncomment,sn as copyLineDown,ln as copyLineUp,Tn as cursorCharBackward,In as cursorCharBackwardLogical,En as cursorCharForward,On as cursorCharForwardLogical,Te as cursorCharLeft,Oe as cursorCharRight,me as cursorDocEnd,de as cursorDocStart,Rn as cursorGroupBackward,vn as cursorGroupForward,Fn as cursorGroupForwardWin,Dt as cursorGroupLeft,xt as cursorGroupRight,Tt as cursorLineBoundaryBackward,Et as cursorLineBoundaryForward,Ot as cursorLineBoundaryLeft,It as cursorLineBoundaryRight,Ue as cursorLineDown,Rt as cursorLineEnd,vt as cursorLineStart,Ge as cursorLineUp,Ft as cursorMatchingBracket,Z as cursorPageDown,fe as cursorPageUp,Un as cursorSubwordBackward,Gn as cursorSubwordForward,Mt as cursorSyntaxLeft,bt as cursorSyntaxRight,tr as defaultKeymap,_ as deleteCharBackward,$n as deleteCharBackwardStrict,je as deleteCharForward,Xe as deleteGroupBackward,Yt as deleteGroupForward,jn as deleteGroupForwardWin,cn as deleteLine,_t as deleteLineBoundaryBackward,en as deleteLineBoundaryForward,Zt as deleteToLineEnd,Qn as deleteToLineStart,Xn as deleteTrailingWhitespace,dn as emacsStyleKeymap,Dn as history,xn as historyField,bn as historyKeymap,et as indentLess,ie as indentMore,an as indentSelection,nr as indentWithTab,fn as insertBlankLine,Yn as insertNewline,ye as insertNewlineAndIndent,Zn as insertNewlineKeepIndent,er as insertTab,mt as invertedEffects,dt as isolateHistory,An as lineComment,Bn as lineUncomment,on as moveLineDown,rn as moveLineUp,Y as redo,Mn as redoDepth,gt as redoSelection,qt as selectAll,Pn as selectCharBackward,wn as selectCharBackwardLogical,Nn as selectCharForward,Jn as selectCharForwardLogical,Je as selectCharLeft,we as selectCharRight,ge as selectDocEnd,pe as selectDocStart,Wn as selectGroupBackward,zn as selectGroupForward,Hn as selectGroupForwardWin,Gt as selectGroupLeft,Ut as selectGroupRight,Kt as selectLine,Jt as selectLineBoundaryBackward,Pt as selectLineBoundaryForward,wt as selectLineBoundaryLeft,zt as selectLineBoundaryRight,qe as selectLineDown,Ht as selectLineEnd,Wt as selectLineStart,He as selectLineUp,Vn as selectMatchingBracket,he as selectPageDown,ae as selectPageUp,$t as selectParentSyntax,Kn as selectSubwordBackward,qn as selectSubwordForward,Vt as selectSyntaxLeft,Nt as selectSyntaxRight,Xt as simplifySelection,tn as splitLine,mn as standardKeymap,_n as temporarilySetTabFocusMode,ut as toggleBlockComment,ft as toggleBlockCommentByLine,ct as toggleComment,it as toggleLineComment,hn as toggleTabFocusMode,nn as transposeChars,Le as undo,Ln as undoDepth,pt as undoSelection};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{N as b,e as Be,c as C,h as Me,I as Z,f as M,P as Ne,a as X,t as u,s as Fe}from"./index-DhmD70Mu.js";import{RangeSetBuilder as fe,RangeSet as Ee,EditorState as I,countColumn as Le,Facet as y,StateField as ce,StateEffect as L,Prec as He,combineConfig as ue}from"./index-BHot-lnj.js";import{V as H,u as We,E as w,G as Re,D as g,S as _,q as Ue,W as he,o as ee}from"./index-891wE-Rj.js";var $;const A=new b;function $e(n){return y.define({combine:n?e=>e.concat(n):void 0})}const qe=new b;class m{constructor(e,t,r=[],i=""){this.data=e,this.name=i,I.prototype.hasOwnProperty("tree")||Object.defineProperty(I.prototype,"tree",{get(){return k(this)}}),this.parser=t,this.extension=[x.of(this),I.languageData.of((s,o,l)=>{let a=te(s,o,l),f=a.type.prop(A);if(!f)return[];let c=s.facet(f),h=a.type.prop(qe);if(h){let p=a.resolve(o-a.from,l);for(let d of h)if(d.test(p,s)){let S=s.facet(d.facet);return d.type=="replace"?S:S.concat(c)}}return c})].concat(r)}isActiveAt(e,t,r=-1){return te(e,t,r).type.prop(A)==this.data}findRegions(e){let t=e.facet(x);if((t==null?void 0:t.data)==this.data)return[{from:0,to:e.doc.length}];if(!t||!t.allowsNesting)return[];let r=[],i=(s,o)=>{if(s.prop(A)==this.data){r.push({from:o,to:o+s.length});return}let l=s.prop(b.mounted);if(l){if(l.tree.prop(A)==this.data){if(l.overlay)for(let a of l.overlay)r.push({from:a.from+o,to:a.to+o});else r.push({from:o,to:o+s.length});return}else if(l.overlay){let a=r.length;if(i(l.tree,l.overlay[0].from+o),r.length>a)return}}for(let a=0;a<s.children.length;a++){let f=s.children[a];f instanceof C&&i(f,s.positions[a]+o)}};return i(k(e),0),r}get allowsNesting(){return!0}}m.setState=L.define();function te(n,e,t){let r=n.facet(x),i=k(n).topNode;if(!r||r.allowsNesting)for(let s=i;s;s=s.enter(e,t,Z.ExcludeBuffers|Z.EnterBracketed))s.type.isTop&&(i=s);return i}class V extends m{constructor(e,t,r){super(e,t,[],r),this.parser=t}static define(e){let t=$e(e.languageData);return new V(t,e.parser.configure({props:[A.add(r=>r.isTop?t:void 0)]}),e.name)}configure(e,t){return new V(this.data,this.parser.configure(e),t||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function k(n){let e=n.field(m.state,!1);return e?e.tree:C.empty}class je{constructor(e){this.doc=e,this.cursorPos=0,this.string="",this.cursor=e.iter()}get length(){return this.doc.length}syncTo(e){return this.string=this.cursor.next(e-this.cursorPos).value,this.cursorPos=e+this.string.length,this.cursorPos-this.string.length}chunk(e){return this.syncTo(e),this.string}get lineChunks(){return!0}read(e,t){let r=this.cursorPos-this.string.length;return e<r||t>=this.cursorPos?this.doc.sliceString(e,t):this.string.slice(e-r,t-r)}}let D=null;class N{constructor(e,t,r=[],i,s,o,l,a){this.parser=e,this.state=t,this.fragments=r,this.tree=i,this.treeLen=s,this.viewport=o,this.skipped=l,this.scheduleOn=a,this.parse=null,this.tempSkipped=[]}static create(e,t,r){return new N(e,t,[],C.empty,0,r,[],null)}startParse(){return this.parser.startParse(new je(this.state.doc),this.fragments)}work(e,t){return t!=null&&t>=this.state.doc.length&&(t=void 0),this.tree!=C.empty&&this.isDone(t??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var r;if(typeof e=="number"){let i=Date.now()+e;e=()=>Date.now()>i}for(this.parse||(this.parse=this.startParse()),t!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>t)&&t<this.state.doc.length&&this.parse.stopAt(t);;){let i=this.parse.advance();if(i)if(this.fragments=this.withoutTempSkipped(M.addTree(i,this.fragments,this.parse.stoppedAt!=null)),this.treeLen=(r=this.parse.stoppedAt)!==null&&r!==void 0?r:this.state.doc.length,this.tree=i,this.parse=null,this.treeLen<(t??this.state.doc.length))this.parse=this.startParse();else return!0;if(e())return!1}})}takeTree(){let e,t;this.parse&&(e=this.parse.parsedPos)>=this.treeLen&&((this.parse.stoppedAt==null||this.parse.stoppedAt>e)&&this.parse.stopAt(e),this.withContext(()=>{for(;!(t=this.parse.advance()););}),this.treeLen=e,this.tree=t,this.fragments=this.withoutTempSkipped(M.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let t=D;D=this;try{return e()}finally{D=t}}withoutTempSkipped(e){for(let t;t=this.tempSkipped.pop();)e=ne(e,t.from,t.to);return e}changes(e,t){let{fragments:r,tree:i,treeLen:s,viewport:o,skipped:l}=this;if(this.takeTree(),!e.empty){let a=[];if(e.iterChangedRanges((f,c,h,p)=>a.push({fromA:f,toA:c,fromB:h,toB:p})),r=M.applyChanges(r,a),i=C.empty,s=0,o={from:e.mapPos(o.from,-1),to:e.mapPos(o.to,1)},this.skipped.length){l=[];for(let f of this.skipped){let c=e.mapPos(f.from,1),h=e.mapPos(f.to,-1);c<h&&l.push({from:c,to:h})}}}return new N(this.parser,t,r,i,s,o,l,this.scheduleOn)}updateViewport(e){if(this.viewport.from==e.from&&this.viewport.to==e.to)return!1;this.viewport=e;let t=this.skipped.length;for(let r=0;r<this.skipped.length;r++){let{from:i,to:s}=this.skipped[r];i<e.to&&s>e.from&&(this.fragments=ne(this.fragments,i,s),this.skipped.splice(r--,1))}return this.skipped.length>=t?!1:(this.reset(),!0)}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(e,t){this.skipped.push({from:e,to:t})}static getSkippingParser(e){return new class extends Ne{createParse(t,r,i){let s=i[0].from,o=i[i.length-1].to;return{parsedPos:s,advance(){let a=D;if(a){for(let f of i)a.tempSkipped.push(f);e&&(a.scheduleOn=a.scheduleOn?Promise.all([a.scheduleOn,e]):e)}return this.parsedPos=o,new C(X.none,[],[],o-s)},stoppedAt:null,stopAt(){}}}}}isDone(e){e=Math.min(e,this.state.doc.length);let t=this.fragments;return this.treeLen>=e&&t.length&&t[0].from==0&&t[0].to>=e}static get(){return D}}function ne(n,e,t){return M.applyChanges(n,[{fromA:e,toA:t,fromB:e,toB:t}])}class P{constructor(e){this.context=e,this.tree=e.tree}apply(e){if(!e.docChanged&&this.tree==this.context.tree)return this;let t=this.context.changes(e.changes,e.state),r=this.context.treeLen==e.startState.doc.length?void 0:Math.max(e.changes.mapPos(this.context.treeLen),t.viewport.to);return t.work(20,r)||t.takeTree(),new P(t)}static init(e){let t=Math.min(3e3,e.doc.length),r=N.create(e.facet(x).parser,e,{from:0,to:t});return r.work(20,t)||r.takeTree(),new P(r)}}m.state=ce.define({create:P.init,update(n,e){for(let t of e.effects)if(t.is(m.setState))return t.value;return e.startState.facet(x)!=e.state.facet(x)?P.init(e.state):n.apply(e)}});let de=n=>{let e=setTimeout(()=>n(),500);return()=>clearTimeout(e)};typeof requestIdleCallback<"u"&&(de=n=>{let e=-1,t=setTimeout(()=>{e=requestIdleCallback(n,{timeout:400})},100);return()=>e<0?clearTimeout(t):cancelIdleCallback(e)});const q=typeof navigator<"u"&&(!(($=navigator.scheduling)===null||$===void 0)&&$.isInputPending)?()=>navigator.scheduling.isInputPending():null,ze=H.fromClass(class{constructor(e){this.view=e,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(e){let t=this.view.state.field(m.state).context;(t.updateViewport(e.view.viewport)||this.view.viewport.to>t.treeLen)&&this.scheduleWork(),(e.docChanged||e.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(t)}scheduleWork(){if(this.working)return;let{state:e}=this.view,t=e.field(m.state);(t.tree!=t.context.tree||!t.context.isDone(e.doc.length))&&(this.working=de(this.work))}work(e){this.working=null;let t=Date.now();if(this.chunkEnd<t&&(this.chunkEnd<0||this.view.hasFocus)&&(this.chunkEnd=t+3e4,this.chunkBudget=3e3),this.chunkBudget<=0)return;let{state:r,viewport:{to:i}}=this.view,s=r.field(m.state);if(s.tree==s.context.tree&&s.context.isDone(i+1e5))return;let o=Date.now()+Math.min(this.chunkBudget,100,e&&!q?Math.max(25,e.timeRemaining()-5):1e9),l=s.context.treeLen<i&&r.doc.length>i+1e3,a=s.context.work(()=>q&&q()||Date.now()>o,i+(l?0:1e5));this.chunkBudget-=Date.now()-t,(a||this.chunkBudget<=0)&&(s.context.takeTree(),this.view.dispatch({effects:m.setState.of(new P(s.context))})),this.chunkBudget>0&&!(a&&!l)&&this.scheduleWork(),this.checkAsyncSchedule(s.context)}checkAsyncSchedule(e){e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(t=>Ue(this.view.state,t)).then(()=>this.workScheduled--),e.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),x=y.define({combine(n){return n.length?n[0]:null},enables:n=>[m.state,ze,w.contentAttributes.compute([n],e=>{let t=e.facet(n);return t&&t.name?{"data-language":t.name}:{}})]});class Ft{constructor(e,t=[]){this.language=e,this.support=t,this.extension=[e,t]}}class pe{constructor(e,t,r,i,s,o=void 0){this.name=e,this.alias=t,this.extensions=r,this.filename=i,this.loadFunc=s,this.support=o,this.loading=null}load(){return this.loading||(this.loading=this.loadFunc().then(e=>this.support=e,e=>{throw this.loading=null,e}))}static of(e){let{load:t,support:r}=e;if(!t){if(!r)throw new RangeError("Must pass either 'load' or 'support' to LanguageDescription.of");t=()=>Promise.resolve(r)}return new pe(e.name,(e.alias||[]).concat(e.name).map(i=>i.toLowerCase()),e.extensions||[],e.filename,t,r)}static matchFilename(e,t){for(let i of e)if(i.filename&&i.filename.test(t))return i;let r=/\.([^.]+)$/.exec(t);if(r){for(let i of e)if(i.extensions.indexOf(r[1])>-1)return i}return null}static matchLanguageName(e,t,r=!0){t=t.toLowerCase();for(let i of e)if(i.alias.some(s=>s==t))return i;if(r)for(let i of e)for(let s of i.alias){let o=t.indexOf(s);if(o>-1&&(s.length>2||!/\w/.test(t[o-1])&&!/\w/.test(t[o+s.length])))return i}return null}}const Ge=y.define(),me=y.define({combine:n=>{if(!n.length)return" ";let e=n[0];if(!e||/\S/.test(e)||Array.from(e).some(t=>t!=e[0]))throw new Error("Invalid indent unit: "+JSON.stringify(n[0]));return e}});function Ve(n){let e=n.facet(me);return e.charCodeAt(0)==9?n.tabSize*e.length:e.length}function Je(n,e){let t="",r=n.tabSize,i=n.facet(me)[0];if(i==" "){for(;e>=r;)t+=" ",e-=r;i=" "}for(let s=0;s<e;s++)t+=i;return t}function Ke(n,e){n instanceof I&&(n=new ge(n));for(let r of n.state.facet(Ge)){let i=r(n,e);if(i!==void 0)return i}let t=k(n.state);return t.length>=e?Xe(n,t,e):null}class ge{constructor(e,t={}){this.state=e,this.options=t,this.unit=Ve(e)}lineAt(e,t=1){let r=this.state.doc.lineAt(e),{simulateBreak:i,simulateDoubleBreak:s}=this.options;return i!=null&&i>=r.from&&i<=r.to?s&&i==e?{text:"",from:e}:(t<0?i<e:i<=e)?{text:r.text.slice(i-r.from),from:i}:{text:r.text.slice(0,i-r.from),from:r.from}:r}textAfterPos(e,t=1){if(this.options.simulateDoubleBreak&&e==this.options.simulateBreak)return"";let{text:r,from:i}=this.lineAt(e,t);return r.slice(e-i,Math.min(r.length,e+100-i))}column(e,t=1){let{text:r,from:i}=this.lineAt(e,t),s=this.countColumn(r,e-i),o=this.options.overrideIndentation?this.options.overrideIndentation(i):-1;return o>-1&&(s+=o-this.countColumn(r,r.search(/\S|$/))),s}countColumn(e,t=e.length){return Le(e,this.state.tabSize,t)}lineIndent(e,t=1){let{text:r,from:i}=this.lineAt(e,t),s=this.options.overrideIndentation;if(s){let o=s(i);if(o>-1)return o}return this.countColumn(r,r.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const Qe=new b;function Xe(n,e,t){let r=e.resolveStack(t),i=e.resolveInner(t,-1).resolve(t,0).enterUnfinishedNodesBefore(t);if(i!=r.node){let s=[];for(let o=i;o&&!(o.from<r.node.from||o.to>r.node.to||o.from==r.node.from&&o.type==r.node.type);o=o.parent)s.push(o);for(let o=s.length-1;o>=0;o--)r={node:s[o],next:r}}return ke(r,n,t)}function ke(n,e,t){for(let r=n;r;r=r.next){let i=Ze(r.node);if(i)return i(Y.create(e,t,r))}return 0}function Ye(n){return n.pos==n.options.simulateBreak&&n.options.simulateDoubleBreak}function Ze(n){let e=n.type.prop(Qe);if(e)return e;let t=n.firstChild,r;if(t&&(r=t.type.prop(b.closedBy))){let i=n.lastChild,s=i&&r.indexOf(i.name)>-1;return o=>be(o,!0,1,void 0,s&&!Ye(o)?i.from:void 0)}return n.parent==null?_e:null}function _e(){return 0}class Y extends ge{constructor(e,t,r){super(e.state,e.options),this.base=e,this.pos=t,this.context=r}get node(){return this.context.node}static create(e,t,r){return new Y(e,t,r)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(e){let t=this.state.doc.lineAt(e.from);for(;;){let r=e.resolve(t.from);for(;r.parent&&r.parent.from==r.from;)r=r.parent;if(et(r,e))break;t=this.state.doc.lineAt(r.from)}return this.lineIndent(t.from)}continue(){return ke(this.context.next,this.base,this.pos)}}function et(n,e){for(let t=e;t;t=t.parent)if(n==t)return!0;return!1}function tt(n){let e=n.node,t=e.childAfter(e.from),r=e.lastChild;if(!t)return null;let i=n.options.simulateBreak,s=n.state.doc.lineAt(t.from),o=i==null||i<=s.from?s.to:Math.min(s.to,i);for(let l=t.to;;){let a=e.childAfter(l);if(!a||a==r)return null;if(!a.type.isSkipped){if(a.from>=o)return null;let f=/^ */.exec(s.text.slice(t.to-s.from))[0].length;return{from:t.from,to:t.to+f}}l=a.to}}function Et({closing:n,align:e=!0,units:t=1}){return r=>be(r,e,t,n)}function be(n,e,t,r,i){let s=n.textAfter,o=s.match(/^\s*/)[0].length,l=r&&s.slice(o,o+r.length)==r||i==n.pos+o,a=e?tt(n):null;return a?l?n.column(a.from):n.column(a.to):n.baseIndent+(l?0:n.unit*t)}const Lt=n=>n.baseIndent;function Ht({except:n,units:e=1}={}){return t=>{let r=n&&n.test(t.textAfter);return t.baseIndent+(r?0:e*t.unit)}}const nt=200;function Wt(){return I.transactionFilter.of(n=>{if(!n.docChanged||!n.isUserEvent("input.type")&&!n.isUserEvent("input.complete"))return n;let e=n.startState.languageDataAt("indentOnInput",n.startState.selection.main.head);if(!e.length)return n;let t=n.newDoc,{head:r}=n.newSelection.main,i=t.lineAt(r);if(r>i.from+nt)return n;let s=t.sliceString(i.from,r);if(!e.some(f=>f.test(s)))return n;let{state:o}=n,l=-1,a=[];for(let{head:f}of o.selection.ranges){let c=o.doc.lineAt(f);if(c.from==l)continue;l=c.from;let h=Ke(o,c.from);if(h==null)continue;let p=/^\s*/.exec(c.text)[0],d=Je(o,h);p!=d&&a.push({from:c.from,to:c.from+p.length,insert:d})}return a.length?[n,{changes:a,sequential:!0}]:n})}const rt=y.define(),it=new b;function Rt(n){let e=n.firstChild,t=n.lastChild;return e&&e.to<t.from?{from:e.to,to:t.type.isError?n.to:t.from}:null}function st(n,e,t){let r=k(n);if(r.length<t)return null;let i=r.resolveStack(t,1),s=null;for(let o=i;o;o=o.next){let l=o.node;if(l.to<=t||l.from>t)continue;if(s&&l.from<e)break;let a=l.type.prop(it);if(a&&(l.to<r.length-50||r.length==n.doc.length||!ot(l))){let f=a(l,n);f&&f.from<=t&&f.from>=e&&f.to>t&&(s=f)}}return s}function ot(n){let e=n.lastChild;return e&&e.to==n.to&&e.type.isError}function F(n,e,t){for(let r of n.facet(rt)){let i=r(n,e,t);if(i)return i}return st(n,e,t)}function ye(n,e){let t=e.mapPos(n.from,1),r=e.mapPos(n.to,-1);return t>=r?void 0:{from:t,to:r}}const W=L.define({map:ye}),O=L.define({map:ye});function we(n){let e=[];for(let{head:t}of n.state.selection.ranges)e.some(r=>r.from<=t&&r.to>=t)||e.push(n.lineBlockAt(t));return e}const v=ce.define({create(){return g.none},update(n,e){e.isUserEvent("delete")&&e.changes.iterChangedRanges((r,i)=>n=re(n,r,i)),n=n.map(e.changes);let t=[];for(let r of e.effects)r.is(W)&&!at(n,r.value.from,r.value.to)?t.push(r.value):r.is(O)&&(n=n.update({filter:(i,s)=>r.value.from!=i||r.value.to!=s,filterFrom:r.value.from,filterTo:r.value.to}));if(t.length){let{preparePlaceholder:r}=e.state.facet(Se),i=t.map(s=>(r?g.replace({widget:new dt(r(e.state,s))}):ie).range(s.from,s.to));n=n.update({add:i})}return e.selection&&(n=re(n,e.selection.main.head)),n},provide:n=>w.decorations.from(n),toJSON(n,e){let t=[];return n.between(0,e.doc.length,(r,i)=>{t.push(r,i)}),t},fromJSON(n){if(!Array.isArray(n)||n.length%2)throw new RangeError("Invalid JSON for fold state");let e=[];for(let t=0;t<n.length;){let r=n[t++],i=n[t++];if(typeof r!="number"||typeof i!="number")throw new RangeError("Invalid JSON for fold state");e.push(ie.range(r,i))}return g.set(e,!0)}});function re(n,e,t=e){let r=!1;return n.between(e,t,(i,s)=>{i<t&&s>e&&(r=!0)}),r?n.update({filterFrom:e,filterTo:t,filter:(i,s)=>i>=t||s<=e}):n}function E(n,e,t){var r;let i=null;return(r=n.field(v,!1))===null||r===void 0||r.between(e,t,(s,o)=>{(!i||i.from>s)&&(i={from:s,to:o})}),i}function at(n,e,t){let r=!1;return n.between(e,e,(i,s)=>{i==e&&s==t&&(r=!0)}),r}function xe(n,e){return n.field(v,!1)?e:e.concat(L.appendConfig.of(Te()))}const lt=n=>{for(let e of we(n)){let t=F(n.state,e.from,e.to);if(t)return n.dispatch({effects:xe(n.state,[W.of(t),ve(n,t)])}),!0}return!1},ft=n=>{if(!n.state.field(v,!1))return!1;let e=[];for(let t of we(n)){let r=E(n.state,t.from,t.to);r&&e.push(O.of(r),ve(n,r,!1))}return e.length&&n.dispatch({effects:e}),e.length>0};function ve(n,e,t=!0){let r=n.state.doc.lineAt(e.from).number,i=n.state.doc.lineAt(e.to).number;return w.announce.of(`${n.state.phrase(t?"Folded lines":"Unfolded lines")} ${r} ${n.state.phrase("to")} ${i}.`)}const ct=n=>{let{state:e}=n,t=[];for(let r=0;r<e.doc.length;){let i=n.lineBlockAt(r),s=F(e,i.from,i.to);s&&t.push(W.of(s)),r=(s?n.lineBlockAt(s.to):i).to+1}return t.length&&n.dispatch({effects:xe(n.state,t)}),!!t.length},ut=n=>{let e=n.state.field(v,!1);if(!e||!e.size)return!1;let t=[];return e.between(0,n.state.doc.length,(r,i)=>{t.push(O.of({from:r,to:i}))}),n.dispatch({effects:t}),!0},Ut=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:lt},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:ft},{key:"Ctrl-Alt-[",run:ct},{key:"Ctrl-Alt-]",run:ut}],ht={placeholderDOM:null,preparePlaceholder:null,placeholderText:"…"},Se=y.define({combine(n){return ue(n,ht)}});function Te(n){return[v,mt]}function Ce(n,e){let{state:t}=n,r=t.facet(Se),i=o=>{let l=n.lineBlockAt(n.posAtDOM(o.target)),a=E(n.state,l.from,l.to);a&&n.dispatch({effects:O.of(a)}),o.preventDefault()};if(r.placeholderDOM)return r.placeholderDOM(n,i,e);let s=document.createElement("span");return s.textContent=r.placeholderText,s.setAttribute("aria-label",t.phrase("folded code")),s.title=t.phrase("unfold"),s.className="cm-foldPlaceholder",s.onclick=i,s}const ie=g.replace({widget:new class extends he{toDOM(n){return Ce(n,null)}}});class dt extends he{constructor(e){super(),this.value=e}eq(e){return this.value==e.value}toDOM(e){return Ce(e,this.value)}}const pt={openText:"⌄",closedText:"›",markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1};class j extends Re{constructor(e,t){super(),this.config=e,this.open=t}eq(e){return this.config==e.config&&this.open==e.open}toDOM(e){if(this.config.markerDOM)return this.config.markerDOM(this.open);let t=document.createElement("span");return t.textContent=this.open?this.config.openText:this.config.closedText,t.title=e.state.phrase(this.open?"Fold line":"Unfold line"),t}}function $t(n={}){let e={...pt,...n},t=new j(e,!0),r=new j(e,!1),i=H.fromClass(class{constructor(o){this.from=o.viewport.from,this.markers=this.buildMarkers(o)}update(o){(o.docChanged||o.viewportChanged||o.startState.facet(x)!=o.state.facet(x)||o.startState.field(v,!1)!=o.state.field(v,!1)||k(o.startState)!=k(o.state)||e.foldingChanged(o))&&(this.markers=this.buildMarkers(o.view))}buildMarkers(o){let l=new fe;for(let a of o.viewportLineBlocks){let f=E(o.state,a.from,a.to)?r:F(o.state,a.from,a.to)?t:null;f&&l.add(a.from,a.from,f)}return l.finish()}}),{domEventHandlers:s}=e;return[i,We({class:"cm-foldGutter",markers(o){var l;return((l=o.plugin(i))===null||l===void 0?void 0:l.markers)||Ee.empty},initialSpacer(){return new j(e,!1)},domEventHandlers:{...s,click:(o,l,a)=>{if(s.click&&s.click(o,l,a))return!0;let f=E(o.state,l.from,l.to);if(f)return o.dispatch({effects:O.of(f)}),!0;let c=F(o.state,l.from,l.to);return c?(o.dispatch({effects:W.of(c)}),!0):!1}}}),Te()]}const mt=w.baseTheme({".cm-foldPlaceholder":{backgroundColor:"#eee",border:"1px solid #ddd",color:"#888",borderRadius:".2em",margin:"0 1px",padding:"0 1px",cursor:"pointer"},".cm-foldGutter span":{padding:"0 1px",cursor:"pointer"}});class R{constructor(e,t){this.specs=e;let r;function i(l){let a=_.newName();return(r||(r=Object.create(null)))["."+a]=l,a}const s=typeof t.all=="string"?t.all:t.all?i(t.all):void 0,o=t.scope;this.scope=o instanceof m?l=>l.prop(A)==o.data:o?l=>l==o:void 0,this.style=Be(e.map(l=>({tag:l.tag,class:l.class||i(Object.assign({},l,{tag:null}))})),{all:s}).style,this.module=r?new _(r):null,this.themeType=t.themeType}static define(e,t){return new R(e,t||{})}}const J=y.define(),Ae=y.define({combine(n){return n.length?[n[0]]:null}});function z(n){let e=n.facet(J);return e.length?e:n.facet(Ae)}function qt(n,e){let t=[kt],r;return n instanceof R&&(n.module&&t.push(w.styleModule.of(n.module)),r=n.themeType),e!=null&&e.fallback?t.push(Ae.of(n)):r?t.push(J.computeN([w.darkTheme],i=>i.facet(w.darkTheme)==(r=="dark")?[n]:[])):t.push(J.of(n)),t}class gt{constructor(e){this.markCache=Object.create(null),this.tree=k(e.state),this.decorations=this.buildDeco(e,z(e.state)),this.decoratedTo=e.viewport.to}update(e){let t=k(e.state),r=z(e.state),i=r!=z(e.startState),{viewport:s}=e.view,o=e.changes.mapPos(this.decoratedTo,1);t.length<s.to&&!i&&t.type==this.tree.type&&o>=s.to?(this.decorations=this.decorations.map(e.changes),this.decoratedTo=o):(t!=this.tree||e.viewportChanged||i)&&(this.tree=t,this.decorations=this.buildDeco(e.view,r),this.decoratedTo=s.to)}buildDeco(e,t){if(!t||!this.tree.length)return g.none;let r=new fe;for(let{from:i,to:s}of e.visibleRanges)Me(this.tree,t,(o,l,a)=>{r.add(o,l,this.markCache[a]||(this.markCache[a]=g.mark({class:a})))},i,s);return r.finish()}}const kt=He.high(H.fromClass(gt,{decorations:n=>n.decorations})),jt=R.define([{tag:u.meta,color:"#404740"},{tag:u.link,textDecoration:"underline"},{tag:u.heading,textDecoration:"underline",fontWeight:"bold"},{tag:u.emphasis,fontStyle:"italic"},{tag:u.strong,fontWeight:"bold"},{tag:u.strikethrough,textDecoration:"line-through"},{tag:u.keyword,color:"#708"},{tag:[u.atom,u.bool,u.url,u.contentSeparator,u.labelName],color:"#219"},{tag:[u.literal,u.inserted],color:"#164"},{tag:[u.string,u.deleted],color:"#a11"},{tag:[u.regexp,u.escape,u.special(u.string)],color:"#e40"},{tag:u.definition(u.variableName),color:"#00f"},{tag:u.local(u.variableName),color:"#30a"},{tag:[u.typeName,u.namespace],color:"#085"},{tag:u.className,color:"#167"},{tag:[u.special(u.variableName),u.macroName],color:"#256"},{tag:u.definition(u.propertyName),color:"#00c"},{tag:u.comment,color:"#940"},{tag:u.invalid,color:"#f00"}]),bt=w.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),Pe=1e4,De="()[]{}",Ie=y.define({combine(n){return ue(n,{afterCursor:!0,brackets:De,maxScanDistance:Pe,renderMatch:xt})}}),yt=g.mark({class:"cm-matchingBracket"}),wt=g.mark({class:"cm-nonmatchingBracket"});function xt(n){let e=[],t=n.matched?yt:wt;return e.push(t.range(n.start.from,n.start.to)),n.end&&e.push(t.range(n.end.from,n.end.to)),e}function se(n){let e=[],t=n.facet(Ie);for(let r of n.selection.ranges){if(!r.empty)continue;let i=B(n,r.head,-1,t)||r.head>0&&B(n,r.head-1,1,t)||t.afterCursor&&(B(n,r.head,1,t)||r.head<n.doc.length&&B(n,r.head+1,-1,t));i&&(e=e.concat(t.renderMatch(i,n)))}return g.set(e,!0)}const vt=H.fromClass(class{constructor(n){this.paused=!1,this.decorations=se(n.state)}update(n){(n.docChanged||n.selectionSet||this.paused)&&(n.view.composing?(this.decorations=this.decorations.map(n.changes),this.paused=!0):(this.decorations=se(n.state),this.paused=!1))}},{decorations:n=>n.decorations}),St=[vt,bt];function zt(n={}){return[Ie.of(n),St]}const Tt=new b;function K(n,e,t){let r=n.prop(e<0?b.openedBy:b.closedBy);if(r)return r;if(n.name.length==1){let i=t.indexOf(n.name);if(i>-1&&i%2==(e<0?1:0))return[t[i+e]]}return null}function Q(n){let e=n.type.prop(Tt);return e?e(n.node):n}function B(n,e,t,r={}){let i=r.maxScanDistance||Pe,s=r.brackets||De,o=k(n),l=o.resolveInner(e,t);for(let a=l;a;a=a.parent){let f=K(a.type,t,s);if(f&&a.from<a.to){let c=Q(a);if(c&&(t>0?e>=c.from&&e<c.to:e>c.from&&e<=c.to))return Ct(n,e,t,a,c,f,s)}}return At(n,e,t,o,l.type,i,s)}function Ct(n,e,t,r,i,s,o){let l=r.parent,a={from:i.from,to:i.to},f=0,c=l==null?void 0:l.cursor();if(c&&(t<0?c.childBefore(r.from):c.childAfter(r.to)))do if(t<0?c.to<=r.from:c.from>=r.to){if(f==0&&s.indexOf(c.type.name)>-1&&c.from<c.to){let h=Q(c);return{start:a,end:h?{from:h.from,to:h.to}:void 0,matched:!0}}else if(K(c.type,t,o))f++;else if(K(c.type,-t,o)){if(f==0){let h=Q(c);return{start:a,end:h&&h.from<h.to?{from:h.from,to:h.to}:void 0,matched:!1}}f--}}while(t<0?c.prevSibling():c.nextSibling());return{start:a,matched:!1}}function At(n,e,t,r,i,s,o){if(t<0?!e:e==n.doc.length)return null;let l=t<0?n.sliceDoc(e-1,e):n.sliceDoc(e,e+1),a=o.indexOf(l);if(a<0||a%2==0!=t>0)return null;let f={from:t<0?e-1:e,to:t>0?e+1:e},c=n.doc.iterRange(e,t>0?n.doc.length:0),h=0;for(let p=0;!c.next().done&&p<=s;){let d=c.value;t<0&&(p+=d.length);let S=e+p*t;for(let T=t>0?0:d.length-1,Oe=t>0?d.length:-1;T!=Oe;T+=t){let U=o.indexOf(d[T]);if(!(U<0||r.resolveInner(S+T,1).type!=i))if(U%2==0==t>0)h++;else{if(h==1)return{start:f,end:{from:S+T,to:S+T+1},matched:U>>1==a>>1};h--}}t>0&&(p+=d.length)}return c.done?{start:f,matched:!1}:null}const Pt=Object.create(null),oe=[X.none],ae=[],le=Object.create(null),Dt=Object.create(null);for(let[n,e]of[["variable","variableName"],["variable-2","variableName.special"],["string-2","string.special"],["def","variableName.definition"],["tag","tagName"],["attribute","attributeName"],["type","typeName"],["builtin","variableName.standard"],["qualifier","modifier"],["error","invalid"],["header","heading"],["property","propertyName"]])Dt[n]=It(Pt,e);function G(n,e){ae.indexOf(n)>-1||(ae.push(n),console.warn(e))}function It(n,e){let t=[];for(let l of e.split(" ")){let a=[];for(let f of l.split(".")){let c=n[f]||u[f];c?typeof c=="function"?a.length?a=a.map(c):G(f,`Modifier ${f} used at start of tag`):a.length?G(f,`Tag ${f} used as modifier`):a=Array.isArray(c)?c:[c]:G(f,`Unknown highlighting tag ${f}`)}for(let f of a)t.push(f)}if(!t.length)return 0;let r=e.replace(/ /g,"_"),i=r+" "+t.map(l=>l.id),s=le[i];if(s)return s.id;let o=le[i]=X.define({id:oe.length,name:r,props:[Fe({[r]:t})]});return oe.push(o),o.id}ee.RTL,ee.LTR;export{R as H,ge as I,Ft as L,N as P,Ut as a,zt as b,Je as c,jt as d,k as e,$t as f,Ke as g,Ve as h,Wt as i,me as j,V as k,Qe as l,B as m,Ht as n,it as o,Rt as p,rt as q,m as r,qt as s,$e as t,A as u,pe as v,Et as w,Lt as x,Tt as y,qe as z};
|
|
1
|
+
import{N as b,e as Be,c as C,h as Me,I as Z,f as M,P as Ne,a as X,t as u,s as Fe}from"./index-BVL_B_hC.js";import{RangeSetBuilder as fe,RangeSet as Ee,EditorState as I,countColumn as Le,Facet as y,StateField as ce,StateEffect as L,Prec as He,combineConfig as ue}from"./index-BHot-lnj.js";import{V as H,u as We,E as w,G as Re,D as g,S as _,q as Ue,W as he,o as ee}from"./index-891wE-Rj.js";var $;const A=new b;function $e(n){return y.define({combine:n?e=>e.concat(n):void 0})}const qe=new b;class m{constructor(e,t,r=[],i=""){this.data=e,this.name=i,I.prototype.hasOwnProperty("tree")||Object.defineProperty(I.prototype,"tree",{get(){return k(this)}}),this.parser=t,this.extension=[x.of(this),I.languageData.of((s,o,l)=>{let a=te(s,o,l),f=a.type.prop(A);if(!f)return[];let c=s.facet(f),h=a.type.prop(qe);if(h){let p=a.resolve(o-a.from,l);for(let d of h)if(d.test(p,s)){let S=s.facet(d.facet);return d.type=="replace"?S:S.concat(c)}}return c})].concat(r)}isActiveAt(e,t,r=-1){return te(e,t,r).type.prop(A)==this.data}findRegions(e){let t=e.facet(x);if((t==null?void 0:t.data)==this.data)return[{from:0,to:e.doc.length}];if(!t||!t.allowsNesting)return[];let r=[],i=(s,o)=>{if(s.prop(A)==this.data){r.push({from:o,to:o+s.length});return}let l=s.prop(b.mounted);if(l){if(l.tree.prop(A)==this.data){if(l.overlay)for(let a of l.overlay)r.push({from:a.from+o,to:a.to+o});else r.push({from:o,to:o+s.length});return}else if(l.overlay){let a=r.length;if(i(l.tree,l.overlay[0].from+o),r.length>a)return}}for(let a=0;a<s.children.length;a++){let f=s.children[a];f instanceof C&&i(f,s.positions[a]+o)}};return i(k(e),0),r}get allowsNesting(){return!0}}m.setState=L.define();function te(n,e,t){let r=n.facet(x),i=k(n).topNode;if(!r||r.allowsNesting)for(let s=i;s;s=s.enter(e,t,Z.ExcludeBuffers|Z.EnterBracketed))s.type.isTop&&(i=s);return i}class V extends m{constructor(e,t,r){super(e,t,[],r),this.parser=t}static define(e){let t=$e(e.languageData);return new V(t,e.parser.configure({props:[A.add(r=>r.isTop?t:void 0)]}),e.name)}configure(e,t){return new V(this.data,this.parser.configure(e),t||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function k(n){let e=n.field(m.state,!1);return e?e.tree:C.empty}class je{constructor(e){this.doc=e,this.cursorPos=0,this.string="",this.cursor=e.iter()}get length(){return this.doc.length}syncTo(e){return this.string=this.cursor.next(e-this.cursorPos).value,this.cursorPos=e+this.string.length,this.cursorPos-this.string.length}chunk(e){return this.syncTo(e),this.string}get lineChunks(){return!0}read(e,t){let r=this.cursorPos-this.string.length;return e<r||t>=this.cursorPos?this.doc.sliceString(e,t):this.string.slice(e-r,t-r)}}let D=null;class N{constructor(e,t,r=[],i,s,o,l,a){this.parser=e,this.state=t,this.fragments=r,this.tree=i,this.treeLen=s,this.viewport=o,this.skipped=l,this.scheduleOn=a,this.parse=null,this.tempSkipped=[]}static create(e,t,r){return new N(e,t,[],C.empty,0,r,[],null)}startParse(){return this.parser.startParse(new je(this.state.doc),this.fragments)}work(e,t){return t!=null&&t>=this.state.doc.length&&(t=void 0),this.tree!=C.empty&&this.isDone(t??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var r;if(typeof e=="number"){let i=Date.now()+e;e=()=>Date.now()>i}for(this.parse||(this.parse=this.startParse()),t!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>t)&&t<this.state.doc.length&&this.parse.stopAt(t);;){let i=this.parse.advance();if(i)if(this.fragments=this.withoutTempSkipped(M.addTree(i,this.fragments,this.parse.stoppedAt!=null)),this.treeLen=(r=this.parse.stoppedAt)!==null&&r!==void 0?r:this.state.doc.length,this.tree=i,this.parse=null,this.treeLen<(t??this.state.doc.length))this.parse=this.startParse();else return!0;if(e())return!1}})}takeTree(){let e,t;this.parse&&(e=this.parse.parsedPos)>=this.treeLen&&((this.parse.stoppedAt==null||this.parse.stoppedAt>e)&&this.parse.stopAt(e),this.withContext(()=>{for(;!(t=this.parse.advance()););}),this.treeLen=e,this.tree=t,this.fragments=this.withoutTempSkipped(M.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let t=D;D=this;try{return e()}finally{D=t}}withoutTempSkipped(e){for(let t;t=this.tempSkipped.pop();)e=ne(e,t.from,t.to);return e}changes(e,t){let{fragments:r,tree:i,treeLen:s,viewport:o,skipped:l}=this;if(this.takeTree(),!e.empty){let a=[];if(e.iterChangedRanges((f,c,h,p)=>a.push({fromA:f,toA:c,fromB:h,toB:p})),r=M.applyChanges(r,a),i=C.empty,s=0,o={from:e.mapPos(o.from,-1),to:e.mapPos(o.to,1)},this.skipped.length){l=[];for(let f of this.skipped){let c=e.mapPos(f.from,1),h=e.mapPos(f.to,-1);c<h&&l.push({from:c,to:h})}}}return new N(this.parser,t,r,i,s,o,l,this.scheduleOn)}updateViewport(e){if(this.viewport.from==e.from&&this.viewport.to==e.to)return!1;this.viewport=e;let t=this.skipped.length;for(let r=0;r<this.skipped.length;r++){let{from:i,to:s}=this.skipped[r];i<e.to&&s>e.from&&(this.fragments=ne(this.fragments,i,s),this.skipped.splice(r--,1))}return this.skipped.length>=t?!1:(this.reset(),!0)}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(e,t){this.skipped.push({from:e,to:t})}static getSkippingParser(e){return new class extends Ne{createParse(t,r,i){let s=i[0].from,o=i[i.length-1].to;return{parsedPos:s,advance(){let a=D;if(a){for(let f of i)a.tempSkipped.push(f);e&&(a.scheduleOn=a.scheduleOn?Promise.all([a.scheduleOn,e]):e)}return this.parsedPos=o,new C(X.none,[],[],o-s)},stoppedAt:null,stopAt(){}}}}}isDone(e){e=Math.min(e,this.state.doc.length);let t=this.fragments;return this.treeLen>=e&&t.length&&t[0].from==0&&t[0].to>=e}static get(){return D}}function ne(n,e,t){return M.applyChanges(n,[{fromA:e,toA:t,fromB:e,toB:t}])}class P{constructor(e){this.context=e,this.tree=e.tree}apply(e){if(!e.docChanged&&this.tree==this.context.tree)return this;let t=this.context.changes(e.changes,e.state),r=this.context.treeLen==e.startState.doc.length?void 0:Math.max(e.changes.mapPos(this.context.treeLen),t.viewport.to);return t.work(20,r)||t.takeTree(),new P(t)}static init(e){let t=Math.min(3e3,e.doc.length),r=N.create(e.facet(x).parser,e,{from:0,to:t});return r.work(20,t)||r.takeTree(),new P(r)}}m.state=ce.define({create:P.init,update(n,e){for(let t of e.effects)if(t.is(m.setState))return t.value;return e.startState.facet(x)!=e.state.facet(x)?P.init(e.state):n.apply(e)}});let de=n=>{let e=setTimeout(()=>n(),500);return()=>clearTimeout(e)};typeof requestIdleCallback<"u"&&(de=n=>{let e=-1,t=setTimeout(()=>{e=requestIdleCallback(n,{timeout:400})},100);return()=>e<0?clearTimeout(t):cancelIdleCallback(e)});const q=typeof navigator<"u"&&(!(($=navigator.scheduling)===null||$===void 0)&&$.isInputPending)?()=>navigator.scheduling.isInputPending():null,ze=H.fromClass(class{constructor(e){this.view=e,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(e){let t=this.view.state.field(m.state).context;(t.updateViewport(e.view.viewport)||this.view.viewport.to>t.treeLen)&&this.scheduleWork(),(e.docChanged||e.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(t)}scheduleWork(){if(this.working)return;let{state:e}=this.view,t=e.field(m.state);(t.tree!=t.context.tree||!t.context.isDone(e.doc.length))&&(this.working=de(this.work))}work(e){this.working=null;let t=Date.now();if(this.chunkEnd<t&&(this.chunkEnd<0||this.view.hasFocus)&&(this.chunkEnd=t+3e4,this.chunkBudget=3e3),this.chunkBudget<=0)return;let{state:r,viewport:{to:i}}=this.view,s=r.field(m.state);if(s.tree==s.context.tree&&s.context.isDone(i+1e5))return;let o=Date.now()+Math.min(this.chunkBudget,100,e&&!q?Math.max(25,e.timeRemaining()-5):1e9),l=s.context.treeLen<i&&r.doc.length>i+1e3,a=s.context.work(()=>q&&q()||Date.now()>o,i+(l?0:1e5));this.chunkBudget-=Date.now()-t,(a||this.chunkBudget<=0)&&(s.context.takeTree(),this.view.dispatch({effects:m.setState.of(new P(s.context))})),this.chunkBudget>0&&!(a&&!l)&&this.scheduleWork(),this.checkAsyncSchedule(s.context)}checkAsyncSchedule(e){e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(t=>Ue(this.view.state,t)).then(()=>this.workScheduled--),e.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),x=y.define({combine(n){return n.length?n[0]:null},enables:n=>[m.state,ze,w.contentAttributes.compute([n],e=>{let t=e.facet(n);return t&&t.name?{"data-language":t.name}:{}})]});class Ft{constructor(e,t=[]){this.language=e,this.support=t,this.extension=[e,t]}}class pe{constructor(e,t,r,i,s,o=void 0){this.name=e,this.alias=t,this.extensions=r,this.filename=i,this.loadFunc=s,this.support=o,this.loading=null}load(){return this.loading||(this.loading=this.loadFunc().then(e=>this.support=e,e=>{throw this.loading=null,e}))}static of(e){let{load:t,support:r}=e;if(!t){if(!r)throw new RangeError("Must pass either 'load' or 'support' to LanguageDescription.of");t=()=>Promise.resolve(r)}return new pe(e.name,(e.alias||[]).concat(e.name).map(i=>i.toLowerCase()),e.extensions||[],e.filename,t,r)}static matchFilename(e,t){for(let i of e)if(i.filename&&i.filename.test(t))return i;let r=/\.([^.]+)$/.exec(t);if(r){for(let i of e)if(i.extensions.indexOf(r[1])>-1)return i}return null}static matchLanguageName(e,t,r=!0){t=t.toLowerCase();for(let i of e)if(i.alias.some(s=>s==t))return i;if(r)for(let i of e)for(let s of i.alias){let o=t.indexOf(s);if(o>-1&&(s.length>2||!/\w/.test(t[o-1])&&!/\w/.test(t[o+s.length])))return i}return null}}const Ge=y.define(),me=y.define({combine:n=>{if(!n.length)return" ";let e=n[0];if(!e||/\S/.test(e)||Array.from(e).some(t=>t!=e[0]))throw new Error("Invalid indent unit: "+JSON.stringify(n[0]));return e}});function Ve(n){let e=n.facet(me);return e.charCodeAt(0)==9?n.tabSize*e.length:e.length}function Je(n,e){let t="",r=n.tabSize,i=n.facet(me)[0];if(i==" "){for(;e>=r;)t+=" ",e-=r;i=" "}for(let s=0;s<e;s++)t+=i;return t}function Ke(n,e){n instanceof I&&(n=new ge(n));for(let r of n.state.facet(Ge)){let i=r(n,e);if(i!==void 0)return i}let t=k(n.state);return t.length>=e?Xe(n,t,e):null}class ge{constructor(e,t={}){this.state=e,this.options=t,this.unit=Ve(e)}lineAt(e,t=1){let r=this.state.doc.lineAt(e),{simulateBreak:i,simulateDoubleBreak:s}=this.options;return i!=null&&i>=r.from&&i<=r.to?s&&i==e?{text:"",from:e}:(t<0?i<e:i<=e)?{text:r.text.slice(i-r.from),from:i}:{text:r.text.slice(0,i-r.from),from:r.from}:r}textAfterPos(e,t=1){if(this.options.simulateDoubleBreak&&e==this.options.simulateBreak)return"";let{text:r,from:i}=this.lineAt(e,t);return r.slice(e-i,Math.min(r.length,e+100-i))}column(e,t=1){let{text:r,from:i}=this.lineAt(e,t),s=this.countColumn(r,e-i),o=this.options.overrideIndentation?this.options.overrideIndentation(i):-1;return o>-1&&(s+=o-this.countColumn(r,r.search(/\S|$/))),s}countColumn(e,t=e.length){return Le(e,this.state.tabSize,t)}lineIndent(e,t=1){let{text:r,from:i}=this.lineAt(e,t),s=this.options.overrideIndentation;if(s){let o=s(i);if(o>-1)return o}return this.countColumn(r,r.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const Qe=new b;function Xe(n,e,t){let r=e.resolveStack(t),i=e.resolveInner(t,-1).resolve(t,0).enterUnfinishedNodesBefore(t);if(i!=r.node){let s=[];for(let o=i;o&&!(o.from<r.node.from||o.to>r.node.to||o.from==r.node.from&&o.type==r.node.type);o=o.parent)s.push(o);for(let o=s.length-1;o>=0;o--)r={node:s[o],next:r}}return ke(r,n,t)}function ke(n,e,t){for(let r=n;r;r=r.next){let i=Ze(r.node);if(i)return i(Y.create(e,t,r))}return 0}function Ye(n){return n.pos==n.options.simulateBreak&&n.options.simulateDoubleBreak}function Ze(n){let e=n.type.prop(Qe);if(e)return e;let t=n.firstChild,r;if(t&&(r=t.type.prop(b.closedBy))){let i=n.lastChild,s=i&&r.indexOf(i.name)>-1;return o=>be(o,!0,1,void 0,s&&!Ye(o)?i.from:void 0)}return n.parent==null?_e:null}function _e(){return 0}class Y extends ge{constructor(e,t,r){super(e.state,e.options),this.base=e,this.pos=t,this.context=r}get node(){return this.context.node}static create(e,t,r){return new Y(e,t,r)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(e){let t=this.state.doc.lineAt(e.from);for(;;){let r=e.resolve(t.from);for(;r.parent&&r.parent.from==r.from;)r=r.parent;if(et(r,e))break;t=this.state.doc.lineAt(r.from)}return this.lineIndent(t.from)}continue(){return ke(this.context.next,this.base,this.pos)}}function et(n,e){for(let t=e;t;t=t.parent)if(n==t)return!0;return!1}function tt(n){let e=n.node,t=e.childAfter(e.from),r=e.lastChild;if(!t)return null;let i=n.options.simulateBreak,s=n.state.doc.lineAt(t.from),o=i==null||i<=s.from?s.to:Math.min(s.to,i);for(let l=t.to;;){let a=e.childAfter(l);if(!a||a==r)return null;if(!a.type.isSkipped){if(a.from>=o)return null;let f=/^ */.exec(s.text.slice(t.to-s.from))[0].length;return{from:t.from,to:t.to+f}}l=a.to}}function Et({closing:n,align:e=!0,units:t=1}){return r=>be(r,e,t,n)}function be(n,e,t,r,i){let s=n.textAfter,o=s.match(/^\s*/)[0].length,l=r&&s.slice(o,o+r.length)==r||i==n.pos+o,a=e?tt(n):null;return a?l?n.column(a.from):n.column(a.to):n.baseIndent+(l?0:n.unit*t)}const Lt=n=>n.baseIndent;function Ht({except:n,units:e=1}={}){return t=>{let r=n&&n.test(t.textAfter);return t.baseIndent+(r?0:e*t.unit)}}const nt=200;function Wt(){return I.transactionFilter.of(n=>{if(!n.docChanged||!n.isUserEvent("input.type")&&!n.isUserEvent("input.complete"))return n;let e=n.startState.languageDataAt("indentOnInput",n.startState.selection.main.head);if(!e.length)return n;let t=n.newDoc,{head:r}=n.newSelection.main,i=t.lineAt(r);if(r>i.from+nt)return n;let s=t.sliceString(i.from,r);if(!e.some(f=>f.test(s)))return n;let{state:o}=n,l=-1,a=[];for(let{head:f}of o.selection.ranges){let c=o.doc.lineAt(f);if(c.from==l)continue;l=c.from;let h=Ke(o,c.from);if(h==null)continue;let p=/^\s*/.exec(c.text)[0],d=Je(o,h);p!=d&&a.push({from:c.from,to:c.from+p.length,insert:d})}return a.length?[n,{changes:a,sequential:!0}]:n})}const rt=y.define(),it=new b;function Rt(n){let e=n.firstChild,t=n.lastChild;return e&&e.to<t.from?{from:e.to,to:t.type.isError?n.to:t.from}:null}function st(n,e,t){let r=k(n);if(r.length<t)return null;let i=r.resolveStack(t,1),s=null;for(let o=i;o;o=o.next){let l=o.node;if(l.to<=t||l.from>t)continue;if(s&&l.from<e)break;let a=l.type.prop(it);if(a&&(l.to<r.length-50||r.length==n.doc.length||!ot(l))){let f=a(l,n);f&&f.from<=t&&f.from>=e&&f.to>t&&(s=f)}}return s}function ot(n){let e=n.lastChild;return e&&e.to==n.to&&e.type.isError}function F(n,e,t){for(let r of n.facet(rt)){let i=r(n,e,t);if(i)return i}return st(n,e,t)}function ye(n,e){let t=e.mapPos(n.from,1),r=e.mapPos(n.to,-1);return t>=r?void 0:{from:t,to:r}}const W=L.define({map:ye}),O=L.define({map:ye});function we(n){let e=[];for(let{head:t}of n.state.selection.ranges)e.some(r=>r.from<=t&&r.to>=t)||e.push(n.lineBlockAt(t));return e}const v=ce.define({create(){return g.none},update(n,e){e.isUserEvent("delete")&&e.changes.iterChangedRanges((r,i)=>n=re(n,r,i)),n=n.map(e.changes);let t=[];for(let r of e.effects)r.is(W)&&!at(n,r.value.from,r.value.to)?t.push(r.value):r.is(O)&&(n=n.update({filter:(i,s)=>r.value.from!=i||r.value.to!=s,filterFrom:r.value.from,filterTo:r.value.to}));if(t.length){let{preparePlaceholder:r}=e.state.facet(Se),i=t.map(s=>(r?g.replace({widget:new dt(r(e.state,s))}):ie).range(s.from,s.to));n=n.update({add:i})}return e.selection&&(n=re(n,e.selection.main.head)),n},provide:n=>w.decorations.from(n),toJSON(n,e){let t=[];return n.between(0,e.doc.length,(r,i)=>{t.push(r,i)}),t},fromJSON(n){if(!Array.isArray(n)||n.length%2)throw new RangeError("Invalid JSON for fold state");let e=[];for(let t=0;t<n.length;){let r=n[t++],i=n[t++];if(typeof r!="number"||typeof i!="number")throw new RangeError("Invalid JSON for fold state");e.push(ie.range(r,i))}return g.set(e,!0)}});function re(n,e,t=e){let r=!1;return n.between(e,t,(i,s)=>{i<t&&s>e&&(r=!0)}),r?n.update({filterFrom:e,filterTo:t,filter:(i,s)=>i>=t||s<=e}):n}function E(n,e,t){var r;let i=null;return(r=n.field(v,!1))===null||r===void 0||r.between(e,t,(s,o)=>{(!i||i.from>s)&&(i={from:s,to:o})}),i}function at(n,e,t){let r=!1;return n.between(e,e,(i,s)=>{i==e&&s==t&&(r=!0)}),r}function xe(n,e){return n.field(v,!1)?e:e.concat(L.appendConfig.of(Te()))}const lt=n=>{for(let e of we(n)){let t=F(n.state,e.from,e.to);if(t)return n.dispatch({effects:xe(n.state,[W.of(t),ve(n,t)])}),!0}return!1},ft=n=>{if(!n.state.field(v,!1))return!1;let e=[];for(let t of we(n)){let r=E(n.state,t.from,t.to);r&&e.push(O.of(r),ve(n,r,!1))}return e.length&&n.dispatch({effects:e}),e.length>0};function ve(n,e,t=!0){let r=n.state.doc.lineAt(e.from).number,i=n.state.doc.lineAt(e.to).number;return w.announce.of(`${n.state.phrase(t?"Folded lines":"Unfolded lines")} ${r} ${n.state.phrase("to")} ${i}.`)}const ct=n=>{let{state:e}=n,t=[];for(let r=0;r<e.doc.length;){let i=n.lineBlockAt(r),s=F(e,i.from,i.to);s&&t.push(W.of(s)),r=(s?n.lineBlockAt(s.to):i).to+1}return t.length&&n.dispatch({effects:xe(n.state,t)}),!!t.length},ut=n=>{let e=n.state.field(v,!1);if(!e||!e.size)return!1;let t=[];return e.between(0,n.state.doc.length,(r,i)=>{t.push(O.of({from:r,to:i}))}),n.dispatch({effects:t}),!0},Ut=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:lt},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:ft},{key:"Ctrl-Alt-[",run:ct},{key:"Ctrl-Alt-]",run:ut}],ht={placeholderDOM:null,preparePlaceholder:null,placeholderText:"…"},Se=y.define({combine(n){return ue(n,ht)}});function Te(n){return[v,mt]}function Ce(n,e){let{state:t}=n,r=t.facet(Se),i=o=>{let l=n.lineBlockAt(n.posAtDOM(o.target)),a=E(n.state,l.from,l.to);a&&n.dispatch({effects:O.of(a)}),o.preventDefault()};if(r.placeholderDOM)return r.placeholderDOM(n,i,e);let s=document.createElement("span");return s.textContent=r.placeholderText,s.setAttribute("aria-label",t.phrase("folded code")),s.title=t.phrase("unfold"),s.className="cm-foldPlaceholder",s.onclick=i,s}const ie=g.replace({widget:new class extends he{toDOM(n){return Ce(n,null)}}});class dt extends he{constructor(e){super(),this.value=e}eq(e){return this.value==e.value}toDOM(e){return Ce(e,this.value)}}const pt={openText:"⌄",closedText:"›",markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1};class j extends Re{constructor(e,t){super(),this.config=e,this.open=t}eq(e){return this.config==e.config&&this.open==e.open}toDOM(e){if(this.config.markerDOM)return this.config.markerDOM(this.open);let t=document.createElement("span");return t.textContent=this.open?this.config.openText:this.config.closedText,t.title=e.state.phrase(this.open?"Fold line":"Unfold line"),t}}function $t(n={}){let e={...pt,...n},t=new j(e,!0),r=new j(e,!1),i=H.fromClass(class{constructor(o){this.from=o.viewport.from,this.markers=this.buildMarkers(o)}update(o){(o.docChanged||o.viewportChanged||o.startState.facet(x)!=o.state.facet(x)||o.startState.field(v,!1)!=o.state.field(v,!1)||k(o.startState)!=k(o.state)||e.foldingChanged(o))&&(this.markers=this.buildMarkers(o.view))}buildMarkers(o){let l=new fe;for(let a of o.viewportLineBlocks){let f=E(o.state,a.from,a.to)?r:F(o.state,a.from,a.to)?t:null;f&&l.add(a.from,a.from,f)}return l.finish()}}),{domEventHandlers:s}=e;return[i,We({class:"cm-foldGutter",markers(o){var l;return((l=o.plugin(i))===null||l===void 0?void 0:l.markers)||Ee.empty},initialSpacer(){return new j(e,!1)},domEventHandlers:{...s,click:(o,l,a)=>{if(s.click&&s.click(o,l,a))return!0;let f=E(o.state,l.from,l.to);if(f)return o.dispatch({effects:O.of(f)}),!0;let c=F(o.state,l.from,l.to);return c?(o.dispatch({effects:W.of(c)}),!0):!1}}}),Te()]}const mt=w.baseTheme({".cm-foldPlaceholder":{backgroundColor:"#eee",border:"1px solid #ddd",color:"#888",borderRadius:".2em",margin:"0 1px",padding:"0 1px",cursor:"pointer"},".cm-foldGutter span":{padding:"0 1px",cursor:"pointer"}});class R{constructor(e,t){this.specs=e;let r;function i(l){let a=_.newName();return(r||(r=Object.create(null)))["."+a]=l,a}const s=typeof t.all=="string"?t.all:t.all?i(t.all):void 0,o=t.scope;this.scope=o instanceof m?l=>l.prop(A)==o.data:o?l=>l==o:void 0,this.style=Be(e.map(l=>({tag:l.tag,class:l.class||i(Object.assign({},l,{tag:null}))})),{all:s}).style,this.module=r?new _(r):null,this.themeType=t.themeType}static define(e,t){return new R(e,t||{})}}const J=y.define(),Ae=y.define({combine(n){return n.length?[n[0]]:null}});function z(n){let e=n.facet(J);return e.length?e:n.facet(Ae)}function qt(n,e){let t=[kt],r;return n instanceof R&&(n.module&&t.push(w.styleModule.of(n.module)),r=n.themeType),e!=null&&e.fallback?t.push(Ae.of(n)):r?t.push(J.computeN([w.darkTheme],i=>i.facet(w.darkTheme)==(r=="dark")?[n]:[])):t.push(J.of(n)),t}class gt{constructor(e){this.markCache=Object.create(null),this.tree=k(e.state),this.decorations=this.buildDeco(e,z(e.state)),this.decoratedTo=e.viewport.to}update(e){let t=k(e.state),r=z(e.state),i=r!=z(e.startState),{viewport:s}=e.view,o=e.changes.mapPos(this.decoratedTo,1);t.length<s.to&&!i&&t.type==this.tree.type&&o>=s.to?(this.decorations=this.decorations.map(e.changes),this.decoratedTo=o):(t!=this.tree||e.viewportChanged||i)&&(this.tree=t,this.decorations=this.buildDeco(e.view,r),this.decoratedTo=s.to)}buildDeco(e,t){if(!t||!this.tree.length)return g.none;let r=new fe;for(let{from:i,to:s}of e.visibleRanges)Me(this.tree,t,(o,l,a)=>{r.add(o,l,this.markCache[a]||(this.markCache[a]=g.mark({class:a})))},i,s);return r.finish()}}const kt=He.high(H.fromClass(gt,{decorations:n=>n.decorations})),jt=R.define([{tag:u.meta,color:"#404740"},{tag:u.link,textDecoration:"underline"},{tag:u.heading,textDecoration:"underline",fontWeight:"bold"},{tag:u.emphasis,fontStyle:"italic"},{tag:u.strong,fontWeight:"bold"},{tag:u.strikethrough,textDecoration:"line-through"},{tag:u.keyword,color:"#708"},{tag:[u.atom,u.bool,u.url,u.contentSeparator,u.labelName],color:"#219"},{tag:[u.literal,u.inserted],color:"#164"},{tag:[u.string,u.deleted],color:"#a11"},{tag:[u.regexp,u.escape,u.special(u.string)],color:"#e40"},{tag:u.definition(u.variableName),color:"#00f"},{tag:u.local(u.variableName),color:"#30a"},{tag:[u.typeName,u.namespace],color:"#085"},{tag:u.className,color:"#167"},{tag:[u.special(u.variableName),u.macroName],color:"#256"},{tag:u.definition(u.propertyName),color:"#00c"},{tag:u.comment,color:"#940"},{tag:u.invalid,color:"#f00"}]),bt=w.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),Pe=1e4,De="()[]{}",Ie=y.define({combine(n){return ue(n,{afterCursor:!0,brackets:De,maxScanDistance:Pe,renderMatch:xt})}}),yt=g.mark({class:"cm-matchingBracket"}),wt=g.mark({class:"cm-nonmatchingBracket"});function xt(n){let e=[],t=n.matched?yt:wt;return e.push(t.range(n.start.from,n.start.to)),n.end&&e.push(t.range(n.end.from,n.end.to)),e}function se(n){let e=[],t=n.facet(Ie);for(let r of n.selection.ranges){if(!r.empty)continue;let i=B(n,r.head,-1,t)||r.head>0&&B(n,r.head-1,1,t)||t.afterCursor&&(B(n,r.head,1,t)||r.head<n.doc.length&&B(n,r.head+1,-1,t));i&&(e=e.concat(t.renderMatch(i,n)))}return g.set(e,!0)}const vt=H.fromClass(class{constructor(n){this.paused=!1,this.decorations=se(n.state)}update(n){(n.docChanged||n.selectionSet||this.paused)&&(n.view.composing?(this.decorations=this.decorations.map(n.changes),this.paused=!0):(this.decorations=se(n.state),this.paused=!1))}},{decorations:n=>n.decorations}),St=[vt,bt];function zt(n={}){return[Ie.of(n),St]}const Tt=new b;function K(n,e,t){let r=n.prop(e<0?b.openedBy:b.closedBy);if(r)return r;if(n.name.length==1){let i=t.indexOf(n.name);if(i>-1&&i%2==(e<0?1:0))return[t[i+e]]}return null}function Q(n){let e=n.type.prop(Tt);return e?e(n.node):n}function B(n,e,t,r={}){let i=r.maxScanDistance||Pe,s=r.brackets||De,o=k(n),l=o.resolveInner(e,t);for(let a=l;a;a=a.parent){let f=K(a.type,t,s);if(f&&a.from<a.to){let c=Q(a);if(c&&(t>0?e>=c.from&&e<c.to:e>c.from&&e<=c.to))return Ct(n,e,t,a,c,f,s)}}return At(n,e,t,o,l.type,i,s)}function Ct(n,e,t,r,i,s,o){let l=r.parent,a={from:i.from,to:i.to},f=0,c=l==null?void 0:l.cursor();if(c&&(t<0?c.childBefore(r.from):c.childAfter(r.to)))do if(t<0?c.to<=r.from:c.from>=r.to){if(f==0&&s.indexOf(c.type.name)>-1&&c.from<c.to){let h=Q(c);return{start:a,end:h?{from:h.from,to:h.to}:void 0,matched:!0}}else if(K(c.type,t,o))f++;else if(K(c.type,-t,o)){if(f==0){let h=Q(c);return{start:a,end:h&&h.from<h.to?{from:h.from,to:h.to}:void 0,matched:!1}}f--}}while(t<0?c.prevSibling():c.nextSibling());return{start:a,matched:!1}}function At(n,e,t,r,i,s,o){if(t<0?!e:e==n.doc.length)return null;let l=t<0?n.sliceDoc(e-1,e):n.sliceDoc(e,e+1),a=o.indexOf(l);if(a<0||a%2==0!=t>0)return null;let f={from:t<0?e-1:e,to:t>0?e+1:e},c=n.doc.iterRange(e,t>0?n.doc.length:0),h=0;for(let p=0;!c.next().done&&p<=s;){let d=c.value;t<0&&(p+=d.length);let S=e+p*t;for(let T=t>0?0:d.length-1,Oe=t>0?d.length:-1;T!=Oe;T+=t){let U=o.indexOf(d[T]);if(!(U<0||r.resolveInner(S+T,1).type!=i))if(U%2==0==t>0)h++;else{if(h==1)return{start:f,end:{from:S+T,to:S+T+1},matched:U>>1==a>>1};h--}}t>0&&(p+=d.length)}return c.done?{start:f,matched:!1}:null}const Pt=Object.create(null),oe=[X.none],ae=[],le=Object.create(null),Dt=Object.create(null);for(let[n,e]of[["variable","variableName"],["variable-2","variableName.special"],["string-2","string.special"],["def","variableName.definition"],["tag","tagName"],["attribute","attributeName"],["type","typeName"],["builtin","variableName.standard"],["qualifier","modifier"],["error","invalid"],["header","heading"],["property","propertyName"]])Dt[n]=It(Pt,e);function G(n,e){ae.indexOf(n)>-1||(ae.push(n),console.warn(e))}function It(n,e){let t=[];for(let l of e.split(" ")){let a=[];for(let f of l.split(".")){let c=n[f]||u[f];c?typeof c=="function"?a.length?a=a.map(c):G(f,`Modifier ${f} used at start of tag`):a.length?G(f,`Tag ${f} used as modifier`):a=Array.isArray(c)?c:[c]:G(f,`Unknown highlighting tag ${f}`)}for(let f of a)t.push(f)}if(!t.length)return 0;let r=e.replace(/ /g,"_"),i=r+" "+t.map(l=>l.id),s=le[i];if(s)return s.id;let o=le[i]=X.define({id:oe.length,name:r,props:[Fe({[r]:t})]});return oe.push(o),o.id}ee.RTL,ee.LTR;export{R as H,ge as I,Ft as L,N as P,Ut as a,zt as b,Je as c,jt as d,k as e,$t as f,Ke as g,Ve as h,Wt as i,me as j,V as k,Qe as l,B as m,Ht as n,it as o,Rt as p,rt as q,m as r,qt as s,$e as t,A as u,pe as v,Et as w,Lt as x,Tt as y,qe as z};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{Prec as st,EditorSelection as P,countColumn as z,EditorState as it}from"./index-BHot-lnj.js";import{n as ot,E as at}from"./index-891wE-Rj.js";import{L as fe,q as lt,e as X,r as ht,j as ft,t as ut,o as Ee,l as dt,u as pt,v as ue,P as ct}from"./index-DueUeK4W.js";import{C as mt}from"./index-ZQEm-9IM.js";import{P as gt,a as Q,N as v,T as kt,b as Ie,s as Me,c as H,p as Lt,t as m}from"./index-DhmD70Mu.js";import{html as bt,htmlCompletionSource as wt}from"./index-BmDgU61K.js";import"./index-MtnHR_Fv.js";import"./index-MEYLoAjh.js";import"./index-BZMuV7wL.js";class U{static create(e,r,n,s,i){let o=s+(s<<8)+e+(r<<4)|0;return new U(e,r,n,o,i,[],[])}constructor(e,r,n,s,i,o,a){this.type=e,this.value=r,this.from=n,this.hash=s,this.end=i,this.children=o,this.positions=a,this.hashProp=[[v.contextHash,s]]}addChild(e,r){e.prop(v.contextHash)!=this.hash&&(e=new H(e.type,e.children,e.positions,e.length,this.hashProp)),this.children.push(e),this.positions.push(r)}toTree(e,r=this.end){let n=this.children.length-1;return n>=0&&(r=Math.max(r,this.positions[n]+this.children[n].length+this.from)),new H(e.types[this.type],this.children,this.positions,r-this.from).balance({makeTree:(s,i,o)=>new H(Q.none,s,i,o,this.hashProp)})}}var u;(function(t){t[t.Document=1]="Document",t[t.CodeBlock=2]="CodeBlock",t[t.FencedCode=3]="FencedCode",t[t.Blockquote=4]="Blockquote",t[t.HorizontalRule=5]="HorizontalRule",t[t.BulletList=6]="BulletList",t[t.OrderedList=7]="OrderedList",t[t.ListItem=8]="ListItem",t[t.ATXHeading1=9]="ATXHeading1",t[t.ATXHeading2=10]="ATXHeading2",t[t.ATXHeading3=11]="ATXHeading3",t[t.ATXHeading4=12]="ATXHeading4",t[t.ATXHeading5=13]="ATXHeading5",t[t.ATXHeading6=14]="ATXHeading6",t[t.SetextHeading1=15]="SetextHeading1",t[t.SetextHeading2=16]="SetextHeading2",t[t.HTMLBlock=17]="HTMLBlock",t[t.LinkReference=18]="LinkReference",t[t.Paragraph=19]="Paragraph",t[t.CommentBlock=20]="CommentBlock",t[t.ProcessingInstructionBlock=21]="ProcessingInstructionBlock",t[t.Escape=22]="Escape",t[t.Entity=23]="Entity",t[t.HardBreak=24]="HardBreak",t[t.Emphasis=25]="Emphasis",t[t.StrongEmphasis=26]="StrongEmphasis",t[t.Link=27]="Link",t[t.Image=28]="Image",t[t.InlineCode=29]="InlineCode",t[t.HTMLTag=30]="HTMLTag",t[t.Comment=31]="Comment",t[t.ProcessingInstruction=32]="ProcessingInstruction",t[t.Autolink=33]="Autolink",t[t.HeaderMark=34]="HeaderMark",t[t.QuoteMark=35]="QuoteMark",t[t.ListMark=36]="ListMark",t[t.LinkMark=37]="LinkMark",t[t.EmphasisMark=38]="EmphasisMark",t[t.CodeMark=39]="CodeMark",t[t.CodeText=40]="CodeText",t[t.CodeInfo=41]="CodeInfo",t[t.LinkTitle=42]="LinkTitle",t[t.LinkLabel=43]="LinkLabel",t[t.URL=44]="URL"})(u||(u={}));class St{constructor(e,r){this.start=e,this.content=r,this.marks=[],this.parsers=[]}}class Ct{constructor(){this.text="",this.baseIndent=0,this.basePos=0,this.depth=0,this.markers=[],this.pos=0,this.indent=0,this.next=-1}forward(){this.basePos>this.pos&&this.forwardInner()}forwardInner(){let e=this.skipSpace(this.basePos);this.indent=this.countIndent(e,this.pos,this.indent),this.pos=e,this.next=e==this.text.length?-1:this.text.charCodeAt(e)}skipSpace(e){return O(this.text,e)}reset(e){for(this.text=e,this.baseIndent=this.basePos=this.pos=this.indent=0,this.forwardInner(),this.depth=1;this.markers.length;)this.markers.pop()}moveBase(e){this.basePos=e,this.baseIndent=this.countIndent(e,this.pos,this.indent)}moveBaseColumn(e){this.baseIndent=e,this.basePos=this.findColumn(e)}addMarker(e){this.markers.push(e)}countIndent(e,r=0,n=0){for(let s=r;s<e;s++)n+=this.text.charCodeAt(s)==9?4-n%4:1;return n}findColumn(e){let r=0;for(let n=0;r<this.text.length&&n<e;r++)n+=this.text.charCodeAt(r)==9?4-n%4:1;return r}scrub(){if(!this.baseIndent)return this.text;let e="";for(let r=0;r<this.basePos;r++)e+=" ";return e+this.text.slice(this.basePos)}}function de(t,e,r){if(r.pos==r.text.length||t!=e.block&&r.indent>=e.stack[r.depth+1].value+r.baseIndent)return!0;if(r.indent>=r.baseIndent+4)return!1;let n=(t.type==u.OrderedList?oe:ie)(r,e,!1);return n>0&&(t.type!=u.BulletList||se(r,e,!1)<0)&&r.text.charCodeAt(r.pos+n-1)==t.value}const He={[u.Blockquote](t,e,r){return r.next!=62?!1:(r.markers.push(k(u.QuoteMark,e.lineStart+r.pos,e.lineStart+r.pos+1)),r.moveBase(r.pos+(x(r.text.charCodeAt(r.pos+1))?2:1)),t.end=e.lineStart+r.text.length,!0)},[u.ListItem](t,e,r){return r.indent<r.baseIndent+t.value&&r.next>-1?!1:(r.moveBaseColumn(r.baseIndent+t.value),!0)},[u.OrderedList]:de,[u.BulletList]:de,[u.Document](){return!0}};function x(t){return t==32||t==9||t==10||t==13}function O(t,e=0){for(;e<t.length&&x(t.charCodeAt(e));)e++;return e}function pe(t,e,r){for(;e>r&&x(t.charCodeAt(e-1));)e--;return e}function Pe(t){if(t.next!=96&&t.next!=126)return-1;let e=t.pos+1;for(;e<t.text.length&&t.text.charCodeAt(e)==t.next;)e++;if(e<t.pos+3)return-1;if(t.next==96){for(let r=e;r<t.text.length;r++)if(t.text.charCodeAt(r)==96)return-1}return e}function ve(t){return t.next!=62?-1:t.text.charCodeAt(t.pos+1)==32?2:1}function se(t,e,r){if(t.next!=42&&t.next!=45&&t.next!=95)return-1;let n=1;for(let s=t.pos+1;s<t.text.length;s++){let i=t.text.charCodeAt(s);if(i==t.next)n++;else if(!x(i))return-1}return r&&t.next==45&&Re(t)>-1&&t.depth==e.stack.length&&e.parser.leafBlockParsers.indexOf(De.SetextHeading)>-1||n<3?-1:1}function Ne(t,e){for(let r=t.stack.length-1;r>=0;r--)if(t.stack[r].type==e)return!0;return!1}function ie(t,e,r){return(t.next==45||t.next==43||t.next==42)&&(t.pos==t.text.length-1||x(t.text.charCodeAt(t.pos+1)))&&(!r||Ne(e,u.BulletList)||t.skipSpace(t.pos+2)<t.text.length)?1:-1}function oe(t,e,r){let n=t.pos,s=t.next;for(;s>=48&&s<=57;){n++;if(n==t.text.length)return-1;s=t.text.charCodeAt(n)}return n==t.pos||n>t.pos+9||s!=46&&s!=41||n<t.text.length-1&&!x(t.text.charCodeAt(n+1))||r&&!Ne(e,u.OrderedList)&&(t.skipSpace(n+1)==t.text.length||n>t.pos+1||t.next!=49)?-1:n+1-t.pos}function ye(t){if(t.next!=35)return-1;let e=t.pos+1;for(;e<t.text.length&&t.text.charCodeAt(e)==35;)e++;if(e<t.text.length&&t.text.charCodeAt(e)!=32)return-1;let r=e-t.pos;return r>6?-1:r}function Re(t){if(t.next!=45&&t.next!=61||t.indent>=t.baseIndent+4)return-1;let e=t.pos+1;for(;e<t.text.length&&t.text.charCodeAt(e)==t.next;)e++;let r=e;for(;e<t.text.length&&x(t.text.charCodeAt(e));)e++;return e==t.text.length?r:-1}const W=/^[ \t]*$/,Oe=/-->/,Te=/\?>/,ee=[[/^<(?:script|pre|style)(?:\s|>|$)/i,/<\/(?:script|pre|style)>/i],[/^\s*<!--/,Oe],[/^\s*<\?/,Te],[/^\s*<![A-Z]/,/>/],[/^\s*<!\[CDATA\[/,/\]\]>/],[/^\s*<\/?(?:address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h1|h2|h3|h4|h5|h6|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul)(?:\s|\/?>|$)/i,W],[/^\s*(?:<\/[a-z][\w-]*\s*>|<[a-z][\w-]*(\s+[a-z:_][\w-.]*(?:\s*=\s*(?:[^\s"'=<>`]+|'[^']*'|"[^"]*"))?)*\s*>)\s*$/i,W]];function ze(t,e,r){if(t.next!=60)return-1;let n=t.text.slice(t.pos);for(let s=0,i=ee.length-(r?1:0);s<i;s++)if(ee[s][0].test(n))return s;return-1}function ce(t,e){let r=t.countIndent(e,t.pos,t.indent),n=t.skipSpace(e),s=t.countIndent(n,e,r);return s>=r+5||n==t.text.length?r+1:s}function A(t,e,r){let n=t.length-1;n>=0&&t[n].to==e&&t[n].type==u.CodeText?t[n].to=r:t.push(k(u.CodeText,e,r))}const $={LinkReference:void 0,IndentedCode(t,e){let r=e.baseIndent+4;if(e.indent<r)return!1;let n=e.findColumn(r),s=t.lineStart+n,i=t.lineStart+e.text.length,o=[],a=[];for(A(o,s,i);t.nextLine()&&e.depth>=t.stack.length;)if(e.pos==e.text.length){A(a,t.lineStart-1,t.lineStart);for(let l of e.markers)a.push(l)}else{if(e.indent<r)break;{if(a.length){for(let h of a)h.type==u.CodeText?A(o,h.from,h.to):o.push(h);a=[]}A(o,t.lineStart-1,t.lineStart);for(let h of e.markers)o.push(h);i=t.lineStart+e.text.length;let l=t.lineStart+e.findColumn(e.baseIndent+4);l<i&&A(o,l,i)}}return a.length&&(a=a.filter(l=>l.type!=u.CodeText),a.length&&(e.markers=a.concat(e.markers))),t.addNode(t.buffer.writeElements(o,-s).finish(u.CodeBlock,i-s),s),!0},FencedCode(t,e){let r=Pe(e);if(r<0)return!1;let n=t.lineStart+e.pos,s=e.next,i=r-e.pos,o=e.skipSpace(r),a=pe(e.text,e.text.length,o),l=[k(u.CodeMark,n,n+i)];o<a&&l.push(k(u.CodeInfo,t.lineStart+o,t.lineStart+a));for(let h=!0,f=!0,p=!1;t.nextLine()&&e.depth>=t.stack.length;h=!1){let d=e.pos;if(e.indent-e.baseIndent<4)for(;d<e.text.length&&e.text.charCodeAt(d)==s;)d++;if(d-e.pos>=i&&e.skipSpace(d)==e.text.length){for(let c of e.markers)l.push(c);f&&p&&A(l,t.lineStart-1,t.lineStart),l.push(k(u.CodeMark,t.lineStart+e.pos,t.lineStart+d)),t.nextLine();break}else{p=!0,h||(A(l,t.lineStart-1,t.lineStart),f=!1);for(let g of e.markers)l.push(g);let c=t.lineStart+e.basePos,L=t.lineStart+e.text.length;c<L&&(A(l,c,L),f=!1)}}return t.addNode(t.buffer.writeElements(l,-n).finish(u.FencedCode,t.prevLineEnd()-n),n),!0},Blockquote(t,e){let r=ve(e);return r<0?!1:(t.startContext(u.Blockquote,e.pos),t.addNode(u.QuoteMark,t.lineStart+e.pos,t.lineStart+e.pos+1),e.moveBase(e.pos+r),null)},HorizontalRule(t,e){if(se(e,t,!1)<0)return!1;let r=t.lineStart+e.pos;return t.nextLine(),t.addNode(u.HorizontalRule,r),!0},BulletList(t,e){let r=ie(e,t,!1);if(r<0)return!1;t.block.type!=u.BulletList&&t.startContext(u.BulletList,e.basePos,e.next);let n=ce(e,e.pos+1);return t.startContext(u.ListItem,e.basePos,n-e.baseIndent),t.addNode(u.ListMark,t.lineStart+e.pos,t.lineStart+e.pos+r),e.moveBaseColumn(n),null},OrderedList(t,e){let r=oe(e,t,!1);if(r<0)return!1;t.block.type!=u.OrderedList&&t.startContext(u.OrderedList,e.basePos,e.text.charCodeAt(e.pos+r-1));let n=ce(e,e.pos+r);return t.startContext(u.ListItem,e.basePos,n-e.baseIndent),t.addNode(u.ListMark,t.lineStart+e.pos,t.lineStart+e.pos+r),e.moveBaseColumn(n),null},ATXHeading(t,e){let r=ye(e);if(r<0)return!1;let n=e.pos,s=t.lineStart+n,i=pe(e.text,e.text.length,n),o=i;for(;o>n&&e.text.charCodeAt(o-1)==e.next;)o--;(o==i||o==n||!x(e.text.charCodeAt(o-1)))&&(o=e.text.length);let a=t.buffer.write(u.HeaderMark,0,r).writeElements(t.parser.parseInline(e.text.slice(n+r+1,o),s+r+1),-s);o<e.text.length&&a.write(u.HeaderMark,o-n,i-n);let l=a.finish(u.ATXHeading1-1+r,e.text.length-n);return t.nextLine(),t.addNode(l,s),!0},HTMLBlock(t,e){let r=ze(e,t,!1);if(r<0)return!1;let n=t.lineStart+e.pos,s=ee[r][1],i=[],o=s!=W;for(;!s.test(e.text)&&t.nextLine();){if(e.depth<t.stack.length){o=!1;break}for(let h of e.markers)i.push(h)}o&&t.nextLine();let a=s==Oe?u.CommentBlock:s==Te?u.ProcessingInstructionBlock:u.HTMLBlock,l=t.prevLineEnd();return t.addNode(t.buffer.writeElements(i,-n).finish(a,l-n),n),!0},SetextHeading:void 0};class xt{constructor(e){this.stage=0,this.elts=[],this.pos=0,this.start=e.start,this.advance(e.content)}nextLine(e,r,n){if(this.stage==-1)return!1;let s=n.content+`
|
|
1
|
+
import{Prec as st,EditorSelection as P,countColumn as z,EditorState as it}from"./index-BHot-lnj.js";import{n as ot,E as at}from"./index-891wE-Rj.js";import{L as fe,q as lt,e as X,r as ht,j as ft,t as ut,o as Ee,l as dt,u as pt,v as ue,P as ct}from"./index-BwqyDurx.js";import{C as mt}from"./index-MFoRbG31.js";import{P as gt,a as Q,N as v,T as kt,b as Ie,s as Me,c as H,p as Lt,t as m}from"./index-BVL_B_hC.js";import{html as bt,htmlCompletionSource as wt}from"./index-cSZKYcZu.js";import"./index-CiZ3hw4e.js";import"./index-CNmvdMxt.js";import"./index-NZmn_bzd.js";class U{static create(e,r,n,s,i){let o=s+(s<<8)+e+(r<<4)|0;return new U(e,r,n,o,i,[],[])}constructor(e,r,n,s,i,o,a){this.type=e,this.value=r,this.from=n,this.hash=s,this.end=i,this.children=o,this.positions=a,this.hashProp=[[v.contextHash,s]]}addChild(e,r){e.prop(v.contextHash)!=this.hash&&(e=new H(e.type,e.children,e.positions,e.length,this.hashProp)),this.children.push(e),this.positions.push(r)}toTree(e,r=this.end){let n=this.children.length-1;return n>=0&&(r=Math.max(r,this.positions[n]+this.children[n].length+this.from)),new H(e.types[this.type],this.children,this.positions,r-this.from).balance({makeTree:(s,i,o)=>new H(Q.none,s,i,o,this.hashProp)})}}var u;(function(t){t[t.Document=1]="Document",t[t.CodeBlock=2]="CodeBlock",t[t.FencedCode=3]="FencedCode",t[t.Blockquote=4]="Blockquote",t[t.HorizontalRule=5]="HorizontalRule",t[t.BulletList=6]="BulletList",t[t.OrderedList=7]="OrderedList",t[t.ListItem=8]="ListItem",t[t.ATXHeading1=9]="ATXHeading1",t[t.ATXHeading2=10]="ATXHeading2",t[t.ATXHeading3=11]="ATXHeading3",t[t.ATXHeading4=12]="ATXHeading4",t[t.ATXHeading5=13]="ATXHeading5",t[t.ATXHeading6=14]="ATXHeading6",t[t.SetextHeading1=15]="SetextHeading1",t[t.SetextHeading2=16]="SetextHeading2",t[t.HTMLBlock=17]="HTMLBlock",t[t.LinkReference=18]="LinkReference",t[t.Paragraph=19]="Paragraph",t[t.CommentBlock=20]="CommentBlock",t[t.ProcessingInstructionBlock=21]="ProcessingInstructionBlock",t[t.Escape=22]="Escape",t[t.Entity=23]="Entity",t[t.HardBreak=24]="HardBreak",t[t.Emphasis=25]="Emphasis",t[t.StrongEmphasis=26]="StrongEmphasis",t[t.Link=27]="Link",t[t.Image=28]="Image",t[t.InlineCode=29]="InlineCode",t[t.HTMLTag=30]="HTMLTag",t[t.Comment=31]="Comment",t[t.ProcessingInstruction=32]="ProcessingInstruction",t[t.Autolink=33]="Autolink",t[t.HeaderMark=34]="HeaderMark",t[t.QuoteMark=35]="QuoteMark",t[t.ListMark=36]="ListMark",t[t.LinkMark=37]="LinkMark",t[t.EmphasisMark=38]="EmphasisMark",t[t.CodeMark=39]="CodeMark",t[t.CodeText=40]="CodeText",t[t.CodeInfo=41]="CodeInfo",t[t.LinkTitle=42]="LinkTitle",t[t.LinkLabel=43]="LinkLabel",t[t.URL=44]="URL"})(u||(u={}));class St{constructor(e,r){this.start=e,this.content=r,this.marks=[],this.parsers=[]}}class Ct{constructor(){this.text="",this.baseIndent=0,this.basePos=0,this.depth=0,this.markers=[],this.pos=0,this.indent=0,this.next=-1}forward(){this.basePos>this.pos&&this.forwardInner()}forwardInner(){let e=this.skipSpace(this.basePos);this.indent=this.countIndent(e,this.pos,this.indent),this.pos=e,this.next=e==this.text.length?-1:this.text.charCodeAt(e)}skipSpace(e){return O(this.text,e)}reset(e){for(this.text=e,this.baseIndent=this.basePos=this.pos=this.indent=0,this.forwardInner(),this.depth=1;this.markers.length;)this.markers.pop()}moveBase(e){this.basePos=e,this.baseIndent=this.countIndent(e,this.pos,this.indent)}moveBaseColumn(e){this.baseIndent=e,this.basePos=this.findColumn(e)}addMarker(e){this.markers.push(e)}countIndent(e,r=0,n=0){for(let s=r;s<e;s++)n+=this.text.charCodeAt(s)==9?4-n%4:1;return n}findColumn(e){let r=0;for(let n=0;r<this.text.length&&n<e;r++)n+=this.text.charCodeAt(r)==9?4-n%4:1;return r}scrub(){if(!this.baseIndent)return this.text;let e="";for(let r=0;r<this.basePos;r++)e+=" ";return e+this.text.slice(this.basePos)}}function de(t,e,r){if(r.pos==r.text.length||t!=e.block&&r.indent>=e.stack[r.depth+1].value+r.baseIndent)return!0;if(r.indent>=r.baseIndent+4)return!1;let n=(t.type==u.OrderedList?oe:ie)(r,e,!1);return n>0&&(t.type!=u.BulletList||se(r,e,!1)<0)&&r.text.charCodeAt(r.pos+n-1)==t.value}const He={[u.Blockquote](t,e,r){return r.next!=62?!1:(r.markers.push(k(u.QuoteMark,e.lineStart+r.pos,e.lineStart+r.pos+1)),r.moveBase(r.pos+(x(r.text.charCodeAt(r.pos+1))?2:1)),t.end=e.lineStart+r.text.length,!0)},[u.ListItem](t,e,r){return r.indent<r.baseIndent+t.value&&r.next>-1?!1:(r.moveBaseColumn(r.baseIndent+t.value),!0)},[u.OrderedList]:de,[u.BulletList]:de,[u.Document](){return!0}};function x(t){return t==32||t==9||t==10||t==13}function O(t,e=0){for(;e<t.length&&x(t.charCodeAt(e));)e++;return e}function pe(t,e,r){for(;e>r&&x(t.charCodeAt(e-1));)e--;return e}function Pe(t){if(t.next!=96&&t.next!=126)return-1;let e=t.pos+1;for(;e<t.text.length&&t.text.charCodeAt(e)==t.next;)e++;if(e<t.pos+3)return-1;if(t.next==96){for(let r=e;r<t.text.length;r++)if(t.text.charCodeAt(r)==96)return-1}return e}function ve(t){return t.next!=62?-1:t.text.charCodeAt(t.pos+1)==32?2:1}function se(t,e,r){if(t.next!=42&&t.next!=45&&t.next!=95)return-1;let n=1;for(let s=t.pos+1;s<t.text.length;s++){let i=t.text.charCodeAt(s);if(i==t.next)n++;else if(!x(i))return-1}return r&&t.next==45&&Re(t)>-1&&t.depth==e.stack.length&&e.parser.leafBlockParsers.indexOf(De.SetextHeading)>-1||n<3?-1:1}function Ne(t,e){for(let r=t.stack.length-1;r>=0;r--)if(t.stack[r].type==e)return!0;return!1}function ie(t,e,r){return(t.next==45||t.next==43||t.next==42)&&(t.pos==t.text.length-1||x(t.text.charCodeAt(t.pos+1)))&&(!r||Ne(e,u.BulletList)||t.skipSpace(t.pos+2)<t.text.length)?1:-1}function oe(t,e,r){let n=t.pos,s=t.next;for(;s>=48&&s<=57;){n++;if(n==t.text.length)return-1;s=t.text.charCodeAt(n)}return n==t.pos||n>t.pos+9||s!=46&&s!=41||n<t.text.length-1&&!x(t.text.charCodeAt(n+1))||r&&!Ne(e,u.OrderedList)&&(t.skipSpace(n+1)==t.text.length||n>t.pos+1||t.next!=49)?-1:n+1-t.pos}function ye(t){if(t.next!=35)return-1;let e=t.pos+1;for(;e<t.text.length&&t.text.charCodeAt(e)==35;)e++;if(e<t.text.length&&t.text.charCodeAt(e)!=32)return-1;let r=e-t.pos;return r>6?-1:r}function Re(t){if(t.next!=45&&t.next!=61||t.indent>=t.baseIndent+4)return-1;let e=t.pos+1;for(;e<t.text.length&&t.text.charCodeAt(e)==t.next;)e++;let r=e;for(;e<t.text.length&&x(t.text.charCodeAt(e));)e++;return e==t.text.length?r:-1}const W=/^[ \t]*$/,Oe=/-->/,Te=/\?>/,ee=[[/^<(?:script|pre|style)(?:\s|>|$)/i,/<\/(?:script|pre|style)>/i],[/^\s*<!--/,Oe],[/^\s*<\?/,Te],[/^\s*<![A-Z]/,/>/],[/^\s*<!\[CDATA\[/,/\]\]>/],[/^\s*<\/?(?:address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h1|h2|h3|h4|h5|h6|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul)(?:\s|\/?>|$)/i,W],[/^\s*(?:<\/[a-z][\w-]*\s*>|<[a-z][\w-]*(\s+[a-z:_][\w-.]*(?:\s*=\s*(?:[^\s"'=<>`]+|'[^']*'|"[^"]*"))?)*\s*>)\s*$/i,W]];function ze(t,e,r){if(t.next!=60)return-1;let n=t.text.slice(t.pos);for(let s=0,i=ee.length-(r?1:0);s<i;s++)if(ee[s][0].test(n))return s;return-1}function ce(t,e){let r=t.countIndent(e,t.pos,t.indent),n=t.skipSpace(e),s=t.countIndent(n,e,r);return s>=r+5||n==t.text.length?r+1:s}function A(t,e,r){let n=t.length-1;n>=0&&t[n].to==e&&t[n].type==u.CodeText?t[n].to=r:t.push(k(u.CodeText,e,r))}const $={LinkReference:void 0,IndentedCode(t,e){let r=e.baseIndent+4;if(e.indent<r)return!1;let n=e.findColumn(r),s=t.lineStart+n,i=t.lineStart+e.text.length,o=[],a=[];for(A(o,s,i);t.nextLine()&&e.depth>=t.stack.length;)if(e.pos==e.text.length){A(a,t.lineStart-1,t.lineStart);for(let l of e.markers)a.push(l)}else{if(e.indent<r)break;{if(a.length){for(let h of a)h.type==u.CodeText?A(o,h.from,h.to):o.push(h);a=[]}A(o,t.lineStart-1,t.lineStart);for(let h of e.markers)o.push(h);i=t.lineStart+e.text.length;let l=t.lineStart+e.findColumn(e.baseIndent+4);l<i&&A(o,l,i)}}return a.length&&(a=a.filter(l=>l.type!=u.CodeText),a.length&&(e.markers=a.concat(e.markers))),t.addNode(t.buffer.writeElements(o,-s).finish(u.CodeBlock,i-s),s),!0},FencedCode(t,e){let r=Pe(e);if(r<0)return!1;let n=t.lineStart+e.pos,s=e.next,i=r-e.pos,o=e.skipSpace(r),a=pe(e.text,e.text.length,o),l=[k(u.CodeMark,n,n+i)];o<a&&l.push(k(u.CodeInfo,t.lineStart+o,t.lineStart+a));for(let h=!0,f=!0,p=!1;t.nextLine()&&e.depth>=t.stack.length;h=!1){let d=e.pos;if(e.indent-e.baseIndent<4)for(;d<e.text.length&&e.text.charCodeAt(d)==s;)d++;if(d-e.pos>=i&&e.skipSpace(d)==e.text.length){for(let c of e.markers)l.push(c);f&&p&&A(l,t.lineStart-1,t.lineStart),l.push(k(u.CodeMark,t.lineStart+e.pos,t.lineStart+d)),t.nextLine();break}else{p=!0,h||(A(l,t.lineStart-1,t.lineStart),f=!1);for(let g of e.markers)l.push(g);let c=t.lineStart+e.basePos,L=t.lineStart+e.text.length;c<L&&(A(l,c,L),f=!1)}}return t.addNode(t.buffer.writeElements(l,-n).finish(u.FencedCode,t.prevLineEnd()-n),n),!0},Blockquote(t,e){let r=ve(e);return r<0?!1:(t.startContext(u.Blockquote,e.pos),t.addNode(u.QuoteMark,t.lineStart+e.pos,t.lineStart+e.pos+1),e.moveBase(e.pos+r),null)},HorizontalRule(t,e){if(se(e,t,!1)<0)return!1;let r=t.lineStart+e.pos;return t.nextLine(),t.addNode(u.HorizontalRule,r),!0},BulletList(t,e){let r=ie(e,t,!1);if(r<0)return!1;t.block.type!=u.BulletList&&t.startContext(u.BulletList,e.basePos,e.next);let n=ce(e,e.pos+1);return t.startContext(u.ListItem,e.basePos,n-e.baseIndent),t.addNode(u.ListMark,t.lineStart+e.pos,t.lineStart+e.pos+r),e.moveBaseColumn(n),null},OrderedList(t,e){let r=oe(e,t,!1);if(r<0)return!1;t.block.type!=u.OrderedList&&t.startContext(u.OrderedList,e.basePos,e.text.charCodeAt(e.pos+r-1));let n=ce(e,e.pos+r);return t.startContext(u.ListItem,e.basePos,n-e.baseIndent),t.addNode(u.ListMark,t.lineStart+e.pos,t.lineStart+e.pos+r),e.moveBaseColumn(n),null},ATXHeading(t,e){let r=ye(e);if(r<0)return!1;let n=e.pos,s=t.lineStart+n,i=pe(e.text,e.text.length,n),o=i;for(;o>n&&e.text.charCodeAt(o-1)==e.next;)o--;(o==i||o==n||!x(e.text.charCodeAt(o-1)))&&(o=e.text.length);let a=t.buffer.write(u.HeaderMark,0,r).writeElements(t.parser.parseInline(e.text.slice(n+r+1,o),s+r+1),-s);o<e.text.length&&a.write(u.HeaderMark,o-n,i-n);let l=a.finish(u.ATXHeading1-1+r,e.text.length-n);return t.nextLine(),t.addNode(l,s),!0},HTMLBlock(t,e){let r=ze(e,t,!1);if(r<0)return!1;let n=t.lineStart+e.pos,s=ee[r][1],i=[],o=s!=W;for(;!s.test(e.text)&&t.nextLine();){if(e.depth<t.stack.length){o=!1;break}for(let h of e.markers)i.push(h)}o&&t.nextLine();let a=s==Oe?u.CommentBlock:s==Te?u.ProcessingInstructionBlock:u.HTMLBlock,l=t.prevLineEnd();return t.addNode(t.buffer.writeElements(i,-n).finish(a,l-n),n),!0},SetextHeading:void 0};class xt{constructor(e){this.stage=0,this.elts=[],this.pos=0,this.start=e.start,this.advance(e.content)}nextLine(e,r,n){if(this.stage==-1)return!1;let s=n.content+`
|
|
2
2
|
`+r.scrub(),i=this.advance(s);return i>-1&&i<s.length?this.complete(e,n,i):!1}finish(e,r){return(this.stage==2||this.stage==3)&&O(r.content,this.pos)==r.content.length?this.complete(e,r,r.content.length):!1}complete(e,r,n){return e.addLeafElement(r,k(u.LinkReference,this.start,this.start+n,this.elts)),!0}nextStage(e){return e?(this.pos=e.to-this.start,this.elts.push(e),this.stage++,!0):(e===!1&&(this.stage=-1),!1)}advance(e){for(;;){if(this.stage==-1)return-1;if(this.stage==0){if(!this.nextStage(Ze(e,this.pos,this.start,!0)))return-1;if(e.charCodeAt(this.pos)!=58)return this.stage=-1;this.elts.push(k(u.LinkMark,this.pos+this.start,this.pos+this.start+1)),this.pos++}else if(this.stage==1){if(!this.nextStage(qe(e,O(e,this.pos),this.start)))return-1}else if(this.stage==2){let r=O(e,this.pos),n=0;if(r>this.pos){let s=Qe(e,r,this.start);if(s){let i=V(e,s.to-this.start);i>0&&(this.nextStage(s),n=i)}}return n||(n=V(e,this.pos)),n>0&&n<e.length?n:-1}else return V(e,this.pos)}}}function V(t,e){for(;e<t.length;e++){let r=t.charCodeAt(e);if(r==10)break;if(!x(r))return-1}return e}class At{nextLine(e,r,n){let s=r.depth<e.stack.length?-1:Re(r),i=r.next;if(s<0)return!1;let o=k(u.HeaderMark,e.lineStart+r.pos,e.lineStart+s);return e.nextLine(),e.addLeafElement(n,k(i==61?u.SetextHeading1:u.SetextHeading2,n.start,e.prevLineEnd(),[...e.parser.parseInline(n.content,n.start),o])),!0}finish(){return!1}}const De={LinkReference(t,e){return e.content.charCodeAt(0)==91?new xt(e):null},SetextHeading(){return new At}},Bt=[(t,e)=>ye(e)>=0,(t,e)=>Pe(e)>=0,(t,e)=>ve(e)>=0,(t,e)=>ie(e,t,!0)>=0,(t,e)=>oe(e,t,!0)>=0,(t,e)=>se(e,t,!0)>=0,(t,e)=>ze(e,t,!0)>=0],Et={text:"",end:0};class It{constructor(e,r,n,s){this.parser=e,this.input=r,this.ranges=s,this.line=new Ct,this.atEnd=!1,this.reusePlaceholders=new Map,this.stoppedAt=null,this.rangeI=0,this.to=s[s.length-1].to,this.lineStart=this.absoluteLineStart=this.absoluteLineEnd=s[0].from,this.block=U.create(u.Document,0,this.lineStart,0,0),this.stack=[this.block],this.fragments=n.length?new Pt(n,r):null,this.readLine()}get parsedPos(){return this.absoluteLineStart}advance(){if(this.stoppedAt!=null&&this.absoluteLineStart>this.stoppedAt)return this.finish();let{line:e}=this;for(;;){for(let n=0;;){let s=e.depth<this.stack.length?this.stack[this.stack.length-1]:null;for(;n<e.markers.length&&(!s||e.markers[n].from<s.end);){let i=e.markers[n++];this.addNode(i.type,i.from,i.to)}if(!s)break;this.finishContext()}if(e.pos<e.text.length)break;if(!this.nextLine())return this.finish()}if(this.fragments&&this.reuseFragment(e.basePos))return null;e:for(;;){for(let n of this.parser.blockParsers)if(n){let s=n(this,e);if(s!=!1){if(s==!0)return null;e.forward();continue e}}break}if(e.pos==e.text.length)return this.nextLine()?null:this.finish();let r=new St(this.lineStart+e.pos,e.text.slice(e.pos));for(let n of this.parser.leafBlockParsers)if(n){let s=n(this,r);s&&r.parsers.push(s)}e:for(;this.nextLine()&&e.pos!=e.text.length;){if(e.indent<e.baseIndent+4){for(let n of this.parser.endLeafBlock)if(n(this,e,r))break e}for(let n of r.parsers)if(n.nextLine(this,e,r))return null;r.content+=`
|
|
3
3
|
`+e.scrub();for(let n of e.markers)r.marks.push(n)}return this.finishLeaf(r),null}stopAt(e){if(this.stoppedAt!=null&&this.stoppedAt<e)throw new RangeError("Can't move stoppedAt forward");this.stoppedAt=e}reuseFragment(e){if(!this.fragments.moveTo(this.absoluteLineStart+e,this.absoluteLineStart)||!this.fragments.matches(this.block.hash))return!1;let r=this.fragments.takeNodes(this);return r?(this.absoluteLineStart+=r,this.lineStart=Ve(this.absoluteLineStart,this.ranges),this.moveRangeI(),this.absoluteLineStart<this.to?(this.lineStart++,this.absoluteLineStart++,this.readLine()):(this.atEnd=!0,this.readLine()),!0):!1}get depth(){return this.stack.length}parentType(e=this.depth-1){return this.parser.nodeSet.types[this.stack[e].type]}nextLine(){return this.lineStart+=this.line.text.length,this.absoluteLineEnd>=this.to?(this.absoluteLineStart=this.absoluteLineEnd,this.atEnd=!0,this.readLine(),!1):(this.lineStart++,this.absoluteLineStart=this.absoluteLineEnd+1,this.moveRangeI(),this.readLine(),!0)}peekLine(){return this.scanLine(this.absoluteLineEnd+1).text}moveRangeI(){for(;this.rangeI<this.ranges.length-1&&this.absoluteLineStart>=this.ranges[this.rangeI].to;)this.rangeI++,this.absoluteLineStart=Math.max(this.absoluteLineStart,this.ranges[this.rangeI].from)}scanLine(e){let r=Et;if(r.end=e,e>=this.to)r.text="";else if(r.text=this.lineChunkAt(e),r.end+=r.text.length,this.ranges.length>1){let n=this.absoluteLineStart,s=this.rangeI;for(;this.ranges[s].to<r.end;){s++;let i=this.ranges[s].from,o=this.lineChunkAt(i);r.end=i+o.length,r.text=r.text.slice(0,this.ranges[s-1].to-n)+o,n=r.end-r.text.length}}return r}readLine(){let{line:e}=this,{text:r,end:n}=this.scanLine(this.absoluteLineStart);for(this.absoluteLineEnd=n,e.reset(r);e.depth<this.stack.length;e.depth++){let s=this.stack[e.depth],i=this.parser.skipContextMarkup[s.type];if(!i)throw new Error("Unhandled block context "+u[s.type]);let o=this.line.markers.length;if(!i(s,this,e)){this.line.markers.length>o&&(s.end=this.line.markers[this.line.markers.length-1].to),e.forward();break}e.forward()}}lineChunkAt(e){let r=this.input.chunk(e),n;if(this.input.lineChunks)n=r==`
|
|
4
4
|
`?"":r;else{let s=r.indexOf(`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{L as w,E as $,a as R}from"./index-MtnHR_Fv.js";import{s as W,t,d as z,I as k}from"./index-DhmD70Mu.js";import{L as x,k as T,l as G,n as U,o as _,p as q,e as F}from"./index-DueUeK4W.js";import"./index-BHot-lnj.js";import"./index-891wE-Rj.js";const Z=145,j=1,E=146,C=147,f=2,N=148,V=3,I=4,X=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],D=58,K=40,b=95,B=91,c=45,A=46,J=35,L=37,H=38,M=92,ee=10,Oe=42;function Q(e){return e>=65&&e<=90||e>=97&&e<=122||e>=161}function m(e){return e>=48&&e<=57}function g(e){return m(e)||e>=97&&e<=102||e>=65&&e<=70}const v=(e,r,i)=>(O,a)=>{for(let o=!1,l=0,n=0;;n++){let{next:s}=O;if(Q(s)||s==c||s==b||o&&m(s))!o&&(s!=c||n>0)&&(o=!0),l===n&&s==c&&l++,O.advance();else if(s==M&&O.peek(1)!=ee){if(O.advance(),g(O.next)){do O.advance();while(g(O.next));O.next==32&&O.advance()}else O.next>-1&&O.advance();o=!0}else{o&&O.acceptToken(l==2&&a.canShift(f)?r:s==K?i:e);break}}},ae=new $(v(E,f,C),{contextual:!0}),re=new $(v(N,V,I),{contextual:!0}),te=new $(e=>{if(X.includes(e.peek(-1))){let{next:r}=e;(Q(r)||r==b||r==J||r==A||r==Oe||r==B||r==D&&Q(e.peek(1))||r==c||r==H)&&e.acceptToken(Z)}}),oe=new $(e=>{if(!X.includes(e.peek(-1))){let{next:r}=e;if(r==L&&(e.advance(),e.acceptToken(j)),Q(r)){do e.advance();while(Q(e.next)||m(e.next));e.acceptToken(j)}}}),le=W({"AtKeyword import charset namespace keyframes media supports font-feature-values":t.definitionKeyword,"from to selector scope MatchFlag":t.keyword,NamespaceName:t.namespace,KeyframeName:t.labelName,KeyframeRangeName:t.operatorKeyword,TagName:t.tagName,ClassName:t.className,PseudoClassName:t.constant(t.className),IdName:t.labelName,"FeatureName PropertyName":t.propertyName,AttributeName:t.attributeName,NumberLiteral:t.number,KeywordQuery:t.keyword,UnaryQueryOp:t.operatorKeyword,"CallTag ValueName FontName":t.atom,VariableName:t.variableName,Callee:t.operatorKeyword,Unit:t.unit,"UniversalSelector NestingSelector":t.definitionOperator,"MatchOp CompareOp":t.compareOperator,"ChildOp SiblingOp, LogicOp":t.logicOperator,BinOp:t.arithmeticOperator,Important:t.modifier,Comment:t.blockComment,ColorLiteral:t.color,"ParenthesizedContent StringLiteral":t.string,":":t.punctuation,"PseudoOp #":t.derefOperator,"; , |":t.separator,"( )":t.paren,"[ ]":t.squareBracket,"{ }":t.brace}),ie={__proto__:null,lang:44,"nth-child":44,"nth-last-child":44,"nth-of-type":44,"nth-last-of-type":44,dir:44,"host-context":44,if:90,url:152,"url-prefix":152,domain:152,regexp:152},ne={__proto__:null,or:104,and:104,not:112,only:112,layer:206},se={__proto__:null,selector:118,style:124,layer:202},de={__proto__:null,"@import":198,"@media":210,"@charset":214,"@namespace":218,"@keyframes":224,"@supports":236,"@scope":240,"@font-feature-values":246},Qe={__proto__:null,to:243},ce=w.deserialize({version:14,states:"MlQYQdOOO#}QdOOP$UO`OOO%OQaO'#CfOOQP'#Ce'#CeO%VQdO'#CgO%[Q`O'#CgO%aQaO'#FnO&XQdO'#CkO&xQaO'#CcO'SQdO'#CnO'_QdO'#EOO'dQdO'#EQO'oQdO'#EXO'oQdO'#E[OOQP'#Fn'#FnO)RQhO'#E}OOQS'#Fm'#FmOOQS'#FQ'#FQQYQdOOO)YQdO'#EbO*iQhO'#EhO)YQdO'#EjO*pQdO'#ElO*{QdO'#EoO)}QhO'#EuO+TQdO'#EwO+`QdO'#EzO+eQaO'#CfO+lQ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R'c&dQ#]nS%Q#]%RR%R#^Q'y'RR(['yQ$m!yR&U$mQ&]$rR'_&]Q']&[R(Q']Q#XkR$y#XQ$P!dR%f$P_bOPco!R#[%P^XOPco!R#[%PQ!`]Q!a^Q#i|Q#j}Q#k!OQ#l!PQ$u#SQ%Y#pR'g&iR%^#qQ!rdQ!{f[$X!n!o!p$[$^$`Q${#Zh%[#q%]%a&m&r&w&y'i'q'r(U(aQ%`#vQ%z$cS&b${&dQ&h%WQ'b&cR'{'T]$Z!n!o!p$[$^$`Q!d`U!ye!r$gQ#RiQ#y!cS#|!d$PQ$R!eQ%d#}Q%e$OQ%i$SS&O$i&QQ&T$lR'n&uQ#{!cW%r$W%m&{'uQ&t%bQ'w'OQ(T'mR(c(YQ%u$WQ&z%mQ't&{R(X'uX%t$W%m&{'uR%k$SR%Z#pQpPR#o!RQ!zeQ$f!rR%}$g",nodeNames:"⚠ Unit VariableName VariableName QueryCallee Comment StyleSheet RuleSet UniversalSelector TagSelector TagName NamespacedTagSelector NamespaceName TagName NestingSelector ClassSelector . ClassName PseudoClassSelector : :: PseudoClassName PseudoClassName ) ( ArgList ValueName ParenthesizedValue AtKeyword # ; ] [ BracketedValue } { BracedValue ColorLiteral NumberLiteral StringLiteral BinaryExpression BinOp CallExpression Callee IfExpression if ArgList IfBranch KeywordQuery FeatureQuery FeatureName BinaryQuery LogicOp ComparisonQuery CompareOp UnaryQuery UnaryQueryOp ParenthesizedQuery SelectorQuery selector ParenthesizedSelector StyleQuery style ParenthesedQuery CallQuery ArgList , UnaryQuery ParenthesedQuery BinaryQuery ParenthesedQuery ParenthesedQuery StyleFeature StyleRange PseudoQuery CallLiteral CallTag ParenthesizedContent PseudoClassName ArgList IdSelector IdName AttributeSelector AttributeName NamespacedAttribute NamespaceName AttributeName MatchOp MatchFlag ChildSelector ChildOp DescendantSelector SiblingSelector SiblingOp Block Declaration PropertyName Important ImportStatement import Layer layer LayerName layer MediaStatement media CharsetStatement charset NamespaceStatement namespace NamespaceName KeyframesStatement keyframes KeyframeName KeyframeList KeyframeSelector KeyframeRangeName SupportsStatement supports ScopeStatement scope to FontFeatureStatement font-feature-values FontName AtRule Styles",maxTerm:172,nodeProps:[["isolate",-2,5,39,""],["openedBy",23,"(",31,"[",34,"{"],["closedBy",24,")",32,"]",35,"}"]],propSources:[le],skippedNodes:[0,5,127],repeatNodeCount:17,tokenData:"K`~R!bOX%ZX^&R^p%Zpq&Rqr)ers)vst+jtu2Xuv%Zvw3Rwx3dxy5Ryz5dz{5i{|6S|}:u}!O;W!O!P;u!P!Q<^!Q![=V![!]>Q!]!^>|!^!_?_!_!`@Z!`!a@n!a!b%Z!b!cAo!c!k%Z!k!lC|!l!u%Z!u!vC|!v!}%Z!}#OD_#O#P%Z#P#QDp#Q#R2X#R#]%Z#]#^ER#^#g%Z#g#hC|#h#o%Z#o#pIf#p#qIw#q#rJ`#r#sJq#s#y%Z#y#z&R#z$f%Z$f$g&R$g#BY%Z#BY#BZ&R#BZ$IS%Z$IS$I_&R$I_$I|%Z$I|$JO&R$JO$JT%Z$JT$JU&R$JU$KV%Z$KV$KW&R$KW&FU%Z&FU&FV&R&FV;'S%Z;'S;=`KY<%lO%Z`%^SOy%jz;'S%j;'S;=`%{<%lO%j`%oS!o`Oy%jz;'S%j;'S;=`%{<%lO%j`&OP;=`<%l%j~&Wh$[~OX%jX^'r^p%jpq'rqy%jz#y%j#y#z'r#z$f%j$f$g'r$g#BY%j#BY#BZ'r#BZ$IS%j$IS$I_'r$I_$I|%j$I|$JO'r$JO$JT%j$JT$JU'r$JU$KV%j$KV$KW'r$KW&FU%j&FU&FV'r&FV;'S%j;'S;=`%{<%lO%j~'yh$[~!o`OX%jX^'r^p%jpq'rqy%jz#y%j#y#z'r#z$f%j$f$g'r$g#BY%j#BY#BZ'r#BZ$IS%j$IS$I_'r$I_$I|%j$I|$JO'r$JO$JT%j$JT$JU'r$JU$KV%j$KV$KW'r$KW&FU%j&FU&FV'r&FV;'S%j;'S;=`%{<%lO%j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=>ne[e]||-1},{term:4,get:e=>se[e]||-1},{term:28,get:e=>de[e]||-1},{term:146,get:e=>Qe[e]||-1}],tokenPrec:2405});let u=null;function p(){if(!u&&typeof document=="object"&&document.body){let{style:e}=document.body,r=[],i=new Set;for(let O in e)O!="cssText"&&O!="cssFloat"&&typeof e[O]=="string"&&(/[A-Z]/.test(O)&&(O=O.replace(/[A-Z]/g,a=>"-"+a.toLowerCase())),i.has(O)||(r.push(O),i.add(O)));u=r.sort().map(O=>({type:"property",label:O,apply:O+": "}))}return u||[]}const S=["active","after","any-link","autofill","backdrop","before","checked","cue","default","defined","disabled","empty","enabled","file-selector-button","first","first-child","first-letter","first-line","first-of-type","focus","focus-visible","focus-within","fullscreen","has","host","host-context","hover","in-range","indeterminate","invalid","is","lang","last-child","last-of-type","left","link","marker","modal","not","nth-child","nth-last-child","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","part","placeholder","placeholder-shown","read-only","read-write","required","right","root","scope","selection","slotted","target","target-text","valid","visited","where"].map(e=>({type:"class",label:e})),h=["above","absolute","activeborder","additive","activecaption","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","antialiased","appworkspace","asterisks","attr","auto","auto-flow","avoid","avoid-column","avoid-page","avoid-region","axis-pan","background","backwards","baseline","below","bidi-override","blink","block","block-axis","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","bullets","button","button-bevel","buttonface","buttonhighlight","buttonshadow","buttontext","calc","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","clear","clip","close-quote","col-resize","collapse","color","color-burn","color-dodge","column","column-reverse","compact","condensed","contain","content","contents","content-box","context-menu","continuous","copy","counter","counters","cover","crop","cross","crosshair","currentcolor","cursive","cyclic","darken","dashed","decimal","decimal-leading-zero","default","default-button","dense","destination-atop","destination-in","destination-out","destination-over","difference","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic-abegede-gez","ethiopic-halehame-aa-er","ethiopic-halehame-gez","ew-resize","exclusion","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fill-box","fixed","flat","flex","flex-end","flex-start","footnotes","forwards","from","geometricPrecision","graytext","grid","groove","hand","hard-light","help","hidden","hide","higher","highlight","highlighttext","horizontal","hsl","hsla","hue","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-grid","inline-table","inset","inside","intrinsic","invert","italic","justify","keep-all","landscape","large","larger","left","level","lighter","lighten","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-hexadecimal","lower-latin","lower-norwegian","lowercase","ltr","luminosity","manipulation","match","matrix","matrix3d","medium","menu","menutext","message-box","middle","min-intrinsic","mix","monospace","move","multiple","multiple_mask_images","multiply","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","opacity","open-quote","optimizeLegibility","optimizeSpeed","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","perspective","pinch-zoom","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row","row-resize","row-reverse","rtl","run-in","running","s-resize","sans-serif","saturation","scale","scale3d","scaleX","scaleY","scaleZ","screen","scroll","scrollbar","scroll-position","se-resize","self-start","self-end","semi-condensed","semi-expanded","separate","serif","show","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","soft-light","solid","source-atop","source-in","source-out","source-over","space","space-around","space-between","space-evenly","spell-out","square","start","static","status-bar","stretch","stroke","stroke-box","sub","subpixel-antialiased","svg_masks","super","sw-resize","symbolic","symbols","system-ui","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","text","text-bottom","text-top","textarea","textfield","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","to","top","transform","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","unidirectional-pan","unset","up","upper-latin","uppercase","url","var","vertical","vertical-text","view-box","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","wrap","wrap-reverse","x-large","x-small","xor","xx-large","xx-small"].map(e=>({type:"keyword",label:e})).concat(["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"].map(e=>({type:"constant",label:e}))),$e=["a","abbr","address","article","aside","b","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","dd","del","details","dfn","dialog","div","dl","dt","em","figcaption","figure","footer","form","header","hgroup","h1","h2","h3","h4","h5","h6","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","main","meter","nav","ol","output","p","pre","ruby","section","select","small","source","span","strong","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","tr","u","ul"].map(e=>({type:"type",label:e})),ue=["@charset","@color-profile","@container","@counter-style","@font-face","@font-feature-values","@font-palette-values","@import","@keyframes","@layer","@media","@namespace","@page","@position-try","@property","@scope","@starting-style","@supports","@view-transition"].map(e=>({type:"keyword",label:e})),d=/^(\w[\w-]*|-\w[\w-]*|)$/,pe=/^-(-[\w-]*)?$/;function me(e,r){var i;if((e.name=="("||e.type.isError)&&(e=e.parent||e),e.name!="ArgList")return!1;let O=(i=e.parent)===null||i===void 0?void 0:i.firstChild;return(O==null?void 0:O.name)!="Callee"?!1:r.sliceString(O.from,O.to)=="var"}const y=new z,je=["Declaration"];function ge(e){for(let r=e;;){if(r.type.isTop)return r;if(!(r=r.parent))return e}}function Y(e,r,i){if(r.to-r.from>4096){let O=y.get(r);if(O)return O;let a=[],o=new Set,l=r.cursor(k.IncludeAnonymous);if(l.firstChild())do for(let n of Y(e,l.node,i))o.has(n.label)||(o.add(n.label),a.push(n));while(l.nextSibling());return y.set(r,a),a}else{let O=[],a=new Set;return r.cursor().iterate(o=>{var l;if(i(o)&&o.matchContext(je)&&((l=o.node.nextSibling)===null||l===void 0?void 0:l.name)==":"){let n=e.sliceString(o.from,o.to);a.has(n)||(a.add(n),O.push({label:n,type:"variable"}))}}),O}}const Se=e=>r=>{let{state:i,pos:O}=r,a=F(i).resolveInner(O,-1),o=a.type.isError&&a.from==a.to-1&&i.doc.sliceString(a.from,a.to)=="-";if(a.name=="PropertyName"||(o||a.name=="TagName")&&/^(Block|Styles)$/.test(a.resolve(a.to).name))return{from:a.from,options:p(),validFor:d};if(a.name=="ValueName")return{from:a.from,options:h,validFor:d};if(a.name=="PseudoClassName")return{from:a.from,options:S,validFor:d};if(e(a)||(r.explicit||o)&&me(a,i.doc))return{from:e(a)||o?a.from:O,options:Y(i.doc,ge(a),e),validFor:pe};if(a.name=="TagName"){for(let{parent:s}=a;s;s=s.parent)if(s.name=="Block")return{from:a.from,options:p(),validFor:d};return{from:a.from,options:$e,validFor:d}}if(a.name=="AtKeyword")return{from:a.from,options:ue,validFor:d};if(!r.explicit)return null;let l=a.resolve(O),n=l.childBefore(O);return n&&n.name==":"&&l.name=="PseudoClassSelector"?{from:O,options:S,validFor:d}:n&&n.name==":"&&l.name=="Declaration"||l.name=="ArgList"?{from:O,options:h,validFor:d}:l.name=="Block"||l.name=="Styles"?{from:O,options:p(),validFor:d}:null},he=Se(e=>e.name=="VariableName"),P=T.define({name:"css",parser:ce.configure({props:[G.add({Declaration:U()}),_.add({"Block KeyframeList":q})]}),languageData:{commentTokens:{block:{open:"/*",close:"*/"}},indentOnInput:/^\s*\}$/,wordChars:"-"}});function ve(){return new x(P,P.data.of({autocomplete:he}))}export{ve as css,he as cssCompletionSource,P as cssLanguage,Se as defineCSSCompletionSource};
|
|
1
|
+
import{L as w,E as $,a as R}from"./index-CiZ3hw4e.js";import{s as W,t,d as z,I as k}from"./index-BVL_B_hC.js";import{L as x,k as T,l as G,n as U,o as _,p as q,e as F}from"./index-BwqyDurx.js";import"./index-BHot-lnj.js";import"./index-891wE-Rj.js";const Z=145,j=1,E=146,C=147,f=2,N=148,V=3,I=4,X=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],D=58,K=40,b=95,B=91,c=45,A=46,J=35,L=37,H=38,M=92,ee=10,Oe=42;function Q(e){return e>=65&&e<=90||e>=97&&e<=122||e>=161}function m(e){return e>=48&&e<=57}function g(e){return m(e)||e>=97&&e<=102||e>=65&&e<=70}const v=(e,r,i)=>(O,a)=>{for(let o=!1,l=0,n=0;;n++){let{next:s}=O;if(Q(s)||s==c||s==b||o&&m(s))!o&&(s!=c||n>0)&&(o=!0),l===n&&s==c&&l++,O.advance();else if(s==M&&O.peek(1)!=ee){if(O.advance(),g(O.next)){do O.advance();while(g(O.next));O.next==32&&O.advance()}else O.next>-1&&O.advance();o=!0}else{o&&O.acceptToken(l==2&&a.canShift(f)?r:s==K?i:e);break}}},ae=new $(v(E,f,C),{contextual:!0}),re=new $(v(N,V,I),{contextual:!0}),te=new $(e=>{if(X.includes(e.peek(-1))){let{next:r}=e;(Q(r)||r==b||r==J||r==A||r==Oe||r==B||r==D&&Q(e.peek(1))||r==c||r==H)&&e.acceptToken(Z)}}),oe=new $(e=>{if(!X.includes(e.peek(-1))){let{next:r}=e;if(r==L&&(e.advance(),e.acceptToken(j)),Q(r)){do e.advance();while(Q(e.next)||m(e.next));e.acceptToken(j)}}}),le=W({"AtKeyword import charset namespace keyframes media supports font-feature-values":t.definitionKeyword,"from to selector scope MatchFlag":t.keyword,NamespaceName:t.namespace,KeyframeName:t.labelName,KeyframeRangeName:t.operatorKeyword,TagName:t.tagName,ClassName:t.className,PseudoClassName:t.constant(t.className),IdName:t.labelName,"FeatureName PropertyName":t.propertyName,AttributeName:t.attributeName,NumberLiteral:t.number,KeywordQuery:t.keyword,UnaryQueryOp:t.operatorKeyword,"CallTag ValueName FontName":t.atom,VariableName:t.variableName,Callee:t.operatorKeyword,Unit:t.unit,"UniversalSelector NestingSelector":t.definitionOperator,"MatchOp CompareOp":t.compareOperator,"ChildOp SiblingOp, LogicOp":t.logicOperator,BinOp:t.arithmeticOperator,Important:t.modifier,Comment:t.blockComment,ColorLiteral:t.color,"ParenthesizedContent StringLiteral":t.string,":":t.punctuation,"PseudoOp #":t.derefOperator,"; , |":t.separator,"( )":t.paren,"[ ]":t.squareBracket,"{ }":t.brace}),ie={__proto__:null,lang:44,"nth-child":44,"nth-last-child":44,"nth-of-type":44,"nth-last-of-type":44,dir:44,"host-context":44,if:90,url:152,"url-prefix":152,domain:152,regexp:152},ne={__proto__:null,or:104,and:104,not:112,only:112,layer:206},se={__proto__:null,selector:118,style:124,layer:202},de={__proto__:null,"@import":198,"@media":210,"@charset":214,"@namespace":218,"@keyframes":224,"@supports":236,"@scope":240,"@font-feature-values":246},Qe={__proto__:null,to:243},ce=w.deserialize({version:14,states:"MlQYQdOOO#}QdOOP$UO`OOO%OQaO'#CfOOQP'#Ce'#CeO%VQdO'#CgO%[Q`O'#CgO%aQaO'#FnO&XQdO'#CkO&xQaO'#CcO'SQdO'#CnO'_QdO'#EOO'dQdO'#EQO'oQdO'#EXO'oQdO'#E[OOQP'#Fn'#FnO)RQhO'#E}OOQS'#Fm'#FmOOQS'#FQ'#FQQYQdOOO)YQdO'#EbO*iQhO'#EhO)YQdO'#EjO*pQdO'#ElO*{QdO'#EoO)}QhO'#EuO+TQdO'#EwO+`QdO'#EzO+eQaO'#CfO+lQ`O'#E_O+qQ`O'#F{O+|QdO'#F{QOQ`OOP,WO&jO'#CaPOOO)CA])CA]OOQP'#Ci'#CiOOQP,59R,59RO%VQdO,59ROOQP'#Cm'#CmOOQP,59V,59VO&XQdO,59VO,cQdO,59YO'_QdO,5:jO'dQdO,5:lO'oQdO,5:sO'oQdO,5:uO'oQdO,5:vO'oQdO'#FXO,nQ`O,58}O,vQdO'#E^OOQS,58},58}OOQP'#Cq'#CqOOQO'#D|'#D|OOQP,59Y,59YO,}Q`O,59YO-SQ`O,59YOOQP'#EP'#EPOOQP,5:j,5:jO-XQpO'#ERO-dQdO'#ESO-iQ`O'#ESO-nQpO,5:lO.XQaO,5:sO.oQaO,5:vOOQW'#D^'#D^O/n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Q(T'mR(c(YQ%u$WQ&z%mQ't&{R(X'uX%t$W%m&{'uR%k$SR%Z#pQpPR#o!RQ!zeQ$f!rR%}$g",nodeNames:"⚠ Unit VariableName VariableName QueryCallee Comment StyleSheet RuleSet UniversalSelector TagSelector TagName NamespacedTagSelector NamespaceName TagName NestingSelector ClassSelector . ClassName PseudoClassSelector : :: PseudoClassName PseudoClassName ) ( ArgList ValueName ParenthesizedValue AtKeyword # ; ] [ BracketedValue } { BracedValue ColorLiteral NumberLiteral StringLiteral BinaryExpression BinOp CallExpression Callee IfExpression if ArgList IfBranch KeywordQuery FeatureQuery FeatureName BinaryQuery LogicOp ComparisonQuery CompareOp UnaryQuery UnaryQueryOp ParenthesizedQuery SelectorQuery selector ParenthesizedSelector StyleQuery style ParenthesedQuery CallQuery ArgList , UnaryQuery ParenthesedQuery BinaryQuery ParenthesedQuery ParenthesedQuery StyleFeature StyleRange PseudoQuery CallLiteral CallTag ParenthesizedContent PseudoClassName ArgList IdSelector IdName AttributeSelector AttributeName NamespacedAttribute NamespaceName AttributeName MatchOp MatchFlag ChildSelector ChildOp DescendantSelector SiblingSelector SiblingOp Block Declaration PropertyName Important ImportStatement import Layer layer LayerName layer MediaStatement media CharsetStatement charset NamespaceStatement namespace NamespaceName KeyframesStatement keyframes KeyframeName KeyframeList KeyframeSelector KeyframeRangeName SupportsStatement supports ScopeStatement scope to FontFeatureStatement font-feature-values FontName AtRule Styles",maxTerm:172,nodeProps:[["isolate",-2,5,39,""],["openedBy",23,"(",31,"[",34,"{"],["closedBy",24,")",32,"]",35,"}"]],propSources:[le],skippedNodes:[0,5,127],repeatNodeCount:17,tokenData:"K`~R!bOX%ZX^&R^p%Zpq&Rqr)ers)vst+jtu2Xuv%Zvw3Rwx3dxy5Ryz5dz{5i{|6S|}:u}!O;W!O!P;u!P!Q<^!Q![=V![!]>Q!]!^>|!^!_?_!_!`@Z!`!a@n!a!b%Z!b!cAo!c!k%Z!k!lC|!l!u%Z!u!vC|!v!}%Z!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%jbEoU!o`Oy%jz#d%j#d#eFR#e;'S%j;'S;=`%{<%lO%jbFWU!o`Oy%jz#c%j#c#dFj#d;'S%j;'S;=`%{<%lO%jbFoU!o`Oy%jz#f%j#f#gGR#g;'S%j;'S;=`%{<%lO%jbGWU!o`Oy%jz#h%j#h#iGj#i;'S%j;'S;=`%{<%lO%jbGoU!o`Oy%jz#T%j#T#UHR#U;'S%j;'S;=`%{<%lO%jbHWU!o`Oy%jz#b%j#b#cHj#c;'S%j;'S;=`%{<%lO%jbHoU!o`Oy%jz#h%j#h#iIR#i;'S%j;'S;=`%{<%lO%jbIYS$pQ!o`Oy%jz;'S%j;'S;=`%{<%lO%jjIkSsYOy%jz;'S%j;'S;=`%{<%lO%jfI|U$cUOy%jz!_%j!_!`2n!`;'S%j;'S;=`%{<%lO%jjJeSrYOy%jz;'S%j;'S;=`%{<%lO%jfJvU#PQOy%jz!_%j!_!`2n!`;'S%j;'S;=`%{<%lO%j`K]P;=`<%l%Z",tokenizers:[te,oe,ae,re,1,2,3,4,new R("m~RRYZ[z{a~~g~aO$_~~dP!P!Qg~lO$`~~",28,152)],topRules:{StyleSheet:[0,6],Styles:[1,126]},dynamicPrecedences:{94:1},specialized:[{term:147,get:e=>ie[e]||-1},{term:148,get:e=>ne[e]||-1},{term:4,get:e=>se[e]||-1},{term:28,get:e=>de[e]||-1},{term:146,get:e=>Qe[e]||-1}],tokenPrec:2405});let u=null;function p(){if(!u&&typeof document=="object"&&document.body){let{style:e}=document.body,r=[],i=new Set;for(let O in e)O!="cssText"&&O!="cssFloat"&&typeof e[O]=="string"&&(/[A-Z]/.test(O)&&(O=O.replace(/[A-Z]/g,a=>"-"+a.toLowerCase())),i.has(O)||(r.push(O),i.add(O)));u=r.sort().map(O=>({type:"property",label:O,apply:O+": "}))}return u||[]}const S=["active","after","any-link","autofill","backdrop","before","checked","cue","default","defined","disabled","empty","enabled","file-selector-button","first","first-child","first-letter","first-line","first-of-type","focus","focus-visible","focus-within","fullscreen","has","host","host-context","hover","in-range","indeterminate","invalid","is","lang","last-child","last-of-type","left","link","marker","modal","not","nth-child","nth-last-child","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","part","placeholder","placeholder-shown","read-only","read-write","required","right","root","scope","selection","slotted","target","target-text","valid","visited","where"].map(e=>({type:"class",label:e})),h=["above","absolute","activeborder","additive","activecaption","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","antialiased","appworkspace","asterisks","attr","auto","auto-flow","avoid","avoid-column","avoid-page","avoid-region","axis-pan","background","backwards","baseline","below","bidi-override","blink","block","block-axis","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","bullets","button","button-bevel","buttonface","buttonhighlight","buttonshadow","buttontext","calc","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","clear","clip","close-quote","col-resize","collapse","color","color-burn","color-dodge","column","column-reverse","compact","condensed","contain","content","contents","content-box","context-menu","continuous","copy","counter","counters","cover","crop","cross","crosshair","currentcolor","cursive","cyclic","darken","dashed","decimal","decimal-leading-zero","default","default-button","dense","destination-atop","destination-in","destination-out","destination-over","difference","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic-abegede-gez","ethiopic-halehame-aa-er","ethiopic-halehame-gez","ew-resize","exclusion","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fill-box","fixed","flat","flex","flex-end","flex-start","footnotes","forwards","from","geometricPrecision","graytext","grid","groove","hand","hard-light","help","hidden","hide","higher","highlight","highlighttext","horizontal","hsl","hsla","hue","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-grid","inline-table","inset","inside","intrinsic","invert","italic","justify","keep-all","landscape","large","larger","left","level","lighter","lighten","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-hexadecimal","lower-latin","lower-norwegian","lowercase","ltr","luminosity","manipulation","match","matrix","matrix3d","medium","menu","menutext","message-box","middle","min-intrinsic","mix","monospace","move","multiple","multiple_mask_images","multiply","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","opacity","open-quote","optimizeLegibility","optimizeSpeed","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","perspective","pinch-zoom","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row","row-resize","row-reverse","rtl","run-in","running","s-resize","sans-serif","saturation","scale","scale3d","scaleX","scaleY","scaleZ","screen","scroll","scrollbar","scroll-position","se-resize","self-start","self-end","semi-condensed","semi-expanded","separate","serif","show","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","soft-light","solid","source-atop","source-in","source-out","source-over","space","space-around","space-between","space-evenly","spell-out","square","start","static","status-bar","stretch","stroke","stroke-box","sub","subpixel-antialiased","svg_masks","super","sw-resize","symbolic","symbols","system-ui","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","text","text-bottom","text-top","textarea","textfield","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","to","top","transform","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","unidirectional-pan","unset","up","upper-latin","uppercase","url","var","vertical","vertical-text","view-box","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","wrap","wrap-reverse","x-large","x-small","xor","xx-large","xx-small"].map(e=>({type:"keyword",label:e})).concat(["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"].map(e=>({type:"constant",label:e}))),$e=["a","abbr","address","article","aside","b","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","dd","del","details","dfn","dialog","div","dl","dt","em","figcaption","figure","footer","form","header","hgroup","h1","h2","h3","h4","h5","h6","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","main","meter","nav","ol","output","p","pre","ruby","section","select","small","source","span","strong","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","tr","u","ul"].map(e=>({type:"type",label:e})),ue=["@charset","@color-profile","@container","@counter-style","@font-face","@font-feature-values","@font-palette-values","@import","@keyframes","@layer","@media","@namespace","@page","@position-try","@property","@scope","@starting-style","@supports","@view-transition"].map(e=>({type:"keyword",label:e})),d=/^(\w[\w-]*|-\w[\w-]*|)$/,pe=/^-(-[\w-]*)?$/;function me(e,r){var i;if((e.name=="("||e.type.isError)&&(e=e.parent||e),e.name!="ArgList")return!1;let O=(i=e.parent)===null||i===void 0?void 0:i.firstChild;return(O==null?void 0:O.name)!="Callee"?!1:r.sliceString(O.from,O.to)=="var"}const y=new z,je=["Declaration"];function ge(e){for(let r=e;;){if(r.type.isTop)return r;if(!(r=r.parent))return e}}function Y(e,r,i){if(r.to-r.from>4096){let O=y.get(r);if(O)return O;let a=[],o=new Set,l=r.cursor(k.IncludeAnonymous);if(l.firstChild())do for(let n of Y(e,l.node,i))o.has(n.label)||(o.add(n.label),a.push(n));while(l.nextSibling());return y.set(r,a),a}else{let O=[],a=new Set;return r.cursor().iterate(o=>{var l;if(i(o)&&o.matchContext(je)&&((l=o.node.nextSibling)===null||l===void 0?void 0:l.name)==":"){let n=e.sliceString(o.from,o.to);a.has(n)||(a.add(n),O.push({label:n,type:"variable"}))}}),O}}const Se=e=>r=>{let{state:i,pos:O}=r,a=F(i).resolveInner(O,-1),o=a.type.isError&&a.from==a.to-1&&i.doc.sliceString(a.from,a.to)=="-";if(a.name=="PropertyName"||(o||a.name=="TagName")&&/^(Block|Styles)$/.test(a.resolve(a.to).name))return{from:a.from,options:p(),validFor:d};if(a.name=="ValueName")return{from:a.from,options:h,validFor:d};if(a.name=="PseudoClassName")return{from:a.from,options:S,validFor:d};if(e(a)||(r.explicit||o)&&me(a,i.doc))return{from:e(a)||o?a.from:O,options:Y(i.doc,ge(a),e),validFor:pe};if(a.name=="TagName"){for(let{parent:s}=a;s;s=s.parent)if(s.name=="Block")return{from:a.from,options:p(),validFor:d};return{from:a.from,options:$e,validFor:d}}if(a.name=="AtKeyword")return{from:a.from,options:ue,validFor:d};if(!r.explicit)return null;let l=a.resolve(O),n=l.childBefore(O);return n&&n.name==":"&&l.name=="PseudoClassSelector"?{from:O,options:S,validFor:d}:n&&n.name==":"&&l.name=="Declaration"||l.name=="ArgList"?{from:O,options:h,validFor:d}:l.name=="Block"||l.name=="Styles"?{from:O,options:p(),validFor:d}:null},he=Se(e=>e.name=="VariableName"),P=T.define({name:"css",parser:ce.configure({props:[G.add({Declaration:U()}),_.add({"Block KeyframeList":q})]}),languageData:{commentTokens:{block:{open:"/*",close:"*/"}},indentOnInput:/^\s*\}$/,wordChars:"-"}});function ve(){return new x(P,P.data.of({autocomplete:he}))}export{ve as css,he as cssCompletionSource,P as cssLanguage,Se as defineCSSCompletionSource};
|