feat: added monaco as editor
This commit is contained in:
1 parent
3923144976
commit
22f625ced0
130 files changed
+71774
-202
No files matched your search
@@ -0,0 +1,93 @@
|
||||
(function(){"use strict";var lt,Ce,ne;class rh{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?It.isErrorNoTelemetry(e)?new It(e.message+`
|
||||
|
||||
`+e.stack):new Error(e.message+`
|
||||
|
||||
`+e.stack):e},0)}}emit(e){this.listeners.forEach(n=>{n(e)})}onUnexpectedError(e){this.unexpectedErrorHandler(e),this.emit(e)}onUnexpectedExternalError(e){this.unexpectedErrorHandler(e)}}const ih=new rh;function $n(t){sh(t)||ih.onUnexpectedError(t)}function Tr(t){if(t instanceof Error){const{name:e,message:n,cause:r}=t,i=t.stacktrace||t.stack;return{$isError:!0,name:e,message:n,stack:i,noTelemetry:It.isErrorNoTelemetry(t),cause:r?Tr(r):void 0,code:t.code}}return t}const Or="Canceled";function sh(t){return t instanceof zs?!0:t instanceof Error&&t.name===Or&&t.message===Or}class zs extends Error{constructor(){super(Or),this.name=this.message}}class It extends Error{constructor(e){super(e),this.name="CodeExpectedError"}static fromError(e){if(e instanceof It)return e;const n=new It;return n.message=e.message,n.stack=e.stack,n}static isErrorNoTelemetry(e){return e.name==="CodeExpectedError"}}class be extends Error{constructor(e){super(e||"An unexpected bug occurred."),Object.setPrototypeOf(this,be.prototype)}}function ah(t,e="Unreachable"){throw new Error(e)}function oh(t,e="unexpected state"){if(!t)throw typeof e=="string"?new be(`Assertion Failed: ${e}`):e}function Un(t){if(!t()){debugger;t(),$n(new be("Assertion Failed"))}}function Ps(t,e){let n=0;for(;n<t.length-1;){const r=t[n],i=t[n+1];if(!e(r,i))return!1;n++}return!0}function lh(t){return typeof t=="string"}function ch(t){return!!t&&typeof t[Symbol.iterator]=="function"}var Bn;(function(t){function e(I){return!!I&&typeof I=="object"&&typeof I[Symbol.iterator]=="function"}t.is=e;const n=Object.freeze([]);function r(){return n}t.empty=r;function*i(I){yield I}t.single=i;function s(I){return e(I)?I:i(I)}t.wrap=s;function a(I){return I||n}t.from=a;function*o(I){for(let R=I.length-1;R>=0;R--)yield I[R]}t.reverse=o;function l(I){return!I||I[Symbol.iterator]().next().done===!0}t.isEmpty=l;function c(I){return I[Symbol.iterator]().next().value}t.first=c;function d(I,R){let z=0;for(const $ of I)if(R($,z++))return!0;return!1}t.some=d;function u(I,R){let z=0;for(const $ of I)if(!R($,z++))return!1;return!0}t.every=u;function m(I,R){for(const z of I)if(R(z))return z}t.find=m;function*f(I,R){for(const z of I)R(z)&&(yield z)}t.filter=f;function*g(I,R){let z=0;for(const $ of I)yield R($,z++)}t.map=g;function*b(I,R){let z=0;for(const $ of I)yield*R($,z++)}t.flatMap=b;function*k(...I){for(const R of I)ch(R)?yield*R:yield R}t.concat=k;function F(I,R,z){let $=z;for(const L of I)$=R($,L);return $}t.reduce=F;function N(I){let R=0;for(const z of I)R++;return R}t.length=N;function*_(I,R,z=I.length){for(R<-I.length&&(R=0),R<0&&(R+=I.length),z<0?z+=I.length:z>I.length&&(z=I.length);R<z;R++)yield I[R]}t.slice=_;function T(I,R=Number.POSITIVE_INFINITY){const z=[];if(R===0)return[z,I];const $=I[Symbol.iterator]();for(let L=0;L<R;L++){const y=$.next();if(y.done)return[z,t.empty()];z.push(y.value)}return[z,{[Symbol.iterator](){return $}}]}t.consume=T;async function O(I){const R=[];for await(const z of I)R.push(z);return R}t.asyncToArray=O;async function V(I){let R=[];for await(const z of I)R=R.concat(z);return R}t.asyncToArrayFlat=V})(Bn||(Bn={}));function Rf(t,e){}function Ts(t){if(Bn.is(t)){const e=[];for(const n of t)if(n)try{n.dispose()}catch(r){e.push(r)}if(e.length===1)throw e[0];if(e.length>1)throw new AggregateError(e,"Encountered errors while disposing of store");return Array.isArray(t)?[]:t}else if(t)return t.dispose(),t}function hh(...t){return qn(()=>Ts(t))}class dh{constructor(e){this._isDisposed=!1,this._fn=e}dispose(){if(!this._isDisposed){if(!this._fn)throw new Error("Unbound disposable context: Need to use an arrow function to preserve the value of this");this._isDisposed=!0,this._fn()}}}function qn(t){return new dh(t)}const Dr=class Dr{constructor(){this._toDispose=new Set,this._isDisposed=!1}dispose(){this._isDisposed||(this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(this._toDispose.size!==0)try{Ts(this._toDispose)}finally{this._toDispose.clear()}}add(e){if(!e||e===wt.None)return e;if(e===this)throw new Error("Cannot register a disposable on itself!");return this._isDisposed?Dr.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(e),e}delete(e){if(e){if(e===this)throw new Error("Cannot dispose a disposable on itself!");this._toDispose.delete(e),e.dispose()}}};Dr.DISABLE_DISPOSED_WARNING=!1;let cn=Dr;const Ds=class Ds{constructor(){this._store=new cn,this._store}dispose(){this._store.dispose()}_register(e){if(e===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(e)}};Ds.None=Object.freeze({dispose(){}});let wt=Ds,le=(lt=class{constructor(e){this.element=e,this.next=lt.Undefined,this.prev=lt.Undefined}},lt.Undefined=new lt(void 0),lt);class uh{constructor(){this._first=le.Undefined,this._last=le.Undefined,this._size=0}get size(){return this._size}isEmpty(){
Line truncated
|
||||
`).slice(2).join(`
|
||||
`))}}class fh extends Error{constructor(e,n){super(e),this.name="ListenerLeakError",this.stack=n}}class gh extends Error{constructor(e,n){super(e),this.name="ListenerRefusalError",this.stack=n}}class Br{constructor(e){this.value=e}}const bh=2;class Ue{constructor(e){this._size=0,this._options=e,this._leakageMon=this._options?.leakWarningThreshold?new $r(e?.onListenerError??$n,this._options?.leakWarningThreshold??mh):void 0,this._perfMon=this._options?._profName?new Vr(this._options._profName):void 0,this._deliveryQueue=this._options?.deliveryQueue}dispose(){this._disposed||(this._disposed=!0,this._deliveryQueue?.current===this&&this._deliveryQueue.reset(),this._listeners&&(this._listeners=void 0,this._size=0),this._options?.onDidRemoveLastListener?.(),this._leakageMon?.dispose())}get event(){return this._event??=(e,n,r)=>{if(this._leakageMon&&this._size>this._leakageMon.threshold**2){const o=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(o);const l=this._leakageMon.getMostFrequentStack()??["UNKNOWN stack",-1],c=new gh(`${o}. HINT: Stack shows most frequent listener (${l[1]}-times)`,l[0]);return(this._options?.onListenerError||$n)(c),wt.None}if(this._disposed)return wt.None;n&&(e=e.bind(n));const i=new Br(e);let s;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(i.stack=Ur.create(),s=this._leakageMon.check(i.stack,this._size+1)),this._listeners?this._listeners instanceof Br?(this._deliveryQueue??=new wh,this._listeners=[this._listeners,i]):this._listeners.push(i):(this._options?.onWillAddFirstListener?.(this),this._listeners=i,this._options?.onDidAddFirstListener?.(this)),this._options?.onDidAddListener?.(this),this._size++;const a=qn(()=>{s?.(),this._removeListener(i)});return r instanceof cn?r.add(a):Array.isArray(r)&&r.push(a),a},this._event}_removeListener(e){if(this._options?.onWillRemoveListener?.(this),!this._listeners)return;if(this._size===1){this._listeners=void 0,this._options?.onDidRemoveLastListener?.(this),this._size=0;return}const n=this._listeners,r=n.indexOf(e);if(r===-1)throw console.log("disposed?",this._disposed),console.log("size?",this._size),console.log("arr?",JSON.stringify(this._listeners)),new Error("Attempted to dispose unknown listener");this._size--,n[r]=void 0;const i=this._deliveryQueue.current===this;if(this._size*bh<=n.length){let s=0;for(let a=0;a<n.length;a++)n[a]?n[s++]=n[a]:i&&s<this._deliveryQueue.end&&(this._deliveryQueue.end--,s<this._deliveryQueue.i&&this._deliveryQueue.i--);n.length=s}}_deliver(e,n){if(!e)return;const r=this._options?.onListenerError||$n;if(!r){e.value(n);return}try{e.value(n)}catch(i){r(i)}}_deliverQueue(e){const n=e.current._listeners;for(;e.i<e.end;)this._deliver(n[e.i++],e.value);e.reset()}fire(e){if(this._deliveryQueue?.current&&(this._deliverQueue(this._deliveryQueue),this._perfMon?.stop()),this._perfMon?.start(this._size),this._listeners)if(this._listeners instanceof Br)this._deliver(this._listeners,e);else{const n=this._deliveryQueue;n.enqueue(this,e,this._listeners.length),this._deliverQueue(n)}this._perfMon?.stop()}hasListeners(){return this._size>0}}class wh{constructor(){this.i=-1,this.end=0}enqueue(e,n,r){this.i=0,this.end=r,this.current=e,this.value=n}reset(){this.i=this.end,this.current=void 0,this.value=void 0}}function vh(){return globalThis._VSCODE_NLS_MESSAGES}function Os(){return globalThis._VSCODE_NLS_LANGUAGE}const yh=Os()==="pseudo"||typeof document<"u"&&document.location&&typeof document.location.hash=="string"&&document.location.hash.indexOf("pseudo=true")>=0;function Ws(t,e){let n;return e.length===0?n=t:n=t.replace(/\{(\d+)\}/g,(r,i)=>{const s=i[0],a=e[s];let o=r;return typeof a=="string"?o=a:(typeof a=="number"||typeof a=="boolean"||a===void 0||a===null)&&(o=String(a)),o}),yh&&(n="["+n.replace(/[aouei]/g,"$&$&")+"]"),n}function B(t,e,...n){return Ws(typeof t=="number"?xh(t,e):e,n)}function xh(t,e){const n=vh()?.[t];if(typeof n!="string"){if(typeof e=="string")return e;throw new Error(`!!! NLS MISSING: ${t} !!!`)}return n}const Dt="en";let qr=!1,jr=!1,Hr=!1,Hn,Gr=Dt,Vs=Dt,Sh,Xe;const vt=globalThis;let ke;typeof vt.vscode<"u"&&typeof vt.vscode.process<"u"?ke=vt.vscode.process:typeof process<"u"&&typeof process?.versions?.node=="string"&&(ke=process);const Ch=typeof ke?.versions?.electron=="string"&&ke?.type==="renderer";if(typeof ke=="object"){qr=ke.platform==="win32",jr=ke.platform==="darwin",Hr=ke.platform==="linux",Hr&&ke.env.SNAP&&ke.env.SNAP_REVISION,ke.env.CI||ke.env.BUILD_ARTIFACTSTAGINGDIRECTORY||ke.env.GITHUB_WORKSPACE,Hn=Dt,Gr=Dt;const t=ke.env.VSCODE_NLS_CONFIG;if(t)try{const e=JSON.parse(t);Hn=e.userLocale,Vs=e.osLocale,Gr=e.resolvedLanguage||Dt,Sh=e.languagePack?.translationsConfigFile}catch{}}else typeof navigator=="object"&&!Ch?(Xe=navigator.userAgent,qr=Xe.indexOf("Windows")>=0,jr=Xe.indexOf("Macintosh")>=0,(Xe.indexOf("Macintosh")>=0||Xe.indexOf("iPad")>=0||Xe.inde
Line truncated
|
||||
`||t===" "}class er{constructor(e,n,r){this.changes=e,this.moves=n,this.hitTimeout=r}}class jd{constructor(e,n){this.lineRangeMapping=e,this.changes=n}}function Hd(t,e,n=(r,i)=>r===i){if(t===e)return!0;if(!t||!e||t.length!==e.length)return!1;for(let r=0,i=t.length;r<i;r++)if(!n(t[r],e[r]))return!1;return!0}function*Gd(t,e){let n,r;for(const i of t)r!==void 0&&e(r,i)?n.push(i):(n&&(yield n),n=[i]),r=i;n&&(yield n)}function Jd(t,e){for(let n=0;n<=t.length;n++)e(n===0?void 0:t[n-1],n===t.length?void 0:t[n])}function Xd(t,e){for(let n=0;n<t.length;n++)e(n===0?void 0:t[n-1],t[n],n+1===t.length?void 0:t[n+1])}function Yd(t,e){for(const n of e)t.push(n)}var mi;(function(t){function e(s){return s<0}t.isLessThan=e;function n(s){return s<=0}t.isLessThanOrEqual=n;function r(s){return s>0}t.isGreaterThan=r;function i(s){return s===0}t.isNeitherLessOrGreaterThan=i,t.greaterThan=1,t.lessThan=-1,t.neitherLessOrGreaterThan=0})(mi||(mi={}));function mn(t,e){return(n,r)=>e(t(n),t(r))}const fn=(t,e)=>t-e;function Qd(t){return(e,n)=>-t(e,n)}const an=class an{constructor(e){this.iterate=e}toArray(){const e=[];return this.iterate(n=>(e.push(n),!0)),e}filter(e){return new an(n=>this.iterate(r=>e(r)?n(r):!0))}map(e){return new an(n=>this.iterate(r=>n(e(r))))}findLast(e){let n;return this.iterate(r=>(e(r)&&(n=r),!0)),n}findLastMaxBy(e){let n,r=!0;return this.iterate(i=>((r||mi.isGreaterThan(e(i,n)))&&(r=!1,n=i),!0)),n}};an.empty=new an(e=>{});let yo=an;class Y{static fromTo(e,n){return new Y(e,n)}static addRange(e,n){let r=0;for(;r<n.length&&n[r].endExclusive<e.start;)r++;let i=r;for(;i<n.length&&n[i].start<=e.endExclusive;)i++;if(r===i)n.splice(r,0,e);else{const s=Math.min(e.start,n[r].start),a=Math.max(e.endExclusive,n[i-1].endExclusive);n.splice(r,i-r,new Y(s,a))}}static tryCreate(e,n){if(!(e>n))return new Y(e,n)}static ofLength(e){return new Y(0,e)}static ofStartAndLength(e,n){return new Y(e,e+n)}static emptyAt(e){return new Y(e,e)}constructor(e,n){if(this.start=e,this.endExclusive=n,e>n)throw new be(`Invalid range: ${this.toString()}`)}get isEmpty(){return this.start===this.endExclusive}delta(e){return new Y(this.start+e,this.endExclusive+e)}deltaStart(e){return new Y(this.start+e,this.endExclusive)}deltaEnd(e){return new Y(this.start,this.endExclusive+e)}get length(){return this.endExclusive-this.start}toString(){return`[${this.start}, ${this.endExclusive})`}equals(e){return this.start===e.start&&this.endExclusive===e.endExclusive}contains(e){return this.start<=e&&e<this.endExclusive}join(e){return new Y(Math.min(this.start,e.start),Math.max(this.endExclusive,e.endExclusive))}intersect(e){const n=Math.max(this.start,e.start),r=Math.min(this.endExclusive,e.endExclusive);if(n<=r)return new Y(n,r)}intersectionLength(e){const n=Math.max(this.start,e.start),r=Math.min(this.endExclusive,e.endExclusive);return Math.max(0,r-n)}intersects(e){const n=Math.max(this.start,e.start),r=Math.min(this.endExclusive,e.endExclusive);return n<r}intersectsOrTouches(e){const n=Math.max(this.start,e.start),r=Math.min(this.endExclusive,e.endExclusive);return n<=r}isBefore(e){return this.endExclusive<=e.start}isAfter(e){return this.start>=e.endExclusive}slice(e){return e.slice(this.start,this.endExclusive)}substring(e){return e.substring(this.start,this.endExclusive)}clip(e){if(this.isEmpty)throw new be(`Invalid clipping range: ${this.toString()}`);return Math.max(this.start,Math.min(this.endExclusive-1,e))}clipCyclic(e){if(this.isEmpty)throw new be(`Invalid clipping range: ${this.toString()}`);return e<this.start?this.endExclusive-(this.start-e)%this.length:e>=this.endExclusive?this.start+(e-this.start)%this.length:e}forEach(e){for(let n=this.start;n<this.endExclusive;n++)e(n)}joinRightTouching(e){if(this.endExclusive!==e.start)throw new be(`Invalid join: ${this.toString()} and ${e.toString()}`);return new Y(this.start,e.endExclusive)}}function Tt(t,e){const n=Ot(t,e);return n===-1?void 0:t[n]}function Ot(t,e,n=0,r=t.length){let i=n,s=r;for(;i<s;){const a=Math.floor((i+s)/2);e(t[a])?i=a+1:s=a}return i-1}function Kd(t,e){const n=fi(t,e);return n===t.length?void 0:t[n]}function fi(t,e,n=0,r=t.length){let i=n,s=r;for(;i<s;){const a=Math.floor((i+s)/2);e(t[a])?s=a:i=a+1}return i}const Mr=class Mr{constructor(e){this._array=e,this._findLastMonotonousLastIdx=0}findLastMonotonous(e){if(Mr.assertInvariants){if(this._prevFindLastPredicate){for(const r of this._array)if(this._prevFindLastPredicate(r)&&!e(r))throw new Error("MonotonousArray: current predicate must be weaker than (or equal to) the previous predicate.")}this._prevFindLastPredicate=e}const n=Ot(this._array,e,this._findLastMonotonousLastIdx);return this._findLastMonotonousLastIdx=n+1,n===-1?void 0:this._array[n]}};Mr.assertInvariants=!1;let tr=Mr;const De=class De{static ofLength(e,n){return new De(e,e+n)}static fromRange(e){return new De(e.startLineNumber,e.endLineNumber)}static fromRangeInclusive(e){return new De(e.startLineNumber,e.endLineNumber+1)}static joinMany(e){if(e.length===0)return[];le
Line truncated
|
||||
`?(n++,r=0):r++;return new $e(n,r)}constructor(e,n){this.lineCount=e,this.columnCount=n}isGreaterThanOrEqualTo(e){return this.lineCount!==e.lineCount?this.lineCount>e.lineCount:this.columnCount>=e.columnCount}add(e){return e.lineCount===0?new $e(this.lineCount,this.columnCount+e.columnCount):new $e(this.lineCount+e.lineCount,e.columnCount)}createRange(e){return this.lineCount===0?new J(e.lineNumber,e.column,e.lineNumber,e.column+this.columnCount):new J(e.lineNumber,e.column,e.lineNumber+this.lineCount,this.columnCount+1)}toRange(){return new J(1,1,this.lineCount+1,this.columnCount+1)}toLineRange(){return Z.ofLength(1,this.lineCount+1)}addToPosition(e){return this.lineCount===0?new re(e.lineNumber,e.column+this.columnCount):new re(e.lineNumber+this.lineCount,this.columnCount+1)}toString(){return`${this.lineCount},${this.columnCount}`}};$e.zero=new $e(0,0);let gn=$e;class Zd{getOffsetRange(e){return new Y(this.getOffset(e.getStartPosition()),this.getOffset(e.getEndPosition()))}getRange(e){return J.fromPositions(this.getPosition(e.start),this.getPosition(e.endExclusive))}getStringReplacement(e){return new Wt.deps.StringReplacement(this.getOffsetRange(e.range),e.text)}getTextReplacement(e){return new Wt.deps.TextReplacement(this.getRange(e.replaceRange),e.newText)}getTextEdit(e){const n=e.replacements.map(r=>this.getTextReplacement(r));return new Wt.deps.TextEdit(n)}}const Ls=class Ls{static get deps(){if(!this._deps)throw new Error("Dependencies not set. Call _setDependencies first.");return this._deps}};Ls._deps=void 0;let Wt=Ls;class eu extends Zd{constructor(e){super(),this.text=e,this.lineStartOffsetByLineIdx=[],this.lineEndOffsetByLineIdx=[],this.lineStartOffsetByLineIdx.push(0);for(let n=0;n<e.length;n++)e.charAt(n)===`
|
||||
`&&(this.lineStartOffsetByLineIdx.push(n+1),n>0&&e.charAt(n-1)==="\r"?this.lineEndOffsetByLineIdx.push(n-1):this.lineEndOffsetByLineIdx.push(n));this.lineEndOffsetByLineIdx.push(e.length)}getOffset(e){const n=this._validatePosition(e);return this.lineStartOffsetByLineIdx[n.lineNumber-1]+n.column-1}_validatePosition(e){if(e.lineNumber<1)return new re(1,1);const n=this.textLength.lineCount+1;if(e.lineNumber>n){const i=this.getLineLength(n);return new re(n,i+1)}if(e.column<1)return new re(e.lineNumber,1);const r=this.getLineLength(e.lineNumber);return e.column-1>r?new re(e.lineNumber,r+1):e}getPosition(e){const n=Ot(this.lineStartOffsetByLineIdx,s=>s<=e),r=n+1,i=e-this.lineStartOffsetByLineIdx[n]+1;return new re(r,i)}get textLength(){const e=this.lineStartOffsetByLineIdx.length-1;return new Wt.deps.TextLength(e,this.text.length-this.lineStartOffsetByLineIdx[e])}getLineLength(e){return this.lineEndOffsetByLineIdx[e-1]-this.lineStartOffsetByLineIdx[e-1]}}class tu{constructor(){this._transformer=void 0}get endPositionExclusive(){return this.length.addToPosition(new re(1,1))}get lineRange(){return this.length.toLineRange()}getValue(){return this.getValueOfRange(this.length.toRange())}getValueOfOffsetRange(e){return this.getValueOfRange(this.getTransformer().getRange(e))}getLineLength(e){return this.getValueOfRange(new J(e,1,e,Number.MAX_SAFE_INTEGER)).length}getTransformer(){return this._transformer||(this._transformer=new eu(this.getValue())),this._transformer}getLineAt(e){return this.getValueOfRange(new J(e,1,e,Number.MAX_SAFE_INTEGER))}}class nu extends tu{constructor(e,n){oh(n>=1),super(),this._getLineContent=e,this._lineCount=n}getValueOfRange(e){if(e.startLineNumber===e.endLineNumber)return this._getLineContent(e.startLineNumber).substring(e.startColumn-1,e.endColumn-1);let n=this._getLineContent(e.startLineNumber).substring(e.startColumn-1);for(let r=e.startLineNumber+1;r<e.endLineNumber;r++)n+=`
|
||||
`+this._getLineContent(r);return n+=`
|
||||
`+this._getLineContent(e.endLineNumber).substring(0,e.endColumn-1),n}getLineLength(e){return this._getLineContent(e).length}get length(){const e=this._getLineContent(this._lineCount);return new gn(this._lineCount-1,e.length)}}class nr extends nu{constructor(e){super(n=>e[n-1],e.length)}}class ut{static joinReplacements(e,n){if(e.length===0)throw new be;if(e.length===1)return e[0];const r=e[0].range.getStartPosition(),i=e[e.length-1].range.getEndPosition();let s="";for(let a=0;a<e.length;a++){const o=e[a];if(s+=o.text,a<e.length-1){const l=e[a+1],c=J.fromPositions(o.range.getEndPosition(),l.range.getStartPosition()),d=n.getValueOfRange(c);s+=d}}return new ut(J.fromPositions(r,i),s)}static fromStringReplacement(e,n){return new ut(n.getTransformer().getRange(e.replaceRange),e.newText)}static delete(e){return new ut(e,"")}constructor(e,n){this.range=e,this.text=n}get isEmpty(){return this.range.isEmpty()&&this.text.length===0}static equals(e,n){return e.range.equalsRange(n.range)&&e.text===n.text}equals(e){return ut.equals(this,e)}removeCommonPrefixAndSuffix(e){return this.removeCommonPrefix(e).removeCommonSuffix(e)}removeCommonPrefix(e){const n=e.getValueOfRange(this.range).replaceAll(`\r
|
||||
`,`
|
||||
`),r=this.text.replaceAll(`\r
|
||||
`,`
|
||||
`),i=Mh(n,r),s=gn.ofText(n.substring(0,i)).addToPosition(this.range.getStartPosition()),a=r.substring(i),o=J.fromPositions(s,this.range.getEndPosition());return new ut(o,a)}removeCommonSuffix(e){const n=e.getValueOfRange(this.range).replaceAll(`\r
|
||||
`,`
|
||||
`),r=this.text.replaceAll(`\r
|
||||
`,`
|
||||
`),i=zh(n,r),s=gn.ofText(n.substring(0,n.length-i)).addToPosition(this.range.getStartPosition()),a=r.substring(0,r.length-i),o=J.fromPositions(this.range.getStartPosition(),s);return new ut(o,a)}toString(){const e=this.range.getStartPosition(),n=this.range.getEndPosition();return`(${e.lineNumber},${e.column} -> ${n.lineNumber},${n.column}): "${this.text}"`}}class Le{static inverse(e,n,r){const i=[];let s=1,a=1;for(const l of e){const c=new Le(new Z(s,l.original.startLineNumber),new Z(a,l.modified.startLineNumber));c.modified.isEmpty||i.push(c),s=l.original.endLineNumberExclusive,a=l.modified.endLineNumberExclusive}const o=new Le(new Z(s,n+1),new Z(a,r+1));return o.modified.isEmpty||i.push(o),i}static clip(e,n,r){const i=[];for(const s of e){const a=s.original.intersect(n),o=s.modified.intersect(r);a&&!a.isEmpty&&o&&!o.isEmpty&&i.push(new Le(a,o))}return i}constructor(e,n){this.original=e,this.modified=n}toString(){return`{${this.original.toString()}->${this.modified.toString()}}`}flip(){return new Le(this.modified,this.original)}join(e){return new Le(this.original.join(e.original),this.modified.join(e.modified))}toRangeMapping(){const e=this.original.toInclusiveRange(),n=this.modified.toInclusiveRange();if(e&&n)return new Ae(e,n);if(this.original.startLineNumber===1||this.modified.startLineNumber===1){if(!(this.modified.startLineNumber===1&&this.original.startLineNumber===1))throw new be("not a valid diff");return new Ae(new J(this.original.startLineNumber,1,this.original.endLineNumberExclusive,1),new J(this.modified.startLineNumber,1,this.modified.endLineNumberExclusive,1))}else return new Ae(new J(this.original.startLineNumber-1,Number.MAX_SAFE_INTEGER,this.original.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),new J(this.modified.startLineNumber-1,Number.MAX_SAFE_INTEGER,this.modified.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER))}toRangeMapping2(e,n){if(xo(this.original.endLineNumberExclusive,e)&&xo(this.modified.endLineNumberExclusive,n))return new Ae(new J(this.original.startLineNumber,1,this.original.endLineNumberExclusive,1),new J(this.modified.startLineNumber,1,this.modified.endLineNumberExclusive,1));if(!this.original.isEmpty&&!this.modified.isEmpty)return new Ae(J.fromPositions(new re(this.original.startLineNumber,1),Vt(new re(this.original.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),e)),J.fromPositions(new re(this.modified.startLineNumber,1),Vt(new re(this.modified.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),n)));if(this.original.startLineNumber>1&&this.modified.startLineNumber>1)return new Ae(J.fromPositions(Vt(new re(this.original.startLineNumber-1,Number.MAX_SAFE_INTEGER),e),Vt(new re(this.original.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),e)),J.fromPositions(Vt(new re(this.modified.startLineNumber-1,Number.MAX_SAFE_INTEGER),n),Vt(new re(this.modified.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),n)));throw new be}}function Vt(t,e){if(t.lineNumber<1)return new re(1,1);if(t.lineNumber>e.length)return new re(e.length,e[e.length-1].length+1);const n=e[t.lineNumber-1];return t.column>n.length+1?new re(t.lineNumber,n.length+1):t}function xo(t,e){return t>=1&&t<=e.length}class Ke extends Le{static fromRangeMappings(e){const n=Z.join(e.map(i=>Z.fromRangeInclusive(i.originalRange))),r=Z.join(e.map(i=>Z.fromRangeInclusive(i.modifiedRange)));return new Ke(n,r,e)}constructor(e,n,r){super(e,n),this.innerChanges=r}flip(){return new Ke(this.modified,this.original,this.innerChanges?.map(e=>e.flip()))}withInnerChangesFromLineRanges(){return new Ke(this.original,this.modified,[this.toRangeMapping()])}}class Ae{static fromEdit(e){const n=e.getNewRanges();return e.replacements.map((i,s)=>new Ae(i.range,n[s]))}static assertSorted(e){for(let n=1;n<e.length;n++){const r=e[n-1],i=e[n];if(!(r.originalRange.getEndPosition().isBeforeOrEqual(i.originalRange.getStartPosition())&&r.modifiedRange.getEndPosition().isBeforeOrEqual(i.modifiedRange.getStartPosition())))throw new be("Range mappings must be sorted")}}constructor(e,n){this.originalRange=e,this.modifiedRange=n}toString(){return`{${this.originalRange.toString()}->${this.modifiedRange.toString()}}`}flip(){return new Ae(this.modifiedRange,this.originalRange)}toTextEdit(e){const n=e.getValueOfRange(this.modifiedRange);return new ut(this.originalRange,n)}}function So(t,e,n,r=!1){const i=[];for(const s of Gd(t.map(a=>ru(a,e,n)),(a,o)=>a.original.intersectsOrTouches(o.original)||a.modified.intersectsOrTouches(o.modified))){const a=s[0],o=s[s.length-1];i.push(new Ke(a.original.join(o.original),a.modified.join(o.modified),s.map(l=>l.innerChanges[0])))}return Un(()=>!r&&i.length>0&&(i[0].modified.startLineNumber!==i[0].original.startLineNumber||n.length.lineCount-i[i.length-1].modified.endLineNumberExclusive!==e.length.lineCount-i[i.length-1].original.endLineNumberExclusive)?!1:Ps(i,(s,a)=>a.original.startLineNumber-s.original.endLineNumberExclusive===a.modified.startLineNumber-s.modified.endLineNumberExclusive&&s.original.endLineNumberExcl
Line truncated
|
||||
`);this.histogram[o]=(this.histogram[o]||0)+1}this.totalCount=i}computeSimilarity(e){let n=0;const r=Math.max(this.histogram.length,e.histogram.length);for(let i=0;i<r;i++)n+=Math.abs((this.histogram[i]??0)-(e.histogram[i]??0));return 1-n/(this.totalCount+e.totalCount)}};Wn.chrKeys=new Map;let rr=Wn;class hu{compute(e,n,r=wn.instance,i){if(e.length===0||n.length===0)return Ze.trivial(e,n);const s=new wi(e.length,n.length),a=new wi(e.length,n.length),o=new wi(e.length,n.length);for(let g=0;g<e.length;g++)for(let b=0;b<n.length;b++){if(!r.isValid())return Ze.trivialTimedOut(e,n);const k=g===0?0:s.get(g-1,b),F=b===0?0:s.get(g,b-1);let N;e.getElement(g)===n.getElement(b)?(g===0||b===0?N=0:N=s.get(g-1,b-1),g>0&&b>0&&a.get(g-1,b-1)===3&&(N+=o.get(g-1,b-1)),N+=i?i(g,b):1):N=-1;const _=Math.max(k,F,N);if(_===N){const T=g>0&&b>0?o.get(g-1,b-1):0;o.set(g,b,T+1),a.set(g,b,3)}else _===k?(o.set(g,b,0),a.set(g,b,1)):_===F&&(o.set(g,b,0),a.set(g,b,2));s.set(g,b,_)}const l=[];let c=e.length,d=n.length;function u(g,b){(g+1!==c||b+1!==d)&&l.push(new ce(new Y(g+1,c),new Y(b+1,d))),c=g,d=b}let m=e.length-1,f=n.length-1;for(;m>=0&&f>=0;)a.get(m,f)===3?(u(m,f),m--,f--):a.get(m,f)===1?m--:f--;return u(-1,-1),l.reverse(),new Ze(l,!1)}}class Eo{compute(e,n,r=wn.instance){if(e.length===0||n.length===0)return Ze.trivial(e,n);const i=e,s=n;function a(b,k){for(;b<i.length&&k<s.length&&i.getElement(b)===s.getElement(k);)b++,k++;return b}let o=0;const l=new du;l.set(0,a(0,0));const c=new uu;c.set(0,l.get(0)===0?null:new Fo(null,0,0,l.get(0)));let d=0;e:for(;;){if(o++,!r.isValid())return Ze.trivialTimedOut(i,s);const b=-Math.min(o,s.length+o%2),k=Math.min(o,i.length+o%2);for(d=b;d<=k;d+=2){const F=d===k?-1:l.get(d+1),N=d===b?-1:l.get(d-1)+1,_=Math.min(Math.max(F,N),i.length),T=_-d;if(_>i.length||T>s.length)continue;const O=a(_,T);l.set(d,O);const V=_===F?c.get(d+1):c.get(d-1);if(c.set(d,O!==_?new Fo(V,_,T,O-_):V),l.get(d)===i.length&&l.get(d)-d===s.length)break e}}let u=c.get(d);const m=[];let f=i.length,g=s.length;for(;;){const b=u?u.x+u.length:0,k=u?u.y+u.length:0;if((b!==f||k!==g)&&m.push(new ce(new Y(b,f),new Y(k,g))),!u)break;f=u.x,g=u.y,u=u.prev}return m.reverse(),new Ze(m,!1)}}class Fo{constructor(e,n,r,i){this.prev=e,this.x=n,this.y=r,this.length=i}}class du{constructor(){this.positiveArr=new Int32Array(10),this.negativeArr=new Int32Array(10)}get(e){return e<0?(e=-e-1,this.negativeArr[e]):this.positiveArr[e]}set(e,n){if(e<0){if(e=-e-1,e>=this.negativeArr.length){const r=this.negativeArr;this.negativeArr=new Int32Array(r.length*2),this.negativeArr.set(r)}this.negativeArr[e]=n}else{if(e>=this.positiveArr.length){const r=this.positiveArr;this.positiveArr=new Int32Array(r.length*2),this.positiveArr.set(r)}this.positiveArr[e]=n}}}class uu{constructor(){this.positiveArr=[],this.negativeArr=[]}get(e){return e<0?(e=-e-1,this.negativeArr[e]):this.positiveArr[e]}set(e,n){e<0?(e=-e-1,this.negativeArr[e]=n):this.positiveArr[e]=n}}class ir{constructor(e,n,r){this.lines=e,this.range=n,this.considerWhitespaceChanges=r,this.elements=[],this.firstElementOffsetByLineIdx=[],this.lineStartOffsets=[],this.trimmedWsLengthsByLineIdx=[],this.firstElementOffsetByLineIdx.push(0);for(let i=this.range.startLineNumber;i<=this.range.endLineNumber;i++){let s=e[i-1],a=0;i===this.range.startLineNumber&&this.range.startColumn>1&&(a=this.range.startColumn-1,s=s.substring(a)),this.lineStartOffsets.push(a);let o=0;if(!r){const c=s.trimStart();o=s.length-c.length,s=c.trimEnd()}this.trimmedWsLengthsByLineIdx.push(o);const l=i===this.range.endLineNumber?Math.min(this.range.endColumn-1-a-o,s.length):s.length;for(let c=0;c<l;c++)this.elements.push(s.charCodeAt(c));i<this.range.endLineNumber&&(this.elements.push(10),this.firstElementOffsetByLineIdx.push(this.elements.length))}}toString(){return`Slice: "${this.text}"`}get text(){return this.getText(new Y(0,this.length))}getText(e){return this.elements.slice(e.start,e.endExclusive).map(n=>String.fromCharCode(n)).join("")}getElement(e){return this.elements[e]}get length(){return this.elements.length}getBoundaryScore(e){const n=Io(e>0?this.elements[e-1]:-1),r=Io(e<this.elements.length?this.elements[e]:-1);if(n===7&&r===8)return 0;if(n===8)return 150;let i=0;return n!==r&&(i+=10,n===0&&r===1&&(i+=1)),i+=No(n),i+=No(r),i}translateOffset(e,n="right"){const r=Ot(this.firstElementOffsetByLineIdx,s=>s<=e),i=e-this.firstElementOffsetByLineIdx[r];return new re(this.range.startLineNumber+r,1+this.lineStartOffsets[r]+i+(i===0&&n==="left"?0:this.trimmedWsLengthsByLineIdx[r]))}translateRange(e){const n=this.translateOffset(e.start,"right"),r=this.translateOffset(e.endExclusive,"left");return r.isBefore(n)?J.fromPositions(r,r):J.fromPositions(n,r)}findWordContaining(e){if(e<0||e>=this.elements.length||!Ut(this.elements[e]))return;let n=e;for(;n>0&&Ut(this.elements[n-1]);)n--;let r=e;for(;r<this.elements.length&&Ut(this.elements[r]);)r++;return new Y(n,r)}findSubWordContaining(e){if(e<0||e>=this.elements.length||!Ut(this.elements[e]))retur
Line truncated
|
||||
`).length>=15&&fu(u,f=>f.length>=2)>=2}),a=vu(t,a),a}function fu(t,e){let n=0;for(const r of t)e(r)&&n++;return n}function gu(t,e,n,r){const i=[],s=t.filter(l=>l.modified.isEmpty&&l.original.length>=3).map(l=>new rr(l.original,e,l)),a=new Set(t.filter(l=>l.original.isEmpty&&l.modified.length>=3).map(l=>new rr(l.modified,n,l))),o=new Set;for(const l of s){let c=-1,d;for(const u of a){const m=l.computeSimilarity(u);m>c&&(c=m,d=u)}if(c>.9&&d&&(a.delete(d),i.push(new Le(l.range,d.range)),o.add(l.source),o.add(d.source)),!r.isValid())return{moves:i,excludedChanges:o}}return{moves:i,excludedChanges:o}}function bu(t,e,n,r,i,s){const a=[],o=new Md;for(const m of t)for(let f=m.original.startLineNumber;f<m.original.endLineNumberExclusive-2;f++){const g=`${e[f-1]}:${e[f+1-1]}:${e[f+2-1]}`;o.add(g,{range:new Z(f,f+3)})}const l=[];t.sort(mn(m=>m.modified.startLineNumber,fn));for(const m of t){let f=[];for(let g=m.modified.startLineNumber;g<m.modified.endLineNumberExclusive-2;g++){const b=`${n[g-1]}:${n[g+1-1]}:${n[g+2-1]}`,k=new Z(g,g+3),F=[];o.forEach(b,({range:N})=>{for(const T of f)if(T.originalLineRange.endLineNumberExclusive+1===N.endLineNumberExclusive&&T.modifiedLineRange.endLineNumberExclusive+1===k.endLineNumberExclusive){T.originalLineRange=new Z(T.originalLineRange.startLineNumber,N.endLineNumberExclusive),T.modifiedLineRange=new Z(T.modifiedLineRange.startLineNumber,k.endLineNumberExclusive),F.push(T);return}const _={modifiedLineRange:k,originalLineRange:N};l.push(_),F.push(_)}),f=F}if(!s.isValid())return[]}l.sort(Qd(mn(m=>m.modifiedLineRange.length,fn)));const c=new qe,d=new qe;for(const m of l){const f=m.modifiedLineRange.startLineNumber-m.originalLineRange.startLineNumber,g=c.subtractFrom(m.modifiedLineRange),b=d.subtractFrom(m.originalLineRange).getWithDelta(f),k=g.getIntersection(b);for(const F of k.ranges){if(F.length<3)continue;const N=F,_=F.delta(-f);a.push(new Le(_,N)),c.addRange(N),d.addRange(_)}}a.sort(mn(m=>m.original.startLineNumber,fn));const u=new tr(t);for(let m=0;m<a.length;m++){const f=a[m],g=u.findLastMonotonous(V=>V.original.startLineNumber<=f.original.startLineNumber),b=Tt(t,V=>V.modified.startLineNumber<=f.modified.startLineNumber),k=Math.max(f.original.startLineNumber-g.original.startLineNumber,f.modified.startLineNumber-b.modified.startLineNumber),F=u.findLastMonotonous(V=>V.original.startLineNumber<f.original.endLineNumberExclusive),N=Tt(t,V=>V.modified.startLineNumber<f.modified.endLineNumberExclusive),_=Math.max(F.original.endLineNumberExclusive-f.original.endLineNumberExclusive,N.modified.endLineNumberExclusive-f.modified.endLineNumberExclusive);let T;for(T=0;T<k;T++){const V=f.original.startLineNumber-T-1,I=f.modified.startLineNumber-T-1;if(V>r.length||I>i.length||c.contains(I)||d.contains(V)||!Do(r[V-1],i[I-1],s))break}T>0&&(d.addRange(new Z(f.original.startLineNumber-T,f.original.startLineNumber)),c.addRange(new Z(f.modified.startLineNumber-T,f.modified.startLineNumber)));let O;for(O=0;O<_;O++){const V=f.original.endLineNumberExclusive+O,I=f.modified.endLineNumberExclusive+O;if(V>r.length||I>i.length||c.contains(I)||d.contains(V)||!Do(r[V-1],i[I-1],s))break}O>0&&(d.addRange(new Z(f.original.endLineNumberExclusive,f.original.endLineNumberExclusive+O)),c.addRange(new Z(f.modified.endLineNumberExclusive,f.modified.endLineNumberExclusive+O))),(T>0||O>0)&&(a[m]=new Le(new Z(f.original.startLineNumber-T,f.original.endLineNumberExclusive+O),new Z(f.modified.startLineNumber-T,f.modified.endLineNumberExclusive+O)))}return a}function Do(t,e,n){if(t.trim()===e.trim())return!0;if(t.length>300&&e.length>300)return!1;const i=new Eo().compute(new ir([t],new J(1,1,1,t.length),!1),new ir([e],new J(1,1,1,e.length),!1),n);let s=0;const a=ce.invert(i.diffs,t.length);for(const d of a)d.seq1Range.forEach(u=>{vi(t.charCodeAt(u))||s++});function o(d){let u=0;for(let m=0;m<t.length;m++)vi(d.charCodeAt(m))||u++;return u}const l=o(t.length>e.length?t:e);return s/l>.6&&l>10}function wu(t){if(t.length===0)return t;t.sort(mn(n=>n.original.startLineNumber,fn));const e=[t[0]];for(let n=1;n<t.length;n++){const r=e[e.length-1],i=t[n],s=i.original.startLineNumber-r.original.endLineNumberExclusive,a=i.modified.startLineNumber-r.modified.endLineNumberExclusive;if(s>=0&&a>=0&&s+a<=2){e[e.length-1]=r.join(i);continue}e.push(i)}return e}function vu(t,e){const n=new tr(t);return e=e.filter(r=>{const i=n.findLastMonotonous(o=>o.original.startLineNumber<r.original.endLineNumberExclusive)||new Le(new Z(1,1),new Z(1,1)),s=Tt(t,o=>o.modified.startLineNumber<r.modified.endLineNumberExclusive);return i!==s}),e}function Lo(t,e,n){let r=n;return r=Ao(t,e,r),r=Ao(t,e,r),r=yu(t,e,r),r}function Ao(t,e,n){if(n.length===0)return n;const r=[];r.push(n[0]);for(let s=1;s<n.length;s++){const a=r[r.length-1];let o=n[s];if(o.seq1Range.isEmpty||o.seq2Range.isEmpty){const l=o.seq1Range.start-a.seq1Range.endExclusive;let c;for(c=1;c<=l&&!(t.getElement(o.seq1Range.start-c)!==t.getElement(o.seq1Range.endExclusive-c)||e.getElement(o.seq2Range
Line truncated
|
||||
`)}isStronglyEqual(e,n){return this.lines[e]===this.lines[n]}}function To(t){let e=0;for(;e<t.length&&(t.charCodeAt(e)===32||t.charCodeAt(e)===9);)e++;return e}class _u{constructor(){this.dynamicProgrammingDiffing=new hu,this.myersDiffingAlgorithm=new Eo}computeDiff(e,n,r){if(e.length<=1&&Hd(e,n,(I,R)=>I===R))return new er([],[],!1);if(e.length===1&&e[0].length===0||n.length===1&&n[0].length===0)return new er([new Ke(new Z(1,e.length+1),new Z(1,n.length+1),[new Ae(new J(1,1,e.length,e[e.length-1].length+1),new J(1,1,n.length,n[n.length-1].length+1))])],[],!1);const i=r.maxComputationTimeMs===0?wn.instance:new cu(r.maxComputationTimeMs),s=!r.ignoreTrimWhitespace,a=new Map;function o(I){let R=a.get(I);return R===void 0&&(R=a.size,a.set(I,R)),R}const l=e.map(I=>o(I.trim())),c=n.map(I=>o(I.trim())),d=new Po(l,e),u=new Po(c,n),m=d.length+u.length<1700?this.dynamicProgrammingDiffing.compute(d,u,i,(I,R)=>e[I]===n[R]?n[R].length===0?.1:1+Math.log(1+n[R].length):.99):this.myersDiffingAlgorithm.compute(d,u,i);let f=m.diffs,g=m.hitTimeout;f=Lo(d,u,f),f=Cu(d,u,f);const b=[],k=I=>{if(s)for(let R=0;R<I;R++){const z=F+R,$=N+R;if(e[z]!==n[$]){const L=this.refineDiff(e,n,new ce(new Y(z,z+1),new Y($,$+1)),i,s,r);for(const y of L.mappings)b.push(y);L.hitTimeout&&(g=!0)}}};let F=0,N=0;for(const I of f){Un(()=>I.seq1Range.start-F===I.seq2Range.start-N);const R=I.seq1Range.start-F;k(R),F=I.seq1Range.endExclusive,N=I.seq2Range.endExclusive;const z=this.refineDiff(e,n,I,i,s,r);z.hitTimeout&&(g=!0);for(const $ of z.mappings)b.push($)}k(e.length-F);const _=new nr(e),T=new nr(n),O=So(b,_,T);let V=[];return r.computeMoves&&(V=this.computeMoves(O,e,n,l,c,i,s,r)),Un(()=>{function I(z,$){if(z.lineNumber<1||z.lineNumber>$.length)return!1;const L=$[z.lineNumber-1];return!(z.column<1||z.column>L.length+1)}function R(z,$){return!(z.startLineNumber<1||z.startLineNumber>$.length+1||z.endLineNumberExclusive<1||z.endLineNumberExclusive>$.length+1)}for(const z of O){if(!z.innerChanges)return!1;for(const $ of z.innerChanges)if(!(I($.modifiedRange.getStartPosition(),n)&&I($.modifiedRange.getEndPosition(),n)&&I($.originalRange.getStartPosition(),e)&&I($.originalRange.getEndPosition(),e)))return!1;if(!R(z.modified,n)||!R(z.original,e))return!1}return!0}),new er(O,V,g)}computeMoves(e,n,r,i,s,a,o,l){return mu(e,n,r,i,s,a).map(u=>{const m=this.refineDiff(n,r,new ce(u.original.toOffsetRange(),u.modified.toOffsetRange()),a,o,l),f=So(m.mappings,new nr(n),new nr(r),!0);return new jd(u,f)})}refineDiff(e,n,r,i,s,a){const l=Eu(r).toRangeMapping2(e,n),c=new ir(e,l.originalRange,s),d=new ir(n,l.modifiedRange,s),u=c.length+d.length<500?this.dynamicProgrammingDiffing.compute(c,d,i):this.myersDiffingAlgorithm.compute(c,d,i);let m=u.diffs;return m=Lo(c,d,m),m=zo(c,d,m,(g,b)=>g.findWordContaining(b)),a.extendToSubwords&&(m=zo(c,d,m,(g,b)=>g.findSubWordContaining(b),!0)),m=xu(c,d,m),m=ku(c,d,m),{mappings:m.map(g=>new Ae(c.translateRange(g.seq1Range),d.translateRange(g.seq2Range))),hitTimeout:u.hitTimeout}}}function Eu(t){return new Le(new Z(t.seq1Range.start+1,t.seq1Range.endExclusive+1),new Z(t.seq2Range.start+1,t.seq2Range.endExclusive+1))}const Oo={getLegacy:()=>new su,getDefault:()=>new _u};function pt(t,e){const n=Math.pow(10,e);return Math.round(t*n)/n}class x{constructor(e,n,r,i=1){this._rgbaBrand=void 0,this.r=Math.min(255,Math.max(0,e))|0,this.g=Math.min(255,Math.max(0,n))|0,this.b=Math.min(255,Math.max(0,r))|0,this.a=pt(Math.max(Math.min(1,i),0),3)}static equals(e,n){return e.r===n.r&&e.g===n.g&&e.b===n.b&&e.a===n.a}}class Me{constructor(e,n,r,i){this._hslaBrand=void 0,this.h=Math.max(Math.min(360,e),0)|0,this.s=pt(Math.max(Math.min(1,n),0),3),this.l=pt(Math.max(Math.min(1,r),0),3),this.a=pt(Math.max(Math.min(1,i),0),3)}static equals(e,n){return e.h===n.h&&e.s===n.s&&e.l===n.l&&e.a===n.a}static fromRGBA(e){const n=e.r/255,r=e.g/255,i=e.b/255,s=e.a,a=Math.max(n,r,i),o=Math.min(n,r,i);let l=0,c=0;const d=(o+a)/2,u=a-o;if(u>0){switch(c=Math.min(d<=.5?u/(2*d):u/(2-2*d),1),a){case n:l=(r-i)/u+(r<i?6:0);break;case r:l=(i-n)/u+2;break;case i:l=(n-r)/u+4;break}l*=60,l=Math.round(l)}return new Me(l,c,d,s)}static _hue2rgb(e,n,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?e+(n-e)*6*r:r<1/2?n:r<2/3?e+(n-e)*(2/3-r)*6:e}static toRGBA(e){const n=e.h/360,{s:r,l:i,a:s}=e;let a,o,l;if(r===0)a=o=l=i;else{const c=i<.5?i*(1+r):i+r-i*r,d=2*i-c;a=Me._hue2rgb(d,c,n+1/3),o=Me._hue2rgb(d,c,n),l=Me._hue2rgb(d,c,n-1/3)}return new x(Math.round(a*255),Math.round(o*255),Math.round(l*255),s)}}class Bt{constructor(e,n,r,i){this._hsvaBrand=void 0,this.h=Math.max(Math.min(360,e),0)|0,this.s=pt(Math.max(Math.min(1,n),0),3),this.v=pt(Math.max(Math.min(1,r),0),3),this.a=pt(Math.max(Math.min(1,i),0),3)}static equals(e,n){return e.h===n.h&&e.s===n.s&&e.v===n.v&&e.a===n.a}static fromRGBA(e){const n=e.r/255,r=e.g/255,i=e.b/255,s=Math.max(n,r,i),a=Math.min(n,r,i),o=s-a,l=s===0?0:o/s;let c;return o===0?c=0:s===n?c=((r-i)/o%6+6)%6:s===r?c=(i-n)/o+2:c=(n-r)/o+4,new Bt(Math.round(c*60),l,s,e.a)}static toRGBA(
Line truncated
|
||||
`);s.lastIndex=0;let d;for(;(d=s.exec(c))!==null;){const u=c.substring(0,d.index),m=(u.match(/\n/g)||[]).length,f=a+m,g=d[0].split(`
|
||||
`),b=g.length,k=f+b-1,F=u.lastIndexOf(`
|
||||
`)+1,N=d.index-F+1,_=g[g.length-1],T=b===1?N+d[0].length:_.length+1,O={startLineNumber:f,startColumn:N,endLineNumber:k,endColumn:T},V=(d.groups??{}).label??"",I=((d.groups??{}).separator??"")!=="",R={range:O,text:V,hasSeparatorLine:I,shouldBeInComments:!0};(R.text||R.hasSeparatorLine)&&(n.length===0||n[n.length-1].range.endLineNumber<R.range.startLineNumber)&&n.push(R),s.lastIndex=d.index+d[0].length}}return n}function zu(t){t=t.trim();const e=t.startsWith("-");return t=t.replace(Iu,""),{text:t,hasSeparatorLine:e}}class Pu{get isRejected(){return this.outcome?.outcome===1}get isSettled(){return!!this.outcome}constructor(){this.p=new Promise((e,n)=>{this.completeCallback=e,this.errorCallback=n})}complete(e){return this.isSettled?Promise.resolve():new Promise(n=>{this.completeCallback(e),this.outcome={outcome:0,value:e},n()})}error(e){return this.isSettled?Promise.resolve():new Promise(n=>{this.errorCallback(e),this.outcome={outcome:1,value:e},n()})}cancel(){return this.error(new zs)}}var Bo;(function(t){async function e(r){let i;const s=await Promise.all(r.map(a=>a.then(o=>o,o=>{i||(i=o)})));if(typeof i<"u")throw i;return s}t.settled=e;function n(r){return new Promise(async(i,s)=>{try{await r(i,s)}catch(a){s(a)}})}t.withAsyncBody=n})(Bo||(Bo={}));class Tu{constructor(){this._unsatisfiedConsumers=[],this._unconsumedValues=[]}get hasFinalValue(){return!!this._finalValue}produce(e){if(this._ensureNoFinalValue(),this._unsatisfiedConsumers.length>0){const n=this._unsatisfiedConsumers.shift();this._resolveOrRejectDeferred(n,e)}else this._unconsumedValues.push(e)}produceFinal(e){this._ensureNoFinalValue(),this._finalValue=e;for(const n of this._unsatisfiedConsumers)this._resolveOrRejectDeferred(n,e);this._unsatisfiedConsumers.length=0}_ensureNoFinalValue(){if(this._finalValue)throw new be("ProducerConsumer: cannot produce after final value has been set")}_resolveOrRejectDeferred(e,n){n.ok?e.complete(n.value):e.error(n.error)}consume(){if(this._unconsumedValues.length>0||this._finalValue){const e=this._unconsumedValues.length>0?this._unconsumedValues.shift():this._finalValue;return e.ok?Promise.resolve(e.value):Promise.reject(e.error)}else{const e=new Pu;return this._unsatisfiedConsumers.push(e),e.p}}}const Fe=class Fe{constructor(e,n){this._onReturn=n,this._producerConsumer=new Tu,this._iterator={next:()=>this._producerConsumer.consume(),return:()=>(this._onReturn?.(),Promise.resolve({done:!0,value:void 0})),throw:async r=>(this._finishError(r),{done:!0,value:void 0})},queueMicrotask(async()=>{const r=e({emitOne:i=>this._producerConsumer.produce({ok:!0,value:{done:!1,value:i}}),emitMany:i=>{for(const s of i)this._producerConsumer.produce({ok:!0,value:{done:!1,value:s}})},reject:i=>this._finishError(i)});if(!this._producerConsumer.hasFinalValue)try{await r,this._finishOk()}catch(i){this._finishError(i)}})}static fromArray(e){return new Fe(n=>{n.emitMany(e)})}static fromPromise(e){return new Fe(async n=>{n.emitMany(await e)})}static fromPromisesResolveOrder(e){return new Fe(async n=>{await Promise.all(e.map(async r=>n.emitOne(await r)))})}static merge(e){return new Fe(async n=>{await Promise.all(e.map(async r=>{for await(const i of r)n.emitOne(i)}))})}static map(e,n){return new Fe(async r=>{for await(const i of e)r.emitOne(n(i))})}map(e){return Fe.map(this,e)}static coalesce(e){return Fe.filter(e,n=>!!n)}coalesce(){return Fe.coalesce(this)}static filter(e,n){return new Fe(async r=>{for await(const i of e)n(i)&&r.emitOne(i)})}filter(e){return Fe.filter(this,e)}_finishOk(){this._producerConsumer.hasFinalValue||this._producerConsumer.produceFinal({ok:!0,value:{done:!0,value:void 0}})}_finishError(e){this._producerConsumer.hasFinalValue||this._producerConsumer.produceFinal({ok:!1,error:e})}[Symbol.asyncIterator](){return this._iterator}};Fe.EMPTY=Fe.fromArray([]);let qo=Fe;class Ou{constructor(e){this.values=e,this.prefixSum=new Uint32Array(e.length),this.prefixSumValidIndex=new Int32Array(1),this.prefixSumValidIndex[0]=-1}insertValues(e,n){e=Mt(e);const r=this.values,i=this.prefixSum,s=n.length;return s===0?!1:(this.values=new Uint32Array(r.length+s),this.values.set(r.subarray(0,e),0),this.values.set(r.subarray(e),e+s),this.values.set(n,e),e-1<this.prefixSumValidIndex[0]&&(this.prefixSumValidIndex[0]=e-1),this.prefixSum=new Uint32Array(this.values.length),this.prefixSumValidIndex[0]>=0&&this.prefixSum.set(i.subarray(0,this.prefixSumValidIndex[0]+1)),!0)}setValue(e,n){return e=Mt(e),n=Mt(n),this.values[e]===n?!1:(this.values[e]=n,e-1<this.prefixSumValidIndex[0]&&(this.prefixSumValidIndex[0]=e-1),!0)}removeValues(e,n){e=Mt(e),n=Mt(n);const r=this.values,i=this.prefixSum;if(e>=r.length)return!1;const s=r.length-e;return n>=s&&(n=s),n===0?!1:(this.values=new Uint32Array(r.length-n),this.values.set(r.subarray(0,e),0),this.values.set(r.subarray(e+n),e),this.prefixSum=new Uint32Array(this.values.length),e-1<this.prefixSumValidIndex[0]&&(this.prefixSumValidIndex[0]=e-1),this.prefixSumValidIndex[0]>=0&&this.prefixSum.set(i.suba
Line truncated
|
||||
`),!0}return!1}_escape(e,n){let r=this.stream.peekChar();if(r===ki){this.stream.advance(1),r=this.stream.peekChar();let i=0;for(;i<6&&(r>=xn&&r<=Sn||r>=ar&&r<=Ho||r>=or&&r<=Jo);)this.stream.advance(1),r=this.stream.peekChar(),i++;if(i>0){try{const s=parseInt(this.stream.substring(this.stream.pos()-i),16);s&&e.push(String.fromCharCode(s))}catch{}return r===_i||r===Ei?this.stream.advance(1):this._newline([]),!0}if(r!==jt&&r!==kn&&r!==qt)return this.stream.advance(1),e.push(String.fromCharCode(r)),!0;if(n)return this._newline(e)}return!1}_stringChar(e,n){const r=this.stream.peekChar();return r!==0&&r!==e&&r!==ki&&r!==jt&&r!==kn&&r!==qt?(this.stream.advance(1),n.push(String.fromCharCode(r)),!0):!1}_string(e){if(this.stream.peekChar()===tl||this.stream.peekChar()===el){const n=this.stream.nextChar();for(e.push(String.fromCharCode(n));this._stringChar(n,e)||this._escape(e,!0););return this.stream.peekChar()===n?(this.stream.nextChar(),e.push(String.fromCharCode(n)),p.String):p.BadString}return null}_unquotedChar(e){const n=this.stream.peekChar();return n!==0&&n!==ki&&n!==tl&&n!==el&&n!==Qo&&n!==Ko&&n!==_i&&n!==Ei&&n!==qt&&n!==kn&&n!==jt?(this.stream.advance(1),e.push(String.fromCharCode(n)),!0):!1}_unquotedString(e){let n=!1;for(;this._unquotedChar(e)||this._escape(e);)n=!0;return n}_whitespace(){return this.stream.advanceWhileChar(n=>n===_i||n===Ei||n===qt||n===kn||n===jt)>0}_name(e){let n=!1;for(;this._identChar(e)||this._escape(e);)n=!0;return n}ident(e){const n=this.stream.pos();if(this._minus(e)){if(this._minus(e)||this._identFirstChar(e)||this._escape(e)){for(;this._identChar(e)||this._escape(e););return!0}}else if(this._identFirstChar(e)||this._escape(e)){for(;this._identChar(e)||this._escape(e););return!0}return this.stream.goBackTo(n),!1}_identFirstChar(e){const n=this.stream.peekChar();return n===Yo||n>=ar&&n<=Go||n>=or&&n<=Xo||n>=128&&n<=65535?(this.stream.advance(1),e.push(String.fromCharCode(n)),!0):!1}_minus(e){const n=this.stream.peekChar();return n===St?(this.stream.advance(1),e.push(String.fromCharCode(n)),!0):!1}_identChar(e){const n=this.stream.peekChar();return n===Yo||n===St||n>=ar&&n<=Go||n>=or&&n<=Xo||n>=xn&&n<=Sn||n>=128&&n<=65535?(this.stream.advance(1),e.push(String.fromCharCode(n)),!0):!1}_unicodeRange(){if(this.stream.advanceIfChar(lp)){const e=r=>r>=xn&&r<=Sn||r>=ar&&r<=Ho||r>=or&&r<=Jo,n=this.stream.advanceWhileChar(e)+this.stream.advanceWhileChar(r=>r===op);if(n>=1&&n<=6)if(this.stream.advanceIfChar(St)){const r=this.stream.advanceWhileChar(e);if(r>=1&&r<=6)return!0}else return!0}return!1}}function pe(t,e){if(t.length<e.length)return!1;for(let n=0;n<e.length;n++)if(t[n]!==e[n])return!1;return!0}function il(t,e){let n=t.length-e.length;return n>0?t.lastIndexOf(e)===n:n===0?t===e:!1}function cp(t,e,n=4){let r=Math.abs(t.length-e.length);if(r>n)return 0;let i=[],s=[],a,o;for(a=0;a<e.length+1;++a)s.push(0);for(a=0;a<t.length+1;++a)i.push(s);for(a=1;a<t.length+1;++a)for(o=1;o<e.length+1;++o)t[a-1]===e[o-1]?i[a][o]=i[a-1][o-1]+1:i[a][o]=Math.max(i[a-1][o],i[a][o-1]);return i[t.length][e.length]-Math.sqrt(r)}function sl(t,e=!0){return t?t.length<140?t:t.slice(0,140)+(e?"…":""):""}function hp(t,e){const n=e.exec(t);return n&&n[0].length?t.substr(0,t.length-n[0].length):t}function al(t,e){let n="";for(;e>0;)(e&1)===1&&(n+=t),t+=t,e=e>>>1;return n}var v;(function(t){t[t.Undefined=0]="Undefined",t[t.Identifier=1]="Identifier",t[t.Stylesheet=2]="Stylesheet",t[t.Ruleset=3]="Ruleset",t[t.Selector=4]="Selector",t[t.SimpleSelector=5]="SimpleSelector",t[t.SelectorInterpolation=6]="SelectorInterpolation",t[t.SelectorCombinator=7]="SelectorCombinator",t[t.SelectorCombinatorParent=8]="SelectorCombinatorParent",t[t.SelectorCombinatorSibling=9]="SelectorCombinatorSibling",t[t.SelectorCombinatorAllSiblings=10]="SelectorCombinatorAllSiblings",t[t.SelectorCombinatorShadowPiercingDescendant=11]="SelectorCombinatorShadowPiercingDescendant",t[t.Page=12]="Page",t[t.PageBoxMarginBox=13]="PageBoxMarginBox",t[t.ClassSelector=14]="ClassSelector",t[t.IdentifierSelector=15]="IdentifierSelector",t[t.ElementNameSelector=16]="ElementNameSelector",t[t.PseudoSelector=17]="PseudoSelector",t[t.AttributeSelector=18]="AttributeSelector",t[t.Declaration=19]="Declaration",t[t.Declarations=20]="Declarations",t[t.Property=21]="Property",t[t.Expression=22]="Expression",t[t.BinaryExpression=23]="BinaryExpression",t[t.Term=24]="Term",t[t.Operator=25]="Operator",t[t.Value=26]="Value",t[t.StringLiteral=27]="StringLiteral",t[t.URILiteral=28]="URILiteral",t[t.EscapedValue=29]="EscapedValue",t[t.Function=30]="Function",t[t.NumericValue=31]="NumericValue",t[t.HexColorValue=32]="HexColorValue",t[t.RatioValue=33]="RatioValue",t[t.MixinDeclaration=34]="MixinDeclaration",t[t.MixinReference=35]="MixinReference",t[t.VariableName=36]="VariableName",t[t.VariableDeclaration=37]="VariableDeclaration",t[t.Prio=38]="Prio",t[t.Interpolation=39]="Interpolation",t[t.NestedProperties=40]="NestedProperties",t[t.ExtendsReference=41]="ExtendsReference",t
Line truncated
|
||||
`,s==="\r"&&i+1<n.length&&n.charAt(i+1)===`
|
||||
`&&i++}r&&n.length>0&&e.push(n.length),this._lineOffsets=e}return this._lineOffsets}positionAt(e){e=Math.max(Math.min(e,this._content.length),0);let n=this.getLineOffsets(),r=0,i=n.length;if(i===0)return ye.create(0,e);for(;r<i;){let a=Math.floor((r+i)/2);n[a]>e?i=a:r=a+1}let s=r-1;return ye.create(s,e-n[s])}offsetAt(e){let n=this.getLineOffsets();if(e.line>=n.length)return this._content.length;if(e.line<0)return 0;let r=n[e.line],i=e.line+1<n.length?n[e.line+1]:this._content.length;return Math.max(Math.min(r+e.character,i),r)}get lineCount(){return this.getLineOffsets().length}};var C;(function(t){const e=Object.prototype.toString;function n(f){return typeof f<"u"}t.defined=n;function r(f){return typeof f>"u"}t.undefined=r;function i(f){return f===!0||f===!1}t.boolean=i;function s(f){return e.call(f)==="[object String]"}t.string=s;function a(f){return e.call(f)==="[object Number]"}t.number=a;function o(f,g,b){return e.call(f)==="[object Number]"&&g<=f&&f<=b}t.numberRange=o;function l(f){return e.call(f)==="[object Number]"&&-2147483648<=f&&f<=2147483647}t.integer=l;function c(f){return e.call(f)==="[object Number]"&&0<=f&&f<=2147483647}t.uinteger=c;function d(f){return e.call(f)==="[object Function]"}t.func=d;function u(f){return f!==null&&typeof f=="object"}t.objectLiteral=u;function m(f,g){return Array.isArray(f)&&f.every(g)}t.typedArray=m})(C||(C={}));class An{constructor(e,n,r,i){this._uri=e,this._languageId=n,this._version=r,this._content=i,this._lineOffsets=void 0}get uri(){return this._uri}get languageId(){return this._languageId}get version(){return this._version}getText(e){if(e){const n=this.offsetAt(e.start),r=this.offsetAt(e.end);return this._content.substring(n,r)}return this._content}update(e,n){for(let r of e)if(An.isIncremental(r)){const i=cc(r.range),s=this.offsetAt(i.start),a=this.offsetAt(i.end);this._content=this._content.substring(0,s)+r.text+this._content.substring(a,this._content.length);const o=Math.max(i.start.line,0),l=Math.max(i.end.line,0);let c=this._lineOffsets;const d=lc(r.text,!1,s);if(l-o===d.length)for(let m=0,f=d.length;m<f;m++)c[m+o+1]=d[m];else d.length<1e4?c.splice(o+1,l-o,...d):this._lineOffsets=c=c.slice(0,o+1).concat(d,c.slice(l+1));const u=r.text.length-(a-s);if(u!==0)for(let m=o+1+d.length,f=c.length;m<f;m++)c[m]=c[m]+u}else if(An.isFull(r))this._content=r.text,this._lineOffsets=void 0;else throw new Error("Unknown change event received");this._version=n}getLineOffsets(){return this._lineOffsets===void 0&&(this._lineOffsets=lc(this._content,!0)),this._lineOffsets}positionAt(e){e=Math.max(Math.min(e,this._content.length),0);let n=this.getLineOffsets(),r=0,i=n.length;if(i===0)return{line:0,character:e};for(;r<i;){let a=Math.floor((r+i)/2);n[a]>e?i=a:r=a+1}let s=r-1;return{line:s,character:e-n[s]}}offsetAt(e){let n=this.getLineOffsets();if(e.line>=n.length)return this._content.length;if(e.line<0)return 0;let r=n[e.line],i=e.line+1<n.length?n[e.line+1]:this._content.length;return Math.max(Math.min(r+e.character,i),r)}get lineCount(){return this.getLineOffsets().length}static isIncremental(e){let n=e;return n!=null&&typeof n.text=="string"&&n.range!==void 0&&(n.rangeLength===void 0||typeof n.rangeLength=="number")}static isFull(e){let n=e;return n!=null&&typeof n.text=="string"&&n.range===void 0&&n.rangeLength===void 0}}var ts;(function(t){function e(i,s,a,o){return new An(i,s,a,o)}t.create=e;function n(i,s,a){if(i instanceof An)return i.update(s,a),i;throw new Error("TextDocument.update: document must be created by TextDocument.create")}t.update=n;function r(i,s){let a=i.getText(),o=ns(s.map(Yp),(d,u)=>{let m=d.range.start.line-u.range.start.line;return m===0?d.range.start.character-u.range.start.character:m}),l=0;const c=[];for(const d of o){let u=i.offsetAt(d.range.start);if(u<l)throw new Error("Overlapping edit");u>l&&c.push(a.substring(l,u)),d.newText.length&&c.push(d.newText),l=i.offsetAt(d.range.end)}return c.push(a.substr(l)),c.join("")}t.applyEdits=r})(ts||(ts={}));function ns(t,e){if(t.length<=1)return t;const n=t.length/2|0,r=t.slice(0,n),i=t.slice(n);ns(r,e),ns(i,e);let s=0,a=0,o=0;for(;s<r.length&&a<i.length;)e(r[s],i[a])<=0?t[o++]=r[s++]:t[o++]=i[a++];for(;s<r.length;)t[o++]=r[s++];for(;a<i.length;)t[o++]=i[a++];return t}function lc(t,e,n=0){const r=e?[n]:[];for(let i=0;i<t.length;i++){let s=t.charCodeAt(i);(s===13||s===10)&&(s===13&&i+1<t.length&&t.charCodeAt(i+1)===10&&i++,r.push(n+i+1))}return r}function cc(t){const e=t.start,n=t.end;return e.line>n.line||e.line===n.line&&e.character>n.character?{start:n,end:e}:t}function Yp(t){const e=cc(t.range);return e!==t.range?{newText:t.newText,range:e}:t}var hc;(function(t){t.LATEST={textDocument:{completion:{completionItem:{documentationFormat:[He.Markdown,He.PlainText]}},hover:{contentFormat:[He.Markdown,He.PlainText]}}}})(hc||(hc={}));var Mn;(function(t){t[t.Unknown=0]="Unknown",t[t.File=1]="File",t[t.Directory=2]="Directory",t[t.SymbolicLink=64]="SymbolicLink"})(Mn||(Mn={}));const dc={E:"Edge",FF:"Firefox",
Line truncated
|
||||
|
||||
`;case"nonstandard":return`🚨️ Property is nonstandard. Avoid using it.
|
||||
|
||||
`;case"obsolete":return`🚨️️️ Property is obsolete. Avoid using it.
|
||||
|
||||
`;default:return""}}function mt(t,e,n){let r;if(e?r={kind:"markdown",value:Kp(t,n)}:r={kind:"plaintext",value:Qp(t,n)},r.value!=="")return r}function vr(t){return t=t.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&"),t.replace(/</g,"<").replace(/>/g,">")}function Qp(t,e){if(!t.description||t.description==="")return"";if(typeof t.description!="string")return t.description.value;let n="";if(e?.documentation!==!1){t.status&&(n+=uc(t.status)),n+=t.description;const r=pc(t.browsers);r&&(n+=`
|
||||
(`+r+")"),"syntax"in t&&(n+=`
|
||||
|
||||
Syntax: ${t.syntax}`)}return t.references&&t.references.length>0&&e?.references!==!1&&(n.length>0&&(n+=`
|
||||
|
||||
`),n+=t.references.map(r=>`${r.name}: ${r.url}`).join(" | ")),n}function Kp(t,e){if(!t.description||t.description==="")return"";let n="";if(e?.documentation!==!1){t.status&&(n+=uc(t.status)),typeof t.description=="string"?n+=vr(t.description):n+=t.description.kind===He.Markdown?t.description.value:vr(t.description.value);const r=pc(t.browsers);r&&(n+=`
|
||||
|
||||
(`+vr(r)+")"),"syntax"in t&&t.syntax&&(n+=`
|
||||
|
||||
Syntax: ${vr(t.syntax)}`)}return t.references&&t.references.length>0&&e?.references!==!1&&(n.length>0&&(n+=`
|
||||
|
||||
`),n+=t.references.map(r=>`[${r.name}](${r.url})`).join(" | ")),n}function pc(t=[]){return t.length===0?null:t.map(e=>{let n="";const r=e.match(/([A-Z]+)(\d+)?/),i=r[1],s=r[2];return i in dc&&(n+=dc[i]),s&&(n+=" "+s),n}).join(", ")}const Zp=/(^#([0-9A-F]{3}){1,2}$)|(^#([0-9A-F]{4}){1,2}$)/i,em=[{label:"rgb",func:"rgb($red, $green, $blue)",insertText:"rgb(${1:red}, ${2:green}, ${3:blue})",desc:w("Creates a Color from red, green, and blue values.")},{label:"rgba",func:"rgba($red, $green, $blue, $alpha)",insertText:"rgba(${1:red}, ${2:green}, ${3:blue}, ${4:alpha})",desc:w("Creates a Color from red, green, blue, and alpha values.")},{label:"rgb relative",func:"rgb(from $color $red $green $blue)",insertText:"rgb(from ${1:color} ${2:r} ${3:g} ${4:b})",desc:w("Creates a Color from the red, green, and blue values of another Color.")},{label:"hsl",func:"hsl($hue, $saturation, $lightness)",insertText:"hsl(${1:hue}, ${2:saturation}, ${3:lightness})",desc:w("Creates a Color from hue, saturation, and lightness values.")},{label:"hsla",func:"hsla($hue, $saturation, $lightness, $alpha)",insertText:"hsla(${1:hue}, ${2:saturation}, ${3:lightness}, ${4:alpha})",desc:w("Creates a Color from hue, saturation, lightness, and alpha values.")},{label:"hsl relative",func:"hsl(from $color $hue $saturation $lightness)",insertText:"hsl(from ${1:color} ${2:h} ${3:s} ${4:l})",desc:w("Creates a Color from the hue, saturation, and lightness values of another Color.")},{label:"hwb",func:"hwb($hue $white $black)",insertText:"hwb(${1:hue} ${2:white} ${3:black})",desc:w("Creates a Color from hue, white, and black values.")},{label:"hwb relative",func:"hwb(from $color $hue $white $black)",insertText:"hwb(from ${1:color} ${2:h} ${3:w} ${4:b})",desc:w("Creates a Color from the hue, white, and black values of another Color.")},{label:"lab",func:"lab($lightness $a $b)",insertText:"lab(${1:lightness} ${2:a} ${3:b})",desc:w("Creates a Color from lightness, a, and b values.")},{label:"lab relative",func:"lab(from $color $lightness $a $b)",insertText:"lab(from ${1:color} ${2:l} ${3:a} ${4:b})",desc:w("Creates a Color from the lightness, a, and b values of another Color.")},{label:"oklab",func:"oklab($lightness $a $b)",insertText:"oklab(${1:lightness} ${2:a} ${3:b})",desc:w("Creates a Color from lightness, a, and b values.")},{label:"oklab relative",func:"oklab(from $color $lightness $a $b)",insertText:"oklab(from ${1:color} ${2:l} ${3:a} ${4:b})",desc:w("Creates a Color from the lightness, a, and b values of another Color.")},{label:"lch",func:"lch($lightness $chroma $hue)",insertText:"lch(${1:lightness} ${2:chroma} ${3:hue})",desc:w("Creates a Color from lightness, chroma, and hue values.")},{label:"lch relative",func:"lch(from $color $lightness $chroma $hue)",insertText:"lch(from ${1:color} ${2:l} ${3:c} ${4:h})",desc:w("Creates a Color from the lightness, chroma, and hue values of another Color.")},{label:"oklch",func:"oklch($lightness $chroma $hue)",insertText:"oklch(${1:lightness} ${2:chroma} ${3:hue})",desc:w("Creates a Color from lightness, chroma, and hue values.")},{label:"oklch relative",func:"oklch(from $color $lightness $chroma $hue)",insertText:"oklch(from ${1:color} ${2:l} ${3:c} ${4:h})",desc:w("Creates a Color from the lightness, chroma, and hue values of another Color.")},{label:"color",func:"color($color-space $red $green $blue)",insertText:"color(${1|srgb,srgb-linear,display-p3,a98-rgb,prophoto-rgb,rec2020,xyx,xyz-d50,xyz-d65|} ${2:red} ${3:green} ${4:blue})",desc:w("Creates a Color in a specific color space from red, green, and blue values.")},{label:"color relative",func:"color(from $color $color-space $red $green $blue)",insertText:"color(from ${1:color} ${2|srgb,srgb-linear,display-p3,a98-rgb,prophoto-rgb,rec2020,xyx,xyz-d50,xyz-d65|} ${3:r} ${4:g} ${5:b})",desc:w("Creates a Color in a specific color space from the red, green, and blue values of another Color.")},{label:"color-mix",func:"color-mix(in $color-space, $color $percentage, $color $percentage)",insertText:"color-mix(in ${1|srgb,srgb-linear,lab,oklab,xyz,xyz-d50,xyz-d65|}, ${3:color} ${4:percentage}, ${5:color} ${6:percentage})",desc:w("Mix two colors together in a rectangular color space.")},{label:"color-mix hue",func:"color-mix(in $color-space $interpolation-method hue, $color $percentage, $color $percentage)",insertText:"color-mix(in ${1|hsl,hwb,lch,oklch|} ${2|shorter hue,longer hue,increasing hue,decreasing hue|}, ${3:color} ${4:percentage}, ${5:color} ${6:percentage})",desc:w("Mix two colors together in a polar color space.")}],tm=/^(rgb|rgba|hsl|hsla|hwb)$/i,yr={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"
Line truncated
|
||||
\r":{[()]},*>+`.indexOf(r.charAt(n))===-1;)n--;return r.substring(n+1,e)}let hs=class Ms{constructor(){this.parent=null,this.children=null,this.attributes=null}findAttribute(e){if(this.attributes){for(const n of this.attributes)if(n.name===e)return n.value}return null}addChild(e){e instanceof Ms&&(e.parent=this),this.children||(this.children=[]),this.children.push(e)}append(e){if(this.attributes){const n=this.attributes[this.attributes.length-1];n.value=n.value+e}}prepend(e){if(this.attributes){const n=this.attributes[0];n.value=e+n.value}}findRoot(){let e=this;for(;e.parent&&!(e.parent instanceof Kt);)e=e.parent;return e}removeChild(e){if(this.children){const n=this.children.indexOf(e);if(n!==-1)return this.children.splice(n,1),!0}return!1}addAttr(e,n){this.attributes||(this.attributes=[]);for(const r of this.attributes)if(r.name===e){r.value+=" "+n;return}this.attributes.push({name:e,value:n})}clone(e=!0){const n=new Ms;if(this.attributes){n.attributes=[];for(const r of this.attributes)n.addAttr(r.name,r.value)}if(e&&this.children){n.children=[];for(let r=0;r<this.children.length;r++)n.addChild(this.children[r].clone())}return n}cloneWithParent(){const e=this.clone(!1);return this.parent&&!(this.parent instanceof Kt)&&this.parent.cloneWithParent().addChild(e),e}};class Kt extends hs{}class ds extends hs{constructor(e){super(),this.addAttr("name",e)}}class zc{constructor(e){this.quote=e,this.result=[]}print(e,n){this.result=[],e instanceof Kt?e.children&&this.doPrint(e.children,0):this.doPrint([e],0);let r;return n?r=`${n.text}
|
||||
… `+this.result.join(`
|
||||
`):r=this.result.join(`
|
||||
`),[{language:"html",value:r}]}doPrint(e,n){for(const r of e)this.doPrintElement(r,n),r.children&&this.doPrint(r.children,n+1)}writeLine(e,n){const r=new Array(e+1).join(" ");this.result.push(r+n)}doPrintElement(e,n){const r=e.findAttribute("name");if(e instanceof ds||r==="…"){this.writeLine(n,r);return}const i=["<"];if(r?i.push(r):i.push("element"),e.attributes){for(const s of e.attributes)if(s.name!=="name"){i.push(" "),i.push(s.name);const a=s.value;a&&(i.push("="),i.push(rt.ensure(a,this.quote)))}}i.push(">"),this.writeLine(n,i.join(""))}}var rt;(function(t){function e(r,i){return i+n(r)+i}t.ensure=e;function n(r){const i=r.match(/^['"](.*)["']$/);return i?i[1]:r}t.remove=n})(rt||(rt={}));class us{constructor(){this.id=0,this.attr=0,this.tag=0}}function Pc(t,e){let n=new hs;for(const r of t.getChildren())switch(r.type){case v.SelectorCombinator:if(e){const o=r.getText().split("&");if(o.length===1){n.addAttr("name",o[0]);break}n=e.cloneWithParent(),o[0]&&n.findRoot().prepend(o[0]);for(let l=1;l<o.length;l++){if(l>1){const c=e.cloneWithParent();n.addChild(c.findRoot()),n=c}n.append(o[l])}}break;case v.SelectorPlaceholder:if(r.matches("@at-root"))return n;case v.ElementNameSelector:const i=r.getText();n.addAttr("name",i==="*"?"element":Oe(i));break;case v.ClassSelector:n.addAttr("class",Oe(r.getText().substring(1)));break;case v.IdentifierSelector:n.addAttr("id",Oe(r.getText().substring(1)));break;case v.MixinDeclaration:n.addAttr("class",r.getName());break;case v.PseudoSelector:n.addAttr(Oe(r.getText()),"");break;case v.AttributeSelector:const s=r,a=s.getIdentifier();if(a){const o=s.getValue(),l=s.getOperator();let c;if(o&&l)switch(Oe(l.getText())){case"|=":c=`${rt.remove(Oe(o.getText()))}-…`;break;case"^=":c=`${rt.remove(Oe(o.getText()))}…`;break;case"$=":c=`…${rt.remove(Oe(o.getText()))}`;break;case"~=":c=` … ${rt.remove(Oe(o.getText()))} … `;break;case"*=":c=`…${rt.remove(Oe(o.getText()))}…`;break;default:c=rt.remove(Oe(o.getText()));break}n.addAttr(Oe(a.getText()),c)}break}return n}function Oe(t){const e=new _n;e.setSource(t);const n=e.scanUnquotedString();return n?n.text:t}class Fm{constructor(e){this.cssDataManager=e}selectorToMarkedString(e,n){const r=Im(e);if(r){const i=new zc('"').print(r,n);return i.push(this.selectorToSpecificityMarkedString(e)),i}else return[]}simpleSelectorToMarkedString(e){const n=Pc(e),r=new zc('"').print(n);return r.push(this.selectorToSpecificityMarkedString(e)),r}isPseudoElementIdentifier(e){const n=e.match(/^::?([\w-]+)/);return n?!!this.cssDataManager.getPseudoElement("::"+n[1]):!1}selectorToSpecificityMarkedString(e){const n=s=>{const a=new us;let o=new us;for(const l of s)for(const c of l.getChildren()){const d=r(c);if(d.id>o.id){o=d;continue}else if(d.id<o.id)continue;if(d.attr>o.attr){o=d;continue}else if(d.attr<o.attr)continue;if(d.tag>o.tag){o=d;continue}}return a.id+=o.id,a.attr+=o.attr,a.tag+=o.tag,a},r=s=>{const a=new us;e:for(const o of s.getChildren()){switch(o.type){case v.IdentifierSelector:a.id++;break;case v.ClassSelector:case v.AttributeSelector:a.attr++;break;case v.ElementNameSelector:if(o.matches("*"))break;a.tag++;break;case v.PseudoSelector:const l=o.getText(),c=o.getChildren();if(this.isPseudoElementIdentifier(l)){if(l.match(/^::slotted/i)&&c.length>0){a.tag++;let d=n(c);a.id+=d.id,a.attr+=d.attr,a.tag+=d.tag;continue e}a.tag++;continue e}if(l.match(/^:where/i))continue e;if(l.match(/^:(?:not|has|is)/i)&&c.length>0){let d=n(c);a.id+=d.id,a.attr+=d.attr,a.tag+=d.tag;continue e}if(l.match(/^:(?:host|host-context)/i)&&c.length>0){a.attr++;let d=n(c);a.id+=d.id,a.attr+=d.attr,a.tag+=d.tag;continue e}if(l.match(/^:(?:nth-child|nth-last-child)/i)&&c.length>0){if(a.attr++,c.length===3&&c[1].type===23){let g=n(c[2].getChildren());a.id+=g.id,a.attr+=g.attr,a.tag+=g.tag;continue e}const d=new Cr,u=c[1].getText();d.scanner.setSource(u);const m=d.scanner.scan(),f=d.scanner.scan();if(m.text==="n"||m.text==="-n"&&f.text==="of"){const g=[],k=u.slice(f.offset+2).split(",");for(const N of k){const _=d.internalParse(N,d._parseSelector);_&&g.push(_)}let F=n(g);a.id+=F.id,a.attr+=F.attr,a.tag+=F.tag;continue e}continue e}a.attr++;continue e}if(o.getChildren().length>0){const l=r(o);a.id+=l.id,a.attr+=l.attr,a.tag+=l.tag}}return a},i=r(e);return`[${w("Selector Specificity")}](https://developer.mozilla.org/docs/Web/CSS/Specificity): (${i.id}, ${i.attr}, ${i.tag})`}}class Rm{constructor(e){this.prev=null,this.element=e}processSelector(e){let n=null;if(!(this.element instanceof Kt)&&e.getChildren().some(r=>r.hasChildren()&&r.getChild(0).type===v.SelectorCombinator)){const r=this.element.findRoot();r.parent instanceof Kt&&(n=this.element,this.element=r.parent,this.element.removeChild(r),this.prev=null)}for(const r of e.getChildren()){if(r instanceof Ht){if(this.prev instanceof Ht){const a=new ds("…");this.element.addChild(a),this.element=a}else this.prev&&(this.prev.matches("+")||this.prev.matches("~"))&&this.element.parent&&(this.element=this.element.
Line truncated
|
||||
$0
|
||||
}`,insertTextFormat:Ie.Snippet,kind:q.Keyword},{label:"@for",documentation:w("For loop that repeatedly outputs a set of styles for each `$var` in the `from/through` or `from/to` clause."),insertText:"@for \\$${1:var} from ${2:start} ${3|to,through|} ${4:end} {\n $0\n}",insertTextFormat:Ie.Snippet,kind:q.Keyword},{label:"@each",documentation:w("Each loop that sets `$var` to each item in the list or map, then outputs the styles it contains using that value of `$var`."),insertText:"@each \\$${1:var} in ${2:list} {\n $0\n}",insertTextFormat:Ie.Snippet,kind:q.Keyword},{label:"@while",documentation:w("While loop that takes an expression and repeatedly outputs the nested styles until the statement evaluates to `false`."),insertText:`@while \${1:condition} {
|
||||
$0
|
||||
}`,insertTextFormat:Ie.Snippet,kind:q.Keyword},{label:"@mixin",documentation:w("Defines styles that can be re-used throughout the stylesheet with `@include`."),insertText:`@mixin \${1:name} {
|
||||
$0
|
||||
}`,insertTextFormat:Ie.Snippet,kind:q.Keyword},{label:"@include",documentation:w("Includes the styles defined by another mixin into the current rule."),kind:q.Keyword},{label:"@function",documentation:w("Defines complex operations that can be re-used throughout stylesheets."),kind:q.Keyword}],ge.scssModuleLoaders=[{label:"@use",documentation:w("Loads mixins, functions, and variables from other Sass stylesheets as 'modules', and combines CSS from multiple stylesheets together."),references:[{name:at,url:"https://sass-lang.com/documentation/at-rules/use"}],insertText:"@use $0;",insertTextFormat:Ie.Snippet,kind:q.Keyword},{label:"@forward",documentation:w("Loads a Sass stylesheet and makes its mixins, functions, and variables available when this stylesheet is loaded with the @use rule."),references:[{name:at,url:"https://sass-lang.com/documentation/at-rules/forward"}],insertText:"@forward $0;",insertTextFormat:Ie.Snippet,kind:q.Keyword}],ge.scssModuleBuiltIns=[{label:"sass:math",documentation:w("Provides functions that operate on numbers."),references:[{name:at,url:"https://sass-lang.com/documentation/modules/math"}]},{label:"sass:string",documentation:w("Makes it easy to combine, search, or split apart strings."),references:[{name:at,url:"https://sass-lang.com/documentation/modules/string"}]},{label:"sass:color",documentation:w("Generates new colors based on existing ones, making it easy to build color themes."),references:[{name:at,url:"https://sass-lang.com/documentation/modules/color"}]},{label:"sass:list",documentation:w("Lets you access and modify values in lists."),references:[{name:at,url:"https://sass-lang.com/documentation/modules/list"}]},{label:"sass:map",documentation:w("Makes it possible to look up the value associated with a key in a map, and much more."),references:[{name:at,url:"https://sass-lang.com/documentation/modules/map"}]},{label:"sass:selector",documentation:w("Provides access to Sass’s powerful selector engine."),references:[{name:at,url:"https://sass-lang.com/documentation/modules/selector"}]},{label:"sass:meta",documentation:w("Exposes the details of Sass’s inner workings."),references:[{name:at,url:"https://sass-lang.com/documentation/modules/meta"}]}];function Jc(t){t.forEach(e=>{if(e.documentation&&e.references&&e.references.length>0){const n=typeof e.documentation=="string"?{kind:"markdown",value:e.documentation}:{kind:"markdown",value:e.documentation.value};n.value+=`
|
||||
|
||||
`,n.value+=e.references.map(r=>`[${r.name}](${r.url})`).join(" | "),e.documentation=n}})}const Xc=47,Km=10,Zm=13,ef=12,_s=96,Es=46;let tf=p.CustomToken;const Fs=tf++;class Yc extends _n{scanNext(e){const n=this.escapedJavaScript();return n!==null?this.finishToken(e,n):this.stream.advanceIfChars([Es,Es,Es])?this.finishToken(e,Fs):super.scanNext(e)}comment(){return super.comment()?!0:!this.inURL&&this.stream.advanceIfChars([Xc,Xc])?(this.stream.advanceWhileChar(e=>{switch(e){case Km:case Zm:case ef:return!1;default:return!0}}),!0):!1}escapedJavaScript(){return this.stream.peekChar()===_s?(this.stream.advance(1),this.stream.advanceWhileChar(n=>n!==_s),this.stream.advanceIfChar(_s)?p.EscapedJavaScript:p.BadEscapedJavaScript):null}}class nf extends Cr{constructor(){super(new Yc)}_parseStylesheetStatement(e=!1){return this.peek(p.AtKeyword)?this._parseVariableDeclaration()||this._parsePlugin()||super._parseStylesheetAtStatement(e):this._tryParseMixinDeclaration()||this._tryParseMixinReference()||this._parseFunction()||this._parseRuleset(!0)}_parseImport(){if(!this.peekKeyword("@import")&&!this.peekKeyword("@import-once"))return null;const e=this.create(Li);if(this.consumeToken(),this.accept(p.ParenthesisL)){if(!this.accept(p.Ident))return this.finish(e,S.IdentifierExpected,[p.SemiColon]);do if(!this.accept(p.Comma))break;while(this.accept(p.Ident));if(!this.accept(p.ParenthesisR))return this.finish(e,S.RightParenthesisExpected,[p.SemiColon])}return!e.addChild(this._parseURILiteral())&&!e.addChild(this._parseStringLiteral())?this.finish(e,S.URIOrStringExpected,[p.SemiColon]):(!this.peek(p.SemiColon)&&!this.peek(p.EOF)&&e.setMedialist(this._parseMediaQueryList()),this._completeParseImport(e))}_parsePlugin(){if(!this.peekKeyword("@plugin"))return null;const e=this.createNode(v.Plugin);return this.consumeToken(),e.addChild(this._parseStringLiteral())?this.accept(p.SemiColon)?this.finish(e):this.finish(e,S.SemiColonExpected):this.finish(e,S.StringLiteralExpected)}_parseMediaQuery(){const e=super._parseMediaQuery();if(!e){const n=this.create(ul);return n.addChild(this._parseVariable())?this.finish(n):null}return e}_parseMediaDeclaration(e=!1){return this._tryParseRuleset(e)||this._tryToParseDeclaration()||this._tryParseMixinDeclaration()||this._tryParseMixinReference()||this._parseDetachedRuleSetMixin()||this._parseStylesheetStatement(e)}_parseMediaFeatureName(){return this._parseIdent()||this._parseVariable()}_parseVariableDeclaration(e=[]){const n=this.create(hr),r=this.mark();if(!n.setVariable(this._parseVariable(!0)))return null;if(this.accept(p.Colon)){if(this.prevToken&&(n.colonPosition=this.prevToken.offset),n.setValue(this._parseDetachedRuleSet()))n.needsSemicolon=!1;else if(!n.setValue(this._parseExpr()))return this.finish(n,S.VariableValueExpected,[],e);n.addChild(this._parsePrio())}else return this.restoreAtMark(r),null;return this.peek(p.SemiColon)&&(n.semicolonPosition=this.token.offset),this.finish(n)}_parseDetachedRuleSet(){let e=this.mark();if(this.peekDelim("#")||this.peekDelim("."))if(this.consumeToken(),!this.hasWhitespace()&&this.accept(p.ParenthesisL)){let r=this.create(In);if(r.getParameters().addChild(this._parseMixinParameter()))for(;(this.accept(p.Comma)||this.accept(p.SemiColon))&&!this.peek(p.ParenthesisR);)r.getParameters().addChild(this._parseMixinParameter())||this.markError(r,S.IdentifierExpected,[],[p.ParenthesisR]);if(!this.accept(p.ParenthesisR))return this.restoreAtMark(e),null}else return this.restoreAtMark(e),null;if(!this.peek(p.CurlyL))return null;const n=this.create(oe);return this._parseBody(n,this._parseDetachedRuleSetBody.bind(this)),this.finish(n)}_parseDetachedRuleSetBody(){return this._tryParseKeyframeSelector()||this._parseRuleSetDeclaration()}_addLookupChildren(e){if(!e.addChild(this._parseLookupValue()))return!1;let n=!1;for(;this.peek(p.BracketL)&&(n=!0),!!e.addChild(this._parseLookupValue());)n=!1;return!n}_parseLookupValue(){const e=this.create(W),n=this.mark();return this.accept(p.BracketL)?(e.addChild(this._parseVariable(!1,!0))||e.addChild(this._parsePropertyIdentifier()))&&this.accept(p.BracketR)||this.accept(p.BracketR)?e:(this.restoreAtMark(n),null):(this.restoreAtMark(n),null)}_parseVariable(e=!1,n=!1){const r=!e&&this.peekDelim("$");if(!this.peekDelim("@")&&!r&&!this.peek(p.AtKeyword))return null;const i=this.create(Wi),s=this.mark();for(;this.acceptDelim("@")||!e&&this.acceptDelim("$");)if(this.hasWhitespace())return this.restoreAtMark(s),null;return!this.accept(p.AtKeyword)&&!this.accept(p.Ident)?(this.restoreAtMark(s),null):!n&&this.peek(p.BracketL)&&!this._addLookupChildren(i)?(this.restoreAtMark(s),null):i}_parseTermExpression(){return this._parseVariable()||this._parseEscaped()||super._parseTermExpression()||this._tryParseMixinReference(!1)}_parseEscaped(){if(this.peek(p.EscapedJavaScript)||this.peek(p.BadEscapedJavaScript)){const e=this.createNode(v.EscapedValue);return this.consumeToken(),this.finish(e)}if(this.peekDelim("~")){const e=this.createNode(
Line truncated
|
||||
`);c!==-1?this.__character_count=l.length-c:this.__character_count+=l.length},s.prototype.pop=function(){var l=null;return this.is_empty()||(l=this.__items.pop(),this.__character_count-=l.length),l},s.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},s.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},s.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},s.prototype.toString=function(){var l="";return this.is_empty()?this.__parent.indent_empty_lines&&(l=this.__parent.get_indent_string(this.__indent_count)):(l=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),l+=this.__items.join("")),l};function a(l,c){this.__cache=[""],this.__indent_size=l.indent_size,this.__indent_string=l.indent_char,l.indent_with_tabs||(this.__indent_string=new Array(l.indent_size+1).join(l.indent_char)),c=c||"",l.indent_level>0&&(c=new Array(l.indent_level+1).join(this.__indent_string)),this.__base_string=c,this.__base_string_length=c.length}a.prototype.get_indent_size=function(l,c){var d=this.__base_string_length;return c=c||0,l<0&&(d=0),d+=l*this.__indent_size,d+=c,d},a.prototype.get_indent_string=function(l,c){var d=this.__base_string;return c=c||0,l<0&&(l=0,d=""),c+=l*this.__indent_size,this.__ensure_cache(c),d+=this.__cache[c],d},a.prototype.__ensure_cache=function(l){for(;l>=this.__cache.length;)this.__add_column()},a.prototype.__add_column=function(){var l=this.__cache.length,c=0,d="";this.__indent_size&&l>=this.__indent_size&&(c=Math.floor(l/this.__indent_size),l-=c*this.__indent_size,d=new Array(c+1).join(this.__indent_string)),l&&(d+=new Array(l+1).join(" ")),this.__cache.push(d)};function o(l,c){this.__indent_cache=new a(l,c),this.raw=!1,this._end_with_newline=l.end_with_newline,this.indent_size=l.indent_size,this.wrap_line_length=l.wrap_line_length,this.indent_empty_lines=l.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new s(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}o.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},o.prototype.get_line_number=function(){return this.__lines.length},o.prototype.get_indent_string=function(l,c){return this.__indent_cache.get_indent_string(l,c)},o.prototype.get_indent_size=function(l,c){return this.__indent_cache.get_indent_size(l,c)},o.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},o.prototype.add_new_line=function(l){return this.is_empty()||!l&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},o.prototype.get_code=function(l){this.trim(!0);var c=this.current_line.pop();c&&(c[c.length-1]===`
|
||||
`&&(c=c.replace(/\n+$/g,"")),this.current_line.push(c)),this._end_with_newline&&this.__add_outputline();var d=this.__lines.join(`
|
||||
`);return l!==`
|
||||
`&&(d=d.replace(/[\n]/g,l)),d},o.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},o.prototype.set_indent=function(l,c){return l=l||0,c=c||0,this.next_line.set_indent(l,c),this.__lines.length>1?(this.current_line.set_indent(l,c),!0):(this.current_line.set_indent(),!1)},o.prototype.add_raw_token=function(l){for(var c=0;c<l.newlines;c++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(l.whitespace_before),this.current_line.push(l.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},o.prototype.add_token=function(l){this.__add_space_before_token(),this.current_line.push(l),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},o.prototype.__add_space_before_token=function(){this.space_before_token&&!this.just_added_newline()&&(this.non_breaking_space||this.set_wrap_point(),this.current_line.push(" "))},o.prototype.remove_indent=function(l){for(var c=this.__lines.length;l<c;)this.__lines[l]._remove_indent(),l++;this.current_line._remove_wrap_indent()},o.prototype.trim=function(l){for(l=l===void 0?!1:l,this.current_line.trim();l&&this.__lines.length>1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},o.prototype.just_added_newline=function(){return this.current_line.is_empty()},o.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},o.prototype.ensure_empty_line_above=function(l,c){for(var d=this.__lines.length-2;d>=0;){var u=this.__lines[d];if(u.is_empty())break;if(u.item(0).indexOf(l)!==0&&u.item(-1)!==c){this.__lines.splice(d+1,0,new s(this)),this.previous_line=this.__lines[this.__lines.length-2];break}d--}},i.exports.Output=o}),,,,(function(i){function s(l,c){this.raw_options=a(l,c),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs",this.indent_char===" "),this.indent_with_tabs&&(this.indent_char=" ",this.indent_size===1&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","angular","django","erb","handlebars","php","smarty"],["auto"])}s.prototype._get_array=function(l,c){var d=this.raw_options[l],u=c||[];return typeof d=="object"?d!==null&&typeof d.concat=="function"&&(u=d.concat()):typeof d=="string"&&(u=d.split(/[^a-zA-Z0-9_\/\-]+/)),u},s.prototype._get_boolean=function(l,c){var d=this.raw_options[l],u=d===void 0?!!c:!!d;return u},s.prototype._get_characters=function(l,c){var d=this.raw_options[l],u=c||"";return typeof d=="string"&&(u=d.replace(/\\r/,"\r").replace(/\\n/,`
|
||||
`).replace(/\\t/," ")),u},s.prototype._get_number=function(l,c){var d=this.raw_options[l];c=parseInt(c,10),isNaN(c)&&(c=0);var u=parseInt(d,10);return isNaN(u)&&(u=c),u},s.prototype._get_selection=function(l,c,d){var u=this._get_selection_list(l,c,d);if(u.length!==1)throw new Error("Invalid Option Value: The option '"+l+`' can only be one of the following values:
|
||||
`+c+`
|
||||
You passed in: '`+this.raw_options[l]+"'");return u[0]},s.prototype._get_selection_list=function(l,c,d){if(!c||c.length===0)throw new Error("Selection list cannot be empty.");if(d=d||[c[0]],!this._is_valid_selection(d,c))throw new Error("Invalid Default Value!");var u=this._get_array(l,d);if(!this._is_valid_selection(u,c))throw new Error("Invalid Option Value: The option '"+l+`' can contain only the following values:
|
||||
`+c+`
|
||||
You passed in: '`+this.raw_options[l]+"'");return u},s.prototype._is_valid_selection=function(l,c){return l.length&&c.length&&!l.some(function(d){return c.indexOf(d)===-1})};function a(l,c){var d={};l=o(l);var u;for(u in l)u!==c&&(d[u]=l[u]);if(c&&l[c])for(u in l[c])d[u]=l[c][u];return d}function o(l){var c={},d;for(d in l){var u=d.replace(/-/g,"_");c[u]=l[d]}return c}i.exports.Options=s,i.exports.normalizeOpts=o,i.exports.mergeOpts=a}),,(function(i){var s=RegExp.prototype.hasOwnProperty("sticky");function a(o){this.__input=o||"",this.__input_length=this.__input.length,this.__position=0}a.prototype.restart=function(){this.__position=0},a.prototype.back=function(){this.__position>0&&(this.__position-=1)},a.prototype.hasNext=function(){return this.__position<this.__input_length},a.prototype.next=function(){var o=null;return this.hasNext()&&(o=this.__input.charAt(this.__position),this.__position+=1),o},a.prototype.peek=function(o){var l=null;return o=o||0,o+=this.__position,o>=0&&o<this.__input_length&&(l=this.__input.charAt(o)),l},a.prototype.__match=function(o,l){o.lastIndex=l;var c=o.exec(this.__input);return c&&!(s&&o.sticky)&&c.index!==l&&(c=null),c},a.prototype.test=function(o,l){return l=l||0,l+=this.__position,l>=0&&l<this.__input_length?!!this.__match(o,l):!1},a.prototype.testChar=function(o,l){var c=this.peek(l);return o.lastIndex=0,c!==null&&o.test(c)},a.prototype.match=function(o){var l=this.__match(o,this.__position);return l?this.__position+=l[0].length:l=null,l},a.prototype.read=function(o,l,c){var d="",u;return o&&(u=this.match(o),u&&(d+=u[0])),l&&(u||!o)&&(d+=this.readUntil(l,c)),d},a.prototype.readUntil=function(o,l){var c="",d=this.__position;o.lastIndex=this.__position;var u=o.exec(this.__input);return u?(d=u.index,l&&(d+=u[0].length)):d=this.__input_length,c=this.__input.substring(this.__position,d),this.__position=d,c},a.prototype.readUntilAfter=function(o){return this.readUntil(o,!0)},a.prototype.get_regexp=function(o,l){var c=null,d="g";return l&&s&&(d="y"),typeof o=="string"&&o!==""?c=new RegExp(o,d):o&&(c=new RegExp(o.source,d)),c},a.prototype.get_literal_regexp=function(o){return RegExp(o.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},a.prototype.peekUntilAfter=function(o){var l=this.__position,c=this.readUntilAfter(o);return this.__position=l,c},a.prototype.lookBack=function(o){var l=this.__position-1;return l>=o.length&&this.__input.substring(l-o.length,l).toLowerCase()===o},i.exports.InputScanner=a}),,,,,(function(i){function s(a,o){a=typeof a=="string"?a:a.source,o=typeof o=="string"?o:o.source,this.__directives_block_pattern=new RegExp(a+/ beautify( \w+[:]\w+)+ /.source+o,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(a+/\sbeautify\signore:end\s/.source+o,"g")}s.prototype.get_directives=function(a){if(!a.match(this.__directives_block_pattern))return null;var o={};this.__directive_pattern.lastIndex=0;for(var l=this.__directive_pattern.exec(a);l;)o[l[1]]=l[2],l=this.__directive_pattern.exec(a);return o},s.prototype.readIgnored=function(a){return a.readUntilAfter(this.__directives_end_ignore_pattern)},i.exports.Directives=s}),,(function(i,s,a){var o=a(16).Beautifier,l=a(17).Options;function c(d,u){var m=new o(d,u);return m.beautify()}i.exports=c,i.exports.defaultOptions=function(){return new l}}),(function(i,s,a){var o=a(17).Options,l=a(2).Output,c=a(8).InputScanner,d=a(13).Directives,u=new d(/\/\*/,/\*\//),m=/\r\n|[\r\n]/,f=/\r\n|[\r\n]/g,g=/\s/,b=/(?:\s|\n)+/g,k=/\/\*(?:[\s\S]*?)((?:\*\/)|$)/g,F=/\/\/(?:[^\n\r\u2028\u2029]*)/g;function N(_,T){this._source_text=_||"",this._options=new o(T),this._ch=null,this._input=null,this.NESTED_AT_RULE={page:!0,"font-face":!0,keyframes:!0,media:!0,supports:!0,document:!0},this.CONDITIONAL_GROUP_RULE={media:!0,supports:!0,document:!0},this.NON_SEMICOLON_NEWLINE_PROPERTY=["grid-template-areas","grid-template"]}N.prototype.eatString=function(_){var T="";for(this._ch=this._input.next();this._ch;){if(T+=this._ch,this._ch==="\\")T+=this._input.next();else if(_.indexOf(this._ch)!==-1||this._ch===`
|
||||
`)break;this._ch=this._input.next()}return T},N.prototype.eatWhitespace=function(_){for(var T=g.test(this._input.peek()),O=0;g.test(this._input.peek());)this._ch=this._input.next(),_&&this._ch===`
|
||||
`&&(O===0||O<this._options.max_preserve_newlines)&&(O++,this._output.add_new_line(!0));return T},N.prototype.foundNestedPseudoClass=function(){for(var _=0,T=1,O=this._input.peek(T);O;){if(O==="{")return!0;if(O==="(")_+=1;else if(O===")"){if(_===0)return!1;_-=1}else if(O===";"||O==="}")return!1;T++,O=this._input.peek(T)}return!1},N.prototype.print_string=function(_){this._output.set_indent(this._indentLevel),this._output.non_breaking_space=!0,this._output.add_token(_)},N.prototype.preserveSingleSpace=function(_){_&&(this._output.space_before_token=!0)},N.prototype.indent=function(){this._indentLevel++},N.prototype.outdent=function(){this._indentLevel>0&&this._indentLevel--},N.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var _=this._source_text,T=this._options.eol;T==="auto"&&(T=`
|
||||
`,_&&m.test(_||"")&&(T=_.match(m)[0])),_=_.replace(f,`
|
||||
`);var O=_.match(/^[\t ]*/)[0];this._output=new l(this._options,O),this._input=new c(_),this._indentLevel=0,this._nestedLevel=0,this._ch=null;for(var V=0,I=!1,R=!1,z=!1,$=!1,L=!1,y=this._ch,E=!1,D,A,M;D=this._input.read(b),A=D!=="",M=y,this._ch=this._input.next(),this._ch==="\\"&&this._input.hasNext()&&(this._ch+=this._input.next()),y=this._ch,this._ch;)if(this._ch==="/"&&this._input.peek()==="*"){this._output.add_new_line(),this._input.back();var P=this._input.read(k),H=u.get_directives(P);H&&H.ignore==="start"&&(P+=u.readIgnored(this._input)),this.print_string(P),this.eatWhitespace(!0),this._output.add_new_line()}else if(this._ch==="/"&&this._input.peek()==="/")this._output.space_before_token=!0,this._input.back(),this.print_string(this._input.read(F)),this.eatWhitespace(!0);else if(this._ch==="$"){this.preserveSingleSpace(A),this.print_string(this._ch);var ee=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);ee.match(/[ :]$/)&&(ee=this.eatString(": ").replace(/\s+$/,""),this.print_string(ee),this._output.space_before_token=!0),V===0&&ee.indexOf(":")!==-1&&(R=!0,this.indent())}else if(this._ch==="@")if(this.preserveSingleSpace(A),this._input.peek()==="{")this.print_string(this._ch+this.eatString("}"));else{this.print_string(this._ch);var G=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);G.match(/[ :]$/)&&(G=this.eatString(": ").replace(/\s+$/,""),this.print_string(G),this._output.space_before_token=!0),V===0&&G.indexOf(":")!==-1?(R=!0,this.indent()):G in this.NESTED_AT_RULE?(this._nestedLevel+=1,G in this.CONDITIONAL_GROUP_RULE&&(z=!0)):V===0&&!R&&($=!0)}else if(this._ch==="#"&&this._input.peek()==="{")this.preserveSingleSpace(A),this.print_string(this._ch+this.eatString("}"));else if(this._ch==="{")R&&(R=!1,this.outdent()),$=!1,z?(z=!1,I=this._indentLevel>=this._nestedLevel):I=this._indentLevel>=this._nestedLevel-1,this._options.newline_between_rules&&I&&this._output.previous_line&&this._output.previous_line.item(-1)!=="{"&&this._output.ensure_empty_line_above("/",","),this._output.space_before_token=!0,this._options.brace_style==="expand"?(this._output.add_new_line(),this.print_string(this._ch),this.indent(),this._output.set_indent(this._indentLevel)):(M==="("?this._output.space_before_token=!1:M!==","&&this.indent(),this.print_string(this._ch)),this.eatWhitespace(!0),this._output.add_new_line();else if(this._ch==="}")this.outdent(),this._output.add_new_line(),M==="{"&&this._output.trim(!0),R&&(this.outdent(),R=!1),this.print_string(this._ch),I=!1,this._nestedLevel&&this._nestedLevel--,this.eatWhitespace(!0),this._output.add_new_line(),this._options.newline_between_rules&&!this._output.just_added_blankline()&&this._input.peek()!=="}"&&this._output.add_new_line(!0),this._input.peek()===")"&&(this._output.trim(!0),this._options.brace_style==="expand"&&this._output.add_new_line(!0));else if(this._ch===":"){for(var xe=0;xe<this.NON_SEMICOLON_NEWLINE_PROPERTY.length;xe++)if(this._input.lookBack(this.NON_SEMICOLON_NEWLINE_PROPERTY[xe])){E=!0;break}(I||z)&&!(this._input.lookBack("&")||this.foundNestedPseudoClass())&&!this._input.lookBack("(")&&!$&&V===0?(this.print_string(":"),R||(R=!0,this._output.space_before_token=!0,this.eatWhitespace(!0),this.indent())):(this._input.lookBack(" ")&&(this._output.space_before_token=!0),this._input.peek()===":"?(this._ch=this._input.next(),this.print_string("::")):this.print_string(":"))}else if(this._ch==='"'||this._ch==="'"){var on=M==='"'||M==="'";this.preserveSingleSpace(on||A),this.print_string(this._ch+this.eatString(this._ch)),this.eatWhitespace(!0)}else if(this._ch===";")E=!1,V===0?(R&&(this.outdent(),R=!1),$=!1,this.print_string(this._ch),this.eatWhitespace(!0),this._input.peek()!=="/"&&this._output.add_new_line()):(this.print_string(this._ch),this.eatWhitespace(!0),this._output.space_before_token=!0);else if(this._ch==="(")if(this._input.lookBack("url"))this.print_string(this._ch),this.eatWhitespace(),V++,this.indent(),this._ch=this._input.next(),this._ch===")"||this._ch==='"'||this._ch==="'"?this._input.back():this._ch&&(this.print_string(this._ch+this.eatString(")")),V&&(V--,this.outdent()));else{var bt=!1;this._input.lookBack("with")&&(bt=!0),this.preserveSingleSpace(A||bt),this.print_string(this._ch),R&&M==="$"&&this._options.selector_separator_newline?(this._output.add_new_line(),L=!0):(this.eatWhitespace(),V++,this.indent())}else if(this._ch===")")V&&(V--,this.outdent()),L&&this._input.peek()===";"&&this._options.selector_separator_newline&&(L=!1,this.outdent(),this._output.add_new_line()),this.print_string(this._ch);else if(this._ch===",")this.print_string(this._ch),this.eatWhitespace(!0),this._options.selector_separator_newline&&(!R||L)&&V===0&&!$?this._output.add_new_line():this._output.space_before_token=!0;else if((this._ch===">"||this._ch==="+"||this._ch==="~")&&!R&&V===0)this._options.space_around_combinator?(this._output.space_before_token=!0,this.print_string(this._ch),this._output.space_before_token=!0):(this.print_string(this._ch),this.eatWhites
Line truncated
|
||||
`&&E&&this._output.add_new_line()}var ln=this._output.get_code(T);return ln},i.exports.Beautifier=N}),(function(i,s,a){var o=a(6).Options;function l(c){o.call(this,c,"css"),this.selector_separator_newline=this._get_boolean("selector_separator_newline",!0),this.newline_between_rules=this._get_boolean("newline_between_rules",!0);var d=this._get_boolean("space_around_selector_separator");this.space_around_combinator=this._get_boolean("space_around_combinator")||d;var u=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_style="collapse";for(var m=0;m<u.length;m++)u[m]!=="expand"?this.brace_style="collapse":this.brace_style=u[m]}l.prototype=new o,i.exports.Options=l})],e={};function n(i){var s=e[i];if(s!==void 0)return s.exports;var a=e[i]={exports:{}};return t[i](a,a.exports,n),a.exports}var r=n(15);Kc=r})();var of=Kc;function lf(t,e,n){let r=t.getText(),i=!0,s=0,a=!1;const o=n.tabSize||4;if(e){let d=t.offsetAt(e.start),u=d;for(;u>0&&th(r,u-1);)u--;u===0||eh(r,u-1)?d=u:u<d&&(d=u+1);let m=t.offsetAt(e.end),f=m;for(;f<r.length&&th(r,f);)f++;if((f===r.length||eh(r,f))&&(m=f),e=K.create(t.positionAt(d),t.positionAt(m)),a=df(r,d),i=m===r.length,r=r.substring(d,m),d!==0){const g=t.offsetAt(ye.create(e.start.line,0));s=uf(t.getText(),g,n)}a&&(r=`{
|
||||
${Zc(r)}`)}else e=K.create(ye.create(0,0),t.positionAt(r.length));const l={indent_size:o,indent_char:n.insertSpaces?" ":" ",end_with_newline:i&&ot(n,"insertFinalNewline",!1),selector_separator_newline:ot(n,"newlineBetweenSelectors",!0),newline_between_rules:ot(n,"newlineBetweenRules",!0),space_around_selector_separator:ot(n,"spaceAroundSelectorSeparator",!1),brace_style:ot(n,"braceStyle","collapse"),indent_empty_lines:ot(n,"indentEmptyLines",!1),max_preserve_newlines:ot(n,"maxPreserveNewLines",void 0),preserve_newlines:ot(n,"preserveNewLines",!0),wrap_line_length:ot(n,"wrapLineLength",void 0),eol:`
|
||||
`};let c=of(r,l);if(a&&(c=Zc(c.substring(2))),s>0){const d=n.insertSpaces?al(" ",o*s):al(" ",s);c=c.split(`
|
||||
`).join(`
|
||||
`+d),e.start.character===0&&(c=d+c)}return[{range:e,newText:c}]}function Zc(t){return t.replace(/^\s+/,"")}const cf=123,hf=125;function df(t,e){for(;e>=0;){const n=t.charCodeAt(e);if(n===cf)return!0;if(n===hf)return!1;e--}return!1}function ot(t,e,n){if(t&&t.hasOwnProperty(e)){const r=t[e];if(r!==null)return r}return n}function uf(t,e,n){let r=e,i=0;const s=n.tabSize||4;for(;r<t.length;){const a=t.charAt(r);if(a===" ")i++;else if(a===" ")i+=s;else break;r++}return Math.floor(i/s)}function eh(t,e){return`\r
|
||||
`.indexOf(t.charAt(e))!==-1}function th(t,e){return" ".indexOf(t.charAt(e))!==-1}const pf={version:1.1,properties:[{name:"additive-symbols",browsers:["FF33"],atRule:"@counter-style",syntax:"[ <integer> && <symbol> ]#",relevance:50,description:"@counter-style descriptor. Specifies the symbols used by the marker-construction algorithm specified by the system descriptor. Needs to be specified if the counter system is 'additive'.",restrictions:["integer","string","image","identifier"]},{name:"align-content",browsers:["E12","FF28","S9","C29","IE11","O16"],values:[{name:"center",description:"Lines are packed toward the center of the flex container."},{name:"flex-end",description:"Lines are packed toward the end of the flex container."},{name:"flex-start",description:"Lines are packed toward the start of the flex container."},{name:"space-around",description:"Lines are evenly distributed in the flex container, with half-size spaces on either end."},{name:"space-between",description:"Lines are evenly distributed in the flex container."},{name:"stretch",description:"Lines stretch to take up the remaining space."},{name:"start"},{name:"end"},{name:"normal"},{name:"baseline"},{name:"first baseline"},{name:"last baseline"},{name:"space-around"},{name:"space-between"},{name:"space-evenly"},{name:"stretch"},{name:"safe"},{name:"unsafe"}],syntax:"normal | <baseline-position> | <content-distribution> | <overflow-position>? <content-position>",relevance:66,references:[{name:"MDN Reference",url:"https://developer.mozilla.org/docs/Web/CSS/align-content"}],description:"Aligns a flex container's lines within the flex container when there is extra space in the cross-axis, similar to how 'justify-content' aligns individual items within the main-axis.",restrictions:["enum"]},{name:"align-items",browsers:["E12","FF20","S9","C29","IE11","O16"],values:[{name:"baseline",description:"If the flex item's inline axis is the same as the cross axis, this value is identical to 'flex-start'. Otherwise, it participates in baseline alignment."},{name:"center",description:"The flex item's margin box is centered in the cross axis within the line."},{name:"flex-end",description:"The cross-end margin edge of the flex item is placed flush with the cross-end edge of the line."},{name:"flex-start",description:"The cross-start margin edge of the flex item is placed flush with the cross-start edge of the line."},{name:"stretch",description:"If the cross size property of the flex item computes to auto, and neither of the cross-axis margins are auto, the flex item is stretched."},{name:"normal"},{name:"start"},{name:"end"},{name:"self-start"},{name:"self-end"},{name:"first baseline"},{name:"last baseline"},{name:"stretch"},{name:"safe"},{name:"unsafe"}],syntax:"normal | stretch | <baseline-position> | [ <overflow-position>? <self-position> ]",relevance:87,references:[{name:"MDN Reference",url:"https://developer.mozilla.org/docs/Web/CSS/align-items"}],description:"Aligns flex items along the cross axis of the current line of the flex container.",restrictions:["enum"]},{name:"justify-items",browsers:["E12","FF20","S9","C52","IE11","O12.1"],values:[{name:"auto"},{name:"normal"},{name:"end"},{name:"start"},{name:"flex-end",description:'"Flex items are packed toward the end of the line."'},{name:"flex-start",description:'"Flex items are packed toward the start of the line."'},{name:"self-end",description:"The item is packed flush to the edge of the alignment container of the end side of the item, in the appropriate axis."},{name:"self-start",description:"The item is packed flush to the edge of the alignment container of the start side of the item, in the appropriate axis.."},{name:"center",description:"The items are packed flush to each other toward the center of the of the alignment container."},{name:"left"},{name:"right"},{name:"baseline"},{name:"first baseline"},{name:"last baseline"},{name:"stretch",description:"If the cross size property of the flex item computes to auto, and neither of the cross-axis margins are auto, the flex item is stretched."},{name:"safe"},{name:"unsafe"},{name:"legacy"}],syntax:"normal | stretch | <baseline-position> | <overflow-position>? [ <self-position> | left | right ] | legacy | legacy && [ left | right | center ]",relevance:53,references:[{name:"MDN Reference",url:"https://developer.mozilla.org/docs/Web/CSS/justify-items"}],description:"Defines the default justify-self for all items of the box, giving them the default way of justifying each box along the appropriate axis",restrictions:["enum"]},{name:"justify-self",browsers:["E16","FF45","S10.1","C57","IE10","O44"],values:[{name:"auto"},{name:"normal"},{name:"end"},{name:"start"},{name:"flex-end",description:'"Flex items are packed toward the end of the line."'},{name:"flex-start",description:'"Flex items are packed toward the start of the line."'},{name:"self-end",description:"The item is packed flush to the edge of the alignment container of the end side of the item, in
Line truncated
|
||||
|
||||
This feature is available since Firefox 55, but is only currently supported with SVG images loaded via chrome:// or resource:// URLs. To experiment with the feature in SVG on the Web it is necessary to set the svg.context-properties.content.enabled pref to true.`},{name:"-moz-float-edge",status:"obsolete",syntax:"border-box | content-box | margin-box | padding-box",values:[{name:"border-box"},{name:"content-box"},{name:"margin-box"},{name:"padding-box"}],relevance:0,browsers:["FF1"],references:[{name:"MDN Reference",url:"https://developer.mozilla.org/docs/Web/CSS/-moz-float-edge"}],description:"The non-standard -moz-float-edge CSS property specifies whether the height and width properties of the element include the margin, border, or padding thickness."},{name:"-moz-force-broken-image-icon",status:"obsolete",syntax:"0 | 1",values:[{name:"0"},{name:"1"}],relevance:0,browsers:["FF1"],references:[{name:"MDN Reference",url:"https://developer.mozilla.org/docs/Web/CSS/-moz-force-broken-image-icon"}],description:"The -moz-force-broken-image-icon extended CSS property can be used to force the broken image icon to be shown even when a broken image has an alt attribute."},{name:"-moz-image-region",status:"nonstandard",syntax:"<shape> | auto",relevance:0,browsers:["FF1"],references:[{name:"MDN Reference",url:"https://developer.mozilla.org/docs/Web/CSS/-moz-image-region"}],description:"For certain XUL elements and pseudo-elements that use an image from the list-style-image property, this property specifies a region of the image that is used in place of the whole image. This allows elements to use different pieces of the same image to improve performance."},{name:"-moz-orient",status:"nonstandard",syntax:"inline | block | horizontal | vertical",values:[{name:"inline"},{name:"block"},{name:"horizontal"},{name:"vertical"}],relevance:0,browsers:["FF6"],references:[{name:"MDN Reference",url:"https://developer.mozilla.org/docs/Web/CSS/-moz-orient"}],description:"The -moz-orient CSS property specifies the orientation of the element to which it's applied."},{name:"-moz-outline-radius",status:"nonstandard",syntax:"<outline-radius>{1,4} [ / <outline-radius>{1,4} ]?",relevance:0,description:"In Mozilla applications like Firefox, the -moz-outline-radius CSS property can be used to give an element's outline rounded corners."},{name:"-moz-outline-radius-bottomleft",status:"nonstandard",syntax:"<outline-radius>",relevance:0,description:"In Mozilla applications, the -moz-outline-radius-bottomleft CSS property can be used to round the bottom-left corner of an element's outline."},{name:"-moz-outline-radius-bottomright",status:"nonstandard",syntax:"<outline-radius>",relevance:0,description:"In Mozilla applications, the -moz-outline-radius-bottomright CSS property can be used to round the bottom-right corner of an element's outline."},{name:"-moz-outline-radius-topleft",status:"nonstandard",syntax:"<outline-radius>",relevance:0,description:"In Mozilla applications, the -moz-outline-radius-topleft CSS property can be used to round the top-left corner of an element's outline."},{name:"-moz-outline-radius-topright",status:"nonstandard",syntax:"<outline-radius>",relevance:0,description:"In Mozilla applications, the -moz-outline-radius-topright CSS property can be used to round the top-right corner of an element's outline."},{name:"-moz-stack-sizing",status:"nonstandard",syntax:"ignore | stretch-to-fit",values:[{name:"ignore"},{name:"stretch-to-fit"}],relevance:0,description:"-moz-stack-sizing is an extended CSS property. Normally, a stack will change its size so that all of its child elements are completely visible. For example, moving a child of the stack far to the right will widen the stack so the child remains visible."},{name:"-moz-text-blink",status:"nonstandard",syntax:"none | blink",values:[{name:"none"},{name:"blink"}],relevance:0,description:"The -moz-text-blink non-standard Mozilla CSS extension specifies the blink mode."},{name:"-moz-user-input",status:"obsolete",syntax:"auto | none | enabled | disabled",values:[{name:"auto"},{name:"none"},{name:"enabled"},{name:"disabled"}],relevance:0,browsers:["FF1"],references:[{name:"MDN Reference",url:"https://developer.mozilla.org/docs/Web/CSS/-moz-user-input"}],description:"In Mozilla applications, -moz-user-input determines if an element will accept user input."},{name:"-moz-user-modify",status:"nonstandard",syntax:"read-only | read-write | write-only",values:[{name:"read-only"},{name:"read-write"},{name:"write-only"}],relevance:0,description:"The -moz-user-modify property has no effect. It was originally planned to determine whether or not the content of an element can be edited by a user."},{name:"-moz-window-dragging",status:"nonstandard",syntax:"drag | no-drag",values:[{name:"drag"},{name:"no-drag"}],relevance:0,description:"The -moz-window-dragging CSS property specifies whether a window is draggable or not. It only works in Chrome code, and only on Mac OS X."},{name:"-moz-window-s
Line truncated
|
||||
|
||||
This property is a shorthand for mask-border-source, mask-border-slice, mask-border-width, mask-border-outset, mask-border-repeat, and mask-border-mode. As with all shorthand properties, any omitted sub-values will be set to their initial value.`},{name:"mask-border-mode",syntax:"luminance | alpha",values:[{name:"luminance"},{name:"alpha"}],relevance:50,description:"The mask-border-mode CSS property specifies the blending mode used in a mask border."},{name:"mask-border-outset",syntax:"[ <length> | <number> ]{1,4}",relevance:50,browsers:["E79","S17.2","C1","O15"],references:[{name:"MDN Reference",url:"https://developer.mozilla.org/docs/Web/CSS/mask-border-outset"}],description:"The mask-border-outset CSS property specifies the distance by which an element's mask border is set out from its border box."},{name:"mask-border-repeat",syntax:"[ stretch | repeat | round | space ]{1,2}",relevance:50,browsers:["E79","S17.2","C1","O15"],references:[{name:"MDN Reference",url:"https://developer.mozilla.org/docs/Web/CSS/mask-border-repeat"}],description:"The mask-border-repeat CSS property defines how the edge regions of a source image are adjusted to fit the dimensions of an element's mask border."},{name:"mask-border-slice",syntax:"<number-percentage>{1,4} fill?",relevance:50,browsers:["E79","S17.2","C1","O15"],references:[{name:"MDN Reference",url:"https://developer.mozilla.org/docs/Web/CSS/mask-border-slice"}],description:"The mask-border-slice CSS property divides the image specified by mask-border-source into regions. These regions are used to form the components of an element's mask border."},{name:"mask-border-source",syntax:"none | <image>",relevance:50,browsers:["E79","S17.2","C1","O15"],references:[{name:"MDN Reference",url:"https://developer.mozilla.org/docs/Web/CSS/mask-border-source"}],description:`The mask-border-source CSS property specifies the source image used to create an element's mask border.
|
||||
|
||||
The mask-border-slice property is used to divide the source image into regions, which are then dynamically applied to the final mask border.`},{name:"mask-border-width",syntax:"[ <length-percentage> | <number> | auto ]{1,4}",relevance:50,browsers:["E79","S17.2","C1","O15"],references:[{name:"MDN Reference",url:"https://developer.mozilla.org/docs/Web/CSS/mask-border-width"}],description:"The mask-border-width CSS property specifies the width of an element's mask border."},{name:"mask-clip",syntax:"[ <geometry-box> | no-clip ]#",relevance:50,browsers:["E120","FF53","S15.4","C120","O106"],references:[{name:"MDN Reference",url:"https://developer.mozilla.org/docs/Web/CSS/mask-clip"}],description:"The mask-clip CSS property determines the area, which is affected by a mask. The painted content of an element must be restricted to this area."},{name:"mask-composite",syntax:"<compositing-operator>#",relevance:50,browsers:["E18","FF53","S15.4","C120","O106"],references:[{name:"MDN Reference",url:"https://developer.mozilla.org/docs/Web/CSS/mask-composite"}],description:"The mask-composite CSS property represents a compositing operation used on the current mask layer with the mask layers below it."},{name:"masonry-auto-flow",status:"experimental",syntax:"[ pack | next ] || [ definite-first | ordered ]",relevance:50,browsers:["Spreview"],references:[{name:"MDN Reference",url:"https://developer.mozilla.org/docs/Web/CSS/masonry-auto-flow"}],description:"The masonry-auto-flow CSS property modifies how items are placed when using masonry in CSS Grid Layout."},{name:"math-depth",syntax:"auto-add | add(<integer>) | <integer>",relevance:50,browsers:["E109","FF117","C109","O95"],references:[{name:"MDN Reference",url:"https://developer.mozilla.org/docs/Web/CSS/math-depth"}],description:'Describe a notion of "depth" for each element of a mathematical formula, with respect to the top-level container of that formula.'},{name:"math-shift",syntax:"normal | compact",values:[{name:"normal"},{name:"compact"}],relevance:50,browsers:["E109","C109","O95"],references:[{name:"MDN Reference",url:"https://developer.mozilla.org/docs/Web/CSS/math-shift"}],description:"Used for positioning superscript during the layout of MathML scripted elements."},{name:"math-style",syntax:"normal | compact",values:[{name:"normal"},{name:"compact"}],relevance:50,browsers:["E109","FF117","S14.1","C109","O95"],references:[{name:"MDN Reference",url:"https://developer.mozilla.org/docs/Web/CSS/math-style"}],description:"The math-style property indicates whether MathML equations should render with normal or compact height."},{name:"max-lines",status:"experimental",syntax:"none | <integer>",relevance:50,description:"The max-lines property forces a break after a set number of lines"},{name:"offset",syntax:"[ <'offset-position'>? [ <'offset-path'> [ <'offset-distance'> || <'offset-rotate'> ]? ]? ]! [ / <'offset-anchor'> ]?",relevance:50,browsers:["E79","FF72","S16","C55","O42"],references:[{name:"MDN Reference",url:"https://developer.mozilla.org/docs/Web/CSS/offset"}],description:"The offset CSS property is a shorthand property for animating an element along a defined path."},{name:"offset-anchor",syntax:"auto | <position>",relevance:50,browsers:["E116","FF72","S16","C116","O102"],references:[{name:"MDN Reference",url:"https://developer.mozilla.org/docs/Web/CSS/offset-anchor"}],description:"Defines an anchor point of the box positioned along the path. The anchor point specifies the point of the box which is to be considered as the point that is moved along the path."},{name:"offset-distance",syntax:"<length-percentage>",relevance:50,browsers:["E79","FF72","S16","C55","O42"],references:[{name:"MDN Reference",url:"https://developer.mozilla.org/docs/Web/CSS/offset-distance"}],description:"The offset-distance CSS property specifies a position along an offset-path."},{name:"offset-path",syntax:"none | <offset-path> || <coord-box>",relevance:50,browsers:["E79","FF72","S15.4","C55","O45"],references:[{name:"MDN Reference",url:"https://developer.mozilla.org/docs/Web/CSS/offset-path"}],description:`The offset-path CSS property specifies the offset path where the element gets positioned. The exact element’s position on the offset path is determined by the offset-distance property. An offset path is either a specified path with one or multiple sub-paths or the geometry of a not-styled basic shape. Each shape or path must define an initial position for the computed value of "0" for offset-distance and an initial direction which specifies the rotation of the object to the initial position.
|
||||
|
||||
In this specification, a direction (or rotation) of 0 degrees is equivalent to the direction of the positive x-axis in the object’s local coordinate system. In other words, a rotation of 0 degree points to the right side of the UA if the object and its ancestors have no transformation applied.`},{name:"offset-position",syntax:"normal | auto | <position>",relevance:50,browsers:["E116","FF122","S16","C116","O102"],references:[{name:"MDN Reference",url:"https://developer.mozilla.org/docs/Web/CSS/offset-position"}],description:"Specifies the initial position of the offset path. If position is specified with static, offset-position would be ignored."},{name:"offset-rotate",syntax:"[ auto | reverse ] || <angle>",relevance:50,browsers:["E79","FF72","S16","C56","O43"],references:[{name:"MDN Reference",url:"https://developer.mozilla.org/docs/Web/CSS/offset-rotate"}],description:"The offset-rotate CSS property defines the direction of the element while positioning along the offset path."},{name:"overflow-anchor",syntax:"auto | none",values:[{name:"auto"},{name:"none"}],relevance:52,browsers:["E79","FF66","Spreview","C56","O43"],references:[{name:"MDN Reference",url:"https://developer.mozilla.org/docs/Web/CSS/overflow-anchor"}],description:"The overflow-anchor CSS property provides a way to opt out browser scroll anchoring behavior which adjusts scroll position to minimize content shifts."},{name:"overflow-block",syntax:"visible | hidden | clip | scroll | auto",values:[{name:"visible"},{name:"hidden"},{name:"clip"},{name:"scroll"},{name:"auto"}],relevance:50,browsers:["FF69"],references:[{name:"MDN Reference",url:"https://developer.mozilla.org/docs/Web/CSS/overflow-block"}],description:"The overflow-block CSS media feature can be used to test how the output device handles content that overflows the initial containing block along the block axis."},{name:"overflow-clip-box",status:"nonstandard",syntax:"padding-box | content-box",values:[{name:"padding-box"},{name:"content-box"}],relevance:0,description:"The overflow-clip-box CSS property specifies relative to which box the clipping happens when there is an overflow. It is short hand for the overflow-clip-box-inline and overflow-clip-box-block properties."},{name:"overflow-clip-margin",syntax:"<visual-box> || <length [0,∞]>",relevance:50,browsers:["E90","FF102","C90","O76"],references:[{name:"MDN Reference",url:"https://developer.mozilla.org/docs/Web/CSS/overflow-clip-margin"}],description:"The overflow-clip-margin CSS property determines how far outside its bounds an element with overflow: clip may be painted before being clipped."},{name:"overflow-inline",syntax:"visible | hidden | clip | scroll | auto",values:[{name:"visible"},{name:"hidden"},{name:"clip"},{name:"scroll"},{name:"auto"}],relevance:50,browsers:["FF69"],references:[{name:"MDN Reference",url:"https://developer.mozilla.org/docs/Web/CSS/overflow-inline"}],description:"The overflow-inline CSS media feature can be used to test how the output device handles content that overflows the initial containing block along the inline axis."},{name:"overlay",status:"experimental",syntax:"none | auto",values:[{name:"none"},{name:"auto"}],relevance:50,browsers:["E117","C117","O103"],references:[{name:"MDN Reference",url:"https://developer.mozilla.org/docs/Web/CSS/overlay"}],description:'The overlay CSS property specifies whether an element appearing in the top layer (for example, a shown popover or modal {{htmlelement("dialog")}} element) is actually rendered in the top layer. This property is only relevant within a list of transition-property values, and only if allow-discrete is set as the transition-behavior.'},{name:"overscroll-behavior",syntax:"[ contain | none | auto ]{1,2}",relevance:50,browsers:["E18","FF59","S16","C63","O50"],references:[{name:"MDN Reference",url:"https://developer.mozilla.org/docs/Web/CSS/overscroll-behavior"}],description:"The overscroll-behavior CSS property is shorthand for the overscroll-behavior-x and overscroll-behavior-y properties, which allow you to control the browser's scroll overflow behavior — what happens when the boundary of a scrolling area is reached."},{name:"overscroll-behavior-block",syntax:"contain | none | auto",values:[{name:"contain"},{name:"none"},{name:"auto"}],relevance:50,browsers:["E79","FF73","S16","C77","O64"],references:[{name:"MDN Reference",url:"https://developer.mozilla.org/docs/Web/CSS/overscroll-behavior-block"}],description:"The overscroll-behavior-block CSS property sets the browser's behavior when the block direction boundary of a scrolling area is reached."},{name:"overscroll-behavior-inline",syntax:"contain | none | auto",values:[{name:"contain"},{name:"none"},{name:"auto"}],relevance:50,browsers:["E79","FF73","S16","C77","O64"],references:[{name:"MDN Reference",url:"https://developer.mozilla.org/docs/Web/CSS/overscroll-behavior-inline"}],description:"The overscroll-behavior-inline CSS property sets the browser's behavior when the inline direction
Line truncated
|
||||
|
||||
Specifying any precise animations or physics used to enforce those snap points is not covered by this property but instead left up to the user agent.`},{name:"scroll-snap-type-y",status:"obsolete",syntax:"none | mandatory | proximity",values:[{name:"none"},{name:"mandatory"},{name:"proximity"}],relevance:0,description:`The scroll-snap-type-y CSS property defines how strictly snap points are enforced on the vertical axis of the scroll container in case there is one.
|
||||
|
||||
Specifying any precise animations or physics used to enforce those snap points is not covered by this property but instead left up to the user agent.`},{name:"scroll-timeline",status:"experimental",syntax:"[ <'scroll-timeline-name'> <'scroll-timeline-axis'>? ]#",relevance:50,browsers:["E115","FF111","C115","O101"],references:[{name:"MDN Reference",url:"https://developer.mozilla.org/docs/Web/CSS/scroll-timeline"}],description:"Defines a name that can be used to identify the source element of a scroll timeline, along with the scrollbar axis that should provide the timeline."},{name:"scroll-timeline-axis",status:"experimental",syntax:"[ block | inline | x | y ]#",relevance:50,browsers:["E115","FF111","C115","O101"],references:[{name:"MDN Reference",url:"https://developer.mozilla.org/docs/Web/CSS/scroll-timeline-axis"}],description:"Specifies the scrollbar that will be used to provide the timeline for a scroll-timeline animation"},{name:"scroll-timeline-name",status:"experimental",syntax:"none | <dashed-ident>#",relevance:50,browsers:["E115","FF111","C115","O101"],references:[{name:"MDN Reference",url:"https://developer.mozilla.org/docs/Web/CSS/scroll-timeline-name"}],description:"Defines a name that can be used to identify an element as the source of a scroll-timeline."},{name:"text-combine-upright",syntax:"none | all | [ digits <integer>? ]",relevance:50,browsers:["E79","FF48","S15.4","C48","IE11","O35"],references:[{name:"MDN Reference",url:"https://developer.mozilla.org/docs/Web/CSS/text-combine-upright"}],description:`The text-combine-upright CSS property specifies the combination of multiple characters into the space of a single character. If the combined text is wider than 1em, the user agent must fit the contents within 1em. The resulting composition is treated as a single upright glyph for layout and decoration. This property only has an effect in vertical writing modes.
|
||||
|
||||
This is used to produce an effect that is known as tate-chū-yoko (縦中横) in Japanese, or as 直書橫向 in Chinese.`},{name:"text-decoration-skip",status:"experimental",syntax:"none | [ objects || [ spaces | [ leading-spaces || trailing-spaces ] ] || edges || box-decoration ]",relevance:52,browsers:["S12.1","C57","O44"],references:[{name:"MDN Reference",url:"https://developer.mozilla.org/docs/Web/CSS/text-decoration-skip"}],description:"The text-decoration-skip CSS property specifies what parts of the element’s content any text decoration affecting the element must skip over. It controls all text decoration lines drawn by the element and also any text decoration lines drawn by its ancestors."},{name:"text-decoration-skip-ink",syntax:"auto | all | none",values:[{name:"auto"},{name:"all"},{name:"none"}],relevance:51,browsers:["E79","FF70","S15.4","C64","O50"],references:[{name:"MDN Reference",url:"https://developer.mozilla.org/docs/Web/CSS/text-decoration-skip-ink"}],description:"The text-decoration-skip-ink CSS property specifies how overlines and underlines are drawn when they pass over glyph ascenders and descenders."},{name:"text-decoration-thickness",syntax:"auto | from-font | <length> | <percentage> ",relevance:50,browsers:["E89","FF70","S12.1","C89","O75"],references:[{name:"MDN Reference",url:"https://developer.mozilla.org/docs/Web/CSS/text-decoration-thickness"}],description:"The text-decoration-thickness CSS property sets the thickness, or width, of the decoration line that is used on text in an element, such as a line-through, underline, or overline."},{name:"text-emphasis",syntax:"<'text-emphasis-style'> || <'text-emphasis-color'>",relevance:50,browsers:["E99","FF46","S7","C99","O85"],references:[{name:"MDN Reference",url:"https://developer.mozilla.org/docs/Web/CSS/text-emphasis"}],description:"The text-emphasis CSS property is a shorthand property for setting text-emphasis-style and text-emphasis-color in one declaration. This property will apply the specified emphasis mark to each character of the element's text, except separator characters, like spaces, and control characters."},{name:"text-emphasis-color",syntax:"<color>",relevance:50,browsers:["E99","FF46","S7","C99","O85"],references:[{name:"MDN Reference",url:"https://developer.mozilla.org/docs/Web/CSS/text-emphasis-color"}],description:"The text-emphasis-color CSS property defines the color used to draw emphasis marks on text being rendered in the HTML document. This value can also be set and reset using the text-emphasis shorthand."},{name:"text-emphasis-position",syntax:"[ over | under ] && [ right | left ]",relevance:50,browsers:["E99","FF46","S7","C99","O85"],references:[{name:"MDN Reference",url:"https://developer.mozilla.org/docs/Web/CSS/text-emphasis-position"}],description:"The text-emphasis-position CSS property describes where emphasis marks are drawn at. The effect of emphasis marks on the line height is the same as for ruby text: if there isn't enough place, the line height is increased."},{name:"text-emphasis-style",syntax:"none | [ [ filled | open ] || [ dot | circle | double-circle | triangle | sesame ] ] | <string>",relevance:50,browsers:["E99","FF46","S7","C99","O85"],references:[{name:"MDN Reference",url:"https://developer.mozilla.org/docs/Web/CSS/text-emphasis-style"}],description:"The text-emphasis-style CSS property defines the type of emphasis used. It can also be set, and reset, using the text-emphasis shorthand."},{name:"text-size-adjust",status:"experimental",syntax:"none | auto | <percentage>",relevance:57,browsers:["E79","C54","O41"],references:[{name:"MDN Reference",url:"https://developer.mozilla.org/docs/Web/CSS/text-size-adjust"}],description:"The text-size-adjust CSS property controls the text inflation algorithm used on some smartphones and tablets. Other browsers will ignore this property."},{name:"text-underline-offset",syntax:"auto | <length> | <percentage> ",relevance:51,browsers:["E87","FF70","S12.1","C87","O73"],references:[{name:"MDN Reference",url:"https://developer.mozilla.org/docs/Web/CSS/text-underline-offset"}],description:"The text-underline-offset CSS property sets the offset distance of an underline text decoration line (applied using text-decoration) from its original position."},{name:"text-wrap",syntax:"wrap | nowrap | balance | stable | pretty",values:[{name:"wrap"},{name:"nowrap"},{name:"balance"},{name:"stable"},{name:"pretty"}],relevance:54,browsers:["E114","FF121","Spreview","C114","O100"],references:[{name:"MDN Reference",url:"https://developer.mozilla.org/docs/Web/CSS/text-wrap"}],description:"The text-wrap CSS property controls how text inside an element is wrapped."},{name:"timeline-scope",status:"experimental",syntax:"none | <dashed-ident>#",relevance:50,browsers:["E116","C116","O102"],references:[{name:"MDN Reference",url:"https://developer.mozilla.org/docs/Web/CSS/timeline-scope"}],description:"The timeline-scope CSS property modifies the scope of a named animation tim
Line truncated
|
||||
|
||||
In order to let ::-webkit-progress-value take effect, -webkit-appearance needs to be set to none on the <progress> element.`},{name:"::grammar-error",status:"experimental",browsers:["E121","Spreview","C121"],references:[{name:"MDN Reference",url:"https://developer.mozilla.org/docs/Web/CSS/::grammar-error"}],description:"The ::grammar-error CSS pseudo-element represents a text segment which the user agent has flagged as grammatically incorrect."},{name:"::marker",browsers:["E86","FF68","S11.1","C86","O72"],references:[{name:"MDN Reference",url:"https://developer.mozilla.org/docs/Web/CSS/::marker"}],description:"The ::marker CSS pseudo-element selects the marker box of a list item, which typically contains a bullet or number. It works on any element or pseudo-element set to display: list-item, such as the <li> and <summary> elements."},{name:"::part",status:"experimental",browsers:["E79","FF72","S13.1","C73","O60"],references:[{name:"MDN Reference",url:"https://developer.mozilla.org/docs/Web/CSS/::part"}],description:"The ::part CSS pseudo-element represents any element within a shadow tree that has a matching part attribute."},{name:"::placeholder",browsers:["E79","FF51","S10.1","C57","O44"],references:[{name:"MDN Reference",url:"https://developer.mozilla.org/docs/Web/CSS/::placeholder"}],description:"The ::placeholder CSS pseudo-element represents the placeholder text of a form element."},{name:"::slotted",browsers:["E79","FF63","S10","C50","O37"],references:[{name:"MDN Reference",url:"https://developer.mozilla.org/docs/Web/CSS/::slotted"}],description:"The :slotted() CSS pseudo-element represents any element that has been placed into a slot inside an HTML template."},{name:"::spelling-error",status:"experimental",browsers:["E121","Spreview","C121"],references:[{name:"MDN Reference",url:"https://developer.mozilla.org/docs/Web/CSS/::spelling-error"}],description:"The ::spelling-error CSS pseudo-element represents a text segment which the user agent has flagged as incorrectly spelled."},{name:"::view-transition",status:"experimental",browsers:["E109","C109","O95"],references:[{name:"MDN Reference",url:"https://developer.mozilla.org/docs/Web/CSS/::view-transition"}],description:"The ::view-transition CSS pseudo-element represents the root of the view transitions overlay, which contains all view transitions and sits over the top of all other page content."},{name:"::view-transition-group",status:"experimental",browsers:["E109","C109","O95"],references:[{name:"MDN Reference",url:"https://developer.mozilla.org/docs/Web/CSS/::view-transition-group"}],description:"The ::view-transition-group CSS pseudo-element represents a single view transition group."},{name:"::view-transition-image-pair",status:"experimental",browsers:["E109","C109","O95"],references:[{name:"MDN Reference",url:"https://developer.mozilla.org/docs/Web/CSS/::view-transition-image-pair"}],description:`The ::view-transition-image-pair CSS pseudo-element represents a container for a view transition's "old" and "new" view states — before and after the transition.`},{name:"::view-transition-new",status:"experimental",browsers:["E109","C109","O95"],references:[{name:"MDN Reference",url:"https://developer.mozilla.org/docs/Web/CSS/::view-transition-new"}],description:'The ::view-transition-new CSS pseudo-element represents the "new" view state of a view transition — a live representation of the new view, after the transition.'},{name:"::view-transition-old",status:"experimental",browsers:["E109","C109","O95"],references:[{name:"MDN Reference",url:"https://developer.mozilla.org/docs/Web/CSS/::view-transition-old"}],description:'The ::view-transition-old CSS pseudo-element represents the "old" view state of a view transition — a static screenshot of the old view, before the transition.'}]};class nh{constructor(e){this._properties=[],this._atDirectives=[],this._pseudoClasses=[],this._pseudoElements=[],this.addData(e)}provideProperties(){return this._properties}provideAtDirectives(){return this._atDirectives}providePseudoClasses(){return this._pseudoClasses}providePseudoElements(){return this._pseudoElements}addData(e){if(Array.isArray(e.properties))for(const n of e.properties)mf(n)&&this._properties.push(n);if(Array.isArray(e.atDirectives))for(const n of e.atDirectives)ff(n)&&this._atDirectives.push(n);if(Array.isArray(e.pseudoClasses))for(const n of e.pseudoClasses)gf(n)&&this._pseudoClasses.push(n);if(Array.isArray(e.pseudoElements))for(const n of e.pseudoElements)bf(n)&&this._pseudoElements.push(n)}}function mf(t){return typeof t.name=="string"}function ff(t){return typeof t.name=="string"}function gf(t){return typeof t.name=="string"}function bf(t){return typeof t.name=="string"}class Rs{constructor(e){this.dataProviders=[],this._propertySet={},this._atDirectiveSet={},this._pseudoClassSet={},this._pseudoElementSet={},this._properties=[],this._atDirectives=[],this._pseudoClasses=[],this._pseudoElements=[],this.setDataProviders(e?.useDefaultDataProviLine truncated
|
||||
@@ -0,0 +1,26 @@
|
||||
(function(){"use strict";class qs{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?De.isErrorNoTelemetry(e)?new De(e.message+`
|
||||
|
||||
`+e.stack):new Error(e.message+`
|
||||
|
||||
`+e.stack):e},0)}}emit(e){this.listeners.forEach(n=>{n(e)})}onUnexpectedError(e){this.unexpectedErrorHandler(e),this.emit(e)}onUnexpectedExternalError(e){this.unexpectedErrorHandler(e)}}const Us=new qs;function bt(t){$s(t)||Us.onUnexpectedError(t)}function $t(t){if(t instanceof Error){const{name:e,message:n,cause:r}=t,s=t.stacktrace||t.stack;return{$isError:!0,name:e,message:n,stack:s,noTelemetry:De.isErrorNoTelemetry(t),cause:r?$t(r):void 0,code:t.code}}return t}const Ht="Canceled";function $s(t){return t instanceof En?!0:t instanceof Error&&t.name===Ht&&t.message===Ht}class En extends Error{constructor(){super(Ht),this.name=this.message}}class De extends Error{constructor(e){super(e),this.name="CodeExpectedError"}static fromError(e){if(e instanceof De)return e;const n=new De;return n.message=e.message,n.stack=e.stack,n}static isErrorNoTelemetry(e){return e.name==="CodeExpectedError"}}class Y extends Error{constructor(e){super(e||"An unexpected bug occurred."),Object.setPrototypeOf(this,Y.prototype)}}function Hs(t,e="Unreachable"){throw new Error(e)}function Ws(t,e="unexpected state"){if(!t)throw typeof e=="string"?new Y(`Assertion Failed: ${e}`):e}function pt(t){if(!t()){debugger;t(),bt(new Y("Assertion Failed"))}}function kn(t,e){let n=0;for(;n<t.length-1;){const r=t[n],s=t[n+1];if(!e(r,s))return!1;n++}return!0}function zs(t){return typeof t=="string"}function Gs(t){return!!t&&typeof t[Symbol.iterator]=="function"}var wt;(function(t){function e(w){return!!w&&typeof w=="object"&&typeof w[Symbol.iterator]=="function"}t.is=e;const n=Object.freeze([]);function r(){return n}t.empty=r;function*s(w){yield w}t.single=s;function i(w){return e(w)?w:s(w)}t.wrap=i;function l(w){return w||n}t.from=l;function*o(w){for(let y=w.length-1;y>=0;y--)yield w[y]}t.reverse=o;function u(w){return!w||w[Symbol.iterator]().next().done===!0}t.isEmpty=u;function c(w){return w[Symbol.iterator]().next().value}t.first=c;function h(w,y){let A=0;for(const D of w)if(y(D,A++))return!0;return!1}t.some=h;function f(w,y){let A=0;for(const D of w)if(!y(D,A++))return!1;return!0}t.every=f;function m(w,y){for(const A of w)if(y(A))return A}t.find=m;function*p(w,y){for(const A of w)y(A)&&(yield A)}t.filter=p;function*b(w,y){let A=0;for(const D of w)yield y(D,A++)}t.map=b;function*d(w,y){let A=0;for(const D of w)yield*y(D,A++)}t.flatMap=d;function*x(...w){for(const y of w)Gs(y)?yield*y:yield y}t.concat=x;function N(w,y,A){let D=A;for(const V of w)D=y(D,V);return D}t.reduce=N;function v(w){let y=0;for(const A of w)y++;return y}t.length=v;function*L(w,y,A=w.length){for(y<-w.length&&(y=0),y<0&&(y+=w.length),A<0?A+=w.length:A>w.length&&(A=w.length);y<A;y++)yield w[y]}t.slice=L;function E(w,y=Number.POSITIVE_INFINITY){const A=[];if(y===0)return[A,w];const D=w[Symbol.iterator]();for(let V=0;V<y;V++){const _=D.next();if(_.done)return[A,t.empty()];A.push(_.value)}return[A,{[Symbol.iterator](){return D}}]}t.consume=E;async function T(w){const y=[];for await(const A of w)y.push(A);return y}t.asyncToArray=T;async function q(w){let y=[];for await(const A of w)y=y.concat(A);return y}t.asyncToArrayFlat=q})(wt||(wt={}));function E1(t,e){}function Mn(t){if(wt.is(t)){const e=[];for(const n of t)if(n)try{n.dispose()}catch(r){e.push(r)}if(e.length===1)throw e[0];if(e.length>1)throw new AggregateError(e,"Encountered errors while disposing of store");return Array.isArray(t)?[]:t}else if(t)return t.dispose(),t}function js(...t){return xt(()=>Mn(t))}class Os{constructor(e){this._isDisposed=!1,this._fn=e}dispose(){if(!this._isDisposed){if(!this._fn)throw new Error("Unbound disposable context: Need to use an arrow function to preserve the value of this");this._isDisposed=!0,this._fn()}}}function xt(t){return new Os(t)}const Tt=class Tt{constructor(){this._toDispose=new Set,this._isDisposed=!1}dispose(){this._isDisposed||(this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(this._toDispose.size!==0)try{Mn(this._toDispose)}finally{this._toDispose.clear()}}add(e){if(!e||e===Re.None)return e;if(e===this)throw new Error("Cannot register a disposable on itself!");return this._isDisposed?Tt.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(e),e}delete(e){if(e){if(e===this)throw new Error("Cannot dispose a disposable on itself!");this._toDispose.delete(e),e.dispose()}}};Tt.DISABLE_DISPOSED_WARNING=!1;let tt=Tt;const Rn=class Rn{constructor(){this._store=new tt,this._store}dispose(){this._store.dispose()}_register(e){if(e===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(e)}};Rn.None=Object.freeze({dispose(){}});let Re=Rn;const Je=class Je{constructor(e){this.element=e,this.next=Je.Undefined,this.prev=Je.Undefined}};Je.Undefined=new Je(void 0);let j=Je;class Xs{constructor(){this._first=j.Undefined,this._last=j.Undefined,this._size=0}get size(){return this._size}isEmpt
Line truncated
|
||||
`).slice(2).join(`
|
||||
`))}}class Ys extends Error{constructor(e,n){super(e),this.name="ListenerLeakError",this.stack=n}}class Zs extends Error{constructor(e,n){super(e),this.name="ListenerRefusalError",this.stack=n}}class Ot{constructor(e){this.value=e}}const Ks=2;class fe{constructor(e){this._size=0,this._options=e,this._leakageMon=this._options?.leakWarningThreshold?new Gt(e?.onListenerError??bt,this._options?.leakWarningThreshold??Js):void 0,this._perfMon=this._options?._profName?new zt(this._options._profName):void 0,this._deliveryQueue=this._options?.deliveryQueue}dispose(){this._disposed||(this._disposed=!0,this._deliveryQueue?.current===this&&this._deliveryQueue.reset(),this._listeners&&(this._listeners=void 0,this._size=0),this._options?.onDidRemoveLastListener?.(),this._leakageMon?.dispose())}get event(){return this._event??=(e,n,r)=>{if(this._leakageMon&&this._size>this._leakageMon.threshold**2){const o=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(o);const u=this._leakageMon.getMostFrequentStack()??["UNKNOWN stack",-1],c=new Zs(`${o}. HINT: Stack shows most frequent listener (${u[1]}-times)`,u[0]);return(this._options?.onListenerError||bt)(c),Re.None}if(this._disposed)return Re.None;n&&(e=e.bind(n));const s=new Ot(e);let i;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(s.stack=jt.create(),i=this._leakageMon.check(s.stack,this._size+1)),this._listeners?this._listeners instanceof Ot?(this._deliveryQueue??=new ei,this._listeners=[this._listeners,s]):this._listeners.push(s):(this._options?.onWillAddFirstListener?.(this),this._listeners=s,this._options?.onDidAddFirstListener?.(this)),this._options?.onDidAddListener?.(this),this._size++;const l=xt(()=>{i?.(),this._removeListener(s)});return r instanceof tt?r.add(l):Array.isArray(r)&&r.push(l),l},this._event}_removeListener(e){if(this._options?.onWillRemoveListener?.(this),!this._listeners)return;if(this._size===1){this._listeners=void 0,this._options?.onDidRemoveLastListener?.(this),this._size=0;return}const n=this._listeners,r=n.indexOf(e);if(r===-1)throw console.log("disposed?",this._disposed),console.log("size?",this._size),console.log("arr?",JSON.stringify(this._listeners)),new Error("Attempted to dispose unknown listener");this._size--,n[r]=void 0;const s=this._deliveryQueue.current===this;if(this._size*Ks<=n.length){let i=0;for(let l=0;l<n.length;l++)n[l]?n[i++]=n[l]:s&&i<this._deliveryQueue.end&&(this._deliveryQueue.end--,i<this._deliveryQueue.i&&this._deliveryQueue.i--);n.length=i}}_deliver(e,n){if(!e)return;const r=this._options?.onListenerError||bt;if(!r){e.value(n);return}try{e.value(n)}catch(s){r(s)}}_deliverQueue(e){const n=e.current._listeners;for(;e.i<e.end;)this._deliver(n[e.i++],e.value);e.reset()}fire(e){if(this._deliveryQueue?.current&&(this._deliverQueue(this._deliveryQueue),this._perfMon?.stop()),this._perfMon?.start(this._size),this._listeners)if(this._listeners instanceof Ot)this._deliver(this._listeners,e);else{const n=this._deliveryQueue;n.enqueue(this,e,this._listeners.length),this._deliverQueue(n)}this._perfMon?.stop()}hasListeners(){return this._size>0}}class ei{constructor(){this.i=-1,this.end=0}enqueue(e,n,r){this.i=0,this.end=r,this.current=e,this.value=n}reset(){this.i=this.end,this.current=void 0,this.value=void 0}}function ti(){return globalThis._VSCODE_NLS_MESSAGES}function Pn(){return globalThis._VSCODE_NLS_LANGUAGE}const ni=Pn()==="pseudo"||typeof document<"u"&&document.location&&typeof document.location.hash=="string"&&document.location.hash.indexOf("pseudo=true")>=0;function Fn(t,e){let n;return e.length===0?n=t:n=t.replace(/\{(\d+)\}/g,(r,s)=>{const i=s[0],l=e[i];let o=r;return typeof l=="string"?o=l:(typeof l=="number"||typeof l=="boolean"||l===void 0||l===null)&&(o=String(l)),o}),ni&&(n="["+n.replace(/[aouei]/g,"$&$&")+"]"),n}function P(t,e,...n){return Fn(typeof t=="number"?ri(t,e):e,n)}function ri(t,e){const n=ti()?.[t];if(typeof n!="string"){if(typeof e=="string")return e;throw new Error(`!!! NLS MISSING: ${t} !!!`)}return n}const Ve="en";let Xt=!1,Qt=!1,Jt=!1,_t,Yt=Ve,Tn=Ve,si,be;const Ce=globalThis;let ee;typeof Ce.vscode<"u"&&typeof Ce.vscode.process<"u"?ee=Ce.vscode.process:typeof process<"u"&&typeof process?.versions?.node=="string"&&(ee=process);const ii=typeof ee?.versions?.electron=="string"&&ee?.type==="renderer";if(typeof ee=="object"){Xt=ee.platform==="win32",Qt=ee.platform==="darwin",Jt=ee.platform==="linux",Jt&&ee.env.SNAP&&ee.env.SNAP_REVISION,ee.env.CI||ee.env.BUILD_ARTIFACTSTAGINGDIRECTORY||ee.env.GITHUB_WORKSPACE,_t=Ve,Yt=Ve;const t=ee.env.VSCODE_NLS_CONFIG;if(t)try{const e=JSON.parse(t);_t=e.userLocale,Tn=e.osLocale,Yt=e.resolvedLanguage||Ve,si=e.languagePack?.translationsConfigFile}catch{}}else typeof navigator=="object"&&!ii?(be=navigator.userAgent,Xt=be.indexOf("Windows")>=0,Qt=be.indexOf("Macintosh")>=0,(be.indexOf("Macintosh")>=0||be.indexOf("iPad")>=0||be.inde
Line truncated
|
||||
`||t===" "}class Et{constructor(e,n,r){this.changes=e,this.moves=n,this.hitTimeout=r}}class Ra{constructor(e,n){this.lineRangeMapping=e,this.changes=n}}function Ca(t,e,n=(r,s)=>r===s){if(t===e)return!0;if(!t||!e||t.length!==e.length)return!1;for(let r=0,s=t.length;r<s;r++)if(!n(t[r],e[r]))return!1;return!0}function*Ea(t,e){let n,r;for(const s of t)r!==void 0&&e(r,s)?n.push(s):(n&&(yield n),n=[s]),r=s;n&&(yield n)}function ka(t,e){for(let n=0;n<=t.length;n++)e(n===0?void 0:t[n-1],n===t.length?void 0:t[n])}function Ma(t,e){for(let n=0;n<t.length;n++)e(n===0?void 0:t[n-1],t[n],n+1===t.length?void 0:t[n+1])}function Pa(t,e){for(const n of e)t.push(n)}var wn;(function(t){function e(i){return i<0}t.isLessThan=e;function n(i){return i<=0}t.isLessThanOrEqual=n;function r(i){return i>0}t.isGreaterThan=r;function s(i){return i===0}t.isNeitherLessOrGreaterThan=s,t.greaterThan=1,t.lessThan=-1,t.neitherLessOrGreaterThan=0})(wn||(wn={}));function at(t,e){return(n,r)=>e(t(n),t(r))}const lt=(t,e)=>t-e;function Fa(t){return(e,n)=>-t(e,n)}const et=class et{constructor(e){this.iterate=e}toArray(){const e=[];return this.iterate(n=>(e.push(n),!0)),e}filter(e){return new et(n=>this.iterate(r=>e(r)?n(r):!0))}map(e){return new et(n=>this.iterate(r=>n(e(r))))}findLast(e){let n;return this.iterate(r=>(e(r)&&(n=r),!0)),n}findLastMaxBy(e){let n,r=!0;return this.iterate(s=>((r||wn.isGreaterThan(e(s,n)))&&(r=!1,n=s),!0)),n}};et.empty=new et(e=>{});let ds=et;class B{static fromTo(e,n){return new B(e,n)}static addRange(e,n){let r=0;for(;r<n.length&&n[r].endExclusive<e.start;)r++;let s=r;for(;s<n.length&&n[s].start<=e.endExclusive;)s++;if(r===s)n.splice(r,0,e);else{const i=Math.min(e.start,n[r].start),l=Math.max(e.endExclusive,n[s-1].endExclusive);n.splice(r,s-r,new B(i,l))}}static tryCreate(e,n){if(!(e>n))return new B(e,n)}static ofLength(e){return new B(0,e)}static ofStartAndLength(e,n){return new B(e,e+n)}static emptyAt(e){return new B(e,e)}constructor(e,n){if(this.start=e,this.endExclusive=n,e>n)throw new Y(`Invalid range: ${this.toString()}`)}get isEmpty(){return this.start===this.endExclusive}delta(e){return new B(this.start+e,this.endExclusive+e)}deltaStart(e){return new B(this.start+e,this.endExclusive)}deltaEnd(e){return new B(this.start,this.endExclusive+e)}get length(){return this.endExclusive-this.start}toString(){return`[${this.start}, ${this.endExclusive})`}equals(e){return this.start===e.start&&this.endExclusive===e.endExclusive}contains(e){return this.start<=e&&e<this.endExclusive}join(e){return new B(Math.min(this.start,e.start),Math.max(this.endExclusive,e.endExclusive))}intersect(e){const n=Math.max(this.start,e.start),r=Math.min(this.endExclusive,e.endExclusive);if(n<=r)return new B(n,r)}intersectionLength(e){const n=Math.max(this.start,e.start),r=Math.min(this.endExclusive,e.endExclusive);return Math.max(0,r-n)}intersects(e){const n=Math.max(this.start,e.start),r=Math.min(this.endExclusive,e.endExclusive);return n<r}intersectsOrTouches(e){const n=Math.max(this.start,e.start),r=Math.min(this.endExclusive,e.endExclusive);return n<=r}isBefore(e){return this.endExclusive<=e.start}isAfter(e){return this.start>=e.endExclusive}slice(e){return e.slice(this.start,this.endExclusive)}substring(e){return e.substring(this.start,this.endExclusive)}clip(e){if(this.isEmpty)throw new Y(`Invalid clipping range: ${this.toString()}`);return Math.max(this.start,Math.min(this.endExclusive-1,e))}clipCyclic(e){if(this.isEmpty)throw new Y(`Invalid clipping range: ${this.toString()}`);return e<this.start?this.endExclusive-(this.start-e)%this.length:e>=this.endExclusive?this.start+(e-this.start)%this.length:e}forEach(e){for(let n=this.start;n<this.endExclusive;n++)e(n)}joinRightTouching(e){if(this.endExclusive!==e.start)throw new Y(`Invalid join: ${this.toString()} and ${e.toString()}`);return new B(this.start,e.endExclusive)}}function He(t,e){const n=We(t,e);return n===-1?void 0:t[n]}function We(t,e,n=0,r=t.length){let s=n,i=r;for(;s<i;){const l=Math.floor((s+i)/2);e(t[l])?s=l+1:i=l}return s-1}function Ta(t,e){const n=xn(t,e);return n===t.length?void 0:t[n]}function xn(t,e,n=0,r=t.length){let s=n,i=r;for(;s<i;){const l=Math.floor((s+i)/2);e(t[l])?i=l:s=l+1}return s}const It=class It{constructor(e){this._array=e,this._findLastMonotonousLastIdx=0}findLastMonotonous(e){if(It.assertInvariants){if(this._prevFindLastPredicate){for(const r of this._array)if(this._prevFindLastPredicate(r)&&!e(r))throw new Error("MonotonousArray: current predicate must be weaker than (or equal to) the previous predicate.")}this._prevFindLastPredicate=e}const n=We(this._array,e,this._findLastMonotonousLastIdx);return this._findLastMonotonousLastIdx=n+1,n===-1?void 0:this._array[n]}};It.assertInvariants=!1;let kt=It;const ie=class ie{static ofLength(e,n){return new ie(e,e+n)}static fromRange(e){return new ie(e.startLineNumber,e.endLineNumber)}static fromRangeInclusive(e){return new ie(e.startLineNumber,e.endLineNumber+1)}static joinMany(e){if(e.length===0)return[];let n=
Line truncated
|
||||
`?(n++,r=0):r++;return new he(n,r)}constructor(e,n){this.lineCount=e,this.columnCount=n}isGreaterThanOrEqualTo(e){return this.lineCount!==e.lineCount?this.lineCount>e.lineCount:this.columnCount>=e.columnCount}add(e){return e.lineCount===0?new he(this.lineCount,this.columnCount+e.columnCount):new he(this.lineCount+e.lineCount,e.columnCount)}createRange(e){return this.lineCount===0?new C(e.lineNumber,e.column,e.lineNumber,e.column+this.columnCount):new C(e.lineNumber,e.column,e.lineNumber+this.lineCount,this.columnCount+1)}toRange(){return new C(1,1,this.lineCount+1,this.columnCount+1)}toLineRange(){return $.ofLength(1,this.lineCount+1)}addToPosition(e){return this.lineCount===0?new H(e.lineNumber,e.column+this.columnCount):new H(e.lineNumber+this.lineCount,this.columnCount+1)}toString(){return`${this.lineCount},${this.columnCount}`}};he.zero=new he(0,0);let ot=he;class Da{getOffsetRange(e){return new B(this.getOffset(e.getStartPosition()),this.getOffset(e.getEndPosition()))}getRange(e){return C.fromPositions(this.getPosition(e.start),this.getPosition(e.endExclusive))}getStringReplacement(e){return new ze.deps.StringReplacement(this.getOffsetRange(e.range),e.text)}getTextReplacement(e){return new ze.deps.TextReplacement(this.getRange(e.replaceRange),e.newText)}getTextEdit(e){const n=e.replacements.map(r=>this.getTextReplacement(r));return new ze.deps.TextEdit(n)}}const Cn=class Cn{static get deps(){if(!this._deps)throw new Error("Dependencies not set. Call _setDependencies first.");return this._deps}};Cn._deps=void 0;let ze=Cn;class Va extends Da{constructor(e){super(),this.text=e,this.lineStartOffsetByLineIdx=[],this.lineEndOffsetByLineIdx=[],this.lineStartOffsetByLineIdx.push(0);for(let n=0;n<e.length;n++)e.charAt(n)===`
|
||||
`&&(this.lineStartOffsetByLineIdx.push(n+1),n>0&&e.charAt(n-1)==="\r"?this.lineEndOffsetByLineIdx.push(n-1):this.lineEndOffsetByLineIdx.push(n));this.lineEndOffsetByLineIdx.push(e.length)}getOffset(e){const n=this._validatePosition(e);return this.lineStartOffsetByLineIdx[n.lineNumber-1]+n.column-1}_validatePosition(e){if(e.lineNumber<1)return new H(1,1);const n=this.textLength.lineCount+1;if(e.lineNumber>n){const s=this.getLineLength(n);return new H(n,s+1)}if(e.column<1)return new H(e.lineNumber,1);const r=this.getLineLength(e.lineNumber);return e.column-1>r?new H(e.lineNumber,r+1):e}getPosition(e){const n=We(this.lineStartOffsetByLineIdx,i=>i<=e),r=n+1,s=e-this.lineStartOffsetByLineIdx[n]+1;return new H(r,s)}get textLength(){const e=this.lineStartOffsetByLineIdx.length-1;return new ze.deps.TextLength(e,this.text.length-this.lineStartOffsetByLineIdx[e])}getLineLength(e){return this.lineEndOffsetByLineIdx[e-1]-this.lineStartOffsetByLineIdx[e-1]}}class Ia{constructor(){this._transformer=void 0}get endPositionExclusive(){return this.length.addToPosition(new H(1,1))}get lineRange(){return this.length.toLineRange()}getValue(){return this.getValueOfRange(this.length.toRange())}getValueOfOffsetRange(e){return this.getValueOfRange(this.getTransformer().getRange(e))}getLineLength(e){return this.getValueOfRange(new C(e,1,e,Number.MAX_SAFE_INTEGER)).length}getTransformer(){return this._transformer||(this._transformer=new Va(this.getValue())),this._transformer}getLineAt(e){return this.getValueOfRange(new C(e,1,e,Number.MAX_SAFE_INTEGER))}}class Ba extends Ia{constructor(e,n){Ws(n>=1),super(),this._getLineContent=e,this._lineCount=n}getValueOfRange(e){if(e.startLineNumber===e.endLineNumber)return this._getLineContent(e.startLineNumber).substring(e.startColumn-1,e.endColumn-1);let n=this._getLineContent(e.startLineNumber).substring(e.startColumn-1);for(let r=e.startLineNumber+1;r<e.endLineNumber;r++)n+=`
|
||||
`+this._getLineContent(r);return n+=`
|
||||
`+this._getLineContent(e.endLineNumber).substring(0,e.endColumn-1),n}getLineLength(e){return this._getLineContent(e).length}get length(){const e=this._getLineContent(this._lineCount);return new ot(this._lineCount-1,e.length)}}class Mt extends Ba{constructor(e){super(n=>e[n-1],e.length)}}class Se{static joinReplacements(e,n){if(e.length===0)throw new Y;if(e.length===1)return e[0];const r=e[0].range.getStartPosition(),s=e[e.length-1].range.getEndPosition();let i="";for(let l=0;l<e.length;l++){const o=e[l];if(i+=o.text,l<e.length-1){const u=e[l+1],c=C.fromPositions(o.range.getEndPosition(),u.range.getStartPosition()),h=n.getValueOfRange(c);i+=h}}return new Se(C.fromPositions(r,s),i)}static fromStringReplacement(e,n){return new Se(n.getTransformer().getRange(e.replaceRange),e.newText)}static delete(e){return new Se(e,"")}constructor(e,n){this.range=e,this.text=n}get isEmpty(){return this.range.isEmpty()&&this.text.length===0}static equals(e,n){return e.range.equalsRange(n.range)&&e.text===n.text}equals(e){return Se.equals(this,e)}removeCommonPrefixAndSuffix(e){return this.removeCommonPrefix(e).removeCommonSuffix(e)}removeCommonPrefix(e){const n=e.getValueOfRange(this.range).replaceAll(`\r
|
||||
`,`
|
||||
`),r=this.text.replaceAll(`\r
|
||||
`,`
|
||||
`),s=bi(n,r),i=ot.ofText(n.substring(0,s)).addToPosition(this.range.getStartPosition()),l=r.substring(s),o=C.fromPositions(i,this.range.getEndPosition());return new Se(o,l)}removeCommonSuffix(e){const n=e.getValueOfRange(this.range).replaceAll(`\r
|
||||
`,`
|
||||
`),r=this.text.replaceAll(`\r
|
||||
`,`
|
||||
`),s=pi(n,r),i=ot.ofText(n.substring(0,n.length-s)).addToPosition(this.range.getStartPosition()),l=r.substring(0,r.length-s),o=C.fromPositions(this.range.getStartPosition(),i);return new Se(o,l)}toString(){const e=this.range.getStartPosition(),n=this.range.getEndPosition();return`(${e.lineNumber},${e.column} -> ${n.lineNumber},${n.column}): "${this.text}"`}}class ae{static inverse(e,n,r){const s=[];let i=1,l=1;for(const u of e){const c=new ae(new $(i,u.original.startLineNumber),new $(l,u.modified.startLineNumber));c.modified.isEmpty||s.push(c),i=u.original.endLineNumberExclusive,l=u.modified.endLineNumberExclusive}const o=new ae(new $(i,n+1),new $(l,r+1));return o.modified.isEmpty||s.push(o),s}static clip(e,n,r){const s=[];for(const i of e){const l=i.original.intersect(n),o=i.modified.intersect(r);l&&!l.isEmpty&&o&&!o.isEmpty&&s.push(new ae(l,o))}return s}constructor(e,n){this.original=e,this.modified=n}toString(){return`{${this.original.toString()}->${this.modified.toString()}}`}flip(){return new ae(this.modified,this.original)}join(e){return new ae(this.original.join(e.original),this.modified.join(e.modified))}toRangeMapping(){const e=this.original.toInclusiveRange(),n=this.modified.toInclusiveRange();if(e&&n)return new le(e,n);if(this.original.startLineNumber===1||this.modified.startLineNumber===1){if(!(this.modified.startLineNumber===1&&this.original.startLineNumber===1))throw new Y("not a valid diff");return new le(new C(this.original.startLineNumber,1,this.original.endLineNumberExclusive,1),new C(this.modified.startLineNumber,1,this.modified.endLineNumberExclusive,1))}else return new le(new C(this.original.startLineNumber-1,Number.MAX_SAFE_INTEGER,this.original.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),new C(this.modified.startLineNumber-1,Number.MAX_SAFE_INTEGER,this.modified.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER))}toRangeMapping2(e,n){if(gs(this.original.endLineNumberExclusive,e)&&gs(this.modified.endLineNumberExclusive,n))return new le(new C(this.original.startLineNumber,1,this.original.endLineNumberExclusive,1),new C(this.modified.startLineNumber,1,this.modified.endLineNumberExclusive,1));if(!this.original.isEmpty&&!this.modified.isEmpty)return new le(C.fromPositions(new H(this.original.startLineNumber,1),Ge(new H(this.original.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),e)),C.fromPositions(new H(this.modified.startLineNumber,1),Ge(new H(this.modified.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),n)));if(this.original.startLineNumber>1&&this.modified.startLineNumber>1)return new le(C.fromPositions(Ge(new H(this.original.startLineNumber-1,Number.MAX_SAFE_INTEGER),e),Ge(new H(this.original.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),e)),C.fromPositions(Ge(new H(this.modified.startLineNumber-1,Number.MAX_SAFE_INTEGER),n),Ge(new H(this.modified.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),n)));throw new Y}}function Ge(t,e){if(t.lineNumber<1)return new H(1,1);if(t.lineNumber>e.length)return new H(e.length,e[e.length-1].length+1);const n=e[t.lineNumber-1];return t.column>n.length+1?new H(t.lineNumber,n.length+1):t}function gs(t,e){return t>=1&&t<=e.length}class xe extends ae{static fromRangeMappings(e){const n=$.join(e.map(s=>$.fromRangeInclusive(s.originalRange))),r=$.join(e.map(s=>$.fromRangeInclusive(s.modifiedRange)));return new xe(n,r,e)}constructor(e,n,r){super(e,n),this.innerChanges=r}flip(){return new xe(this.modified,this.original,this.innerChanges?.map(e=>e.flip()))}withInnerChangesFromLineRanges(){return new xe(this.original,this.modified,[this.toRangeMapping()])}}class le{static fromEdit(e){const n=e.getNewRanges();return e.replacements.map((s,i)=>new le(s.range,n[i]))}static assertSorted(e){for(let n=1;n<e.length;n++){const r=e[n-1],s=e[n];if(!(r.originalRange.getEndPosition().isBeforeOrEqual(s.originalRange.getStartPosition())&&r.modifiedRange.getEndPosition().isBeforeOrEqual(s.modifiedRange.getStartPosition())))throw new Y("Range mappings must be sorted")}}constructor(e,n){this.originalRange=e,this.modifiedRange=n}toString(){return`{${this.originalRange.toString()}->${this.modifiedRange.toString()}}`}flip(){return new le(this.modifiedRange,this.originalRange)}toTextEdit(e){const n=e.getValueOfRange(this.modifiedRange);return new Se(this.originalRange,n)}}function bs(t,e,n,r=!1){const s=[];for(const i of Ea(t.map(l=>qa(l,e,n)),(l,o)=>l.original.intersectsOrTouches(o.original)||l.modified.intersectsOrTouches(o.modified))){const l=i[0],o=i[i.length-1];s.push(new xe(l.original.join(o.original),l.modified.join(o.modified),i.map(u=>u.innerChanges[0])))}return pt(()=>!r&&s.length>0&&(s[0].modified.startLineNumber!==s[0].original.startLineNumber||n.length.lineCount-s[s.length-1].modified.endLineNumberExclusive!==e.length.lineCount-s[s.length-1].original.endLineNumberExclusive)?!1:kn(s,(i,l)=>l.original.startLineNumber-i.original.endLineNumberExclusive===l.modified.startLineNumber-i.modified.endLineNumberExclusive&&i.original.endLineNumberExclusive<l.origin
Line truncated
|
||||
`);this.histogram[o]=(this.histogram[o]||0)+1}this.totalCount=s}computeSimilarity(e){let n=0;const r=Math.max(this.histogram.length,e.histogram.length);for(let s=0;s<r;s++)n+=Math.abs((this.histogram[s]??0)-(e.histogram[s]??0));return 1-n/(this.totalCount+e.totalCount)}};mt.chrKeys=new Map;let Pt=mt;class ja{compute(e,n,r=ct.instance,s){if(e.length===0||n.length===0)return ye.trivial(e,n);const i=new Ln(e.length,n.length),l=new Ln(e.length,n.length),o=new Ln(e.length,n.length);for(let b=0;b<e.length;b++)for(let d=0;d<n.length;d++){if(!r.isValid())return ye.trivialTimedOut(e,n);const x=b===0?0:i.get(b-1,d),N=d===0?0:i.get(b,d-1);let v;e.getElement(b)===n.getElement(d)?(b===0||d===0?v=0:v=i.get(b-1,d-1),b>0&&d>0&&l.get(b-1,d-1)===3&&(v+=o.get(b-1,d-1)),v+=s?s(b,d):1):v=-1;const L=Math.max(x,N,v);if(L===v){const E=b>0&&d>0?o.get(b-1,d-1):0;o.set(b,d,E+1),l.set(b,d,3)}else L===x?(o.set(b,d,0),l.set(b,d,1)):L===N&&(o.set(b,d,0),l.set(b,d,2));i.set(b,d,L)}const u=[];let c=e.length,h=n.length;function f(b,d){(b+1!==c||d+1!==h)&&u.push(new O(new B(b+1,c),new B(d+1,h))),c=b,h=d}let m=e.length-1,p=n.length-1;for(;m>=0&&p>=0;)l.get(m,p)===3?(f(m,p),m--,p--):l.get(m,p)===1?m--:p--;return f(-1,-1),u.reverse(),new ye(u,!1)}}class ys{compute(e,n,r=ct.instance){if(e.length===0||n.length===0)return ye.trivial(e,n);const s=e,i=n;function l(d,x){for(;d<s.length&&x<i.length&&s.getElement(d)===i.getElement(x);)d++,x++;return d}let o=0;const u=new Oa;u.set(0,l(0,0));const c=new Xa;c.set(0,u.get(0)===0?null:new _s(null,0,0,u.get(0)));let h=0;e:for(;;){if(o++,!r.isValid())return ye.trivialTimedOut(s,i);const d=-Math.min(o,i.length+o%2),x=Math.min(o,s.length+o%2);for(h=d;h<=x;h+=2){const N=h===x?-1:u.get(h+1),v=h===d?-1:u.get(h-1)+1,L=Math.min(Math.max(N,v),s.length),E=L-h;if(L>s.length||E>i.length)continue;const T=l(L,E);u.set(h,T);const q=L===N?c.get(h+1):c.get(h-1);if(c.set(h,T!==L?new _s(q,L,E,T-L):q),u.get(h)===s.length&&u.get(h)-h===i.length)break e}}let f=c.get(h);const m=[];let p=s.length,b=i.length;for(;;){const d=f?f.x+f.length:0,x=f?f.y+f.length:0;if((d!==p||x!==b)&&m.push(new O(new B(d,p),new B(x,b))),!f)break;p=f.x,b=f.y,f=f.prev}return m.reverse(),new ye(m,!1)}}class _s{constructor(e,n,r,s){this.prev=e,this.x=n,this.y=r,this.length=s}}class Oa{constructor(){this.positiveArr=new Int32Array(10),this.negativeArr=new Int32Array(10)}get(e){return e<0?(e=-e-1,this.negativeArr[e]):this.positiveArr[e]}set(e,n){if(e<0){if(e=-e-1,e>=this.negativeArr.length){const r=this.negativeArr;this.negativeArr=new Int32Array(r.length*2),this.negativeArr.set(r)}this.negativeArr[e]=n}else{if(e>=this.positiveArr.length){const r=this.positiveArr;this.positiveArr=new Int32Array(r.length*2),this.positiveArr.set(r)}this.positiveArr[e]=n}}}class Xa{constructor(){this.positiveArr=[],this.negativeArr=[]}get(e){return e<0?(e=-e-1,this.negativeArr[e]):this.positiveArr[e]}set(e,n){e<0?(e=-e-1,this.negativeArr[e]=n):this.positiveArr[e]=n}}class Ft{constructor(e,n,r){this.lines=e,this.range=n,this.considerWhitespaceChanges=r,this.elements=[],this.firstElementOffsetByLineIdx=[],this.lineStartOffsets=[],this.trimmedWsLengthsByLineIdx=[],this.firstElementOffsetByLineIdx.push(0);for(let s=this.range.startLineNumber;s<=this.range.endLineNumber;s++){let i=e[s-1],l=0;s===this.range.startLineNumber&&this.range.startColumn>1&&(l=this.range.startColumn-1,i=i.substring(l)),this.lineStartOffsets.push(l);let o=0;if(!r){const c=i.trimStart();o=i.length-c.length,i=c.trimEnd()}this.trimmedWsLengthsByLineIdx.push(o);const u=s===this.range.endLineNumber?Math.min(this.range.endColumn-1-l-o,i.length):i.length;for(let c=0;c<u;c++)this.elements.push(i.charCodeAt(c));s<this.range.endLineNumber&&(this.elements.push(10),this.firstElementOffsetByLineIdx.push(this.elements.length))}}toString(){return`Slice: "${this.text}"`}get text(){return this.getText(new B(0,this.length))}getText(e){return this.elements.slice(e.start,e.endExclusive).map(n=>String.fromCharCode(n)).join("")}getElement(e){return this.elements[e]}get length(){return this.elements.length}getBoundaryScore(e){const n=Ns(e>0?this.elements[e-1]:-1),r=Ns(e<this.elements.length?this.elements[e]:-1);if(n===7&&r===8)return 0;if(n===8)return 150;let s=0;return n!==r&&(s+=10,n===0&&r===1&&(s+=1)),s+=vs(n),s+=vs(r),s}translateOffset(e,n="right"){const r=We(this.firstElementOffsetByLineIdx,i=>i<=e),s=e-this.firstElementOffsetByLineIdx[r];return new H(this.range.startLineNumber+r,1+this.lineStartOffsets[r]+s+(s===0&&n==="left"?0:this.trimmedWsLengthsByLineIdx[r]))}translateRange(e){const n=this.translateOffset(e.start,"right"),r=this.translateOffset(e.endExclusive,"left");return r.isBefore(n)?C.fromPositions(r,r):C.fromPositions(n,r)}findWordContaining(e){if(e<0||e>=this.elements.length||!Oe(this.elements[e]))return;let n=e;for(;n>0&&Oe(this.elements[n-1]);)n--;let r=e;for(;r<this.elements.length&&Oe(this.elements[r]);)r++;return new B(n,r)}findSubWordContaining(e){if(e<0||e>=this.elements.length||!Oe(this.elements[e]))return;l
Line truncated
|
||||
`).length>=15&&Ya(f,p=>p.length>=2)>=2}),l=t1(t,l),l}function Ya(t,e){let n=0;for(const r of t)e(r)&&n++;return n}function Za(t,e,n,r){const s=[],i=t.filter(u=>u.modified.isEmpty&&u.original.length>=3).map(u=>new Pt(u.original,e,u)),l=new Set(t.filter(u=>u.original.isEmpty&&u.modified.length>=3).map(u=>new Pt(u.modified,n,u))),o=new Set;for(const u of i){let c=-1,h;for(const f of l){const m=u.computeSimilarity(f);m>c&&(c=m,h=f)}if(c>.9&&h&&(l.delete(h),s.push(new ae(u.range,h.range)),o.add(u.source),o.add(h.source)),!r.isValid())return{moves:s,excludedChanges:o}}return{moves:s,excludedChanges:o}}function Ka(t,e,n,r,s,i){const l=[],o=new ba;for(const m of t)for(let p=m.original.startLineNumber;p<m.original.endLineNumberExclusive-2;p++){const b=`${e[p-1]}:${e[p+1-1]}:${e[p+2-1]}`;o.add(b,{range:new $(p,p+3)})}const u=[];t.sort(at(m=>m.modified.startLineNumber,lt));for(const m of t){let p=[];for(let b=m.modified.startLineNumber;b<m.modified.endLineNumberExclusive-2;b++){const d=`${n[b-1]}:${n[b+1-1]}:${n[b+2-1]}`,x=new $(b,b+3),N=[];o.forEach(d,({range:v})=>{for(const E of p)if(E.originalLineRange.endLineNumberExclusive+1===v.endLineNumberExclusive&&E.modifiedLineRange.endLineNumberExclusive+1===x.endLineNumberExclusive){E.originalLineRange=new $(E.originalLineRange.startLineNumber,v.endLineNumberExclusive),E.modifiedLineRange=new $(E.modifiedLineRange.startLineNumber,x.endLineNumberExclusive),N.push(E);return}const L={modifiedLineRange:x,originalLineRange:v};u.push(L),N.push(L)}),p=N}if(!i.isValid())return[]}u.sort(Fa(at(m=>m.modifiedLineRange.length,lt)));const c=new de,h=new de;for(const m of u){const p=m.modifiedLineRange.startLineNumber-m.originalLineRange.startLineNumber,b=c.subtractFrom(m.modifiedLineRange),d=h.subtractFrom(m.originalLineRange).getWithDelta(p),x=b.getIntersection(d);for(const N of x.ranges){if(N.length<3)continue;const v=N,L=N.delta(-p);l.push(new ae(L,v)),c.addRange(v),h.addRange(L)}}l.sort(at(m=>m.original.startLineNumber,lt));const f=new kt(t);for(let m=0;m<l.length;m++){const p=l[m],b=f.findLastMonotonous(q=>q.original.startLineNumber<=p.original.startLineNumber),d=He(t,q=>q.modified.startLineNumber<=p.modified.startLineNumber),x=Math.max(p.original.startLineNumber-b.original.startLineNumber,p.modified.startLineNumber-d.modified.startLineNumber),N=f.findLastMonotonous(q=>q.original.startLineNumber<p.original.endLineNumberExclusive),v=He(t,q=>q.modified.startLineNumber<p.modified.endLineNumberExclusive),L=Math.max(N.original.endLineNumberExclusive-p.original.endLineNumberExclusive,v.modified.endLineNumberExclusive-p.modified.endLineNumberExclusive);let E;for(E=0;E<x;E++){const q=p.original.startLineNumber-E-1,w=p.modified.startLineNumber-E-1;if(q>r.length||w>s.length||c.contains(w)||h.contains(q)||!Ss(r[q-1],s[w-1],i))break}E>0&&(h.addRange(new $(p.original.startLineNumber-E,p.original.startLineNumber)),c.addRange(new $(p.modified.startLineNumber-E,p.modified.startLineNumber)));let T;for(T=0;T<L;T++){const q=p.original.endLineNumberExclusive+T,w=p.modified.endLineNumberExclusive+T;if(q>r.length||w>s.length||c.contains(w)||h.contains(q)||!Ss(r[q-1],s[w-1],i))break}T>0&&(h.addRange(new $(p.original.endLineNumberExclusive,p.original.endLineNumberExclusive+T)),c.addRange(new $(p.modified.endLineNumberExclusive,p.modified.endLineNumberExclusive+T))),(E>0||T>0)&&(l[m]=new ae(new $(p.original.startLineNumber-E,p.original.endLineNumberExclusive+T),new $(p.modified.startLineNumber-E,p.modified.endLineNumberExclusive+T)))}return l}function Ss(t,e,n){if(t.trim()===e.trim())return!0;if(t.length>300&&e.length>300)return!1;const s=new ys().compute(new Ft([t],new C(1,1,1,t.length),!1),new Ft([e],new C(1,1,1,e.length),!1),n);let i=0;const l=O.invert(s.diffs,t.length);for(const h of l)h.seq1Range.forEach(f=>{vn(t.charCodeAt(f))||i++});function o(h){let f=0;for(let m=0;m<t.length;m++)vn(h.charCodeAt(m))||f++;return f}const u=o(t.length>e.length?t:e);return i/u>.6&&u>10}function e1(t){if(t.length===0)return t;t.sort(at(n=>n.original.startLineNumber,lt));const e=[t[0]];for(let n=1;n<t.length;n++){const r=e[e.length-1],s=t[n],i=s.original.startLineNumber-r.original.endLineNumberExclusive,l=s.modified.startLineNumber-r.modified.endLineNumberExclusive;if(i>=0&&l>=0&&i+l<=2){e[e.length-1]=r.join(s);continue}e.push(s)}return e}function t1(t,e){const n=new kt(t);return e=e.filter(r=>{const s=n.findLastMonotonous(o=>o.original.startLineNumber<r.original.endLineNumberExclusive)||new ae(new $(1,1),new $(1,1)),i=He(t,o=>o.modified.startLineNumber<r.modified.endLineNumberExclusive);return s!==i}),e}function As(t,e,n){let r=n;return r=Rs(t,e,r),r=Rs(t,e,r),r=n1(t,e,r),r}function Rs(t,e,n){if(n.length===0)return n;const r=[];r.push(n[0]);for(let i=1;i<n.length;i++){const l=r[r.length-1];let o=n[i];if(o.seq1Range.isEmpty||o.seq2Range.isEmpty){const u=o.seq1Range.start-l.seq1Range.endExclusive;let c;for(c=1;c<=u&&!(t.getElement(o.seq1Range.start-c)!==t.getElement(o.seq1Range.endExclusive-c)||e.getElement(o.seq2Range.
Line truncated
|
||||
`)}isStronglyEqual(e,n){return this.lines[e]===this.lines[n]}}function Ms(t){let e=0;for(;e<t.length&&(t.charCodeAt(e)===32||t.charCodeAt(e)===9);)e++;return e}class l1{constructor(){this.dynamicProgrammingDiffing=new ja,this.myersDiffingAlgorithm=new ys}computeDiff(e,n,r){if(e.length<=1&&Ca(e,n,(w,y)=>w===y))return new Et([],[],!1);if(e.length===1&&e[0].length===0||n.length===1&&n[0].length===0)return new Et([new xe(new $(1,e.length+1),new $(1,n.length+1),[new le(new C(1,1,e.length,e[e.length-1].length+1),new C(1,1,n.length,n[n.length-1].length+1))])],[],!1);const s=r.maxComputationTimeMs===0?ct.instance:new Ga(r.maxComputationTimeMs),i=!r.ignoreTrimWhitespace,l=new Map;function o(w){let y=l.get(w);return y===void 0&&(y=l.size,l.set(w,y)),y}const u=e.map(w=>o(w.trim())),c=n.map(w=>o(w.trim())),h=new ks(u,e),f=new ks(c,n),m=h.length+f.length<1700?this.dynamicProgrammingDiffing.compute(h,f,s,(w,y)=>e[w]===n[y]?n[y].length===0?.1:1+Math.log(1+n[y].length):.99):this.myersDiffingAlgorithm.compute(h,f,s);let p=m.diffs,b=m.hitTimeout;p=As(h,f,p),p=i1(h,f,p);const d=[],x=w=>{if(i)for(let y=0;y<w;y++){const A=N+y,D=v+y;if(e[A]!==n[D]){const V=this.refineDiff(e,n,new O(new B(A,A+1),new B(D,D+1)),s,i,r);for(const _ of V.mappings)d.push(_);V.hitTimeout&&(b=!0)}}};let N=0,v=0;for(const w of p){pt(()=>w.seq1Range.start-N===w.seq2Range.start-v);const y=w.seq1Range.start-N;x(y),N=w.seq1Range.endExclusive,v=w.seq2Range.endExclusive;const A=this.refineDiff(e,n,w,s,i,r);A.hitTimeout&&(b=!0);for(const D of A.mappings)d.push(D)}x(e.length-N);const L=new Mt(e),E=new Mt(n),T=bs(d,L,E);let q=[];return r.computeMoves&&(q=this.computeMoves(T,e,n,u,c,s,i,r)),pt(()=>{function w(A,D){if(A.lineNumber<1||A.lineNumber>D.length)return!1;const V=D[A.lineNumber-1];return!(A.column<1||A.column>V.length+1)}function y(A,D){return!(A.startLineNumber<1||A.startLineNumber>D.length+1||A.endLineNumberExclusive<1||A.endLineNumberExclusive>D.length+1)}for(const A of T){if(!A.innerChanges)return!1;for(const D of A.innerChanges)if(!(w(D.modifiedRange.getStartPosition(),n)&&w(D.modifiedRange.getEndPosition(),n)&&w(D.originalRange.getStartPosition(),e)&&w(D.originalRange.getEndPosition(),e)))return!1;if(!y(A.modified,n)||!y(A.original,e))return!1}return!0}),new Et(T,q,b)}computeMoves(e,n,r,s,i,l,o,u){return Ja(e,n,r,s,i,l).map(f=>{const m=this.refineDiff(n,r,new O(f.original.toOffsetRange(),f.modified.toOffsetRange()),l,o,u),p=bs(m.mappings,new Mt(n),new Mt(r),!0);return new Ra(f,p)})}refineDiff(e,n,r,s,i,l){const u=o1(r).toRangeMapping2(e,n),c=new Ft(e,u.originalRange,i),h=new Ft(n,u.modifiedRange,i),f=c.length+h.length<500?this.dynamicProgrammingDiffing.compute(c,h,s):this.myersDiffingAlgorithm.compute(c,h,s);let m=f.diffs;return m=As(c,h,m),m=Es(c,h,m,(b,d)=>b.findWordContaining(d)),l.extendToSubwords&&(m=Es(c,h,m,(b,d)=>b.findSubWordContaining(d),!0)),m=r1(c,h,m),m=a1(c,h,m),{mappings:m.map(b=>new le(c.translateRange(b.seq1Range),h.translateRange(b.seq2Range))),hitTimeout:f.hitTimeout}}}function o1(t){return new ae(new $(t.seq1Range.start+1,t.seq1Range.endExclusive+1),new $(t.seq2Range.start+1,t.seq2Range.endExclusive+1))}const Ps={getLegacy:()=>new $a,getDefault:()=>new l1};function Ae(t,e){const n=Math.pow(10,e);return Math.round(t*n)/n}class g{constructor(e,n,r,s=1){this._rgbaBrand=void 0,this.r=Math.min(255,Math.max(0,e))|0,this.g=Math.min(255,Math.max(0,n))|0,this.b=Math.min(255,Math.max(0,r))|0,this.a=Ae(Math.max(Math.min(1,s),0),3)}static equals(e,n){return e.r===n.r&&e.g===n.g&&e.b===n.b&&e.a===n.a}}class oe{constructor(e,n,r,s){this._hslaBrand=void 0,this.h=Math.max(Math.min(360,e),0)|0,this.s=Ae(Math.max(Math.min(1,n),0),3),this.l=Ae(Math.max(Math.min(1,r),0),3),this.a=Ae(Math.max(Math.min(1,s),0),3)}static equals(e,n){return e.h===n.h&&e.s===n.s&&e.l===n.l&&e.a===n.a}static fromRGBA(e){const n=e.r/255,r=e.g/255,s=e.b/255,i=e.a,l=Math.max(n,r,s),o=Math.min(n,r,s);let u=0,c=0;const h=(o+l)/2,f=l-o;if(f>0){switch(c=Math.min(h<=.5?f/(2*h):f/(2-2*h),1),l){case n:u=(r-s)/f+(r<s?6:0);break;case r:u=(s-n)/f+2;break;case s:u=(n-r)/f+4;break}u*=60,u=Math.round(u)}return new oe(u,c,h,i)}static _hue2rgb(e,n,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?e+(n-e)*6*r:r<1/2?n:r<2/3?e+(n-e)*(2/3-r)*6:e}static toRGBA(e){const n=e.h/360,{s:r,l:s,a:i}=e;let l,o,u;if(r===0)l=o=u=s;else{const c=s<.5?s*(1+r):s+r-s*r,h=2*s-c;l=oe._hue2rgb(h,c,n+1/3),o=oe._hue2rgb(h,c,n),u=oe._hue2rgb(h,c,n-1/3)}return new g(Math.round(l*255),Math.round(o*255),Math.round(u*255),i)}}class Xe{constructor(e,n,r,s){this._hsvaBrand=void 0,this.h=Math.max(Math.min(360,e),0)|0,this.s=Ae(Math.max(Math.min(1,n),0),3),this.v=Ae(Math.max(Math.min(1,r),0),3),this.a=Ae(Math.max(Math.min(1,s),0),3)}static equals(e,n){return e.h===n.h&&e.s===n.s&&e.v===n.v&&e.a===n.a}static fromRGBA(e){const n=e.r/255,r=e.g/255,s=e.b/255,i=Math.max(n,r,s),l=Math.min(n,r,s),o=i-l,u=i===0?0:o/i;let c;return o===0?c=0:i===n?c=((r-s)/o%6+6)%6:i===r?c=(s-n)/o+2:c=(n-r)/o+4,new Xe(Math.round(c*60),u,i,e.a)}static toRGBA(e)
Line truncated
|
||||
`);i.lastIndex=0;let h;for(;(h=i.exec(c))!==null;){const f=c.substring(0,h.index),m=(f.match(/\n/g)||[]).length,p=l+m,b=h[0].split(`
|
||||
`),d=b.length,x=p+d-1,N=f.lastIndexOf(`
|
||||
`)+1,v=h.index-N+1,L=b[b.length-1],E=d===1?v+h[0].length:L.length+1,T={startLineNumber:p,startColumn:v,endLineNumber:x,endColumn:E},q=(h.groups??{}).label??"",w=((h.groups??{}).separator??"")!=="",y={range:T,text:q,hasSeparatorLine:w,shouldBeInComments:!0};(y.text||y.hasSeparatorLine)&&(n.length===0||n[n.length-1].range.endLineNumber<y.range.startLineNumber)&&n.push(y),i.lastIndex=h.index+h[0].length}}return n}function p1(t){t=t.trim();const e=t.startsWith("-");return t=t.replace(f1,""),{text:t,hasSeparatorLine:e}}class w1{get isRejected(){return this.outcome?.outcome===1}get isSettled(){return!!this.outcome}constructor(){this.p=new Promise((e,n)=>{this.completeCallback=e,this.errorCallback=n})}complete(e){return this.isSettled?Promise.resolve():new Promise(n=>{this.completeCallback(e),this.outcome={outcome:0,value:e},n()})}error(e){return this.isSettled?Promise.resolve():new Promise(n=>{this.errorCallback(e),this.outcome={outcome:1,value:e},n()})}cancel(){return this.error(new En)}}var Is;(function(t){async function e(r){let s;const i=await Promise.all(r.map(l=>l.then(o=>o,o=>{s||(s=o)})));if(typeof s<"u")throw s;return i}t.settled=e;function n(r){return new Promise(async(s,i)=>{try{await r(s,i)}catch(l){i(l)}})}t.withAsyncBody=n})(Is||(Is={}));class x1{constructor(){this._unsatisfiedConsumers=[],this._unconsumedValues=[]}get hasFinalValue(){return!!this._finalValue}produce(e){if(this._ensureNoFinalValue(),this._unsatisfiedConsumers.length>0){const n=this._unsatisfiedConsumers.shift();this._resolveOrRejectDeferred(n,e)}else this._unconsumedValues.push(e)}produceFinal(e){this._ensureNoFinalValue(),this._finalValue=e;for(const n of this._unsatisfiedConsumers)this._resolveOrRejectDeferred(n,e);this._unsatisfiedConsumers.length=0}_ensureNoFinalValue(){if(this._finalValue)throw new Y("ProducerConsumer: cannot produce after final value has been set")}_resolveOrRejectDeferred(e,n){n.ok?e.complete(n.value):e.error(n.error)}consume(){if(this._unconsumedValues.length>0||this._finalValue){const e=this._unconsumedValues.length>0?this._unconsumedValues.shift():this._finalValue;return e.ok?Promise.resolve(e.value):Promise.reject(e.error)}else{const e=new w1;return this._unsatisfiedConsumers.push(e),e.p}}}const re=class re{constructor(e,n){this._onReturn=n,this._producerConsumer=new x1,this._iterator={next:()=>this._producerConsumer.consume(),return:()=>(this._onReturn?.(),Promise.resolve({done:!0,value:void 0})),throw:async r=>(this._finishError(r),{done:!0,value:void 0})},queueMicrotask(async()=>{const r=e({emitOne:s=>this._producerConsumer.produce({ok:!0,value:{done:!1,value:s}}),emitMany:s=>{for(const i of s)this._producerConsumer.produce({ok:!0,value:{done:!1,value:i}})},reject:s=>this._finishError(s)});if(!this._producerConsumer.hasFinalValue)try{await r,this._finishOk()}catch(s){this._finishError(s)}})}static fromArray(e){return new re(n=>{n.emitMany(e)})}static fromPromise(e){return new re(async n=>{n.emitMany(await e)})}static fromPromisesResolveOrder(e){return new re(async n=>{await Promise.all(e.map(async r=>n.emitOne(await r)))})}static merge(e){return new re(async n=>{await Promise.all(e.map(async r=>{for await(const s of r)n.emitOne(s)}))})}static map(e,n){return new re(async r=>{for await(const s of e)r.emitOne(n(s))})}map(e){return re.map(this,e)}static coalesce(e){return re.filter(e,n=>!!n)}coalesce(){return re.coalesce(this)}static filter(e,n){return new re(async r=>{for await(const s of e)n(s)&&r.emitOne(s)})}filter(e){return re.filter(this,e)}_finishOk(){this._producerConsumer.hasFinalValue||this._producerConsumer.produceFinal({ok:!0,value:{done:!0,value:void 0}})}_finishError(e){this._producerConsumer.hasFinalValue||this._producerConsumer.produceFinal({ok:!1,error:e})}[Symbol.asyncIterator](){return this._iterator}};re.EMPTY=re.fromArray([]);let Bs=re;class y1{constructor(e){this.values=e,this.prefixSum=new Uint32Array(e.length),this.prefixSumValidIndex=new Int32Array(1),this.prefixSumValidIndex[0]=-1}insertValues(e,n){e=qe(e);const r=this.values,s=this.prefixSum,i=n.length;return i===0?!1:(this.values=new Uint32Array(r.length+i),this.values.set(r.subarray(0,e),0),this.values.set(r.subarray(e),e+i),this.values.set(n,e),e-1<this.prefixSumValidIndex[0]&&(this.prefixSumValidIndex[0]=e-1),this.prefixSum=new Uint32Array(this.values.length),this.prefixSumValidIndex[0]>=0&&this.prefixSum.set(s.subarray(0,this.prefixSumValidIndex[0]+1)),!0)}setValue(e,n){return e=qe(e),n=qe(n),this.values[e]===n?!1:(this.values[e]=n,e-1<this.prefixSumValidIndex[0]&&(this.prefixSumValidIndex[0]=e-1),!0)}removeValues(e,n){e=qe(e),n=qe(n);const r=this.values,s=this.prefixSum;if(e>=r.length)return!1;const i=r.length-e;return n>=i&&(n=i),n===0?!1:(this.values=new Uint32Array(r.length-n),this.values.set(r.subarray(0,e),0),this.values.set(r.subarray(e+n),e),this.prefixSum=new Uint32Array(this.values.length),e-1<this.prefixSumValidIndex[0]&&(this.prefixSumValidIndex[0]=e-1),this.prefixSumValidIndex[0]>=0&&this.prefixSum.set(s.subar
Line truncated
|
||||
@@ -0,0 +1,470 @@
|
||||
(function(){"use strict";var Be,ce,Q;class no{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?nt.isErrorNoTelemetry(e)?new nt(e.message+`
|
||||
|
||||
`+e.stack):new Error(e.message+`
|
||||
|
||||
`+e.stack):e},0)}}emit(e){this.listeners.forEach(n=>{n(e)})}onUnexpectedError(e){this.unexpectedErrorHandler(e),this.emit(e)}onUnexpectedExternalError(e){this.unexpectedErrorHandler(e)}}const io=new no;function qt(t){ro(t)||io.onUnexpectedError(t)}function Sn(t){if(t instanceof Error){const{name:e,message:n,cause:i}=t,r=t.stacktrace||t.stack;return{$isError:!0,name:e,message:n,stack:r,noTelemetry:nt.isErrorNoTelemetry(t),cause:i?Sn(i):void 0,code:t.code}}return t}const An="Canceled";function ro(t){return t instanceof Ii?!0:t instanceof Error&&t.name===An&&t.message===An}class Ii extends Error{constructor(){super(An),this.name=this.message}}class nt extends Error{constructor(e){super(e),this.name="CodeExpectedError"}static fromError(e){if(e instanceof nt)return e;const n=new nt;return n.message=e.message,n.stack=e.stack,n}static isErrorNoTelemetry(e){return e.name==="CodeExpectedError"}}class le extends Error{constructor(e){super(e||"An unexpected bug occurred."),Object.setPrototypeOf(this,le.prototype)}}function so(t,e="Unreachable"){throw new Error(e)}function ao(t,e="unexpected state"){if(!t)throw typeof e=="string"?new le(`Assertion Failed: ${e}`):e}function Ot(t){if(!t()){debugger;t(),qt(new le("Assertion Failed"))}}function zi(t,e){let n=0;for(;n<t.length-1;){const i=t[n],r=t[n+1];if(!e(i,r))return!1;n++}return!0}function oo(t){return typeof t=="string"}function lo(t){return!!t&&typeof t[Symbol.iterator]=="function"}var Vt;(function(t){function e(b){return!!b&&typeof b=="object"&&typeof b[Symbol.iterator]=="function"}t.is=e;const n=Object.freeze([]);function i(){return n}t.empty=i;function*r(b){yield b}t.single=r;function s(b){return e(b)?b:r(b)}t.wrap=s;function a(b){return b||n}t.from=a;function*l(b){for(let g=b.length-1;g>=0;g--)yield b[g]}t.reverse=l;function o(b){return!b||b[Symbol.iterator]().next().done===!0}t.isEmpty=o;function u(b){return b[Symbol.iterator]().next().value}t.first=u;function c(b,g){let v=0;for(const N of b)if(g(N,v++))return!0;return!1}t.some=c;function d(b,g){let v=0;for(const N of b)if(!g(N,v++))return!1;return!0}t.every=d;function m(b,g){for(const v of b)if(g(v))return v}t.find=m;function*f(b,g){for(const v of b)g(v)&&(yield v)}t.filter=f;function*w(b,g){let v=0;for(const N of b)yield g(N,v++)}t.map=w;function*p(b,g){let v=0;for(const N of b)yield*g(N,v++)}t.flatMap=p;function*x(...b){for(const g of b)lo(g)?yield*g:yield g}t.concat=x;function T(b,g,v){let N=v;for(const S of b)N=g(N,S);return N}t.reduce=T;function y(b){let g=0;for(const v of b)g++;return g}t.length=y;function*A(b,g,v=b.length){for(g<-b.length&&(g=0),g<0&&(g+=b.length),v<0?v+=b.length:v>b.length&&(v=b.length);g<v;g++)yield b[g]}t.slice=A;function I(b,g=Number.POSITIVE_INFINITY){const v=[];if(g===0)return[v,b];const N=b[Symbol.iterator]();for(let S=0;S<g;S++){const _=N.next();if(_.done)return[v,t.empty()];v.push(_.value)}return[v,{[Symbol.iterator](){return N}}]}t.consume=I;async function H(b){const g=[];for await(const v of b)g.push(v);return g}t.asyncToArray=H;async function P(b){let g=[];for await(const v of b)g=g.concat(v);return g}t.asyncToArrayFlat=P})(Vt||(Vt={}));function sh(t,e){}function Hi(t){if(Vt.is(t)){const e=[];for(const n of t)if(n)try{n.dispose()}catch(i){e.push(i)}if(e.length===1)throw e[0];if(e.length>1)throw new AggregateError(e,"Encountered errors while disposing of store");return Array.isArray(t)?[]:t}else if(t)return t.dispose(),t}function uo(...t){return jt(()=>Hi(t))}class co{constructor(e){this._isDisposed=!1,this._fn=e}dispose(){if(!this._isDisposed){if(!this._fn)throw new Error("Unbound disposable context: Need to use an arrow function to preserve the value of this");this._isDisposed=!0,this._fn()}}}function jt(t){return new co(t)}const _n=class _n{constructor(){this._toDispose=new Set,this._isDisposed=!1}dispose(){this._isDisposed||(this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(this._toDispose.size!==0)try{Hi(this._toDispose)}finally{this._toDispose.clear()}}add(e){if(!e||e===Xe.None)return e;if(e===this)throw new Error("Cannot register a disposable on itself!");return this._isDisposed?_n.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(e),e}delete(e){if(e){if(e===this)throw new Error("Cannot dispose a disposable on itself!");this._toDispose.delete(e),e.dispose()}}};_n.DISABLE_DISPOSED_WARNING=!1;let xt=_n;const Mi=class Mi{constructor(){this._store=new xt,this._store}dispose(){this._store.dispose()}_register(e){if(e===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(e)}};Mi.None=Object.freeze({dispose(){}});let Xe=Mi,te=(Be=class{constructor(e){this.element=e,this.next=Be.Undefined,this.prev=Be.Undefined}},Be.Undefined=new Be(void 0),Be);class ho{constructor(){this._first=te.Undefined,this._last=te.Undefined,this._size=0}get size(){return this._size}isEmpty(){
Line truncated
|
||||
`).slice(2).join(`
|
||||
`))}}class po extends Error{constructor(e,n){super(e),this.name="ListenerLeakError",this.stack=n}}class go extends Error{constructor(e,n){super(e),this.name="ListenerRefusalError",this.stack=n}}class Dn{constructor(e){this.value=e}}const bo=2;class Ee{constructor(e){this._size=0,this._options=e,this._leakageMon=this._options?.leakWarningThreshold?new En(e?.onListenerError??qt,this._options?.leakWarningThreshold??fo):void 0,this._perfMon=this._options?._profName?new Cn(this._options._profName):void 0,this._deliveryQueue=this._options?.deliveryQueue}dispose(){this._disposed||(this._disposed=!0,this._deliveryQueue?.current===this&&this._deliveryQueue.reset(),this._listeners&&(this._listeners=void 0,this._size=0),this._options?.onDidRemoveLastListener?.(),this._leakageMon?.dispose())}get event(){return this._event??=(e,n,i)=>{if(this._leakageMon&&this._size>this._leakageMon.threshold**2){const l=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(l);const o=this._leakageMon.getMostFrequentStack()??["UNKNOWN stack",-1],u=new go(`${l}. HINT: Stack shows most frequent listener (${o[1]}-times)`,o[0]);return(this._options?.onListenerError||qt)(u),Xe.None}if(this._disposed)return Xe.None;n&&(e=e.bind(n));const r=new Dn(e);let s;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(r.stack=Rn.create(),s=this._leakageMon.check(r.stack,this._size+1)),this._listeners?this._listeners instanceof Dn?(this._deliveryQueue??=new wo,this._listeners=[this._listeners,r]):this._listeners.push(r):(this._options?.onWillAddFirstListener?.(this),this._listeners=r,this._options?.onDidAddFirstListener?.(this)),this._options?.onDidAddListener?.(this),this._size++;const a=jt(()=>{s?.(),this._removeListener(r)});return i instanceof xt?i.add(a):Array.isArray(i)&&i.push(a),a},this._event}_removeListener(e){if(this._options?.onWillRemoveListener?.(this),!this._listeners)return;if(this._size===1){this._listeners=void 0,this._options?.onDidRemoveLastListener?.(this),this._size=0;return}const n=this._listeners,i=n.indexOf(e);if(i===-1)throw console.log("disposed?",this._disposed),console.log("size?",this._size),console.log("arr?",JSON.stringify(this._listeners)),new Error("Attempted to dispose unknown listener");this._size--,n[i]=void 0;const r=this._deliveryQueue.current===this;if(this._size*bo<=n.length){let s=0;for(let a=0;a<n.length;a++)n[a]?n[s++]=n[a]:r&&s<this._deliveryQueue.end&&(this._deliveryQueue.end--,s<this._deliveryQueue.i&&this._deliveryQueue.i--);n.length=s}}_deliver(e,n){if(!e)return;const i=this._options?.onListenerError||qt;if(!i){e.value(n);return}try{e.value(n)}catch(r){i(r)}}_deliverQueue(e){const n=e.current._listeners;for(;e.i<e.end;)this._deliver(n[e.i++],e.value);e.reset()}fire(e){if(this._deliveryQueue?.current&&(this._deliverQueue(this._deliveryQueue),this._perfMon?.stop()),this._perfMon?.start(this._size),this._listeners)if(this._listeners instanceof Dn)this._deliver(this._listeners,e);else{const n=this._deliveryQueue;n.enqueue(this,e,this._listeners.length),this._deliverQueue(n)}this._perfMon?.stop()}hasListeners(){return this._size>0}}class wo{constructor(){this.i=-1,this.end=0}enqueue(e,n,i){this.i=0,this.end=i,this.current=e,this.value=n}reset(){this.i=this.end,this.current=void 0,this.value=void 0}}function _o(){return globalThis._VSCODE_NLS_MESSAGES}function Ui(){return globalThis._VSCODE_NLS_LANGUAGE}const vo=Ui()==="pseudo"||typeof document<"u"&&document.location&&typeof document.location.hash=="string"&&document.location.hash.indexOf("pseudo=true")>=0;function Pi(t,e){let n;return e.length===0?n=t:n=t.replace(/\{(\d+)\}/g,(i,r)=>{const s=r[0],a=e[s];let l=i;return typeof a=="string"?l=a:(typeof a=="number"||typeof a=="boolean"||a===void 0||a===null)&&(l=String(a)),l}),vo&&(n="["+n.replace(/[aouei]/g,"$&$&")+"]"),n}function q(t,e,...n){return Pi(typeof t=="number"?yo(t,e):e,n)}function yo(t,e){const n=_o()?.[t];if(typeof n!="string"){if(typeof e=="string")return e;throw new Error(`!!! NLS MISSING: ${t} !!!`)}return n}const it="en";let Mn=!1,Nn=!1,In=!1,Gt,zn=it,Wi=it,To,Ie;const Je=globalThis;let he;typeof Je.vscode<"u"&&typeof Je.vscode.process<"u"?he=Je.vscode.process:typeof process<"u"&&typeof process?.versions?.node=="string"&&(he=process);const xo=typeof he?.versions?.electron=="string"&&he?.type==="renderer";if(typeof he=="object"){Mn=he.platform==="win32",Nn=he.platform==="darwin",In=he.platform==="linux",In&&he.env.SNAP&&he.env.SNAP_REVISION,he.env.CI||he.env.BUILD_ARTIFACTSTAGINGDIRECTORY||he.env.GITHUB_WORKSPACE,Gt=it,zn=it;const t=he.env.VSCODE_NLS_CONFIG;if(t)try{const e=JSON.parse(t);Gt=e.userLocale,Wi=e.osLocale,zn=e.resolvedLanguage||it,To=e.languagePack?.translationsConfigFile}catch{}}else typeof navigator=="object"&&!xo?(Ie=navigator.userAgent,Mn=Ie.indexOf("Windows")>=0,Nn=Ie.indexOf("Macintosh")>=0,(Ie.indexOf("Macintosh")>=0||Ie.indexOf("iPad")>=0||Ie.inde
Line truncated
|
||||
`||t===" "}class tn{constructor(e,n,i){this.changes=e,this.moves=n,this.hitTimeout=i}}class jl{constructor(e,n){this.lineRangeMapping=e,this.changes=n}}function $l(t,e,n=(i,r)=>i===r){if(t===e)return!0;if(!t||!e||t.length!==e.length)return!1;for(let i=0,r=t.length;i<r;i++)if(!n(t[i],e[i]))return!1;return!0}function*Gl(t,e){let n,i;for(const r of t)i!==void 0&&e(i,r)?n.push(r):(n&&(yield n),n=[r]),i=r;n&&(yield n)}function Xl(t,e){for(let n=0;n<=t.length;n++)e(n===0?void 0:t[n-1],n===t.length?void 0:t[n])}function Jl(t,e){for(let n=0;n<t.length;n++)e(n===0?void 0:t[n-1],t[n],n+1===t.length?void 0:t[n+1])}function Ql(t,e){for(const n of e)t.push(n)}var ni;(function(t){function e(s){return s<0}t.isLessThan=e;function n(s){return s<=0}t.isLessThanOrEqual=n;function i(s){return s>0}t.isGreaterThan=i;function r(s){return s===0}t.isNeitherLessOrGreaterThan=r,t.greaterThan=1,t.lessThan=-1,t.neitherLessOrGreaterThan=0})(ni||(ni={}));function Ct(t,e){return(n,i)=>e(t(n),t(i))}const Et=(t,e)=>t-e;function Yl(t){return(e,n)=>-t(e,n)}const Tt=class Tt{constructor(e){this.iterate=e}toArray(){const e=[];return this.iterate(n=>(e.push(n),!0)),e}filter(e){return new Tt(n=>this.iterate(i=>e(i)?n(i):!0))}map(e){return new Tt(n=>this.iterate(i=>n(e(i))))}findLast(e){let n;return this.iterate(i=>(e(i)&&(n=i),!0)),n}findLastMaxBy(e){let n,i=!0;return this.iterate(r=>((i||ni.isGreaterThan(e(r,n)))&&(i=!1,n=r),!0)),n}};Tt.empty=new Tt(e=>{});let ws=Tt;class G{static fromTo(e,n){return new G(e,n)}static addRange(e,n){let i=0;for(;i<n.length&&n[i].endExclusive<e.start;)i++;let r=i;for(;r<n.length&&n[r].start<=e.endExclusive;)r++;if(i===r)n.splice(i,0,e);else{const s=Math.min(e.start,n[i].start),a=Math.max(e.endExclusive,n[r-1].endExclusive);n.splice(i,r-i,new G(s,a))}}static tryCreate(e,n){if(!(e>n))return new G(e,n)}static ofLength(e){return new G(0,e)}static ofStartAndLength(e,n){return new G(e,e+n)}static emptyAt(e){return new G(e,e)}constructor(e,n){if(this.start=e,this.endExclusive=n,e>n)throw new le(`Invalid range: ${this.toString()}`)}get isEmpty(){return this.start===this.endExclusive}delta(e){return new G(this.start+e,this.endExclusive+e)}deltaStart(e){return new G(this.start+e,this.endExclusive)}deltaEnd(e){return new G(this.start,this.endExclusive+e)}get length(){return this.endExclusive-this.start}toString(){return`[${this.start}, ${this.endExclusive})`}equals(e){return this.start===e.start&&this.endExclusive===e.endExclusive}contains(e){return this.start<=e&&e<this.endExclusive}join(e){return new G(Math.min(this.start,e.start),Math.max(this.endExclusive,e.endExclusive))}intersect(e){const n=Math.max(this.start,e.start),i=Math.min(this.endExclusive,e.endExclusive);if(n<=i)return new G(n,i)}intersectionLength(e){const n=Math.max(this.start,e.start),i=Math.min(this.endExclusive,e.endExclusive);return Math.max(0,i-n)}intersects(e){const n=Math.max(this.start,e.start),i=Math.min(this.endExclusive,e.endExclusive);return n<i}intersectsOrTouches(e){const n=Math.max(this.start,e.start),i=Math.min(this.endExclusive,e.endExclusive);return n<=i}isBefore(e){return this.endExclusive<=e.start}isAfter(e){return this.start>=e.endExclusive}slice(e){return e.slice(this.start,this.endExclusive)}substring(e){return e.substring(this.start,this.endExclusive)}clip(e){if(this.isEmpty)throw new le(`Invalid clipping range: ${this.toString()}`);return Math.max(this.start,Math.min(this.endExclusive-1,e))}clipCyclic(e){if(this.isEmpty)throw new le(`Invalid clipping range: ${this.toString()}`);return e<this.start?this.endExclusive-(this.start-e)%this.length:e>=this.endExclusive?this.start+(e-this.start)%this.length:e}forEach(e){for(let n=this.start;n<this.endExclusive;n++)e(n)}joinRightTouching(e){if(this.endExclusive!==e.start)throw new le(`Invalid join: ${this.toString()} and ${e.toString()}`);return new G(this.start,e.endExclusive)}}function ut(t,e){const n=ct(t,e);return n===-1?void 0:t[n]}function ct(t,e,n=0,i=t.length){let r=n,s=i;for(;r<s;){const a=Math.floor((r+s)/2);e(t[a])?r=a+1:s=a}return r-1}function Zl(t,e){const n=ii(t,e);return n===t.length?void 0:t[n]}function ii(t,e,n=0,i=t.length){let r=n,s=i;for(;r<s;){const a=Math.floor((r+s)/2);e(t[a])?s=a:r=a+1}return r}const Tn=class Tn{constructor(e){this._array=e,this._findLastMonotonousLastIdx=0}findLastMonotonous(e){if(Tn.assertInvariants){if(this._prevFindLastPredicate){for(const i of this._array)if(this._prevFindLastPredicate(i)&&!e(i))throw new Error("MonotonousArray: current predicate must be weaker than (or equal to) the previous predicate.")}this._prevFindLastPredicate=e}const n=ct(this._array,e,this._findLastMonotonousLastIdx);return this._findLastMonotonousLastIdx=n+1,n===-1?void 0:this._array[n]}};Tn.assertInvariants=!1;let nn=Tn;const _e=class _e{static ofLength(e,n){return new _e(e,e+n)}static fromRange(e){return new _e(e.startLineNumber,e.endLineNumber)}static fromRangeInclusive(e){return new _e(e.startLineNumber,e.endLineNumber+1)}static joinMany(e){if(e.length===0)return[];le
Line truncated
|
||||
`?(n++,i=0):i++;return new Le(n,i)}constructor(e,n){this.lineCount=e,this.columnCount=n}isGreaterThanOrEqualTo(e){return this.lineCount!==e.lineCount?this.lineCount>e.lineCount:this.columnCount>=e.columnCount}add(e){return e.lineCount===0?new Le(this.lineCount,this.columnCount+e.columnCount):new Le(this.lineCount+e.lineCount,e.columnCount)}createRange(e){return this.lineCount===0?new j(e.lineNumber,e.column,e.lineNumber,e.column+this.columnCount):new j(e.lineNumber,e.column,e.lineNumber+this.lineCount,this.columnCount+1)}toRange(){return new j(1,1,this.lineCount+1,this.columnCount+1)}toLineRange(){return X.ofLength(1,this.lineCount+1)}addToPosition(e){return this.lineCount===0?new K(e.lineNumber,e.column+this.columnCount):new K(e.lineNumber+this.lineCount,this.columnCount+1)}toString(){return`${this.lineCount},${this.columnCount}`}};Le.zero=new Le(0,0);let Rt=Le;class Kl{getOffsetRange(e){return new G(this.getOffset(e.getStartPosition()),this.getOffset(e.getEndPosition()))}getRange(e){return j.fromPositions(this.getPosition(e.start),this.getPosition(e.endExclusive))}getStringReplacement(e){return new ht.deps.StringReplacement(this.getOffsetRange(e.range),e.text)}getTextReplacement(e){return new ht.deps.TextReplacement(this.getRange(e.replaceRange),e.newText)}getTextEdit(e){const n=e.replacements.map(i=>this.getTextReplacement(i));return new ht.deps.TextEdit(n)}}const Ni=class Ni{static get deps(){if(!this._deps)throw new Error("Dependencies not set. Call _setDependencies first.");return this._deps}};Ni._deps=void 0;let ht=Ni;class eu extends Kl{constructor(e){super(),this.text=e,this.lineStartOffsetByLineIdx=[],this.lineEndOffsetByLineIdx=[],this.lineStartOffsetByLineIdx.push(0);for(let n=0;n<e.length;n++)e.charAt(n)===`
|
||||
`&&(this.lineStartOffsetByLineIdx.push(n+1),n>0&&e.charAt(n-1)==="\r"?this.lineEndOffsetByLineIdx.push(n-1):this.lineEndOffsetByLineIdx.push(n));this.lineEndOffsetByLineIdx.push(e.length)}getOffset(e){const n=this._validatePosition(e);return this.lineStartOffsetByLineIdx[n.lineNumber-1]+n.column-1}_validatePosition(e){if(e.lineNumber<1)return new K(1,1);const n=this.textLength.lineCount+1;if(e.lineNumber>n){const r=this.getLineLength(n);return new K(n,r+1)}if(e.column<1)return new K(e.lineNumber,1);const i=this.getLineLength(e.lineNumber);return e.column-1>i?new K(e.lineNumber,i+1):e}getPosition(e){const n=ct(this.lineStartOffsetByLineIdx,s=>s<=e),i=n+1,r=e-this.lineStartOffsetByLineIdx[n]+1;return new K(i,r)}get textLength(){const e=this.lineStartOffsetByLineIdx.length-1;return new ht.deps.TextLength(e,this.text.length-this.lineStartOffsetByLineIdx[e])}getLineLength(e){return this.lineEndOffsetByLineIdx[e-1]-this.lineStartOffsetByLineIdx[e-1]}}class tu{constructor(){this._transformer=void 0}get endPositionExclusive(){return this.length.addToPosition(new K(1,1))}get lineRange(){return this.length.toLineRange()}getValue(){return this.getValueOfRange(this.length.toRange())}getValueOfOffsetRange(e){return this.getValueOfRange(this.getTransformer().getRange(e))}getLineLength(e){return this.getValueOfRange(new j(e,1,e,Number.MAX_SAFE_INTEGER)).length}getTransformer(){return this._transformer||(this._transformer=new eu(this.getValue())),this._transformer}getLineAt(e){return this.getValueOfRange(new j(e,1,e,Number.MAX_SAFE_INTEGER))}}class nu extends tu{constructor(e,n){ao(n>=1),super(),this._getLineContent=e,this._lineCount=n}getValueOfRange(e){if(e.startLineNumber===e.endLineNumber)return this._getLineContent(e.startLineNumber).substring(e.startColumn-1,e.endColumn-1);let n=this._getLineContent(e.startLineNumber).substring(e.startColumn-1);for(let i=e.startLineNumber+1;i<e.endLineNumber;i++)n+=`
|
||||
`+this._getLineContent(i);return n+=`
|
||||
`+this._getLineContent(e.endLineNumber).substring(0,e.endColumn-1),n}getLineLength(e){return this._getLineContent(e).length}get length(){const e=this._getLineContent(this._lineCount);return new Rt(this._lineCount-1,e.length)}}class rn extends nu{constructor(e){super(n=>e[n-1],e.length)}}class je{static joinReplacements(e,n){if(e.length===0)throw new le;if(e.length===1)return e[0];const i=e[0].range.getStartPosition(),r=e[e.length-1].range.getEndPosition();let s="";for(let a=0;a<e.length;a++){const l=e[a];if(s+=l.text,a<e.length-1){const o=e[a+1],u=j.fromPositions(l.range.getEndPosition(),o.range.getStartPosition()),c=n.getValueOfRange(u);s+=c}}return new je(j.fromPositions(i,r),s)}static fromStringReplacement(e,n){return new je(n.getTransformer().getRange(e.replaceRange),e.newText)}static delete(e){return new je(e,"")}constructor(e,n){this.range=e,this.text=n}get isEmpty(){return this.range.isEmpty()&&this.text.length===0}static equals(e,n){return e.range.equalsRange(n.range)&&e.text===n.text}equals(e){return je.equals(this,e)}removeCommonPrefixAndSuffix(e){return this.removeCommonPrefix(e).removeCommonSuffix(e)}removeCommonPrefix(e){const n=e.getValueOfRange(this.range).replaceAll(`\r
|
||||
`,`
|
||||
`),i=this.text.replaceAll(`\r
|
||||
`,`
|
||||
`),r=Io(n,i),s=Rt.ofText(n.substring(0,r)).addToPosition(this.range.getStartPosition()),a=i.substring(r),l=j.fromPositions(s,this.range.getEndPosition());return new je(l,a)}removeCommonSuffix(e){const n=e.getValueOfRange(this.range).replaceAll(`\r
|
||||
`,`
|
||||
`),i=this.text.replaceAll(`\r
|
||||
`,`
|
||||
`),r=zo(n,i),s=Rt.ofText(n.substring(0,n.length-r)).addToPosition(this.range.getStartPosition()),a=i.substring(0,i.length-r),l=j.fromPositions(this.range.getStartPosition(),s);return new je(l,a)}toString(){const e=this.range.getStartPosition(),n=this.range.getEndPosition();return`(${e.lineNumber},${e.column} -> ${n.lineNumber},${n.column}): "${this.text}"`}}class ve{static inverse(e,n,i){const r=[];let s=1,a=1;for(const o of e){const u=new ve(new X(s,o.original.startLineNumber),new X(a,o.modified.startLineNumber));u.modified.isEmpty||r.push(u),s=o.original.endLineNumberExclusive,a=o.modified.endLineNumberExclusive}const l=new ve(new X(s,n+1),new X(a,i+1));return l.modified.isEmpty||r.push(l),r}static clip(e,n,i){const r=[];for(const s of e){const a=s.original.intersect(n),l=s.modified.intersect(i);a&&!a.isEmpty&&l&&!l.isEmpty&&r.push(new ve(a,l))}return r}constructor(e,n){this.original=e,this.modified=n}toString(){return`{${this.original.toString()}->${this.modified.toString()}}`}flip(){return new ve(this.modified,this.original)}join(e){return new ve(this.original.join(e.original),this.modified.join(e.modified))}toRangeMapping(){const e=this.original.toInclusiveRange(),n=this.modified.toInclusiveRange();if(e&&n)return new ye(e,n);if(this.original.startLineNumber===1||this.modified.startLineNumber===1){if(!(this.modified.startLineNumber===1&&this.original.startLineNumber===1))throw new le("not a valid diff");return new ye(new j(this.original.startLineNumber,1,this.original.endLineNumberExclusive,1),new j(this.modified.startLineNumber,1,this.modified.endLineNumberExclusive,1))}else return new ye(new j(this.original.startLineNumber-1,Number.MAX_SAFE_INTEGER,this.original.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),new j(this.modified.startLineNumber-1,Number.MAX_SAFE_INTEGER,this.modified.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER))}toRangeMapping2(e,n){if(_s(this.original.endLineNumberExclusive,e)&&_s(this.modified.endLineNumberExclusive,n))return new ye(new j(this.original.startLineNumber,1,this.original.endLineNumberExclusive,1),new j(this.modified.startLineNumber,1,this.modified.endLineNumberExclusive,1));if(!this.original.isEmpty&&!this.modified.isEmpty)return new ye(j.fromPositions(new K(this.original.startLineNumber,1),dt(new K(this.original.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),e)),j.fromPositions(new K(this.modified.startLineNumber,1),dt(new K(this.modified.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),n)));if(this.original.startLineNumber>1&&this.modified.startLineNumber>1)return new ye(j.fromPositions(dt(new K(this.original.startLineNumber-1,Number.MAX_SAFE_INTEGER),e),dt(new K(this.original.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),e)),j.fromPositions(dt(new K(this.modified.startLineNumber-1,Number.MAX_SAFE_INTEGER),n),dt(new K(this.modified.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),n)));throw new le}}function dt(t,e){if(t.lineNumber<1)return new K(1,1);if(t.lineNumber>e.length)return new K(e.length,e[e.length-1].length+1);const n=e[t.lineNumber-1];return t.column>n.length+1?new K(t.lineNumber,n.length+1):t}function _s(t,e){return t>=1&&t<=e.length}class Ue extends ve{static fromRangeMappings(e){const n=X.join(e.map(r=>X.fromRangeInclusive(r.originalRange))),i=X.join(e.map(r=>X.fromRangeInclusive(r.modifiedRange)));return new Ue(n,i,e)}constructor(e,n,i){super(e,n),this.innerChanges=i}flip(){return new Ue(this.modified,this.original,this.innerChanges?.map(e=>e.flip()))}withInnerChangesFromLineRanges(){return new Ue(this.original,this.modified,[this.toRangeMapping()])}}class ye{static fromEdit(e){const n=e.getNewRanges();return e.replacements.map((r,s)=>new ye(r.range,n[s]))}static assertSorted(e){for(let n=1;n<e.length;n++){const i=e[n-1],r=e[n];if(!(i.originalRange.getEndPosition().isBeforeOrEqual(r.originalRange.getStartPosition())&&i.modifiedRange.getEndPosition().isBeforeOrEqual(r.modifiedRange.getStartPosition())))throw new le("Range mappings must be sorted")}}constructor(e,n){this.originalRange=e,this.modifiedRange=n}toString(){return`{${this.originalRange.toString()}->${this.modifiedRange.toString()}}`}flip(){return new ye(this.modifiedRange,this.originalRange)}toTextEdit(e){const n=e.getValueOfRange(this.modifiedRange);return new je(this.originalRange,n)}}function vs(t,e,n,i=!1){const r=[];for(const s of Gl(t.map(a=>iu(a,e,n)),(a,l)=>a.original.intersectsOrTouches(l.original)||a.modified.intersectsOrTouches(l.modified))){const a=s[0],l=s[s.length-1];r.push(new Ue(a.original.join(l.original),a.modified.join(l.modified),s.map(o=>o.innerChanges[0])))}return Ot(()=>!i&&r.length>0&&(r[0].modified.startLineNumber!==r[0].original.startLineNumber||n.length.lineCount-r[r.length-1].modified.endLineNumberExclusive!==e.length.lineCount-r[r.length-1].original.endLineNumberExclusive)?!1:zi(r,(s,a)=>a.original.startLineNumber-s.original.endLineNumberExclusive===a.modified.startLineNumber-s.modified.endLineNumberExclusive&&s.original.endLineNumberExclusive<a.ori
Line truncated
|
||||
`);this.histogram[l]=(this.histogram[l]||0)+1}this.totalCount=r}computeSimilarity(e){let n=0;const i=Math.max(this.histogram.length,e.histogram.length);for(let r=0;r<i;r++)n+=Math.abs((this.histogram[r]??0)-(e.histogram[r]??0));return 1-n/(this.totalCount+e.totalCount)}};Ft.chrKeys=new Map;let sn=Ft;class cu{compute(e,n,i=Mt.instance,r){if(e.length===0||n.length===0)return Pe.trivial(e,n);const s=new ai(e.length,n.length),a=new ai(e.length,n.length),l=new ai(e.length,n.length);for(let w=0;w<e.length;w++)for(let p=0;p<n.length;p++){if(!i.isValid())return Pe.trivialTimedOut(e,n);const x=w===0?0:s.get(w-1,p),T=p===0?0:s.get(w,p-1);let y;e.getElement(w)===n.getElement(p)?(w===0||p===0?y=0:y=s.get(w-1,p-1),w>0&&p>0&&a.get(w-1,p-1)===3&&(y+=l.get(w-1,p-1)),y+=r?r(w,p):1):y=-1;const A=Math.max(x,T,y);if(A===y){const I=w>0&&p>0?l.get(w-1,p-1):0;l.set(w,p,I+1),a.set(w,p,3)}else A===x?(l.set(w,p,0),a.set(w,p,1)):A===T&&(l.set(w,p,0),a.set(w,p,2));s.set(w,p,A)}const o=[];let u=e.length,c=n.length;function d(w,p){(w+1!==u||p+1!==c)&&o.push(new ne(new G(w+1,u),new G(p+1,c))),u=w,c=p}let m=e.length-1,f=n.length-1;for(;m>=0&&f>=0;)a.get(m,f)===3?(d(m,f),m--,f--):a.get(m,f)===1?m--:f--;return d(-1,-1),o.reverse(),new Pe(o,!1)}}class ks{compute(e,n,i=Mt.instance){if(e.length===0||n.length===0)return Pe.trivial(e,n);const r=e,s=n;function a(p,x){for(;p<r.length&&x<s.length&&r.getElement(p)===s.getElement(x);)p++,x++;return p}let l=0;const o=new hu;o.set(0,a(0,0));const u=new du;u.set(0,o.get(0)===0?null:new Ss(null,0,0,o.get(0)));let c=0;e:for(;;){if(l++,!i.isValid())return Pe.trivialTimedOut(r,s);const p=-Math.min(l,s.length+l%2),x=Math.min(l,r.length+l%2);for(c=p;c<=x;c+=2){const T=c===x?-1:o.get(c+1),y=c===p?-1:o.get(c-1)+1,A=Math.min(Math.max(T,y),r.length),I=A-c;if(A>r.length||I>s.length)continue;const H=a(A,I);o.set(c,H);const P=A===T?u.get(c+1):u.get(c-1);if(u.set(c,H!==A?new Ss(P,A,I,H-A):P),o.get(c)===r.length&&o.get(c)-c===s.length)break e}}let d=u.get(c);const m=[];let f=r.length,w=s.length;for(;;){const p=d?d.x+d.length:0,x=d?d.y+d.length:0;if((p!==f||x!==w)&&m.push(new ne(new G(p,f),new G(x,w))),!d)break;f=d.x,w=d.y,d=d.prev}return m.reverse(),new Pe(m,!1)}}class Ss{constructor(e,n,i,r){this.prev=e,this.x=n,this.y=i,this.length=r}}class hu{constructor(){this.positiveArr=new Int32Array(10),this.negativeArr=new Int32Array(10)}get(e){return e<0?(e=-e-1,this.negativeArr[e]):this.positiveArr[e]}set(e,n){if(e<0){if(e=-e-1,e>=this.negativeArr.length){const i=this.negativeArr;this.negativeArr=new Int32Array(i.length*2),this.negativeArr.set(i)}this.negativeArr[e]=n}else{if(e>=this.positiveArr.length){const i=this.positiveArr;this.positiveArr=new Int32Array(i.length*2),this.positiveArr.set(i)}this.positiveArr[e]=n}}}class du{constructor(){this.positiveArr=[],this.negativeArr=[]}get(e){return e<0?(e=-e-1,this.negativeArr[e]):this.positiveArr[e]}set(e,n){e<0?(e=-e-1,this.negativeArr[e]=n):this.positiveArr[e]=n}}class an{constructor(e,n,i){this.lines=e,this.range=n,this.considerWhitespaceChanges=i,this.elements=[],this.firstElementOffsetByLineIdx=[],this.lineStartOffsets=[],this.trimmedWsLengthsByLineIdx=[],this.firstElementOffsetByLineIdx.push(0);for(let r=this.range.startLineNumber;r<=this.range.endLineNumber;r++){let s=e[r-1],a=0;r===this.range.startLineNumber&&this.range.startColumn>1&&(a=this.range.startColumn-1,s=s.substring(a)),this.lineStartOffsets.push(a);let l=0;if(!i){const u=s.trimStart();l=s.length-u.length,s=u.trimEnd()}this.trimmedWsLengthsByLineIdx.push(l);const o=r===this.range.endLineNumber?Math.min(this.range.endColumn-1-a-l,s.length):s.length;for(let u=0;u<o;u++)this.elements.push(s.charCodeAt(u));r<this.range.endLineNumber&&(this.elements.push(10),this.firstElementOffsetByLineIdx.push(this.elements.length))}}toString(){return`Slice: "${this.text}"`}get text(){return this.getText(new G(0,this.length))}getText(e){return this.elements.slice(e.start,e.endExclusive).map(n=>String.fromCharCode(n)).join("")}getElement(e){return this.elements[e]}get length(){return this.elements.length}getBoundaryScore(e){const n=Cs(e>0?this.elements[e-1]:-1),i=Cs(e<this.elements.length?this.elements[e]:-1);if(n===7&&i===8)return 0;if(n===8)return 150;let r=0;return n!==i&&(r+=10,n===0&&i===1&&(r+=1)),r+=Ls(n),r+=Ls(i),r}translateOffset(e,n="right"){const i=ct(this.firstElementOffsetByLineIdx,s=>s<=e),r=e-this.firstElementOffsetByLineIdx[i];return new K(this.range.startLineNumber+i,1+this.lineStartOffsets[i]+r+(r===0&&n==="left"?0:this.trimmedWsLengthsByLineIdx[i]))}translateRange(e){const n=this.translateOffset(e.start,"right"),i=this.translateOffset(e.endExclusive,"left");return i.isBefore(n)?j.fromPositions(i,i):j.fromPositions(n,i)}findWordContaining(e){if(e<0||e>=this.elements.length||!ft(this.elements[e]))return;let n=e;for(;n>0&&ft(this.elements[n-1]);)n--;let i=e;for(;i<this.elements.length&&ft(this.elements[i]);)i++;return new G(n,i)}findSubWordContaining(e){if(e<0||e>=this.elements.length||!ft(this.elements[e]))return
Line truncated
|
||||
`).length>=15&&pu(d,f=>f.length>=2)>=2}),a=_u(t,a),a}function pu(t,e){let n=0;for(const i of t)e(i)&&n++;return n}function gu(t,e,n,i){const r=[],s=t.filter(o=>o.modified.isEmpty&&o.original.length>=3).map(o=>new sn(o.original,e,o)),a=new Set(t.filter(o=>o.original.isEmpty&&o.modified.length>=3).map(o=>new sn(o.modified,n,o))),l=new Set;for(const o of s){let u=-1,c;for(const d of a){const m=o.computeSimilarity(d);m>u&&(u=m,c=d)}if(u>.9&&c&&(a.delete(c),r.push(new ve(o.range,c.range)),l.add(o.source),l.add(c.source)),!i.isValid())return{moves:r,excludedChanges:l}}return{moves:r,excludedChanges:l}}function bu(t,e,n,i,r,s){const a=[],l=new Il;for(const m of t)for(let f=m.original.startLineNumber;f<m.original.endLineNumberExclusive-2;f++){const w=`${e[f-1]}:${e[f+1-1]}:${e[f+2-1]}`;l.add(w,{range:new X(f,f+3)})}const o=[];t.sort(Ct(m=>m.modified.startLineNumber,Et));for(const m of t){let f=[];for(let w=m.modified.startLineNumber;w<m.modified.endLineNumberExclusive-2;w++){const p=`${n[w-1]}:${n[w+1-1]}:${n[w+2-1]}`,x=new X(w,w+3),T=[];l.forEach(p,({range:y})=>{for(const I of f)if(I.originalLineRange.endLineNumberExclusive+1===y.endLineNumberExclusive&&I.modifiedLineRange.endLineNumberExclusive+1===x.endLineNumberExclusive){I.originalLineRange=new X(I.originalLineRange.startLineNumber,y.endLineNumberExclusive),I.modifiedLineRange=new X(I.modifiedLineRange.startLineNumber,x.endLineNumberExclusive),T.push(I);return}const A={modifiedLineRange:x,originalLineRange:y};o.push(A),T.push(A)}),f=T}if(!s.isValid())return[]}o.sort(Yl(Ct(m=>m.modifiedLineRange.length,Et)));const u=new De,c=new De;for(const m of o){const f=m.modifiedLineRange.startLineNumber-m.originalLineRange.startLineNumber,w=u.subtractFrom(m.modifiedLineRange),p=c.subtractFrom(m.originalLineRange).getWithDelta(f),x=w.getIntersection(p);for(const T of x.ranges){if(T.length<3)continue;const y=T,A=T.delta(-f);a.push(new ve(A,y)),u.addRange(y),c.addRange(A)}}a.sort(Ct(m=>m.original.startLineNumber,Et));const d=new nn(t);for(let m=0;m<a.length;m++){const f=a[m],w=d.findLastMonotonous(P=>P.original.startLineNumber<=f.original.startLineNumber),p=ut(t,P=>P.modified.startLineNumber<=f.modified.startLineNumber),x=Math.max(f.original.startLineNumber-w.original.startLineNumber,f.modified.startLineNumber-p.modified.startLineNumber),T=d.findLastMonotonous(P=>P.original.startLineNumber<f.original.endLineNumberExclusive),y=ut(t,P=>P.modified.startLineNumber<f.modified.endLineNumberExclusive),A=Math.max(T.original.endLineNumberExclusive-f.original.endLineNumberExclusive,y.modified.endLineNumberExclusive-f.modified.endLineNumberExclusive);let I;for(I=0;I<x;I++){const P=f.original.startLineNumber-I-1,b=f.modified.startLineNumber-I-1;if(P>i.length||b>r.length||u.contains(b)||c.contains(P)||!Es(i[P-1],r[b-1],s))break}I>0&&(c.addRange(new X(f.original.startLineNumber-I,f.original.startLineNumber)),u.addRange(new X(f.modified.startLineNumber-I,f.modified.startLineNumber)));let H;for(H=0;H<A;H++){const P=f.original.endLineNumberExclusive+H,b=f.modified.endLineNumberExclusive+H;if(P>i.length||b>r.length||u.contains(b)||c.contains(P)||!Es(i[P-1],r[b-1],s))break}H>0&&(c.addRange(new X(f.original.endLineNumberExclusive,f.original.endLineNumberExclusive+H)),u.addRange(new X(f.modified.endLineNumberExclusive,f.modified.endLineNumberExclusive+H))),(I>0||H>0)&&(a[m]=new ve(new X(f.original.startLineNumber-I,f.original.endLineNumberExclusive+H),new X(f.modified.startLineNumber-I,f.modified.endLineNumberExclusive+H)))}return a}function Es(t,e,n){if(t.trim()===e.trim())return!0;if(t.length>300&&e.length>300)return!1;const r=new ks().compute(new an([t],new j(1,1,1,t.length),!1),new an([e],new j(1,1,1,e.length),!1),n);let s=0;const a=ne.invert(r.diffs,t.length);for(const c of a)c.seq1Range.forEach(d=>{oi(t.charCodeAt(d))||s++});function l(c){let d=0;for(let m=0;m<t.length;m++)oi(c.charCodeAt(m))||d++;return d}const o=l(t.length>e.length?t:e);return s/o>.6&&o>10}function wu(t){if(t.length===0)return t;t.sort(Ct(n=>n.original.startLineNumber,Et));const e=[t[0]];for(let n=1;n<t.length;n++){const i=e[e.length-1],r=t[n],s=r.original.startLineNumber-i.original.endLineNumberExclusive,a=r.modified.startLineNumber-i.modified.endLineNumberExclusive;if(s>=0&&a>=0&&s+a<=2){e[e.length-1]=i.join(r);continue}e.push(r)}return e}function _u(t,e){const n=new nn(t);return e=e.filter(i=>{const r=n.findLastMonotonous(l=>l.original.startLineNumber<i.original.endLineNumberExclusive)||new ve(new X(1,1),new X(1,1)),s=ut(t,l=>l.modified.startLineNumber<i.modified.endLineNumberExclusive);return r!==s}),e}function Rs(t,e,n){let i=n;return i=Ds(t,e,i),i=Ds(t,e,i),i=vu(t,e,i),i}function Ds(t,e,n){if(n.length===0)return n;const i=[];i.push(n[0]);for(let s=1;s<n.length;s++){const a=i[i.length-1];let l=n[s];if(l.seq1Range.isEmpty||l.seq2Range.isEmpty){const o=l.seq1Range.start-a.seq1Range.endExclusive;let u;for(u=1;u<=o&&!(t.getElement(l.seq1Range.start-u)!==t.getElement(l.seq1Range.endExclusive-u)||e.getElement(l.seq2Range
Line truncated
|
||||
`)}isStronglyEqual(e,n){return this.lines[e]===this.lines[n]}}function zs(t){let e=0;for(;e<t.length&&(t.charCodeAt(e)===32||t.charCodeAt(e)===9);)e++;return e}class Su{constructor(){this.dynamicProgrammingDiffing=new cu,this.myersDiffingAlgorithm=new ks}computeDiff(e,n,i){if(e.length<=1&&$l(e,n,(b,g)=>b===g))return new tn([],[],!1);if(e.length===1&&e[0].length===0||n.length===1&&n[0].length===0)return new tn([new Ue(new X(1,e.length+1),new X(1,n.length+1),[new ye(new j(1,1,e.length,e[e.length-1].length+1),new j(1,1,n.length,n[n.length-1].length+1))])],[],!1);const r=i.maxComputationTimeMs===0?Mt.instance:new uu(i.maxComputationTimeMs),s=!i.ignoreTrimWhitespace,a=new Map;function l(b){let g=a.get(b);return g===void 0&&(g=a.size,a.set(b,g)),g}const o=e.map(b=>l(b.trim())),u=n.map(b=>l(b.trim())),c=new Is(o,e),d=new Is(u,n),m=c.length+d.length<1700?this.dynamicProgrammingDiffing.compute(c,d,r,(b,g)=>e[b]===n[g]?n[g].length===0?.1:1+Math.log(1+n[g].length):.99):this.myersDiffingAlgorithm.compute(c,d,r);let f=m.diffs,w=m.hitTimeout;f=Rs(c,d,f),f=xu(c,d,f);const p=[],x=b=>{if(s)for(let g=0;g<b;g++){const v=T+g,N=y+g;if(e[v]!==n[N]){const S=this.refineDiff(e,n,new ne(new G(v,v+1),new G(N,N+1)),r,s,i);for(const _ of S.mappings)p.push(_);S.hitTimeout&&(w=!0)}}};let T=0,y=0;for(const b of f){Ot(()=>b.seq1Range.start-T===b.seq2Range.start-y);const g=b.seq1Range.start-T;x(g),T=b.seq1Range.endExclusive,y=b.seq2Range.endExclusive;const v=this.refineDiff(e,n,b,r,s,i);v.hitTimeout&&(w=!0);for(const N of v.mappings)p.push(N)}x(e.length-T);const A=new rn(e),I=new rn(n),H=vs(p,A,I);let P=[];return i.computeMoves&&(P=this.computeMoves(H,e,n,o,u,r,s,i)),Ot(()=>{function b(v,N){if(v.lineNumber<1||v.lineNumber>N.length)return!1;const S=N[v.lineNumber-1];return!(v.column<1||v.column>S.length+1)}function g(v,N){return!(v.startLineNumber<1||v.startLineNumber>N.length+1||v.endLineNumberExclusive<1||v.endLineNumberExclusive>N.length+1)}for(const v of H){if(!v.innerChanges)return!1;for(const N of v.innerChanges)if(!(b(N.modifiedRange.getStartPosition(),n)&&b(N.modifiedRange.getEndPosition(),n)&&b(N.originalRange.getStartPosition(),e)&&b(N.originalRange.getEndPosition(),e)))return!1;if(!g(v.modified,n)||!g(v.original,e))return!1}return!0}),new tn(H,P,w)}computeMoves(e,n,i,r,s,a,l,o){return fu(e,n,i,r,s,a).map(d=>{const m=this.refineDiff(n,i,new ne(d.original.toOffsetRange(),d.modified.toOffsetRange()),a,l,o),f=vs(m.mappings,new rn(n),new rn(i),!0);return new jl(d,f)})}refineDiff(e,n,i,r,s,a){const o=Au(i).toRangeMapping2(e,n),u=new an(e,o.originalRange,s),c=new an(n,o.modifiedRange,s),d=u.length+c.length<500?this.dynamicProgrammingDiffing.compute(u,c,r):this.myersDiffingAlgorithm.compute(u,c,r);let m=d.diffs;return m=Rs(u,c,m),m=Ns(u,c,m,(w,p)=>w.findWordContaining(p)),a.extendToSubwords&&(m=Ns(u,c,m,(w,p)=>w.findSubWordContaining(p),!0)),m=yu(u,c,m),m=ku(u,c,m),{mappings:m.map(w=>new ye(u.translateRange(w.seq1Range),c.translateRange(w.seq2Range))),hitTimeout:d.hitTimeout}}}function Au(t){return new ve(new X(t.seq1Range.start+1,t.seq1Range.endExclusive+1),new X(t.seq2Range.start+1,t.seq2Range.endExclusive+1))}const Hs={getLegacy:()=>new su,getDefault:()=>new Su};function $e(t,e){const n=Math.pow(10,e);return Math.round(t*n)/n}class C{constructor(e,n,i,r=1){this._rgbaBrand=void 0,this.r=Math.min(255,Math.max(0,e))|0,this.g=Math.min(255,Math.max(0,n))|0,this.b=Math.min(255,Math.max(0,i))|0,this.a=$e(Math.max(Math.min(1,r),0),3)}static equals(e,n){return e.r===n.r&&e.g===n.g&&e.b===n.b&&e.a===n.a}}class Te{constructor(e,n,i,r){this._hslaBrand=void 0,this.h=Math.max(Math.min(360,e),0)|0,this.s=$e(Math.max(Math.min(1,n),0),3),this.l=$e(Math.max(Math.min(1,i),0),3),this.a=$e(Math.max(Math.min(1,r),0),3)}static equals(e,n){return e.h===n.h&&e.s===n.s&&e.l===n.l&&e.a===n.a}static fromRGBA(e){const n=e.r/255,i=e.g/255,r=e.b/255,s=e.a,a=Math.max(n,i,r),l=Math.min(n,i,r);let o=0,u=0;const c=(l+a)/2,d=a-l;if(d>0){switch(u=Math.min(c<=.5?d/(2*c):d/(2-2*c),1),a){case n:o=(i-r)/d+(i<r?6:0);break;case i:o=(r-n)/d+2;break;case r:o=(n-i)/d+4;break}o*=60,o=Math.round(o)}return new Te(o,u,c,s)}static _hue2rgb(e,n,i){return i<0&&(i+=1),i>1&&(i-=1),i<1/6?e+(n-e)*6*i:i<1/2?n:i<2/3?e+(n-e)*(2/3-i)*6:e}static toRGBA(e){const n=e.h/360,{s:i,l:r,a:s}=e;let a,l,o;if(i===0)a=l=o=r;else{const u=r<.5?r*(1+i):r+i-r*i,c=2*r-u;a=Te._hue2rgb(c,u,n+1/3),l=Te._hue2rgb(c,u,n),o=Te._hue2rgb(c,u,n-1/3)}return new C(Math.round(a*255),Math.round(l*255),Math.round(o*255),s)}}class pt{constructor(e,n,i,r){this._hsvaBrand=void 0,this.h=Math.max(Math.min(360,e),0)|0,this.s=$e(Math.max(Math.min(1,n),0),3),this.v=$e(Math.max(Math.min(1,i),0),3),this.a=$e(Math.max(Math.min(1,r),0),3)}static equals(e,n){return e.h===n.h&&e.s===n.s&&e.v===n.v&&e.a===n.a}static fromRGBA(e){const n=e.r/255,i=e.g/255,r=e.b/255,s=Math.max(n,i,r),a=Math.min(n,i,r),l=s-a,o=s===0?0:l/s;let u;return l===0?u=0:s===n?u=((i-r)/l%6+6)%6:s===i?u=(r-n)/l+2:u=(n-i)/l+4,new pt(Math.round(u*60),o,s,e.a)}static toRGBA(
Line truncated
|
||||
`);s.lastIndex=0;let c;for(;(c=s.exec(u))!==null;){const d=u.substring(0,c.index),m=(d.match(/\n/g)||[]).length,f=a+m,w=c[0].split(`
|
||||
`),p=w.length,x=f+p-1,T=d.lastIndexOf(`
|
||||
`)+1,y=c.index-T+1,A=w[w.length-1],I=p===1?y+c[0].length:A.length+1,H={startLineNumber:f,startColumn:y,endLineNumber:x,endColumn:I},P=(c.groups??{}).label??"",b=((c.groups??{}).separator??"")!=="",g={range:H,text:P,hasSeparatorLine:b,shouldBeInComments:!0};(g.text||g.hasSeparatorLine)&&(n.length===0||n[n.length-1].range.endLineNumber<g.range.startLineNumber)&&n.push(g),s.lastIndex=c.index+c[0].length}}return n}function zu(t){t=t.trim();const e=t.startsWith("-");return t=t.replace(Ru,""),{text:t,hasSeparatorLine:e}}class Hu{get isRejected(){return this.outcome?.outcome===1}get isSettled(){return!!this.outcome}constructor(){this.p=new Promise((e,n)=>{this.completeCallback=e,this.errorCallback=n})}complete(e){return this.isSettled?Promise.resolve():new Promise(n=>{this.completeCallback(e),this.outcome={outcome:0,value:e},n()})}error(e){return this.isSettled?Promise.resolve():new Promise(n=>{this.errorCallback(e),this.outcome={outcome:1,value:e},n()})}cancel(){return this.error(new Ii)}}var Bs;(function(t){async function e(i){let r;const s=await Promise.all(i.map(a=>a.then(l=>l,l=>{r||(r=l)})));if(typeof r<"u")throw r;return s}t.settled=e;function n(i){return new Promise(async(r,s)=>{try{await i(r,s)}catch(a){s(a)}})}t.withAsyncBody=n})(Bs||(Bs={}));class Uu{constructor(){this._unsatisfiedConsumers=[],this._unconsumedValues=[]}get hasFinalValue(){return!!this._finalValue}produce(e){if(this._ensureNoFinalValue(),this._unsatisfiedConsumers.length>0){const n=this._unsatisfiedConsumers.shift();this._resolveOrRejectDeferred(n,e)}else this._unconsumedValues.push(e)}produceFinal(e){this._ensureNoFinalValue(),this._finalValue=e;for(const n of this._unsatisfiedConsumers)this._resolveOrRejectDeferred(n,e);this._unsatisfiedConsumers.length=0}_ensureNoFinalValue(){if(this._finalValue)throw new le("ProducerConsumer: cannot produce after final value has been set")}_resolveOrRejectDeferred(e,n){n.ok?e.complete(n.value):e.error(n.error)}consume(){if(this._unconsumedValues.length>0||this._finalValue){const e=this._unconsumedValues.length>0?this._unconsumedValues.shift():this._finalValue;return e.ok?Promise.resolve(e.value):Promise.reject(e.error)}else{const e=new Hu;return this._unsatisfiedConsumers.push(e),e.p}}}const pe=class pe{constructor(e,n){this._onReturn=n,this._producerConsumer=new Uu,this._iterator={next:()=>this._producerConsumer.consume(),return:()=>(this._onReturn?.(),Promise.resolve({done:!0,value:void 0})),throw:async i=>(this._finishError(i),{done:!0,value:void 0})},queueMicrotask(async()=>{const i=e({emitOne:r=>this._producerConsumer.produce({ok:!0,value:{done:!1,value:r}}),emitMany:r=>{for(const s of r)this._producerConsumer.produce({ok:!0,value:{done:!1,value:s}})},reject:r=>this._finishError(r)});if(!this._producerConsumer.hasFinalValue)try{await i,this._finishOk()}catch(r){this._finishError(r)}})}static fromArray(e){return new pe(n=>{n.emitMany(e)})}static fromPromise(e){return new pe(async n=>{n.emitMany(await e)})}static fromPromisesResolveOrder(e){return new pe(async n=>{await Promise.all(e.map(async i=>n.emitOne(await i)))})}static merge(e){return new pe(async n=>{await Promise.all(e.map(async i=>{for await(const r of i)n.emitOne(r)}))})}static map(e,n){return new pe(async i=>{for await(const r of e)i.emitOne(n(r))})}map(e){return pe.map(this,e)}static coalesce(e){return pe.filter(e,n=>!!n)}coalesce(){return pe.coalesce(this)}static filter(e,n){return new pe(async i=>{for await(const r of e)n(r)&&i.emitOne(r)})}filter(e){return pe.filter(this,e)}_finishOk(){this._producerConsumer.hasFinalValue||this._producerConsumer.produceFinal({ok:!0,value:{done:!0,value:void 0}})}_finishError(e){this._producerConsumer.hasFinalValue||this._producerConsumer.produceFinal({ok:!1,error:e})}[Symbol.asyncIterator](){return this._iterator}};pe.EMPTY=pe.fromArray([]);let qs=pe;class Pu{constructor(e){this.values=e,this.prefixSum=new Uint32Array(e.length),this.prefixSumValidIndex=new Int32Array(1),this.prefixSumValidIndex[0]=-1}insertValues(e,n){e=at(e);const i=this.values,r=this.prefixSum,s=n.length;return s===0?!1:(this.values=new Uint32Array(i.length+s),this.values.set(i.subarray(0,e),0),this.values.set(i.subarray(e),e+s),this.values.set(n,e),e-1<this.prefixSumValidIndex[0]&&(this.prefixSumValidIndex[0]=e-1),this.prefixSum=new Uint32Array(this.values.length),this.prefixSumValidIndex[0]>=0&&this.prefixSum.set(r.subarray(0,this.prefixSumValidIndex[0]+1)),!0)}setValue(e,n){return e=at(e),n=at(n),this.values[e]===n?!1:(this.values[e]=n,e-1<this.prefixSumValidIndex[0]&&(this.prefixSumValidIndex[0]=e-1),!0)}removeValues(e,n){e=at(e),n=at(n);const i=this.values,r=this.prefixSum;if(e>=i.length)return!1;const s=i.length-e;return n>=s&&(n=s),n===0?!1:(this.values=new Uint32Array(i.length-n),this.values.set(i.subarray(0,e),0),this.values.set(i.subarray(e+n),e),this.prefixSum=new Uint32Array(this.values.length),e-1<this.prefixSumValidIndex[0]&&(this.prefixSumValidIndex[0]=e-1),this.prefixSumValidIndex[0]>=0&&this.prefixSum.set(r.suba
Line truncated
|
||||
`,s==="\r"&&r+1<n.length&&n.charAt(r+1)===`
|
||||
`&&r++}i&&n.length>0&&e.push(n.length),this._lineOffsets=e}return this._lineOffsets}positionAt(e){e=Math.max(Math.min(e,this._content.length),0);let n=this.getLineOffsets(),i=0,r=n.length;if(r===0)return se.create(0,e);for(;i<r;){let a=Math.floor((i+r)/2);n[a]>e?r=a:i=a+1}let s=i-1;return se.create(s,e-n[s])}offsetAt(e){let n=this.getLineOffsets();if(e.line>=n.length)return this._content.length;if(e.line<0)return 0;let i=n[e.line],r=e.line+1<n.length?n[e.line+1]:this._content.length;return Math.max(Math.min(i+e.character,r),i)}get lineCount(){return this.getLineOffsets().length}};var E;(function(t){const e=Object.prototype.toString;function n(f){return typeof f<"u"}t.defined=n;function i(f){return typeof f>"u"}t.undefined=i;function r(f){return f===!0||f===!1}t.boolean=r;function s(f){return e.call(f)==="[object String]"}t.string=s;function a(f){return e.call(f)==="[object Number]"}t.number=a;function l(f,w,p){return e.call(f)==="[object Number]"&&w<=f&&f<=p}t.numberRange=l;function o(f){return e.call(f)==="[object Number]"&&-2147483648<=f&&f<=2147483647}t.integer=o;function u(f){return e.call(f)==="[object Number]"&&0<=f&&f<=2147483647}t.uinteger=u;function c(f){return e.call(f)==="[object Function]"}t.func=c;function d(f){return f!==null&&typeof f=="object"}t.objectLiteral=d;function m(f,w){return Array.isArray(f)&&f.every(w)}t.typedArray=m})(E||(E={}));class Ht{constructor(e,n,i,r){this._uri=e,this._languageId=n,this._version=i,this._content=r,this._lineOffsets=void 0}get uri(){return this._uri}get languageId(){return this._languageId}get version(){return this._version}getText(e){if(e){const n=this.offsetAt(e.start),i=this.offsetAt(e.end);return this._content.substring(n,i)}return this._content}update(e,n){for(let i of e)if(Ht.isIncremental(i)){const r=Ua(i.range),s=this.offsetAt(r.start),a=this.offsetAt(r.end);this._content=this._content.substring(0,s)+i.text+this._content.substring(a,this._content.length);const l=Math.max(r.start.line,0),o=Math.max(r.end.line,0);let u=this._lineOffsets;const c=Ha(i.text,!1,s);if(o-l===c.length)for(let m=0,f=c.length;m<f;m++)u[m+l+1]=c[m];else c.length<1e4?u.splice(l+1,o-l,...c):this._lineOffsets=u=u.slice(0,l+1).concat(c,u.slice(o+1));const d=i.text.length-(a-s);if(d!==0)for(let m=l+1+c.length,f=u.length;m<f;m++)u[m]=u[m]+d}else if(Ht.isFull(i))this._content=i.text,this._lineOffsets=void 0;else throw new Error("Unknown change event received");this._version=n}getLineOffsets(){return this._lineOffsets===void 0&&(this._lineOffsets=Ha(this._content,!0)),this._lineOffsets}positionAt(e){e=Math.max(Math.min(e,this._content.length),0);let n=this.getLineOffsets(),i=0,r=n.length;if(r===0)return{line:0,character:e};for(;i<r;){let a=Math.floor((i+r)/2);n[a]>e?r=a:i=a+1}let s=i-1;return{line:s,character:e-n[s]}}offsetAt(e){let n=this.getLineOffsets();if(e.line>=n.length)return this._content.length;if(e.line<0)return 0;let i=n[e.line],r=e.line+1<n.length?n[e.line+1]:this._content.length;return Math.max(Math.min(i+e.character,r),i)}get lineCount(){return this.getLineOffsets().length}static isIncremental(e){let n=e;return n!=null&&typeof n.text=="string"&&n.range!==void 0&&(n.rangeLength===void 0||typeof n.rangeLength=="number")}static isFull(e){let n=e;return n!=null&&typeof n.text=="string"&&n.range===void 0&&n.rangeLength===void 0}}var Ai;(function(t){function e(r,s,a,l){return new Ht(r,s,a,l)}t.create=e;function n(r,s,a){if(r instanceof Ht)return r.update(s,a),r;throw new Error("TextDocument.update: document must be created by TextDocument.create")}t.update=n;function i(r,s){let a=r.getText(),l=Li(s.map(Xu),(c,d)=>{let m=c.range.start.line-d.range.start.line;return m===0?c.range.start.character-d.range.start.character:m}),o=0;const u=[];for(const c of l){let d=r.offsetAt(c.range.start);if(d<o)throw new Error("Overlapping edit");d>o&&u.push(a.substring(o,d)),c.newText.length&&u.push(c.newText),o=r.offsetAt(c.range.end)}return u.push(a.substr(o)),u.join("")}t.applyEdits=i})(Ai||(Ai={}));function Li(t,e){if(t.length<=1)return t;const n=t.length/2|0,i=t.slice(0,n),r=t.slice(n);Li(i,e),Li(r,e);let s=0,a=0,l=0;for(;s<i.length&&a<r.length;)e(i[s],r[a])<=0?t[l++]=i[s++]:t[l++]=r[a++];for(;s<i.length;)t[l++]=i[s++];for(;a<r.length;)t[l++]=r[a++];return t}function Ha(t,e,n=0){const i=e?[n]:[];for(let r=0;r<t.length;r++){let s=t.charCodeAt(r);(s===13||s===10)&&(s===13&&r+1<t.length&&t.charCodeAt(r+1)===10&&r++,i.push(n+r+1))}return i}function Ua(t){const e=t.start,n=t.end;return e.line>n.line||e.line===n.line&&e.character>n.character?{start:n,end:e}:t}function Xu(t){const e=Ua(t.range);return e!==t.range?{newText:t.newText,range:e}:t}var z;(function(t){t[t.StartCommentTag=0]="StartCommentTag",t[t.Comment=1]="Comment",t[t.EndCommentTag=2]="EndCommentTag",t[t.StartTagOpen=3]="StartTagOpen",t[t.StartTagClose=4]="StartTagClose",t[t.StartTagSelfClose=5]="StartTagSelfClose",t[t.StartTag=6]="StartTag",t[t.EndTagOpen=7]="EndTagOpen",t[t.EndTagClose=8]="EndTagClose",t[t.EndTag=9]="EndTag",t[t.Delimi
Line truncated
|
||||
`,"nexist;":"∄","nexists;":"∄","Nfr;":"𝔑","nfr;":"𝔫","ngE;":"≧̸","nge;":"≱","ngeq;":"≱","ngeqq;":"≧̸","ngeqslant;":"⩾̸","nges;":"⩾̸","nGg;":"⋙̸","ngsim;":"≵","nGt;":"≫⃒","ngt;":"≯","ngtr;":"≯","nGtv;":"≫̸","nhArr;":"⇎","nharr;":"↮","nhpar;":"⫲","ni;":"∋","nis;":"⋼","nisd;":"⋺","niv;":"∋","NJcy;":"Њ","njcy;":"њ","nlArr;":"⇍","nlarr;":"↚","nldr;":"‥","nlE;":"≦̸","nle;":"≰","nLeftarrow;":"⇍","nleftarrow;":"↚","nLeftrightarrow;":"⇎","nleftrightarrow;":"↮","nleq;":"≰","nleqq;":"≦̸","nleqslant;":"⩽̸","nles;":"⩽̸","nless;":"≮","nLl;":"⋘̸","nlsim;":"≴","nLt;":"≪⃒","nlt;":"≮","nltri;":"⋪","nltrie;":"⋬","nLtv;":"≪̸","nmid;":"∤","NoBreak;":"","NonBreakingSpace;":" ","Nopf;":"ℕ","nopf;":"𝕟","Not;":"⫬","not;":"¬",not:"¬","NotCongruent;":"≢","NotCupCap;":"≭","NotDoubleVerticalBar;":"∦","NotElement;":"∉","NotEqual;":"≠","NotEqualTilde;":"≂̸","NotExists;":"∄","NotGreater;":"≯","NotGreaterEqual;":"≱","NotGreaterFullEqual;":"≧̸","NotGreaterGreater;":"≫̸","NotGreaterLess;":"≹","NotGreaterSlantEqual;":"⩾̸","NotGreaterTilde;":"≵","NotHumpDownHump;":"≎̸","NotHumpEqual;":"≏̸","notin;":"∉","notindot;":"⋵̸","notinE;":"⋹̸","notinva;":"∉","notinvb;":"⋷","notinvc;":"⋶","NotLeftTriangle;":"⋪","NotLeftTriangleBar;":"⧏̸","NotLeftTriangleEqual;":"⋬","NotLess;":"≮","NotLessEqual;":"≰","NotLessGreater;":"≸","NotLessLess;":"≪̸","NotLessSlantEqual;":"⩽̸","NotLessTilde;":"≴","NotNestedGreaterGreater;":"⪢̸","NotNestedLessLess;":"⪡̸","notni;":"∌","notniva;":"∌","notnivb;":"⋾","notnivc;":"⋽","NotPrecedes;":"⊀","NotPrecedesEqual;":"⪯̸","NotPrecedesSlantEqual;":"⋠","NotReverseElement;":"∌","NotRightTriangle;":"⋫","NotRightTriangleBar;":"⧐̸","NotRightTriangleEqual;":"⋭","NotSquareSubset;":"⊏̸","NotSquareSubsetEqual;":"⋢","NotSquareSuperset;":"⊐̸","NotSquareSupersetEqual;":"⋣","NotSubset;":"⊂⃒","NotSubsetEqual;":"⊈","NotSucceeds;":"⊁","NotSucceedsEqual;":"⪰̸","NotSucceedsSlantEqual;":"⋡","NotSucceedsTilde;":"≿̸","NotSuperset;":"⊃⃒","NotSupersetEqual;":"⊉","NotTilde;":"≁","NotTildeEqual;":"≄","NotTildeFullEqual;":"≇","NotTildeTilde;":"≉","NotVerticalBar;":"∤","npar;":"∦","nparallel;":"∦","nparsl;":"⫽⃥","npart;":"∂̸","npolint;":"⨔","npr;":"⊀","nprcue;":"⋠","npre;":"⪯̸","nprec;":"⊀","npreceq;":"⪯̸","nrArr;":"⇏","nrarr;":"↛","nrarrc;":"⤳̸","nrarrw;":"↝̸","nRightarrow;":"⇏","nrightarrow;":"↛","nrtri;":"⋫","nrtrie;":"⋭","nsc;":"⊁","nsccue;":"⋡","nsce;":"⪰̸","Nscr;":"𝒩","nscr;":"𝓃","nshortmid;":"∤","nshortparallel;":"∦","nsim;":"≁","nsime;":"≄","nsimeq;":"≄","nsmid;":"∤","nspar;":"∦","nsqsube;":"⋢","nsqsupe;":"⋣","nsub;":"⊄","nsubE;":"⫅̸","nsube;":"⊈","nsubset;":"⊂⃒","nsubseteq;":"⊈","nsubseteqq;":"⫅̸","nsucc;":"⊁","nsucceq;":"⪰̸","nsup;":"⊅","nsupE;":"⫆̸","nsupe;":"⊉","nsupset;":"⊃⃒","nsupseteq;":"⊉","nsupseteqq;":"⫆̸","ntgl;":"≹","Ntilde;":"Ñ",Ntilde:"Ñ","ntilde;":"ñ",ntilde:"ñ","ntlg;":"≸","ntriangleleft;":"⋪","ntrianglelefteq;":"⋬","ntriangleright;":"⋫","ntrianglerighteq;":"⋭","Nu;":"Ν","nu;":"ν","num;":"#","numero;":"№","numsp;":" ","nvap;":"≍⃒","nVDash;":"⊯","nVdash;":"⊮","nvDash;":"⊭","nvdash;":"⊬","nvge;":"≥⃒","nvgt;":">⃒","nvHarr;":"⤄","nvinfin;":"⧞","nvlArr;":"⤂","nvle;":"≤⃒","nvlt;":"<⃒","nvltrie;":"⊴⃒","nvrArr;":"⤃","nvrtrie;":"⊵⃒","nvsim;":"∼⃒","nwarhk;":"⤣","nwArr;":"⇖","nwarr;":"↖","nwarrow;":"↖","nwnear;":"⤧","Oacute;":"Ó",Oacute:"Ó","oacute;":"ó",oacute:"ó","oast;":"⊛","ocir;":"⊚","Ocirc;":"Ô",Ocirc:"Ô","ocirc;":"ô",ocirc:"ô","Ocy;":"О","ocy;":"о","odash;":"⊝","Odblac;":"Ő","odblac;":"ő","odiv;":"⨸","odot;":"⊙","odsold;":"⦼","OElig;":"Œ","oelig;":"œ","ofcir;":"⦿","Ofr;":"𝔒","ofr;":"𝔬","ogon;":"˛","Ograve;":"Ò",Ograve:"Ò","ograve;":"ò",ograve:"ò","ogt;":"⧁","ohbar;":"⦵","ohm;":"Ω","oint;":"∮","olarr;":"↺","olcir;":"⦾","olcross;":"⦻","oline;":"‾","olt;":"⧀","Omacr;":"Ō","omacr;":"ō","Omega;":"Ω","omega;":"ω","Omicron;":"Ο","omicron;":"ο","omid;":"⦶","ominus;":"⊖","Oopf;":"𝕆","oopf;":"𝕠","opar;":"⦷","OpenCurlyDoubleQuote;":"“","OpenCurlyQuote;":"‘","operp;":"⦹","oplus;":"⊕","Or;":"⩔","or;":"∨","orarr;":"↻","ord;":"⩝","order;":"ℴ","orderof;":"ℴ","ordf;":"ª",ordf:"ª","ordm;":"º",ordm:"º","origof;":"⊶","oror;":"⩖","orslope;":"⩗","orv;":"⩛","oS;":"Ⓢ","Oscr;":"𝒪","oscr;":"ℴ","Oslash;":"Ø",Oslash:"Ø","oslash;":"ø",oslash:"ø","osol;":"⊘","Otilde;":"Õ",Otilde:"Õ","otilde;":"õ",otilde:"õ","Otimes;":"⨷","otimes;":"⊗","otimesas;":"⨶","Ouml;":"Ö",Ouml:"Ö","ouml;":"ö",ouml:"ö","ovbar;":"⌽","OverBar;":"‾","OverBrace;":"⏞","OverBracket;":"⎴","OverParenthesis;":"⏜","par;"
Line truncated
|
||||
|
||||
`),n?i.value+=t.references.map(r=>`[${r.name}](${r.url})`).join(" | "):i.value+=t.references.map(r=>`${r.name}: ${r.url}`).join(`
|
||||
`)),i.value!=="")return i}class pc{constructor(e,n){this.dataManager=e,this.readDirectory=n,this.atributeCompletions=[]}onHtmlAttributeValue(e){this.dataManager.isPathAttribute(e.tag,e.attribute)&&this.atributeCompletions.push(e)}async computeCompletions(e,n){const i={items:[],isIncomplete:!1};for(const r of this.atributeCompletions){const s=bc(e.getText(r.range));if(wc(s))if(s==="."||s==="..")i.isIncomplete=!0;else{const a=_c(r.value,s,r.range),l=await this.providePathSuggestions(r.value,a,e,n);for(const o of l)i.items.push(o)}}return i}async providePathSuggestions(e,n,i,r){const s=e.substring(0,e.lastIndexOf("/")+1);let a=r.resolveReference(s||".",i.uri);if(a)try{const l=[],o=await this.readDirectory(a);for(const[u,c]of o)u.charCodeAt(0)!==gc&&l.push(vc(u,c===Ci.Directory,n));return l}catch{}return[]}}const gc=46;function bc(t){return Ge(t,"'")||Ge(t,'"')?t.slice(1,-1):t}function wc(t){return!(Ge(t,"http")||Ge(t,"https")||Ge(t,"//"))}function _c(t,e,n){let i;const r=t.lastIndexOf("/");if(r===-1)i=yc(n,1,-1);else{const s=e.slice(r+1),a=Wt(n.end,-1-s.length),l=s.indexOf(" ");let o;l!==-1?o=Wt(a,l):o=Wt(n.end,-1),i=J.create(a,o)}return i}function vc(t,e,n){return e?(t=t+"/",{label:t,kind:fe.Folder,textEdit:oe.replace(n,t),command:{title:"Suggest",command:"editor.action.triggerSuggest"}}):{label:t,kind:fe.File,textEdit:oe.replace(n,t)}}function Wt(t,e){return se.create(t.line,t.character+e)}function yc(t,e,n){const i=Wt(t.start,e),r=Wt(t.end,n);return J.create(i,r)}class Tc{constructor(e,n){this.lsOptions=e,this.dataManager=n,this.completionParticipants=[]}setCompletionParticipants(e){this.completionParticipants=e||[]}async doComplete2(e,n,i,r,s){if(!this.lsOptions.fileSystemProvider||!this.lsOptions.fileSystemProvider.readDirectory)return this.doComplete(e,n,i,s);const a=new pc(this.dataManager,this.lsOptions.fileSystemProvider.readDirectory),l=this.completionParticipants;this.completionParticipants=[a].concat(l);const o=this.doComplete(e,n,i,s);try{const u=await a.computeCompletions(e,r);return{isIncomplete:o.isIncomplete||u.isIncomplete,items:u.items.concat(o.items)}}finally{this.completionParticipants=l}}doComplete(e,n,i,r){const s=this._doComplete(e,n,i,r);return this.convertCompletionList(s)}_doComplete(e,n,i,r){const s={isIncomplete:!1,items:[]},a=this.completionParticipants,l=this.dataManager.getDataProviders().filter(k=>k.isApplicable(e.languageId)&&(!r||r[k.getId()]!==!1)),o=this.dataManager.getVoidElements(l),u=this.doesSupportMarkdown(),c=e.getText(),d=e.offsetAt(n),m=i.findNodeBefore(d);if(!m)return s;const f=be(c,m.start);let w="",p;function x(k,R=d){return k>d&&(k=d),{start:e.positionAt(k),end:e.positionAt(R)}}function T(k,R){const M=x(k,R);return l.forEach(W=>{W.provideTags().forEach(F=>{s.items.push({label:F.name,kind:fe.Property,documentation:Ze(F,void 0,u),textEdit:oe.replace(M,F.name),insertTextFormat:Ae.PlainText})})}),s}function y(k){let R=k;for(;R>0;){const M=c.charAt(R-1);if(`
|
||||
\r`.indexOf(M)>=0)return c.substring(R,k);if(!wn(M))return null;R--}return c.substring(0,k)}function A(k,R,M=d){const W=x(k,M),F=Va(c,M,V.WithinEndTag,z.EndTagClose)?"":">";let U=m;for(R&&(U=U.parent);U;){const O=U.tag;if(O&&(!U.closed||U.endTagStart&&U.endTagStart>d)){const Y={label:"/"+O,kind:fe.Property,filterText:"/"+O,textEdit:oe.replace(W,"/"+O+F),insertTextFormat:Ae.PlainText},Z=y(U.start),xe=y(k-1);if(Z!==null&&xe!==null&&Z!==xe){const Ce=Z+"</"+O+F;Y.textEdit=oe.replace(x(k-1-xe.length),Ce),Y.filterText=xe+"</"+O}return s.items.push(Y),s}U=U.parent}return R||l.forEach(O=>{O.provideTags().forEach(Y=>{s.items.push({label:"/"+Y.name,kind:fe.Property,documentation:Ze(Y,void 0,u),filterText:"/"+Y.name+F,textEdit:oe.replace(W,"/"+Y.name+F),insertTextFormat:Ae.PlainText})})}),s}const I=(k,R)=>{if(r&&r.hideAutoCompleteProposals)return s;if(!this.dataManager.isVoidElement(R,o)){const M=e.positionAt(k);s.items.push({label:"</"+R+">",kind:fe.Property,filterText:"</"+R+">",textEdit:oe.insert(M,"$0</"+R+">"),insertTextFormat:Ae.Snippet})}return s};function H(k,R){return T(k,R),A(k,!0,R),s}function P(){const k=Object.create(null);return m.attributeNames.forEach(R=>{k[R]=!0}),k}function b(k,R=d){let M=d;for(;M<R&&c[M]!=="<";)M++;const W=c.substring(k,R),F=x(k,M);let U="";if(!Va(c,R,V.AfterAttributeName,z.DelimiterAssign)){const Y=r?.attributeDefaultValue??"doublequotes";Y==="empty"?U="=$1":Y==="singlequotes"?U="='$1'":U='="$1"'}const O=P();return O[W]=!1,l.forEach(Y=>{Y.provideAttributes(w).forEach(Z=>{if(O[Z.name])return;O[Z.name]=!0;let xe=Z.name,Ce;Z.valueSet!=="v"&&U.length&&(xe=xe+U,(Z.valueSet||Z.name==="style")&&(Ce={title:"Suggest",command:"editor.action.triggerSuggest"})),s.items.push({label:Z.name,kind:Z.valueSet==="handler"?fe.Function:fe.Value,documentation:Ze(Z,void 0,u),textEdit:oe.replace(F,xe),insertTextFormat:Ae.Snippet,command:Ce})})}),g(F,O),s}function g(k,R){const M="data-",W={};W[M]=`${M}$1="$2"`;function F(U){U.attributeNames.forEach(O=>{Ge(O,M)&&!W[O]&&!R[O]&&(W[O]=O+'="$1"')}),U.children.forEach(O=>F(O))}i&&i.roots.forEach(U=>F(U)),Object.keys(W).forEach(U=>s.items.push({label:U,kind:fe.Value,textEdit:oe.replace(k,W[U]),insertTextFormat:Ae.Snippet}))}function v(k,R=d){let M,W,F;if(d>k&&d<=R&&xc(c[k])){const U=k+1;let O=R;R>k&&c[R-1]===c[k]&&O--;const Y=kc(c,d,U),Z=Sc(c,d,O);M=x(Y,Z),F=d>=U&&d<=O?c.substring(U,d):"",W=!1}else M=x(k,R),F=c.substring(k,d),W=!0;if(a.length>0){const U=w.toLowerCase(),O=p.toLowerCase(),Y=x(k,R);for(const Z of a)Z.onHtmlAttributeValue&&Z.onHtmlAttributeValue({document:e,position:n,tag:U,attribute:O,value:F,range:Y})}return l.forEach(U=>{U.provideValues(w,p).forEach(O=>{const Y=W?'"'+O.name+'"':O.name;s.items.push({label:O.name,filterText:Y,kind:fe.Unit,documentation:Ze(O,void 0,u),textEdit:oe.replace(M,Y),insertTextFormat:Ae.PlainText})})}),_(),s}function N(k){return d===f.getTokenEnd()&&(D=f.scan(),D===k&&f.getTokenOffset()===d)?f.getTokenEnd():d}function S(){for(const k of a)k.onHtmlContent&&k.onHtmlContent({document:e,position:n});return _()}function _(){let k=d-1,R=n.character;for(;k>=0&&Pt(c,k);)k--,R--;if(k>=0&&c[k]==="&"){const M=J.create(se.create(n.line,R-1),n);for(const W in Ut)if(oc(W,";")){const F="&"+W;s.items.push({label:F,kind:fe.Keyword,documentation:Se("Character entity representing '{0}'",Ut[W]),textEdit:oe.replace(M,F),insertTextFormat:Ae.PlainText})}}return s}function L(k,R){const M=x(k,R);s.items.push({label:"!DOCTYPE",kind:fe.Property,documentation:"A preamble for an HTML document.",textEdit:oe.replace(M,"!DOCTYPE html>"),insertTextFormat:Ae.PlainText})}let D=f.scan();for(;D!==z.EOS&&f.getTokenOffset()<=d;){switch(D){case z.StartTagOpen:if(f.getTokenEnd()===d){const k=N(z.StartTag);return n.line===0&&L(d,k),H(d,k)}break;case z.StartTag:if(f.getTokenOffset()<=d&&d<=f.getTokenEnd())return T(f.getTokenOffset(),f.getTokenEnd());w=f.getTokenText();break;case z.AttributeName:if(f.getTokenOffset()<=d&&d<=f.getTokenEnd())return b(f.getTokenOffset(),f.getTokenEnd());p=f.getTokenText();break;case z.DelimiterAssign:if(f.getTokenEnd()===d){const k=N(z.AttributeValue);return v(d,k)}break;case z.AttributeValue:if(f.getTokenOffset()<=d&&d<=f.getTokenEnd())return v(f.getTokenOffset(),f.getTokenEnd());break;case z.Whitespace:if(d<=f.getTokenEnd())switch(f.getScannerState()){case V.AfterOpeningStartTag:const k=f.getTokenOffset(),R=N(z.StartTag);return H(k,R);case V.WithinTag:case V.AfterAttributeName:return b(f.getTokenEnd());case V.BeforeAttributeValue:return v(f.getTokenEnd());case V.AfterOpeningEndTag:return A(f.getTokenOffset()-1,!1);case V.WithinContent:return S()}break;case z.EndTagOpen:if(d<=f.getTokenEnd()){const k=f.getTokenOffset()+1,R=N(z.EndTag);return A(k,!1,R)}break;case z.EndTag:if(d<=f.getTokenEnd()){let k=f.getTokenOffset()-1;for(;k>=0;){const R=c.charAt(k);if(R==="/")return A(k,!1,f.getTokenEnd());if(!wn(R))break;k--}}break;case z.StartTagClose:if(d<=f.getTokenEnd()&&w)return I(f.getTokenEnd(),w);break;case z.Content:if(d<=f.getTokenEnd())r
Line truncated
|
||||
`);u!==-1?this.__character_count=o.length-u:this.__character_count+=o.length},s.prototype.pop=function(){var o=null;return this.is_empty()||(o=this.__items.pop(),this.__character_count-=o.length),o},s.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},s.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},s.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},s.prototype.toString=function(){var o="";return this.is_empty()?this.__parent.indent_empty_lines&&(o=this.__parent.get_indent_string(this.__indent_count)):(o=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),o+=this.__items.join("")),o};function a(o,u){this.__cache=[""],this.__indent_size=o.indent_size,this.__indent_string=o.indent_char,o.indent_with_tabs||(this.__indent_string=new Array(o.indent_size+1).join(o.indent_char)),u=u||"",o.indent_level>0&&(u=new Array(o.indent_level+1).join(this.__indent_string)),this.__base_string=u,this.__base_string_length=u.length}a.prototype.get_indent_size=function(o,u){var c=this.__base_string_length;return u=u||0,o<0&&(c=0),c+=o*this.__indent_size,c+=u,c},a.prototype.get_indent_string=function(o,u){var c=this.__base_string;return u=u||0,o<0&&(o=0,c=""),u+=o*this.__indent_size,this.__ensure_cache(u),c+=this.__cache[u],c},a.prototype.__ensure_cache=function(o){for(;o>=this.__cache.length;)this.__add_column()},a.prototype.__add_column=function(){var o=this.__cache.length,u=0,c="";this.__indent_size&&o>=this.__indent_size&&(u=Math.floor(o/this.__indent_size),o-=u*this.__indent_size,c=new Array(u+1).join(this.__indent_string)),o&&(c+=new Array(o+1).join(" ")),this.__cache.push(c)};function l(o,u){this.__indent_cache=new a(o,u),this.raw=!1,this._end_with_newline=o.end_with_newline,this.indent_size=o.indent_size,this.wrap_line_length=o.wrap_line_length,this.indent_empty_lines=o.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new s(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}l.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},l.prototype.get_line_number=function(){return this.__lines.length},l.prototype.get_indent_string=function(o,u){return this.__indent_cache.get_indent_string(o,u)},l.prototype.get_indent_size=function(o,u){return this.__indent_cache.get_indent_size(o,u)},l.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},l.prototype.add_new_line=function(o){return this.is_empty()||!o&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},l.prototype.get_code=function(o){this.trim(!0);var u=this.current_line.pop();u&&(u[u.length-1]===`
|
||||
`&&(u=u.replace(/\n+$/g,"")),this.current_line.push(u)),this._end_with_newline&&this.__add_outputline();var c=this.__lines.join(`
|
||||
`);return o!==`
|
||||
`&&(c=c.replace(/[\n]/g,o)),c},l.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},l.prototype.set_indent=function(o,u){return o=o||0,u=u||0,this.next_line.set_indent(o,u),this.__lines.length>1?(this.current_line.set_indent(o,u),!0):(this.current_line.set_indent(),!1)},l.prototype.add_raw_token=function(o){for(var u=0;u<o.newlines;u++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(o.whitespace_before),this.current_line.push(o.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},l.prototype.add_token=function(o){this.__add_space_before_token(),this.current_line.push(o),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},l.prototype.__add_space_before_token=function(){this.space_before_token&&!this.just_added_newline()&&(this.non_breaking_space||this.set_wrap_point(),this.current_line.push(" "))},l.prototype.remove_indent=function(o){for(var u=this.__lines.length;o<u;)this.__lines[o]._remove_indent(),o++;this.current_line._remove_wrap_indent()},l.prototype.trim=function(o){for(o=o===void 0?!1:o,this.current_line.trim();o&&this.__lines.length>1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},l.prototype.just_added_newline=function(){return this.current_line.is_empty()},l.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},l.prototype.ensure_empty_line_above=function(o,u){for(var c=this.__lines.length-2;c>=0;){var d=this.__lines[c];if(d.is_empty())break;if(d.item(0).indexOf(o)!==0&&d.item(-1)!==u){this.__lines.splice(c+1,0,new s(this)),this.previous_line=this.__lines[this.__lines.length-2];break}c--}},r.exports.Output=l}),,,,(function(r){function s(o,u){this.raw_options=a(o,u),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs",this.indent_char===" "),this.indent_with_tabs&&(this.indent_char=" ",this.indent_size===1&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","angular","django","erb","handlebars","php","smarty"],["auto"])}s.prototype._get_array=function(o,u){var c=this.raw_options[o],d=u||[];return typeof c=="object"?c!==null&&typeof c.concat=="function"&&(d=c.concat()):typeof c=="string"&&(d=c.split(/[^a-zA-Z0-9_\/\-]+/)),d},s.prototype._get_boolean=function(o,u){var c=this.raw_options[o],d=c===void 0?!!u:!!c;return d},s.prototype._get_characters=function(o,u){var c=this.raw_options[o],d=u||"";return typeof c=="string"&&(d=c.replace(/\\r/,"\r").replace(/\\n/,`
|
||||
`).replace(/\\t/," ")),d},s.prototype._get_number=function(o,u){var c=this.raw_options[o];u=parseInt(u,10),isNaN(u)&&(u=0);var d=parseInt(c,10);return isNaN(d)&&(d=u),d},s.prototype._get_selection=function(o,u,c){var d=this._get_selection_list(o,u,c);if(d.length!==1)throw new Error("Invalid Option Value: The option '"+o+`' can only be one of the following values:
|
||||
`+u+`
|
||||
You passed in: '`+this.raw_options[o]+"'");return d[0]},s.prototype._get_selection_list=function(o,u,c){if(!u||u.length===0)throw new Error("Selection list cannot be empty.");if(c=c||[u[0]],!this._is_valid_selection(c,u))throw new Error("Invalid Default Value!");var d=this._get_array(o,c);if(!this._is_valid_selection(d,u))throw new Error("Invalid Option Value: The option '"+o+`' can contain only the following values:
|
||||
`+u+`
|
||||
You passed in: '`+this.raw_options[o]+"'");return d},s.prototype._is_valid_selection=function(o,u){return o.length&&u.length&&!o.some(function(c){return u.indexOf(c)===-1})};function a(o,u){var c={};o=l(o);var d;for(d in o)d!==u&&(c[d]=o[d]);if(u&&o[u])for(d in o[u])c[d]=o[u][d];return c}function l(o){var u={},c;for(c in o){var d=c.replace(/-/g,"_");u[d]=o[c]}return u}r.exports.Options=s,r.exports.normalizeOpts=l,r.exports.mergeOpts=a}),,(function(r){var s=RegExp.prototype.hasOwnProperty("sticky");function a(l){this.__input=l||"",this.__input_length=this.__input.length,this.__position=0}a.prototype.restart=function(){this.__position=0},a.prototype.back=function(){this.__position>0&&(this.__position-=1)},a.prototype.hasNext=function(){return this.__position<this.__input_length},a.prototype.next=function(){var l=null;return this.hasNext()&&(l=this.__input.charAt(this.__position),this.__position+=1),l},a.prototype.peek=function(l){var o=null;return l=l||0,l+=this.__position,l>=0&&l<this.__input_length&&(o=this.__input.charAt(l)),o},a.prototype.__match=function(l,o){l.lastIndex=o;var u=l.exec(this.__input);return u&&!(s&&l.sticky)&&u.index!==o&&(u=null),u},a.prototype.test=function(l,o){return o=o||0,o+=this.__position,o>=0&&o<this.__input_length?!!this.__match(l,o):!1},a.prototype.testChar=function(l,o){var u=this.peek(o);return l.lastIndex=0,u!==null&&l.test(u)},a.prototype.match=function(l){var o=this.__match(l,this.__position);return o?this.__position+=o[0].length:o=null,o},a.prototype.read=function(l,o,u){var c="",d;return l&&(d=this.match(l),d&&(c+=d[0])),o&&(d||!l)&&(c+=this.readUntil(o,u)),c},a.prototype.readUntil=function(l,o){var u="",c=this.__position;l.lastIndex=this.__position;var d=l.exec(this.__input);return d?(c=d.index,o&&(c+=d[0].length)):c=this.__input_length,u=this.__input.substring(this.__position,c),this.__position=c,u},a.prototype.readUntilAfter=function(l){return this.readUntil(l,!0)},a.prototype.get_regexp=function(l,o){var u=null,c="g";return o&&s&&(c="y"),typeof l=="string"&&l!==""?u=new RegExp(l,c):l&&(u=new RegExp(l.source,c)),u},a.prototype.get_literal_regexp=function(l){return RegExp(l.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},a.prototype.peekUntilAfter=function(l){var o=this.__position,u=this.readUntilAfter(l);return this.__position=o,u},a.prototype.lookBack=function(l){var o=this.__position-1;return o>=l.length&&this.__input.substring(o-l.length,o).toLowerCase()===l},r.exports.InputScanner=a}),,,,,(function(r){function s(a,l){a=typeof a=="string"?a:a.source,l=typeof l=="string"?l:l.source,this.__directives_block_pattern=new RegExp(a+/ beautify( \w+[:]\w+)+ /.source+l,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(a+/\sbeautify\signore:end\s/.source+l,"g")}s.prototype.get_directives=function(a){if(!a.match(this.__directives_block_pattern))return null;var l={};this.__directive_pattern.lastIndex=0;for(var o=this.__directive_pattern.exec(a);o;)l[o[1]]=o[2],o=this.__directive_pattern.exec(a);return l},s.prototype.readIgnored=function(a){return a.readUntilAfter(this.__directives_end_ignore_pattern)},r.exports.Directives=s}),,(function(r,s,a){var l=a(16).Beautifier,o=a(17).Options;function u(c,d){var m=new l(c,d);return m.beautify()}r.exports=u,r.exports.defaultOptions=function(){return new o}}),(function(r,s,a){var l=a(17).Options,o=a(2).Output,u=a(8).InputScanner,c=a(13).Directives,d=new c(/\/\*/,/\*\//),m=/\r\n|[\r\n]/,f=/\r\n|[\r\n]/g,w=/\s/,p=/(?:\s|\n)+/g,x=/\/\*(?:[\s\S]*?)((?:\*\/)|$)/g,T=/\/\/(?:[^\n\r\u2028\u2029]*)/g;function y(A,I){this._source_text=A||"",this._options=new l(I),this._ch=null,this._input=null,this.NESTED_AT_RULE={page:!0,"font-face":!0,keyframes:!0,media:!0,supports:!0,document:!0},this.CONDITIONAL_GROUP_RULE={media:!0,supports:!0,document:!0},this.NON_SEMICOLON_NEWLINE_PROPERTY=["grid-template-areas","grid-template"]}y.prototype.eatString=function(A){var I="";for(this._ch=this._input.next();this._ch;){if(I+=this._ch,this._ch==="\\")I+=this._input.next();else if(A.indexOf(this._ch)!==-1||this._ch===`
|
||||
`)break;this._ch=this._input.next()}return I},y.prototype.eatWhitespace=function(A){for(var I=w.test(this._input.peek()),H=0;w.test(this._input.peek());)this._ch=this._input.next(),A&&this._ch===`
|
||||
`&&(H===0||H<this._options.max_preserve_newlines)&&(H++,this._output.add_new_line(!0));return I},y.prototype.foundNestedPseudoClass=function(){for(var A=0,I=1,H=this._input.peek(I);H;){if(H==="{")return!0;if(H==="(")A+=1;else if(H===")"){if(A===0)return!1;A-=1}else if(H===";"||H==="}")return!1;I++,H=this._input.peek(I)}return!1},y.prototype.print_string=function(A){this._output.set_indent(this._indentLevel),this._output.non_breaking_space=!0,this._output.add_token(A)},y.prototype.preserveSingleSpace=function(A){A&&(this._output.space_before_token=!0)},y.prototype.indent=function(){this._indentLevel++},y.prototype.outdent=function(){this._indentLevel>0&&this._indentLevel--},y.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var A=this._source_text,I=this._options.eol;I==="auto"&&(I=`
|
||||
`,A&&m.test(A||"")&&(I=A.match(m)[0])),A=A.replace(f,`
|
||||
`);var H=A.match(/^[\t ]*/)[0];this._output=new o(this._options,H),this._input=new u(A),this._indentLevel=0,this._nestedLevel=0,this._ch=null;for(var P=0,b=!1,g=!1,v=!1,N=!1,S=!1,_=this._ch,L=!1,D,k,R;D=this._input.read(p),k=D!=="",R=_,this._ch=this._input.next(),this._ch==="\\"&&this._input.hasNext()&&(this._ch+=this._input.next()),_=this._ch,this._ch;)if(this._ch==="/"&&this._input.peek()==="*"){this._output.add_new_line(),this._input.back();var M=this._input.read(x),W=d.get_directives(M);W&&W.ignore==="start"&&(M+=d.readIgnored(this._input)),this.print_string(M),this.eatWhitespace(!0),this._output.add_new_line()}else if(this._ch==="/"&&this._input.peek()==="/")this._output.space_before_token=!0,this._input.back(),this.print_string(this._input.read(T)),this.eatWhitespace(!0);else if(this._ch==="$"){this.preserveSingleSpace(k),this.print_string(this._ch);var F=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);F.match(/[ :]$/)&&(F=this.eatString(": ").replace(/\s+$/,""),this.print_string(F),this._output.space_before_token=!0),P===0&&F.indexOf(":")!==-1&&(g=!0,this.indent())}else if(this._ch==="@")if(this.preserveSingleSpace(k),this._input.peek()==="{")this.print_string(this._ch+this.eatString("}"));else{this.print_string(this._ch);var U=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);U.match(/[ :]$/)&&(U=this.eatString(": ").replace(/\s+$/,""),this.print_string(U),this._output.space_before_token=!0),P===0&&U.indexOf(":")!==-1?(g=!0,this.indent()):U in this.NESTED_AT_RULE?(this._nestedLevel+=1,U in this.CONDITIONAL_GROUP_RULE&&(v=!0)):P===0&&!g&&(N=!0)}else if(this._ch==="#"&&this._input.peek()==="{")this.preserveSingleSpace(k),this.print_string(this._ch+this.eatString("}"));else if(this._ch==="{")g&&(g=!1,this.outdent()),N=!1,v?(v=!1,b=this._indentLevel>=this._nestedLevel):b=this._indentLevel>=this._nestedLevel-1,this._options.newline_between_rules&&b&&this._output.previous_line&&this._output.previous_line.item(-1)!=="{"&&this._output.ensure_empty_line_above("/",","),this._output.space_before_token=!0,this._options.brace_style==="expand"?(this._output.add_new_line(),this.print_string(this._ch),this.indent(),this._output.set_indent(this._indentLevel)):(R==="("?this._output.space_before_token=!1:R!==","&&this.indent(),this.print_string(this._ch)),this.eatWhitespace(!0),this._output.add_new_line();else if(this._ch==="}")this.outdent(),this._output.add_new_line(),R==="{"&&this._output.trim(!0),g&&(this.outdent(),g=!1),this.print_string(this._ch),b=!1,this._nestedLevel&&this._nestedLevel--,this.eatWhitespace(!0),this._output.add_new_line(),this._options.newline_between_rules&&!this._output.just_added_blankline()&&this._input.peek()!=="}"&&this._output.add_new_line(!0),this._input.peek()===")"&&(this._output.trim(!0),this._options.brace_style==="expand"&&this._output.add_new_line(!0));else if(this._ch===":"){for(var O=0;O<this.NON_SEMICOLON_NEWLINE_PROPERTY.length;O++)if(this._input.lookBack(this.NON_SEMICOLON_NEWLINE_PROPERTY[O])){L=!0;break}(b||v)&&!(this._input.lookBack("&")||this.foundNestedPseudoClass())&&!this._input.lookBack("(")&&!N&&P===0?(this.print_string(":"),g||(g=!0,this._output.space_before_token=!0,this.eatWhitespace(!0),this.indent())):(this._input.lookBack(" ")&&(this._output.space_before_token=!0),this._input.peek()===":"?(this._ch=this._input.next(),this.print_string("::")):this.print_string(":"))}else if(this._ch==='"'||this._ch==="'"){var Y=R==='"'||R==="'";this.preserveSingleSpace(Y||k),this.print_string(this._ch+this.eatString(this._ch)),this.eatWhitespace(!0)}else if(this._ch===";")L=!1,P===0?(g&&(this.outdent(),g=!1),N=!1,this.print_string(this._ch),this.eatWhitespace(!0),this._input.peek()!=="/"&&this._output.add_new_line()):(this.print_string(this._ch),this.eatWhitespace(!0),this._output.space_before_token=!0);else if(this._ch==="(")if(this._input.lookBack("url"))this.print_string(this._ch),this.eatWhitespace(),P++,this.indent(),this._ch=this._input.next(),this._ch===")"||this._ch==='"'||this._ch==="'"?this._input.back():this._ch&&(this.print_string(this._ch+this.eatString(")")),P&&(P--,this.outdent()));else{var Z=!1;this._input.lookBack("with")&&(Z=!0),this.preserveSingleSpace(k||Z),this.print_string(this._ch),g&&R==="$"&&this._options.selector_separator_newline?(this._output.add_new_line(),S=!0):(this.eatWhitespace(),P++,this.indent())}else if(this._ch===")")P&&(P--,this.outdent()),S&&this._input.peek()===";"&&this._options.selector_separator_newline&&(S=!1,this.outdent(),this._output.add_new_line()),this.print_string(this._ch);else if(this._ch===",")this.print_string(this._ch),this.eatWhitespace(!0),this._options.selector_separator_newline&&(!g||S)&&P===0&&!N?this._output.add_new_line():this._output.space_before_token=!0;else if((this._ch===">"||this._ch==="+"||this._ch==="~")&&!g&&P===0)this._options.space_around_combinator?(this._output.space_before_token=!0,this.print_string(this._ch),this._output.space_before_token=!0):(this.print_string(this._ch),this.eatWhitespace(),this._c
Line truncated
|
||||
`&&L&&this._output.add_new_line()}var Ce=this._output.get_code(I);return Ce},r.exports.Beautifier=y}),(function(r,s,a){var l=a(6).Options;function o(u){l.call(this,u,"css"),this.selector_separator_newline=this._get_boolean("selector_separator_newline",!0),this.newline_between_rules=this._get_boolean("newline_between_rules",!0);var c=this._get_boolean("space_around_selector_separator");this.space_around_combinator=this._get_boolean("space_around_combinator")||c;var d=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_style="collapse";for(var m=0;m<d.length;m++)d[m]!=="expand"?this.brace_style="collapse":this.brace_style=d[m]}o.prototype=new l,r.exports.Options=o})],e={};function n(r){var s=e[r];if(s!==void 0)return s.exports;var a=e[r]={exports:{}};return t[r](a,a.exports,n),a.exports}var i=n(15);ja=i})();var Ec=ja,$a;(function(){var t=[,,(function(r){function s(o){this.__parent=o,this.__character_count=0,this.__indent_count=-1,this.__alignment_count=0,this.__wrap_point_index=0,this.__wrap_point_character_count=0,this.__wrap_point_indent_count=-1,this.__wrap_point_alignment_count=0,this.__items=[]}s.prototype.clone_empty=function(){var o=new s(this.__parent);return o.set_indent(this.__indent_count,this.__alignment_count),o},s.prototype.item=function(o){return o<0?this.__items[this.__items.length+o]:this.__items[o]},s.prototype.has_match=function(o){for(var u=this.__items.length-1;u>=0;u--)if(this.__items[u].match(o))return!0;return!1},s.prototype.set_indent=function(o,u){this.is_empty()&&(this.__indent_count=o||0,this.__alignment_count=u||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},s.prototype._set_wrap_point=function(){this.__parent.wrap_line_length&&(this.__wrap_point_index=this.__items.length,this.__wrap_point_character_count=this.__character_count,this.__wrap_point_indent_count=this.__parent.next_line.__indent_count,this.__wrap_point_alignment_count=this.__parent.next_line.__alignment_count)},s.prototype._should_wrap=function(){return this.__wrap_point_index&&this.__character_count>this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count},s.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var o=this.__parent.current_line;return o.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),o.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),o.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,o.__items[0]===" "&&(o.__items.splice(0,1),o.__character_count-=1),!0}return!1},s.prototype.is_empty=function(){return this.__items.length===0},s.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},s.prototype.push=function(o){this.__items.push(o);var u=o.lastIndexOf(`
|
||||
`);u!==-1?this.__character_count=o.length-u:this.__character_count+=o.length},s.prototype.pop=function(){var o=null;return this.is_empty()||(o=this.__items.pop(),this.__character_count-=o.length),o},s.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},s.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},s.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},s.prototype.toString=function(){var o="";return this.is_empty()?this.__parent.indent_empty_lines&&(o=this.__parent.get_indent_string(this.__indent_count)):(o=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),o+=this.__items.join("")),o};function a(o,u){this.__cache=[""],this.__indent_size=o.indent_size,this.__indent_string=o.indent_char,o.indent_with_tabs||(this.__indent_string=new Array(o.indent_size+1).join(o.indent_char)),u=u||"",o.indent_level>0&&(u=new Array(o.indent_level+1).join(this.__indent_string)),this.__base_string=u,this.__base_string_length=u.length}a.prototype.get_indent_size=function(o,u){var c=this.__base_string_length;return u=u||0,o<0&&(c=0),c+=o*this.__indent_size,c+=u,c},a.prototype.get_indent_string=function(o,u){var c=this.__base_string;return u=u||0,o<0&&(o=0,c=""),u+=o*this.__indent_size,this.__ensure_cache(u),c+=this.__cache[u],c},a.prototype.__ensure_cache=function(o){for(;o>=this.__cache.length;)this.__add_column()},a.prototype.__add_column=function(){var o=this.__cache.length,u=0,c="";this.__indent_size&&o>=this.__indent_size&&(u=Math.floor(o/this.__indent_size),o-=u*this.__indent_size,c=new Array(u+1).join(this.__indent_string)),o&&(c+=new Array(o+1).join(" ")),this.__cache.push(c)};function l(o,u){this.__indent_cache=new a(o,u),this.raw=!1,this._end_with_newline=o.end_with_newline,this.indent_size=o.indent_size,this.wrap_line_length=o.wrap_line_length,this.indent_empty_lines=o.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new s(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}l.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},l.prototype.get_line_number=function(){return this.__lines.length},l.prototype.get_indent_string=function(o,u){return this.__indent_cache.get_indent_string(o,u)},l.prototype.get_indent_size=function(o,u){return this.__indent_cache.get_indent_size(o,u)},l.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},l.prototype.add_new_line=function(o){return this.is_empty()||!o&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},l.prototype.get_code=function(o){this.trim(!0);var u=this.current_line.pop();u&&(u[u.length-1]===`
|
||||
`&&(u=u.replace(/\n+$/g,"")),this.current_line.push(u)),this._end_with_newline&&this.__add_outputline();var c=this.__lines.join(`
|
||||
`);return o!==`
|
||||
`&&(c=c.replace(/[\n]/g,o)),c},l.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},l.prototype.set_indent=function(o,u){return o=o||0,u=u||0,this.next_line.set_indent(o,u),this.__lines.length>1?(this.current_line.set_indent(o,u),!0):(this.current_line.set_indent(),!1)},l.prototype.add_raw_token=function(o){for(var u=0;u<o.newlines;u++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(o.whitespace_before),this.current_line.push(o.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},l.prototype.add_token=function(o){this.__add_space_before_token(),this.current_line.push(o),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},l.prototype.__add_space_before_token=function(){this.space_before_token&&!this.just_added_newline()&&(this.non_breaking_space||this.set_wrap_point(),this.current_line.push(" "))},l.prototype.remove_indent=function(o){for(var u=this.__lines.length;o<u;)this.__lines[o]._remove_indent(),o++;this.current_line._remove_wrap_indent()},l.prototype.trim=function(o){for(o=o===void 0?!1:o,this.current_line.trim();o&&this.__lines.length>1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},l.prototype.just_added_newline=function(){return this.current_line.is_empty()},l.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},l.prototype.ensure_empty_line_above=function(o,u){for(var c=this.__lines.length-2;c>=0;){var d=this.__lines[c];if(d.is_empty())break;if(d.item(0).indexOf(o)!==0&&d.item(-1)!==u){this.__lines.splice(c+1,0,new s(this)),this.previous_line=this.__lines[this.__lines.length-2];break}c--}},r.exports.Output=l}),(function(r){function s(a,l,o,u){this.type=a,this.text=l,this.comments_before=null,this.newlines=o||0,this.whitespace_before=u||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}r.exports.Token=s}),,,(function(r){function s(o,u){this.raw_options=a(o,u),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs",this.indent_char===" "),this.indent_with_tabs&&(this.indent_char=" ",this.indent_size===1&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","angular","django","erb","handlebars","php","smarty"],["auto"])}s.prototype._get_array=function(o,u){var c=this.raw_options[o],d=u||[];return typeof c=="object"?c!==null&&typeof c.concat=="function"&&(d=c.concat()):typeof c=="string"&&(d=c.split(/[^a-zA-Z0-9_\/\-]+/)),d},s.prototype._get_boolean=function(o,u){var c=this.raw_options[o],d=c===void 0?!!u:!!c;return d},s.prototype._get_characters=function(o,u){var c=this.raw_options[o],d=u||"";return typeof c=="string"&&(d=c.replace(/\\r/,"\r").replace(/\\n/,`
|
||||
`).replace(/\\t/," ")),d},s.prototype._get_number=function(o,u){var c=this.raw_options[o];u=parseInt(u,10),isNaN(u)&&(u=0);var d=parseInt(c,10);return isNaN(d)&&(d=u),d},s.prototype._get_selection=function(o,u,c){var d=this._get_selection_list(o,u,c);if(d.length!==1)throw new Error("Invalid Option Value: The option '"+o+`' can only be one of the following values:
|
||||
`+u+`
|
||||
You passed in: '`+this.raw_options[o]+"'");return d[0]},s.prototype._get_selection_list=function(o,u,c){if(!u||u.length===0)throw new Error("Selection list cannot be empty.");if(c=c||[u[0]],!this._is_valid_selection(c,u))throw new Error("Invalid Default Value!");var d=this._get_array(o,c);if(!this._is_valid_selection(d,u))throw new Error("Invalid Option Value: The option '"+o+`' can contain only the following values:
|
||||
`+u+`
|
||||
You passed in: '`+this.raw_options[o]+"'");return d},s.prototype._is_valid_selection=function(o,u){return o.length&&u.length&&!o.some(function(c){return u.indexOf(c)===-1})};function a(o,u){var c={};o=l(o);var d;for(d in o)d!==u&&(c[d]=o[d]);if(u&&o[u])for(d in o[u])c[d]=o[u][d];return c}function l(o){var u={},c;for(c in o){var d=c.replace(/-/g,"_");u[d]=o[c]}return u}r.exports.Options=s,r.exports.normalizeOpts=l,r.exports.mergeOpts=a}),,(function(r){var s=RegExp.prototype.hasOwnProperty("sticky");function a(l){this.__input=l||"",this.__input_length=this.__input.length,this.__position=0}a.prototype.restart=function(){this.__position=0},a.prototype.back=function(){this.__position>0&&(this.__position-=1)},a.prototype.hasNext=function(){return this.__position<this.__input_length},a.prototype.next=function(){var l=null;return this.hasNext()&&(l=this.__input.charAt(this.__position),this.__position+=1),l},a.prototype.peek=function(l){var o=null;return l=l||0,l+=this.__position,l>=0&&l<this.__input_length&&(o=this.__input.charAt(l)),o},a.prototype.__match=function(l,o){l.lastIndex=o;var u=l.exec(this.__input);return u&&!(s&&l.sticky)&&u.index!==o&&(u=null),u},a.prototype.test=function(l,o){return o=o||0,o+=this.__position,o>=0&&o<this.__input_length?!!this.__match(l,o):!1},a.prototype.testChar=function(l,o){var u=this.peek(o);return l.lastIndex=0,u!==null&&l.test(u)},a.prototype.match=function(l){var o=this.__match(l,this.__position);return o?this.__position+=o[0].length:o=null,o},a.prototype.read=function(l,o,u){var c="",d;return l&&(d=this.match(l),d&&(c+=d[0])),o&&(d||!l)&&(c+=this.readUntil(o,u)),c},a.prototype.readUntil=function(l,o){var u="",c=this.__position;l.lastIndex=this.__position;var d=l.exec(this.__input);return d?(c=d.index,o&&(c+=d[0].length)):c=this.__input_length,u=this.__input.substring(this.__position,c),this.__position=c,u},a.prototype.readUntilAfter=function(l){return this.readUntil(l,!0)},a.prototype.get_regexp=function(l,o){var u=null,c="g";return o&&s&&(c="y"),typeof l=="string"&&l!==""?u=new RegExp(l,c):l&&(u=new RegExp(l.source,c)),u},a.prototype.get_literal_regexp=function(l){return RegExp(l.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},a.prototype.peekUntilAfter=function(l){var o=this.__position,u=this.readUntilAfter(l);return this.__position=o,u},a.prototype.lookBack=function(l){var o=this.__position-1;return o>=l.length&&this.__input.substring(o-l.length,o).toLowerCase()===l},r.exports.InputScanner=a}),(function(r,s,a){var l=a(8).InputScanner,o=a(3).Token,u=a(10).TokenStream,c=a(11).WhitespacePattern,d={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},m=function(f,w){this._input=new l(f),this._options=w||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new c(this._input)};m.prototype.tokenize=function(){this._input.restart(),this.__tokens=new u,this._reset();for(var f,w=new o(d.START,""),p=null,x=[],T=new u;w.type!==d.EOF;){for(f=this._get_next_token(w,p);this._is_comment(f);)T.add(f),f=this._get_next_token(w,p);T.isEmpty()||(f.comments_before=T,T=new u),f.parent=p,this._is_opening(f)?(x.push(p),p=f):p&&this._is_closing(f,p)&&(f.opened=p,p.closed=f,p=x.pop(),f.parent=p),f.previous=w,w.next=f,this.__tokens.add(f),w=f}return this.__tokens},m.prototype._is_first_token=function(){return this.__tokens.isEmpty()},m.prototype._reset=function(){},m.prototype._get_next_token=function(f,w){this._readWhitespace();var p=this._input.read(/.+/g);return p?this._create_token(d.RAW,p):this._create_token(d.EOF,"")},m.prototype._is_comment=function(f){return!1},m.prototype._is_opening=function(f){return!1},m.prototype._is_closing=function(f,w){return!1},m.prototype._create_token=function(f,w){var p=new o(f,w,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return p},m.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},r.exports.Tokenizer=m,r.exports.TOKEN=d}),(function(r){function s(a){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=a}s.prototype.restart=function(){this.__position=0},s.prototype.isEmpty=function(){return this.__tokens_length===0},s.prototype.hasNext=function(){return this.__position<this.__tokens_length},s.prototype.next=function(){var a=null;return this.hasNext()&&(a=this.__tokens[this.__position],this.__position+=1),a},s.prototype.peek=function(a){var l=null;return a=a||0,a+=this.__position,a>=0&&a<this.__tokens_length&&(l=this.__tokens[a]),l},s.prototype.add=function(a){this.__parent_token&&(a.parent=this.__parent_token),this.__tokens.push(a),this.__tokens_length+=1},r.exports.TokenStream=s}),(function(r,s,a){var l=a(12).Pattern;function o(u,c){l.call(this,u,c),c?this._line_regexp=this._input.get_regexp(c._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}o.prototype=new l,o.prototype.__set_whitespace_patterns=function(u,c){u+="\\t ",c+="\\n\\r",this._match_pattern=this._input.get_regexp("["+u+c+"]+",!0)Line truncated
|
||||
`,b&&d.test(b)&&(g=b.match(d)[0])),b=b.replace(m,`
|
||||
`);var v=b.match(/^[\t ]*/)[0],N={text:"",type:""},S=new I,_=new f(this._options,v),L=new u(b,this._options).tokenize();this._tag_stack=new y(_);for(var D=null,k=L.next();k.type!==c.EOF;)k.type===c.TAG_OPEN||k.type===c.COMMENT?(D=this._handle_tag_open(_,k,S,N,L),S=D):k.type===c.ATTRIBUTE||k.type===c.EQUALS||k.type===c.VALUE||k.type===c.TEXT&&!S.tag_complete?D=this._handle_inside_tag(_,k,S,N):k.type===c.TAG_CLOSE?D=this._handle_tag_close(_,k,S):k.type===c.TEXT?D=this._handle_text(_,k,S):k.type===c.CONTROL_FLOW_OPEN?D=this._handle_control_flow_open(_,k):k.type===c.CONTROL_FLOW_CLOSE?D=this._handle_control_flow_close(_,k):_.add_raw_token(k),N=D,k=L.next();var R=_._output.get_code(g);return R},A.prototype._handle_control_flow_open=function(b,g){var v={text:g.text,type:g.type};return b.set_space_before_token(g.newlines||g.whitespace_before!=="",!0),g.newlines?b.print_preserved_newlines(g):b.set_space_before_token(g.newlines||g.whitespace_before!=="",!0),b.print_token(g),b.indent(),v},A.prototype._handle_control_flow_close=function(b,g){var v={text:g.text,type:g.type};return b.deindent(),g.newlines?b.print_preserved_newlines(g):b.set_space_before_token(g.newlines||g.whitespace_before!=="",!0),b.print_token(g),v},A.prototype._handle_tag_close=function(b,g,v){var N={text:g.text,type:g.type};return b.alignment_size=0,v.tag_complete=!0,b.set_space_before_token(g.newlines||g.whitespace_before!=="",!0),v.is_unformatted?b.add_raw_token(g):(v.tag_start_char==="<"&&(b.set_space_before_token(g.text[0]==="/",!0),this._is_wrap_attributes_force_expand_multiline&&v.has_wrapped_attrs&&b.print_newline(!1)),b.print_token(g)),v.indent_content&&!(v.is_unformatted||v.is_content_unformatted)&&(b.indent(),v.indent_content=!1),!v.is_inline_element&&!(v.is_unformatted||v.is_content_unformatted)&&b.set_wrap_point(),N},A.prototype._handle_inside_tag=function(b,g,v,N){var S=v.has_wrapped_attrs,_={text:g.text,type:g.type};return b.set_space_before_token(g.newlines||g.whitespace_before!=="",!0),v.is_unformatted?b.add_raw_token(g):v.tag_start_char==="{"&&g.type===c.TEXT?b.print_preserved_newlines(g)?(g.newlines=0,b.add_raw_token(g)):b.print_token(g):(g.type===c.ATTRIBUTE?b.set_space_before_token(!0):(g.type===c.EQUALS||g.type===c.VALUE&&g.previous.type===c.EQUALS)&&b.set_space_before_token(!1),g.type===c.ATTRIBUTE&&v.tag_start_char==="<"&&((this._is_wrap_attributes_preserve||this._is_wrap_attributes_preserve_aligned)&&(b.traverse_whitespace(g),S=S||g.newlines!==0),this._is_wrap_attributes_force&&v.attr_count>=this._options.wrap_attributes_min_attrs&&(N.type!==c.TAG_OPEN||this._is_wrap_attributes_force_expand_multiline)&&(b.print_newline(!1),S=!0)),b.print_token(g),S=S||b.previous_token_wrapped(),v.has_wrapped_attrs=S),_},A.prototype._handle_text=function(b,g,v){var N={text:g.text,type:"TK_CONTENT"};return v.custom_beautifier_name?this._print_custom_beatifier_text(b,g,v):v.is_unformatted||v.is_content_unformatted?b.add_raw_token(g):(b.traverse_whitespace(g),b.print_token(g)),N},A.prototype._print_custom_beatifier_text=function(b,g,v){var N=this;if(g.text!==""){var S=g.text,_,L=1,D="",k="";v.custom_beautifier_name==="javascript"&&typeof this._js_beautify=="function"?_=this._js_beautify:v.custom_beautifier_name==="css"&&typeof this._css_beautify=="function"?_=this._css_beautify:v.custom_beautifier_name==="html"&&(_=function(O,Y){var Z=new A(O,Y,N._js_beautify,N._css_beautify);return Z.beautify()}),this._options.indent_scripts==="keep"?L=0:this._options.indent_scripts==="separate"&&(L=-b.indent_level);var R=b.get_full_indent(L);if(S=S.replace(/\n[ \t]*$/,""),v.custom_beautifier_name!=="html"&&S[0]==="<"&&S.match(/^(<!--|<!\[CDATA\[)/)){var M=/^(<!--[^\n]*|<!\[CDATA\[)(\n?)([ \t\n]*)([\s\S]*)(-->|]]>)$/.exec(S);if(!M){b.add_raw_token(g);return}D=R+M[1]+`
|
||||
`,S=M[4],M[5]&&(k=R+M[5]),S=S.replace(/\n[ \t]*$/,""),(M[2]||M[3].indexOf(`
|
||||
`)!==-1)&&(M=M[3].match(/[ \t]+$/),M&&(g.whitespace_before=M[0]))}if(S)if(_){var W=function(){this.eol=`
|
||||
`};W.prototype=this._options.raw_options;var F=new W;S=_(R+S,F)}else{var U=g.whitespace_before;U&&(S=S.replace(new RegExp(`
|
||||
(`+U+")?","g"),`
|
||||
`)),S=R+S.replace(/\n/g,`
|
||||
`+R)}D&&(S?S=D+S+`
|
||||
`+k:S=D+k),b.print_newline(!1),S&&(g.text=S,g.whitespace_before="",g.newlines=0,b.add_raw_token(g),b.print_newline(!0))}},A.prototype._handle_tag_open=function(b,g,v,N,S){var _=this._get_tag_open_token(g);if((v.is_unformatted||v.is_content_unformatted)&&!v.is_empty_element&&g.type===c.TAG_OPEN&&!_.is_start_tag?(b.add_raw_token(g),_.start_tag_token=this._tag_stack.try_pop(_.tag_name)):(b.traverse_whitespace(g),this._set_tag_position(b,g,_,v,N),_.is_inline_element||b.set_wrap_point(),b.print_token(g)),_.is_start_tag&&this._is_wrap_attributes_force){var L=0,D;do D=S.peek(L),D.type===c.ATTRIBUTE&&(_.attr_count+=1),L+=1;while(D.type!==c.EOF&&D.type!==c.TAG_CLOSE)}return(this._is_wrap_attributes_force_aligned||this._is_wrap_attributes_aligned_multiple||this._is_wrap_attributes_preserve_aligned)&&(_.alignment_size=g.text.length+1),!_.tag_complete&&!_.is_unformatted&&(b.alignment_size=_.alignment_size),_};var I=function(b,g){if(this.parent=b||null,this.text="",this.type="TK_TAG_OPEN",this.tag_name="",this.is_inline_element=!1,this.is_unformatted=!1,this.is_content_unformatted=!1,this.is_empty_element=!1,this.is_start_tag=!1,this.is_end_tag=!1,this.indent_content=!1,this.multiline_content=!1,this.custom_beautifier_name=null,this.start_tag_token=null,this.attr_count=0,this.has_wrapped_attrs=!1,this.alignment_size=0,this.tag_complete=!1,this.tag_start_char="",this.tag_check="",!g)this.tag_complete=!0;else{var v;this.tag_start_char=g.text[0],this.text=g.text,this.tag_start_char==="<"?(v=g.text.match(/^<([^\s>]*)/),this.tag_check=v?v[1]:""):(v=g.text.match(/^{{~?(?:[\^]|#\*?)?([^\s}]+)/),this.tag_check=v?v[1]:"",(g.text.startsWith("{{#>")||g.text.startsWith("{{~#>"))&&this.tag_check[0]===">"&&(this.tag_check===">"&&g.next!==null?this.tag_check=g.next.text.split(" ")[0]:this.tag_check=g.text.split(">")[1])),this.tag_check=this.tag_check.toLowerCase(),g.type===c.COMMENT&&(this.tag_complete=!0),this.is_start_tag=this.tag_check.charAt(0)!=="/",this.tag_name=this.is_start_tag?this.tag_check:this.tag_check.substr(1),this.is_end_tag=!this.is_start_tag||g.closed&&g.closed.text==="/>";var N=2;this.tag_start_char==="{"&&this.text.length>=3&&this.text.charAt(2)==="~"&&(N=3),this.is_end_tag=this.is_end_tag||this.tag_start_char==="{"&&(this.text.length<3||/[^#\^]/.test(this.text.charAt(N)))}};A.prototype._get_tag_open_token=function(b){var g=new I(this._tag_stack.get_parser_token(),b);return g.alignment_size=this._options.wrap_attributes_indent_size,g.is_end_tag=g.is_end_tag||x(g.tag_check,this._options.void_elements),g.is_empty_element=g.tag_complete||g.is_start_tag&&g.is_end_tag,g.is_unformatted=!g.tag_complete&&x(g.tag_check,this._options.unformatted),g.is_content_unformatted=!g.is_empty_element&&x(g.tag_check,this._options.content_unformatted),g.is_inline_element=x(g.tag_name,this._options.inline)||this._options.inline_custom_elements&&g.tag_name.includes("-")||g.tag_start_char==="{",g},A.prototype._set_tag_position=function(b,g,v,N,S){if(v.is_empty_element||(v.is_end_tag?v.start_tag_token=this._tag_stack.try_pop(v.tag_name):(this._do_optional_end_element(v)&&(v.is_inline_element||b.print_newline(!1)),this._tag_stack.record_tag(v),(v.tag_name==="script"||v.tag_name==="style")&&!(v.is_unformatted||v.is_content_unformatted)&&(v.custom_beautifier_name=p(v.tag_check,g)))),x(v.tag_check,this._options.extra_liners)&&(b.print_newline(!1),b._output.just_added_blankline()||b.print_newline(!0)),v.is_empty_element){if(v.tag_start_char==="{"&&v.tag_check==="else"){this._tag_stack.indent_to_tag(["if","unless","each"]),v.indent_content=!0;var _=b.current_line_has_match(/{{#if/);_||b.print_newline(!1)}v.tag_name==="!--"&&S.type===c.TAG_CLOSE&&N.is_end_tag&&v.text.indexOf(`
|
||||
`)===-1||(v.is_inline_element||v.is_unformatted||b.print_newline(!1),this._calcluate_parent_multiline(b,v))}else if(v.is_end_tag){var L=!1;L=v.start_tag_token&&v.start_tag_token.multiline_content,L=L||!v.is_inline_element&&!(N.is_inline_element||N.is_unformatted)&&!(S.type===c.TAG_CLOSE&&v.start_tag_token===N)&&S.type!=="TK_CONTENT",(v.is_content_unformatted||v.is_unformatted)&&(L=!1),L&&b.print_newline(!1)}else v.indent_content=!v.custom_beautifier_name,v.tag_start_char==="<"&&(v.tag_name==="html"?v.indent_content=this._options.indent_inner_html:v.tag_name==="head"?v.indent_content=this._options.indent_head_inner_html:v.tag_name==="body"&&(v.indent_content=this._options.indent_body_inner_html)),!(v.is_inline_element||v.is_unformatted)&&(S.type!=="TK_CONTENT"||v.is_content_unformatted)&&b.print_newline(!1),this._calcluate_parent_multiline(b,v)},A.prototype._calcluate_parent_multiline=function(b,g){g.parent&&b._output.just_added_newline()&&!((g.is_inline_element||g.is_unformatted)&&g.parent.is_inline_element)&&(g.parent.multiline_content=!0)};var H=["address","article","aside","blockquote","details","div","dl","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hr","main","menu","nav","ol","p","pre","section","table","ul"],P=["a","audio","del","ins","map","noscript","video"];A.prototype._do_optional_end_element=function(b){var g=null;if(!(b.is_empty_element||!b.is_start_tag||!b.parent)){if(b.tag_name==="body")g=g||this._tag_stack.try_pop("head");else if(b.tag_name==="li")g=g||this._tag_stack.try_pop("li",["ol","ul","menu"]);else if(b.tag_name==="dd"||b.tag_name==="dt")g=g||this._tag_stack.try_pop("dt",["dl"]),g=g||this._tag_stack.try_pop("dd",["dl"]);else if(b.parent.tag_name==="p"&&H.indexOf(b.tag_name)!==-1){var v=b.parent.parent;(!v||P.indexOf(v.tag_name)===-1)&&(g=g||this._tag_stack.try_pop("p"))}else b.tag_name==="rp"||b.tag_name==="rt"?(g=g||this._tag_stack.try_pop("rt",["ruby","rtc"]),g=g||this._tag_stack.try_pop("rp",["ruby","rtc"])):b.tag_name==="optgroup"?g=g||this._tag_stack.try_pop("optgroup",["select"]):b.tag_name==="option"?g=g||this._tag_stack.try_pop("option",["select","datalist","optgroup"]):b.tag_name==="colgroup"?g=g||this._tag_stack.try_pop("caption",["table"]):b.tag_name==="thead"?(g=g||this._tag_stack.try_pop("caption",["table"]),g=g||this._tag_stack.try_pop("colgroup",["table"])):b.tag_name==="tbody"||b.tag_name==="tfoot"?(g=g||this._tag_stack.try_pop("caption",["table"]),g=g||this._tag_stack.try_pop("colgroup",["table"]),g=g||this._tag_stack.try_pop("thead",["table"]),g=g||this._tag_stack.try_pop("tbody",["table"])):b.tag_name==="tr"?(g=g||this._tag_stack.try_pop("caption",["table"]),g=g||this._tag_stack.try_pop("colgroup",["table"]),g=g||this._tag_stack.try_pop("tr",["table","thead","tbody","tfoot"])):(b.tag_name==="th"||b.tag_name==="td")&&(g=g||this._tag_stack.try_pop("td",["table","thead","tbody","tfoot","tr"]),g=g||this._tag_stack.try_pop("th",["table","thead","tbody","tfoot","tr"]));return b.parent=this._tag_stack.get_parser_token(),g}},r.exports.Beautifier=A}),(function(r,s,a){var l=a(6).Options;function o(u){l.call(this,u,"html"),this.templating.length===1&&this.templating[0]==="auto"&&(this.templating=["django","erb","handlebars","php"]),this.indent_inner_html=this._get_boolean("indent_inner_html"),this.indent_body_inner_html=this._get_boolean("indent_body_inner_html",!0),this.indent_head_inner_html=this._get_boolean("indent_head_inner_html",!0),this.indent_handlebars=this._get_boolean("indent_handlebars",!0),this.wrap_attributes=this._get_selection("wrap_attributes",["auto","force","force-aligned","force-expand-multiline","aligned-multiple","preserve","preserve-aligned"]),this.wrap_attributes_min_attrs=this._get_number("wrap_attributes_min_attrs",2),this.wrap_attributes_indent_size=this._get_number("wrap_attributes_indent_size",this.indent_size),this.extra_liners=this._get_array("extra_liners",["head","body","/html"]),this.inline=this._get_array("inline",["a","abbr","area","audio","b","bdi","bdo","br","button","canvas","cite","code","data","datalist","del","dfn","em","embed","i","iframe","img","input","ins","kbd","keygen","label","map","mark","math","meter","noscript","object","output","progress","q","ruby","s","samp","select","small","span","strong","sub","sup","svg","template","textarea","time","u","var","video","wbr","text","acronym","big","strike","tt"]),this.inline_custom_elements=this._get_boolean("inline_custom_elements",!0),this.void_elements=this._get_array("void_elements",["area","base","br","col","embed","hr","img","input","keygen","link","menuitem","meta","param","source","track","wbr","!doctype","?xml","basefont","isindex"]),this.unformatted=this._get_array("unformatted",[]),this.content_unformatted=this._get_array("content_unformatted",["pre","textarea"]),this.unformatted_content_delimiter=this._get_characters("unformatted_content_delimiter"),this.indent_scripts=this._get_selection("indent_scripts",["normal","keep","separat
Line truncated
|
||||
`,indent_scripts:we(n,"indentScripts","normal"),templating:Nc(n,"all"),unformatted_content_delimiter:we(n,"unformattedContentDelimiter","")};let o=Rc(Mc(i),l);if(s>0){const u=n.insertSpaces?qa(" ",a*s):qa(" ",s);o=o.split(`
|
||||
`).join(`
|
||||
`+u),e.start.character===0&&(o=u+o)}return[{range:e,newText:o}]}function Mc(t){return t.replace(/^\s+/,"")}function we(t,e,n){if(t&&t.hasOwnProperty(e)){const i=t[e];if(i!==null)return i}return n}function Ri(t,e,n){const i=we(t,e,null);return typeof i=="string"?i.length>0?i.split(",").map(r=>r.trim().toLowerCase()):[]:n}function Nc(t,e){const n=we(t,"templating",e);return n===!0?["auto"]:n===!1||n===e||Array.isArray(n)===!1?["none"]:n}function Ic(t,e,n){let i=e,r=0;const s=n.tabSize||4;for(;i<t.length;){const a=t.charAt(i);if(a===" ")r++;else if(a===" ")r+=s;else break;i++}return Math.floor(r/s)}function Ga(t,e){return`\r
|
||||
`.indexOf(t.charAt(e))!==-1}function Xa(t,e){return" ".indexOf(t.charAt(e))!==-1}var Ja;(()=>{var t={470:r=>{function s(o){if(typeof o!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(o))}function a(o,u){for(var c,d="",m=0,f=-1,w=0,p=0;p<=o.length;++p){if(p<o.length)c=o.charCodeAt(p);else{if(c===47)break;c=47}if(c===47){if(!(f===p-1||w===1))if(f!==p-1&&w===2){if(d.length<2||m!==2||d.charCodeAt(d.length-1)!==46||d.charCodeAt(d.length-2)!==46){if(d.length>2){var x=d.lastIndexOf("/");if(x!==d.length-1){x===-1?(d="",m=0):m=(d=d.slice(0,x)).length-1-d.lastIndexOf("/"),f=p,w=0;continue}}else if(d.length===2||d.length===1){d="",m=0,f=p,w=0;continue}}u&&(d.length>0?d+="/..":d="..",m=2)}else d.length>0?d+="/"+o.slice(f+1,p):d=o.slice(f+1,p),m=p-f-1;f=p,w=0}else c===46&&w!==-1?++w:w=-1}return d}var l={resolve:function(){for(var o,u="",c=!1,d=arguments.length-1;d>=-1&&!c;d--){var m;d>=0?m=arguments[d]:(o===void 0&&(o=process.cwd()),m=o),s(m),m.length!==0&&(u=m+"/"+u,c=m.charCodeAt(0)===47)}return u=a(u,!c),c?u.length>0?"/"+u:"/":u.length>0?u:"."},normalize:function(o){if(s(o),o.length===0)return".";var u=o.charCodeAt(0)===47,c=o.charCodeAt(o.length-1)===47;return(o=a(o,!u)).length!==0||u||(o="."),o.length>0&&c&&(o+="/"),u?"/"+o:o},isAbsolute:function(o){return s(o),o.length>0&&o.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var o,u=0;u<arguments.length;++u){var c=arguments[u];s(c),c.length>0&&(o===void 0?o=c:o+="/"+c)}return o===void 0?".":l.normalize(o)},relative:function(o,u){if(s(o),s(u),o===u||(o=l.resolve(o))===(u=l.resolve(u)))return"";for(var c=1;c<o.length&&o.charCodeAt(c)===47;++c);for(var d=o.length,m=d-c,f=1;f<u.length&&u.charCodeAt(f)===47;++f);for(var w=u.length-f,p=m<w?m:w,x=-1,T=0;T<=p;++T){if(T===p){if(w>p){if(u.charCodeAt(f+T)===47)return u.slice(f+T+1);if(T===0)return u.slice(f+T)}else m>p&&(o.charCodeAt(c+T)===47?x=T:T===0&&(x=0));break}var y=o.charCodeAt(c+T);if(y!==u.charCodeAt(f+T))break;y===47&&(x=T)}var A="";for(T=c+x+1;T<=d;++T)T!==d&&o.charCodeAt(T)!==47||(A.length===0?A+="..":A+="/..");return A.length>0?A+u.slice(f+x):(f+=x,u.charCodeAt(f)===47&&++f,u.slice(f))},_makeLong:function(o){return o},dirname:function(o){if(s(o),o.length===0)return".";for(var u=o.charCodeAt(0),c=u===47,d=-1,m=!0,f=o.length-1;f>=1;--f)if((u=o.charCodeAt(f))===47){if(!m){d=f;break}}else m=!1;return d===-1?c?"/":".":c&&d===1?"//":o.slice(0,d)},basename:function(o,u){if(u!==void 0&&typeof u!="string")throw new TypeError('"ext" argument must be a string');s(o);var c,d=0,m=-1,f=!0;if(u!==void 0&&u.length>0&&u.length<=o.length){if(u.length===o.length&&u===o)return"";var w=u.length-1,p=-1;for(c=o.length-1;c>=0;--c){var x=o.charCodeAt(c);if(x===47){if(!f){d=c+1;break}}else p===-1&&(f=!1,p=c+1),w>=0&&(x===u.charCodeAt(w)?--w==-1&&(m=c):(w=-1,m=p))}return d===m?m=p:m===-1&&(m=o.length),o.slice(d,m)}for(c=o.length-1;c>=0;--c)if(o.charCodeAt(c)===47){if(!f){d=c+1;break}}else m===-1&&(f=!1,m=c+1);return m===-1?"":o.slice(d,m)},extname:function(o){s(o);for(var u=-1,c=0,d=-1,m=!0,f=0,w=o.length-1;w>=0;--w){var p=o.charCodeAt(w);if(p!==47)d===-1&&(m=!1,d=w+1),p===46?u===-1?u=w:f!==1&&(f=1):u!==-1&&(f=-1);else if(!m){c=w+1;break}}return u===-1||d===-1||f===0||f===1&&u===d-1&&u===c+1?"":o.slice(u,d)},format:function(o){if(o===null||typeof o!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof o);return(function(u,c){var d=c.dir||c.root,m=c.base||(c.name||"")+(c.ext||"");return d?d===c.root?d+m:d+"/"+m:m})(0,o)},parse:function(o){s(o);var u={root:"",dir:"",base:"",ext:"",name:""};if(o.length===0)return u;var c,d=o.charCodeAt(0),m=d===47;m?(u.root="/",c=1):c=0;for(var f=-1,w=0,p=-1,x=!0,T=o.length-1,y=0;T>=c;--T)if((d=o.charCodeAt(T))!==47)p===-1&&(x=!1,p=T+1),d===46?f===-1?f=T:y!==1&&(y=1):f!==-1&&(y=-1);else if(!x){w=T+1;break}return f===-1||p===-1||y===0||y===1&&f===p-1&&f===w+1?p!==-1&&(u.base=u.name=w===0&&m?o.slice(1,p):o.slice(w,p)):(w===0&&m?(u.name=o.slice(1,f),u.base=o.slice(1,p)):(u.name=o.slice(w,f),u.base=o.slice(w,p)),u.ext=o.slice(f,p)),w>0?u.dir=o.slice(0,w-1):m&&(u.dir="/"),u},sep:"/",delimiter:":",win32:null,posix:null};l.posix=l,r.exports=l}},e={};function n(r){var s=e[r];if(s!==void 0)return s.exports;var a=e[r]={exports:{}};return t[r](a,a.exports,n),a.exports}n.d=(r,s)=>{for(var a in s)n.o(s,a)&&!n.o(r,a)&&Object.defineProperty(r,a,{enumerable:!0,get:s[a]})},n.o=(r,s)=>Object.prototype.hasOwnProperty.call(r,s),n.r=r=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(r,"__esModule",{value:!0})};var i={};(()=>{let r;n.r(i),n.d(i,{URI:()=>m,Utils:()=>N}),typeof process=="object"?r=process.platform==="win32":typeof navigator=="object"&&(r=navigator.userAgent.indexOf("Windows")>=0);const s=/^\w[\w\d+.-]*$/,a=/^\//,l=/^\/\//;function o(S,_){if(!S.scheme&&_)throw new Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${S.authoriLine truncated
|
||||
|
||||
This metadata name is associated with the value contained by the [\`content\`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/meta#attr-content) attribute. The possible values for the name attribute are:
|
||||
|
||||
* \`application-name\` which defines the name of the application running in the web page.
|
||||
|
||||
**Note:**
|
||||
|
||||
* Browsers may use this to identify the application. It is different from the [\`<title>\`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/title "The HTML Title element (<title>) defines the document's title that is shown in a browser's title bar or a page's tab.") element, which usually contain the application name, but may also contain information like the document name or a status.
|
||||
* Simple web pages shouldn't define an application-name.
|
||||
|
||||
* \`author\` which defines the name of the document's author.
|
||||
* \`description\` which contains a short and accurate summary of the content of the page. Several browsers, like Firefox and Opera, use this as the default description of bookmarked pages.
|
||||
* \`generator\` which contains the identifier of the software that generated the page.
|
||||
* \`keywords\` which contains words relevant to the page's content separated by commas.
|
||||
* \`referrer\` which controls the [\`Referer\` HTTP header](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Referer) attached to requests sent from the document:
|
||||
|
||||
Values for the \`content\` attribute of \`<meta name="referrer">\`
|
||||
|
||||
\`no-referrer\`
|
||||
|
||||
Do not send a HTTP \`Referrer\` header.
|
||||
|
||||
\`origin\`
|
||||
|
||||
Send the [origin](https://developer.mozilla.org/en-US/docs/Glossary/Origin) of the document.
|
||||
|
||||
\`no-referrer-when-downgrade\`
|
||||
|
||||
Send the [origin](https://developer.mozilla.org/en-US/docs/Glossary/Origin) as a referrer to URLs as secure as the current page, (https→https), but does not send a referrer to less secure URLs (https→http). This is the default behaviour.
|
||||
|
||||
\`origin-when-cross-origin\`
|
||||
|
||||
Send the full URL (stripped of parameters) for same-origin requests, but only send the [origin](https://developer.mozilla.org/en-US/docs/Glossary/Origin) for other cases.
|
||||
|
||||
\`same-origin\`
|
||||
|
||||
A referrer will be sent for [same-site origins](https://developer.mozilla.org/en-US/docs/Web/Security/Same-origin_policy), but cross-origin requests will contain no referrer information.
|
||||
|
||||
\`strict-origin\`
|
||||
|
||||
Only send the origin of the document as the referrer to a-priori as-much-secure destination (HTTPS->HTTPS), but don't send it to a less secure destination (HTTPS->HTTP).
|
||||
|
||||
\`strict-origin-when-cross-origin\`
|
||||
|
||||
Send a full URL when performing a same-origin request, only send the origin of the document to a-priori as-much-secure destination (HTTPS->HTTPS), and send no header to a less secure destination (HTTPS->HTTP).
|
||||
|
||||
\`unsafe-URL\`
|
||||
|
||||
Send the full URL (stripped of parameters) for same-origin or cross-origin requests.
|
||||
|
||||
**Notes:**
|
||||
|
||||
* Some browsers support the deprecated values of \`always\`, \`default\`, and \`never\` for referrer.
|
||||
* Dynamically inserting \`<meta name="referrer">\` (with [\`document.write\`](https://developer.mozilla.org/en-US/docs/Web/API/Document/write) or [\`appendChild\`](https://developer.mozilla.org/en-US/docs/Web/API/Node/appendChild)) makes the referrer behaviour unpredictable.
|
||||
* When several conflicting policies are defined, the no-referrer policy is applied.
|
||||
|
||||
|
||||
This attribute may also have a value taken from the extended list defined on [WHATWG Wiki MetaExtensions page](https://wiki.whatwg.org/wiki/MetaExtensions). Although none have been formally accepted yet, a few commonly used names are:
|
||||
|
||||
* \`creator\` which defines the name of the creator of the document, such as an organization or institution. If there are more than one, several [\`<meta>\`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/meta "The HTML <meta> element represents metadata that cannot be represented by other HTML meta-related elements, like <base>, <link>, <script>, <style> or <title>.") elements should be used.
|
||||
* \`googlebot\`, a synonym of \`robots\`, is only followed by Googlebot (the indexing crawler for Google).
|
||||
* \`publisher\` which defines the name of the document's publisher.
|
||||
* \`robots\` which defines the behaviour that cooperative crawlers, or "robots", should use with the page. It is a comma-separated list of the values below:
|
||||
|
||||
Values for the content of \`<meta name="robots">\`
|
||||
|
||||
Value
|
||||
|
||||
Description
|
||||
|
||||
Used by
|
||||
|
||||
\`index\`
|
||||
|
||||
Allows the robot to index the page (default).
|
||||
|
||||
All
|
||||
|
||||
\`noindex\`
|
||||
|
||||
Requests the robot to not index the page.
|
||||
|
||||
All
|
||||
|
||||
\`follow\`
|
||||
|
||||
Allows the robot to follow the links on the page (default).
|
||||
|
||||
All
|
||||
|
||||
\`nofollow\`
|
||||
|
||||
Requests the robot to not follow the links on the page.
|
||||
|
||||
All
|
||||
|
||||
\`none\`
|
||||
|
||||
Equivalent to \`noindex, nofollow\`
|
||||
|
||||
[Google](https://support.google.com/webmasters/answer/79812)
|
||||
|
||||
\`noodp\`
|
||||
|
||||
Prevents using the [Open Directory Project](https://www.dmoz.org/) description, if any, as the page description in search engine results.
|
||||
|
||||
[Google](https://support.google.com/webmasters/answer/35624#nodmoz), [Yahoo](https://help.yahoo.com/kb/search-for-desktop/meta-tags-robotstxt-yahoo-search-sln2213.html#cont5), [Bing](https://www.bing.com/webmaster/help/which-robots-metatags-does-bing-support-5198d240)
|
||||
|
||||
\`noarchive\`
|
||||
|
||||
Requests the search engine not to cache the page content.
|
||||
|
||||
[Google](https://developers.google.com/webmasters/control-crawl-index/docs/robots_meta_tag#valid-indexing--serving-directives), [Yahoo](https://help.yahoo.com/kb/search-for-desktop/SLN2213.html), [Bing](https://www.bing.com/webmaster/help/which-robots-metatags-does-bing-support-5198d240)
|
||||
|
||||
\`nosnippet\`
|
||||
|
||||
Prevents displaying any description of the page in search engine results.
|
||||
|
||||
[Google](https://developers.google.com/webmasters/control-crawl-index/docs/robots_meta_tag#valid-indexing--serving-directives), [Bing](https://www.bing.com/webmaster/help/which-robots-metatags-does-bing-support-5198d240)
|
||||
|
||||
\`noimageindex\`
|
||||
|
||||
Requests this page not to appear as the referring page of an indexed image.
|
||||
|
||||
[Google](https://developers.google.com/webmasters/control-crawl-index/docs/robots_meta_tag#valid-indexing--serving-directives)
|
||||
|
||||
\`nocache\`
|
||||
|
||||
Synonym of \`noarchive\`.
|
||||
|
||||
[Bing](https://www.bing.com/webmaster/help/which-robots-metatags-does-bing-support-5198d240)
|
||||
|
||||
**Notes:**
|
||||
|
||||
* Only cooperative robots follow these rules. Do not expect to prevent e-mail harvesters with them.
|
||||
* The robot still needs to access the page in order to read these rules. To prevent bandwidth consumption, use a _[robots.txt](https://developer.mozilla.org/en-US/docs/Glossary/robots.txt "robots.txt: Robots.txt is a file which is usually placed in the root of any website. It decides whether crawlers are permitted or forbidden access to the web site.")_ file.
|
||||
* If you want to remove a page, \`noindex\` will work, but only after the robot visits the page again. Ensure that the \`robots.txt\` file is not preventing revisits.
|
||||
* Some values are mutually exclusive, like \`index\` and \`noindex\`, or \`follow\` and \`nofollow\`. In these cases the robot's behaviour is undefined and may vary between them.
|
||||
* Some crawler robots, like Google, Yahoo and Bing, support the same values for the HTTP header \`X-Robots-Tag\`; this allows non-HTML documents like images to use these rules.
|
||||
|
||||
* \`slurp\`, is a synonym of \`robots\`, but only for Slurp - the crawler for Yahoo Search.
|
||||
* \`viewport\`, which gives hints about the size of the initial size of the [viewport](https://developer.mozilla.org/en-US/docs/Glossary/viewport "viewport: A viewport represents a polygonal (normally rectangular) area in computer graphics that is currently being viewed. In web browser terms, it refers to the part of the document you're viewing which is currently visible in its window (or the screen, if the document is being viewed in full screen mode). Content outside the viewport is not visible onscreen until scrolled into view."). Used by mobile devices only.
|
||||
|
||||
Values for the content of \`<meta name="viewport">\`
|
||||
|
||||
Value
|
||||
|
||||
Possible subvalues
|
||||
|
||||
Description
|
||||
|
||||
\`width\`
|
||||
|
||||
A positive integer number, or the text \`device-width\`
|
||||
|
||||
Defines the pixel width of the viewport that you want the web site to be rendered at.
|
||||
|
||||
\`height\`
|
||||
|
||||
A positive integer, or the text \`device-height\`
|
||||
|
||||
Defines the height of the viewport. Not used by any browser.
|
||||
|
||||
\`initial-scale\`
|
||||
|
||||
A positive number between \`0.0\` and \`10.0\`
|
||||
|
||||
Defines the ratio between the device width (\`device-width\` in portrait mode or \`device-height\` in landscape mode) and the viewport size.
|
||||
|
||||
\`maximum-scale\`
|
||||
|
||||
A positive number between \`0.0\` and \`10.0\`
|
||||
|
||||
Defines the maximum amount to zoom in. It must be greater or equal to the \`minimum-scale\` or the behaviour is undefined. Browser settings can ignore this rule and iOS10+ ignores it by default.
|
||||
|
||||
\`minimum-scale\`
|
||||
|
||||
A positive number between \`0.0\` and \`10.0\`
|
||||
|
||||
Defines the minimum zoom level. It must be smaller or equal to the \`maximum-scale\` or the behaviour is undefined. Browser settings can ignore this rule and iOS10+ ignores it by default.
|
||||
|
||||
\`user-scalable\`
|
||||
|
||||
\`yes\` or \`no\`
|
||||
|
||||
If set to \`no\`, the user is not able to zoom in the webpage. The default is \`yes\`. Browser settings can ignore this rule, and iOS10+ ignores it by default.
|
||||
|
||||
Specification
|
||||
|
||||
Status
|
||||
|
||||
Comment
|
||||
|
||||
[CSS Device Adaptation
|
||||
The definition of '<meta name="viewport">' in that specification.](https://drafts.csswg.org/css-device-adapt/#viewport-meta)
|
||||
|
||||
Working Draft
|
||||
|
||||
Non-normatively describes the Viewport META element
|
||||
|
||||
See also: [\`@viewport\`](https://developer.mozilla.org/en-US/docs/Web/CSS/@viewport "The @viewport CSS at-rule lets you configure the viewport through which the document is viewed. It's primarily used for mobile devices, but is also used by desktop browsers that support features like "snap to edge" (such as Microsoft Edge).")
|
||||
|
||||
**Notes:**
|
||||
|
||||
* Though unstandardized, this declaration is respected by most mobile browsers due to de-facto dominance.
|
||||
* The default values may vary between devices and browsers.
|
||||
* To learn about this declaration in Firefox for Mobile, see [this article](https://developer.mozilla.org/en-US/docs/Mobile/Viewport_meta_tag "Mobile/Viewport meta tag").`}},{name:"http-equiv",description:{kind:"markdown",value:'Defines a pragma directive. The attribute is named `**http-equiv**(alent)` because all the allowed values are names of particular HTTP headers:\n\n* `"content-language"` \n Defines the default language of the page. It can be overridden by the [lang](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/lang) attribute on any element.\n \n **Warning:** Do not use this value, as it is obsolete. Prefer the `lang` attribute on the [`<html>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/html "The HTML <html> element represents the root (top-level element) of an HTML document, so it is also referred to as the root element. All other elements must be descendants of this element.") element.\n \n* `"content-security-policy"` \n Allows page authors to define a [content policy](https://developer.mozilla.org/en-US/docs/Web/Security/CSP/CSP_policy_directives) for the current page. Content policies mostly specify allowed server origins and script endpoints which help guard against cross-site scripting attacks.\n* `"content-type"` \n Defines the [MIME type](https://developer.mozilla.org/en-US/docs/Glossary/MIME_type) of the document, followed by its character encoding. It follows the same syntax as the HTTP `content-type` entity-header field, but as it is inside a HTML page, most values other than `text/html` are impossible. Therefore the valid syntax for its `content` is the string \'`text/html`\' followed by a character set with the following syntax: \'`; charset=_IANAcharset_`\', where `IANAcharset` is the _preferred MIME name_ for a character set as [defined by the IANA.](https://www.iana.org/assignments/character-sets)\n \n **Warning:** Do not use this value, as it is obsolete. Use the [`charset`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/meta#attr-charset) attribute on the [`<meta>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/meta "The HTML <meta> element represents metadata that cannot be represented by other HTML meta-related elements, like <base>, <link>, <script>, <style> or <title>.") element.\n \n **Note:** As [`<meta>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/meta "The HTML <meta> element represents metadata that cannot be represented by other HTML meta-related elements, like <base>, <link>, <script>, <style> or <title>.") can\'t change documents\' types in XHTML or HTML5\'s XHTML serialization, never set the MIME type to an XHTML MIME type with `<meta>`.\n \n* `"refresh"` \n This instruction specifies:\n * The number of seconds until the page should be reloaded - only if the [`content`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/meta#attr-content) attribute contains a positive integer.\n * The number of seconds until the page should redirect to another - only if the [`content`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/meta#attr-content) attribute contains a positive integer followed by the string \'`;url=`\', and a valid URL.\n* `"set-cookie"` \n Defines a [cookie](https://developer.mozilla.org/en-US/docs/cookie) for the page. Its content must follow the syntax defined in the [IETF HTTP Cookie Specification](https://tools.ietf.org/html/draft-ietf-httpstate-cookie-14).\n \n **Warning:** Do not use this instruction, as it is obsolete. Use the HTTP header [`Set-Cookie`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Set-Cookie) instead.'}},{name:"content",description:{kind:"markdown",value:"This attribute contains the value for the [`http-equiv`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/meta#attr-http-equiv) or [`name`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/meta#attr-name) attribute, depending on which is used."}},{name:"charset",description:{kind:"markdown",value:'This attribute declares the page\'s character encoding. It must contain a [standard IANA MIME name for character encodings](https://www.iana.org/assignments/character-sets). Although the standard doesn\'t request a specific encoding, it suggests:\n\n* Authors are encouraged to use [`UTF-8`](https://developer.mozilla.org/en-US/docs/Glossary/UTF-8).\n* Authors should not use ASCII-incompatible encodings to avoid security risk: browsers not supporting them may interpret harmful content as HTML. This happens with the `JIS_C6226-1983`, `JIS_X0212-1990`, `HZ-GB-2312`, `JOHAB`, the ISO-2022 family and the EBCDIC family.\n\n**Note:** ASCII-incompatible encodings are those that don\'t map the 8-bit code points `0x20` to `0x7E` to the `0x0020` to `0x007E` Unicode code points)\n\n* Authors **must not** use `CESU-8`, `UTF-7`, `BOCU-1` and/or `SCSU` as [cross-site scripting](https://developer.mozilla.org
Line truncated
|
||||
\`sync\`
|
||||
|
||||
Decode the image synchronously for atomic presentation with other content.
|
||||
|
||||
\`async\`
|
||||
|
||||
Decode the image asynchronously to reduce delay in presenting other content.
|
||||
|
||||
\`auto\`
|
||||
|
||||
Default mode, which indicates no preference for the decoding mode. The browser decides what is best for the user.`}},{name:"loading",valueSet:"loading",description:{kind:"markdown",value:"Indicates how the browser should load the image."}},{name:"referrerpolicy",valueSet:"referrerpolicy",description:{kind:"markdown",value:"A string indicating which referrer to use when fetching the resource:\n\n* `no-referrer:` The [`Referer`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Referer \"The Referer request header contains the address of the previous web page from which a link to the currently requested page was followed. The Referer header allows servers to identify where people are visiting them from and may use that data for analytics, logging, or optimized caching, for example.\") header will not be sent.\n* `no-referrer-when-downgrade:` No `Referer` header will be sent when navigating to an origin without TLS (HTTPS). This is a user agent’s default behavior if no policy is otherwise specified.\n* `origin:` The `Referer` header will include the page of origin's scheme, the host, and the port.\n* `origin-when-cross-origin:` Navigating to other origins will limit the included referral data to the scheme, the host and the port, while navigating from the same origin will include the referrer's full path.\n* `unsafe-url:` The `Referer` header will include the origin and the path, but not the fragment, password, or username. This case is unsafe because it can leak origins and paths from TLS-protected resources to insecure origins."}},{name:"sizes",description:{kind:"markdown",value:"A list of one or more strings separated by commas indicating a set of source sizes. Each source size consists of:\n\n1. a media condition. This must be omitted for the last item.\n2. a source size value.\n\nSource size values specify the intended display size of the image. User agents use the current source size to select one of the sources supplied by the `srcset` attribute, when those sources are described using width ('`w`') descriptors. The selected source size affects the intrinsic size of the image (the image’s display size if no CSS styling is applied). If the `srcset` attribute is absent, or contains no values with a width (`w`) descriptor, then the `sizes` attribute has no effect."}},{name:"importance",description:"Indicates the relative importance of the resource. Priority hints are delegated using the values:"},{name:"importance",description:"`auto`: Indicates **no preference**. The browser may use its own heuristics to decide the priority of the image.\n\n`high`: Indicates to the browser that the image is of **high** priority.\n\n`low`: Indicates to the browser that the image is of **low** priority."},{name:"intrinsicsize",description:"This attribute tells the browser to ignore the actual intrinsic size of the image and pretend it’s the size specified in the attribute. Specifically, the image would raster at these dimensions and `naturalWidth`/`naturalHeight` on images would return the values specified in this attribute. [Explainer](https://github.com/ojanvafai/intrinsicsize-attribute), [examples](https://googlechrome.github.io/samples/intrinsic-size/index.html)"}],references:[{name:"MDN Reference",url:"https://developer.mozilla.org/docs/Web/HTML/Element/img"}]},{name:"iframe",description:{kind:"markdown",value:"The iframe element represents a nested browsing context."},attributes:[{name:"src",description:{kind:"markdown",value:'The URL of the page to embed. Use a value of `about:blank` to embed an empty page that conforms to the [same-origin policy](https://developer.mozilla.org/en-US/docs/Web/Security/Same-origin_policy#Inherited_origins). Also note that programatically removing an `<iframe>`\'s src attribute (e.g. via [`Element.removeAttribute()`](https://developer.mozilla.org/en-US/docs/Web/API/Element/removeAttribute "The Element method removeAttribute() removes the attribute with the specified name from the element.")) causes `about:blank` to be loaded in the frame in Firefox (from version 65), Chromium-based browsers, and Safari/iOS.'}},{name:"srcdoc",description:{kind:"markdown",value:"Inline HTML to embed, overriding the `src` attribute. If a browser does not support the `srcdoc` attribute, it will fall back to the URL in the `src` attribute."}},{name:"name",description:{kind:"markdown",value:'A targetable name for the embedded browsing context. This can be used in the `target` attribute of the [`<a>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a "The HTML <a> element (or anchor element) creates a hyperlink to other web pages, files, locations within the same page, email addresses, or any other URL."), [`<form>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/form "The HTML <form> element represents a document section that contains interactive controls for submitting information to a web server."), or [`<base>`](https://developer.mozilla.org/en-US/doc
Line truncated
|
||||
|
||||
\`auto\` (default)
|
||||
|
||||
No preference. The browser uses its own heuristics to decide the priority of the resource.
|
||||
|
||||
\`high\`
|
||||
|
||||
The resource should be downloaded before other lower-priority page resources.
|
||||
|
||||
\`low\`
|
||||
|
||||
The resource should be downloaded after other higher-priority page resources.`},{name:"referrerpolicy",description:'Indicates which [referrer](https://developer.mozilla.org/en-US/docs/Web/API/Document/referrer) to send when fetching the frame\'s resource:\n\n* `no-referrer`: The [`Referer`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Referer "The Referer request header contains the address of the previous web page from which a link to the currently requested page was followed. The Referer header allows servers to identify where people are visiting them from and may use that data for analytics, logging, or optimized caching, for example.") header will not be sent.\n* `no-referrer-when-downgrade` (default): The [`Referer`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Referer "The Referer request header contains the address of the previous web page from which a link to the currently requested page was followed. The Referer header allows servers to identify where people are visiting them from and may use that data for analytics, logging, or optimized caching, for example.") header will not be sent to [origin](https://developer.mozilla.org/en-US/docs/Glossary/origin "origin: Web content\'s origin is defined by the scheme (protocol), host (domain), and port of the URL used to access it. Two objects have the same origin only when the scheme, host, and port all match.")s without [TLS](https://developer.mozilla.org/en-US/docs/Glossary/TLS "TLS: Transport Layer Security (TLS), previously known as Secure Sockets Layer (SSL), is a protocol used by applications to communicate securely across a network, preventing tampering with and eavesdropping on email, web browsing, messaging, and other protocols.") ([HTTPS](https://developer.mozilla.org/en-US/docs/Glossary/HTTPS "HTTPS: HTTPS (HTTP Secure) is an encrypted version of the HTTP protocol. It usually uses SSL or TLS to encrypt all communication between a client and a server. This secure connection allows clients to safely exchange sensitive data with a server, for example for banking activities or online shopping.")).\n* `origin`: The sent referrer will be limited to the origin of the referring page: its [scheme](https://developer.mozilla.org/en-US/docs/Archive/Mozilla/URIScheme), [host](https://developer.mozilla.org/en-US/docs/Glossary/host "host: A host is a device connected to the Internet (or a local network). Some hosts called servers offer additional services like serving webpages or storing files and emails."), and [port](https://developer.mozilla.org/en-US/docs/Glossary/port "port: For a computer connected to a network with an IP address, a port is a communication endpoint. Ports are designated by numbers, and below 1024 each port is associated by default with a specific protocol.").\n* `origin-when-cross-origin`: The referrer sent to other origins will be limited to the scheme, the host, and the port. Navigations on the same origin will still include the path.\n* `same-origin`: A referrer will be sent for [same origin](https://developer.mozilla.org/en-US/docs/Glossary/Same-origin_policy "same origin: The same-origin policy is a critical security mechanism that restricts how a document or script loaded from one origin can interact with a resource from another origin."), but cross-origin requests will contain no referrer information.\n* `strict-origin`: Only send the origin of the document as the referrer when the protocol security level stays the same (HTTPS→HTTPS), but don\'t send it to a less secure destination (HTTPS→HTTP).\n* `strict-origin-when-cross-origin`: Send a full URL when performing a same-origin request, only send the origin when the protocol security level stays the same (HTTPS→HTTPS), and send no header to a less secure destination (HTTPS→HTTP).\n* `unsafe-url`: The referrer will include the origin _and_ the path (but not the [fragment](https://developer.mozilla.org/en-US/docs/Web/API/HTMLHyperlinkElementUtils/hash), [password](https://developer.mozilla.org/en-US/docs/Web/API/HTMLHyperlinkElementUtils/password), or [username](https://developer.mozilla.org/en-US/docs/Web/API/HTMLHyperlinkElementUtils/username)). **This value is unsafe**, because it leaks origins and paths from TLS-protected resources to insecure origins.'}],references:[{name:"MDN Reference",url:"https://developer.mozilla.org/docs/Web/HTML/Element/iframe"}]},{name:"embed",description:{kind:"markdown",value:"The embed element provides an integration point for an external (typically non-HTML) application or interactive content."},void:!0,attributes:[{name:"src",description:{kind:"markdown",value:"The URL of the resource being embedded."}},{name:"type",description:{kind:"markdown",value:"The MIME type to use to select the plug-in to instantiate."}},{name:"width",description:{kind:"markdown",value:"The displayed width of the resource, in [CSS pixels](https://drafts.csswg.org/css-values/#px). This must be an absolute value; percentage
Line truncated
|
||||
|
||||
* data: Default value. The value is passed to the object's implementation as a string.
|
||||
* ref: The value is a URI to a resource where run-time values are stored.
|
||||
* object: An ID of another [\`<object>\`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/object "The HTML <object> element represents an external resource, which can be treated as an image, a nested browsing context, or a resource to be handled by a plugin.") in the same document.`}],references:[{name:"MDN Reference",url:"https://developer.mozilla.org/docs/Web/HTML/Element/param"}]},{name:"video",description:{kind:"markdown",value:"A video element is used for playing videos or movies, and audio files with captions."},attributes:[{name:"src"},{name:"crossorigin",valueSet:"xo"},{name:"poster"},{name:"preload",valueSet:"pl"},{name:"autoplay",valueSet:"v",description:{kind:"markdown",value:'A Boolean attribute; if specified, the video automatically begins to play back as soon as it can do so without stopping to finish loading the data.\n**Note**: Sites that automatically play audio (or video with an audio track) can be an unpleasant experience for users, so it should be avoided when possible. If you must offer autoplay functionality, you should make it opt-in (requiring a user to specifically enable it). However, this can be useful when creating media elements whose source will be set at a later time, under user control.\n\nTo disable video autoplay, `autoplay="false"` will not work; the video will autoplay if the attribute is there in the `<video>` tag at all. To remove autoplay the attribute needs to be removed altogether.\n\nIn some browsers (e.g. Chrome 70.0) autoplay is not working if no `muted` attribute is present.'}},{name:"mediagroup"},{name:"loop",valueSet:"v"},{name:"muted",valueSet:"v"},{name:"controls",valueSet:"v"},{name:"width"},{name:"height"}],references:[{name:"MDN Reference",url:"https://developer.mozilla.org/docs/Web/HTML/Element/video"}]},{name:"audio",description:{kind:"markdown",value:"An audio element represents a sound or audio stream."},attributes:[{name:"src",description:{kind:"markdown",value:'The URL of the audio to embed. This is subject to [HTTP access controls](https://developer.mozilla.org/en-US/docs/HTTP_access_control). This is optional; you may instead use the [`<source>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/source "The HTML <source> element specifies multiple media resources for the <picture>, the <audio> element, or the <video> element.") element within the audio block to specify the audio to embed.'}},{name:"crossorigin",valueSet:"xo",description:{kind:"markdown",value:'This enumerated attribute indicates whether to use CORS to fetch the related image. [CORS-enabled resources](https://developer.mozilla.org/en-US/docs/CORS_Enabled_Image) can be reused in the [`<canvas>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/canvas "Use the HTML <canvas> element with either the canvas scripting API or the WebGL API to draw graphics and animations.") element without being _tainted_. The allowed values are:\n\nanonymous\n\nSends a cross-origin request without a credential. In other words, it sends the `Origin:` HTTP header without a cookie, X.509 certificate, or performing HTTP Basic authentication. If the server does not give credentials to the origin site (by not setting the `Access-Control-Allow-Origin:` HTTP header), the image will be _tainted_, and its usage restricted.\n\nuse-credentials\n\nSends a cross-origin request with a credential. In other words, it sends the `Origin:` HTTP header with a cookie, a certificate, or performing HTTP Basic authentication. If the server does not give credentials to the origin site (through `Access-Control-Allow-Credentials:` HTTP header), the image will be _tainted_ and its usage restricted.\n\nWhen not present, the resource is fetched without a CORS request (i.e. without sending the `Origin:` HTTP header), preventing its non-tainted used in [`<canvas>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/canvas "Use the HTML <canvas> element with either the canvas scripting API or the WebGL API to draw graphics and animations.") elements. If invalid, it is handled as if the enumerated keyword **anonymous** was used. See [CORS settings attributes](https://developer.mozilla.org/en-US/docs/HTML/CORS_settings_attributes) for additional information.'}},{name:"preload",valueSet:"pl",description:{kind:"markdown",value:"This enumerated attribute is intended to provide a hint to the browser about what the author thinks will lead to the best user experience. It may have one of the following values:\n\n* `none`: Indicates that the audio should not be preloaded.\n* `metadata`: Indicates that only audio metadata (e.g. length) is fetched.\n* `auto`: Indicates that the whole audio file can be downloaded, even if the user is not expected to use it.\n* _empty string_: A synonym of the `auto` value.\n\nIf not set, `preload`'s default value is browser-defined (i.e. each browser may have its own default value). The spec advises it to be set to `metadata`.\n\n**Usage notes:**\n\n* The `autoplay` attriLine truncated
|
||||
|
||||
**Note**: Sites that automatically play audio (or videos with an audio track) can be an unpleasant experience for users, so should be avoided when possible. If you must offer autoplay functionality, you should make it opt-in (requiring a user to specifically enable it). However, this can be useful when creating media elements whose source will be set at a later time, under user control.`}},{name:"mediagroup"},{name:"loop",valueSet:"v",description:{kind:"markdown",value:"A Boolean attribute: if specified, the audio player will automatically seek back to the start upon reaching the end of the audio."}},{name:"muted",valueSet:"v",description:{kind:"markdown",value:"A Boolean attribute that indicates whether the audio will be initially silenced. Its default value is `false`."}},{name:"controls",valueSet:"v",description:{kind:"markdown",value:"If this attribute is present, the browser will offer controls to allow the user to control audio playback, including volume, seeking, and pause/resume playback."}}],references:[{name:"MDN Reference",url:"https://developer.mozilla.org/docs/Web/HTML/Element/audio"}]},{name:"source",description:{kind:"markdown",value:"The source element allows authors to specify multiple alternative media resources for media elements. It does not represent anything on its own."},void:!0,attributes:[{name:"src",description:{kind:"markdown",value:'Required for [`<audio>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/audio "The HTML <audio> element is used to embed sound content in documents. It may contain one or more audio sources, represented using the src attribute or the <source> element: the browser will choose the most suitable one. It can also be the destination for streamed media, using a MediaStream.") and [`<video>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/video "The HTML Video element (<video>) embeds a media player which supports video playback into the document."), address of the media resource. The value of this attribute is ignored when the `<source>` element is placed inside a [`<picture>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/picture "The HTML <picture> element contains zero or more <source> elements and one <img> element to provide versions of an image for different display/device scenarios.") element.'}},{name:"type",description:{kind:"markdown",value:"The MIME-type of the resource, optionally with a `codecs` parameter. See [RFC 4281](https://tools.ietf.org/html/rfc4281) for information about how to specify codecs."}},{name:"sizes",description:'Is a list of source sizes that describes the final rendered width of the image represented by the source. Each source size consists of a comma-separated list of media condition-length pairs. This information is used by the browser to determine, before laying the page out, which image defined in [`srcset`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/source#attr-srcset) to use. \nThe `sizes` attribute has an effect only when the [`<source>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/source "The HTML <source> element specifies multiple media resources for the <picture>, the <audio> element, or the <video> element.") element is the direct child of a [`<picture>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/picture "The HTML <picture> element contains zero or more <source> elements and one <img> element to provide versions of an image for different display/device scenarios.") element.'},{name:"srcset",description:"A list of one or more strings separated by commas indicating a set of possible images represented by the source for the browser to use. Each string is composed of:\n\n1. one URL to an image,\n2. a width descriptor, that is a positive integer directly followed by `'w'`. The default value, if missing, is the infinity.\n3. a pixel density descriptor, that is a positive floating number directly followed by `'x'`. The default value, if missing, is `1x`.\n\nEach string in the list must have at least a width descriptor or a pixel density descriptor to be valid. Among the list, there must be only one string containing the same tuple of width descriptor and pixel density descriptor. \nThe browser chooses the most adequate image to display at a given point of time. \nThe `srcset` attribute has an effect only when the [`<source>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/source \"The HTML <source> element specifies multiple media resources for the <picture>, the <audio> element, or the <video> element.\") element is the direct child of a [`<picture>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/picture \"The HTML <picture> element contains zero or more <source> elements and one <img> element to provide versions of an image for different display/device scenarios.\") element."},{name:"media",description:'[Media query](https://developer.mozilla.org/en-US/docs/CSS/Media_queries) of the resource\'s intended med
Line truncated
|
||||
|
||||
\`left\`
|
||||
|
||||
The caption is displayed to the left of the table.
|
||||
|
||||
\`top\`
|
||||
|
||||
The caption is displayed above the table.
|
||||
|
||||
\`right\`
|
||||
|
||||
The caption is displayed to the right of the table.
|
||||
|
||||
\`bottom\`
|
||||
|
||||
The caption is displayed below the table.
|
||||
|
||||
**Usage note:** Do not use this attribute, as it has been deprecated. The [\`<caption>\`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/caption "The HTML Table Caption element (<caption>) specifies the caption (or title) of a table, and if used is always the first child of a <table>.") element should be styled using the [CSS](https://developer.mozilla.org/en-US/docs/CSS) properties [\`caption-side\`](https://developer.mozilla.org/en-US/docs/Web/CSS/caption-side "The caption-side CSS property puts the content of a table's <caption> on the specified side. The values are relative to the writing-mode of the table.") and [\`text-align\`](https://developer.mozilla.org/en-US/docs/Web/CSS/text-align "The text-align CSS property sets the horizontal alignment of an inline or table-cell box. This means it works like vertical-align but in the horizontal direction.").`}],references:[{name:"MDN Reference",url:"https://developer.mozilla.org/docs/Web/HTML/Element/caption"}]},{name:"colgroup",description:{kind:"markdown",value:"The colgroup element represents a group of one or more columns in the table that is its parent, if it has a parent and that is a table element."},attributes:[{name:"span"},{name:"align",description:'This enumerated attribute specifies how horizontal alignment of each column cell content will be handled. Possible values are:\n\n* `left`, aligning the content to the left of the cell\n* `center`, centering the content in the cell\n* `right`, aligning the content to the right of the cell\n* `justify`, inserting spaces into the textual content so that the content is justified in the cell\n* `char`, aligning the textual content on a special character with a minimal offset, defined by the [`char`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/col#attr-char) and [`charoff`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/col#attr-charoff) attributes Unimplemented (see [bug 2212](https://bugzilla.mozilla.org/show_bug.cgi?id=2212 "character alignment not implemented (align=char, charoff=, text-align:<string>)")).\n\nIf this attribute is not set, the `left` value is assumed. The descendant [`<col>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/col "The HTML <col> element defines a column within a table and is used for defining common semantics on all common cells. It is generally found within a <colgroup> element.") elements may override this value using their own [`align`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/col#attr-align) attribute.\n\n**Note:** Do not use this attribute as it is obsolete (not supported) in the latest standard.\n\n* To achieve the same effect as the `left`, `center`, `right` or `justify` values:\n * Do not try to set the [`text-align`](https://developer.mozilla.org/en-US/docs/Web/CSS/text-align "The text-align CSS property sets the horizontal alignment of an inline or table-cell box. This means it works like vertical-align but in the horizontal direction.") property on a selector giving a [`<colgroup>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/colgroup "The HTML <colgroup> element defines a group of columns within a table.") element. Because [`<td>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/td "The HTML <td> element defines a cell of a table that contains data. It participates in the table model.") elements are not descendant of the [`<colgroup>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/colgroup "The HTML <colgroup> element defines a group of columns within a table.") element, they won\'t inherit it.\n * If the table doesn\'t use a [`colspan`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/td#attr-colspan) attribute, use one `td:nth-child(an+b)` CSS selector per column, where a is the total number of the columns in the table and b is the ordinal position of this column in the table. Only after this selector the [`text-align`](https://developer.mozilla.org/en-US/docs/Web/CSS/text-align "The text-align CSS property sets the horizontal alignment of an inline or table-cell box. This means it works like vertical-align but in the horizontal direction.") property can be used.\n * If the table does use a [`colspan`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/td#attr-colspan) attribute, the effect can be achieved by combining adequate CSS attribute selectors like `[colspan=n]`, though this is not trivial.\n* To achieve the same effect as the `char` value, in CSS3, you can use the value of the [`char`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/colgroup#attr-char) as the value of the [`text-align`](https://developer.mozilla.org/en-US/docs/Web/CSS/text-align "The text-align CSS property sets the horizontal alignment of an inline or table-cell box. This means it works like vertical-align but in the horizontal direction.") property Unimplemented.'}],references:[{name:"MDN Reference",url:"https://developer.mozilla.o
Line truncated
|
||||
|
||||
**Note:** Do not use this attribute as it is obsolete in the latest standard. Alternatively, you can put the abbreviated description inside the cell and place the long content in the **title** attribute.`},{name:"align",description:'This enumerated attribute specifies how the cell content\'s horizontal alignment will be handled. Possible values are:\n\n* `left`: The content is aligned to the left of the cell.\n* `center`: The content is centered in the cell.\n* `right`: The content is aligned to the right of the cell.\n* `justify` (with text only): The content is stretched out inside the cell so that it covers its entire width.\n* `char` (with text only): The content is aligned to a character inside the `<th>` element with minimal offset. This character is defined by the [`char`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/td#attr-char) and [`charoff`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/td#attr-charoff) attributes Unimplemented (see [bug 2212](https://bugzilla.mozilla.org/show_bug.cgi?id=2212 "character alignment not implemented (align=char, charoff=, text-align:<string>)")).\n\nThe default value when this attribute is not specified is `left`.\n\n**Note:** Do not use this attribute as it is obsolete in the latest standard.\n\n* To achieve the same effect as the `left`, `center`, `right` or `justify` values, apply the CSS [`text-align`](https://developer.mozilla.org/en-US/docs/Web/CSS/text-align "The text-align CSS property sets the horizontal alignment of an inline or table-cell box. This means it works like vertical-align but in the horizontal direction.") property to the element.\n* To achieve the same effect as the `char` value, give the [`text-align`](https://developer.mozilla.org/en-US/docs/Web/CSS/text-align "The text-align CSS property sets the horizontal alignment of an inline or table-cell box. This means it works like vertical-align but in the horizontal direction.") property the same value you would use for the [`char`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/td#attr-char). Unimplemented in CSS3.'},{name:"axis",description:"This attribute contains a list of space-separated strings. Each string is the `id` of a group of cells that this header applies to.\n\n**Note:** Do not use this attribute as it is obsolete in the latest standard."},{name:"bgcolor",description:`This attribute defines the background color of each cell in a column. It consists of a 6-digit hexadecimal code as defined in [sRGB](https://www.w3.org/Graphics/Color/sRGB) and is prefixed by '#'. This attribute may be used with one of sixteen predefined color strings:
|
||||
|
||||
|
||||
|
||||
\`black\` = "#000000"
|
||||
|
||||
|
||||
|
||||
\`green\` = "#008000"
|
||||
|
||||
|
||||
|
||||
\`silver\` = "#C0C0C0"
|
||||
|
||||
|
||||
|
||||
\`lime\` = "#00FF00"
|
||||
|
||||
|
||||
|
||||
\`gray\` = "#808080"
|
||||
|
||||
|
||||
|
||||
\`olive\` = "#808000"
|
||||
|
||||
|
||||
|
||||
\`white\` = "#FFFFFF"
|
||||
|
||||
|
||||
|
||||
\`yellow\` = "#FFFF00"
|
||||
|
||||
|
||||
|
||||
\`maroon\` = "#800000"
|
||||
|
||||
|
||||
|
||||
\`navy\` = "#000080"
|
||||
|
||||
|
||||
|
||||
\`red\` = "#FF0000"
|
||||
|
||||
|
||||
|
||||
\`blue\` = "#0000FF"
|
||||
|
||||
|
||||
|
||||
\`purple\` = "#800080"
|
||||
|
||||
|
||||
|
||||
\`teal\` = "#008080"
|
||||
|
||||
|
||||
|
||||
\`fuchsia\` = "#FF00FF"
|
||||
|
||||
|
||||
|
||||
\`aqua\` = "#00FFFF"
|
||||
|
||||
**Note:** Do not use this attribute, as it is non-standard and only implemented in some versions of Microsoft Internet Explorer: The [\`<td>\`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/td "The HTML <td> element defines a cell of a table that contains data. It participates in the table model.") element should be styled using [CSS](https://developer.mozilla.org/en-US/docs/CSS). To create a similar effect use the [\`background-color\`](https://developer.mozilla.org/en-US/docs/Web/CSS/background-color "The background-color CSS property sets the background color of an element.") property in [CSS](https://developer.mozilla.org/en-US/docs/CSS) instead.`}],references:[{name:"MDN Reference",url:"https://developer.mozilla.org/docs/Web/HTML/Element/td"}]},{name:"th",description:{kind:"markdown",value:"The th element represents a header cell in a table."},attributes:[{name:"colspan"},{name:"rowspan"},{name:"headers"},{name:"scope",valueSet:"s"},{name:"sorted"},{name:"abbr",description:{kind:"markdown",value:"This attribute contains a short abbreviated description of the cell's content. Some user-agents, such as speech readers, may present this description before the content itself."}},{name:"align",description:'This enumerated attribute specifies how the cell content\'s horizontal alignment will be handled. Possible values are:\n\n* `left`: The content is aligned to the left of the cell.\n* `center`: The content is centered in the cell.\n* `right`: The content is aligned to the right of the cell.\n* `justify` (with text only): The content is stretched out inside the cell so that it covers its entire width.\n* `char` (with text only): The content is aligned to a character inside the `<th>` element with minimal offset. This character is defined by the [`char`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/th#attr-char) and [`charoff`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/th#attr-charoff) attributes.\n\nThe default value when this attribute is not specified is `left`.\n\n**Note:** Do not use this attribute as it is obsolete in the latest standard.\n\n* To achieve the same effect as the `left`, `center`, `right` or `justify` values, apply the CSS [`text-align`](https://developer.mozilla.org/en-US/docs/Web/CSS/text-align "The text-align CSS property sets the horizontal alignment of an inline or table-cell box. This means it works like vertical-align but in the horizontal direction.") property to the element.\n* To achieve the same effect as the `char` value, give the [`text-align`](https://developer.mozilla.org/en-US/docs/Web/CSS/text-align "The text-align CSS property sets the horizontal alignment of an inline or table-cell box. This means it works like vertical-align but in the horizontal direction.") property the same value you would use for the [`char`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/th#attr-char). Unimplemented in CSS3.'},{name:"axis",description:"This attribute contains a list of space-separated strings. Each string is the `id` of a group of cells that this header applies to.\n\n**Note:** Do not use this attribute as it is obsolete in the latest standard: use the [`scope`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/th#attr-scope) attribute instead."},{name:"bgcolor",description:`This attribute defines the background color of each cell in a column. It consists of a 6-digit hexadecimal code as defined in [sRGB](https://www.w3.org/Graphics/Color/sRGB) and is prefixed by '#'. This attribute may be used with one of sixteen predefined color strings:
|
||||
|
||||
|
||||
|
||||
\`black\` = "#000000"
|
||||
|
||||
|
||||
|
||||
\`green\` = "#008000"
|
||||
|
||||
|
||||
|
||||
\`silver\` = "#C0C0C0"
|
||||
|
||||
|
||||
|
||||
\`lime\` = "#00FF00"
|
||||
|
||||
|
||||
|
||||
\`gray\` = "#808080"
|
||||
|
||||
|
||||
|
||||
\`olive\` = "#808000"
|
||||
|
||||
|
||||
|
||||
\`white\` = "#FFFFFF"
|
||||
|
||||
|
||||
|
||||
\`yellow\` = "#FFFF00"
|
||||
|
||||
|
||||
|
||||
\`maroon\` = "#800000"
|
||||
|
||||
|
||||
|
||||
\`navy\` = "#000080"
|
||||
|
||||
|
||||
|
||||
\`red\` = "#FF0000"
|
||||
|
||||
|
||||
|
||||
\`blue\` = "#0000FF"
|
||||
|
||||
|
||||
|
||||
\`purple\` = "#800080"
|
||||
|
||||
|
||||
|
||||
\`teal\` = "#008080"
|
||||
|
||||
|
||||
|
||||
\`fuchsia\` = "#FF00FF"
|
||||
|
||||
|
||||
|
||||
\`aqua\` = "#00FFFF"
|
||||
|
||||
**Note:** Do not use this attribute, as it is non-standard and only implemented in some versions of Microsoft Internet Explorer: The [\`<th>\`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/th "The HTML <th> element defines a cell as header of a group of table cells. The exact nature of this group is defined by the scope and headers attributes.") element should be styled using [CSS](https://developer.mozilla.org/en-US/docs/Web/CSS). To create a similar effect use the [\`background-color\`](https://developer.mozilla.org/en-US/docs/Web/CSS/background-color "The background-color CSS property sets the background color of an element.") property in [CSS](https://developer.mozilla.org/en-US/docs/Web/CSS) instead.`}],references:[{name:"MDN Reference",url:"https://developer.mozilla.org/docs/Web/HTML/Element/th"}]},{name:"form",description:{kind:"markdown",value:"The form element represents a collection of form-associated elements, some of which can represent editable values that can be submitted to a server for processing."},attributes:[{name:"accept-charset",description:{kind:"markdown",value:'A space- or comma-delimited list of character encodings that the server accepts. The browser uses them in the order in which they are listed. The default value, the reserved string `"UNKNOWN"`, indicates the same encoding as that of the document containing the form element. \nIn previous versions of HTML, the different character encodings could be delimited by spaces or commas. In HTML5, only spaces are allowed as delimiters.'}},{name:"action",description:{kind:"markdown",value:'The URI of a program that processes the form information. This value can be overridden by a [`formaction`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#attr-formaction) attribute on a [`<button>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button "The HTML <button> element represents a clickable button, which can be used in forms or anywhere in a document that needs simple, standard button functionality.") or [`<input>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input "The HTML <input> element is used to create interactive controls for web-based forms in order to accept data from the user; a wide variety of types of input data and control widgets are available, depending on the device and user agent.") element.'}},{name:"autocomplete",valueSet:"o",description:{kind:"markdown",value:"Indicates whether input elements can by default have their values automatically completed by the browser. This setting can be overridden by an `autocomplete` attribute on an element belonging to the form. Possible values are:\n\n* `off`: The user must explicitly enter a value into each field for every use, or the document provides its own auto-completion method; the browser does not automatically complete entries.\n* `on`: The browser can automatically complete values based on values that the user has previously entered in the form.\n\nFor most modern browsers (including Firefox 38+, Google Chrome 34+, IE 11+) setting the autocomplete attribute will not prevent a browser's password manager from asking the user if they want to store login fields (username and password), if the user permits the storage the browser will autofill the login the next time the user visits the page. See [The autocomplete attribute and login fields](https://developer.mozilla.org/en-US/docs/Web/Security/Securing_your_site/Turning_off_form_autocompletion#The_autocomplete_attribute_and_login_fields).\n**Note:** If you set `autocomplete` to `off` in a form because the document provides its own auto-completion, then you should also set `autocomplete` to `off` for each of the form's `input` elements that the document can auto-complete. For details, see the note regarding Google Chrome in the [Browser Compatibility chart](#compatChart)."}},{name:"enctype",valueSet:"et",description:{kind:"markdown",value:'When the value of the `method` attribute is `post`, enctype is the [MIME type](https://en.wikipedia.org/wiki/Mime_type) of content that is used to submit the form to the server. Possible values are:\n\n* `application/x-www-form-urlencoded`: The default value if the attribute is not specified.\n* `multipart/form-data`: The value used for an [`<input>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input "The HTML <input> element is used to create interactive controls for web-based forms in order to accept data from the user; a wide variety of types of input data and control widgets are available, depending on the device and user agent.") element with the `type` attribute set to "file".\n* `text/plain`: (HTML5)\n\nThis value can be overridden by a [`formenctype`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#attr-formenctype) attribute on a [`<button>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button "The HTML <button> element represents a clickable button, which can be used in forms or
Line truncated
|
||||
|
||||
This attribute must not be used if the \`src\` attribute is absent (i.e. for inline scripts). If it is included in this case it will have no effect.
|
||||
|
||||
Browsers usually assume the worst case scenario and load scripts synchronously, (i.e. \`async="false"\`) during HTML parsing.
|
||||
|
||||
Dynamically inserted scripts (using [\`document.createElement()\`](https://developer.mozilla.org/en-US/docs/Web/API/Document/createElement "In an HTML document, the document.createElement() method creates the HTML element specified by tagName, or an HTMLUnknownElement if tagName isn't recognized.")) load asynchronously by default, so to turn on synchronous loading (i.e. scripts load in the order they were inserted) set \`async="false"\`.
|
||||
|
||||
See [Browser compatibility](#Browser_compatibility) for notes on browser support. See also [Async scripts for asm.js](https://developer.mozilla.org/en-US/docs/Games/Techniques/Async_scripts).`}},{name:"defer",valueSet:"v",description:{kind:"markdown",value:'This Boolean attribute is set to indicate to a browser that the script is meant to be executed after the document has been parsed, but before firing [`DOMContentLoaded`](https://developer.mozilla.org/en-US/docs/Web/Events/DOMContentLoaded "/en-US/docs/Web/Events/DOMContentLoaded").\n\nScripts with the `defer` attribute will prevent the `DOMContentLoaded` event from firing until the script has loaded and finished evaluating.\n\nThis attribute must not be used if the `src` attribute is absent (i.e. for inline scripts), in this case it would have no effect.\n\nTo achieve a similar effect for dynamically inserted scripts use `async="false"` instead. Scripts with the `defer` attribute will execute in the order in which they appear in the document.'}},{name:"crossorigin",valueSet:"xo",description:{kind:"markdown",value:'Normal `script` elements pass minimal information to the [`window.onerror`](https://developer.mozilla.org/en-US/docs/Web/API/GlobalEventHandlers/onerror "The onerror property of the GlobalEventHandlers mixin is an EventHandler that processes error events.") for scripts which do not pass the standard [CORS](https://developer.mozilla.org/en-US/docs/Glossary/CORS "CORS: CORS (Cross-Origin Resource Sharing) is a system, consisting of transmitting HTTP headers, that determines whether browsers block frontend JavaScript code from accessing responses for cross-origin requests.") checks. To allow error logging for sites which use a separate domain for static media, use this attribute. See [CORS settings attributes](https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_settings_attributes) for a more descriptive explanation of its valid arguments.'}},{name:"nonce",description:{kind:"markdown",value:"A cryptographic nonce (number used once) to list the allowed inline scripts in a [script-src Content-Security-Policy](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/script-src). The server must generate a unique nonce value each time it transmits a policy. It is critical to provide a nonce that cannot be guessed as bypassing a resource's policy is otherwise trivial."}},{name:"integrity",description:"This attribute contains inline metadata that a user agent can use to verify that a fetched resource has been delivered free of unexpected manipulation. See [Subresource Integrity](https://developer.mozilla.org/en-US/docs/Web/Security/Subresource_Integrity)."},{name:"nomodule",description:"This Boolean attribute is set to indicate that the script should not be executed in browsers that support [ES2015 modules](https://hacks.mozilla.org/2015/08/es6-in-depth-modules/) — in effect, this can be used to serve fallback scripts to older browsers that do not support modular JavaScript code."},{name:"referrerpolicy",description:'Indicates which [referrer](https://developer.mozilla.org/en-US/docs/Web/API/Document/referrer) to send when fetching the script, or resources fetched by the script:\n\n* `no-referrer`: The [`Referer`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Referer "The Referer request header contains the address of the previous web page from which a link to the currently requested page was followed. The Referer header allows servers to identify where people are visiting them from and may use that data for analytics, logging, or optimized caching, for example.") header will not be sent.\n* `no-referrer-when-downgrade` (default): The [`Referer`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Referer "The Referer request header contains the address of the previous web page from which a link to the currently requested page was followed. The Referer header allows servers to identify where people are visiting them from and may use that data for analytics, logging, or optimized caching, for example.") header will not be sent to [origin](https://developer.mozilla.org/en-US/docs/Glossary/origin "origin: Web content\'s origin is defined by the scheme (protocol), host (domain), and port of the URL used to access it. Two objects have the same origin only when the scheme, host, and port all match.")s without [TLS](https://developer.mozilla.org/en-US/docs/Glossary/TLS "TLS: Transport Layer Security (TLS), previously known as Secure Sockets Layer (SSL), is a protocol used by applications to communicate securely across a network, preventing tampering with and eavesdropping on email, web browsing, messaging, and other protocols.") ([HTTPS](https://developer.mozilla.org/en-US/docs/Glossary/HTTPS "HTTPS: HTTPS (HTTP Secure) is an encrypted version of the HTTP protocol. It usually uses SSL or TLS to encrypt all communication between a client and a server. This secure connection allows clients to safely exchange s
Line truncated
|
||||
|
||||
* a _negative value_ means that the element should be focusable, but should not be reachable via sequential keyboard navigation;
|
||||
* \`0\` means that the element should be focusable and reachable via sequential keyboard navigation, but its relative order is defined by the platform convention;
|
||||
* a _positive value_ means that the element should be focusable and reachable via sequential keyboard navigation; the order in which the elements are focused is the increasing value of the [**tabindex**](#attr-tabindex). If several elements share the same tabindex, their relative order follows their relative positions in the document.`},references:[{name:"MDN Reference",url:"https://developer.mozilla.org/docs/Web/HTML/Global_attributes/tabindex"}]},{name:"title",description:{kind:"markdown",value:"Contains a text representing advisory information related to the element it belongs to. Such information can typically, but not necessarily, be presented to the user as a tooltip."},references:[{name:"MDN Reference",url:"https://developer.mozilla.org/docs/Web/HTML/Global_attributes/title"}]},{name:"translate",description:{kind:"markdown",value:"An enumerated attribute that is used to specify whether an element's attribute values and the values of its [`Text`](https://developer.mozilla.org/docs/Web/API/Text \"The Text interface represents the textual content of Element or Attr. If an element has no markup within its content, it has a single child implementing Text that contains the element's text. However, if the element contains markup, it is parsed into information items and Text nodes that form its children.\") node children are to be translated when the page is localized, or whether to leave them unchanged. It can have the following values:\n\n* empty string and `yes`, which indicates that the element will be translated.\n* `no`, which indicates that the element will not be translated."},valueSet:"y",references:[{name:"MDN Reference",url:"https://developer.mozilla.org/docs/Web/HTML/Global_attributes/translate"}]},{name:"onabort",description:{kind:"markdown",value:"The loading of a resource has been aborted."}},{name:"onblur",description:{kind:"markdown",value:"An element has lost focus (does not bubble)."}},{name:"oncanplay",description:{kind:"markdown",value:"The user agent can play the media, but estimates that not enough data has been loaded to play the media up to its end without having to stop for further buffering of content."}},{name:"oncanplaythrough",description:{kind:"markdown",value:"The user agent can play the media up to its end without having to stop for further buffering of content."}},{name:"onchange",description:{kind:"markdown",value:"The change event is fired for <input>, <select>, and <textarea> elements when a change to the element's value is committed by the user."}},{name:"onclick",description:{kind:"markdown",value:"A pointing device button has been pressed and released on an element."}},{name:"oncontextmenu",description:{kind:"markdown",value:"The right button of the mouse is clicked (before the context menu is displayed)."}},{name:"ondblclick",description:{kind:"markdown",value:"A pointing device button is clicked twice on an element."}},{name:"ondrag",description:{kind:"markdown",value:"An element or text selection is being dragged (every 350ms)."}},{name:"ondragend",description:{kind:"markdown",value:"A drag operation is being ended (by releasing a mouse button or hitting the escape key)."}},{name:"ondragenter",description:{kind:"markdown",value:"A dragged element or text selection enters a valid drop target."}},{name:"ondragleave",description:{kind:"markdown",value:"A dragged element or text selection leaves a valid drop target."}},{name:"ondragover",description:{kind:"markdown",value:"An element or text selection is being dragged over a valid drop target (every 350ms)."}},{name:"ondragstart",description:{kind:"markdown",value:"The user starts dragging an element or text selection."}},{name:"ondrop",description:{kind:"markdown",value:"An element is dropped on a valid drop target."}},{name:"ondurationchange",description:{kind:"markdown",value:"The duration attribute has been updated."}},{name:"onemptied",description:{kind:"markdown",value:"The media has become empty; for example, this event is sent if the media has already been loaded (or partially loaded), and the load() method is called to reload it."}},{name:"onended",description:{kind:"markdown",value:"Playback has stopped because the end of the media was reached."}},{name:"onerror",description:{kind:"markdown",value:"A resource failed to load."}},{name:"onfocus",description:{kind:"markdown",value:"An element has received focus (does not bubble)."}},{name:"onformchange"},{name:"onforminput"},{name:"oninput",description:{kind:"markdown",value:"The value of an element changes or the content of an element with the attribute contenteditable is modified."}},{name:"oninvalid",description:{kind:"markdown",value:"A submittable element has been checked and doesn't satisfy its constraints."}},{name:"onkeydown",description:{kind:"markdown",value:"A key is pressed down."}},{name:"onkeypress",description:{kind:"markdown",value:"A key is pressed down and that key normally produces a character value (use input instead)."}},{name:"onkeyup
Line truncated
|
||||
@@ -0,0 +1,58 @@
|
||||
(function(){"use strict";var he,J;class $o{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?ft.isErrorNoTelemetry(e)?new ft(e.message+`
|
||||
|
||||
`+e.stack):new Error(e.message+`
|
||||
|
||||
`+e.stack):e},0)}}emit(e){this.listeners.forEach(n=>{n(e)})}onUnexpectedError(e){this.unexpectedErrorHandler(e),this.emit(e)}onUnexpectedExternalError(e){this.unexpectedErrorHandler(e)}}const Bo=new $o;function ln(t){Uo(t)||Bo.onUnexpectedError(t)}function Wn(t){if(t instanceof Error){const{name:e,message:n,cause:r}=t,i=t.stacktrace||t.stack;return{$isError:!0,name:e,message:n,stack:i,noTelemetry:ft.isErrorNoTelemetry(t),cause:r?Wn(r):void 0,code:t.code}}return t}const Hn="Canceled";function Uo(t){return t instanceof si?!0:t instanceof Error&&t.name===Hn&&t.message===Hn}class si extends Error{constructor(){super(Hn),this.name=this.message}}class ft extends Error{constructor(e){super(e),this.name="CodeExpectedError"}static fromError(e){if(e instanceof ft)return e;const n=new ft;return n.message=e.message,n.stack=e.stack,n}static isErrorNoTelemetry(e){return e.name==="CodeExpectedError"}}class le extends Error{constructor(e){super(e||"An unexpected bug occurred."),Object.setPrototypeOf(this,le.prototype)}}function qo(t,e="Unreachable"){throw new Error(e)}function jo(t,e="unexpected state"){if(!t)throw typeof e=="string"?new le(`Assertion Failed: ${e}`):e}function un(t){if(!t()){debugger;t(),ln(new le("Assertion Failed"))}}function ai(t,e){let n=0;for(;n<t.length-1;){const r=t[n],i=t[n+1];if(!e(r,i))return!1;n++}return!0}function Wo(t){return typeof t=="string"}function Ho(t){return!!t&&typeof t[Symbol.iterator]=="function"}var cn;(function(t){function e(L){return!!L&&typeof L=="object"&&typeof L[Symbol.iterator]=="function"}t.is=e;const n=Object.freeze([]);function r(){return n}t.empty=r;function*i(L){yield L}t.single=i;function s(L){return e(L)?L:i(L)}t.wrap=s;function a(L){return L||n}t.from=a;function*o(L){for(let S=L.length-1;S>=0;S--)yield L[S]}t.reverse=o;function u(L){return!L||L[Symbol.iterator]().next().done===!0}t.isEmpty=u;function l(L){return L[Symbol.iterator]().next().value}t.first=l;function h(L,S){let P=0;for(const D of L)if(S(D,P++))return!0;return!1}t.some=h;function f(L,S){let P=0;for(const D of L)if(!S(D,P++))return!1;return!0}t.every=f;function m(L,S){for(const P of L)if(S(P))return P}t.find=m;function*g(L,S){for(const P of L)S(P)&&(yield P)}t.filter=g;function*d(L,S){let P=0;for(const D of L)yield S(D,P++)}t.map=d;function*p(L,S){let P=0;for(const D of L)yield*S(D,P++)}t.flatMap=p;function*y(...L){for(const S of L)Ho(S)?yield*S:yield S}t.concat=y;function x(L,S,P){let D=P;for(const T of L)D=S(D,T);return D}t.reduce=x;function v(L){let S=0;for(const P of L)S++;return S}t.length=v;function*b(L,S,P=L.length){for(S<-L.length&&(S=0),S<0&&(S+=L.length),P<0?P+=L.length:P>L.length&&(P=L.length);S<P;S++)yield L[S]}t.slice=b;function _(L,S=Number.POSITIVE_INFINITY){const P=[];if(S===0)return[P,L];const D=L[Symbol.iterator]();for(let T=0;T<S;T++){const w=D.next();if(w.done)return[P,t.empty()];P.push(w.value)}return[P,{[Symbol.iterator](){return D}}]}t.consume=_;async function N(L){const S=[];for await(const P of L)S.push(P);return S}t.asyncToArray=N;async function E(L){let S=[];for await(const P of L)S=S.concat(P);return S}t.asyncToArrayFlat=E})(cn||(cn={}));function O1(t,e){}function oi(t){if(cn.is(t)){const e=[];for(const n of t)if(n)try{n.dispose()}catch(r){e.push(r)}if(e.length===1)throw e[0];if(e.length>1)throw new AggregateError(e,"Encountered errors while disposing of store");return Array.isArray(t)?[]:t}else if(t)return t.dispose(),t}function zo(...t){return fn(()=>oi(t))}class Go{constructor(e){this._isDisposed=!1,this._fn=e}dispose(){if(!this._isDisposed){if(!this._fn)throw new Error("Unbound disposable context: Need to use an arrow function to preserve the value of this");this._isDisposed=!0,this._fn()}}}function fn(t){return new Go(t)}const Vn=class Vn{constructor(){this._toDispose=new Set,this._isDisposed=!1}dispose(){this._isDisposed||(this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(this._toDispose.size!==0)try{oi(this._toDispose)}finally{this._toDispose.clear()}}add(e){if(!e||e===et.None)return e;if(e===this)throw new Error("Cannot register a disposable on itself!");return this._isDisposed?Vn.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(e),e}delete(e){if(e){if(e===this)throw new Error("Cannot dispose a disposable on itself!");this._toDispose.delete(e),e.dispose()}}};Vn.DISABLE_DISPOSED_WARNING=!1;let Ot=Vn;const ri=class ri{constructor(){this._store=new Ot,this._store}dispose(){this._store.dispose()}_register(e){if(e===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(e)}};ri.None=Object.freeze({dispose(){}});let et=ri;const Ct=class Ct{constructor(e){this.element=e,this.next=Ct.Undefined,this.prev=Ct.Undefined}};Ct.Undefined=new Ct(void 0);let Y=Ct;class Jo{constructor(){this._first=Y.Undefined,this._last=Y.Undefined,this._size=0}get size(){return this._size}is
Line truncated
|
||||
`).slice(2).join(`
|
||||
`))}}class Zo extends Error{constructor(e,n){super(e),this.name="ListenerLeakError",this.stack=n}}class Yo extends Error{constructor(e,n){super(e),this.name="ListenerRefusalError",this.stack=n}}class Qn{constructor(e){this.value=e}}const Ko=2;class Pe{constructor(e){this._size=0,this._options=e,this._leakageMon=this._options?.leakWarningThreshold?new Jn(e?.onListenerError??ln,this._options?.leakWarningThreshold??Qo):void 0,this._perfMon=this._options?._profName?new Gn(this._options._profName):void 0,this._deliveryQueue=this._options?.deliveryQueue}dispose(){this._disposed||(this._disposed=!0,this._deliveryQueue?.current===this&&this._deliveryQueue.reset(),this._listeners&&(this._listeners=void 0,this._size=0),this._options?.onDidRemoveLastListener?.(),this._leakageMon?.dispose())}get event(){return this._event??=(e,n,r)=>{if(this._leakageMon&&this._size>this._leakageMon.threshold**2){const o=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(o);const u=this._leakageMon.getMostFrequentStack()??["UNKNOWN stack",-1],l=new Yo(`${o}. HINT: Stack shows most frequent listener (${u[1]}-times)`,u[0]);return(this._options?.onListenerError||ln)(l),et.None}if(this._disposed)return et.None;n&&(e=e.bind(n));const i=new Qn(e);let s;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(i.stack=Xn.create(),s=this._leakageMon.check(i.stack,this._size+1)),this._listeners?this._listeners instanceof Qn?(this._deliveryQueue??=new el,this._listeners=[this._listeners,i]):this._listeners.push(i):(this._options?.onWillAddFirstListener?.(this),this._listeners=i,this._options?.onDidAddFirstListener?.(this)),this._options?.onDidAddListener?.(this),this._size++;const a=fn(()=>{s?.(),this._removeListener(i)});return r instanceof Ot?r.add(a):Array.isArray(r)&&r.push(a),a},this._event}_removeListener(e){if(this._options?.onWillRemoveListener?.(this),!this._listeners)return;if(this._size===1){this._listeners=void 0,this._options?.onDidRemoveLastListener?.(this),this._size=0;return}const n=this._listeners,r=n.indexOf(e);if(r===-1)throw console.log("disposed?",this._disposed),console.log("size?",this._size),console.log("arr?",JSON.stringify(this._listeners)),new Error("Attempted to dispose unknown listener");this._size--,n[r]=void 0;const i=this._deliveryQueue.current===this;if(this._size*Ko<=n.length){let s=0;for(let a=0;a<n.length;a++)n[a]?n[s++]=n[a]:i&&s<this._deliveryQueue.end&&(this._deliveryQueue.end--,s<this._deliveryQueue.i&&this._deliveryQueue.i--);n.length=s}}_deliver(e,n){if(!e)return;const r=this._options?.onListenerError||ln;if(!r){e.value(n);return}try{e.value(n)}catch(i){r(i)}}_deliverQueue(e){const n=e.current._listeners;for(;e.i<e.end;)this._deliver(n[e.i++],e.value);e.reset()}fire(e){if(this._deliveryQueue?.current&&(this._deliverQueue(this._deliveryQueue),this._perfMon?.stop()),this._perfMon?.start(this._size),this._listeners)if(this._listeners instanceof Qn)this._deliver(this._listeners,e);else{const n=this._deliveryQueue;n.enqueue(this,e,this._listeners.length),this._deliverQueue(n)}this._perfMon?.stop()}hasListeners(){return this._size>0}}class el{constructor(){this.i=-1,this.end=0}enqueue(e,n,r){this.i=0,this.end=r,this.current=e,this.value=n}reset(){this.i=this.end,this.current=void 0,this.value=void 0}}function tl(){return globalThis._VSCODE_NLS_MESSAGES}function li(){return globalThis._VSCODE_NLS_LANGUAGE}const nl=li()==="pseudo"||typeof document<"u"&&document.location&&typeof document.location.hash=="string"&&document.location.hash.indexOf("pseudo=true")>=0;function ui(t,e){let n;return e.length===0?n=t:n=t.replace(/\{(\d+)\}/g,(r,i)=>{const s=i[0],a=e[s];let o=r;return typeof a=="string"?o=a:(typeof a=="number"||typeof a=="boolean"||a===void 0||a===null)&&(o=String(a)),o}),nl&&(n="["+n.replace(/[aouei]/g,"$&$&")+"]"),n}function $(t,e,...n){return ui(typeof t=="number"?rl(t,e):e,n)}function rl(t,e){const n=tl()?.[t];if(typeof n!="string"){if(typeof e=="string")return e;throw new Error(`!!! NLS MISSING: ${t} !!!`)}return n}const ht="en";let Zn=!1,Yn=!1,Kn=!1,mn,er=ht,ci=ht,il,$e;const tt=globalThis;let me;typeof tt.vscode<"u"&&typeof tt.vscode.process<"u"?me=tt.vscode.process:typeof process<"u"&&typeof process?.versions?.node=="string"&&(me=process);const sl=typeof me?.versions?.electron=="string"&&me?.type==="renderer";if(typeof me=="object"){Zn=me.platform==="win32",Yn=me.platform==="darwin",Kn=me.platform==="linux",Kn&&me.env.SNAP&&me.env.SNAP_REVISION,me.env.CI||me.env.BUILD_ARTIFACTSTAGINGDIRECTORY||me.env.GITHUB_WORKSPACE,mn=ht,er=ht;const t=me.env.VSCODE_NLS_CONFIG;if(t)try{const e=JSON.parse(t);mn=e.userLocale,ci=e.osLocale,er=e.resolvedLanguage||ht,il=e.languagePack?.translationsConfigFile}catch{}}else typeof navigator=="object"&&!sl?($e=navigator.userAgent,Zn=$e.indexOf("Windows")>=0,Yn=$e.indexOf("Macintosh")>=0,($e.indexOf("Macintosh")>=0||$e.indexOf("iPad")>=0||$e.inde
Line truncated
|
||||
`||t===" "}class vn{constructor(e,n,r){this.changes=e,this.moves=n,this.hitTimeout=r}}class ku{constructor(e,n){this.lineRangeMapping=e,this.changes=n}}function Ru(t,e,n=(r,i)=>r===i){if(t===e)return!0;if(!t||!e||t.length!==e.length)return!1;for(let r=0,i=t.length;r<i;r++)if(!n(t[r],e[r]))return!1;return!0}function*Eu(t,e){let n,r;for(const i of t)r!==void 0&&e(r,i)?n.push(i):(n&&(yield n),n=[i]),r=i;n&&(yield n)}function Mu(t,e){for(let n=0;n<=t.length;n++)e(n===0?void 0:t[n-1],n===t.length?void 0:t[n])}function Tu(t,e){for(let n=0;n<t.length;n++)e(n===0?void 0:t[n-1],t[n],n+1===t.length?void 0:t[n+1])}function Pu(t,e){for(const n of e)t.push(n)}var vr;(function(t){function e(s){return s<0}t.isLessThan=e;function n(s){return s<=0}t.isLessThanOrEqual=n;function r(s){return s>0}t.isGreaterThan=r;function i(s){return s===0}t.isNeitherLessOrGreaterThan=i,t.greaterThan=1,t.lessThan=-1,t.neitherLessOrGreaterThan=0})(vr||(vr={}));function jt(t,e){return(n,r)=>e(t(n),t(r))}const Wt=(t,e)=>t-e;function Cu(t){return(e,n)=>-t(e,n)}const Dt=class Dt{constructor(e){this.iterate=e}toArray(){const e=[];return this.iterate(n=>(e.push(n),!0)),e}filter(e){return new Dt(n=>this.iterate(r=>e(r)?n(r):!0))}map(e){return new Dt(n=>this.iterate(r=>n(e(r))))}findLast(e){let n;return this.iterate(r=>(e(r)&&(n=r),!0)),n}findLastMaxBy(e){let n,r=!0;return this.iterate(i=>((r||vr.isGreaterThan(e(i,n)))&&(r=!1,n=i),!0)),n}};Dt.empty=new Dt(e=>{});let js=Dt;class j{static fromTo(e,n){return new j(e,n)}static addRange(e,n){let r=0;for(;r<n.length&&n[r].endExclusive<e.start;)r++;let i=r;for(;i<n.length&&n[i].start<=e.endExclusive;)i++;if(r===i)n.splice(r,0,e);else{const s=Math.min(e.start,n[r].start),a=Math.max(e.endExclusive,n[i-1].endExclusive);n.splice(r,i-r,new j(s,a))}}static tryCreate(e,n){if(!(e>n))return new j(e,n)}static ofLength(e){return new j(0,e)}static ofStartAndLength(e,n){return new j(e,e+n)}static emptyAt(e){return new j(e,e)}constructor(e,n){if(this.start=e,this.endExclusive=n,e>n)throw new le(`Invalid range: ${this.toString()}`)}get isEmpty(){return this.start===this.endExclusive}delta(e){return new j(this.start+e,this.endExclusive+e)}deltaStart(e){return new j(this.start+e,this.endExclusive)}deltaEnd(e){return new j(this.start,this.endExclusive+e)}get length(){return this.endExclusive-this.start}toString(){return`[${this.start}, ${this.endExclusive})`}equals(e){return this.start===e.start&&this.endExclusive===e.endExclusive}contains(e){return this.start<=e&&e<this.endExclusive}join(e){return new j(Math.min(this.start,e.start),Math.max(this.endExclusive,e.endExclusive))}intersect(e){const n=Math.max(this.start,e.start),r=Math.min(this.endExclusive,e.endExclusive);if(n<=r)return new j(n,r)}intersectionLength(e){const n=Math.max(this.start,e.start),r=Math.min(this.endExclusive,e.endExclusive);return Math.max(0,r-n)}intersects(e){const n=Math.max(this.start,e.start),r=Math.min(this.endExclusive,e.endExclusive);return n<r}intersectsOrTouches(e){const n=Math.max(this.start,e.start),r=Math.min(this.endExclusive,e.endExclusive);return n<=r}isBefore(e){return this.endExclusive<=e.start}isAfter(e){return this.start>=e.endExclusive}slice(e){return e.slice(this.start,this.endExclusive)}substring(e){return e.substring(this.start,this.endExclusive)}clip(e){if(this.isEmpty)throw new le(`Invalid clipping range: ${this.toString()}`);return Math.max(this.start,Math.min(this.endExclusive-1,e))}clipCyclic(e){if(this.isEmpty)throw new le(`Invalid clipping range: ${this.toString()}`);return e<this.start?this.endExclusive-(this.start-e)%this.length:e>=this.endExclusive?this.start+(e-this.start)%this.length:e}forEach(e){for(let n=this.start;n<this.endExclusive;n++)e(n)}joinRightTouching(e){if(this.endExclusive!==e.start)throw new le(`Invalid join: ${this.toString()} and ${e.toString()}`);return new j(this.start,e.endExclusive)}}function yt(t,e){const n=wt(t,e);return n===-1?void 0:t[n]}function wt(t,e,n=0,r=t.length){let i=n,s=r;for(;i<s;){const a=Math.floor((i+s)/2);e(t[a])?i=a+1:s=a}return i-1}function Iu(t,e){const n=Lr(t,e);return n===t.length?void 0:t[n]}function Lr(t,e,n=0,r=t.length){let i=n,s=r;for(;i<s;){const a=Math.floor((i+s)/2);e(t[a])?s=a:i=a+1}return i}const $n=class $n{constructor(e){this._array=e,this._findLastMonotonousLastIdx=0}findLastMonotonous(e){if($n.assertInvariants){if(this._prevFindLastPredicate){for(const r of this._array)if(this._prevFindLastPredicate(r)&&!e(r))throw new Error("MonotonousArray: current predicate must be weaker than (or equal to) the previous predicate.")}this._prevFindLastPredicate=e}const n=wt(this._array,e,this._findLastMonotonousLastIdx);return this._findLastMonotonousLastIdx=n+1,n===-1?void 0:this._array[n]}};$n.assertInvariants=!1;let Ln=$n;const ve=class ve{static ofLength(e,n){return new ve(e,e+n)}static fromRange(e){return new ve(e.startLineNumber,e.endLineNumber)}static fromRangeInclusive(e){return new ve(e.startLineNumber,e.endLineNumber+1)}static joinMany(e){if(e.length===0)return[];le
Line truncated
|
||||
`?(n++,r=0):r++;return new Te(n,r)}constructor(e,n){this.lineCount=e,this.columnCount=n}isGreaterThanOrEqualTo(e){return this.lineCount!==e.lineCount?this.lineCount>e.lineCount:this.columnCount>=e.columnCount}add(e){return e.lineCount===0?new Te(this.lineCount,this.columnCount+e.columnCount):new Te(this.lineCount+e.lineCount,e.columnCount)}createRange(e){return this.lineCount===0?new B(e.lineNumber,e.column,e.lineNumber,e.column+this.columnCount):new B(e.lineNumber,e.column,e.lineNumber+this.lineCount,this.columnCount+1)}toRange(){return new B(1,1,this.lineCount+1,this.columnCount+1)}toLineRange(){return H.ofLength(1,this.lineCount+1)}addToPosition(e){return this.lineCount===0?new Q(e.lineNumber,e.column+this.columnCount):new Q(e.lineNumber+this.lineCount,this.columnCount+1)}toString(){return`${this.lineCount},${this.columnCount}`}};Te.zero=new Te(0,0);let Ht=Te;class Fu{getOffsetRange(e){return new j(this.getOffset(e.getStartPosition()),this.getOffset(e.getEndPosition()))}getRange(e){return B.fromPositions(this.getPosition(e.start),this.getPosition(e.endExclusive))}getStringReplacement(e){return new xt.deps.StringReplacement(this.getOffsetRange(e.range),e.text)}getTextReplacement(e){return new xt.deps.TextReplacement(this.getRange(e.replaceRange),e.newText)}getTextEdit(e){const n=e.replacements.map(r=>this.getTextReplacement(r));return new xt.deps.TextEdit(n)}}const ii=class ii{static get deps(){if(!this._deps)throw new Error("Dependencies not set. Call _setDependencies first.");return this._deps}};ii._deps=void 0;let xt=ii;class Vu extends Fu{constructor(e){super(),this.text=e,this.lineStartOffsetByLineIdx=[],this.lineEndOffsetByLineIdx=[],this.lineStartOffsetByLineIdx.push(0);for(let n=0;n<e.length;n++)e.charAt(n)===`
|
||||
`&&(this.lineStartOffsetByLineIdx.push(n+1),n>0&&e.charAt(n-1)==="\r"?this.lineEndOffsetByLineIdx.push(n-1):this.lineEndOffsetByLineIdx.push(n));this.lineEndOffsetByLineIdx.push(e.length)}getOffset(e){const n=this._validatePosition(e);return this.lineStartOffsetByLineIdx[n.lineNumber-1]+n.column-1}_validatePosition(e){if(e.lineNumber<1)return new Q(1,1);const n=this.textLength.lineCount+1;if(e.lineNumber>n){const i=this.getLineLength(n);return new Q(n,i+1)}if(e.column<1)return new Q(e.lineNumber,1);const r=this.getLineLength(e.lineNumber);return e.column-1>r?new Q(e.lineNumber,r+1):e}getPosition(e){const n=wt(this.lineStartOffsetByLineIdx,s=>s<=e),r=n+1,i=e-this.lineStartOffsetByLineIdx[n]+1;return new Q(r,i)}get textLength(){const e=this.lineStartOffsetByLineIdx.length-1;return new xt.deps.TextLength(e,this.text.length-this.lineStartOffsetByLineIdx[e])}getLineLength(e){return this.lineEndOffsetByLineIdx[e-1]-this.lineStartOffsetByLineIdx[e-1]}}class Du{constructor(){this._transformer=void 0}get endPositionExclusive(){return this.length.addToPosition(new Q(1,1))}get lineRange(){return this.length.toLineRange()}getValue(){return this.getValueOfRange(this.length.toRange())}getValueOfOffsetRange(e){return this.getValueOfRange(this.getTransformer().getRange(e))}getLineLength(e){return this.getValueOfRange(new B(e,1,e,Number.MAX_SAFE_INTEGER)).length}getTransformer(){return this._transformer||(this._transformer=new Vu(this.getValue())),this._transformer}getLineAt(e){return this.getValueOfRange(new B(e,1,e,Number.MAX_SAFE_INTEGER))}}class Ou extends Du{constructor(e,n){jo(n>=1),super(),this._getLineContent=e,this._lineCount=n}getValueOfRange(e){if(e.startLineNumber===e.endLineNumber)return this._getLineContent(e.startLineNumber).substring(e.startColumn-1,e.endColumn-1);let n=this._getLineContent(e.startLineNumber).substring(e.startColumn-1);for(let r=e.startLineNumber+1;r<e.endLineNumber;r++)n+=`
|
||||
`+this._getLineContent(r);return n+=`
|
||||
`+this._getLineContent(e.endLineNumber).substring(0,e.endColumn-1),n}getLineLength(e){return this._getLineContent(e).length}get length(){const e=this._getLineContent(this._lineCount);return new Ht(this._lineCount-1,e.length)}}class Nn extends Ou{constructor(e){super(n=>e[n-1],e.length)}}class Xe{static joinReplacements(e,n){if(e.length===0)throw new le;if(e.length===1)return e[0];const r=e[0].range.getStartPosition(),i=e[e.length-1].range.getEndPosition();let s="";for(let a=0;a<e.length;a++){const o=e[a];if(s+=o.text,a<e.length-1){const u=e[a+1],l=B.fromPositions(o.range.getEndPosition(),u.range.getStartPosition()),h=n.getValueOfRange(l);s+=h}}return new Xe(B.fromPositions(r,i),s)}static fromStringReplacement(e,n){return new Xe(n.getTransformer().getRange(e.replaceRange),e.newText)}static delete(e){return new Xe(e,"")}constructor(e,n){this.range=e,this.text=n}get isEmpty(){return this.range.isEmpty()&&this.text.length===0}static equals(e,n){return e.range.equalsRange(n.range)&&e.text===n.text}equals(e){return Xe.equals(this,e)}removeCommonPrefixAndSuffix(e){return this.removeCommonPrefix(e).removeCommonSuffix(e)}removeCommonPrefix(e){const n=e.getValueOfRange(this.range).replaceAll(`\r
|
||||
`,`
|
||||
`),r=this.text.replaceAll(`\r
|
||||
`,`
|
||||
`),i=pl(n,r),s=Ht.ofText(n.substring(0,i)).addToPosition(this.range.getStartPosition()),a=r.substring(i),o=B.fromPositions(s,this.range.getEndPosition());return new Xe(o,a)}removeCommonSuffix(e){const n=e.getValueOfRange(this.range).replaceAll(`\r
|
||||
`,`
|
||||
`),r=this.text.replaceAll(`\r
|
||||
`,`
|
||||
`),i=bl(n,r),s=Ht.ofText(n.substring(0,n.length-i)).addToPosition(this.range.getStartPosition()),a=r.substring(0,r.length-i),o=B.fromPositions(this.range.getStartPosition(),s);return new Xe(o,a)}toString(){const e=this.range.getStartPosition(),n=this.range.getEndPosition();return`(${e.lineNumber},${e.column} -> ${n.lineNumber},${n.column}): "${this.text}"`}}class Le{static inverse(e,n,r){const i=[];let s=1,a=1;for(const u of e){const l=new Le(new H(s,u.original.startLineNumber),new H(a,u.modified.startLineNumber));l.modified.isEmpty||i.push(l),s=u.original.endLineNumberExclusive,a=u.modified.endLineNumberExclusive}const o=new Le(new H(s,n+1),new H(a,r+1));return o.modified.isEmpty||i.push(o),i}static clip(e,n,r){const i=[];for(const s of e){const a=s.original.intersect(n),o=s.modified.intersect(r);a&&!a.isEmpty&&o&&!o.isEmpty&&i.push(new Le(a,o))}return i}constructor(e,n){this.original=e,this.modified=n}toString(){return`{${this.original.toString()}->${this.modified.toString()}}`}flip(){return new Le(this.modified,this.original)}join(e){return new Le(this.original.join(e.original),this.modified.join(e.modified))}toRangeMapping(){const e=this.original.toInclusiveRange(),n=this.modified.toInclusiveRange();if(e&&n)return new Ne(e,n);if(this.original.startLineNumber===1||this.modified.startLineNumber===1){if(!(this.modified.startLineNumber===1&&this.original.startLineNumber===1))throw new le("not a valid diff");return new Ne(new B(this.original.startLineNumber,1,this.original.endLineNumberExclusive,1),new B(this.modified.startLineNumber,1,this.modified.endLineNumberExclusive,1))}else return new Ne(new B(this.original.startLineNumber-1,Number.MAX_SAFE_INTEGER,this.original.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),new B(this.modified.startLineNumber-1,Number.MAX_SAFE_INTEGER,this.modified.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER))}toRangeMapping2(e,n){if(Ws(this.original.endLineNumberExclusive,e)&&Ws(this.modified.endLineNumberExclusive,n))return new Ne(new B(this.original.startLineNumber,1,this.original.endLineNumberExclusive,1),new B(this.modified.startLineNumber,1,this.modified.endLineNumberExclusive,1));if(!this.original.isEmpty&&!this.modified.isEmpty)return new Ne(B.fromPositions(new Q(this.original.startLineNumber,1),vt(new Q(this.original.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),e)),B.fromPositions(new Q(this.modified.startLineNumber,1),vt(new Q(this.modified.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),n)));if(this.original.startLineNumber>1&&this.modified.startLineNumber>1)return new Ne(B.fromPositions(vt(new Q(this.original.startLineNumber-1,Number.MAX_SAFE_INTEGER),e),vt(new Q(this.original.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),e)),B.fromPositions(vt(new Q(this.modified.startLineNumber-1,Number.MAX_SAFE_INTEGER),n),vt(new Q(this.modified.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),n)));throw new le}}function vt(t,e){if(t.lineNumber<1)return new Q(1,1);if(t.lineNumber>e.length)return new Q(e.length,e[e.length-1].length+1);const n=e[t.lineNumber-1];return t.column>n.length+1?new Q(t.lineNumber,n.length+1):t}function Ws(t,e){return t>=1&&t<=e.length}class qe extends Le{static fromRangeMappings(e){const n=H.join(e.map(i=>H.fromRangeInclusive(i.originalRange))),r=H.join(e.map(i=>H.fromRangeInclusive(i.modifiedRange)));return new qe(n,r,e)}constructor(e,n,r){super(e,n),this.innerChanges=r}flip(){return new qe(this.modified,this.original,this.innerChanges?.map(e=>e.flip()))}withInnerChangesFromLineRanges(){return new qe(this.original,this.modified,[this.toRangeMapping()])}}class Ne{static fromEdit(e){const n=e.getNewRanges();return e.replacements.map((i,s)=>new Ne(i.range,n[s]))}static assertSorted(e){for(let n=1;n<e.length;n++){const r=e[n-1],i=e[n];if(!(r.originalRange.getEndPosition().isBeforeOrEqual(i.originalRange.getStartPosition())&&r.modifiedRange.getEndPosition().isBeforeOrEqual(i.modifiedRange.getStartPosition())))throw new le("Range mappings must be sorted")}}constructor(e,n){this.originalRange=e,this.modifiedRange=n}toString(){return`{${this.originalRange.toString()}->${this.modifiedRange.toString()}}`}flip(){return new Ne(this.modifiedRange,this.originalRange)}toTextEdit(e){const n=e.getValueOfRange(this.modifiedRange);return new Xe(this.originalRange,n)}}function Hs(t,e,n,r=!1){const i=[];for(const s of Eu(t.map(a=>$u(a,e,n)),(a,o)=>a.original.intersectsOrTouches(o.original)||a.modified.intersectsOrTouches(o.modified))){const a=s[0],o=s[s.length-1];i.push(new qe(a.original.join(o.original),a.modified.join(o.modified),s.map(u=>u.innerChanges[0])))}return un(()=>!r&&i.length>0&&(i[0].modified.startLineNumber!==i[0].original.startLineNumber||n.length.lineCount-i[i.length-1].modified.endLineNumberExclusive!==e.length.lineCount-i[i.length-1].original.endLineNumberExclusive)?!1:ai(i,(s,a)=>a.original.startLineNumber-s.original.endLineNumberExclusive===a.modified.startLineNumber-s.modified.endLineNumberExclusive&&s.original.endLineNumberExclusive<a.ori
Line truncated
|
||||
`);this.histogram[o]=(this.histogram[o]||0)+1}this.totalCount=i}computeSimilarity(e){let n=0;const r=Math.max(this.histogram.length,e.histogram.length);for(let i=0;i<r;i++)n+=Math.abs((this.histogram[i]??0)-(e.histogram[i]??0));return 1-n/(this.totalCount+e.totalCount)}};sn.chrKeys=new Map;let _n=sn;class zu{compute(e,n,r=Gt.instance,i){if(e.length===0||n.length===0)return je.trivial(e,n);const s=new Sr(e.length,n.length),a=new Sr(e.length,n.length),o=new Sr(e.length,n.length);for(let d=0;d<e.length;d++)for(let p=0;p<n.length;p++){if(!r.isValid())return je.trivialTimedOut(e,n);const y=d===0?0:s.get(d-1,p),x=p===0?0:s.get(d,p-1);let v;e.getElement(d)===n.getElement(p)?(d===0||p===0?v=0:v=s.get(d-1,p-1),d>0&&p>0&&a.get(d-1,p-1)===3&&(v+=o.get(d-1,p-1)),v+=i?i(d,p):1):v=-1;const b=Math.max(y,x,v);if(b===v){const _=d>0&&p>0?o.get(d-1,p-1):0;o.set(d,p,_+1),a.set(d,p,3)}else b===y?(o.set(d,p,0),a.set(d,p,1)):b===x&&(o.set(d,p,0),a.set(d,p,2));s.set(d,p,b)}const u=[];let l=e.length,h=n.length;function f(d,p){(d+1!==l||p+1!==h)&&u.push(new K(new j(d+1,l),new j(p+1,h))),l=d,h=p}let m=e.length-1,g=n.length-1;for(;m>=0&&g>=0;)a.get(m,g)===3?(f(m,g),m--,g--):a.get(m,g)===1?m--:g--;return f(-1,-1),u.reverse(),new je(u,!1)}}class Xs{compute(e,n,r=Gt.instance){if(e.length===0||n.length===0)return je.trivial(e,n);const i=e,s=n;function a(p,y){for(;p<i.length&&y<s.length&&i.getElement(p)===s.getElement(y);)p++,y++;return p}let o=0;const u=new Gu;u.set(0,a(0,0));const l=new Ju;l.set(0,u.get(0)===0?null:new Qs(null,0,0,u.get(0)));let h=0;e:for(;;){if(o++,!r.isValid())return je.trivialTimedOut(i,s);const p=-Math.min(o,s.length+o%2),y=Math.min(o,i.length+o%2);for(h=p;h<=y;h+=2){const x=h===y?-1:u.get(h+1),v=h===p?-1:u.get(h-1)+1,b=Math.min(Math.max(x,v),i.length),_=b-h;if(b>i.length||_>s.length)continue;const N=a(b,_);u.set(h,N);const E=b===x?l.get(h+1):l.get(h-1);if(l.set(h,N!==b?new Qs(E,b,_,N-b):E),u.get(h)===i.length&&u.get(h)-h===s.length)break e}}let f=l.get(h);const m=[];let g=i.length,d=s.length;for(;;){const p=f?f.x+f.length:0,y=f?f.y+f.length:0;if((p!==g||y!==d)&&m.push(new K(new j(p,g),new j(y,d))),!f)break;g=f.x,d=f.y,f=f.prev}return m.reverse(),new je(m,!1)}}class Qs{constructor(e,n,r,i){this.prev=e,this.x=n,this.y=r,this.length=i}}class Gu{constructor(){this.positiveArr=new Int32Array(10),this.negativeArr=new Int32Array(10)}get(e){return e<0?(e=-e-1,this.negativeArr[e]):this.positiveArr[e]}set(e,n){if(e<0){if(e=-e-1,e>=this.negativeArr.length){const r=this.negativeArr;this.negativeArr=new Int32Array(r.length*2),this.negativeArr.set(r)}this.negativeArr[e]=n}else{if(e>=this.positiveArr.length){const r=this.positiveArr;this.positiveArr=new Int32Array(r.length*2),this.positiveArr.set(r)}this.positiveArr[e]=n}}}class Ju{constructor(){this.positiveArr=[],this.negativeArr=[]}get(e){return e<0?(e=-e-1,this.negativeArr[e]):this.positiveArr[e]}set(e,n){e<0?(e=-e-1,this.negativeArr[e]=n):this.positiveArr[e]=n}}class Sn{constructor(e,n,r){this.lines=e,this.range=n,this.considerWhitespaceChanges=r,this.elements=[],this.firstElementOffsetByLineIdx=[],this.lineStartOffsets=[],this.trimmedWsLengthsByLineIdx=[],this.firstElementOffsetByLineIdx.push(0);for(let i=this.range.startLineNumber;i<=this.range.endLineNumber;i++){let s=e[i-1],a=0;i===this.range.startLineNumber&&this.range.startColumn>1&&(a=this.range.startColumn-1,s=s.substring(a)),this.lineStartOffsets.push(a);let o=0;if(!r){const l=s.trimStart();o=s.length-l.length,s=l.trimEnd()}this.trimmedWsLengthsByLineIdx.push(o);const u=i===this.range.endLineNumber?Math.min(this.range.endColumn-1-a-o,s.length):s.length;for(let l=0;l<u;l++)this.elements.push(s.charCodeAt(l));i<this.range.endLineNumber&&(this.elements.push(10),this.firstElementOffsetByLineIdx.push(this.elements.length))}}toString(){return`Slice: "${this.text}"`}get text(){return this.getText(new j(0,this.length))}getText(e){return this.elements.slice(e.start,e.endExclusive).map(n=>String.fromCharCode(n)).join("")}getElement(e){return this.elements[e]}get length(){return this.elements.length}getBoundaryScore(e){const n=Ks(e>0?this.elements[e-1]:-1),r=Ks(e<this.elements.length?this.elements[e]:-1);if(n===7&&r===8)return 0;if(n===8)return 150;let i=0;return n!==r&&(i+=10,n===0&&r===1&&(i+=1)),i+=Ys(n),i+=Ys(r),i}translateOffset(e,n="right"){const r=wt(this.firstElementOffsetByLineIdx,s=>s<=e),i=e-this.firstElementOffsetByLineIdx[r];return new Q(this.range.startLineNumber+r,1+this.lineStartOffsets[r]+i+(i===0&&n==="left"?0:this.trimmedWsLengthsByLineIdx[r]))}translateRange(e){const n=this.translateOffset(e.start,"right"),r=this.translateOffset(e.endExclusive,"left");return r.isBefore(n)?B.fromPositions(r,r):B.fromPositions(n,r)}findWordContaining(e){if(e<0||e>=this.elements.length||!Nt(this.elements[e]))return;let n=e;for(;n>0&&Nt(this.elements[n-1]);)n--;let r=e;for(;r<this.elements.length&&Nt(this.elements[r]);)r++;return new j(n,r)}findSubWordContaining(e){if(e<0||e>=this.elements.length||!Nt(this.elements[e]))return;l
Line truncated
|
||||
`).length>=15&&Zu(f,g=>g.length>=2)>=2}),a=tc(t,a),a}function Zu(t,e){let n=0;for(const r of t)e(r)&&n++;return n}function Yu(t,e,n,r){const i=[],s=t.filter(u=>u.modified.isEmpty&&u.original.length>=3).map(u=>new _n(u.original,e,u)),a=new Set(t.filter(u=>u.original.isEmpty&&u.modified.length>=3).map(u=>new _n(u.modified,n,u))),o=new Set;for(const u of s){let l=-1,h;for(const f of a){const m=u.computeSimilarity(f);m>l&&(l=m,h=f)}if(l>.9&&h&&(a.delete(h),i.push(new Le(u.range,h.range)),o.add(u.source),o.add(h.source)),!r.isValid())return{moves:i,excludedChanges:o}}return{moves:i,excludedChanges:o}}function Ku(t,e,n,r,i,s){const a=[],o=new pu;for(const m of t)for(let g=m.original.startLineNumber;g<m.original.endLineNumberExclusive-2;g++){const d=`${e[g-1]}:${e[g+1-1]}:${e[g+2-1]}`;o.add(d,{range:new H(g,g+3)})}const u=[];t.sort(jt(m=>m.modified.startLineNumber,Wt));for(const m of t){let g=[];for(let d=m.modified.startLineNumber;d<m.modified.endLineNumberExclusive-2;d++){const p=`${n[d-1]}:${n[d+1-1]}:${n[d+2-1]}`,y=new H(d,d+3),x=[];o.forEach(p,({range:v})=>{for(const _ of g)if(_.originalLineRange.endLineNumberExclusive+1===v.endLineNumberExclusive&&_.modifiedLineRange.endLineNumberExclusive+1===y.endLineNumberExclusive){_.originalLineRange=new H(_.originalLineRange.startLineNumber,v.endLineNumberExclusive),_.modifiedLineRange=new H(_.modifiedLineRange.startLineNumber,y.endLineNumberExclusive),x.push(_);return}const b={modifiedLineRange:y,originalLineRange:v};u.push(b),x.push(b)}),g=x}if(!s.isValid())return[]}u.sort(Cu(jt(m=>m.modifiedLineRange.length,Wt)));const l=new Ie,h=new Ie;for(const m of u){const g=m.modifiedLineRange.startLineNumber-m.originalLineRange.startLineNumber,d=l.subtractFrom(m.modifiedLineRange),p=h.subtractFrom(m.originalLineRange).getWithDelta(g),y=d.getIntersection(p);for(const x of y.ranges){if(x.length<3)continue;const v=x,b=x.delta(-g);a.push(new Le(b,v)),l.addRange(v),h.addRange(b)}}a.sort(jt(m=>m.original.startLineNumber,Wt));const f=new Ln(t);for(let m=0;m<a.length;m++){const g=a[m],d=f.findLastMonotonous(E=>E.original.startLineNumber<=g.original.startLineNumber),p=yt(t,E=>E.modified.startLineNumber<=g.modified.startLineNumber),y=Math.max(g.original.startLineNumber-d.original.startLineNumber,g.modified.startLineNumber-p.modified.startLineNumber),x=f.findLastMonotonous(E=>E.original.startLineNumber<g.original.endLineNumberExclusive),v=yt(t,E=>E.modified.startLineNumber<g.modified.endLineNumberExclusive),b=Math.max(x.original.endLineNumberExclusive-g.original.endLineNumberExclusive,v.modified.endLineNumberExclusive-g.modified.endLineNumberExclusive);let _;for(_=0;_<y;_++){const E=g.original.startLineNumber-_-1,L=g.modified.startLineNumber-_-1;if(E>r.length||L>i.length||l.contains(L)||h.contains(E)||!ea(r[E-1],i[L-1],s))break}_>0&&(h.addRange(new H(g.original.startLineNumber-_,g.original.startLineNumber)),l.addRange(new H(g.modified.startLineNumber-_,g.modified.startLineNumber)));let N;for(N=0;N<b;N++){const E=g.original.endLineNumberExclusive+N,L=g.modified.endLineNumberExclusive+N;if(E>r.length||L>i.length||l.contains(L)||h.contains(E)||!ea(r[E-1],i[L-1],s))break}N>0&&(h.addRange(new H(g.original.endLineNumberExclusive,g.original.endLineNumberExclusive+N)),l.addRange(new H(g.modified.endLineNumberExclusive,g.modified.endLineNumberExclusive+N))),(_>0||N>0)&&(a[m]=new Le(new H(g.original.startLineNumber-_,g.original.endLineNumberExclusive+N),new H(g.modified.startLineNumber-_,g.modified.endLineNumberExclusive+N)))}return a}function ea(t,e,n){if(t.trim()===e.trim())return!0;if(t.length>300&&e.length>300)return!1;const i=new Xs().compute(new Sn([t],new B(1,1,1,t.length),!1),new Sn([e],new B(1,1,1,e.length),!1),n);let s=0;const a=K.invert(i.diffs,t.length);for(const h of a)h.seq1Range.forEach(f=>{Ar(t.charCodeAt(f))||s++});function o(h){let f=0;for(let m=0;m<t.length;m++)Ar(h.charCodeAt(m))||f++;return f}const u=o(t.length>e.length?t:e);return s/u>.6&&u>10}function ec(t){if(t.length===0)return t;t.sort(jt(n=>n.original.startLineNumber,Wt));const e=[t[0]];for(let n=1;n<t.length;n++){const r=e[e.length-1],i=t[n],s=i.original.startLineNumber-r.original.endLineNumberExclusive,a=i.modified.startLineNumber-r.modified.endLineNumberExclusive;if(s>=0&&a>=0&&s+a<=2){e[e.length-1]=r.join(i);continue}e.push(i)}return e}function tc(t,e){const n=new Ln(t);return e=e.filter(r=>{const i=n.findLastMonotonous(o=>o.original.startLineNumber<r.original.endLineNumberExclusive)||new Le(new H(1,1),new H(1,1)),s=yt(t,o=>o.modified.startLineNumber<r.modified.endLineNumberExclusive);return i!==s}),e}function ta(t,e,n){let r=n;return r=na(t,e,r),r=na(t,e,r),r=nc(t,e,r),r}function na(t,e,n){if(n.length===0)return n;const r=[];r.push(n[0]);for(let s=1;s<n.length;s++){const a=r[r.length-1];let o=n[s];if(o.seq1Range.isEmpty||o.seq2Range.isEmpty){const u=o.seq1Range.start-a.seq1Range.endExclusive;let l;for(l=1;l<=u&&!(t.getElement(o.seq1Range.start-l)!==t.getElement(o.seq1Range.endExclusive-l)||e.getElement(o.seq2Range.
Line truncated
|
||||
`)}isStronglyEqual(e,n){return this.lines[e]===this.lines[n]}}function aa(t){let e=0;for(;e<t.length&&(t.charCodeAt(e)===32||t.charCodeAt(e)===9);)e++;return e}class oc{constructor(){this.dynamicProgrammingDiffing=new zu,this.myersDiffingAlgorithm=new Xs}computeDiff(e,n,r){if(e.length<=1&&Ru(e,n,(L,S)=>L===S))return new vn([],[],!1);if(e.length===1&&e[0].length===0||n.length===1&&n[0].length===0)return new vn([new qe(new H(1,e.length+1),new H(1,n.length+1),[new Ne(new B(1,1,e.length,e[e.length-1].length+1),new B(1,1,n.length,n[n.length-1].length+1))])],[],!1);const i=r.maxComputationTimeMs===0?Gt.instance:new Hu(r.maxComputationTimeMs),s=!r.ignoreTrimWhitespace,a=new Map;function o(L){let S=a.get(L);return S===void 0&&(S=a.size,a.set(L,S)),S}const u=e.map(L=>o(L.trim())),l=n.map(L=>o(L.trim())),h=new sa(u,e),f=new sa(l,n),m=h.length+f.length<1700?this.dynamicProgrammingDiffing.compute(h,f,i,(L,S)=>e[L]===n[S]?n[S].length===0?.1:1+Math.log(1+n[S].length):.99):this.myersDiffingAlgorithm.compute(h,f,i);let g=m.diffs,d=m.hitTimeout;g=ta(h,f,g),g=sc(h,f,g);const p=[],y=L=>{if(s)for(let S=0;S<L;S++){const P=x+S,D=v+S;if(e[P]!==n[D]){const T=this.refineDiff(e,n,new K(new j(P,P+1),new j(D,D+1)),i,s,r);for(const w of T.mappings)p.push(w);T.hitTimeout&&(d=!0)}}};let x=0,v=0;for(const L of g){un(()=>L.seq1Range.start-x===L.seq2Range.start-v);const S=L.seq1Range.start-x;y(S),x=L.seq1Range.endExclusive,v=L.seq2Range.endExclusive;const P=this.refineDiff(e,n,L,i,s,r);P.hitTimeout&&(d=!0);for(const D of P.mappings)p.push(D)}y(e.length-x);const b=new Nn(e),_=new Nn(n),N=Hs(p,b,_);let E=[];return r.computeMoves&&(E=this.computeMoves(N,e,n,u,l,i,s,r)),un(()=>{function L(P,D){if(P.lineNumber<1||P.lineNumber>D.length)return!1;const T=D[P.lineNumber-1];return!(P.column<1||P.column>T.length+1)}function S(P,D){return!(P.startLineNumber<1||P.startLineNumber>D.length+1||P.endLineNumberExclusive<1||P.endLineNumberExclusive>D.length+1)}for(const P of N){if(!P.innerChanges)return!1;for(const D of P.innerChanges)if(!(L(D.modifiedRange.getStartPosition(),n)&&L(D.modifiedRange.getEndPosition(),n)&&L(D.originalRange.getStartPosition(),e)&&L(D.originalRange.getEndPosition(),e)))return!1;if(!S(P.modified,n)||!S(P.original,e))return!1}return!0}),new vn(N,E,d)}computeMoves(e,n,r,i,s,a,o,u){return Qu(e,n,r,i,s,a).map(f=>{const m=this.refineDiff(n,r,new K(f.original.toOffsetRange(),f.modified.toOffsetRange()),a,o,u),g=Hs(m.mappings,new Nn(n),new Nn(r),!0);return new ku(f,g)})}refineDiff(e,n,r,i,s,a){const u=lc(r).toRangeMapping2(e,n),l=new Sn(e,u.originalRange,s),h=new Sn(n,u.modifiedRange,s),f=l.length+h.length<500?this.dynamicProgrammingDiffing.compute(l,h,i):this.myersDiffingAlgorithm.compute(l,h,i);let m=f.diffs;return m=ta(l,h,m),m=ia(l,h,m,(d,p)=>d.findWordContaining(p)),a.extendToSubwords&&(m=ia(l,h,m,(d,p)=>d.findSubWordContaining(p),!0)),m=rc(l,h,m),m=ac(l,h,m),{mappings:m.map(d=>new Ne(l.translateRange(d.seq1Range),h.translateRange(d.seq2Range))),hitTimeout:f.hitTimeout}}}function lc(t){return new Le(new H(t.seq1Range.start+1,t.seq1Range.endExclusive+1),new H(t.seq2Range.start+1,t.seq2Range.endExclusive+1))}const oa={getLegacy:()=>new Uu,getDefault:()=>new oc};function Qe(t,e){const n=Math.pow(10,e);return Math.round(t*n)/n}class A{constructor(e,n,r,i=1){this._rgbaBrand=void 0,this.r=Math.min(255,Math.max(0,e))|0,this.g=Math.min(255,Math.max(0,n))|0,this.b=Math.min(255,Math.max(0,r))|0,this.a=Qe(Math.max(Math.min(1,i),0),3)}static equals(e,n){return e.r===n.r&&e.g===n.g&&e.b===n.b&&e.a===n.a}}class _e{constructor(e,n,r,i){this._hslaBrand=void 0,this.h=Math.max(Math.min(360,e),0)|0,this.s=Qe(Math.max(Math.min(1,n),0),3),this.l=Qe(Math.max(Math.min(1,r),0),3),this.a=Qe(Math.max(Math.min(1,i),0),3)}static equals(e,n){return e.h===n.h&&e.s===n.s&&e.l===n.l&&e.a===n.a}static fromRGBA(e){const n=e.r/255,r=e.g/255,i=e.b/255,s=e.a,a=Math.max(n,r,i),o=Math.min(n,r,i);let u=0,l=0;const h=(o+a)/2,f=a-o;if(f>0){switch(l=Math.min(h<=.5?f/(2*h):f/(2-2*h),1),a){case n:u=(r-i)/f+(r<i?6:0);break;case r:u=(i-n)/f+2;break;case i:u=(n-r)/f+4;break}u*=60,u=Math.round(u)}return new _e(u,l,h,s)}static _hue2rgb(e,n,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?e+(n-e)*6*r:r<1/2?n:r<2/3?e+(n-e)*(2/3-r)*6:e}static toRGBA(e){const n=e.h/360,{s:r,l:i,a:s}=e;let a,o,u;if(r===0)a=o=u=i;else{const l=i<.5?i*(1+r):i+r-i*r,h=2*i-l;a=_e._hue2rgb(h,l,n+1/3),o=_e._hue2rgb(h,l,n),u=_e._hue2rgb(h,l,n-1/3)}return new A(Math.round(a*255),Math.round(o*255),Math.round(u*255),s)}}class _t{constructor(e,n,r,i){this._hsvaBrand=void 0,this.h=Math.max(Math.min(360,e),0)|0,this.s=Qe(Math.max(Math.min(1,n),0),3),this.v=Qe(Math.max(Math.min(1,r),0),3),this.a=Qe(Math.max(Math.min(1,i),0),3)}static equals(e,n){return e.h===n.h&&e.s===n.s&&e.v===n.v&&e.a===n.a}static fromRGBA(e){const n=e.r/255,r=e.g/255,i=e.b/255,s=Math.max(n,r,i),a=Math.min(n,r,i),o=s-a,u=s===0?0:o/s;let l;return o===0?l=0:s===n?l=((r-i)/o%6+6)%6:s===r?l=(i-n)/o+2:l=(n-r)/o+4,new _t(Math.round(l*60),u,s,e.a)}static toRGBA(e)
Line truncated
|
||||
`);s.lastIndex=0;let h;for(;(h=s.exec(l))!==null;){const f=l.substring(0,h.index),m=(f.match(/\n/g)||[]).length,g=a+m,d=h[0].split(`
|
||||
`),p=d.length,y=g+p-1,x=f.lastIndexOf(`
|
||||
`)+1,v=h.index-x+1,b=d[d.length-1],_=p===1?v+h[0].length:b.length+1,N={startLineNumber:g,startColumn:v,endLineNumber:y,endColumn:_},E=(h.groups??{}).label??"",L=((h.groups??{}).separator??"")!=="",S={range:N,text:E,hasSeparatorLine:L,shouldBeInComments:!0};(S.text||S.hasSeparatorLine)&&(n.length===0||n[n.length-1].range.endLineNumber<S.range.startLineNumber)&&n.push(S),s.lastIndex=h.index+h[0].length}}return n}function bc(t){t=t.trim();const e=t.startsWith("-");return t=t.replace(hc,""),{text:t,hasSeparatorLine:e}}class yc{get isRejected(){return this.outcome?.outcome===1}get isSettled(){return!!this.outcome}constructor(){this.p=new Promise((e,n)=>{this.completeCallback=e,this.errorCallback=n})}complete(e){return this.isSettled?Promise.resolve():new Promise(n=>{this.completeCallback(e),this.outcome={outcome:0,value:e},n()})}error(e){return this.isSettled?Promise.resolve():new Promise(n=>{this.errorCallback(e),this.outcome={outcome:1,value:e},n()})}cancel(){return this.error(new si)}}var ha;(function(t){async function e(r){let i;const s=await Promise.all(r.map(a=>a.then(o=>o,o=>{i||(i=o)})));if(typeof i<"u")throw i;return s}t.settled=e;function n(r){return new Promise(async(i,s)=>{try{await r(i,s)}catch(a){s(a)}})}t.withAsyncBody=n})(ha||(ha={}));class wc{constructor(){this._unsatisfiedConsumers=[],this._unconsumedValues=[]}get hasFinalValue(){return!!this._finalValue}produce(e){if(this._ensureNoFinalValue(),this._unsatisfiedConsumers.length>0){const n=this._unsatisfiedConsumers.shift();this._resolveOrRejectDeferred(n,e)}else this._unconsumedValues.push(e)}produceFinal(e){this._ensureNoFinalValue(),this._finalValue=e;for(const n of this._unsatisfiedConsumers)this._resolveOrRejectDeferred(n,e);this._unsatisfiedConsumers.length=0}_ensureNoFinalValue(){if(this._finalValue)throw new le("ProducerConsumer: cannot produce after final value has been set")}_resolveOrRejectDeferred(e,n){n.ok?e.complete(n.value):e.error(n.error)}consume(){if(this._unconsumedValues.length>0||this._finalValue){const e=this._unconsumedValues.length>0?this._unconsumedValues.shift():this._finalValue;return e.ok?Promise.resolve(e.value):Promise.reject(e.error)}else{const e=new yc;return this._unsatisfiedConsumers.push(e),e.p}}}const pe=class pe{constructor(e,n){this._onReturn=n,this._producerConsumer=new wc,this._iterator={next:()=>this._producerConsumer.consume(),return:()=>(this._onReturn?.(),Promise.resolve({done:!0,value:void 0})),throw:async r=>(this._finishError(r),{done:!0,value:void 0})},queueMicrotask(async()=>{const r=e({emitOne:i=>this._producerConsumer.produce({ok:!0,value:{done:!1,value:i}}),emitMany:i=>{for(const s of i)this._producerConsumer.produce({ok:!0,value:{done:!1,value:s}})},reject:i=>this._finishError(i)});if(!this._producerConsumer.hasFinalValue)try{await r,this._finishOk()}catch(i){this._finishError(i)}})}static fromArray(e){return new pe(n=>{n.emitMany(e)})}static fromPromise(e){return new pe(async n=>{n.emitMany(await e)})}static fromPromisesResolveOrder(e){return new pe(async n=>{await Promise.all(e.map(async r=>n.emitOne(await r)))})}static merge(e){return new pe(async n=>{await Promise.all(e.map(async r=>{for await(const i of r)n.emitOne(i)}))})}static map(e,n){return new pe(async r=>{for await(const i of e)r.emitOne(n(i))})}map(e){return pe.map(this,e)}static coalesce(e){return pe.filter(e,n=>!!n)}coalesce(){return pe.coalesce(this)}static filter(e,n){return new pe(async r=>{for await(const i of e)n(i)&&r.emitOne(i)})}filter(e){return pe.filter(this,e)}_finishOk(){this._producerConsumer.hasFinalValue||this._producerConsumer.produceFinal({ok:!0,value:{done:!0,value:void 0}})}_finishError(e){this._producerConsumer.hasFinalValue||this._producerConsumer.produceFinal({ok:!1,error:e})}[Symbol.asyncIterator](){return this._iterator}};pe.EMPTY=pe.fromArray([]);let ma=pe;class xc{constructor(e){this.values=e,this.prefixSum=new Uint32Array(e.length),this.prefixSumValidIndex=new Int32Array(1),this.prefixSumValidIndex[0]=-1}insertValues(e,n){e=gt(e);const r=this.values,i=this.prefixSum,s=n.length;return s===0?!1:(this.values=new Uint32Array(r.length+s),this.values.set(r.subarray(0,e),0),this.values.set(r.subarray(e),e+s),this.values.set(n,e),e-1<this.prefixSumValidIndex[0]&&(this.prefixSumValidIndex[0]=e-1),this.prefixSum=new Uint32Array(this.values.length),this.prefixSumValidIndex[0]>=0&&this.prefixSum.set(i.subarray(0,this.prefixSumValidIndex[0]+1)),!0)}setValue(e,n){return e=gt(e),n=gt(n),this.values[e]===n?!1:(this.values[e]=n,e-1<this.prefixSumValidIndex[0]&&(this.prefixSumValidIndex[0]=e-1),!0)}removeValues(e,n){e=gt(e),n=gt(n);const r=this.values,i=this.prefixSum;if(e>=r.length)return!1;const s=r.length-e;return n>=s&&(n=s),n===0?!1:(this.values=new Uint32Array(r.length-n),this.values.set(r.subarray(0,e),0),this.values.set(r.subarray(e+n),e),this.prefixSum=new Uint32Array(this.values.length),e-1<this.prefixSumValidIndex[0]&&(this.prefixSumValidIndex[0]=e-1),this.prefixSumValidIndex[0]>=0&&this.prefixSum.set(i.suba
Line truncated
|
||||
`;break;case 114:b+="\r";break;case 116:b+=" ";break;case 117:const L=m(4);L>=0?b+=String.fromCharCode(L):f=4;break;default:f=5}_=r;continue}if(N>=0&&N<=31)if(Qt(N)){b+=t.substring(_,r),f=2;break}else f=6;r++}return b}function y(){if(i="",f=0,s=r,u=o,h=l,r>=n)return s=n,a=17;let b=t.charCodeAt(r);if(Tr(b)){do r++,i+=String.fromCharCode(b),b=t.charCodeAt(r);while(Tr(b));return a=15}if(Qt(b))return r++,i+=String.fromCharCode(b),b===13&&t.charCodeAt(r)===10&&(r++,i+=`
|
||||
`),o++,l=r,a=14;switch(b){case 123:return r++,a=1;case 125:return r++,a=2;case 91:return r++,a=3;case 93:return r++,a=4;case 58:return r++,a=6;case 44:return r++,a=5;case 34:return r++,i=p(),a=10;case 47:const _=r-1;if(t.charCodeAt(r+1)===47){for(r+=2;r<n&&!Qt(t.charCodeAt(r));)r++;return i=t.substring(_,r),a=12}if(t.charCodeAt(r+1)===42){r+=2;const N=n-1;let E=!1;for(;r<N;){const L=t.charCodeAt(r);if(L===42&&t.charCodeAt(r+1)===47){r+=2,E=!0;break}r++,Qt(L)&&(L===13&&t.charCodeAt(r)===10&&r++,o++,l=r)}return E||(r++,f=1),i=t.substring(_,r),a=13}return i+=String.fromCharCode(b),r++,a=16;case 45:if(i+=String.fromCharCode(b),r++,r===n||!St(t.charCodeAt(r)))return a=16;case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return i+=d(),a=11;default:for(;r<n&&x(b);)r++,b=t.charCodeAt(r);if(s!==r){switch(i=t.substring(s,r),i){case"true":return a=8;case"false":return a=9;case"null":return a=7}return a=16}return i+=String.fromCharCode(b),r++,a=16}}function x(b){if(Tr(b)||Qt(b))return!1;switch(b){case 125:case 93:case 123:case 91:case 34:case 58:case 44:case 47:return!1}return!0}function v(){let b;do b=y();while(b>=12&&b<=15);return b}return{setPosition:g,getPosition:()=>r,scan:e?v:y,getToken:()=>a,getTokenValue:()=>i,getTokenOffset:()=>s,getTokenLength:()=>r-s,getTokenStartLine:()=>u,getTokenStartCharacter:()=>s-h,getTokenError:()=>f}}function Tr(t){return t===32||t===9}function Qt(t){return t===10||t===13}function St(t){return t>=48&&t<=57}var da;(function(t){t[t.lineFeed=10]="lineFeed",t[t.carriageReturn=13]="carriageReturn",t[t.space=32]="space",t[t._0=48]="_0",t[t._1=49]="_1",t[t._2=50]="_2",t[t._3=51]="_3",t[t._4=52]="_4",t[t._5=53]="_5",t[t._6=54]="_6",t[t._7=55]="_7",t[t._8=56]="_8",t[t._9=57]="_9",t[t.a=97]="a",t[t.b=98]="b",t[t.c=99]="c",t[t.d=100]="d",t[t.e=101]="e",t[t.f=102]="f",t[t.g=103]="g",t[t.h=104]="h",t[t.i=105]="i",t[t.j=106]="j",t[t.k=107]="k",t[t.l=108]="l",t[t.m=109]="m",t[t.n=110]="n",t[t.o=111]="o",t[t.p=112]="p",t[t.q=113]="q",t[t.r=114]="r",t[t.s=115]="s",t[t.t=116]="t",t[t.u=117]="u",t[t.v=118]="v",t[t.w=119]="w",t[t.x=120]="x",t[t.y=121]="y",t[t.z=122]="z",t[t.A=65]="A",t[t.B=66]="B",t[t.C=67]="C",t[t.D=68]="D",t[t.E=69]="E",t[t.F=70]="F",t[t.G=71]="G",t[t.H=72]="H",t[t.I=73]="I",t[t.J=74]="J",t[t.K=75]="K",t[t.L=76]="L",t[t.M=77]="M",t[t.N=78]="N",t[t.O=79]="O",t[t.P=80]="P",t[t.Q=81]="Q",t[t.R=82]="R",t[t.S=83]="S",t[t.T=84]="T",t[t.U=85]="U",t[t.V=86]="V",t[t.W=87]="W",t[t.X=88]="X",t[t.Y=89]="Y",t[t.Z=90]="Z",t[t.asterisk=42]="asterisk",t[t.backslash=92]="backslash",t[t.closeBrace=125]="closeBrace",t[t.closeBracket=93]="closeBracket",t[t.colon=58]="colon",t[t.comma=44]="comma",t[t.dot=46]="dot",t[t.doubleQuote=34]="doubleQuote",t[t.minus=45]="minus",t[t.openBrace=123]="openBrace",t[t.openBracket=91]="openBracket",t[t.plus=43]="plus",t[t.slash=47]="slash",t[t.formFeed=12]="formFeed",t[t.tab=9]="tab"})(da||(da={}));const Se=new Array(20).fill(0).map((t,e)=>" ".repeat(e)),At=200,ga={" ":{"\n":new Array(At).fill(0).map((t,e)=>`
|
||||
`+" ".repeat(e)),"\r":new Array(At).fill(0).map((t,e)=>"\r"+" ".repeat(e)),"\r\n":new Array(At).fill(0).map((t,e)=>`\r
|
||||
`+" ".repeat(e))}," ":{"\n":new Array(At).fill(0).map((t,e)=>`
|
||||
`+" ".repeat(e)),"\r":new Array(At).fill(0).map((t,e)=>"\r"+" ".repeat(e)),"\r\n":new Array(At).fill(0).map((t,e)=>`\r
|
||||
`+" ".repeat(e))}},kc=[`
|
||||
`,"\r",`\r
|
||||
`];function Rc(t,e,n){let r,i,s,a,o;if(e){for(a=e.offset,o=a+e.length,s=a;s>0&&!pa(t,s-1);)s--;let N=o;for(;N<t.length&&!pa(t,N);)N++;i=t.substring(s,N),r=Ec(i,n)}else i=t,r=0,s=0,a=0,o=t.length;const u=Mc(n,t),l=kc.includes(u);let h=0,f=0,m;n.insertSpaces?m=Se[n.tabSize||4]??kt(Se[1],n.tabSize||4):m=" ";const g=m===" "?" ":" ";let d=Mr(i,!1),p=!1;function y(){if(h>1)return kt(u,h)+kt(m,r+f);const N=m.length*(r+f);return!l||N>ga[g][u].length?u+kt(m,r+f):N<=0?u:ga[g][u][N]}function x(){let N=d.scan();for(h=0;N===15||N===14;)N===14&&n.keepLines?h+=1:N===14&&(h=1),N=d.scan();return p=N===16||d.getTokenError()!==0,N}const v=[];function b(N,E,L){!p&&(!e||E<o&&L>a)&&t.substring(E,L)!==N&&v.push({offset:E,length:L-E,content:N})}let _=x();if(n.keepLines&&h>0&&b(kt(u,h),0,0),_!==17){let N=d.getTokenOffset()+s,E=m.length*r<20&&n.insertSpaces?Se[m.length*r]:kt(m,r);b(E,s,N)}for(;_!==17;){let N=d.getTokenOffset()+d.getTokenLength()+s,E=x(),L="",S=!1;for(;h===0&&(E===12||E===13);){let D=d.getTokenOffset()+s;b(Se[1],N,D),N=d.getTokenOffset()+d.getTokenLength()+s,S=E===12,L=S?y():"",E=x()}if(E===2)_!==1&&f--,n.keepLines&&h>0||!n.keepLines&&_!==1?L=y():n.keepLines&&(L=Se[1]);else if(E===4)_!==3&&f--,n.keepLines&&h>0||!n.keepLines&&_!==3?L=y():n.keepLines&&(L=Se[1]);else{switch(_){case 3:case 1:f++,n.keepLines&&h>0||!n.keepLines?L=y():L=Se[1];break;case 5:n.keepLines&&h>0||!n.keepLines?L=y():L=Se[1];break;case 12:L=y();break;case 13:h>0?L=y():S||(L=Se[1]);break;case 6:n.keepLines&&h>0?L=y():S||(L=Se[1]);break;case 10:n.keepLines&&h>0?L=y():E===6&&!S&&(L="");break;case 7:case 8:case 9:case 11:case 2:case 4:n.keepLines&&h>0?L=y():(E===12||E===13)&&!S?L=Se[1]:E!==5&&E!==17&&(p=!0);break;case 16:p=!0;break}h>0&&(E===12||E===13)&&(L=y())}E===17&&(n.keepLines&&h>0?L=y():L=n.insertFinalNewline?u:"");const P=d.getTokenOffset()+s;b(L,N,P),_=E}return v}function kt(t,e){let n="";for(let r=0;r<e;r++)n+=t;return n}function Ec(t,e){let n=0,r=0;const i=e.tabSize||4;for(;n<t.length;){let s=t.charAt(n);if(s===Se[1])r++;else if(s===" ")r+=i;else break;n++}return Math.floor(r/i)}function Mc(t,e){for(let n=0;n<e.length;n++){const r=e.charAt(n);if(r==="\r")return n+1<e.length&&e.charAt(n+1)===`
|
||||
`?`\r
|
||||
`:"\r";if(r===`
|
||||
`)return`
|
||||
`}return t&&t.eol||`
|
||||
`}function pa(t,e){return`\r
|
||||
`.indexOf(t.charAt(e))!==-1}var kn;(function(t){t.DEFAULT={allowTrailingComma:!1}})(kn||(kn={}));function Tc(t,e=[],n=kn.DEFAULT){let r=null,i=[];const s=[];function a(u){Array.isArray(i)?i.push(u):r!==null&&(i[r]=u)}return Cc(t,{onObjectBegin:()=>{const u={};a(u),s.push(i),i=u,r=null},onObjectProperty:u=>{r=u},onObjectEnd:()=>{i=s.pop()},onArrayBegin:()=>{const u=[];a(u),s.push(i),i=u,r=null},onArrayEnd:()=>{i=s.pop()},onLiteralValue:a,onError:(u,l,h)=>{e.push({error:u,offset:l,length:h})}},n),i[0]}function ba(t){if(!t.parent||!t.parent.children)return[];const e=ba(t.parent);if(t.parent.type==="property"){const n=t.parent.children[0].value;e.push(n)}else if(t.parent.type==="array"){const n=t.parent.children.indexOf(t);n!==-1&&e.push(n)}return e}function Pr(t){switch(t.type){case"array":return t.children.map(Pr);case"object":const e=Object.create(null);for(let n of t.children){const r=n.children[1];r&&(e[n.children[0].value]=Pr(r))}return e;case"null":case"string":case"number":case"boolean":return t.value;default:return}}function Pc(t,e,n=!1){return e>=t.offset&&e<t.offset+t.length||n&&e===t.offset+t.length}function ya(t,e,n=!1){if(Pc(t,e,n)){const r=t.children;if(Array.isArray(r))for(let i=0;i<r.length&&r[i].offset<=e;i++){const s=ya(r[i],e,n);if(s)return s}return t}}function Cc(t,e,n=kn.DEFAULT){const r=Mr(t,!1),i=[];function s(w){return w?()=>w(r.getTokenOffset(),r.getTokenLength(),r.getTokenStartLine(),r.getTokenStartCharacter()):()=>!0}function a(w){return w?()=>w(r.getTokenOffset(),r.getTokenLength(),r.getTokenStartLine(),r.getTokenStartCharacter(),()=>i.slice()):()=>!0}function o(w){return w?k=>w(k,r.getTokenOffset(),r.getTokenLength(),r.getTokenStartLine(),r.getTokenStartCharacter()):()=>!0}function u(w){return w?k=>w(k,r.getTokenOffset(),r.getTokenLength(),r.getTokenStartLine(),r.getTokenStartCharacter(),()=>i.slice()):()=>!0}const l=a(e.onObjectBegin),h=u(e.onObjectProperty),f=s(e.onObjectEnd),m=a(e.onArrayBegin),g=s(e.onArrayEnd),d=u(e.onLiteralValue),p=o(e.onSeparator),y=s(e.onComment),x=o(e.onError),v=n&&n.disallowComments,b=n&&n.allowTrailingComma;function _(){for(;;){const w=r.scan();switch(r.getTokenError()){case 4:N(14);break;case 5:N(15);break;case 3:N(13);break;case 1:v||N(11);break;case 2:N(12);break;case 6:N(16);break}switch(w){case 12:case 13:v?N(10):y();break;case 16:N(1);break;case 15:case 14:break;default:return w}}}function N(w,k=[],C=[]){if(x(w),k.length+C.length>0){let I=r.getToken();for(;I!==17;){if(k.indexOf(I)!==-1){_();break}else if(C.indexOf(I)!==-1)break;I=_()}}}function E(w){const k=r.getTokenValue();return w?d(k):(h(k),i.push(k)),_(),!0}function L(){switch(r.getToken()){case 11:const w=r.getTokenValue();let k=Number(w);isNaN(k)&&(N(2),k=0),d(k);break;case 7:d(null);break;case 8:d(!0);break;case 9:d(!1);break;default:return!1}return _(),!0}function S(){return r.getToken()!==10?(N(3,[],[2,5]),!1):(E(!1),r.getToken()===6?(p(":"),_(),T()||N(4,[],[2,5])):N(5,[],[2,5]),i.pop(),!0)}function P(){l(),_();let w=!1;for(;r.getToken()!==2&&r.getToken()!==17;){if(r.getToken()===5){if(w||N(4,[],[]),p(","),_(),r.getToken()===2&&b)break}else w&&N(6,[],[]);S()||N(4,[],[2,5]),w=!0}return f(),r.getToken()!==2?N(7,[2],[]):_(),!0}function D(){m(),_();let w=!0,k=!1;for(;r.getToken()!==4&&r.getToken()!==17;){if(r.getToken()===5){if(k||N(4,[],[]),p(","),_(),r.getToken()===4&&b)break}else k&&N(6,[],[]);w?(i.push(0),w=!1):i[i.length-1]++,T()||N(4,[],[4,5]),k=!0}return g(),w||i.pop(),r.getToken()!==4?N(8,[4],[]):_(),!0}function T(){switch(r.getToken()){case 3:return D();case 1:return P();case 10:return E(!0);default:return L()}}return _(),r.getToken()===17?n.allowEmptyContent?!0:(N(4,[],[]),!1):T()?(r.getToken()!==17&&N(9,[],[]),!0):(N(4,[],[]),!1)}const it=Mr;var wa;(function(t){t[t.None=0]="None",t[t.UnexpectedEndOfComment=1]="UnexpectedEndOfComment",t[t.UnexpectedEndOfString=2]="UnexpectedEndOfString",t[t.UnexpectedEndOfNumber=3]="UnexpectedEndOfNumber",t[t.InvalidUnicode=4]="InvalidUnicode",t[t.InvalidEscapeCharacter=5]="InvalidEscapeCharacter",t[t.InvalidCharacter=6]="InvalidCharacter"})(wa||(wa={}));var xa;(function(t){t[t.OpenBraceToken=1]="OpenBraceToken",t[t.CloseBraceToken=2]="CloseBraceToken",t[t.OpenBracketToken=3]="OpenBracketToken",t[t.CloseBracketToken=4]="CloseBracketToken",t[t.CommaToken=5]="CommaToken",t[t.ColonToken=6]="ColonToken",t[t.NullKeyword=7]="NullKeyword",t[t.TrueKeyword=8]="TrueKeyword",t[t.FalseKeyword=9]="FalseKeyword",t[t.StringLiteral=10]="StringLiteral",t[t.NumericLiteral=11]="NumericLiteral",t[t.LineCommentTrivia=12]="LineCommentTrivia",t[t.BlockCommentTrivia=13]="BlockCommentTrivia",t[t.LineBreakTrivia=14]="LineBreakTrivia",t[t.Trivia=15]="Trivia",t[t.Unknown=16]="Unknown",t[t.EOF=17]="EOF"})(xa||(xa={}));const Ic=Tc,Fc=ya,Vc=ba,Dc=Pr;var va;(function(t){t[t.InvalidSymbol=1]="InvalidSymbol",t[t.InvalidNumberFormat=2]="InvalidNumberFormat",t[t.PropertyNameExpected=3]="PropertyNameExpected",t[t.ValueExpected=4]="ValueExpected",t[t.ColonExpected=5]="ColonExpected",t
Line truncated
|
||||
`,s==="\r"&&i+1<n.length&&n.charAt(i+1)===`
|
||||
`&&i++}r&&n.length>0&&e.push(n.length),this._lineOffsets=e}return this._lineOffsets}positionAt(e){e=Math.max(Math.min(e,this._content.length),0);let n=this.getLineOffsets(),r=0,i=n.length;if(i===0)return ee.create(0,e);for(;r<i;){let a=Math.floor((r+i)/2);n[a]>e?i=a:r=a+1}let s=r-1;return ee.create(s,e-n[s])}offsetAt(e){let n=this.getLineOffsets();if(e.line>=n.length)return this._content.length;if(e.line<0)return 0;let r=n[e.line],i=e.line+1<n.length?n[e.line+1]:this._content.length;return Math.max(Math.min(r+e.character,i),r)}get lineCount(){return this.getLineOffsets().length}};var R;(function(t){const e=Object.prototype.toString;function n(g){return typeof g<"u"}t.defined=n;function r(g){return typeof g>"u"}t.undefined=r;function i(g){return g===!0||g===!1}t.boolean=i;function s(g){return e.call(g)==="[object String]"}t.string=s;function a(g){return e.call(g)==="[object Number]"}t.number=a;function o(g,d,p){return e.call(g)==="[object Number]"&&d<=g&&g<=p}t.numberRange=o;function u(g){return e.call(g)==="[object Number]"&&-2147483648<=g&&g<=2147483647}t.integer=u;function l(g){return e.call(g)==="[object Number]"&&0<=g&&g<=2147483647}t.uinteger=l;function h(g){return e.call(g)==="[object Function]"}t.func=h;function f(g){return g!==null&&typeof g=="object"}t.objectLiteral=f;function m(g,d){return Array.isArray(g)&&g.every(d)}t.typedArray=m})(R||(R={}));class en{constructor(e,n,r,i){this._uri=e,this._languageId=n,this._version=r,this._content=i,this._lineOffsets=void 0}get uri(){return this._uri}get languageId(){return this._languageId}get version(){return this._version}getText(e){if(e){const n=this.offsetAt(e.start),r=this.offsetAt(e.end);return this._content.substring(n,r)}return this._content}update(e,n){for(let r of e)if(en.isIncremental(r)){const i=xo(r.range),s=this.offsetAt(i.start),a=this.offsetAt(i.end);this._content=this._content.substring(0,s)+r.text+this._content.substring(a,this._content.length);const o=Math.max(i.start.line,0),u=Math.max(i.end.line,0);let l=this._lineOffsets;const h=wo(r.text,!1,s);if(u-o===h.length)for(let m=0,g=h.length;m<g;m++)l[m+o+1]=h[m];else h.length<1e4?l.splice(o+1,u-o,...h):this._lineOffsets=l=l.slice(0,o+1).concat(h,l.slice(u+1));const f=r.text.length-(a-s);if(f!==0)for(let m=o+1+h.length,g=l.length;m<g;m++)l[m]=l[m]+f}else if(en.isFull(r))this._content=r.text,this._lineOffsets=void 0;else throw new Error("Unknown change event received");this._version=n}getLineOffsets(){return this._lineOffsets===void 0&&(this._lineOffsets=wo(this._content,!0)),this._lineOffsets}positionAt(e){e=Math.max(Math.min(e,this._content.length),0);let n=this.getLineOffsets(),r=0,i=n.length;if(i===0)return{line:0,character:e};for(;r<i;){let a=Math.floor((r+i)/2);n[a]>e?i=a:r=a+1}let s=r-1;return{line:s,character:e-n[s]}}offsetAt(e){let n=this.getLineOffsets();if(e.line>=n.length)return this._content.length;if(e.line<0)return 0;let r=n[e.line],i=e.line+1<n.length?n[e.line+1]:this._content.length;return Math.max(Math.min(r+e.character,i),r)}get lineCount(){return this.getLineOffsets().length}static isIncremental(e){let n=e;return n!=null&&typeof n.text=="string"&&n.range!==void 0&&(n.rangeLength===void 0||typeof n.rangeLength=="number")}static isFull(e){let n=e;return n!=null&&typeof n.text=="string"&&n.range===void 0&&n.rangeLength===void 0}}var Ee;(function(t){function e(i,s,a,o){return new en(i,s,a,o)}t.create=e;function n(i,s,a){if(i instanceof en)return i.update(s,a),i;throw new Error("TextDocument.update: document must be created by TextDocument.create")}t.update=n;function r(i,s){let a=i.getText(),o=zr(s.map(Uc),(h,f)=>{let m=h.range.start.line-f.range.start.line;return m===0?h.range.start.character-f.range.start.character:m}),u=0;const l=[];for(const h of o){let f=i.offsetAt(h.range.start);if(f<u)throw new Error("Overlapping edit");f>u&&l.push(a.substring(u,f)),h.newText.length&&l.push(h.newText),u=i.offsetAt(h.range.end)}return l.push(a.substr(u)),l.join("")}t.applyEdits=r})(Ee||(Ee={}));function zr(t,e){if(t.length<=1)return t;const n=t.length/2|0,r=t.slice(0,n),i=t.slice(n);zr(r,e),zr(i,e);let s=0,a=0,o=0;for(;s<r.length&&a<i.length;)e(r[s],i[a])<=0?t[o++]=r[s++]:t[o++]=i[a++];for(;s<r.length;)t[o++]=r[s++];for(;a<i.length;)t[o++]=i[a++];return t}function wo(t,e,n=0){const r=e?[n]:[];for(let i=0;i<t.length;i++){let s=t.charCodeAt(i);(s===13||s===10)&&(s===13&&i+1<t.length&&t.charCodeAt(i+1)===10&&i++,r.push(n+i+1))}return r}function xo(t){const e=t.start,n=t.end;return e.line>n.line||e.line===n.line&&e.character>n.character?{start:n,end:e}:t}function Uc(t){const e=xo(t.range);return e!==t.range?{newText:t.newText,range:e}:t}var G;(function(t){t[t.Undefined=0]="Undefined",t[t.EnumValueMismatch=1]="EnumValueMismatch",t[t.Deprecated=2]="Deprecated",t[t.UnexpectedEndOfComment=257]="UnexpectedEndOfComment",t[t.UnexpectedEndOfString=258]="UnexpectedEndOfString",t[t.UnexpectedEndOfNumber=259]="UnexpectedEndOfNumber",t[t.InvalidUnicode=260]="InvalidUnicode",t[t.InvalidEscapeCharacter=261]
Line truncated
|
||||
`;for(let s=0;s<t.length;s++)i+=r+Zr(t[s],r,n),s<t.length-1&&(i+=","),i+=`
|
||||
`;return i+=e+"]",i}else{const i=Object.keys(t);if(i.length===0)return"{}";let s=`{
|
||||
`;for(let a=0;a<i.length;a++){const o=i[a];s+=r+JSON.stringify(o)+": "+Zr(t[o],r,n),a<i.length-1&&(s+=","),s+=`
|
||||
`}return s+=e+"}",s}}return n(t)}class Kc{constructor(e,n=[],r=Promise,i={}){this.schemaService=e,this.contributions=n,this.promiseConstructor=r,this.clientCapabilities=i}doResolve(e){for(let n=this.contributions.length-1;n>=0;n--){const r=this.contributions[n].resolveCompletion;if(r){const i=r(e);if(i)return i}}return this.promiseConstructor.resolve(e)}doComplete(e,n,r){const i={items:[],isIncomplete:!1},s=e.getText(),a=e.offsetAt(n);let o=r.getNodeFromOffset(a,!0);if(this.isInComment(e,o?o.offset:0,a))return Promise.resolve(i);if(o&&a===o.offset+o.length&&a>0){const m=s[a-1];(o.type==="object"&&m==="}"||o.type==="array"&&m==="]")&&(o=o.parent)}const u=this.getCurrentWord(e,a);let l;if(o&&(o.type==="string"||o.type==="number"||o.type==="boolean"||o.type==="null"))l=W.create(e.positionAt(o.offset),e.positionAt(o.offset+o.length));else{let m=a-u.length;m>0&&s[m-1]==='"'&&m--,l=W.create(e.positionAt(m),n)}const h=new Map,f={add:m=>{let g=m.label;const d=h.get(g);if(d)d.documentation||(d.documentation=m.documentation),d.detail||(d.detail=m.detail),d.labelDetails||(d.labelDetails=m.labelDetails);else{if(g=g.replace(/[\n]/g,"↵"),g.length>60){const p=g.substr(0,57).trim()+"...";h.has(p)||(g=p)}m.textEdit=Ve.replace(l,m.insertText),m.label=g,h.set(g,m),i.items.push(m)}},setAsIncomplete:()=>{i.isIncomplete=!0},error:m=>{console.error(m)},getNumberOfProposals:()=>i.items.length};return this.schemaService.getSchemaForResource(e.uri,r).then(m=>{const g=[];let d=!0,p="",y;if(o&&o.type==="string"){const v=o.parent;v&&v.type==="property"&&v.keyNode===o&&(d=!v.valueNode,y=v,p=s.substr(o.offset+1,o.length-2),v&&(o=v.parent))}if(o&&o.type==="object"){if(o.offset===a)return i;o.properties.forEach(N=>{(!y||y!==N)&&h.set(N.keyNode.value,jr.create("__"))});let b="";d&&(b=this.evaluateSeparatorAfter(e,e.offsetAt(l.end))),m?this.getPropertyCompletions(m,r,o,d,b,f):this.getSchemaLessPropertyCompletions(r,o,p,f);const _=Qr(o);this.contributions.forEach(N=>{const E=N.collectPropertyCompletions(e.uri,_,u,d,b==="",f);E&&g.push(E)}),!m&&u.length>0&&s.charAt(a-u.length-1)!=='"'&&(f.add({kind:we.Property,label:this.getLabelForValue(u),insertText:this.getInsertTextForProperty(u,void 0,!1,b),insertTextFormat:ie.Snippet,documentation:""}),f.setAsIncomplete())}const x={};return m?this.getValueCompletions(m,r,o,a,e,f,x):this.getSchemaLessValueCompletions(r,o,a,e,f),this.contributions.length>0&&this.getContributedValueCompletions(r,o,a,e,f,g),this.promiseConstructor.all(g).then(()=>{if(f.getNumberOfProposals()===0){let v=a;o&&(o.type==="string"||o.type==="number"||o.type==="boolean"||o.type==="null")&&(v=o.offset+o.length);const b=this.evaluateSeparatorAfter(e,v);this.addFillerValueCompletions(x,b,f)}return i})})}getPropertyCompletions(e,n,r,i,s,a){n.getMatchingSchemas(e.schema,r.offset).forEach(u=>{if(u.node===r&&!u.inverted){const l=u.schema.properties;l&&Object.keys(l).forEach(f=>{const m=l[f];if(typeof m=="object"&&!m.deprecationMessage&&!m.doNotSuggest){const g={kind:we.Property,label:f,insertText:this.getInsertTextForProperty(f,m,i,s),insertTextFormat:ie.Snippet,filterText:this.getFilterTextForValue(f),documentation:this.fromMarkup(m.markdownDescription)||m.description||""};m.suggestSortText!==void 0&&(g.sortText=m.suggestSortText),g.insertText&&Zt(g.insertText,`$1${s}`)&&(g.command={title:"Suggest",command:"editor.action.triggerSuggest"}),a.add(g)}});const h=u.schema.propertyNames;if(typeof h=="object"&&!h.deprecationMessage&&!h.doNotSuggest){const f=(m,g=void 0)=>{const d={kind:we.Property,label:m,insertText:this.getInsertTextForProperty(m,void 0,i,s),insertTextFormat:ie.Snippet,filterText:this.getFilterTextForValue(m),documentation:g||this.fromMarkup(h.markdownDescription)||h.description||""};h.suggestSortText!==void 0&&(d.sortText=h.suggestSortText),d.insertText&&Zt(d.insertText,`$1${s}`)&&(d.command={title:"Suggest",command:"editor.action.triggerSuggest"}),a.add(d)};if(h.enum)for(let m=0;m<h.enum.length;m++){let g;h.markdownEnumDescriptions&&m<h.markdownEnumDescriptions.length?g=this.fromMarkup(h.markdownEnumDescriptions[m]):h.enumDescriptions&&m<h.enumDescriptions.length&&(g=h.enumDescriptions[m]),f(h.enum[m],g)}h.const&&f(h.const)}}})}getSchemaLessPropertyCompletions(e,n,r,i){const s=a=>{a.properties.forEach(o=>{const u=o.keyNode.value;i.add({kind:we.Property,label:u,insertText:this.getInsertTextForValue(u,""),insertTextFormat:ie.Snippet,filterText:this.getFilterTextForValue(u),documentation:""})})};if(n.parent)if(n.parent.type==="property"){const a=n.parent.keyNode.value;e.visit(o=>(o.type==="property"&&o!==n.parent&&o.keyNode.value===a&&o.valueNode&&o.valueNode.type==="object"&&s(o.valueNode),!0))}else n.parent.type==="array"&&n.parent.items.forEach(a=>{a.type==="object"&&a!==n&&s(a)});else n.type==="object"&&i.add({kind:we.Property,label:"$schema",insertText:this.getInsertTextForProperty("$schema",void 0,!0,""),insertTextFormat:ie.Snippet,documentation:"",filterText:this.getFilterTextForValue("$schema")})}getSchemaLessValueC
Line truncated
|
||||
`,g=g+`
|
||||
`+d+"]",d+=" ",o="array";h=m+d+a.bodyText.split(`
|
||||
`).join(`
|
||||
`+d)+g+n,l=l||h,f=h.replace(/[\n]/g,"")}else return;r.add({kind:this.getSuggestionKind(o),label:l,documentation:this.fromMarkup(a.markdownDescription)||a.description,insertText:h,insertTextFormat:ie.Snippet,filterText:f}),s=!0}),!s&&typeof e.items=="object"&&!Array.isArray(e.items)&&i<5&&this.addDefaultValueCompletions(e.items,n,r,i+1)}addEnumValueCompletions(e,n,r){if(Re(e.const)&&r.add({kind:this.getSuggestionKind(e.type),label:this.getLabelForValue(e.const),insertText:this.getInsertTextForValue(e.const,n),insertTextFormat:ie.Snippet,documentation:this.fromMarkup(e.markdownDescription)||e.description}),Array.isArray(e.enum))for(let i=0,s=e.enum.length;i<s;i++){const a=e.enum[i];let o=this.fromMarkup(e.markdownDescription)||e.description;e.markdownEnumDescriptions&&i<e.markdownEnumDescriptions.length&&this.doesSupportMarkdown()?o=this.fromMarkup(e.markdownEnumDescriptions[i]):e.enumDescriptions&&i<e.enumDescriptions.length&&(o=e.enumDescriptions[i]),r.add({kind:this.getSuggestionKind(e.type),label:this.getLabelForValue(a),insertText:this.getInsertTextForValue(a,n),insertTextFormat:ie.Snippet,documentation:o})}}collectTypes(e,n){if(Array.isArray(e.enum)||Re(e.const))return;const r=e.type;Array.isArray(r)?r.forEach(i=>n[i]=!0):r&&(n[r]=!0)}addFillerValueCompletions(e,n,r){e.object&&r.add({kind:this.getSuggestionKind("object"),label:"{}",insertText:this.getInsertTextForGuessedValue({},n),insertTextFormat:ie.Snippet,detail:M("New object"),documentation:""}),e.array&&r.add({kind:this.getSuggestionKind("array"),label:"[]",insertText:this.getInsertTextForGuessedValue([],n),insertTextFormat:ie.Snippet,detail:M("New array"),documentation:""})}addBooleanValueCompletion(e,n,r){r.add({kind:this.getSuggestionKind("boolean"),label:e?"true":"false",insertText:this.getInsertTextForValue(e,n),insertTextFormat:ie.Snippet,documentation:""})}addNullValueCompletion(e,n){n.add({kind:this.getSuggestionKind("null"),label:"null",insertText:"null"+e,insertTextFormat:ie.Snippet,documentation:""})}addDollarSchemaCompletions(e,n){this.schemaService.getRegisteredSchemaIds(i=>i==="http"||i==="https").forEach(i=>{i.startsWith("http://json-schema.org/draft-")&&(i=i+"#"),n.add({kind:we.Module,label:this.getLabelForValue(i),filterText:this.getFilterTextForValue(i),insertText:this.getInsertTextForValue(i,e),insertTextFormat:ie.Snippet,documentation:""})})}getLabelForValue(e){return JSON.stringify(e)}getValueFromLabel(e){return JSON.parse(e)}getFilterTextForValue(e){return JSON.stringify(e)}getFilterTextForSnippetValue(e){return JSON.stringify(e).replace(/\$\{\d+:([^}]+)\}|\$\d+/g,"$1")}getLabelForSnippetValue(e){return JSON.stringify(e).replace(/\$\{\d+:([^}]+)\}|\$\d+/g,"$1")}getInsertTextForPlainText(e){return e.replace(/[\\\$\}]/g,"\\$&")}getInsertTextForValue(e,n){const r=JSON.stringify(e,null," ");return r==="{}"?"{$1}"+n:r==="[]"?"[$1]"+n:this.getInsertTextForPlainText(r+n)}getInsertTextForSnippetValue(e,n){return Zr(e,"",i=>typeof i=="string"&&i[0]==="^"?i.substr(1):JSON.stringify(i))+n}getInsertTextForGuessedValue(e,n){switch(typeof e){case"object":return e===null?"${1:null}"+n:this.getInsertTextForValue(e,n);case"string":let r=JSON.stringify(e);return r=r.substr(1,r.length-2),r=this.getInsertTextForPlainText(r),'"${1:'+r+'}"'+n;case"number":case"boolean":return"${1:"+JSON.stringify(e)+"}"+n}return this.getInsertTextForValue(e,n)}getSuggestionKind(e){if(Array.isArray(e)){const n=e;e=n.length>0?n[0]:void 0}if(!e)return we.Value;switch(e){case"string":return we.Value;case"object":return we.Module;case"property":return we.Property;default:return we.Value}}getLabelTextForMatchingNode(e,n){switch(e.type){case"array":return"[]";case"object":return"{}";default:return n.getText().substr(e.offset,e.length)}}getInsertTextForMatchingNode(e,n,r){switch(e.type){case"array":return this.getInsertTextForValue([],r);case"object":return this.getInsertTextForValue({},r);default:const i=n.getText().substr(e.offset,e.length)+r;return this.getInsertTextForPlainText(i)}}getInsertTextForProperty(e,n,r,i){const s=this.getInsertTextForValue(e,"");if(!r)return s;const a=s+": ";let o,u=0;if(n){if(Array.isArray(n.defaultSnippets)){if(n.defaultSnippets.length===1){const l=n.defaultSnippets[0].body;Re(l)&&(o=this.getInsertTextForSnippetValue(l,""))}u+=n.defaultSnippets.length}if(n.enum&&(!o&&n.enum.length===1&&(o=this.getInsertTextForGuessedValue(n.enum[0],"")),u+=n.enum.length),Re(n.const)&&(o||(o=this.getInsertTextForGuessedValue(n.const,"")),u++),Re(n.default)&&(o||(o=this.getInsertTextForGuessedValue(n.default,"")),u++),Array.isArray(n.examples)&&n.examples.length&&(o||(o=this.getInsertTextForGuessedValue(n.examples[0],"")),u+=n.examples.length),u===0){let l=Array.isArray(n.type)?n.type[0]:n.type;switch(l||(n.properties?l="object":n.items&&(l="array")),l){case"boolean":o="$1";break;case"string":o='"$1"';break;case"object":o="{$1}";break;case"array":o="[$1]";break;case"number":case"integer":o="${1:0}";break;case"null":o="${1:null}";break;default:return s}}}ret
Line truncated
|
||||
\r\v":{[,]}`.indexOf(i.charAt(r))===-1;)r--;return i.substring(r+1,n)}evaluateSeparatorAfter(e,n){const r=it(e.getText(),!0);switch(r.setPosition(n),r.scan()){case 5:case 2:case 4:case 17:return"";default:return","}}findItemAtOffset(e,n,r){const i=it(n.getText(),!0),s=e.items;for(let a=s.length-1;a>=0;a--){const o=s[a];if(r>o.offset+o.length)return i.setPosition(o.offset+o.length),i.scan()===5&&r>=i.getTokenOffset()+i.getTokenLength()?a+1:a;if(r>=o.offset)return a}return 0}isInComment(e,n,r){const i=it(e.getText(),!1);i.setPosition(n);let s=i.scan();for(;s!==17&&i.getTokenOffset()+i.getTokenLength()<r;)s=i.scan();return(s===12||s===13)&&i.getTokenOffset()<=r}fromMarkup(e){if(e&&this.doesSupportMarkdown())return{kind:st.Markdown,value:e}}doesSupportMarkdown(){if(!Re(this.supportsMarkdown)){const e=this.clientCapabilities.textDocument?.completion?.completionItem?.documentationFormat;this.supportsMarkdown=Array.isArray(e)&&e.indexOf(st.Markdown)!==-1}return this.supportsMarkdown}doesSupportsCommitCharacters(){return Re(this.supportsCommitCharacters)||(this.labelDetailsSupport=this.clientCapabilities.textDocument?.completion?.completionItem?.commitCharactersSupport),this.supportsCommitCharacters}doesSupportsLabelDetails(){return Re(this.labelDetailsSupport)||(this.labelDetailsSupport=this.clientCapabilities.textDocument?.completion?.completionItem?.labelDetailsSupport),this.labelDetailsSupport}}class e1{constructor(e,n=[],r){this.schemaService=e,this.contributions=n,this.promise=r||Promise}doHover(e,n,r){const i=e.offsetAt(n);let s=r.getNodeFromOffset(i);if(!s||(s.type==="object"||s.type==="array")&&i>s.offset+1&&i<s.offset+s.length-1)return this.promise.resolve(null);const a=s;if(s.type==="string"){const h=s.parent;if(h&&h.type==="property"&&h.keyNode===s&&(s=h.valueNode,!s))return this.promise.resolve(null)}const o=W.create(e.positionAt(a.offset),e.positionAt(a.offset+a.length)),u=h=>({contents:h,range:o}),l=Qr(s);for(let h=this.contributions.length-1;h>=0;h--){const m=this.contributions[h].getInfoContribution(e.uri,l);if(m)return m.then(g=>u(g))}return this.schemaService.getSchemaForResource(e.uri,r).then(h=>{if(h&&s){const f=r.getMatchingSchemas(h.schema,s.offset);let m,g,d,p;f.every(x=>{if(x.node===s&&!x.inverted&&x.schema&&(m=m||x.schema.title,g=g||x.schema.markdownDescription||Yr(x.schema.description),x.schema.enum)){const v=x.schema.enum.indexOf(ot(s));x.schema.markdownEnumDescriptions?d=x.schema.markdownEnumDescriptions[v]:x.schema.enumDescriptions&&(d=Yr(x.schema.enumDescriptions[v])),d&&(p=x.schema.enum[v],typeof p!="string"&&(p=JSON.stringify(p)))}return!0});let y="";return m&&(y=Yr(m)),g&&(y.length>0&&(y+=`
|
||||
|
||||
`),y+=g),d&&(y.length>0&&(y+=`
|
||||
|
||||
`),y+=`\`${t1(p)}\`: ${d}`),u([y])}return null})}}function Yr(t){if(t)return t.replace(/([^\n\r])(\r?\n)([^\n\r])/gm,`$1
|
||||
|
||||
$3`).replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}function t1(t){return t.indexOf("`")!==-1?"`` "+t+" ``":t}class n1{constructor(e,n){this.jsonSchemaService=e,this.promise=n,this.validationEnabled=!0}configure(e){e&&(this.validationEnabled=e.validate!==!1,this.commentSeverity=e.allowComments?void 0:ye.Error)}doValidation(e,n,r,i){if(!this.validationEnabled)return this.promise.resolve([]);const s=[],a={},o=l=>{const h=l.range.start.line+" "+l.range.start.character+" "+l.message;a[h]||(a[h]=!0,s.push(l))},u=l=>{let h=r?.trailingCommas?Cn(r.trailingCommas):ye.Error,f=r?.comments?Cn(r.comments):this.commentSeverity,m=r?.schemaValidation?Cn(r.schemaValidation):ye.Warning,g=r?.schemaRequest?Cn(r.schemaRequest):ye.Warning;if(l){const d=(p,y)=>{if(n.root&&g){const x=n.root,v=x.type==="object"?x.properties[0]:void 0;if(v&&v.keyNode.value==="$schema"){const b=v.valueNode||v,_=W.create(e.positionAt(b.offset),e.positionAt(b.offset+b.length));o(He.create(_,p,g,y))}else{const b=W.create(e.positionAt(x.offset),e.positionAt(x.offset+1));o(He.create(b,p,g,y))}}};if(l.errors.length)d(l.errors[0],G.SchemaResolveError);else if(m){for(const y of l.warnings)d(y,G.SchemaUnsupportedFeature);const p=n.validate(e,l.schema,m,r?.schemaDraft);p&&p.forEach(o)}ko(l.schema)&&(f=void 0),Ro(l.schema)&&(h=void 0)}for(const d of n.syntaxErrors){if(d.code===G.TrailingComma){if(typeof h!="number")continue;d.severity=h}o(d)}if(typeof f=="number"){const d=M("Comments are not permitted in JSON.");n.comments.forEach(p=>{o(He.create(p,d,f,G.CommentNotPermitted))})}return s};if(i){const l=i.id||"schemaservice://untitled/"+r1++;return this.jsonSchemaService.registerExternalSchema({uri:l,schema:i}).getResolvedSchema().then(f=>u(f))}return this.jsonSchemaService.getSchemaForResource(e.uri,n).then(l=>u(l))}getLanguageStatus(e,n){return{schemas:this.jsonSchemaService.getSchemaURIsForResource(e.uri,n)}}}let r1=0;function ko(t){if(t&&typeof t=="object"){if(Fe(t.allowComments))return t.allowComments;if(t.allOf)for(const e of t.allOf){const n=ko(e);if(Fe(n))return n}}}function Ro(t){if(t&&typeof t=="object"){if(Fe(t.allowTrailingCommas))return t.allowTrailingCommas;const e=t;if(Fe(e.allowsTrailingCommas))return e.allowsTrailingCommas;if(t.allOf)for(const n of t.allOf){const r=Ro(n);if(Fe(r))return r}}}function Cn(t){switch(t){case"error":return ye.Error;case"warning":return ye.Warning;case"ignore":return}}const Eo=48,i1=57,s1=65,In=97,a1=102;function ne(t){return t<Eo?0:t<=i1?t-Eo:(t<In&&(t+=In-s1),t>=In&&t<=a1?t-In+10:0)}function o1(t){if(t[0]==="#")switch(t.length){case 4:return{red:ne(t.charCodeAt(1))*17/255,green:ne(t.charCodeAt(2))*17/255,blue:ne(t.charCodeAt(3))*17/255,alpha:1};case 5:return{red:ne(t.charCodeAt(1))*17/255,green:ne(t.charCodeAt(2))*17/255,blue:ne(t.charCodeAt(3))*17/255,alpha:ne(t.charCodeAt(4))*17/255};case 7:return{red:(ne(t.charCodeAt(1))*16+ne(t.charCodeAt(2)))/255,green:(ne(t.charCodeAt(3))*16+ne(t.charCodeAt(4)))/255,blue:(ne(t.charCodeAt(5))*16+ne(t.charCodeAt(6)))/255,alpha:1};case 9:return{red:(ne(t.charCodeAt(1))*16+ne(t.charCodeAt(2)))/255,green:(ne(t.charCodeAt(3))*16+ne(t.charCodeAt(4)))/255,blue:(ne(t.charCodeAt(5))*16+ne(t.charCodeAt(6)))/255,alpha:(ne(t.charCodeAt(7))*16+ne(t.charCodeAt(8)))/255}}}class l1{constructor(e){this.schemaService=e}findDocumentSymbols(e,n,r={resultLimit:Number.MAX_VALUE}){const i=n.root;if(!i)return[];let s=r.resultLimit||Number.MAX_VALUE;const a=e.uri;if((a==="vscode://defaultsettings/keybindings.json"||Zt(a.toLowerCase(),"/user/keybindings.json"))&&i.type==="array"){const m=[];for(const g of i.items)if(g.type==="object"){for(const d of g.properties)if(d.keyNode.value==="key"&&d.valueNode){const p=Et.create(e.uri,Ye(e,g));if(m.push({name:Mo(d.valueNode),kind:De.Function,location:p}),s--,s<=0)return r&&r.onResultLimitExceeded&&r.onResultLimitExceeded(a),m}}return m}const o=[{node:i,containerName:""}];let u=0,l=!1;const h=[],f=(m,g)=>{m.type==="array"?m.items.forEach(d=>{d&&o.push({node:d,containerName:g})}):m.type==="object"&&m.properties.forEach(d=>{const p=d.valueNode;if(p)if(s>0){s--;const y=Et.create(e.uri,Ye(e,d)),x=g?g+"."+d.keyNode.value:d.keyNode.value;h.push({name:this.getKeyLabel(d),kind:this.getSymbolKind(p.type),location:y,containerName:g}),o.push({node:p,containerName:x})}else l=!0})};for(;u<o.length;){const m=o[u++];f(m.node,m.containerName)}return l&&r&&r.onResultLimitExceeded&&r.onResultLimitExceeded(a),h}findDocumentSymbols2(e,n,r={resultLimit:Number.MAX_VALUE}){const i=n.root;if(!i)return[];let s=r.resultLimit||Number.MAX_VALUE;const a=e.uri;if((a==="vscode://defaultsettings/keybindings.json"||Zt(a.toLowerCase(),"/user/keybindings.json"))&&i.type==="array"){const m=[];for(const g of i.items)if(g.type==="object"){for(const d of g.properties)if(d.keyNode.value==="key"&&d.valueNode){const p=Ye(e,g),y=Ye(e,d.keyNode);if(m.push({name:Mo(d.valueNode),kind:De.Function,range:p,selectionRange:y}),s--,s<=0)return r&&r.onResultLimitExceeded&&r.onResultLimitExceeded(a),m}}return m}const o=[],uLine truncated
|
||||
`,keepLines:e?.keepLines===!0};return Oc(t.getText(),r,i).map(s=>Ve.replace(W.create(t.positionAt(s.offset),t.positionAt(s.offset+s.length)),s.content))}var se;(function(t){t[t.Object=0]="Object",t[t.Array=1]="Array"})(se||(se={}));class Fn{constructor(e,n){this.propertyName=e??"",this.beginningLineNumber=n,this.childrenProperties=[],this.lastProperty=!1,this.noKeyName=!1}addChildProperty(e){if(e.parent=this,this.childrenProperties.length>0){let n=0;e.noKeyName?n=this.childrenProperties.length:n=x1(this.childrenProperties,e,w1),n<0&&(n=n*-1-1),this.childrenProperties.splice(n,0,e)}else this.childrenProperties.push(e);return e}}function w1(t,e){const n=t.propertyName.toLowerCase(),r=e.propertyName.toLowerCase();return n<r?-1:n>r?1:0}function x1(t,e,n){const r=e.propertyName.toLowerCase(),i=t[0].propertyName.toLowerCase(),s=t[t.length-1].propertyName.toLowerCase();if(r<i)return 0;if(r>s)return t.length;let a=0,o=t.length-1;for(;a<=o;){let u=o+a>>1,l=n(e,t[u]);if(l>0)a=u+1;else if(l<0)o=u-1;else return u}return-a-1}function v1(t,e){const n={...e,keepLines:!1},r=Ee.applyEdits(t,ei(t,n,void 0)),i=Ee.create("test://test.json","json",0,r),s=L1(i),a=N1(i,s),o=ei(a,n,void 0),u=Ee.applyEdits(a,o);return[Ve.replace(W.create(ee.create(0,0),t.positionAt(t.getText().length)),u)]}function L1(t){const e=t.getText(),n=it(e,!1);let r=new Fn,i=r,s=r,a=r,o,u=0,l=0,h,f,m=-1,g=-1,d=0,p=0,y=[],x=!1,v=!1;for(;(o=n.scan())!==17;){if(x===!0&&o!==14&&o!==15&&o!==12&&o!==13&&s.endLineNumber===void 0){let b=n.getTokenStartLine();f===2||f===4?a.endLineNumber=b-1:s.endLineNumber=b-1,d=b,x=!1}if(v===!0&&o!==14&&o!==15&&o!==12&&o!==13&&(d=n.getTokenStartLine(),v=!1),n.getTokenStartLine()!==u){for(let b=u;b<n.getTokenStartLine();b++){const _=t.getText(W.create(ee.create(b,0),ee.create(b+1,0))).length;l=l+_}u=n.getTokenStartLine()}switch(o){case 10:{if(h===void 0||h===1||h===5&&y[y.length-1]===se.Object){const b=new Fn(n.getTokenValue(),d);a=s,s=i.addChildProperty(b)}break}case 3:{if(r.beginningLineNumber===void 0&&(r.beginningLineNumber=n.getTokenStartLine()),y[y.length-1]===se.Object)i=s;else if(y[y.length-1]===se.Array){const b=new Fn(n.getTokenValue(),d);b.noKeyName=!0,a=s,s=i.addChildProperty(b),i=s}y.push(se.Array),s.type=se.Array,d=n.getTokenStartLine(),d++;break}case 1:{if(r.beginningLineNumber===void 0)r.beginningLineNumber=n.getTokenStartLine();else if(y[y.length-1]===se.Array){const b=new Fn(n.getTokenValue(),d);b.noKeyName=!0,a=s,s=i.addChildProperty(b)}s.type=se.Object,y.push(se.Object),i=s,d=n.getTokenStartLine(),d++;break}case 4:{p=n.getTokenStartLine(),y.pop(),s.endLineNumber===void 0&&(h===2||h===4)&&(s.endLineNumber=p-1,s.lastProperty=!0,s.lineWhereToAddComma=m,s.indexWhereToAddComa=g,a=s,s=s?s.parent:void 0,i=s),r.endLineNumber=p,d=p+1;break}case 2:{p=n.getTokenStartLine(),y.pop(),h!==1&&(s.endLineNumber===void 0&&(s.endLineNumber=p-1,s.lastProperty=!0,s.lineWhereToAddComma=m,s.indexWhereToAddComa=g),a=s,s=s?s.parent:void 0,i=s),r.endLineNumber=n.getTokenStartLine(),d=p+1;break}case 5:{p=n.getTokenStartLine(),s.endLineNumber===void 0&&(y[y.length-1]===se.Object||y[y.length-1]===se.Array&&(h===2||h===4))&&(s.endLineNumber=p,s.commaIndex=n.getTokenOffset()-l,s.commaLine=p),(h===2||h===4)&&(a=s,s=s?s.parent:void 0,i=s),d=p+1;break}case 13:{h===5&&m===n.getTokenStartLine()&&(y[y.length-1]===se.Array&&(f===2||f===4)||y[y.length-1]===se.Object)&&(y[y.length-1]===se.Array&&(f===2||f===4)||y[y.length-1]===se.Object)&&(s.endLineNumber=void 0,x=!0),(h===1||h===3)&&m===n.getTokenStartLine()&&(v=!0);break}}o!==14&&o!==13&&o!==12&&o!==15&&(f=h,h=o,m=n.getTokenStartLine(),g=n.getTokenOffset()+n.getTokenLength()-l)}return r}function N1(t,e){if(e.childrenProperties.length===0)return t;const n=Ee.create("test://test.json","json",0,t.getText()),r=[];for(Io(r,e,e.beginningLineNumber);r.length>0;){const i=r.shift(),s=i.propertyTreeArray;let a=i.beginningLineNumber;for(let o=0;o<s.length;o++){const u=s[o],l=W.create(ee.create(u.beginningLineNumber,0),ee.create(u.endLineNumber+1,0)),h=t.getText(l),f=Ee.create("test://test.json","json",0,h);if(u.lastProperty===!0&&o!==s.length-1){const d=u.lineWhereToAddComma-u.beginningLineNumber,p=u.indexWhereToAddComa,y={range:W.create(ee.create(d,p),ee.create(d,p)),text:","};Ee.update(f,[y],1)}else if(u.lastProperty===!1&&o===s.length-1){const d=u.commaIndex,y=u.commaLine-u.beginningLineNumber,x={range:W.create(ee.create(y,d),ee.create(y,d+1)),text:""};Ee.update(f,[x],1)}const m=u.endLineNumber-u.beginningLineNumber+1,g={range:W.create(ee.create(a,0),ee.create(a+m,0)),text:f.getText()};Ee.update(n,[g],1),Io(r,u,a),a=a+m}}return n}function Io(t,e,n){if(e.childrenProperties.length!==0)if(e.type===se.Object){let r=1/0;for(const s of e.childrenProperties)s.beginningLineNumber<r&&(r=s.beginningLineNumber);const i=r-e.beginningLineNumber;n=n+i,t.push(new Vo(n,e.childrenProperties))}else e.type===se.Array&&Fo(t,e,n)}function Fo(t,e,n){for(const r of e.childrenProperties){if(r.type===se.Object){let i=1/0;for(const
Line truncated
|
||||
File diff suppressed because it is too large.
Load diff
Reference in new issue
Block a user