|
|
(window.webpackJsonp=window.webpackJsonp||[]).push([[254,5,6,7],{"+NIl":function(it,ne,q){(function(G){G(q("VrN/"))})(function(G){"use strict";G.defineMode("stex",function(L,I){"use strict";function R(a,t){a.cmdState.push(t)}function M(a){return a.cmdState.length>0?a.cmdState[a.cmdState.length-1]:null}function p(a){var t=a.cmdState.pop();t&&t.closeBracket()}function E(a){for(var t=a.cmdState,r=t.length-1;r>=0;r--){var s=t[r];if(s.name=="DEFAULT")continue;return s}return{styleIdentifier:function(){return null}}}function b(a,t,r){return function(){this.name=a,this.bracketNo=0,this.style=t,this.styles=r,this.argument=null,this.styleIdentifier=function(){return this.styles[this.bracketNo-1]||null},this.openBracket=function(){return this.bracketNo++,"bracket"},this.closeBracket=function(){}}}var i={};i.importmodule=b("importmodule","tag",["string","builtin"]),i.documentclass=b("documentclass","tag",["","atom"]),i.usepackage=b("usepackage","tag",["atom"]),i.begin=b("begin","tag",["atom"]),i.end=b("end","tag",["atom"]),i.label=b("label","tag",["atom"]),i.ref=b("ref","tag",["atom"]),i.eqref=b("eqref","tag",["atom"]),i.cite=b("cite","tag",["atom"]),i.bibitem=b("bibitem","tag",["atom"]),i.Bibitem=b("Bibitem","tag",["atom"]),i.RBibitem=b("RBibitem","tag",["atom"]),i.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}};function c(a,t){a.f=t}function o(a,t){var r;if(a.match(/^\\[a-zA-Z@]+/)){var s=a.current().slice(1);return r=i.hasOwnProperty(s)?i[s]:i.DEFAULT,r=new r,R(t,r),c(t,n),r.style}if(a.match(/^\\[$&%#{}_]/))return"tag";if(a.match(/^\\[,;!\/\\]/))return"tag";if(a.match("\\["))return c(t,function(d,f){return h(d,f,"\\]")}),"keyword";if(a.match("\\("))return c(t,function(d,f){return h(d,f,"\\)")}),"keyword";if(a.match("$$"))return c(t,function(d,f){return h(d,f,"$$")}),"keyword";if(a.match("$"))return c(t,function(d,f){return h(d,f,"$")}),"keyword";var u=a.next();if(u=="%")return a.skipToEnd(),"comment";if(u=="}"||u=="]"){if(r=M(t),r)r.closeBracket(u),c(t,n);else return"error";return"bracket"}else return u=="{"||u=="["?(r=i.DEFAULT,r=new r,R(t,r),"bracket"):/\d/.test(u)?(a.eatWhile(/[\w.%]/),"atom"):(a.eatWhile(/[\w\-_]/),r=E(t),r.name=="begin"&&(r.argument=a.current()),r.styleIdentifier())}function h(a,t,r){if(a.eatSpace())return null;if(r&&a.match(r))return c(t,o),"keyword";if(a.match(/^\\[a-zA-Z@]+/))return"tag";if(a.match(/^[a-zA-Z]+/))return"variable-2";if(a.match(/^\\[$&%#{}_]/))return"tag";if(a.match(/^\\[,;!\/]/))return"tag";if(a.match(/^[\^_&]/))return"tag";if(a.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(a.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var s=a.next();return s=="{"||s=="}"||s=="["||s=="]"||s=="("||s==")"?"bracket":s=="%"?(a.skipToEnd(),"comment"):"error"}function n(a,t){var r=a.peek(),s;return r=="{"||r=="["?(s=M(t),s.openBracket(r),a.eat(r),c(t,o),"bracket"):/[ \t\r]/.test(r)?(a.eat(r),null):(c(t,o),p(t),o(a,t))}return{startState:function(){var a=I.inMathMode?function(t,r){return h(t,r)}:o;return{cmdState:[],f:a}},copyState:function(a){return{cmdState:a.cmdState.slice(),f:a.f}},token:function(a,t){return t.f(a,t)},blankLine:function(a){a.f=o,a.cmdState.length=0},lineComment:"%"}}),G.defineMIME("text/x-stex","stex"),G.defineMIME("text/x-latex","stex")})},"+ua5":function(it,ne,q){},"/POA":function(it,ne,q){!function(G,L){if(!0)it.exports=L();else var I,R}(window,function(){return function(G){var L={};function I(R){if(L[R])return L[R].exports;var M=L[R]={i:R,l:!1,exports:{}};return G[R].call(M.exports,M,M.exports,I),M.l=!0,M.exports}return I.m=G,I.c=L,I.d=function(R,M,p){I.o(R,M)||Object.defineProperty(R,M,{enumerable:!0,get:p})},I.r=function(R){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(R,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(R,"__esModule",{value:!0})},I.t=function(R,M){if(1&M&&(R=I(R)),8&M)return R;if(4&M&&typeof R=="object"&&R&&R.__esModule)return R;var p=Object.create(null);if(I.r(p),Object.defineProperty(p,"default",{enumerable:!0,value:R}),2&M&&typeof R!="string")for(var E in R)I.d(p,E,function(b){return R[b]}.bind(null,E));return p},I.n=function(R){var M=R&&R.__esModule?function(){return R.default}:function(){return R};return I.d(M,"a",M),M},I.o=function(R,M){return Object.prototype.hasOwnProperty.call(R,M)},I.p="",I(I.s=34)}([function(G,L,I){"use strict";Object.defineProperty(L,"__esModule",{value:!0}),L.forwardEvent=L.EventEmitter=void 0;var R=function(){function M(){this._listeners=[],this._disposed=!1}return Object.defineProperty(M.prototype,"event",{get:function(){var p=this;return this._event||(this._event=function(E){return p._listeners.push(E),{dispose:function(){if(!p._disposed){for(var b=0;b<p._listeners.length;b++)if(p._listeners[b]===E)return void p._listeners.splice(b,1)}}}}),this._event},enumerable:!1,configurable:!0}),M.prototype.fire=function(p,E){for(var b=[],i=0;i<this._listeners.length;i++)b.push(this._listeners[i]);for(i=0;i<b.length;i++)b[i].call(void 0,p,E)},M.prototype.dispose=function(){this._listeners&&(this._listeners.length=0),this._disposed=!0},M}();L.EventEmitter=R,L.forwardEvent=function(M,p){return M(function(E){return p.fire(E)})}},function(G,L,I){"use strict";Object.defineProperty(L,"__esModule",{value:!0}),L.IUnicodeService=L.IOptionsService=L.ILogService=L.IInstantiationService=L.IDirtyRowService=L.ICharsetService=L.ICoreService=L.ICoreMouseService=L.IBufferService=void 0;var R=I(14);L.IBufferService=R.createDecorator("BufferService"),L.ICoreMouseService=R.createDecorator("CoreMouseService"),L.ICoreService=R.createDecorator("CoreService"),L.ICharsetService=R.createDecorator("CharsetService"),L.IDirtyRowService=R.createDecorator("DirtyRowService"),L.IInstantiationService=R.createDecorator("InstantiationService"),L.ILogService=R.createDecorator("LogService"),L.IOptionsService=R.createDecorator("OptionsService"),L.IUnicodeService=R.createDecorator("UnicodeService")},function(G,L,I){"use strict";Object.defineProperty(L,"__esModule",{value:!0}),L.getDisposeArrayDisposable=L.disposeArray=L.Disposable=void 0;var R=function(){function p(){this._disposables=[],this._isDisposed=!1}return p.prototype.dispose=function(){this._isDisposed=!0;for(var E=0,b=this._disposables;E<b.length;E++)b[E].dispose();this._disposables.length=0},p.prototype.register=function(E){return this._disposables.push(E),E},p.prototype.unregister=function(E){var b=this._disposables.indexOf(E);b!==-1&&this._disposables.splice(b,1)},p}();function M(p){for(var E=0,b=p;E<b.length;E++)b[E].dispose();p.length=0}L.Disposable=R,L.disposeArray=M,L.getDisposeArrayDisposable=function(p){return{dispose:function(){return M(p)}}}},function(G,L,I){"use strict";Object.defineProperty(L,"__esModule",{value:!0}),L.WHITESPACE_CELL_CODE=L.WHITESPACE_CELL_WIDTH=L.WHITESPACE_CELL_CHAR=L.NULL_CELL_CODE=L.NULL_CELL_WIDTH=L.NULL_CELL_CHAR=L.CHAR_DATA_CODE_INDEX=L.CHAR_DATA_WIDTH_INDEX=L.CHAR_DATA_CHAR_INDEX=L.CHAR_DATA_ATTR_INDEX=L.DEFAULT_ATTR=L.DEFAULT_COLOR=void 0,L.DEFAULT_COLOR=256,L.DEFAULT_ATTR=256|L.DEFAULT_COLOR<<9,L.CHAR_DATA_ATTR_INDEX=0,L.CHAR_DATA_CHAR_INDEX=1,L.CHAR_DATA_WIDTH_INDEX=2,L.CHAR_DATA_CODE_INDEX=3,L.NULL_CELL_CHAR="",L.NULL_CELL_WIDTH=1,L.NULL_CELL_CODE=0,L.WHITESPACE_CELL_CHAR=" ",L.WHITESPACE_CELL_WIDTH=1,L.WHITESPACE_CELL_CODE=32},function(G,L,I){"use strict";var R,M=this&&this.__extends||(R=function(c,o){return(R=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(h,n){h.__proto__=n}||function(h,n){for(var a in n)n.hasOwnProperty(a)&&(h[a]=n[a])})(c,o)},function(c,o){function h(){this.constructor=c}R(c,o),c.prototype=o===null?Object.create(o):(h.prototype=o.prototype,new h)});Object.defineProperty(L,"__esModule",{value:!0}),L.CellData=void 0;var p=I(8),E=I(3),b=I(6),i=function(c){function o(){var h=c!==null&&c.apply(this,arguments)||this;return h.content=0,h.fg=0,h.bg=0,h.extended=new b.ExtendedAttrs,h.combinedData="",h}return M(o,c),o.fromCharData=function(h){var n=new o;return n.setFromCharData(h),n},o.prototype.isCombined=function(){return 2097152&this.content},o.prototype.getWidth=function(){return this.content>>22},o.prototype.getChars=function(){return 2097152&this.content?this.combinedData:2097151&this.content?p.stringFromCodePoint(2097151&this.content):""},o.prototype.getCode=function(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content},o.prototype.setFromCharData=function(h){this.fg=h[E.CHAR_DATA_ATTR_INDEX],this.bg=0;var n=!1;if(h[E.CHAR_DATA_CHAR_INDEX].length>2)n=!0;else if(h[E.CHAR_DATA_CHAR_INDEX].length===2){var a=h[E.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=a&&a<=56319){var t=h[E.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=t&&t<=57343?this.content=1024*(a-55296)+t-56320+65536|h[E.CHAR_DATA_WIDTH_INDEX]<<22:n=!0}else n=!0}else this.content=h[E.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|h[E.CHAR_DATA_WIDTH_INDEX]<<22;n&&(this.combinedData=h[E.CHAR_DATA_CHAR_INDEX],this.content=2097152|h[E.CHAR_DATA_WIDTH_INDEX]<<22)},o.prototype.getAsCharData=function(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]},o}(b.AttributeData);L.CellData=i},function(G,L,I){"use strict";Object.defineProperty(L,"__esModule",{value:!0}),L.ISoundService=L.ISelectionService=L.IRenderService=L.IMouseService=L.ICoreBrowserService=L.ICharSizeService=void 0;var R=I(14);L.ICharSizeService=R.createDecorator("CharSizeService"),L.ICoreBrowserService=R.createDecorator("CoreBrowserService"),L.IMouseService=R.createDecorator("MouseService"),L.IRenderService=R.createDecorator("RenderService"),L.ISelectionService=R.createDecorator("SelectionService"),L.ISoundService=R.createDecorator("SoundService")},function(G,L,I){"use strict";Object.defineProperty(L,"__esModule",{value:!0}),L.ExtendedAttrs=L.AttributeData=void 0;var R=function(){function p(){this.fg=0,this.bg=0,this.extended=new M}return p.toColorRGB=function(E){return[E>>>16&255,E>>>8&255,255&E]},p.fromColorRGB=function(E){return(255&E[0])<<16|(255&E[1])<<8|255&E[2]},p.prototype.clone=function(){var E=new p;return E.fg=this.fg,E.bg=this.bg,E.extended=this.extended.clone(),E},p.prototype.isInverse=function(){return 67108864&this.fg},p.prototype.isBold=function(){return 134217728&this.fg},p.prototype.isUnderline=function(){return 268435456&this.fg},p.prototype.isBlink=function(){return 536870912&this.fg},p.prototype.isInvisible=function(){return 1073741824&this.fg},p.prototype.isItalic=function(){return 67108864&this.bg},p.prototype.isDim=function(){return 134217728&this.bg},p.prototype.getFgColorMode=function(){return 50331648&this.fg},p.prototype.getBgColorMode=function(){return 50331648&this.bg},p.prototype.isFgRGB=function(){return(50331648&this.fg)==50331648},p.prototype.isBgRGB=function(){return(50331648&this.bg)==50331648},p.prototype.isFgPalette=function(){return(50331648&this.fg)==16777216||(50331648&this.fg)==33554432},p.prototype.isBgPalette=function(){return(50331648&this.bg)==16777216||(50331648&this.bg)==33554432},p.prototype.isFgDefault=function(){return(50331648&this.fg)==0},p.prototype.isBgDefault=function(){return(50331648&this.bg)==0},p.prototype.isAttributeDefault=function(){return this.fg===0&&this.bg===0},p.prototype.getFgColor=function(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}},p.prototype.getBgColor=function(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}},p.prototype.hasExtendedAttrs=function(){return 268435456&this.bg},p.prototype.updateExtended=function(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456},p.prototype.getUnderlineColor=function(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()},p.prototype.getUnderlineColorMode=function(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()},p.prototype.isUnderlineColorRGB=function(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==50331648:this.isFgRGB()},p.prototype.isUnderlineColorPalette=function(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==16777216||(50331648&this.extended.underlineColor)==33554432:this.isFgPalette()},p.prototype.isUnderlineColorDefault=function(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==0:this.isFgDefault()},p.prototype.getUnderlineStyle=function(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0},p}();L.AttributeData=R;var M=function(){function p(E,b){E===void 0&&(E=0),b===void 0&&(b=-1),this.underlineStyle=E,this.underlineColor=b}return p.prototype.clone=function(){return new p(this.underlineStyle,this.underlineColor)},p.prototype.isEmpty=function(){return this.underlineStyle===0},p}();L.ExtendedAttrs=M},function(G,L,I){"use strict";Object.defineProperty(L,"__esModule",{value:!0}),L.addDisposableDomListener=void 0,L.addDisposableDomListener=function(R,M,p,E){R.addEventListener(M,p,E);var b=!1;return{dispose:function(){b||(b=!0,R.removeEventListener(M,p,E))}}}},function(G,L,I){"use strict";Object.defineProperty(L,"__esModule",{value:!0}),L.Utf8ToUtf32=L.StringToUtf32=L.utf32ToString=L.stringFromCodePoint=void 0,L.stringFromCodePoint=function(p){return p>65535?(p-=65536,String.fromCharCode(55296+(p>>10))+String.fromCharCode(p%1024+56320)):String.fromCharCode(p)},L.utf32ToString=function(p,E,b){E===void 0&&(E=0),b===void 0&&(b=p.length);for(var i="",c=E;c<b;++c){var o=p[c];o>65535?(o-=65536,i+=String.fromCharCode(55296+(o>>10))+String.fromCharCode(o%1024+56320)):i+=String.fromCharCode(o)}return i};var R=function(){function p(){this._interim=0}return p.prototype.clear=function(){this._interim=0},p.prototype.decode=function(E,b){var i=E.length;if(!i)return 0;var c=0,o=0;this._interim&&(56320<=(a=E.charCodeAt(o++))&&a<=57343?b[c++]=1024*(this._interim-55296)+a-56320+65536:(b[c++]=this._interim,b[c++]=a),this._interim=0);for(var h=o;h<i;++h){var n=E.charCodeAt(h);if(55296<=n&&n<=56319){if(++h>=i)return this._interim=n,c;var a;56320<=(a=E.charCodeAt(h))&&a<=57343?b[c++]=1024*(n-55296)+a-56320+65536:(b[c++]=n,b[c++]=a)}else b[c++]=n}return c},p}();L.StringToUtf32=R;var M=function(){function p(){this.interim=new Uint8Array(3)}return p.prototype.clear=function(){this.interim.fill(0)},p.prototype.decode=function(E,b){var i=E.length;if(!i)return 0;var c,o,h,n,a=0,t=0,r=0;if(this.interim[0]){var s=!1,u=this.interim[0];u&=(224&u)==192?31:(240&u)==224?15:7;for(var d=0,f=void 0;(f=63&this.interim[++d])&&d<4;)u<<=6,u|=f;for(var v=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,m=v-d;r<m;){if(r>=i)return 0;if((192&(f=E[r++]))!=128){r--,s=!0;break}this.interim[d++]=f,u<<=6,u|=63&f}s||(v===2?u<128?r--:b[a++]=u:v===3?u<2048||u>=55296&&u<=57343||(b[a++]=u):u<65536||u>1114111||(b[a++]=u)),this.interim.fill(0)}for(var S=i-4,C=r;C<i;){for(;!(!(C<S)||128&(c=E[C])||128&(o=E[C+1])||128&(h=E[C+2])||128&(n=E[C+3]));)b[a++]=c,b[a++]=o,b[a++]=h,b[a++]=n,C+=4;if((c=E[C++])<128)b[a++]=c;else if((224&c)==192){if(C>=i)return this.interim[0]=c,a;if((192&(o=E[C++]))!=128){C--;continue}if((t=(31&c)<<6|63&o)<128){C--;continue}b[a++]=t}else if((240&c)==224){if(C>=i)return this.interim[0]=c,a;if((192&(o=E[C++]))!=128){C--;continue}if(C>=i)return this.interim[0]=c,this.interim[1]=o,a;if((192&(h=E[C++]))!=128){C--;continue}if((t=(15&c)<<12|(63&o)<<6|63&h)<2048||t>=55296&&t<=57343)continue;b[a++]=t}else if((248&c)==240){if(C>=i)return this.interim[0]=c,a;if((192&(o=E[C++]))!=128){C--;continue}if(C>=i)return this.interim[0]=c,this.interim[1]=o,a;if((192&(h=E[C++]))!=128){C--;continue}if(C>=i)return this.interim[0]=c,this.interim[1]=o,this.interim[2]=h,a;if((192&(n=E[C++]))!=128){C--;continue}if((t=(7&c)<<18|(63&o)<<12|(63&h)<<6|63&n)<65536||t>1114111)continue;b[a++]=t}}return a},p}();L.Utf8ToUtf32=M},function(G,L,I){"use strict";Object.defineProperty(L,"__esModule",{value:!0}),L.CHAR_ATLAS_CELL_SPACING=L.DIM_OPACITY=L.INVERTED_DEFAULT_COLOR=void 0,L.INVERTED_DEFAULT_COLOR=257,L.DIM_OPACITY=.5,L.CHAR_ATLAS_CELL_SPACING=1},function(G,L,I){"use strict";var R,M,p,E;function b(c){var o=c.toString(16);return o.length<2?"0"+o:o}function i(c,o){return c<o?(o+.05)/(c+.05):(c+.05)/(o+.05)}Object.defineProperty(L,"__esModule",{value:!0}),L.contrastRatio=L.toPaddedHex=L.rgba=L.rgb=L.css=L.color=L.channels=void 0,function(c){c.toCss=function(o,h,n,a){return a!==void 0?"#"+b(o)+b(h)+b(n)+b(a):"#"+b(o)+b(h)+b(n)},c.toRgba=function(o,h,n,a){return a===void 0&&(a=255),(o<<24|h<<16|n<<8|a)>>>0}}(R=L.channels||(L.channels={})),(M=L.color||(L.color={})).blend=function(c,o){var h=(255&o.rgba)/255;if(h===1)return{css:o.css,rgba:o.rgba};var n=o.rgba>>24&255,a=o.rgba>>16&255,t=o.rgba>>8&255,r=c.rgba>>24&255,s=c.rgba>>16&255,u=c.rgba>>8&255,d=r+Math.round((n-r)*h),f=s+Math.round((a-s)*h),v=u+Math.round((t-u)*h);return{css:R.toCss(d,f,v),rgba:R.toRgba(d,f,v)}},M.isOpaque=function(c){return(255&c.rgba)==255},M.ensureContrastRatio=function(c,o,h){var n=E.ensureContrastRatio(c.rgba,o.rgba,h);if(n)return E.toColor(n>>24&255,n>>16&255,n>>8&255)},M.opaque=function(c){var o=(255|c.rgba)>>>0,h=E.toChannels(o),n=h[0],a=h[1],t=h[2];return{css:R.toCss(n,a,t),rgba:o}},M.opacity=function(c,o){var h=Math.round(255*o),n=E.toChannels(c.rgba),a=n[0],t=n[1],r=n[2];return{css:R.toCss(a,t,r,h),rgba:R.toRgba(a,t,r,h)}},(L.css||(L.css={})).toColor=function(c){switch(c.length){case 7:return{css:c,rgba:(parseInt(c.slice(1),16)<<8|255)>>>0};case 9:return{css:c,rgba:parseInt(c.slice(1),16)>>>0}}throw new Error("css.toColor: Unsupported css format")},function(c){function o(h,n,a){var t=h/255,r=n/255,s=a/255;return .2126*(t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4))+.7152*(r<=.03928?r/12.92:Math.pow((r+.055)/1.055,2.4))+.0722*(s<=.03928?s/12.92:Math.pow((s+.055)/1.055,2.4))}c.relativeLuminance=function(h){return o(h>>16&255,h>>8&255,255&h)},c.relativeLuminance2=o}(p=L.rgb||(L.rgb={})),function(c){function o(n,a,t){for(var r=n>>24&255,s=n>>16&255,u=n>>8&255,d=a>>24&255,f=a>>16&255,v=a>>8&255,m=i(p.relativeLuminance2(d,v,f),p.relativeLuminance2(r,s,u));m<t&&(d>0||f>0||v>0);)d-=Math.max(0,Math.ceil(.1*d)),f-=Math.max(0,Math.ceil(.1*f)),v-=Math.max(0,Math.ceil(.1*v)),m=i(p.relativeLuminance2(d,v,f),p.relativeLuminance2(r,s,u));return(d<<24|f<<16|v<<8|255)>>>0}function h(n,a,t){for(var r=n>>24&255,s=n>>16&255,u=n>>8&255,d=a>>24&255,f=a>>16&255,v=a>>8&255,m=i(p.relativeLuminance2(d,v,f),p.relativeLuminance2(r,s,u));m<t&&(d<255||f<255||v<255);)d=Math.min(255,d+Math.ceil(.1*(255-d))),f=Math.min(255,f+Math.ceil(.1*(255-f))),v=Math.min(255,v+Math.ceil(.1*(255-v))),m=i(p.relativeLuminance2(d,v,f),p.relativeLuminance2(r,s,u));return(d<<24|f<<16|v<<8|255)>>>0}c.ensureContrastRatio=function(n,a,t){var r=p.relativeLuminance(n>>8),s=p.relativeLuminance(a>>8);if(i(r,s)<t)return s<r?o(n,a,t):h(n,a,t)},c.reduceLuminance=o,c.increaseLuminance=h,c.toChannels=function(n){return[n>>24&255,n>>16&255,n>>8&255,255&n]},c.toColor=function(n,a,t){return{css:R.toCss(n,a,t),rgba:R.toRgba(n,a,t)}}}(E=L.rgba||(L.rgba={})),L.toPaddedHex=b,L.contrastRatio=i},function(G,L,I){"use strict";Object.defineProperty(L,"__esModule",{value:!0}),L.isLinux=L.isWindows=L.isIphone=L.isIpad=L.isMac=L.isSafari=L.isFirefox=void 0;var R=typeof navigator=="undefined",M=R?"node":navigator.userAgent,p=R?"node":navigator.platform;function E(b,i){return b.indexOf(i)>=0}L.isFirefox=!!~M.indexOf("Firefox"),L.isSafari=/^((?!chrome|android).)*safari/i.test(M),L.isMac=E(["Macintosh","MacIntel","MacPPC","Mac68K"],p),L.isIpad=p==="iPad",L.isIphone=p==="iPhone",L.isWindows=E(["Windows","Win16","Win32","WinCE"],p),L.isLinux=p.indexOf("Linux")>=0},function(G,L,I){"use strict";Object.defineProperty(L,"__esModule",{value:!0}),L.C1=L.C0=void 0,function(R){R.NUL="\0",R.SOH="",R.STX="",R.ETX="",R.EOT="",R.ENQ="",R.ACK="",R.BEL="\x07",R.BS="\b",R.HT=" ",R.LF=`
|
|
|
`,R.VT="\v",R.FF="\f",R.CR="\r",R.SO="",R.SI="",R.DLE="",R.DC1="",R.DC2="",R.DC3="",R.DC4="",R.NAK="",R.SYN="",R.ETB="",R.CAN="",R.EM="",R.SUB="",R.ESC="",R.FS="",R.GS="",R.RS="",R.US="",R.SP=" ",R.DEL="\x7F"}(L.C0||(L.C0={})),function(R){R.PAD="\x80",R.HOP="\x81",R.BPH="\x82",R.NBH="\x83",R.IND="\x84",R.NEL="\x85",R.SSA="\x86",R.ESA="\x87",R.HTS="\x88",R.HTJ="\x89",R.VTS="\x8A",R.PLD="\x8B",R.PLU="\x8C",R.RI="\x8D",R.SS2="\x8E",R.SS3="\x8F",R.DCS="\x90",R.PU1="\x91",R.PU2="\x92",R.STS="\x93",R.CCH="\x94",R.MW="\x95",R.SPA="\x96",R.EPA="\x97",R.SOS="\x98",R.SGCI="\x99",R.SCI="\x9A",R.CSI="\x9B",R.ST="\x9C",R.OSC="\x9D",R.PM="\x9E",R.APC="\x9F"}(L.C1||(L.C1={}))},function(G,L,I){"use strict";Object.defineProperty(L,"__esModule",{value:!0}),L.BaseRenderLayer=void 0;var R=I(3),M=I(9),p=I(25),E=I(6),b=I(28),i=I(10),c=I(17),o=function(){function h(n,a,t,r,s,u,d,f){this._container=n,this._alpha=r,this._colors=s,this._rendererId=u,this._bufferService=d,this._optionsService=f,this._scaledCharWidth=0,this._scaledCharHeight=0,this._scaledCellWidth=0,this._scaledCellHeight=0,this._scaledCharLeft=0,this._scaledCharTop=0,this._currentGlyphIdentifier={chars:"",code:0,bg:0,fg:0,bold:!1,dim:!1,italic:!1},this._canvas=document.createElement("canvas"),this._canvas.classList.add("xterm-"+a+"-layer"),this._canvas.style.zIndex=t.toString(),this._initCanvas(),this._container.appendChild(this._canvas)}return h.prototype.dispose=function(){var n;c.removeElementFromParent(this._canvas),(n=this._charAtlas)===null||n===void 0||n.dispose()},h.prototype._initCanvas=function(){this._ctx=b.throwIfFalsy(this._canvas.getContext("2d",{alpha:this._alpha})),this._alpha||this._clearAll()},h.prototype.onOptionsChanged=function(){},h.prototype.onBlur=function(){},h.prototype.onFocus=function(){},h.prototype.onCursorMove=function(){},h.prototype.onGridChanged=function(n,a){},h.prototype.onSelectionChanged=function(n,a,t){t===void 0&&(t=!1)},h.prototype.setColors=function(n){this._refreshCharAtlas(n)},h.prototype._setTransparency=function(n){if(n!==this._alpha){var a=this._canvas;this._alpha=n,this._canvas=this._canvas.cloneNode(),this._initCanvas(),this._container.replaceChild(this._canvas,a),this._refreshCharAtlas(this._colors),this.onGridChanged(0,this._bufferService.rows-1)}},h.prototype._refreshCharAtlas=function(n){this._scaledCharWidth<=0&&this._scaledCharHeight<=0||(this._charAtlas=p.acquireCharAtlas(this._optionsService.options,this._rendererId,n,this._scaledCharWidth,this._scaledCharHeight),this._charAtlas.warmUp())},h.prototype.resize=function(n){this._scaledCellWidth=n.scaledCellWidth,this._scaledCellHeight=n.scaledCellHeight,this._scaledCharWidth=n.scaledCharWidth,this._scaledCharHeight=n.scaledCharHeight,this._scaledCharLeft=n.scaledCharLeft,this._scaledCharTop=n.scaledCharTop,this._canvas.width=n.scaledCanvasWidth,this._canvas.height=n.scaledCanvasHeight,this._canvas.style.width=n.canvasWidth+"px",this._canvas.style.height=n.canvasHeight+"px",this._alpha||this._clearAll(),this._refreshCharAtlas(this._colors)},h.prototype._fillCells=function(n,a,t,r){this._ctx.fillRect(n*this._scaledCellWidth,a*this._scaledCellHeight,t*this._scaledCellWidth,r*this._scaledCellHeight)},h.prototype._fillBottomLineAtCells=function(n,a,t){t===void 0&&(t=1),this._ctx.fillRect(n*this._scaledCellWidth,(a+1)*this._scaledCellHeight-window.devicePixelRatio-1,t*this._scaledCellWidth,window.devicePixelRatio)},h.prototype._fillLeftLineAtCell=function(n,a,t){this._ctx.fillRect(n*this._scaledCellWidth,a*this._scaledCellHeight,window.devicePixelRatio*t,this._scaledCellHeight)},h.prototype._strokeRectAtCell=function(n,a,t,r){this._ctx.lineWidth=window.devicePixelRatio,this._ctx.strokeRect(n*this._scaledCellWidth+window.devicePixelRatio/2,a*this._scaledCellHeight+window.devicePixelRatio/2,t*this._scaledCellWidth-window.devicePixelRatio,r*this._scaledCellHeight-window.devicePixelRatio)},h.prototype._clearAll=function(){this._alpha?this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height):(this._ctx.fillStyle=this._colors.background.css,this._ctx.fillRect(0,0,this._canvas.width,this._canvas.height))},h.prototype._clearCells=function(n,a,t,r){this._alpha?this._ctx.clearRect(n*this._scaledCellWidth,a*this._scaledCellHeight,t*this._scaledCellWidth,r*this._scaledCellHeight):(this._ctx.fillStyle=this._colors.background.css,this._ctx.fillRect(n*this._scaledCellWidth,a*this._scaledCellHeight,t*this._scaledCellWidth,r*this._scaledCellHeight))},h.prototype._fillCharTrueColor=function(n,a,t){this._ctx.font=this._getFont(!1,!1),this._ctx.textBaseline="middle",this._clipRow(t),this._ctx.fillText(n.getChars(),a*this._scaledCellWidth+this._scaledCharLeft,t*this._scaledCellHeight+this._scaledCharTop+this._scaledCharHeight/2)},h.prototype._drawChars=function(n,a,t){var r,s,u=this._getContrastColor(n);u||n.isFgRGB()||n.isBgRGB()?this._drawUncachedChars(n,a,t,u):(n.isInverse()?(r=n.isBgDefault()?M.INVERTED_DEFAULT_COLOR:n.getBgColor(),s=n.isFgDefault()?M.INVERTED_DEFAULT_COLOR:n.getFgColor()):(s=n.isBgDefault()?R.DEFAULT_COLOR:n.getBgColor(),r=n.isFgDefault()?R.DEFAULT_COLOR:n.getFgColor()),r+=this._optionsService.options.drawBoldTextInBrightColors&&n.isBold()&&r<8?8:0,this._currentGlyphIdentifier.chars=n.getChars()||R.WHITESPACE_CELL_CHAR,this._currentGlyphIdentifier.code=n.getCode()||R.WHITESPACE_CELL_CODE,this._currentGlyphIdentifier.bg=s,this._currentGlyphIdentifier.fg=r,this._currentGlyphIdentifier.bold=!!n.isBold(),this._currentGlyphIdentifier.dim=!!n.isDim(),this._currentGlyphIdentifier.italic=!!n.isItalic(),this._charAtlas&&this._charAtlas.draw(this._ctx,this._currentGlyphIdentifier,a*this._scaledCellWidth+this._scaledCharLeft,t*this._scaledCellHeight+this._scaledCharTop)||this._drawUncachedChars(n,a,t))},h.prototype._drawUncachedChars=function(n,a,t,r){if(this._ctx.save(),this._ctx.font=this._getFont(!!n.isBold(),!!n.isItalic()),this._ctx.textBaseline="middle",n.isInverse())if(r)this._ctx.fillStyle=r.css;else if(n.isBgDefault())this._ctx.fillStyle=i.color.opaque(this._colors.background).css;else if(n.isBgRGB())this._ctx.fillStyle="rgb("+E.AttributeData.toColorRGB(n.getBgColor()).join(",")+")";else{var s=n.getBgColor();this._optionsService.options.drawBoldTextInBrightColors&&n.isBold()&&s<8&&(s+=8),this._ctx.fillStyle=this._colors.ansi[s].css}else if(r)this._ctx.fillStyle=r.css;else if(n.isFgDefault())this._ctx.fillStyle=this._colors.foreground.css;else if(n.isFgRGB())this._ctx.fillStyle="rgb("+E.AttributeData.toColorRGB(n.getFgColor()).join(",")+")";else{var u=n.getFgColor();this._optionsService.options.drawBoldTextInBrightColors&&n.isBold()&&u<8&&(u+=8),this._ctx.fillStyle=this._colors.ansi[u].css}this._clipRow(t),n.isDim()&&(this._ctx.globalAlpha=M.DIM_OPACITY),this._ctx.fillText(n.getChars(),a*this._scaledCellWidth+this._scaledCharLeft,t*this._scaledCellHeight+this._scaledCharTop+this._scaledCharHeight/2),this._ctx.restore()},h.prototype._clipRow=function(n){this._ctx.beginPath(),this._ctx.rect(0,n*this._scaledCellHeight,this._bufferService.cols*this._scaledCellWidth,this._scaledCellHeight),this._ctx.clip()},h.prototype._getFont=function(n,a){return(a?"italic":"")+" "+(n?this._optionsService.options.fontWeightBold:this._optionsService.options.fontWeight)+" "+this._optionsService.options.fontSize*window.devicePixelRatio+"px "+this._optionsService.options.fontFamily},h.prototype._getContrastColor=function(n){if(this._optionsService.options.minimumContrastRatio!==1){var a=this._colors.contrastCache.getColor(n.bg,n.fg);if(a!==void 0)return a||void 0;var t=n.getFgColor(),r=n.getFgColorMode(),s=n.getBgColor(),u=n.getBgColorMode(),d=!!n.isInverse(),f=!!n.isInverse();if(d){var v=t;t=s,s=v;var m=r;r=u,u=m}var S=this._resolveBackgroundRgba(u,s,d),C=this._resolveForegroundRgba(r,t,d,f),_=i.rgba.ensureContrastRatio(S,C,this._optionsService.options.minimumContrastRatio);if(_){var y={css:i.channels.toCss(_>>24&255,_>>16&255,_>>8&255),rgba:_};return this._colors.contrastCache.setColor(n.bg,n.fg,y),y}this._colors.contrastCache.setColor(n.bg,n.fg,null)}},h.prototype._resolveBackgroundRgba=function(n,a,t){switch(n){case 16777216:case 33554432:return this._colors.ansi[a].rgba;case 50331648:return a<<8;case 0:default:return t?this._colors.foreground.rgba:this._colors.background.rgba}},h.prototype._resolveForegroundRgba=function(n,a,t,r){switch(n){case 16777216:case 33554432:return this._optionsService.options.drawBoldTextInBrightColors&&r&&a<8&&(a+=8),this._colors.ansi[a].rgba;case 50331648:return a<<8;case 0:default:return t?this._colors.background.rgba:this._colors.foreground.rgba}},h}();L.BaseRenderLayer=o},function(G,L,I){"use strict";Object.defineProperty(L,"__esModule",{value:!0}),L.createDecorator=L.getServiceDependencies=L.serviceRegistry=void 0;function R(M,p,E){p.di$target===p?p.di$dependencies.push({id:M,index:E}):(p.di$dependencies=[{id:M,index:E}],p.di$target=p)}L.serviceRegistry=new Map,L.getServiceDependencies=function(M){return M.di$dependencies||[]},L.createDecorator=function(M){if(L.serviceRegistry.has(M))return L.serviceRegistry.get(M);var p=function(E,b,i){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");R(p,E,i)};return p.toString=function(){return M},L.serviceRegistry.set(M,p),p}},function(G,L,I){"use strict";function R(M,p,E,b){if(E===void 0&&(E=0),b===void 0&&(b=M.length),E>=M.length)return M;E=(M.length+E)%M.length,b=b>=M.length?M.length:(M.length+b)%M.length;for(var i=E;i<b;++i)M[i]=p;return M}Object.defineProperty(L,"__esModule",{value:!0}),L.concat=L.fillFallback=L.fill=void 0,L.fill=function(M,p,E,b){return M.fill?M.fill(p,E,b):R(M,p,E,b)},L.fillFallback=R,L.concat=function(M,p){var E=new M.constructor(M.length+p.length);return E.set(M),E.set(p,M.length),E}},function(G,L,I){"use strict";Object.defineProperty(L,"__esModule",{value:!0}),L.BufferLine=L.DEFAULT_ATTR_DATA=void 0;var R=I(8),M=I(3),p=I(4),E=I(6);L.DEFAULT_ATTR_DATA=Object.freeze(new E.AttributeData);var b=function(){function i(c,o,h){h===void 0&&(h=!1),this.isWrapped=h,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*c);for(var n=o||p.CellData.fromCharData([0,M.NULL_CELL_CHAR,M.NULL_CELL_WIDTH,M.NULL_CELL_CODE]),a=0;a<c;++a)this.setCell(a,n);this.length=c}return i.prototype.get=function(c){var o=this._data[3*c+0],h=2097151&o;return[this._data[3*c+1],2097152&o?this._combined[c]:h?R.stringFromCodePoint(h):"",o>>22,2097152&o?this._combined[c].charCodeAt(this._combined[c].length-1):h]},i.prototype.set=function(c,o){this._data[3*c+1]=o[M.CHAR_DATA_ATTR_INDEX],o[M.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[c]=o[1],this._data[3*c+0]=2097152|c|o[M.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*c+0]=o[M.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|o[M.CHAR_DATA_WIDTH_INDEX]<<22},i.prototype.getWidth=function(c){return this._data[3*c+0]>>22},i.prototype.hasWidth=function(c){return 12582912&this._data[3*c+0]},i.prototype.getFg=function(c){return this._data[3*c+1]},i.prototype.getBg=function(c){return this._data[3*c+2]},i.prototype.hasContent=function(c){return 4194303&this._data[3*c+0]},i.prototype.getCodePoint=function(c){var o=this._data[3*c+0];return 2097152&o?this._combined[c].charCodeAt(this._combined[c].length-1):2097151&o},i.prototype.isCombined=function(c){return 2097152&this._data[3*c+0]},i.prototype.getString=function(c){var o=this._data[3*c+0];return 2097152&o?this._combined[c]:2097151&o?R.stringFromCodePoint(2097151&o):""},i.prototype.loadCell=function(c,o){var h=3*c;return o.content=this._data[h+0],o.fg=this._data[h+1],o.bg=this._data[h+2],2097152&o.content&&(o.combinedData=this._combined[c]),268435456&o.bg&&(o.extended=this._extendedAttrs[c]),o},i.prototype.setCell=function(c,o){2097152&o.content&&(this._combined[c]=o.combinedData),268435456&o.bg&&(this._extendedAttrs[c]=o.extended),this._data[3*c+0]=o.content,this._data[3*c+1]=o.fg,this._data[3*c+2]=o.bg},i.prototype.setCellFromCodePoint=function(c,o,h,n,a,t){268435456&a&&(this._extendedAttrs[c]=t),this._data[3*c+0]=o|h<<22,this._data[3*c+1]=n,this._data[3*c+2]=a},i.prototype.addCodepointToCell=function(c,o){var h=this._data[3*c+0];2097152&h?this._combined[c]+=R.stringFromCodePoint(o):(2097151&h?(this._combined[c]=R.stringFromCodePoint(2097151&h)+R.stringFromCodePoint(o),h&=-2097152,h|=2097152):h=o|1<<22,this._data[3*c+0]=h)},i.prototype.insertCells=function(c,o,h,n){if((c%=this.length)&&this.getWidth(c-1)===2&&this.setCellFromCodePoint(c-1,0,1,(n==null?void 0:n.fg)||0,(n==null?void 0:n.bg)||0,(n==null?void 0:n.extended)||new E.ExtendedAttrs),o<this.length-c){for(var a=new p.CellData,t=this.length-c-o-1;t>=0;--t)this.setCell(c+o+t,this.loadCell(c+t,a));for(t=0;t<o;++t)this.setCell(c+t,h)}else for(t=c;t<this.length;++t)this.setCell(t,h);this.getWidth(this.length-1)===2&&this.setCellFromCodePoint(this.length-1,0,1,(n==null?void 0:n.fg)||0,(n==null?void 0:n.bg)||0,(n==null?void 0:n.extended)||new E.ExtendedAttrs)},i.prototype.deleteCells=function(c,o,h,n){if(c%=this.length,o<this.length-c){for(var a=new p.CellData,t=0;t<this.length-c-o;++t)this.setCell(c+t,this.loadCell(c+o+t,a));for(t=this.length-o;t<this.length;++t)this.setCell(t,h)}else for(t=c;t<this.length;++t)this.setCell(t,h);c&&this.getWidth(c-1)===2&&this.setCellFromCodePoint(c-1,0,1,(n==null?void 0:n.fg)||0,(n==null?void 0:n.bg)||0,(n==null?void 0:n.extended)||new E.ExtendedAttrs),this.getWidth(c)!==0||this.hasContent(c)||this.setCellFromCodePoint(c,0,1,(n==null?void 0:n.fg)||0,(n==null?void 0:n.bg)||0,(n==null?void 0:n.extended)||new E.ExtendedAttrs)},i.prototype.replaceCells=function(c,o,h,n){for(c&&this.getWidth(c-1)===2&&this.setCellFromCodePoint(c-1,0,1,(n==null?void 0:n.fg)||0,(n==null?void 0:n.bg)||0,(n==null?void 0:n.extended)||new E.ExtendedAttrs),o<this.length&&this.getWidth(o-1)===2&&this.setCellFromCodePoint(o,0,1,(n==null?void 0:n.fg)||0,(n==null?void 0:n.bg)||0,(n==null?void 0:n.extended)||new E.ExtendedAttrs);c<o&&c<this.length;)this.setCell(c++,h)},i.prototype.resize=function(c,o){if(c!==this.length){if(c>this.length){var h=new Uint32Array(3*c);this.length&&(3*c<this._data.length?h.set(this._data.subarray(0,3*c)):h.set(this._data)),this._data=h;for(var n=this.length;n<c;++n)this.setCell(n,o)}else if(c){(h=new Uint32Array(3*c)).set(this._data.subarray(0,3*c)),this._data=h;var a=Object.keys(this._combined);for(n=0;n<a.length;n++){var t=parseInt(a[n],10);t>=c&&delete this._combined[t]}}else this._data=new Uint32Array(0),this._combined={};this.length=c}},i.prototype.fill=function(c){this._combined={},this._extendedAttrs={};for(var o=0;o<this.length;++o)this.setCell(o,c)},i.prototype.copyFrom=function(c){for(var o in this.length!==c.length?this._data=new Uint32Array(c._data):this._data.set(c._data),this.length=c.length,this._combined={},c._combined)this._combined[o]=c._combined[o];for(var o in this._extendedAttrs={},c._extendedAttrs)this._extendedAttrs[o]=c._extendedAttrs[o];this.isWrapped=c.isWrapped},i.prototype.clone=function(){var c=new i(0);for(var o in c._data=new Uint32Array(this._data),c.length=this.length,this._combined)c._combined[o]=this._combined[o];for(var o in this._extendedAttrs)c._extendedAttrs[o]=this._extendedAttrs[o];return c.isWrapped=this.isWrapped,c},i.prototype.getTrimmedLength=function(){for(var c=this.length-1;c>=0;--c)if(4194303&this._data[3*c+0])return c+(this._data[3*c+0]>>22);return 0},i.prototype.copyCellsFrom=function(c,o,h,n,a){var t=c._data;if(a)for(var r=n-1;r>=0;r--)for(var s=0;s<3;s++)this._data[3*(h+r)+s]=t[3*(o+r)+s];else for(r=0;r<n;r++)for(s=0;s<3;s++)this._data[3*(h+r)+s]=t[3*(o+r)+s];var u=Object.keys(c._combined);for(s=0;s<u.length;s++){var d=parseInt(u[s],10);d>=o&&(this._combined[d-o+h]=c._combined[d])}},i.prototype.translateToString=function(c,o,h){c===void 0&&(c=!1),o===void 0&&(o=0),h===void 0&&(h=this.length),c&&(h=Math.min(h,this.getTrimmedLength()));for(var n="";o<h;){var a=this._data[3*o+0],t=2097151&a;n+=2097152&a?this._combined[o]:t?R.stringFromCodePoint(t):M.WHITESPACE_CELL_CHAR,o+=a>>22||1}return n},i}();L.BufferLine=b},function(G,L,I){"use strict";Object.defineProperty(L,"__esModule",{value:!0}),L.removeElementFromParent=void 0,L.removeElementFromParent=function(){for(var R,M=[],p=0;p<arguments.length;p++)M[p]=arguments[p];for(var E=0,b=M;E<b.length;E++){var i=b[E];(R=i==null?void 0:i.parentElement)===null||R===void 0||R.removeChild(i)}}},function(G,L,I){"use strict";Object.defineProperty(L,"__esModule",{value:!0}),L.tooMuchOutput=L.promptLabel=void 0,L.promptLabel="Terminal input",L.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},function(G,L,I){"use strict";var R,M=this&&this.__extends||(R=function(C,_){return(R=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(y,T){y.__proto__=T}||function(y,T){for(var O in T)T.hasOwnProperty(O)&&(y[O]=T[O])})(C,_)},function(C,_){function y(){this.constructor=C}R(C,_),C.prototype=_===null?Object.create(_):(y.prototype=_.prototype,new y)});Object.defineProperty(L,"__esModule",{value:!0}),L.InputHandler=L.WindowsOptionsReportType=void 0;var p,E=I(12),b=I(20),i=I(39),c=I(2),o=I(15),h=I(8),n=I(16),a=I(0),t=I(3),r=I(4),s=I(6),u=I(22),d=I(24),f={"(":0,")":1,"*":2,"+":3,"-":1,".":2};function v(C,_){if(C>24)return _.setWinLines||!1;switch(C){case 1:return!!_.restoreWin;case 2:return!!_.minimizeWin;case 3:return!!_.setWinPosition;case 4:return!!_.setWinSizePixels;case 5:return!!_.raiseWin;case 6:return!!_.lowerWin;case 7:return!!_.refreshWin;case 8:return!!_.setWinSizeChars;case 9:return!!_.maximizeWin;case 10:return!!_.fullscreenWin;case 11:return!!_.getWinState;case 13:return!!_.getWinPosition;case 14:return!!_.getWinSizePixels;case 15:return!!_.getScreenSizePixels;case 16:return!!_.getCellSizePixels;case 18:return!!_.getWinSizeChars;case 19:return!!_.getScreenSizeChars;case 20:return!!_.getIconTitle;case 21:return!!_.getWinTitle;case 22:return!!_.pushTitle;case 23:return!!_.popTitle;case 24:return!!_.setWinLines}return!1}!function(C){C[C.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",C[C.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"}(p=L.WindowsOptionsReportType||(L.WindowsOptionsReportType={}));var m=function(){function C(_,y,T,O){this._bufferService=_,this._coreService=y,this._logService=T,this._optionsService=O,this._data=new Uint32Array(0)}return C.prototype.hook=function(_){this._data=new Uint32Array(0)},C.prototype.put=function(_,y,T){this._data=o.concat(this._data,_.subarray(y,T))},C.prototype.unhook=function(_){if(_){var y=h.utf32ToString(this._data);switch(this._data=new Uint32Array(0),y){case'"q':return this._coreService.triggerDataEvent(E.C0.ESC+'P1$r0"q'+E.C0.ESC+"\\");case'"p':return this._coreService.triggerDataEvent(E.C0.ESC+'P1$r61;1"p'+E.C0.ESC+"\\");case"r":var T=this._bufferService.buffer.scrollTop+1+";"+(this._bufferService.buffer.scrollBottom+1)+"r";return this._coreService.triggerDataEvent(E.C0.ESC+"P1$r"+T+E.C0.ESC+"\\");case"m":return this._coreService.triggerDataEvent(E.C0.ESC+"P1$r0m"+E.C0.ESC+"\\");case" q":var O={block:2,underline:4,bar:6}[this._optionsService.options.cursorStyle];return O-=this._optionsService.options.cursorBlink?1:0,this._coreService.triggerDataEvent(E.C0.ESC+"P1$r"+O+" q"+E.C0.ESC+"\\");default:this._logService.debug("Unknown DCS $q %s",y),this._coreService.triggerDataEvent(E.C0.ESC+"P0$r"+E.C0.ESC+"\\")}}else this._data=new Uint32Array(0)},C}(),S=function(C){function _(y,T,O,g,F,P,N,X,j){j===void 0&&(j=new i.EscapeSequenceParser);var A=C.call(this)||this;A._bufferService=y,A._charsetService=T,A._coreService=O,A._dirtyRowService=g,A._logService=F,A._optionsService=P,A._coreMouseService=N,A._unicodeService=X,A._parser=j,A._parseBuffer=new Uint32Array(4096),A._stringDecoder=new h.StringToUtf32,A._utf8Decoder=new h.Utf8ToUtf32,A._workCell=new r.CellData,A._windowTitle="",A._iconName="",A._windowTitleStack=[],A._iconNameStack=[],A._curAttrData=n.DEFAULT_ATTR_DATA.clone(),A._eraseAttrDataInternal=n.DEFAULT_ATTR_DATA.clone(),A._onRequestBell=new a.EventEmitter,A._onRequestRefreshRows=new a.EventEmitter,A._onRequestReset=new a.EventEmitter,A._onRequestScroll=new a.EventEmitter,A._onRequestSyncScrollBar=new a.EventEmitter,A._onRequestWindowsOptionsReport=new a.EventEmitter,A._onA11yChar=new a.EventEmitter,A._onA11yTab=new a.EventEmitter,A._onCursorMove=new a.EventEmitter,A._onLineFeed=new a.EventEmitter,A._onScroll=new a.EventEmitter,A._onTitleChange=new a.EventEmitter,A.register(A._parser),A._parser.setCsiHandlerFallback(function(z,te){A._logService.debug("Unknown CSI code: ",{identifier:A._parser.identToString(z),params:te.toArray()})}),A._parser.setEscHandlerFallback(function(z){A._logService.debug("Unknown ESC code: ",{identifier:A._parser.identToString(z)})}),A._parser.setExecuteHandlerFallback(function(z){A._logService.debug("Unknown EXECUTE code: ",{code:z})}),A._parser.setOscHandlerFallback(function(z,te,de){A._logService.debug("Unknown OSC code: ",{identifier:z,action:te,data:de})}),A._parser.setDcsHandlerFallback(function(z,te,de){te==="HOOK"&&(de=de.toArray()),A._logService.debug("Unknown DCS code: ",{identifier:A._parser.identToString(z),action:te,payload:de})}),A._parser.setPrintHandler(function(z,te,de){return A.print(z,te,de)}),A._parser.setCsiHandler({final:"@"},function(z){return A.insertChars(z)}),A._parser.setCsiHandler({intermediates:" ",final:"@"},function(z){return A.scrollLeft(z)}),A._parser.setCsiHandler({final:"A"},function(z){return A.cursorUp(z)}),A._parser.setCsiHandler({intermediates:" ",final:"A"},function(z){return A.scrollRight(z)}),A._parser.setCsiHandler({final:"B"},function(z){return A.cursorDown(z)}),A._parser.setCsiHandler({final:"C"},function(z){return A.cursorForward(z)}),A._parser.setCsiHandler({final:"D"},function(z){return A.cursorBackward(z)}),A._parser.setCsiHandler({final:"E"},function(z){return A.cursorNextLine(z)}),A._parser.setCsiHandler({final:"F"},function(z){return A.cursorPrecedingLine(z)}),A._parser.setCsiHandler({final:"G"},function(z){return A.cursorCharAbsolute(z)}),A._parser.setCsiHandler({final:"H"},function(z){return A.cursorPosition(z)}),A._parser.setCsiHandler({final:"I"},function(z){return A.cursorForwardTab(z)}),A._parser.setCsiHandler({final:"J"},function(z){return A.eraseInDisplay(z)}),A._parser.setCsiHandler({prefix:"?",final:"J"},function(z){return A.eraseInDisplay(z)}),A._parser.setCsiHandler({final:"K"},function(z){return A.eraseInLine(z)}),A._parser.setCsiHandler({prefix:"?",final:"K"},function(z){return A.eraseInLine(z)}),A._parser.setCsiHandler({final:"L"},function(z){return A.insertLines(z)}),A._parser.setCsiHandler({final:"M"},function(z){return A.deleteLines(z)}),A._parser.setCsiHandler({final:"P"},function(z){return A.deleteChars(z)}),A._parser.setCsiHandler({final:"S"},function(z){return A.scrollUp(z)}),A._parser.setCsiHandler({final:"T"},function(z){return A.scrollDown(z)}),A._parser.setCsiHandler({final:"X"},function(z){return A.eraseChars(z)}),A._parser.setCsiHandler({final:"Z"},function(z){return A.cursorBackwardTab(z)}),A._parser.setCsiHandler({final:"`"},function(z){return A.charPosAbsolute(z)}),A._parser.setCsiHandler({final:"a"},function(z){return A.hPositionRelative(z)}),A._parser.setCsiHandler({final:"b"},function(z){return A.repeatPrecedingCharacter(z)}),A._parser.setCsiHandler({final:"c"},function(z){return A.sendDeviceAttributesPrimary(z)}),A._parser.setCsiHandler({prefix:">",final:"c"},function(z){return A.sendDeviceAttributesSecondary(z)}),A._parser.setCsiHandler({final:"d"},function(z){return A.linePosAbsolute(z)}),A._parser.setCsiHandler({final:"e"},function(z){return A.vPositionRelative(z)}),A._parser.setCsiHandler({final:"f"},function(z){return A.hVPosition(z)}),A._parser.setCsiHandler({final:"g"},function(z){return A.tabClear(z)}),A._parser.setCsiHandler({final:"h"},function(z){return A.setMode(z)}),A._parser.setCsiHandler({prefix:"?",final:"h"},function(z){return A.setModePrivate(z)}),A._parser.setCsiHandler({final:"l"},function(z){return A.resetMode(z)}),A._parser.setCsiHandler({prefix:"?",final:"l"},function(z){return A.resetModePrivate(z)}),A._parser.setCsiHandler({final:"m"},function(z){return A.charAttributes(z)}),A._parser.setCsiHandler({final:"n"},function(z){return A.deviceStatus(z)}),A._parser.setCsiHandler({prefix:"?",final:"n"},function(z){return A.deviceStatusPrivate(z)}),A._parser.setCsiHandler({intermediates:"!",final:"p"},function(z){return A.softReset(z)}),A._parser.setCsiHandler({intermediates:" ",final:"q"},function(z){return A.setCursorStyle(z)}),A._parser.setCsiHandler({final:"r"},function(z){return A.setScrollRegion(z)}),A._parser.setCsiHandler({final:"s"},function(z){return A.saveCursor(z)}),A._parser.setCsiHandler({final:"t"},function(z){return A.windowOptions(z)}),A._parser.setCsiHandler({final:"u"},function(z){return A.restoreCursor(z)}),A._parser.setCsiHandler({intermediates:"'",final:"}"},function(z){return A.insertColumns(z)}),A._parser.setCsiHandler({intermediates:"'",final:"~"},function(z){return A.deleteColumns(z)}),A._parser.setExecuteHandler(E.C0.BEL,function(){return A.bell()}),A._parser.setExecuteHandler(E.C0.LF,function(){return A.lineFeed()}),A._parser.setExecuteHandler(E.C0.VT,function(){return A.lineFeed()}),A._parser.setExecuteHandler(E.C0.FF,function(){return A.lineFeed()}),A._parser.setExecuteHandler(E.C0.CR,function(){return A.carriageReturn()}),A._parser.setExecuteHandler(E.C0.BS,function(){return A.backspace()}),A._parser.setExecuteHandler(E.C0.HT,function(){return A.tab()}),A._parser.setExecuteHandler(E.C0.SO,function(){return A.shiftOut()}),A._parser.setExecuteHandler(E.C0.SI,function(){return A.shiftIn()}),A._parser.setExecuteHandler(E.C1.IND,function(){return A.index()}),A._parser.setExecuteHandler(E.C1.NEL,function(){return A.nextLine()}),A._parser.setExecuteHandler(E.C1.HTS,function(){return A.tabSet()}),A._parser.setOscHandler(0,new u.OscHandler(function(z){A.setTitle(z),A.setIconName(z)})),A._parser.setOscHandler(1,new u.OscHandler(function(z){return A.setIconName(z)})),A._parser.setOscHandler(2,new u.OscHandler(function(z){return A.setTitle(z)})),A._parser.setEscHandler({final:"7"},function(){return A.saveCursor()}),A._parser.setEscHandler({final:"8"},function(){return A.restoreCursor()}),A._parser.setEscHandler({final:"D"},function(){return A.index()}),A._parser.setEscHandler({final:"E"},function(){return A.nextLine()}),A._parser.setEscHandler({final:"H"},function(){return A.tabSet()}),A._parser.setEscHandler({final:"M"},function(){return A.reverseIndex()}),A._parser.setEscHandler({final:"="},function(){return A.keypadApplicationMode()}),A._parser.setEscHandler({final:">"},function(){return A.keypadNumericMode()}),A._parser.setEscHandler({final:"c"},function(){return A.fullReset()}),A._parser.setEscHandler({final:"n"},function(){return A.setgLevel(2)}),A._parser.setEscHandler({final:"o"},function(){return A.setgLevel(3)}),A._parser.setEscHandler({final:"|"},function(){return A.setgLevel(3)}),A._parser.setEscHandler({final:"}"},function(){return A.setgLevel(2)}),A._parser.setEscHandler({final:"~"},function(){return A.setgLevel(1)}),A._parser.setEscHandler({intermediates:"%",final:"@"},function(){return A.selectDefaultCharset()}),A._parser.setEscHandler({intermediates:"%",final:"G"},function(){return A.selectDefaultCharset()});var K=function(z){U._parser.setEscHandler({intermediates:"(",final:z},function(){return A.selectCharset("("+z)}),U._parser.setEscHandler({intermediates:")",final:z},function(){return A.selectCharset(")"+z)}),U._parser.setEscHandler({intermediates:"*",final:z},function(){return A.selectCharset("*"+z)}),U._parser.setEscHandler({intermediates:"+",final:z},function(){return A.selectCharset("+"+z)}),U._parser.setEscHandler({intermediates:"-",final:z},function(){return A.selectCharset("-"+z)}),U._parser.setEscHandler({intermediates:".",final:z},function(){return A.selectCharset("."+z)}),U._parser.setEscHandler({intermediates:"/",final:z},function(){return A.selectCharset("/"+z)})},U=this;for(var k in b.CHARSETS)K(k);return A._parser.setEscHandler({intermediates:"#",final:"8"},function(){return A.screenAlignmentPattern()}),A._parser.setErrorHandler(function(z){return A._logService.error("Parsing error: ",z),z}),A._parser.setDcsHandler({intermediates:"$",final:"q"},new m(A._bufferService,A._coreService,A._logService,A._optionsService)),A}return M(_,C),Object.defineProperty(_.prototype,"onRequestBell",{get:function(){return this._onRequestBell.event},enumerable:!1,configurable:!0}),Object.defineProperty(_.prototype,"onRequestRefreshRows",{get:function(){return this._onRequestRefreshRows.event},enumerable:!1,configurable:!0}),Object.defineProperty(_.prototype,"onRequestReset",{get:function(){return this._onRequestReset.event},enumerable:!1,configurable:!0}),Object.defineProperty(_.prototype,"onRequestScroll",{get:function(){return this._onRequestScroll.event},enumerable:!1,configurable:!0}),Object.defineProperty(_.prototype,"onRequestSyncScrollBar",{get:function(){return this._onRequestSyncScrollBar.event},enumerable:!1,configurable:!0}),Object.defineProperty(_.prototype,"onRequestWindowsOptionsReport",{get:function(){return this._onRequestWindowsOptionsReport.event},enumerable:!1,configurable:!0}),Object.defineProperty(_.prototype,"onA11yChar",{get:function(){return this._onA11yChar.event},enumerable:!1,configurable:!0}),Object.defineProperty(_.prototype,"onA11yTab",{get:function(){return this._onA11yTab.event},enumerable:!1,configurable:!0}),Object.defineProperty(_.prototype,"onCursorMove",{get:function(){return this._onCursorMove.event},enumerable:!1,configurable:!0}),Object.defineProperty(_.prototype,"onLineFeed",{get:function(){return this._onLineFeed.event},enumerable:!1,configurable:!0}),Object.defineProperty(_.prototype,"onScroll",{get:function(){return this._onScroll.event},enumerable:!1,configurable:!0}),Object.defineProperty(_.prototype,"onTitleChange",{get:function(){return this._onTitleChange.event},enumerable:!1,configurable:!0}),_.prototype.dispose=function(){C.prototype.dispose.call(this)},_.prototype.parse=function(y){var T=this._bufferService.buffer,O=T.x,g=T.y;if(this._logService.debug("parsing data",y),this._parseBuffer.length<y.length&&this._parseBuffer.length<131072&&(this._parseBuffer=new Uint32Array(Math.min(y.length,131072))),this._dirtyRowService.clearRange(),y.length>131072)for(var F=0;F<y.length;F+=131072){var P=F+131072<y.length?F+131072:y.length,N=typeof y=="string"?this._stringDecoder.decode(y.substring(F,P),this._parseBuffer):this._utf8Decoder.decode(y.subarray(F,P),this._parseBuffer);this._parser.parse(this._parseBuffer,N)}else N=typeof y=="string"?this._stringDecoder.decode(y,this._parseBuffer):this._utf8Decoder.decode(y,this._parseBuffer),this._parser.parse(this._parseBuffer,N);(T=this._bufferService.buffer).x===O&&T.y===g||this._onCursorMove.fire(),this._onRequestRefreshRows.fire(this._dirtyRowService.start,this._dirtyRowService.end)},_.prototype.print=function(y,T,O){var g,F,P=this._bufferService.buffer,N=this._charsetService.charset,X=this._optionsService.options.screenReaderMode,j=this._bufferService.cols,A=this._coreService.decPrivateModes.wraparound,K=this._coreService.modes.insertMode,U=this._curAttrData,k=P.lines.get(P.ybase+P.y);this._dirtyRowService.markDirty(P.y),P.x&&O-T>0&&k.getWidth(P.x-1)===2&&k.setCellFromCodePoint(P.x-1,0,1,U.fg,U.bg,U.extended);for(var z=T;z<O;++z){if(g=y[z],F=this._unicodeService.wcwidth(g),g<127&&N){var te=N[String.fromCharCode(g)];te&&(g=te.charCodeAt(0))}if(X&&this._onA11yChar.fire(h.stringFromCodePoint(g)),F||!P.x){if(P.x+F-1>=j){if(A){for(;P.x<j;)k.setCellFromCodePoint(P.x++,0,1,U.fg,U.bg,U.extended);P.x=0,P.y++,P.y===P.scrollBottom+1?(P.y--,this._onRequestScroll.fire(this._eraseAttrData(),!0)):(P.y>=this._bufferService.rows&&(P.y=this._bufferService.rows-1),P.lines.get(P.ybase+P.y).isWrapped=!0),k=P.lines.get(P.ybase+P.y)}else if(P.x=j-1,F===2)continue}if(K&&(k.insertCells(P.x,F,P.getNullCell(U),U),k.getWidth(j-1)===2&&k.setCellFromCodePoint(j-1,t.NULL_CELL_CODE,t.NULL_CELL_WIDTH,U.fg,U.bg,U.extended)),k.setCellFromCodePoint(P.x++,g,F,U.fg,U.bg,U.extended),F>0)for(;--F;)k.setCellFromCodePoint(P.x++,0,0,U.fg,U.bg,U.extended)}else k.getWidth(P.x-1)?k.addCodepointToCell(P.x-1,g):k.addCodepointToCell(P.x-2,g)}O-T>0&&(k.loadCell(P.x-1,this._workCell),this._workCell.getWidth()===2||this._workCell.getCode()>65535?this._parser.precedingCodepoint=0:this._workCell.isCombined()?this._parser.precedingCodepoint=this._workCell.getChars().charCodeAt(0):this._parser.precedingCodepoint=this._workCell.content),P.x<j&&O-T>0&&k.getWidth(P.x)===0&&!k.hasContent(P.x)&&k.setCellFromCodePoint(P.x,0,1,U.fg,U.bg,U.extended),this._dirtyRowService.markDirty(P.y)},_.prototype.addCsiHandler=function(y,T){var O=this;return y.final!=="t"||y.prefix||y.intermediates?this._parser.addCsiHandler(y,T):this._parser.addCsiHandler(y,function(g){return!v(g.params[0],O._optionsService.options.windowOptions)||T(g)})},_.prototype.addDcsHandler=function(y,T){return this._parser.addDcsHandler(y,new d.DcsHandler(T))},_.prototype.addEscHandler=function(y,T){return this._parser.addEscHandler(y,T)},_.prototype.addOscHandler=function(y,T){return this._parser.addOscHandler(y,new u.OscHandler(T))},_.prototype.bell=function(){this._onRequestBell.fire()},_.prototype.lineFeed=function(){var y=this._bufferService.buffer;this._dirtyRowService.markDirty(y.y),this._optionsService.options.convertEol&&(y.x=0),y.y++,y.y===y.scrollBottom+1?(y.y--,this._onRequestScroll.fire(this._eraseAttrData())):y.y>=this._bufferService.rows&&(y.y=this._bufferService.rows-1),y.x>=this._bufferService.cols&&y.x--,this._dirtyRowService.markDirty(y.y),this._onLineFeed.fire()},_.prototype.carriageReturn=function(){this._bufferService.buffer.x=0},_.prototype.backspace=function(){var y,T=this._bufferService.buffer;if(!this._coreService.decPrivateModes.reverseWraparound)return this._restrictCursor(),void(T.x>0&&T.x--);if(this._restrictCursor(this._bufferService.cols),T.x>0)T.x--;else if(T.x===0&&T.y>T.scrollTop&&T.y<=T.scrollBottom&&((y=T.lines.get(T.ybase+T.y))===null||y===void 0?void 0:y.isWrapped)){T.lines.get(T.ybase+T.y).isWrapped=!1,T.y--,T.x=this._bufferService.cols-1;var O=T.lines.get(T.ybase+T.y);O.hasWidth(T.x)&&!O.hasContent(T.x)&&T.x--}this._restrictCursor()},_.prototype.tab=function(){if(!(this._bufferService.buffer.x>=this._bufferService.cols)){var y=this._bufferService.buffer.x;this._bufferService.buffer.x=this._bufferService.buffer.nextStop(),this._optionsService.options.screenReaderMode&&this._onA11yTab.fire(this._bufferService.buffer.x-y)}},_.prototype.shiftOut=function(){this._charsetService.setgLevel(1)},_.prototype.shiftIn=function(){this._charsetService.setgLevel(0)},_.prototype._restrictCursor=function(y){y===void 0&&(y=this._bufferService.cols-1),this._bufferService.buffer.x=Math.min(y,Math.max(0,this._bufferService.buffer.x)),this._bufferService.buffer.y=this._coreService.decPrivateModes.origin?Math.min(this._bufferService.buffer.scrollBottom,Math.max(this._bufferService.buffer.scrollTop,this._bufferService.buffer.y)):Math.min(this._bufferService.rows-1,Math.max(0,this._bufferService.buffer.y)),this._dirtyRowService.markDirty(this._bufferService.buffer.y)},_.prototype._setCursor=function(y,T){this._dirtyRowService.markDirty(this._bufferService.buffer.y),this._coreService.decPrivateModes.origin?(this._bufferService.buffer.x=y,this._bufferService.buffer.y=this._bufferService.buffer.scrollTop+T):(this._bufferService.buffer.x=y,this._bufferService.buffer.y=T),this._restrictCursor(),this._dirtyRowService.markDirty(this._bufferService.buffer.y)},_.prototype._moveCursor=function(y,T){this._restrictCursor(),this._setCursor(this._bufferService.buffer.x+y,this._bufferService.buffer.y+T)},_.prototype.cursorUp=function(y){var T=this._bufferService.buffer.y-this._bufferService.buffer.scrollTop;T>=0?this._moveCursor(0,-Math.min(T,y.params[0]||1)):this._moveCursor(0,-(y.params[0]||1))},_.prototype.cursorDown=function(y){var T=this._bufferService.buffer.scrollBottom-this._bufferService.buffer.y;T>=0?this._moveCursor(0,Math.min(T,y.params[0]||1)):this._moveCursor(0,y.params[0]||1)},_.prototype.cursorForward=function(y){this._moveCursor(y.params[0]||1,0)},_.prototype.cursorBackward=function(y){this._moveCursor(-(y.params[0]||1),0)},_.prototype.cursorNextLine=function(y){this.cursorDown(y),this._bufferService.buffer.x=0},_.prototype.cursorPrecedingLine=function(y){this.cursorUp(y),this._bufferService.buffer.x=0},_.prototype.cursorCharAbsolute=function(y){this._setCursor((y.params[0]||1)-1,this._bufferService.buffer.y)},_.prototype.cursorPosition=function(y){this._setCursor(y.length>=2?(y.params[1]||1)-1:0,(y.params[0]||1)-1)},_.prototype.charPosAbsolute=function(y){this._setCursor((y.params[0]||1)-1,this._bufferService.buffer.y)},_.prototype.hPositionRelative=function(y){this._moveCursor(y.params[0]||1,0)},_.prototype.linePosAbsolute=function(y){this._setCursor(this._bufferService.buffer.x,(y.params[0]||1)-1)},_.prototype.vPositionRelative=function(y){this._moveCursor(0,y.params[0]||1)},_.prototype.hVPosition=function(y){this.cursorPosition(y)},_.prototype.tabClear=function(y){var T=y.params[0];T===0?delete this._bufferService.buffer.tabs[this._bufferService.buffer.x]:T===3&&(this._bufferService.buffer.tabs={})},_.prototype.cursorForwardTab=function(y){if(!(this._bufferService.buffer.x>=this._bufferService.cols))for(var T=y.params[0]||1;T--;)this._bufferService.buffer.x=this._bufferService.buffer.nextStop()},_.prototype.cursorBackwardTab=function(y){if(!(this._bufferService.buffer.x>=this._bufferService.cols))for(var T=y.params[0]||1,O=this._bufferService.buffer;T--;)O.x=O.prevStop()},_.prototype._eraseInBufferLine=function(y,T,O,g){g===void 0&&(g=!1);var F=this._bufferService.buffer.lines.get(this._bufferService.buffer.ybase+y);F.replaceCells(T,O,this._bufferService.buffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),g&&(F.isWrapped=!1)},_.prototype._resetBufferLine=function(y){var T=this._bufferService.buffer.lines.get(this._bufferService.buffer.ybase+y);T.fill(this._bufferService.buffer.getNullCell(this._eraseAttrData())),T.isWrapped=!1},_.prototype.eraseInDisplay=function(y){var T;switch(this._restrictCursor(),y.params[0]){case 0:for(T=this._bufferService.buffer.y,this._dirtyRowService.markDirty(T),this._eraseInBufferLine(T++,this._bufferService.buffer.x,this._bufferService.cols,this._bufferService.buffer.x===0);T<this._bufferService.rows;T++)this._resetBufferLine(T);this._dirtyRowService.markDirty(T);break;case 1:for(T=this._bufferService.buffer.y,this._dirtyRowService.markDirty(T),this._eraseInBufferLine(T,0,this._bufferService.buffer.x+1,!0),this._bufferService.buffer.x+1>=this._bufferService.cols&&(this._bufferService.buffer.lines.get(T+1).isWrapped=!1);T--;)this._resetBufferLine(T);this._dirtyRowService.markDirty(0);break;case 2:for(T=this._bufferService.rows,this._dirtyRowService.markDirty(T-1);T--;)this._resetBufferLine(T);this._dirtyRowService.markDirty(0);break;case 3:var O=this._bufferService.buffer.lines.length-this._bufferService.rows;O>0&&(this._bufferService.buffer.lines.trimStart(O),this._bufferService.buffer.ybase=Math.max(this._bufferService.buffer.ybase-O,0),this._bufferService.buffer.ydisp=Math.max(this._bufferService.buffer.ydisp-O,0),this._onScroll.fire(0))}},_.prototype.eraseInLine=function(y){switch(this._restrictCursor(),y.params[0]){case 0:this._eraseInBufferLine(this._bufferService.buffer.y,this._bufferService.buffer.x,this._bufferService.cols);break;case 1:this._eraseInBufferLine(this._bufferService.buffer.y,0,this._bufferService.buffer.x+1);break;case 2:this._eraseInBufferLine(this._bufferService.buffer.y,0,this._bufferService.cols)}this._dirtyRowService.markDirty(this._bufferService.buffer.y)},_.prototype.insertLines=function(y){this._restrictCursor();var T=y.params[0]||1,O=this._bufferService.buffer;if(!(O.y>O.scrollBottom||O.y<O.scrollTop)){for(var g=O.ybase+O.y,F=this._bufferService.rows-1-O.scrollBottom,P=this._bufferService.rows-1+O.ybase-F+1;T--;)O.lines.splice(P-1,1),O.lines.splice(g,0,O.getBlankLine(this._eraseAttrData()));this._dirtyRowService.markRangeDirty(O.y,O.scrollBottom),O.x=0}},_.prototype.deleteLines=function(y){this._restrictCursor();var T=y.params[0]||1,O=this._bufferService.buffer;if(!(O.y>O.scrollBottom||O.y<O.scrollTop)){var g,F=O.ybase+O.y;for(g=this._bufferService.rows-1-O.scrollBottom,g=this._bufferService.rows-1+O.ybase-g;T--;)O.lines.splice(F,1),O.lines.splice(g,0,O.getBlankLine(this._eraseAttrData()));this._dirtyRowService.markRangeDirty(O.y,O.scrollBottom),O.x=0}},_.prototype.insertChars=function(y){this._restrictCursor();var T=this._bufferService.buffer.lines.get(this._bufferService.buffer.ybase+this._bufferService.buffer.y);T&&(T.insertCells(this._bufferService.buffer.x,y.params[0]||1,this._bufferService.buffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),this._dirtyRowService.markDirty(this._bufferService.buffer.y))},_.prototype.deleteChars=function(y){this._restrictCursor();var T=this._bufferService.buffer.lines.get(this._bufferService.buffer.ybase+this._bufferService.buffer.y);T&&(T.deleteCells(this._bufferService.buffer.x,y.params[0]||1,this._bufferService.buffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),this._dirtyRowService.markDirty(this._bufferService.buffer.y))},_.prototype.scrollUp=function(y){for(var T=y.params[0]||1,O=this._bufferService.buffer;T--;)O.lines.splice(O.ybase+O.scrollTop,1),O.lines.splice(O.ybase+O.scrollBottom,0,O.getBlankLine(this._eraseAttrData()));this._dirtyRowService.markRangeDirty(O.scrollTop,O.scrollBottom)},_.prototype.scrollDown=function(y){for(var T=y.params[0]||1,O=this._bufferService.buffer;T--;)O.lines.splice(O.ybase+O.scrollBottom,1),O.lines.splice(O.ybase+O.scrollTop,0,O.getBlankLine(n.DEFAULT_ATTR_DATA));this._dirtyRowService.markRangeDirty(O.scrollTop,O.scrollBottom)},_.prototype.scrollLeft=function(y){var T=this._bufferService.buffer;if(!(T.y>T.scrollBottom||T.y<T.scrollTop)){for(var O=y.params[0]||1,g=T.scrollTop;g<=T.scrollBottom;++g){var F=T.lines.get(T.ybase+g);F.deleteCells(0,O,T.getNullCell(this._eraseAttrData()),this._eraseAttrData()),F.isWrapped=!1}this._dirtyRowService.markRangeDirty(T.scrollTop,T.scrollBottom)}},_.prototype.scrollRight=function(y){var T=this._bufferService.buffer;if(!(T.y>T.scrollBottom||T.y<T.scrollTop)){for(var O=y.params[0]||1,g=T.scrollTop;g<=T.scrollBottom;++g){var F=T.lines.get(T.ybase+g);F.insertCells(0,O,T.getNullCell(this._eraseAttrData()),this._eraseAttrData()),F.isWrapped=!1}this._dirtyRowService.markRangeDirty(T.scrollTop,T.scrollBottom)}},_.prototype.insertColumns=function(y){var T=this._bufferService.buffer;if(!(T.y>T.scrollBottom||T.y<T.scrollTop)){for(var O=y.params[0]||1,g=T.scrollTop;g<=T.scrollBottom;++g){var F=this._bufferService.buffer.lines.get(T.ybase+g);F.insertCells(T.x,O,T.getNullCell(this._eraseAttrData()),this._eraseAttrData()),F.isWrapped=!1}this._dirtyRowService.markRangeDirty(T.scrollTop,T.scrollBottom)}},_.prototype.deleteColumns=function(y){var T=this._bufferService.buffer;if(!(T.y>T.scrollBottom||T.y<T.scrollTop)){for(var O=y.params[0]||1,g=T.scrollTop;g<=T.scrollBottom;++g){var F=T.lines.get(T.ybase+g);F.deleteCells(T.x,O,T.getNullCell(this._eraseAttrData()),this._eraseAttrData()),F.isWrapped=!1}this._dirtyRowService.markRangeDirty(T.scrollTop,T.scrollBottom)}},_.prototype.eraseChars=function(y){this._restrictCursor();var T=this._bufferService.buffer.lines.get(this._bufferService.buffer.ybase+this._bufferService.buffer.y);T&&(T.replaceCells(this._bufferService.buffer.x,this._bufferService.buffer.x+(y.params[0]||1),this._bufferService.buffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),this._dirtyRowService.markDirty(this._bufferService.buffer.y))},_.prototype.repeatPrecedingCharacter=function(y){if(this._parser.precedingCodepoint){for(var T=y.params[0]||1,O=new Uint32Array(T),g=0;g<T;++g)O[g]=this._parser.precedingCodepoint;this.print(O,0,O.length)}},_.prototype.sendDeviceAttributesPrimary=function(y){y.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(E.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(E.C0.ESC+"[?6c"))},_.prototype.sendDeviceAttributesSecondary=function(y){y.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(E.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(E.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(y.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(E.C0.ESC+"[>83;40003;0c"))},_.prototype._is=function(y){return(this._optionsService.options.termName+"").indexOf(y)===0},_.prototype.setMode=function(y){for(var T=0;T<y.length;T++)switch(y.params[T]){case 4:this._coreService.modes.insertMode=!0}},_.prototype.setModePrivate=function(y){for(var T=0;T<y.length;T++)switch(y.params[T]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,b.DEFAULT_CHARSET),this._charsetService.setgCharset(1,b.DEFAULT_CHARSET),this._charsetService.setgCharset(2,b.DEFAULT_CHARSET),this._charsetService.setgCharset(3,b.DEFAULT_CHARSET);break;case 3:this._optionsService.options.windowOptions.setWinLines&&(this._bufferService.resize(132,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!0,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!0;break;case 12:break;case 45:this._coreService.decPrivateModes.reverseWraparound=!0;break;case 66:this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire();break;case 9:this._coreMouseService.activeProtocol="X10";break;case 1e3:this._coreMouseService.activeProtocol="VT200";break;case 1002:this._coreMouseService.activeProtocol="DRAG";break;case 1003:this._coreMouseService.activeProtocol="ANY";break;case 1004:this._coreService.decPrivateModes.sendFocus=!0;break;case 1005:this._logService.debug("DECSET 1005 not supported (see #2507)");break;case 1006:this._coreMouseService.activeEncoding="SGR";break;case 1015:this._logService.debug("DECSET 1015 not supported (see #2507)");break;case 25:this._coreService.isCursorHidden=!1;break;case 1048:this.saveCursor();break;case 1049:this.saveCursor();case 47:case 1047:this._bufferService.buffers.activateAltBuffer(this._eraseAttrData()),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!0}},_.prototype.resetMode=function(y){for(var T=0;T<y.length;T++)switch(y.params[T]){case 4:this._coreService.modes.insertMode=!1}},_.prototype.resetModePrivate=function(y){for(var T=0;T<y.length;T++)switch(y.params[T]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!1;break;case 3:this._optionsService.options.windowOptions.setWinLines&&(this._bufferService.resize(80,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!1,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!1;break;case 12:break;case 45:this._coreService.decPrivateModes.reverseWraparound=!1;break;case 66:this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire();break;case 9:case 1e3:case 1002:case 1003:this._coreMouseService.activeProtocol="NONE";break;case 1004:this._coreService.decPrivateModes.sendFocus=!1;break;case 1005:this._logService.debug("DECRST 1005 not supported (see #2507)");break;case 1006:this._coreMouseService.activeEncoding="DEFAULT";break;case 1015:this._logService.debug("DECRST 1015 not supported (see #2507)");break;case 25:this._coreService.isCursorHidden=!0;break;case 1048:this.restoreCursor();break;case 1049:case 47:case 1047:this._bufferService.buffers.activateNormalBuffer(),y.params[T]===1049&&this.restoreCursor(),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!1}},_.prototype._updateAttrColor=function(y,T,O,g,F){return T===2?(y|=50331648,y&=-16777216,y|=s.AttributeData.fromColorRGB([O,g,F])):T===5&&(y&=-50331904,y|=33554432|255&O),y},_.prototype._extractColor=function(y,T,O){var g=[0,0,-1,0,0,0],F=0,P=0;do{if(g[P+F]=y.params[T+P],y.hasSubParams(T+P)){var N=y.getSubParams(T+P),X=0;do g[1]===5&&(F=1),g[P+X+1+F]=N[X];while(++X<N.length&&X+P+1+F<g.length);break}if(g[1]===5&&P+F>=2||g[1]===2&&P+F>=5)break;g[1]&&(F=1)}while(++P+T<y.length&&P+F<g.length);for(X=2;X<g.length;++X)g[X]===-1&&(g[X]=0);switch(g[0]){case 38:O.fg=this._updateAttrColor(O.fg,g[1],g[3],g[4],g[5]);break;case 48:O.bg=this._updateAttrColor(O.bg,g[1],g[3],g[4],g[5]);break;case 58:O.extended=O.extended.clone(),O.extended.underlineColor=this._updateAttrColor(O.extended.underlineColor,g[1],g[3],g[4],g[5])}return P},_.prototype._processUnderline=function(y,T){T.extended=T.extended.clone(),(!~y||y>5)&&(y=1),T.extended.underlineStyle=y,T.fg|=268435456,y===0&&(T.fg&=-268435457),T.updateExtended()},_.prototype.charAttributes=function(y){if(y.length===1&&y.params[0]===0)return this._curAttrData.fg=n.DEFAULT_ATTR_DATA.fg,void(this._curAttrData.bg=n.DEFAULT_ATTR_DATA.bg);for(var T,O=y.length,g=this._curAttrData,F=0;F<O;F++)(T=y.params[F])>=30&&T<=37?(g.fg&=-50331904,g.fg|=16777216|T-30):T>=40&&T<=47?(g.bg&=-50331904,g.bg|=16777216|T-40):T>=90&&T<=97?(g.fg&=-50331904,g.fg|=16777224|T-90):T>=100&&T<=107?(g.bg&=-50331904,g.bg|=16777224|T-100):T===0?(g.fg=n.DEFAULT_ATTR_DATA.fg,g.bg=n.DEFAULT_ATTR_DATA.bg):T===1?g.fg|=134217728:T===3?g.bg|=67108864:T===4?(g.fg|=268435456,this._processUnderline(y.hasSubParams(F)?y.getSubParams(F)[0]:1,g)):T===5?g.fg|=536870912:T===7?g.fg|=67108864:T===8?g.fg|=1073741824:T===2?g.bg|=134217728:T===21?this._processUnderline(2,g):T===22?(g.fg&=-134217729,g.bg&=-134217729):T===23?g.bg&=-67108865:T===24?g.fg&=-268435457:T===25?g.fg&=-536870913:T===27?g.fg&=-67108865:T===28?g.fg&=-1073741825:T===39?(g.fg&=-67108864,g.fg|=16777215&n.DEFAULT_ATTR_DATA.fg):T===49?(g.bg&=-67108864,g.bg|=16777215&n.DEFAULT_ATTR_DATA.bg):T===38||T===48||T===58?F+=this._extractColor(y,F,g):T===59?(g.extended=g.extended.clone(),g.extended.underlineColor=-1,g.updateExtended()):T===100?(g.fg&=-67108864,g.fg|=16777215&n.DEFAULT_ATTR_DATA.fg,g.bg&=-67108864,g.bg|=16777215&n.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",T)},_.prototype.deviceStatus=function(y){switch(y.params[0]){case 5:this._coreService.triggerDataEvent(E.C0.ESC+"[0n");break;case 6:var T=this._bufferService.buffer.y+1,O=this._bufferService.buffer.x+1;this._coreService.triggerDataEvent(E.C0.ESC+"["+T+";"+O+"R")}},_.prototype.deviceStatusPrivate=function(y){switch(y.params[0]){case 6:var T=this._bufferService.buffer.y+1,O=this._bufferService.buffer.x+1;this._coreService.triggerDataEvent(E.C0.ESC+"[?"+T+";"+O+"R")}},_.prototype.softReset=function(y){this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._bufferService.buffer.scrollTop=0,this._bufferService.buffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=n.DEFAULT_ATTR_DATA.clone(),this._coreService.reset(),this._charsetService.reset(),this._bufferService.buffer.savedX=0,this._bufferService.buffer.savedY=this._bufferService.buffer.ybase,this._bufferService.buffer.savedCurAttrData.fg=this._curAttrData.fg,this._bufferService.buffer.savedCurAttrData.bg=this._curAttrData.bg,this._bufferService.buffer.savedCharset=this._charsetService.charset,this._coreService.decPrivateModes.origin=!1},_.prototype.setCursorStyle=function(y){var T=y.params[0]||1;switch(T){case 1:case 2:this._optionsService.options.cursorStyle="block";break;case 3:case 4:this._optionsService.options.cursorStyle="underline";break;case 5:case 6:this._optionsService.options.cursorStyle="bar"}var O=T%2==1;this._optionsService.options.cursorBlink=O},_.prototype.setScrollRegion=function(y){var T,O=y.params[0]||1;(y.length<2||(T=y.params[1])>this._bufferService.rows||T===0)&&(T=this._bufferService.rows),T>O&&(this._bufferService.buffer.scrollTop=O-1,this._bufferService.buffer.scrollBottom=T-1,this._setCursor(0,0))},_.prototype.windowOptions=function(y){if(v(y.params[0],this._optionsService.options.windowOptions)){var T=y.length>1?y.params[1]:0;switch(y.params[0]){case 14:T!==2&&this._onRequestWindowsOptionsReport.fire(p.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(p.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(E.C0.ESC+"[8;"+this._bufferService.rows+";"+this._bufferService.cols+"t");break;case 22:T!==0&&T!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),T!==0&&T!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:T!==0&&T!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),T!==0&&T!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}}},_.prototype.saveCursor=function(y){this._bufferService.buffer.savedX=this._bufferService.buffer.x,this._bufferService.buffer.savedY=this._bufferService.buffer.ybase+this._bufferService.buffer.y,this._bufferService.buffer.savedCurAttrData.fg=this._curAttrData.fg,this._bufferService.buffer.savedCurAttrData.bg=this._curAttrData.bg,this._bufferService.buffer.savedCharset=this._charsetService.charset},_.prototype.restoreCursor=function(y){this._bufferService.buffer.x=this._bufferService.buffer.savedX||0,this._bufferService.buffer.y=Math.max(this._bufferService.buffer.savedY-this._bufferService.buffer.ybase,0),this._curAttrData.fg=this._bufferService.buffer.savedCurAttrData.fg,this._curAttrData.bg=this._bufferService.buffer.savedCurAttrData.bg,this._charsetService.charset=this._savedCharset,this._bufferService.buffer.savedCharset&&(this._charsetService.charset=this._bufferService.buffer.savedCharset),this._restrictCursor()},_.prototype.setTitle=function(y){this._windowTitle=y,this._onTitleChange.fire(y)},_.prototype.setIconName=function(y){this._iconName=y},_.prototype.nextLine=function(){this._bufferService.buffer.x=0,this.index()},_.prototype.keypadApplicationMode=function(){this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire()},_.prototype.keypadNumericMode=function(){this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire()},_.prototype.selectDefaultCharset=function(){this._charsetService.setgLevel(0),this._charsetService.setgCharset(0,b.DEFAULT_CHARSET)},_.prototype.selectCharset=function(y){y.length===2?y[0]!=="/"&&this._charsetService.setgCharset(f[y[0]],b.CHARSETS[y[1]]||b.DEFAULT_CHARSET):this.selectDefaultCharset()},_.prototype.index=function(){this._restrictCursor();var y=this._bufferService.buffer;this._bufferService.buffer.y++,y.y===y.scrollBottom+1?(y.y--,this._onRequestScroll.fire(this._eraseAttrData())):y.y>=this._bufferService.rows&&(y.y=this._bufferService.rows-1),this._restrictCursor()},_.prototype.tabSet=function(){this._bufferService.buffer.tabs[this._bufferService.buffer.x]=!0},_.prototype.reverseIndex=function(){this._restrictCursor();var y=this._bufferService.buffer;if(y.y===y.scrollTop){var T=y.scrollBottom-y.scrollTop;y.lines.shiftElements(y.ybase+y.y,T,1),y.lines.set(y.ybase+y.y,y.getBlankLine(this._eraseAttrData())),this._dirtyRowService.markRangeDirty(y.scrollTop,y.scrollBottom)}else y.y--,this._restrictCursor()},_.prototype.fullReset=function(){this._parser.reset(),this._onRequestReset.fire()},_.prototype.reset=function(){this._curAttrData=n.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=n.DEFAULT_ATTR_DATA.clone()},_.prototype._eraseAttrData=function(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal},_.prototype.setgLevel=function(y){this._charsetService.setgLevel(y)},_.prototype.screenAlignmentPattern=function(){var y=new r.CellData;y.content=1<<22|"E".charCodeAt(0),y.fg=this._curAttrData.fg,y.bg=this._curAttrData.bg;var T=this._bufferService.buffer;this._setCursor(0,0);for(var O=0;O<this._bufferService.rows;++O){var g=T.ybase+T.y+O,F=T.lines.get(g);F&&(F.fill(y),F.isWrapped=!1)}this._dirtyRowService.markAllDirty(),this._setCursor(0,0)},_}(c.Disposable);L.InputHandler=S},function(G,L,I){"use strict";Object.defineProperty(L,"__esModule",{value:!0}),L.DEFAULT_CHARSET=L.CHARSETS=void 0,L.CHARSETS={},L.DEFAULT_CHARSET=L.CHARSETS.B,L.CHARSETS[0]={"`":"\u25C6",a:"\u2592",b:"\u2409",c:"\u240C",d:"\u240D",e:"\u240A",f:"\xB0",g:"\xB1",h:"\u2424",i:"\u240B",j:"\u2518",k:"\u2510",l:"\u250C",m:"\u2514",n:"\u253C",o:"\u23BA",p:"\u23BB",q:"\u2500",r:"\u23BC",s:"\u23BD",t:"\u251C",u:"\u2524",v:"\u2534",w:"\u252C",x:"\u2502",y:"\u2264",z:"\u2265","{":"\u03C0","|":"\u2260","}":"\xA3","~":"\xB7"},L.CHARSETS.A={"#":"\xA3"},L.CHARSETS.B=void 0,L.CHARSETS[4]={"#":"\xA3","@":"\xBE","[":"ij","\\":"\xBD","]":"|","{":"\xA8","|":"f","}":"\xBC","~":"\xB4"},L.CHARSETS.C=L.CHARSETS[5]={"[":"\xC4","\\":"\xD6","]":"\xC5","^":"\xDC","`":"\xE9","{":"\xE4","|":"\xF6","}":"\xE5","~":"\xFC"},L.CHARSETS.R={"#":"\xA3","@":"\xE0","[":"\xB0","\\":"\xE7","]":"\xA7","{":"\xE9","|":"\xF9","}":"\xE8","~":"\xA8"},L.CHARSETS.Q={"@":"\xE0","[":"\xE2","\\":"\xE7","]":"\xEA","^":"\xEE","`":"\xF4","{":"\xE9","|":"\xF9","}":"\xE8","~":"\xFB"},L.CHARSETS.K={"@":"\xA7","[":"\xC4","\\":"\xD6","]":"\xDC","{":"\xE4","|":"\xF6","}":"\xFC","~":"\xDF"},L.CHARSETS.Y={"#":"\xA3","@":"\xA7","[":"\xB0","\\":"\xE7","]":"\xE9","`":"\xF9","{":"\xE0","|":"\xF2","}":"\xE8","~":"\xEC"},L.CHARSETS.E=L.CHARSETS[6]={"@":"\xC4","[":"\xC6","\\":"\xD8","]":"\xC5","^":"\xDC","`":"\xE4","{":"\xE6","|":"\xF8","}":"\xE5","~":"\xFC"},L.CHARSETS.Z={"#":"\xA3","@":"\xA7","[":"\xA1","\\":"\xD1","]":"\xBF","{":"\xB0","|":"\xF1","}":"\xE7"},L.CHARSETS.H=L.CHARSETS[7]={"@":"\xC9","[":"\xC4","\\":"\xD6","]":"\xC5","^":"\xDC","`":"\xE9","{":"\xE4","|":"\xF6","}":"\xE5","~":"\xFC"},L.CHARSETS["="]={"#":"\xF9","@":"\xE0","[":"\xE9","\\":"\xE7","]":"\xEA","^":"\xEE",_:"\xE8","`":"\xF4","{":"\xE4","|":"\xF6","}":"\xFC","~":"\xFB"}},function(G,L,I){"use strict";Object.defineProperty(L,"__esModule",{value:!0}),L.Params=void 0;var R=function(){function M(p,E){if(p===void 0&&(p=32),E===void 0&&(E=32),this.maxLength=p,this.maxSubParamsLength=E,E>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(p),this.length=0,this._subParams=new Int32Array(E),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(p),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}return M.fromArray=function(p){var E=new M;if(!p.length)return E;for(var b=p[0]instanceof Array?1:0;b<p.length;++b){var i=p[b];if(i instanceof Array)for(var c=0;c<i.length;++c)E.addSubParam(i[c]);else E.addParam(i)}return E},M.prototype.clone=function(){var p=new M(this.maxLength,this.maxSubParamsLength);return p.params.set(this.params),p.length=this.length,p._subParams.set(this._subParams),p._subParamsLength=this._subParamsLength,p._subParamsIdx.set(this._subParamsIdx),p._rejectDigits=this._rejectDigits,p._rejectSubDigits=this._rejectSubDigits,p._digitIsSub=this._digitIsSub,p},M.prototype.toArray=function(){for(var p=[],E=0;E<this.length;++E){p.push(this.params[E]);var b=this._subParamsIdx[E]>>8,i=255&this._subParamsIdx[E];i-b>0&&p.push(Array.prototype.slice.call(this._subParams,b,i))}return p},M.prototype.reset=function(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1},M.prototype.addParam=function(p){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(p<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=p>2147483647?2147483647:p}},M.prototype.addSubParam=function(p){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(p<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=p>2147483647?2147483647:p,this._subParamsIdx[this.length-1]++}},M.prototype.hasSubParams=function(p){return(255&this._subParamsIdx[p])-(this._subParamsIdx[p]>>8)>0},M.prototype.getSubParams=function(p){var E=this._subParamsIdx[p]>>8,b=255&this._subParamsIdx[p];return b-E>0?this._subParams.subarray(E,b):null},M.prototype.getSubParamsAll=function(){for(var p={},E=0;E<this.length;++E){var b=this._subParamsIdx[E]>>8,i=255&this._subParamsIdx[E];i-b>0&&(p[E]=this._subParams.slice(b,i))}return p},M.prototype.addDigit=function(p){var E;if(!(this._rejectDigits||!(E=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)){var b=this._digitIsSub?this._subParams:this.params,i=b[E-1];b[E-1]=~i?Math.min(10*i+p,2147483647):p}},M}();L.Params=R},function(G,L,I){"use strict";Object.defineProperty(L,"__esModule",{value:!0}),L.OscHandler=L.OscParser=void 0;var R=I(23),M=I(8),p=function(){function b(){this._state=0,this._id=-1,this._handlers=Object.create(null),this._handlerFb=function(){}}return b.prototype.addHandler=function(i,c){this._handlers[i]===void 0&&(this._handlers[i]=[]);var o=this._handlers[i];return o.push(c),{dispose:function(){var h=o.indexOf(c);h!==-1&&o.splice(h,1)}}},b.prototype.setHandler=function(i,c){this._handlers[i]=[c]},b.prototype.clearHandler=function(i){this._handlers[i]&&delete this._handlers[i]},b.prototype.setHandlerFallback=function(i){this._handlerFb=i},b.prototype.dispose=function(){this._handlers=Object.create(null),this._handlerFb=function(){}},b.prototype.reset=function(){this._state===2&&this.end(!1),this._id=-1,this._state=0},b.prototype._start=function(){var i=this._handlers[this._id];if(i)for(var c=i.length-1;c>=0;c--)i[c].start();else this._handlerFb(this._id,"START")},b.prototype._put=function(i,c,o){var h=this._handlers[this._id];if(h)for(var n=h.length-1;n>=0;n--)h[n].put(i,c,o);else this._handlerFb(this._id,"PUT",M.utf32ToString(i,c,o))},b.prototype._end=function(i){var c=this._handlers[this._id];if(c){for(var o=c.length-1;o>=0&&c[o].end(i)===!1;o--);for(o--;o>=0;o--)c[o].end(!1)}else this._handlerFb(this._id,"END",i)},b.prototype.start=function(){this.reset(),this._id=-1,this._state=1},b.prototype.put=function(i,c,o){if(this._state!==3){if(this._state===1)for(;c<o;){var h=i[c++];if(h===59){this._state=2,this._start();break}if(h<48||57<h)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+h-48}this._state===2&&o-c>0&&this._put(i,c,o)}},b.prototype.end=function(i){this._state!==0&&(this._state!==3&&(this._state===1&&this._start(),this._end(i)),this._id=-1,this._state=0)},b}();L.OscParser=p;var E=function(){function b(i){this._handler=i,this._data="",this._hitLimit=!1}return b.prototype.start=function(){this._data="",this._hitLimit=!1},b.prototype.put=function(i,c,o){this._hitLimit||(this._data+=M.utf32ToString(i,c,o),this._data.length>R.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))},b.prototype.end=function(i){var c;return this._hitLimit?c=!1:i&&(c=this._handler(this._data)),this._data="",this._hitLimit=!1,c},b}();L.OscHandler=E},function(G,L,I){"use strict";Object.defineProperty(L,"__esModule",{value:!0}),L.PAYLOAD_LIMIT=void 0,L.PAYLOAD_LIMIT=1e7},function(G,L,I){"use strict";Object.defineProperty(L,"__esModule",{value:!0}),L.DcsHandler=L.DcsParser=void 0;var R=I(8),M=I(21),p=I(23),E=[],b=function(){function c(){this._handlers=Object.create(null),this._active=E,this._ident=0,this._handlerFb=function(){}}return c.prototype.dispose=function(){this._handlers=Object.create(null),this._handlerFb=function(){}},c.prototype.addHandler=function(o,h){this._handlers[o]===void 0&&(this._handlers[o]=[]);var n=this._handlers[o];return n.push(h),{dispose:function(){var a=n.indexOf(h);a!==-1&&n.splice(a,1)}}},c.prototype.setHandler=function(o,h){this._handlers[o]=[h]},c.prototype.clearHandler=function(o){this._handlers[o]&&delete this._handlers[o]},c.prototype.setHandlerFallback=function(o){this._handlerFb=o},c.prototype.reset=function(){this._active.length&&this.unhook(!1),this._active=E,this._ident=0},c.prototype.hook=function(o,h){if(this.reset(),this._ident=o,this._active=this._handlers[o]||E,this._active.length)for(var n=this._active.length-1;n>=0;n--)this._active[n].hook(h);else this._handlerFb(this._ident,"HOOK",h)},c.prototype.put=function(o,h,n){if(this._active.length)for(var a=this._active.length-1;a>=0;a--)this._active[a].put(o,h,n);else this._handlerFb(this._ident,"PUT",R.utf32ToString(o,h,n))},c.prototype.unhook=function(o){if(this._active.length){for(var h=this._active.length-1;h>=0&&this._active[h].unhook(o)===!1;h--);for(h--;h>=0;h--)this._active[h].unhook(!1)}else this._handlerFb(this._ident,"UNHOOK",o);this._active=E,this._ident=0},c}();L.DcsParser=b;var i=function(){function c(o){this._handler=o,this._data="",this._hitLimit=!1}return c.prototype.hook=function(o){this._params=o.clone(),this._data="",this._hitLimit=!1},c.prototype.put=function(o,h,n){this._hitLimit||(this._data+=R.utf32ToString(o,h,n),this._data.length>p.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))},c.prototype.unhook=function(o){var h;return this._hitLimit?h=!1:o&&(h=this._handler(this._data,this._params||new M.Params)),this._params=void 0,this._data="",this._hitLimit=!1,h},c}();L.DcsHandler=i},function(G,L,I){"use strict";Object.defineProperty(L,"__esModule",{value:!0}),L.removeTerminalFromCache=L.acquireCharAtlas=void 0;var R=I(26),M=I(43),p=[];L.acquireCharAtlas=function(E,b,i,c,o){for(var h=R.generateConfig(c,o,E,i),n=0;n<p.length;n++){var a=(t=p[n]).ownedBy.indexOf(b);if(a>=0){if(R.configEquals(t.config,h))return t.atlas;t.ownedBy.length===1?(t.atlas.dispose(),p.splice(n,1)):t.ownedBy.splice(a,1);break}}for(n=0;n<p.length;n++){var t=p[n];if(R.configEquals(t.config,h))return t.ownedBy.push(b),t.atlas}var r={atlas:new M.DynamicCharAtlas(document,h),config:h,ownedBy:[b]};return p.push(r),r.atlas},L.removeTerminalFromCache=function(E){for(var b=0;b<p.length;b++){var i=p[b].ownedBy.indexOf(E);if(i!==-1){p[b].ownedBy.length===1?(p[b].atlas.dispose(),p.splice(b,1)):p[b].ownedBy.splice(i,1);break}}}},function(G,L,I){"use strict";Object.defineProperty(L,"__esModule",{value:!0}),L.is256Color=L.configEquals=L.generateConfig=void 0;var R=I(3);L.generateConfig=function(M,p,E,b){var i={foreground:b.foreground,background:b.background,cursor:void 0,cursorAccent:void 0,selection:void 0,ansi:b.ansi.slice(0,16)};return{devicePixelRatio:window.devicePixelRatio,scaledCharWidth:M,scaledCharHeight:p,fontFamily:E.fontFamily,fontSize:E.fontSize,fontWeight:E.fontWeight,fontWeightBold:E.fontWeightBold,allowTransparency:E.allowTransparency,colors:i}},L.configEquals=function(M,p){for(var E=0;E<M.colors.ansi.length;E++)if(M.colors.ansi[E].rgba!==p.colors.ansi[E].rgba)return!1;return M.devicePixelRatio===p.devicePixelRatio&&M.fontFamily===p.fontFamily&&M.fontSize===p.fontSize&&M.fontWeight===p.fontWeight&&M.fontWeightBold===p.fontWeightBold&&M.allowTransparency===p.allowTransparency&&M.scaledCharWidth===p.scaledCharWidth&&M.scaledCharHeight===p.scaledCharHeight&&M.colors.foreground===p.colors.foreground&&M.colors.background===p.colors.background},L.is256Color=function(M){return M<R.DEFAULT_COLOR}},function(G,L,I){"use strict";Object.defineProperty(L,"__esModule",{value:!0}),L.ColorManager=L.DEFAULT_ANSI_COLORS=void 0;var R=I(10),M=I(45),p=R.css.toColor("#ffffff"),E=R.css.toColor("#000000"),b=R.css.toColor("#ffffff"),i=R.css.toColor("#000000"),c={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};L.DEFAULT_ANSI_COLORS=function(){for(var h=[R.css.toColor("#2e3436"),R.css.toColor("#cc0000"),R.css.toColor("#4e9a06"),R.css.toColor("#c4a000"),R.css.toColor("#3465a4"),R.css.toColor("#75507b"),R.css.toColor("#06989a"),R.css.toColor("#d3d7cf"),R.css.toColor("#555753"),R.css.toColor("#ef2929"),R.css.toColor("#8ae234"),R.css.toColor("#fce94f"),R.css.toColor("#729fcf"),R.css.toColor("#ad7fa8"),R.css.toColor("#34e2e2"),R.css.toColor("#eeeeec")],n=[0,95,135,175,215,255],a=0;a<216;a++){var t=n[a/36%6|0],r=n[a/6%6|0],s=n[a%6];h.push({css:R.channels.toCss(t,r,s),rgba:R.channels.toRgba(t,r,s)})}for(a=0;a<24;a++){var u=8+10*a;h.push({css:R.channels.toCss(u,u,u),rgba:R.channels.toRgba(u,u,u)})}return h}();var o=function(){function h(n,a){this.allowTransparency=a;var t=n.createElement("canvas");t.width=1,t.height=1;var r=t.getContext("2d");if(!r)throw new Error("Could not get rendering context");this._ctx=r,this._ctx.globalCompositeOperation="copy",this._litmusColor=this._ctx.createLinearGradient(0,0,1,1),this._contrastCache=new M.ColorContrastCache,this.colors={foreground:p,background:E,cursor:b,cursorAccent:i,selectionTransparent:c,selectionOpaque:R.color.blend(E,c),ansi:L.DEFAULT_ANSI_COLORS.slice(),contrastCache:this._contrastCache}}return h.prototype.onOptionsChange=function(n){n==="minimumContrastRatio"&&this._contrastCache.clear()},h.prototype.setTheme=function(n){(n===void 0&&(n={}),this.colors.foreground=this._parseColor(n.foreground,p),this.colors.background=this._parseColor(n.background,E),this.colors.cursor=this._parseColor(n.cursor,b,!0),this.colors.cursorAccent=this._parseColor(n.cursorAccent,i,!0),this.colors.selectionTransparent=this._parseColor(n.selection,c,!0),this.colors.selectionOpaque=R.color.blend(this.colors.background,this.colors.selectionTransparent),R.color.isOpaque(this.colors.selectionTransparent))&&(this.colors.selectionTransparent=R.color.opacity(this.colors.selectionTransparent,.3)),this.colors.ansi[0]=this._parseColor(n.black,L.DEFAULT_ANSI_COLORS[0]),this.colors.ansi[1]=this._parseColor(n.red,L.DEFAULT_ANSI_COLORS[1]),this.colors.ansi[2]=this._parseColor(n.green,L.DEFAULT_ANSI_COLORS[2]),this.colors.ansi[3]=this._parseColor(n.yellow,L.DEFAULT_ANSI_COLORS[3]),this.colors.ansi[4]=this._parseColor(n.blue,L.DEFAULT_ANSI_COLORS[4]),this.colors.ansi[5]=this._parseColor(n.magenta,L.DEFAULT_ANSI_COLORS[5]),this.colors.ansi[6]=this._parseColor(n.cyan,L.DEFAULT_ANSI_COLORS[6]),this.colors.ansi[7]=this._parseColor(n.white,L.DEFAULT_ANSI_COLORS[7]),this.colors.ansi[8]=this._parseColor(n.brightBlack,L.DEFAULT_ANSI_COLORS[8]),this.colors.ansi[9]=this._parseColor(n.brightRed,L.DEFAULT_ANSI_COLORS[9]),this.colors.ansi[10]=this._parseColor(n.brightGreen,L.DEFAULT_ANSI_COLORS[10]),this.colors.ansi[11]=this._parseColor(n.brightYellow,L.DEFAULT_ANSI_COLORS[11]),this.colors.ansi[12]=this._parseColor(n.brightBlue,L.DEFAULT_ANSI_COLORS[12]),this.colors.ansi[13]=this._parseColor(n.brightMagenta,L.DEFAULT_ANSI_COLORS[13]),this.colors.ansi[14]=this._parseColor(n.brightCyan,L.DEFAULT_ANSI_COLORS[14]),this.colors.ansi[15]=this._parseColor(n.brightWhite,L.DEFAULT_ANSI_COLORS[15]),this._contrastCache.clear()},h.prototype._parseColor=function(n,a,t){if(t===void 0&&(t=this.allowTransparency),n===void 0)return a;if(this._ctx.fillStyle=this._litmusColor,this._ctx.fillStyle=n,typeof this._ctx.fillStyle!="string")return console.warn("Color: "+n+" is invalid using fallback "+a.css),a;this._ctx.fillRect(0,0,1,1);var r=this._ctx.getImageData(0,0,1,1).data;if(r[3]!==255){if(!t)return console.warn("Color: "+n+" is using transparency, but allowTransparency is false. Using fallback "+a.css+"."),a;var s=this._ctx.fillStyle.substring(5,this._ctx.fillStyle.length-1).split(",").map(function(S){return Number(S)}),u=s[0],d=s[1],f=s[2],v=s[3],m=Math.round(255*v);return{rgba:R.channels.toRgba(u,d,f,m),css:n}}return{css:this._ctx.fillStyle,rgba:R.channels.toRgba(r[0],r[1],r[2],r[3])}},h}();L.ColorManager=o},function(G,L,I){"use strict";Object.defineProperty(L,"__esModule",{value:!0}),L.throwIfFalsy=void 0,L.throwIfFalsy=function(R){if(!R)throw new Error("value must not be falsy");return R}},function(G,L,I){"use strict";var R,M=this&&this.__extends||(R=function(o,h){return(R=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,a){n.__proto__=a}||function(n,a){for(var t in a)a.hasOwnProperty(t)&&(n[t]=a[t])})(o,h)},function(o,h){function n(){this.constructor=o}R(o,h),o.prototype=h===null?Object.create(h):(n.prototype=h.prototype,new n)});Object.defineProperty(L,"__esModule",{value:!0}),L.CharacterJoinerRegistry=L.JoinedCellData=void 0;var p=I(6),E=I(3),b=I(4),i=function(o){function h(n,a,t){var r=o.call(this)||this;return r.content=0,r.combinedData="",r.fg=n.fg,r.bg=n.bg,r.combinedData=a,r._width=t,r}return M(h,o),h.prototype.isCombined=function(){return 2097152},h.prototype.getWidth=function(){return this._width},h.prototype.getChars=function(){return this.combinedData},h.prototype.getCode=function(){return 2097151},h.prototype.setFromCharData=function(n){throw new Error("not implemented")},h.prototype.getAsCharData=function(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]},h}(p.AttributeData);L.JoinedCellData=i;var c=function(){function o(h){this._bufferService=h,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new b.CellData}return o.prototype.registerCharacterJoiner=function(h){var n={id:this._nextCharacterJoinerId++,handler:h};return this._characterJoiners.push(n),n.id},o.prototype.deregisterCharacterJoiner=function(h){for(var n=0;n<this._characterJoiners.length;n++)if(this._characterJoiners[n].id===h)return this._characterJoiners.splice(n,1),!0;return!1},o.prototype.getJoinedCharacters=function(h){if(this._characterJoiners.length===0)return[];var n=this._bufferService.buffer.lines.get(h);if(!n||n.length===0)return[];for(var a=[],t=n.translateToString(!0),r=0,s=0,u=0,d=n.getFg(0),f=n.getBg(0),v=0;v<n.getTrimmedLength();v++)if(n.loadCell(v,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==d||this._workCell.bg!==f){if(v-r>1)for(var m=this._getJoinedRanges(t,u,s,n,r),S=0;S<m.length;S++)a.push(m[S]);r=v,u=s,d=this._workCell.fg,f=this._workCell.bg}s+=this._workCell.getChars().length||E.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-r>1)for(m=this._getJoinedRanges(t,u,s,n,r),S=0;S<m.length;S++)a.push(m[S]);return a},o.prototype._getJoinedRanges=function(h,n,a,t,r){for(var s=h.substring(n,a),u=this._characterJoiners[0].handler(s),d=1;d<this._characterJoiners.length;d++)for(var f=this._characterJoiners[d].handler(s),v=0;v<f.length;v++)o._mergeRanges(u,f[v]);return this._stringRangesToCellRanges(u,t,r),u},o.prototype._stringRangesToCellRanges=function(h,n,a){var t=0,r=!1,s=0,u=h[t];if(u){for(var d=a;d<this._bufferService.cols;d++){var f=n.getWidth(d),v=n.getString(d).length||E.WHITESPACE_CELL_CHAR.length;if(f!==0){if(!r&&u[0]<=s&&(u[0]=d,r=!0),u[1]<=s){if(u[1]=d,!(u=h[++t]))break;u[0]<=s?(u[0]=d,r=!0):r=!1}s+=v}}u&&(u[1]=this._bufferService.cols)}},o._mergeRanges=function(h,n){for(var a=!1,t=0;t<h.length;t++){var r=h[t];if(a){if(n[1]<=r[0])return h[t-1][1]=n[1],h;if(n[1]<=r[1])return h[t-1][1]=Math.max(n[1],r[1]),h.splice(t,1),h;h.splice(t,1),t--}else{if(n[1]<=r[0])return h.splice(t,0,n),h;if(n[1]<=r[1])return r[0]=Math.min(n[0],r[0]),h;n[0]<r[1]&&(r[0]=Math.min(n[0],r[0]),a=!0)}}return a?h[h.length-1][1]=n[1]:h.push(n),h},o}();L.CharacterJoinerRegistry=c},function(G,L,I){"use strict";function R(M,p){var E=p.getBoundingClientRect();return[M.clientX-E.left,M.clientY-E.top]}Object.defineProperty(L,"__esModule",{value:!0}),L.getRawByteCoords=L.getCoords=L.getCoordsRelativeToElement=void 0,L.getCoordsRelativeToElement=R,L.getCoords=function(M,p,E,b,i,c,o,h){if(i){var n=R(M,p);if(n)return n[0]=Math.ceil((n[0]+(h?c/2:0))/c),n[1]=Math.ceil(n[1]/o),n[0]=Math.min(Math.max(n[0],1),E+(h?1:0)),n[1]=Math.min(Math.max(n[1],1),b),n}},L.getRawByteCoords=function(M){if(M)return{x:M[0]+32,y:M[1]+32}}},function(G,L,I){"use strict";Object.defineProperty(L,"__esModule",{value:!0}),L.RenderDebouncer=void 0;var R=function(){function M(p){this._renderCallback=p}return M.prototype.dispose=function(){this._animationFrame&&(window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)},M.prototype.refresh=function(p,E,b){var i=this;this._rowCount=b,p=p!==void 0?p:0,E=E!==void 0?E:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,p):p,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,E):E,this._animationFrame||(this._animationFrame=window.requestAnimationFrame(function(){return i._innerRefresh()}))},M.prototype._innerRefresh=function(){if(this._rowStart!==void 0&&this._rowEnd!==void 0&&this._rowCount!==void 0){var p=Math.max(this._rowStart,0),E=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._animationFrame=void 0,this._renderCallback(p,E)}},M}();L.RenderDebouncer=R},function(G,L,I){"use strict";var R,M=this&&this.__extends||(R=function(E,b){return(R=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,c){i.__proto__=c}||function(i,c){for(var o in c)c.hasOwnProperty(o)&&(i[o]=c[o])})(E,b)},function(E,b){function i(){this.constructor=E}R(E,b),E.prototype=b===null?Object.create(b):(i.prototype=b.prototype,new i)});Object.defineProperty(L,"__esModule",{value:!0}),L.ScreenDprMonitor=void 0;var p=function(E){function b(){var i=E!==null&&E.apply(this,arguments)||this;return i._currentDevicePixelRatio=window.devicePixelRatio,i}return M(b,E),b.prototype.setListener=function(i){var c=this;this._listener&&this.clearListener(),this._listener=i,this._outerListener=function(){c._listener&&(c._listener(window.devicePixelRatio,c._currentDevicePixelRatio),c._updateDpr())},this._updateDpr()},b.prototype.dispose=function(){E.prototype.dispose.call(this),this.clearListener()},b.prototype._updateDpr=function(){var i;this._outerListener&&((i=this._resolutionMediaMatchList)===null||i===void 0||i.removeListener(this._outerListener),this._currentDevicePixelRatio=window.devicePixelRatio,this._resolutionMediaMatchList=window.matchMedia("screen and (resolution: "+window.devicePixelRatio+"dppx)"),this._resolutionMediaMatchList.addListener(this._outerListener))},b.prototype.clearListener=function(){this._resolutionMediaMatchList&&this._listener&&this._outerListener&&(this._resolutionMediaMatchList.removeListener(this._outerListener),this._resolutionMediaMatchList=void 0,this._listener=void 0,this._outerListener=void 0)},b}(I(2).Disposable);L.ScreenDprMonitor=p},function(G,L,I){"use strict";Object.defineProperty(L,"__esModule",{value:!0}),L.clone=void 0,L.clone=function R(M,p){if(p===void 0&&(p=5),typeof M!="object")return M;var E=Array.isArray(M)?[]:{};for(var b in M)E[b]=p<=1?M[b]:M[b]?R(M[b],p-1):M[b];return E}},function(G,L,I){"use strict";Object.defineProperty(L,"__esModule",{value:!0}),L.Terminal=void 0;var R=I(4),M=I(35),p=I(18),E=I(0),b=I(83),i=function(){function t(r){this._core=new M.Terminal(r),this._addonManager=new b.AddonManager}return t.prototype._checkProposedApi=function(){if(!this._core.optionsService.options.allowProposedApi)throw new Error("You must set the allowProposedApi option to true to use proposed API")},Object.defineProperty(t.prototype,"onCursorMove",{get:function(){return this._core.onCursorMove},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onLineFeed",{get:function(){return this._core.onLineFeed},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onSelectionChange",{get:function(){return this._core.onSelectionChange},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onData",{get:function(){return this._core.onData},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onBinary",{get:function(){return this._core.onBinary},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onTitleChange",{get:function(){return this._core.onTitleChange},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onScroll",{get:function(){return this._core.onScroll},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onKey",{get:function(){return this._core.onKey},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onRender",{get:function(){return this._core.onRender},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onResize",{get:function(){return this._core.onResize},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"element",{get:function(){return this._core.element},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"parser",{get:function(){return this._checkProposedApi(),this._parser||(this._parser=new n(this._core)),this._parser},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"unicode",{get:function(){return this._checkProposedApi(),new a(this._core)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"textarea",{get:function(){return this._core.textarea},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"rows",{get:function(){return this._core.rows},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"cols",{get:function(){return this._core.cols},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"buffer",{get:function(){return this._checkProposedApi(),new o(this._core.buffers)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"markers",{get:function(){return this._checkProposedApi(),this._core.markers},enumerable:!1,configurable:!0}),t.prototype.blur=function(){this._core.blur()},t.prototype.focus=function(){this._core.focus()},t.prototype.resize=function(r,s){this._verifyIntegers(r,s),this._core.resize(r,s)},t.prototype.open=function(r){this._core.open(r)},t.prototype.attachCustomKeyEventHandler=function(r){this._core.attachCustomKeyEventHandler(r)},t.prototype.registerLinkMatcher=function(r,s,u){return this._checkProposedApi(),this._core.registerLinkMatcher(r,s,u)},t.prototype.deregisterLinkMatcher=function(r){this._checkProposedApi(),this._core.deregisterLinkMatcher(r)},t.prototype.registerLinkProvider=function(r){return this._checkProposedApi(),this._core.registerLinkProvider(r)},t.prototype.registerCharacterJoiner=function(r){return this._checkProposedApi(),this._core.registerCharacterJoiner(r)},t.prototype.deregisterCharacterJoiner=function(r){this._checkProposedApi(),this._core.deregisterCharacterJoiner(r)},t.prototype.registerMarker=function(r){return this._checkProposedApi(),this._verifyIntegers(r),this._core.addMarker(r)},t.prototype.addMarker=function(r){return this.registerMarker(r)},t.prototype.hasSelection=function(){return this._core.hasSelection()},t.prototype.select=function(r,s,u){this._verifyIntegers(r,s,u),this._core.select(r,s,u)},t.prototype.getSelection=function(){return this._core.getSelection()},t.prototype.getSelectionPosition=function(){return this._core.getSelectionPosition()},t.prototype.clearSelection=function(){this._core.clearSelection()},t.prototype.selectAll=function(){this._core.selectAll()},t.prototype.selectLines=function(r,s){this._verifyIntegers(r,s),this._core.selectLines(r,s)},t.prototype.dispose=function(){this._addonManager.dispose(),this._core.dispose()},t.prototype.scrollLines=function(r){this._verifyIntegers(r),this._core.scrollLines(r)},t.prototype.scrollPages=function(r){this._verifyIntegers(r),this._core.scrollPages(r)},t.prototype.scrollToTop=function(){this._core.scrollToTop()},t.prototype.scrollToBottom=function(){this._core.scrollToBottom()},t.prototype.scrollToLine=function(r){this._verifyIntegers(r),this._core.scrollToLine(r)},t.prototype.clear=function(){this._core.clear()},t.prototype.write=function(r,s){this._core.write(r,s)},t.prototype.writeUtf8=function(r,s){this._core.write(r,s)},t.prototype.writeln=function(r,s){this._core.write(r),this._core.write(`\r
|
|
|
`,s)},t.prototype.paste=function(r){this._core.paste(r)},t.prototype.getOption=function(r){return this._core.optionsService.getOption(r)},t.prototype.setOption=function(r,s){this._core.optionsService.setOption(r,s)},t.prototype.refresh=function(r,s){this._verifyIntegers(r,s),this._core.refresh(r,s)},t.prototype.reset=function(){this._core.reset()},t.prototype.loadAddon=function(r){return this._addonManager.loadAddon(this,r)},Object.defineProperty(t,"strings",{get:function(){return p},enumerable:!1,configurable:!0}),t.prototype._verifyIntegers=function(){for(var r=[],s=0;s<arguments.length;s++)r[s]=arguments[s];for(var u=0,d=r;u<d.length;u++){var f=d[u];if(f===1/0||isNaN(f)||f%1!=0)throw new Error("This API only accepts integers")}},t}();L.Terminal=i;var c=function(){function t(r,s){this._buffer=r,this.type=s}return t.prototype.init=function(r){return this._buffer=r,this},Object.defineProperty(t.prototype,"cursorY",{get:function(){return this._buffer.y},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"cursorX",{get:function(){return this._buffer.x},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"viewportY",{get:function(){return this._buffer.ydisp},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"baseY",{get:function(){return this._buffer.ybase},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"length",{get:function(){return this._buffer.lines.length},enumerable:!1,configurable:!0}),t.prototype.getLine=function(r){var s=this._buffer.lines.get(r);if(s)return new h(s)},t.prototype.getNullCell=function(){return new R.CellData},t}(),o=function(){function t(r){var s=this;this._buffers=r,this._onBufferChange=new E.EventEmitter,this._normal=new c(this._buffers.normal,"normal"),this._alternate=new c(this._buffers.alt,"alternate"),this._buffers.onBufferActivate(function(){return s._onBufferChange.fire(s.active)})}return Object.defineProperty(t.prototype,"onBufferChange",{get:function(){return this._onBufferChange.event},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"active",{get:function(){if(this._buffers.active===this._buffers.normal)return this.normal;if(this._buffers.active===this._buffers.alt)return this.alternate;throw new Error("Active buffer is neither normal nor alternate")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"normal",{get:function(){return this._normal.init(this._buffers.normal)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"alternate",{get:function(){return this._alternate.init(this._buffers.alt)},enumerable:!1,configurable:!0}),t}(),h=function(){function t(r){this._line=r}return Object.defineProperty(t.prototype,"isWrapped",{get:function(){return this._line.isWrapped},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"length",{get:function(){return this._line.length},enumerable:!1,configurable:!0}),t.prototype.getCell=function(r,s){if(!(r<0||r>=this._line.length))return s?(this._line.loadCell(r,s),s):this._line.loadCell(r,new R.CellData)},t.prototype.translateToString=function(r,s,u){return this._line.translateToString(r,s,u)},t}(),n=function(){function t(r){this._core=r}return t.prototype.registerCsiHandler=function(r,s){return this._core.addCsiHandler(r,function(u){return s(u.toArray())})},t.prototype.addCsiHandler=function(r,s){return this.registerCsiHandler(r,s)},t.prototype.registerDcsHandler=function(r,s){return this._core.addDcsHandler(r,function(u,d){return s(u,d.toArray())})},t.prototype.addDcsHandler=function(r,s){return this.registerDcsHandler(r,s)},t.prototype.registerEscHandler=function(r,s){return this._core.addEscHandler(r,s)},t.prototype.addEscHandler=function(r,s){return this.registerEscHandler(r,s)},t.prototype.registerOscHandler=function(r,s){return this._core.addOscHandler(r,s)},t.prototype.addOscHandler=function(r,s){return this.registerOscHandler(r,s)},t}(),a=function(){function t(r){this._core=r}return t.prototype.register=function(r){this._core.unicodeService.register(r)},Object.defineProperty(t.prototype,"versions",{get:function(){return this._core.unicodeService.versions},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"activeVersion",{get:function(){return this._core.unicodeService.activeVersion},set:function(r){this._core.unicodeService.activeVersion=r},enumerable:!1,configurable:!0}),t}()},function(G,L,I){"use strict";var R,M=this&&this.__extends||(R=function(j,A){return(R=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(K,U){K.__proto__=U}||function(K,U){for(var k in U)U.hasOwnProperty(k)&&(K[k]=U[k])})(j,A)},function(j,A){function K(){this.constructor=j}R(j,A),j.prototype=A===null?Object.create(A):(K.prototype=A.prototype,new K)});Object.defineProperty(L,"__esModule",{value:!0}),L.Terminal=void 0;var p=I(36),E=I(37),b=I(38),i=I(12),c=I(19),o=I(40),h=I(50),n=I(51),a=I(11),t=I(7),r=I(18),s=I(54),u=I(55),d=I(56),f=I(57),v=I(59),m=I(0),S=I(16),C=I(27),_=I(60),y=I(5),T=I(61),O=I(62),g=I(63),F=I(64),P=I(65),N=typeof window!="undefined"?window.document:null,X=function(j){function A(K){K===void 0&&(K={});var U=j.call(this,K)||this;return U.browser=a,U._keyDownHandled=!1,U._onCursorMove=new m.EventEmitter,U._onKey=new m.EventEmitter,U._onRender=new m.EventEmitter,U._onSelectionChange=new m.EventEmitter,U._onTitleChange=new m.EventEmitter,U._onFocus=new m.EventEmitter,U._onBlur=new m.EventEmitter,U._onA11yCharEmitter=new m.EventEmitter,U._onA11yTabEmitter=new m.EventEmitter,U._setup(),U.linkifier=U._instantiationService.createInstance(h.Linkifier),U.linkifier2=U.register(U._instantiationService.createInstance(g.Linkifier2)),U.register(U._inputHandler.onRequestBell(function(){return U.bell()})),U.register(U._inputHandler.onRequestRefreshRows(function(k,z){return U.refresh(k,z)})),U.register(U._inputHandler.onRequestReset(function(){return U.reset()})),U.register(U._inputHandler.onRequestScroll(function(k,z){return U.scroll(k,z||void 0)})),U.register(U._inputHandler.onRequestWindowsOptionsReport(function(k){return U._reportWindowsOptions(k)})),U.register(m.forwardEvent(U._inputHandler.onCursorMove,U._onCursorMove)),U.register(m.forwardEvent(U._inputHandler.onTitleChange,U._onTitleChange)),U.register(m.forwardEvent(U._inputHandler.onA11yChar,U._onA11yCharEmitter)),U.register(m.forwardEvent(U._inputHandler.onA11yTab,U._onA11yTabEmitter)),U.register(U._bufferService.onResize(function(k){return U._afterResize(k.cols,k.rows)})),U}return M(A,j),Object.defineProperty(A.prototype,"options",{get:function(){return this.optionsService.options},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"onCursorMove",{get:function(){return this._onCursorMove.event},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"onKey",{get:function(){return this._onKey.event},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"onRender",{get:function(){return this._onRender.event},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"onSelectionChange",{get:function(){return this._onSelectionChange.event},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"onTitleChange",{get:function(){return this._onTitleChange.event},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"onFocus",{get:function(){return this._onFocus.event},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"onBlur",{get:function(){return this._onBlur.event},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"onA11yChar",{get:function(){return this._onA11yCharEmitter.event},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"onA11yTab",{get:function(){return this._onA11yTabEmitter.event},enumerable:!1,configurable:!0}),A.prototype.dispose=function(){var K,U,k;this._isDisposed||(j.prototype.dispose.call(this),(K=this._renderService)===null||K===void 0||K.dispose(),this._customKeyEventHandler=void 0,this.write=function(){},(k=(U=this.element)===null||U===void 0?void 0:U.parentNode)===null||k===void 0||k.removeChild(this.element))},A.prototype._setup=function(){j.prototype._setup.call(this),this._customKeyEventHandler=void 0},Object.defineProperty(A.prototype,"buffer",{get:function(){return this.buffers.active},enumerable:!1,configurable:!0}),A.prototype.focus=function(){this.textarea&&this.textarea.focus({preventScroll:!0})},A.prototype._updateOptions=function(K){var U,k,z,te;switch(j.prototype._updateOptions.call(this,K),K){case"fontFamily":case"fontSize":(U=this._renderService)===null||U===void 0||U.clear(),(k=this._charSizeService)===null||k===void 0||k.measure();break;case"cursorBlink":case"cursorStyle":this.refresh(this.buffer.y,this.buffer.y);break;case"drawBoldTextInBrightColors":case"letterSpacing":case"lineHeight":case"fontWeight":case"fontWeightBold":case"minimumContrastRatio":this._renderService&&(this._renderService.clear(),this._renderService.onResize(this.cols,this.rows),this.refresh(0,this.rows-1));break;case"rendererType":this._renderService&&(this._renderService.setRenderer(this._createRenderer()),this._renderService.onResize(this.cols,this.rows));break;case"scrollback":(z=this.viewport)===null||z===void 0||z.syncScrollArea();break;case"screenReaderMode":this.optionsService.options.screenReaderMode?!this._accessibilityManager&&this._renderService&&(this._accessibilityManager=new d.AccessibilityManager(this,this._renderService)):((te=this._accessibilityManager)===null||te===void 0||te.dispose(),this._accessibilityManager=void 0);break;case"tabStopWidth":this.buffers.setupTabStops();break;case"theme":this._setTheme(this.optionsService.options.theme)}},A.prototype._onTextAreaFocus=function(K){this._coreService.decPrivateModes.sendFocus&&this._coreService.triggerDataEvent(i.C0.ESC+"[I"),this.updateCursorStyle(K),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()},A.prototype.blur=function(){var K;return(K=this.textarea)===null||K===void 0?void 0:K.blur()},A.prototype._onTextAreaBlur=function(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this._coreService.decPrivateModes.sendFocus&&this._coreService.triggerDataEvent(i.C0.ESC+"[O"),this.element.classList.remove("focus"),this._onBlur.fire()},A.prototype._syncTextArea=function(){if(this.textarea&&this.buffer.isCursorInViewport&&!this._compositionHelper.isComposing){var K=Math.ceil(this._charSizeService.height*this.optionsService.options.lineHeight),U=this._bufferService.buffer.y*K,k=this._bufferService.buffer.x*this._charSizeService.width;this.textarea.style.left=k+"px",this.textarea.style.top=U+"px",this.textarea.style.width=this._charSizeService.width+"px",this.textarea.style.height=K+"px",this.textarea.style.lineHeight=K+"px",this.textarea.style.zIndex="-5"}},A.prototype._initGlobal=function(){var K=this;this._bindKeys(),this.register(t.addDisposableDomListener(this.element,"copy",function(k){K.hasSelection()&&b.copyHandler(k,K._selectionService)}));var U=function(k){return b.handlePasteEvent(k,K.textarea,K._coreService)};this.register(t.addDisposableDomListener(this.textarea,"paste",U)),this.register(t.addDisposableDomListener(this.element,"paste",U)),a.isFirefox?this.register(t.addDisposableDomListener(this.element,"mousedown",function(k){k.button===2&&b.rightClickHandler(k,K.textarea,K.screenElement,K._selectionService,K.options.rightClickSelectsWord)})):this.register(t.addDisposableDomListener(this.element,"contextmenu",function(k){b.rightClickHandler(k,K.textarea,K.screenElement,K._selectionService,K.options.rightClickSelectsWord)})),a.isLinux&&this.register(t.addDisposableDomListener(this.element,"auxclick",function(k){k.button===1&&b.moveTextAreaUnderMouseCursor(k,K.textarea,K.screenElement)}))},A.prototype._bindKeys=function(){var K=this;this.register(t.addDisposableDomListener(this.textarea,"keyup",function(U){return K._keyUp(U)},!0)),this.register(t.addDisposableDomListener(this.textarea,"keydown",function(U){return K._keyDown(U)},!0)),this.register(t.addDisposableDomListener(this.textarea,"keypress",function(U){return K._keyPress(U)},!0)),this.register(t.addDisposableDomListener(this.textarea,"compositionstart",function(){return K._compositionHelper.compositionstart()})),this.register(t.addDisposableDomListener(this.textarea,"compositionupdate",function(U){return K._compositionHelper.compositionupdate(U)})),this.register(t.addDisposableDomListener(this.textarea,"compositionend",function(){return K._compositionHelper.compositionend()})),this.register(this.onRender(function(){return K._compositionHelper.updateCompositionElements()})),this.register(this.onRender(function(U){return K._queueLinkification(U.start,U.end)}))},A.prototype.open=function(K){var U=this;if(!K)throw new Error("Terminal requires a parent element.");N.body.contains(K)||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),this._document=K.ownerDocument,this.element=this._document.createElement("div"),this.element.dir="ltr",this.element.classList.add("terminal"),this.element.classList.add("xterm"),this.element.setAttribute("tabindex","0"),K.appendChild(this.element);var k=N.createDocumentFragment();this._viewportElement=N.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),k.appendChild(this._viewportElement),this._viewportScrollArea=N.createElement("div"),this._viewportScrollArea.classList.add("xterm-scroll-area"),this._viewportElement.appendChild(this._viewportScrollArea),this.screenElement=N.createElement("div"),this.screenElement.classList.add("xterm-screen"),this._helperContainer=N.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),k.appendChild(this.screenElement),this.textarea=N.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",r.promptLabel),this.textarea.setAttribute("aria-multiline","false"),this.textarea.setAttribute("autocorrect","off"),this.textarea.setAttribute("autocapitalize","off"),this.textarea.setAttribute("spellcheck","false"),this.textarea.tabIndex=0,this.register(t.addDisposableDomListener(this.textarea,"focus",function(de){return U._onTextAreaFocus(de)})),this.register(t.addDisposableDomListener(this.textarea,"blur",function(){return U._onTextAreaBlur()})),this._helperContainer.appendChild(this.textarea);var z=this._instantiationService.createInstance(F.CoreBrowserService,this.textarea);this._instantiationService.setService(y.ICoreBrowserService,z),this._charSizeService=this._instantiationService.createInstance(T.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(y.ICharSizeService,this._charSizeService),this._compositionView=N.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(p.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this.element.appendChild(k),this._theme=this.options.theme||this._theme,this._colorManager=new C.ColorManager(N,this.options.allowTransparency),this.register(this.optionsService.onOptionChange(function(de){return U._colorManager.onOptionsChange(de)})),this._colorManager.setTheme(this._theme);var te=this._createRenderer();this._renderService=this.register(this._instantiationService.createInstance(_.RenderService,te,this.rows,this.screenElement)),this._instantiationService.setService(y.IRenderService,this._renderService),this.register(this._renderService.onRenderedBufferChange(function(de){return U._onRender.fire(de)})),this.onResize(function(de){return U._renderService.resize(de.cols,de.rows)}),this._soundService=this._instantiationService.createInstance(s.SoundService),this._instantiationService.setService(y.ISoundService,this._soundService),this._mouseService=this._instantiationService.createInstance(O.MouseService),this._instantiationService.setService(y.IMouseService,this._mouseService),this.viewport=this._instantiationService.createInstance(E.Viewport,function(de,be){return U.scrollLines(de,be)},this._viewportElement,this._viewportScrollArea),this.viewport.onThemeChange(this._colorManager.colors),this.register(this._inputHandler.onRequestSyncScrollBar(function(){return U.viewport.syncScrollArea()})),this.register(this.viewport),this.register(this.onCursorMove(function(){U._renderService.onCursorMove(),U._syncTextArea()})),this.register(this.onResize(function(){return U._renderService.onResize(U.cols,U.rows)})),this.register(this.onBlur(function(){return U._renderService.onBlur()})),this.register(this.onFocus(function(){return U._renderService.onFocus()})),this.register(this._renderService.onDimensionsChange(function(){return U.viewport.syncScrollArea()})),this._selectionService=this.register(this._instantiationService.createInstance(n.SelectionService,this.element,this.screenElement)),this._instantiationService.setService(y.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines(function(de){return U.scrollLines(de.amount,de.suppressScrollEvent)})),this.register(this._selectionService.onSelectionChange(function(){return U._onSelectionChange.fire()})),this.register(this._selectionService.onRequestRedraw(function(de){return U._renderService.onSelectionChanged(de.start,de.end,de.columnSelectMode)})),this.register(this._selectionService.onLinuxMouseSelection(function(de){U.textarea.value=de,U.textarea.focus(),U.textarea.select()})),this.register(this.onScroll(function(){U.viewport.syncScrollArea(),U._selectionService.refresh()})),this.register(t.addDisposableDomListener(this._viewportElement,"scroll",function(){return U._selectionService.refresh()})),this._mouseZoneManager=this._instantiationService.createInstance(u.MouseZoneManager,this.element,this.screenElement),this.register(this._mouseZoneManager),this.register(this.onScroll(function(){return U._mouseZoneManager.clearAll()})),this.linkifier.attachToDom(this.element,this._mouseZoneManager),this.linkifier2.attachToDom(this.element,this._mouseService,this._renderService),this.register(t.addDisposableDomListener(this.element,"mousedown",function(de){return U._selectionService.onMouseDown(de)})),this._coreMouseService.areMouseEventsActive?(this._selectionService.disable(),this.element.classList.add("enable-mouse-events")):this._selectionService.enable(),this.options.screenReaderMode&&(this._accessibilityManager=new d.AccessibilityManager(this,this._renderService)),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()},A.prototype._createRenderer=function(){switch(this.options.rendererType){case"canvas":return this._instantiationService.createInstance(o.Renderer,this._colorManager.colors,this.screenElement,this.linkifier,this.linkifier2);case"dom":return this._instantiationService.createInstance(f.DomRenderer,this._colorManager.colors,this.element,this.screenElement,this._viewportElement,this.linkifier,this.linkifier2);default:throw new Error('Unrecognized rendererType "'+this.options.rendererType+'"')}},A.prototype._setTheme=function(K){var U,k,z;this._theme=K,(U=this._colorManager)===null||U===void 0||U.setTheme(K),(k=this._renderService)===null||k===void 0||k.setColors(this._colorManager.colors),(z=this.viewport)===null||z===void 0||z.onThemeChange(this._colorManager.colors)},A.prototype.bindMouse=function(){var K=this,U=this,k=this.element;function z(Le){var Ke,He,Ae=U._mouseService.getRawByteCoords(Le,U.screenElement,U.cols,U.rows);if(!Ae)return!1;switch(Le.overrideType||Le.type){case"mousemove":He=32,Le.buttons===void 0?(Ke=3,Le.button!==void 0&&(Ke=Le.button<3?Le.button:3)):Ke=1&Le.buttons?0:4&Le.buttons?1:2&Le.buttons?2:3;break;case"mouseup":He=0,Ke=Le.button<3?Le.button:3;break;case"mousedown":He=1,Ke=Le.button<3?Le.button:3;break;case"wheel":Le.deltaY!==0&&(He=Le.deltaY<0?0:1),Ke=4;break;default:return!1}return!(He===void 0||Ke===void 0||Ke>4)&&U._coreMouseService.triggerMouseEvent({col:Ae.x-33,row:Ae.y-33,button:Ke,action:He,ctrl:Le.ctrlKey,alt:Le.altKey,shift:Le.shiftKey})}var te={mouseup:null,wheel:null,mousedrag:null,mousemove:null},de=function(Le){return z(Le),Le.buttons||(K._document.removeEventListener("mouseup",te.mouseup),te.mousedrag&&K._document.removeEventListener("mousemove",te.mousedrag)),K.cancel(Le)},be=function(Le){return z(Le),Le.preventDefault(),K.cancel(Le)},We=function(Le){Le.buttons&&z(Le)},Ne=function(Le){Le.buttons||z(Le)};this.register(this._coreMouseService.onProtocolChange(function(Le){Le?(K.optionsService.options.logLevel==="debug"&&K._logService.debug("Binding to mouse events:",K._coreMouseService.explainEvents(Le)),K.element.classList.add("enable-mouse-events"),K._selectionService.disable()):(K._logService.debug("Unbinding from mouse events."),K.element.classList.remove("enable-mouse-events"),K._selectionService.enable()),8&Le?te.mousemove||(k.addEventListener("mousemove",Ne),te.mousemove=Ne):(k.removeEventListener("mousemove",te.mousemove),te.mousemove=null),16&Le?te.wheel||(k.addEventListener("wheel",be,{passive:!1}),te.wheel=be):(k.removeEventListener("wheel",te.wheel),te.wheel=null),2&Le?te.mouseup||(te.mouseup=de):(K._document.removeEventListener("mouseup",te.mouseup),te.mouseup=null),4&Le?te.mousedrag||(te.mousedrag=We):(K._document.removeEventListener("mousemove",te.mousedrag),te.mousedrag=null)})),this._coreMouseService.activeProtocol=this._coreMouseService.activeProtocol,this.register(t.addDisposableDomListener(k,"mousedown",function(Le){if(Le.preventDefault(),K.focus(),K._coreMouseService.areMouseEventsActive&&!K._selectionService.shouldForceSelection(Le))return z(Le),te.mouseup&&K._document.addEventListener("mouseup",te.mouseup),te.mousedrag&&K._document.addEventListener("mousemove",te.mousedrag),K.cancel(Le)})),this.register(t.addDisposableDomListener(k,"wheel",function(Le){if(!te.wheel){if(!K.buffer.hasScrollback){var Ke=K.viewport.getLinesScrolled(Le);if(Ke===0)return;for(var He=i.C0.ESC+(K._coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(Le.deltaY<0?"A":"B"),Ae="",Se=0;Se<Math.abs(Ke);Se++)Ae+=He;K._coreService.triggerDataEvent(Ae,!0)}}},{passive:!0})),this.register(t.addDisposableDomListener(k,"wheel",function(Le){if(!te.wheel)return K.viewport.onWheel(Le)?void 0:K.cancel(Le)},{passive:!1})),this.register(t.addDisposableDomListener(k,"touchstart",function(Le){if(!K._coreMouseService.areMouseEventsActive)return K.viewport.onTouchStart(Le),K.cancel(Le)},{passive:!0})),this.register(t.addDisposableDomListener(k,"touchmove",function(Le){if(!K._coreMouseService.areMouseEventsActive)return K.viewport.onTouchMove(Le)?void 0:K.cancel(Le)},{passive:!1}))},A.prototype.refresh=function(K,U){var k;(k=this._renderService)===null||k===void 0||k.refreshRows(K,U)},A.prototype._queueLinkification=function(K,U){var k;(k=this.linkifier)===null||k===void 0||k.linkifyRows(K,U)},A.prototype.updateCursorStyle=function(K){this._selectionService&&this._selectionService.shouldColumnSelect(K)?this.element.classList.add("column-select"):this.element.classList.remove("column-select")},A.prototype._showCursor=function(){this._coreService.isCursorInitialized||(this._coreService.isCursorInitialized=!0,this.refresh(this.buffer.y,this.buffer.y))},A.prototype.scrollLines=function(K,U){j.prototype.scrollLines.call(this,K,U),this.refresh(0,this.rows-1)},A.prototype.paste=function(K){b.paste(K,this.textarea,this._coreService)},A.prototype.attachCustomKeyEventHandler=function(K){this._customKeyEventHandler=K},A.prototype.registerLinkMatcher=function(K,U,k){var z=this.linkifier.registerLinkMatcher(K,U,k);return this.refresh(0,this.rows-1),z},A.prototype.deregisterLinkMatcher=function(K){this.linkifier.deregisterLinkMatcher(K)&&this.refresh(0,this.rows-1)},A.prototype.registerLinkProvider=function(K){return this.linkifier2.registerLinkProvider(K)},A.prototype.registerCharacterJoiner=function(K){var U=this._renderService.registerCharacterJoiner(K);return this.refresh(0,this.rows-1),U},A.prototype.deregisterCharacterJoiner=function(K){this._renderService.deregisterCharacterJoiner(K)&&this.refresh(0,this.rows-1)},Object.defineProperty(A.prototype,"markers",{get:function(){return this.buffer.markers},enumerable:!1,configurable:!0}),A.prototype.addMarker=function(K){if(this.buffer===this.buffers.normal)return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+K)},A.prototype.hasSelection=function(){return!!this._selectionService&&this._selectionService.hasSelection},A.prototype.select=function(K,U,k){this._selectionService.setSelection(K,U,k)},A.prototype.getSelection=function(){return this._selectionService?this._selectionService.selectionText:""},A.prototype.getSelectionPosition=function(){if(this._selectionService&&this._selectionService.hasSelection)return{startColumn:this._selectionService.selectionStart[0],startRow:this._selectionService.selectionStart[1],endColumn:this._selectionService.selectionEnd[0],endRow:this._selectionService.selectionEnd[1]}},A.prototype.clearSelection=function(){var K;(K=this._selectionService)===null||K===void 0||K.clearSelection()},A.prototype.selectAll=function(){var K;(K=this._selectionService)===null||K===void 0||K.selectAll()},A.prototype.selectLines=function(K,U){var k;(k=this._selectionService)===null||k===void 0||k.selectLines(K,U)},A.prototype._keyDown=function(K){if(this._keyDownHandled=!1,this._customKeyEventHandler&&this._customKeyEventHandler(K)===!1)return!1;if(!this._compositionHelper.keydown(K))return this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;var U=v.evaluateKeyboardEvent(K,this._coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(K),U.type===3||U.type===2){var k=this.rows-1;return this.scrollLines(U.type===2?-k:k),this.cancel(K,!0)}return U.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,K)||(U.cancel&&this.cancel(K,!0),!U.key||(U.key!==i.C0.ETX&&U.key!==i.C0.CR||(this.textarea.value=""),this._onKey.fire({key:U.key,domEvent:K}),this._showCursor(),this._coreService.triggerDataEvent(U.key,!0),this.optionsService.options.screenReaderMode?void(this._keyDownHandled=!0):this.cancel(K,!0)))},A.prototype._isThirdLevelShift=function(K,U){var k=K.isMac&&!this.options.macOptionIsMeta&&U.altKey&&!U.ctrlKey&&!U.metaKey||K.isWindows&&U.altKey&&U.ctrlKey&&!U.metaKey;return U.type==="keypress"?k:k&&(!U.keyCode||U.keyCode>47)},A.prototype._keyUp=function(K){this._customKeyEventHandler&&this._customKeyEventHandler(K)===!1||(function(U){return U.keyCode===16||U.keyCode===17||U.keyCode===18}(K)||this.focus(),this.updateCursorStyle(K))},A.prototype._keyPress=function(K){var U;if(this._keyDownHandled)return!1;if(this._customKeyEventHandler&&this._customKeyEventHandler(K)===!1)return!1;if(this.cancel(K),K.charCode)U=K.charCode;else if(K.which===null||K.which===void 0)U=K.keyCode;else{if(K.which===0||K.charCode===0)return!1;U=K.which}return!(!U||(K.altKey||K.ctrlKey||K.metaKey)&&!this._isThirdLevelShift(this.browser,K))&&(U=String.fromCharCode(U),this._onKey.fire({key:U,domEvent:K}),this._showCursor(),this._coreService.triggerDataEvent(U,!0),!0)},A.prototype.bell=function(){this._soundBell()&&this._soundService.playBellSound()},A.prototype.resize=function(K,U){K!==this.cols||U!==this.rows?j.prototype.resize.call(this,K,U):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()},A.prototype._afterResize=function(K,U){var k,z;(k=this._charSizeService)===null||k===void 0||k.measure(),(z=this.viewport)===null||z===void 0||z.syncScrollArea(!0)},A.prototype.clear=function(){if(this.buffer.ybase!==0||this.buffer.y!==0){this.buffer.lines.set(0,this.buffer.lines.get(this.buffer.ybase+this.buffer.y)),this.buffer.lines.length=1,this.buffer.ydisp=0,this.buffer.ybase=0,this.buffer.y=0;for(var K=1;K<this.rows;K++)this.buffer.lines.push(this.buffer.getBlankLine(S.DEFAULT_ATTR_DATA));this.refresh(0,this.rows-1),this._onScroll.fire(this.buffer.ydisp)}},A.prototype.reset=function(){var K,U;this.options.rows=this.rows,this.options.cols=this.cols;var k=this._customKeyEventHandler;this._setup(),j.prototype.reset.call(this),(K=this._selectionService)===null||K===void 0||K.reset(),this._customKeyEventHandler=k,this.refresh(0,this.rows-1),(U=this.viewport)===null||U===void 0||U.syncScrollArea()},A.prototype._reportWindowsOptions=function(K){if(this._renderService)switch(K){case c.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:var U=this._renderService.dimensions.scaledCanvasWidth.toFixed(0),k=this._renderService.dimensions.scaledCanvasHeight.toFixed(0);this._coreService.triggerDataEvent(i.C0.ESC+"[4;"+k+";"+U+"t");break;case c.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:var z=this._renderService.dimensions.scaledCellWidth.toFixed(0),te=this._renderService.dimensions.scaledCellHeight.toFixed(0);this._coreService.triggerDataEvent(i.C0.ESC+"[6;"+te+";"+z+"t")}},A.prototype.cancel=function(K,U){if(this.options.cancelEvents||U)return K.preventDefault(),K.stopPropagation(),!1},A.prototype._visualBell=function(){return!1},A.prototype._soundBell=function(){return this.options.bellStyle==="sound"},A}(P.CoreTerminal);L.Terminal=X},function(G,L,I){"use strict";var R=this&&this.__decorate||function(i,c,o,h){var n,a=arguments.length,t=a<3?c:h===null?h=Object.getOwnPropertyDescriptor(c,o):h;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")t=Reflect.decorate(i,c,o,h);else for(var r=i.length-1;r>=0;r--)(n=i[r])&&(t=(a<3?n(t):a>3?n(c,o,t):n(c,o))||t);return a>3&&t&&Object.defineProperty(c,o,t),t},M=this&&this.__param||function(i,c){return function(o,h){c(o,h,i)}};Object.defineProperty(L,"__esModule",{value:!0}),L.CompositionHelper=void 0;var p=I(5),E=I(1),b=function(){function i(c,o,h,n,a,t){this._textarea=c,this._compositionView=o,this._bufferService=h,this._optionsService=n,this._charSizeService=a,this._coreService=t,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0}}return Object.defineProperty(i.prototype,"isComposing",{get:function(){return this._isComposing},enumerable:!1,configurable:!0}),i.prototype.compositionstart=function(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent="",this._compositionView.classList.add("active")},i.prototype.compositionupdate=function(c){var o=this;this._compositionView.textContent=c.data,this.updateCompositionElements(),setTimeout(function(){o._compositionPosition.end=o._textarea.value.length},0)},i.prototype.compositionend=function(){this._finalizeComposition(!0)},i.prototype.keydown=function(c){if(this._isComposing||this._isSendingComposition){if(c.keyCode===229)return!1;if(c.keyCode===16||c.keyCode===17||c.keyCode===18)return!1;this._finalizeComposition(!1)}return c.keyCode!==229||(this._handleAnyTextareaChanges(),!1)},i.prototype._finalizeComposition=function(c){var o=this;if(this._compositionView.classList.remove("active"),this._isComposing=!1,c){var h={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout(function(){if(o._isSendingComposition){o._isSendingComposition=!1;var a=void 0;a=o._isComposing?o._textarea.value.substring(h.start,h.end):o._textarea.value.substring(h.start),o._coreService.triggerDataEvent(a,!0)}},0)}else{this._isSendingComposition=!1;var n=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(n,!0)}},i.prototype._handleAnyTextareaChanges=function(){var c=this,o=this._textarea.value;setTimeout(function(){if(!c._isComposing){var h=c._textarea.value.replace(o,"");h.length>0&&c._coreService.triggerDataEvent(h,!0)}},0)},i.prototype.updateCompositionElements=function(c){var o=this;if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){var h=Math.ceil(this._charSizeService.height*this._optionsService.options.lineHeight),n=this._bufferService.buffer.y*h,a=this._bufferService.buffer.x*this._charSizeService.width;this._compositionView.style.left=a+"px",this._compositionView.style.top=n+"px",this._compositionView.style.height=h+"px",this._compositionView.style.lineHeight=h+"px",this._compositionView.style.fontFamily=this._optionsService.options.fontFamily,this._compositionView.style.fontSize=this._optionsService.options.fontSize+"px";var t=this._compositionView.getBoundingClientRect();this._textarea.style.left=a+"px",this._textarea.style.top=n+"px",this._textarea.style.width=t.width+"px",this._textarea.style.height=t.height+"px",this._textarea.style.lineHeight=t.height+"px"}c||setTimeout(function(){return o.updateCompositionElements(!0)},0)}},i=R([M(2,E.IBufferService),M(3,E.IOptionsService),M(4,p.ICharSizeService),M(5,E.ICoreService)],i)}();L.CompositionHelper=b},function(G,L,I){"use strict";var R,M=this&&this.__extends||(R=function(n,a){return(R=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,r){t.__proto__=r}||function(t,r){for(var s in r)r.hasOwnProperty(s)&&(t[s]=r[s])})(n,a)},function(n,a){function t(){this.constructor=n}R(n,a),n.prototype=a===null?Object.create(a):(t.prototype=a.prototype,new t)}),p=this&&this.__decorate||function(n,a,t,r){var s,u=arguments.length,d=u<3?a:r===null?r=Object.getOwnPropertyDescriptor(a,t):r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")d=Reflect.decorate(n,a,t,r);else for(var f=n.length-1;f>=0;f--)(s=n[f])&&(d=(u<3?s(d):u>3?s(a,t,d):s(a,t))||d);return u>3&&d&&Object.defineProperty(a,t,d),d},E=this&&this.__param||function(n,a){return function(t,r){a(t,r,n)}};Object.defineProperty(L,"__esModule",{value:!0}),L.Viewport=void 0;var b=I(2),i=I(7),c=I(5),o=I(1),h=function(n){function a(t,r,s,u,d,f,v){var m=n.call(this)||this;return m._scrollLines=t,m._viewportElement=r,m._scrollArea=s,m._bufferService=u,m._optionsService=d,m._charSizeService=f,m._renderService=v,m.scrollBarWidth=0,m._currentRowHeight=0,m._lastRecordedBufferLength=0,m._lastRecordedViewportHeight=0,m._lastRecordedBufferHeight=0,m._lastTouchY=0,m._lastScrollTop=0,m._wheelPartialScroll=0,m._refreshAnimationFrame=null,m._ignoreNextScrollEvent=!1,m.scrollBarWidth=m._viewportElement.offsetWidth-m._scrollArea.offsetWidth||15,m.register(i.addDisposableDomListener(m._viewportElement,"scroll",m._onScroll.bind(m))),setTimeout(function(){return m.syncScrollArea()},0),m}return M(a,n),a.prototype.onThemeChange=function(t){this._viewportElement.style.backgroundColor=t.background.css},a.prototype._refresh=function(t){var r=this;if(t)return this._innerRefresh(),void(this._refreshAnimationFrame!==null&&cancelAnimationFrame(this._refreshAnimationFrame));this._refreshAnimationFrame===null&&(this._refreshAnimationFrame=requestAnimationFrame(function(){return r._innerRefresh()}))},a.prototype._innerRefresh=function(){if(this._charSizeService.height>0){this._currentRowHeight=this._renderService.dimensions.scaledCellHeight/window.devicePixelRatio,this._lastRecordedViewportHeight=this._viewportElement.offsetHeight;var t=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderService.dimensions.canvasHeight);this._lastRecordedBufferHeight!==t&&(this._lastRecordedBufferHeight=t,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}var r=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==r&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=r),this._refreshAnimationFrame=null},a.prototype.syncScrollArea=function(t){if(t===void 0&&(t=!1),this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(t);if(this._lastRecordedViewportHeight===this._renderService.dimensions.canvasHeight){var r=this._bufferService.buffer.ydisp*this._currentRowHeight;this._lastScrollTop===r&&this._lastScrollTop===this._viewportElement.scrollTop&&this._renderService.dimensions.scaledCellHeight/window.devicePixelRatio===this._currentRowHeight||this._refresh(t)}else this._refresh(t)},a.prototype._onScroll=function(t){if(this._lastScrollTop=this._viewportElement.scrollTop,this._viewportElement.offsetParent)if(this._ignoreNextScrollEvent)this._ignoreNextScrollEvent=!1;else{var r=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._scrollLines(r,!0)}},a.prototype._bubbleScroll=function(t,r){var s=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(r<0&&this._viewportElement.scrollTop!==0||r>0&&s<this._lastRecordedBufferHeight)||(t.cancelable&&t.preventDefault(),!1)},a.prototype.onWheel=function(t){var r=this._getPixelsScrolled(t);return r!==0&&(this._viewportElement.scrollTop+=r,this._bubbleScroll(t,r))},a.prototype._getPixelsScrolled=function(t){if(t.deltaY===0)return 0;var r=this._applyScrollModifier(t.deltaY,t);return t.deltaMode===WheelEvent.DOM_DELTA_LINE?r*=this._currentRowHeight:t.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(r*=this._currentRowHeight*this._bufferService.rows),r},a.prototype.getLinesScrolled=function(t){if(t.deltaY===0)return 0;var r=this._applyScrollModifier(t.deltaY,t);return t.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(r/=this._currentRowHeight+0,this._wheelPartialScroll+=r,r=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):t.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(r*=this._bufferService.rows),r},a.prototype._applyScrollModifier=function(t,r){var s=this._optionsService.options.fastScrollModifier;return s==="alt"&&r.altKey||s==="ctrl"&&r.ctrlKey||s==="shift"&&r.shiftKey?t*this._optionsService.options.fastScrollSensitivity*this._optionsService.options.scrollSensitivity:t*this._optionsService.options.scrollSensitivity},a.prototype.onTouchStart=function(t){this._lastTouchY=t.touches[0].pageY},a.prototype.onTouchMove=function(t){var r=this._lastTouchY-t.touches[0].pageY;return this._lastTouchY=t.touches[0].pageY,r!==0&&(this._viewportElement.scrollTop+=r,this._bubbleScroll(t,r))},a=p([E(3,o.IBufferService),E(4,o.IOptionsService),E(5,c.ICharSizeService),E(6,c.IRenderService)],a)}(b.Disposable);L.Viewport=h},function(G,L,I){"use strict";function R(b){return b.replace(/\r?\n/g,"\r")}function M(b,i){return i?"[200~"+b+"[201~":b}function p(b,i,c){b=M(b=R(b),c.decPrivateModes.bracketedPasteMode),c.triggerDataEvent(b,!0),i.value=""}function E(b,i,c){var o=c.getBoundingClientRect(),h=b.clientX-o.left-10,n=b.clientY-o.top-10;i.style.width="20px",i.style.height="20px",i.style.left=h+"px",i.style.top=n+"px",i.style.zIndex="1000",i.focus()}Object.defineProperty(L,"__esModule",{value:!0}),L.rightClickHandler=L.moveTextAreaUnderMouseCursor=L.paste=L.handlePasteEvent=L.copyHandler=L.bracketTextForPaste=L.prepareTextForTerminal=void 0,L.prepareTextForTerminal=R,L.bracketTextForPaste=M,L.copyHandler=function(b,i){b.clipboardData&&b.clipboardData.setData("text/plain",i.selectionText),b.preventDefault()},L.handlePasteEvent=function(b,i,c){b.stopPropagation(),b.clipboardData&&p(b.clipboardData.getData("text/plain"),i,c)},L.paste=p,L.moveTextAreaUnderMouseCursor=E,L.rightClickHandler=function(b,i,c,o,h){E(b,i,c),h&&!o.isClickInSelection(b)&&o.selectWordAtCursor(b),i.value=o.selectionText,i.select()}},function(G,L,I){"use strict";var R,M=this&&this.__extends||(R=function(n,a){return(R=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,r){t.__proto__=r}||function(t,r){for(var s in r)r.hasOwnProperty(s)&&(t[s]=r[s])})(n,a)},function(n,a){function t(){this.constructor=n}R(n,a),n.prototype=a===null?Object.create(a):(t.prototype=a.prototype,new t)});Object.defineProperty(L,"__esModule",{value:!0}),L.EscapeSequenceParser=L.VT500_TRANSITION_TABLE=L.TransitionTable=void 0;var p=I(2),E=I(15),b=I(21),i=I(22),c=I(24),o=function(){function n(a){this.table=new Uint8Array(a)}return n.prototype.setDefault=function(a,t){E.fill(this.table,a<<4|t)},n.prototype.add=function(a,t,r,s){this.table[t<<8|a]=r<<4|s},n.prototype.addMany=function(a,t,r,s){for(var u=0;u<a.length;u++)this.table[t<<8|a[u]]=r<<4|s},n}();L.TransitionTable=o,L.VT500_TRANSITION_TABLE=function(){var n=new o(4095),a=Array.apply(null,Array(256)).map(function(f,v){return v}),t=function(f,v){return a.slice(f,v)},r=t(32,127),s=t(0,24);s.push(25),s.push.apply(s,t(28,32));var u,d=t(0,14);for(u in n.setDefault(1,0),n.addMany(r,0,2,0),d)n.addMany([24,26,153,154],u,3,0),n.addMany(t(128,144),u,3,0),n.addMany(t(144,152),u,3,0),n.add(156,u,0,0),n.add(27,u,11,1),n.add(157,u,4,8),n.addMany([152,158,159],u,0,7),n.add(155,u,11,3),n.add(144,u,11,9);return n.addMany(s,0,3,0),n.addMany(s,1,3,1),n.add(127,1,0,1),n.addMany(s,8,0,8),n.addMany(s,3,3,3),n.add(127,3,0,3),n.addMany(s,4,3,4),n.add(127,4,0,4),n.addMany(s,6,3,6),n.addMany(s,5,3,5),n.add(127,5,0,5),n.addMany(s,2,3,2),n.add(127,2,0,2),n.add(93,1,4,8),n.addMany(r,8,5,8),n.add(127,8,5,8),n.addMany([156,27,24,26,7],8,6,0),n.addMany(t(28,32),8,0,8),n.addMany([88,94,95],1,0,7),n.addMany(r,7,0,7),n.addMany(s,7,0,7),n.add(156,7,0,0),n.add(127,7,0,7),n.add(91,1,11,3),n.addMany(t(64,127),3,7,0),n.addMany(t(48,60),3,8,4),n.addMany([60,61,62,63],3,9,4),n.addMany(t(48,60),4,8,4),n.addMany(t(64,127),4,7,0),n.addMany([60,61,62,63],4,0,6),n.addMany(t(32,64),6,0,6),n.add(127,6,0,6),n.addMany(t(64,127),6,0,0),n.addMany(t(32,48),3,9,5),n.addMany(t(32,48),5,9,5),n.addMany(t(48,64),5,0,6),n.addMany(t(64,127),5,7,0),n.addMany(t(32,48),4,9,5),n.addMany(t(32,48),1,9,2),n.addMany(t(32,48),2,9,2),n.addMany(t(48,127),2,10,0),n.addMany(t(48,80),1,10,0),n.addMany(t(81,88),1,10,0),n.addMany([89,90,92],1,10,0),n.addMany(t(96,127),1,10,0),n.add(80,1,11,9),n.addMany(s,9,0,9),n.add(127,9,0,9),n.addMany(t(28,32),9,0,9),n.addMany(t(32,48),9,9,12),n.addMany(t(48,60),9,8,10),n.addMany([60,61,62,63],9,9,10),n.addMany(s,11,0,11),n.addMany(t(32,128),11,0,11),n.addMany(t(28,32),11,0,11),n.addMany(s,10,0,10),n.add(127,10,0,10),n.addMany(t(28,32),10,0,10),n.addMany(t(48,60),10,8,10),n.addMany([60,61,62,63],10,0,11),n.addMany(t(32,48),10,9,12),n.addMany(s,12,0,12),n.add(127,12,0,12),n.addMany(t(28,32),12,0,12),n.addMany(t(32,48),12,9,12),n.addMany(t(48,64),12,0,11),n.addMany(t(64,127),12,12,13),n.addMany(t(64,127),10,12,13),n.addMany(t(64,127),9,12,13),n.addMany(s,13,13,13),n.addMany(r,13,13,13),n.add(127,13,0,13),n.addMany([27,156,24,26],13,14,0),n.add(160,0,2,0),n.add(160,8,5,8),n.add(160,6,0,6),n.add(160,11,0,11),n.add(160,13,13,13),n}();var h=function(n){function a(t){t===void 0&&(t=L.VT500_TRANSITION_TABLE);var r=n.call(this)||this;return r._transitions=t,r.initialState=0,r.currentState=r.initialState,r._params=new b.Params,r._params.addParam(0),r._collect=0,r.precedingCodepoint=0,r._printHandlerFb=function(s,u,d){},r._executeHandlerFb=function(s){},r._csiHandlerFb=function(s,u){},r._escHandlerFb=function(s){},r._errorHandlerFb=function(s){return s},r._printHandler=r._printHandlerFb,r._executeHandlers=Object.create(null),r._csiHandlers=Object.create(null),r._escHandlers=Object.create(null),r._oscParser=new i.OscParser,r._dcsParser=new c.DcsParser,r._errorHandler=r._errorHandlerFb,r.setEscHandler({final:"\\"},function(){}),r}return M(a,n),a.prototype._identifier=function(t,r){r===void 0&&(r=[64,126]);var s=0;if(t.prefix){if(t.prefix.length>1)throw new Error("only one byte as prefix supported");if((s=t.prefix.charCodeAt(0))&&60>s||s>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(t.intermediates){if(t.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(var u=0;u<t.intermediates.length;++u){var d=t.intermediates.charCodeAt(u);if(32>d||d>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");s<<=8,s|=d}}if(t.final.length!==1)throw new Error("final must be a single byte");var f=t.final.charCodeAt(0);if(r[0]>f||f>r[1])throw new Error("final must be in range "+r[0]+" .. "+r[1]);return s<<=8,s|=f},a.prototype.identToString=function(t){for(var r=[];t;)r.push(String.fromCharCode(255&t)),t>>=8;return r.reverse().join("")},a.prototype.dispose=function(){this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null),this._oscParser.dispose(),this._dcsParser.dispose()},a.prototype.setPrintHandler=function(t){this._printHandler=t},a.prototype.clearPrintHandler=function(){this._printHandler=this._printHandlerFb},a.prototype.addEscHandler=function(t,r){var s=this._identifier(t,[48,126]);this._escHandlers[s]===void 0&&(this._escHandlers[s]=[]);var u=this._escHandlers[s];return u.push(r),{dispose:function(){var d=u.indexOf(r);d!==-1&&u.splice(d,1)}}},a.prototype.setEscHandler=function(t,r){this._escHandlers[this._identifier(t,[48,126])]=[r]},a.prototype.clearEscHandler=function(t){this._escHandlers[this._identifier(t,[48,126])]&&delete this._escHandlers[this._identifier(t,[48,126])]},a.prototype.setEscHandlerFallback=function(t){this._escHandlerFb=t},a.prototype.setExecuteHandler=function(t,r){this._executeHandlers[t.charCodeAt(0)]=r},a.prototype.clearExecuteHandler=function(t){this._executeHandlers[t.charCodeAt(0)]&&delete this._executeHandlers[t.charCodeAt(0)]},a.prototype.setExecuteHandlerFallback=function(t){this._executeHandlerFb=t},a.prototype.addCsiHandler=function(t,r){var s=this._identifier(t);this._csiHandlers[s]===void 0&&(this._csiHandlers[s]=[]);var u=this._csiHandlers[s];return u.push(r),{dispose:function(){var d=u.indexOf(r);d!==-1&&u.splice(d,1)}}},a.prototype.setCsiHandler=function(t,r){this._csiHandlers[this._identifier(t)]=[r]},a.prototype.clearCsiHandler=function(t){this._csiHandlers[this._identifier(t)]&&delete this._csiHandlers[this._identifier(t)]},a.prototype.setCsiHandlerFallback=function(t){this._csiHandlerFb=t},a.prototype.addDcsHandler=function(t,r){return this._dcsParser.addHandler(this._identifier(t),r)},a.prototype.setDcsHandler=function(t,r){this._dcsParser.setHandler(this._identifier(t),r)},a.prototype.clearDcsHandler=function(t){this._dcsParser.clearHandler(this._identifier(t))},a.prototype.setDcsHandlerFallback=function(t){this._dcsParser.setHandlerFallback(t)},a.prototype.addOscHandler=function(t,r){return this._oscParser.addHandler(t,r)},a.prototype.setOscHandler=function(t,r){this._oscParser.setHandler(t,r)},a.prototype.clearOscHandler=function(t){this._oscParser.clearHandler(t)},a.prototype.setOscHandlerFallback=function(t){this._oscParser.setHandlerFallback(t)},a.prototype.setErrorHandler=function(t){this._errorHandler=t},a.prototype.clearErrorHandler=function(){this._errorHandler=this._errorHandlerFb},a.prototype.reset=function(){this.currentState=this.initialState,this._oscParser.reset(),this._dcsParser.reset(),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingCodepoint=0},a.prototype.parse=function(t,r){for(var s=0,u=0,d=this.currentState,f=this._oscParser,v=this._dcsParser,m=this._collect,S=this._params,C=this._transitions.table,_=0;_<r;++_){switch((u=C[d<<8|((s=t[_])<160?s:160)])>>4){case 2:for(var y=_+1;;++y){if(y>=r||(s=t[y])<32||s>126&&s<160){this._printHandler(t,_,y),_=y-1;break}if(++y>=r||(s=t[y])<32||s>126&&s<160){this._printHandler(t,_,y),_=y-1;break}if(++y>=r||(s=t[y])<32||s>126&&s<160){this._printHandler(t,_,y),_=y-1;break}if(++y>=r||(s=t[y])<32||s>126&&s<160){this._printHandler(t,_,y),_=y-1;break}}break;case 3:this._executeHandlers[s]?this._executeHandlers[s]():this._executeHandlerFb(s),this.precedingCodepoint=0;break;case 0:break;case 1:if(this._errorHandler({position:_,code:s,currentState:d,collect:m,params:S,abort:!1}).abort)return;break;case 7:for(var T=this._csiHandlers[m<<8|s],O=T?T.length-1:-1;O>=0&&T[O](S)===!1;O--);O<0&&this._csiHandlerFb(m<<8|s,S),this.precedingCodepoint=0;break;case 8:do switch(s){case 59:S.addParam(0);break;case 58:S.addSubParam(-1);break;default:S.addDigit(s-48)}while(++_<r&&(s=t[_])>47&&s<60);_--;break;case 9:m<<=8,m|=s;break;case 10:for(var g=this._escHandlers[m<<8|s],F=g?g.length-1:-1;F>=0&&g[F]()===!1;F--);F<0&&this._escHandlerFb(m<<8|s),this.precedingCodepoint=0;break;case 11:S.reset(),S.addParam(0),m=0;break;case 12:v.hook(m<<8|s,S);break;case 13:for(var P=_+1;;++P)if(P>=r||(s=t[P])===24||s===26||s===27||s>127&&s<160){v.put(t,_,P),_=P-1;break}break;case 14:v.unhook(s!==24&&s!==26),s===27&&(u|=1),S.reset(),S.addParam(0),m=0,this.precedingCodepoint=0;break;case 4:f.start();break;case 5:for(var N=_+1;;N++)if(N>=r||(s=t[N])<32||s>127&&s<=159){f.put(t,_,N),_=N-1;break}break;case 6:f.end(s!==24&&s!==26),s===27&&(u|=1),S.reset(),S.addParam(0),m=0,this.precedingCodepoint=0}d=15&u}this._collect=m,this.currentState=d},a}(p.Disposable);L.EscapeSequenceParser=h},function(G,L,I){"use strict";var R,M=this&&this.__extends||(R=function(f,v){return(R=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(m,S){m.__proto__=S}||function(m,S){for(var C in S)S.hasOwnProperty(C)&&(m[C]=S[C])})(f,v)},function(f,v){function m(){this.constructor=f}R(f,v),f.prototype=v===null?Object.create(v):(m.prototype=v.prototype,new m)}),p=this&&this.__decorate||function(f,v,m,S){var C,_=arguments.length,y=_<3?v:S===null?S=Object.getOwnPropertyDescriptor(v,m):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(f,v,m,S);else for(var T=f.length-1;T>=0;T--)(C=f[T])&&(y=(_<3?C(y):_>3?C(v,m,y):C(v,m))||y);return _>3&&y&&Object.defineProperty(v,m,y),y},E=this&&this.__param||function(f,v){return function(m,S){v(m,S,f)}};Object.defineProperty(L,"__esModule",{value:!0}),L.Renderer=void 0;var b=I(41),i=I(47),c=I(48),o=I(49),h=I(29),n=I(2),a=I(5),t=I(1),r=I(25),s=I(0),u=1,d=function(f){function v(m,S,C,_,y,T,O,g,F){var P=f.call(this)||this;P._colors=m,P._screenElement=S,P._bufferService=y,P._charSizeService=T,P._optionsService=O,P._id=u++,P._onRequestRedraw=new s.EventEmitter;var N=P._optionsService.options.allowTransparency;return P._characterJoinerRegistry=new h.CharacterJoinerRegistry(P._bufferService),P._renderLayers=[new b.TextRenderLayer(P._screenElement,0,P._colors,P._characterJoinerRegistry,N,P._id,P._bufferService,O),new i.SelectionRenderLayer(P._screenElement,1,P._colors,P._id,P._bufferService,O),new o.LinkRenderLayer(P._screenElement,2,P._colors,P._id,C,_,P._bufferService,O),new c.CursorRenderLayer(P._screenElement,3,P._colors,P._id,P._onRequestRedraw,P._bufferService,O,g,F)],P.dimensions={scaledCharWidth:0,scaledCharHeight:0,scaledCellWidth:0,scaledCellHeight:0,scaledCharLeft:0,scaledCharTop:0,scaledCanvasWidth:0,scaledCanvasHeight:0,canvasWidth:0,canvasHeight:0,actualCellWidth:0,actualCellHeight:0},P._devicePixelRatio=window.devicePixelRatio,P._updateDimensions(),P.onOptionsChanged(),P}return M(v,f),Object.defineProperty(v.prototype,"onRequestRedraw",{get:function(){return this._onRequestRedraw.event},enumerable:!1,configurable:!0}),v.prototype.dispose=function(){for(var m=0,S=this._renderLayers;m<S.length;m++)S[m].dispose();f.prototype.dispose.call(this),r.removeTerminalFromCache(this._id)},v.prototype.onDevicePixelRatioChange=function(){this._devicePixelRatio!==window.devicePixelRatio&&(this._devicePixelRatio=window.devicePixelRatio,this.onResize(this._bufferService.cols,this._bufferService.rows))},v.prototype.setColors=function(m){this._colors=m;for(var S=0,C=this._renderLayers;S<C.length;S++){var _=C[S];_.setColors(this._colors),_.reset()}},v.prototype.onResize=function(m,S){this._updateDimensions();for(var C=0,_=this._renderLayers;C<_.length;C++)_[C].resize(this.dimensions);this._screenElement.style.width=this.dimensions.canvasWidth+"px",this._screenElement.style.height=this.dimensions.canvasHeight+"px"},v.prototype.onCharSizeChanged=function(){this.onResize(this._bufferService.cols,this._bufferService.rows)},v.prototype.onBlur=function(){this._runOperation(function(m){return m.onBlur()})},v.prototype.onFocus=function(){this._runOperation(function(m){return m.onFocus()})},v.prototype.onSelectionChanged=function(m,S,C){C===void 0&&(C=!1),this._runOperation(function(_){return _.onSelectionChanged(m,S,C)})},v.prototype.onCursorMove=function(){this._runOperation(function(m){return m.onCursorMove()})},v.prototype.onOptionsChanged=function(){this._runOperation(function(m){return m.onOptionsChanged()})},v.prototype.clear=function(){this._runOperation(function(m){return m.reset()})},v.prototype._runOperation=function(m){for(var S=0,C=this._renderLayers;S<C.length;S++)m(C[S])},v.prototype.renderRows=function(m,S){for(var C=0,_=this._renderLayers;C<_.length;C++)_[C].onGridChanged(m,S)},v.prototype._updateDimensions=function(){this._charSizeService.hasValidSize&&(this.dimensions.scaledCharWidth=Math.floor(this._charSizeService.width*window.devicePixelRatio),this.dimensions.scaledCharHeight=Math.ceil(this._charSizeService.height*window.devicePixelRatio),this.dimensions.scaledCellHeight=Math.floor(this.dimensions.scaledCharHeight*this._optionsService.options.lineHeight),this.dimensions.scaledCharTop=this._optionsService.options.lineHeight===1?0:Math.round((this.dimensions.scaledCellHeight-this.dimensions.scaledCharHeight)/2),this.dimensions.scaledCellWidth=this.dimensions.scaledCharWidth+Math.round(this._optionsService.options.letterSpacing),this.dimensions.scaledCharLeft=Math.floor(this._optionsService.options.letterSpacing/2),this.dimensions.scaledCanvasHeight=this._bufferService.rows*this.dimensions.scaledCellHeight,this.dimensions.scaledCanvasWidth=this._bufferService.cols*this.dimensions.scaledCellWidth,this.dimensions.canvasHeight=Math.round(this.dimensions.scaledCanvasHeight/window.devicePixelRatio),this.dimensions.canvasWidth=Math.round(this.dimensions.scaledCanvasWidth/window.devicePixelRatio),this.dimensions.actualCellHeight=this.dimensions.canvasHeight/this._bufferService.rows,this.dimensions.actualCellWidth=this.dimensions.canvasWidth/this._bufferService.cols)},v.prototype.registerCharacterJoiner=function(m){return this._characterJoinerRegistry.registerCharacterJoiner(m)},v.prototype.deregisterCharacterJoiner=function(m){return this._characterJoinerRegistry.deregisterCharacterJoiner(m)},v=p([E(4,t.IBufferService),E(5,a.ICharSizeService),E(6,t.IOptionsService),E(7,t.ICoreService),E(8,a.ICoreBrowserService)],v)}(n.Disposable);L.Renderer=d},function(G,L,I){"use strict";var R,M=this&&this.__extends||(R=function(n,a){return(R=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,r){t.__proto__=r}||function(t,r){for(var s in r)r.hasOwnProperty(s)&&(t[s]=r[s])})(n,a)},function(n,a){function t(){this.constructor=n}R(n,a),n.prototype=a===null?Object.create(a):(t.prototype=a.prototype,new t)});Object.defineProperty(L,"__esModule",{value:!0}),L.TextRenderLayer=void 0;var p=I(42),E=I(13),b=I(6),i=I(3),c=I(29),o=I(4),h=function(n){function a(t,r,s,u,d,f,v,m){var S=n.call(this,t,"text",r,d,s,f,v,m)||this;return S._characterWidth=0,S._characterFont="",S._characterOverlapCache={},S._workCell=new o.CellData,S._state=new p.GridCache,S._characterJoinerRegistry=u,S}return M(a,n),a.prototype.resize=function(t){n.prototype.resize.call(this,t);var r=this._getFont(!1,!1);this._characterWidth===t.scaledCharWidth&&this._characterFont===r||(this._characterWidth=t.scaledCharWidth,this._characterFont=r,this._characterOverlapCache={}),this._state.clear(),this._state.resize(this._bufferService.cols,this._bufferService.rows)},a.prototype.reset=function(){this._state.clear(),this._clearAll()},a.prototype._forEachCell=function(t,r,s,u){for(var d=t;d<=r;d++)for(var f=d+this._bufferService.buffer.ydisp,v=this._bufferService.buffer.lines.get(f),m=s?s.getJoinedCharacters(f):[],S=0;S<this._bufferService.cols;S++){v.loadCell(S,this._workCell);var C=this._workCell,_=!1,y=S;if(C.getWidth()!==0){if(m.length>0&&S===m[0][0]){_=!0;var T=m.shift();C=new c.JoinedCellData(this._workCell,v.translateToString(!0,T[0],T[1]),T[1]-T[0]),y=T[1]-1}!_&&this._isOverlapping(C)&&y<v.length-1&&v.getCodePoint(y+1)===i.NULL_CELL_CODE&&(C.content&=-12582913,C.content|=2<<22),u(C,S,d),S=y}}},a.prototype._drawBackground=function(t,r){var s=this,u=this._ctx,d=this._bufferService.cols,f=0,v=0,m=null;u.save(),this._forEachCell(t,r,null,function(S,C,_){var y=null;S.isInverse()?y=S.isFgDefault()?s._colors.foreground.css:S.isFgRGB()?"rgb("+b.AttributeData.toColorRGB(S.getFgColor()).join(",")+")":s._colors.ansi[S.getFgColor()].css:S.isBgRGB()?y="rgb("+b.AttributeData.toColorRGB(S.getBgColor()).join(",")+")":S.isBgPalette()&&(y=s._colors.ansi[S.getBgColor()].css),m===null&&(f=C,v=_),_!==v?(u.fillStyle=m||"",s._fillCells(f,v,d-f,1),f=C,v=_):m!==y&&(u.fillStyle=m||"",s._fillCells(f,v,C-f,1),f=C,v=_),m=y}),m!==null&&(u.fillStyle=m,this._fillCells(f,v,d-f,1)),u.restore()},a.prototype._drawForeground=function(t,r){var s=this;this._forEachCell(t,r,this._characterJoinerRegistry,function(u,d,f){if(!u.isInvisible()&&(s._drawChars(u,d,f),u.isUnderline())){if(s._ctx.save(),u.isInverse())if(u.isBgDefault())s._ctx.fillStyle=s._colors.background.css;else if(u.isBgRGB())s._ctx.fillStyle="rgb("+b.AttributeData.toColorRGB(u.getBgColor()).join(",")+")";else{var v=u.getBgColor();s._optionsService.options.drawBoldTextInBrightColors&&u.isBold()&&v<8&&(v+=8),s._ctx.fillStyle=s._colors.ansi[v].css}else if(u.isFgDefault())s._ctx.fillStyle=s._colors.foreground.css;else if(u.isFgRGB())s._ctx.fillStyle="rgb("+b.AttributeData.toColorRGB(u.getFgColor()).join(",")+")";else{var m=u.getFgColor();s._optionsService.options.drawBoldTextInBrightColors&&u.isBold()&&m<8&&(m+=8),s._ctx.fillStyle=s._colors.ansi[m].css}s._fillBottomLineAtCells(d,f,u.getWidth()),s._ctx.restore()}})},a.prototype.onGridChanged=function(t,r){this._state.cache.length!==0&&(this._charAtlas&&this._charAtlas.beginFrame(),this._clearCells(0,t,this._bufferService.cols,r-t+1),this._drawBackground(t,r),this._drawForeground(t,r))},a.prototype.onOptionsChanged=function(){this._setTransparency(this._optionsService.options.allowTransparency)},a.prototype._isOverlapping=function(t){if(t.getWidth()!==1)return!1;if(t.getCode()<256)return!1;var r=t.getChars();if(this._characterOverlapCache.hasOwnProperty(r))return this._characterOverlapCache[r];this._ctx.save(),this._ctx.font=this._characterFont;var s=Math.floor(this._ctx.measureText(r).width)>this._characterWidth;return this._ctx.restore(),this._characterOverlapCache[r]=s,s},a}(E.BaseRenderLayer);L.TextRenderLayer=h},function(G,L,I){"use strict";Object.defineProperty(L,"__esModule",{value:!0}),L.GridCache=void 0;var R=function(){function M(){this.cache=[]}return M.prototype.resize=function(p,E){for(var b=0;b<p;b++){this.cache.length<=b&&this.cache.push([]);for(var i=this.cache[b].length;i<E;i++)this.cache[b].push(void 0);this.cache[b].length=E}this.cache.length=p},M.prototype.clear=function(){for(var p=0;p<this.cache.length;p++)for(var E=0;E<this.cache[p].length;E++)this.cache[p][E]=void 0},M}();L.GridCache=R},function(G,L,I){"use strict";var R,M=this&&this.__extends||(R=function(s,u){return(R=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,f){d.__proto__=f}||function(d,f){for(var v in f)f.hasOwnProperty(v)&&(d[v]=f[v])})(s,u)},function(s,u){function d(){this.constructor=s}R(s,u),s.prototype=u===null?Object.create(u):(d.prototype=u.prototype,new d)});Object.defineProperty(L,"__esModule",{value:!0}),L.NoneCharAtlas=L.DynamicCharAtlas=L.getGlyphCacheKey=void 0;var p=I(9),E=I(44),b=I(27),i=I(46),c=I(11),o=I(28),h=I(10),n={css:"rgba(0, 0, 0, 0)",rgba:0};function a(s){return s.code<<21|s.bg<<12|s.fg<<3|(s.bold?0:4)+(s.dim?0:2)+(s.italic?0:1)}L.getGlyphCacheKey=a;var t=function(s){function u(d,f){var v=s.call(this)||this;v._config=f,v._drawToCacheCount=0,v._glyphsWaitingOnBitmap=[],v._bitmapCommitTimeout=null,v._bitmap=null,v._cacheCanvas=d.createElement("canvas"),v._cacheCanvas.width=1024,v._cacheCanvas.height=1024,v._cacheCtx=o.throwIfFalsy(v._cacheCanvas.getContext("2d",{alpha:!0}));var m=d.createElement("canvas");m.width=v._config.scaledCharWidth,m.height=v._config.scaledCharHeight,v._tmpCtx=o.throwIfFalsy(m.getContext("2d",{alpha:v._config.allowTransparency})),v._width=Math.floor(1024/v._config.scaledCharWidth),v._height=Math.floor(1024/v._config.scaledCharHeight);var S=v._width*v._height;return v._cacheMap=new i.LRUMap(S),v._cacheMap.prealloc(S),v}return M(u,s),u.prototype.dispose=function(){this._bitmapCommitTimeout!==null&&(window.clearTimeout(this._bitmapCommitTimeout),this._bitmapCommitTimeout=null)},u.prototype.beginFrame=function(){this._drawToCacheCount=0},u.prototype.draw=function(d,f,v,m){if(f.code===32)return!0;if(!this._canCache(f))return!1;var S=a(f),C=this._cacheMap.get(S);if(C!=null)return this._drawFromCache(d,C,v,m),!0;if(this._drawToCacheCount<100){var _=void 0;_=this._cacheMap.size<this._cacheMap.capacity?this._cacheMap.size:this._cacheMap.peek().index;var y=this._drawToCache(f,_);return this._cacheMap.set(S,y),this._drawFromCache(d,y,v,m),!0}return!1},u.prototype._canCache=function(d){return d.code<256},u.prototype._toCoordinateX=function(d){return d%this._width*this._config.scaledCharWidth},u.prototype._toCoordinateY=function(d){return Math.floor(d/this._width)*this._config.scaledCharHeight},u.prototype._drawFromCache=function(d,f,v,m){if(!f.isEmpty){var S=this._toCoordinateX(f.index),C=this._toCoordinateY(f.index);d.drawImage(f.inBitmap?this._bitmap:this._cacheCanvas,S,C,this._config.scaledCharWidth,this._config.scaledCharHeight,v,m,this._config.scaledCharWidth,this._config.scaledCharHeight)}},u.prototype._getColorFromAnsiIndex=function(d){return d<this._config.colors.ansi.length?this._config.colors.ansi[d]:b.DEFAULT_ANSI_COLORS[d]},u.prototype._getBackgroundColor=function(d){return this._config.allowTransparency?n:d.bg===p.INVERTED_DEFAULT_COLOR?this._config.colors.foreground:d.bg<256?this._getColorFromAnsiIndex(d.bg):this._config.colors.background},u.prototype._getForegroundColor=function(d){return d.fg===p.INVERTED_DEFAULT_COLOR?h.color.opaque(this._config.colors.background):d.fg<256?this._getColorFromAnsiIndex(d.fg):this._config.colors.foreground},u.prototype._drawToCache=function(d,f){this._drawToCacheCount++,this._tmpCtx.save();var v=this._getBackgroundColor(d);this._tmpCtx.globalCompositeOperation="copy",this._tmpCtx.fillStyle=v.css,this._tmpCtx.fillRect(0,0,this._config.scaledCharWidth,this._config.scaledCharHeight),this._tmpCtx.globalCompositeOperation="source-over";var m=d.bold?this._config.fontWeightBold:this._config.fontWeight,S=d.italic?"italic":"";this._tmpCtx.font=S+" "+m+" "+this._config.fontSize*this._config.devicePixelRatio+"px "+this._config.fontFamily,this._tmpCtx.textBaseline="middle",this._tmpCtx.fillStyle=this._getForegroundColor(d).css,d.dim&&(this._tmpCtx.globalAlpha=p.DIM_OPACITY),this._tmpCtx.fillText(d.chars,0,this._config.scaledCharHeight/2),this._tmpCtx.restore();var C=this._tmpCtx.getImageData(0,0,this._config.scaledCharWidth,this._config.scaledCharHeight),_=!1;this._config.allowTransparency||(_=function(g,F){for(var P=!0,N=F.rgba>>>24,X=F.rgba>>>16&255,j=F.rgba>>>8&255,A=0;A<g.data.length;A+=4)g.data[A]===N&&g.data[A+1]===X&&g.data[A+2]===j?g.data[A+3]=0:P=!1;return P}(C,v));var y=this._toCoordinateX(f),T=this._toCoordinateY(f);this._cacheCtx.putImageData(C,y,T);var O={index:f,isEmpty:_,inBitmap:!1};return this._addGlyphToBitmap(O),O},u.prototype._addGlyphToBitmap=function(d){var f=this;!("createImageBitmap"in window)||c.isFirefox||c.isSafari||(this._glyphsWaitingOnBitmap.push(d),this._bitmapCommitTimeout===null&&(this._bitmapCommitTimeout=window.setTimeout(function(){return f._generateBitmap()},100)))},u.prototype._generateBitmap=function(){var d=this,f=this._glyphsWaitingOnBitmap;this._glyphsWaitingOnBitmap=[],window.createImageBitmap(this._cacheCanvas).then(function(v){d._bitmap=v;for(var m=0;m<f.length;m++)f[m].inBitmap=!0}),this._bitmapCommitTimeout=null},u}(E.BaseCharAtlas);L.DynamicCharAtlas=t;var r=function(s){function u(d,f){return s.call(this)||this}return M(u,s),u.prototype.draw=function(d,f,v,m){return!1},u}(E.BaseCharAtlas);L.NoneCharAtlas=r},function(G,L,I){"use strict";Object.defineProperty(L,"__esModule",{value:!0}),L.BaseCharAtlas=void 0;var R=function(){function M(){this._didWarmUp=!1}return M.prototype.dispose=function(){},M.prototype.warmUp=function(){this._didWarmUp||(this._doWarmUp(),this._didWarmUp=!0)},M.prototype._doWarmUp=function(){},M.prototype.beginFrame=function(){},M}();L.BaseCharAtlas=R},function(G,L,I){"use strict";Object.defineProperty(L,"__esModule",{value:!0}),L.ColorContrastCache=void 0;var R=function(){function M(){this._color={},this._rgba={}}return M.prototype.clear=function(){this._color={},this._rgba={}},M.prototype.setCss=function(p,E,b){this._rgba[p]||(this._rgba[p]={}),this._rgba[p][E]=b},M.prototype.getCss=function(p,E){return this._rgba[p]?this._rgba[p][E]:void 0},M.prototype.setColor=function(p,E,b){this._color[p]||(this._color[p]={}),this._color[p][E]=b},M.prototype.getColor=function(p,E){return this._color[p]?this._color[p][E]:void 0},M}();L.ColorContrastCache=R},function(G,L,I){"use strict";Object.defineProperty(L,"__esModule",{value:!0}),L.LRUMap=void 0;var R=function(){function M(p){this.capacity=p,this._map={},this._head=null,this._tail=null,this._nodePool=[],this.size=0}return M.prototype._unlinkNode=function(p){var E=p.prev,b=p.next;p===this._head&&(this._head=b),p===this._tail&&(this._tail=E),E!==null&&(E.next=b),b!==null&&(b.prev=E)},M.prototype._appendNode=function(p){var E=this._tail;E!==null&&(E.next=p),p.prev=E,p.next=null,this._tail=p,this._head===null&&(this._head=p)},M.prototype.prealloc=function(p){for(var E=this._nodePool,b=0;b<p;b++)E.push({prev:null,next:null,key:null,value:null})},M.prototype.get=function(p){var E=this._map[p];return E!==void 0?(this._unlinkNode(E),this._appendNode(E),E.value):null},M.prototype.peekValue=function(p){var E=this._map[p];return E!==void 0?E.value:null},M.prototype.peek=function(){var p=this._head;return p===null?null:p.value},M.prototype.set=function(p,E){var b=this._map[p];if(b!==void 0)b=this._map[p],this._unlinkNode(b),b.value=E;else if(this.size>=this.capacity)b=this._head,this._unlinkNode(b),delete this._map[b.key],b.key=p,b.value=E,this._map[p]=b;else{var i=this._nodePool;i.length>0?((b=i.pop()).key=p,b.value=E):b={prev:null,next:null,key:p,value:E},this._map[p]=b,this.size++}this._appendNode(b)},M}();L.LRUMap=R},function(G,L,I){"use strict";var R,M=this&&this.__extends||(R=function(E,b){return(R=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,c){i.__proto__=c}||function(i,c){for(var o in c)c.hasOwnProperty(o)&&(i[o]=c[o])})(E,b)},function(E,b){function i(){this.constructor=E}R(E,b),E.prototype=b===null?Object.create(b):(i.prototype=b.prototype,new i)});Object.defineProperty(L,"__esModule",{value:!0}),L.SelectionRenderLayer=void 0;var p=function(E){function b(i,c,o,h,n,a){var t=E.call(this,i,"selection",c,!0,o,h,n,a)||this;return t._clearState(),t}return M(b,E),b.prototype._clearState=function(){this._state={start:void 0,end:void 0,columnSelectMode:void 0,ydisp:void 0}},b.prototype.resize=function(i){E.prototype.resize.call(this,i),this._clearState()},b.prototype.reset=function(){this._state.start&&this._state.end&&(this._clearState(),this._clearAll())},b.prototype.onSelectionChanged=function(i,c,o){if(this._didStateChange(i,c,o,this._bufferService.buffer.ydisp))if(this._clearAll(),i&&c){var h=i[1]-this._bufferService.buffer.ydisp,n=c[1]-this._bufferService.buffer.ydisp,a=Math.max(h,0),t=Math.min(n,this._bufferService.rows-1);if(!(a>=this._bufferService.rows||t<0)){if(this._ctx.fillStyle=this._colors.selectionTransparent.css,o){var r=i[0],s=c[0]-r,u=t-a+1;this._fillCells(r,a,s,u)}else{r=h===a?i[0]:0;var d=a===t?c[0]:this._bufferService.cols;this._fillCells(r,a,d-r,1);var f=Math.max(t-a-1,0);if(this._fillCells(0,a+1,this._bufferService.cols,f),a!==t){var v=n===t?c[0]:this._bufferService.cols;this._fillCells(0,t,v,1)}}this._state.start=[i[0],i[1]],this._state.end=[c[0],c[1]],this._state.columnSelectMode=o,this._state.ydisp=this._bufferService.buffer.ydisp}}else this._clearState()},b.prototype._didStateChange=function(i,c,o,h){return!this._areCoordinatesEqual(i,this._state.start)||!this._areCoordinatesEqual(c,this._state.end)||o!==this._state.columnSelectMode||h!==this._state.ydisp},b.prototype._areCoordinatesEqual=function(i,c){return!(!i||!c)&&i[0]===c[0]&&i[1]===c[1]},b}(I(13).BaseRenderLayer);L.SelectionRenderLayer=p},function(G,L,I){"use strict";var R,M=this&&this.__extends||(R=function(c,o){return(R=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(h,n){h.__proto__=n}||function(h,n){for(var a in n)n.hasOwnProperty(a)&&(h[a]=n[a])})(c,o)},function(c,o){function h(){this.constructor=c}R(c,o),c.prototype=o===null?Object.create(o):(h.prototype=o.prototype,new h)});Object.defineProperty(L,"__esModule",{value:!0}),L.CursorRenderLayer=void 0;var p=I(13),E=I(4),b=function(c){function o(h,n,a,t,r,s,u,d,f){var v=c.call(this,h,"cursor",n,!0,a,t,s,u)||this;return v._onRequestRedraw=r,v._coreService=d,v._coreBrowserService=f,v._cell=new E.CellData,v._state={x:0,y:0,isFocused:!1,style:"",width:0},v._cursorRenderers={bar:v._renderBarCursor.bind(v),block:v._renderBlockCursor.bind(v),underline:v._renderUnderlineCursor.bind(v)},v}return M(o,c),o.prototype.resize=function(h){c.prototype.resize.call(this,h),this._state={x:0,y:0,isFocused:!1,style:"",width:0}},o.prototype.reset=function(){this._clearCursor(),this._cursorBlinkStateManager&&(this._cursorBlinkStateManager.dispose(),this._cursorBlinkStateManager=void 0,this.onOptionsChanged())},o.prototype.onBlur=function(){this._cursorBlinkStateManager&&this._cursorBlinkStateManager.pause(),this._onRequestRedraw.fire({start:this._bufferService.buffer.y,end:this._bufferService.buffer.y})},o.prototype.onFocus=function(){this._cursorBlinkStateManager?this._cursorBlinkStateManager.resume():this._onRequestRedraw.fire({start:this._bufferService.buffer.y,end:this._bufferService.buffer.y})},o.prototype.onOptionsChanged=function(){var h,n=this;this._optionsService.options.cursorBlink?this._cursorBlinkStateManager||(this._cursorBlinkStateManager=new i(this._coreBrowserService.isFocused,function(){n._render(!0)})):((h=this._cursorBlinkStateManager)===null||h===void 0||h.dispose(),this._cursorBlinkStateManager=void 0),this._onRequestRedraw.fire({start:this._bufferService.buffer.y,end:this._bufferService.buffer.y})},o.prototype.onCursorMove=function(){this._cursorBlinkStateManager&&this._cursorBlinkStateManager.restartBlinkAnimation()},o.prototype.onGridChanged=function(h,n){!this._cursorBlinkStateManager||this._cursorBlinkStateManager.isPaused?this._render(!1):this._cursorBlinkStateManager.restartBlinkAnimation()},o.prototype._render=function(h){if(this._coreService.isCursorInitialized&&!this._coreService.isCursorHidden){var n=this._bufferService.buffer.ybase+this._bufferService.buffer.y,a=n-this._bufferService.buffer.ydisp;if(a<0||a>=this._bufferService.rows)this._clearCursor();else{var t=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1);if(this._bufferService.buffer.lines.get(n).loadCell(t,this._cell),this._cell.content!==void 0){if(!this._coreBrowserService.isFocused){this._clearCursor(),this._ctx.save(),this._ctx.fillStyle=this._colors.cursor.css;var r=this._optionsService.options.cursorStyle;return r&&r!=="block"?this._cursorRenderers[r](t,a,this._cell):this._renderBlurCursor(t,a,this._cell),this._ctx.restore(),this._state.x=t,this._state.y=a,this._state.isFocused=!1,this._state.style=r,void(this._state.width=this._cell.getWidth())}if(!this._cursorBlinkStateManager||this._cursorBlinkStateManager.isCursorVisible){if(this._state){if(this._state.x===t&&this._state.y===a&&this._state.isFocused===this._coreBrowserService.isFocused&&this._state.style===this._optionsService.options.cursorStyle&&this._state.width===this._cell.getWidth())return;this._clearCursor()}this._ctx.save(),this._cursorRenderers[this._optionsService.options.cursorStyle||"block"](t,a,this._cell),this._ctx.restore(),this._state.x=t,this._state.y=a,this._state.isFocused=!1,this._state.style=this._optionsService.options.cursorStyle,this._state.width=this._cell.getWidth()}else this._clearCursor()}}}else this._clearCursor()},o.prototype._clearCursor=function(){this._state&&(this._clearCells(this._state.x,this._state.y,this._state.width,1),this._state={x:0,y:0,isFocused:!1,style:"",width:0})},o.prototype._renderBarCursor=function(h,n,a){this._ctx.save(),this._ctx.fillStyle=this._colors.cursor.css,this._fillLeftLineAtCell(h,n,this._optionsService.options.cursorWidth),this._ctx.restore()},o.prototype._renderBlockCursor=function(h,n,a){this._ctx.save(),this._ctx.fillStyle=this._colors.cursor.css,this._fillCells(h,n,a.getWidth(),1),this._ctx.fillStyle=this._colors.cursorAccent.css,this._fillCharTrueColor(a,h,n),this._ctx.restore()},o.prototype._renderUnderlineCursor=function(h,n,a){this._ctx.save(),this._ctx.fillStyle=this._colors.cursor.css,this._fillBottomLineAtCells(h,n),this._ctx.restore()},o.prototype._renderBlurCursor=function(h,n,a){this._ctx.save(),this._ctx.strokeStyle=this._colors.cursor.css,this._strokeRectAtCell(h,n,a.getWidth(),1),this._ctx.restore()},o}(p.BaseRenderLayer);L.CursorRenderLayer=b;var i=function(){function c(o,h){this._renderCallback=h,this.isCursorVisible=!0,o&&this._restartInterval()}return Object.defineProperty(c.prototype,"isPaused",{get:function(){return!(this._blinkStartTimeout||this._blinkInterval)},enumerable:!1,configurable:!0}),c.prototype.dispose=function(){this._blinkInterval&&(window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout&&(window.clearTimeout(this._blinkStartTimeout),this._blinkStartTimeout=void 0),this._animationFrame&&(window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)},c.prototype.restartBlinkAnimation=function(){var o=this;this.isPaused||(this._animationTimeRestarted=Date.now(),this.isCursorVisible=!0,this._animationFrame||(this._animationFrame=window.requestAnimationFrame(function(){o._renderCallback(),o._animationFrame=void 0})))},c.prototype._restartInterval=function(o){var h=this;o===void 0&&(o=600),this._blinkInterval&&window.clearInterval(this._blinkInterval),this._blinkStartTimeout=window.setTimeout(function(){if(h._animationTimeRestarted){var n=600-(Date.now()-h._animationTimeRestarted);if(h._animationTimeRestarted=void 0,n>0)return void h._restartInterval(n)}h.isCursorVisible=!1,h._animationFrame=window.requestAnimationFrame(function(){h._renderCallback(),h._animationFrame=void 0}),h._blinkInterval=window.setInterval(function(){if(h._animationTimeRestarted){var a=600-(Date.now()-h._animationTimeRestarted);return h._animationTimeRestarted=void 0,void h._restartInterval(a)}h.isCursorVisible=!h.isCursorVisible,h._animationFrame=window.requestAnimationFrame(function(){h._renderCallback(),h._animationFrame=void 0})},600)},o)},c.prototype.pause=function(){this.isCursorVisible=!0,this._blinkInterval&&(window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout&&(window.clearTimeout(this._blinkStartTimeout),this._blinkStartTimeout=void 0),this._animationFrame&&(window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)},c.prototype.resume=function(){this.pause(),this._animationTimeRestarted=void 0,this._restartInterval(),this.restartBlinkAnimation()},c}()},function(G,L,I){"use strict";var R,M=this&&this.__extends||(R=function(c,o){return(R=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(h,n){h.__proto__=n}||function(h,n){for(var a in n)n.hasOwnProperty(a)&&(h[a]=n[a])})(c,o)},function(c,o){function h(){this.constructor=c}R(c,o),c.prototype=o===null?Object.create(o):(h.prototype=o.prototype,new h)});Object.defineProperty(L,"__esModule",{value:!0}),L.LinkRenderLayer=void 0;var p=I(13),E=I(9),b=I(26),i=function(c){function o(h,n,a,t,r,s,u,d){var f=c.call(this,h,"link",n,!0,a,t,u,d)||this;return r.onShowLinkUnderline(function(v){return f._onShowLinkUnderline(v)}),r.onHideLinkUnderline(function(v){return f._onHideLinkUnderline(v)}),s.onShowLinkUnderline(function(v){return f._onShowLinkUnderline(v)}),s.onHideLinkUnderline(function(v){return f._onHideLinkUnderline(v)}),f}return M(o,c),o.prototype.resize=function(h){c.prototype.resize.call(this,h),this._state=void 0},o.prototype.reset=function(){this._clearCurrentLink()},o.prototype._clearCurrentLink=function(){if(this._state){this._clearCells(this._state.x1,this._state.y1,this._state.cols-this._state.x1,1);var h=this._state.y2-this._state.y1-1;h>0&&this._clearCells(0,this._state.y1+1,this._state.cols,h),this._clearCells(0,this._state.y2,this._state.x2,1),this._state=void 0}},o.prototype._onShowLinkUnderline=function(h){if(h.fg===E.INVERTED_DEFAULT_COLOR?this._ctx.fillStyle=this._colors.background.css:h.fg&&b.is256Color(h.fg)?this._ctx.fillStyle=this._colors.ansi[h.fg].css:this._ctx.fillStyle=this._colors.foreground.css,h.y1===h.y2)this._fillBottomLineAtCells(h.x1,h.y1,h.x2-h.x1);else{this._fillBottomLineAtCells(h.x1,h.y1,h.cols-h.x1);for(var n=h.y1+1;n<h.y2;n++)this._fillBottomLineAtCells(0,n,h.cols);this._fillBottomLineAtCells(0,h.y2,h.x2)}this._state=h},o.prototype._onHideLinkUnderline=function(h){this._clearCurrentLink()},o}(p.BaseRenderLayer);L.LinkRenderLayer=i},function(G,L,I){"use strict";var R=this&&this.__decorate||function(c,o,h,n){var a,t=arguments.length,r=t<3?o:n===null?n=Object.getOwnPropertyDescriptor(o,h):n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(c,o,h,n);else for(var s=c.length-1;s>=0;s--)(a=c[s])&&(r=(t<3?a(r):t>3?a(o,h,r):a(o,h))||r);return t>3&&r&&Object.defineProperty(o,h,r),r},M=this&&this.__param||function(c,o){return function(h,n){o(h,n,c)}};Object.defineProperty(L,"__esModule",{value:!0}),L.MouseZone=L.Linkifier=void 0;var p=I(0),E=I(1),b=function(){function c(o,h,n){this._bufferService=o,this._logService=h,this._unicodeService=n,this._linkMatchers=[],this._nextLinkMatcherId=0,this._onShowLinkUnderline=new p.EventEmitter,this._onHideLinkUnderline=new p.EventEmitter,this._onLinkTooltip=new p.EventEmitter,this._rowsToLinkify={start:void 0,end:void 0}}return Object.defineProperty(c.prototype,"onShowLinkUnderline",{get:function(){return this._onShowLinkUnderline.event},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"onHideLinkUnderline",{get:function(){return this._onHideLinkUnderline.event},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"onLinkTooltip",{get:function(){return this._onLinkTooltip.event},enumerable:!1,configurable:!0}),c.prototype.attachToDom=function(o,h){this._element=o,this._mouseZoneManager=h},c.prototype.linkifyRows=function(o,h){var n=this;this._mouseZoneManager&&(this._rowsToLinkify.start===void 0||this._rowsToLinkify.end===void 0?(this._rowsToLinkify.start=o,this._rowsToLinkify.end=h):(this._rowsToLinkify.start=Math.min(this._rowsToLinkify.start,o),this._rowsToLinkify.end=Math.max(this._rowsToLinkify.end,h)),this._mouseZoneManager.clearAll(o,h),this._rowsTimeoutId&&clearTimeout(this._rowsTimeoutId),this._rowsTimeoutId=setTimeout(function(){return n._linkifyRows()},c._timeBeforeLatency))},c.prototype._linkifyRows=function(){this._rowsTimeoutId=void 0;var o=this._bufferService.buffer;if(this._rowsToLinkify.start!==void 0&&this._rowsToLinkify.end!==void 0){var h=o.ydisp+this._rowsToLinkify.start;if(!(h>=o.lines.length)){for(var n=o.ydisp+Math.min(this._rowsToLinkify.end,this._bufferService.rows)+1,a=Math.ceil(2e3/this._bufferService.cols),t=this._bufferService.buffer.iterator(!1,h,n,a,a);t.hasNext();)for(var r=t.next(),s=0;s<this._linkMatchers.length;s++)this._doLinkifyRow(r.range.first,r.content,this._linkMatchers[s]);this._rowsToLinkify.start=void 0,this._rowsToLinkify.end=void 0}}else this._logService.debug("_rowToLinkify was unset before _linkifyRows was called")},c.prototype.registerLinkMatcher=function(o,h,n){if(n===void 0&&(n={}),!h)throw new Error("handler must be defined");var a={id:this._nextLinkMatcherId++,regex:o,handler:h,matchIndex:n.matchIndex,validationCallback:n.validationCallback,hoverTooltipCallback:n.tooltipCallback,hoverLeaveCallback:n.leaveCallback,willLinkActivate:n.willLinkActivate,priority:n.priority||0};return this._addLinkMatcherToList(a),a.id},c.prototype._addLinkMatcherToList=function(o){if(this._linkMatchers.length!==0){for(var h=this._linkMatchers.length-1;h>=0;h--)if(o.priority<=this._linkMatchers[h].priority)return void this._linkMatchers.splice(h+1,0,o);this._linkMatchers.splice(0,0,o)}else this._linkMatchers.push(o)},c.prototype.deregisterLinkMatcher=function(o){for(var h=0;h<this._linkMatchers.length;h++)if(this._linkMatchers[h].id===o)return this._linkMatchers.splice(h,1),!0;return!1},c.prototype._doLinkifyRow=function(o,h,n){for(var a,t=this,r=new RegExp(n.regex.source,(n.regex.flags||"")+"g"),s=-1,u=function(){var f=a[typeof n.matchIndex!="number"?0:n.matchIndex];if(!f)return d._logService.debug("match found without corresponding matchIndex",a,n),"break";if(s=h.indexOf(f,s+1),r.lastIndex=s+f.length,s<0)return"break";var v=d._bufferService.buffer.stringIndexToBufferIndex(o,s);if(v[0]<0)return"break";var m=d._bufferService.buffer.lines.get(v[0]);if(!m)return"break";var S=m.getFg(v[1]),C=S?S>>9&511:void 0;n.validationCallback?n.validationCallback(f,function(_){t._rowsTimeoutId||_&&t._addLink(v[1],v[0]-t._bufferService.buffer.ydisp,f,n,C)}):d._addLink(v[1],v[0]-d._bufferService.buffer.ydisp,f,n,C)},d=this;(a=r.exec(h))!==null&&!(u()==="break"););},c.prototype._addLink=function(o,h,n,a,t){var r=this;if(this._mouseZoneManager&&this._element){var s=this._unicodeService.getStringCellWidth(n),u=o%this._bufferService.cols,d=h+Math.floor(o/this._bufferService.cols),f=(u+s)%this._bufferService.cols,v=d+Math.floor((u+s)/this._bufferService.cols);f===0&&(f=this._bufferService.cols,v--),this._mouseZoneManager.add(new i(u+1,d+1,f+1,v+1,function(m){if(a.handler)return a.handler(m,n);var S=window.open();S?(S.opener=null,S.location.href=n):console.warn("Opening link blocked as opener could not be cleared")},function(){r._onShowLinkUnderline.fire(r._createLinkHoverEvent(u,d,f,v,t)),r._element.classList.add("xterm-cursor-pointer")},function(m){r._onLinkTooltip.fire(r._createLinkHoverEvent(u,d,f,v,t)),a.hoverTooltipCallback&&a.hoverTooltipCallback(m,n,{start:{x:u,y:d},end:{x:f,y:v}})},function(){r._onHideLinkUnderline.fire(r._createLinkHoverEvent(u,d,f,v,t)),r._element.classList.remove("xterm-cursor-pointer"),a.hoverLeaveCallback&&a.hoverLeaveCallback()},function(m){return!a.willLinkActivate||a.willLinkActivate(m,n)}))}},c.prototype._createLinkHoverEvent=function(o,h,n,a,t){return{x1:o,y1:h,x2:n,y2:a,cols:this._bufferService.cols,fg:t}},c._timeBeforeLatency=200,c=R([M(0,E.IBufferService),M(1,E.ILogService),M(2,E.IUnicodeService)],c)}();L.Linkifier=b;var i=function(c,o,h,n,a,t,r,s,u){this.x1=c,this.y1=o,this.x2=h,this.y2=n,this.clickCallback=a,this.hoverCallback=t,this.tooltipCallback=r,this.leaveCallback=s,this.willLinkActivate=u};L.MouseZone=i},function(G,L,I){"use strict";var R,M=this&&this.__extends||(R=function(f,v){return(R=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(m,S){m.__proto__=S}||function(m,S){for(var C in S)S.hasOwnProperty(C)&&(m[C]=S[C])})(f,v)},function(f,v){function m(){this.constructor=f}R(f,v),f.prototype=v===null?Object.create(v):(m.prototype=v.prototype,new m)}),p=this&&this.__decorate||function(f,v,m,S){var C,_=arguments.length,y=_<3?v:S===null?S=Object.getOwnPropertyDescriptor(v,m):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(f,v,m,S);else for(var T=f.length-1;T>=0;T--)(C=f[T])&&(y=(_<3?C(y):_>3?C(v,m,y):C(v,m))||y);return _>3&&y&&Object.defineProperty(v,m,y),y},E=this&&this.__param||function(f,v){return function(m,S){v(m,S,f)}};Object.defineProperty(L,"__esModule",{value:!0}),L.SelectionService=void 0;var b=I(11),i=I(52),c=I(4),o=I(0),h=I(5),n=I(1),a=I(30),t=I(53),r=I(2),s=String.fromCharCode(160),u=new RegExp(s,"g"),d=function(f){function v(m,S,C,_,y,T,O){var g=f.call(this)||this;return g._element=m,g._screenElement=S,g._bufferService=C,g._coreService=_,g._mouseService=y,g._optionsService=T,g._renderService=O,g._dragScrollAmount=0,g._enabled=!0,g._workCell=new c.CellData,g._mouseDownTimeStamp=0,g._onLinuxMouseSelection=g.register(new o.EventEmitter),g._onRedrawRequest=g.register(new o.EventEmitter),g._onSelectionChange=g.register(new o.EventEmitter),g._onRequestScrollLines=g.register(new o.EventEmitter),g._mouseMoveListener=function(F){return g._onMouseMove(F)},g._mouseUpListener=function(F){return g._onMouseUp(F)},g._coreService.onUserInput(function(){g.hasSelection&&g.clearSelection()}),g._trimListener=g._bufferService.buffer.lines.onTrim(function(F){return g._onTrim(F)}),g.register(g._bufferService.buffers.onBufferActivate(function(F){return g._onBufferActivate(F)})),g.enable(),g._model=new i.SelectionModel(g._bufferService),g._activeSelectionMode=0,g}return M(v,f),Object.defineProperty(v.prototype,"onLinuxMouseSelection",{get:function(){return this._onLinuxMouseSelection.event},enumerable:!1,configurable:!0}),Object.defineProperty(v.prototype,"onRequestRedraw",{get:function(){return this._onRedrawRequest.event},enumerable:!1,configurable:!0}),Object.defineProperty(v.prototype,"onSelectionChange",{get:function(){return this._onSelectionChange.event},enumerable:!1,configurable:!0}),Object.defineProperty(v.prototype,"onRequestScrollLines",{get:function(){return this._onRequestScrollLines.event},enumerable:!1,configurable:!0}),v.prototype.dispose=function(){this._removeMouseDownListeners()},v.prototype.reset=function(){this.clearSelection()},v.prototype.disable=function(){this.clearSelection(),this._enabled=!1},v.prototype.enable=function(){this._enabled=!0},Object.defineProperty(v.prototype,"selectionStart",{get:function(){return this._model.finalSelectionStart},enumerable:!1,configurable:!0}),Object.defineProperty(v.prototype,"selectionEnd",{get:function(){return this._model.finalSelectionEnd},enumerable:!1,configurable:!0}),Object.defineProperty(v.prototype,"hasSelection",{get:function(){var m=this._model.finalSelectionStart,S=this._model.finalSelectionEnd;return!(!m||!S)&&(m[0]!==S[0]||m[1]!==S[1])},enumerable:!1,configurable:!0}),Object.defineProperty(v.prototype,"selectionText",{get:function(){var m=this._model.finalSelectionStart,S=this._model.finalSelectionEnd;if(!m||!S)return"";var C=this._bufferService.buffer,_=[];if(this._activeSelectionMode===3){if(m[0]===S[0])return"";for(var y=m[1];y<=S[1];y++){var T=C.translateBufferLineToString(y,!0,m[0],S[0]);_.push(T)}}else{var O=m[1]===S[1]?S[0]:void 0;for(_.push(C.translateBufferLineToString(m[1],!0,m[0],O)),y=m[1]+1;y<=S[1]-1;y++){var g=C.lines.get(y);T=C.translateBufferLineToString(y,!0),g&&g.isWrapped?_[_.length-1]+=T:_.push(T)}m[1]!==S[1]&&(g=C.lines.get(S[1]),T=C.translateBufferLineToString(S[1],!0,0,S[0]),g&&g.isWrapped?_[_.length-1]+=T:_.push(T))}return _.map(function(F){return F.replace(u," ")}).join(b.isWindows?`\r
|
|
|
`:`
|
|
|
`)},enumerable:!1,configurable:!0}),v.prototype.clearSelection=function(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()},v.prototype.refresh=function(m){var S=this;(this._refreshAnimationFrame||(this._refreshAnimationFrame=window.requestAnimationFrame(function(){return S._refresh()})),b.isLinux&&m)&&this.selectionText.length&&this._onLinuxMouseSelection.fire(this.selectionText)},v.prototype._refresh=function(){this._refreshAnimationFrame=void 0,this._onRedrawRequest.fire({start:this._model.finalSelectionStart,end:this._model.finalSelectionEnd,columnSelectMode:this._activeSelectionMode===3})},v.prototype.isClickInSelection=function(m){var S=this._getMouseBufferCoords(m),C=this._model.finalSelectionStart,_=this._model.finalSelectionEnd;return!!(C&&_&&S)&&this._areCoordsInSelection(S,C,_)},v.prototype._areCoordsInSelection=function(m,S,C){return m[1]>S[1]&&m[1]<C[1]||S[1]===C[1]&&m[1]===S[1]&&m[0]>=S[0]&&m[0]<C[0]||S[1]<C[1]&&m[1]===C[1]&&m[0]<C[0]||S[1]<C[1]&&m[1]===S[1]&&m[0]>=S[0]},v.prototype.selectWordAtCursor=function(m){var S=this._getMouseBufferCoords(m);S&&(this._selectWordAt(S,!1),this._model.selectionEnd=void 0,this.refresh(!0))},v.prototype.selectAll=function(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()},v.prototype.selectLines=function(m,S){this._model.clearSelection(),m=Math.max(m,0),S=Math.min(S,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,m],this._model.selectionEnd=[this._bufferService.cols,S],this.refresh(),this._onSelectionChange.fire()},v.prototype._onTrim=function(m){this._model.onTrim(m)&&this.refresh()},v.prototype._getMouseBufferCoords=function(m){var S=this._mouseService.getCoords(m,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(S)return S[0]--,S[1]--,S[1]+=this._bufferService.buffer.ydisp,S},v.prototype._getMouseEventScrollAmount=function(m){var S=a.getCoordsRelativeToElement(m,this._screenElement)[1],C=this._renderService.dimensions.canvasHeight;return S>=0&&S<=C?0:(S>C&&(S-=C),S=Math.min(Math.max(S,-50),50),(S/=50)/Math.abs(S)+Math.round(14*S))},v.prototype.shouldForceSelection=function(m){return b.isMac?m.altKey&&this._optionsService.options.macOptionClickForcesSelection:m.shiftKey},v.prototype.onMouseDown=function(m){if(this._mouseDownTimeStamp=m.timeStamp,(m.button!==2||!this.hasSelection)&&m.button===0){if(!this._enabled){if(!this.shouldForceSelection(m))return;m.stopPropagation()}m.preventDefault(),this._dragScrollAmount=0,this._enabled&&m.shiftKey?this._onIncrementalClick(m):m.detail===1?this._onSingleClick(m):m.detail===2?this._onDoubleClick(m):m.detail===3&&this._onTripleClick(m),this._addMouseDownListeners(),this.refresh(!0)}},v.prototype._addMouseDownListeners=function(){var m=this;this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.addEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.addEventListener("mouseup",this._mouseUpListener)),this._dragScrollIntervalTimer=window.setInterval(function(){return m._dragScroll()},50)},v.prototype._removeMouseDownListeners=function(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.removeEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.removeEventListener("mouseup",this._mouseUpListener)),clearInterval(this._dragScrollIntervalTimer),this._dragScrollIntervalTimer=void 0},v.prototype._onIncrementalClick=function(m){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(m))},v.prototype._onSingleClick=function(m){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(m)?3:0,this._model.selectionStart=this._getMouseBufferCoords(m),this._model.selectionStart){this._model.selectionEnd=void 0;var S=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);S&&S.length!==this._model.selectionStart[0]&&S.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}},v.prototype._onDoubleClick=function(m){var S=this._getMouseBufferCoords(m);S&&(this._activeSelectionMode=1,this._selectWordAt(S,!0))},v.prototype._onTripleClick=function(m){var S=this._getMouseBufferCoords(m);S&&(this._activeSelectionMode=2,this._selectLineAt(S[1]))},v.prototype.shouldColumnSelect=function(m){return m.altKey&&!(b.isMac&&this._optionsService.options.macOptionClickForcesSelection)},v.prototype._onMouseMove=function(m){if(m.stopImmediatePropagation(),this._model.selectionStart){var S=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(m),this._model.selectionEnd){this._activeSelectionMode===2?this._model.selectionEnd[1]<this._model.selectionStart[1]?this._model.selectionEnd[0]=0:this._model.selectionEnd[0]=this._bufferService.cols:this._activeSelectionMode===1&&this._selectToWordAt(this._model.selectionEnd),this._dragScrollAmount=this._getMouseEventScrollAmount(m),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));var C=this._bufferService.buffer;if(this._model.selectionEnd[1]<C.lines.length){var _=C.lines.get(this._model.selectionEnd[1]);_&&_.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]++}S&&S[0]===this._model.selectionEnd[0]&&S[1]===this._model.selectionEnd[1]||this.refresh(!0)}else this.refresh(!0)}},v.prototype._dragScroll=function(){if(this._model.selectionEnd&&this._model.selectionStart&&this._dragScrollAmount){this._onRequestScrollLines.fire({amount:this._dragScrollAmount,suppressScrollEvent:!1});var m=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(m.ydisp+this._bufferService.rows,m.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=m.ydisp),this.refresh()}},v.prototype._onMouseUp=function(m){var S=m.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&S<500&&m.altKey){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){var C=this._mouseService.getCoords(m,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(C&&C[0]!==void 0&&C[1]!==void 0){var _=t.moveToCellSequence(C[0]-1,C[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(_,!0)}}}else this.hasSelection&&this._onSelectionChange.fire()},v.prototype._onBufferActivate=function(m){var S=this;this.clearSelection(),this._trimListener.dispose(),this._trimListener=m.activeBuffer.lines.onTrim(function(C){return S._onTrim(C)})},v.prototype._convertViewportColToCharacterIndex=function(m,S){for(var C=S[0],_=0;S[0]>=_;_++){var y=m.loadCell(_,this._workCell).getChars().length;this._workCell.getWidth()===0?C--:y>1&&S[0]!==_&&(C+=y-1)}return C},v.prototype.setSelection=function(m,S,C){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[m,S],this._model.selectionStartLength=C,this.refresh()},v.prototype._getWordAt=function(m,S,C,_){if(C===void 0&&(C=!0),_===void 0&&(_=!0),!(m[0]>=this._bufferService.cols)){var y=this._bufferService.buffer,T=y.lines.get(m[1]);if(T){var O=y.translateBufferLineToString(m[1],!1),g=this._convertViewportColToCharacterIndex(T,m),F=g,P=m[0]-g,N=0,X=0,j=0,A=0;if(O.charAt(g)===" "){for(;g>0&&O.charAt(g-1)===" ";)g--;for(;F<O.length&&O.charAt(F+1)===" ";)F++}else{var K=m[0],U=m[0];T.getWidth(K)===0&&(N++,K--),T.getWidth(U)===2&&(X++,U++);var k=T.getString(U).length;for(k>1&&(A+=k-1,F+=k-1);K>0&&g>0&&!this._isCharWordSeparator(T.loadCell(K-1,this._workCell));){T.loadCell(K-1,this._workCell);var z=this._workCell.getChars().length;this._workCell.getWidth()===0?(N++,K--):z>1&&(j+=z-1,g-=z-1),g--,K--}for(;U<T.length&&F+1<O.length&&!this._isCharWordSeparator(T.loadCell(U+1,this._workCell));){T.loadCell(U+1,this._workCell);var te=this._workCell.getChars().length;this._workCell.getWidth()===2?(X++,U++):te>1&&(A+=te-1,F+=te-1),F++,U++}}F++;var de=g+P-N+j,be=Math.min(this._bufferService.cols,F-g+N+X-j-A);if(S||O.slice(g,F).trim()!==""){if(C&&de===0&&T.getCodePoint(0)!==32){var We=y.lines.get(m[1]-1);if(We&&T.isWrapped&&We.getCodePoint(this._bufferService.cols-1)!==32){var Ne=this._getWordAt([this._bufferService.cols-1,m[1]-1],!1,!0,!1);if(Ne){var Le=this._bufferService.cols-Ne.start;de-=Le,be+=Le}}}if(_&&de+be===this._bufferService.cols&&T.getCodePoint(this._bufferService.cols-1)!==32){var Ke=y.lines.get(m[1]+1);if(Ke&&Ke.isWrapped&&Ke.getCodePoint(0)!==32){var He=this._getWordAt([0,m[1]+1],!1,!1,!0);He&&(be+=He.length)}}return{start:de,length:be}}}}},v.prototype._selectWordAt=function(m,S){var C=this._getWordAt(m,S);if(C){for(;C.start<0;)C.start+=this._bufferService.cols,m[1]--;this._model.selectionStart=[C.start,m[1]],this._model.selectionStartLength=C.length}},v.prototype._selectToWordAt=function(m){var S=this._getWordAt(m,!0);if(S){for(var C=m[1];S.start<0;)S.start+=this._bufferService.cols,C--;if(!this._model.areSelectionValuesReversed())for(;S.start+S.length>this._bufferService.cols;)S.length-=this._bufferService.cols,C++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?S.start:S.start+S.length,C]}},v.prototype._isCharWordSeparator=function(m){return m.getWidth()!==0&&this._optionsService.options.wordSeparator.indexOf(m.getChars())>=0},v.prototype._selectLineAt=function(m){var S=this._bufferService.buffer.getWrappedRangeForLine(m);this._model.selectionStart=[0,S.first],this._model.selectionEnd=[this._bufferService.cols,S.last],this._model.selectionStartLength=0},v=p([E(2,n.IBufferService),E(3,n.ICoreService),E(4,h.IMouseService),E(5,n.IOptionsService),E(6,h.IRenderService)],v)}(r.Disposable);L.SelectionService=d},function(G,L,I){"use strict";Object.defineProperty(L,"__esModule",{value:!0}),L.SelectionModel=void 0;var R=function(){function M(p){this._bufferService=p,this.isSelectAllActive=!1,this.selectionStartLength=0}return M.prototype.clearSelection=function(){this.selectionStart=void 0,this.selectionEnd=void 0,this.isSelectAllActive=!1,this.selectionStartLength=0},Object.defineProperty(M.prototype,"finalSelectionStart",{get:function(){return this.isSelectAllActive?[0,0]:this.selectionEnd&&this.selectionStart&&this.areSelectionValuesReversed()?this.selectionEnd:this.selectionStart},enumerable:!1,configurable:!0}),Object.defineProperty(M.prototype,"finalSelectionEnd",{get:function(){if(this.isSelectAllActive)return[this._bufferService.cols,this._bufferService.buffer.ybase+this._bufferService.rows-1];if(this.selectionStart){if(!this.selectionEnd||this.areSelectionValuesReversed()){var p=this.selectionStart[0]+this.selectionStartLength;return p>this._bufferService.cols?[p%this._bufferService.cols,this.selectionStart[1]+Math.floor(p/this._bufferService.cols)]:[p,this.selectionStart[1]]}return this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]?[Math.max(this.selectionStart[0]+this.selectionStartLength,this.selectionEnd[0]),this.selectionEnd[1]]:this.selectionEnd}},enumerable:!1,configurable:!0}),M.prototype.areSelectionValuesReversed=function(){var p=this.selectionStart,E=this.selectionEnd;return!(!p||!E)&&(p[1]>E[1]||p[1]===E[1]&&p[0]>E[0])},M.prototype.onTrim=function(p){return this.selectionStart&&(this.selectionStart[1]-=p),this.selectionEnd&&(this.selectionEnd[1]-=p),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)},M}();L.SelectionModel=R},function(G,L,I){"use strict";Object.defineProperty(L,"__esModule",{value:!0}),L.moveToCellSequence=void 0;var R=I(12);function M(o,h,n,a){var t=o-p(n,o),r=h-p(n,h);return c(Math.abs(t-r)-function(s,u,d){for(var f=0,v=s-p(d,s),m=u-p(d,u),S=0;S<Math.abs(v-m);S++){var C=E(s,u)==="A"?-1:1,_=d.buffer.lines.get(v+C*S);_&&_.isWrapped&&f++}return f}(o,h,n),i(E(o,h),a))}function p(o,h){for(var n=0,a=o.buffer.lines.get(h),t=a&&a.isWrapped;t&&h>=0&&h<o.rows;)n++,t=(a=o.buffer.lines.get(--h))&&a.isWrapped;return n}function E(o,h){return o>h?"A":"B"}function b(o,h,n,a,t,r){for(var s=o,u=h,d="";s!==n||u!==a;)s+=t?1:-1,t&&s>r.cols-1?(d+=r.buffer.translateBufferLineToString(u,!1,o,s),s=0,o=0,u++):!t&&s<0&&(d+=r.buffer.translateBufferLineToString(u,!1,0,o+1),o=s=r.cols-1,u--);return d+r.buffer.translateBufferLineToString(u,!1,o,s)}function i(o,h){var n=h?"O":"[";return R.C0.ESC+n+o}function c(o,h){o=Math.floor(o);for(var n="",a=0;a<o;a++)n+=h;return n}L.moveToCellSequence=function(o,h,n,a){var t,r=n.buffer.x,s=n.buffer.y;if(!n.buffer.hasScrollback)return function(d,f,v,m,S,C){return M(f,m,S,C).length===0?"":c(b(d,f,d,f-p(S,f),!1,S).length,i("D",C))}(r,s,0,h,n,a)+M(s,h,n,a)+function(d,f,v,m,S,C){var _;_=M(f,m,S,C).length>0?m-p(S,m):f;var y=m,T=function(O,g,F,P,N,X){var j;return j=M(F,P,N,X).length>0?P-p(N,P):g,O<F&&j<=P||O>=F&&j<P?"C":"D"}(d,f,v,m,S,C);return c(b(d,_,v,y,T==="C",S).length,i(T,C))}(r,s,o,h,n,a);if(s===h)return t=r>o?"D":"C",c(Math.abs(r-o),i(t,a));t=s>h?"D":"C";var u=Math.abs(s-h);return c(function(d,f){return f.cols-d}(s>h?o:r,n)+(u-1)*n.cols+1+((s>h?r:o)-1),i(t,a))}},function(G,L,I){"use strict";var R=this&&this.__decorate||function(b,i,c,o){var h,n=arguments.length,a=n<3?i:o===null?o=Object.getOwnPropertyDescriptor(i,c):o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(b,i,c,o);else for(var t=b.length-1;t>=0;t--)(h=b[t])&&(a=(n<3?h(a):n>3?h(i,c,a):h(i,c))||a);return n>3&&a&&Object.defineProperty(i,c,a),a},M=this&&this.__param||function(b,i){return function(c,o){i(c,o,b)}};Object.defineProperty(L,"__esModule",{value:!0}),L.SoundService=void 0;var p=I(1),E=function(){function b(i){this._optionsService=i}return Object.defineProperty(b,"audioContext",{get:function(){if(!b._audioContext){var i=window.AudioContext||window.webkitAudioContext;if(!i)return console.warn("Web Audio API is not supported by this browser. Consider upgrading to the latest version"),null;b._audioContext=new i}return b._audioContext},enumerable:!1,configurable:!0}),b.prototype.playBellSound=function(){var i=b.audioContext;if(i){var c=i.createBufferSource();i.decodeAudioData(this._base64ToArrayBuffer(this._removeMimeType(this._optionsService.options.bellSound)),function(o){c.buffer=o,c.connect(i.destination),c.start(0)})}},b.prototype._base64ToArrayBuffer=function(i){for(var c=window.atob(i),o=c.length,h=new Uint8Array(o),n=0;n<o;n++)h[n]=c.charCodeAt(n);return h.buffer},b.prototype._removeMimeType=function(i){return i.split(",")[1]},b=R([M(0,p.IOptionsService)],b)}();L.SoundService=E},function(G,L,I){"use strict";var R,M=this&&this.__extends||(R=function(n,a){return(R=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,r){t.__proto__=r}||function(t,r){for(var s in r)r.hasOwnProperty(s)&&(t[s]=r[s])})(n,a)},function(n,a){function t(){this.constructor=n}R(n,a),n.prototype=a===null?Object.create(a):(t.prototype=a.prototype,new t)}),p=this&&this.__decorate||function(n,a,t,r){var s,u=arguments.length,d=u<3?a:r===null?r=Object.getOwnPropertyDescriptor(a,t):r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")d=Reflect.decorate(n,a,t,r);else for(var f=n.length-1;f>=0;f--)(s=n[f])&&(d=(u<3?s(d):u>3?s(a,t,d):s(a,t))||d);return u>3&&d&&Object.defineProperty(a,t,d),d},E=this&&this.__param||function(n,a){return function(t,r){a(t,r,n)}};Object.defineProperty(L,"__esModule",{value:!0}),L.MouseZoneManager=void 0;var b=I(2),i=I(7),c=I(5),o=I(1),h=function(n){function a(t,r,s,u,d,f){var v=n.call(this)||this;return v._element=t,v._screenElement=r,v._bufferService=s,v._mouseService=u,v._selectionService=d,v._optionsService=f,v._zones=[],v._areZonesActive=!1,v._lastHoverCoords=[void 0,void 0],v._initialSelectionLength=0,v.register(i.addDisposableDomListener(v._element,"mousedown",function(m){return v._onMouseDown(m)})),v._mouseMoveListener=function(m){return v._onMouseMove(m)},v._mouseLeaveListener=function(m){return v._onMouseLeave(m)},v._clickListener=function(m){return v._onClick(m)},v}return M(a,n),a.prototype.dispose=function(){n.prototype.dispose.call(this),this._deactivate()},a.prototype.add=function(t){this._zones.push(t),this._zones.length===1&&this._activate()},a.prototype.clearAll=function(t,r){if(this._zones.length!==0){t&&r||(t=0,r=this._bufferService.rows-1);for(var s=0;s<this._zones.length;s++){var u=this._zones[s];(u.y1>t&&u.y1<=r+1||u.y2>t&&u.y2<=r+1||u.y1<t&&u.y2>r+1)&&(this._currentZone&&this._currentZone===u&&(this._currentZone.leaveCallback(),this._currentZone=void 0),this._zones.splice(s--,1))}this._zones.length===0&&this._deactivate()}},a.prototype._activate=function(){this._areZonesActive||(this._areZonesActive=!0,this._element.addEventListener("mousemove",this._mouseMoveListener),this._element.addEventListener("mouseleave",this._mouseLeaveListener),this._element.addEventListener("click",this._clickListener))},a.prototype._deactivate=function(){this._areZonesActive&&(this._areZonesActive=!1,this._element.removeEventListener("mousemove",this._mouseMoveListener),this._element.removeEventListener("mouseleave",this._mouseLeaveListener),this._element.removeEventListener("click",this._clickListener))},a.prototype._onMouseMove=function(t){this._lastHoverCoords[0]===t.pageX&&this._lastHoverCoords[1]===t.pageY||(this._onHover(t),this._lastHoverCoords=[t.pageX,t.pageY])},a.prototype._onHover=function(t){var r=this,s=this._findZoneEventAt(t);s!==this._currentZone&&(this._currentZone&&(this._currentZone.leaveCallback(),this._currentZone=void 0,this._tooltipTimeout&&clearTimeout(this._tooltipTimeout)),s&&(this._currentZone=s,s.hoverCallback&&s.hoverCallback(t),this._tooltipTimeout=window.setTimeout(function(){return r._onTooltip(t)},this._optionsService.options.linkTooltipHoverDuration)))},a.prototype._onTooltip=function(t){this._tooltipTimeout=void 0;var r=this._findZoneEventAt(t);r&&r.tooltipCallback&&r.tooltipCallback(t)},a.prototype._onMouseDown=function(t){if(this._initialSelectionLength=this._getSelectionLength(),this._areZonesActive){var r=this._findZoneEventAt(t);(r==null?void 0:r.willLinkActivate(t))&&(t.preventDefault(),t.stopImmediatePropagation())}},a.prototype._onMouseLeave=function(t){this._currentZone&&(this._currentZone.leaveCallback(),this._currentZone=void 0,this._tooltipTimeout&&clearTimeout(this._tooltipTimeout))},a.prototype._onClick=function(t){var r=this._findZoneEventAt(t),s=this._getSelectionLength();r&&s===this._initialSelectionLength&&(r.clickCallback(t),t.preventDefault(),t.stopImmediatePropagation())},a.prototype._getSelectionLength=function(){var t=this._selectionService.selectionText;return t?t.length:0},a.prototype._findZoneEventAt=function(t){var r=this._mouseService.getCoords(t,this._screenElement,this._bufferService.cols,this._bufferService.rows);if(r)for(var s=r[0],u=r[1],d=0;d<this._zones.length;d++){var f=this._zones[d];if(f.y1===f.y2){if(u===f.y1&&s>=f.x1&&s<f.x2)return f}else if(u===f.y1&&s>=f.x1||u===f.y2&&s<f.x2||u>f.y1&&u<f.y2)return f}},a=p([E(2,o.IBufferService),E(3,c.IMouseService),E(4,c.ISelectionService),E(5,o.IOptionsService)],a)}(b.Disposable);L.MouseZoneManager=h},function(G,L,I){"use strict";var R,M=this&&this.__extends||(R=function(a,t){return(R=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,s){r.__proto__=s}||function(r,s){for(var u in s)s.hasOwnProperty(u)&&(r[u]=s[u])})(a,t)},function(a,t){function r(){this.constructor=a}R(a,t),a.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(L,"__esModule",{value:!0}),L.AccessibilityManager=void 0;var p=I(18),E=I(11),b=I(31),i=I(7),c=I(2),o=I(32),h=I(17),n=function(a){function t(r,s){var u=a.call(this)||this;u._terminal=r,u._renderService=s,u._liveRegionLineCount=0,u._charsToConsume=[],u._charsToAnnounce="",u._accessibilityTreeRoot=document.createElement("div"),u._accessibilityTreeRoot.classList.add("xterm-accessibility"),u._rowContainer=document.createElement("div"),u._rowContainer.classList.add("xterm-accessibility-tree"),u._rowContainer.setAttribute("role","list"),u._rowElements=[];for(var d=0;d<u._terminal.rows;d++)u._rowElements[d]=u._createAccessibilityTreeNode(),u._rowContainer.appendChild(u._rowElements[d]);if(u._topBoundaryFocusListener=function(f){return u._onBoundaryFocus(f,0)},u._bottomBoundaryFocusListener=function(f){return u._onBoundaryFocus(f,1)},u._rowElements[0].addEventListener("focus",u._topBoundaryFocusListener),u._rowElements[u._rowElements.length-1].addEventListener("focus",u._bottomBoundaryFocusListener),u._refreshRowsDimensions(),u._accessibilityTreeRoot.appendChild(u._rowContainer),u._renderRowsDebouncer=new b.RenderDebouncer(u._renderRows.bind(u)),u._refreshRows(),u._liveRegion=document.createElement("div"),u._liveRegion.classList.add("live-region"),u._liveRegion.setAttribute("aria-live","assertive"),u._accessibilityTreeRoot.appendChild(u._liveRegion),!u._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");return u._terminal.element.insertAdjacentElement("afterbegin",u._accessibilityTreeRoot),u.register(u._renderRowsDebouncer),u.register(u._terminal.onResize(function(f){return u._onResize(f.rows)})),u.register(u._terminal.onRender(function(f){return u._refreshRows(f.start,f.end)})),u.register(u._terminal.onScroll(function(){return u._refreshRows()})),u.register(u._terminal.onA11yChar(function(f){return u._onChar(f)})),u.register(u._terminal.onLineFeed(function(){return u._onChar(`
|
|
|
`)})),u.register(u._terminal.onA11yTab(function(f){return u._onTab(f)})),u.register(u._terminal.onKey(function(f){return u._onKey(f.key)})),u.register(u._terminal.onBlur(function(){return u._clearLiveRegion()})),u.register(u._renderService.onDimensionsChange(function(){return u._refreshRowsDimensions()})),u._screenDprMonitor=new o.ScreenDprMonitor,u.register(u._screenDprMonitor),u._screenDprMonitor.setListener(function(){return u._refreshRowsDimensions()}),u.register(i.addDisposableDomListener(window,"resize",function(){return u._refreshRowsDimensions()})),u}return M(t,a),t.prototype.dispose=function(){a.prototype.dispose.call(this),h.removeElementFromParent(this._accessibilityTreeRoot),this._rowElements.length=0},t.prototype._onBoundaryFocus=function(r,s){var u=r.target,d=this._rowElements[s===0?1:this._rowElements.length-2];if(u.getAttribute("aria-posinset")!==(s===0?"1":""+this._terminal.buffer.lines.length)&&r.relatedTarget===d){var f,v;if(s===0?(f=u,v=this._rowElements.pop(),this._rowContainer.removeChild(v)):(f=this._rowElements.shift(),v=u,this._rowContainer.removeChild(f)),f.removeEventListener("focus",this._topBoundaryFocusListener),v.removeEventListener("focus",this._bottomBoundaryFocusListener),s===0){var m=this._createAccessibilityTreeNode();this._rowElements.unshift(m),this._rowContainer.insertAdjacentElement("afterbegin",m)}else m=this._createAccessibilityTreeNode(),this._rowElements.push(m),this._rowContainer.appendChild(m);this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(s===0?-1:1),this._rowElements[s===0?1:this._rowElements.length-2].focus(),r.preventDefault(),r.stopImmediatePropagation()}},t.prototype._onResize=function(r){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(var s=this._rowContainer.children.length;s<this._terminal.rows;s++)this._rowElements[s]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[s]);for(;this._rowElements.length>r;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()},t.prototype._createAccessibilityTreeNode=function(){var r=document.createElement("div");return r.setAttribute("role","listitem"),r.tabIndex=-1,this._refreshRowDimensions(r),r},t.prototype._onTab=function(r){for(var s=0;s<r;s++)this._onChar(" ")},t.prototype._onChar=function(r){var s=this;this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==r&&(this._charsToAnnounce+=r):this._charsToAnnounce+=r,r===`
|
|
|
`&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=p.tooMuchOutput)),E.isMac&&this._liveRegion.textContent&&this._liveRegion.textContent.length>0&&!this._liveRegion.parentNode&&setTimeout(function(){s._accessibilityTreeRoot.appendChild(s._liveRegion)},0))},t.prototype._clearLiveRegion=function(){this._liveRegion.textContent="",this._liveRegionLineCount=0,E.isMac&&h.removeElementFromParent(this._liveRegion)},t.prototype._onKey=function(r){this._clearLiveRegion(),this._charsToConsume.push(r)},t.prototype._refreshRows=function(r,s){this._renderRowsDebouncer.refresh(r,s,this._terminal.rows)},t.prototype._renderRows=function(r,s){for(var u=this._terminal.buffer,d=u.lines.length.toString(),f=r;f<=s;f++){var v=u.translateBufferLineToString(u.ydisp+f,!0),m=(u.ydisp+f+1).toString(),S=this._rowElements[f];S&&(v.length===0?S.innerHTML=" ":S.textContent=v,S.setAttribute("aria-posinset",m),S.setAttribute("aria-setsize",d))}this._announceCharacters()},t.prototype._refreshRowsDimensions=function(){if(this._renderService.dimensions.actualCellHeight){this._rowElements.length!==this._terminal.rows&&this._onResize(this._terminal.rows);for(var r=0;r<this._terminal.rows;r++)this._refreshRowDimensions(this._rowElements[r])}},t.prototype._refreshRowDimensions=function(r){r.style.height=this._renderService.dimensions.actualCellHeight+"px"},t.prototype._announceCharacters=function(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")},t}(c.Disposable);L.AccessibilityManager=n},function(G,L,I){"use strict";var R,M=this&&this.__extends||(R=function(u,d){return(R=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(f,v){f.__proto__=v}||function(f,v){for(var m in v)v.hasOwnProperty(m)&&(f[m]=v[m])})(u,d)},function(u,d){function f(){this.constructor=u}R(u,d),u.prototype=d===null?Object.create(d):(f.prototype=d.prototype,new f)}),p=this&&this.__decorate||function(u,d,f,v){var m,S=arguments.length,C=S<3?d:v===null?v=Object.getOwnPropertyDescriptor(d,f):v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")C=Reflect.decorate(u,d,f,v);else for(var _=u.length-1;_>=0;_--)(m=u[_])&&(C=(S<3?m(C):S>3?m(d,f,C):m(d,f))||C);return S>3&&C&&Object.defineProperty(d,f,C),C},E=this&&this.__param||function(u,d){return function(f,v){d(f,v,u)}};Object.defineProperty(L,"__esModule",{value:!0}),L.DomRenderer=void 0;var b=I(58),i=I(9),c=I(2),o=I(5),h=I(1),n=I(0),a=I(10),t=I(17),r=1,s=function(u){function d(f,v,m,S,C,_,y,T,O){var g=u.call(this)||this;return g._colors=f,g._element=v,g._screenElement=m,g._viewportElement=S,g._linkifier=C,g._linkifier2=_,g._charSizeService=y,g._optionsService=T,g._bufferService=O,g._terminalClass=r++,g._rowElements=[],g._rowContainer=document.createElement("div"),g._rowContainer.classList.add("xterm-rows"),g._rowContainer.style.lineHeight="normal",g._rowContainer.setAttribute("aria-hidden","true"),g._refreshRowElements(g._bufferService.cols,g._bufferService.rows),g._selectionContainer=document.createElement("div"),g._selectionContainer.classList.add("xterm-selection"),g._selectionContainer.setAttribute("aria-hidden","true"),g.dimensions={scaledCharWidth:0,scaledCharHeight:0,scaledCellWidth:0,scaledCellHeight:0,scaledCharLeft:0,scaledCharTop:0,scaledCanvasWidth:0,scaledCanvasHeight:0,canvasWidth:0,canvasHeight:0,actualCellWidth:0,actualCellHeight:0},g._updateDimensions(),g._injectCss(),g._rowFactory=new b.DomRendererRowFactory(document,g._optionsService,g._colors),g._element.classList.add("xterm-dom-renderer-owner-"+g._terminalClass),g._screenElement.appendChild(g._rowContainer),g._screenElement.appendChild(g._selectionContainer),g._linkifier.onShowLinkUnderline(function(F){return g._onLinkHover(F)}),g._linkifier.onHideLinkUnderline(function(F){return g._onLinkLeave(F)}),g._linkifier2.onShowLinkUnderline(function(F){return g._onLinkHover(F)}),g._linkifier2.onHideLinkUnderline(function(F){return g._onLinkLeave(F)}),g}return M(d,u),Object.defineProperty(d.prototype,"onRequestRedraw",{get:function(){return new n.EventEmitter().event},enumerable:!1,configurable:!0}),d.prototype.dispose=function(){this._element.classList.remove("xterm-dom-renderer-owner-"+this._terminalClass),t.removeElementFromParent(this._rowContainer,this._selectionContainer,this._themeStyleElement,this._dimensionsStyleElement),u.prototype.dispose.call(this)},d.prototype._updateDimensions=function(){this.dimensions.scaledCharWidth=this._charSizeService.width*window.devicePixelRatio,this.dimensions.scaledCharHeight=Math.ceil(this._charSizeService.height*window.devicePixelRatio),this.dimensions.scaledCellWidth=this.dimensions.scaledCharWidth+Math.round(this._optionsService.options.letterSpacing),this.dimensions.scaledCellHeight=Math.floor(this.dimensions.scaledCharHeight*this._optionsService.options.lineHeight),this.dimensions.scaledCharLeft=0,this.dimensions.scaledCharTop=0,this.dimensions.scaledCanvasWidth=this.dimensions.scaledCellWidth*this._bufferService.cols,this.dimensions.scaledCanvasHeight=this.dimensions.scaledCellHeight*this._bufferService.rows,this.dimensions.canvasWidth=Math.round(this.dimensions.scaledCanvasWidth/window.devicePixelRatio),this.dimensions.canvasHeight=Math.round(this.dimensions.scaledCanvasHeight/window.devicePixelRatio),this.dimensions.actualCellWidth=this.dimensions.canvasWidth/this._bufferService.cols,this.dimensions.actualCellHeight=this.dimensions.canvasHeight/this._bufferService.rows;for(var f=0,v=this._rowElements;f<v.length;f++){var m=v[f];m.style.width=this.dimensions.canvasWidth+"px",m.style.height=this.dimensions.actualCellHeight+"px",m.style.lineHeight=this.dimensions.actualCellHeight+"px",m.style.overflow="hidden"}this._dimensionsStyleElement||(this._dimensionsStyleElement=document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));var S=this._terminalSelector+" .xterm-rows span { display: inline-block; height: 100%; vertical-align: top; width: "+this.dimensions.actualCellWidth+"px}";this._dimensionsStyleElement.innerHTML=S,this._selectionContainer.style.height=this._viewportElement.style.height,this._screenElement.style.width=this.dimensions.canvasWidth+"px",this._screenElement.style.height=this.dimensions.canvasHeight+"px"},d.prototype.setColors=function(f){this._colors=f,this._injectCss()},d.prototype._injectCss=function(){var f=this;this._themeStyleElement||(this._themeStyleElement=document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));var v=this._terminalSelector+" .xterm-rows { color: "+this._colors.foreground.css+"; font-family: "+this._optionsService.options.fontFamily+"; font-size: "+this._optionsService.options.fontSize+"px;}";v+=this._terminalSelector+" span:not(."+b.BOLD_CLASS+") { font-weight: "+this._optionsService.options.fontWeight+";}"+this._terminalSelector+" span."+b.BOLD_CLASS+" { font-weight: "+this._optionsService.options.fontWeightBold+";}"+this._terminalSelector+" span."+b.ITALIC_CLASS+" { font-style: italic;}",v+="@keyframes blink_box_shadow_"+this._terminalClass+" { 50% { box-shadow: none; }}",v+="@keyframes blink_block_"+this._terminalClass+" { 0% { background-color: "+this._colors.cursor.css+"; color: "+this._colors.cursorAccent.css+"; } 50% { background-color: "+this._colors.cursorAccent.css+"; color: "+this._colors.cursor.css+"; }}",v+=this._terminalSelector+" .xterm-rows:not(.xterm-focus) ."+b.CURSOR_CLASS+"."+b.CURSOR_STYLE_BLOCK_CLASS+" { outline: 1px solid "+this._colors.cursor.css+"; outline-offset: -1px;}"+this._terminalSelector+" .xterm-rows.xterm-focus ."+b.CURSOR_CLASS+"."+b.CURSOR_BLINK_CLASS+":not(."+b.CURSOR_STYLE_BLOCK_CLASS+") { animation: blink_box_shadow_"+this._terminalClass+" 1s step-end infinite;}"+this._terminalSelector+" .xterm-rows.xterm-focus ."+b.CURSOR_CLASS+"."+b.CURSOR_BLINK_CLASS+"."+b.CURSOR_STYLE_BLOCK_CLASS+" { animation: blink_block_"+this._terminalClass+" 1s step-end infinite;}"+this._terminalSelector+" .xterm-rows.xterm-focus ."+b.CURSOR_CLASS+"."+b.CURSOR_STYLE_BLOCK_CLASS+" { background-color: "+this._colors.cursor.css+"; color: "+this._colors.cursorAccent.css+";}"+this._terminalSelector+" .xterm-rows ."+b.CURSOR_CLASS+"."+b.CURSOR_STYLE_BAR_CLASS+" { box-shadow: "+this._optionsService.options.cursorWidth+"px 0 0 "+this._colors.cursor.css+" inset;}"+this._terminalSelector+" .xterm-rows ."+b.CURSOR_CLASS+"."+b.CURSOR_STYLE_UNDERLINE_CLASS+" { box-shadow: 0 -1px 0 "+this._colors.cursor.css+" inset;}",v+=this._terminalSelector+" .xterm-selection { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}"+this._terminalSelector+" .xterm-selection div { position: absolute; background-color: "+this._colors.selectionTransparent.css+";}",this._colors.ansi.forEach(function(m,S){v+=f._terminalSelector+" .xterm-fg-"+S+" { color: "+m.css+"; }"+f._terminalSelector+" .xterm-bg-"+S+" { background-color: "+m.css+"; }"}),v+=this._terminalSelector+" .xterm-fg-"+i.INVERTED_DEFAULT_COLOR+" { color: "+a.color.opaque(this._colors.background).css+"; }"+this._terminalSelector+" .xterm-bg-"+i.INVERTED_DEFAULT_COLOR+" { background-color: "+this._colors.foreground.css+"; }",this._themeStyleElement.innerHTML=v},d.prototype.onDevicePixelRatioChange=function(){this._updateDimensions()},d.prototype._refreshRowElements=function(f,v){for(var m=this._rowElements.length;m<=v;m++){var S=document.createElement("div");this._rowContainer.appendChild(S),this._rowElements.push(S)}for(;this._rowElements.length>v;)this._rowContainer.removeChild(this._rowElements.pop())},d.prototype.onResize=function(f,v){this._refreshRowElements(f,v),this._updateDimensions()},d.prototype.onCharSizeChanged=function(){this._updateDimensions()},d.prototype.onBlur=function(){this._rowContainer.classList.remove("xterm-focus")},d.prototype.onFocus=function(){this._rowContainer.classList.add("xterm-focus")},d.prototype.onSelectionChanged=function(f,v,m){for(;this._selectionContainer.children.length;)this._selectionContainer.removeChild(this._selectionContainer.children[0]);if(f&&v){var S=f[1]-this._bufferService.buffer.ydisp,C=v[1]-this._bufferService.buffer.ydisp,_=Math.max(S,0),y=Math.min(C,this._bufferService.rows-1);if(!(_>=this._bufferService.rows||y<0)){var T=document.createDocumentFragment();if(m)T.appendChild(this._createSelectionElement(_,f[0],v[0],y-_+1));else{var O=S===_?f[0]:0,g=_===y?v[0]:this._bufferService.cols;T.appendChild(this._createSelectionElement(_,O,g));var F=y-_-1;if(T.appendChild(this._createSelectionElement(_+1,0,this._bufferService.cols,F)),_!==y){var P=C===y?v[0]:this._bufferService.cols;T.appendChild(this._createSelectionElement(y,0,P))}}this._selectionContainer.appendChild(T)}}},d.prototype._createSelectionElement=function(f,v,m,S){S===void 0&&(S=1);var C=document.createElement("div");return C.style.height=S*this.dimensions.actualCellHeight+"px",C.style.top=f*this.dimensions.actualCellHeight+"px",C.style.left=v*this.dimensions.actualCellWidth+"px",C.style.width=this.dimensions.actualCellWidth*(m-v)+"px",C},d.prototype.onCursorMove=function(){},d.prototype.onOptionsChanged=function(){this._updateDimensions(),this._injectCss()},d.prototype.clear=function(){for(var f=0,v=this._rowElements;f<v.length;f++)v[f].innerHTML=""},d.prototype.renderRows=function(f,v){for(var m=this._bufferService.buffer.ybase+this._bufferService.buffer.y,S=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),C=this._optionsService.options.cursorBlink,_=f;_<=v;_++){var y=this._rowElements[_];y.innerHTML="";var T=_+this._bufferService.buffer.ydisp,O=this._bufferService.buffer.lines.get(T),g=this._optionsService.options.cursorStyle;y.appendChild(this._rowFactory.createRow(O,T===m,g,S,C,this.dimensions.actualCellWidth,this._bufferService.cols))}},Object.defineProperty(d.prototype,"_terminalSelector",{get:function(){return".xterm-dom-renderer-owner-"+this._terminalClass},enumerable:!1,configurable:!0}),d.prototype.registerCharacterJoiner=function(f){return-1},d.prototype.deregisterCharacterJoiner=function(f){return!1},d.prototype._onLinkHover=function(f){this._setCellUnderline(f.x1,f.x2,f.y1,f.y2,f.cols,!0)},d.prototype._onLinkLeave=function(f){this._setCellUnderline(f.x1,f.x2,f.y1,f.y2,f.cols,!1)},d.prototype._setCellUnderline=function(f,v,m,S,C,_){for(;f!==v||m!==S;){var y=this._rowElements[m];if(!y)return;var T=y.children[f];T&&(T.style.textDecoration=_?"underline":"none"),++f>=C&&(f=0,m++)}},d=p([E(6,o.ICharSizeService),E(7,h.IOptionsService),E(8,h.IBufferService)],d)}(c.Disposable);L.DomRenderer=s},function(G,L,I){"use strict";Object.defineProperty(L,"__esModule",{value:!0}),L.DomRendererRowFactory=L.CURSOR_STYLE_UNDERLINE_CLASS=L.CURSOR_STYLE_BAR_CLASS=L.CURSOR_STYLE_BLOCK_CLASS=L.CURSOR_BLINK_CLASS=L.CURSOR_CLASS=L.UNDERLINE_CLASS=L.ITALIC_CLASS=L.DIM_CLASS=L.BOLD_CLASS=void 0;var R=I(9),M=I(3),p=I(4),E=I(10);L.BOLD_CLASS="xterm-bold",L.DIM_CLASS="xterm-dim",L.ITALIC_CLASS="xterm-italic",L.UNDERLINE_CLASS="xterm-underline",L.CURSOR_CLASS="xterm-cursor",L.CURSOR_BLINK_CLASS="xterm-cursor-blink",L.CURSOR_STYLE_BLOCK_CLASS="xterm-cursor-block",L.CURSOR_STYLE_BAR_CLASS="xterm-cursor-bar",L.CURSOR_STYLE_UNDERLINE_CLASS="xterm-cursor-underline";var b=function(){function c(o,h,n){this._document=o,this._optionsService=h,this._colors=n,this._workCell=new p.CellData}return c.prototype.setColors=function(o){this._colors=o},c.prototype.createRow=function(o,h,n,a,t,r,s){for(var u=this._document.createDocumentFragment(),d=0,f=Math.min(o.length,s)-1;f>=0;f--)if(o.loadCell(f,this._workCell).getCode()!==M.NULL_CELL_CODE||h&&f===a){d=f+1;break}for(f=0;f<d;f++){o.loadCell(f,this._workCell);var v=this._workCell.getWidth();if(v!==0){var m=this._document.createElement("span");if(v>1&&(m.style.width=r*v+"px"),h&&f===a)switch(m.classList.add(L.CURSOR_CLASS),t&&m.classList.add(L.CURSOR_BLINK_CLASS),n){case"bar":m.classList.add(L.CURSOR_STYLE_BAR_CLASS);break;case"underline":m.classList.add(L.CURSOR_STYLE_UNDERLINE_CLASS);break;default:m.classList.add(L.CURSOR_STYLE_BLOCK_CLASS)}this._workCell.isBold()&&m.classList.add(L.BOLD_CLASS),this._workCell.isItalic()&&m.classList.add(L.ITALIC_CLASS),this._workCell.isDim()&&m.classList.add(L.DIM_CLASS),this._workCell.isUnderline()&&m.classList.add(L.UNDERLINE_CLASS),this._workCell.isInvisible()?m.textContent=M.WHITESPACE_CELL_CHAR:m.textContent=this._workCell.getChars()||M.WHITESPACE_CELL_CHAR;var S=this._workCell.getFgColor(),C=this._workCell.getFgColorMode(),_=this._workCell.getBgColor(),y=this._workCell.getBgColorMode(),T=!!this._workCell.isInverse();if(T){var O=S;S=_,_=O;var g=C;C=y,y=g}switch(C){case 16777216:case 33554432:this._workCell.isBold()&&S<8&&this._optionsService.options.drawBoldTextInBrightColors&&(S+=8),this._applyMinimumContrast(m,this._colors.background,this._colors.ansi[S])||m.classList.add("xterm-fg-"+S);break;case 50331648:var F=E.rgba.toColor(S>>16&255,S>>8&255,255&S);this._applyMinimumContrast(m,this._colors.background,F)||this._addStyle(m,"color:#"+i(S.toString(16),"0",6));break;case 0:default:this._applyMinimumContrast(m,this._colors.background,this._colors.foreground)||T&&m.classList.add("xterm-fg-"+R.INVERTED_DEFAULT_COLOR)}switch(y){case 16777216:case 33554432:m.classList.add("xterm-bg-"+_);break;case 50331648:this._addStyle(m,"background-color:#"+i(_.toString(16),"0",6));break;case 0:default:T&&m.classList.add("xterm-bg-"+R.INVERTED_DEFAULT_COLOR)}u.appendChild(m)}}return u},c.prototype._applyMinimumContrast=function(o,h,n){if(this._optionsService.options.minimumContrastRatio===1)return!1;var a=this._colors.contrastCache.getColor(this._workCell.bg,this._workCell.fg);return a===void 0&&(a=E.color.ensureContrastRatio(h,n,this._optionsService.options.minimumContrastRatio),this._colors.contrastCache.setColor(this._workCell.bg,this._workCell.fg,a!=null?a:null)),!!a&&(this._addStyle(o,"color:"+a.css),!0)},c.prototype._addStyle=function(o,h){o.setAttribute("style",""+(o.getAttribute("style")||"")+h+";")},c}();function i(c,o,h){for(;c.length<h;)c=o+c;return c}L.DomRendererRowFactory=b},function(G,L,I){"use strict";Object.defineProperty(L,"__esModule",{value:!0}),L.evaluateKeyboardEvent=void 0;var R=I(12),M={48:["0",")"],49:["1","!"],50:["2","@"],51:["3","#"],52:["4","$"],53:["5","%"],54:["6","^"],55:["7","&"],56:["8","*"],57:["9","("],186:[";",":"],187:["=","+"],188:[",","<"],189:["-","_"],190:[".",">"],191:["/","?"],192:["`","~"],219:["[","{"],220:["\\","|"],221:["]","}"],222:["'",'"']};L.evaluateKeyboardEvent=function(p,E,b,i){var c={type:0,cancel:!1,key:void 0},o=(p.shiftKey?1:0)|(p.altKey?2:0)|(p.ctrlKey?4:0)|(p.metaKey?8:0);switch(p.keyCode){case 0:p.key==="UIKeyInputUpArrow"?c.key=E?R.C0.ESC+"OA":R.C0.ESC+"[A":p.key==="UIKeyInputLeftArrow"?c.key=E?R.C0.ESC+"OD":R.C0.ESC+"[D":p.key==="UIKeyInputRightArrow"?c.key=E?R.C0.ESC+"OC":R.C0.ESC+"[C":p.key==="UIKeyInputDownArrow"&&(c.key=E?R.C0.ESC+"OB":R.C0.ESC+"[B");break;case 8:if(p.shiftKey){c.key=R.C0.BS;break}if(p.altKey){c.key=R.C0.ESC+R.C0.DEL;break}c.key=R.C0.DEL;break;case 9:if(p.shiftKey){c.key=R.C0.ESC+"[Z";break}c.key=R.C0.HT,c.cancel=!0;break;case 13:c.key=p.altKey?R.C0.ESC+R.C0.CR:R.C0.CR,c.cancel=!0;break;case 27:c.key=R.C0.ESC,p.altKey&&(c.key=R.C0.ESC+R.C0.ESC),c.cancel=!0;break;case 37:if(p.metaKey)break;o?(c.key=R.C0.ESC+"[1;"+(o+1)+"D",c.key===R.C0.ESC+"[1;3D"&&(c.key=R.C0.ESC+(b?"b":"[1;5D"))):c.key=E?R.C0.ESC+"OD":R.C0.ESC+"[D";break;case 39:if(p.metaKey)break;o?(c.key=R.C0.ESC+"[1;"+(o+1)+"C",c.key===R.C0.ESC+"[1;3C"&&(c.key=R.C0.ESC+(b?"f":"[1;5C"))):c.key=E?R.C0.ESC+"OC":R.C0.ESC+"[C";break;case 38:if(p.metaKey)break;o?(c.key=R.C0.ESC+"[1;"+(o+1)+"A",b||c.key!==R.C0.ESC+"[1;3A"||(c.key=R.C0.ESC+"[1;5A")):c.key=E?R.C0.ESC+"OA":R.C0.ESC+"[A";break;case 40:if(p.metaKey)break;o?(c.key=R.C0.ESC+"[1;"+(o+1)+"B",b||c.key!==R.C0.ESC+"[1;3B"||(c.key=R.C0.ESC+"[1;5B")):c.key=E?R.C0.ESC+"OB":R.C0.ESC+"[B";break;case 45:p.shiftKey||p.ctrlKey||(c.key=R.C0.ESC+"[2~");break;case 46:c.key=o?R.C0.ESC+"[3;"+(o+1)+"~":R.C0.ESC+"[3~";break;case 36:c.key=o?R.C0.ESC+"[1;"+(o+1)+"H":E?R.C0.ESC+"OH":R.C0.ESC+"[H";break;case 35:c.key=o?R.C0.ESC+"[1;"+(o+1)+"F":E?R.C0.ESC+"OF":R.C0.ESC+"[F";break;case 33:p.shiftKey?c.type=2:c.key=R.C0.ESC+"[5~";break;case 34:p.shiftKey?c.type=3:c.key=R.C0.ESC+"[6~";break;case 112:c.key=o?R.C0.ESC+"[1;"+(o+1)+"P":R.C0.ESC+"OP";break;case 113:c.key=o?R.C0.ESC+"[1;"+(o+1)+"Q":R.C0.ESC+"OQ";break;case 114:c.key=o?R.C0.ESC+"[1;"+(o+1)+"R":R.C0.ESC+"OR";break;case 115:c.key=o?R.C0.ESC+"[1;"+(o+1)+"S":R.C0.ESC+"OS";break;case 116:c.key=o?R.C0.ESC+"[15;"+(o+1)+"~":R.C0.ESC+"[15~";break;case 117:c.key=o?R.C0.ESC+"[17;"+(o+1)+"~":R.C0.ESC+"[17~";break;case 118:c.key=o?R.C0.ESC+"[18;"+(o+1)+"~":R.C0.ESC+"[18~";break;case 119:c.key=o?R.C0.ESC+"[19;"+(o+1)+"~":R.C0.ESC+"[19~";break;case 120:c.key=o?R.C0.ESC+"[20;"+(o+1)+"~":R.C0.ESC+"[20~";break;case 121:c.key=o?R.C0.ESC+"[21;"+(o+1)+"~":R.C0.ESC+"[21~";break;case 122:c.key=o?R.C0.ESC+"[23;"+(o+1)+"~":R.C0.ESC+"[23~";break;case 123:c.key=o?R.C0.ESC+"[24;"+(o+1)+"~":R.C0.ESC+"[24~";break;default:if(!p.ctrlKey||p.shiftKey||p.altKey||p.metaKey)if(b&&!i||!p.altKey||p.metaKey)b&&!p.altKey&&!p.ctrlKey&&p.metaKey?p.keyCode===65&&(c.type=1):p.key&&!p.ctrlKey&&!p.altKey&&!p.metaKey&&p.keyCode>=48&&p.key.length===1?c.key=p.key:p.key&&p.ctrlKey&&p.key==="_"&&(c.key=R.C0.US);else{var h=M[p.keyCode],n=h&&h[p.shiftKey?1:0];if(n)c.key=R.C0.ESC+n;else if(p.keyCode>=65&&p.keyCode<=90){var a=p.ctrlKey?p.keyCode-64:p.keyCode+32;c.key=R.C0.ESC+String.fromCharCode(a)}}else p.keyCode>=65&&p.keyCode<=90?c.key=String.fromCharCode(p.keyCode-64):p.keyCode===32?c.key=R.C0.NUL:p.keyCode>=51&&p.keyCode<=55?c.key=String.fromCharCode(p.keyCode-51+27):p.keyCode===56?c.key=R.C0.DEL:p.keyCode===219?c.key=R.C0.ESC:p.keyCode===220?c.key=R.C0.FS:p.keyCode===221&&(c.key=R.C0.GS)}return c}},function(G,L,I){"use strict";var R,M=this&&this.__extends||(R=function(r,s){return(R=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(u,d){u.__proto__=d}||function(u,d){for(var f in d)d.hasOwnProperty(f)&&(u[f]=d[f])})(r,s)},function(r,s){function u(){this.constructor=r}R(r,s),r.prototype=s===null?Object.create(s):(u.prototype=s.prototype,new u)}),p=this&&this.__decorate||function(r,s,u,d){var f,v=arguments.length,m=v<3?s:d===null?d=Object.getOwnPropertyDescriptor(s,u):d;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")m=Reflect.decorate(r,s,u,d);else for(var S=r.length-1;S>=0;S--)(f=r[S])&&(m=(v<3?f(m):v>3?f(s,u,m):f(s,u))||m);return v>3&&m&&Object.defineProperty(s,u,m),m},E=this&&this.__param||function(r,s){return function(u,d){s(u,d,r)}};Object.defineProperty(L,"__esModule",{value:!0}),L.RenderService=void 0;var b=I(31),i=I(0),c=I(2),o=I(32),h=I(7),n=I(1),a=I(5),t=function(r){function s(u,d,f,v,m,S){var C=r.call(this)||this;if(C._renderer=u,C._rowCount=d,C._isPaused=!1,C._needsFullRefresh=!1,C._isNextRenderRedrawOnly=!0,C._needsSelectionRefresh=!1,C._canvasWidth=0,C._canvasHeight=0,C._selectionState={start:void 0,end:void 0,columnSelectMode:!1},C._onDimensionsChange=new i.EventEmitter,C._onRender=new i.EventEmitter,C._onRefreshRequest=new i.EventEmitter,C.register({dispose:function(){return C._renderer.dispose()}}),C._renderDebouncer=new b.RenderDebouncer(function(y,T){return C._renderRows(y,T)}),C.register(C._renderDebouncer),C._screenDprMonitor=new o.ScreenDprMonitor,C._screenDprMonitor.setListener(function(){return C.onDevicePixelRatioChange()}),C.register(C._screenDprMonitor),C.register(S.onResize(function(y){return C._fullRefresh()})),C.register(v.onOptionChange(function(){return C._renderer.onOptionsChanged()})),C.register(m.onCharSizeChange(function(){return C.onCharSizeChanged()})),C._renderer.onRequestRedraw(function(y){return C.refreshRows(y.start,y.end,!0)}),C.register(h.addDisposableDomListener(window,"resize",function(){return C.onDevicePixelRatioChange()})),"IntersectionObserver"in window){var _=new IntersectionObserver(function(y){return C._onIntersectionChange(y[y.length-1])},{threshold:0});_.observe(f),C.register({dispose:function(){return _.disconnect()}})}return C}return M(s,r),Object.defineProperty(s.prototype,"onDimensionsChange",{get:function(){return this._onDimensionsChange.event},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"onRenderedBufferChange",{get:function(){return this._onRender.event},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"onRefreshRequest",{get:function(){return this._onRefreshRequest.event},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"dimensions",{get:function(){return this._renderer.dimensions},enumerable:!1,configurable:!0}),s.prototype._onIntersectionChange=function(u){this._isPaused=u.intersectionRatio===0,!this._isPaused&&this._needsFullRefresh&&(this.refreshRows(0,this._rowCount-1),this._needsFullRefresh=!1)},s.prototype.refreshRows=function(u,d,f){f===void 0&&(f=!1),this._isPaused?this._needsFullRefresh=!0:(f||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(u,d,this._rowCount))},s.prototype._renderRows=function(u,d){this._renderer.renderRows(u,d),this._needsSelectionRefresh&&(this._renderer.onSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRender.fire({start:u,end:d}),this._isNextRenderRedrawOnly=!0},s.prototype.resize=function(u,d){this._rowCount=d,this._fireOnCanvasResize()},s.prototype.changeOptions=function(){this._renderer.onOptionsChanged(),this.refreshRows(0,this._rowCount-1),this._fireOnCanvasResize()},s.prototype._fireOnCanvasResize=function(){this._renderer.dimensions.canvasWidth===this._canvasWidth&&this._renderer.dimensions.canvasHeight===this._canvasHeight||this._onDimensionsChange.fire(this._renderer.dimensions)},s.prototype.dispose=function(){r.prototype.dispose.call(this)},s.prototype.setRenderer=function(u){var d=this;this._renderer.dispose(),this._renderer=u,this._renderer.onRequestRedraw(function(f){return d.refreshRows(f.start,f.end,!0)}),this._needsSelectionRefresh=!0,this._fullRefresh()},s.prototype._fullRefresh=function(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)},s.prototype.setColors=function(u){this._renderer.setColors(u),this._fullRefresh()},s.prototype.onDevicePixelRatioChange=function(){this._renderer.onDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1)},s.prototype.onResize=function(u,d){this._renderer.onResize(u,d),this._fullRefresh()},s.prototype.onCharSizeChanged=function(){this._renderer.onCharSizeChanged()},s.prototype.onBlur=function(){this._renderer.onBlur()},s.prototype.onFocus=function(){this._renderer.onFocus()},s.prototype.onSelectionChanged=function(u,d,f){this._selectionState.start=u,this._selectionState.end=d,this._selectionState.columnSelectMode=f,this._renderer.onSelectionChanged(u,d,f)},s.prototype.onCursorMove=function(){this._renderer.onCursorMove()},s.prototype.clear=function(){this._renderer.clear()},s.prototype.registerCharacterJoiner=function(u){return this._renderer.registerCharacterJoiner(u)},s.prototype.deregisterCharacterJoiner=function(u){return this._renderer.deregisterCharacterJoiner(u)},s=p([E(3,n.IOptionsService),E(4,a.ICharSizeService),E(5,n.IBufferService)],s)}(c.Disposable);L.RenderService=t},function(G,L,I){"use strict";var R=this&&this.__decorate||function(c,o,h,n){var a,t=arguments.length,r=t<3?o:n===null?n=Object.getOwnPropertyDescriptor(o,h):n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(c,o,h,n);else for(var s=c.length-1;s>=0;s--)(a=c[s])&&(r=(t<3?a(r):t>3?a(o,h,r):a(o,h))||r);return t>3&&r&&Object.defineProperty(o,h,r),r},M=this&&this.__param||function(c,o){return function(h,n){o(h,n,c)}};Object.defineProperty(L,"__esModule",{value:!0}),L.CharSizeService=void 0;var p=I(1),E=I(0),b=function(){function c(o,h,n){this._optionsService=n,this.width=0,this.height=0,this._onCharSizeChange=new E.EventEmitter,this._measureStrategy=new i(o,h,this._optionsService)}return Object.defineProperty(c.prototype,"hasValidSize",{get:function(){return this.width>0&&this.height>0},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"onCharSizeChange",{get:function(){return this._onCharSizeChange.event},enumerable:!1,configurable:!0}),c.prototype.measure=function(){var o=this._measureStrategy.measure();o.width===this.width&&o.height===this.height||(this.width=o.width,this.height=o.height,this._onCharSizeChange.fire())},c=R([M(2,p.IOptionsService)],c)}();L.CharSizeService=b;var i=function(){function c(o,h,n){this._document=o,this._parentElement=h,this._optionsService=n,this._result={width:0,height:0},this._measureElement=this._document.createElement("span"),this._measureElement.classList.add("xterm-char-measure-element"),this._measureElement.textContent="W",this._measureElement.setAttribute("aria-hidden","true"),this._parentElement.appendChild(this._measureElement)}return c.prototype.measure=function(){this._measureElement.style.fontFamily=this._optionsService.options.fontFamily,this._measureElement.style.fontSize=this._optionsService.options.fontSize+"px";var o=this._measureElement.getBoundingClientRect();return o.width!==0&&o.height!==0&&(this._result.width=o.width,this._result.height=Math.ceil(o.height)),this._result},c}()},function(G,L,I){"use strict";var R=this&&this.__decorate||function(i,c,o,h){var n,a=arguments.length,t=a<3?c:h===null?h=Object.getOwnPropertyDescriptor(c,o):h;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")t=Reflect.decorate(i,c,o,h);else for(var r=i.length-1;r>=0;r--)(n=i[r])&&(t=(a<3?n(t):a>3?n(c,o,t):n(c,o))||t);return a>3&&t&&Object.defineProperty(c,o,t),t},M=this&&this.__param||function(i,c){return function(o,h){c(o,h,i)}};Object.defineProperty(L,"__esModule",{value:!0}),L.MouseService=void 0;var p=I(5),E=I(30),b=function(){function i(c,o){this._renderService=c,this._charSizeService=o}return i.prototype.getCoords=function(c,o,h,n,a){return E.getCoords(c,o,h,n,this._charSizeService.hasValidSize,this._renderService.dimensions.actualCellWidth,this._renderService.dimensions.actualCellHeight,a)},i.prototype.getRawByteCoords=function(c,o,h,n){var a=this.getCoords(c,o,h,n);return E.getRawByteCoords(a)},i=R([M(0,p.IRenderService),M(1,p.ICharSizeService)],i)}();L.MouseService=b},function(G,L,I){"use strict";var R,M=this&&this.__extends||(R=function(n,a){return(R=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,r){t.__proto__=r}||function(t,r){for(var s in r)r.hasOwnProperty(s)&&(t[s]=r[s])})(n,a)},function(n,a){function t(){this.constructor=n}R(n,a),n.prototype=a===null?Object.create(a):(t.prototype=a.prototype,new t)}),p=this&&this.__decorate||function(n,a,t,r){var s,u=arguments.length,d=u<3?a:r===null?r=Object.getOwnPropertyDescriptor(a,t):r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")d=Reflect.decorate(n,a,t,r);else for(var f=n.length-1;f>=0;f--)(s=n[f])&&(d=(u<3?s(d):u>3?s(a,t,d):s(a,t))||d);return u>3&&d&&Object.defineProperty(a,t,d),d},E=this&&this.__param||function(n,a){return function(t,r){a(t,r,n)}};Object.defineProperty(L,"__esModule",{value:!0}),L.Linkifier2=void 0;var b=I(1),i=I(0),c=I(2),o=I(7),h=function(n){function a(t){var r=n.call(this)||this;return r._bufferService=t,r._linkProviders=[],r._linkCacheDisposables=[],r._isMouseOut=!0,r._activeLine=-1,r._onShowLinkUnderline=r.register(new i.EventEmitter),r._onHideLinkUnderline=r.register(new i.EventEmitter),r.register(c.getDisposeArrayDisposable(r._linkCacheDisposables)),r}return M(a,n),Object.defineProperty(a.prototype,"onShowLinkUnderline",{get:function(){return this._onShowLinkUnderline.event},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"onHideLinkUnderline",{get:function(){return this._onHideLinkUnderline.event},enumerable:!1,configurable:!0}),a.prototype.registerLinkProvider=function(t){var r=this;return this._linkProviders.push(t),{dispose:function(){var s=r._linkProviders.indexOf(t);s!==-1&&r._linkProviders.splice(s,1)}}},a.prototype.attachToDom=function(t,r,s){var u=this;this._element=t,this._mouseService=r,this._renderService=s,this.register(o.addDisposableDomListener(this._element,"mouseleave",function(){u._isMouseOut=!0,u._clearCurrentLink()})),this.register(o.addDisposableDomListener(this._element,"mousemove",this._onMouseMove.bind(this))),this.register(o.addDisposableDomListener(this._element,"click",this._onClick.bind(this)))},a.prototype._onMouseMove=function(t){if(this._lastMouseEvent=t,this._element&&this._mouseService){var r=this._positionFromMouseEvent(t,this._element,this._mouseService);if(r){this._isMouseOut=!1;for(var s=t.composedPath(),u=0;u<s.length;u++){var d=s[u];if(d.classList.contains("xterm"))break;if(d.classList.contains("xterm-hover"))return}this._lastBufferCell&&r.x===this._lastBufferCell.x&&r.y===this._lastBufferCell.y||(this._onHover(r),this._lastBufferCell=r)}}},a.prototype._onHover=function(t){if(this._activeLine!==t.y)return this._clearCurrentLink(),void this._askForLink(t,!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,t)||(this._clearCurrentLink(),this._askForLink(t,!0))},a.prototype._askForLink=function(t,r){var s=this;this._activeProviderReplies&&r||(this._activeProviderReplies=new Map,this._activeLine=t.y);var u=!1;this._linkProviders.forEach(function(d,f){var v;r?((v=s._activeProviderReplies)===null||v===void 0?void 0:v.get(f))&&(u=s._checkLinkProviderResult(f,t,u)):d.provideLinks(t.y,function(m){var S,C;if(!s._isMouseOut){var _=m==null?void 0:m.map(function(y){return{link:y}});(S=s._activeProviderReplies)===null||S===void 0||S.set(f,_),u=s._checkLinkProviderResult(f,t,u),((C=s._activeProviderReplies)===null||C===void 0?void 0:C.size)===s._linkProviders.length&&s._removeIntersectingLinks(t.y,s._activeProviderReplies)}})})},a.prototype._removeIntersectingLinks=function(t,r){for(var s=new Set,u=0;u<r.size;u++){var d=r.get(u);if(d)for(var f=0;f<d.length;f++)for(var v=d[f],m=v.link.range.start.y<t?0:v.link.range.start.x,S=v.link.range.end.y>t?this._bufferService.cols:v.link.range.end.x,C=m;C<=S;C++){if(s.has(C)){d.splice(f--,1);break}s.add(C)}}},a.prototype._checkLinkProviderResult=function(t,r,s){var u,d=this;if(!this._activeProviderReplies)return s;for(var f=this._activeProviderReplies.get(t),v=!1,m=0;m<t;m++)this._activeProviderReplies.has(m)&&!this._activeProviderReplies.get(m)||(v=!0);if(!v&&f){var S=f.find(function(_){return d._linkAtPosition(_.link,r)});S&&(s=!0,this._handleNewLink(S))}if(this._activeProviderReplies.size===this._linkProviders.length&&!s)for(m=0;m<this._activeProviderReplies.size;m++){var C=(u=this._activeProviderReplies.get(m))===null||u===void 0?void 0:u.find(function(_){return d._linkAtPosition(_.link,r)});if(C){s=!0,this._handleNewLink(C);break}}return s},a.prototype._onClick=function(t){if(this._element&&this._mouseService&&this._currentLink){var r=this._positionFromMouseEvent(t,this._element,this._mouseService);r&&this._linkAtPosition(this._currentLink.link,r)&&this._currentLink.link.activate(t,this._currentLink.link.text)}},a.prototype._clearCurrentLink=function(t,r){this._element&&this._currentLink&&this._lastMouseEvent&&(!t||!r||this._currentLink.link.range.start.y>=t&&this._currentLink.link.range.end.y<=r)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,c.disposeArray(this._linkCacheDisposables))},a.prototype._handleNewLink=function(t){var r=this;if(this._element&&this._lastMouseEvent&&this._mouseService){var s=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);s&&this._linkAtPosition(t.link,s)&&(this._currentLink=t,this._currentLink.state={decorations:{underline:t.link.decorations===void 0||t.link.decorations.underline,pointerCursor:t.link.decorations===void 0||t.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,t.link,this._lastMouseEvent),t.link.decorations={},Object.defineProperties(t.link.decorations,{pointerCursor:{get:function(){var u,d;return(d=(u=r._currentLink)===null||u===void 0?void 0:u.state)===null||d===void 0?void 0:d.decorations.pointerCursor},set:function(u){var d,f;((d=r._currentLink)===null||d===void 0?void 0:d.state)&&r._currentLink.state.decorations.pointerCursor!==u&&(r._currentLink.state.decorations.pointerCursor=u,r._currentLink.state.isHovered&&((f=r._element)===null||f===void 0||f.classList.toggle("xterm-cursor-pointer",u)))}},underline:{get:function(){var u,d;return(d=(u=r._currentLink)===null||u===void 0?void 0:u.state)===null||d===void 0?void 0:d.decorations.underline},set:function(u){var d,f,v;((d=r._currentLink)===null||d===void 0?void 0:d.state)&&((v=(f=r._currentLink)===null||f===void 0?void 0:f.state)===null||v===void 0?void 0:v.decorations.underline)!==u&&(r._currentLink.state.decorations.underline=u,r._currentLink.state.isHovered&&r._fireUnderlineEvent(t.link,u))}}}),this._renderService&&this._linkCacheDisposables.push(this._renderService.onRenderedBufferChange(function(u){var d=u.start===0?0:u.start+1+r._bufferService.buffer.ydisp;r._clearCurrentLink(d,u.end+1+r._bufferService.buffer.ydisp)})))}},a.prototype._linkHover=function(t,r,s){var u;((u=this._currentLink)===null||u===void 0?void 0:u.state)&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(r,!0),this._currentLink.state.decorations.pointerCursor&&t.classList.add("xterm-cursor-pointer")),r.hover&&r.hover(s,r.text)},a.prototype._fireUnderlineEvent=function(t,r){var s=t.range,u=this._bufferService.buffer.ydisp,d=this._createLinkUnderlineEvent(s.start.x-1,s.start.y-u-1,s.end.x,s.end.y-u-1,void 0);(r?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(d)},a.prototype._linkLeave=function(t,r,s){var u;((u=this._currentLink)===null||u===void 0?void 0:u.state)&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(r,!1),this._currentLink.state.decorations.pointerCursor&&t.classList.remove("xterm-cursor-pointer")),r.leave&&r.leave(s,r.text)},a.prototype._linkAtPosition=function(t,r){var s=t.range.start.y===t.range.end.y,u=t.range.start.y<r.y,d=t.range.end.y>r.y;return(s&&t.range.start.x<=r.x&&t.range.end.x>=r.x||u&&t.range.end.x>=r.x||d&&t.range.start.x<=r.x||u&&d)&&t.range.start.y<=r.y&&t.range.end.y>=r.y},a.prototype._positionFromMouseEvent=function(t,r,s){var u=s.getCoords(t,r,this._bufferService.cols,this._bufferService.rows);if(u)return{x:u[0],y:u[1]+this._bufferService.buffer.ydisp}},a.prototype._createLinkUnderlineEvent=function(t,r,s,u,d){return{x1:t,y1:r,x2:s,y2:u,cols:this._bufferService.cols,fg:d}},a=p([E(0,b.IBufferService)],a)}(c.Disposable);L.Linkifier2=h},function(G,L,I){"use strict";Object.defineProperty(L,"__esModule",{value:!0}),L.CoreBrowserService=void 0;var R=function(){function M(p){this._textarea=p}return Object.defineProperty(M.prototype,"isFocused",{get:function(){return document.activeElement===this._textarea&&document.hasFocus()},enumerable:!1,configurable:!0}),M}();L.CoreBrowserService=R},function(G,L,I){"use strict";var R,M=this&&this.__extends||(R=function(m,S){return(R=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(C,_){C.__proto__=_}||function(C,_){for(var y in _)_.hasOwnProperty(y)&&(C[y]=_[y])})(m,S)},function(m,S){function C(){this.constructor=m}R(m,S),m.prototype=S===null?Object.create(S):(C.prototype=S.prototype,new C)});Object.defineProperty(L,"__esModule",{value:!0}),L.CoreTerminal=void 0;var p=I(2),E=I(1),b=I(66),i=I(67),c=I(68),o=I(74),h=I(75),n=I(0),a=I(76),t=I(77),r=I(78),s=I(80),u=I(81),d=I(19),f=I(82),v=function(m){function S(C){var _=m.call(this)||this;return _._onBinary=new n.EventEmitter,_._onData=new n.EventEmitter,_._onLineFeed=new n.EventEmitter,_._onResize=new n.EventEmitter,_._onScroll=new n.EventEmitter,_._instantiationService=new b.InstantiationService,_.optionsService=new o.OptionsService(C),_._instantiationService.setService(E.IOptionsService,_.optionsService),_._bufferService=_.register(_._instantiationService.createInstance(c.BufferService)),_._instantiationService.setService(E.IBufferService,_._bufferService),_._logService=_._instantiationService.createInstance(i.LogService),_._instantiationService.setService(E.ILogService,_._logService),_._coreService=_.register(_._instantiationService.createInstance(h.CoreService,function(){return _.scrollToBottom()})),_._instantiationService.setService(E.ICoreService,_._coreService),_._coreMouseService=_._instantiationService.createInstance(a.CoreMouseService),_._instantiationService.setService(E.ICoreMouseService,_._coreMouseService),_._dirtyRowService=_._instantiationService.createInstance(t.DirtyRowService),_._instantiationService.setService(E.IDirtyRowService,_._dirtyRowService),_.unicodeService=_._instantiationService.createInstance(r.UnicodeService),_._instantiationService.setService(E.IUnicodeService,_.unicodeService),_._charsetService=_._instantiationService.createInstance(s.CharsetService),_._instantiationService.setService(E.ICharsetService,_._charsetService),_._inputHandler=new d.InputHandler(_._bufferService,_._charsetService,_._coreService,_._dirtyRowService,_._logService,_.optionsService,_._coreMouseService,_.unicodeService),_.register(n.forwardEvent(_._inputHandler.onLineFeed,_._onLineFeed)),_.register(_._inputHandler),_.register(n.forwardEvent(_._bufferService.onResize,_._onResize)),_.register(n.forwardEvent(_._coreService.onData,_._onData)),_.register(n.forwardEvent(_._coreService.onBinary,_._onBinary)),_.register(_.optionsService.onOptionChange(function(y){return _._updateOptions(y)})),_._writeBuffer=new f.WriteBuffer(function(y){return _._inputHandler.parse(y)}),_}return M(S,m),Object.defineProperty(S.prototype,"onBinary",{get:function(){return this._onBinary.event},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"onData",{get:function(){return this._onData.event},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"onLineFeed",{get:function(){return this._onLineFeed.event},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"onResize",{get:function(){return this._onResize.event},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"onScroll",{get:function(){return this._onScroll.event},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"cols",{get:function(){return this._bufferService.cols},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"rows",{get:function(){return this._bufferService.rows},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"buffers",{get:function(){return this._bufferService.buffers},enumerable:!1,configurable:!0}),S.prototype.dispose=function(){var C;this._isDisposed||(m.prototype.dispose.call(this),(C=this._windowsMode)===null||C===void 0||C.dispose(),this._windowsMode=void 0)},S.prototype.write=function(C,_){this._writeBuffer.write(C,_)},S.prototype.writeSync=function(C){this._writeBuffer.writeSync(C)},S.prototype.resize=function(C,_){isNaN(C)||isNaN(_)||(C=Math.max(C,c.MINIMUM_COLS),_=Math.max(_,c.MINIMUM_ROWS),this._bufferService.resize(C,_))},S.prototype.scroll=function(C,_){_===void 0&&(_=!1);var y,T=this._bufferService.buffer;(y=this._cachedBlankLine)&&y.length===this.cols&&y.getFg(0)===C.fg&&y.getBg(0)===C.bg||(y=T.getBlankLine(C,_),this._cachedBlankLine=y),y.isWrapped=_;var O=T.ybase+T.scrollTop,g=T.ybase+T.scrollBottom;if(T.scrollTop===0){var F=T.lines.isFull;g===T.lines.length-1?F?T.lines.recycle().copyFrom(y):T.lines.push(y.clone()):T.lines.splice(g+1,0,y.clone()),F?this._bufferService.isUserScrolling&&(T.ydisp=Math.max(T.ydisp-1,0)):(T.ybase++,this._bufferService.isUserScrolling||T.ydisp++)}else{var P=g-O+1;T.lines.shiftElements(O+1,P-1,-1),T.lines.set(g,y.clone())}this._bufferService.isUserScrolling||(T.ydisp=T.ybase),this._dirtyRowService.markRangeDirty(T.scrollTop,T.scrollBottom),this._onScroll.fire(T.ydisp)},S.prototype.scrollLines=function(C,_){var y=this._bufferService.buffer;if(C<0){if(y.ydisp===0)return;this._bufferService.isUserScrolling=!0}else C+y.ydisp>=y.ybase&&(this._bufferService.isUserScrolling=!1);var T=y.ydisp;y.ydisp=Math.max(Math.min(y.ydisp+C,y.ybase),0),T!==y.ydisp&&(_||this._onScroll.fire(y.ydisp))},S.prototype.scrollPages=function(C){this.scrollLines(C*(this.rows-1))},S.prototype.scrollToTop=function(){this.scrollLines(-this._bufferService.buffer.ydisp)},S.prototype.scrollToBottom=function(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)},S.prototype.scrollToLine=function(C){var _=C-this._bufferService.buffer.ydisp;_!==0&&this.scrollLines(_)},S.prototype.addEscHandler=function(C,_){return this._inputHandler.addEscHandler(C,_)},S.prototype.addDcsHandler=function(C,_){return this._inputHandler.addDcsHandler(C,_)},S.prototype.addCsiHandler=function(C,_){return this._inputHandler.addCsiHandler(C,_)},S.prototype.addOscHandler=function(C,_){return this._inputHandler.addOscHandler(C,_)},S.prototype._setup=function(){this.optionsService.options.windowsMode&&this._enableWindowsMode()},S.prototype.reset=function(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this._coreService.reset(),this._coreMouseService.reset()},S.prototype._updateOptions=function(C){var _;switch(C){case"scrollback":this.buffers.resize(this.cols,this.rows);break;case"windowsMode":this.optionsService.options.windowsMode?this._enableWindowsMode():((_=this._windowsMode)===null||_===void 0||_.dispose(),this._windowsMode=void 0)}},S.prototype._enableWindowsMode=function(){var C=this;if(!this._windowsMode){var _=[];_.push(this.onLineFeed(u.updateWindowsModeWrappedState.bind(null,this._bufferService))),_.push(this.addCsiHandler({final:"H"},function(){return u.updateWindowsModeWrappedState(C._bufferService),!1})),this._windowsMode={dispose:function(){for(var y=0,T=_;y<T.length;y++)T[y].dispose()}}}},S}(p.Disposable);L.CoreTerminal=v},function(G,L,I){"use strict";var R=this&&this.__spreadArrays||function(){for(var i=0,c=0,o=arguments.length;c<o;c++)i+=arguments[c].length;var h=Array(i),n=0;for(c=0;c<o;c++)for(var a=arguments[c],t=0,r=a.length;t<r;t++,n++)h[n]=a[t];return h};Object.defineProperty(L,"__esModule",{value:!0}),L.InstantiationService=L.ServiceCollection=void 0;var M=I(1),p=I(14),E=function(){function i(){for(var c=[],o=0;o<arguments.length;o++)c[o]=arguments[o];this._entries=new Map;for(var h=0,n=c;h<n.length;h++){var a=n[h],t=a[0],r=a[1];this.set(t,r)}}return i.prototype.set=function(c,o){var h=this._entries.get(c);return this._entries.set(c,o),h},i.prototype.forEach=function(c){this._entries.forEach(function(o,h){return c(h,o)})},i.prototype.has=function(c){return this._entries.has(c)},i.prototype.get=function(c){return this._entries.get(c)},i}();L.ServiceCollection=E;var b=function(){function i(){this._services=new E,this._services.set(M.IInstantiationService,this)}return i.prototype.setService=function(c,o){this._services.set(c,o)},i.prototype.getService=function(c){return this._services.get(c)},i.prototype.createInstance=function(c){for(var o=[],h=1;h<arguments.length;h++)o[h-1]=arguments[h];for(var n=p.getServiceDependencies(c).sort(function(f,v){return f.index-v.index}),a=[],t=0,r=n;t<r.length;t++){var s=r[t],u=this._services.get(s.id);if(!u)throw new Error("[createInstance] "+c.name+" depends on UNKNOWN service "+s.id+".");a.push(u)}var d=n.length>0?n[0].index:o.length;if(o.length!==d)throw new Error("[createInstance] First service dependency of "+c.name+" at position "+(d+1)+" conflicts with "+o.length+" static arguments");return new(c.bind.apply(c,R([void 0],R(o,a))))},i}();L.InstantiationService=b},function(G,L,I){"use strict";var R=this&&this.__decorate||function(o,h,n,a){var t,r=arguments.length,s=r<3?h:a===null?a=Object.getOwnPropertyDescriptor(h,n):a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,h,n,a);else for(var u=o.length-1;u>=0;u--)(t=o[u])&&(s=(r<3?t(s):r>3?t(h,n,s):t(h,n))||s);return r>3&&s&&Object.defineProperty(h,n,s),s},M=this&&this.__param||function(o,h){return function(n,a){h(n,a,o)}},p=this&&this.__spreadArrays||function(){for(var o=0,h=0,n=arguments.length;h<n;h++)o+=arguments[h].length;var a=Array(o),t=0;for(h=0;h<n;h++)for(var r=arguments[h],s=0,u=r.length;s<u;s++,t++)a[t]=r[s];return a};Object.defineProperty(L,"__esModule",{value:!0}),L.LogService=L.LogLevel=void 0;var E,b=I(1);!function(o){o[o.DEBUG=0]="DEBUG",o[o.INFO=1]="INFO",o[o.WARN=2]="WARN",o[o.ERROR=3]="ERROR",o[o.OFF=4]="OFF"}(E=L.LogLevel||(L.LogLevel={}));var i={debug:E.DEBUG,info:E.INFO,warn:E.WARN,error:E.ERROR,off:E.OFF},c=function(){function o(h){var n=this;this._optionsService=h,this._updateLogLevel(),this._optionsService.onOptionChange(function(a){a==="logLevel"&&n._updateLogLevel()})}return o.prototype._updateLogLevel=function(){this._logLevel=i[this._optionsService.options.logLevel]},o.prototype._evalLazyOptionalParams=function(h){for(var n=0;n<h.length;n++)typeof h[n]=="function"&&(h[n]=h[n]())},o.prototype._log=function(h,n,a){this._evalLazyOptionalParams(a),h.call.apply(h,p([console,"xterm.js: "+n],a))},o.prototype.debug=function(h){for(var n=[],a=1;a<arguments.length;a++)n[a-1]=arguments[a];this._logLevel<=E.DEBUG&&this._log(console.log,h,n)},o.prototype.info=function(h){for(var n=[],a=1;a<arguments.length;a++)n[a-1]=arguments[a];this._logLevel<=E.INFO&&this._log(console.info,h,n)},o.prototype.warn=function(h){for(var n=[],a=1;a<arguments.length;a++)n[a-1]=arguments[a];this._logLevel<=E.WARN&&this._log(console.warn,h,n)},o.prototype.error=function(h){for(var n=[],a=1;a<arguments.length;a++)n[a-1]=arguments[a];this._logLevel<=E.ERROR&&this._log(console.error,h,n)},o=R([M(0,b.IOptionsService)],o)}();L.LogService=c},function(G,L,I){"use strict";var R,M=this&&this.__extends||(R=function(n,a){return(R=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,r){t.__proto__=r}||function(t,r){for(var s in r)r.hasOwnProperty(s)&&(t[s]=r[s])})(n,a)},function(n,a){function t(){this.constructor=n}R(n,a),n.prototype=a===null?Object.create(a):(t.prototype=a.prototype,new t)}),p=this&&this.__decorate||function(n,a,t,r){var s,u=arguments.length,d=u<3?a:r===null?r=Object.getOwnPropertyDescriptor(a,t):r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")d=Reflect.decorate(n,a,t,r);else for(var f=n.length-1;f>=0;f--)(s=n[f])&&(d=(u<3?s(d):u>3?s(a,t,d):s(a,t))||d);return u>3&&d&&Object.defineProperty(a,t,d),d},E=this&&this.__param||function(n,a){return function(t,r){a(t,r,n)}};Object.defineProperty(L,"__esModule",{value:!0}),L.BufferService=L.MINIMUM_ROWS=L.MINIMUM_COLS=void 0;var b=I(1),i=I(69),c=I(0),o=I(2);L.MINIMUM_COLS=2,L.MINIMUM_ROWS=1;var h=function(n){function a(t){var r=n.call(this)||this;return r._optionsService=t,r.isUserScrolling=!1,r._onResize=new c.EventEmitter,r.cols=Math.max(t.options.cols,L.MINIMUM_COLS),r.rows=Math.max(t.options.rows,L.MINIMUM_ROWS),r.buffers=new i.BufferSet(t,r),r}return M(a,n),Object.defineProperty(a.prototype,"onResize",{get:function(){return this._onResize.event},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"buffer",{get:function(){return this.buffers.active},enumerable:!1,configurable:!0}),a.prototype.dispose=function(){n.prototype.dispose.call(this),this.buffers.dispose()},a.prototype.resize=function(t,r){this.cols=t,this.rows=r,this.buffers.resize(t,r),this.buffers.setupTabStops(this.cols),this._onResize.fire({cols:t,rows:r})},a.prototype.reset=function(){this.buffers.dispose(),this.buffers=new i.BufferSet(this._optionsService,this),this.isUserScrolling=!1},a=p([E(0,b.IOptionsService)],a)}(o.Disposable);L.BufferService=h},function(G,L,I){"use strict";var R,M=this&&this.__extends||(R=function(i,c){return(R=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,h){o.__proto__=h}||function(o,h){for(var n in h)h.hasOwnProperty(n)&&(o[n]=h[n])})(i,c)},function(i,c){function o(){this.constructor=i}R(i,c),i.prototype=c===null?Object.create(c):(o.prototype=c.prototype,new o)});Object.defineProperty(L,"__esModule",{value:!0}),L.BufferSet=void 0;var p=I(70),E=I(0),b=function(i){function c(o,h){var n=i.call(this)||this;return n._onBufferActivate=n.register(new E.EventEmitter),n._normal=new p.Buffer(!0,o,h),n._normal.fillViewportRows(),n._alt=new p.Buffer(!1,o,h),n._activeBuffer=n._normal,n.setupTabStops(),n}return M(c,i),Object.defineProperty(c.prototype,"onBufferActivate",{get:function(){return this._onBufferActivate.event},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"alt",{get:function(){return this._alt},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"active",{get:function(){return this._activeBuffer},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"normal",{get:function(){return this._normal},enumerable:!1,configurable:!0}),c.prototype.activateNormalBuffer=function(){this._activeBuffer!==this._normal&&(this._normal.x=this._alt.x,this._normal.y=this._alt.y,this._alt.clear(),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}))},c.prototype.activateAltBuffer=function(o){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(o),this._alt.x=this._normal.x,this._alt.y=this._normal.y,this._activeBuffer=this._alt,this._onBufferActivate.fire({activeBuffer:this._alt,inactiveBuffer:this._normal}))},c.prototype.resize=function(o,h){this._normal.resize(o,h),this._alt.resize(o,h)},c.prototype.setupTabStops=function(o){this._normal.setupTabStops(o),this._alt.setupTabStops(o)},c}(I(2).Disposable);L.BufferSet=b},function(G,L,I){"use strict";Object.defineProperty(L,"__esModule",{value:!0}),L.BufferStringIterator=L.Buffer=L.MAX_BUFFER_SIZE=void 0;var R=I(71),M=I(16),p=I(4),E=I(3),b=I(72),i=I(73),c=I(20),o=I(6);L.MAX_BUFFER_SIZE=4294967295;var h=function(){function a(t,r,s){this._hasScrollback=t,this._optionsService=r,this._bufferService=s,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.savedY=0,this.savedX=0,this.savedCurAttrData=M.DEFAULT_ATTR_DATA.clone(),this.savedCharset=c.DEFAULT_CHARSET,this.markers=[],this._nullCell=p.CellData.fromCharData([0,E.NULL_CELL_CHAR,E.NULL_CELL_WIDTH,E.NULL_CELL_CODE]),this._whitespaceCell=p.CellData.fromCharData([0,E.WHITESPACE_CELL_CHAR,E.WHITESPACE_CELL_WIDTH,E.WHITESPACE_CELL_CODE]),this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new R.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}return a.prototype.getNullCell=function(t){return t?(this._nullCell.fg=t.fg,this._nullCell.bg=t.bg,this._nullCell.extended=t.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new o.ExtendedAttrs),this._nullCell},a.prototype.getWhitespaceCell=function(t){return t?(this._whitespaceCell.fg=t.fg,this._whitespaceCell.bg=t.bg,this._whitespaceCell.extended=t.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new o.ExtendedAttrs),this._whitespaceCell},a.prototype.getBlankLine=function(t,r){return new M.BufferLine(this._bufferService.cols,this.getNullCell(t),r)},Object.defineProperty(a.prototype,"hasScrollback",{get:function(){return this._hasScrollback&&this.lines.maxLength>this._rows},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"isCursorInViewport",{get:function(){var t=this.ybase+this.y-this.ydisp;return t>=0&&t<this._rows},enumerable:!1,configurable:!0}),a.prototype._getCorrectBufferLength=function(t){if(!this._hasScrollback)return t;var r=t+this._optionsService.options.scrollback;return r>L.MAX_BUFFER_SIZE?L.MAX_BUFFER_SIZE:r},a.prototype.fillViewportRows=function(t){if(this.lines.length===0){t===void 0&&(t=M.DEFAULT_ATTR_DATA);for(var r=this._rows;r--;)this.lines.push(this.getBlankLine(t))}},a.prototype.clear=function(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new R.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()},a.prototype.resize=function(t,r){var s=this.getNullCell(M.DEFAULT_ATTR_DATA),u=this._getCorrectBufferLength(r);if(u>this.lines.maxLength&&(this.lines.maxLength=u),this.lines.length>0){if(this._cols<t)for(var d=0;d<this.lines.length;d++)this.lines.get(d).resize(t,s);var f=0;if(this._rows<r)for(var v=this._rows;v<r;v++)this.lines.length<r+this.ybase&&(this._optionsService.options.windowsMode?this.lines.push(new M.BufferLine(t,s)):this.ybase>0&&this.lines.length<=this.ybase+this.y+f+1?(this.ybase--,f++,this.ydisp>0&&this.ydisp--):this.lines.push(new M.BufferLine(t,s)));else for(v=this._rows;v>r;v--)this.lines.length>r+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(u<this.lines.maxLength){var m=this.lines.length-u;m>0&&(this.lines.trimStart(m),this.ybase=Math.max(this.ybase-m,0),this.ydisp=Math.max(this.ydisp-m,0),this.savedY=Math.max(this.savedY-m,0)),this.lines.maxLength=u}this.x=Math.min(this.x,t-1),this.y=Math.min(this.y,r-1),f&&(this.y+=f),this.savedX=Math.min(this.savedX,t-1),this.scrollTop=0}if(this.scrollBottom=r-1,this._isReflowEnabled&&(this._reflow(t,r),this._cols>t))for(d=0;d<this.lines.length;d++)this.lines.get(d).resize(t,s);this._cols=t,this._rows=r},Object.defineProperty(a.prototype,"_isReflowEnabled",{get:function(){return this._hasScrollback&&!this._optionsService.options.windowsMode},enumerable:!1,configurable:!0}),a.prototype._reflow=function(t,r){this._cols!==t&&(t>this._cols?this._reflowLarger(t,r):this._reflowSmaller(t,r))},a.prototype._reflowLarger=function(t,r){var s=b.reflowLargerGetLinesToRemove(this.lines,this._cols,t,this.ybase+this.y,this.getNullCell(M.DEFAULT_ATTR_DATA));if(s.length>0){var u=b.reflowLargerCreateNewLayout(this.lines,s);b.reflowLargerApplyNewLayout(this.lines,u.layout),this._reflowLargerAdjustViewport(t,r,u.countRemoved)}},a.prototype._reflowLargerAdjustViewport=function(t,r,s){for(var u=this.getNullCell(M.DEFAULT_ATTR_DATA),d=s;d-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<r&&this.lines.push(new M.BufferLine(t,u))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-s,0)},a.prototype._reflowSmaller=function(t,r){for(var s=this.getNullCell(M.DEFAULT_ATTR_DATA),u=[],d=0,f=this.lines.length-1;f>=0;f--){var v=this.lines.get(f);if(!(!v||!v.isWrapped&&v.getTrimmedLength()<=t)){for(var m=[v];v.isWrapped&&f>0;)v=this.lines.get(--f),m.unshift(v);var S=this.ybase+this.y;if(!(S>=f&&S<f+m.length)){var C=m[m.length-1].getTrimmedLength(),_=b.reflowSmallerGetNewLineLengths(m,this._cols,t),y=_.length-m.length,T=void 0;T=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+y):Math.max(0,this.lines.length-this.lines.maxLength+y);for(var O=[],g=0;g<y;g++){var F=this.getBlankLine(M.DEFAULT_ATTR_DATA,!0);O.push(F)}O.length>0&&(u.push({start:f+m.length+d,newLines:O}),d+=O.length),m.push.apply(m,O);var P=_.length-1,N=_[P];N===0&&(N=_[--P]);for(var X=m.length-y-1,j=C;X>=0;){var A=Math.min(j,N);if(m[P].copyCellsFrom(m[X],j-A,N-A,A,!0),(N-=A)===0&&(N=_[--P]),(j-=A)===0){X--;var K=Math.max(X,0);j=b.getWrappedLineTrimmedLength(m,K,this._cols)}}for(g=0;g<m.length;g++)_[g]<t&&m[g].setCell(_[g],s);for(var U=y-T;U-- >0;)this.ybase===0?this.y<r-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+d)-r&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+y,this.ybase+r-1)}}}if(u.length>0){var k=[],z=[];for(g=0;g<this.lines.length;g++)z.push(this.lines.get(g));var te=this.lines.length,de=te-1,be=0,We=u[be];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+d);var Ne=0;for(g=Math.min(this.lines.maxLength-1,te+d-1);g>=0;g--)if(We&&We.start>de+Ne){for(var Le=We.newLines.length-1;Le>=0;Le--)this.lines.set(g--,We.newLines[Le]);g++,k.push({index:de+1,amount:We.newLines.length}),Ne+=We.newLines.length,We=u[++be]}else this.lines.set(g,z[de--]);var Ke=0;for(g=k.length-1;g>=0;g--)k[g].index+=Ke,this.lines.onInsertEmitter.fire(k[g]),Ke+=k[g].amount;var He=Math.max(0,te+d-this.lines.maxLength);He>0&&this.lines.onTrimEmitter.fire(He)}},a.prototype.stringIndexToBufferIndex=function(t,r,s){for(s===void 0&&(s=!1);r;){var u=this.lines.get(t);if(!u)return[-1,-1];for(var d=s?u.getTrimmedLength():u.length,f=0;f<d;++f)if(u.get(f)[E.CHAR_DATA_WIDTH_INDEX]&&(r-=u.get(f)[E.CHAR_DATA_CHAR_INDEX].length||1),r<0)return[t,f];t++}return[t,0]},a.prototype.translateBufferLineToString=function(t,r,s,u){s===void 0&&(s=0);var d=this.lines.get(t);return d?d.translateToString(r,s,u):""},a.prototype.getWrappedRangeForLine=function(t){for(var r=t,s=t;r>0&&this.lines.get(r).isWrapped;)r--;for(;s+1<this.lines.length&&this.lines.get(s+1).isWrapped;)s++;return{first:r,last:s}},a.prototype.setupTabStops=function(t){for(t!=null?this.tabs[t]||(t=this.prevStop(t)):(this.tabs={},t=0);t<this._cols;t+=this._optionsService.options.tabStopWidth)this.tabs[t]=!0},a.prototype.prevStop=function(t){for(t==null&&(t=this.x);!this.tabs[--t]&&t>0;);return t>=this._cols?this._cols-1:t<0?0:t},a.prototype.nextStop=function(t){for(t==null&&(t=this.x);!this.tabs[++t]&&t<this._cols;);return t>=this._cols?this._cols-1:t<0?0:t},a.prototype.addMarker=function(t){var r=this,s=new i.Marker(t);return this.markers.push(s),s.register(this.lines.onTrim(function(u){s.line-=u,s.line<0&&s.dispose()})),s.register(this.lines.onInsert(function(u){s.line>=u.index&&(s.line+=u.amount)})),s.register(this.lines.onDelete(function(u){s.line>=u.index&&s.line<u.index+u.amount&&s.dispose(),s.line>u.index&&(s.line-=u.amount)})),s.register(s.onDispose(function(){return r._removeMarker(s)})),s},a.prototype._removeMarker=function(t){this.markers.splice(this.markers.indexOf(t),1)},a.prototype.iterator=function(t,r,s,u,d){return new n(this,t,r,s,u,d)},a}();L.Buffer=h;var n=function(){function a(t,r,s,u,d,f){s===void 0&&(s=0),u===void 0&&(u=t.lines.length),d===void 0&&(d=0),f===void 0&&(f=0),this._buffer=t,this._trimRight=r,this._startIndex=s,this._endIndex=u,this._startOverscan=d,this._endOverscan=f,this._startIndex<0&&(this._startIndex=0),this._endIndex>this._buffer.lines.length&&(this._endIndex=this._buffer.lines.length),this._current=this._startIndex}return a.prototype.hasNext=function(){return this._current<this._endIndex},a.prototype.next=function(){var t=this._buffer.getWrappedRangeForLine(this._current);t.first<this._startIndex-this._startOverscan&&(t.first=this._startIndex-this._startOverscan),t.last>this._endIndex+this._endOverscan&&(t.last=this._endIndex+this._endOverscan),t.first=Math.max(t.first,0),t.last=Math.min(t.last,this._buffer.lines.length);for(var r="",s=t.first;s<=t.last;++s)r+=this._buffer.translateBufferLineToString(s,this._trimRight);return this._current=t.last+1,{range:t,content:r}},a}();L.BufferStringIterator=n},function(G,L,I){"use strict";Object.defineProperty(L,"__esModule",{value:!0}),L.CircularList=void 0;var R=I(0),M=function(){function p(E){this._maxLength=E,this.onDeleteEmitter=new R.EventEmitter,this.onInsertEmitter=new R.EventEmitter,this.onTrimEmitter=new R.EventEmitter,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}return Object.defineProperty(p.prototype,"onDelete",{get:function(){return this.onDeleteEmitter.event},enumerable:!1,configurable:!0}),Object.defineProperty(p.prototype,"onInsert",{get:function(){return this.onInsertEmitter.event},enumerable:!1,configurable:!0}),Object.defineProperty(p.prototype,"onTrim",{get:function(){return this.onTrimEmitter.event},enumerable:!1,configurable:!0}),Object.defineProperty(p.prototype,"maxLength",{get:function(){return this._maxLength},set:function(E){if(this._maxLength!==E){for(var b=new Array(E),i=0;i<Math.min(E,this.length);i++)b[i]=this._array[this._getCyclicIndex(i)];this._array=b,this._maxLength=E,this._startIndex=0}},enumerable:!1,configurable:!0}),Object.defineProperty(p.prototype,"length",{get:function(){return this._length},set:function(E){if(E>this._length)for(var b=this._length;b<E;b++)this._array[b]=void 0;this._length=E},enumerable:!1,configurable:!0}),p.prototype.get=function(E){return this._array[this._getCyclicIndex(E)]},p.prototype.set=function(E,b){this._array[this._getCyclicIndex(E)]=b},p.prototype.push=function(E){this._array[this._getCyclicIndex(this._length)]=E,this._length===this._maxLength?(this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1)):this._length++},p.prototype.recycle=function(){if(this._length!==this._maxLength)throw new Error("Can only recycle when the buffer is full");return this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1),this._array[this._getCyclicIndex(this._length-1)]},Object.defineProperty(p.prototype,"isFull",{get:function(){return this._length===this._maxLength},enumerable:!1,configurable:!0}),p.prototype.pop=function(){return this._array[this._getCyclicIndex(this._length---1)]},p.prototype.splice=function(E,b){for(var i=[],c=2;c<arguments.length;c++)i[c-2]=arguments[c];if(b){for(var o=E;o<this._length-b;o++)this._array[this._getCyclicIndex(o)]=this._array[this._getCyclicIndex(o+b)];this._length-=b}for(o=this._length-1;o>=E;o--)this._array[this._getCyclicIndex(o+i.length)]=this._array[this._getCyclicIndex(o)];for(o=0;o<i.length;o++)this._array[this._getCyclicIndex(E+o)]=i[o];if(this._length+i.length>this._maxLength){var h=this._length+i.length-this._maxLength;this._startIndex+=h,this._length=this._maxLength,this.onTrimEmitter.fire(h)}else this._length+=i.length},p.prototype.trimStart=function(E){E>this._length&&(E=this._length),this._startIndex+=E,this._length-=E,this.onTrimEmitter.fire(E)},p.prototype.shiftElements=function(E,b,i){if(!(b<=0)){if(E<0||E>=this._length)throw new Error("start argument out of range");if(E+i<0)throw new Error("Cannot shift elements in list beyond index 0");if(i>0){for(var c=b-1;c>=0;c--)this.set(E+c+i,this.get(E+c));var o=E+b+i-this._length;if(o>0)for(this._length+=o;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(c=0;c<b;c++)this.set(E+c+i,this.get(E+c))}},p.prototype._getCyclicIndex=function(E){return(this._startIndex+E)%this._maxLength},p}();L.CircularList=M},function(G,L,I){"use strict";function R(M,p,E){if(p===M.length-1)return M[p].getTrimmedLength();var b=!M[p].hasContent(E-1)&&M[p].getWidth(E-1)===1,i=M[p+1].getWidth(0)===2;return b&&i?E-1:E}Object.defineProperty(L,"__esModule",{value:!0}),L.getWrappedLineTrimmedLength=L.reflowSmallerGetNewLineLengths=L.reflowLargerApplyNewLayout=L.reflowLargerCreateNewLayout=L.reflowLargerGetLinesToRemove=void 0,L.reflowLargerGetLinesToRemove=function(M,p,E,b,i){for(var c=[],o=0;o<M.length-1;o++){var h=o,n=M.get(++h);if(n.isWrapped){for(var a=[M.get(o)];h<M.length&&n.isWrapped;)a.push(n),n=M.get(++h);if(b>=o&&b<h)o+=a.length-1;else{for(var t=0,r=R(a,t,p),s=1,u=0;s<a.length;){var d=R(a,s,p),f=d-u,v=E-r,m=Math.min(f,v);a[t].copyCellsFrom(a[s],u,r,m,!1),(r+=m)===E&&(t++,r=0),(u+=m)===d&&(s++,u=0),r===0&&t!==0&&a[t-1].getWidth(E-1)===2&&(a[t].copyCellsFrom(a[t-1],E-1,r++,1,!1),a[t-1].setCell(E-1,i))}a[t].replaceCells(r,E,i);for(var S=0,C=a.length-1;C>0&&(C>t||a[C].getTrimmedLength()===0);C--)S++;S>0&&(c.push(o+a.length-S),c.push(S)),o+=a.length-1}}}return c},L.reflowLargerCreateNewLayout=function(M,p){for(var E=[],b=0,i=p[b],c=0,o=0;o<M.length;o++)if(i===o){var h=p[++b];M.onDeleteEmitter.fire({index:o-c,amount:h}),o+=h-1,c+=h,i=p[++b]}else E.push(o);return{layout:E,countRemoved:c}},L.reflowLargerApplyNewLayout=function(M,p){for(var E=[],b=0;b<p.length;b++)E.push(M.get(p[b]));for(b=0;b<E.length;b++)M.set(b,E[b]);M.length=p.length},L.reflowSmallerGetNewLineLengths=function(M,p,E){for(var b=[],i=M.map(function(r,s){return R(M,s,p)}).reduce(function(r,s){return r+s}),c=0,o=0,h=0;h<i;){if(i-h<E){b.push(i-h);break}c+=E;var n=R(M,o,p);c>n&&(c-=n,o++);var a=M[o].getWidth(c-1)===2;a&&c--;var t=a?E-1:E;b.push(t),h+=t}return b},L.getWrappedLineTrimmedLength=R},function(G,L,I){"use strict";var R,M=this&&this.__extends||(R=function(b,i){return(R=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(c,o){c.__proto__=o}||function(c,o){for(var h in o)o.hasOwnProperty(h)&&(c[h]=o[h])})(b,i)},function(b,i){function c(){this.constructor=b}R(b,i),b.prototype=i===null?Object.create(i):(c.prototype=i.prototype,new c)});Object.defineProperty(L,"__esModule",{value:!0}),L.Marker=void 0;var p=I(0),E=function(b){function i(c){var o=b.call(this)||this;return o.line=c,o._id=i._nextId++,o.isDisposed=!1,o._onDispose=new p.EventEmitter,o}return M(i,b),Object.defineProperty(i.prototype,"id",{get:function(){return this._id},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"onDispose",{get:function(){return this._onDispose.event},enumerable:!1,configurable:!0}),i.prototype.dispose=function(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire())},i._nextId=1,i}(I(2).Disposable);L.Marker=E},function(G,L,I){"use strict";Object.defineProperty(L,"__esModule",{value:!0}),L.OptionsService=L.DEFAULT_OPTIONS=L.DEFAULT_BELL_SOUND=void 0;var R=I(0),M=I(11),p=I(33);L.DEFAULT_BELL_SOUND="data:audio/mp3;base64,SUQzBAAAAAAAI1RTU0UAAAAPAAADTGF2ZjU4LjMyLjEwNAAAAAAAAAAAAAAA//tQxAADB8AhSmxhIIEVCSiJrDCQBTcu3UrAIwUdkRgQbFAZC1CQEwTJ9mjRvBA4UOLD8nKVOWfh+UlK3z/177OXrfOdKl7pyn3Xf//WreyTRUoAWgBgkOAGbZHBgG1OF6zM82DWbZaUmMBptgQhGjsyYqc9ae9XFz280948NMBWInljyzsNRFLPWdnZGWrddDsjK1unuSrVN9jJsK8KuQtQCtMBjCEtImISdNKJOopIpBFpNSMbIHCSRpRR5iakjTiyzLhchUUBwCgyKiweBv/7UsQbg8isVNoMPMjAAAA0gAAABEVFGmgqK////9bP/6XCykxBTUUzLjEwMKqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq",L.DEFAULT_OPTIONS=Object.freeze({cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,bellSound:L.DEFAULT_BELL_SOUND,bellStyle:"none",drawBoldTextInBrightColors:!0,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"courier-new, courier, monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",lineHeight:1,linkTooltipHoverDuration:500,letterSpacing:0,logLevel:"info",scrollback:1e3,scrollSensitivity:1,screenReaderMode:!1,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!0,allowTransparency:!1,tabStopWidth:8,theme:{},rightClickSelectsWord:M.isMac,rendererType:"canvas",windowOptions:{},windowsMode:!1,wordSeparator:" ()[]{}',\"`",convertEol:!1,termName:"xterm",cancelEvents:!1});var E=["cols","rows"],b=function(){function i(c){this._onOptionChange=new R.EventEmitter,this.options=p.clone(L.DEFAULT_OPTIONS);for(var o=0,h=Object.keys(c);o<h.length;o++){var n=h[o];if(n in this.options){var a=c[n];this.options[n]=a}}}return Object.defineProperty(i.prototype,"onOptionChange",{get:function(){return this._onOptionChange.event},enumerable:!1,configurable:!0}),i.prototype.setOption=function(c,o){if(!(c in L.DEFAULT_OPTIONS))throw new Error('No option with key "'+c+'"');if(E.indexOf(c)!==-1)throw new Error('Option "'+c+'" can only be set in the constructor');this.options[c]!==o&&(o=this._sanitizeAndValidateOption(c,o),this.options[c]!==o&&(this.options[c]=o,this._onOptionChange.fire(c)))},i.prototype._sanitizeAndValidateOption=function(c,o){switch(c){case"bellStyle":case"cursorStyle":case"fontWeight":case"fontWeightBold":case"rendererType":case"wordSeparator":o||(o=L.DEFAULT_OPTIONS[c]);break;case"cursorWidth":o=Math.floor(o);case"lineHeight":case"tabStopWidth":if(o<1)throw new Error(c+" cannot be less than 1, value: "+o);break;case"minimumContrastRatio":o=Math.max(1,Math.min(21,Math.round(10*o)/10));break;case"scrollback":if((o=Math.min(o,4294967295))<0)throw new Error(c+" cannot be less than 0, value: "+o);break;case"fastScrollSensitivity":case"scrollSensitivity":if(o<=0)throw new Error(c+" cannot be less than or equal to 0, value: "+o)}return o},i.prototype.getOption=function(c){if(!(c in L.DEFAULT_OPTIONS))throw new Error('No option with key "'+c+'"');return this.options[c]},i}();L.OptionsService=b},function(G,L,I){"use strict";var R,M=this&&this.__extends||(R=function(t,r){return(R=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(s,u){s.__proto__=u}||function(s,u){for(var d in u)u.hasOwnProperty(d)&&(s[d]=u[d])})(t,r)},function(t,r){function s(){this.constructor=t}R(t,r),t.prototype=r===null?Object.create(r):(s.prototype=r.prototype,new s)}),p=this&&this.__decorate||function(t,r,s,u){var d,f=arguments.length,v=f<3?r:u===null?u=Object.getOwnPropertyDescriptor(r,s):u;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")v=Reflect.decorate(t,r,s,u);else for(var m=t.length-1;m>=0;m--)(d=t[m])&&(v=(f<3?d(v):f>3?d(r,s,v):d(r,s))||v);return f>3&&v&&Object.defineProperty(r,s,v),v},E=this&&this.__param||function(t,r){return function(s,u){r(s,u,t)}};Object.defineProperty(L,"__esModule",{value:!0}),L.CoreService=void 0;var b=I(1),i=I(0),c=I(33),o=I(2),h=Object.freeze({insertMode:!1}),n=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0}),a=function(t){function r(s,u,d,f){var v=t.call(this)||this;return v._bufferService=u,v._logService=d,v._optionsService=f,v.isCursorInitialized=!1,v.isCursorHidden=!1,v._onData=v.register(new i.EventEmitter),v._onUserInput=v.register(new i.EventEmitter),v._onBinary=v.register(new i.EventEmitter),v._scrollToBottom=s,v.register({dispose:function(){return v._scrollToBottom=void 0}}),v.modes=c.clone(h),v.decPrivateModes=c.clone(n),v}return M(r,t),Object.defineProperty(r.prototype,"onData",{get:function(){return this._onData.event},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"onUserInput",{get:function(){return this._onUserInput.event},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"onBinary",{get:function(){return this._onBinary.event},enumerable:!1,configurable:!0}),r.prototype.reset=function(){this.modes=c.clone(h),this.decPrivateModes=c.clone(n)},r.prototype.triggerDataEvent=function(s,u){if(u===void 0&&(u=!1),!this._optionsService.options.disableStdin){var d=this._bufferService.buffer;d.ybase!==d.ydisp&&this._scrollToBottom(),u&&this._onUserInput.fire(),this._logService.debug('sending data "'+s+'"',function(){return s.split("").map(function(f){return f.charCodeAt(0)})}),this._onData.fire(s)}},r.prototype.triggerBinaryEvent=function(s){this._optionsService.options.disableStdin||(this._logService.debug('sending binary "'+s+'"',function(){return s.split("").map(function(u){return u.charCodeAt(0)})}),this._onBinary.fire(s))},r=p([E(1,b.IBufferService),E(2,b.ILogService),E(3,b.IOptionsService)],r)}(o.Disposable);L.CoreService=a},function(G,L,I){"use strict";var R=this&&this.__decorate||function(n,a,t,r){var s,u=arguments.length,d=u<3?a:r===null?r=Object.getOwnPropertyDescriptor(a,t):r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")d=Reflect.decorate(n,a,t,r);else for(var f=n.length-1;f>=0;f--)(s=n[f])&&(d=(u<3?s(d):u>3?s(a,t,d):s(a,t))||d);return u>3&&d&&Object.defineProperty(a,t,d),d},M=this&&this.__param||function(n,a){return function(t,r){a(t,r,n)}};Object.defineProperty(L,"__esModule",{value:!0}),L.CoreMouseService=void 0;var p=I(1),E=I(0),b={NONE:{events:0,restrict:function(){return!1}},X10:{events:1,restrict:function(n){return n.button!==4&&n.action===1&&(n.ctrl=!1,n.alt=!1,n.shift=!1,!0)}},VT200:{events:19,restrict:function(n){return n.action!==32}},DRAG:{events:23,restrict:function(n){return n.action!==32||n.button!==3}},ANY:{events:31,restrict:function(n){return!0}}};function i(n,a){var t=(n.ctrl?16:0)|(n.shift?4:0)|(n.alt?8:0);return n.button===4?(t|=64,t|=n.action):(t|=3&n.button,4&n.button&&(t|=64),8&n.button&&(t|=128),n.action===32?t|=32:n.action!==0||a||(t|=3)),t}var c=String.fromCharCode,o={DEFAULT:function(n){var a=[i(n,!1)+32,n.col+32,n.row+32];return a[0]>255||a[1]>255||a[2]>255?"":"[M"+c(a[0])+c(a[1])+c(a[2])},SGR:function(n){var a=n.action===0&&n.button!==4?"m":"M";return"[<"+i(n,!0)+";"+n.col+";"+n.row+a}},h=function(){function n(a,t){this._bufferService=a,this._coreService=t,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._onProtocolChange=new E.EventEmitter,this._lastEvent=null;for(var r=0,s=Object.keys(b);r<s.length;r++){var u=s[r];this.addProtocol(u,b[u])}for(var d=0,f=Object.keys(o);d<f.length;d++){var v=f[d];this.addEncoding(v,o[v])}this.reset()}return n.prototype.addProtocol=function(a,t){this._protocols[a]=t},n.prototype.addEncoding=function(a,t){this._encodings[a]=t},Object.defineProperty(n.prototype,"activeProtocol",{get:function(){return this._activeProtocol},set:function(a){if(!this._protocols[a])throw new Error('unknown protocol "'+a+'"');this._activeProtocol=a,this._onProtocolChange.fire(this._protocols[a].events)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"areMouseEventsActive",{get:function(){return this._protocols[this._activeProtocol].events!==0},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"activeEncoding",{get:function(){return this._activeEncoding},set:function(a){if(!this._encodings[a])throw new Error('unknown encoding "'+a+'"');this._activeEncoding=a},enumerable:!1,configurable:!0}),n.prototype.reset=function(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null},Object.defineProperty(n.prototype,"onProtocolChange",{get:function(){return this._onProtocolChange.event},enumerable:!1,configurable:!0}),n.prototype.triggerMouseEvent=function(a){if(a.col<0||a.col>=this._bufferService.cols||a.row<0||a.row>=this._bufferService.rows)return!1;if(a.button===4&&a.action===32)return!1;if(a.button===3&&a.action!==32)return!1;if(a.button!==4&&(a.action===2||a.action===3))return!1;if(a.col++,a.row++,a.action===32&&this._lastEvent&&this._compareEvents(this._lastEvent,a))return!1;if(!this._protocols[this._activeProtocol].restrict(a))return!1;var t=this._encodings[this._activeEncoding](a);return t&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(t):this._coreService.triggerDataEvent(t,!0)),this._lastEvent=a,!0},n.prototype.explainEvents=function(a){return{down:!!(1&a),up:!!(2&a),drag:!!(4&a),move:!!(8&a),wheel:!!(16&a)}},n.prototype._compareEvents=function(a,t){return a.col===t.col&&(a.row===t.row&&(a.button===t.button&&(a.action===t.action&&(a.ctrl===t.ctrl&&a.alt===t.alt))))&&a.shift===t.shift},n=R([M(0,p.IBufferService),M(1,p.ICoreService)],n)}();L.CoreMouseService=h},function(G,L,I){"use strict";var R=this&&this.__decorate||function(b,i,c,o){var h,n=arguments.length,a=n<3?i:o===null?o=Object.getOwnPropertyDescriptor(i,c):o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(b,i,c,o);else for(var t=b.length-1;t>=0;t--)(h=b[t])&&(a=(n<3?h(a):n>3?h(i,c,a):h(i,c))||a);return n>3&&a&&Object.defineProperty(i,c,a),a},M=this&&this.__param||function(b,i){return function(c,o){i(c,o,b)}};Object.defineProperty(L,"__esModule",{value:!0}),L.DirtyRowService=void 0;var p=I(1),E=function(){function b(i){this._bufferService=i,this.clearRange()}return Object.defineProperty(b.prototype,"start",{get:function(){return this._start},enumerable:!1,configurable:!0}),Object.defineProperty(b.prototype,"end",{get:function(){return this._end},enumerable:!1,configurable:!0}),b.prototype.clearRange=function(){this._start=this._bufferService.buffer.y,this._end=this._bufferService.buffer.y},b.prototype.markDirty=function(i){i<this._start?this._start=i:i>this._end&&(this._end=i)},b.prototype.markRangeDirty=function(i,c){if(i>c){var o=i;i=c,c=o}i<this._start&&(this._start=i),c>this._end&&(this._end=c)},b.prototype.markAllDirty=function(){this.markRangeDirty(0,this._bufferService.rows-1)},b=R([M(0,p.IBufferService)],b)}();L.DirtyRowService=E},function(G,L,I){"use strict";Object.defineProperty(L,"__esModule",{value:!0}),L.UnicodeService=void 0;var R=I(0),M=I(79),p=function(){function E(){this._providers=Object.create(null),this._active="",this._onChange=new R.EventEmitter;var b=new M.UnicodeV6;this.register(b),this._active=b.version,this._activeProvider=b}return Object.defineProperty(E.prototype,"onChange",{get:function(){return this._onChange.event},enumerable:!1,configurable:!0}),Object.defineProperty(E.prototype,"versions",{get:function(){return Object.keys(this._providers)},enumerable:!1,configurable:!0}),Object.defineProperty(E.prototype,"activeVersion",{get:function(){return this._active},set:function(b){if(!this._providers[b])throw new Error('unknown Unicode version "'+b+'"');this._active=b,this._activeProvider=this._providers[b],this._onChange.fire(b)},enumerable:!1,configurable:!0}),E.prototype.register=function(b){this._providers[b.version]=b},E.prototype.wcwidth=function(b){return this._activeProvider.wcwidth(b)},E.prototype.getStringCellWidth=function(b){for(var i=0,c=b.length,o=0;o<c;++o){var h=b.charCodeAt(o);if(55296<=h&&h<=56319){if(++o>=c)return i+this.wcwidth(h);var n=b.charCodeAt(o);56320<=n&&n<=57343?h=1024*(h-55296)+n-56320+65536:i+=this.wcwidth(n)}i+=this.wcwidth(h)}return i},E}();L.UnicodeService=p},function(G,L,I){"use strict";Object.defineProperty(L,"__esModule",{value:!0}),L.UnicodeV6=void 0;var R,M=I(15),p=[[768,879],[1155,1158],[1160,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1539],[1552,1557],[1611,1630],[1648,1648],[1750,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2305,2306],[2364,2364],[2369,2376],[2381,2381],[2385,2388],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2883],[2893,2893],[2902,2902],[2946,2946],[3008,3008],[3021,3021],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3393,3395],[3405,3405],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3984,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4146],[4150,4151],[4153,4153],[4184,4185],[4448,4607],[4959,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7616,7626],[7678,7679],[8203,8207],[8234,8238],[8288,8291],[8298,8303],[8400,8431],[12330,12335],[12441,12442],[43014,43014],[43019,43019],[43045,43046],[64286,64286],[65024,65039],[65056,65059],[65279,65279],[65529,65531]],E=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]],b=function(){function i(){if(this.version="6",!R){R=new Uint8Array(65536),M.fill(R,1),R[0]=0,M.fill(R,0,1,32),M.fill(R,0,127,160),M.fill(R,2,4352,4448),R[9001]=2,R[9002]=2,M.fill(R,2,11904,42192),R[12351]=1,M.fill(R,2,44032,55204),M.fill(R,2,63744,64256),M.fill(R,2,65040,65050),M.fill(R,2,65072,65136),M.fill(R,2,65280,65377),M.fill(R,2,65504,65511);for(var c=0;c<p.length;++c)M.fill(R,0,p[c][0],p[c][1]+1)}}return i.prototype.wcwidth=function(c){return c<32?0:c<127?1:c<65536?R[c]:function(o,h){var n,a=0,t=h.length-1;if(o<h[0][0]||o>h[t][1])return!1;for(;t>=a;)if(o>h[n=a+t>>1][1])a=n+1;else{if(!(o<h[n][0]))return!0;t=n-1}return!1}(c,E)?0:c>=131072&&c<=196605||c>=196608&&c<=262141?2:1},i}();L.UnicodeV6=b},function(G,L,I){"use strict";Object.defineProperty(L,"__esModule",{value:!0}),L.CharsetService=void 0;var R=function(){function M(){this.glevel=0,this._charsets=[]}return M.prototype.reset=function(){this.charset=void 0,this._charsets=[],this.glevel=0},M.prototype.setgLevel=function(p){this.glevel=p,this.charset=this._charsets[p]},M.prototype.setgCharset=function(p,E){this._charsets[p]=E,this.glevel===p&&(this.charset=E)},M}();L.CharsetService=R},function(G,L,I){"use strict";Object.defineProperty(L,"__esModule",{value:!0}),L.updateWindowsModeWrappedState=void 0;var R=I(3);L.updateWindowsModeWrappedState=function(M){var p=M.buffer.lines.get(M.buffer.ybase+M.buffer.y-1),E=p==null?void 0:p.get(M.cols-1),b=M.buffer.lines.get(M.buffer.ybase+M.buffer.y);b&&E&&(b.isWrapped=E[R.CHAR_DATA_CODE_INDEX]!==R.NULL_CELL_CODE&&E[R.CHAR_DATA_CODE_INDEX]!==R.WHITESPACE_CELL_CODE)}},function(G,L,I){"use strict";Object.defineProperty(L,"__esModule",{value:!0}),L.WriteBuffer=void 0;var R=function(){function M(p){this._action=p,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0}return M.prototype.writeSync=function(p){if(this._writeBuffer.length){for(var E=this._bufferOffset;E<this._writeBuffer.length;++E){var b=this._writeBuffer[E],i=this._callbacks[E];this._action(b),i&&i()}this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=2147483647}this._action(p)},M.prototype.write=function(p,E){var b=this;if(this._pendingData>5e7)throw new Error("write data discarded, use flow control to avoid losing data");this._writeBuffer.length||(this._bufferOffset=0,setTimeout(function(){return b._innerWrite()})),this._pendingData+=p.length,this._writeBuffer.push(p),this._callbacks.push(E)},M.prototype._innerWrite=function(){for(var p=this,E=Date.now();this._writeBuffer.length>this._bufferOffset;){var b=this._writeBuffer[this._bufferOffset],i=this._callbacks[this._bufferOffset];if(this._bufferOffset++,this._action(b),this._pendingData-=b.length,i&&i(),Date.now()-E>=12)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>50&&(this._writeBuffer=this._writeBuffer.slice(this._bufferOffset),this._callbacks=this._callbacks.slice(this._bufferOffset),this._bufferOffset=0),setTimeout(function(){return p._innerWrite()},0)):(this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0)},M}();L.WriteBuffer=R},function(G,L,I){"use strict";Object.defineProperty(L,"__esModule",{value:!0}),L.AddonManager=void 0;var R=function(){function M(){this._addons=[]}return M.prototype.dispose=function(){for(var p=this._addons.length-1;p>=0;p--)this._addons[p].instance.dispose()},M.prototype.loadAddon=function(p,E){var b=this,i={instance:E,dispose:E.dispose,isDisposed:!1};this._addons.push(i),E.dispose=function(){return b._wrappedAddonDispose(i)},E.activate(p)},M.prototype._wrappedAddonDispose=function(p){if(!p.isDisposed){for(var E=-1,b=0;b<this._addons.length;b++)if(this._addons[b]===p){E=b;break}if(E===-1)throw new Error("Could not dispose an addon that has not been loaded");p.isDisposed=!0,p.dispose.apply(p.instance),this._addons.splice(E,1)}},M}();L.AddonManager=R}])})},"/cxE":function(it,ne,q){"use strict";q.d(ne,"f",function(){return I}),q.d(ne,"g",function(){return R}),q.d(ne,"h",function(){return M}),q.d(ne,"e",function(){return E}),q.d(ne,"b",function(){return b}),q.d(ne,"c",function(){return i}),q.d(ne,"d",function(){return c}),q.d(ne,"a",function(){return o});class G{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(h){setTimeout(()=>{throw h.stack?new Error(h.message+`
|
|
|
|
|
|
`+h.stack):h},0)}}emit(h){this.listeners.forEach(n=>{n(h)})}onUnexpectedError(h){this.unexpectedErrorHandler(h),this.emit(h)}onUnexpectedExternalError(h){this.unexpectedErrorHandler(h)}}const L=new G;function I(h){E(h)||L.onUnexpectedError(h);return}function R(h){E(h)||L.onUnexpectedExternalError(h);return}function M(h){if(h instanceof Error){let{name:n,message:a}=h;const t=h.stacktrace||h.stack;return{$isError:!0,name:n,message:a,stack:t}}return h}const p="Canceled";function E(h){return h instanceof Error&&h.name===p&&h.message===p}function b(){const h=new Error(p);return h.name=h.message,h}function i(h){return h?new Error(`Illegal argument: ${h}`):new Error("Illegal argument")}function c(h){return h?new Error(`Illegal state: ${h}`):new Error("Illegal state")}class o extends Error{constructor(h){super("NotSupported");h&&(this.message=h)}}},"07cG":function(it,ne,q){it.exports={ldsRing:"ldsRing___2F8W7",idsRingWrapper:"idsRingWrapper___fC2cF",ldsring:"ldsring___3A88y"}},"19Vz":function(it,ne,q){(function(G){G(q("VrN/"))})(function(G){G.defineOption("placeholder","",function(b,i,c){var o=c&&c!=G.Init;if(i&&!o)b.on("blur",M),b.on("change",p),b.on("swapDoc",p),G.on(b.getInputField(),"compositionupdate",b.state.placeholderCompose=function(){R(b)}),p(b);else if(!i&&o){b.off("blur",M),b.off("change",p),b.off("swapDoc",p),G.off(b.getInputField(),"compositionupdate",b.state.placeholderCompose),L(b);var h=b.getWrapperElement();h.className=h.className.replace(" CodeMirror-empty","")}i&&!b.hasFocus()&&M(b)});function L(b){b.state.placeholder&&(b.state.placeholder.parentNode.removeChild(b.state.placeholder),b.state.placeholder=null)}function I(b){L(b);var i=b.state.placeholder=document.createElement("pre");i.style.cssText="height: 0; overflow: visible",i.style.direction=b.getOption("direction"),i.className="CodeMirror-placeholder CodeMirror-line-like";var c=b.getOption("placeholder");typeof c=="string"&&(c=document.createTextNode(c)),i.appendChild(c),b.display.lineSpace.insertBefore(i,b.display.lineSpace.firstChild)}function R(b){setTimeout(function(){var i=!1,c=b.getInputField();c.nodeName=="TEXTAREA"?i=!c.value:b.lineCount()==1&&(i=!/[^\u200b]/.test(c.querySelector(".CodeMirror-line").textContent)),i?I(b):L(b)},20)}function M(b){E(b)&&I(b)}function p(b){var i=b.getWrapperElement(),c=E(b);i.className=i.className.replace(" CodeMirror-empty","")+(c?" CodeMirror-empty":""),c?I(b):L(b)}function E(b){return b.lineCount()===1&&b.getLine(0)===""}})},"1dTM":function(it,ne,q){"use strict";Object.defineProperty(ne,"__esModule",{value:!0}),ne.default=void 0;var G=q("GQ8N"),L=T(q("Lo0S")),I=q("VSMT"),R=q("GdRQ"),M=q("SZEN"),p=q("vewr"),E=_(q("YJ9k")),b=_(q("MZdM")),i=_(q("ItS6")),c=_(q("whVF")),o=_(q("Fv0C")),h=_(q("LCi9")),n=_(q("rwxt")),a=_(q("Mmt2")),t=_(q("iUHT")),r=_(q("mHUz")),s=_(q("P2ho")),u=q("NBmB");q("mdZa");var d=_(q("34/K")),f=_(q("hXwI")),v=_(q("SgaC")),m=_(q("3690")),S=_(q("8K/p")),C=_(q("xO64"));function _(ge){return ge&&ge.__esModule?ge:{default:ge}}function y(){if(typeof WeakMap!="function")return null;var ge=new WeakMap;return y=function(){return ge},ge}function T(ge){if(ge&&ge.__esModule)return ge;if(ge===null||O(ge)!=="object"&&typeof ge!="function")return{default:ge};var xe=y();if(xe&&xe.has(ge))return xe.get(ge);var we={},Te=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var re in ge)if(Object.prototype.hasOwnProperty.call(ge,re)){var ve=Te?Object.getOwnPropertyDescriptor(ge,re):null;ve&&(ve.get||ve.set)?Object.defineProperty(we,re,ve):we[re]=ge[re]}return we.default=ge,xe&&xe.set(ge,we),we}function O(ge){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?O=function(we){return typeof we}:O=function(we){return we&&typeof Symbol=="function"&&we.constructor===Symbol&&we!==Symbol.prototype?"symbol":typeof we},O(ge)}function g(ge,xe){if(!(ge instanceof xe))throw new TypeError("Cannot call a class as a function")}function F(ge,xe){for(var we=0;we<xe.length;we++){var Te=xe[we];Te.enumerable=Te.enumerable||!1,Te.configurable=!0,"value"in Te&&(Te.writable=!0),Object.defineProperty(ge,Te.key,Te)}}function P(ge,xe,we){return xe&&F(ge.prototype,xe),we&&F(ge,we),ge}function N(ge,xe){if(typeof xe!="function"&&xe!==null)throw new TypeError("Super expression must either be null or a function");ge.prototype=Object.create(xe&&xe.prototype,{constructor:{value:ge,writable:!0,configurable:!0}}),xe&&X(ge,xe)}function X(ge,xe){return X=Object.setPrototypeOf||function(Te,re){return Te.__proto__=re,Te},X(ge,xe)}function j(ge){var xe=U();return function(){var Te=k(ge),re;if(xe){var ve=k(this).constructor;re=Reflect.construct(Te,arguments,ve)}else re=Te.apply(this,arguments);return A(this,re)}}function A(ge,xe){return xe&&(O(xe)==="object"||typeof xe=="function")?xe:K(ge)}function K(ge){if(ge===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return ge}function U(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(ge){return!1}}function k(ge){return k=Object.setPrototypeOf?Object.getPrototypeOf:function(we){return we.__proto__||Object.getPrototypeOf(we)},k(ge)}var z=3,te="rgb(40, 40, 40)",de=17,be=50,We=19,Ne=75,Le=50,Ke=1e3,He=50,Ae=1,Se=1<<1,he=1<<2,Ie=1<<3,ye=1<<4,Ge=1<<24,$e=1<<25,ze=1<<26,Je=1<<27,Qe=1<<28,fe=function(ge){N(we,ge);var xe=j(we);function we(Te,re,ve){var ae;if(g(this,we),!Te)throw new Error("Must specify target");if(!re)throw new Error("Must specify URL");ae=xe.call(this),ae._target=Te,ae._url=re,ve=ve||{},ae._rfbCredentials=ve.credentials||{},ae._shared="shared"in ve?!!ve.shared:!0,ae._repeaterID=ve.repeaterID||"",ae._wsProtocols=ve.wsProtocols||[],ae._rfbConnectionState="",ae._rfbInitState="",ae._rfbAuthScheme=-1,ae._rfbCleanDisconnect=!0,ae._rfbVersion=0,ae._rfbMaxVersion=3.8,ae._rfbTightVNC=!1,ae._rfbVeNCryptState=0,ae._rfbXvpVer=0,ae._fbWidth=0,ae._fbHeight=0,ae._fbName="",ae._capabilities={power:!1},ae._supportsFence=!1,ae._supportsContinuousUpdates=!1,ae._enabledContinuousUpdates=!1,ae._supportsSetDesktopSize=!1,ae._screenID=0,ae._screenFlags=0,ae._qemuExtKeyEventSupported=!1,ae._clipboardText=null,ae._clipboardServerCapabilitiesActions={},ae._clipboardServerCapabilitiesFormats={},ae._sock=null,ae._display=null,ae._flushing=!1,ae._keyboard=null,ae._gestures=null,ae._disconnTimer=null,ae._resizeTimeout=null,ae._mouseMoveTimer=null,ae._decoders={},ae._FBU={rects:0,x:0,y:0,width:0,height:0,encoding:null},ae._mousePos={},ae._mouseButtonMask=0,ae._mouseLastMoveTime=0,ae._viewportDragging=!1,ae._viewportDragPos={},ae._viewportHasMoved=!1,ae._accumulatedWheelDeltaX=0,ae._accumulatedWheelDeltaY=0,ae._gestureLastTapTime=null,ae._gestureFirstDoubleTapEv=null,ae._gestureLastMagnitudeX=0,ae._gestureLastMagnitudeY=0,ae._eventHandlers={focusCanvas:ae._focusCanvas.bind(K(ae)),windowResize:ae._windowResize.bind(K(ae)),handleMouse:ae._handleMouse.bind(K(ae)),handleWheel:ae._handleWheel.bind(K(ae)),handleGesture:ae._handleGesture.bind(K(ae))},L.Debug(">> RFB.constructor"),ae._screen=document.createElement("div"),ae._screen.style.display="flex",ae._screen.style.width="100%",ae._screen.style.height="100%",ae._screen.style.overflow="auto",ae._screen.style.background=te,ae._canvas=document.createElement("canvas"),ae._canvas.style.margin="auto",ae._canvas.style.outline="none",ae._canvas.style.flexShrink="0",ae._canvas.width=0,ae._canvas.height=0,ae._canvas.tabIndex=-1,ae._screen.appendChild(ae._canvas),ae._cursor=new n.default,ae._cursorImage=we.cursors.none,ae._decoders[u.encodings.encodingRaw]=new d.default,ae._decoders[u.encodings.encodingCopyRect]=new f.default,ae._decoders[u.encodings.encodingRRE]=new v.default,ae._decoders[u.encodings.encodingHextile]=new m.default,ae._decoders[u.encodings.encodingTight]=new S.default,ae._decoders[u.encodings.encodingTightPNG]=new C.default;try{ae._display=new b.default(ae._canvas)}catch(Me){throw L.Error("Display exception: "+Me),Me}return ae._display.onflush=ae._onFlush.bind(K(ae)),ae._keyboard=new o.default(ae._canvas),ae._keyboard.onkeyevent=ae._handleKeyEvent.bind(K(ae)),ae._gestures=new h.default,ae._sock=new a.default,ae._sock.on("message",function(){ae._handleMessage()}),ae._sock.on("open",function(){ae._rfbConnectionState==="connecting"&&ae._rfbInitState===""?(ae._rfbInitState="ProtocolVersion",L.Debug("Starting VNC handshake")):ae._fail("Unexpected server connection while "+ae._rfbConnectionState)}),ae._sock.on("close",function(Me){L.Debug("WebSocket on-close event");var Ye="";Me.code&&(Ye="(code: "+Me.code,Me.reason&&(Ye+=", reason: "+Me.reason),Ye+=")");switch(ae._rfbConnectionState){case"connecting":ae._fail("Connection closed "+Ye);break;case"connected":ae._updateConnectionState("disconnecting"),ae._updateConnectionState("disconnected");break;case"disconnecting":ae._updateConnectionState("disconnected");break;case"disconnected":ae._fail("Unexpected server disconnect when already disconnected "+Ye);break;default:ae._fail("Unexpected server disconnect before connecting "+Ye);break}ae._sock.off("close")}),ae._sock.on("error",function(Me){return L.Warn("WebSocket on-error event")}),setTimeout(ae._updateConnectionState.bind(K(ae),"connecting")),L.Debug("<< RFB.constructor"),ae.dragViewport=!1,ae.focusOnClick=!0,ae._viewOnly=!1,ae._clipViewport=!1,ae._scaleViewport=!1,ae._resizeSession=!1,ae._showDotCursor=!1,ve.showDotCursor!==void 0&&(L.Warn("Specifying showDotCursor as a RFB constructor argument is deprecated"),ae._showDotCursor=ve.showDotCursor),ae._qualityLevel=6,ae._compressionLevel=2,ae}return P(we,[{key:"disconnect",value:function(){this._updateConnectionState("disconnecting"),this._sock.off("error"),this._sock.off("message"),this._sock.off("open")}},{key:"sendCredentials",value:function(re){this._rfbCredentials=re,setTimeout(this._initMsg.bind(this),0)}},{key:"sendCtrlAltDel",value:function(){if(this._rfbConnectionState!=="connected"||this._viewOnly)return;L.Info("Sending Ctrl-Alt-Del"),this.sendKey(r.default.XK_Control_L,"ControlLeft",!0),this.sendKey(r.default.XK_Alt_L,"AltLeft",!0),this.sendKey(r.default.XK_Delete,"Delete",!0),this.sendKey(r.default.XK_Delete,"Delete",!1),this.sendKey(r.default.XK_Alt_L,"AltLeft",!1),this.sendKey(r.default.XK_Control_L,"ControlLeft",!1)}},{key:"machineShutdown",value:function(){this._xvpOp(1,2)}},{key:"machineReboot",value:function(){this._xvpOp(1,3)}},{key:"machineReset",value:function(){this._xvpOp(1,4)}},{key:"sendKey",value:function(re,ve,ae){if(this._rfbConnectionState!=="connected"||this._viewOnly)return;if(ae===void 0){this.sendKey(re,ve,!0),this.sendKey(re,ve,!1);return}var Me=s.default[ve];if(this._qemuExtKeyEventSupported&&Me)re=re||0,L.Info("Sending key ("+(ae?"down":"up")+"): keysym "+re+", scancode "+Me),we.messages.QEMUExtendedKeyEvent(this._sock,re,ae,Me);else{if(!re)return;L.Info("Sending keysym ("+(ae?"down":"up")+"): "+re),we.messages.keyEvent(this._sock,re,ae?1:0)}}},{key:"focus",value:function(){this._canvas.focus()}},{key:"blur",value:function(){this._canvas.blur()}},{key:"clipboardPasteFrom",value:function(re){if(this._rfbConnectionState!=="connected"||this._viewOnly)return;if(this._clipboardServerCapabilitiesFormats[Ae]&&this._clipboardServerCapabilitiesActions[Je])this._clipboardText=re,we.messages.extendedClipboardNotify(this._sock,[Ae]);else{for(var ve=new Uint8Array(re.length),ae=0;ae<re.length;ae++)ve[ae]=re.charCodeAt(ae);we.messages.clientCutText(this._sock,ve)}}},{key:"_connect",value:function(){L.Debug(">> RFB.connect"),L.Info("connecting to "+this._url);try{this._sock.open(this._url,this._wsProtocols)}catch(re){re.name==="SyntaxError"?this._fail("Invalid host or port ("+re+")"):this._fail("Error when opening socket ("+re+")")}this._target.appendChild(this._screen),this._gestures.attach(this._canvas),this._cursor.attach(this._canvas),this._refreshCursor(),window.addEventListener("resize",this._eventHandlers.windowResize),this._canvas.addEventListener("mousedown",this._eventHandlers.focusCanvas),this._canvas.addEventListener("touchstart",this._eventHandlers.focusCanvas),this._canvas.addEventListener("mousedown",this._eventHandlers.handleMouse),this._canvas.addEventListener("mouseup",this._eventHandlers.handleMouse),this._canvas.addEventListener("mousemove",this._eventHandlers.handleMouse),this._canvas.addEventListener("click",this._eventHandlers.handleMouse),this._canvas.addEventListener("contextmenu",this._eventHandlers.handleMouse),this._canvas.addEventListener("wheel",this._eventHandlers.handleWheel),this._canvas.addEventListener("gesturestart",this._eventHandlers.handleGesture),this._canvas.addEventListener("gesturemove",this._eventHandlers.handleGesture),this._canvas.addEventListener("gestureend",this._eventHandlers.handleGesture),L.Debug("<< RFB.connect")}},{key:"_disconnect",value:function(){L.Debug(">> RFB.disconnect"),this._cursor.detach(),this._canvas.removeEventListener("gesturestart",this._eventHandlers.handleGesture),this._canvas.removeEventListener("gesturemove",this._eventHandlers.handleGesture),this._canvas.removeEventListener("gestureend",this._eventHandlers.handleGesture),this._canvas.removeEventListener("wheel",this._eventHandlers.handleWheel),this._canvas.removeEventListener("mousedown",this._eventHandlers.handleMouse),this._canvas.removeEventListener("mouseup",this._eventHandlers.handleMouse),this._canvas.removeEventListener("mousemove",this._eventHandlers.handleMouse),this._canvas.removeEventListener("click",this._eventHandlers.handleMouse),this._canvas.removeEventListener("contextmenu",this._eventHandlers.handleMouse),this._canvas.removeEventListener("mousedown",this._eventHandlers.focusCanvas),this._canvas.removeEventListener("touchstart",this._eventHandlers.focusCanvas),window.removeEventListener("resize",this._eventHandlers.windowResize),this._keyboard.ungrab(),this._gestures.detach(),this._sock.close();try{this._target.removeChild(this._screen)}catch(re){if(!(re.name==="NotFoundError"))throw re}clearTimeout(this._resizeTimeout),clearTimeout(this._mouseMoveTimer),L.Debug("<< RFB.disconnect")}},{key:"_focusCanvas",value:function(re){if(!this.focusOnClick)return;this.focus()}},{key:"_setDesktopName",value:function(re){this._fbName=re,this.dispatchEvent(new CustomEvent("desktopname",{detail:{name:this._fbName}}))}},{key:"_windowResize",value:function(re){var ve=this;window.requestAnimationFrame(function(){ve._updateClip(),ve._updateScale()}),this._resizeSession&&(clearTimeout(this._resizeTimeout),this._resizeTimeout=setTimeout(this._requestRemoteResize.bind(this),500))}},{key:"_updateClip",value:function(){var re=this._display.clipViewport,ve=this._clipViewport;if(this._scaleViewport&&(ve=!1),re!==ve&&(this._display.clipViewport=ve),ve){var ae=this._screenSize();this._display.viewportChangeSize(ae.w,ae.h),this._fixScrollbars()}}},{key:"_updateScale",value:function(){if(!this._scaleViewport)this._display.scale=1;else{var re=this._screenSize();this._display.autoscale(re.w,re.h)}this._fixScrollbars()}},{key:"_requestRemoteResize",value:function(){if(clearTimeout(this._resizeTimeout),this._resizeTimeout=null,!this._resizeSession||this._viewOnly||!this._supportsSetDesktopSize)return;var re=this._screenSize();we.messages.setDesktopSize(this._sock,Math.floor(re.w),Math.floor(re.h),this._screenID,this._screenFlags),L.Debug("Requested new desktop size: "+re.w+"x"+re.h)}},{key:"_screenSize",value:function(){var re=this._screen.getBoundingClientRect();return{w:re.width,h:re.height}}},{key:"_fixScrollbars",value:function(){var re=this._screen.style.overflow;this._screen.style.overflow="hidden",this._screen.getBoundingClientRect(),this._screen.style.overflow=re}},{key:"_updateConnectionState",value:function(re){var ve=this,ae=this._rfbConnectionState;if(re===ae){L.Debug("Already in state '"+re+"', ignoring");return}if(ae==="disconnected"){L.Error("Tried changing state of a disconnected RFB object");return}switch(re){case"connected":if(ae!=="connecting"){L.Error("Bad transition to connected state, previous connection state: "+ae);return}break;case"disconnected":if(ae!=="disconnecting"){L.Error("Bad transition to disconnected state, previous connection state: "+ae);return}break;case"connecting":if(ae!==""){L.Error("Bad transition to connecting state, previous connection state: "+ae);return}break;case"disconnecting":if(ae!=="connected"&&ae!=="connecting"){L.Error("Bad transition to disconnecting state, previous connection state: "+ae);return}break;default:L.Error("Unknown connection state: "+re);return}this._rfbConnectionState=re,L.Debug("New state '"+re+"', was '"+ae+"'."),this._disconnTimer&&re!=="disconnecting"&&(L.Debug("Clearing disconnect timer"),clearTimeout(this._disconnTimer),this._disconnTimer=null,this._sock.off("close"));switch(re){case"connecting":this._connect();break;case"connected":this.dispatchEvent(new CustomEvent("connect",{detail:{}}));break;case"disconnecting":this._disconnect(),this._disconnTimer=setTimeout(function(){L.Error("Disconnection timed out."),ve._updateConnectionState("disconnected")},z*1e3);break;case"disconnected":this.dispatchEvent(new CustomEvent("disconnect",{detail:{clean:this._rfbCleanDisconnect}}));break}}},{key:"_fail",value:function(re){switch(this._rfbConnectionState){case"disconnecting":L.Error("Failed when disconnecting: "+re);break;case"connected":L.Error("Failed while connected: "+re);break;case"connecting":L.Error("Failed when connecting: "+re);break;default:L.Error("RFB failure: "+re);break}return this._rfbCleanDisconnect=!1,this._updateConnectionState("disconnecting"),this._updateConnectionState("disconnected"),!1}},{key:"_setCapability",value:function(re,ve){this._capabilities[re]=ve,this.dispatchEvent(new CustomEvent("capabilities",{detail:{capabilities:this._capabilities}}))}},{key:"_handleMessage",value:function(){if(this._sock.rQlen===0){L.Warn("handleMessage called on an empty receive queue");return}switch(this._rfbConnectionState){case"disconnected":L.Error("Got data while disconnected");break;case"connected":for(;!this._flushing;){if(!this._normalMsg())break;if(this._sock.rQlen===0)break}break;default:this._initMsg();break}}},{key:"_handleKeyEvent",value:function(re,ve,ae){this.sendKey(re,ve,ae)}},{key:"_handleMouse",value:function(re){if(re.type==="click"&&re.target!==this._canvas)return;if(re.stopPropagation(),re.preventDefault(),re.type==="click"||re.type==="contextmenu")return;var ve=(0,M.clientToElement)(re.clientX,re.clientY,this._canvas);switch(re.type){case"mousedown":(0,p.setCapture)(this._canvas),this._handleMouseButton(ve.x,ve.y,!0,1<<re.button);break;case"mouseup":this._handleMouseButton(ve.x,ve.y,!1,1<<re.button);break;case"mousemove":this._handleMouseMove(ve.x,ve.y);break}}},{key:"_handleMouseButton",value:function(re,ve,ae,Me){if(this.dragViewport)if(ae&&!this._viewportDragging){this._viewportDragging=!0,this._viewportDragPos={x:re,y:ve},this._viewportHasMoved=!1;return}else{if(this._viewportDragging=!1,this._viewportHasMoved)return;this._sendMouse(re,ve,Me)}this._mouseMoveTimer!==null&&(clearTimeout(this._mouseMoveTimer),this._mouseMoveTimer=null,this._sendMouse(re,ve,this._mouseButtonMask)),ae?this._mouseButtonMask|=Me:this._mouseButtonMask&=~Me,this._sendMouse(re,ve,this._mouseButtonMask)}},{key:"_handleMouseMove",value:function(re,ve){var ae=this;if(this._viewportDragging){var Me=this._viewportDragPos.x-re,Ye=this._viewportDragPos.y-ve;(this._viewportHasMoved||Math.abs(Me)>R.dragThreshold||Math.abs(Ye)>R.dragThreshold)&&(this._viewportHasMoved=!0,this._viewportDragPos={x:re,y:ve},this._display.viewportChangePos(Me,Ye));return}if(this._mousePos={x:re,y:ve},this._mouseMoveTimer==null){var et=Date.now()-this._mouseLastMoveTime;et>de?(this._sendMouse(re,ve,this._mouseButtonMask),this._mouseLastMoveTime=Date.now()):this._mouseMoveTimer=setTimeout(function(){ae._handleDelayedMouseMove()},de-et)}}},{key:"_handleDelayedMouseMove",value:function(){this._mouseMoveTimer=null,this._sendMouse(this._mousePos.x,this._mousePos.y,this._mouseButtonMask),this._mouseLastMoveTime=Date.now()}},{key:"_sendMouse",value:function(re,ve,ae){if(this._rfbConnectionState!=="connected")return;if(this._viewOnly)return;we.messages.pointerEvent(this._sock,this._display.absX(re),this._display.absY(ve),ae)}},{key:"_handleWheel",value:function(re){if(this._rfbConnectionState!=="connected")return;if(this._viewOnly)return;re.stopPropagation(),re.preventDefault();var ve=(0,M.clientToElement)(re.clientX,re.clientY,this._canvas),ae=re.deltaX,Me=re.deltaY;re.deltaMode!==0&&(ae*=We,Me*=We),this._accumulatedWheelDeltaX+=ae,this._accumulatedWheelDeltaY+=Me,Math.abs(this._accumulatedWheelDeltaX)>=be&&(this._accumulatedWheelDeltaX<0?(this._handleMouseButton(ve.x,ve.y,!0,1<<5),this._handleMouseButton(ve.x,ve.y,!1,1<<5)):this._accumulatedWheelDeltaX>0&&(this._handleMouseButton(ve.x,ve.y,!0,1<<6),this._handleMouseButton(ve.x,ve.y,!1,1<<6)),this._accumulatedWheelDeltaX=0),Math.abs(this._accumulatedWheelDeltaY)>=be&&(this._accumulatedWheelDeltaY<0?(this._handleMouseButton(ve.x,ve.y,!0,1<<3),this._handleMouseButton(ve.x,ve.y,!1,1<<3)):this._accumulatedWheelDeltaY>0&&(this._handleMouseButton(ve.x,ve.y,!0,1<<4),this._handleMouseButton(ve.x,ve.y,!1,1<<4)),this._accumulatedWheelDeltaY=0)}},{key:"_fakeMouseMove",value:function(re,ve,ae){this._handleMouseMove(ve,ae),this._cursor.move(re.detail.clientX,re.detail.clientY)}},{key:"_handleTapEvent",value:function(re,ve){var ae=(0,M.clientToElement)(re.detail.clientX,re.detail.clientY,this._canvas);if(this._gestureLastTapTime!==null&&Date.now()-this._gestureLastTapTime<Ke&&this._gestureFirstDoubleTapEv.detail.type===re.detail.type){var Me=this._gestureFirstDoubleTapEv.detail.clientX-re.detail.clientX,Ye=this._gestureFirstDoubleTapEv.detail.clientY-re.detail.clientY,et=Math.hypot(Me,Ye);et<He?ae=(0,M.clientToElement)(this._gestureFirstDoubleTapEv.detail.clientX,this._gestureFirstDoubleTapEv.detail.clientY,this._canvas):this._gestureFirstDoubleTapEv=re}else this._gestureFirstDoubleTapEv=re;this._gestureLastTapTime=Date.now(),this._fakeMouseMove(this._gestureFirstDoubleTapEv,ae.x,ae.y),this._handleMouseButton(ae.x,ae.y,!0,ve),this._handleMouseButton(ae.x,ae.y,!1,ve)}},{key:"_handleGesture",value:function(re){var ve,ae=(0,M.clientToElement)(re.detail.clientX,re.detail.clientY,this._canvas);switch(re.type){case"gesturestart":switch(re.detail.type){case"onetap":this._handleTapEvent(re,1);break;case"twotap":this._handleTapEvent(re,4);break;case"threetap":this._handleTapEvent(re,2);break;case"drag":this._fakeMouseMove(re,ae.x,ae.y),this._handleMouseButton(ae.x,ae.y,!0,1);break;case"longpress":this._fakeMouseMove(re,ae.x,ae.y),this._handleMouseButton(ae.x,ae.y,!0,4);break;case"twodrag":this._gestureLastMagnitudeX=re.detail.magnitudeX,this._gestureLastMagnitudeY=re.detail.magnitudeY,this._fakeMouseMove(re,ae.x,ae.y);break;case"pinch":this._gestureLastMagnitudeX=Math.hypot(re.detail.magnitudeX,re.detail.magnitudeY),this._fakeMouseMove(re,ae.x,ae.y);break}break;case"gesturemove":switch(re.detail.type){case"onetap":case"twotap":case"threetap":break;case"drag":case"longpress":this._fakeMouseMove(re,ae.x,ae.y);break;case"twodrag":for(this._fakeMouseMove(re,ae.x,ae.y);re.detail.magnitudeY-this._gestureLastMagnitudeY>Le;)this._handleMouseButton(ae.x,ae.y,!0,8),this._handleMouseButton(ae.x,ae.y,!1,8),this._gestureLastMagnitudeY+=Le;for(;re.detail.magnitudeY-this._gestureLastMagnitudeY<-Le;)this._handleMouseButton(ae.x,ae.y,!0,16),this._handleMouseButton(ae.x,ae.y,!1,16),this._gestureLastMagnitudeY-=Le;for(;re.detail.magnitudeX-this._gestureLastMagnitudeX>Le;)this._handleMouseButton(ae.x,ae.y,!0,32),this._handleMouseButton(ae.x,ae.y,!1,32),this._gestureLastMagnitudeX+=Le;for(;re.detail.magnitudeX-this._gestureLastMagnitudeX<-Le;)this._handleMouseButton(ae.x,ae.y,!0,64),this._handleMouseButton(ae.x,ae.y,!1,64),this._gestureLastMagnitudeX-=Le;break;case"pinch":if(this._fakeMouseMove(re,ae.x,ae.y),ve=Math.hypot(re.detail.magnitudeX,re.detail.magnitudeY),Math.abs(ve-this._gestureLastMagnitudeX)>Ne){for(this._handleKeyEvent(r.default.XK_Control_L,"ControlLeft",!0);ve-this._gestureLastMagnitudeX>Ne;)this._handleMouseButton(ae.x,ae.y,!0,8),this._handleMouseButton(ae.x,ae.y,!1,8),this._gestureLastMagnitudeX+=Ne;for(;ve-this._gestureLastMagnitudeX<-Ne;)this._handleMouseButton(ae.x,ae.y,!0,16),this._handleMouseButton(ae.x,ae.y,!1,16),this._gestureLastMagnitudeX-=Ne}this._handleKeyEvent(r.default.XK_Control_L,"ControlLeft",!1);break}break;case"gestureend":switch(re.detail.type){case"onetap":case"twotap":case"threetap":case"pinch":case"twodrag":break;case"drag":this._fakeMouseMove(re,ae.x,ae.y),this._handleMouseButton(ae.x,ae.y,!1,1);break;case"longpress":this._fakeMouseMove(re,ae.x,ae.y),this._handleMouseButton(ae.x,ae.y,!1,4);break}break}}},{key:"_negotiateProtocolVersion",value:function(){if(this._sock.rQwait("version",12))return!1;var re=this._sock.rQshiftStr(12).substr(4,7);L.Info("Server ProtocolVersion: "+re);var ve=0;switch(re){case"000.000":ve=1;break;case"003.003":case"003.006":case"003.889":this._rfbVersion=3.3;break;case"003.007":this._rfbVersion=3.7;break;case"003.008":case"004.000":case"004.001":case"005.000":this._rfbVersion=3.8;break;default:return this._fail("Invalid server version "+re)}if(ve){for(var ae="ID:"+this._repeaterID;ae.length<250;)ae+="\0";return this._sock.sendString(ae),!0}this._rfbVersion>this._rfbMaxVersion&&(this._rfbVersion=this._rfbMaxVersion);var Me="00"+parseInt(this._rfbVersion,10)+".00"+this._rfbVersion*10%10;this._sock.sendString("RFB "+Me+`
|
|
|
`),L.Debug("Sent ProtocolVersion: "+Me),this._rfbInitState="Security"}},{key:"_negotiateSecurity",value:function(){function re(Me,Ye){for(var et=0;et<Ye.length;et++)if(Ye[et]===Me)return!0;return!1}if(this._rfbVersion>=3.7){var ve=this._sock.rQshift8();if(this._sock.rQwait("security type",ve,1))return!1;if(ve===0)return this._rfbInitState="SecurityReason",this._securityContext="no security types",this._securityStatus=1,this._initMsg();var ae=this._sock.rQshiftBytes(ve);if(L.Debug("Server security types: "+ae),re(1,ae))this._rfbAuthScheme=1;else if(re(22,ae))this._rfbAuthScheme=22;else if(re(16,ae))this._rfbAuthScheme=16;else if(re(2,ae))this._rfbAuthScheme=2;else if(re(19,ae))this._rfbAuthScheme=19;else return this._fail("Unsupported security types (types: "+ae+")");this._sock.send([this._rfbAuthScheme])}else{if(this._sock.rQwait("security scheme",4))return!1;if(this._rfbAuthScheme=this._sock.rQshift32(),this._rfbAuthScheme==0)return this._rfbInitState="SecurityReason",this._securityContext="authentication scheme",this._securityStatus=1,this._initMsg()}return this._rfbInitState="Authentication",L.Debug("Authenticating using scheme: "+this._rfbAuthScheme),this._initMsg()}},{key:"_handleSecurityReason",value:function(){if(this._sock.rQwait("reason length",4))return!1;var re=this._sock.rQshift32(),ve="";if(re>0){if(this._sock.rQwait("reason",re,4))return!1;ve=this._sock.rQshiftStr(re)}return ve!==""?(this.dispatchEvent(new CustomEvent("securityfailure",{detail:{status:this._securityStatus,reason:ve}})),this._fail("Security negotiation failed on "+this._securityContext+" (reason: "+ve+")")):(this.dispatchEvent(new CustomEvent("securityfailure",{detail:{status:this._securityStatus}})),this._fail("Security negotiation failed on "+this._securityContext))}},{key:"_negotiateXvpAuth",value:function(){if(this._rfbCredentials.username===void 0||this._rfbCredentials.password===void 0||this._rfbCredentials.target===void 0)return this.dispatchEvent(new CustomEvent("credentialsrequired",{detail:{types:["username","password","target"]}})),!1;var re=String.fromCharCode(this._rfbCredentials.username.length)+String.fromCharCode(this._rfbCredentials.target.length)+this._rfbCredentials.username+this._rfbCredentials.target;return this._sock.sendString(re),this._rfbAuthScheme=2,this._negotiateAuthentication()}},{key:"_negotiateVeNCryptAuth",value:function(){if(this._rfbVeNCryptState==0){if(this._sock.rQwait("vencrypt version",2))return!1;var re=this._sock.rQshift8(),ve=this._sock.rQshift8();if(!(re==0&&ve==2))return this._fail("Unsupported VeNCrypt version "+re+"."+ve);this._sock.send([0,2]),this._rfbVeNCryptState=1}if(this._rfbVeNCryptState==1){if(this._sock.rQwait("vencrypt ack",1))return!1;var ae=this._sock.rQshift8();if(ae!=0)return this._fail("VeNCrypt failure "+ae);this._rfbVeNCryptState=2}if(this._rfbVeNCryptState==2){if(this._sock.rQwait("vencrypt subtypes length",1))return!1;var Me=this._sock.rQshift8();if(Me<1)return this._fail("VeNCrypt subtypes empty");this._rfbVeNCryptSubtypesLength=Me,this._rfbVeNCryptState=3}if(this._rfbVeNCryptState==3){if(this._sock.rQwait("vencrypt subtypes",4*this._rfbVeNCryptSubtypesLength))return!1;for(var Ye=[],et=0;et<this._rfbVeNCryptSubtypesLength;et++)Ye.push(this._sock.rQshift32());if(Ye.indexOf(256)!=-1)this._sock.send([0,0,1,0]),this._rfbVeNCryptState=4;else return this._fail("VeNCrypt Plain subtype not offered by server")}if(this._rfbVeNCryptState==4){if(!this._rfbCredentials.username||!this._rfbCredentials.password)return this.dispatchEvent(new CustomEvent("credentialsrequired",{detail:{types:["username","password"]}})),!1;var je=(0,I.encodeUTF8)(this._rfbCredentials.username),ot=(0,I.encodeUTF8)(this._rfbCredentials.password);return this._sock.send([0,0,0,je.length]),this._sock.send([0,0,0,ot.length]),this._sock.sendString(je),this._sock.sendString(ot),this._rfbInitState="SecurityResult",!0}}},{key:"_negotiateStdVNCAuth",value:function(){if(this._sock.rQwait("auth challenge",16))return!1;if(this._rfbCredentials.password===void 0)return this.dispatchEvent(new CustomEvent("credentialsrequired",{detail:{types:["password"]}})),!1;var re=Array.prototype.slice.call(this._sock.rQshiftBytes(16)),ve=we.genDES(this._rfbCredentials.password,re);return this._sock.send(ve),this._rfbInitState="SecurityResult",!0}},{key:"_negotiateTightUnixAuth",value:function(){return this._rfbCredentials.username===void 0||this._rfbCredentials.password===void 0?(this.dispatchEvent(new CustomEvent("credentialsrequired",{detail:{types:["username","password"]}})),!1):(this._sock.send([0,0,0,this._rfbCredentials.username.length]),this._sock.send([0,0,0,this._rfbCredentials.password.length]),this._sock.sendString(this._rfbCredentials.username),this._sock.sendString(this._rfbCredentials.password),this._rfbInitState="SecurityResult",!0)}},{key:"_negotiateTightTunnels",value:function(re){for(var ve={0:{vendor:"TGHT",signature:"NOTUNNEL"}},ae={},Me=0;Me<re;Me++){var Ye=this._sock.rQshift32(),et=this._sock.rQshiftStr(4),je=this._sock.rQshiftStr(8);ae[Ye]={vendor:et,signature:je}}return L.Debug("Server Tight tunnel types: "+ae),ae[1]&&ae[1].vendor==="SICR"&&ae[1].signature==="SCHANNEL"&&(L.Debug("Detected Siemens server. Assuming NOTUNNEL support."),ae[0]={vendor:"TGHT",signature:"NOTUNNEL"}),ae[0]?ae[0].vendor!=ve[0].vendor||ae[0].signature!=ve[0].signature?this._fail("Client's tunnel type had the incorrect vendor or signature"):(L.Debug("Selected tunnel type: "+ve[0]),this._sock.send([0,0,0,0]),!1):this._fail("Server wanted tunnels, but doesn't support the notunnel type")}},{key:"_negotiateTightAuth",value:function(){if(!this._rfbTightVNC){if(this._sock.rQwait("num tunnels",4))return!1;var re=this._sock.rQshift32();if(re>0&&this._sock.rQwait("tunnel capabilities",16*re,4))return!1;if(this._rfbTightVNC=!0,re>0)return this._negotiateTightTunnels(re),!1}if(this._sock.rQwait("sub auth count",4))return!1;var ve=this._sock.rQshift32();if(ve===0)return this._rfbInitState="SecurityResult",!0;if(this._sock.rQwait("sub auth capabilities",16*ve,4))return!1;for(var ae={STDVNOAUTH__:1,STDVVNCAUTH_:2,TGHTULGNAUTH:129},Me=[],Ye=0;Ye<ve;Ye++){this._sock.rQshift32();var et=this._sock.rQshiftStr(12);Me.push(et)}L.Debug("Server Tight authentication types: "+Me);for(var je in ae)if(Me.indexOf(je)!=-1){this._sock.send([0,0,0,ae[je]]),L.Debug("Selected authentication type: "+je);switch(je){case"STDVNOAUTH__":return this._rfbInitState="SecurityResult",!0;case"STDVVNCAUTH_":return this._rfbAuthScheme=2,this._initMsg();case"TGHTULGNAUTH":return this._rfbAuthScheme=129,this._initMsg();default:return this._fail("Unsupported tiny auth scheme (scheme: "+je+")")}}return this._fail("No supported sub-auth types!")}},{key:"_negotiateAuthentication",value:function(){switch(this._rfbAuthScheme){case 1:return this._rfbVersion>=3.8?(this._rfbInitState="SecurityResult",!0):(this._rfbInitState="ClientInitialisation",this._initMsg());case 22:return this._negotiateXvpAuth();case 2:return this._negotiateStdVNCAuth();case 16:return this._negotiateTightAuth();case 19:return this._negotiateVeNCryptAuth();case 129:return this._negotiateTightUnixAuth();default:return this._fail("Unsupported auth scheme (scheme: "+this._rfbAuthScheme+")")}}},{key:"_handleSecurityResult",value:function(){if(this._sock.rQwait("VNC auth response ",4))return!1;var re=this._sock.rQshift32();return re===0?(this._rfbInitState="ClientInitialisation",L.Debug("Authentication OK"),this._initMsg()):this._rfbVersion>=3.8?(this._rfbInitState="SecurityReason",this._securityContext="security result",this._securityStatus=re,this._initMsg()):(this.dispatchEvent(new CustomEvent("securityfailure",{detail:{status:re}})),this._fail("Security handshake failed"))}},{key:"_negotiateServerInit",value:function(){if(this._sock.rQwait("server initialization",24))return!1;var re=this._sock.rQshift16(),ve=this._sock.rQshift16(),ae=this._sock.rQshift8(),Me=this._sock.rQshift8(),Ye=this._sock.rQshift8(),et=this._sock.rQshift8(),je=this._sock.rQshift16(),ot=this._sock.rQshift16(),ce=this._sock.rQshift16(),Pe=this._sock.rQshift8(),Fe=this._sock.rQshift8(),Ce=this._sock.rQshift8();this._sock.rQskipBytes(3);var _e=this._sock.rQshift32();if(this._sock.rQwait("server init name",_e,24))return!1;var Ee=this._sock.rQshiftStr(_e);if(Ee=(0,I.decodeUTF8)(Ee,!0),this._rfbTightVNC){if(this._sock.rQwait("TightVNC extended server init header",8,24+_e))return!1;var ee=this._sock.rQshift16(),oe=this._sock.rQshift16(),Q=this._sock.rQshift16();this._sock.rQskipBytes(2);var me=(ee+oe+Q)*16;if(this._sock.rQwait("TightVNC extended server init header",me,32+_e))return!1;this._sock.rQskipBytes(16*ee),this._sock.rQskipBytes(16*oe),this._sock.rQskipBytes(16*Q)}return L.Info("Screen: "+re+"x"+ve+", bpp: "+ae+", depth: "+Me+", bigEndian: "+Ye+", trueColor: "+et+", redMax: "+je+", greenMax: "+ot+", blueMax: "+ce+", redShift: "+Pe+", greenShift: "+Fe+", blueShift: "+Ce),this._setDesktopName(Ee),this._resize(re,ve),this._viewOnly||this._keyboard.grab(),this._fbDepth=24,this._fbName==="Intel(r) AMT KVM"&&(L.Warn("Intel AMT KVM only supports 8/16 bit depths. Using low color mode."),this._fbDepth=8),we.messages.pixelFormat(this._sock,this._fbDepth,!0),this._sendEncodings(),we.messages.fbUpdateRequest(this._sock,!1,0,0,this._fbWidth,this._fbHeight),this._updateConnectionState("connected"),!0}},{key:"_sendEncodings",value:function(){var re=[];re.push(u.encodings.encodingCopyRect),this._fbDepth==24&&(re.push(u.encodings.encodingTight),re.push(u.encodings.encodingTightPNG),re.push(u.encodings.encodingHextile),re.push(u.encodings.encodingRRE)),re.push(u.encodings.encodingRaw),re.push(u.encodings.pseudoEncodingQualityLevel0+this._qualityLevel),re.push(u.encodings.pseudoEncodingCompressLevel0+this._compressionLevel),re.push(u.encodings.pseudoEncodingDesktopSize),re.push(u.encodings.pseudoEncodingLastRect),re.push(u.encodings.pseudoEncodingQEMUExtendedKeyEvent),re.push(u.encodings.pseudoEncodingExtendedDesktopSize),re.push(u.encodings.pseudoEncodingXvp),re.push(u.encodings.pseudoEncodingFence),re.push(u.encodings.pseudoEncodingContinuousUpdates),re.push(u.encodings.pseudoEncodingDesktopName),re.push(u.encodings.pseudoEncodingExtendedClipboard),this._fbDepth==24&&(re.push(u.encodings.pseudoEncodingVMwareCursor),re.push(u.encodings.pseudoEncodingCursor)),we.messages.clientEncodings(this._sock,re)}},{key:"_initMsg",value:function(){switch(this._rfbInitState){case"ProtocolVersion":return this._negotiateProtocolVersion();case"Security":return this._negotiateSecurity();case"Authentication":return this._negotiateAuthentication();case"SecurityResult":return this._handleSecurityResult();case"SecurityReason":return this._handleSecurityReason();case"ClientInitialisation":return this._sock.send([this._shared?1:0]),this._rfbInitState="ServerInitialisation",!0;case"ServerInitialisation":return this._negotiateServerInit();default:return this._fail("Unknown init state (state: "+this._rfbInitState+")")}}},{key:"_handleSetColourMapMsg",value:function(){return L.Debug("SetColorMapEntries"),this._fail("Unexpected SetColorMapEntries message")}},{key:"_handleServerCutText",value:function(){if(L.Debug("ServerCutText"),this._sock.rQwait("ServerCutText header",7,1))return!1;this._sock.rQskipBytes(3);var re=this._sock.rQshift32();if(re=(0,G.toSigned32bit)(re),this._sock.rQwait("ServerCutText content",Math.abs(re),8))return!1;if(re>=0){var ve=this._sock.rQshiftStr(re);if(this._viewOnly)return!0;this.dispatchEvent(new CustomEvent("clipboard",{detail:{text:ve}}))}else{re=Math.abs(re);var ae=this._sock.rQshift32(),Me=ae&65535,Ye=ae&4278190080,et=!!(Ye&Ge);if(et){this._clipboardServerCapabilitiesFormats={},this._clipboardServerCapabilitiesActions={};for(var je=0;je<=15;je++){var ot=1<<je;Me&ot&&(this._clipboardServerCapabilitiesFormats[ot]=!0,this._sock.rQshift32())}for(var ce=24;ce<=31;ce++){var Pe=1<<ce;this._clipboardServerCapabilitiesActions[Pe]=!!(Ye&Pe)}var Fe=[Ge,$e,ze,Je,Qe];we.messages.extendedClipboardCaps(this._sock,Fe,{extendedClipboardFormatText:0})}else if(Ye===$e){if(this._viewOnly)return!0;this._clipboardText!=null&&this._clipboardServerCapabilitiesActions[Qe]&&(Me&Ae&&we.messages.extendedClipboardProvide(this._sock,[Ae],[this._clipboardText]))}else if(Ye===ze){if(this._viewOnly)return!0;this._clipboardServerCapabilitiesActions[Je]&&(this._clipboardText!=null?we.messages.extendedClipboardNotify(this._sock,[Ae]):we.messages.extendedClipboardNotify(this._sock,[]))}else if(Ye===Je){if(this._viewOnly)return!0;this._clipboardServerCapabilitiesActions[$e]&&(Me&Ae&&we.messages.extendedClipboardRequest(this._sock,[Ae]))}else if(Ye===Qe){if(this._viewOnly)return!0;if(!(Me&Ae))return!0;this._clipboardText=null;var Ce=this._sock.rQshiftBytes(re-4),_e=new i.default,Ee=null;_e.setInput(Ce);for(var ee=0;ee<=15;ee++){var oe=1<<ee;if(Me&oe){var Q=0,me=_e.inflate(4);Q|=me[0]<<24,Q|=me[1]<<16,Q|=me[2]<<8,Q|=me[3];var Oe=_e.inflate(Q);oe===Ae&&(Ee=Oe)}}if(_e.setInput(null),Ee!==null){for(var V="",Re=0;Re<Ee.length;Re++)V+=String.fromCharCode(Ee[Re]);Ee=V,Ee=(0,I.decodeUTF8)(Ee),Ee.length>0&&Ee.charAt(Ee.length-1)==="\0"&&(Ee=Ee.slice(0,-1)),Ee=Ee.replace(`\r
|
|
|
`,`
|
|
|
`),this.dispatchEvent(new CustomEvent("clipboard",{detail:{text:Ee}}))}}else return this._fail("Unexpected action in extended clipboard message: "+Ye)}return!0}},{key:"_handleServerFenceMsg",value:function(){if(this._sock.rQwait("ServerFence header",8,1))return!1;this._sock.rQskipBytes(3);var re=this._sock.rQshift32(),ve=this._sock.rQshift8();if(this._sock.rQwait("ServerFence payload",ve,9))return!1;ve>64&&(L.Warn("Bad payload length ("+ve+") in fence response"),ve=64);var ae=this._sock.rQshiftStr(ve);return this._supportsFence=!0,re&1<<31?(re&=1<<0|1<<1,we.messages.clientFence(this._sock,re,ae),!0):this._fail("Unexpected fence response")}},{key:"_handleXvpMsg",value:function(){if(this._sock.rQwait("XVP version and message",3,1))return!1;this._sock.rQskipBytes(1);var re=this._sock.rQshift8(),ve=this._sock.rQshift8();switch(ve){case 0:L.Error("XVP Operation Failed");break;case 1:this._rfbXvpVer=re,L.Info("XVP extensions enabled (version "+this._rfbXvpVer+")"),this._setCapability("power",!0);break;default:this._fail("Illegal server XVP message (msg: "+ve+")");break}return!0}},{key:"_normalMsg",value:function(){var re;this._FBU.rects>0?re=0:re=this._sock.rQshift8();var ve,ae;switch(re){case 0:return ae=this._framebufferUpdate(),ae&&!this._enabledContinuousUpdates&&we.messages.fbUpdateRequest(this._sock,!0,0,0,this._fbWidth,this._fbHeight),ae;case 1:return this._handleSetColourMapMsg();case 2:return L.Debug("Bell"),this.dispatchEvent(new CustomEvent("bell",{detail:{}})),!0;case 3:return this._handleServerCutText();case 150:return ve=!this._supportsContinuousUpdates,this._supportsContinuousUpdates=!0,this._enabledContinuousUpdates=!1,ve&&(this._enabledContinuousUpdates=!0,this._updateContinuousUpdates(),L.Info("Enabling continuous updates.")),!0;case 248:return this._handleServerFenceMsg();case 250:return this._handleXvpMsg();default:return this._fail("Unexpected server message (type "+re+")"),L.Debug("sock.rQslice(0, 30): "+this._sock.rQslice(0,30)),!0}}},{key:"_onFlush",value:function(){this._flushing=!1,this._sock.rQlen>0&&this._handleMessage()}},{key:"_framebufferUpdate",value:function(){if(this._FBU.rects===0){if(this._sock.rQwait("FBU header",3,1))return!1;if(this._sock.rQskipBytes(1),this._FBU.rects=this._sock.rQshift16(),this._display.pending())return this._flushing=!0,this._display.flush(),!1}for(;this._FBU.rects>0;){if(this._FBU.encoding===null){if(this._sock.rQwait("rect header",12))return!1;var re=this._sock.rQshiftBytes(12);this._FBU.x=(re[0]<<8)+re[1],this._FBU.y=(re[2]<<8)+re[3],this._FBU.width=(re[4]<<8)+re[5],this._FBU.height=(re[6]<<8)+re[7],this._FBU.encoding=parseInt((re[8]<<24)+(re[9]<<16)+(re[10]<<8)+re[11],10)}if(!this._handleRect())return!1;this._FBU.rects--,this._FBU.encoding=null}return this._display.flip(),!0}},{key:"_handleRect",value:function(){switch(this._FBU.encoding){case u.encodings.pseudoEncodingLastRect:return this._FBU.rects=1,!0;case u.encodings.pseudoEncodingVMwareCursor:return this._handleVMwareCursor();case u.encodings.pseudoEncodingCursor:return this._handleCursor();case u.encodings.pseudoEncodingQEMUExtendedKeyEvent:try{var re=document.createEvent("keyboardEvent");re.code!==void 0&&(this._qemuExtKeyEventSupported=!0)}catch(ve){}return!0;case u.encodings.pseudoEncodingDesktopName:return this._handleDesktopName();case u.encodings.pseudoEncodingDesktopSize:return this._resize(this._FBU.width,this._FBU.height),!0;case u.encodings.pseudoEncodingExtendedDesktopSize:return this._handleExtendedDesktopSize();default:return this._handleDataRect()}}},{key:"_handleVMwareCursor",value:function(){var re=this._FBU.x,ve=this._FBU.y,ae=this._FBU.width,Me=this._FBU.height;if(this._sock.rQwait("VMware cursor encoding",1))return!1;var Ye=this._sock.rQshift8();this._sock.rQshift8();var et,je=4;if(Ye==0){var ot=4294967040|0;if(et=new Array(ae*Me*je),this._sock.rQwait("VMware cursor classic encoding",ae*Me*je*2,2))return!1;for(var ce=new Array(ae*Me),Pe=0;Pe<ae*Me;Pe++)ce[Pe]=this._sock.rQshift32();for(var Fe=new Array(ae*Me),Ce=0;Ce<ae*Me;Ce++)Fe[Ce]=this._sock.rQshift32();for(var _e=0;_e<ae*Me;_e++)if(ce[_e]==0){var Ee=Fe[_e],ee=Ee>>8&255,oe=Ee>>16&255,Q=Ee>>24&255;et[_e*je]=ee,et[_e*je+1]=oe,et[_e*je+2]=Q,et[_e*je+3]=255}else(ce[_e]&ot)==ot?Fe[_e]==0?(et[_e*je]=0,et[_e*je+1]=0,et[_e*je+2]=0,et[_e*je+3]=0):((Fe[_e]&ot)==ot,et[_e*je]=0,et[_e*je+1]=0,et[_e*je+2]=0,et[_e*je+3]=255):(et[_e*je]=0,et[_e*je+1]=0,et[_e*je+2]=0,et[_e*je+3]=255)}else if(Ye==1){if(this._sock.rQwait("VMware cursor alpha encoding",ae*Me*4,2))return!1;et=new Array(ae*Me*je);for(var me=0;me<ae*Me;me++){var Oe=this._sock.rQshift32();et[me*4]=Oe>>24&255,et[me*4+1]=Oe>>16&255,et[me*4+2]=Oe>>8&255,et[me*4+3]=Oe&255}}else return L.Warn("The given cursor type is not supported: "+Ye+" given."),!1;return this._updateCursor(et,re,ve,ae,Me),!0}},{key:"_handleCursor",value:function(){var re=this._FBU.x,ve=this._FBU.y,ae=this._FBU.width,Me=this._FBU.height,Ye=ae*Me*4,et=Math.ceil(ae/8)*Me,je=Ye+et;if(this._sock.rQwait("cursor encoding",je))return!1;for(var ot=this._sock.rQshiftBytes(Ye),ce=this._sock.rQshiftBytes(et),Pe=new Uint8Array(ae*Me*4),Fe=0,Ce=0;Ce<Me;Ce++)for(var _e=0;_e<ae;_e++){var Ee=Ce*Math.ceil(ae/8)+Math.floor(_e/8),ee=ce[Ee]<<_e%8&128?255:0;Pe[Fe]=ot[Fe+2],Pe[Fe+1]=ot[Fe+1],Pe[Fe+2]=ot[Fe],Pe[Fe+3]=ee,Fe+=4}return this._updateCursor(Pe,re,ve,ae,Me),!0}},{key:"_handleDesktopName",value:function(){if(this._sock.rQwait("DesktopName",4))return!1;var re=this._sock.rQshift32();if(this._sock.rQwait("DesktopName",re,4))return!1;var ve=this._sock.rQshiftStr(re);return ve=(0,I.decodeUTF8)(ve,!0),this._setDesktopName(ve),!0}},{key:"_handleExtendedDesktopSize",value:function(){if(this._sock.rQwait("ExtendedDesktopSize",4))return!1;var re=this._sock.rQpeek8(),ve=4+re*16;if(this._sock.rQwait("ExtendedDesktopSize",ve))return!1;var ae=!this._supportsSetDesktopSize;this._supportsSetDesktopSize=!0,ae&&this._requestRemoteResize(),this._sock.rQskipBytes(1),this._sock.rQskipBytes(3);for(var Me=0;Me<re;Me+=1)Me===0?(this._screenID=this._sock.rQshiftBytes(4),this._sock.rQskipBytes(2),this._sock.rQskipBytes(2),this._sock.rQskipBytes(2),this._sock.rQskipBytes(2),this._screenFlags=this._sock.rQshiftBytes(4)):this._sock.rQskipBytes(16);if(this._FBU.x===1&&this._FBU.y!==0){var Ye="";switch(this._FBU.y){case 1:Ye="Resize is administratively prohibited";break;case 2:Ye="Out of resources";break;case 3:Ye="Invalid screen layout";break;default:Ye="Unknown reason";break}L.Warn("Server did not accept the resize request: "+Ye)}else this._resize(this._FBU.width,this._FBU.height);return!0}},{key:"_handleDataRect",value:function(){var re=this._decoders[this._FBU.encoding];if(!re)return this._fail("Unsupported encoding (encoding: "+this._FBU.encoding+")"),!1;try{return re.decodeRect(this._FBU.x,this._FBU.y,this._FBU.width,this._FBU.height,this._sock,this._display,this._fbDepth)}catch(ve){return this._fail("Error decoding rect: "+ve),!1}}},{key:"_updateContinuousUpdates",value:function(){if(!this._enabledContinuousUpdates)return;we.messages.enableContinuousUpdates(this._sock,!0,0,0,this._fbWidth,this._fbHeight)}},{key:"_resize",value:function(re,ve){this._fbWidth=re,this._fbHeight=ve,this._display.resize(this._fbWidth,this._fbHeight),this._updateClip(),this._updateScale(),this._updateContinuousUpdates()}},{key:"_xvpOp",value:function(re,ve){if(this._rfbXvpVer<re)return;L.Info("Sending XVP operation "+ve+" (version "+re+")"),we.messages.xvpOp(this._sock,re,ve)}},{key:"_updateCursor",value:function(re,ve,ae,Me,Ye){this._cursorImage={rgbaPixels:re,hotx:ve,hoty:ae,w:Me,h:Ye},this._refreshCursor()}},{key:"_shouldShowDotCursor",value:function(){if(!this._showDotCursor)return!1;for(var re=3;re<this._cursorImage.rgbaPixels.length;re+=4)if(this._cursorImage.rgbaPixels[re])return!1;return!0}},{key:"_refreshCursor",value:function(){if(this._rfbConnectionState!=="connecting"&&this._rfbConnectionState!=="connected")return;var re=this._shouldShowDotCursor()?we.cursors.dot:this._cursorImage;this._cursor.change(re.rgbaPixels,re.hotx,re.hoty,re.w,re.h)}},{key:"viewOnly",get:function(){return this._viewOnly},set:function(re){this._viewOnly=re,(this._rfbConnectionState==="connecting"||this._rfbConnectionState==="connected")&&(re?this._keyboard.ungrab():this._keyboard.grab())}},{key:"capabilities",get:function(){return this._capabilities}},{key:"touchButton",get:function(){return 0},set:function(re){L.Warn("Using old API!")}},{key:"clipViewport",get:function(){return this._clipViewport},set:function(re){this._clipViewport=re,this._updateClip()}},{key:"scaleViewport",get:function(){return this._scaleViewport},set:function(re){this._scaleViewport=re,re&&this._clipViewport&&this._updateClip(),this._updateScale(),!re&&this._clipViewport&&this._updateClip()}},{key:"resizeSession",get:function(){return this._resizeSession},set:function(re){this._resizeSession=re,re&&this._requestRemoteResize()}},{key:"showDotCursor",get:function(){return this._showDotCursor},set:function(re){this._showDotCursor=re,this._refreshCursor()}},{key:"background",get:function(){return this._screen.style.background},set:function(re){this._screen.style.background=re}},{key:"qualityLevel",get:function(){return this._qualityLevel},set:function(re){if(!Number.isInteger(re)||re<0||re>9){L.Error("qualityLevel must be an integer between 0 and 9");return}if(this._qualityLevel===re)return;this._qualityLevel=re,this._rfbConnectionState==="connected"&&this._sendEncodings()}},{key:"compressionLevel",get:function(){return this._compressionLevel},set:function(re){if(!Number.isInteger(re)||re<0||re>9){L.Error("compressionLevel must be an integer between 0 and 9");return}if(this._compressionLevel===re)return;this._compressionLevel=re,this._rfbConnectionState==="connected"&&this._sendEncodings()}}],[{key:"genDES",value:function(re,ve){var ae=re.split("").map(function(Me){return Me.charCodeAt(0)});return new t.default(ae).encrypt(ve)}}]),we}(E.default);ne.default=fe,fe.messages={keyEvent:function(xe,we,Te){var re=xe._sQ,ve=xe._sQlen;re[ve]=4,re[ve+1]=Te,re[ve+2]=0,re[ve+3]=0,re[ve+4]=we>>24,re[ve+5]=we>>16,re[ve+6]=we>>8,re[ve+7]=we,xe._sQlen+=8,xe.flush()},QEMUExtendedKeyEvent:function(xe,we,Te,re){function ve(et){var je=re>>8,ot=re&255;return je===224&&ot<127?ot|128:et}var ae=xe._sQ,Me=xe._sQlen;ae[Me]=255,ae[Me+1]=0,ae[Me+2]=Te>>8,ae[Me+3]=Te,ae[Me+4]=we>>24,ae[Me+5]=we>>16,ae[Me+6]=we>>8,ae[Me+7]=we;var Ye=ve(re);ae[Me+8]=Ye>>24,ae[Me+9]=Ye>>16,ae[Me+10]=Ye>>8,ae[Me+11]=Ye,xe._sQlen+=12,xe.flush()},pointerEvent:function(xe,we,Te,re){var ve=xe._sQ,ae=xe._sQlen;ve[ae]=5,ve[ae+1]=re,ve[ae+2]=we>>8,ve[ae+3]=we,ve[ae+4]=Te>>8,ve[ae+5]=Te,xe._sQlen+=6,xe.flush()},_buildExtendedClipboardFlags:function(xe,we){for(var Te=new Uint8Array(4),re=0,ve=0,ae=0;ae<xe.length;ae++)ve|=xe[ae];for(var Me=0;Me<we.length;Me++)re|=we[Me];return Te[0]=ve>>24,Te[1]=0,Te[2]=0,Te[3]=re,Te},extendedClipboardProvide:function(xe,we,Te){for(var re=new c.default,ve=[],ae=0;ae<we.length;ae++){if(we[ae]!=Ae)throw new Error("Unsupported extended clipboard format for Provide message.");Te[ae]=Te[ae].replace(/\r\n|\r|\n/gm,`\r
|
|
|
`);var Me=(0,I.encodeUTF8)(Te[ae]+"\0");ve.push(Me.length>>24&255,Me.length>>16&255,Me.length>>8&255,Me.length&255);for(var Ye=0;Ye<Me.length;Ye++)ve.push(Me.charCodeAt(Ye))}var et=re.deflate(new Uint8Array(ve)),je=new Uint8Array(4+et.length);je.set(fe.messages._buildExtendedClipboardFlags([Qe],we)),je.set(et,4),fe.messages.clientCutText(xe,je,!0)},extendedClipboardNotify:function(xe,we){var Te=fe.messages._buildExtendedClipboardFlags([Je],we);fe.messages.clientCutText(xe,Te,!0)},extendedClipboardRequest:function(xe,we){var Te=fe.messages._buildExtendedClipboardFlags([$e],we);fe.messages.clientCutText(xe,Te,!0)},extendedClipboardCaps:function(xe,we,Te){var re=Object.keys(Te),ve=new Uint8Array(4+4*re.length);re.map(function(Ye){return parseInt(Ye)}),re.sort(function(Ye,et){return Ye-et}),ve.set(fe.messages._buildExtendedClipboardFlags(we,[]));for(var ae=4,Me=0;Me<re.length;Me++)ve[ae]=Te[re[Me]]>>24,ve[ae+1]=Te[re[Me]]>>16,ve[ae+2]=Te[re[Me]]>>8,ve[ae+3]=Te[re[Me]]>>0,ae+=4,ve[3]|=1<<re[Me];fe.messages.clientCutText(xe,ve,!0)},clientCutText:function(xe,we){var Te=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,re=xe._sQ,ve=xe._sQlen;re[ve]=6,re[ve+1]=0,re[ve+2]=0,re[ve+3]=0;var ae;Te?ae=(0,G.toUnsigned32bit)(-we.length):ae=we.length,re[ve+4]=ae>>24,re[ve+5]=ae>>16,re[ve+6]=ae>>8,re[ve+7]=ae,xe._sQlen+=8;for(var Me=0,Ye=we.length;Ye>0;){for(var et=Math.min(Ye,xe._sQbufferSize-xe._sQlen),je=0;je<et;je++)re[xe._sQlen+je]=we[Me+je];xe._sQlen+=et,xe.flush(),Ye-=et,Me+=et}},setDesktopSize:function(xe,we,Te,re,ve){var ae=xe._sQ,Me=xe._sQlen;ae[Me]=251,ae[Me+1]=0,ae[Me+2]=we>>8,ae[Me+3]=we,ae[Me+4]=Te>>8,ae[Me+5]=Te,ae[Me+6]=1,ae[Me+7]=0,ae[Me+8]=re>>24,ae[Me+9]=re>>16,ae[Me+10]=re>>8,ae[Me+11]=re,ae[Me+12]=0,ae[Me+13]=0,ae[Me+14]=0,ae[Me+15]=0,ae[Me+16]=we>>8,ae[Me+17]=we,ae[Me+18]=Te>>8,ae[Me+19]=Te,ae[Me+20]=ve>>24,ae[Me+21]=ve>>16,ae[Me+22]=ve>>8,ae[Me+23]=ve,xe._sQlen+=24,xe.flush()},clientFence:function(xe,we,Te){var re=xe._sQ,ve=xe._sQlen;re[ve]=248,re[ve+1]=0,re[ve+2]=0,re[ve+3]=0,re[ve+4]=we>>24,re[ve+5]=we>>16,re[ve+6]=we>>8,re[ve+7]=we;var ae=Te.length;re[ve+8]=ae;for(var Me=0;Me<ae;Me++)re[ve+9+Me]=Te.charCodeAt(Me);xe._sQlen+=9+ae,xe.flush()},enableContinuousUpdates:function(xe,we,Te,re,ve,ae){var Me=xe._sQ,Ye=xe._sQlen;Me[Ye]=150,Me[Ye+1]=we,Me[Ye+2]=Te>>8,Me[Ye+3]=Te,Me[Ye+4]=re>>8,Me[Ye+5]=re,Me[Ye+6]=ve>>8,Me[Ye+7]=ve,Me[Ye+8]=ae>>8,Me[Ye+9]=ae,xe._sQlen+=10,xe.flush()},pixelFormat:function(xe,we,Te){var re=xe._sQ,ve=xe._sQlen,ae;we>16?ae=32:we>8?ae=16:ae=8;var Me=Math.floor(we/3);re[ve]=0,re[ve+1]=0,re[ve+2]=0,re[ve+3]=0,re[ve+4]=ae,re[ve+5]=we,re[ve+6]=0,re[ve+7]=Te?1:0,re[ve+8]=0,re[ve+9]=(1<<Me)-1,re[ve+10]=0,re[ve+11]=(1<<Me)-1,re[ve+12]=0,re[ve+13]=(1<<Me)-1,re[ve+14]=Me*2,re[ve+15]=Me*1,re[ve+16]=Me*0,re[ve+17]=0,re[ve+18]=0,re[ve+19]=0,xe._sQlen+=20,xe.flush()},clientEncodings:function(xe,we){var Te=xe._sQ,re=xe._sQlen;Te[re]=2,Te[re+1]=0,Te[re+2]=we.length>>8,Te[re+3]=we.length;for(var ve=re+4,ae=0;ae<we.length;ae++){var Me=we[ae];Te[ve]=Me>>24,Te[ve+1]=Me>>16,Te[ve+2]=Me>>8,Te[ve+3]=Me,ve+=4}xe._sQlen+=ve-re,xe.flush()},fbUpdateRequest:function(xe,we,Te,re,ve,ae){var Me=xe._sQ,Ye=xe._sQlen;typeof Te=="undefined"&&(Te=0),typeof re=="undefined"&&(re=0),Me[Ye]=3,Me[Ye+1]=we?1:0,Me[Ye+2]=Te>>8&255,Me[Ye+3]=Te&255,Me[Ye+4]=re>>8&255,Me[Ye+5]=re&255,Me[Ye+6]=ve>>8&255,Me[Ye+7]=ve&255,Me[Ye+8]=ae>>8&255,Me[Ye+9]=ae&255,xe._sQlen+=10,xe.flush()},xvpOp:function(xe,we,Te){var re=xe._sQ,ve=xe._sQlen;re[ve]=250,re[ve+1]=0,re[ve+2]=we,re[ve+3]=Te,xe._sQlen+=4,xe.flush()}},fe.cursors={none:{rgbaPixels:new Uint8Array,w:0,h:0,hotx:0,hoty:0},dot:{rgbaPixels:new Uint8Array([255,255,255,255,0,0,0,255,255,255,255,255,0,0,0,255,0,0,0,0,0,0,0,255,255,255,255,255,0,0,0,255,255,255,255,255]),w:3,h:3,hotx:1,hoty:1}}},"1eCo":function(it,ne,q){(function(G){G(q("VrN/"))})(function(G){"use strict";var L={autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!0,caseFold:!0},I={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};G.defineMode("xml",function(R,M){var p=R.indentUnit,E={},b=M.htmlMode?L:I;for(var i in b)E[i]=b[i];for(var i in M)E[i]=M[i];var c,o;function h(g,F){function P(j){return F.tokenize=j,j(g,F)}var N=g.next();if(N=="<")return g.eat("!")?g.eat("[")?g.match("CDATA[")?P(t("atom","]]>")):null:g.match("--")?P(t("comment","-->")):g.match("DOCTYPE",!0,!0)?(g.eatWhile(/[\w\._\-]/),P(r(1))):null:g.eat("?")?(g.eatWhile(/[\w\._\-]/),F.tokenize=t("meta","?>"),"meta"):(c=g.eat("/")?"closeTag":"openTag",F.tokenize=n,"tag bracket");if(N=="&"){var X;return g.eat("#")?g.eat("x")?X=g.eatWhile(/[a-fA-F\d]/)&&g.eat(";"):X=g.eatWhile(/[\d]/)&&g.eat(";"):X=g.eatWhile(/[\w\.\-:]/)&&g.eat(";"),X?"atom":"error"}else return g.eatWhile(/[^&<]/),null}h.isInText=!0;function n(g,F){var P=g.next();if(P==">"||P=="/"&&g.eat(">"))return F.tokenize=h,c=P==">"?"endTag":"selfcloseTag","tag bracket";if(P=="=")return c="equals",null;if(P=="<"){F.tokenize=h,F.state=f,F.tagName=F.tagStart=null;var N=F.tokenize(g,F);return N?N+" tag error":"tag error"}else return/[\'\"]/.test(P)?(F.tokenize=a(P),F.stringStartCol=g.column(),F.tokenize(g,F)):(g.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function a(g){var F=function(P,N){for(;!P.eol();)if(P.next()==g){N.tokenize=n;break}return"string"};return F.isInAttribute=!0,F}function t(g,F){return function(P,N){for(;!P.eol();){if(P.match(F)){N.tokenize=h;break}P.next()}return g}}function r(g){return function(F,P){for(var N;(N=F.next())!=null;){if(N=="<")return P.tokenize=r(g+1),P.tokenize(F,P);if(N==">")if(g==1){P.tokenize=h;break}else return P.tokenize=r(g-1),P.tokenize(F,P)}return"meta"}}function s(g,F,P){this.prev=g.context,this.tagName=F,this.indent=g.indented,this.startOfLine=P,(E.doNotIndent.hasOwnProperty(F)||g.context&&g.context.noIndent)&&(this.noIndent=!0)}function u(g){g.context&&(g.context=g.context.prev)}function d(g,F){for(var P;;){if(!g.context)return;if(P=g.context.tagName,!E.contextGrabbers.hasOwnProperty(P)||!E.contextGrabbers[P].hasOwnProperty(F))return;u(g)}}function f(g,F,P){return g=="openTag"?(P.tagStart=F.column(),v):g=="closeTag"?m:f}function v(g,F,P){return g=="word"?(P.tagName=F.current(),o="tag",_):E.allowMissingTagName&&g=="endTag"?(o="tag bracket",_(g,F,P)):(o="error",v)}function m(g,F,P){if(g=="word"){var N=F.current();return P.context&&P.context.tagName!=N&&E.implicitlyClosed.hasOwnProperty(P.context.tagName)&&u(P),P.context&&P.context.tagName==N||E.matchClosing===!1?(o="tag",S):(o="tag error",C)}else return E.allowMissingTagName&&g=="endTag"?(o="tag bracket",S(g,F,P)):(o="error",C)}function S(g,F,P){return g!="endTag"?(o="error",S):(u(P),f)}function C(g,F,P){return o="error",S(g,F,P)}function _(g,F,P){if(g=="word")return o="attribute",y;if(g=="endTag"||g=="selfcloseTag"){var N=P.tagName,X=P.tagStart;return P.tagName=P.tagStart=null,g=="selfcloseTag"||E.autoSelfClosers.hasOwnProperty(N)?d(P,N):(d(P,N),P.context=new s(P,N,X==P.indented)),f}return o="error",_}function y(g,F,P){return g=="equals"?T:(E.allowMissing||(o="error"),_(g,F,P))}function T(g,F,P){return g=="string"?O:g=="word"&&E.allowUnquoted?(o="string",_):(o="error",_(g,F,P))}function O(g,F,P){return g=="string"?O:_(g,F,P)}return{startState:function(g){var F={tokenize:h,state:f,indented:g||0,tagName:null,tagStart:null,context:null};return g!=null&&(F.baseIndent=g),F},token:function(g,F){if(!F.tagName&&g.sol()&&(F.indented=g.indentation()),g.eatSpace())return null;c=null;var P=F.tokenize(g,F);return(P||c)&&P!="comment"&&(o=null,F.state=F.state(c||P,g,F),o&&(P=o=="error"?P+" error":o)),P},indent:function(g,F,P){var N=g.context;if(g.tokenize.isInAttribute)return g.tagStart==g.indented?g.stringStartCol+1:g.indented+p;if(N&&N.noIndent)return G.Pass;if(g.tokenize!=n&&g.tokenize!=h)return P?P.match(/^(\s*)/)[0].length:0;if(g.tagName)return E.multilineTagIndentPastTag!==!1?g.tagStart+g.tagName.length+2:g.tagStart+p*(E.multilineTagIndentFactor||1);if(E.alignCDATA&&/<!\[CDATA\[/.test(F))return 0;var X=F&&/^<(\/)?([\w_:\.-]*)/.exec(F);if(X&&X[1])for(;N;)if(N.tagName==X[2]){N=N.prev;break}else if(E.implicitlyClosed.hasOwnProperty(N.tagName))N=N.prev;else break;else if(X)for(;N;){var j=E.contextGrabbers[N.tagName];if(j&&j.hasOwnProperty(X[2]))N=N.prev;else break}for(;N&&N.prev&&!N.startOfLine;)N=N.prev;return N?N.indent+p:g.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:E.htmlMode?"html":"xml",helperType:E.htmlMode?"html":"xml",skipAttribute:function(g){g.state==T&&(g.state=_)},xmlCurrentTag:function(g){return g.tagName?{name:g.tagName,close:g.type=="closeTag"}:null},xmlCurrentContext:function(g){for(var F=[],P=g.context;P;P=P.prev)P.tagName&&F.push(P.tagName);return F.reverse()}}}),G.defineMIME("text/xml","xml"),G.defineMIME("application/xml","xml"),G.mimeModes.hasOwnProperty("text/html")||G.defineMIME("text/html",{name:"xml",htmlMode:!0})})},"1q3G":function(it,ne,q){"use strict";Object.defineProperty(ne,"__esModule",{value:!0}),ne.default=G;function G(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},"24hK":function(it,ne,q){"use strict";q.d(ne,"a",function(){return L});class G{constructor(I){this.element=I,this.next=G.Undefined,this.prev=G.Undefined}}G.Undefined=new G(void 0);class L{constructor(){this._first=G.Undefined,this._last=G.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===G.Undefined}clear(){let I=this._first;for(;I!==G.Undefined;){const R=I.next;I.prev=G.Undefined,I.next=G.Undefined,I=R}this._first=G.Undefined,this._last=G.Undefined,this._size=0}unshift(I){return this._insert(I,!1)}push(I){return this._insert(I,!0)}_insert(I,R){const M=new G(I);if(this._first===G.Undefined)this._first=M,this._last=M;else if(R){const E=this._last;this._last=M,M.prev=E,E.next=M}else{const E=this._first;this._first=M,M.next=E,E.prev=M}this._size+=1;let p=!1;return()=>{p||(p=!0,this._remove(M))}}shift(){if(this._first===G.Undefined)return;{const I=this._first.element;return this._remove(this._first),I}}pop(){if(this._last===G.Undefined)return;{const I=this._last.element;return this._remove(this._last),I}}_remove(I){if(I.prev!==G.Undefined&&I.next!==G.Undefined){const R=I.prev;R.next=I.next,I.next.prev=R}else I.prev===G.Undefined&&I.next===G.Undefined?(this._first=G.Undefined,this._last=G.Undefined):I.next===G.Undefined?(this._last=this._last.prev,this._last.next=G.Undefined):I.prev===G.Undefined&&(this._first=this._first.next,this._first.prev=G.Undefined);this._size-=1}*[Symbol.iterator](){let I=this._first;for(;I!==G.Undefined;)yield I.element,I=I.next}}},"3/fG":function(it,ne,q){"use strict";q.d(ne,"a",function(){return L});function G(I,R){let M;return R.length===0?M=I:M=I.replace(/\{(\d+)\}/g,function(p,E){const b=E[0];return typeof R[b]!="undefined"?R[b]:p}),M}function L(I,R,...M){return G(R,M)}},"34/K":function(it,ne,q){"use strict";Object.defineProperty(ne,"__esModule",{value:!0}),ne.default=void 0;function G(M,p){if(!(M instanceof p))throw new TypeError("Cannot call a class as a function")}function L(M,p){for(var E=0;E<p.length;E++){var b=p[E];b.enumerable=b.enumerable||!1,b.configurable=!0,"value"in b&&(b.writable=!0),Object.defineProperty(M,b.key,b)}}function I(M,p,E){return p&&L(M.prototype,p),E&&L(M,E),M}var R=function(){function M(){G(this,M),this._lines=0}return I(M,[{key:"decodeRect",value:function(E,b,i,c,o,h,n){this._lines===0&&(this._lines=c);var a=n==8?1:4,t=i*a;if(o.rQwait("RAW",t))return!1;var r=b+(c-this._lines),s=Math.min(this._lines,Math.floor(o.rQlen/t)),u=o.rQ,d=o.rQi;if(n==8){for(var f=i*s,v=new Uint8Array(f*4),m=0;m<f;m++)v[m*4+0]=(u[d+m]>>0&3)*255/3,v[m*4+1]=(u[d+m]>>2&3)*255/3,v[m*4+2]=(u[d+m]>>4&3)*255/3,v[m*4+4]=0;u=v,d=0}return h.blitImage(E,r,i,s,u,d),o.rQskipBytes(s*t),this._lines-=s,!(this._lines>0)}}]),M}();ne.default=R},"3690":function(it,ne,q){"use strict";function G(i){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?G=function(o){return typeof o}:G=function(o){return o&&typeof Symbol=="function"&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},G(i)}Object.defineProperty(ne,"__esModule",{value:!0}),ne.default=void 0;var L=R(q("Lo0S"));function I(){if(typeof WeakMap!="function")return null;var i=new WeakMap;return I=function(){return i},i}function R(i){if(i&&i.__esModule)return i;if(i===null||G(i)!=="object"&&typeof i!="function")return{default:i};var c=I();if(c&&c.has(i))return c.get(i);var o={},h=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in i)if(Object.prototype.hasOwnProperty.call(i,n)){var a=h?Object.getOwnPropertyDescriptor(i,n):null;a&&(a.get||a.set)?Object.defineProperty(o,n,a):o[n]=i[n]}return o.default=i,c&&c.set(i,o),o}function M(i,c){if(!(i instanceof c))throw new TypeError("Cannot call a class as a function")}function p(i,c){for(var o=0;o<c.length;o++){var h=c[o];h.enumerable=h.enumerable||!1,h.configurable=!0,"value"in h&&(h.writable=!0),Object.defineProperty(i,h.key,h)}}function E(i,c,o){return c&&p(i.prototype,c),o&&p(i,o),i}var b=function(){function i(){M(this,i),this._tiles=0,this._lastsubencoding=0}return E(i,[{key:"decodeRect",value:function(o,h,n,a,t,r,s){for(this._tiles===0&&(this._tilesX=Math.ceil(n/16),this._tilesY=Math.ceil(a/16),this._totalTiles=this._tilesX*this._tilesY,this._tiles=this._totalTiles);this._tiles>0;){var u=1;if(t.rQwait("HEXTILE",u))return!1;var d=t.rQ,f=t.rQi,v=d[f];if(v>30)throw new Error("Illegal hextile subencoding (subencoding: "+v+")");var m=this._totalTiles-this._tiles,S=m%this._tilesX,C=Math.floor(m/this._tilesX),_=o+S*16,y=h+C*16,T=Math.min(16,o+n-_),O=Math.min(16,h+a-y);if(v&1)u+=T*O*4;else if(v&2&&(u+=4),v&4&&(u+=4),v&8){if(u++,t.rQwait("HEXTILE",u))return!1;var g=d[f+u-1];v&16?u+=g*(4+2):u+=g*2}if(t.rQwait("HEXTILE",u))return!1;if(f++,v===0)this._lastsubencoding&1?L.Debug(" Ignoring blank after RAW"):r.fillRect(_,y,T,O,this._background);else if(v&1)r.blitImage(_,y,T,O,d,f),f+=u-1;else{if(v&2&&(this._background=[d[f],d[f+1],d[f+2],d[f+3]],f+=4),v&4&&(this._foreground=[d[f],d[f+1],d[f+2],d[f+3]],f+=4),r.startTile(_,y,T,O,this._background),v&8){var F=d[f];f++;for(var P=0;P<F;P++){var N=void 0;v&16?(N=[d[f],d[f+1],d[f+2],d[f+3]],f+=4):N=this._foreground;var X=d[f];f++;var j=X>>4,A=X&15,K=d[f];f++;var U=(K>>4)+1,k=(K&15)+1;r.subTile(j,A,U,k,N)}}r.finishTile()}t.rQi=f,this._lastsubencoding=v,this._tiles--}return!0}}]),i}();ne.default=b},"5VLF":function(it,ne,q){"use strict";var G,L;function I(R,M,p){var E=function(b,i){return R.js_beautify(b,i)};return E.js=R.js_beautify,E.css=M.css_beautify,E.html=p.html_beautify,E.js_beautify=R.js_beautify,E.css_beautify=M.css_beautify,E.html_beautify=p.html_beautify,E}!(G=[q("6UM0"),q("TXwP"),q("psGv")],L=function(R,M,p){return I(R,M,p)}.apply(ne,G),L!==void 0&&(it.exports=L))},"5Y4S":function(it,ne,q){"use strict";q.d(ne,"a",function(){return I});var G=q("MNsG");const L=G.b.performance&&typeof G.b.performance.now=="function";class I{constructor(R){this._highResolution=L&&R,this._startTime=this._now(),this._stopTime=-1}static create(R=!0){return new I(R)}stop(){this._stopTime=this._now()}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}_now(){return this._highResolution?G.b.performance.now():Date.now()}}},"6BzB":function(it,ne,q){"use strict";Object.defineProperty(ne,"__esModule",{value:!0}),ne.shrinkBuf=G,ne.arraySet=L,ne.flattenChunks=I,ne.Buf32=ne.Buf16=ne.Buf8=void 0;function G(E,b){return E.length===b?E:E.subarray?E.subarray(0,b):(E.length=b,E)}function L(E,b,i,c,o){if(b.subarray&&E.subarray){E.set(b.subarray(i,i+c),o);return}for(var h=0;h<c;h++)E[o+h]=b[i+h]}function I(E){var b,i,c,o,h,n;for(c=0,b=0,i=E.length;b<i;b++)c+=E[b].length;for(n=new Uint8Array(c),o=0,b=0,i=E.length;b<i;b++)h=E[b],n.set(h,o),o+=h.length;return n}var R=Uint8Array;ne.Buf8=R;var M=Uint16Array;ne.Buf16=M;var p=Int32Array;ne.Buf32=p},"6Qwc":function(it,ne,q){"use strict";Object.defineProperty(ne,"__esModule",{value:!0}),ne.default=void 0;var G={8:"Backspace",9:"Tab",10:"NumpadClear",12:"Numpad5",13:"Enter",16:"ShiftLeft",17:"ControlLeft",18:"AltLeft",19:"Pause",20:"CapsLock",21:"Lang1",25:"Lang2",27:"Escape",28:"Convert",29:"NonConvert",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",41:"Select",44:"PrintScreen",45:"Insert",46:"Delete",47:"Help",48:"Digit0",49:"Digit1",50:"Digit2",51:"Digit3",52:"Digit4",53:"Digit5",54:"Digit6",55:"Digit7",56:"Digit8",57:"Digit9",91:"MetaLeft",92:"MetaRight",93:"ContextMenu",95:"Sleep",96:"Numpad0",97:"Numpad1",98:"Numpad2",99:"Numpad3",100:"Numpad4",101:"Numpad5",102:"Numpad6",103:"Numpad7",104:"Numpad8",105:"Numpad9",106:"NumpadMultiply",107:"NumpadAdd",108:"NumpadDecimal",109:"NumpadSubtract",110:"NumpadDecimal",111:"NumpadDivide",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",124:"F13",125:"F14",126:"F15",127:"F16",128:"F17",129:"F18",130:"F19",131:"F20",132:"F21",133:"F22",134:"F23",135:"F24",144:"NumLock",145:"ScrollLock",166:"BrowserBack",167:"BrowserForward",168:"BrowserRefresh",169:"BrowserStop",170:"BrowserSearch",171:"BrowserFavorites",172:"BrowserHome",173:"AudioVolumeMute",174:"AudioVolumeDown",175:"AudioVolumeUp",176:"MediaTrackNext",177:"MediaTrackPrevious",178:"MediaStop",179:"MediaPlayPause",180:"LaunchMail",181:"MediaSelect",182:"LaunchApp1",183:"LaunchApp2",225:"AltRight"};ne.default=G},"6UM0":function(it,ne,q){var G,L;(function(){var I;(function(){"use strict";var M=[function(i,c,o){var h=o(1).Beautifier,n=o(5).Options;function a(t,r){var s=new h(t,r);return s.beautify()}i.exports=a,i.exports.defaultOptions=function(){return new n}},function(i,c,o){var h=o(2).Output,n=o(3).Token,a=o(4),t=o(5).Options,r=o(7).Tokenizer,s=o(7).line_starters,u=o(7).positionable_operators,d=o(7).TOKEN;function f(k,z){return z.indexOf(k)!==-1}function v(k){return k.replace(/^\s+/g,"")}function m(k){for(var z={},te=0;te<k.length;te++)z[k[te].replace(/-/g,"_")]=k[te];return z}function S(k,z){return k&&k.type===d.RESERVED&&k.text===z}function C(k,z){return k&&k.type===d.RESERVED&&f(k.text,z)}var _=["case","return","do","if","throw","else","await","break","continue","async"],y=["before-newline","after-newline","preserve-newline"],T=m(y),O=[T.before_newline,T.preserve_newline],g={BlockStatement:"BlockStatement",Statement:"Statement",ObjectLiteral:"ObjectLiteral",ArrayLiteral:"ArrayLiteral",ForInitializer:"ForInitializer",Conditional:"Conditional",Expression:"Expression"};function F(k,z){if(z.multiline_frame||z.mode===g.ForInitializer||z.mode===g.Conditional)return;k.remove_indent(z.start_line_index)}function P(k){k=k.replace(a.allLineBreaks,`
|
|
|
`);for(var z=[],te=k.indexOf(`
|
|
|
`);te!==-1;)z.push(k.substring(0,te)),k=k.substring(te+1),te=k.indexOf(`
|
|
|
`);return k.length&&z.push(k),z}function N(k){return k===g.ArrayLiteral}function X(k){return f(k,[g.Expression,g.ForInitializer,g.Conditional])}function j(k,z){for(var te=0;te<k.length;te++){var de=k[te].trim();if(de.charAt(0)!==z)return!1}return!0}function A(k,z){for(var te=0,de=k.length,be;te<de;te++)if(be=k[te],be&&be.indexOf(z)!==0)return!1;return!0}function K(k,z){z=z||{},this._source_text=k||"",this._output=null,this._tokens=null,this._last_last_text=null,this._flags=null,this._previous_flags=null,this._flag_store=null,this._options=new t(z)}K.prototype.create_flags=function(k,z){var te=0;k&&(te=k.indentation_level,!this._output.just_added_newline()&&k.line_indent_level>te&&(te=k.line_indent_level));var de={mode:z,parent:k,last_token:k?k.last_token:new n(d.START_BLOCK,""),last_word:k?k.last_word:"",declaration_statement:!1,declaration_assignment:!1,multiline_frame:!1,inline_frame:!1,if_block:!1,else_block:!1,class_start_block:!1,do_block:!1,do_while:!1,import_block:!1,in_case_statement:!1,in_case:!1,case_body:!1,case_block:!1,indentation_level:te,alignment:0,line_indent_level:k?k.line_indent_level:te,start_line_index:this._output.get_line_number(),ternary_depth:0};return de},K.prototype._reset=function(k){var z=k.match(/^[\t ]*/)[0];this._last_last_text="",this._output=new h(this._options,z),this._output.raw=this._options.test_output_raw,this._flag_store=[],this.set_mode(g.BlockStatement);var te=new r(k,this._options);return this._tokens=te.tokenize(),k},K.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var k,z=this._reset(this._source_text),te=this._options.eol;this._options.eol==="auto"&&(te=`
|
|
|
`,z&&a.lineBreak.test(z||"")&&(te=z.match(a.lineBreak)[0]));for(var de=this._tokens.next();de;)this.handle_token(de),this._last_last_text=this._flags.last_token.text,this._flags.last_token=de,de=this._tokens.next();return k=this._output.get_code(te),k},K.prototype.handle_token=function(k,z){k.type===d.START_EXPR?this.handle_start_expr(k):k.type===d.END_EXPR?this.handle_end_expr(k):k.type===d.START_BLOCK?this.handle_start_block(k):k.type===d.END_BLOCK?this.handle_end_block(k):k.type===d.WORD?this.handle_word(k):k.type===d.RESERVED?this.handle_word(k):k.type===d.SEMICOLON?this.handle_semicolon(k):k.type===d.STRING?this.handle_string(k):k.type===d.EQUALS?this.handle_equals(k):k.type===d.OPERATOR?this.handle_operator(k):k.type===d.COMMA?this.handle_comma(k):k.type===d.BLOCK_COMMENT?this.handle_block_comment(k,z):k.type===d.COMMENT?this.handle_comment(k,z):k.type===d.DOT?this.handle_dot(k):k.type===d.EOF?this.handle_eof(k):k.type===d.UNKNOWN?this.handle_unknown(k,z):this.handle_unknown(k,z)},K.prototype.handle_whitespace_and_comments=function(k,z){var te=k.newlines,de=this._options.keep_array_indentation&&N(this._flags.mode);if(k.comments_before)for(var be=k.comments_before.next();be;)this.handle_whitespace_and_comments(be,z),this.handle_token(be,z),be=k.comments_before.next();if(de)for(var We=0;We<te;We+=1)this.print_newline(We>0,z);else if(this._options.max_preserve_newlines&&te>this._options.max_preserve_newlines&&(te=this._options.max_preserve_newlines),this._options.preserve_newlines&&te>1){this.print_newline(!1,z);for(var Ne=1;Ne<te;Ne+=1)this.print_newline(!0,z)}};var U=["async","break","continue","return","throw","yield"];K.prototype.allow_wrap_or_preserved_newline=function(k,z){if(z=z===void 0?!1:z,this._output.just_added_newline())return;var te=this._options.preserve_newlines&&k.newlines||z,de=f(this._flags.last_token.text,u)||f(k.text,u);if(de){var be=f(this._flags.last_token.text,u)&&f(this._options.operator_position,O)||f(k.text,u);te=te&&be}if(te)this.print_newline(!1,!0);else if(this._options.wrap_line_length){if(C(this._flags.last_token,U))return;this._output.set_wrap_point()}},K.prototype.print_newline=function(k,z){if(!z&&(this._flags.last_token.text!==";"&&this._flags.last_token.text!==","&&this._flags.last_token.text!=="="&&(this._flags.last_token.type!==d.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++")))for(var te=this._tokens.peek();this._flags.mode===g.Statement&&!(this._flags.if_block&&S(te,"else"))&&!this._flags.do_block;)this.restore_mode();this._output.add_new_line(k)&&(this._flags.multiline_frame=!0)},K.prototype.print_token_line_indentation=function(k){this._output.just_added_newline()&&(this._options.keep_array_indentation&&k.newlines&&(k.text==="["||N(this._flags.mode))?(this._output.current_line.set_indent(-1),this._output.current_line.push(k.whitespace_before),this._output.space_before_token=!1):this._output.set_indent(this._flags.indentation_level,this._flags.alignment)&&(this._flags.line_indent_level=this._flags.indentation_level))},K.prototype.print_token=function(k){if(this._output.raw){this._output.add_raw_token(k);return}if(this._options.comma_first&&k.previous&&k.previous.type===d.COMMA&&this._output.just_added_newline()&&this._output.previous_line.last()===","){var z=this._output.previous_line.pop();this._output.previous_line.is_empty()&&(this._output.previous_line.push(z),this._output.trim(!0),this._output.current_line.pop(),this._output.trim()),this.print_token_line_indentation(k),this._output.add_token(","),this._output.space_before_token=!0}this.print_token_line_indentation(k),this._output.non_breaking_space=!0,this._output.add_token(k.text),this._output.previous_token_wrapped&&(this._flags.multiline_frame=!0)},K.prototype.indent=function(){this._flags.indentation_level+=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},K.prototype.deindent=function(){this._flags.indentation_level>0&&(!this._flags.parent||this._flags.indentation_level>this._flags.parent.indentation_level)&&(this._flags.indentation_level-=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},K.prototype.set_mode=function(k){this._flags?(this._flag_store.push(this._flags),this._previous_flags=this._flags):this._previous_flags=this.create_flags(null,k),this._flags=this.create_flags(this._previous_flags,k),this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},K.prototype.restore_mode=function(){this._flag_store.length>0&&(this._previous_flags=this._flags,this._flags=this._flag_store.pop(),this._previous_flags.mode===g.Statement&&F(this._output,this._previous_flags),this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},K.prototype.start_of_object_property=function(){return this._flags.parent.mode===g.ObjectLiteral&&this._flags.mode===g.Statement&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||C(this._flags.last_token,["get","set"]))},K.prototype.start_of_statement=function(k){var z=!1;return z=z||C(this._flags.last_token,["var","let","const"])&&k.type===d.WORD,z=z||S(this._flags.last_token,"do"),z=z||!(this._flags.parent.mode===g.ObjectLiteral&&this._flags.mode===g.Statement)&&C(this._flags.last_token,U)&&!k.newlines,z=z||S(this._flags.last_token,"else")&&!(S(k,"if")&&!k.comments_before),z=z||this._flags.last_token.type===d.END_EXPR&&(this._previous_flags.mode===g.ForInitializer||this._previous_flags.mode===g.Conditional),z=z||this._flags.last_token.type===d.WORD&&this._flags.mode===g.BlockStatement&&!this._flags.in_case&&!(k.text==="--"||k.text==="++")&&this._last_last_text!=="function"&&k.type!==d.WORD&&k.type!==d.RESERVED,z=z||this._flags.mode===g.ObjectLiteral&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||C(this._flags.last_token,["get","set"])),z?(this.set_mode(g.Statement),this.indent(),this.handle_whitespace_and_comments(k,!0),this.start_of_object_property()||this.allow_wrap_or_preserved_newline(k,C(k,["do","for","if","while"])),!0):!1},K.prototype.handle_start_expr=function(k){this.start_of_statement(k)||this.handle_whitespace_and_comments(k);var z=g.Expression;if(k.text==="["){if(this._flags.last_token.type===d.WORD||this._flags.last_token.text===")"){C(this._flags.last_token,s)&&(this._output.space_before_token=!0),this.print_token(k),this.set_mode(z),this.indent(),this._options.space_in_paren&&(this._output.space_before_token=!0);return}z=g.ArrayLiteral,N(this._flags.mode)&&((this._flags.last_token.text==="["||this._flags.last_token.text===","&&(this._last_last_text==="]"||this._last_last_text==="}"))&&(this._options.keep_array_indentation||this.print_newline())),f(this._flags.last_token.type,[d.START_EXPR,d.END_EXPR,d.WORD,d.OPERATOR,d.DOT])||(this._output.space_before_token=!0)}else{if(this._flags.last_token.type===d.RESERVED)this._flags.last_token.text==="for"?(this._output.space_before_token=this._options.space_before_conditional,z=g.ForInitializer):f(this._flags.last_token.text,["if","while","switch"])?(this._output.space_before_token=this._options.space_before_conditional,z=g.Conditional):f(this._flags.last_word,["await","async"])?this._output.space_before_token=!0:this._flags.last_token.text==="import"&&k.whitespace_before===""?this._output.space_before_token=!1:(f(this._flags.last_token.text,s)||this._flags.last_token.text==="catch")&&(this._output.space_before_token=!0);else if(this._flags.last_token.type===d.EQUALS||this._flags.last_token.type===d.OPERATOR)this.start_of_object_property()||this.allow_wrap_or_preserved_newline(k);else if(this._flags.last_token.type===d.WORD){this._output.space_before_token=!1;var te=this._tokens.peek(-3);if(this._options.space_after_named_function&&te){var de=this._tokens.peek(-4);C(te,["async","function"])||te.text==="*"&&C(de,["async","function"])?this._output.space_before_token=!0:this._flags.mode===g.ObjectLiteral?(te.text==="{"||te.text===","||te.text==="*"&&(de.text==="{"||de.text===","))&&(this._output.space_before_token=!0):this._flags.parent&&this._flags.parent.class_start_block&&(this._output.space_before_token=!0)}}else this.allow_wrap_or_preserved_newline(k);(this._flags.last_token.type===d.RESERVED&&(this._flags.last_word==="function"||this._flags.last_word==="typeof")||this._flags.last_token.text==="*"&&(f(this._last_last_text,["function","yield"])||this._flags.mode===g.ObjectLiteral&&f(this._last_last_text,["{",","])))&&(this._output.space_before_token=this._options.space_after_anon_function)}this._flags.last_token.text===";"||this._flags.last_token.type===d.START_BLOCK?this.print_newline():(this._flags.last_token.type===d.END_EXPR||this._flags.last_token.type===d.START_EXPR||this._flags.last_token.type===d.END_BLOCK||this._flags.last_token.text==="."||this._flags.last_token.type===d.COMMA)&&this.allow_wrap_or_preserved_newline(k,k.newlines),this.print_token(k),this.set_mode(z),this._options.space_in_paren&&(this._output.space_before_token=!0),this.indent()},K.prototype.handle_end_expr=function(k){for(;this._flags.mode===g.Statement;)this.restore_mode();this.handle_whitespace_and_comments(k),this._flags.multiline_frame&&this.allow_wrap_or_preserved_newline(k,k.text==="]"&&N(this._flags.mode)&&!this._options.keep_array_indentation),this._options.space_in_paren&&(this._flags.last_token.type===d.START_EXPR&&!this._options.space_in_empty_paren?(this._output.trim(),this._output.space_before_token=!1):this._output.space_before_token=!0),this.deindent(),this.print_token(k),this.restore_mode(),F(this._output,this._previous_flags),this._flags.do_while&&this._previous_flags.mode===g.Conditional&&(this._previous_flags.mode=g.Expression,this._flags.do_block=!1,this._flags.do_while=!1)},K.prototype.handle_start_block=function(k){this.handle_whitespace_and_comments(k);var z=this._tokens.peek(),te=this._tokens.peek(1);this._flags.last_word==="switch"&&this._flags.last_token.type===d.END_EXPR?(this.set_mode(g.BlockStatement),this._flags.in_case_statement=!0):this._flags.case_body?this.set_mode(g.BlockStatement):te&&(f(te.text,[":",","])&&f(z.type,[d.STRING,d.WORD,d.RESERVED])||f(z.text,["get","set","..."])&&f(te.type,[d.WORD,d.RESERVED]))?f(this._last_last_text,["class","interface"])&&!f(te.text,[":",","])?this.set_mode(g.BlockStatement):this.set_mode(g.ObjectLiteral):this._flags.last_token.type===d.OPERATOR&&this._flags.last_token.text==="=>"?this.set_mode(g.BlockStatement):f(this._flags.last_token.type,[d.EQUALS,d.START_EXPR,d.COMMA,d.OPERATOR])||C(this._flags.last_token,["return","throw","import","default"])?this.set_mode(g.ObjectLiteral):this.set_mode(g.BlockStatement),this._flags.last_token&&(C(this._flags.last_token.previous,["class","extends"])&&(this._flags.class_start_block=!0));var de=!z.comments_before&&z.text==="}",be=de&&this._flags.last_word==="function"&&this._flags.last_token.type===d.END_EXPR;if(this._options.brace_preserve_inline){var We=0,Ne=null;this._flags.inline_frame=!0;do if(We+=1,Ne=this._tokens.peek(We-1),Ne.newlines){this._flags.inline_frame=!1;break}while(Ne.type!==d.EOF&&!(Ne.type===d.END_BLOCK&&Ne.opened===k))}(this._options.brace_style==="expand"||this._options.brace_style==="none"&&k.newlines)&&!this._flags.inline_frame?this._flags.last_token.type!==d.OPERATOR&&(be||this._flags.last_token.type===d.EQUALS||C(this._flags.last_token,_)&&this._flags.last_token.text!=="else")?this._output.space_before_token=!0:this.print_newline(!1,!0):(N(this._previous_flags.mode)&&(this._flags.last_token.type===d.START_EXPR||this._flags.last_token.type===d.COMMA)&&((this._flags.last_token.type===d.COMMA||this._options.space_in_paren)&&(this._output.space_before_token=!0),(this._flags.last_token.type===d.COMMA||this._flags.last_token.type===d.START_EXPR&&this._flags.inline_frame)&&(this.allow_wrap_or_preserved_newline(k),this._previous_flags.multiline_frame=this._previous_flags.multiline_frame||this._flags.multiline_frame,this._flags.multiline_frame=!1)),this._flags.last_token.type!==d.OPERATOR&&this._flags.last_token.type!==d.START_EXPR&&(this._flags.last_token.type===d.START_BLOCK&&!this._flags.inline_frame?this.print_newline():this._output.space_before_token=!0)),this.print_token(k),this.indent(),!de&&!(this._options.brace_preserve_inline&&this._flags.inline_frame)&&this.print_newline()},K.prototype.handle_end_block=function(k){for(this.handle_whitespace_and_comments(k);this._flags.mode===g.Statement;)this.restore_mode();var z=this._flags.last_token.type===d.START_BLOCK;this._flags.inline_frame&&!z?this._output.space_before_token=!0:this._options.brace_style==="expand"?z||this.print_newline():z||(N(this._flags.mode)&&this._options.keep_array_indentation?(this._options.keep_array_indentation=!1,this.print_newline(),this._options.keep_array_indentation=!0):this.print_newline()),this.restore_mode(),this.print_token(k)},K.prototype.handle_word=function(k){if(k.type===d.RESERVED){if(f(k.text,["set","get"])&&this._flags.mode!==g.ObjectLiteral)k.type=d.WORD;else if(k.text==="import"&&f(this._tokens.peek().text,["(","."]))k.type=d.WORD;else if(f(k.text,["as","from"])&&!this._flags.import_block)k.type=d.WORD;else if(this._flags.mode===g.ObjectLiteral){var z=this._tokens.peek();z.text===":"&&(k.type=d.WORD)}}if(this.start_of_statement(k)?C(this._flags.last_token,["var","let","const"])&&k.type===d.WORD&&(this._flags.declaration_statement=!0):k.newlines&&!X(this._flags.mode)&&(this._flags.last_token.type!==d.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++")&&this._flags.last_token.type!==d.EQUALS&&(this._options.preserve_newlines||!C(this._flags.last_token,["var","let","const","set","get"]))?(this.handle_whitespace_and_comments(k),this.print_newline()):this.handle_whitespace_and_comments(k),this._flags.do_block&&!this._flags.do_while)if(S(k,"while")){this._output.space_before_token=!0,this.print_token(k),this._output.space_before_token=!0,this._flags.do_while=!0;return}else this.print_newline(),this._flags.do_block=!1;if(this._flags.if_block)if(!this._flags.else_block&&S(k,"else"))this._flags.else_block=!0;else{for(;this._flags.mode===g.Statement;)this.restore_mode();this._flags.if_block=!1,this._flags.else_block=!1}if(this._flags.in_case_statement&&C(k,["case","default"])){this.print_newline(),!this._flags.case_block&&(this._flags.case_body||this._options.jslint_happy)&&this.deindent(),this._flags.case_body=!1,this.print_token(k),this._flags.in_case=!0;return}if((this._flags.last_token.type===d.COMMA||this._flags.last_token.type===d.START_EXPR||this._flags.last_token.type===d.EQUALS||this._flags.last_token.type===d.OPERATOR)&&(this.start_of_object_property()||this.allow_wrap_or_preserved_newline(k)),S(k,"function")){(f(this._flags.last_token.text,["}",";"])||this._output.just_added_newline()&&!(f(this._flags.last_token.text,["(","[","{",":","=",","])||this._flags.last_token.type===d.OPERATOR))&&(!this._output.just_added_blankline()&&!k.comments_before&&(this.print_newline(),this.print_newline(!0))),this._flags.last_token.type===d.RESERVED||this._flags.last_token.type===d.WORD?C(this._flags.last_token,["get","set","new","export"])||C(this._flags.last_token,U)?this._output.space_before_token=!0:S(this._flags.last_token,"default")&&this._last_last_text==="export"?this._output.space_before_token=!0:this._flags.last_token.text==="declare"?this._output.space_before_token=!0:this.print_newline():this._flags.last_token.type===d.OPERATOR||this._flags.last_token.text==="="?this._output.space_before_token=!0:!this._flags.multiline_frame&&(X(this._flags.mode)||N(this._flags.mode))||this.print_newline(),this.print_token(k),this._flags.last_word=k.text;return}var te="NONE";if(this._flags.last_token.type===d.END_BLOCK?this._previous_flags.inline_frame?te="SPACE":C(k,["else","catch","finally","from"])?this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&k.newlines?te="NEWLINE":(te="SPACE",this._output.space_before_token=!0):te="NEWLINE":this._flags.last_token.type===d.SEMICOLON&&this._flags.mode===g.BlockStatement?te="NEWLINE":this._flags.last_token.type===d.SEMICOLON&&X(this._flags.mode)?te="SPACE":this._flags.last_token.type===d.STRING?te="NEWLINE":this._flags.last_token.type===d.RESERVED||this._flags.last_token.type===d.WORD||this._flags.last_token.text==="*"&&(f(this._last_last_text,["function","yield"])||this._flags.mode===g.ObjectLiteral&&f(this._last_last_text,["{",","]))?te="SPACE":this._flags.last_token.type===d.START_BLOCK?this._flags.inline_frame?te="SPACE":te="NEWLINE":this._flags.last_token.type===d.END_EXPR&&(this._output.space_before_token=!0,te="NEWLINE"),C(k,s)&&this._flags.last_token.text!==")"&&(this._flags.inline_frame||this._flags.last_token.text==="else"||this._flags.last_token.text==="export"?te="SPACE":te="NEWLINE"),C(k,["else","catch","finally"]))if((!(this._flags.last_token.type===d.END_BLOCK&&this._previous_flags.mode===g.BlockStatement)||this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&k.newlines)&&!this._flags.inline_frame)this.print_newline();else{this._output.trim(!0);var de=this._output.current_line;de.last()!=="}"&&this.print_newline(),this._output.space_before_token=!0}else te==="NEWLINE"?C(this._flags.last_token,_)?this._output.space_before_token=!0:this._flags.last_token.text==="declare"&&C(k,["var","let","const"])?this._output.space_before_token=!0:this._flags.last_token.type!==d.END_EXPR?(this._flags.last_token.type!==d.START_EXPR||!C(k,["var","let","const"]))&&this._flags.last_token.text!==":"&&(S(k,"if")&&S(k.previous,"else")?this._output.space_before_token=!0:this.print_newline()):C(k,s)&&this._flags.last_token.text!==")"&&this.print_newline():this._flags.multiline_frame&&N(this._flags.mode)&&this._flags.last_token.text===","&&this._last_last_text==="}"?this.print_newline():te==="SPACE"&&(this._output.space_before_token=!0);k.previous&&(k.previous.type===d.WORD||k.previous.type===d.RESERVED)&&(this._output.space_before_token=!0),this.print_token(k),this._flags.last_word=k.text,k.type===d.RESERVED&&(k.text==="do"?this._flags.do_block=!0:k.text==="if"?this._flags.if_block=!0:k.text==="import"?this._flags.import_block=!0:this._flags.import_block&&S(k,"from")&&(this._flags.import_block=!1))},K.prototype.handle_semicolon=function(k){this.start_of_statement(k)?this._output.space_before_token=!1:this.handle_whitespace_and_comments(k);for(var z=this._tokens.peek();this._flags.mode===g.Statement&&!(this._flags.if_block&&S(z,"else"))&&!this._flags.do_block;)this.restore_mode();this._flags.import_block&&(this._flags.import_block=!1),this.print_token(k)},K.prototype.handle_string=function(k){k.text.startsWith("`")&&k.newlines===0&&k.whitespace_before===""&&(k.previous.text===")"||this._flags.last_token.type===d.WORD)||(this.start_of_statement(k)?this._output.space_before_token=!0:(this.handle_whitespace_and_comments(k),this._flags.last_token.type===d.RESERVED||this._flags.last_token.type===d.WORD||this._flags.inline_frame?this._output.space_before_token=!0:this._flags.last_token.type===d.COMMA||this._flags.last_token.type===d.START_EXPR||this._flags.last_token.type===d.EQUALS||this._flags.last_token.type===d.OPERATOR?this.start_of_object_property()||this.allow_wrap_or_preserved_newline(k):k.text.startsWith("`")&&this._flags.last_token.type===d.END_EXPR&&(k.previous.text==="]"||k.previous.text===")")&&k.newlines===0?this._output.space_before_token=!0:this.print_newline())),this.print_token(k)},K.prototype.handle_equals=function(k){this.start_of_statement(k)||this.handle_whitespace_and_comments(k),this._flags.declaration_statement&&(this._flags.declaration_assignment=!0),this._output.space_before_token=!0,this.print_token(k),this._output.space_before_token=!0},K.prototype.handle_comma=function(k){this.handle_whitespace_and_comments(k,!0),this.print_token(k),this._output.space_before_token=!0,this._flags.declaration_statement?(X(this._flags.parent.mode)&&(this._flags.declaration_assignment=!1),this._flags.declaration_assignment?(this._flags.declaration_assignment=!1,this.print_newline(!1,!0)):this._options.comma_first&&this.allow_wrap_or_preserved_newline(k)):this._flags.mode===g.ObjectLiteral||this._flags.mode===g.Statement&&this._flags.parent.mode===g.ObjectLiteral?(this._flags.mode===g.Statement&&this.restore_mode(),this._flags.inline_frame||this.print_newline()):this._options.comma_first&&this.allow_wrap_or_preserved_newline(k)},K.prototype.handle_operator=function(k){var z=k.text==="*"&&(C(this._flags.last_token,["function","yield"])||f(this._flags.last_token.type,[d.START_BLOCK,d.COMMA,d.END_BLOCK,d.SEMICOLON])),te=f(k.text,["-","+"])&&(f(this._flags.last_token.type,[d.START_BLOCK,d.START_EXPR,d.EQUALS,d.OPERATOR])||f(this._flags.last_token.text,s)||this._flags.last_token.text===",");if(!this.start_of_statement(k)){var de=!z;this.handle_whitespace_and_comments(k,de)}if(k.text==="*"&&this._flags.last_token.type===d.DOT){this.print_token(k);return}if(k.text==="::"){this.print_token(k);return}if(this._flags.last_token.type===d.OPERATOR&&f(this._options.operator_position,O)&&this.allow_wrap_or_preserved_newline(k),k.text===":"&&this._flags.in_case){this.print_token(k),this._flags.in_case=!1,this._flags.case_body=!0,this._tokens.peek().type!==d.START_BLOCK?(this.indent(),this.print_newline(),this._flags.case_block=!1):(this._flags.case_block=!0,this._output.space_before_token=!0);return}var be=!0,We=!0,Ne=!1;if(k.text===":"?this._flags.ternary_depth===0?be=!1:(this._flags.ternary_depth-=1,Ne=!0):k.text==="?"&&(this._flags.ternary_depth+=1),!te&&!z&&this._options.preserve_newlines&&f(k.text,u)){var Le=k.text===":",Ke=Le&&Ne,He=Le&&!Ne;switch(this._options.operator_position){case T.before_newline:this._output.space_before_token=!He,this.print_token(k),(!Le||Ke)&&this.allow_wrap_or_preserved_newline(k),this._output.space_before_token=!0;return;case T.after_newline:this._output.space_before_token=!0,!Le||Ke?this._tokens.peek().newlines?this.print_newline(!1,!0):this.allow_wrap_or_preserved_newline(k):this._output.space_before_token=!1,this.print_token(k),this._output.space_before_token=!0;return;case T.preserve_newline:He||this.allow_wrap_or_preserved_newline(k),be=!(this._output.just_added_newline()||He),this._output.space_before_token=be,this.print_token(k),this._output.space_before_token=!0;return}}if(z){this.allow_wrap_or_preserved_newline(k),be=!1;var Ae=this._tokens.peek();We=Ae&&f(Ae.type,[d.WORD,d.RESERVED])}else if(k.text==="...")this.allow_wrap_or_preserved_newline(k),be=this._flags.last_token.type===d.START_BLOCK,We=!1;else if(f(k.text,["--","++","!","~"])||te){if((this._flags.last_token.type===d.COMMA||this._flags.last_token.type===d.START_EXPR)&&this.allow_wrap_or_preserved_newline(k),be=!1,We=!1,k.newlines&&(k.text==="--"||k.text==="++"||k.text==="~")){var Se=C(this._flags.last_token,_)&&k.newlines;Se&&(this._previous_flags.if_block||this._previous_flags.else_block)&&this.restore_mode(),this.print_newline(Se,!0)}this._flags.last_token.text===";"&&X(this._flags.mode)&&(be=!0),this._flags.last_token.type===d.RESERVED?be=!0:this._flags.last_token.type===d.END_EXPR?be=!(this._flags.last_token.text==="]"&&(k.text==="--"||k.text==="++")):this._flags.last_token.type===d.OPERATOR&&(be=f(k.text,["--","-","++","+"])&&f(this._flags.last_token.text,["--","-","++","+"]),f(k.text,["+","-"])&&f(this._flags.last_token.text,["--","++"])&&(We=!0)),(this._flags.mode===g.BlockStatement&&!this._flags.inline_frame||this._flags.mode===g.Statement)&&(this._flags.last_token.text==="{"||this._flags.last_token.text===";")&&this.print_newline()}this._output.space_before_token=this._output.space_before_token||be,this.print_token(k),this._output.space_before_token=We},K.prototype.handle_block_comment=function(k,z){if(this._output.raw){this._output.add_raw_token(k),k.directives&&k.directives.preserve==="end"&&(this._output.raw=this._options.test_output_raw);return}if(k.directives){this.print_newline(!1,z),this.print_token(k),k.directives.preserve==="start"&&(this._output.raw=!0),this.print_newline(!1,!0);return}if(!a.newline.test(k.text)&&!k.newlines){this._output.space_before_token=!0,this.print_token(k),this._output.space_before_token=!0;return}else this.print_block_commment(k,z)},K.prototype.print_block_commment=function(k,z){var te=P(k.text),de,be=!1,We=!1,Ne=k.whitespace_before,Le=Ne.length;if(this.print_newline(!1,z),this.print_token_line_indentation(k),this._output.add_token(te[0]),this.print_newline(!1,z),te.length>1){for(te=te.slice(1),be=j(te,"*"),We=A(te,Ne),be&&(this._flags.alignment=1),de=0;de<te.length;de++)be?(this.print_token_line_indentation(k),this._output.add_token(v(te[de]))):We&&te[de]?(this.print_token_line_indentation(k),this._output.add_token(te[de].substring(Le))):(this._output.current_line.set_indent(-1),this._output.add_token(te[de])),this.print_newline(!1,z);this._flags.alignment=0}},K.prototype.handle_comment=function(k,z){k.newlines?this.print_newline(!1,z):this._output.trim(!0),this._output.space_before_token=!0,this.print_token(k),this.print_newline(!1,z)},K.prototype.handle_dot=function(k){this.start_of_statement(k)||this.handle_whitespace_and_comments(k,!0),this._flags.last_token.text.match("^[0-9]+$")&&(this._output.space_before_token=!0),C(this._flags.last_token,_)?this._output.space_before_token=!1:this.allow_wrap_or_preserved_newline(k,this._flags.last_token.text===")"&&this._options.break_chained_methods),this._options.unindent_chained_methods&&this._output.just_added_newline()&&this.deindent(),this.print_token(k)},K.prototype.handle_unknown=function(k,z){this.print_token(k),k.text[k.text.length-1]===`
|
|
|
`&&this.print_newline(!1,z)},K.prototype.handle_eof=function(k){for(;this._flags.mode===g.Statement;)this.restore_mode();this.handle_whitespace_and_comments(k)},i.exports.Beautifier=K},function(i){function c(n){this.__parent=n,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=[]}c.prototype.clone_empty=function(){var n=new c(this.__parent);return n.set_indent(this.__indent_count,this.__alignment_count),n},c.prototype.item=function(n){return n<0?this.__items[this.__items.length+n]:this.__items[n]},c.prototype.has_match=function(n){for(var a=this.__items.length-1;a>=0;a--)if(this.__items[a].match(n))return!0;return!1},c.prototype.set_indent=function(n,a){this.is_empty()&&(this.__indent_count=n||0,this.__alignment_count=a||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},c.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)},c.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},c.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var n=this.__parent.current_line;return n.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),n.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),n.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,n.__items[0]===" "&&(n.__items.splice(0,1),n.__character_count-=1),!0}return!1},c.prototype.is_empty=function(){return this.__items.length===0},c.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},c.prototype.push=function(n){this.__items.push(n);var a=n.lastIndexOf(`
|
|
|
`);a!==-1?this.__character_count=n.length-a:this.__character_count+=n.length},c.prototype.pop=function(){var n=null;return this.is_empty()||(n=this.__items.pop(),this.__character_count-=n.length),n},c.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},c.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},c.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},c.prototype.toString=function(){var n="";return this.is_empty()?this.__parent.indent_empty_lines&&(n=this.__parent.get_indent_string(this.__indent_count)):(n=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),n+=this.__items.join("")),n};function o(n,a){this.__cache=[""],this.__indent_size=n.indent_size,this.__indent_string=n.indent_char,n.indent_with_tabs||(this.__indent_string=new Array(n.indent_size+1).join(n.indent_char)),a=a||"",n.indent_level>0&&(a=new Array(n.indent_level+1).join(this.__indent_string)),this.__base_string=a,this.__base_string_length=a.length}o.prototype.get_indent_size=function(n,a){var t=this.__base_string_length;return a=a||0,n<0&&(t=0),t+=n*this.__indent_size,t+=a,t},o.prototype.get_indent_string=function(n,a){var t=this.__base_string;return a=a||0,n<0&&(n=0,t=""),a+=n*this.__indent_size,this.__ensure_cache(a),t+=this.__cache[a],t},o.prototype.__ensure_cache=function(n){for(;n>=this.__cache.length;)this.__add_column()},o.prototype.__add_column=function(){var n=this.__cache.length,a=0,t="";this.__indent_size&&n>=this.__indent_size&&(a=Math.floor(n/this.__indent_size),n-=a*this.__indent_size,t=new Array(a+1).join(this.__indent_string)),n&&(t+=new Array(n+1).join(" ")),this.__cache.push(t)};function h(n,a){this.__indent_cache=new o(n,a),this.raw=!1,this._end_with_newline=n.end_with_newline,this.indent_size=n.indent_size,this.wrap_line_length=n.wrap_line_length,this.indent_empty_lines=n.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new c(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}h.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},h.prototype.get_line_number=function(){return this.__lines.length},h.prototype.get_indent_string=function(n,a){return this.__indent_cache.get_indent_string(n,a)},h.prototype.get_indent_size=function(n,a){return this.__indent_cache.get_indent_size(n,a)},h.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},h.prototype.add_new_line=function(n){return this.is_empty()||!n&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},h.prototype.get_code=function(n){this.trim(!0);var a=this.current_line.pop();a&&(a[a.length-1]===`
|
|
|
`&&(a=a.replace(/\n+$/g,"")),this.current_line.push(a)),this._end_with_newline&&this.__add_outputline();var t=this.__lines.join(`
|
|
|
`);return n!==`
|
|
|
`&&(t=t.replace(/[\n]/g,n)),t},h.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},h.prototype.set_indent=function(n,a){return n=n||0,a=a||0,this.next_line.set_indent(n,a),this.__lines.length>1?(this.current_line.set_indent(n,a),!0):(this.current_line.set_indent(),!1)},h.prototype.add_raw_token=function(n){for(var a=0;a<n.newlines;a++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(n.whitespace_before),this.current_line.push(n.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},h.prototype.add_token=function(n){this.__add_space_before_token(),this.current_line.push(n),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},h.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(" "))},h.prototype.remove_indent=function(n){for(var a=this.__lines.length;n<a;)this.__lines[n]._remove_indent(),n++;this.current_line._remove_wrap_indent()},h.prototype.trim=function(n){for(n=n===void 0?!1:n,this.current_line.trim();n&&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},h.prototype.just_added_newline=function(){return this.current_line.is_empty()},h.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},h.prototype.ensure_empty_line_above=function(n,a){for(var t=this.__lines.length-2;t>=0;){var r=this.__lines[t];if(r.is_empty())break;if(r.item(0).indexOf(n)!==0&&r.item(-1)!==a){this.__lines.splice(t+1,0,new c(this)),this.previous_line=this.__lines[this.__lines.length-2];break}t--}},i.exports.Output=h},function(i){function c(o,h,n,a){this.type=o,this.text=h,this.comments_before=null,this.newlines=n||0,this.whitespace_before=a||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}i.exports.Token=c},function(i,c){var o="\\x23\\x24\\x40\\x41-\\x5a\\x5f\\x61-\\x7a",h="\\x24\\x30-\\x39\\x41-\\x5a\\x5f\\x61-\\x7a",n="\\xaa\\xb5\\xba\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\u02c1\\u02c6-\\u02d1\\u02e0-\\u02e4\\u02ec\\u02ee\\u0370-\\u0374\\u0376\\u0377\\u037a-\\u037d\\u0386\\u0388-\\u038a\\u038c\\u038e-\\u03a1\\u03a3-\\u03f5\\u03f7-\\u0481\\u048a-\\u0527\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05d0-\\u05ea\\u05f0-\\u05f2\\u0620-\\u064a\\u066e\\u066f\\u0671-\\u06d3\\u06d5\\u06e5\\u06e6\\u06ee\\u06ef\\u06fa-\\u06fc\\u06ff\\u0710\\u0712-\\u072f\\u074d-\\u07a5\\u07b1\\u07ca-\\u07ea\\u07f4\\u07f5\\u07fa\\u0800-\\u0815\\u081a\\u0824\\u0828\\u0840-\\u0858\\u08a0\\u08a2-\\u08ac\\u0904-\\u0939\\u093d\\u0950\\u0958-\\u0961\\u0971-\\u0977\\u0979-\\u097f\\u0985-\\u098c\\u098f\\u0990\\u0993-\\u09a8\\u09aa-\\u09b0\\u09b2\\u09b6-\\u09b9\\u09bd\\u09ce\\u09dc\\u09dd\\u09df-\\u09e1\\u09f0\\u09f1\\u0a05-\\u0a0a\\u0a0f\\u0a10\\u0a13-\\u0a28\\u0a2a-\\u0a30\\u0a32\\u0a33\\u0a35\\u0a36\\u0a38\\u0a39\\u0a59-\\u0a5c\\u0a5e\\u0a72-\\u0a74\\u0a85-\\u0a8d\\u0a8f-\\u0a91\\u0a93-\\u0aa8\\u0aaa-\\u0ab0\\u0ab2\\u0ab3\\u0ab5-\\u0ab9\\u0abd\\u0ad0\\u0ae0\\u0ae1\\u0b05-\\u0b0c\\u0b0f\\u0b10\\u0b13-\\u0b28\\u0b2a-\\u0b30\\u0b32\\u0b33\\u0b35-\\u0b39\\u0b3d\\u0b5c\\u0b5d\\u0b5f-\\u0b61\\u0b71\\u0b83\\u0b85-\\u0b8a\\u0b8e-\\u0b90\\u0b92-\\u0b95\\u0b99\\u0b9a\\u0b9c\\u0b9e\\u0b9f\\u0ba3\\u0ba4\\u0ba8-\\u0baa\\u0bae-\\u0bb9\\u0bd0\\u0c05-\\u0c0c\\u0c0e-\\u0c10\\u0c12-\\u0c28\\u0c2a-\\u0c33\\u0c35-\\u0c39\\u0c3d\\u0c58\\u0c59\\u0c60\\u0c61\\u0c85-\\u0c8c\\u0c8e-\\u0c90\\u0c92-\\u0ca8\\u0caa-\\u0cb3\\u0cb5-\\u0cb9\\u0cbd\\u0cde\\u0ce0\\u0ce1\\u0cf1\\u0cf2\\u0d05-\\u0d0c\\u0d0e-\\u0d10\\u0d12-\\u0d3a\\u0d3d\\u0d4e\\u0d60\\u0d61\\u0d7a-\\u0d7f\\u0d85-\\u0d96\\u0d9a-\\u0db1\\u0db3-\\u0dbb\\u0dbd\\u0dc0-\\u0dc6\\u0e01-\\u0e30\\u0e32\\u0e33\\u0e40-\\u0e46\\u0e81\\u0e82\\u0e84\\u0e87\\u0e88\\u0e8a\\u0e8d\\u0e94-\\u0e97\\u0e99-\\u0e9f\\u0ea1-\\u0ea3\\u0ea5\\u0ea7\\u0eaa\\u0eab\\u0ead-\\u0eb0\\u0eb2\\u0eb3\\u0ebd\\u0ec0-\\u0ec4\\u0ec6\\u0edc-\\u0edf\\u0f00\\u0f40-\\u0f47\\u0f49-\\u0f6c\\u0f88-\\u0f8c\\u1000-\\u102a\\u103f\\u1050-\\u1055\\u105a-\\u105d\\u1061\\u1065\\u1066\\u106e-\\u1070\\u1075-\\u1081\\u108e\\u10a0-\\u10c5\\u10c7\\u10cd\\u10d0-\\u10fa\\u10fc-\\u1248\\u124a-\\u124d\\u1250-\\u1256\\u1258\\u125a-\\u125d\\u1260-\\u1288\\u128a-\\u128d\\u1290-\\u12b0\\u12b2-\\u12b5\\u12b8-\\u12be\\u12c0\\u12c2-\\u12c5\\u12c8-\\u12d6\\u12d8-\\u1310\\u1312-\\u1315\\u1318-\\u135a\\u1380-\\u138f\\u13a0-\\u13f4\\u1401-\\u166c\\u166f-\\u167f\\u1681-\\u169a\\u16a0-\\u16ea\\u16ee-\\u16f0\\u1700-\\u170c\\u170e-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176c\\u176e-\\u1770\\u1780-\\u17b3\\u17d7\\u17dc\\u1820-\\u1877\\u1880-\\u18a8\\u18aa\\u18b0-\\u18f5\\u1900-\\u191c\\u1950-\\u196d\\u1970-\\u1974\\u1980-\\u19ab\\u19c1-\\u19c7\\u1a00-\\u1a16\\u1a20-\\u1a54\\u1aa7\\u1b05-\\u1b33\\u1b45-\\u1b4b\\u1b83-\\u1ba0\\u1bae\\u1baf\\u1bba-\\u1be5\\u1c00-\\u1c23\\u1c4d-\\u1c4f\\u1c5a-\\u1c7d\\u1ce9-\\u1cec\\u1cee-\\u1cf1\\u1cf5\\u1cf6\\u1d00-\\u1dbf\\u1e00-\\u1f15\\u1f18-\\u1f1d\\u1f20-\\u1f45\\u1f48-\\u1f4d\\u1f50-\\u1f57\\u1f59\\u1f5b\\u1f5d\\u1f5f-\\u1f7d\\u1f80-\\u1fb4\\u1fb6-\\u1fbc\\u1fbe\\u1fc2-\\u1fc4\\u1fc6-\\u1fcc\\u1fd0-\\u1fd3\\u1fd6-\\u1fdb\\u1fe0-\\u1fec\\u1ff2-\\u1ff4\\u1ff6-\\u1ffc\\u2071\\u207f\\u2090-\\u209c\\u2102\\u2107\\u210a-\\u2113\\u2115\\u2119-\\u211d\\u2124\\u2126\\u2128\\u212a-\\u212d\\u212f-\\u2139\\u213c-\\u213f\\u2145-\\u2149\\u214e\\u2160-\\u2188\\u2c00-\\u2c2e\\u2c30-\\u2c5e\\u2c60-\\u2ce4\\u2ceb-\\u2cee\\u2cf2\\u2cf3\\u2d00-\\u2d25\\u2d27\\u2d2d\\u2d30-\\u2d67\\u2d6f\\u2d80-\\u2d96\\u2da0-\\u2da6\\u2da8-\\u2dae\\u2db0-\\u2db6\\u2db8-\\u2dbe\\u2dc0-\\u2dc6\\u2dc8-\\u2dce\\u2dd0-\\u2dd6\\u2dd8-\\u2dde\\u2e2f\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303c\\u3041-\\u3096\\u309d-\\u309f\\u30a1-\\u30fa\\u30fc-\\u30ff\\u3105-\\u312d\\u3131-\\u318e\\u31a0-\\u31ba\\u31f0-\\u31ff\\u3400-\\u4db5\\u4e00-\\u9fcc\\ua000-\\ua48c\\ua4d0-\\ua4fd\\ua500-\\ua60c\\ua610-\\ua61f\\ua62a\\ua62b\\ua640-\\ua66e\\ua67f-\\ua697\\ua6a0-\\ua6ef\\ua717-\\ua71f\\ua722-\\ua788\\ua78b-\\ua78e\\ua790-\\ua793\\ua7a0-\\ua7aa\\ua7f8-\\ua801\\ua803-\\ua805\\ua807-\\ua80a\\ua80c-\\ua822\\ua840-\\ua873\\ua882-\\ua8b3\\ua8f2-\\ua8f7\\ua8fb\\ua90a-\\ua925\\ua930-\\ua946\\ua960-\\ua97c\\ua984-\\ua9b2\\ua9cf\\uaa00-\\uaa28\\uaa40-\\uaa42\\uaa44-\\uaa4b\\uaa60-\\uaa76\\uaa7a\\uaa80-\\uaaaf\\uaab1\\uaab5\\uaab6\\uaab9-\\uaabd\\uaac0\\uaac2\\uaadb-\\uaadd\\uaae0-\\uaaea\\uaaf2-\\uaaf4\\uab01-\\uab06\\uab09-\\uab0e\\uab11-\\uab16\\uab20-\\uab26\\uab28-\\uab2e\\uabc0-\\uabe2\\uac00-\\ud7a3\\ud7b0-\\ud7c6\\ud7cb-\\ud7fb\\uf900-\\ufa6d\\ufa70-\\ufad9\\ufb00-\\ufb06\\ufb13-\\ufb17\\ufb1d\\ufb1f-\\ufb28\\ufb2a-\\ufb36\\ufb38-\\ufb3c\\ufb3e\\ufb40\\ufb41\\ufb43\\ufb44\\ufb46-\\ufbb1\\ufbd3-\\ufd3d\\ufd50-\\ufd8f\\ufd92-\\ufdc7\\ufdf0-\\ufdfb\\ufe70-\\ufe74\\ufe76-\\ufefc\\uff21-\\uff3a\\uff41-\\uff5a\\uff66-\\uffbe\\uffc2-\\uffc7\\uffca-\\uffcf\\uffd2-\\uffd7\\uffda-\\uffdc",a="\\u0300-\\u036f\\u0483-\\u0487\\u0591-\\u05bd\\u05bf\\u05c1\\u05c2\\u05c4\\u05c5\\u05c7\\u0610-\\u061a\\u0620-\\u0649\\u0672-\\u06d3\\u06e7-\\u06e8\\u06fb-\\u06fc\\u0730-\\u074a\\u0800-\\u0814\\u081b-\\u0823\\u0825-\\u0827\\u0829-\\u082d\\u0840-\\u0857\\u08e4-\\u08fe\\u0900-\\u0903\\u093a-\\u093c\\u093e-\\u094f\\u0951-\\u0957\\u0962-\\u0963\\u0966-\\u096f\\u0981-\\u0983\\u09bc\\u09be-\\u09c4\\u09c7\\u09c8\\u09d7\\u09df-\\u09e0\\u0a01-\\u0a03\\u0a3c\\u0a3e-\\u0a42\\u0a47\\u0a48\\u0a4b-\\u0a4d\\u0a51\\u0a66-\\u0a71\\u0a75\\u0a81-\\u0a83\\u0abc\\u0abe-\\u0ac5\\u0ac7-\\u0ac9\\u0acb-\\u0acd\\u0ae2-\\u0ae3\\u0ae6-\\u0aef\\u0b01-\\u0b03\\u0b3c\\u0b3e-\\u0b44\\u0b47\\u0b48\\u0b4b-\\u0b4d\\u0b56\\u0b57\\u0b5f-\\u0b60\\u0b66-\\u0b6f\\u0b82\\u0bbe-\\u0bc2\\u0bc6-\\u0bc8\\u0bca-\\u0bcd\\u0bd7\\u0be6-\\u0bef\\u0c01-\\u0c03\\u0c46-\\u0c48\\u0c4a-\\u0c4d\\u0c55\\u0c56\\u0c62-\\u0c63\\u0c66-\\u0c6f\\u0c82\\u0c83\\u0cbc\\u0cbe-\\u0cc4\\u0cc6-\\u0cc8\\u0cca-\\u0ccd\\u0cd5\\u0cd6\\u0ce2-\\u0ce3\\u0ce6-\\u0cef\\u0d02\\u0d03\\u0d46-\\u0d48\\u0d57\\u0d62-\\u0d63\\u0d66-\\u0d6f\\u0d82\\u0d83\\u0dca\\u0dcf-\\u0dd4\\u0dd6\\u0dd8-\\u0ddf\\u0df2\\u0df3\\u0e34-\\u0e3a\\u0e40-\\u0e45\\u0e50-\\u0e59\\u0eb4-\\u0eb9\\u0ec8-\\u0ecd\\u0ed0-\\u0ed9\\u0f18\\u0f19\\u0f20-\\u0f29\\u0f35\\u0f37\\u0f39\\u0f41-\\u0f47\\u0f71-\\u0f84\\u0f86-\\u0f87\\u0f8d-\\u0f97\\u0f99-\\u0fbc\\u0fc6\\u1000-\\u1029\\u1040-\\u1049\\u1067-\\u106d\\u1071-\\u1074\\u1082-\\u108d\\u108f-\\u109d\\u135d-\\u135f\\u170e-\\u1710\\u1720-\\u1730\\u1740-\\u1750\\u1772\\u1773\\u1780-\\u17b2\\u17dd\\u17e0-\\u17e9\\u180b-\\u180d\\u1810-\\u1819\\u1920-\\u192b\\u1930-\\u193b\\u1951-\\u196d\\u19b0-\\u19c0\\u19c8-\\u19c9\\u19d0-\\u19d9\\u1a00-\\u1a15\\u1a20-\\u1a53\\u1a60-\\u1a7c\\u1a7f-\\u1a89\\u1a90-\\u1a99\\u1b46-\\u1b4b\\u1b50-\\u1b59\\u1b6b-\\u1b73\\u1bb0-\\u1bb9\\u1be6-\\u1bf3\\u1c00-\\u1c22\\u1c40-\\u1c49\\u1c5b-\\u1c7d\\u1cd0-\\u1cd2\\u1d00-\\u1dbe\\u1e01-\\u1f15\\u200c\\u200d\\u203f\\u2040\\u2054\\u20d0-\\u20dc\\u20e1\\u20e5-\\u20f0\\u2d81-\\u2d96\\u2de0-\\u2dff\\u3021-\\u3028\\u3099\\u309a\\ua640-\\ua66d\\ua674-\\ua67d\\ua69f\\ua6f0-\\ua6f1\\ua7f8-\\ua800\\ua806\\ua80b\\ua823-\\ua827\\ua880-\\ua881\\ua8b4-\\ua8c4\\ua8d0-\\ua8d9\\ua8f3-\\ua8f7\\ua900-\\ua909\\ua926-\\ua92d\\ua930-\\ua945\\ua980-\\ua983\\ua9b3-\\ua9c0\\uaa00-\\uaa27\\uaa40-\\uaa41\\uaa4c-\\uaa4d\\uaa50-\\uaa59\\uaa7b\\uaae0-\\uaae9\\uaaf2-\\uaaf3\\uabc0-\\uabe1\\uabec\\uabed\\uabf0-\\uabf9\\ufb20-\\ufb28\\ufe00-\\ufe0f\\ufe20-\\ufe26\\ufe33\\ufe34\\ufe4d-\\ufe4f\\uff10-\\uff19\\uff3f",t="(?:\\\\u[0-9a-fA-F]{4}|["+o+n+"])",r="(?:\\\\u[0-9a-fA-F]{4}|["+h+n+a+"])*";c.identifier=new RegExp(t+r,"g"),c.identifierStart=new RegExp(t),c.identifierMatch=new RegExp("(?:\\\\u[0-9a-fA-F]{4}|["+h+n+a+"])+");var s=/[\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff]/;c.newline=/[\n\r\u2028\u2029]/,c.lineBreak=new RegExp(`\r
|
|
|
|`+c.newline.source),c.allLineBreaks=new RegExp(c.lineBreak.source,"g")},function(i,c,o){var h=o(6).Options,n=["before-newline","after-newline","preserve-newline"];function a(t){h.call(this,t,"js");var r=this.raw_options.brace_style||null;r==="expand-strict"?this.raw_options.brace_style="expand":r==="collapse-preserve-inline"?this.raw_options.brace_style="collapse,preserve-inline":this.raw_options.braces_on_own_line!==void 0&&(this.raw_options.brace_style=this.raw_options.braces_on_own_line?"expand":"collapse");var s=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_preserve_inline=!1,this.brace_style="collapse";for(var u=0;u<s.length;u++)s[u]==="preserve-inline"?this.brace_preserve_inline=!0:this.brace_style=s[u];this.unindent_chained_methods=this._get_boolean("unindent_chained_methods"),this.break_chained_methods=this._get_boolean("break_chained_methods"),this.space_in_paren=this._get_boolean("space_in_paren"),this.space_in_empty_paren=this._get_boolean("space_in_empty_paren"),this.jslint_happy=this._get_boolean("jslint_happy"),this.space_after_anon_function=this._get_boolean("space_after_anon_function"),this.space_after_named_function=this._get_boolean("space_after_named_function"),this.keep_array_indentation=this._get_boolean("keep_array_indentation"),this.space_before_conditional=this._get_boolean("space_before_conditional",!0),this.unescape_strings=this._get_boolean("unescape_strings"),this.e4x=this._get_boolean("e4x"),this.comma_first=this._get_boolean("comma_first"),this.operator_position=this._get_selection("operator_position",n),this.test_output_raw=this._get_boolean("test_output_raw"),this.jslint_happy&&(this.space_after_anon_function=!0)}a.prototype=new h,i.exports.Options=a},function(i){function c(n,a){this.raw_options=o(n,a),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","django","erb","handlebars","php","smarty"],["auto"])}c.prototype._get_array=function(n,a){var t=this.raw_options[n],r=a||[];return typeof t=="object"?t!==null&&typeof t.concat=="function"&&(r=t.concat()):typeof t=="string"&&(r=t.split(/[^a-zA-Z0-9_\/\-]+/)),r},c.prototype._get_boolean=function(n,a){var t=this.raw_options[n],r=t===void 0?!!a:!!t;return r},c.prototype._get_characters=function(n,a){var t=this.raw_options[n],r=a||"";return typeof t=="string"&&(r=t.replace(/\\r/,"\r").replace(/\\n/,`
|
|
|
`).replace(/\\t/," ")),r},c.prototype._get_number=function(n,a){var t=this.raw_options[n];a=parseInt(a,10),isNaN(a)&&(a=0);var r=parseInt(t,10);return isNaN(r)&&(r=a),r},c.prototype._get_selection=function(n,a,t){var r=this._get_selection_list(n,a,t);if(r.length!==1)throw new Error("Invalid Option Value: The option '"+n+`' can only be one of the following values:
|
|
|
`+a+`
|
|
|
You passed in: '`+this.raw_options[n]+"'");return r[0]},c.prototype._get_selection_list=function(n,a,t){if(!a||a.length===0)throw new Error("Selection list cannot be empty.");if(t=t||[a[0]],!this._is_valid_selection(t,a))throw new Error("Invalid Default Value!");var r=this._get_array(n,t);if(!this._is_valid_selection(r,a))throw new Error("Invalid Option Value: The option '"+n+`' can contain only the following values:
|
|
|
`+a+`
|
|
|
You passed in: '`+this.raw_options[n]+"'");return r},c.prototype._is_valid_selection=function(n,a){return n.length&&a.length&&!n.some(function(t){return a.indexOf(t)===-1})};function o(n,a){var t={};n=h(n);var r;for(r in n)r!==a&&(t[r]=n[r]);if(a&&n[a])for(r in n[a])t[r]=n[a][r];return t}function h(n){var a={},t;for(t in n){var r=t.replace(/-/g,"_");a[r]=n[t]}return a}i.exports.Options=c,i.exports.normalizeOpts=h,i.exports.mergeOpts=o},function(i,c,o){var h=o(8).InputScanner,n=o(9).Tokenizer,a=o(9).TOKEN,t=o(13).Directives,r=o(4),s=o(12).Pattern,u=o(14).TemplatablePattern;function d(j,A){return A.indexOf(j)!==-1}var f={START_EXPR:"TK_START_EXPR",END_EXPR:"TK_END_EXPR",START_BLOCK:"TK_START_BLOCK",END_BLOCK:"TK_END_BLOCK",WORD:"TK_WORD",RESERVED:"TK_RESERVED",SEMICOLON:"TK_SEMICOLON",STRING:"TK_STRING",EQUALS:"TK_EQUALS",OPERATOR:"TK_OPERATOR",COMMA:"TK_COMMA",BLOCK_COMMENT:"TK_BLOCK_COMMENT",COMMENT:"TK_COMMENT",DOT:"TK_DOT",UNKNOWN:"TK_UNKNOWN",START:a.START,RAW:a.RAW,EOF:a.EOF},v=new t(/\/\*/,/\*\//),m=/0[xX][0123456789abcdefABCDEF_]*n?|0[oO][01234567_]*n?|0[bB][01_]*n?|\d[\d_]*n|(?:\.\d[\d_]*|\d[\d_]*\.?[\d_]*)(?:[eE][+-]?[\d_]+)?/,S=/[0-9]/,C=/[^\d\.]/,_=">>> === !== &&= ??= ||= << && >= ** != == <= >> || ?? |> < / - + > : & % ? ^ | *".split(" "),y=">>>= ... >>= <<= === >>> !== **= &&= ??= ||= => ^= :: /= << <= == && -= >= >> != -- += ** || ?? ++ %= &= *= |= |> = ! ? > < : / ^ - + * & % ~ |";y=y.replace(/[-[\]{}()*+?.,\\^$|#]/g,"\\$&"),y="\\?\\.(?!\\d) "+y,y=y.replace(/ /g,"|");var T=new RegExp(y),O="continue,try,throw,return,var,let,const,if,switch,case,default,for,while,break,function,import,export".split(","),g=O.concat(["do","in","of","else","get","set","new","catch","finally","typeof","yield","async","await","from","as","class","extends"]),F=new RegExp("^(?:"+g.join("|")+")$"),P,N=function(j,A){n.call(this,j,A),this._patterns.whitespace=this._patterns.whitespace.matching(/\u00A0\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff/.source,/\u2028\u2029/.source);var K=new s(this._input),U=new u(this._input).read_options(this._options);this.__patterns={template:U,identifier:U.starting_with(r.identifier).matching(r.identifierMatch),number:K.matching(m),punct:K.matching(T),comment:K.starting_with(/\/\//).until(/[\n\r\u2028\u2029]/),block_comment:K.starting_with(/\/\*/).until_after(/\*\//),html_comment_start:K.matching(/<!--/),html_comment_end:K.matching(/-->/),include:K.starting_with(/#include/).until_after(r.lineBreak),shebang:K.starting_with(/#!/).until_after(r.lineBreak),xml:K.matching(/[\s\S]*?<(\/?)([-a-zA-Z:0-9_.]+|{[^}]+?}|!\[CDATA\[[^\]]*?\]\]|)(\s*{[^}]+?}|\s+[-a-zA-Z:0-9_.]+|\s+[-a-zA-Z:0-9_.]+\s*=\s*('[^']*'|"[^"]*"|{([^{}]|{[^}]+?})+?}))*\s*(\/?)\s*>/),single_quote:U.until(/['\\\n\r\u2028\u2029]/),double_quote:U.until(/["\\\n\r\u2028\u2029]/),template_text:U.until(/[`\\$]/),template_expression:U.until(/[`}\\]/)}};N.prototype=new n,N.prototype._is_comment=function(j){return j.type===f.COMMENT||j.type===f.BLOCK_COMMENT||j.type===f.UNKNOWN},N.prototype._is_opening=function(j){return j.type===f.START_BLOCK||j.type===f.START_EXPR},N.prototype._is_closing=function(j,A){return(j.type===f.END_BLOCK||j.type===f.END_EXPR)&&A&&(j.text==="]"&&A.text==="["||j.text===")"&&A.text==="("||j.text==="}"&&A.text==="{")},N.prototype._reset=function(){P=!1},N.prototype._get_next_token=function(j,A){var K=null;this._readWhitespace();var U=this._input.peek();return U===null?this._create_token(f.EOF,""):(K=K||this._read_non_javascript(U),K=K||this._read_string(U),K=K||this._read_word(j),K=K||this._read_singles(U),K=K||this._read_comment(U),K=K||this._read_regexp(U,j),K=K||this._read_xml(U,j),K=K||this._read_punctuation(),K=K||this._create_token(f.UNKNOWN,this._input.next()),K)},N.prototype._read_word=function(j){var A;if(A=this.__patterns.identifier.read(),A!=="")return A=A.replace(r.allLineBreaks,`
|
|
|
`),!(j.type===f.DOT||j.type===f.RESERVED&&(j.text==="set"||j.text==="get"))&&F.test(A)?(A==="in"||A==="of")&&(j.type===f.WORD||j.type===f.STRING)?this._create_token(f.OPERATOR,A):this._create_token(f.RESERVED,A):this._create_token(f.WORD,A);if(A=this.__patterns.number.read(),A!=="")return this._create_token(f.WORD,A)},N.prototype._read_singles=function(j){var A=null;return j==="("||j==="["?A=this._create_token(f.START_EXPR,j):j===")"||j==="]"?A=this._create_token(f.END_EXPR,j):j==="{"?A=this._create_token(f.START_BLOCK,j):j==="}"?A=this._create_token(f.END_BLOCK,j):j===";"?A=this._create_token(f.SEMICOLON,j):j==="."&&C.test(this._input.peek(1))?A=this._create_token(f.DOT,j):j===","&&(A=this._create_token(f.COMMA,j)),A&&this._input.next(),A},N.prototype._read_punctuation=function(){var j=this.__patterns.punct.read();if(j!=="")return j==="="?this._create_token(f.EQUALS,j):j==="?."?this._create_token(f.DOT,j):this._create_token(f.OPERATOR,j)},N.prototype._read_non_javascript=function(j){var A="";if(j==="#"){if(this._is_first_token()&&(A=this.__patterns.shebang.read(),A))return this._create_token(f.UNKNOWN,A.trim()+`
|
|
|
`);if(A=this.__patterns.include.read(),A)return this._create_token(f.UNKNOWN,A.trim()+`
|
|
|
`);j=this._input.next();var K="#";if(this._input.hasNext()&&this._input.testChar(S)){do j=this._input.next(),K+=j;while(this._input.hasNext()&&j!=="#"&&j!=="=");return j==="#"||(this._input.peek()==="["&&this._input.peek(1)==="]"?(K+="[]",this._input.next(),this._input.next()):this._input.peek()==="{"&&this._input.peek(1)==="}"&&(K+="{}",this._input.next(),this._input.next())),this._create_token(f.WORD,K)}this._input.back()}else if(j==="<"&&this._is_first_token()){if(A=this.__patterns.html_comment_start.read(),A){for(;this._input.hasNext()&&!this._input.testChar(r.newline);)A+=this._input.next();return P=!0,this._create_token(f.COMMENT,A)}}else if(P&&j==="-"&&(A=this.__patterns.html_comment_end.read(),A))return P=!1,this._create_token(f.COMMENT,A);return null},N.prototype._read_comment=function(j){var A=null;if(j==="/"){var K="";if(this._input.peek(1)==="*"){K=this.__patterns.block_comment.read();var U=v.get_directives(K);U&&U.ignore==="start"&&(K+=v.readIgnored(this._input)),K=K.replace(r.allLineBreaks,`
|
|
|
`),A=this._create_token(f.BLOCK_COMMENT,K),A.directives=U}else this._input.peek(1)==="/"&&(K=this.__patterns.comment.read(),A=this._create_token(f.COMMENT,K))}return A},N.prototype._read_string=function(j){if(j==="`"||j==="'"||j==='"'){var A=this._input.next();return this.has_char_escapes=!1,j==="`"?A+=this._read_string_recursive("`",!0,"${"):A+=this._read_string_recursive(j),this.has_char_escapes&&this._options.unescape_strings&&(A=X(A)),this._input.peek()===j&&(A+=this._input.next()),A=A.replace(r.allLineBreaks,`
|
|
|
`),this._create_token(f.STRING,A)}return null},N.prototype._allow_regexp_or_xml=function(j){return j.type===f.RESERVED&&d(j.text,["return","case","throw","else","do","typeof","yield"])||j.type===f.END_EXPR&&j.text===")"&&j.opened.previous.type===f.RESERVED&&d(j.opened.previous.text,["if","while","for"])||d(j.type,[f.COMMENT,f.START_EXPR,f.START_BLOCK,f.START,f.END_BLOCK,f.OPERATOR,f.EQUALS,f.EOF,f.SEMICOLON,f.COMMA])},N.prototype._read_regexp=function(j,A){if(j==="/"&&this._allow_regexp_or_xml(A)){for(var K=this._input.next(),U=!1,k=!1;this._input.hasNext()&&(U||k||this._input.peek()!==j)&&!this._input.testChar(r.newline);)K+=this._input.peek(),U?U=!1:(U=this._input.peek()==="\\",this._input.peek()==="["?k=!0:this._input.peek()==="]"&&(k=!1)),this._input.next();return this._input.peek()===j&&(K+=this._input.next(),K+=this._input.read(r.identifier)),this._create_token(f.STRING,K)}return null},N.prototype._read_xml=function(j,A){if(this._options.e4x&&j==="<"&&this._allow_regexp_or_xml(A)){var K="",U=this.__patterns.xml.read_match();if(U){for(var k=U[2].replace(/^{\s+/,"{").replace(/\s+}$/,"}"),z=k.indexOf("{")===0,te=0;U;){var de=!!U[1],be=U[2],We=!!U[U.length-1]||be.slice(0,8)==="![CDATA[";if(!We&&(be===k||z&&be.replace(/^{\s+/,"{").replace(/\s+}$/,"}"))&&(de?--te:++te),K+=U[0],te<=0)break;U=this.__patterns.xml.read_match()}return U||(K+=this._input.match(/[\s\S]*/g)[0]),K=K.replace(r.allLineBreaks,`
|
|
|
`),this._create_token(f.STRING,K)}}return null};function X(j){for(var A="",K=0,U=new h(j),k=null;U.hasNext();)if(k=U.match(/([\s]|[^\\]|\\\\)+/g),k&&(A+=k[0]),U.peek()==="\\"){if(U.next(),U.peek()==="x")k=U.match(/x([0-9A-Fa-f]{2})/g);else if(U.peek()==="u")k=U.match(/u([0-9A-Fa-f]{4})/g);else{A+="\\",U.hasNext()&&(A+=U.next());continue}if(!k)return j;if(K=parseInt(k[1],16),K>126&&K<=255&&k[0].indexOf("x")===0)return j;if(K>=0&&K<32){A+="\\"+k[0];continue}else K===34||K===39||K===92?A+="\\"+String.fromCharCode(K):A+=String.fromCharCode(K)}return A}N.prototype._read_string_recursive=function(j,A,K){var U,k;j==="'"?k=this.__patterns.single_quote:j==='"'?k=this.__patterns.double_quote:j==="`"?k=this.__patterns.template_text:j==="}"&&(k=this.__patterns.template_expression);for(var z=k.read(),te="";this._input.hasNext();){if(te=this._input.next(),te===j||!A&&r.newline.test(te)){this._input.back();break}else te==="\\"&&this._input.hasNext()?(U=this._input.peek(),U==="x"||U==="u"?this.has_char_escapes=!0:U==="\r"&&this._input.peek(1)===`
|
|
|
`&&this._input.next(),te+=this._input.next()):K&&(K==="${"&&te==="$"&&this._input.peek()==="{"&&(te+=this._input.next()),K===te&&(j==="`"?te+=this._read_string_recursive("}",A,"`"):te+=this._read_string_recursive("`",A,"${"),this._input.hasNext()&&(te+=this._input.next())));te+=k.read(),z+=te}return z},i.exports.Tokenizer=N,i.exports.TOKEN=f,i.exports.positionable_operators=_.slice(),i.exports.line_starters=O.slice()},function(i){var c=RegExp.prototype.hasOwnProperty("sticky");function o(h){this.__input=h||"",this.__input_length=this.__input.length,this.__position=0}o.prototype.restart=function(){this.__position=0},o.prototype.back=function(){this.__position>0&&(this.__position-=1)},o.prototype.hasNext=function(){return this.__position<this.__input_length},o.prototype.next=function(){var h=null;return this.hasNext()&&(h=this.__input.charAt(this.__position),this.__position+=1),h},o.prototype.peek=function(h){var n=null;return h=h||0,h+=this.__position,h>=0&&h<this.__input_length&&(n=this.__input.charAt(h)),n},o.prototype.__match=function(h,n){h.lastIndex=n;var a=h.exec(this.__input);return a&&!(c&&h.sticky)&&(a.index!==n&&(a=null)),a},o.prototype.test=function(h,n){return n=n||0,n+=this.__position,n>=0&&n<this.__input_length?!!this.__match(h,n):!1},o.prototype.testChar=function(h,n){var a=this.peek(n);return h.lastIndex=0,a!==null&&h.test(a)},o.prototype.match=function(h){var n=this.__match(h,this.__position);return n?this.__position+=n[0].length:n=null,n},o.prototype.read=function(h,n,a){var t="",r;return h&&(r=this.match(h),r&&(t+=r[0])),n&&(r||!h)&&(t+=this.readUntil(n,a)),t},o.prototype.readUntil=function(h,n){var a="",t=this.__position;h.lastIndex=this.__position;var r=h.exec(this.__input);return r?(t=r.index,n&&(t+=r[0].length)):t=this.__input_length,a=this.__input.substring(this.__position,t),this.__position=t,a},o.prototype.readUntilAfter=function(h){return this.readUntil(h,!0)},o.prototype.get_regexp=function(h,n){var a=null,t="g";return n&&c&&(t="y"),typeof h=="string"&&h!==""?a=new RegExp(h,t):h&&(a=new RegExp(h.source,t)),a},o.prototype.get_literal_regexp=function(h){return RegExp(h.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},o.prototype.peekUntilAfter=function(h){var n=this.__position,a=this.readUntilAfter(h);return this.__position=n,a},o.prototype.lookBack=function(h){var n=this.__position-1;return n>=h.length&&this.__input.substring(n-h.length,n).toLowerCase()===h},i.exports.InputScanner=o},function(i,c,o){var h=o(8).InputScanner,n=o(3).Token,a=o(10).TokenStream,t=o(11).WhitespacePattern,r={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},s=function(u,d){this._input=new h(u),this._options=d||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new t(this._input)};s.prototype.tokenize=function(){this._input.restart(),this.__tokens=new a,this._reset();for(var u,d=new n(r.START,""),f=null,v=[],m=new a;d.type!==r.EOF;){for(u=this._get_next_token(d,f);this._is_comment(u);)m.add(u),u=this._get_next_token(d,f);m.isEmpty()||(u.comments_before=m,m=new a),u.parent=f,this._is_opening(u)?(v.push(f),f=u):f&&this._is_closing(u,f)&&(u.opened=f,f.closed=u,f=v.pop(),u.parent=f),u.previous=d,d.next=u,this.__tokens.add(u),d=u}return this.__tokens},s.prototype._is_first_token=function(){return this.__tokens.isEmpty()},s.prototype._reset=function(){},s.prototype._get_next_token=function(u,d){this._readWhitespace();var f=this._input.read(/.+/g);return f?this._create_token(r.RAW,f):this._create_token(r.EOF,"")},s.prototype._is_comment=function(u){return!1},s.prototype._is_opening=function(u){return!1},s.prototype._is_closing=function(u,d){return!1},s.prototype._create_token=function(u,d){var f=new n(u,d,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return f},s.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},i.exports.Tokenizer=s,i.exports.TOKEN=r},function(i){function c(o){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=o}c.prototype.restart=function(){this.__position=0},c.prototype.isEmpty=function(){return this.__tokens_length===0},c.prototype.hasNext=function(){return this.__position<this.__tokens_length},c.prototype.next=function(){var o=null;return this.hasNext()&&(o=this.__tokens[this.__position],this.__position+=1),o},c.prototype.peek=function(o){var h=null;return o=o||0,o+=this.__position,o>=0&&o<this.__tokens_length&&(h=this.__tokens[o]),h},c.prototype.add=function(o){this.__parent_token&&(o.parent=this.__parent_token),this.__tokens.push(o),this.__tokens_length+=1},i.exports.TokenStream=c},function(i,c,o){var h=o(12).Pattern;function n(a,t){h.call(this,a,t),t?this._line_regexp=this._input.get_regexp(t._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}n.prototype=new h,n.prototype.__set_whitespace_patterns=function(a,t){a+="\\t ",t+="\\n\\r",this._match_pattern=this._input.get_regexp("["+a+t+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+t+"]")},n.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var a=this._input.read(this._match_pattern);if(a===" ")this.whitespace_before_token=" ";else if(a){var t=this.__split(this._newline_regexp,a);this.newline_count=t.length-1,this.whitespace_before_token=t[this.newline_count]}return a},n.prototype.matching=function(a,t){var r=this._create();return r.__set_whitespace_patterns(a,t),r._update(),r},n.prototype._create=function(){return new n(this._input,this)},n.prototype.__split=function(a,t){a.lastIndex=0;for(var r=0,s=[],u=a.exec(t);u;)s.push(t.substring(r,u.index)),r=u.index+u[0].length,u=a.exec(t);return r<t.length?s.push(t.substring(r,t.length)):s.push(""),s},i.exports.WhitespacePattern=n},function(i){function c(o,h){this._input=o,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,h&&(this._starting_pattern=this._input.get_regexp(h._starting_pattern,!0),this._match_pattern=this._input.get_regexp(h._match_pattern,!0),this._until_pattern=this._input.get_regexp(h._until_pattern),this._until_after=h._until_after)}c.prototype.read=function(){var o=this._input.read(this._starting_pattern);return(!this._starting_pattern||o)&&(o+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),o},c.prototype.read_match=function(){return this._input.match(this._match_pattern)},c.prototype.until_after=function(o){var h=this._create();return h._until_after=!0,h._until_pattern=this._input.get_regexp(o),h._update(),h},c.prototype.until=function(o){var h=this._create();return h._until_after=!1,h._until_pattern=this._input.get_regexp(o),h._update(),h},c.prototype.starting_with=function(o){var h=this._create();return h._starting_pattern=this._input.get_regexp(o,!0),h._update(),h},c.prototype.matching=function(o){var h=this._create();return h._match_pattern=this._input.get_regexp(o,!0),h._update(),h},c.prototype._create=function(){return new c(this._input,this)},c.prototype._update=function(){},i.exports.Pattern=c},function(i){function c(o,h){o=typeof o=="string"?o:o.source,h=typeof h=="string"?h:h.source,this.__directives_block_pattern=new RegExp(o+/ beautify( \w+[:]\w+)+ /.source+h,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(o+/\sbeautify\signore:end\s/.source+h,"g")}c.prototype.get_directives=function(o){if(!o.match(this.__directives_block_pattern))return null;var h={};this.__directive_pattern.lastIndex=0;for(var n=this.__directive_pattern.exec(o);n;)h[n[1]]=n[2],n=this.__directive_pattern.exec(o);return h},c.prototype.readIgnored=function(o){return o.readUntilAfter(this.__directives_end_ignore_pattern)},i.exports.Directives=c},function(i,c,o){var h=o(12).Pattern,n={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1};function a(t,r){h.call(this,t,r),this.__template_pattern=null,this._disabled=Object.assign({},n),this._excluded=Object.assign({},n),r&&(this.__template_pattern=this._input.get_regexp(r.__template_pattern),this._excluded=Object.assign(this._excluded,r._excluded),this._disabled=Object.assign(this._disabled,r._disabled));var s=new h(t);this.__patterns={handlebars_comment:s.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:s.starting_with(/{{{/).until_after(/}}}/),handlebars:s.starting_with(/{{/).until_after(/}}/),php:s.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),erb:s.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:s.starting_with(/{%/).until_after(/%}/),django_value:s.starting_with(/{{/).until_after(/}}/),django_comment:s.starting_with(/{#/).until_after(/#}/),smarty:s.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:s.starting_with(/{\*/).until_after(/\*}/),smarty_literal:s.starting_with(/{literal}/).until_after(/{\/literal}/)}}a.prototype=new h,a.prototype._create=function(){return new a(this._input,this)},a.prototype._update=function(){this.__set_templated_pattern()},a.prototype.disable=function(t){var r=this._create();return r._disabled[t]=!0,r._update(),r},a.prototype.read_options=function(t){var r=this._create();for(var s in n)r._disabled[s]=t.templating.indexOf(s)===-1;return r._update(),r},a.prototype.exclude=function(t){var r=this._create();return r._excluded[t]=!0,r._update(),r},a.prototype.read=function(){var t="";this._match_pattern?t=this._input.read(this._starting_pattern):t=this._input.read(this._starting_pattern,this.__template_pattern);for(var r=this._read_template();r;)this._match_pattern?r+=this._input.read(this._match_pattern):r+=this._input.readUntil(this.__template_pattern),t+=r,r=this._read_template();return this._until_after&&(t+=this._input.readUntilAfter(this._until_pattern)),t},a.prototype.__set_templated_pattern=function(){var t=[];this._disabled.php||t.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||t.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||t.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(t.push(this.__patterns.django._starting_pattern.source),t.push(this.__patterns.django_value._starting_pattern.source),t.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||t.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&t.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+t.join("|")+")")},a.prototype._read_template=function(){var t="",r=this._input.peek();if(r==="<"){var s=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&s==="?"&&(t=t||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&s==="%"&&(t=t||this.__patterns.erb.read())}else r==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(t=t||this.__patterns.handlebars_comment.read(),t=t||this.__patterns.handlebars_unescaped.read(),t=t||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(t=t||this.__patterns.django_value.read()),this._excluded.django||(t=t||this.__patterns.django_comment.read(),t=t||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(t=t||this.__patterns.smarty_comment.read(),t=t||this.__patterns.smarty_literal.read(),t=t||this.__patterns.smarty.read()));return t},i.exports.TemplatablePattern=a}],p={};function E(i){var c=p[i];if(c!==void 0)return c.exports;var o=p[i]={exports:{}};return M[i](o,o.exports,E),o.exports}var b=E(0);I=b})();var R=I;!(G=[],L=function(){return{js_beautify:R}}.apply(ne,G),L!==void 0&&(it.exports=L))})()},"746U":function(it,ne,q){"use strict";q.d(ne,"f",function(){return G}),q.d(ne,"l",function(){return L}),q.d(ne,"k",function(){return I}),q.d(ne,"j",function(){return R}),q.d(ne,"g",function(){return M}),q.d(ne,"m",function(){return p}),q.d(ne,"h",function(){return E}),q.d(ne,"n",function(){return b}),q.d(ne,"c",function(){return i}),q.d(ne,"a",function(){return c}),q.d(ne,"i",function(){return o}),q.d(ne,"o",function(){return h}),q.d(ne,"e",function(){return t}),q.d(ne,"d",function(){return r}),q.d(ne,"p",function(){return s}),q.d(ne,"b",function(){return u});function G(d){return Array.isArray(d)}function L(d){return typeof d=="string"}function I(d){return typeof d=="object"&&d!==null&&!Array.isArray(d)&&!(d instanceof RegExp)&&!(d instanceof Date)}function R(d){return typeof d=="number"&&!isNaN(d)}function M(d){return d===!0||d===!1}function p(d){return typeof d=="undefined"}function E(d){return!b(d)}function b(d){return p(d)||d===null}function i(d,f){if(!d)throw new Error(f?`Unexpected type, expected '${f}'`:"Unexpected type")}function c(d){if(b(d))throw new Error("Assertion Failed: argument is undefined or null");return d}function o(d){return typeof d=="function"}function h(d,f){const v=Math.min(d.length,f.length);for(let m=0;m<v;m++)n(d[m],f[m])}function n(d,f){if(L(f)){if(typeof d!==f)throw new Error(`argument does not match constraint: typeof ${f}`)}else if(o(f)){try{if(d instanceof f)return}catch(v){}if(!b(d)&&d.constructor===f)return;if(f.length===1&&f.call(void 0,d)===!0)return;throw new Error("argument does not match one of these constraints: arg instanceof constraint, arg.constructor === constraint, nor constraint(arg) === true")}}function a(d){let f=[],v=Object.getPrototypeOf(d);for(;Object.prototype!==v;)f=f.concat(Object.getOwnPropertyNames(v)),v=Object.getPrototypeOf(v);return f}function t(d){const f=[];for(const v of a(d))typeof d[v]=="function"&&f.push(v);return f}function r(d,f){const v=S=>function(){const C=Array.prototype.slice.call(arguments,0);return f(S,C)};let m={};for(const S of d)m[S]=v(S);return m}function s(d){return d===null?void 0:d}function u(d,f="Unreachable"){throw new Error(f)}},"7Cbv":function(it,ne,q){"use strict";var G=typeof crypto!="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto!="undefined"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),L=new Uint8Array(16);function I(){if(!G)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return G(L)}var R=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function M(n){return typeof n=="string"&&R.test(n)}for(var p=M,E=[],b=0;b<256;++b)E.push((b+256).toString(16).substr(1));function i(n){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,t=(E[n[a+0]]+E[n[a+1]]+E[n[a+2]]+E[n[a+3]]+"-"+E[n[a+4]]+E[n[a+5]]+"-"+E[n[a+6]]+E[n[a+7]]+"-"+E[n[a+8]]+E[n[a+9]]+"-"+E[n[a+10]]+E[n[a+11]]+E[n[a+12]]+E[n[a+13]]+E[n[a+14]]+E[n[a+15]]).toLowerCase();if(!p(t))throw TypeError("Stringified UUID is invalid");return t}var c=i;function o(n,a,t){n=n||{};var r=n.random||(n.rng||I)();if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,a){t=t||0;for(var s=0;s<16;++s)a[t+s]=r[s];return a}return c(r)}var h=ne.a=o},"7ahc":function(it,ne,q){"use strict";q.d(ne,"a",function(){return v});var G=q("k1fw"),L=q("0Owb"),I=q("+L6B"),R=q("2/Rp"),M=q("y8nQ"),p=q("Vl3Y"),E=q("tJVT"),b=q("OaEy"),i=q("2fM7"),c=q("q1tI"),o=q.n(c),h=q("VrN/"),n=q.n(h),a=q("p77/"),t=q.n(a),r=q("c5Ni"),s=q.n(r),u=i.a.Option,d={labelCol:{span:4},wrapperCol:{span:20}},f={asp:["ASP","vbscript"],actionscript:["ActionScript(3.0)/Flash/Flex","clike"],bash:["Bash/Bat","shell"],css:["CSS","css"],c:["C","clike"],cpp:["C++","clike"],csharp:["C#","clike"],coffeescript:["CoffeeScript","coffeescript"],d:["D","d"],dart:["Dart","dart"],delphi:["Delphi/Pascal","pascal"],erlang:["Erlang","erlang"],go:["Golang","go"],groovy:["Groovy","groovy"],html:["HTML","text/html"],java:["Java","clike"],json:["JSON","text/json"],javascript:["Javascript","javascript"],lua:["Lua","lua"],less:["LESS","css"],markdown:["Markdown","gfm"],"objective-c":["Objective-C","clike"],php:["PHP","php"],perl:["Perl","perl"],python:["Python","python"],r:["R","r"],rst:["reStructedText","rst"],ruby:["Ruby","ruby"],sql:["SQL","sql"],sass:["SASS/SCSS","sass"],shell:["Shell","shell"],scala:["Scala","clike"],swift:["Swift","clike"],vb:["VB/VBScript","vb"],xml:["XML","text/xml"],yaml:["YAML","yaml"]};ne.b=function(m){var S=m.callback,C=m.onCancel,_=Object(c.useState)("python"),y=Object(E.a)(_,2),T=y[0],O=y[1];function g(P){O(f[P][1])}function F(P){S(P)}return o.a.createElement(p.a,Object(L.a)({},d,{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:F}),o.a.createElement(p.a.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},o.a.createElement(i.a,{onChange:g},Object.keys(f).map(function(P){return o.a.createElement(u,{key:P,value:P},f[P][0])}))),o.a.createElement(p.a.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},o.a.createElement(v,{mode:T})),o.a.createElement("div",{className:"flex-container flex-end"},o.a.createElement(R.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),o.a.createElement(R.a,{type:"ghost",onClick:C},"\u53D6\u6D88")))};function v(m){var S=m.value,C=m.onChange,_=m.mode,y=m.options,T=y===void 0?{}:y,O=Object(c.useRef)(),g=Object(c.useState)(),F=Object(E.a)(g,2),P=F[0],N=F[1];return Object(c.useEffect)(function(){if(P){function X(j){var A=j.getValue();C&&C(A)}return P.on("change",X),function(){P.off("change",X)}}},[P,C]),Object(c.useEffect)(function(){P&&P.setOption("mode",_)},[P,_]),Object(c.useEffect)(function(){P&&((S!==P.getValue()||S==="")&&setTimeout(function(){P.setValue(S||" ")},300))},[P,S]),Object(c.useEffect)(function(){if(O.current&&!P){var X=n.a.fromTextArea(O.current,Object(G.a)({mode:_,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},T));N(X)}},[O.current,P]),o.a.createElement("div",{className:"my-codemirror-container"},o.a.createElement("textarea",{ref:O}))}},"7ixt":function(it,ne,q){"use strict";q.d(ne,"a",function(){return I});var G={adjustX:1,adjustY:1},L=[0,0],I={left:{points:["cr","cl"],overflow:G,offset:[-4,0],targetOffset:L},right:{points:["cl","cr"],overflow:G,offset:[4,0],targetOffset:L},top:{points:["bc","tc"],overflow:G,offset:[0,-4],targetOffset:L},bottom:{points:["tc","bc"],overflow:G,offset:[0,4],targetOffset:L},topLeft:{points:["bl","tl"],overflow:G,offset:[0,-4],targetOffset:L},leftTop:{points:["tr","tl"],overflow:G,offset:[-4,0],targetOffset:L},topRight:{points:["br","tr"],overflow:G,offset:[0,-4],targetOffset:L},rightTop:{points:["tl","tr"],overflow:G,offset:[4,0],targetOffset:L},bottomRight:{points:["tr","br"],overflow:G,offset:[0,4],targetOffset:L},rightBottom:{points:["bl","br"],overflow:G,offset:[4,0],targetOffset:L},bottomLeft:{points:["tl","bl"],overflow:G,offset:[0,4],targetOffset:L},leftBottom:{points:["br","bl"],overflow:G,offset:[-4,0],targetOffset:L}},R=I},"8+yF":function(it,ne,q){"use strict";Object.defineProperty(ne,"__esModule",{value:!0}),ne.default=void 0;var G={256:960,257:992,258:451,259:483,260:417,261:433,262:454,263:486,264:710,265:742,266:709,267:741,268:456,269:488,270:463,271:495,272:464,273:496,274:938,275:954,278:972,279:1004,280:458,281:490,282:460,283:492,284:728,285:760,286:683,287:699,288:725,289:757,290:939,291:955,292:678,293:694,294:673,295:689,296:933,297:949,298:975,299:1007,302:967,303:999,304:681,305:697,308:684,309:700,310:979,311:1011,312:930,313:453,314:485,315:934,316:950,317:421,318:437,321:419,322:435,323:465,324:497,325:977,326:1009,327:466,328:498,330:957,331:959,332:978,333:1010,336:469,337:501,338:5052,339:5053,340:448,341:480,342:931,343:947,344:472,345:504,346:422,347:438,348:734,349:766,350:426,351:442,352:425,353:441,354:478,355:510,356:427,357:443,358:940,359:956,360:989,361:1021,362:990,363:1022,364:733,365:765,366:473,367:505,368:475,369:507,370:985,371:1017,376:5054,377:428,378:444,379:431,380:447,381:430,382:446,402:2294,466:16777681,711:439,728:418,729:511,731:434,733:445,901:1966,902:1953,904:1954,905:1955,906:1956,908:1959,910:1960,911:1963,912:1974,913:1985,914:1986,915:1987,916:1988,917:1989,918:1990,919:1991,920:1992,921:1993,922:1994,923:1995,924:1996,925:1997,926:1998,927:1999,928:2e3,929:2001,931:2002,932:2004,933:2005,934:2006,935:2007,936:2008,937:2009,938:1957,939:1961,940:1969,941:1970,942:1971,943:1972,944:1978,945:2017,946:2018,947:2019,948:2020,949:2021,950:2022,951:2023,952:2024,953:2025,954:2026,955:2027,956:2028,957:2029,958:2030,959:2031,960:2032,961:2033,962:2035,963:2034,964:2036,965:2037,966:2038,967:2039,968:2040,969:2041,970:1973,971:1977,972:1975,973:1976,974:1979,1025:1715,1026:1713,1027:1714,1028:1716,1029:1717,1030:1718,1031:1719,1032:1720,1033:1721,1034:1722,1035:1723,1036:1724,1038:1726,1039:1727,1040:1761,1041:1762,1042:1783,1043:1767,1044:1764,1045:1765,1046:1782,1047:1786,1048:1769,1049:1770,1050:1771,1051:1772,1052:1773,1053:1774,1054:1775,1055:1776,1056:1778,1057:1779,1058:1780,1059:1781,1060:1766,1061:1768,1062:1763,1063:1790,1064:1787,1065:1789,1066:1791,1067:1785,1068:1784,1069:1788,1070:1760,1071:1777,1072:1729,1073:1730,1074:1751,1075:1735,1076:1732,1077:1733,1078:1750,1079:1754,1080:1737,1081:1738,1082:1739,1083:1740,1084:1741,1085:1742,1086:1743,1087:1744,1088:1746,1089:1747,1090:1748,1091:1749,1092:1734,1093:1736,1094:1731,1095:1758,1096:1755,1097:1757,1098:1759,1099:1753,1100:1752,1101:1756,1102:1728,1103:1745,1105:1699,1106:1697,1107:1698,1108:1700,1109:1701,1110:1702,1111:1703,1112:1704,1113:1705,1114:1706,1115:1707,1116:1708,1118:1710,1119:1711,1168:1725,1169:1709,1488:3296,1489:3297,1490:3298,1491:3299,1492:3300,1493:3301,1494:3302,1495:3303,1496:3304,1497:3305,1498:3306,1499:3307,1500:3308,1501:3309,1502:3310,1503:3311,1504:3312,1505:3313,1506:3314,1507:3315,1508:3316,1509:3317,1510:3318,1511:3319,1512:3320,1513:3321,1514:3322,1548:1452,1563:1467,1567:1471,1569:1473,1570:1474,1571:1475,1572:1476,1573:1477,1574:1478,1575:1479,1576:1480,1577:1481,1578:1482,1579:1483,1580:1484,1581:1485,1582:1486,1583:1487,1584:1488,1585:1489,1586:1490,1587:1491,1588:1492,1589:1493,1590:1494,1591:1495,1592:1496,1593:1497,1594:1498,1600:1504,1601:1505,1602:1506,1603:1507,1604:1508,1605:1509,1606:1510,1607:1511,1608:1512,1609:1513,1610:1514,1611:1515,1612:1516,1613:1517,1614:1518,1615:1519,1616:1520,1617:1521,1618:1522,3585:3489,3586:3490,3587:3491,3588:3492,3589:3493,3590:3494,3591:3495,3592:3496,3593:3497,3594:3498,3595:3499,3596:3500,3597:3501,3598:3502,3599:3503,3600:3504,3601:3505,3602:3506,3603:3507,3604:3508,3605:3509,3606:3510,3607:3511,3608:3512,3609:3513,3610:3514,3611:3515,3612:3516,3613:3517,3614:3518,3615:3519,3616:3520,3617:3521,3618:3522,3619:3523,3620:3524,3621:3525,3622:3526,3623:3527,3624:3528,3625:3529,3626:3530,3627:3531,3628:3532,3629:3533,3630:3534,3631:3535,3632:3536,3633:3537,3634:3538,3635:3539,3636:3540,3637:3541,3638:3542,3639:3543,3640:3544,3641:3545,3642:3546,3647:3551,3648:3552,3649:3553,3650:3554,3651:3555,3652:3556,3653:3557,3654:3558,3655:3559,3656:3560,3657:3561,3658:3562,3659:3563,3660:3564,3661:3565,3664:3568,3665:3569,3666:3570,3667:3571,3668:3572,3669:3573,3670:3574,3671:3575,3672:3576,3673:3577,8194:2722,8195:2721,8196:2723,8197:2724,8199:2725,8200:2726,8201:2727,8202:2728,8210:2747,8211:2730,8212:2729,8213:1967,8215:3295,8216:2768,8217:2769,8218:2813,8220:2770,8221:2771,8222:2814,8224:2801,8225:2802,8226:2790,8229:2735,8230:2734,8240:2773,8242:2774,8243:2775,8248:2812,8254:1150,8361:3839,8364:8364,8453:2744,8470:1712,8471:2811,8478:2772,8482:2761,8531:2736,8532:2737,8533:2738,8534:2739,8535:2740,8536:2741,8537:2742,8538:2743,8539:2755,8540:2756,8541:2757,8542:2758,8592:2299,8593:2300,8594:2301,8595:2302,8658:2254,8660:2253,8706:2287,8711:2245,8728:3018,8730:2262,8733:2241,8734:2242,8743:2270,8744:2271,8745:2268,8746:2269,8747:2239,8756:2240,8764:2248,8771:2249,8773:16785992,8800:2237,8801:2255,8804:2236,8805:2238,8834:2266,8835:2267,8866:3068,8867:3036,8868:3010,8869:3022,8968:3027,8970:3012,8981:2810,8992:2212,8993:2213,9109:3020,9115:2219,9117:2220,9118:2221,9120:2222,9121:2215,9123:2216,9124:2217,9126:2218,9128:2223,9132:2224,9143:2209,9146:2543,9147:2544,9148:2546,9149:2547,9225:2530,9226:2533,9227:2537,9228:2531,9229:2532,9251:2732,9252:2536,9472:2211,9474:2214,9484:2210,9488:2539,9492:2541,9496:2538,9500:2548,9508:2549,9516:2551,9524:2550,9532:2542,9618:2529,9642:2791,9643:2785,9644:2779,9645:2786,9646:2783,9647:2767,9650:2792,9651:2787,9654:2781,9655:2765,9660:2793,9661:2788,9664:2780,9665:2764,9670:2528,9675:2766,9679:2782,9702:2784,9734:2789,9742:2809,9747:2762,9756:2794,9758:2795,9792:2808,9794:2807,9827:2796,9829:2798,9830:2797,9837:2806,9839:2805,10003:2803,10007:2804,10013:2777,10016:2800,10216:2748,10217:2750,12289:1188,12290:1185,12300:1186,12301:1187,12443:1246,12444:1247,12449:1191,12450:1201,12451:1192,12452:1202,12453:1193,12454:1203,12455:1194,12456:1204,12457:1195,12458:1205,12459:1206,12461:1207,12463:1208,12465:1209,12467:1210,12469:1211,12471:1212,12473:1213,12475:1214,12477:1215,12479:1216,12481:1217,12483:1199,12484:1218,12486:1219,12488:1220,12490:1221,12491:1222,12492:1223,12493:1224,12494:1225,12495:1226,12498:1227,12501:1228,12504:1229,12507:1230,12510:1231,12511:1232,12512:1233,12513:1234,12514:1235,12515:1196,12516:1236,12517:1197,12518:1237,12519:1198,12520:1238,12521:1239,12522:1240,12523:1241,12524:1242,12525:1243,12527:1244,12530:1190,12531:1245,12539:1189,12540:1200},L={lookup:function(R){if(R>=32&&R<=255)return R;var M=G[R];return M!==void 0?M:16777216|R}};ne.default=L},"8CQX":function(it,ne,q){"use strict";function G(a){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?G=function(r){return typeof r}:G=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},G(a)}Object.defineProperty(ne,"__esModule",{value:!0}),ne.getKeycode=o,ne.getKey=h,ne.getKeysym=n;var L=c(q("mHUz")),I=c(q("8+yF")),R=c(q("6Qwc")),M=c(q("gIYZ")),p=c(q("mTgk")),E=i(q("GdRQ"));function b(){if(typeof WeakMap!="function")return null;var a=new WeakMap;return b=function(){return a},a}function i(a){if(a&&a.__esModule)return a;if(a===null||G(a)!=="object"&&typeof a!="function")return{default:a};var t=b();if(t&&t.has(a))return t.get(a);var r={},s=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in a)if(Object.prototype.hasOwnProperty.call(a,u)){var d=s?Object.getOwnPropertyDescriptor(a,u):null;d&&(d.get||d.set)?Object.defineProperty(r,u,d):r[u]=a[u]}return r.default=a,t&&t.set(a,r),r}function c(a){return a&&a.__esModule?a:{default:a}}function o(a){if(a.code){switch(a.code){case"OSLeft":return"MetaLeft";case"OSRight":return"MetaRight"}return a.code}if(a.type!=="keypress"&&a.keyCode in R.default){var t=R.default[a.keyCode];if(E.isMac()&&t==="ContextMenu"&&(t="MetaRight"),a.location===2)switch(t){case"ShiftLeft":return"ShiftRight";case"ControlLeft":return"ControlRight";case"AltLeft":return"AltRight"}if(a.location===3)switch(t){case"Delete":return"NumpadDecimal";case"Insert":return"Numpad0";case"End":return"Numpad1";case"ArrowDown":return"Numpad2";case"PageDown":return"Numpad3";case"ArrowLeft":return"Numpad4";case"ArrowRight":return"Numpad6";case"Home":return"Numpad7";case"ArrowUp":return"Numpad8";case"PageUp":return"Numpad9";case"Enter":return"NumpadEnter"}return t}return"Unidentified"}function h(a){if(a.key!==void 0){switch(a.key){case"Spacebar":return" ";case"Esc":return"Escape";case"Scroll":return"ScrollLock";case"Win":return"Meta";case"Apps":return"ContextMenu";case"Up":return"ArrowUp";case"Left":return"ArrowLeft";case"Right":return"ArrowRight";case"Down":return"ArrowDown";case"Del":return"Delete";case"Divide":return"/";case"Multiply":return"*";case"Subtract":return"-";case"Add":return"+";case"Decimal":return a.char}switch(a.key){case"OS":return"Meta";case"LaunchMyComputer":return"LaunchApplication1";case"LaunchCalculator":return"LaunchApplication2"}switch(a.key){case"UIKeyInputUpArrow":return"ArrowUp";case"UIKeyInputDownArrow":return"ArrowDown";case"UIKeyInputLeftArrow":return"ArrowLeft";case"UIKeyInputRightArrow":return"ArrowRight";case"UIKeyInputEscape":return"Escape"}if(a.key==="\0"&&a.code==="NumpadDecimal")return"Delete";if(!E.isIE()&&!E.isEdge())return a.key;if(a.key.length!==1&&a.key!=="Unidentified")return a.key}var t=o(a);return t in M.default?M.default[t]:a.charCode?String.fromCharCode(a.charCode):"Unidentified"}function n(a){var t=h(a);if(t==="Unidentified")return null;if(t in p.default){var r=a.location;if(t==="Meta"&&r===0&&(r=2),t==="Clear"&&r===3){var s=o(a);s==="NumLock"&&(r=0)}if((r===void 0||r>3)&&(r=0),t==="Meta"){var u=o(a);if(u==="AltLeft")return L.default.XK_Meta_L;if(u==="AltRight")return L.default.XK_Meta_R}if(t==="Clear"){var d=o(a);if(d==="NumLock")return L.default.XK_Num_Lock}return p.default[t][r]}if(t.length!==1)return null;var f=t.charCodeAt();return f?I.default.lookup(f):null}},"8EBN":function(it,ne,q){(function(G){G(q("VrN/"))})(function(G){"use strict";G.modeInfo=[{name:"APL",mime:"text/apl",mode:"apl",ext:["dyalog","apl"]},{name:"PGP",mimes:["application/pgp","application/pgp-encrypted","application/pgp-keys","application/pgp-signature"],mode:"asciiarmor",ext:["asc","pgp","sig"]},{name:"ASN.1",mime:"text/x-ttcn-asn",mode:"asn.1",ext:["asn","asn1"]},{name:"Asterisk",mime:"text/x-asterisk",mode:"asterisk",file:/^extensions\.conf$/i},{name:"Brainfuck",mime:"text/x-brainfuck",mode:"brainfuck",ext:["b","bf"]},{name:"C",mime:"text/x-csrc",mode:"clike",ext:["c","h","ino"]},{name:"C++",mime:"text/x-c++src",mode:"clike",ext:["cpp","c++","cc","cxx","hpp","h++","hh","hxx"],alias:["cpp"]},{name:"Cobol",mime:"text/x-cobol",mode:"cobol",ext:["cob","cpy"]},{name:"C#",mime:"text/x-csharp",mode:"clike",ext:["cs"],alias:["csharp","cs"]},{name:"Clojure",mime:"text/x-clojure",mode:"clojure",ext:["clj","cljc","cljx"]},{name:"ClojureScript",mime:"text/x-clojurescript",mode:"clojure",ext:["cljs"]},{name:"Closure Stylesheets (GSS)",mime:"text/x-gss",mode:"css",ext:["gss"]},{name:"CMake",mime:"text/x-cmake",mode:"cmake",ext:["cmake","cmake.in"],file:/^CMakeLists\.txt$/},{name:"CoffeeScript",mimes:["application/vnd.coffeescript","text/coffeescript","text/x-coffeescript"],mode:"coffeescript",ext:["coffee"],alias:["coffee","coffee-script"]},{name:"Common Lisp",mime:"text/x-common-lisp",mode:"commonlisp",ext:["cl","lisp","el"],alias:["lisp"]},{name:"Cypher",mime:"application/x-cypher-query",mode:"cypher",ext:["cyp","cypher"]},{name:"Cython",mime:"text/x-cython",mode:"python",ext:["pyx","pxd","pxi"]},{name:"Crystal",mime:"text/x-crystal",mode:"crystal",ext:["cr"]},{name:"CSS",mime:"text/css",mode:"css",ext:["css"]},{name:"CQL",mime:"text/x-cassandra",mode:"sql",ext:["cql"]},{name:"D",mime:"text/x-d",mode:"d",ext:["d"]},{name:"Dart",mimes:["application/dart","text/x-dart"],mode:"dart",ext:["dart"]},{name:"diff",mime:"text/x-diff",mode:"diff",ext:["diff","patch"]},{name:"Django",mime:"text/x-django",mode:"django"},{name:"Dockerfile",mime:"text/x-dockerfile",mode:"dockerfile",file:/^Dockerfile$/},{name:"DTD",mime:"application/xml-dtd",mode:"dtd",ext:["dtd"]},{name:"Dylan",mime:"text/x-dylan",mode:"dylan",ext:["dylan","dyl","intr"]},{name:"EBNF",mime:"text/x-ebnf",mode:"ebnf"},{name:"ECL",mime:"text/x-ecl",mode:"ecl",ext:["ecl"]},{name:"edn",mime:"application/edn",mode:"clojure",ext:["edn"]},{name:"Eiffel",mime:"text/x-eiffel",mode:"eiffel",ext:["e"]},{name:"Elm",mime:"text/x-elm",mode:"elm",ext:["elm"]},{name:"Embedded Javascript",mime:"application/x-ejs",mode:"htmlembedded",ext:["ejs"]},{name:"Embedded Ruby",mime:"application/x-erb",mode:"htmlembedded",ext:["erb"]},{name:"Erlang",mime:"text/x-erlang",mode:"erlang",ext:["erl"]},{name:"Esper",mime:"text/x-esper",mode:"sql"},{name:"Factor",mime:"text/x-factor",mode:"factor",ext:["factor"]},{name:"FCL",mime:"text/x-fcl",mode:"fcl"},{name:"Forth",mime:"text/x-forth",mode:"forth",ext:["forth","fth","4th"]},{name:"Fortran",mime:"text/x-fortran",mode:"fortran",ext:["f","for","f77","f90","f95"]},{name:"F#",mime:"text/x-fsharp",mode:"mllike",ext:["fs"],alias:["fsharp"]},{name:"Gas",mime:"text/x-gas",mode:"gas",ext:["s"]},{name:"Gherkin",mime:"text/x-feature",mode:"gherkin",ext:["feature"]},{name:"GitHub Flavored Markdown",mime:"text/x-gfm",mode:"gfm",file:/^(readme|contributing|history)\.md$/i},{name:"Go",mime:"text/x-go",mode:"go",ext:["go"]},{name:"Groovy",mime:"text/x-groovy",mode:"groovy",ext:["groovy","gradle"],file:/^Jenkinsfile$/},{name:"HAML",mime:"text/x-haml",mode:"haml",ext:["haml"]},{name:"Haskell",mime:"text/x-haskell",mode:"haskell",ext:["hs"]},{name:"Haskell (Literate)",mime:"text/x-literate-haskell",mode:"haskell-literate",ext:["lhs"]},{name:"Haxe",mime:"text/x-haxe",mode:"haxe",ext:["hx"]},{name:"HXML",mime:"text/x-hxml",mode:"haxe",ext:["hxml"]},{name:"ASP.NET",mime:"application/x-aspx",mode:"htmlembedded",ext:["aspx"],alias:["asp","aspx"]},{name:"HTML",mime:"text/html",mode:"htmlmixed",ext:["html","htm","handlebars","hbs"],alias:["xhtml"]},{name:"HTTP",mime:"message/http",mode:"http"},{name:"IDL",mime:"text/x-idl",mode:"idl",ext:["pro"]},{name:"Pug",mime:"text/x-pug",mode:"pug",ext:["jade","pug"],alias:["jade"]},{name:"Java",mime:"text/x-java",mode:"clike",ext:["java"]},{name:"Java Server Pages",mime:"application/x-jsp",mode:"htmlembedded",ext:["jsp"],alias:["jsp"]},{name:"JavaScript",mimes:["text/javascript","text/ecmascript","application/javascript","application/x-javascript","application/ecmascript"],mode:"javascript",ext:["js"],alias:["ecmascript","js","node"]},{name:"JSON",mimes:["application/json","application/x-json"],mode:"javascript",ext:["json","map"],alias:["json5"]},{name:"JSON-LD",mime:"application/ld+json",mode:"javascript",ext:["jsonld"],alias:["jsonld"]},{name:"JSX",mime:"text/jsx",mode:"jsx",ext:["jsx"]},{name:"Jinja2",mime:"text/jinja2",mode:"jinja2",ext:["j2","jinja","jinja2"]},{name:"Julia",mime:"text/x-julia",mode:"julia",ext:["jl"]},{name:"Kotlin",mime:"text/x-kotlin",mode:"clike",ext:["kt"]},{name:"LESS",mime:"text/x-less",mode:"css",ext:["less"]},{name:"LiveScript",mime:"text/x-livescript",mode:"livescript",ext:["ls"],alias:["ls"]},{name:"Lua",mime:"text/x-lua",mode:"lua",ext:["lua"]},{name:"Markdown",mime:"text/x-markdown",mode:"markdown",ext:["markdown","md","mkd"]},{name:"mIRC",mime:"text/mirc",mode:"mirc"},{name:"MariaDB SQL",mime:"text/x-mariadb",mode:"sql"},{name:"Mathematica",mime:"text/x-mathematica",mode:"mathematica",ext:["m","nb","wl","wls"]},{name:"Modelica",mime:"text/x-modelica",mode:"modelica",ext:["mo"]},{name:"MUMPS",mime:"text/x-mumps",mode:"mumps",ext:["mps"]},{name:"MS SQL",mime:"text/x-mssql",mode:"sql"},{name:"mbox",mime:"application/mbox",mode:"mbox",ext:["mbox"]},{name:"MySQL",mime:"text/x-mysql",mode:"sql"},{name:"Nginx",mime:"text/x-nginx-conf",mode:"nginx",file:/nginx.*\.conf$/i},{name:"NSIS",mime:"text/x-nsis",mode:"nsis",ext:["nsh","nsi"]},{name:"NTriples",mimes:["application/n-triples","application/n-quads","text/n-triples"],mode:"ntriples",ext:["nt","nq"]},{name:"Objective-C",mime:"text/x-objectivec",mode:"clike",ext:["m"],alias:["objective-c","objc"]},{name:"Objective-C++",mime:"text/x-objectivec++",mode:"clike",ext:["mm"],alias:["objective-c++","objc++"]},{name:"OCaml",mime:"text/x-ocaml",mode:"mllike",ext:["ml","mli","mll","mly"]},{name:"Octave",mime:"text/x-octave",mode:"octave",ext:["m"]},{name:"Oz",mime:"text/x-oz",mode:"oz",ext:["oz"]},{name:"Pascal",mime:"text/x-pascal",mode:"pascal",ext:["p","pas"]},{name:"PEG.js",mime:"null",mode:"pegjs",ext:["jsonld"]},{name:"Perl",mime:"text/x-perl",mode:"perl",ext:["pl","pm"]},{name:"PHP",mimes:["text/x-php","application/x-httpd-php","application/x-httpd-php-open"],mode:"php",ext:["php","php3","php4","php5","php7","phtml"]},{name:"Pig",mime:"text/x-pig",mode:"pig",ext:["pig"]},{name:"Plain Text",mime:"text/plain",mode:"null",ext:["txt","text","conf","def","list","log"]},{name:"PLSQL",mime:"text/x-plsql",mode:"sql",ext:["pls"]},{name:"PostgreSQL",mime:"text/x-pgsql",mode:"sql"},{name:"PowerShell",mime:"application/x-powershell",mode:"powershell",ext:["ps1","psd1","psm1"]},{name:"Properties files",mime:"text/x-properties",mode:"properties",ext:["properties","ini","in"],alias:["ini","properties"]},{name:"ProtoBuf",mime:"text/x-protobuf",mode:"protobuf",ext:["proto"]},{name:"Python",mime:"text/x-python",mode:"python",ext:["BUILD","bzl","py","pyw"],file:/^(BUCK|BUILD)$/},{name:"Puppet",mime:"text/x-puppet",mode:"puppet",ext:["pp"]},{name:"Q",mime:"text/x-q",mode:"q",ext:["q"]},{name:"R",mime:"text/x-rsrc",mode:"r",ext:["r","R"],alias:["rscript"]},{name:"reStructuredText",mime:"text/x-rst",mode:"rst",ext:["rst"],alias:["rst"]},{name:"RPM Changes",mime:"text/x-rpm-changes",mode:"rpm"},{name:"RPM Spec",mime:"text/x-rpm-spec",mode:"rpm",ext:["spec"]},{name:"Ruby",mime:"text/x-ruby",mode:"ruby",ext:["rb"],alias:["jruby","macruby","rake","rb","rbx"]},{name:"Rust",mime:"text/x-rustsrc",mode:"rust",ext:["rs"]},{name:"SAS",mime:"text/x-sas",mode:"sas",ext:["sas"]},{name:"Sass",mime:"text/x-sass",mode:"sass",ext:["sass"]},{name:"Scala",mime:"text/x-scala",mode:"clike",ext:["scala"]},{name:"Scheme",mime:"text/x-scheme",mode:"scheme",ext:["scm","ss"]},{name:"SCSS",mime:"text/x-scss",mode:"css",ext:["scss"]},{name:"Shell",mimes:["text/x-sh","application/x-sh"],mode:"shell",ext:["sh","ksh","bash"],alias:["bash","sh","zsh"],file:/^PKGBUILD$/},{name:"Sieve",mime:"application/sieve",mode:"sieve",ext:["siv","sieve"]},{name:"Slim",mimes:["text/x-slim","application/x-slim"],mode:"slim",ext:["slim"]},{name:"Smalltalk",mime:"text/x-stsrc",mode:"smalltalk",ext:["st"]},{name:"Smarty",mime:"text/x-smarty",mode:"smarty",ext:["tpl"]},{name:"Solr",mime:"text/x-solr",mode:"solr"},{name:"SML",mime:"text/x-sml",mode:"mllike",ext:["sml","sig","fun","smackspec"]},{name:"Soy",mime:"text/x-soy",mode:"soy",ext:["soy"],alias:["closure template"]},{name:"SPARQL",mime:"application/sparql-query",mode:"sparql",ext:["rq","sparql"],alias:["sparul"]},{name:"Spreadsheet",mime:"text/x-spreadsheet",mode:"spreadsheet",alias:["excel","formula"]},{name:"SQL",mime:"text/x-sql",mode:"sql",ext:["sql"]},{name:"SQLite",mime:"text/x-sqlite",mode:"sql"},{name:"Squirrel",mime:"text/x-squirrel",mode:"clike",ext:["nut"]},{name:"Stylus",mime:"text/x-styl",mode:"stylus",ext:["styl"]},{name:"Swift",mime:"text/x-swift",mode:"swift",ext:["swift"]},{name:"sTeX",mime:"text/x-stex",mode:"stex"},{name:"LaTeX",mime:"text/x-latex",mode:"stex",ext:["text","ltx","tex"],alias:["tex"]},{name:"SystemVerilog",mime:"text/x-systemverilog",mode:"verilog",ext:["v","sv","svh"]},{name:"Tcl",mime:"text/x-tcl",mode:"tcl",ext:["tcl"]},{name:"Textile",mime:"text/x-textile",mode:"textile",ext:["textile"]},{name:"TiddlyWiki",mime:"text/x-tiddlywiki",mode:"tiddlywiki"},{name:"Tiki wiki",mime:"text/tiki",mode:"tiki"},{name:"TOML",mime:"text/x-toml",mode:"toml",ext:["toml"]},{name:"Tornado",mime:"text/x-tornado",mode:"tornado"},{name:"troff",mime:"text/troff",mode:"troff",ext:["1","2","3","4","5","6","7","8","9"]},{name:"TTCN",mime:"text/x-ttcn",mode:"ttcn",ext:["ttcn","ttcn3","ttcnpp"]},{name:"TTCN_CFG",mime:"text/x-ttcn-cfg",mode:"ttcn-cfg",ext:["cfg"]},{name:"Turtle",mime:"text/turtle",mode:"turtle",ext:["ttl"]},{name:"TypeScript",mime:"application/typescript",mode:"javascript",ext:["ts"],alias:["ts"]},{name:"TypeScript-JSX",mime:"text/typescript-jsx",mode:"jsx",ext:["tsx"],alias:["tsx"]},{name:"Twig",mime:"text/x-twig",mode:"twig"},{name:"Web IDL",mime:"text/x-webidl",mode:"webidl",ext:["webidl"]},{name:"VB.NET",mime:"text/x-vb",mode:"vb",ext:["vb"]},{name:"VBScript",mime:"text/vbscript",mode:"vbscript",ext:["vbs"]},{name:"Velocity",mime:"text/velocity",mode:"velocity",ext:["vtl"]},{name:"Verilog",mime:"text/x-verilog",mode:"verilog",ext:["v"]},{name:"VHDL",mime:"text/x-vhdl",mode:"vhdl",ext:["vhd","vhdl"]},{name:"Vue.js Component",mimes:["script/x-vue","text/x-vue"],mode:"vue",ext:["vue"]},{name:"XML",mimes:["application/xml","text/xml"],mode:"xml",ext:["xml","xsl","xsd","svg"],alias:["rss","wsdl","xsd"]},{name:"XQuery",mime:"application/xquery",mode:"xquery",ext:["xy","xquery"]},{name:"Yacas",mime:"text/x-yacas",mode:"yacas",ext:["ys"]},{name:"YAML",mimes:["text/x-yaml","text/yaml"],mode:"yaml",ext:["yaml","yml"],alias:["yml"]},{name:"Z80",mime:"text/x-z80",mode:"z80",ext:["z80"]},{name:"mscgen",mime:"text/x-mscgen",mode:"mscgen",ext:["mscgen","mscin","msc"]},{name:"xu",mime:"text/x-xu",mode:"mscgen",ext:["xu"]},{name:"msgenny",mime:"text/x-msgenny",mode:"mscgen",ext:["msgenny"]},{name:"WebAssembly",mime:"text/webassembly",mode:"wast",ext:["wat","wast"]}];for(var L=0;L<G.modeInfo.length;L++){var I=G.modeInfo[L];I.mimes&&(I.mime=I.mimes[0])}G.findModeByMIME=function(R){R=R.toLowerCase();for(var M=0;M<G.modeInfo.length;M++){var p=G.modeInfo[M];if(p.mime==R)return p;if(p.mimes){for(var E=0;E<p.mimes.length;E++)if(p.mimes[E]==R)return p}}if(/\+xml$/.test(R))return G.findModeByMIME("application/xml");if(/\+json$/.test(R))return G.findModeByMIME("application/json")},G.findModeByExtension=function(R){R=R.toLowerCase();for(var M=0;M<G.modeInfo.length;M++){var p=G.modeInfo[M];if(p.ext){for(var E=0;E<p.ext.length;E++)if(p.ext[E]==R)return p}}},G.findModeByFileName=function(R){for(var M=0;M<G.modeInfo.length;M++){var p=G.modeInfo[M];if(p.file&&p.file.test(R))return p}var E=R.lastIndexOf("."),b=E>-1&&R.substring(E+1,R.length);if(b)return G.findModeByExtension(b)},G.findModeByName=function(R){R=R.toLowerCase();for(var M=0;M<G.modeInfo.length;M++){var p=G.modeInfo[M];if(p.name.toLowerCase()==R)return p;if(p.alias){for(var E=0;E<p.alias.length;E++)if(p.alias[E].toLowerCase()==R)return p}}}})},"8HAY":function(it,ne,q){"use strict";q.d(ne,"a",function(){return M}),q.d(ne,"b",function(){return p}),q.d(ne,"d",function(){return E}),q.d(ne,"e",function(){return b}),q.d(ne,"c",function(){return i});var G=q("MI8n"),L=q("pmY6"),I=q("3/fG"),R=function(c,o,h,n){function a(t){return t instanceof h?t:new h(function(r){r(t)})}return new(h||(h=Promise))(function(t,r){function s(f){try{d(n.next(f))}catch(v){r(v)}}function u(f){try{d(n.throw(f))}catch(v){r(v)}}function d(f){f.done?t(f.value):a(f.value).then(s,u)}d((n=n.apply(c,o||[])).next())})};class M extends L.a{constructor(c,o="",h="",n=!0,a){super();this._onDidChange=this._register(new G.b),this.onDidChange=this._onDidChange.event,this._enabled=!0,this._id=c,this._label=o,this._cssClass=h,this._enabled=n,this._actionCallback=a}get id(){return this._id}get label(){return this._label}set label(c){this._setLabel(c)}_setLabel(c){this._label!==c&&(this._label=c,this._onDidChange.fire({label:c}))}get tooltip(){return this._tooltip||""}set tooltip(c){this._setTooltip(c)}_setTooltip(c){this._tooltip!==c&&(this._tooltip=c,this._onDidChange.fire({tooltip:c}))}get class(){return this._cssClass}set class(c){this._setClass(c)}_setClass(c){this._cssClass!==c&&(this._cssClass=c,this._onDidChange.fire({class:c}))}get enabled(){return this._enabled}set enabled(c){this._setEnabled(c)}_setEnabled(c){this._enabled!==c&&(this._enabled=c,this._onDidChange.fire({enabled:c}))}get checked(){return this._checked}set checked(c){this._setChecked(c)}_setChecked(c){this._checked!==c&&(this._checked=c,this._onDidChange.fire({checked:c}))}run(c,o){return R(this,void 0,void 0,function*(){this._actionCallback&&(yield this._actionCallback(c))})}}class p extends L.a{constructor(){super(...arguments);this._onBeforeRun=this._register(new G.b),this.onBeforeRun=this._onBeforeRun.event,this._onDidRun=this._register(new G.b),this.onDidRun=this._onDidRun.event}run(c,o){return R(this,void 0,void 0,function*(){if(!c.enabled)return;this._onBeforeRun.fire({action:c});let h;try{yield this.runAction(c,o)}catch(n){h=n}this._onDidRun.fire({action:c,error:h})})}runAction(c,o){return R(this,void 0,void 0,function*(){yield c.run(o)})}}class E extends M{constructor(c){super(E.ID,c,c?"separator text":"separator");this.checked=!1,this.enabled=!1}}E.ID="vs.actions.separator";class b{constructor(c,o,h,n){this.tooltip="",this.enabled=!0,this.checked=!1,this.id=c,this.label=o,this.class=n,this._actions=h}get actions(){return this._actions}dispose(){}run(){return R(this,void 0,void 0,function*(){})}}class i extends M{constructor(){super(i.ID,I.a("submenu.empty","(empty)"),void 0,!1)}}i.ID="vs.actions.empty"},"8K/p":function(it,ne,q){"use strict";function G(o){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?G=function(n){return typeof n}:G=function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},G(o)}Object.defineProperty(ne,"__esModule",{value:!0}),ne.default=void 0;var L=p(q("Lo0S")),I=R(q("ItS6"));function R(o){return o&&o.__esModule?o:{default:o}}function M(){if(typeof WeakMap!="function")return null;var o=new WeakMap;return M=function(){return o},o}function p(o){if(o&&o.__esModule)return o;if(o===null||G(o)!=="object"&&typeof o!="function")return{default:o};var h=M();if(h&&h.has(o))return h.get(o);var n={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var t in o)if(Object.prototype.hasOwnProperty.call(o,t)){var r=a?Object.getOwnPropertyDescriptor(o,t):null;r&&(r.get||r.set)?Object.defineProperty(n,t,r):n[t]=o[t]}return n.default=o,h&&h.set(o,n),n}function E(o,h){if(!(o instanceof h))throw new TypeError("Cannot call a class as a function")}function b(o,h){for(var n=0;n<h.length;n++){var a=h[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(o,a.key,a)}}function i(o,h,n){return h&&b(o.prototype,h),n&&b(o,n),o}var c=function(){function o(){E(this,o),this._ctl=null,this._filter=null,this._numColors=0,this._palette=new Uint8Array(1024),this._len=0,this._zlibs=[];for(var h=0;h<4;h++)this._zlibs[h]=new I.default}return i(o,[{key:"decodeRect",value:function(n,a,t,r,s,u,d){if(this._ctl===null){if(s.rQwait("TIGHT compression-control",1))return!1;this._ctl=s.rQshift8();for(var f=0;f<4;f++)this._ctl>>f&1&&(this._zlibs[f].reset(),L.Info("Reset zlib stream "+f));this._ctl=this._ctl>>4}var v;if(this._ctl===8)v=this._fillRect(n,a,t,r,s,u,d);else if(this._ctl===9)v=this._jpegRect(n,a,t,r,s,u,d);else if(this._ctl===10)v=this._pngRect(n,a,t,r,s,u,d);else if((this._ctl&128)==0)v=this._basicRect(this._ctl,n,a,t,r,s,u,d);else throw new Error("Illegal tight compression received (ctl: "+this._ctl+")");return v&&(this._ctl=null),v}},{key:"_fillRect",value:function(n,a,t,r,s,u,d){if(s.rQwait("TIGHT",3))return!1;var f=s.rQi,v=s.rQ;return u.fillRect(n,a,t,r,[v[f+2],v[f+1],v[f]],!1),s.rQskipBytes(3),!0}},{key:"_jpegRect",value:function(n,a,t,r,s,u,d){var f=this._readData(s);return f===null?!1:(u.imageRect(n,a,t,r,"image/jpeg",f),!0)}},{key:"_pngRect",value:function(n,a,t,r,s,u,d){throw new Error("PNG received in standard Tight rect")}},{key:"_basicRect",value:function(n,a,t,r,s,u,d,f){if(this._filter===null)if(n&4){if(u.rQwait("TIGHT",1))return!1;this._filter=u.rQshift8()}else this._filter=0;var v=n&3,m;switch(this._filter){case 0:m=this._copyFilter(v,a,t,r,s,u,d,f);break;case 1:m=this._paletteFilter(v,a,t,r,s,u,d,f);break;case 2:m=this._gradientFilter(v,a,t,r,s,u,d,f);break;default:throw new Error("Illegal tight filter received (ctl: "+this._filter+")")}return m&&(this._filter=null),m}},{key:"_copyFilter",value:function(n,a,t,r,s,u,d,f){var v=r*s*3,m;if(v<12){if(u.rQwait("TIGHT",v))return!1;m=u.rQshiftBytes(v)}else{if(m=this._readData(u),m===null)return!1;this._zlibs[n].setInput(m),m=this._zlibs[n].inflate(v),this._zlibs[n].setInput(null)}return d.blitRgbImage(a,t,r,s,m,0,!1),!0}},{key:"_paletteFilter",value:function(n,a,t,r,s,u,d,f){if(this._numColors===0){if(u.rQwait("TIGHT palette",1))return!1;var v=u.rQpeek8()+1,m=v*3;if(u.rQwait("TIGHT palette",1+m))return!1;this._numColors=v,u.rQskipBytes(1),u.rQshiftTo(this._palette,m)}var S=this._numColors<=2?1:8,C=Math.floor((r*S+7)/8),_=C*s,y;if(_<12){if(u.rQwait("TIGHT",_))return!1;y=u.rQshiftBytes(_)}else{if(y=this._readData(u),y===null)return!1;this._zlibs[n].setInput(y),y=this._zlibs[n].inflate(_),this._zlibs[n].setInput(null)}return this._numColors==2?this._monoRect(a,t,r,s,y,this._palette,d):this._paletteRect(a,t,r,s,y,this._palette,d),this._numColors=0,!0}},{key:"_monoRect",value:function(n,a,t,r,s,u,d){for(var f=this._getScratchBuffer(t*r*4),v=Math.floor((t+7)/8),m=Math.floor(t/8),S=0;S<r;S++){var C=void 0,_=void 0,y=void 0;for(y=0;y<m;y++)for(var T=7;T>=0;T--)C=(S*t+y*8+7-T)*4,_=(s[S*v+y]>>T&1)*3,f[C]=u[_],f[C+1]=u[_+1],f[C+2]=u[_+2],f[C+3]=255;for(var O=7;O>=8-t%8;O--)C=(S*t+y*8+7-O)*4,_=(s[S*v+y]>>O&1)*3,f[C]=u[_],f[C+1]=u[_+1],f[C+2]=u[_+2],f[C+3]=255}d.blitRgbxImage(n,a,t,r,f,0,!1)}},{key:"_paletteRect",value:function(n,a,t,r,s,u,d){for(var f=this._getScratchBuffer(t*r*4),v=t*r*4,m=0,S=0;m<v;m+=4,S++){var C=s[S]*3;f[m]=u[C],f[m+1]=u[C+1],f[m+2]=u[C+2],f[m+3]=255}d.blitRgbxImage(n,a,t,r,f,0,!1)}},{key:"_gradientFilter",value:function(n,a,t,r,s,u,d,f){throw new Error("Gradient filter not implemented")}},{key:"_readData",value:function(n){if(this._len===0){if(n.rQwait("TIGHT",3))return null;var a;a=n.rQshift8(),this._len=a&127,a&128&&(a=n.rQshift8(),this._len|=(a&127)<<7,a&128&&(a=n.rQshift8(),this._len|=a<<14))}if(n.rQwait("TIGHT",this._len))return null;var t=n.rQshiftBytes(this._len);return this._len=0,t}},{key:"_getScratchBuffer",value:function(n){return(!this._scratchBuffer||this._scratchBuffer.length<n)&&(this._scratchBuffer=new Uint8Array(n)),this._scratchBuffer}}]),o}();ne.default=c},"8hTe":function(it,ne,q){it.exports={button:"button___1wy9m"}},"9Bee":function(it,ne,q){"use strict";var G=q("DYRE"),L=q("zeV3"),I=q("+L6B"),R=q("2/Rp"),M=q("k1fw"),p=q("9og8"),E=q("tJVT"),b=q("WmNS"),i=q.n(b),c=q("q1tI"),o=q.n(c),h=q("vg9a"),n=q("DlQD"),a=q.n(n),t=q("rUJ1");function r(J,B){var H=J.match(/^(\s+)(?:```)/);if(H===null)return B;var Y=H[1];return B.split(`
|
|
|
`).map(function(le){var $=le.match(/^\s+/);if($===null)return le;var Be=Object(E.a)($,1),nt=Be[0];return nt.length>=Y.length?le.slice(Y.length):le}).join(`
|
|
|
`)}var s=[],u=["<ul>"],d=new a.a.Renderer,f=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function v(){s.length=0,u=["<ul>"]}var m={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function S(J,B,H,Y){if(B>=J.length||J[B].level<=H)return B;var le=J[B];Y.push("<li><a href='#"+le.anchor+"'>"+le.text+"</a>"),B++;var $=[];return B=S(J,B,le.level,$),$.length>0&&(Y.push("<ul>"),$.forEach(function(Be){Y.push(Be)}),Y.push("</ul>")),Y.push("</li>"),B=S(J,B,H,Y),B}function C(){return S(s,0,0,u),u.push("</ul>"),u.join("")}var _={heading:function(B){var H=f.exec(B);if(H)return{type:"heading",raw:H[0],depth:H[1].length,text:H[2]}},fences:function(B){var H=this.rules.block.fences.exec(B);if(H){var Y=H[0],le=r(Y,H[3]||""),$=H[2]?H[2].trim():H[2];if(["latex","katex","math"].indexOf($)>=0){var Be=O(),nt=le;le=Be,g[Be]={type:"block",expression:nt}}return{type:"code",raw:Y,lang:$,text:le}}}},y=/(?:\${2})([^\n`]+?)(?:\${2})/gi,T=0,O=function(){return"__special_katext_id_".concat(T++,"__")},g={};function F(){return g}function P(){T=0,g={}}function N(J){return J=J.replace(y,function(B,H){var Y=O();return g[Y]={type:"inline",expression:H},Y}),J}var X=d.listitem;d.listitem=function(J){return X(N(J))};var j=d.paragraph;d.paragraph=function(J){return j(N(J))};var A=d.tablecell;d.tablecell=function(J,B){return A(N(J),B)},d.code=function(J,B,H){var Y=(B||"").match(/\S*/)[0];return Y?["latex","katex","math"].indexOf(Y)>=0?"<p class='editormd-tex'>".concat(J,"</p>"):'<pre class="prettyprint linenums"><code class="language-'.concat(B,'">').concat(H?J:Object(t.escape)(J,!0),`</code></pre>
|
|
|
`):'<pre class="prettyprint linenums"><code>'+(H?J:Object(t.escape)(J,!0))+"</code></pre>"},d.heading=function(J,B,H){var Y=this.options.headerPrefix+H.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return s.push({anchor:Y,level:B,text:J}),"<h"+B+' id="'+Y+'">'+J+"</h"+B+">"},a.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),a.a.use({tokenizer:_,renderer:d});var K=a.a,U=q("SJMd"),k=q("ulZh"),z=q.n(k),te=q("m3rI"),de=q("Oy/b"),be=q("p5ED"),We=q("ErOA");/*! *****************************************************************************
|
|
|
Copyright (c) Microsoft Corporation.
|
|
|
|
|
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
|
purpose with or without fee is hereby granted.
|
|
|
|
|
|
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
|
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
|
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
|
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
|
PERFORMANCE OF THIS SOFTWARE.
|
|
|
***************************************************************************** */var Ne=function(J,B){return(Ne=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(H,Y){H.__proto__=Y}||function(H,Y){for(var le in Y)Object.prototype.hasOwnProperty.call(Y,le)&&(H[le]=Y[le])})(J,B)};function Le(J,B){function H(){this.constructor=J}Ne(J,B),J.prototype=B===null?Object.create(B):(H.prototype=B.prototype,new H)}function Ke(J,B,H,Y){return new(H||(H=Promise))(function(le,$){function Be(wt){try{mt(Y.next(wt))}catch(st){$(st)}}function nt(wt){try{mt(Y.throw(wt))}catch(st){$(st)}}function mt(wt){var st;wt.done?le(wt.value):(st=wt.value,st instanceof H?st:new H(function(Rt){Rt(st)})).then(Be,nt)}mt((Y=Y.apply(J,B||[])).next())})}function He(J,B){var H,Y,le,$,Be={label:0,sent:function(){if(1&le[0])throw le[1];return le[1]},trys:[],ops:[]};return $={next:nt(0),throw:nt(1),return:nt(2)},typeof Symbol=="function"&&($[Symbol.iterator]=function(){return this}),$;function nt(mt){return function(wt){return function(st){if(H)throw new TypeError("Generator is already executing.");for(;Be;)try{if(H=1,Y&&(le=2&st[0]?Y.return:st[0]?Y.throw||((le=Y.return)&&le.call(Y),0):Y.next)&&!(le=le.call(Y,st[1])).done)return le;switch(Y=0,le&&(st=[2&st[0],le.value]),st[0]){case 0:case 1:le=st;break;case 4:return Be.label++,{value:st[1],done:!1};case 5:Be.label++,Y=st[1],st=[0];continue;case 7:st=Be.ops.pop(),Be.trys.pop();continue;default:if(!(le=Be.trys,(le=le.length>0&&le[le.length-1])||st[0]!==6&&st[0]!==2)){Be=0;continue}if(st[0]===3&&(!le||st[1]>le[0]&&st[1]<le[3])){Be.label=st[1];break}if(st[0]===6&&Be.label<le[1]){Be.label=le[1],le=st;break}if(le&&Be.label<le[2]){Be.label=le[2],Be.ops.push(st);break}le[2]&&Be.ops.pop(),Be.trys.pop();continue}st=B.call(J,Be)}catch(Rt){st=[6,Rt],Y=0}finally{H=le=0}if(5&st[0])throw st[1];return{value:st[0]?st[1]:void 0,done:!0}}([mt,wt])}}}function Ae(){for(var J=0,B=0,H=arguments.length;B<H;B++)J+=arguments[B].length;var Y=Array(J),le=0;for(B=0;B<H;B++)for(var $=arguments[B],Be=0,nt=$.length;Be<nt;Be++,le++)Y[le]=$[Be];return Y}var Se=function(){function J(){}return J.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},J.setAttributes=function(B,H){for(var Y=0,le=H;Y<le.length;Y++){var $=le[Y],Be=$[0],nt=$[1];B.setAttribute(Be,nt)}},J.createRect=function(B,H,Y){var le=document.createElementNS("http://www.w3.org/2000/svg","rect");return le.setAttribute("width",B.toString()),le.setAttribute("height",H.toString()),Y&&J.setAttributes(le,Y),le},J.createLine=function(B,H,Y,le,$){var Be=document.createElementNS("http://www.w3.org/2000/svg","line");return Be.setAttribute("x1",B.toString()),Be.setAttribute("y1",H.toString()),Be.setAttribute("x2",Y.toString()),Be.setAttribute("y2",le.toString()),$&&J.setAttributes(Be,$),Be},J.createPolygon=function(B,H){var Y=document.createElementNS("http://www.w3.org/2000/svg","polygon");return Y.setAttribute("points",B),H&&J.setAttributes(Y,H),Y},J.createCircle=function(B,H){var Y=document.createElementNS("http://www.w3.org/2000/svg","circle");return Y.setAttribute("cx",(B/2).toString()),Y.setAttribute("cy",(B/2).toString()),Y.setAttribute("r",B.toString()),H&&J.setAttributes(Y,H),Y},J.createEllipse=function(B,H,Y){var le=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return le.setAttribute("cx",(B/2).toString()),le.setAttribute("cy",(H/2).toString()),le.setAttribute("rx",(B/2).toString()),le.setAttribute("ry",(H/2).toString()),Y&&J.setAttributes(le,Y),le},J.createGroup=function(B){var H=document.createElementNS("http://www.w3.org/2000/svg","g");return B&&J.setAttributes(H,B),H},J.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},J.createMarker=function(B,H,Y,le,$,Be,nt){var mt=document.createElementNS("http://www.w3.org/2000/svg","marker");return J.setAttributes(mt,[["id",B],["orient",H],["markerWidth",Y.toString()],["markerHeight",le.toString()],["refX",$.toString()],["refY",Be.toString()]]),mt.appendChild(nt),mt},J.createText=function(B){var H=document.createElementNS("http://www.w3.org/2000/svg","text");return H.setAttribute("x","0"),H.setAttribute("y","0"),B&&J.setAttributes(H,B),H},J.createTSpan=function(B,H){var Y=document.createElementNS("http://www.w3.org/2000/svg","tspan");return Y.textContent=B,H&&J.setAttributes(Y,H),Y},J.createImage=function(B){var H=document.createElementNS("http://www.w3.org/2000/svg","image");return B&&J.setAttributes(H,B),H},J.createPoint=function(B,H){var Y=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return Y.x=B,Y.y=H,Y},J.createPath=function(B,H){var Y=document.createElementNS("http://www.w3.org/2000/svg","path");return Y.setAttribute("d",B),H&&J.setAttributes(Y,H),Y},J}(),he=function(){function J(){}return J.addKey=function(B){J.key=B},Object.defineProperty(J,"isLicensed",{get:function(){return!!J.key&&new RegExp(/^MJS2-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(J.key)},enumerable:!1,configurable:!0}),J}(),Ie=function(){function J(){this.naturalSize=!1,this.imageType="image/png",this.markersOnly=!1}return J.prototype.rasterize=function(B,H,Y){var le=this;return new Promise(function($){var Be=Y!==void 0?Y:document.createElement("canvas");B===null&&(le.markersOnly=!0,le.naturalSize=!1);var nt=document.createElementNS("http://www.w3.org/2000/svg","svg");nt.setAttribute("xmlns","http://www.w3.org/2000/svg"),nt.setAttribute("width",H.width.baseVal.valueAsString),nt.setAttribute("height",H.height.baseVal.valueAsString),nt.setAttribute("viewBox","0 0 "+H.viewBox.baseVal.width.toString()+" "+H.viewBox.baseVal.height.toString()),nt.innerHTML=H.innerHTML,le.naturalSize===!0?(nt.width.baseVal.value=B.naturalWidth,nt.height.baseVal.value=B.naturalHeight):le.width!==void 0&&le.height!==void 0&&(nt.width.baseVal.value=le.width,nt.height.baseVal.value=le.height),Be.width=nt.width.baseVal.value,Be.height=nt.height.baseVal.value;var mt=nt.outerHTML,wt=Be.getContext("2d");le.markersOnly!==!0&&wt.drawImage(B,0,0,Be.width,Be.height);var st=window.URL,Rt=new Image(Be.width,Be.height);Rt.setAttribute("crossOrigin","anonymous");var Vt=new Blob([mt],{type:"image/svg+xml"}),ri=st.createObjectURL(Vt);Rt.onload=function(){wt.drawImage(Rt,0,0),st.revokeObjectURL(ri);var Hi=Be.toDataURL(le.imageType,le.imageQuality);$(Hi)},Rt.src=ri})},J}(),ye=function(){},Ge=function(){function J(B){this._classNamePrefixBase="__markerjs2_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+B+"_"}return Object.defineProperty(J.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"defaultSettings",{get:function(){return{canvasBackgroundColor:"#ffffff",toolbarBackgroundColor:"#111111",toolbarBackgroundHoverColor:"#333333",toolbarColor:"#eeeeee",toolbarHeight:40,toolboxColor:"#eeeeee",toolboxAccentColor:"#3080c3",undoButtonVisible:!0,redoButtonVisible:!1,zoomButtonVisible:!1,zoomOutButtonVisible:!1,clearButtonVisible:!1,resultButtonBlockVisible:!0,logoPosition:"left"}},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"fade_out"},enumerable:!1,configurable:!0}),J.prototype.addClass=function(B){return this.styleSheet===void 0&&this.addStyleSheet(),B.name=""+this.classNamePrefix+B.localName,this.classes.push(B),this.styleSheet.sheet.insertRule("."+B.name+" {"+B.style+"}",this.styleSheet.sheet.cssRules.length),B},J.prototype.addRule=function(B){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(B),this.styleSheet.sheet.insertRule(B.selector+" {"+B.style+"}",this.styleSheet.sheet.cssRules.length)},J.prototype.addStyleSheet=function(){var B;this.styleSheet=document.createElement("style"),((B=this.styleSheetRoot)!==null&&B!==void 0?B:document.head).appendChild(this.styleSheet),this.addRule(new $e("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new $e("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
|
|
|
from {
|
|
|
opacity: 0;
|
|
|
}
|
|
|
to {
|
|
|
opacity: 1;
|
|
|
}
|
|
|
`)),this.addRule(new $e("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
|
|
|
from {
|
|
|
opacity: 1;
|
|
|
}
|
|
|
to {
|
|
|
opacity: 0;
|
|
|
}
|
|
|
`)),this.addClass(new ze("fade_in",`
|
|
|
animation-duration: 0.3s;
|
|
|
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
|
|
|
`)),this.addClass(new ze("fade_out",`
|
|
|
animation-duration: 0.3s;
|
|
|
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
|
|
|
`))},J.prototype.removeStyleSheet=function(){var B;this.styleSheet&&(((B=this.styleSheetRoot)!==null&&B!==void 0?B:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},J}(),$e=function(J,B){this.selector=J,this.style=B},ze=function(J,B){this.localName=J,this.style=B},Je=function(){function J(B,H,Y,le,$){this.buttons=[],this.markerButtons=[],this.buttonClickListeners=[],this.markerjsContainer=B,this.displayMode=H,this.markerItems=Y,this.uiStyleSettings=le,this.styles=$,this.addStyles(),this.adjustLayout=this.adjustLayout.bind(this),this.overflowButtonClicked=this.overflowButtonClicked.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this)}return J.prototype.show=function(B){var H=this;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=B,this.uiContainer.className=this.toolbarStyleClass.name+" "+this.styles.fadeInAnimationClassName+" "+(this.uiStyleSettings.toolbarStyleColorsClassName?this.uiStyleSettings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name);var Y=document.createElement("div");Y.className=this.toolbarBlockStyleClass.name,Y.style.whiteSpace="nowrap",this.uiContainer.appendChild(Y),this.addActionButton(Y,'<svg viewBox="0 0 24 24"><path d="M10.07 14.27a.997.997 0 011.33.48l2.3 4.99 1.8-.85-2.31-4.98c-.24-.5-.02-1.1.48-1.33l.28-.08 2.3-.45L8 5.12V15.9l1.82-1.47.25-.16m3.57 7.7a.99.99 0 01-1.33-.47l-2.18-4.74-2.51 2.02c-.17.14-.38.22-.62.22a1 1 0 01-1-1V3a1 1 0 011-1c.24 0 .47.09.64.23l.01-.01 11.49 9.64a1.001 1.001 0 01-.44 1.75l-3.16.62 2.2 4.73c.26.5.02 1.09-.48 1.32l-3.62 1.69z"/></svg>',"select"),this.addActionButton(Y,'<svg viewBox="0 0 24 24"><path d="M9 3v1H4v2h1v13a2 2 0 002 2h10a2 2 0 002-2V6h1V4h-5V3H9M7 6h10v13H7V6m2 2v9h2V8H9m4 0v9h2V8h-2z"/></svg>',"delete"),this.uiStyleSettings.clearButtonVisible&&this.addActionButton(Y,'<svg viewBox="0 0 24 24"><path d="M19.36 2.72l1.42 1.42-5.72 5.71c1.07 1.54 1.22 3.39.32 4.59L9.06 8.12c1.2-.9 3.05-.75 4.59.32l5.71-5.72M5.93 17.57c-2.01-2.01-3.24-4.41-3.58-6.65l4.88-2.09 7.44 7.44-2.09 4.88c-2.24-.34-4.64-1.57-6.65-3.58z"/></svg>',"clear"),this.uiStyleSettings.undoButtonVisible&&this.addActionButton(Y,'<svg viewBox="0 0 24 24"><path d="M12.5 8c-2.65 0-5.05 1-6.9 2.6L2 7v9h9l-3.62-3.62c1.39-1.16 3.16-1.88 5.12-1.88 3.54 0 6.55 2.31 7.6 5.5l2.37-.78C21.08 11.03 17.15 8 12.5 8z"/></svg>',"undo"),this.uiStyleSettings.redoButtonVisible&&this.addActionButton(Y,'<svg viewBox="0 0 24 24"><path d="M18.4 10.6C16.55 9 14.15 8 11.5 8c-4.65 0-8.58 3.03-9.96 7.22L3.9 16a8.002 8.002 0 017.6-5.5c1.95 0 3.73.72 5.12 1.88L13 16h9V7l-3.6 3.6z"/></svg>',"redo"),this.uiStyleSettings.zoomButtonVisible&&this.addActionButton(Y,'<svg viewBox="0 0 24 24"><path d="M15.5 14l5 5-1.5 1.5-5-5v-.79l-.27-.28A6.471 6.471 0 019.5 16 6.5 6.5 0 013 9.5 6.5 6.5 0 019.5 3 6.5 6.5 0 0116 9.5c0 1.61-.59 3.09-1.57 4.23l.28.27h.79m-6 0C12 14 14 12 14 9.5S12 5 9.5 5 5 7 5 9.5 7 14 9.5 14m2.5-4h-2v2H9v-2H7V9h2V7h1v2h2v1z"/></svg>',"zoom"),this.uiStyleSettings.zoomButtonVisible&&this.uiStyleSettings.zoomOutButtonVisible&&this.addActionButton(Y,'<svg viewBox="0 0 24 24"><path d="M15.5 14h-.79l-.28-.27A6.471 6.471 0 0016 9.5 6.5 6.5 0 009.5 3 6.5 6.5 0 003 9.5 6.5 6.5 0 009.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 5 1.5-1.5-5-5m-6 0C7 14 5 12 5 9.5S7 5 9.5 5 14 7 14 9.5 12 14 9.5 14M7 9h5v1H7V9z"/></svg>',"zoom-out"),this.uiStyleSettings.notesButtonVisible&&this.addActionButton(Y,'<svg viewBox="0 0 24 24"><path d="M18.13 12l1.26-1.26c.44-.44 1-.68 1.61-.74V9l-6-6H5c-1.11 0-2 .89-2 2v14a2 2 0 002 2h6v-1.87l.13-.13H5V5h7v7h6.13M14 4.5l5.5 5.5H14V4.5m5.13 9.33l2.04 2.04L15.04 22H13v-2.04l6.13-6.13m3.72.36l-.98.98-2.04-2.04.98-.98c.19-.2.52-.2.72 0l1.32 1.32c.2.2.2.53 0 .72z"/></svg>',"notes"),this.markerButtonBlock=document.createElement("div"),this.markerButtonBlock.className=this.toolbarBlockStyleClass.name,this.markerButtonBlock.style.flexGrow="2",this.markerButtonBlock.style.textAlign="center",this.uiContainer.appendChild(this.markerButtonBlock),this.markerButtonOverflowBlock=document.createElement("div"),this.markerButtonOverflowBlock.className=this.toolbarOverflowBlockStyleClass.name+" "+(this.uiStyleSettings.toolbarOverflowBlockStyleColorsClassName?this.uiStyleSettings.toolbarOverflowBlockStyleColorsClassName:this.toolbarOverflowBlockStyleColorsClass.name),this.markerButtonOverflowBlock.style.display="none",this.uiContainer.appendChild(this.markerButtonOverflowBlock),this.markerItems&&(this.markerItems.forEach(function($){var Be=document.createElement("div");Be.className=""+H.toolbarButtonStyleClass.name,Be.setAttribute("data-type-name",$.typeName),Be.innerHTML=$.icon,Be.addEventListener("click",function(){H.markerToolbarButtonClicked(Be,$)}),H.buttons.push(Be),H.markerButtons.push(Be)}),this.overflowButton=document.createElement("div"),this.overflowButton.className=this.toolbarButtonStyleClass.name+" "+(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name),this.overflowButton.innerHTML='<svg viewBox="0 0 24 24"><path d="M12 16a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2m0-6a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2m0-6a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2z"/></svg>',this.overflowButton.addEventListener("click",this.overflowButtonClicked),this.markerButtonBlock.appendChild(this.overflowButton));var le=document.createElement("div");le.className=this.toolbarBlockStyleClass.name,le.style.whiteSpace="nowrap",le.style.display=this.uiStyleSettings.resultButtonBlockVisible!==!1?"":"none",this.uiContainer.appendChild(le),this.addActionButton(le,'<svg viewBox="0 0 24 24"><path d="M9 20.42l-6.21-6.21 2.83-2.83L9 14.77l9.88-9.89 2.83 2.83L9 20.42z"/></svg>',"render"),this.addActionButton(le,'<svg viewBox="0 0 24 24"><path d="M20 6.91L17.09 4 12 9.09 6.91 4 4 6.91 9.09 12 4 17.09 6.91 20 12 14.91 17.09 20 20 17.09 14.91 12 20 6.91z"/></svg>',"close"),this.markerjsContainer.appendChild(this.uiContainer),this.setSelectMode(),this.setCurrentMarker(),this.adjustLayout()},J.prototype.addButtonClickListener=function(B){this.buttonClickListeners.push(B)},J.prototype.removeButtonClickListener=function(B){this.buttonClickListeners.indexOf(B)>-1&&this.buttonClickListeners.splice(this.buttonClickListeners.indexOf(B),1)},J.prototype.setSelectMode=function(){this.resetButtonStyles(),this.setActiveButton(this.buttons[0])},J.prototype.adjustLayout=function(){if(this.markerButtons&&this.markerButtons.length>0){var B=Math.floor(this.markerButtonBlock.clientWidth/this.uiStyleSettings.toolbarHeight)-1;this.markerButtonBlock.innerHTML="",this.markerButtonOverflowBlock.innerHTML="";for(var H=0;H<this.markerButtons.length;H++)H<B||H===B&&this.markerButtons.length-1===B?this.markerButtonBlock.appendChild(this.markerButtons[H]):(H===B&&this.markerButtonBlock.appendChild(this.overflowButton),this.markerButtonOverflowBlock.appendChild(this.markerButtons[H]))}},J.prototype.overflowButtonClicked=function(){this.markerButtonOverflowBlock.style.display!=="none"?(this.markerButtonOverflowBlock.className=this.markerButtonOverflowBlock.className.replace(this.styles.fadeInAnimationClassName,""),this.markerButtonOverflowBlock.style.display="none"):(this.markerButtonOverflowBlock.className+=" "+this.styles.fadeInAnimationClassName,this.markerButtonOverflowBlock.style.top=this.uiContainer.offsetTop+this.overflowButton.offsetHeight+"px",this.markerButtonOverflowBlock.style.right=this.uiContainer.offsetWidth-this.overflowButton.offsetLeft-this.overflowButton.offsetWidth+2*this.uiContainer.offsetLeft+"px",this.markerButtonOverflowBlock.style.display="inline-block")},J.prototype.resetButtonStyles=function(){var B=this;this.buttons.forEach(function(H){H.className=H.className.replace(B.uiStyleSettings.toolbarButtonStyleColorsClassName?B.uiStyleSettings.toolbarButtonStyleColorsClassName:B.toolbarButtonStyleColorsClass.name,"").trim(),H.className=H.className.replace(B.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?B.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:B.toolbarActiveButtonStyleColorsClass.name,"").trim(),H.className+=" "+(B.uiStyleSettings.toolbarButtonStyleColorsClassName?B.uiStyleSettings.toolbarButtonStyleColorsClassName:B.toolbarButtonStyleColorsClass.name)})},J.prototype.addActionButton=function(B,H,Y){var le=this,$=document.createElement("div");switch($.className=""+this.toolbarButtonStyleClass.name,$.innerHTML=H,$.setAttribute("data-action",Y),$.addEventListener("click",function(){le.actionToolbarButtonClicked($,Y)}),Y){case"select":$.style.fill=this.uiStyleSettings.selectButtonColor;break;case"delete":case"clear":$.style.fill=this.uiStyleSettings.deleteButtonColor;break;case"undo":case"redo":$.style.fill=this.uiStyleSettings.selectButtonColor;break;case"render":$.style.fill=this.uiStyleSettings.okButtonColor;break;case"close":$.style.fill=this.uiStyleSettings.closeButtonColor}B.appendChild($),this.buttons.push($)},J.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new ze("toolbar",`
|
|
|
width: 100%;
|
|
|
flex-shrink: 0;
|
|
|
display: flex;
|
|
|
flex-direction: row;
|
|
|
justify-content: space-between;
|
|
|
height: `+this.uiStyleSettings.toolbarHeight+`px;
|
|
|
box-sizing: content-box;
|
|
|
`+(this.displayMode==="inline"?"border-top-left-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
|
|
|
`+(this.displayMode==="inline"?"border-top-right-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
|
|
|
overflow: hidden;
|
|
|
`)),this.toolbarStyleColorsClass=this.styles.addClass(new ze("toolbar_colors",`
|
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
|
box-shadow: 0px 3px rgba(33, 33, 33, 0.1);
|
|
|
`)),this.toolbarBlockStyleClass=this.styles.addClass(new ze("toolbar-block",`
|
|
|
display: inline-block;
|
|
|
box-sizing: content-box;
|
|
|
`)),this.toolbarOverflowBlockStyleClass=this.styles.addClass(new ze("toolbar-overflow-block",`
|
|
|
position: absolute;
|
|
|
top: `+this.uiStyleSettings.toolbarHeight+`px;
|
|
|
max-width: `+2*this.uiStyleSettings.toolbarHeight+`px;
|
|
|
z-index: 10;
|
|
|
box-sizing: content-box;
|
|
|
`)),this.toolbarOverflowBlockStyleColorsClass=this.styles.addClass(new ze("toolbar-overflow-block_colors",`
|
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
|
`));var B=this.uiStyleSettings.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new ze("toolbar_button",`
|
|
|
display: inline-block;
|
|
|
width: `+(this.uiStyleSettings.toolbarHeight-2*B)+`px;
|
|
|
height: `+(this.uiStyleSettings.toolbarHeight-2*B)+`px;
|
|
|
padding: `+B+`px;
|
|
|
box-sizing: content-box;
|
|
|
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new ze("toolbar_button_colors",`
|
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
|
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new ze("toolbar_active_button",`
|
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
|
`)),this.styles.addRule(new $e("."+this.toolbarButtonStyleClass.name+" svg",`
|
|
|
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
|
|
|
`)),this.styles.addRule(new $e("."+this.toolbarButtonStyleColorsClass.name+":hover",`
|
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
|
`))},J.prototype.markerToolbarButtonClicked=function(B,H){this.setActiveButton(B),this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(Y){return Y("marker",H)}),this.markerButtonOverflowBlock.style.display="none"},J.prototype.actionToolbarButtonClicked=function(B,H){this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(Y){return Y("action",H)}),this.markerButtonOverflowBlock.style.display="none",this.setActiveButton(this.buttons[0])},J.prototype.setActiveButton=function(B){this.resetButtonStyles(),B.className=B.className.replace(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,"").trim(),B.className+=" "+(this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name)},J.prototype.setActiveMarkerButton=function(B){var H=this.markerButtons.find(function(Y){return Y.getAttribute("data-type-name")===B});H&&this.setActiveButton(H)},J.prototype.setCurrentMarker=function(B){var H=this;this.currentMarker=B,this.buttons.filter(function(Y){return/delete|notes/.test(Y.getAttribute("data-action"))}).forEach(function(Y){H.currentMarker===void 0?(Y.style.fillOpacity="0.4",Y.style.pointerEvents="none"):(Y.style.fillOpacity="1",Y.style.pointerEvents="all")})},J}(),Qe=function(){function J(B,H,Y,le){this.panels=[],this.panelButtons=[],this.markerjsContainer=B,this.displayMode=H,this.uiStyleSettings=Y,this.styles=le,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return J.prototype.addStyles=function(){var B;this.toolboxStyleClass=this.styles.addClass(new ze("toolbox",`
|
|
|
width: 100%;
|
|
|
flex-shrink: 0;
|
|
|
display: flex;
|
|
|
flex-direction: column;
|
|
|
font-family: sans-serif;
|
|
|
`+(this.displayMode==="popup"?"height:"+2.5*this.uiStyleSettings.toolbarHeight+"px;":"")+`
|
|
|
box-sizing: content-box;
|
|
|
`+(this.displayMode==="popup"?"background-color: "+this.uiStyleSettings.canvasBackgroundColor+";":"")+`
|
|
|
`+(this.displayMode==="inline"?"border-bottom-left-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
|
|
|
`+(this.displayMode==="inline"?"border-bottom-right-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
|
|
|
overflow: hidden;
|
|
|
`)),this.toolboxStyleColorsClass=this.styles.addClass(new ze("toolbox_colors",`
|
|
|
color: `+this.uiStyleSettings.toolboxColor+`;
|
|
|
`));var H=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new ze("toolbox-button-row",`
|
|
|
display: flex;
|
|
|
cursor: default;
|
|
|
box-sizing: content-box;
|
|
|
`)),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new ze("toolbox-button-row_colors",`
|
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
|
`)),this.toolboxPanelRowStyleClass=this.styles.addClass(new ze("toolbox-panel-row",`
|
|
|
display: flex;
|
|
|
`+(this.displayMode==="inline"?"position: absolute;":"")+`
|
|
|
`+(this.displayMode==="inline"?"bottom: "+this.uiStyleSettings.toolbarHeight+"px;":"")+`
|
|
|
cursor: default;
|
|
|
height: `+1.5*this.uiStyleSettings.toolbarHeight+`px;
|
|
|
`+(this.displayMode==="inline"?"width: 100%;":"")+`
|
|
|
box-sizing: content-box;
|
|
|
`)),this.toolboxPanelRowStyleColorsClass=this.styles.addClass(new ze("toolbox-panel-row_colors",`
|
|
|
background-color: `+((B=this.uiStyleSettings.toolboxBackgroundColor)!==null&&B!==void 0?B:this.uiStyleSettings.toolbarBackgroundHoverColor)+`;
|
|
|
`)),this.toolboxButtonStyleClass=this.styles.addClass(new ze("toolbox_button",`
|
|
|
display: inline-block;
|
|
|
width: `+(this.uiStyleSettings.toolbarHeight-2*H)+`px;
|
|
|
height: `+(this.uiStyleSettings.toolbarHeight-2*H)+`px;
|
|
|
padding: `+H+`px;
|
|
|
box-sizing: content-box;
|
|
|
`)),this.toolboxButtonStyleColorsClass=this.styles.addClass(new ze("toolbox-button_colors",`
|
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
|
`)),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new ze("toolbox-active-button_colors",`
|
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`;
|
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
|
`)),this.styles.addRule(new $e("."+this.toolboxButtonStyleColorsClass.name+":hover",`
|
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
|
`)),this.styles.addRule(new $e("."+this.toolboxButtonStyleClass.name+" svg",`
|
|
|
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
|
|
|
`))},J.prototype.show=function(B){var H;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=B,this.uiContainer.className=this.toolboxStyleClass.name+" "+((H=this.uiStyleSettings.toolboxStyleColorsClassName)!==null&&H!==void 0?H:this.toolboxStyleColorsClass.name),this.markerjsContainer.appendChild(this.uiContainer)},J.prototype.setPanelButtons=function(B){var H,Y,le=this;this.panels=B,this.uiContainer!==void 0&&(this.uiContainer.innerHTML="",this.panelRow=document.createElement("div"),this.panelRow.className=this.toolboxPanelRowStyleClass.name+" "+((H=this.uiStyleSettings.toolboxPanelRowStyleColorsClassName)!==null&&H!==void 0?H:this.toolboxPanelRowStyleColorsClass.name),this.uiContainer.appendChild(this.panelRow),this.buttonRow=document.createElement("div"),this.buttonRow.className=this.toolboxButtonRowStyleClass.name+" "+((Y=this.uiStyleSettings.toolboxButtonRowStyleColorsClassName)!==null&&Y!==void 0?Y:this.toolboxButtonRowStyleColorsClass.name)+" ",this.uiContainer.appendChild(this.buttonRow),this.panelButtons.splice(0),this.panels.forEach(function($){var Be;$.uiStyleSettings=le.uiStyleSettings;var nt=document.createElement("div");nt.className=le.toolboxButtonStyleClass.name+" "+((Be=le.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&Be!==void 0?Be:le.toolboxButtonStyleColorsClass.name),nt.innerHTML=$.icon,nt.title=$.title,nt.addEventListener("click",function(){le.panelButtonClick($)}),le.panelButtons.push(nt),le.buttonRow.appendChild(nt)}),this.displayMode==="inline"?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},J.prototype.panelButtonClick=function(B){var H=this,Y=-1;if(B!==this.activePanel){Y=this.panels.indexOf(B),this.panelRow.innerHTML="";var le=B.getUi();le.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.panelRow.appendChild(le),this.panelRow.style.display="flex",this.panelRow.style.visibility="visible",this.panelRow.className=this.panelRow.className.replace(this.styles.fadeOutAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeInAnimationClassName,this.activePanel=B}else this.activePanel=void 0,this.panelRow.className=this.panelRow.className.replace(this.styles.fadeInAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeOutAnimationClassName,setTimeout(function(){H.displayMode==="inline"?H.panelRow.style.display="none":H.panelRow.style.visibility="hidden"},200);this.panelButtons.forEach(function($,Be){var nt,mt;$.className=H.toolboxButtonStyleClass.name+" "+(Be===Y?""+((nt=H.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&nt!==void 0?nt:H.toolboxActiveButtonStyleColorsClass.name):""+((mt=H.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&mt!==void 0?mt:H.toolboxButtonStyleColorsClass.name))})},J}(),fe=function(J,B){this.title=J,this.icon=B},ge=function(J){function B(H,Y,le,$){var Be=J.call(this,H,$||'<svg viewBox="0 0 24 24"><path d="M17.5 12a1.5 1.5 0 01-1.5-1.5A1.5 1.5 0 0117.5 9a1.5 1.5 0 011.5 1.5 1.5 1.5 0 01-1.5 1.5m-3-4A1.5 1.5 0 0113 6.5 1.5 1.5 0 0114.5 5 1.5 1.5 0 0116 6.5 1.5 1.5 0 0114.5 8m-5 0A1.5 1.5 0 018 6.5 1.5 1.5 0 019.5 5 1.5 1.5 0 0111 6.5 1.5 1.5 0 019.5 8m-3 4A1.5 1.5 0 015 10.5 1.5 1.5 0 016.5 9 1.5 1.5 0 018 10.5 1.5 1.5 0 016.5 12M12 3a9 9 0 00-9 9 9 9 0 009 9 1.5 1.5 0 001.5-1.5c0-.39-.15-.74-.39-1-.23-.27-.38-.62-.38-1a1.5 1.5 0 011.5-1.5H16a5 5 0 005-5c0-4.42-4.03-8-9-8z"/></svg>')||this;return Be.colors=[],Be.addTransparent=!1,Be.colorBoxes=[],Be.colors=Y,Be.currentColor=le,Be.setCurrentColor=Be.setCurrentColor.bind(Be),Be.getColorBox=Be.getColorBox.bind(Be),Be}return Le(B,J),B.prototype.getUi=function(){var H=this,Y=document.createElement("div");return Y.style.overflow="hidden",Y.style.whiteSpace="nowrap",this.colors.forEach(function(le){var $=H.getColorBox(le);Y.appendChild($),H.colorBoxes.push($)}),Y},B.prototype.getColorBox=function(H){var Y=this,le=this.uiStyleSettings.toolbarHeight/4,$=this.uiStyleSettings.toolbarHeight-le,Be=document.createElement("div");Be.style.display="inline-block",Be.style.boxSizing="content-box",Be.style.width=$-2+"px",Be.style.height=$-2+"px",Be.style.padding="1px",Be.style.marginRight="2px",Be.style.marginBottom="2px",Be.style.borderWidth="2px",Be.style.borderStyle="solid",Be.style.borderRadius=($+2)/2+"px",Be.style.borderColor=H===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",Be.addEventListener("click",function(){Y.setCurrentColor(H,Be)});var nt=document.createElement("div");return nt.style.display="inline-block",nt.style.width=$-2+"px",nt.style.height=$-2+"px",nt.style.backgroundColor=H,nt.style.borderRadius=$/2+"px",H==="transparent"&&(nt.style.fill=this.uiStyleSettings.toolboxAccentColor,nt.innerHTML=`<svg viewBox="0 0 24 24">
|
|
|
<path d="M2,5.27L3.28,4L20,20.72L18.73,22L15.65,18.92C14.5,19.3 13.28,19.5 12,19.5C7,19.5 2.73,16.39 1,12C1.69,10.24 2.79,8.69 4.19,7.46L2,5.27M12,9A3,3 0 0,1 15,12C15,12.35 14.94,12.69 14.83,13L11,9.17C11.31,9.06 11.65,9 12,9M12,4.5C17,4.5 21.27,7.61 23,12C22.18,14.08 20.79,15.88 19,17.19L17.58,15.76C18.94,14.82 20.06,13.54 20.82,12C19.17,8.64 15.76,6.5 12,6.5C10.91,6.5 9.84,6.68 8.84,7L7.3,5.47C8.74,4.85 10.33,4.5 12,4.5M3.18,12C4.83,15.36 8.24,17.5 12,17.5C12.69,17.5 13.37,17.43 14,17.29L11.72,15C10.29,14.85 9.15,13.71 9,12.28L5.6,8.87C4.61,9.72 3.78,10.78 3.18,12Z" />
|
|
|
</svg>`),Be.appendChild(nt),Be},B.prototype.setCurrentColor=function(H,Y){var le=this;this.currentColor=H,this.colorBoxes.forEach(function($){$.style.borderColor=$===Y?le.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onColorChanged&&this.onColorChanged(H)},B}(fe),xe=function(){function J(B,H,Y){this._state="new",this._isSelected=!1,this._container=B,this._overlayContainer=H,this.globalSettings=Y,this.stateChanged=this.stateChanged.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this)}return Object.defineProperty(J.prototype,"typeName",{get:function(){return Object.getPrototypeOf(this).constructor.typeName},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"container",{get:function(){return this._container},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"overlayContainer",{get:function(){return this._overlayContainer},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"toolboxPanels",{get:function(){return[]},enumerable:!1,configurable:!0}),J.prototype.ownsTarget=function(B){return!1},Object.defineProperty(J.prototype,"isSelected",{get:function(){return this._isSelected},enumerable:!1,configurable:!0}),J.prototype.select=function(){this.container.style.cursor="move",this._isSelected=!0,this.manipulationStartState=this.getState()},J.prototype.deselect=function(){this.container.style.cursor="default",this._isSelected=!1,this.stateChanged()},J.prototype.pointerDown=function(B,H){},J.prototype.dblClick=function(B,H){},J.prototype.manipulate=function(B){},J.prototype.pointerUp=function(B){this.stateChanged()},J.prototype.dispose=function(){},J.prototype.addMarkerVisualToContainer=function(B){this.container.childNodes.length>0?this.container.insertBefore(B,this.container.childNodes[0]):this.container.appendChild(B)},J.prototype.getState=function(){return{typeName:J.typeName,state:this.state,notes:this.notes}},J.prototype.restoreState=function(B){this._state=B.state,this.notes=B.notes},J.prototype.scale=function(B,H){},J.prototype.colorChanged=function(B){this.onColorChanged&&this.onColorChanged(B),this.stateChanged()},J.prototype.fillColorChanged=function(B){this.onFillColorChanged&&this.onFillColorChanged(B),this.stateChanged()},J.prototype.stateChanged=function(){if(this.onStateChanged&&this.state!=="creating"&&this.state!=="new"){var B=this.getState();this.manipulationStartState!==void 0&&(this.manipulationStartState.state="select"),B.state="select",JSON.stringify(this.manipulationStartState)!=JSON.stringify(B)&&this.onStateChanged(this)}},J.typeName="MarkerBase",J}(),we=function(){function J(){this.findGripByVisual=this.findGripByVisual.bind(this)}return J.prototype.findGripByVisual=function(B){return this.topLeft.ownsTarget(B)?this.topLeft:this.topCenter.ownsTarget(B)?this.topCenter:this.topRight.ownsTarget(B)?this.topRight:this.centerLeft.ownsTarget(B)?this.centerLeft:this.centerRight.ownsTarget(B)?this.centerRight:this.bottomLeft.ownsTarget(B)?this.bottomLeft:this.bottomCenter.ownsTarget(B)?this.bottomCenter:this.bottomRight.ownsTarget(B)?this.bottomRight:void 0},J}(),Te=function(){function J(){this.GRIP_SIZE=10,this.visual=Se.createGroup(),this.visual.appendChild(Se.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(Se.createCircle(this.GRIP_SIZE,[["fill","#cccccc"],["fill-opacity","0.7"],["stroke","#333333"],["stroke-width","2"],["stroke-opacity","0.7"]]))}return J.prototype.ownsTarget=function(B){return B===this.visual||B===this.visual.childNodes[0]||B===this.visual.childNodes[1]},J}(),re=function(){function J(){}return J.toITransformMatrix=function(B){return{a:B.a,b:B.b,c:B.c,d:B.d,e:B.e,f:B.f}},J.toSVGMatrix=function(B,H){return B.a=H.a,B.b=H.b,B.c=H.c,B.d=H.d,B.e=H.e,B.f=H.f,B},J}(),ve=function(J){function B(H,Y,le){var $=J.call(this,H,Y,le)||this;return $.left=0,$.top=0,$.width=0,$.height=0,$.defaultSize={x:50,y:20},$.offsetX=0,$.offsetY=0,$.rotationAngle=0,$.CB_DISTANCE=10,$._suppressMarkerCreateEvent=!1,$.container.transform.baseVal.appendItem(Se.createTransform()),$.setupControlBox(),$}return Le(B,J),Object.defineProperty(B.prototype,"centerX",{get:function(){return this.left+this.width/2},enumerable:!1,configurable:!0}),Object.defineProperty(B.prototype,"centerY",{get:function(){return this.top+this.height/2},enumerable:!1,configurable:!0}),Object.defineProperty(B.prototype,"visual",{get:function(){return this._visual},set:function(H){this._visual=H;var Y=Se.createTransform();this._visual.transform.baseVal.appendItem(Y)},enumerable:!1,configurable:!0}),B.prototype.ownsTarget=function(H){return!!J.prototype.ownsTarget.call(this,H)||!!(this.controlGrips.findGripByVisual(H)!==void 0||this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(H))},B.prototype.pointerDown=function(H,Y){J.prototype.pointerDown.call(this,H,Y),this.state==="new"&&(this.left=H.x,this.top=H.y),this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.manipulationStartWidth=this.width,this.manipulationStartHeight=this.height;var le=this.unrotatePoint(H);if(this.manipulationStartX=le.x,this.manipulationStartY=le.y,this.offsetX=le.x-this.left,this.offsetY=le.y-this.top,this.state!=="new")if(this.select(),this.activeGrip=this.controlGrips.findGripByVisual(Y),this.activeGrip!==void 0)this._state="resize";else if(this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(Y)){this.activeGrip=this.rotatorGrip;var $=this.rotatePoint({x:this.centerX,y:this.centerY});this.left=$.x-this.width/2,this.top=$.y-this.height/2,this.moveVisual({x:this.left,y:this.top});var Be=this.container.transform.baseVal.getItem(0);Be.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(Be,0),this.adjustControlBox(),this._state="rotate"}else this._state="move"},B.prototype.pointerUp=function(H){var Y=this.state;J.prototype.pointerUp.call(this,H),this.state==="creating"&&this.width<10&&this.height<10?(this.width=this.defaultSize.x,this.height=this.defaultSize.y):this.manipulate(H),this._state="select",Y==="creating"&&this.onMarkerCreated&&this._suppressMarkerCreateEvent===!1&&this.onMarkerCreated(this)},B.prototype.moveVisual=function(H){this.visual.style.transform="translate("+H.x+"px, "+H.y+"px)"},B.prototype.manipulate=function(H){var Y=this.unrotatePoint(H);this.state==="creating"?this.resize(H):this.state==="move"?(this.left=this.manipulationStartLeft+(Y.x-this.manipulationStartLeft)-this.offsetX,this.top=this.manipulationStartTop+(Y.y-this.manipulationStartTop)-this.offsetY,this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()):this.state==="resize"?this.resize(Y):this.state==="rotate"&&this.rotate(H)},B.prototype.resize=function(H){var Y=this.manipulationStartLeft,le=this.manipulationStartWidth,$=this.manipulationStartTop,Be=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:Y=this.manipulationStartLeft+H.x-this.manipulationStartX,le=this.manipulationStartWidth+this.manipulationStartLeft-Y;break;case this.controlGrips.bottomRight:case this.controlGrips.centerRight:case this.controlGrips.topRight:case void 0:le=this.manipulationStartWidth+H.x-this.manipulationStartX}switch(this.activeGrip){case this.controlGrips.topCenter:case this.controlGrips.topLeft:case this.controlGrips.topRight:$=this.manipulationStartTop+H.y-this.manipulationStartY,Be=this.manipulationStartHeight+this.manipulationStartTop-$;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:Be=this.manipulationStartHeight+H.y-this.manipulationStartY}le>=0?(this.left=Y,this.width=le):(this.left=Y+le,this.width=-le),Be>=0?(this.top=$,this.height=Be):(this.top=$+Be,this.height=-Be),this.setSize()},B.prototype.setSize=function(){this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()},B.prototype.rotate=function(H){if(Math.abs(H.x-this.centerX)>.1){var Y=Math.sign(H.x-this.centerX);this.rotationAngle=180*Math.atan((H.y-this.centerY)/(H.x-this.centerX))/Math.PI+90*Y,this.applyRotation()}},B.prototype.applyRotation=function(){var H=this.container.transform.baseVal.getItem(0);H.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(H,0)},B.prototype.rotatePoint=function(H){if(this.rotationAngle===0)return H;var Y=this.container.getCTM(),le=Se.createPoint(H.x,H.y);return{x:(le=le.matrixTransform(Y)).x,y:le.y}},B.prototype.unrotatePoint=function(H){if(this.rotationAngle===0)return H;var Y=this.container.getCTM();Y=Y.inverse();var le=Se.createPoint(H.x,H.y);return{x:(le=le.matrixTransform(Y)).x,y:le.y}},B.prototype.select=function(){J.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},B.prototype.deselect=function(){J.prototype.deselect.call(this),this.controlBox.style.display="none"},B.prototype.setupControlBox=function(){this.controlBox=Se.createGroup();var H=Se.createTransform();H.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(H),this.container.appendChild(this.controlBox),this.controlRect=Se.createRect(this.width+this.CB_DISTANCE,this.height+this.CB_DISTANCE,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"],["fill","transparent"],["pointer-events","none"]]),this.controlBox.appendChild(this.controlRect),this.globalSettings.disableRotation!==!0&&(this.rotatorGripLine=Se.createLine((this.width+2*this.CB_DISTANCE)/2,this.top-this.CB_DISTANCE,(this.width+2*this.CB_DISTANCE)/2,this.top-3*this.CB_DISTANCE,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.controlBox.appendChild(this.rotatorGripLine)),this.controlGrips=new we,this.addControlGrips(),this.controlBox.style.display="none"},B.prototype.adjustControlBox=function(){var H=this.controlBox.transform.baseVal.getItem(0);H.setTranslate(this.left-this.CB_DISTANCE/2,this.top-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.replaceItem(H,0),this.controlRect.setAttribute("width",(this.width+this.CB_DISTANCE).toString()),this.controlRect.setAttribute("height",(this.height+this.CB_DISTANCE).toString()),this.rotatorGripLine!==void 0&&(this.rotatorGripLine.setAttribute("x1",((this.width+this.CB_DISTANCE)/2).toString()),this.rotatorGripLine.setAttribute("y1",(-this.CB_DISTANCE/2).toString()),this.rotatorGripLine.setAttribute("x2",((this.width+this.CB_DISTANCE)/2).toString()),this.rotatorGripLine.setAttribute("y2",(3*-this.CB_DISTANCE).toString())),this.positionGrips()},B.prototype.addControlGrips=function(){this.controlGrips.topLeft=this.createGrip(),this.controlGrips.topCenter=this.createGrip(),this.controlGrips.topRight=this.createGrip(),this.controlGrips.centerLeft=this.createGrip(),this.controlGrips.centerRight=this.createGrip(),this.controlGrips.bottomLeft=this.createGrip(),this.controlGrips.bottomCenter=this.createGrip(),this.controlGrips.bottomRight=this.createGrip(),this.globalSettings.disableRotation!==!0&&(this.rotatorGrip=this.createGrip()),this.positionGrips()},B.prototype.createGrip=function(){var H=new Te;return H.visual.transform.baseVal.appendItem(Se.createTransform()),this.controlBox.appendChild(H.visual),H},B.prototype.positionGrips=function(){var H=this.controlGrips.topLeft.GRIP_SIZE,Y=-H/2,le=Y,$=(this.width+this.CB_DISTANCE)/2-H/2,Be=(this.height+this.CB_DISTANCE)/2-H/2,nt=this.height+this.CB_DISTANCE-H/2,mt=this.width+this.CB_DISTANCE-H/2;this.positionGrip(this.controlGrips.topLeft.visual,Y,le),this.positionGrip(this.controlGrips.topCenter.visual,$,le),this.positionGrip(this.controlGrips.topRight.visual,mt,le),this.positionGrip(this.controlGrips.centerLeft.visual,Y,Be),this.positionGrip(this.controlGrips.centerRight.visual,mt,Be),this.positionGrip(this.controlGrips.bottomLeft.visual,Y,nt),this.positionGrip(this.controlGrips.bottomCenter.visual,$,nt),this.positionGrip(this.controlGrips.bottomRight.visual,mt,nt),this.rotatorGrip!==void 0&&this.positionGrip(this.rotatorGrip.visual,$,le-3*this.CB_DISTANCE)},B.prototype.positionGrip=function(H,Y,le){var $=H.transform.baseVal.getItem(0);$.setTranslate(Y,le),H.transform.baseVal.replaceItem($,0)},B.prototype.hideControlBox=function(){this.controlBox.style.display="none"},B.prototype.showControlBox=function(){this.controlBox.style.display=""},B.prototype.getState=function(){return Object.assign({left:this.left,top:this.top,width:this.width,height:this.height,rotationAngle:this.rotationAngle,visualTransformMatrix:re.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:re.toITransformMatrix(this.container.transform.baseVal.getItem(0).matrix)},J.prototype.getState.call(this))},B.prototype.restoreState=function(H){J.prototype.restoreState.call(this,H);var Y=H;this.left=Y.left,this.top=Y.top,this.width=Y.width,this.height=Y.height,this.rotationAngle=Y.rotationAngle,this.visual.transform.baseVal.getItem(0).setMatrix(re.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,Y.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(re.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,Y.containerTransformMatrix))},B.prototype.scale=function(H,Y){J.prototype.scale.call(this,H,Y);var le=this.rotatePoint({x:this.left,y:this.top}),$=this.unrotatePoint({x:le.x*H,y:le.y*Y});this.left=$.x,this.top=$.y,this.width=this.width*H,this.height=this.height*Y,this.adjustControlBox()},B}(xe),ae=function(J){function B(H,Y,le){var $=J.call(this,H,Y,le)||this;return $.fillColor="transparent",$.strokeColor="transparent",$.strokeWidth=0,$.strokeDasharray="",$.opacity=1,$.setStrokeColor=$.setStrokeColor.bind($),$.setFillColor=$.setFillColor.bind($),$.setStrokeWidth=$.setStrokeWidth.bind($),$.setStrokeDasharray=$.setStrokeDasharray.bind($),$.createVisual=$.createVisual.bind($),$}return Le(B,J),B.prototype.ownsTarget=function(H){return!(!J.prototype.ownsTarget.call(this,H)&&H!==this.visual)},B.prototype.createVisual=function(){this.visual=Se.createRect(1,1,[["fill",this.fillColor],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["stroke-dasharray",this.strokeDasharray],["opacity",this.opacity.toString()]]),this.addMarkerVisualToContainer(this.visual)},B.prototype.pointerDown=function(H,Y){J.prototype.pointerDown.call(this,H,Y),this.state==="new"&&(this.createVisual(),this.moveVisual(H),this._state="creating")},B.prototype.manipulate=function(H){J.prototype.manipulate.call(this,H)},B.prototype.resize=function(H){J.prototype.resize.call(this,H),this.setSize()},B.prototype.setSize=function(){J.prototype.setSize.call(this),Se.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},B.prototype.pointerUp=function(H){J.prototype.pointerUp.call(this,H),this.setSize()},B.prototype.setStrokeColor=function(H){this.strokeColor=H,this.visual&&Se.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(H),this.stateChanged()},B.prototype.setFillColor=function(H){this.fillColor=H,this.visual&&Se.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},B.prototype.setStrokeWidth=function(H){this.strokeWidth=H,this.visual&&Se.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},B.prototype.setStrokeDasharray=function(H){this.strokeDasharray=H,this.visual&&Se.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},B.prototype.getState=function(){return Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},J.prototype.getState.call(this))},B.prototype.restoreState=function(H){var Y=H;this.fillColor=Y.fillColor,this.strokeColor=Y.strokeColor,this.strokeWidth=Y.strokeWidth,this.strokeDasharray=Y.strokeDasharray,this.opacity=Y.opacity,this.createVisual(),J.prototype.restoreState.call(this,H),this.setSize()},B.prototype.scale=function(H,Y){J.prototype.scale.call(this,H,Y),this.setSize()},B.title="Rectangle marker",B}(ve),Me=function(J){function B(H,Y,le,$){var Be=J.call(this,H,$||'<svg viewBox="0 0 24 24"><path d="M3 17h18v-2H3v2m0 3h18v-1H3v1m0-7h18v-3H3v3m0-9v4h18V4H3z"/></svg>')||this;return Be.widths=[],Be.widthBoxes=[],Be.widths=Y,Be.currentWidth=le,Be.setCurrentWidth=Be.setCurrentWidth.bind(Be),Be}return Le(B,J),B.prototype.getUi=function(){var H=this,Y=document.createElement("div");return Y.style.display="flex",Y.style.overflow="hidden",Y.style.flexGrow="2",this.widths.forEach(function(le){var $=document.createElement("div");$.style.display="flex",$.style.flexGrow="2",$.style.alignItems="center",$.style.justifyContent="space-between",$.style.padding="5px",$.style.borderWidth="2px",$.style.borderStyle="solid",$.style.borderColor=le===H.currentWidth?H.uiStyleSettings.toolboxAccentColor:"transparent",$.addEventListener("click",function(){H.setCurrentWidth(le,$)}),Y.appendChild($);var Be=document.createElement("div");Be.innerText=le.toString(),Be.style.marginRight="5px",$.appendChild(Be);var nt=document.createElement("div");nt.style.minHeight="20px",nt.style.flexGrow="2",nt.style.display="flex",nt.style.alignItems="center";var mt=document.createElement("hr");mt.style.minWidth="20px",mt.style.border="0px",mt.style.borderTop=le+"px solid "+H.uiStyleSettings.toolboxColor,mt.style.flexGrow="2",nt.appendChild(mt),$.appendChild(nt),H.widthBoxes.push($)}),Y},B.prototype.setCurrentWidth=function(H,Y){var le=this;this.currentWidth=H,this.widthBoxes.forEach(function($){$.style.borderColor=$===Y?le.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},B}(fe),Ye=function(J){function B(H,Y,le,$){var Be=J.call(this,H,$||'<svg viewBox="0 0 24 24"><path d="M3 16h5v-2H3v2m6.5 0h5v-2h-5v2m6.5 0h5v-2h-5v2M3 20h2v-2H3v2m4 0h2v-2H7v2m4 0h2v-2h-2v2m4 0h2v-2h-2v2m4 0h2v-2h-2v2M3 12h8v-2H3v2m10 0h8v-2h-8v2M3 4v4h18V4H3z"/></svg>')||this;return Be.styles=[],Be.styleBoxes=[],Be.styles=Y,Be.currentStyle=le,Be.setCurrentStyle=Be.setCurrentStyle.bind(Be),Be}return Le(B,J),B.prototype.getUi=function(){var H=this,Y=document.createElement("div");return Y.style.display="flex",Y.style.overflow="hidden",Y.style.flexGrow="2",this.styles.forEach(function(le){var $=document.createElement("div");$.style.display="flex",$.style.alignItems="center",$.style.justifyContent="space-between",$.style.padding="5px",$.style.borderWidth="2px",$.style.borderStyle="solid",$.style.overflow="hidden",$.style.maxWidth=100/H.styles.length-5+"%",$.style.borderColor=le===H.currentStyle?H.uiStyleSettings.toolboxAccentColor:"transparent",$.addEventListener("click",function(){H.setCurrentStyle(le,$)}),Y.appendChild($);var Be=document.createElement("div");Be.style.minHeight="20px",Be.style.flexGrow="2",Be.style.overflow="hidden";var nt=`<svg width="100" height="20">
|
|
|
<line x1="0" y1="10" x2="100" y2="10" stroke="`+H.uiStyleSettings.toolboxColor+'" stroke-width="3" '+(le!==""?'stroke-dasharray="'+le+'"':"")+` />
|
|
|
</svg>`;Be.innerHTML=nt,$.appendChild(Be),H.styleBoxes.push($)}),Y},B.prototype.setCurrentStyle=function(H,Y){var le=this;this.currentStyle=H,this.styleBoxes.forEach(function($){$.style.borderColor=$===Y?le.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},B}(fe),et=function(J){function B(H,Y,le){var $=J.call(this,H,Y,le)||this;return $.strokeColor=le.defaultColor,$.strokeWidth=le.defaultStrokeWidth,$.strokeDasharray=le.defaultStrokeDasharray,$.strokePanel=new ge("Line color",le.defaultColorSet,le.defaultColor),$.strokePanel.onColorChanged=$.setStrokeColor,$.strokeWidthPanel=new Me("Line width",le.defaultStrokeWidths,le.defaultStrokeWidth),$.strokeWidthPanel.onWidthChanged=$.setStrokeWidth,$.strokeStylePanel=new Ye("Line style",le.defaultStrokeDasharrays,le.defaultStrokeDasharray),$.strokeStylePanel.onStyleChanged=$.setStrokeDasharray,$}return Le(B,J),Object.defineProperty(B.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),B.prototype.getState=function(){var H=J.prototype.getState.call(this);return H.typeName=B.typeName,H},B.typeName="FrameMarker",B.title="Frame marker",B.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4m14 11H6V8h12v9z"/></svg>',B}(ae),je=function(){this.defaultColorSet=["#EF4444","#10B981","#2563EB","#FFFF00","#7C3AED","#F472B6","#000000","#FFFFFF"],this.defaultColor=this.defaultColorSet[0],this.defaultFillColor=this.defaultColorSet[0],this.defaultStrokeColor=this.defaultColorSet[7],this.defaultHighlightColor=this.defaultColorSet[3],this.defaultStrokeWidth=3,this.defaultStrokeDasharray="",this.defaultHighlightOpacity=.5,this.defaultFontFamily="Helvetica, Arial, sans-serif",this.defaultStrokeWidths=[1,2,3,5,10],this.defaultStrokeDasharrays=["","3","12 3","9 6 3 6"],this.defaultOpacitySteps=[.1,.25,.5,.75,1],this.displayMode="inline",this.defaultFontFamilies=['Times, "Times New Roman", serif',"Helvetica, Arial, sans-serif",'Courier, "Courier New", monospace',"cursive","fantasy"],this.popupMargin=30,this.newFreehandMarkerOnPointerUp=!1,this.defaultColorsFollowCurrentColors=!1,this.freehandPixelRatio=1,this.disableRotation=!1},ot=function(J){function B(H,Y,le){var $=J.call(this,H,Y,le)||this;return $.x1=0,$.y1=0,$.x2=0,$.y2=0,$.defaultLength=50,$.manipulationStartX=0,$.manipulationStartY=0,$.manipulationStartX1=0,$.manipulationStartY1=0,$.manipulationStartX2=0,$.manipulationStartY2=0,$.setupControlBox(),$}return Le(B,J),B.prototype.ownsTarget=function(H){return!!J.prototype.ownsTarget.call(this,H)||!(!this.grip1.ownsTarget(H)&&!this.grip2.ownsTarget(H))},B.prototype.pointerDown=function(H,Y){J.prototype.pointerDown.call(this,H,Y),this.manipulationStartX=H.x,this.manipulationStartY=H.y,this.state==="new"&&(this.x1=H.x,this.y1=H.y,this.x2=H.x,this.y2=H.y),this.manipulationStartX1=this.x1,this.manipulationStartY1=this.y1,this.manipulationStartX2=this.x2,this.manipulationStartY2=this.y2,this.state!=="new"&&(this.select(),this.grip1.ownsTarget(Y)?this.activeGrip=this.grip1:this.grip2.ownsTarget(Y)?this.activeGrip=this.grip2:this.activeGrip=void 0,this.activeGrip?this._state="resize":this._state="move")},B.prototype.pointerUp=function(H){var Y=this.state;J.prototype.pointerUp.call(this,H),this.state==="creating"&&Math.abs(this.x1-this.x2)<10&&Math.abs(this.y1-this.y2)<10?(this.x2=this.x1+this.defaultLength,this.adjustVisual(),this.adjustControlBox()):this.manipulate(H),this._state="select",Y==="creating"&&this.onMarkerCreated&&this.onMarkerCreated(this)},B.prototype.adjustVisual=function(){},B.prototype.manipulate=function(H){this.state==="creating"?this.resize(H):this.state==="move"?(this.x1=this.manipulationStartX1+H.x-this.manipulationStartX,this.y1=this.manipulationStartY1+H.y-this.manipulationStartY,this.x2=this.manipulationStartX2+H.x-this.manipulationStartX,this.y2=this.manipulationStartY2+H.y-this.manipulationStartY,this.adjustVisual(),this.adjustControlBox()):this.state==="resize"&&this.resize(H)},B.prototype.resize=function(H){switch(this.activeGrip){case this.grip1:this.x1=H.x,this.y1=H.y;break;case this.grip2:case void 0:this.x2=H.x,this.y2=H.y}this.adjustVisual(),this.adjustControlBox()},B.prototype.select=function(){J.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},B.prototype.deselect=function(){J.prototype.deselect.call(this),this.controlBox.style.display="none"},B.prototype.setupControlBox=function(){this.controlBox=Se.createGroup(),this.container.appendChild(this.controlBox),this.addControlGrips(),this.controlBox.style.display="none"},B.prototype.adjustControlBox=function(){this.positionGrips()},B.prototype.addControlGrips=function(){this.grip1=this.createGrip(),this.grip2=this.createGrip(),this.positionGrips()},B.prototype.createGrip=function(){var H=new Te;return H.visual.transform.baseVal.appendItem(Se.createTransform()),this.controlBox.appendChild(H.visual),H},B.prototype.positionGrips=function(){var H=this.grip1.GRIP_SIZE;this.positionGrip(this.grip1.visual,this.x1-H/2,this.y1-H/2),this.positionGrip(this.grip2.visual,this.x2-H/2,this.y2-H/2)},B.prototype.positionGrip=function(H,Y,le){var $=H.transform.baseVal.getItem(0);$.setTranslate(Y,le),H.transform.baseVal.replaceItem($,0)},B.prototype.getState=function(){return Object.assign({x1:this.x1,y1:this.y1,x2:this.x2,y2:this.y2},J.prototype.getState.call(this))},B.prototype.restoreState=function(H){J.prototype.restoreState.call(this,H);var Y=H;this.x1=Y.x1,this.y1=Y.y1,this.x2=Y.x2,this.y2=Y.y2},B.prototype.scale=function(H,Y){J.prototype.scale.call(this,H,Y),this.x1=this.x1*H,this.y1=this.y1*Y,this.x2=this.x2*H,this.y2=this.y2*Y,this.adjustVisual(),this.adjustControlBox()},B}(xe),ce=function(J){function B(H,Y,le){var $=J.call(this,H,Y,le)||this;return $.strokeColor="transparent",$.strokeWidth=0,$.strokeDasharray="",$.setStrokeColor=$.setStrokeColor.bind($),$.setStrokeWidth=$.setStrokeWidth.bind($),$.setStrokeDasharray=$.setStrokeDasharray.bind($),$.strokeColor=le.defaultColor,$.strokeWidth=le.defaultStrokeWidth,$.strokeDasharray=le.defaultStrokeDasharray,$.strokePanel=new ge("Line color",le.defaultColorSet,le.defaultColor),$.strokePanel.onColorChanged=$.setStrokeColor,$.strokeWidthPanel=new Me("Line width",le.defaultStrokeWidths,le.defaultStrokeWidth),$.strokeWidthPanel.onWidthChanged=$.setStrokeWidth,$.strokeStylePanel=new Ye("Line style",le.defaultStrokeDasharrays,le.defaultStrokeDasharray),$.strokeStylePanel.onStyleChanged=$.setStrokeDasharray,$}return Le(B,J),B.prototype.ownsTarget=function(H){return!(!J.prototype.ownsTarget.call(this,H)&&H!==this.visual&&H!==this.selectorLine&&H!==this.visibleLine)},B.prototype.createVisual=function(){this.visual=Se.createGroup(),this.selectorLine=Se.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=Se.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.visual.appendChild(this.selectorLine),this.visual.appendChild(this.visibleLine),this.addMarkerVisualToContainer(this.visual)},B.prototype.pointerDown=function(H,Y){J.prototype.pointerDown.call(this,H,Y),this.state==="new"&&(this.createVisual(),this.adjustVisual(),this._state="creating")},B.prototype.adjustVisual=function(){this.selectorLine&&this.visibleLine&&(this.selectorLine.setAttribute("x1",this.x1.toString()),this.selectorLine.setAttribute("y1",this.y1.toString()),this.selectorLine.setAttribute("x2",this.x2.toString()),this.selectorLine.setAttribute("y2",this.y2.toString()),this.visibleLine.setAttribute("x1",this.x1.toString()),this.visibleLine.setAttribute("y1",this.y1.toString()),this.visibleLine.setAttribute("x2",this.x2.toString()),this.visibleLine.setAttribute("y2",this.y2.toString()),Se.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),Se.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),Se.setAttributes(this.visibleLine,[["stroke-dasharray",this.strokeDasharray.toString()]]))},B.prototype.setStrokeColor=function(H){this.strokeColor=H,this.adjustVisual(),this.colorChanged(H)},B.prototype.setStrokeWidth=function(H){this.strokeWidth=H,this.adjustVisual()},B.prototype.setStrokeDasharray=function(H){this.strokeDasharray=H,this.adjustVisual(),this.stateChanged()},Object.defineProperty(B.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),B.prototype.getState=function(){var H=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray},J.prototype.getState.call(this));return H.typeName=B.typeName,H},B.prototype.restoreState=function(H){J.prototype.restoreState.call(this,H);var Y=H;this.strokeColor=Y.strokeColor,this.strokeWidth=Y.strokeWidth,this.strokeDasharray=Y.strokeDasharray,this.createVisual(),this.adjustVisual()},B.typeName="LineMarker",B.title="Line marker",B.icon='<svg viewBox="0 0 24 24"><path d="M19 13H5v-2h14v2z"/></svg>',B}(ot),Pe=function(J){function B(H,Y,le,$){var Be=J.call(this,H,$||'<svg viewBox="0 0 24 24"><path d="M17 8h3v12h1v1h-4v-1h1v-3h-4l-1.5 3H14v1h-4v-1h1l6-12m1 1l-3.5 7H18V9M5 3h5c1.11 0 2 .89 2 2v11H9v-5H6v5H3V5c0-1.11.89-2 2-2m1 2v4h3V5H6z"/></svg>')||this;return Be.fonts=[],Be.fontBoxes=[],Be.fonts=Y,Be.currentFont=le,Be.setCurrentFont=Be.setCurrentFont.bind(Be),Be}return Le(B,J),B.prototype.getUi=function(){var H=this,Y=document.createElement("div");return Y.style.overflow="hidden",Y.style.flexGrow="2",this.fonts.forEach(function(le){var $=document.createElement("div");$.style.display="inline-block",$.style.alignItems="center",$.style.justifyContent="space-between",$.style.padding="5px",$.style.borderWidth="2px",$.style.borderStyle="solid",$.style.overflow="hidden",$.style.maxWidth=100/H.fonts.length-5+"%",$.style.borderColor=le===H.currentFont?H.uiStyleSettings.toolboxAccentColor:"transparent",$.addEventListener("click",function(){H.setCurrentFont(le,$)}),Y.appendChild($);var Be=document.createElement("div");Be.style.display="flex",Be.style.minHeight="20px",Be.style.flexGrow="2",Be.style.fontFamily=le,Be.style.overflow="hidden";var nt=document.createElement("div");nt.style.whiteSpace="nowrap",nt.style.overflow="hidden",nt.style.textOverflow="ellipsis",nt.innerHTML="The quick brown fox jumps over the lazy dog",Be.appendChild(nt),$.appendChild(Be),H.fontBoxes.push($)}),Y},B.prototype.setCurrentFont=function(H,Y){var le=this;this.currentFont=H,this.fontBoxes.forEach(function($){$.style.borderColor=$===Y?le.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onFontChanged&&this.onFontChanged(this.currentFont)},B}(fe),Fe=function(J){function B(H,Y,le){var $=J.call(this,H,Y,le)||this;return $.color="transparent",$.padding=5,$.DEFAULT_TEXT="your text here",$.text=$.DEFAULT_TEXT,$.isMoved=!1,$.color=le.defaultColor,$.fontFamily=le.defaultFontFamily,$.defaultSize={x:100,y:30},$.setColor=$.setColor.bind($),$.setFont=$.setFont.bind($),$.renderText=$.renderText.bind($),$.sizeText=$.sizeText.bind($),$.textEditDivClicked=$.textEditDivClicked.bind($),$.showTextEditor=$.showTextEditor.bind($),$.setSize=$.setSize.bind($),$.positionTextEditor=$.positionTextEditor.bind($),$.colorPanel=new ge("Color",le.defaultColorSet,le.defaultColor),$.colorPanel.onColorChanged=$.setColor,$.fontFamilyPanel=new Pe("Font",le.defaultFontFamilies,le.defaultFontFamily),$.fontFamilyPanel.onFontChanged=$.setFont,$}return Le(B,J),B.prototype.ownsTarget=function(H){if(J.prototype.ownsTarget.call(this,H)||H===this.visual||H===this.textElement||H===this.bgRectangle)return!0;var Y=!1;return this.textElement.childNodes.forEach(function(le){le===H&&(Y=!0)}),Y},B.prototype.createVisual=function(){this.visual=Se.createGroup(),this.bgRectangle=Se.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=Se.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(Se.createTransform()),this.textElement.transform.baseVal.appendItem(Se.createTransform()),this.visual.appendChild(this.textElement),this.addMarkerVisualToContainer(this.visual),this.renderText()},B.prototype.pointerDown=function(H,Y){J.prototype.pointerDown.call(this,H,Y),this.isMoved=!1,this.pointerDownPoint=H,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(H),this._state="creating")},B.prototype.renderText=function(){var H=this;if(this.textElement){for(;this.textElement.lastChild;)this.textElement.removeChild(this.textElement.lastChild);this.text.split(/\r\n|[\n\v\f\r\x85\u2028\u2029]/).forEach(function(Y){H.textElement.appendChild(Se.createTSpan(Y.trim()===""?" ":Y.trim(),[["x","0"],["dy","1.2em"]]))}),setTimeout(this.sizeText,10)}},B.prototype.getTextScale=function(){var H=this.textElement.getBBox(),Y=1;if(H.width>0&&H.height>0){var le=(1*this.width-this.width*this.padding*2/100)/H.width,$=(1*this.height-this.height*this.padding*2/100)/H.height;Y=Math.min(le,$)}return Y},B.prototype.getTextPosition=function(H){var Y=this.textElement.getBBox(),le=0,$=0;return Y.width>0&&Y.height>0&&(le=(this.width-Y.width*H)/2,$=this.height/2-Y.height*H/2),{x:le,y:$}},B.prototype.sizeText=function(){var H=this.textElement.getBBox(),Y=this.getTextScale(),le=this.getTextPosition(Y);le.y-=H.y*Y,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+le.x+"px, "+le.y+"px) scale("+Y+", "+Y+")":(this.textElement.transform.baseVal.getItem(0).setTranslate(le.x,le.y),this.textElement.transform.baseVal.getItem(1).setScale(Y,Y))},B.prototype.manipulate=function(H){J.prototype.manipulate.call(this,H),this.pointerDownPoint!==void 0&&(this.isMoved=Math.abs(H.x-this.pointerDownPoint.x)>5||Math.abs(H.y-this.pointerDownPoint.y)>5)},B.prototype.resize=function(H){J.prototype.resize.call(this,H),this.isMoved=!0,this.setSize(),this.sizeText()},B.prototype.setSize=function(){J.prototype.setSize.call(this),this.visual&&this.bgRectangle&&(Se.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),Se.setAttributes(this.bgRectangle,[["width",this.width.toString()],["height",this.height.toString()]]))},B.prototype.pointerUp=function(H){var Y=this.state;Y==="creating"&&(this._suppressMarkerCreateEvent=!0),J.prototype.pointerUp.call(this,H),this.setSize(),(Y==="creating"||!this.isMoved&&Date.now()-this.pointerDownTimestamp>500)&&this.showTextEditor(),this.pointerDownPoint=void 0},B.prototype.showTextEditor=function(){var H=this;this._state="edit",this.overlayContainer.innerHTML="",this.textEditDiv=document.createElement("div"),this.textEditDiv.style.flexGrow="2",this.textEditDiv.style.alignItems="center",this.textEditDiv.style.justifyContent="center",this.textEditDiv.style.pointerEvents="auto",this.textEditDiv.style.overflow="hidden",this.textEditor=document.createElement("div"),this.textEditor.style.position="absolute",this.textEditor.style.fontFamily=this.fontFamily,this.textEditor.style.lineHeight="1em",this.textEditor.innerText=this.text,this.textEditor.contentEditable="true",this.textEditor.style.color=this.color,this.textEditor.style.whiteSpace="pre",this.positionTextEditor(),this.textEditor.addEventListener("pointerup",function(Y){Y.stopPropagation()}),this.textEditor.addEventListener("input",function(){for(var Y=Number.parseFloat(H.textEditor.style.fontSize);H.textEditor.clientWidth>=Number.parseInt(H.textEditor.style.maxWidth)&&Y>.9;)Y-=.1,H.textEditor.style.fontSize=Math.max(Y,.9)+"em"}),this.textEditor.addEventListener("keyup",function(Y){Y.cancelBubble=!0}),this.textEditor.addEventListener("paste",function(Y){if(Y.clipboardData){var le=Y.clipboardData.getData("text"),$=window.getSelection();if(!$.rangeCount)return!1;$.deleteFromDocument(),$.getRangeAt(0).insertNode(document.createTextNode(le)),Y.preventDefault()}}),this.textEditDiv.addEventListener("pointerup",function(){H.textEditDivClicked(H.textEditor.innerText)}),this.textEditDiv.appendChild(this.textEditor),this.overlayContainer.appendChild(this.textEditDiv),this.hideVisual(),this.textEditor.focus(),document.execCommand("selectAll")},B.prototype.positionTextEditor=function(){if(this.state==="edit")if(this.textEditor===void 0)this.showTextEditor();else{this.textElement.style.display="";var H=this.getTextScale(),Y=this.rotatePoint({x:this.left+this.width/2,y:this.top+this.height/2}),le=this.textElement.getBBox(),$={x:le.width*H,y:le.height*H};Y.x-=$.x/2,Y.y-=$.y/2,this.textEditor.style.top=Y.y+"px",this.textEditor.style.left=Y.x+"px",this.textEditor.style.maxWidth=this.overlayContainer.offsetWidth-Y.x+"px",this.textEditor.style.fontSize=Math.max(16*H,12)+"px",this.textElement.style.display="none"}},B.prototype.textEditDivClicked=function(H){this.text=H.trim(),this.overlayContainer.innerHTML="",this.renderText(),this.showVisual(),this._suppressMarkerCreateEvent&&(this._suppressMarkerCreateEvent=!1,this.onMarkerCreated&&this.onMarkerCreated(this)),this.stateChanged()},B.prototype.select=function(){J.prototype.select.call(this),this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText)},B.prototype.deselect=function(){this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText),J.prototype.deselect.call(this)},B.prototype.dblClick=function(H,Y){J.prototype.dblClick.call(this,H,Y),this.showTextEditor()},B.prototype.setColor=function(H){this.textElement&&Se.setAttributes(this.textElement,[["fill",H]]),this.color=H,this.textEditor&&(this.textEditor.style.color=this.color),this.colorChanged(H)},B.prototype.setFont=function(H){this.textElement&&Se.setAttributes(this.textElement,[["font-family",H]]),this.fontFamily=H,this.textEditor&&(this.textEditor.style.fontFamily=this.fontFamily),this.renderText(),this.stateChanged()},B.prototype.hideVisual=function(){this.textElement.style.display="none",this.hideControlBox()},B.prototype.showVisual=function(){this.state==="edit"&&(this._state="select"),this.textElement.style.display="",this.showControlBox()},Object.defineProperty(B.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),B.prototype.getState=function(){var H=Object.assign({color:this.color,fontFamily:this.fontFamily,padding:this.padding,text:this.text},J.prototype.getState.call(this));return H.typeName=B.typeName,H},B.prototype.restoreState=function(H){var Y=H;this.color=Y.color,this.fontFamily=Y.fontFamily,this.padding=Y.padding,this.text=Y.text,this.createVisual(),J.prototype.restoreState.call(this,H),this.setSize()},B.prototype.scale=function(H,Y){J.prototype.scale.call(this,H,Y),this.setSize(),this.sizeText(),this.positionTextEditor()},B.typeName="TextMarker",B.title="Text marker",B.icon='<svg viewBox="0 0 24 24"><path d="M9.6 14L12 7.7l2.4 6.3M11 5L5.5 19h2.2l1.1-3H15l1.1 3h2.2L13 5h-2z"/></svg>',B}(ve),Ce=function(J){function B(H,Y,le){var $=J.call(this,H,Y,le)||this;return $.color="transparent",$.lineWidth=3,$.drawing=!1,$.pixelRatio=1,$.color=le.defaultColor,$.lineWidth=le.defaultStrokeWidth,$.pixelRatio=le.freehandPixelRatio,$.setColor=$.setColor.bind($),$.addCanvas=$.addCanvas.bind($),$.finishCreation=$.finishCreation.bind($),$.setLineWidth=$.setLineWidth.bind($),$.colorPanel=new ge("Color",le.defaultColorSet,le.defaultColor),$.colorPanel.onColorChanged=$.setColor,$.lineWidthPanel=new Me("Line width",le.defaultStrokeWidths,le.defaultStrokeWidth),$.lineWidthPanel.onWidthChanged=$.setLineWidth,$}return Le(B,J),B.prototype.ownsTarget=function(H){return!(!J.prototype.ownsTarget.call(this,H)&&H!==this.visual&&H!==this.drawingImage)},B.prototype.createVisual=function(){this.visual=Se.createGroup(),this.drawingImage=Se.createImage(),this.visual.appendChild(this.drawingImage);var H=Se.createTransform();this.visual.transform.baseVal.appendItem(H),this.addMarkerVisualToContainer(this.visual)},B.prototype.pointerDown=function(H,Y){this.state==="new"&&(this.addCanvas(),this.createVisual(),this._state="creating"),this.state==="creating"?(this.canvasContext.strokeStyle=this.color,this.canvasContext.lineWidth=this.lineWidth,this.canvasContext.beginPath(),this.canvasContext.moveTo(H.x,H.y),this.drawing=!0):J.prototype.pointerDown.call(this,H,Y)},B.prototype.manipulate=function(H){this.state==="creating"?this.drawing&&(this.canvasContext.lineTo(H.x,H.y),this.canvasContext.stroke()):J.prototype.manipulate.call(this,H)},B.prototype.resize=function(H){J.prototype.resize.call(this,H),Se.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),Se.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]])},B.prototype.pointerUp=function(H){this._state==="creating"?this.drawing&&(this.canvasContext.closePath(),this.drawing=!1,this.globalSettings.newFreehandMarkerOnPointerUp&&this.finishCreation()):J.prototype.pointerUp.call(this,H)},B.prototype.addCanvas=function(){this.overlayContainer.innerHTML="",this.canvasElement=document.createElement("canvas"),this.canvasElement.width=this.overlayContainer.clientWidth*this.pixelRatio,this.canvasElement.height=this.overlayContainer.clientHeight*this.pixelRatio,this.canvasContext=this.canvasElement.getContext("2d"),this.canvasContext.scale(this.pixelRatio,this.pixelRatio),this.overlayContainer.appendChild(this.canvasElement)},B.prototype.select=function(){this.state==="creating"&&this.finishCreation(),J.prototype.select.call(this)},B.prototype.deselect=function(){this.state==="creating"&&this.finishCreation(),J.prototype.deselect.call(this)},B.prototype.finishCreation=function(){for(var H=this.canvasContext.getImageData(0,0,this.canvasElement.width,this.canvasElement.height),Y=[this.canvasElement.width+1,this.canvasElement.height+1,-1,-1],le=Y[0],$=Y[1],Be=Y[2],nt=Y[3],mt=!1,wt=0;wt<this.canvasElement.height;wt++)for(var st=0;st<this.canvasElement.width;st++)H.data[wt*this.canvasElement.width*4+4*st+3]>0&&(mt=!0,wt<$&&($=wt),st<le&&(le=st),wt>nt&&(nt=wt),st>Be&&(Be=st));if(mt){this.left=le/this.pixelRatio,this.top=$/this.pixelRatio,this.width=(Be-le)/this.pixelRatio,this.height=(nt-$)/this.pixelRatio;var Rt=document.createElement("canvas");Rt.width=Be-le,Rt.height=nt-$,Rt.getContext("2d").putImageData(this.canvasContext.getImageData(le,$,Be-le,nt-$),0,0),this.drawingImgUrl=Rt.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},B.prototype.setDrawingImage=function(){Se.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),Se.setAttributes(this.drawingImage,[["href",this.drawingImgUrl]]),this.moveVisual({x:this.left,y:this.top})},B.prototype.setColor=function(H){this.color=H,this.colorChanged(H)},B.prototype.setLineWidth=function(H){this.lineWidth=H},Object.defineProperty(B.prototype,"toolboxPanels",{get:function(){return this.state==="new"||this.state==="creating"?[this.colorPanel,this.lineWidthPanel]:[]},enumerable:!1,configurable:!0}),B.prototype.getState=function(){var H=Object.assign({drawingImgUrl:this.drawingImgUrl},J.prototype.getState.call(this));return H.typeName=B.typeName,H},B.prototype.restoreState=function(H){this.createVisual(),J.prototype.restoreState.call(this,H),this.drawingImgUrl=H.drawingImgUrl,this.setDrawingImage()},B.prototype.scale=function(H,Y){J.prototype.scale.call(this,H,Y),this.setDrawingImage()},B.typeName="FreehandMarker",B.title="Freehand marker",B.icon='<svg viewBox="0 0 24 24"><path d="M9.75 20.85c1.78-.7 1.39-2.63.49-3.85-.89-1.25-2.12-2.11-3.36-2.94A9.817 9.817 0 014.54 12c-.28-.33-.85-.94-.27-1.06.59-.12 1.61.46 2.13.68.91.38 1.81.82 2.65 1.34l1.01-1.7C8.5 10.23 6.5 9.32 4.64 9.05c-1.06-.16-2.18.06-2.54 1.21-.32.99.19 1.99.77 2.77 1.37 1.83 3.5 2.71 5.09 4.29.34.33.75.72.95 1.18.21.44.16.47-.31.47-1.24 0-2.79-.97-3.8-1.61l-1.01 1.7c1.53.94 4.09 2.41 5.96 1.79m11.09-15.6c.22-.22.22-.58 0-.79l-1.3-1.3a.562.562 0 00-.78 0l-1.02 1.02 2.08 2.08M11 10.92V13h2.08l6.15-6.15-2.08-2.08L11 10.92z"/></svg>',B}(ve),_e=function(J){function B(H,Y,le){var $=J.call(this,H,le||'<svg viewBox="0 0 24 24"><path d="M8 14v4l-6-6 6-6v4h8V6l6 6-6 6v-4H8z"/></svg>')||this;return $.typeBoxes=[],$.currentType=Y,$.setCurrentType=$.setCurrentType.bind($),$}return Le(B,J),B.prototype.getUi=function(){var H=this,Y=document.createElement("div");Y.style.display="flex",Y.style.overflow="hidden",Y.style.flexGrow="2";for(var le=function(nt){var mt="both";switch(nt){case 0:mt="both";break;case 1:mt="start";break;case 2:mt="end";break;case 3:mt="none"}var wt=document.createElement("div");if(wt.style.display="flex",wt.style.flexGrow="2",wt.style.alignItems="center",wt.style.justifyContent="space-between",wt.style.padding="5px",wt.style.borderWidth="2px",wt.style.borderStyle="solid",wt.style.borderColor=mt===$.currentType?$.uiStyleSettings.toolboxAccentColor:"transparent",wt.addEventListener("click",function(){H.setCurrentType(mt,wt)}),Y.appendChild(wt),mt==="both"||mt==="start"){var st=document.createElement("div");st.style.display="flex",st.style.alignItems="center",st.style.minHeight="20px",st.innerHTML=`<svg viewBox="0 0 10 10" width="10" height="10" xmlns="http://www.w3.org/2000/svg">
|
|
|
<polygon points="0,5 10,0 10,10" fill="`+($.uiStyleSettings!==void 0?$.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
|
|
|
</svg>`,st.style.marginLeft="5px",wt.appendChild(st)}var Rt=document.createElement("div");Rt.style.display="flex",Rt.style.alignItems="center",Rt.style.minHeight="20px",Rt.style.flexGrow="2";var Vt=document.createElement("hr");if(Vt.style.minWidth="20px",Vt.style.border="0px",Vt.style.borderTop="3px solid "+($.uiStyleSettings!==void 0?$.uiStyleSettings.toolboxColor:"#eeeeee"),Vt.style.flexGrow="2",Rt.appendChild(Vt),wt.appendChild(Rt),mt==="both"||mt==="end"){var ri=document.createElement("div");ri.style.display="flex",ri.style.alignItems="center",ri.style.minHeight="20px",ri.innerHTML=`<svg viewBox="0 0 10 10" width="10" height="10" xmlns="http://www.w3.org/2000/svg">
|
|
|
<polygon points="0,0 10,5 0,10" fill="`+($.uiStyleSettings!==void 0?$.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
|
|
|
</svg>`,ri.style.marginRight="5px",wt.appendChild(ri)}$.typeBoxes.push(wt)},$=this,Be=0;Be<4;Be++)le(Be);return Y},B.prototype.setCurrentType=function(H,Y){var le=this;this.currentType=H,this.typeBoxes.forEach(function($){$.style.borderColor=$===Y?le.uiStyleSettings!==void 0?le.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"}),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},B}(fe),Ee=function(J){function B(H,Y,le){var $=J.call(this,H,Y,le)||this;return $.arrowType="end",$.arrowBaseHeight=10,$.arrowBaseWidth=10,$.getArrowPoints=$.getArrowPoints.bind($),$.setArrowType=$.setArrowType.bind($),$.arrowTypePanel=new _e("Arrow type","end"),$.arrowTypePanel.onArrowTypeChanged=$.setArrowType,$}return Le(B,J),B.prototype.ownsTarget=function(H){return!(!J.prototype.ownsTarget.call(this,H)&&H!==this.arrow1&&H!==this.arrow2)},B.prototype.getArrowPoints=function(H,Y){var le=this.arrowBaseWidth+2*this.strokeWidth,$=this.arrowBaseHeight+2*this.strokeWidth;return H-le/2+","+(Y+$/2)+" "+H+","+(Y-$/2)+" "+(H+le/2)+","+(Y+$/2)},B.prototype.createTips=function(){this.arrow1=Se.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(Se.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=Se.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(Se.createTransform()),this.visual.appendChild(this.arrow2)},B.prototype.pointerDown=function(H,Y){J.prototype.pointerDown.call(this,H,Y),this.state==="creating"&&this.createTips()},B.prototype.adjustVisual=function(){if(J.prototype.adjustVisual.call(this),this.arrow1&&this.arrow2&&(this.arrow1.style.display=this.arrowType==="both"||this.arrowType==="start"?"":"none",this.arrow2.style.display=this.arrowType==="both"||this.arrowType==="end"?"":"none",Se.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),Se.setAttributes(this.arrow2,[["points",this.getArrowPoints(this.x2,this.y2)],["fill",this.strokeColor]]),Math.abs(this.x1-this.x2)>.1)){var H=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),Y=this.arrow1.transform.baseVal.getItem(0);Y.setRotate(H,this.x1,this.y1),this.arrow1.transform.baseVal.replaceItem(Y,0);var le=this.arrow2.transform.baseVal.getItem(0);le.setRotate(H+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem(le,0)}},B.prototype.setArrowType=function(H){this.arrowType=H,this.adjustVisual(),this.stateChanged()},Object.defineProperty(B.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel,this.arrowTypePanel]},enumerable:!1,configurable:!0}),B.prototype.getState=function(){var H=Object.assign({arrowType:this.arrowType},J.prototype.getState.call(this));return H.typeName=B.typeName,H},B.prototype.restoreState=function(H){J.prototype.restoreState.call(this,H);var Y=H;this.arrowType=Y.arrowType,this.createTips(),this.adjustVisual()},B.typeName="ArrowMarker",B.title="Arrow marker",B.icon='<svg viewBox="0 0 24 24"><path d="M19 6.41L17.59 5 7 15.59V9H5v10h10v-2H8.41L19 6.41z"/></svg>',B}(ce),ee=function(J){function B(H,Y,le){var $=J.call(this,H,Y,le)||this;return $.fillColor=le.defaultFillColor,$.strokeWidth=0,$.fillPanel=new ge("Color",le.defaultColorSet,le.defaultFillColor),$.fillPanel.onColorChanged=$.setFillColor,$}return Le(B,J),Object.defineProperty(B.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),B.prototype.getState=function(){var H=J.prototype.getState.call(this);return H.typeName=B.typeName,H},B.typeName="CoverMarker",B.title="Cover marker",B.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4z"/></svg>',B}(ae),oe=function(J){function B(H,Y,le,$){var Be=J.call(this,H,$||'<svg viewBox="0 0 24 24"><path d="M17.66 8L12 2.35 6.34 8A8.02 8.02 0 004 13.64c0 2 .78 4.11 2.34 5.67a7.99 7.99 0 0011.32 0c1.56-1.56 2.34-3.67 2.34-5.67S19.22 9.56 17.66 8M6 14c0-2 .62-3.27 1.76-4.4L12 5.27l4.24 4.38C17.38 10.77 18 12 18 14H6z"/></svg>')||this;return Be.opacities=[],Be.opacityBoxes=[],Be.opacities=Y,Be.currentOpacity=le,Be.setCurrentOpacity=Be.setCurrentOpacity.bind(Be),Be}return Le(B,J),B.prototype.getUi=function(){var H=this,Y=document.createElement("div");return Y.style.display="flex",Y.style.overflow="hidden",Y.style.flexGrow="2",Y.style.justifyContent="space-between",this.opacities.forEach(function(le){var $=document.createElement("div");$.style.display="flex",$.style.alignItems="center",$.style.justifyContent="center",$.style.padding="5px",$.style.borderWidth="2px",$.style.borderStyle="solid",$.style.borderColor=le===H.currentOpacity?H.uiStyleSettings.toolboxAccentColor:"transparent",$.addEventListener("click",function(){H.setCurrentOpacity(le,$)}),Y.appendChild($);var Be=document.createElement("div");Be.innerText=100*le+"%",$.appendChild(Be),H.opacityBoxes.push($)}),Y},B.prototype.setCurrentOpacity=function(H,Y){var le=this;this.currentOpacity=H,this.opacityBoxes.forEach(function($){$.style.borderColor=$===Y?le.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},B}(fe),Q=function(J){function B(H,Y,le){var $=J.call(this,H,Y,le)||this;return $.setOpacity=$.setOpacity.bind($),$.fillColor=le.defaultHighlightColor,$.strokeWidth=0,$.opacity=le.defaultHighlightOpacity,$.fillPanel=new ge("Color",le.defaultColorSet,$.fillColor),$.fillPanel.onColorChanged=$.setFillColor,$.opacityPanel=new oe("Opacity",le.defaultOpacitySteps,$.opacity),$.opacityPanel.onOpacityChanged=$.setOpacity,$}return Le(B,J),B.prototype.setOpacity=function(H){this.opacity=H,this.visual&&Se.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(B.prototype,"toolboxPanels",{get:function(){return[this.fillPanel,this.opacityPanel]},enumerable:!1,configurable:!0}),B.prototype.getState=function(){var H=J.prototype.getState.call(this);return H.typeName=B.typeName,H},B.typeName="HighlightMarker",B.title="Highlight marker",B.icon='<svg viewBox="0 0 24 24"><path d="M18.5 1.15c-.53 0-1.04.19-1.43.58l-5.81 5.82 5.65 5.65 5.82-5.81c.77-.78.77-2.04 0-2.83l-2.84-2.83c-.39-.39-.89-.58-1.39-.58M10.3 8.5l-5.96 5.96c-.78.78-.78 2.04.02 2.85C3.14 18.54 1.9 19.77.67 21h5.66l.86-.86c.78.76 2.03.75 2.81-.02l5.95-5.96"/></svg>',B}(ee),me='<svg viewBox="0 0 24 24"><path d="M19 11.5s-2 2.17-2 3.5a2 2 0 002 2 2 2 0 002-2c0-1.33-2-3.5-2-3.5M5.21 10L10 5.21 14.79 10m1.77-1.06L7.62 0 6.21 1.41l2.38 2.38-5.15 5.15c-.59.56-.59 1.53 0 2.12l5.5 5.5c.29.29.68.44 1.06.44s.77-.15 1.06-.44l5.5-5.5c.59-.59.59-1.56 0-2.12z"/></svg>',Oe=function(J){function B(H,Y,le){var $=J.call(this,H,Y,le)||this;return $.bgColor="transparent",$.tipPosition={x:0,y:0},$.tipBase1Position={x:0,y:0},$.tipBase2Position={x:0,y:0},$.tipMoving=!1,$.color=le.defaultStrokeColor,$.bgColor=le.defaultFillColor,$.fontFamily=le.defaultFontFamily,$.defaultSize={x:100,y:30},$.setBgColor=$.setBgColor.bind($),$.getTipPoints=$.getTipPoints.bind($),$.positionTip=$.positionTip.bind($),$.setTipPoints=$.setTipPoints.bind($),$.colorPanel=new ge("Text color",le.defaultColorSet,$.color,'<svg viewBox="0 0 24 24"><path d="M9.62 12L12 5.67 14.37 12M11 3L5.5 17h2.25l1.12-3h6.25l1.13 3h2.25L13 3h-2z"/></svg>'),$.colorPanel.onColorChanged=$.setColor,$.bgColorPanel=new ge("Fill color",le.defaultColorSet,$.bgColor,me),$.bgColorPanel.onColorChanged=$.setBgColor,$.fontFamilyPanel=new Pe("Font",le.defaultFontFamilies,le.defaultFontFamily),$.fontFamilyPanel.onFontChanged=$.setFont,$.tipGrip=new Te,$.tipGrip.visual.transform.baseVal.appendItem(Se.createTransform()),$.controlBox.appendChild($.tipGrip.visual),$}return Le(B,J),B.prototype.ownsTarget=function(H){return J.prototype.ownsTarget.call(this,H)||this.tipGrip.ownsTarget(H)||this.tip===H},B.prototype.createTip=function(){Se.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=Se.createPolygon(this.getTipPoints(),[["fill",this.bgColor]]),this.visual.appendChild(this.tip)},B.prototype.pointerDown=function(H,Y){this.state==="new"&&J.prototype.pointerDown.call(this,H,Y),this.state==="creating"?this.createTip():this.tipGrip.ownsTarget(Y)?(this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.tipMoving=!0):J.prototype.pointerDown.call(this,H,Y)},B.prototype.pointerUp=function(H){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,J.prototype.pointerUp.call(this,H);else{var Y=this.state==="creating";J.prototype.pointerUp.call(this,H),this.setTipPoints(Y),this.positionTip()}},B.prototype.manipulate=function(H){if(this.tipMoving){var Y=this.unrotatePoint(H);this.tipPosition={x:Y.x-this.manipulationStartLeft,y:Y.y-this.manipulationStartTop},this.positionTip()}else J.prototype.manipulate.call(this,H)},B.prototype.setBgColor=function(H){this.bgRectangle&&this.tip&&(Se.setAttributes(this.bgRectangle,[["fill",H]]),Se.setAttributes(this.tip,[["fill",H]])),this.bgColor=H,this.fillColorChanged(H)},B.prototype.getTipPoints=function(){return this.setTipPoints(this.state==="creating"),this.tipBase1Position.x+","+this.tipBase1Position.y+" "+this.tipBase2Position.x+","+this.tipBase2Position.y+" "+this.tipPosition.x+","+this.tipPosition.y},B.prototype.setTipPoints=function(H){H===void 0&&(H=!1);var Y=Math.min(this.height/2,15),le=this.height/5;H&&(this.tipPosition={x:Y+le/2,y:this.height+20});var $=Math.atan(this.height/2/(this.width/2));this.tipPosition.x<this.width/2&&this.tipPosition.y<this.height/2?$<Math.atan((this.height/2-this.tipPosition.y)/(this.width/2-this.tipPosition.x))?(le=this.width/5,Y=Math.min(this.width/2,15),this.tipBase1Position={x:Y,y:0},this.tipBase2Position={x:Y+le,y:0}):(this.tipBase1Position={x:0,y:Y},this.tipBase2Position={x:0,y:Y+le}):this.tipPosition.x>=this.width/2&&this.tipPosition.y<this.height/2?$<Math.atan((this.height/2-this.tipPosition.y)/(this.tipPosition.x-this.width/2))?(le=this.width/5,Y=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-Y-le,y:0},this.tipBase2Position={x:this.width-Y,y:0}):(this.tipBase1Position={x:this.width,y:Y},this.tipBase2Position={x:this.width,y:Y+le}):this.tipPosition.x>=this.width/2&&this.tipPosition.y>=this.height/2?$<Math.atan((this.tipPosition.y-this.height/2)/(this.tipPosition.x-this.width/2))?(le=this.width/5,Y=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-Y-le,y:this.height},this.tipBase2Position={x:this.width-Y,y:this.height}):(this.tipBase1Position={x:this.width,y:this.height-Y-le},this.tipBase2Position={x:this.width,y:this.height-Y}):$<Math.atan((this.tipPosition.y-this.height/2)/(this.width/2-this.tipPosition.x))?(le=this.width/5,Y=Math.min(this.width/2,15),this.tipBase1Position={x:Y,y:this.height},this.tipBase2Position={x:Y+le,y:this.height}):(this.tipBase1Position={x:0,y:this.height-Y},this.tipBase2Position={x:0,y:this.height-Y-le})},B.prototype.resize=function(H){J.prototype.resize.call(this,H),this.positionTip()},B.prototype.positionTip=function(){Se.setAttributes(this.tip,[["points",this.getTipPoints()]]);var H=this.tipGrip.visual.transform.baseVal.getItem(0);H.setTranslate(this.tipPosition.x,this.tipPosition.y),this.tipGrip.visual.transform.baseVal.replaceItem(H,0)},Object.defineProperty(B.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.bgColorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),B.prototype.select=function(){this.positionTip(),J.prototype.select.call(this)},B.prototype.getState=function(){var H=Object.assign({bgColor:this.bgColor,tipPosition:this.tipPosition},J.prototype.getState.call(this));return H.typeName=B.typeName,H},B.prototype.restoreState=function(H){var Y=H;this.bgColor=Y.bgColor,this.tipPosition=Y.tipPosition,J.prototype.restoreState.call(this,H),this.createTip(),this.setTipPoints()},B.prototype.scale=function(H,Y){J.prototype.scale.call(this,H,Y),this.tipPosition={x:this.tipPosition.x*H,y:this.tipPosition.y*Y},this.positionTip()},B.typeName="CalloutMarker",B.title="Callout marker",B.icon='<svg viewBox="0 0 24 24"><path d="M4 2h16a2 2 0 012 2v12a2 2 0 01-2 2h-4l-4 4-4-4H4a2 2 0 01-2-2V4a2 2 0 012-2m0 2v12h4.83L12 19.17 15.17 16H20V4H4m2 3h12v2H6V7m0 4h10v2H6v-2z"/></svg>',B}(Fe),V=function(J){function B(H,Y,le){var $=J.call(this,H,Y,le)||this;return $.fillColor="transparent",$.strokeColor="transparent",$.strokeWidth=0,$.strokeDasharray="",$.opacity=1,$.strokeColor=le.defaultColor,$.strokeWidth=le.defaultStrokeWidth,$.strokeDasharray=le.defaultStrokeDasharray,$.fillColor=le.defaultFillColor,$.setStrokeColor=$.setStrokeColor.bind($),$.setFillColor=$.setFillColor.bind($),$.setStrokeWidth=$.setStrokeWidth.bind($),$.setStrokeDasharray=$.setStrokeDasharray.bind($),$.setOpacity=$.setOpacity.bind($),$.createVisual=$.createVisual.bind($),$.strokePanel=new ge("Line color",Ae(le.defaultColorSet,["transparent"]),le.defaultColor),$.strokePanel.onColorChanged=$.setStrokeColor,$.fillPanel=new ge("Fill color",Ae(le.defaultColorSet,["transparent"]),$.fillColor,me),$.fillPanel.onColorChanged=$.setFillColor,$.strokeWidthPanel=new Me("Line width",le.defaultStrokeWidths,le.defaultStrokeWidth),$.strokeWidthPanel.onWidthChanged=$.setStrokeWidth,$.strokeStylePanel=new Ye("Line style",le.defaultStrokeDasharrays,le.defaultStrokeDasharray),$.strokeStylePanel.onStyleChanged=$.setStrokeDasharray,$.opacityPanel=new oe("Opacity",le.defaultOpacitySteps,$.opacity),$.opacityPanel.onOpacityChanged=$.setOpacity,$}return Le(B,J),B.prototype.ownsTarget=function(H){return!(!J.prototype.ownsTarget.call(this,H)&&H!==this.visual)},B.prototype.createVisual=function(){this.visual=Se.createEllipse(this.width/2,this.height/2,[["fill",this.fillColor],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["stroke-dasharray",this.strokeDasharray],["opacity",this.opacity.toString()]]),this.addMarkerVisualToContainer(this.visual)},B.prototype.pointerDown=function(H,Y){J.prototype.pointerDown.call(this,H,Y),this.state==="new"&&(this.createVisual(),this.moveVisual(H),this._state="creating")},B.prototype.manipulate=function(H){J.prototype.manipulate.call(this,H)},B.prototype.resize=function(H){J.prototype.resize.call(this,H),this.setSize()},B.prototype.setSize=function(){J.prototype.setSize.call(this),Se.setAttributes(this.visual,[["cx",(this.width/2).toString()],["cy",(this.height/2).toString()],["rx",(this.width/2).toString()],["ry",(this.height/2).toString()]])},B.prototype.pointerUp=function(H){J.prototype.pointerUp.call(this,H),this.setSize()},B.prototype.setStrokeColor=function(H){this.strokeColor=H,this.visual&&Se.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(H),this.stateChanged()},B.prototype.setFillColor=function(H){this.fillColor=H,this.visual&&Se.setAttributes(this.visual,[["fill",this.fillColor]]),this.fillColorChanged(H),this.stateChanged()},B.prototype.setStrokeWidth=function(H){this.strokeWidth=H,this.visual&&Se.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},B.prototype.setStrokeDasharray=function(H){this.strokeDasharray=H,this.visual&&Se.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},B.prototype.setOpacity=function(H){this.opacity=H,this.visual&&Se.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(B.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.fillPanel,this.strokeWidthPanel,this.strokeStylePanel,this.opacityPanel]},enumerable:!1,configurable:!0}),B.prototype.getState=function(){var H=Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},J.prototype.getState.call(this));return H.typeName=B.typeName,H},B.prototype.restoreState=function(H){var Y=H;this.fillColor=Y.fillColor,this.strokeColor=Y.strokeColor,this.strokeWidth=Y.strokeWidth,this.strokeDasharray=Y.strokeDasharray,this.opacity=Y.opacity,this.createVisual(),J.prototype.restoreState.call(this,H),this.setSize()},B.prototype.scale=function(H,Y){J.prototype.scale.call(this,H,Y),this.setSize()},B.typeName="EllipseMarker",B.title="Ellipse marker",B.icon='<svg viewBox="0 0 24 24"><path d="M12 4C6.5 4 2 7.58 2 12s4.5 8 10 8 10-3.58 10-8-4.5-8-10-8z"/></svg>',B}(ve),Re=function(J){function B(H,Y,le){return J.call(this,H,Y,le)||this}return Le(B,J),Object.defineProperty(B.prototype,"tipLength",{get:function(){return 10+3*this.strokeWidth},enumerable:!1,configurable:!0}),B.prototype.ownsTarget=function(H){return!(!J.prototype.ownsTarget.call(this,H)&&H!==this.tip1&&H!==this.tip2)},B.prototype.createTips=function(){this.tip1=Se.createLine(this.x1-this.tipLength/2,this.y1,this.x1+this.tipLength/2,this.y1,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.tip1.transform.baseVal.appendItem(Se.createTransform()),this.visual.appendChild(this.tip1),this.tip2=Se.createLine(this.x2-this.tipLength/2,this.y2,this.x2+this.tipLength/2,this.y2,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.tip2.transform.baseVal.appendItem(Se.createTransform()),this.visual.appendChild(this.tip2)},B.prototype.pointerDown=function(H,Y){J.prototype.pointerDown.call(this,H,Y),this.state==="creating"&&this.createTips()},B.prototype.adjustVisual=function(){if(J.prototype.adjustVisual.call(this),this.tip1&&this.tip2&&(Se.setAttributes(this.tip1,[["x1",(this.x1-this.tipLength/2).toString()],["y1",this.y1.toString()],["x2",(this.x1+this.tipLength/2).toString()],["y2",this.y1.toString()],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),Se.setAttributes(this.tip2,[["x1",(this.x2-this.tipLength/2).toString()],["y1",this.y2.toString()],["x2",(this.x2+this.tipLength/2).toString()],["y2",this.y2.toString()],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),Math.abs(this.x1-this.x2)>.1)){var H=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),Y=this.tip1.transform.baseVal.getItem(0);Y.setRotate(H,this.x1,this.y1),this.tip1.transform.baseVal.replaceItem(Y,0);var le=this.tip2.transform.baseVal.getItem(0);le.setRotate(H+180,this.x2,this.y2),this.tip2.transform.baseVal.replaceItem(le,0)}},Object.defineProperty(B.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),B.prototype.getState=function(){var H=J.prototype.getState.call(this);return H.typeName=B.typeName,H},B.prototype.restoreState=function(H){J.prototype.restoreState.call(this,H),this.createTips(),this.adjustVisual()},B.typeName="MeasurementMarker",B.title="Measurement marker",B.icon='<svg viewBox="0 0 24 24"><path d="M1.39 18.36l1.77-1.76L4.58 18l1.06-1.05-1.42-1.41 1.42-1.42 2.47 2.48 1.06-1.06-2.47-2.48 1.41-1.41 1.42 1.41L10.59 12l-1.42-1.41 1.42-1.42 2.47 2.48 1.06-1.06-2.47-2.48 1.41-1.41 1.41 1.41 1.07-1.06-1.42-1.41 1.42-1.42L18 6.7l1.07-1.06-2.47-2.48 1.76-1.77 4.25 4.25L5.64 22.61l-4.25-4.25z"/></svg>',B}(ce),Xe=function(J){function B(H,Y,le){var $=J.call(this,H,Y,le)||this;return $.strokePanel.colors=le.defaultColorSet,$.fillColor="transparent",$}return Le(B,J),Object.defineProperty(B.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),B.prototype.getState=function(){var H=J.prototype.getState.call(this);return H.typeName=B.typeName,H},B.typeName="EllipseFrameMarker",B.title="Ellipse frame marker",B.icon='<svg viewBox="0 0 24 24"><path d="M12 6c4.41 0 8 2.69 8 6s-3.59 6-8 6-8-2.69-8-6 3.59-6 8-6m0-2C6.5 4 2 7.58 2 12s4.5 8 10 8 10-3.58 10-8-4.5-8-10-8z"/></svg>',B}(V),pe=function(){function J(){this.undoStack=[],this.redoStack=[]}return Object.defineProperty(J.prototype,"isUndoPossible",{get:function(){return this.undoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"isRedoPossible",{get:function(){return this.redoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"undoStepCount",{get:function(){return this.undoStack.length},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"redoStepCount",{get:function(){return this.redoStack.length},enumerable:!1,configurable:!0}),J.prototype.addUndoStep=function(B){this.undoStack.length!==0&&JSON.stringify(this.undoStack[this.undoStack.length-1])===JSON.stringify(B)||(this.undoStack.push(B),JSON.stringify(this.lastRedoStep)!==JSON.stringify(B)&&this.redoStack.splice(0,this.redoStack.length))},J.prototype.replaceLastUndoStep=function(B){this.undoStack.length>0&&(this.undoStack[this.undoStack.length-1]=B)},J.prototype.getLastUndoStep=function(){return this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0},J.prototype.undo=function(){if(this.undoStack.length>1){var B=this.undoStack.pop();return B!==void 0&&this.redoStack.push(B),this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0}},J.prototype.redo=function(){return this.lastRedoStep=this.redoStack.pop(),this.lastRedoStep},J}(),ke=function(J){function B(H,Y,le){var $=J.call(this,H,Y,le)||this;return $.strokeColor="transparent",$.strokeWidth=0,$.strokeDasharray="",$.curveX=0,$.curveY=0,$.manipulationStartCurveX=0,$.manipulationStartCurveY=0,$.setStrokeColor=$.setStrokeColor.bind($),$.setStrokeWidth=$.setStrokeWidth.bind($),$.setStrokeDasharray=$.setStrokeDasharray.bind($),$.positionGrips=$.positionGrips.bind($),$.addControlGrips=$.addControlGrips.bind($),$.adjustVisual=$.adjustVisual.bind($),$.setupControlBox=$.setupControlBox.bind($),$.resize=$.resize.bind($),$.strokeColor=le.defaultColor,$.strokeWidth=le.defaultStrokeWidth,$.strokeDasharray=le.defaultStrokeDasharray,$.strokePanel=new ge("Line color",le.defaultColorSet,le.defaultColor),$.strokePanel.onColorChanged=$.setStrokeColor,$.strokeWidthPanel=new Me("Line width",le.defaultStrokeWidths,le.defaultStrokeWidth),$.strokeWidthPanel.onWidthChanged=$.setStrokeWidth,$.strokeStylePanel=new Ye("Line style",le.defaultStrokeDasharrays,le.defaultStrokeDasharray),$.strokeStylePanel.onStyleChanged=$.setStrokeDasharray,$}return Le(B,J),B.prototype.ownsTarget=function(H){return!(!J.prototype.ownsTarget.call(this,H)&&H!==this.visual&&H!==this.selectorCurve&&H!==this.visibleCurve&&!this.curveGrip.ownsTarget(H))},B.prototype.getPathD=function(){return"M "+this.x1+" "+this.y1+" Q "+this.curveX+" "+this.curveY+", "+this.x2+" "+this.y2},B.prototype.createVisual=function(){this.visual=Se.createGroup(),this.selectorCurve=Se.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=Se.createPath(this.getPathD(),[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["fill","transparent"]]),this.visual.appendChild(this.selectorCurve),this.visual.appendChild(this.visibleCurve),this.addMarkerVisualToContainer(this.visual)},B.prototype.pointerDown=function(H,Y){J.prototype.pointerDown.call(this,H,Y),this.manipulationStartCurveX=this.curveX,this.manipulationStartCurveY=this.curveY,this.state==="new"&&(this.curveX=H.x,this.curveY=H.y),this.state==="new"?(this.createVisual(),this.adjustVisual(),this._state="creating"):this.curveGrip.ownsTarget(Y)&&(this.activeGrip=this.curveGrip,this._state="resize")},B.prototype.adjustVisual=function(){this.selectorCurve&&this.visibleCurve&&(this.selectorCurve.setAttribute("d",this.getPathD()),this.visibleCurve.setAttribute("d",this.getPathD()),Se.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),Se.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),Se.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},B.prototype.setupControlBox=function(){J.prototype.setupControlBox.call(this),this.curveControlLine1=Se.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=Se.createLine(this.x2,this.y2,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.controlBox.insertBefore(this.curveControlLine1,this.controlBox.firstChild),this.controlBox.insertBefore(this.curveControlLine2,this.controlBox.firstChild)},B.prototype.addControlGrips=function(){this.curveGrip=this.createGrip(),this.curveX=0,this.curveY=0,J.prototype.addControlGrips.call(this)},B.prototype.positionGrips=function(){J.prototype.positionGrips.call(this);var H=this.curveGrip.GRIP_SIZE;this.positionGrip(this.curveGrip.visual,this.curveX-H/2,this.curveY-H/2),this.curveControlLine1&&this.curveControlLine2&&(this.curveControlLine1.setAttribute("x1",this.x1.toString()),this.curveControlLine1.setAttribute("y1",this.y1.toString()),this.curveControlLine1.setAttribute("x2",this.curveX.toString()),this.curveControlLine1.setAttribute("y2",this.curveY.toString()),this.curveControlLine2.setAttribute("x1",this.x2.toString()),this.curveControlLine2.setAttribute("y1",this.y2.toString()),this.curveControlLine2.setAttribute("x2",this.curveX.toString()),this.curveControlLine2.setAttribute("y2",this.curveY.toString()))},B.prototype.manipulate=function(H){this.state==="move"&&(this.curveX=this.manipulationStartCurveX+H.x-this.manipulationStartX,this.curveY=this.manipulationStartCurveY+H.y-this.manipulationStartY),J.prototype.manipulate.call(this,H)},B.prototype.resize=function(H){this.activeGrip===this.curveGrip&&(this.curveX=H.x,this.curveY=H.y),J.prototype.resize.call(this,H),this.state==="creating"&&(this.curveX=this.x1+(this.x2-this.x1)/2,this.curveY=this.y1+(this.y2-this.y1)/2)},B.prototype.setStrokeColor=function(H){this.strokeColor=H,this.adjustVisual(),this.colorChanged(H)},B.prototype.setStrokeWidth=function(H){this.strokeWidth=H,this.adjustVisual()},B.prototype.setStrokeDasharray=function(H){this.strokeDasharray=H,this.adjustVisual()},B.prototype.scale=function(H,Y){this.curveX=this.curveX*H,this.curveY=this.curveY*Y,J.prototype.scale.call(this,H,Y)},Object.defineProperty(B.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),B.prototype.getState=function(){var H=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,curveX:this.curveX,curveY:this.curveY},J.prototype.getState.call(this));return H.typeName=B.typeName,H},B.prototype.restoreState=function(H){J.prototype.restoreState.call(this,H);var Y=H;this.strokeColor=Y.strokeColor,this.strokeWidth=Y.strokeWidth,this.strokeDasharray=Y.strokeDasharray,this.curveX=Y.curveX,this.curveY=Y.curveY,this.createVisual(),this.adjustVisual()},B.typeName="CurveMarker",B.title="Curve marker",B.icon='<svg viewBox="0 0 24 24"><path d="M18.5 2A1.5 1.5 0 0120 3.5 1.5 1.5 0 0118.5 5c-.23 0-.45-.05-.65-.15l-3.69 3.7.34.45c2.19-1.26 4.76-2 7.5-2l1 .03v2.01L22 9c-2.58 0-5 .75-7 2.04A3.96 3.96 0 0111.04 15C9.75 17 9 19.42 9 22l.04 1H7.03L7 22c0-2.74.74-5.31 2-7.5l-.45-.34-3.7 3.69c.1.2.15.42.15.65A1.5 1.5 0 013.5 20 1.5 1.5 0 012 18.5 1.5 1.5 0 013.5 17c.23 0 .45.05.65.15l3.69-3.7C7.31 12.78 7 11.92 7 11a4 4 0 014-4c.92 0 1.78.31 2.45.84l3.7-3.69c-.1-.2-.15-.42-.15-.65A1.5 1.5 0 0118.5 2M11 9a2 2 0 00-2 2 2 2 0 002 2 2 2 0 002-2 2 2 0 00-2-2z"/></svg>',B}(ot),Ve=function(){function J(B,H){H===void 0&&(H=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=B,this.cancelable=H}return Object.defineProperty(J.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),J.prototype.preventDefault=function(){this._defaultPrevented=!0},J}(),ht=function(J){function B(H,Y,le){var $=J.call(this,H,!1)||this;return $.dataUrl=Y,$.state=le,$}return Le(B,J),B}(Ve),tt=function(J){function B(H,Y,le){le===void 0&&(le=!1);var $=J.call(this,H,le)||this;return $.marker=Y,$}return Le(B,J),B}(Ve),at=function(){function J(){this.render=[],this.beforeclose=[],this.close=[],this.show=[],this.restorestate=[],this.statechange=[],this.markerselect=[],this.markerdeselect=[],this.markercreating=[],this.markercreate=[],this.markerbeforedelete=[],this.markerdelete=[],this.markerchange=[],this.focus=[],this.blur=[]}return J.prototype.addEventListener=function(B,H){this[B].push(H)},J.prototype.removeEventListener=function(B,H){var Y=this[B].indexOf(H);Y>-1&&this[B].splice(Y,1)},J}(),ut=function(){function J(B){this.touchPoints=0,this._availableMarkerTypes=this.DEFAULT_MARKER_TYPES,this.mode="select",this.markers=[],this.isDragging=!1,this.renderEventListeners=[],this.closeEventListeners=[],this.settings=new je,this._isOpen=!1,this.undoRedoManager=new pe,this.renderAtNaturalSize=!1,this.renderImageType="image/png",this.renderMarkersOnly=!1,this.zoomSteps=[1,1.5,2,4],this._zoomLevel=1,this._isResizing=!1,this.prevPanPoint={x:0,y:0},this.eventListeners=new at,this._silentRenderMode=!1,this._isFocused=!1,this._instanceNo=J.instanceCounter++,this.styles=new Ge(this.instanceNo),this.uiStyleSettings=this.styles.settings,this.target=B,this.targetRoot=document.body,this.width=B.clientWidth,this.height=B.clientHeight,this.styles.removeStyleSheet(),this.open=this.open.bind(this),this.setTopLeft=this.setTopLeft.bind(this),this.toolbarButtonClicked=this.toolbarButtonClicked.bind(this),this.createNewMarker=this.createNewMarker.bind(this),this.addNewMarker=this.addNewMarker.bind(this),this.markerCreated=this.markerCreated.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onDblClick=this.onDblClick.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.onPointerOut=this.onPointerOut.bind(this),this.onKeyUp=this.onKeyUp.bind(this),this.overrideOverflow=this.overrideOverflow.bind(this),this.restoreOverflow=this.restoreOverflow.bind(this),this.close=this.close.bind(this),this.closeUI=this.closeUI.bind(this),this.addCloseEventListener=this.addCloseEventListener.bind(this),this.removeCloseEventListener=this.removeCloseEventListener.bind(this),this.addRenderEventListener=this.addRenderEventListener.bind(this),this.removeRenderEventListener=this.removeRenderEventListener.bind(this),this.clientToLocalCoordinates=this.clientToLocalCoordinates.bind(this),this.onWindowResize=this.onWindowResize.bind(this),this.deleteSelectedMarker=this.deleteSelectedMarker.bind(this),this.setWindowHeight=this.setWindowHeight.bind(this),this.removeMarker=this.removeMarker.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this),this.onPopupTargetResize=this.onPopupTargetResize.bind(this),this.showNotesEditor=this.showNotesEditor.bind(this),this.hideNotesEditor=this.hideNotesEditor.bind(this),this.stepZoom=this.stepZoom.bind(this),this.focus=this.focus.bind(this),this.blur=this.blur.bind(this),this.markerStateChanged=this.markerStateChanged.bind(this),this.switchToSelectMode=this.switchToSelectMode.bind(this),this.addDefs=this.addDefs.bind(this),this.addDefsToImage=this.addDefsToImage.bind(this)}return Object.defineProperty(J.prototype,"ALL_MARKER_TYPES",{get:function(){return[et,Ce,Ee,Fe,Xe,V,Q,Oe,Re,ee,ce,ke]},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[et,Ce,Ee,Fe,V,Q,Oe]},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"BASIC_MARKER_TYPES",{get:function(){return[et,Ce,Ee,Fe,Q]},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"availableMarkerTypes",{get:function(){return this._availableMarkerTypes},set:function(B){var H=this;this._availableMarkerTypes.splice(0),B.forEach(function(Y){if(typeof Y=="string"){var le=H.ALL_MARKER_TYPES.find(function($){return $.typeName===Y});le!==void 0&&H._availableMarkerTypes.push(le)}else H._availableMarkerTypes.push(Y)})},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"currentMarker",{get:function(){return this._currentMarker},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"isUndoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isUndoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"isRedoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isRedoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"zoomLevel",{get:function(){return this._zoomLevel},set:function(B){this._zoomLevel=B,this.editorCanvas&&this.contentDiv&&(this.editorCanvas.style.transform="scale("+this._zoomLevel+")",this.contentDiv.scrollTo({left:(this.editorCanvas.clientWidth*this._zoomLevel-this.contentDiv.clientWidth)/2,top:(this.editorCanvas.clientHeight*this._zoomLevel-this.contentDiv.clientHeight)/2}))},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),J.prototype.open=function(){this.setupResizeObserver(),this.setEditingTarget(),this.setTopLeft(),this.initMarkerCanvas(),this.initOverlay(),this.attachEvents(),this.settings.displayMode==="popup"&&this.onPopupTargetResize(),he.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},J.prototype.show=function(){var B=this;this.styles.styleSheetRoot===void 0&&ye.styleSheetRoot!==void 0&&(this.styles.styleSheetRoot=ye.styleSheetRoot),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach(function(H){return H(new Ve(B))})},J.prototype.render=function(){return Ke(this,void 0,void 0,function(){var B;return He(this,function(H){switch(H.label){case 0:return this.setCurrentMarker(),(B=new Ie).naturalSize=this.renderAtNaturalSize,B.imageType=this.renderImageType,B.imageQuality=this.renderImageQuality,B.markersOnly=this.renderMarkersOnly,B.width=this.renderWidth,B.height=this.renderHeight,[4,B.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 1:return H.sent(),[4,B.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 2:return[2,H.sent()]}})})},J.prototype.close=function(B){var H=this;if(B===void 0&&(B=!1),this.isOpen){var Y=!1;B||this.eventListeners.beforeclose.forEach(function(le){var $=new Ve(H,!0);le($),$.defaultPrevented&&(Y=!0)}),Y||(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.settings.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),this.eventListeners.close.forEach(function(le){return le(new Ve(H))}),this.detachEvents(),this._isOpen=!1)}},J.prototype.addMarkersToToolbar=function(){for(var B,H=[],Y=0;Y<arguments.length;Y++)H[Y]=arguments[Y];(B=this._availableMarkerTypes).push.apply(B,H)},J.prototype.addRenderEventListener=function(B){this.addEventListener("render",function(H){B(H.dataUrl,H.state)})},J.prototype.removeRenderEventListener=function(B){},J.prototype.addCloseEventListener=function(B){this.addEventListener("close",function(){B()})},J.prototype.removeCloseEventListener=function(B){},J.prototype.setupResizeObserver=function(){var B=this;this.settings.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){B.resize(B.target.clientWidth,B.target.clientHeight)}),this.targetObserver.observe(this.target)):this.settings.displayMode==="popup"&&(window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){return B.onPopupTargetResize()}),this.targetObserver.observe(this.editorCanvas)),window.addEventListener("resize",this.setWindowHeight))},J.prototype.onPopupTargetResize=function(){var B=1*this.target.clientWidth/this.target.clientHeight,H=this.editorCanvas.clientWidth/B>this.editorCanvas.clientHeight?this.editorCanvas.clientHeight*B:this.editorCanvas.clientWidth,Y=H<this.editorCanvas.clientWidth?this.editorCanvas.clientHeight:this.editorCanvas.clientWidth/B;this.resize(H,Y)},J.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},J.prototype.resize=function(B,H){this._isResizing=!0;var Y=B/this.imageWidth,le=H/this.imageHeight;this.imageWidth=Math.round(B),this.imageHeight=Math.round(H),this.target instanceof HTMLImageElement&&this.editingTarget instanceof HTMLImageElement&&(this.editingTarget.src=this.target.src),this.editingTarget.width=this.imageWidth,this.editingTarget.height=this.imageHeight,this.editingTarget.style.width=this.imageWidth+"px",this.editingTarget.style.height=this.imageHeight+"px",this.markerImage.setAttribute("width",this.imageWidth.toString()),this.markerImage.setAttribute("height",this.imageHeight.toString()),this.markerImage.setAttribute("viewBox","0 0 "+this.imageWidth.toString()+" "+this.imageHeight.toString()),this.markerImageHolder.style.width=this.imageWidth+"px",this.markerImageHolder.style.height=this.imageHeight+"px",this.overlayContainer.style.width=this.imageWidth+"px",this.overlayContainer.style.height=this.imageHeight+"px",this.settings.displayMode!=="popup"?this.coverDiv.style.width=this.imageWidth.toString()+"px":(this.setTopLeft(),this.positionMarkerImage()),this.toolbar!==void 0&&this.toolbar.adjustLayout(),this.positionLogo(),this.scaleMarkers(Y,le),this._isResizing=!1},J.prototype.scaleMarkers=function(B,H){var Y,le=this;this._currentMarker&&this._currentMarker instanceof Fe?this._currentMarker.scale(B,H):(Y=this._currentMarker,this.setCurrentMarker()),this.markers.forEach(function($){$!==le._currentMarker&&$.scale(B,H)}),Y!==void 0&&this.setCurrentMarker(Y)},J.prototype.setEditingTarget=function(){this.imageWidth=Math.round(this.target.clientWidth),this.imageHeight=Math.round(this.target.clientHeight),this.target instanceof HTMLImageElement&&this.editingTarget instanceof HTMLImageElement&&(this.editingTarget.src=this.target.src),this.editingTarget.width=this.imageWidth,this.editingTarget.height=this.imageHeight,this.editingTarget.style.width=this.imageWidth+"px",this.editingTarget.style.height=this.imageHeight+"px"},J.prototype.setTopLeft=function(){var B=this.editingTarget.getBoundingClientRect(),H=this.editorCanvas.getBoundingClientRect();this.left=B.left-H.left,this.top=B.top-H.top},J.prototype.initMarkerCanvas=function(){this.markerImageHolder=document.createElement("div"),this.markerImageHolder.style.setProperty("touch-action","pinch-zoom"),this.markerImage=document.createElementNS("http://www.w3.org/2000/svg","svg"),this.markerImage.setAttribute("xmlns","http://www.w3.org/2000/svg"),this.markerImage.setAttribute("width",this.imageWidth.toString()),this.markerImage.setAttribute("height",this.imageHeight.toString()),this.markerImage.setAttribute("viewBox","0 0 "+this.imageWidth.toString()+" "+this.imageHeight.toString()),this.markerImage.style.pointerEvents="auto",this.markerImageHolder.style.position="absolute",this.markerImageHolder.style.width=this.imageWidth+"px",this.markerImageHolder.style.height=this.imageHeight+"px",this.markerImageHolder.style.transformOrigin="top left",this.positionMarkerImage(),this.markerImageHolder.appendChild(this.markerImage),this.editorCanvas.appendChild(this.markerImageHolder)},J.prototype.addDefs=function(){for(var B,H=[],Y=0;Y<arguments.length;Y++)H[Y]=arguments[Y];this.defs=Se.createDefs(),this.addDefsToImage(),(B=this.defs).append.apply(B,H)},J.prototype.addDefsToImage=function(){this.defs&&this.markerImage.insertBefore(this.defs,this.markerImage.firstChild)},J.prototype.initOverlay=function(){this.overlayContainer=document.createElement("div"),this.overlayContainer.style.position="absolute",this.overlayContainer.style.left="0px",this.overlayContainer.style.top="0px",this.overlayContainer.style.width=this.imageWidth+"px",this.overlayContainer.style.height=this.imageHeight+"px",this.overlayContainer.style.display="flex",this.markerImageHolder.appendChild(this.overlayContainer)},J.prototype.positionMarkerImage=function(){this.markerImageHolder.style.top=this.top/this.zoomLevel+"px",this.markerImageHolder.style.left=this.left/this.zoomLevel+"px"},J.prototype.attachEvents=function(){this.markerImage.addEventListener("pointerdown",this.onPointerDown),this.markerImage.addEventListener("dblclick",this.onDblClick),this.attachWindowEvents()},J.prototype.attachWindowEvents=function(){window.addEventListener("pointermove",this.onPointerMove),window.addEventListener("pointerup",this.onPointerUp),window.addEventListener("pointercancel",this.onPointerOut),window.addEventListener("pointerout",this.onPointerOut),window.addEventListener("pointerleave",this.onPointerUp),window.addEventListener("resize",this.onWindowResize),window.addEventListener("keyup",this.onKeyUp)},J.prototype.detachEvents=function(){this.markerImage.removeEventListener("pointerdown",this.onPointerDown),this.markerImage.removeEventListener("dblclick",this.onDblClick),this.detachWindowEvents()},J.prototype.detachWindowEvents=function(){window.removeEventListener("pointermove",this.onPointerMove),window.removeEventListener("pointerup",this.onPointerUp),window.removeEventListener("pointercancel",this.onPointerOut),window.removeEventListener("pointerout",this.onPointerOut),window.removeEventListener("pointerleave",this.onPointerUp),window.removeEventListener("resize",this.onWindowResize),window.removeEventListener("keyup",this.onKeyUp)},J.prototype.addLogo=function(){this.logoUI=document.createElement("div"),this.logoUI.style.display="inline-block",this.logoUI.style.margin="0px",this.logoUI.style.padding="0px",this.logoUI.style.fill="#333333";var B=document.createElement("a");B.href="https://markerjs.com/",B.target="_blank",B.innerHTML='<svg viewBox="0 0 112 96" xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="1.414"><path fill="#e5f20d" fill-opacity=".647" d="M0 40.386h111.96V95.62H0z"/><path d="M93.61 61.452c0 .987-.328 1.831-.987 2.53-.657.7-1.52 1.048-2.591 1.048-1.481 0-2.222-.74-2.222-2.22 0-16.617-.533-29.347-1.604-38.192-1.068-8.842-2.92-13.265-5.552-13.265-4.443 0-10.94 15.509-19.497 46.52v.124c0 .987-.328 1.831-.987 2.53-.657.7-1.52 1.048-2.592 1.048-1.48 0-2.22-.74-2.22-2.22 0-3.29.165-8.392.493-15.302.33-7.732.494-13.82.494-18.262 0-6.17-.186-10.55-.556-13.142-.37-2.591-1.172-3.887-2.406-3.887-2.796 0-6.333 5.12-10.612 15.363C38.494 34.367 34.01 46.44 29.32 60.34l-1.11 3.209a5.714 5.714 0 01-1.42 2.097c-.617.578-1.295.864-2.036.864-.987 0-1.644-.081-1.974-.247-.328-.162-.533-.656-.617-1.48-.41-4.03-.74-9.418-.987-16.165-.163-1.728-.329-4.566-.494-8.515-.822-13.901-1.562-23.3-2.221-28.196-.657-4.893-.987-7.628-.987-8.205 0-.657.33-1.44.987-2.345.659-.903 1.276-1.357 1.85-1.357 1.319 0 2.387.947 3.21 2.838.411.906.863 4.526 1.357 10.859.493 6.335.905 14.19 1.233 23.568l.617 18.88c4.527-13.983 9.216-26.673 14.068-38.068C45.65 6.686 50.093.988 54.123.988c2.715 0 4.566 1.974 5.553 5.923.987 3.949 1.481 9.667 1.481 17.152 0 3.949-.081 9.625-.247 17.029l-.123 5.676c3.373-11.762 6.725-21.634 10.057-29.615 3.331-7.979 6.685-11.97 10.056-11.97 8.475 0 12.71 18.757 12.71 56.269z" fill-rule="nonzero"/></svg>',B.title="Powered by marker.js",B.style.display="grid",B.style.alignItems="center",B.style.justifyItems="center",B.style.padding="3px",B.style.width="20px",B.style.height="20px",this.logoUI.appendChild(B),this.editorCanvas.appendChild(this.logoUI),this.logoUI.style.position="absolute",this.logoUI.style.pointerEvents="all",this.positionLogo()},J.prototype.positionLogo=function(){this.logoUI&&(this.uiStyleSettings.logoPosition!=="right"?this.logoUI.style.left=this.markerImageHolder.offsetLeft+10+"px":this.logoUI.style.left=this.markerImageHolder.offsetLeft+this.markerImageHolder.offsetWidth-this.logoUI.clientWidth-10+"px",this.logoUI.style.top=this.markerImageHolder.offsetTop+this.markerImageHolder.offsetHeight-this.logoUI.clientHeight-10+"px")},J.prototype.overrideOverflow=function(){this.scrollXState=window.scrollX,this.scrollYState=window.scrollY,this.bodyOverflowState=document.body.style.overflow,window.scroll({top:0,left:0}),document.body.style.overflow="hidden"},J.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},J.prototype.showUI=function(){switch(this.settings.displayMode==="popup"&&this.overrideOverflow(),this.coverDiv=document.createElement("div"),this.coverDiv.style.visibility=this._silentRenderMode?"hidden":"visible",this.coverDiv.className=this.styles.classNamePrefixBase+" "+this.styles.classNamePrefix,this.coverDiv.style.fontSize="16px",this.coverDiv.style.userSelect="none",this.settings.displayMode){case"inline":this.coverDiv.style.position="absolute";var B=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=B+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px",this.coverDiv.style.width=this.target.offsetWidth.toString()+"px",this.coverDiv.style.zIndex=this.uiStyleSettings.zIndex!==void 0?this.uiStyleSettings.zIndex:"5";break;case"popup":this.coverDiv.style.position="absolute",this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=window.innerHeight+"px",this.coverDiv.style.backgroundColor="rgba(0, 0, 0, 0.75)",this.coverDiv.style.zIndex=this.uiStyleSettings.zIndex!==void 0?this.uiStyleSettings.zIndex:"1000",this.coverDiv.style.display="flex"}this.targetRoot.appendChild(this.coverDiv),this.uiDiv=document.createElement("div"),this.uiDiv.style.display="flex",this.uiDiv.style.flexDirection="column",this.uiDiv.style.flexGrow="2",this.uiDiv.style.margin=this.settings.displayMode==="popup"?this.settings.popupMargin+"px":"0px",this.uiDiv.style.border="0px",this.coverDiv.appendChild(this.uiDiv),this.toolbar=new Je(this.uiDiv,this.settings.displayMode,this._availableMarkerTypes,this.uiStyleSettings,this.styles),this.toolbar.addButtonClickListener(this.toolbarButtonClicked),this.toolbar.show(this._silentRenderMode||this.uiStyleSettings.hideToolbar?"hidden":"visible"),this.contentDiv=document.createElement("div"),this.contentDiv.style.display="flex",this.contentDiv.style.flexDirection="row",this.contentDiv.style.flexGrow="2",this.contentDiv.style.flexShrink="1",this.settings.displayMode==="popup"&&(this.contentDiv.style.backgroundColor=this.uiStyleSettings.canvasBackgroundColor,this.contentDiv.style.maxHeight=this.windowHeight-2*this.settings.popupMargin-3.5*this.uiStyleSettings.toolbarHeight+"px",this.contentDiv.style.maxWidth="calc(100vw - "+2*this.settings.popupMargin+"px)"),this.contentDiv.style.overflow="auto",this.uiDiv.appendChild(this.contentDiv),this.editorCanvas=document.createElement("div"),this.editorCanvas.style.flexGrow="2",this.editorCanvas.style.flexShrink="1",this.editorCanvas.style.position="relative",this.editorCanvas.style.overflow="hidden",this.editorCanvas.style.display="flex",this.settings.displayMode==="popup"&&(this.editorCanvas.style.alignItems="center",this.editorCanvas.style.justifyContent="center"),this.editorCanvas.style.pointerEvents="none",this.editorCanvas.style.transformOrigin="left top",this.editorCanvas.style.transform="scale("+this.zoomLevel+")",this.contentDiv.appendChild(this.editorCanvas),this.editingTarget=this.target instanceof HTMLImageElement?document.createElement("img"):document.createElement("canvas"),this.target.getClientRects().item(0).y<this.styles.settings.toolbarHeight&&(this.editingTarget.style.marginTop=this.target.offsetTop-this.styles.settings.toolbarHeight+"px"),this.editorCanvas.appendChild(this.editingTarget),this.toolbox=new Qe(this.uiDiv,this.settings.displayMode,this.uiStyleSettings,this.styles),this.toolbox.show(this._silentRenderMode||this.uiStyleSettings.hideToolbox?"hidden":"visible")},J.prototype.closeUI=function(){this.settings.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},J.prototype.removeMarker=function(B){this.markerImage.removeChild(B.container),this.markers.indexOf(B)>-1&&this.markers.splice(this.markers.indexOf(B),1),B.dispose()},J.prototype.switchToSelectMode=function(){this.mode="select",this.hideNotesEditor(),this._currentMarker!==void 0&&(this._currentMarker.state!=="new"?this._currentMarker.select():(this.removeMarker(this._currentMarker),this.setCurrentMarker(),this.markerImage.style.cursor="default"),this.addUndoStep())},J.prototype.toolbarButtonClicked=function(B,H){if(B==="marker"&&H!==void 0)this.createNewMarker(H);else if(B==="action")switch(H){case"select":this.switchToSelectMode(),this.switchToSelectMode();break;case"delete":this.deleteSelectedMarker();break;case"clear":this.clear();break;case"undo":this.undo();break;case"redo":this.redo();break;case"zoom":this.stepZoom();break;case"zoom-out":this.zoomLevel=1;break;case"notes":this.notesArea===void 0?(this.switchToSelectMode(),this.zoomLevel=1,this.showNotesEditor()):this.switchToSelectMode();break;case"close":this.close();break;case"render":this.switchToSelectMode(),this.startRenderAndClose()}},J.prototype.deleteSelectedMarker=function(){var B=this;if(this._currentMarker!==void 0){var H=!1;if(this.eventListeners.markerbeforedelete.forEach(function(le){var $=new tt(B,B._currentMarker,!0);le($),$.defaultPrevented&&(H=!0)}),!H){var Y=this._currentMarker;this._currentMarker.dispose(),this.markerImage.removeChild(this._currentMarker.container),this.markers.splice(this.markers.indexOf(this._currentMarker),1),this.setCurrentMarker(),this.addUndoStep(),this.eventListeners.markerdelete.forEach(function(le){return le(new tt(B,Y))})}}},J.prototype.clear=function(){var B=this,H=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach(function(Be){var nt=new tt(B,void 0,!0);Be(nt),nt.defaultPrevented&&(H=!0)}),!H)){this.setCurrentMarker();for(var Y=function(Be){var nt=le.markers[Be];le.setCurrentMarker(le.markers[Be]),le._currentMarker.dispose(),le.markerImage.removeChild(le._currentMarker.container),le.markers.splice(le.markers.indexOf(le._currentMarker),1),le.eventListeners.markerdelete.forEach(function(mt){return mt(new tt(B,nt))})},le=this,$=this.markers.length-1;$>=0;$--)Y($);this.addUndoStep()}},Object.defineProperty(J.prototype,"isNotesAreaOpen",{get:function(){return this.notesArea!==void 0},enumerable:!1,configurable:!0}),J.prototype.showNotesEditor=function(){var B;this._currentMarker!==void 0&&(this.overlayContainer.innerHTML="",this.notesArea=document.createElement("textarea"),this.notesArea.className=this.uiStyleSettings.notesAreaStyleClassName,this.notesArea.style.pointerEvents="auto",this.notesArea.style.alignSelf="stretch",this.notesArea.style.width="100%",this.notesArea.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.notesArea.value=(B=this._currentMarker.notes)!==null&&B!==void 0?B:"",this.overlayContainer.appendChild(this.notesArea))},J.prototype.hideNotesEditor=function(){this.isNotesAreaOpen&&(this._currentMarker!==void 0&&(this._currentMarker.notes=this.notesArea.value.trim()!==""?this.notesArea.value:void 0),this.overlayContainer.removeChild(this.notesArea),this.notesArea=void 0)},J.prototype.selectLastMarker=function(){this.markers.length>0?this.setCurrentMarker(this.markers[this.markers.length-1]):this.setCurrentMarker()},J.prototype.addUndoStep=function(){var B=this;if(this._currentMarker===void 0||this._currentMarker.state!=="edit"){var H=this.getState(),Y=this.undoRedoManager.getLastUndoStep();if(!Y||Y.width===H.width&&Y.height===H.height){var le=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(H),le<this.undoRedoManager.undoStepCount&&this.eventListeners.statechange.forEach(function($){return $(new Ve(B))})}else this.undoRedoManager.replaceLastUndoStep(H),this.eventListeners.statechange.forEach(function($){return $(new Ve(B))})}},J.prototype.undo=function(){this.switchToSelectMode(),this.addUndoStep(),this.undoStep()},J.prototype.undoStep=function(){var B=this,H=this.undoRedoManager.undo();H!==void 0&&(this.restoreState(H),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(Y){return Y(new Ve(B))}))},J.prototype.redo=function(){this.switchToSelectMode(),this.redoStep()},J.prototype.redoStep=function(){var B=this,H=this.undoRedoManager.redo();H!==void 0&&(this.restoreState(H),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(Y){return Y(new Ve(B))}))},J.prototype.stepZoom=function(){var B=this.zoomSteps.indexOf(this.zoomLevel);this.zoomLevel=B<this.zoomSteps.length-1?this.zoomSteps[B+1]:this.zoomSteps[0]},J.prototype.panTo=function(B){this.contentDiv.scrollBy({left:this.prevPanPoint.x-B.x,top:this.prevPanPoint.y-B.y}),this.prevPanPoint=B},J.prototype.startRenderAndClose=function(){return Ke(this,void 0,void 0,function(){var B,H,Y=this;return He(this,function(le){switch(le.label){case 0:return[4,this.render()];case 1:return B=le.sent(),H=this.getState(),this.eventListeners.render.forEach(function($){return $(new ht(Y,B,H))}),this.close(!0),[2]}})})},J.prototype.getState=function(B){B===!0&&this.setCurrentMarker();var H={width:this.imageWidth,height:this.imageHeight,markers:[]};return this.markers.forEach(function(Y){return H.markers.push(Y.getState())}),H},J.prototype.restoreState=function(B){var H=this;for(this.markers.splice(0);this.markerImage.lastChild;)this.markerImage.removeChild(this.markerImage.lastChild);B.markers.forEach(function(Y){var le=H._availableMarkerTypes.find(function(Be){return Be.typeName===Y.typeName});if(le!==void 0){var $=H.addNewMarker(le);$.restoreState(Y),H.markers.push($)}}),B.width&&B.height&&(B.width!==this.imageWidth||B.height!==this.imageHeight)&&this.scaleMarkers(this.imageWidth/B.width,this.imageHeight/B.height),this.eventListeners.restorestate.forEach(function(Y){return Y(new Ve(H))})},J.prototype.addNewMarker=function(B){var H=Se.createGroup();return this.markerImage.appendChild(H),new B(H,this.overlayContainer,this.settings)},J.prototype.createNewMarker=function(B){var H,Y=this;(H=typeof B=="string"?this._availableMarkerTypes.find(function(le){return le.typeName===B}):B)&&(this.setCurrentMarker(),this.addUndoStep(),this._currentMarker=this.addNewMarker(H),this._currentMarker.onMarkerCreated=this.markerCreated,this._currentMarker.onColorChanged=this.colorChanged,this._currentMarker.onFillColorChanged=this.fillColorChanged,this._currentMarker.onStateChanged=this.markerStateChanged,this.markerImage.style.cursor="crosshair",this.toolbar.setActiveMarkerButton(H.typeName),this.toolbox.setPanelButtons(this._currentMarker.toolboxPanels),this.eventListeners.markercreating.forEach(function(le){return le(new tt(Y,Y._currentMarker))}))},J.prototype.markerCreated=function(B){var H=this;this.mode="select",this.markerImage.style.cursor="default",this.markers.push(B),this.setCurrentMarker(B),B instanceof Ce&&this.settings.newFreehandMarkerOnPointerUp?this.createNewMarker(Ce):this.toolbar.setSelectMode(),this.addUndoStep(),this.eventListeners.markercreate.forEach(function(Y){return Y(new tt(H,H._currentMarker))})},J.prototype.colorChanged=function(B){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultColor=B,this.settings.defaultStrokeColor=B)},J.prototype.fillColorChanged=function(B){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultFillColor=B)},J.prototype.markerStateChanged=function(B){var H=this;this.eventListeners.markerchange.forEach(function(Y){return Y(new tt(H,B))})},J.prototype.setCurrentMarker=function(B){var H=this;this._currentMarker!==B&&this._currentMarker!==void 0&&(this._currentMarker.deselect(),this.toolbar.setCurrentMarker(),this.toolbox.setPanelButtons([]),this._isResizing||this.eventListeners.markerdeselect.forEach(function(Y){return Y(new tt(H,H._currentMarker))})),this._currentMarker=B,this._currentMarker===void 0||this._currentMarker.isSelected||(this._currentMarker.state!=="new"&&this._currentMarker.select(),this.toolbar.setCurrentMarker(this._currentMarker),this.toolbox.setPanelButtons(this._currentMarker.toolboxPanels),this._isResizing||this.eventListeners.markerselect.forEach(function(Y){return Y(new tt(H,H._currentMarker))}))},J.prototype.onPointerDown=function(B){if(this._isFocused||this.focus(),this.touchPoints++,this.touchPoints===1||B.pointerType!=="touch")if(this._currentMarker===void 0||this._currentMarker.state!=="new"&&this._currentMarker.state!=="creating"){if(this.mode==="select"){var H=this.markers.find(function(Y){return Y.ownsTarget(B.target)});H!==void 0?(this.setCurrentMarker(H),this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(B.clientX,B.clientY),B.target)):(this.setCurrentMarker(),this.isDragging=!0,this.prevPanPoint={x:B.clientX,y:B.clientY})}}else this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(B.clientX,B.clientY))},J.prototype.onDblClick=function(B){if(this._isFocused||this.focus(),this.mode==="select"){var H=this.markers.find(function(Y){return Y.ownsTarget(B.target)});H!==void 0&&H!==this._currentMarker&&this.setCurrentMarker(H),this._currentMarker!==void 0?this._currentMarker.dblClick(this.clientToLocalCoordinates(B.clientX,B.clientY),B.target):this.setCurrentMarker()}},J.prototype.onPointerMove=function(B){this.touchPoints!==1&&B.pointerType==="touch"||(this._currentMarker!==void 0||this.isDragging)&&(this._currentMarker!==void 0&&this._currentMarker.state==="edit"||B.preventDefault(),this._currentMarker!==void 0?this._currentMarker.manipulate(this.clientToLocalCoordinates(B.clientX,B.clientY)):this.zoomLevel>1&&this.panTo({x:B.clientX,y:B.clientY}))},J.prototype.onPointerUp=function(B){this.touchPoints>0&&this.touchPoints--,this.touchPoints===0&&this.isDragging&&this._currentMarker!==void 0&&this._currentMarker.pointerUp(this.clientToLocalCoordinates(B.clientX,B.clientY)),this.isDragging=!1,this.addUndoStep()},J.prototype.onPointerOut=function(){this.touchPoints>0&&this.touchPoints--},J.prototype.onKeyUp=function(B){this._currentMarker===void 0||this.notesArea!==void 0||B.key!=="Delete"&&B.key!=="Backspace"||this.deleteSelectedMarker()},J.prototype.clientToLocalCoordinates=function(B,H){var Y=this.markerImage.getBoundingClientRect();return{x:(B-Y.left)/this.zoomLevel,y:(H-Y.top)/this.zoomLevel}},J.prototype.onWindowResize=function(){this.positionUI()},J.prototype.positionUI=function(){switch(this.setTopLeft(),this.settings.displayMode){case"inline":var B=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=B+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px";break;case"popup":this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=this.windowHeight+"px",this.contentDiv.style.maxHeight=this.windowHeight-2*this.settings.popupMargin-3.5*this.styles.settings.toolbarHeight+"px"}this.positionMarkerImage(),this.positionLogo()},J.prototype.addLicenseKey=function(B){he.addKey(B)},J.prototype.addEventListener=function(B,H){this.eventListeners.addEventListener(B,H)},J.prototype.removeEventListener=function(B,H){this.eventListeners.removeEventListener(B,H)},J.prototype.renderState=function(B){this._silentRenderMode=!0,this.settings.displayMode="inline",this.isOpen||this.show(),this.restoreState(B),this.startRenderAndClose(),this._silentRenderMode=!1},Object.defineProperty(J.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!1,configurable:!0}),J.prototype.focus=function(){var B=this;this._isFocused||(this.attachWindowEvents(),this._isFocused=!0,this._previousCurrentMarker!==void 0&&this.setCurrentMarker(this._previousCurrentMarker),this.eventListeners.focus.forEach(function(H){return H(new Ve(B))}))},J.prototype.blur=function(){var B=this;this._isFocused&&(this.detachWindowEvents(),this._isFocused=!1,this._previousCurrentMarker=this._currentMarker,this.setCurrentMarker(),this.eventListeners.blur.forEach(function(H){return H(new Ve(B))}))},J.instanceCounter=0,J}();/* **********************************
|
|
|
cropro version 1.2.0
|
|
|
@license SEE LICENSE IN LICENSE
|
|
|
|
|
|
copyright Alan Mendelevich
|
|
|
see README and LICENSE for details
|
|
|
********************************** *//*! *****************************************************************************
|
|
|
Copyright (c) Microsoft Corporation.
|
|
|
|
|
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
|
purpose with or without fee is hereby granted.
|
|
|
|
|
|
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
|
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
|
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
|
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
|
PERFORMANCE OF THIS SOFTWARE.
|
|
|
***************************************************************************** */var Ft=function(J,B){return(Ft=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(H,Y){H.__proto__=Y}||function(H,Y){for(var le in Y)Object.prototype.hasOwnProperty.call(Y,le)&&(H[le]=Y[le])})(J,B)};function St(J,B){if(typeof B!="function"&&B!==null)throw new TypeError("Class extends value "+String(B)+" is not a constructor or null");function H(){this.constructor=J}Ft(J,B),J.prototype=B===null?Object.create(B):(H.prototype=B.prototype,new H)}function vt(J,B,H,Y){return new(H||(H=Promise))(function(le,$){function Be(wt){try{mt(Y.next(wt))}catch(st){$(st)}}function nt(wt){try{mt(Y.throw(wt))}catch(st){$(st)}}function mt(wt){var st;wt.done?le(wt.value):(st=wt.value,st instanceof H?st:new H(function(Rt){Rt(st)})).then(Be,nt)}mt((Y=Y.apply(J,B||[])).next())})}function Bt(J,B){var H,Y,le,$,Be={label:0,sent:function(){if(1&le[0])throw le[1];return le[1]},trys:[],ops:[]};return $={next:nt(0),throw:nt(1),return:nt(2)},typeof Symbol=="function"&&($[Symbol.iterator]=function(){return this}),$;function nt(mt){return function(wt){return function(st){if(H)throw new TypeError("Generator is already executing.");for(;Be;)try{if(H=1,Y&&(le=2&st[0]?Y.return:st[0]?Y.throw||((le=Y.return)&&le.call(Y),0):Y.next)&&!(le=le.call(Y,st[1])).done)return le;switch(Y=0,le&&(st=[2&st[0],le.value]),st[0]){case 0:case 1:le=st;break;case 4:return Be.label++,{value:st[1],done:!1};case 5:Be.label++,Y=st[1],st=[0];continue;case 7:st=Be.ops.pop(),Be.trys.pop();continue;default:if(!(le=Be.trys,(le=le.length>0&&le[le.length-1])||st[0]!==6&&st[0]!==2)){Be=0;continue}if(st[0]===3&&(!le||st[1]>le[0]&&st[1]<le[3])){Be.label=st[1];break}if(st[0]===6&&Be.label<le[1]){Be.label=le[1],le=st;break}if(le&&Be.label<le[2]){Be.label=le[2],Be.ops.push(st);break}le[2]&&Be.ops.pop(),Be.trys.pop();continue}st=B.call(J,Be)}catch(Rt){st=[6,Rt],Y=0}finally{H=le=0}if(5&st[0])throw st[1];return{value:st[0]?st[1]:void 0,done:!0}}([mt,wt])}}}var Nt=function(){function J(){}return J.addKey=function(B){J.key=B},Object.defineProperty(J,"isLicensed",{get:function(){return!!J.key&&new RegExp(/^CRPR-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(J.key)},enumerable:!1,configurable:!0}),J}(),dt=function(){function J(){}return J.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},J.setAttributes=function(B,H){for(var Y=0,le=H;Y<le.length;Y++){var $=le[Y],Be=$[0],nt=$[1];B.setAttribute(Be,nt)}},J.createRect=function(B,H,Y){var le=document.createElementNS("http://www.w3.org/2000/svg","rect");return le.setAttribute("width",B.toString()),le.setAttribute("height",H.toString()),Y&&J.setAttributes(le,Y),le},J.createLine=function(B,H,Y,le,$){var Be=document.createElementNS("http://www.w3.org/2000/svg","line");return Be.setAttribute("x1",B.toString()),Be.setAttribute("y1",H.toString()),Be.setAttribute("x2",Y.toString()),Be.setAttribute("y2",le.toString()),$&&J.setAttributes(Be,$),Be},J.createPolygon=function(B,H){var Y=document.createElementNS("http://www.w3.org/2000/svg","polygon");return Y.setAttribute("points",B),H&&J.setAttributes(Y,H),Y},J.createCircle=function(B,H){var Y=document.createElementNS("http://www.w3.org/2000/svg","circle");return Y.setAttribute("cx",(B/2).toString()),Y.setAttribute("cy",(B/2).toString()),Y.setAttribute("r",B.toString()),H&&J.setAttributes(Y,H),Y},J.createEllipse=function(B,H,Y){var le=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return le.setAttribute("cx",(B/2).toString()),le.setAttribute("cy",(H/2).toString()),le.setAttribute("rx",(B/2).toString()),le.setAttribute("ry",(H/2).toString()),Y&&J.setAttributes(le,Y),le},J.createGroup=function(B){var H=document.createElementNS("http://www.w3.org/2000/svg","g");return B&&J.setAttributes(H,B),H},J.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},J.createMarker=function(B,H,Y,le,$,Be,nt){var mt=document.createElementNS("http://www.w3.org/2000/svg","marker");return J.setAttributes(mt,[["id",B],["orient",H],["markerWidth",Y.toString()],["markerHeight",le.toString()],["refX",$.toString()],["refY",Be.toString()]]),mt.appendChild(nt),mt},J.createText=function(B){var H=document.createElementNS("http://www.w3.org/2000/svg","text");return H.setAttribute("x","0"),H.setAttribute("y","0"),B&&J.setAttributes(H,B),H},J.createTSpan=function(B,H){var Y=document.createElementNS("http://www.w3.org/2000/svg","tspan");return Y.textContent=B,H&&J.setAttributes(Y,H),Y},J.createImage=function(B){var H=document.createElementNS("http://www.w3.org/2000/svg","image");return B&&J.setAttributes(H,B),H},J.createPoint=function(B,H){var Y=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return Y.x=B,Y.y=H,Y},J.createPath=function(B,H){var Y=document.createElementNS("http://www.w3.org/2000/svg","path");return Y.setAttribute("d",B),H&&J.setAttributes(Y,H),Y},J.createElement=function(B,H){var Y=document.createElementNS("http://www.w3.org/2000/svg",B);return H&&J.setAttributes(Y,H),Y},J.getHollowRectanglePath=function(B,H,Y,le,$,Be,nt,mt){return"M"+B+","+H+"V"+(H+le)+"H"+(B+Y)+"V"+H+"H"+$+"V"+Be+"H"+($+nt)+"V"+(Be+mt)+"H"+$+"V"+H+"Z"},J}(),Ut=function(){function J(B){this._classNamePrefixBase="__cropro_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+B+"_"}return Object.defineProperty(J.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"defaultSettings",{get:function(){return{canvasBackgroundColor:"#333333",toolbarBackgroundColor:"#111111",toolbarBackgroundHoverColor:"#333333",toolbarBackgroundActiveColor:"#282828",toolbarColor:"#eeeeee",cropShadeColor:"#ffffff",cropFrameColor:"#ffffff",gripColor:"#333333",gripFillColor:"#cccccc",toolbarHeight:40}},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_out"},enumerable:!1,configurable:!0}),J.prototype.addClass=function(B){return this.styleSheet===void 0&&this.addStyleSheet(),B.name=""+this.classNamePrefix+B.localName,this.classes.push(B),this.styleSheet.sheet.insertRule("."+B.name+" {"+B.style+"}",this.styleSheet.sheet.cssRules.length),B},J.prototype.addRule=function(B){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(B),this.styleSheet.sheet.insertRule(B.selector+" {"+B.style+"}",this.styleSheet.sheet.cssRules.length)},J.prototype.addStyleSheet=function(){var B;this.styleSheet=document.createElement("style"),((B=this.styleSheetRoot)!==null&&B!==void 0?B:document.head).appendChild(this.styleSheet),this.addRule(new gt("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new gt("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
|
|
|
from {
|
|
|
opacity: 0;
|
|
|
}
|
|
|
to {
|
|
|
opacity: 1;
|
|
|
}
|
|
|
`)),this.addRule(new gt("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
|
|
|
from {
|
|
|
opacity: 1;
|
|
|
}
|
|
|
to {
|
|
|
opacity: 0;
|
|
|
}
|
|
|
`)),this.addClass(new pt("_fade_in",`
|
|
|
animation-duration: 0.3s;
|
|
|
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
|
|
|
`)),this.addClass(new pt("_fade_out",`
|
|
|
animation-duration: 0.3s;
|
|
|
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
|
|
|
`))},J.prototype.removeStyleSheet=function(){var B;this.styleSheet&&(((B=this.styleSheetRoot)!==null&&B!==void 0?B:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},J}(),gt=function(J,B){this.selector=J,this.style=B},pt=function(J,B){this.localName=J,this.style=B},Ct=function(){function J(){this.blocks=[],this.display=""}return J.prototype.addButtonBlock=function(B){B.className=this.blockClassName,B.buttonClassName=this.buttonClassName,B.buttonColorsClassName=this.buttonColorsClassName,B.buttonActiveColorsClassName=this.buttonActiveColorsClassName,this.blocks.push(B)},J.prototype.addElementBlock=function(B){B.className===void 0&&(B.className=this.blockClassName),this.blocks.push(B)},J.prototype.getUI=function(){var B=document.createElement("div");return B.className=this.className+" "+this.colorsClassName+" "+this.fadeInClassName,B.style.display=this.display,this.blocks.forEach(function(H){return B.appendChild(H.getUI())}),B},J}(),It=function(){function J(){}return J.prototype.getUI=function(){var B=document.createElement("div");if(B.className=this.className,this.minWidth!==void 0&&(B.style.minWidth=this.minWidth),this.contentAlign!==void 0)switch(this.contentAlign){case"start":B.style.justifyContent="flex-start";break;case"center":B.style.justifyContent="center";break;case"end":B.style.justifyContent="flex-end"}return B.style.whiteSpace="nowrap",B},J}(),Xt=function(J){function B(){var H=J!==null&&J.apply(this,arguments)||this;return H.buttons=[],H}return St(B,J),B.prototype.addButton=function(H){H.className=this.buttonClassName,H.colorsClassName=this.buttonColorsClassName,H.activeColorsClassName=this.buttonActiveColorsClassName,this.buttons.push(H)},B.prototype.getUI=function(){var H=J.prototype.getUI.call(this);return this.buttons.forEach(function(Y){return H.appendChild(Y.getUI())}),H},B}(It),At=function(){function J(B,H){this._isActive=!1,this._isHidden=!1,this._icon=B,this.title=H,this.uiContainer=document.createElement("div"),this.adjustClassName=this.adjustClassName.bind(this)}return Object.defineProperty(J.prototype,"icon",{get:function(){return this._icon},set:function(B){this._icon=B,this.buttonContainer.innerHTML=this._icon},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"isActive",{get:function(){return this._isActive},set:function(B){this._isActive=B,this.adjustClassName()},enumerable:!1,configurable:!0}),J.prototype.getUI=function(){var B=this;return this.buttonContainer=document.createElement("div"),this.buttonContainer.title=this.title,this.buttonContainer.className=this.className+" "+this.colorsClassName,this.adjustClassName(),this.buttonContainer.innerHTML=this._icon,this.onClick&&this.buttonContainer.addEventListener("click",function(){return B.onClick()}),this.uiContainer.appendChild(this.buttonContainer),this.uiContainer.style.display=this._isHidden?"none":"inline-block",this.uiContainer},J.prototype.adjustClassName=function(){this.activeColorsClassName&&(this._isActive&&this.buttonContainer.className.indexOf(this.activeColorsClassName)<0?this.buttonContainer.className+=" "+this.activeColorsClassName:this._isActive||(this.buttonContainer.className=this.buttonContainer.className.replace(this.activeColorsClassName,"")))},J.prototype.hide=function(){this._isHidden=!0},J}(),bt=function(J){function B(){var H=J!==null&&J.apply(this,arguments)||this;return H.elements=[],H}return St(B,J),B.prototype.addElement=function(H){this.elements.push(H)},B.prototype.getUI=function(){var H=J.prototype.getUI.call(this);return this.elements.forEach(function(Y){return H.appendChild(Y)}),H},B}(It),Si=function(){function J(B,H){this.horizontal=B,this.vertical=H}return Object.defineProperty(J.prototype,"ratio",{get:function(){return 1*this.horizontal/this.vertical},enumerable:!1,configurable:!0}),J.prototype.getVerticalLength=function(B){return B/this.ratio},J.prototype.getHorizontalLength=function(B){return B*this.ratio},J}(),qt=function(){function J(){}return J.getIcon=function(B,H){if(B>0&&H>0){var Y=new Si(B,H),le=Y.ratio>=1?20:Y.getHorizontalLength(20),$=Y.ratio<1?20:Y.getVerticalLength(20),Be=document.createElementNS("http://www.w3.org/2000/svg","svg");Be.setAttribute("xmlns","http://www.w3.org/2000/svg"),Be.setAttribute("viewBox","0 0 24 24"),document.body.appendChild(Be);var nt=dt.createDefs();Be.appendChild(nt);var mt=dt.createElement("clipPath",[["id","text-bg-clip"]]);nt.appendChild(mt);var wt=dt.createPath(dt.getHollowRectanglePath((24-le)/2,(24-$)/2,le,$,(24-le)/2+2,(24-$)/2+2,le-4,$-4));Be.appendChild(wt);var st=dt.createText([["x","0"],["y","0"],["font-size","7px"],["font-family","monospace"]]);st.appendChild(dt.createTSpan(B+":"+H)),Be.appendChild(st);var Rt=st.getBBox();dt.setAttributes(st,[["x",((24-Rt.width)/2).toString()],["y",((24-Rt.height)/2-Rt.y).toString()]]);var Vt=dt.createPath(dt.getHollowRectanglePath(0,0,24,24,(24-Math.ceil(Rt.width))/2,(24-Math.ceil(Rt.height))/2,Math.ceil(Rt.width),Math.ceil(Rt.height)));return mt.appendChild(Vt),dt.setAttributes(wt,[["clip-path","url(#text-bg-clip)"]]),document.body.removeChild(Be),Be.outerHTML}return'<svg viewBox="0 0 24 24"><path d="M19 12h-2v3h-3v2h5v-5M7 9h3V7H5v5h2V9m14-6H3a2 2 0 00-2 2v14a2 2 0 002 2h18a2 2 0 002-2V5a2 2 0 00-2-2m0 16H3V5h18v14z"/></svg>'},J}(),ii=function(J){function B(H,Y,le){var $=J.call(this,H,Y)||this;return $.isDropdownOpen=!1,$.onClick=$.dropdownButtonClicked,$.dropdownButtons=le,$}return St(B,J),B.prototype.setupDropdown=function(){var H=this;this.dropdownBlock=document.createElement("div"),this.dropdownBlock.className=this.dropdownClassName+" "+this.dropdownColorsClassName,this.dropdownBlock.style.display="none",this.dropdownButtons.forEach(function(Y){Y.className=H.className,Y.colorsClassName=H.colorsClassName,H.dropdownBlock.appendChild(Y.getUI())}),this.uiContainer.appendChild(this.dropdownBlock)},B.prototype.positionDropdown=function(){this.dropdownBlock.style.left=this.uiContainer.clientLeft+"px",this.dropdownBlock.style.top=this.uiContainer.clientTop+this.uiContainer.clientHeight+"px"},B.prototype.dropdownButtonClicked=function(){this.dropdownBlock===void 0&&this.setupDropdown(),this.isDropdownOpen=!this.isDropdownOpen,this.toggleDropdown()},B.prototype.toggleDropdown=function(){this.positionDropdown(),this.dropdownBlock.style.display=this.isDropdownOpen?"inline-block":"none"},B.prototype.showDropdown=function(){this.isDropdownOpen=!0,this.toggleDropdown()},B.prototype.hideDropdown=function(){this.isDropdownOpen=!1,this.toggleDropdown()},B}(At),Pt=function(){function J(B,H){this.GRIP_SIZE=10,this.color=B,this.fillColor=H,this.visual=dt.createGroup(),this.visual.appendChild(dt.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(dt.createCircle(this.GRIP_SIZE,[["fill",this.fillColor],["fill-opacity","0.9"],["stroke",this.color],["stroke-width","2"],["stroke-opacity","0.7"]]))}return J.prototype.ownsTarget=function(B){return B===this.visual||B===this.visual.childNodes[0]||B===this.visual.childNodes[1]},J.prototype.setCenter=function(B,H){this.visual.childNodes.forEach(function(Y){return dt.setAttributes(Y,[["cx",B.toString()],["cy",H.toString()]])})},J}(),di=function(){function J(B,H,Y,le){this.isMoving=!1,this._isGridVisible=!0,this.numberOfGridLines=2,this.horizontalGridLines=[],this.verticalGridLines=[],this._zoomFactor=1,this.cropRectChanged=!1,this.canvasWidth=B,this.canvasHeight=H,this.margin=Y,this.container=le,this.attachEvents=this.attachEvents.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.resize=this.resize.bind(this),this.adjustCropRect=this.adjustCropRect.bind(this),this.scaleCanvas=this.scaleCanvas.bind(this),this.getRescaledRect=this.getRescaledRect.bind(this)}return Object.defineProperty(J.prototype,"aspectRatio",{get:function(){return this._aspectRatio},set:function(B){this._aspectRatio=B,this.adjustCropRect(),this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(B){this._isGridVisible=B,this.gridContainer&&dt.setAttributes(this.gridContainer,[["display",this._isGridVisible?"":"none"]])},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"zoomFactor",{get:function(){return this._zoomFactor},set:function(B){this._zoomFactor=B,this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),J.prototype.open=function(){var B=this;this.cropShadeElement=dt.createPath("M0,0Z",[["fill",this.cropShadeColor],["fill-opacity","0.8"]]),this.container.appendChild(this.cropShadeElement),this.gridContainer=dt.createGroup([["display",this.isGridVisible?"":"none"]]),this.container.appendChild(this.gridContainer);for(var H=0;H<this.numberOfGridLines;H++)this.horizontalGridLines.push(dt.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]])),this.verticalGridLines.push(dt.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]]));this.horizontalGridLines.forEach(function(Y){return B.gridContainer.appendChild(Y)}),this.verticalGridLines.forEach(function(Y){return B.gridContainer.appendChild(Y)}),this.cropRectElement=dt.createRect(0,0,[["stroke",this.cropFrameColor],["stroke-width","3"],["fill","transparent"]]),this.container.appendChild(this.cropRectElement),this.topLeftGrip=new Pt(this.gripColor,this.gripFillColor),this.container.appendChild(this.topLeftGrip.visual),this.topRightGrip=new Pt(this.gripColor,this.gripFillColor),this.container.appendChild(this.topRightGrip.visual),this.bottomLeftGrip=new Pt(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomLeftGrip.visual),this.bottomRightGrip=new Pt(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomRightGrip.visual),this.attachEvents()},J.prototype.setCropRectangle=function(B){this.cropRect=B;var H=Object.assign({},this.cropRect);this.zoomFactor!==1&&(H.width=this.cropRect.width*this.zoomFactor,H.height=this.cropRect.height*this.zoomFactor,H.x=this.cropRect.height/this.cropRect.width<this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasWidth/2-H.width/2,H.y=this.cropRect.height/this.cropRect.width>this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasHeight/2-H.height/2),dt.setAttributes(this.cropRectElement,[["x",H.x.toString()],["y",H.y.toString()],["width",H.width.toString()],["height",H.height.toString()]]);var Y=H.height/(this.numberOfGridLines+1);this.horizontalGridLines.forEach(function($,Be){var nt=H.y+Y*(Be+1);dt.setAttributes($,[["x1",""+H.x],["y1",""+nt],["x2",""+(H.x+H.width)],["y2",""+nt]])});var le=H.width/(this.numberOfGridLines+1);this.verticalGridLines.forEach(function($,Be){var nt=H.x+le*(Be+1);dt.setAttributes($,[["x1",""+nt],["y1",""+H.y],["x2",""+nt],["y2",""+(H.y+H.height)]])}),dt.setAttributes(this.cropShadeElement,[["d",dt.getHollowRectanglePath(0,0,this.canvasWidth+2*this.margin,this.canvasHeight+2*this.margin,H.x,H.y,H.width,H.height)]]),this.topLeftGrip.setCenter(H.x,H.y),this.topRightGrip.setCenter(H.x+H.width,H.y),this.bottomLeftGrip.setCenter(H.x,H.y+H.height),this.bottomRightGrip.setCenter(H.x+H.width,H.y+H.height),this.cropRectChanged&&this.onCropChange&&(this.cropRectChanged=!1,this.onCropChange(this.cropRect)),this.cropRectChanged=!1},J.prototype.attachEvents=function(){this.container.style.touchAction="none",this.container.addEventListener("pointerdown",this.onPointerDown),this.container.addEventListener("pointermove",this.onPointerMove),this.container.addEventListener("pointerup",this.onPointerUp)},J.prototype.clientToLocalCoordinates=function(B,H){var Y=this.container.getBoundingClientRect();return{x:B-Y.left+this.margin,y:H-Y.top+this.margin}},J.prototype.onPointerDown=function(B){this.container.setPointerCapture(B.pointerId),this.previousPoint=this.clientToLocalCoordinates(B.clientX,B.clientY),this.cropRectElement===B.target?this.isMoving=!0:this.topLeftGrip.ownsTarget(B.target)?this.activeGrip=this.topLeftGrip:this.bottomLeftGrip.ownsTarget(B.target)?this.activeGrip=this.bottomLeftGrip:this.topRightGrip.ownsTarget(B.target)?this.activeGrip=this.topRightGrip:this.bottomRightGrip.ownsTarget(B.target)&&(this.activeGrip=this.bottomRightGrip)},J.prototype.onPointerMove=function(B){if(this.isMoving)this.move(this.clientToLocalCoordinates(B.clientX,B.clientY));else if(this.activeGrip){var H=this.clientToLocalCoordinates(B.clientX,B.clientY);this.resize(H)}B.preventDefault()},J.prototype.onPointerUp=function(B){this.activeGrip=void 0,this.isMoving=!1,this.container.releasePointerCapture(B.pointerId)},J.prototype.move=function(B){var H=B.x-this.previousPoint.x,Y=B.y-this.previousPoint.y;this.zoomFactor!==1&&(H=-H/this.zoomFactor,Y=-Y/this.zoomFactor),this.cropRect.x=Math.min(Math.max(this.margin,this.cropRect.x+H),this.canvasWidth-this.cropRect.width+this.margin),this.cropRect.y=Math.min(Math.max(this.margin,this.cropRect.y+Y),this.canvasHeight-this.cropRect.height+this.margin),this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect),this.previousPoint=B},J.prototype.resize=function(B){var H=Object.assign({},this.cropRect),Y=B.x-this.previousPoint.x,le=B.y-this.previousPoint.y;switch(this.activeGrip){case this.bottomLeftGrip:case this.topLeftGrip:H.x+Y<this.margin&&(Y=this.margin-H.x),H.x+=Y,H.width=this.cropRect.x+this.cropRect.width-H.x;break;case this.bottomRightGrip:case this.topRightGrip:H.width+Y>this.canvasWidth*this.zoomFactor&&(Y=this.canvasWidth*this.zoomFactor-H.width),H.width+=Y}switch(this.activeGrip){case this.topLeftGrip:case this.topRightGrip:this.aspectRatio?(H.y=this.cropRect.y-(this.activeGrip===this.topLeftGrip?-1:1)*this.aspectRatio.getVerticalLength(Y),H.height=this.aspectRatio.getVerticalLength(H.width)):(H.y+=le,H.height=this.cropRect.y+this.cropRect.height-H.y);break;case this.bottomLeftGrip:case this.bottomRightGrip:this.aspectRatio?H.height=this.aspectRatio.getVerticalLength(H.width):H.height+=le}H.width<10&&(H.x=this.cropRect.x,H.width=10),H.height<10&&(H.y=this.cropRect.y,H.height=10),this.previousPoint=B,H.x>=this.margin&&H.y>=this.margin&&H.x-this.margin+H.width<=this.canvasWidth&&H.y-this.margin+H.height<=this.canvasHeight&&(this.cropRect=H,this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect))},J.prototype.adjustCropRect=function(){if(this.aspectRatio&&Math.round(this.cropRect.height)!==Math.round(this.aspectRatio.getVerticalLength(this.cropRect.width))){var B=this.cropRect.x+this.cropRect.width/2,H=this.cropRect.y+this.cropRect.height/2,Y=this.aspectRatio.getHorizontalLength(this.cropRect.height),le=this.aspectRatio.getVerticalLength(this.cropRect.width);Y/this.canvasWidth<le/this.canvasHeight?this.cropRect.width=Y:this.cropRect.height=le,this.cropRect.width>this.canvasWidth&&(this.cropRect.height/=this.cropRect.width/this.canvasWidth,this.cropRect.width=this.canvasWidth),this.cropRect.height>this.canvasHeight&&(this.cropRect.width/=this.cropRect.height/this.canvasHeight,this.cropRect.height=this.canvasHeight),this.cropRect.x=B-this.cropRect.width/2,this.cropRect.y=H-this.cropRect.height/2,this.cropRect.x+this.cropRect.width>this.margin+this.canvasWidth&&(this.cropRect.x=this.margin+this.canvasWidth-this.cropRect.width),this.cropRect.y+this.cropRect.height>this.margin+this.canvasHeight&&(this.cropRect.y=this.margin+this.canvasHeight-this.cropRect.height),this.cropRect.x=Math.max(this.cropRect.x,this.margin),this.cropRect.y=Math.max(this.cropRect.y,this.margin)}},J.prototype.getRescaledRect=function(B,H,Y,le,$,Be){var nt=Y/B,mt=le/H;return{x:($.x-Be)*nt+Be,y:($.y-Be)*mt+Be,width:$.width*nt,height:$.height*mt}},J.prototype.scaleCanvas=function(B,H){var Y=this.getRescaledRect(this.canvasWidth,this.canvasHeight,B,H,this.cropRect,this.margin);this.canvasWidth=B,this.canvasHeight=H,this.onCropChange&&this.onCropChange(Y),this.setCropRectangle(Y)},J}(),Di=function(){function J(B){this._angle=0,this.isDragging=!1,this.width=401,this.height=24,this.title=B,this.uiContainer=document.createElement("div"),this.getUI=this.getUI.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.setAngleLabel=this.setAngleLabel.bind(this),this.positionScaleShape=this.positionScaleShape.bind(this)}return Object.defineProperty(J.prototype,"angle",{get:function(){return this._angle},set:function(B){this._angle=B,this.setAngleLabel(),this.positionScaleShape()},enumerable:!1,configurable:!0}),J.prototype.getUI=function(){return this.controlContainer=document.createElement("div"),this.controlContainer.title=this.title,this.controlContainer.className=this.className+" "+this.colorsClassName,this.controlContainer.appendChild(this.getVisual()),this.controlContainer.addEventListener("pointerdown",this.onPointerDown),this.controlContainer.addEventListener("pointermove",this.onPointerMove),this.controlContainer.addEventListener("pointerup",this.onPointerUp),this.uiContainer.appendChild(this.controlContainer),this.uiContainer.style.display="inline-block",this.uiContainer.style.touchAction="none",this.setAngleLabel(),this.positionScaleShape(),this.uiContainer},J.prototype.onPointerDown=function(B){this.controlContainer.setPointerCapture(B.pointerId),this.isDragging=!0,this.previousPoint={x:B.clientX,y:B.clientY}},J.prototype.onPointerMove=function(B){this.isDragging&&(this.onAngleChange&&this.onAngleChange((B.clientX-this.previousPoint.x)/5),this.previousPoint.x=B.clientX)},J.prototype.onPointerUp=function(B){this.isDragging&&this.onAngleChange&&this.onAngleChange((B.clientX-this.previousPoint.x)/5),this.isDragging=!1,this.controlContainer.releasePointerCapture(B.pointerId)},J.prototype.setAngleLabel=function(){if(this.angleLabelText){this.angleLabelText.innerHTML=""+Math.round(this._angle);var B=this.angleLabelText.getBBox();dt.setAttributes(this.angleLabelElement,[["x",((this.width-B.width)/2).toString()],["y",(this.height/2).toString()]])}},J.prototype.positionScaleShape=function(){if(this.scaleShape){var B=this.scaleShape.transform.baseVal.getItem(0);B.setTranslate(this._angle%5*5-25,0),this.scaleShape.transform.baseVal.replaceItem(B,0)}},J.prototype.getVisual=function(){var B=document.createElementNS("http://www.w3.org/2000/svg","svg");B.setAttribute("xmlns","http://www.w3.org/2000/svg"),B.setAttribute("width",this.width+"px"),B.setAttribute("height",this.height+"px"),B.setAttribute("viewBox","0 0 "+this.width+" "+this.height),B.style.flexShrink="0",document.body.appendChild(B);for(var H="M0,"+(this.height-1)+" v"+-this.height/3+"h1v"+this.height/3,Y=1;Y<=this.width/5+10;Y++){var le=Y%5==0?this.height/3:this.height/6;H+="h4v"+-le+"h1v"+le}H+="v1H0Z",this.scaleShape=dt.createPath(H);var $=dt.createTransform();this.scaleShape.transform.baseVal.appendItem($),B.appendChild(this.scaleShape),this.angleLabelElement=dt.createText([["x","0"],["y","0"],["font-size","10px"],["font-family","monospace"]]),this.angleLabelText=dt.createTSpan(""),this.angleLabelElement.appendChild(this.angleLabelText);var Be=dt.createTSpan("");return Be.innerHTML="°",this.angleLabelElement.appendChild(Be),B.appendChild(this.angleLabelElement),document.body.removeChild(B),B},J}(),Yi=function(){function J(){this.naturalSize=!1,this.imageType="image/png"}return J.prototype.rasterize=function(B,H,Y,le,$,Be,nt){var mt=this;return new Promise(function(wt){var st=document.createElement("canvas");st.width=B.width.baseVal.value-2*le,st.height=B.height.baseVal.value-2*le;var Rt=1,Vt=1;mt.naturalSize===!0?(Rt=H.naturalWidth/(B.width.baseVal.value-2*le)/Be,Vt=H.naturalHeight/(B.height.baseVal.value-2*le)/nt,st.width=H.naturalWidth/Be,st.height=H.naturalHeight/nt):mt.width!==void 0&&mt.height!==void 0&&(Rt=mt.width/Y.width,Vt=mt.height/Y.height,st.width*=Rt,st.height*=Vt);var ri=st.getContext("2d");ri.translate(st.width/2,st.height/2),ri.rotate($*Math.PI/180),ri.scale(Be,nt),ri.translate(-st.width/2,-st.height/2),ri.drawImage(H,0,0,st.width,st.height);var Hi=document.createElement("canvas");Hi.width=Y.width*Rt,Hi.height=Y.height*Vt,Hi.getContext("2d").putImageData(ri.getImageData((Y.x-le)*Rt,(Y.y-le)*Vt,Y.width*Rt,Y.height*Vt),0,0),wt(Hi.toDataURL(mt.imageType,mt.imageQuality))})},J}(),ct=function(){function J(B){this._zoomToCropEnabled=!0,this.zoomFactor=1,this.flippedHorizontally=!1,this.flippedVertically=!1,this._isGridVisible=!0,this._gridLines=2,this._rotationAngle=0,this.scaleFactor=1,this.renderEventListeners=[],this.closeEventListeners=[],this._isOpen=!1,this.CANVAS_MARGIN=20,this.renderAtNaturalSize=!1,this.renderImageType="image/png",this.displayMode="inline",this.popupMargin=30,this.toolbarHeight=40,this.aspectRatios=[{horizontal:0,vertical:0},{horizontal:4,vertical:3},{horizontal:3,vertical:2},{horizontal:16,vertical:9},{horizontal:1,vertical:1},{horizontal:3,vertical:4},{horizontal:2,vertical:3},{horizontal:9,vertical:16}],this._instanceNo=J.instanceCounter++,this.styles=new Ut(this.instanceNo),this.target=B,this.targetRoot=document.body,this.open=this.open.bind(this),this.setTopLeft=this.setTopLeft.bind(this),this.overrideOverflow=this.overrideOverflow.bind(this),this.restoreOverflow=this.restoreOverflow.bind(this),this.close=this.close.bind(this),this.closeUI=this.closeUI.bind(this),this.addCloseEventListener=this.addCloseEventListener.bind(this),this.removeCloseEventListener=this.removeCloseEventListener.bind(this),this.addRenderEventListener=this.addRenderEventListener.bind(this),this.removeRenderEventListener=this.removeRenderEventListener.bind(this),this.clientToLocalCoordinates=this.clientToLocalCoordinates.bind(this),this.onWindowResize=this.onWindowResize.bind(this),this.setWindowHeight=this.setWindowHeight.bind(this),this.rotateBy=this.rotateBy.bind(this),this.applyRotation=this.applyRotation.bind(this),this.cropRectChanged=this.cropRectChanged.bind(this),this.zoomToCrop=this.zoomToCrop.bind(this),this.unzoomFromCrop=this.unzoomFromCrop.bind(this),this.rotateLeftButtonClicked=this.rotateLeftButtonClicked.bind(this),this.rotateRightButtonClicked=this.rotateRightButtonClicked.bind(this),this.flipHorizontallyButtonClicked=this.flipHorizontallyButtonClicked.bind(this),this.flipVerticallyButtonClicked=this.flipVerticallyButtonClicked.bind(this),this.applyFlip=this.applyFlip.bind(this),this.startRenderAndClose=this.startRenderAndClose.bind(this),this.render=this.render.bind(this),this.onPopupResize=this.onPopupResize.bind(this),this.applyAspectRatio=this.applyAspectRatio.bind(this)}return Object.defineProperty(J.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"zoomToCropEnabled",{get:function(){return this._zoomToCropEnabled},set:function(B){this._zoomToCropEnabled=B,B?this.zoomToCrop():this.unzoomFromCrop()},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(B){this._isGridVisible=B,this.cropLayer&&(this.cropLayer.isGridVisible=this._isGridVisible)},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"gridLines",{get:function(){return this._gridLines},set:function(B){this._gridLines=B,this.cropLayer&&(this.cropLayer.numberOfGridLines=this._gridLines)},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"rotationAngle",{get:function(){return this._rotationAngle},set:function(B){this._rotationAngle=B,this.straightener&&(this.straightener.angle=this._rotationAngle)},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"paddedImageWidth",{get:function(){return this.imageWidth+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"paddedImageHeight",{get:function(){return this.imageHeight+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"aspectRatio",{get:function(){var B;return(B=this._aspectRatio)!==null&&B!==void 0?B:this.aspectRatios[0]},set:function(B){this._aspectRatio=B},enumerable:!1,configurable:!0}),J.prototype.open=function(){this.imageWidth=Math.round(this.target.clientWidth),this.imageHeight=Math.round(this.target.clientHeight),this.setupResizeObserver(),this.initCropCanvas(),this.setEditingTarget(),this.setTopLeft(),this.initCropLayer(),this.attachEvents(),this.applyAspectRatio(),this.displayMode==="popup"&&this.onPopupResize(),this._isOpen=!0},J.prototype.show=function(){this.showUI(),this.open()},J.prototype.close=function(B){B===void 0&&(B=!1),this.isOpen&&(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),B||this.closeEventListeners.forEach(function(H){return H()}),this._isOpen=!1)},J.prototype.addRenderEventListener=function(B){this.renderEventListeners.push(B)},J.prototype.removeRenderEventListener=function(B){this.renderEventListeners.indexOf(B)>-1&&this.renderEventListeners.splice(this.renderEventListeners.indexOf(B),1)},J.prototype.addCloseEventListener=function(B){this.closeEventListeners.push(B)},J.prototype.removeCloseEventListener=function(B){this.closeEventListeners.indexOf(B)>-1&&this.closeEventListeners.splice(this.closeEventListeners.indexOf(B),1)},J.prototype.setupResizeObserver=function(){var B=this;this.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){B.resize(B.target.clientWidth,B.target.clientHeight)}),this.targetObserver.observe(this.target)):this.displayMode==="popup"&&(window.ResizeObserver&&(this.targetObserver=new ResizeObserver(this.onPopupResize),this.targetObserver.observe(this.contentDiv)),window.addEventListener("resize",this.setWindowHeight))},J.prototype.onPopupResize=function(){if(this.contentDiv.clientWidth>0&&this.contentDiv.clientHeight>0){var B=1*this.target.clientWidth/this.target.clientHeight,H=this.contentDiv.clientWidth/B>this.contentDiv.clientHeight?(this.contentDiv.clientHeight-2*this.CANVAS_MARGIN)*B:this.contentDiv.clientWidth-2*this.CANVAS_MARGIN,Y=H+2*this.CANVAS_MARGIN<this.contentDiv.clientWidth?this.contentDiv.clientHeight-2*this.CANVAS_MARGIN:(this.contentDiv.clientWidth-2*this.CANVAS_MARGIN)/B;this.resize(H,Y)}},J.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},J.prototype.setEditingTargetSize=function(){this.editorCanvas.style.width=this.imageWidth+2*this.CANVAS_MARGIN+"px",this.editorCanvas.style.height=this.imageHeight+2*this.CANVAS_MARGIN+"px",dt.setAttributes(this.editingTarget,[["width",""+this.imageWidth],["height",""+this.imageHeight]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px"},J.prototype.resize=function(B,H){this.imageWidth=Math.round(B),this.imageHeight=Math.round(H),this.setEditingTargetSize(),this.cropImage.setAttribute("width",this.paddedImageWidth.toString()),this.cropImage.setAttribute("height",this.paddedImageHeight.toString()),this.cropImage.setAttribute("viewBox","0 0 "+this.paddedImageWidth.toString()+" "+this.paddedImageHeight.toString()),this.cropImageHolder.style.width=this.paddedImageWidth+"px",this.cropImageHolder.style.height=this.paddedImageHeight+"px",this.displayMode!=="popup"?this.coverDiv.style.width=this.paddedImageWidth+"px":(this.setTopLeft(),this.positionCropImage()),this.cropLayer.scaleCanvas(this.imageWidth,this.imageHeight),this.applyRotation()},J.prototype.setEditingTarget=function(){var B=document.createElement("canvas");B.width=this.target.naturalWidth,B.height=this.target.naturalHeight,B.getContext("2d").drawImage(this.target,0,0,this.target.naturalWidth,this.target.naturalHeight);var H=B.toDataURL();dt.setAttributes(this.editingTarget,[["href",H]]),this.setEditingTargetSize()},J.prototype.setTopLeft=function(){var B=this.target.getBoundingClientRect(),H=this.editorCanvas.getBoundingClientRect();this.left=B.left-H.left-this.CANVAS_MARGIN,this.top=B.top-H.top-this.CANVAS_MARGIN},J.prototype.initCropCanvas=function(){this.cropImageHolder=document.createElement("div"),this.cropImageHolder.style.setProperty("touch-action","none"),this.cropImageHolder.style.setProperty("-ms-touch-action","none"),this.cropImage=document.createElementNS("http://www.w3.org/2000/svg","svg"),this.cropImage.setAttribute("xmlns","http://www.w3.org/2000/svg"),this.cropImage.setAttribute("width",this.paddedImageWidth.toString()),this.cropImage.setAttribute("height",this.paddedImageHeight.toString()),this.cropImage.setAttribute("viewBox","0 0 "+this.paddedImageWidth.toString()+" "+this.paddedImageHeight.toString()),this.cropImage.style.pointerEvents="auto",this.cropImageHolder.style.width=this.paddedImageWidth+"px",this.cropImageHolder.style.height=this.paddedImageHeight+"px",this.cropImageHolder.style.transformOrigin="top left",this.positionCropImage(),this.defs=dt.createDefs(),this.cropImage.appendChild(this.defs),this.editingTarget=dt.createImage([["href",""]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationContainer=dt.createGroup(),this.editingTargetRotationScaleContainer=dt.createGroup(),this.editingTargetRotationScaleContainer.appendChild(this.editingTarget),this.editingTargetRotationContainer.appendChild(this.editingTargetRotationScaleContainer);var B=dt.createTransform();this.editingTargetRotationContainer.transform.baseVal.appendItem(B);var H=dt.createTransform();this.editingTargetRotationScaleContainer.transform.baseVal.appendItem(H),this.editingTargetContainer=dt.createGroup(),this.editingTargetContainer.style.transform="translate("+this.CANVAS_MARGIN+"px, "+this.CANVAS_MARGIN+"px)",this.editingTargetContainer.appendChild(this.editingTargetRotationContainer),this.cropImage.appendChild(this.editingTargetContainer),this.cropImageHolder.appendChild(this.cropImage),this.editorCanvas.appendChild(this.cropImageHolder)},J.prototype.positionCropImage=function(){this.cropImageHolder.style.top=this.top+"px",this.cropImageHolder.style.left=this.left+"px"},J.prototype.initCropLayer=function(){this.cropRect={x:this.CANVAS_MARGIN,y:this.CANVAS_MARGIN,width:this.imageWidth,height:this.imageHeight},this.cropLayerContainer=dt.createGroup(),this.cropImage.appendChild(this.cropLayerContainer),this.cropLayer=new di(this.imageWidth,this.imageHeight,this.CANVAS_MARGIN,this.cropLayerContainer),this.cropLayer.onCropChange=this.cropRectChanged,this.cropLayer.numberOfGridLines=this.gridLines,this.cropLayer.isGridVisible=this.isGridVisible,this.cropLayer.cropShadeColor=this.styles.settings.cropShadeColor,this.cropLayer.cropFrameColor=this.styles.settings.cropFrameColor,this.cropLayer.gripColor=this.styles.settings.gripColor,this.cropLayer.gripFillColor=this.styles.settings.gripFillColor,this.cropLayer.open(),this.cropLayer.setCropRectangle(this.cropRect),this.zoomToCropEnabled&&this.zoomToCrop()},J.prototype.zoomToCrop=function(){if(this.cropRect){var B=this.cropRect.x-this.CANVAS_MARGIN+this.cropRect.width/2,H=this.cropRect.y-this.CANVAS_MARGIN+this.cropRect.height/2;this.zoomFactor=Math.min(this.imageWidth/this.cropRect.width,this.imageHeight/this.cropRect.height),this.editingTargetContainer&&this.cropLayer&&(this.editingTargetContainer.style.transformOrigin=B+"px "+H+"px",this.editingTargetContainer.style.transform="translate("+(this.imageWidth/2-B+this.CANVAS_MARGIN)+"px,"+(this.imageHeight/2-H+this.CANVAS_MARGIN)+"px) scale("+this.zoomFactor+")",this.cropLayer.zoomFactor=this.zoomFactor)}},J.prototype.unzoomFromCrop=function(){this.zoomFactor=1,this.editingTargetContainer&&this.cropLayer&&(this.editingTargetContainer.style.transformOrigin="center",this.editingTargetContainer.style.transform="translate("+this.CANVAS_MARGIN+"px, "+this.CANVAS_MARGIN+"px) scale(1)",this.cropLayer.zoomFactor=this.zoomFactor)},J.prototype.cropRectChanged=function(B){this.cropRect=B,this.zoomToCropEnabled?this.zoomToCrop():this.cropLayer.zoomFactor=1},J.prototype.attachEvents=function(){window.addEventListener("resize",this.onWindowResize)},J.prototype.overrideOverflow=function(){this.scrollXState=window.scrollX,this.scrollYState=window.scrollY,this.bodyOverflowState=document.body.style.overflow,window.scroll({top:0,left:0}),document.body.style.overflow="hidden"},J.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},J.prototype.showUI=function(){switch(this.addStyles(),this.displayMode==="popup"&&this.overrideOverflow(),this.coverDiv=document.createElement("div"),this.coverDiv.className=this.styles.classNamePrefixBase+" "+this.styles.classNamePrefix,this.coverDiv.style.fontSize="16px",this.displayMode){case"inline":this.coverDiv.style.position="absolute";var B=this.styles.settings.hideTopToolbar?0:this.toolbarHeight,H=this.target.offsetTop>B+this.CANVAS_MARGIN?this.target.offsetTop-(B+this.CANVAS_MARGIN):0;this.coverDiv.style.top=H+"px",this.coverDiv.style.left=(this.target.offsetLeft>this.CANVAS_MARGIN?this.target.offsetLeft-this.CANVAS_MARGIN:0)+"px",this.coverDiv.style.width=this.target.offsetWidth+this.CANVAS_MARGIN+"px",this.coverDiv.style.zIndex=this.styles.settings.zIndex!==void 0?this.styles.settings.zIndex:"5";break;case"popup":this.coverDiv.style.position="absolute",this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=window.innerHeight+"px",this.coverDiv.style.backgroundColor="rgba(0, 0, 0, 0.75)",this.coverDiv.style.zIndex=this.styles.settings.zIndex!==void 0?this.styles.settings.zIndex:"1000",this.coverDiv.style.display="flex"}this.targetRoot.appendChild(this.coverDiv),this.uiDiv=document.createElement("div"),this.uiDiv.style.display="flex",this.uiDiv.style.flexDirection="column",this.uiDiv.style.flexGrow="2",this.uiDiv.style.margin=this.displayMode==="popup"?this.popupMargin+"px":"0px",this.uiDiv.style.border="0px",this.coverDiv.appendChild(this.uiDiv),this.addToolbars(),this.uiDiv.appendChild(this.topToolbar.getUI()),this.contentDiv=document.createElement("div"),this.contentDiv.style.display="flex",this.contentDiv.style.alignItems="center",this.contentDiv.style.flexDirection="row",this.contentDiv.style.flexGrow="2",this.contentDiv.style.flexShrink="1",this.contentDiv.style.overflow="hidden",this.contentDiv.style.backgroundColor=this.styles.settings.canvasBackgroundColor,this.displayMode==="popup"&&(this.contentDiv.style.maxHeight="calc(100vh - "+(2*this.popupMargin+2*this.toolbarHeight)+"px)",this.contentDiv.style.maxWidth="calc(100vw - "+2*this.popupMargin+"px)"),this.uiDiv.appendChild(this.contentDiv),this.editorCanvas=document.createElement("div"),this.editorCanvas.style.flexGrow="2",this.editorCanvas.style.flexShrink="1",this.editorCanvas.style.position="relative",this.editorCanvas.style.overflow="hidden",this.editorCanvas.style.display="flex",this.displayMode==="popup"&&(this.editorCanvas.style.alignItems="center",this.editorCanvas.style.justifyContent="center"),this.editorCanvas.style.pointerEvents="none",this.contentDiv.appendChild(this.editorCanvas),this.uiDiv.appendChild(this.bottomToolbar.getUI()),this.straightener.angle=this.rotationAngle},J.prototype.addToolbars=function(){this.addTopToolbar(),this.addBottomToolbar()},J.prototype.addTopToolbar=function(){var B=this;this.topToolbar=new Ct,this.topToolbar.display=this.styles.settings.hideTopToolbar?"none":"",this.topToolbar.className=this.toolbarStyleClass.name,this.topToolbar.colorsClassName=this.styles.settings.toolbarStyleColorsClassName?this.styles.settings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name,this.topToolbar.fadeInClassName=this.styles.fadeInAnimationClassName,this.topToolbar.blockClassName=this.toolbarBlockStyleClass.name,this.topToolbar.buttonClassName=this.toolbarButtonStyleClass.name,this.topToolbar.buttonColorsClassName=this.styles.settings.toolbarButtonStyleColorsClassName?this.styles.settings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,this.topToolbar.buttonActiveColorsClassName=this.styles.settings.toolbarActiveButtonStyleColorsClassName?this.styles.settings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name;var H=new Xt;H.minWidth=3*this.toolbarHeight+"px",this.topToolbar.addButtonBlock(H);var Y=[];this.aspectRatios.forEach(function(Vt){var ri=new At(qt.getIcon(Vt.horizontal,Vt.vertical),Vt.horizontal===0&&Vt.vertical===0?"FREE":Vt.horizontal+":"+Vt.vertical);ri.onClick=function(){return B.ratioButtonClicked(Vt)},Y.push(ri)}),this.aspectRatioButton=new ii(qt.getIcon(0,0),"Aspect ratio",Y),this.aspectRatioButton.dropdownClassName=this.toolbarDropdownStyleClass.name,this.aspectRatioButton.dropdownColorsClassName=this.styles.settings.toolbarDropdownStyleColorsClassName?this.styles.settings.toolbarDropdownStyleColorsClassName:this.toolbarDropdownStyleColorsClass.name,H.addButton(this.aspectRatioButton),this.aspectRatios.length<2&&this.aspectRatioButton.hide();var le=new At('<svg viewBox="0 0 24 24"><path d="M10 4v4h4V4h-4m6 0v4h4V4h-4m0 6v4h4v-4h-4m0 6v4h4v-4h-4m-2 4v-4h-4v4h4m-6 0v-4H4v4h4m0-6v-4H4v4h4m0-6V4H4v4h4m2 6h4v-4h-4v4M4 2h16a2 2 0 012 2v16a2 2 0 01-2 2H4c-1.08 0-2-.9-2-2V4a2 2 0 012-2z"/></svg>',"Toggle grid");le.isActive=this.isGridVisible,le.onClick=function(){B.isGridVisible=!B.isGridVisible,le.isActive=B.isGridVisible},H.addButton(le);var $=new At('<svg viewBox="0 0 24 24"><path d="M15.5 14l5 5-1.5 1.5-5-5v-.79l-.27-.28A6.471 6.471 0 019.5 16 6.5 6.5 0 013 9.5 6.5 6.5 0 019.5 3 6.5 6.5 0 0116 9.5c0 1.61-.59 3.09-1.57 4.23l.28.27h.79m-6 0C12 14 14 12 14 9.5S12 5 9.5 5 5 7 5 9.5 7 14 9.5 14m2.5-4h-2v2H9v-2H7V9h2V7h1v2h2v1z"/></svg>',"Zoom to selection");if($.isActive=this.zoomToCropEnabled,$.onClick=function(){B.zoomToCropEnabled=!B.zoomToCropEnabled,$.isActive=B.zoomToCropEnabled},H.addButton($),!Nt.isLicensed){var Be=new bt;this.topToolbar.addElementBlock(Be);var nt=document.createElement("div");nt.className=this.topToolbar.buttonClassName+" "+this.topToolbar.buttonColorsClassName;var mt=document.createElement("a");mt.style.color="currentColor",mt.href="https://markerjs.com/products/cropro",mt.target="_blank",mt.innerHTML='<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="2"><path d="M16.326 14.895c0 1.126-.558 1.688-1.673 1.688H9.931c-1.116 0-1.674-.562-1.674-1.688V3.733c0-1.126.558-1.688 1.674-1.688h4.722c1.115 0 1.673.562 1.673 1.688v2.899h-1.957V3.793h-4.124v11.042h4.124v-3.242h1.957v3.302z" fill="currentColor"/><path d="M15.94 7.364a.783.783 0 00-1.065-.304l-11.01 6.126a.783.783 0 00-.303 1.065l4.498 8.085a.783.783 0 001.065.304l11.01-6.126a.783.783 0 00.303-1.065L15.94 7.364zM5.311 14.173l3.737 6.718 9.641-5.364-3.737-6.718-9.641 5.364z" fill="#eef762"/></svg>',nt.appendChild(mt),Be.addElement(nt)}var wt=new Xt;wt.minWidth=3*this.toolbarHeight+"px",wt.contentAlign="end",this.topToolbar.addButtonBlock(wt);var st=new At('<svg viewBox="0 0 24 24"><path d="M9 20.42l-6.21-6.21 2.83-2.83L9 14.77l9.88-9.89 2.83 2.83L9 20.42z"/></svg>',"OK");st.onClick=this.startRenderAndClose,wt.addButton(st),this.styles.settings.toolbarOkButtonStyleColorsClassName&&(st.colorsClassName=this.styles.settings.toolbarOkButtonStyleColorsClassName);var Rt=new At('<svg viewBox="0 0 24 24"><path d="M20 6.91L17.09 4 12 9.09 6.91 4 4 6.91 9.09 12 4 17.09 6.91 20 12 14.91 17.09 20 20 17.09 14.91 12 20 6.91z"/></svg>',"Close");Rt.onClick=this.close,wt.addButton(Rt),this.styles.settings.toolbarCloseButtonStyleColorsClassName&&(Rt.colorsClassName=this.styles.settings.toolbarCloseButtonStyleColorsClassName)},J.prototype.addBottomToolbar=function(){var B=this;this.bottomToolbar=new Ct,this.bottomToolbar.display=this.styles.settings.hideBottomToolbar?"none":"",this.bottomToolbar.className=this.toolbarStyleClass.name,this.bottomToolbar.colorsClassName=this.styles.settings.toolbarStyleColorsClassName?this.styles.settings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name,this.bottomToolbar.fadeInClassName=this.styles.fadeInAnimationClassName,this.bottomToolbar.blockClassName=this.toolbarBlockStyleClass.name,this.bottomToolbar.buttonClassName=this.toolbarButtonStyleClass.name,this.bottomToolbar.buttonColorsClassName=this.styles.settings.toolbarButtonStyleColorsClassName?this.styles.settings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,this.bottomToolbar.buttonActiveColorsClassName=this.styles.settings.toolbarActiveButtonStyleColorsClassName?this.styles.settings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name;var H=new Xt;H.minWidth=2*this.toolbarHeight+"px",this.bottomToolbar.addButtonBlock(H);var Y=new At('<svg viewBox="0 0 24 24"><path d="M13 4.07V1L8.45 5.55 13 10V6.09c2.84.48 5 2.94 5 5.91s-2.16 5.43-5 5.91v2.02c3.95-.49 7-3.85 7-7.93s-3.05-7.44-7-7.93M7.1 18.32c1.16.9 2.51 1.44 3.9 1.61V17.9c-.87-.15-1.71-.49-2.46-1.03L7.1 18.32M6.09 13H4.07c.17 1.39.72 2.73 1.62 3.89l1.41-1.42c-.52-.75-.87-1.59-1.01-2.47m1.02-4.47L5.7 7.11C4.8 8.27 4.24 9.61 4.07 11h2.02c.14-.87.49-1.72 1.02-2.47z"/></svg>',"Rotate left");Y.onClick=this.rotateLeftButtonClicked,H.addButton(Y);var le=new At('<svg viewBox="0 0 24 24"><path d="M16.89 15.5l1.42 1.39c.9-1.16 1.45-2.5 1.62-3.89h-2.02c-.14.87-.48 1.72-1.02 2.5M13 17.9v2.02c1.39-.17 2.74-.71 3.9-1.61l-1.44-1.44c-.75.54-1.59.89-2.46 1.03m6.93-6.9a7.906 7.906 0 00-1.62-3.89l-1.42 1.42c.54.75.88 1.6 1.02 2.47m-2.36-5.45L11 1v3.07C7.06 4.56 4 7.92 4 12s3.05 7.44 7 7.93v-2.02c-2.84-.48-5-2.94-5-5.91s2.16-5.43 5-5.91V10l4.55-4.45z"/></svg>',"Rotate right");le.onClick=this.rotateRightButtonClicked,H.addButton(le);var $=new bt;$.className=this.toolbarStraightenerBlockStyleClass.name,this.bottomToolbar.addElementBlock($),this.straightener=new Di("Straighten"),this.straightener.className=this.toolbarStraightenerStyleClass.name,this.straightener.colorsClassName=this.styles.settings.toolbarStraightenerColorsClassName?this.styles.settings.toolbarStraightenerColorsClassName:this.toolbarStraightenerStyleColorsClass.name,this.straightener.onAngleChange=function(wt){B.rotateBy(wt),B.straightener.angle=B.rotationAngle},$.addElement(this.straightener.getUI());var Be=new Xt;Be.minWidth=2*this.toolbarHeight+"px",Be.contentAlign="end",this.bottomToolbar.addButtonBlock(Be);var nt=new At('<svg viewBox="0 0 24 24"><path d="M15 21h2v-2h-2m4-10h2V7h-2M3 5v14c0 1.1.9 2 2 2h4v-2H5V5h4V3H5c-1.1 0-2 .9-2 2m16-2v2h2c0-1.1-.9-2-2-2m-8 20h2V1h-2m8 16h2v-2h-2M15 5h2V3h-2m4 10h2v-2h-2m0 10c1.1 0 2-.9 2-2h-2z"/></svg>',"Flip horizontal");nt.onClick=this.flipHorizontallyButtonClicked,Be.addButton(nt);var mt=new At('<svg viewBox="0 0 24 24"><path d="M3 15v2h2v-2m10 4v2h2v-2m2-16H5c-1.1 0-2 .9-2 2v4h2V5h14v4h2V5c0-1.1-.9-2-2-2m2 16h-2v2c1.1 0 2-.9 2-2M1 11v2h22v-2M7 19v2h2v-2m10-4v2h2v-2m-10 4v2h2v-2M3 19c0 1.1.9 2 2 2v-2z"/></svg>',"Flip vertical");mt.onClick=this.flipVerticallyButtonClicked,Be.addButton(mt)},J.prototype.ratioButtonClicked=function(B){this.aspectRatio=B,this.applyAspectRatio(),this.aspectRatioButton.hideDropdown()},J.prototype.applyAspectRatio=function(){this.setCropLayerAspectRatio(),this.aspectRatioButton.icon=qt.getIcon(this.aspectRatio.horizontal,this.aspectRatio.vertical)},J.prototype.setCropLayerAspectRatio=function(){this.cropLayer&&(this.aspectRatio&&this.aspectRatio.horizontal!==0&&this.aspectRatio.vertical!==0?this.cropLayer.aspectRatio=new Si(this.aspectRatio.horizontal,this.aspectRatio.vertical):this.cropLayer.aspectRatio=void 0)},J.prototype.closeUI=function(){this.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},J.prototype.getState=function(){return{width:this.imageWidth,height:this.imageHeight,rotationAngle:this.rotationAngle,flippedHorizontally:this.flippedHorizontally,flippedVertically:this.flippedVertically,cropRect:Object.assign({},this.cropRect)}},J.prototype.restoreState=function(B){if(B){var H=this.cropLayer.getRescaledRect(B.width,B.height,this.imageWidth,this.imageHeight,B.cropRect,this.CANVAS_MARGIN);this.cropLayer.setCropRectangle(H),this.cropRectChanged(H),this.flippedHorizontally=B.flippedHorizontally,this.flippedVertically=B.flippedVertically,this.applyFlip(),this.rotationAngle=B.rotationAngle,this.applyRotation()}},J.prototype.clientToLocalCoordinates=function(B,H){var Y=this.cropImage.getBoundingClientRect();return{x:B-Y.left,y:H-Y.top}},J.prototype.onWindowResize=function(){this.positionUI()},J.prototype.positionUI=function(){switch(this.setTopLeft(),this.displayMode){case"inline":var B=this.target.offsetTop>this.toolbarHeight?this.target.offsetTop-this.toolbarHeight:0;this.coverDiv.style.top=B+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px";break;case"popup":this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=this.windowHeight+"px",this.contentDiv.style.maxHeight="calc(100vh - "+(2*this.popupMargin+2*this.toolbarHeight)+"px)"}this.positionCropImage()},J.prototype.rotateLeftButtonClicked=function(){var B=this.rotationAngle-90;this.rotationAngle%90!=0&&(B+=this.rotationAngle>=0?90-this.rotationAngle%90:-this.rotationAngle%90),this.rotateTo(B)},J.prototype.rotateRightButtonClicked=function(){var B=this.rotationAngle+90;this.rotationAngle%90!=0&&(B-=this.rotationAngle>=0?this.rotationAngle%90:90+this.rotationAngle%90),this.rotateTo(B)},J.prototype.rotateTo=function(B){B=(B=B>180?B-360:B)<=-180?B+360:B,this.rotationAngle=B,this.applyRotation()},J.prototype.rotateBy=function(B){this.rotateTo((this.rotationAngle+B)%360)},J.prototype.applyRotation=function(){var B=this.zoomToCropEnabled;this.zoomToCropEnabled=!1,this.editingTargetRotationScaleContainer.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationScaleContainer.style.transform="scale(1)";var H=this.editingTargetRotationContainer.transform.baseVal.getItem(0);H.setRotate(this.rotationAngle,this.imageWidth/2,this.imageHeight/2),this.editingTargetRotationContainer.transform.baseVal.replaceItem(H,0);var Y=this.editingTarget.getBoundingClientRect();this.scaleFactor=Math.min(this.imageWidth/Y.width,this.imageHeight/Y.height),this.editingTargetRotationScaleContainer.style.transform="scale("+this.scaleFactor+")",this.zoomToCropEnabled=B},J.prototype.flipHorizontallyButtonClicked=function(){this.flippedHorizontally=!this.flippedHorizontally,this.applyFlip()},J.prototype.flipVerticallyButtonClicked=function(){this.flippedVertically=!this.flippedVertically,this.applyFlip()},J.prototype.applyFlip=function(){this.editingTarget.style.transform="scale("+(this.flippedHorizontally?-1:1)+","+(this.flippedVertically?-1:1)+")"},J.prototype.startRenderAndClose=function(){return vt(this,void 0,void 0,function(){var B,H;return Bt(this,function(Y){switch(Y.label){case 0:return[4,this.render()];case 1:return B=Y.sent(),H=this.getState(),this.renderEventListeners.forEach(function(le){return le(B,H)}),this.close(!0),[2]}})})},J.prototype.render=function(){return vt(this,void 0,void 0,function(){var B;return Bt(this,function(H){switch(H.label){case 0:return(B=new Yi).naturalSize=this.renderAtNaturalSize,B.imageType=this.renderImageType,B.imageQuality=this.renderImageQuality,B.width=this.renderWidth,B.height=this.renderHeight,this.unzoomFromCrop(),dt.setAttributes(this.cropLayerContainer,[["display","none"]]),[4,B.rasterize(this.cropImage,this.target,{x:this.cropRect.x,y:this.cropRect.y,width:this.cropRect.width,height:this.cropRect.height},this.CANVAS_MARGIN,this.rotationAngle,this.scaleFactor*(this.flippedHorizontally?-1:1),this.scaleFactor*(this.flippedVertically?-1:1))];case 1:return H.sent(),[4,B.rasterize(this.cropImage,this.target,{x:this.cropRect.x,y:this.cropRect.y,width:this.cropRect.width,height:this.cropRect.height},this.CANVAS_MARGIN,this.rotationAngle,this.scaleFactor*(this.flippedHorizontally?-1:1),this.scaleFactor*(this.flippedVertically?-1:1))];case 2:return[2,H.sent()]}})})},J.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new pt("toolbar",`
|
|
|
width: `+(this.displayMode==="inline"?"100%":"calc(100vw - "+2*this.popupMargin+"px)")+`;
|
|
|
flex-shrink: 0;
|
|
|
display: flex;
|
|
|
flex-direction: row;
|
|
|
justify-content: space-between;
|
|
|
height: `+this.toolbarHeight+`px;
|
|
|
box-sizing: content-box;
|
|
|
overflow: hidden;
|
|
|
line-height: 0px;
|
|
|
`)),this.toolbarStyleColorsClass=this.styles.addClass(new pt("toolbar_colors",`
|
|
|
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
|
|
|
`)),this.toolbarBlockStyleClass=this.styles.addClass(new pt("toolbar-block",`
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
|
box-sizing: content-box;
|
|
|
`));var B=this.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new pt("toolbar_button",`
|
|
|
display: inline-block;
|
|
|
width: `+(this.toolbarHeight-2*B)+`px;
|
|
|
height: `+(this.toolbarHeight-2*B)+`px;
|
|
|
padding: `+B+`px;
|
|
|
cursor: default;
|
|
|
user-select: none;
|
|
|
box-sizing: content-box;
|
|
|
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new pt("toolbar_button_colors",`
|
|
|
color: `+this.styles.settings.toolbarColor+`;
|
|
|
fill: currentColor;
|
|
|
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new pt("toolbar_active_button",`
|
|
|
color: `+this.styles.settings.toolbarColor+`;
|
|
|
fill: currentColor;
|
|
|
background-color: `+this.styles.settings.toolbarBackgroundActiveColor+`
|
|
|
`)),this.styles.addRule(new gt("."+this.toolbarButtonStyleClass.name+" svg",`
|
|
|
height: `+this.toolbarHeight/2+`px;
|
|
|
`)),this.styles.addRule(new gt("."+this.toolbarButtonStyleColorsClass.name+":hover",`
|
|
|
background-color: `+this.styles.settings.toolbarBackgroundHoverColor+`
|
|
|
`)),this.toolbarDropdownStyleClass=this.styles.addClass(new pt("toolbar_dropdown",`
|
|
|
position: absolute;
|
|
|
max-width: `+4*this.toolbarHeight+`px;
|
|
|
z-index: 20;
|
|
|
white-space: normal;
|
|
|
box-sizing: content-box;
|
|
|
box-shadow: 3px 3px rgba(33, 33, 33, 0.1);
|
|
|
margin: `+(this.displayMode==="inline"?"0":this.popupMargin)+`px;
|
|
|
line-height: 0px;
|
|
|
`)),this.toolbarDropdownStyleColorsClass=this.styles.addClass(new pt("toolbar_dropdown_colors",`
|
|
|
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
|
|
|
`)),this.toolbarStraightenerBlockStyleClass=this.styles.addClass(new pt("toolbar_straightener_block",`
|
|
|
display: flex;
|
|
|
overflow: hidden;
|
|
|
justify-content: center;
|
|
|
-webkit-mask-image: linear-gradient(90deg, rgba(0,0,0,0) 0%, rgba(0,0,0,1) 30%, rgba(0,0,0,1) 70%, rgba(0,0,0,0) 100%);
|
|
|
`)),this.toolbarStraightenerStyleClass=this.styles.addClass(new pt("toolbar_straightener",`
|
|
|
display: flex;
|
|
|
overflow: hidden;
|
|
|
justify-content: center;
|
|
|
height: `+(this.toolbarHeight-2*B)+`px;
|
|
|
padding: `+B+`px;
|
|
|
cursor: default;
|
|
|
user-select: none;
|
|
|
box-sizing: content-box;
|
|
|
`)),this.toolbarStraightenerStyleColorsClass=this.styles.addClass(new pt("toolbar_straightener_colors",`
|
|
|
color: `+this.styles.settings.toolbarColor+`;
|
|
|
fill: currentColor;
|
|
|
`))},J.instanceCounter=0,J}(),Dt=q("8hTe"),pr=q.n(Dt),mr=/<pre[^>]*>/g;function gr(J){var B=document.createElement("div");return B.innerHTML=J,B.childNodes.length===0?"":B.childNodes[0].nodeValue}var vr=ne.a=function(J){var B=J.value,H=B===void 0?"":B,Y=J.edit,le=Y===void 0?!1:Y,$=J.className,Be=J.showTextOnly,nt=J.showLines,mt=J.replaces,wt=J.zoomImg,st=J.hasMask,Rt=J.style,Vt=Rt===void 0?{}:Rt,ri=J.stylesPrev,Hi=ri===void 0?{}:ri,Ti=String(H),Ci=Object(c.useRef)(),qi=Object(c.useRef)(),kr=Object(c.useState)(""),mi=Object(E.a)(kr,2),zi=mi[0],lr=mi[1],ur=Object(c.useState)("office"),ji=Object(E.a)(ur,2),Ir=ji[0],_r=ji[1],Xr=function(){var Yt=new ct(qi.current);Yt.displayMode="popup",Yt.addRenderEventListener(function(){var xi=Object(p.a)(i.a.mark(function jt(ui){var $t;return i.a.wrap(function(gi){for(;;)switch(gi.prev=gi.next){case 0:return Ci.current.style.display="none",gi.next=3,Object(We.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:ui}});case 3:$t=gi.sent,$t!=null&&$t.id&&mt(qi.current.getAttribute("src").replace(te.a.API_SERVER,""),"/api/attachments/".concat($t==null?void 0:$t.id,"?type=").concat($t.content_type));case 5:case"end":return gi.stop()}},jt)}));return function(jt){return xi.apply(this,arguments)}}()),Yt.show()},zr=function(){var Yt=new ut(qi.current);Yt.settings.displayMode="popup",Yt.addEventListener("render",function(){var xi=Object(p.a)(i.a.mark(function jt(ui){var $t;return i.a.wrap(function(gi){for(;;)switch(gi.prev=gi.next){case 0:if(Ci.current.style.display="none",!qi.current){gi.next=6;break}return gi.next=4,Object(We.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:ui.dataUrl}});case 4:$t=gi.sent,$t!=null&&$t.id&&mt(qi.current.getAttribute("src").replace(te.a.API_SERVER,""),"/api/attachments/".concat($t==null?void 0:$t.id,"?type=").concat($t.content_type));case 6:case"end":return gi.stop()}},jt)}));return function(jt){return xi.apply(this,arguments)}}()),Yt.show(),window.markerArea=Yt},$i=Object(c.useMemo)(function(){Ci.current&&(Ci.current.style.zIndex=-1);try{var oi=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,Yt=/\"\/api\/attachments\/|\"\/attachments\/download\//g,xi=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;Ti=Ti.replace(oi,"("+te.a.API_SERVER+"/api/attachments/").replace(Yt,'"'+te.a.API_SERVER+"/api/attachments/").replace(xi,'"'+te.a.API_SERVER+"/files/uploads/").replaceAll("http://video.educoder","https://video.educoder").replaceAll("http://www.educoder.net/api","https://data.educoder.net/api").replaceAll("https://www.educoder.net/api","https://data.educoder.net/api").replace(/\r\n/g,`
|
|
|
`)}catch(rr){}var jt=K(Ti),ui=F();if(Ti.match(/\[TOC\]/)&&(jt=jt.replace("<p>[TOC]</p>",C()),v()),jt=jt.replace(/(__special_katext_id_\d+__)/g,function(rr,gi){var Oi=ui[gi],Gr=Oi.type,xr=Oi.expression;return Object(de.renderToString)(gr(xr)||"",{displayMode:Gr==="block",throwOnError:!1,output:"html"})}),jt=jt.replace(/▁/g,"\u2581\u2581\u2581"),P(),Be){var $t=document.createElement("div");return $t.innerHTML=jt,$t.innerText}return setTimeout(function(){return cn()},500),jt},[Ti]),Qi=Object(c.useRef)();m.WebkitLineClamp=nt,nt&&(Vt=Object(M.a)(Object(M.a)({},Vt),m));function yr(oi){var Yt=oi.target;if(Yt.tagName.toUpperCase()==="IMG"){if(wt){var xi=Yt.getAttribute("src");lr(xi),_r("image")}}else if(Yt.tagName.toUpperCase()==="A"){var jt=Yt.getAttribute("href");if(jt.indexOf("office")>-1)oi.preventDefault(),lr(jt),_r("office");else if(jt.indexOf("application/pdf")>-1)oi.preventDefault(),lr(jt),_r("pdf");else if(jt.indexOf("text/html")>-1)oi.preventDefault(),lr(jt),_r("html");else if(jt.startsWith("#")){oi.preventDefault();var ui=document.getElementById(jt.replace("#",""));ui&&ui.scrollIntoView(!0)}}}var cn=function(){var Yt,xi=(Yt=Qi.current)===null||Yt===void 0?void 0:Yt.querySelectorAll("video");xi==null||xi.forEach(function(jt){if(jt.oncontextmenu=function(){return!1},jt.src.indexOf(".m3u8")>-1&&!jt.canPlayType("application/vnd.apple.mpegurl")){if(z.a.isSupported()){var ui=new z.a;ui.loadSource(jt.src),ui.attachMedia(jt)}}})};Object(c.useEffect)(function(){if(Qi.current&&$i&&($i.match(mr)&&window.PR.prettyPrint()),Qi.current)return Qi.current.addEventListener("click",yr),function(){Qi.current.removeEventListener("click",yr),P(),v()}},[$i,Qi.current,yr]);var br=function(Yt){if(!le)return;Yt.target.nodeName==="IMG"?(Ci.current.style.zIndex=1,Ci.current.style.display="flex",Ci.current.style.width=Yt.target.clientWidth+"px",Ci.current.style.height=Yt.target.clientHeight+"px",Ci.current.style.top=Yt.target.offsetTop+"px",Ci.current.style.left=Yt.target.offsetLeft+"px",qi.current.src=Yt.target.getAttribute("src")):Ci.current.style.display="none"};return o.a.createElement("div",{style:{position:"relative"}},o.a.createElement("div",{ref:Qi,style:Object(M.a)({},Vt),className:"".concat($||""," markdown-body ").concat(pr.a.mdBody),onMouseOver:br,dangerouslySetInnerHTML:{__html:$i}}),o.a.createElement("div",{ref:Ci,className:pr.a.button},o.a.createElement(L.a,null,o.a.createElement(R.a,{onClick:function(){return Xr()}},"\u88C1\u526A"),o.a.createElement(R.a,{onClick:function(){return zr()}},"\u7F16\u8F91"))),o.a.createElement("img",{ref:qi,src:"",alt:"sample",crossOrigin:"anonymous",style:{maxWidth:"90%",opacity:0,position:"absolute",zIndex:-1}}),o.a.createElement(be.a,{close:!0,data:zi,type:zi!=null&&zi.length?Ir:"",style:Object(M.a)({},Hi),onClose:function(){return lr("")}}))}},"9VGf":function(it,ne,q){"use strict";q.d(ne,"a",function(){return I});var G=q("q1tI"),L=q.n(G);function I(R,M){var p=Object(G.useRef)();Object(G.useEffect)(function(){p.current=R}),Object(G.useEffect)(function(){function E(){p.current()}if(M!==null){var b=setInterval(E,M);return function(){return clearInterval(b)}}},[M])}},BU3w:function(it,ne,q){"use strict";q.d(ne,"a",function(){return p});var G=q("MNnm"),L="rc-util-key";function I(E){if(E.attachTo)return E.attachTo;var b=document.querySelector("head");return b||document.body}function R(E){var b,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!Object(G.a)())return null;var c=document.createElement("style");if((b=i.csp)===null||b===void 0?void 0:b.nonce){var o;c.nonce=(o=i.csp)===null||o===void 0?void 0:o.nonce}c.innerHTML=E;var h=I(i),n=h.firstChild;return i.prepend&&h.prepend?h.prepend(c):i.prepend&&n?h.insertBefore(c,n):h.appendChild(c),c}var M=new Map;function p(E,b){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},c=I(i);if(!M.has(c)){var o=R("",i),h=o.parentNode;M.set(c,h),h.removeChild(o)}var n=Array.from(M.get(c).children).find(function(u){return u.tagName==="STYLE"&&u[L]===b});if(n){var a,t;if(((a=i.csp)===null||a===void 0?void 0:a.nonce)&&n.nonce!==((t=i.csp)===null||t===void 0?void 0:t.nonce)){var r;n.nonce=(r=i.csp)===null||r===void 0?void 0:r.nonce}return n.innerHTML!==E&&(n.innerHTML=E),n}var s=R(E,i);return s[L]=b,s}},Bd2K:function(it,ne,q){(function(G){G(q("VrN/"),q("osHv"))})(function(G){G.defineOption("autoCloseTags",!1,function(i,c,o){if(o!=G.Init&&o&&i.removeKeyMap("autoCloseTags"),!c)return;var h={name:"autoCloseTags"};(typeof c!="object"||c.whenClosing!==!1)&&(h["'/'"]=function(n){return p(n)}),(typeof c!="object"||c.whenOpening!==!1)&&(h["'>'"]=function(n){return R(n)}),i.addKeyMap(h)});var L=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],I=["applet","blockquote","body","button","div","dl","fieldset","form","frameset","h1","h2","h3","h4","h5","h6","head","html","iframe","layer","legend","object","ol","p","select","table","ul"];function R(i){if(i.getOption("disableInput"))return G.Pass;for(var c=i.listSelections(),o=[],h=i.getOption("autoCloseTags"),n=0;n<c.length;n++){if(!c[n].empty())return G.Pass;var a=c[n].head,t=i.getTokenAt(a),r=G.innerMode(i.getMode(),t.state),s=r.state,u=r.mode.xmlCurrentTag&&r.mode.xmlCurrentTag(s),d=u&&u.name;if(!d)return G.Pass;var f=r.mode.configuration=="html",v=typeof h=="object"&&h.dontCloseTags||f&&L,m=typeof h=="object"&&h.indentTags||f&&I;t.end>a.ch&&(d=d.slice(0,d.length-t.end+a.ch));var S=d.toLowerCase();if(!d||t.type=="string"&&(t.end!=a.ch||!/[\"\']/.test(t.string.charAt(t.string.length-1))||t.string.length==1)||t.type=="tag"&&u.close||t.string.indexOf("/")==a.ch-t.start-1||v&&E(v,S)>-1||b(i,r.mode.xmlCurrentContext&&r.mode.xmlCurrentContext(s)||[],d,a,!0))return G.Pass;var C=typeof h=="object"&&h.emptyTags;if(C&&E(C,d)>-1){o[n]={text:"/>",newPos:G.Pos(a.line,a.ch+2)};continue}var _=m&&E(m,S)>-1;o[n]={indent:_,text:">"+(_?`
|
|
|
|
|
|
`:"")+"</"+d+">",newPos:_?G.Pos(a.line+1,0):G.Pos(a.line,a.ch+1)}}for(var y=typeof h=="object"&&h.dontIndentOnAutoClose,n=c.length-1;n>=0;n--){var T=o[n];i.replaceRange(T.text,c[n].head,c[n].anchor,"+insert");var O=i.listSelections().slice(0);O[n]={head:T.newPos,anchor:T.newPos},i.setSelections(O),!y&&T.indent&&(i.indentLine(T.newPos.line,null,!0),i.indentLine(T.newPos.line+1,null,!0))}}function M(i,c){for(var o=i.listSelections(),h=[],n=c?"/":"</",a=i.getOption("autoCloseTags"),t=typeof a=="object"&&a.dontIndentOnSlash,r=0;r<o.length;r++){if(!o[r].empty())return G.Pass;var s=o[r].head,u=i.getTokenAt(s),d=G.innerMode(i.getMode(),u.state),f=d.state;if(c&&(u.type=="string"||u.string.charAt(0)!="<"||u.start!=s.ch-1))return G.Pass;var v,m=d.mode.name!="xml"&&i.getMode().name=="htmlmixed";if(m&&d.mode.name=="javascript")v=n+"script";else if(m&&d.mode.name=="css")v=n+"style";else{var S=d.mode.xmlCurrentContext&&d.mode.xmlCurrentContext(f);if(!S||S.length&&b(i,S,S[S.length-1],s))return G.Pass;v=n+S[S.length-1]}i.getLine(s.line).charAt(u.end)!=">"&&(v+=">"),h[r]=v}if(i.replaceSelections(h),o=i.listSelections(),!t)for(var r=0;r<o.length;r++)(r==o.length-1||o[r].head.line<o[r+1].head.line)&&i.indentLine(o[r].head.line)}function p(i){return i.getOption("disableInput")?G.Pass:M(i,!0)}G.commands.closeTag=function(i){return M(i)};function E(i,c){if(i.indexOf)return i.indexOf(c);for(var o=0,h=i.length;o<h;++o)if(i[o]==c)return o;return-1}function b(i,c,o,h,n){if(!G.scanForClosingTag)return!1;var a=Math.min(i.lastLine()+1,h.line+500),t=G.scanForClosingTag(i,h,null,a);if(!t||t.tag!=o)return!1;for(var r=n?1:0,s=c.length-1;s>=0&&c[s]==o;s--)++r;h=t.to;for(var s=1;s<r;s++){var u=G.scanForClosingTag(i,h,null,a);if(!u||u.tag!=o)return!1;h=u.to}return!0}})},BjJ7:function(it,ne,q){"use strict";q.d(ne,"d",function(){return L}),q.d(ne,"c",function(){return I}),q.d(ne,"e",function(){return R}),q.d(ne,"b",function(){return M}),q.d(ne,"a",function(){return E});var G=q("m3rI");function L(b){var i=!0;if(b.length>0){for(var c=0;c<b.length;c++)if(b[c].compile_success==0||!b[c].compile_success){i=!1;break}}else i=!1;return i}function I(b){for(var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",c=[],o=0;o<b.length;o++){var h=b[o],n=i?"".concat(i,"/").concat(h.name):"".concat(h.name);c.push({title:h.name,isLeaf:!(h.type==="tree"),key:n})}return c}function R(b,i,c){for(var o=0;o<b.length;o++){var h=b[o];if(h.key===i){h.children=c;break}h.children&&R(h.children,i,c)}return b}function M(b,i,c){var o;return function(){var h=this,n=arguments,a=function(){o=null,c||b.apply(h,n)},t=c&&!o;clearTimeout(o),o=setTimeout(a,i),t&&b.apply(h,n)}}var p=!0,E=G.a.API_SERVER},"C+DQ":function(it,ne,q){},"C/vA":function(it,ne,q){"use strict";q.d(ne,"a",function(){return G});function G(L){const I=this;let R=!1,M;return function(){return R||(R=!0,M=L.apply(I,arguments)),M}}},"Cg/j":function(it,ne,q){"use strict";q.d(ne,"b",function(){return G}),q.d(ne,"a",function(){return L}),q.d(ne,"c",function(){return R}),q.d(ne,"d",function(){return M});var G;(function(p){p.serviceIds=new Map,p.DI_TARGET="$di$target",p.DI_DEPENDENCIES="$di$dependencies";function E(b){return b[p.DI_DEPENDENCIES]||[]}p.getServiceDependencies=E})(G||(G={}));const L=R("instantiationService");function I(p,E,b,i){E[G.DI_TARGET]===E?E[G.DI_DEPENDENCIES].push({id:p,index:b,optional:i}):(E[G.DI_DEPENDENCIES]=[{id:p,index:b,optional:i}],E[G.DI_TARGET]=E)}function R(p){if(G.serviceIds.has(p))return G.serviceIds.get(p);const E=function(b,i,c){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");I(E,b,c,!1)};return E.toString=()=>p,G.serviceIds.set(p,E),E}function M(p){return function(E,b,i){if(arguments.length!==3)throw new Error("@optional-decorator can only be used to decorate a parameter");I(p,E,i,!0)}}},DlQD:function(it,ne,q){(function(G,L){it.exports=L()})(this,function(){"use strict";function G(Ce,_e){for(var Ee=0;Ee<_e.length;Ee++){var ee=_e[Ee];ee.enumerable=ee.enumerable||!1,ee.configurable=!0,"value"in ee&&(ee.writable=!0),Object.defineProperty(Ce,ee.key,ee)}}function L(Ce,_e,Ee){return _e&&G(Ce.prototype,_e),Ee&&G(Ce,Ee),Ce}function I(Ce,_e){if(!Ce)return;if(typeof Ce=="string")return R(Ce,_e);var Ee=Object.prototype.toString.call(Ce).slice(8,-1);if(Ee==="Object"&&Ce.constructor&&(Ee=Ce.constructor.name),Ee==="Map"||Ee==="Set")return Array.from(Ce);if(Ee==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(Ee))return R(Ce,_e)}function R(Ce,_e){(_e==null||_e>Ce.length)&&(_e=Ce.length);for(var Ee=0,ee=new Array(_e);Ee<_e;Ee++)ee[Ee]=Ce[Ee];return ee}function M(Ce,_e){var Ee;if(typeof Symbol=="undefined"||Ce[Symbol.iterator]==null){if(Array.isArray(Ce)||(Ee=I(Ce))||_e&&Ce&&typeof Ce.length=="number"){Ee&&(Ce=Ee);var ee=0;return function(){return ee>=Ce.length?{done:!0}:{done:!1,value:Ce[ee++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}return Ee=Ce[Symbol.iterator](),Ee.next.bind(Ee)}function p(Ce,_e){return _e={exports:{}},Ce(_e,_e.exports),_e.exports}var E=p(function(Ce){function _e(){return{baseUrl:null,breaks:!1,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}function Ee(ee){Ce.exports.defaults=ee}Ce.exports={defaults:_e(),getDefaults:_e,changeDefaults:Ee}}),b=E.defaults,i=E.getDefaults,c=E.changeDefaults,o=/[&<>"']/,h=/[&<>"']/g,n=/[<>"']|&(?!#?\w+;)/,a=/[<>"']|&(?!#?\w+;)/g,t={"&":"&","<":"<",">":">",'"':""","'":"'"},r=function(_e){return t[_e]};function s(Ce,_e){if(_e){if(o.test(Ce))return Ce.replace(h,r)}else if(n.test(Ce))return Ce.replace(a,r);return Ce}var u=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function d(Ce){return Ce.replace(u,function(_e,Ee){return Ee=Ee.toLowerCase(),Ee==="colon"?":":Ee.charAt(0)==="#"?Ee.charAt(1)==="x"?String.fromCharCode(parseInt(Ee.substring(2),16)):String.fromCharCode(+Ee.substring(1)):""})}var f=/(^|[^\[])\^/g;function v(Ce,_e){Ce=Ce.source||Ce,_e=_e||"";var Ee={replace:function(oe,Q){return Q=Q.source||Q,Q=Q.replace(f,"$1"),Ce=Ce.replace(oe,Q),Ee},getRegex:function(){return new RegExp(Ce,_e)}};return Ee}var m=/[^\w:]/g,S=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function C(Ce,_e,Ee){if(Ce){var ee;try{ee=decodeURIComponent(d(Ee)).replace(m,"").toLowerCase()}catch(oe){return null}if(ee.indexOf("javascript:")===0||ee.indexOf("vbscript:")===0||ee.indexOf("data:")===0)return null}_e&&!S.test(Ee)&&(Ee=g(_e,Ee));try{Ee=encodeURI(Ee).replace(/%25/g,"%")}catch(oe){return null}return Ee}var _={},y=/^[^:]+:\/*[^/]*$/,T=/^([^:]+:)[\s\S]*$/,O=/^([^:]+:\/*[^/]*)[\s\S]*$/;function g(Ce,_e){_[" "+Ce]||(y.test(Ce)?_[" "+Ce]=Ce+"/":_[" "+Ce]=X(Ce,"/",!0)),Ce=_[" "+Ce];var Ee=Ce.indexOf(":")===-1;return _e.substring(0,2)==="//"?Ee?_e:Ce.replace(T,"$1")+_e:_e.charAt(0)==="/"?Ee?_e:Ce.replace(O,"$1")+_e:Ce+_e}var F={exec:function(){}};function P(Ce){for(var _e=1,Ee,ee;_e<arguments.length;_e++){Ee=arguments[_e];for(ee in Ee)Object.prototype.hasOwnProperty.call(Ee,ee)&&(Ce[ee]=Ee[ee])}return Ce}function N(Ce,_e){var Ee=Ce.replace(/\|/g,function(Q,me,Oe){for(var V=!1,Re=me;--Re>=0&&Oe[Re]==="\\";)V=!V;return V?"|":" |"}),ee=Ee.split(/ \|/),oe=0;if(ee.length>_e)ee.splice(_e);else for(;ee.length<_e;)ee.push("");for(;oe<ee.length;oe++)ee[oe]=ee[oe].trim().replace(/\\\|/g,"|");return ee}function X(Ce,_e,Ee){var ee=Ce.length;if(ee===0)return"";for(var oe=0;oe<ee;){var Q=Ce.charAt(ee-oe-1);if(Q===_e&&!Ee)oe++;else if(Q!==_e&&Ee)oe++;else break}return Ce.substr(0,ee-oe)}function j(Ce,_e){if(Ce.indexOf(_e[1])===-1)return-1;for(var Ee=Ce.length,ee=0,oe=0;oe<Ee;oe++)if(Ce[oe]==="\\")oe++;else if(Ce[oe]===_e[0])ee++;else if(Ce[oe]===_e[1]&&(ee--,ee<0))return oe;return-1}function A(Ce){Ce&&Ce.sanitize&&!Ce.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}var K={escape:s,unescape:d,edit:v,cleanUrl:C,resolveUrl:g,noopTest:F,merge:P,splitCells:N,rtrim:X,findClosingBracket:j,checkSanitizeDeprecation:A},U=E.defaults,k=K.rtrim,z=K.splitCells,te=K.escape,de=K.findClosingBracket;function be(Ce,_e,Ee){var ee=_e.href,oe=_e.title?te(_e.title):null,Q=Ce[1].replace(/\\([\[\]])/g,"$1");return Ce[0].charAt(0)!=="!"?{type:"link",raw:Ee,href:ee,title:oe,text:Q}:{type:"image",raw:Ee,href:ee,title:oe,text:te(Q)}}function We(Ce,_e){var Ee=Ce.match(/^(\s+)(?:```)/);if(Ee===null)return _e;var ee=Ee[1];return _e.split(`
|
|
|
`).map(function(oe){var Q=oe.match(/^\s+/);if(Q===null)return oe;var me=Q[0];return me.length>=ee.length?oe.slice(ee.length):oe}).join(`
|
|
|
`)}var Ne=function(){function Ce(Ee){this.options=Ee||U}var _e=Ce.prototype;return _e.space=function(ee){var oe=this.rules.block.newline.exec(ee);if(oe)return oe[0].length>1?{type:"space",raw:oe[0]}:{raw:`
|
|
|
`}},_e.code=function(ee,oe){var Q=this.rules.block.code.exec(ee);if(Q){var me=oe[oe.length-1];if(me&&me.type==="paragraph")return{raw:Q[0],text:Q[0].trimRight()};var Oe=Q[0].replace(/^ {4}/gm,"");return{type:"code",raw:Q[0],codeBlockStyle:"indented",text:this.options.pedantic?Oe:k(Oe,`
|
|
|
`)}}},_e.fences=function(ee){var oe=this.rules.block.fences.exec(ee);if(oe){var Q=oe[0],me=We(Q,oe[3]||"");return{type:"code",raw:Q,lang:oe[2]?oe[2].trim():oe[2],text:me}}},_e.heading=function(ee){var oe=this.rules.block.heading.exec(ee);if(oe)return{type:"heading",raw:oe[0],depth:oe[1].length,text:oe[2]}},_e.nptable=function(ee){var oe=this.rules.block.nptable.exec(ee);if(oe){var Q={type:"table",header:z(oe[1].replace(/^ *| *\| *$/g,"")),align:oe[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:oe[3]?oe[3].replace(/\n$/,"").split(`
|
|
|
`):[],raw:oe[0]};if(Q.header.length===Q.align.length){var me=Q.align.length,Oe;for(Oe=0;Oe<me;Oe++)/^ *-+: *$/.test(Q.align[Oe])?Q.align[Oe]="right":/^ *:-+: *$/.test(Q.align[Oe])?Q.align[Oe]="center":/^ *:-+ *$/.test(Q.align[Oe])?Q.align[Oe]="left":Q.align[Oe]=null;for(me=Q.cells.length,Oe=0;Oe<me;Oe++)Q.cells[Oe]=z(Q.cells[Oe],Q.header.length);return Q}}},_e.hr=function(ee){var oe=this.rules.block.hr.exec(ee);if(oe)return{type:"hr",raw:oe[0]}},_e.blockquote=function(ee){var oe=this.rules.block.blockquote.exec(ee);if(oe){var Q=oe[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:oe[0],text:Q}}},_e.list=function(ee){var oe=this.rules.block.list.exec(ee);if(oe){for(var Q=oe[0],me=oe[2],Oe=me.length>1,V=me[me.length-1]===")",Re={type:"list",raw:Q,ordered:Oe,start:Oe?+me.slice(0,-1):"",loose:!1,items:[]},Xe=oe[0].match(this.rules.block.item),pe=!1,ke,Ve,ht,tt,at,ut,Ft,St=Xe.length,vt=0;vt<St;vt++)ke=Xe[vt],Q=ke,Ve=ke.length,ke=ke.replace(/^ *([*+-]|\d+[.)]) */,""),~ke.indexOf(`
|
|
|
`)&&(Ve-=ke.length,ke=this.options.pedantic?ke.replace(/^ {1,4}/gm,""):ke.replace(new RegExp("^ {1,"+Ve+"}","gm"),"")),vt!==St-1&&(ht=this.rules.block.bullet.exec(Xe[vt+1])[0],(Oe?ht.length===1||!V&&ht[ht.length-1]===")":ht.length>1||this.options.smartLists&&ht!==me)&&(tt=Xe.slice(vt+1).join(`
|
|
|
`),Re.raw=Re.raw.substring(0,Re.raw.length-tt.length),vt=St-1)),at=pe||/\n\n(?!\s*$)/.test(ke),vt!==St-1&&(pe=ke.charAt(ke.length-1)===`
|
|
|
`,at||(at=pe)),at&&(Re.loose=!0),ut=/^\[[ xX]\] /.test(ke),Ft=void 0,ut&&(Ft=ke[1]!==" ",ke=ke.replace(/^\[[ xX]\] +/,"")),Re.items.push({type:"list_item",raw:Q,task:ut,checked:Ft,loose:at,text:ke});return Re}},_e.html=function(ee){var oe=this.rules.block.html.exec(ee);if(oe)return{type:this.options.sanitize?"paragraph":"html",raw:oe[0],pre:!this.options.sanitizer&&(oe[1]==="pre"||oe[1]==="script"||oe[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(oe[0]):te(oe[0]):oe[0]}},_e.def=function(ee){var oe=this.rules.block.def.exec(ee);if(oe){oe[3]&&(oe[3]=oe[3].substring(1,oe[3].length-1));var Q=oe[1].toLowerCase().replace(/\s+/g," ");return{tag:Q,raw:oe[0],href:oe[2],title:oe[3]}}},_e.table=function(ee){var oe=this.rules.block.table.exec(ee);if(oe){var Q={type:"table",header:z(oe[1].replace(/^ *| *\| *$/g,"")),align:oe[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:oe[3]?oe[3].replace(/\n$/,"").split(`
|
|
|
`):[]};if(Q.header.length===Q.align.length){Q.raw=oe[0];var me=Q.align.length,Oe;for(Oe=0;Oe<me;Oe++)/^ *-+: *$/.test(Q.align[Oe])?Q.align[Oe]="right":/^ *:-+: *$/.test(Q.align[Oe])?Q.align[Oe]="center":/^ *:-+ *$/.test(Q.align[Oe])?Q.align[Oe]="left":Q.align[Oe]=null;for(me=Q.cells.length,Oe=0;Oe<me;Oe++)Q.cells[Oe]=z(Q.cells[Oe].replace(/^ *\| *| *\| *$/g,""),Q.header.length);return Q}}},_e.lheading=function(ee){var oe=this.rules.block.lheading.exec(ee);if(oe)return{type:"heading",raw:oe[0],depth:oe[2].charAt(0)==="="?1:2,text:oe[1]}},_e.paragraph=function(ee){var oe=this.rules.block.paragraph.exec(ee);if(oe)return{type:"paragraph",raw:oe[0],text:oe[1].charAt(oe[1].length-1)===`
|
|
|
`?oe[1].slice(0,-1):oe[1]}},_e.text=function(ee,oe){var Q=this.rules.block.text.exec(ee);if(Q){var me=oe[oe.length-1];return me&&me.type==="text"?{raw:Q[0],text:Q[0]}:{type:"text",raw:Q[0],text:Q[0]}}},_e.escape=function(ee){var oe=this.rules.inline.escape.exec(ee);if(oe)return{type:"escape",raw:oe[0],text:te(oe[1])}},_e.tag=function(ee,oe,Q){var me=this.rules.inline.tag.exec(ee);if(me)return!oe&&/^<a /i.test(me[0])?oe=!0:oe&&/^<\/a>/i.test(me[0])&&(oe=!1),!Q&&/^<(pre|code|kbd|script)(\s|>)/i.test(me[0])?Q=!0:Q&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(me[0])&&(Q=!1),{type:this.options.sanitize?"text":"html",raw:me[0],inLink:oe,inRawBlock:Q,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(me[0]):te(me[0]):me[0]}},_e.link=function(ee){var oe=this.rules.inline.link.exec(ee);if(oe){var Q=de(oe[2],"()");if(Q>-1){var me=oe[0].indexOf("!")===0?5:4,Oe=me+oe[1].length+Q;oe[2]=oe[2].substring(0,Q),oe[0]=oe[0].substring(0,Oe).trim(),oe[3]=""}var V=oe[2],Re="";if(this.options.pedantic){var Xe=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(V);Xe?(V=Xe[1],Re=Xe[3]):Re=""}else Re=oe[3]?oe[3].slice(1,-1):"";V=V.trim().replace(/^<([\s\S]*)>$/,"$1");var pe=be(oe,{href:V&&V.replace(this.rules.inline._escapes,"$1"),title:Re&&Re.replace(this.rules.inline._escapes,"$1")},oe[0]);return pe}},_e.reflink=function(ee,oe){var Q;if((Q=this.rules.inline.reflink.exec(ee))||(Q=this.rules.inline.nolink.exec(ee))){var me=(Q[2]||Q[1]).replace(/\s+/g," ");if(me=oe[me.toLowerCase()],!me||!me.href){var Oe=Q[0].charAt(0);return{type:"text",raw:Oe,text:Oe}}var V=be(Q,me,Q[0]);return V}},_e.strong=function(ee,oe,Q){Q===void 0&&(Q="");var me=this.rules.inline.strong.start.exec(ee);if(me&&(!me[1]||me[1]&&(Q===""||this.rules.inline.punctuation.exec(Q)))){oe=oe.slice(-1*ee.length);var Oe=me[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;Oe.lastIndex=0;for(var V;(me=Oe.exec(oe))!=null;)if(V=this.rules.inline.strong.middle.exec(oe.slice(0,me.index+3)),V)return{type:"strong",raw:ee.slice(0,V[0].length),text:ee.slice(2,V[0].length-2)}}},_e.em=function(ee,oe,Q){Q===void 0&&(Q="");var me=this.rules.inline.em.start.exec(ee);if(me&&(!me[1]||me[1]&&(Q===""||this.rules.inline.punctuation.exec(Q)))){oe=oe.slice(-1*ee.length);var Oe=me[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;Oe.lastIndex=0;for(var V;(me=Oe.exec(oe))!=null;)if(V=this.rules.inline.em.middle.exec(oe.slice(0,me.index+2)),V)return{type:"em",raw:ee.slice(0,V[0].length),text:ee.slice(1,V[0].length-1)}}},_e.codespan=function(ee){var oe=this.rules.inline.code.exec(ee);if(oe){var Q=oe[2].replace(/\n/g," "),me=/[^ ]/.test(Q),Oe=Q.startsWith(" ")&&Q.endsWith(" ");return me&&Oe&&(Q=Q.substring(1,Q.length-1)),Q=te(Q,!0),{type:"codespan",raw:oe[0],text:Q}}},_e.br=function(ee){var oe=this.rules.inline.br.exec(ee);if(oe)return{type:"br",raw:oe[0]}},_e.del=function(ee){var oe=this.rules.inline.del.exec(ee);if(oe)return{type:"del",raw:oe[0],text:oe[1]}},_e.autolink=function(ee,oe){var Q=this.rules.inline.autolink.exec(ee);if(Q){var me,Oe;return Q[2]==="@"?(me=te(this.options.mangle?oe(Q[1]):Q[1]),Oe="mailto:"+me):(me=te(Q[1]),Oe=me),{type:"link",raw:Q[0],text:me,href:Oe,tokens:[{type:"text",raw:me,text:me}]}}},_e.url=function(ee,oe){var Q;if(Q=this.rules.inline.url.exec(ee)){var me,Oe;if(Q[2]==="@")me=te(this.options.mangle?oe(Q[0]):Q[0]),Oe="mailto:"+me;else{var V;do V=Q[0],Q[0]=this.rules.inline._backpedal.exec(Q[0])[0];while(V!==Q[0]);me=te(Q[0]),Q[1]==="www."?Oe="http://"+me:Oe=me}return{type:"link",raw:Q[0],text:me,href:Oe,tokens:[{type:"text",raw:me,text:me}]}}},_e.inlineText=function(ee,oe,Q){var me=this.rules.inline.text.exec(ee);if(me){var Oe;return oe?Oe=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(me[0]):te(me[0]):me[0]:Oe=te(this.options.smartypants?Q(me[0]):me[0]),{type:"text",raw:me[0],text:Oe}}},Ce}(),Le=K.noopTest,Ke=K.edit,He=K.merge,Ae={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?:\n+|$)|$)/,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6}) +([^\n]*?)(?: +#+)? *(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3})(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:"^ {0,3}(?:<(script|pre|style)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?\\?>\\n*|<![A-Z][\\s\\S]*?>\\n*|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>\\n*|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:\\n{2,}|$)|<(?!script|pre|style)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$)|</(?!script|pre|style)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$))",def:/^ {0,3}\[(label)\]: *\n? *<?([^\s>]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,nptable:Le,table:Le,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/};Ae._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,Ae._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,Ae.def=Ke(Ae.def).replace("label",Ae._label).replace("title",Ae._title).getRegex(),Ae.bullet=/(?:[*+-]|\d{1,9}[.)])/,Ae.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,Ae.item=Ke(Ae.item,"gm").replace(/bull/g,Ae.bullet).getRegex(),Ae.list=Ke(Ae.list).replace(/bull/g,Ae.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+Ae.def.source+")").getRegex(),Ae._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Ae._comment=/<!--(?!-?>)[\s\S]*?-->/,Ae.html=Ke(Ae.html,"i").replace("comment",Ae._comment).replace("tag",Ae._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Ae.paragraph=Ke(Ae._paragraph).replace("hr",Ae.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",Ae._tag).getRegex(),Ae.blockquote=Ke(Ae.blockquote).replace("paragraph",Ae.paragraph).getRegex(),Ae.normal=He({},Ae),Ae.gfm=He({},Ae.normal,{nptable:"^ *([^|\\n ].*\\|.*)\\n *([-:]+ *\\|[-| :]*)(?:\\n((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)",table:"^ *\\|(.+)\\n *\\|?( *[-:]+[-| :]*)(?:\\n *((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"}),Ae.gfm.nptable=Ke(Ae.gfm.nptable).replace("hr",Ae.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",Ae._tag).getRegex(),Ae.gfm.table=Ke(Ae.gfm.table).replace("hr",Ae.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",Ae._tag).getRegex(),Ae.pedantic=He({},Ae.normal,{html:Ke(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Ae._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/,fences:Le,paragraph:Ke(Ae.normal._paragraph).replace("hr",Ae.hr).replace("heading",` *#{1,6} *[^
|
|
|
]`).replace("lheading",Ae.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var Se={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:Le,tag:"^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/,nolink:/^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",strong:{start:/^(?:(\*\*(?=[*punctuation]))|\*\*)(?![\s])|__/,middle:/^\*\*(?:(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)|\*(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)*?\*)+?\*\*$|^__(?![\s])((?:(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)|_(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)*?_)+?)__$/,endAst:/[^punctuation\s]\*\*(?!\*)|[punctuation]\*\*(?!\*)(?:(?=[punctuation\s]|$))/,endUnd:/[^\s]__(?!_)(?:(?=[punctuation\s])|$)/},em:{start:/^(?:(\*(?=[punctuation]))|\*)(?![*\s])|_/,middle:/^\*(?:(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)|\*(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)*?\*)+?\*$|^_(?![_\s])(?:(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)|_(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)*?_)+?_$/,endAst:/[^punctuation\s]\*(?!\*)|[punctuation]\*(?!\*)(?:(?=[punctuation\s]|$))/,endUnd:/[^\s]_(?!_)(?:(?=[punctuation\s])|$)/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:Le,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*]|\b_|$)|[^ ](?= {2,}\n))|(?= {2,}\n))/,punctuation:/^([\s*punctuation])/};Se._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",Se.punctuation=Ke(Se.punctuation).replace(/punctuation/g,Se._punctuation).getRegex(),Se._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",Se._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",Se.em.start=Ke(Se.em.start).replace(/punctuation/g,Se._punctuation).getRegex(),Se.em.middle=Ke(Se.em.middle).replace(/punctuation/g,Se._punctuation).replace(/overlapSkip/g,Se._overlapSkip).getRegex(),Se.em.endAst=Ke(Se.em.endAst,"g").replace(/punctuation/g,Se._punctuation).getRegex(),Se.em.endUnd=Ke(Se.em.endUnd,"g").replace(/punctuation/g,Se._punctuation).getRegex(),Se.strong.start=Ke(Se.strong.start).replace(/punctuation/g,Se._punctuation).getRegex(),Se.strong.middle=Ke(Se.strong.middle).replace(/punctuation/g,Se._punctuation).replace(/blockSkip/g,Se._blockSkip).getRegex(),Se.strong.endAst=Ke(Se.strong.endAst,"g").replace(/punctuation/g,Se._punctuation).getRegex(),Se.strong.endUnd=Ke(Se.strong.endUnd,"g").replace(/punctuation/g,Se._punctuation).getRegex(),Se.blockSkip=Ke(Se._blockSkip,"g").getRegex(),Se.overlapSkip=Ke(Se._overlapSkip,"g").getRegex(),Se._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,Se._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,Se._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/,Se.autolink=Ke(Se.autolink).replace("scheme",Se._scheme).replace("email",Se._email).getRegex(),Se._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,Se.tag=Ke(Se.tag).replace("comment",Ae._comment).replace("attribute",Se._attribute).getRegex(),Se._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,Se._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,Se._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,Se.link=Ke(Se.link).replace("label",Se._label).replace("href",Se._href).replace("title",Se._title).getRegex(),Se.reflink=Ke(Se.reflink).replace("label",Se._label).getRegex(),Se.reflinkSearch=Ke(Se.reflinkSearch,"g").replace("reflink",Se.reflink).replace("nolink",Se.nolink).getRegex(),Se.normal=He({},Se),Se.pedantic=He({},Se.normal,{strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:Ke(/^!?\[(label)\]\((.*?)\)/).replace("label",Se._label).getRegex(),reflink:Ke(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Se._label).getRegex()}),Se.gfm=He({},Se.normal,{escape:Ke(Se.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^~+(?=\S)([\s\S]*?\S)~+/,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*~]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))|(?= {2,}\n|[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))/}),Se.gfm.url=Ke(Se.gfm.url,"i").replace("email",Se.gfm._extended_email).getRegex(),Se.breaks=He({},Se.gfm,{br:Ke(Se.br).replace("{2,}","*").getRegex(),text:Ke(Se.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});var he={block:Ae,inline:Se},Ie=E.defaults,ye=he.block,Ge=he.inline;function $e(Ce){return Ce.replace(/---/g,"\u2014").replace(/--/g,"\u2013").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1\u2018").replace(/'/g,"\u2019").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1\u201C").replace(/"/g,"\u201D").replace(/\.{3}/g,"\u2026")}function ze(Ce){var _e="",Ee,ee,oe=Ce.length;for(Ee=0;Ee<oe;Ee++)ee=Ce.charCodeAt(Ee),Math.random()>.5&&(ee="x"+ee.toString(16)),_e+="&#"+ee+";";return _e}var Je=function(){function Ce(Ee){this.tokens=[],this.tokens.links=Object.create(null),this.options=Ee||Ie,this.options.tokenizer=this.options.tokenizer||new Ne,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var ee={block:ye.normal,inline:Ge.normal};this.options.pedantic?(ee.block=ye.pedantic,ee.inline=Ge.pedantic):this.options.gfm&&(ee.block=ye.gfm,this.options.breaks?ee.inline=Ge.breaks:ee.inline=Ge.gfm),this.tokenizer.rules=ee}Ce.lex=function(ee,oe){var Q=new Ce(oe);return Q.lex(ee)};var _e=Ce.prototype;return _e.lex=function(ee){return ee=ee.replace(/\r\n|\r/g,`
|
|
|
`).replace(/\t/g," "),this.blockTokens(ee,this.tokens,!0),this.inline(this.tokens),this.tokens},_e.blockTokens=function(ee,oe,Q){oe===void 0&&(oe=[]),Q===void 0&&(Q=!0),ee=ee.replace(/^ +$/gm,"");for(var me,Oe,V,Re;ee;){if(me=this.tokenizer.space(ee)){ee=ee.substring(me.raw.length),me.type&&oe.push(me);continue}if(me=this.tokenizer.code(ee,oe)){ee=ee.substring(me.raw.length),me.type?oe.push(me):(Re=oe[oe.length-1],Re.raw+=`
|
|
|
`+me.raw,Re.text+=`
|
|
|
`+me.text);continue}if(me=this.tokenizer.fences(ee)){ee=ee.substring(me.raw.length),oe.push(me);continue}if(me=this.tokenizer.heading(ee)){ee=ee.substring(me.raw.length),oe.push(me);continue}if(me=this.tokenizer.nptable(ee)){ee=ee.substring(me.raw.length),oe.push(me);continue}if(me=this.tokenizer.hr(ee)){ee=ee.substring(me.raw.length),oe.push(me);continue}if(me=this.tokenizer.blockquote(ee)){ee=ee.substring(me.raw.length),me.tokens=this.blockTokens(me.text,[],Q),oe.push(me);continue}if(me=this.tokenizer.list(ee)){for(ee=ee.substring(me.raw.length),V=me.items.length,Oe=0;Oe<V;Oe++)me.items[Oe].tokens=this.blockTokens(me.items[Oe].text,[],!1);oe.push(me);continue}if(me=this.tokenizer.html(ee)){ee=ee.substring(me.raw.length),oe.push(me);continue}if(Q&&(me=this.tokenizer.def(ee))){ee=ee.substring(me.raw.length),this.tokens.links[me.tag]||(this.tokens.links[me.tag]={href:me.href,title:me.title});continue}if(me=this.tokenizer.table(ee)){ee=ee.substring(me.raw.length),oe.push(me);continue}if(me=this.tokenizer.lheading(ee)){ee=ee.substring(me.raw.length),oe.push(me);continue}if(Q&&(me=this.tokenizer.paragraph(ee))){ee=ee.substring(me.raw.length),oe.push(me);continue}if(me=this.tokenizer.text(ee,oe)){ee=ee.substring(me.raw.length),me.type?oe.push(me):(Re=oe[oe.length-1],Re.raw+=`
|
|
|
`+me.raw,Re.text+=`
|
|
|
`+me.text);continue}if(ee){var Xe="Infinite loop on byte: "+ee.charCodeAt(0);if(this.options.silent){console.error(Xe);break}else throw new Error(Xe)}}return oe},_e.inline=function(ee){var oe,Q,me,Oe,V,Re,Xe=ee.length;for(oe=0;oe<Xe;oe++){Re=ee[oe];switch(Re.type){case"paragraph":case"text":case"heading":{Re.tokens=[],this.inlineTokens(Re.text,Re.tokens);break}case"table":{for(Re.tokens={header:[],cells:[]},Oe=Re.header.length,Q=0;Q<Oe;Q++)Re.tokens.header[Q]=[],this.inlineTokens(Re.header[Q],Re.tokens.header[Q]);for(Oe=Re.cells.length,Q=0;Q<Oe;Q++)for(V=Re.cells[Q],Re.tokens.cells[Q]=[],me=0;me<V.length;me++)Re.tokens.cells[Q][me]=[],this.inlineTokens(V[me],Re.tokens.cells[Q][me]);break}case"blockquote":{this.inline(Re.tokens);break}case"list":{for(Oe=Re.items.length,Q=0;Q<Oe;Q++)this.inline(Re.items[Q].tokens);break}}}return ee},_e.inlineTokens=function(ee,oe,Q,me,Oe){oe===void 0&&(oe=[]),Q===void 0&&(Q=!1),me===void 0&&(me=!1),Oe===void 0&&(Oe="");var V,Re=ee,Xe;if(this.tokens.links){var pe=Object.keys(this.tokens.links);if(pe.length>0)for(;(Xe=this.tokenizer.rules.inline.reflinkSearch.exec(Re))!=null;)pe.includes(Xe[0].slice(Xe[0].lastIndexOf("[")+1,-1))&&(Re=Re.slice(0,Xe.index)+"["+"a".repeat(Xe[0].length-2)+"]"+Re.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(Xe=this.tokenizer.rules.inline.blockSkip.exec(Re))!=null;)Re=Re.slice(0,Xe.index)+"["+"a".repeat(Xe[0].length-2)+"]"+Re.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;ee;){if(V=this.tokenizer.escape(ee)){ee=ee.substring(V.raw.length),oe.push(V);continue}if(V=this.tokenizer.tag(ee,Q,me)){ee=ee.substring(V.raw.length),Q=V.inLink,me=V.inRawBlock,oe.push(V);continue}if(V=this.tokenizer.link(ee)){ee=ee.substring(V.raw.length),V.type==="link"&&(V.tokens=this.inlineTokens(V.text,[],!0,me)),oe.push(V);continue}if(V=this.tokenizer.reflink(ee,this.tokens.links)){ee=ee.substring(V.raw.length),V.type==="link"&&(V.tokens=this.inlineTokens(V.text,[],!0,me)),oe.push(V);continue}if(V=this.tokenizer.strong(ee,Re,Oe)){ee=ee.substring(V.raw.length),V.tokens=this.inlineTokens(V.text,[],Q,me),oe.push(V);continue}if(V=this.tokenizer.em(ee,Re,Oe)){ee=ee.substring(V.raw.length),V.tokens=this.inlineTokens(V.text,[],Q,me),oe.push(V);continue}if(V=this.tokenizer.codespan(ee)){ee=ee.substring(V.raw.length),oe.push(V);continue}if(V=this.tokenizer.br(ee)){ee=ee.substring(V.raw.length),oe.push(V);continue}if(V=this.tokenizer.del(ee)){ee=ee.substring(V.raw.length),V.tokens=this.inlineTokens(V.text,[],Q,me),oe.push(V);continue}if(V=this.tokenizer.autolink(ee,ze)){ee=ee.substring(V.raw.length),oe.push(V);continue}if(!Q&&(V=this.tokenizer.url(ee,ze))){ee=ee.substring(V.raw.length),oe.push(V);continue}if(V=this.tokenizer.inlineText(ee,me,$e)){ee=ee.substring(V.raw.length),Oe=V.raw.slice(-1),oe.push(V);continue}if(ee){var ke="Infinite loop on byte: "+ee.charCodeAt(0);if(this.options.silent){console.error(ke);break}else throw new Error(ke)}}return oe},L(Ce,null,[{key:"rules",get:function(){return{block:ye,inline:Ge}}}]),Ce}(),Qe=E.defaults,fe=K.cleanUrl,ge=K.escape,xe=function(){function Ce(Ee){this.options=Ee||Qe}var _e=Ce.prototype;return _e.code=function(ee,oe,Q){var me=(oe||"").match(/\S*/)[0];if(this.options.highlight){var Oe=this.options.highlight(ee,me);Oe!=null&&Oe!==ee&&(Q=!0,ee=Oe)}return me?'<pre><code class="'+this.options.langPrefix+ge(me,!0)+'">'+(Q?ee:ge(ee,!0))+`</code></pre>
|
|
|
`:"<pre><code>"+(Q?ee:ge(ee,!0))+`</code></pre>
|
|
|
`},_e.blockquote=function(ee){return`<blockquote>
|
|
|
`+ee+`</blockquote>
|
|
|
`},_e.html=function(ee){return ee},_e.heading=function(ee,oe,Q,me){return this.options.headerIds?"<h"+oe+' id="'+this.options.headerPrefix+me.slug(Q)+'">'+ee+"</h"+oe+`>
|
|
|
`:"<h"+oe+">"+ee+"</h"+oe+`>
|
|
|
`},_e.hr=function(){return this.options.xhtml?`<hr/>
|
|
|
`:`<hr>
|
|
|
`},_e.list=function(ee,oe,Q){var me=oe?"ol":"ul",Oe=oe&&Q!==1?' start="'+Q+'"':"";return"<"+me+Oe+`>
|
|
|
`+ee+"</"+me+`>
|
|
|
`},_e.listitem=function(ee){return"<li>"+ee+`</li>
|
|
|
`},_e.checkbox=function(ee){return"<input "+(ee?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},_e.paragraph=function(ee){return"<p>"+ee+`</p>
|
|
|
`},_e.table=function(ee,oe){return oe&&(oe="<tbody>"+oe+"</tbody>"),`<table>
|
|
|
<thead>
|
|
|
`+ee+`</thead>
|
|
|
`+oe+`</table>
|
|
|
`},_e.tablerow=function(ee){return`<tr>
|
|
|
`+ee+`</tr>
|
|
|
`},_e.tablecell=function(ee,oe){var Q=oe.header?"th":"td",me=oe.align?"<"+Q+' align="'+oe.align+'">':"<"+Q+">";return me+ee+"</"+Q+`>
|
|
|
`},_e.strong=function(ee){return"<strong>"+ee+"</strong>"},_e.em=function(ee){return"<em>"+ee+"</em>"},_e.codespan=function(ee){return"<code>"+ee+"</code>"},_e.br=function(){return this.options.xhtml?"<br/>":"<br>"},_e.del=function(ee){return"<del>"+ee+"</del>"},_e.link=function(ee,oe,Q){if(ee=fe(this.options.sanitize,this.options.baseUrl,ee),ee===null)return Q;var me='<a href="'+ge(ee)+'"';return oe&&(me+=' title="'+oe+'"'),me+=">"+Q+"</a>",me},_e.image=function(ee,oe,Q){if(ee=fe(this.options.sanitize,this.options.baseUrl,ee),ee===null)return Q;var me='<img src="'+ee+'" alt="'+Q+'"';return oe&&(me+=' title="'+oe+'"'),me+=this.options.xhtml?"/>":">",me},_e.text=function(ee){return ee},Ce}(),we=function(){function Ce(){}var _e=Ce.prototype;return _e.strong=function(ee){return ee},_e.em=function(ee){return ee},_e.codespan=function(ee){return ee},_e.del=function(ee){return ee},_e.html=function(ee){return ee},_e.text=function(ee){return ee},_e.link=function(ee,oe,Q){return""+Q},_e.image=function(ee,oe,Q){return""+Q},_e.br=function(){return""},Ce}(),Te=function(){function Ce(){this.seen={}}var _e=Ce.prototype;return _e.slug=function(ee){var oe=ee.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(oe)){var Q=oe;do this.seen[Q]++,oe=Q+"-"+this.seen[Q];while(this.seen.hasOwnProperty(oe))}return this.seen[oe]=0,oe},Ce}(),re=E.defaults,ve=K.unescape,ae=function(){function Ce(Ee){this.options=Ee||re,this.options.renderer=this.options.renderer||new xe,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new we,this.slugger=new Te}Ce.parse=function(ee,oe){var Q=new Ce(oe);return Q.parse(ee)};var _e=Ce.prototype;return _e.parse=function(ee,oe){oe===void 0&&(oe=!0);var Q="",me,Oe,V,Re,Xe,pe,ke,Ve,ht,tt,at,ut,Ft,St,vt,Bt,Nt,dt,Ut=ee.length;for(me=0;me<Ut;me++){tt=ee[me];switch(tt.type){case"space":continue;case"hr":{Q+=this.renderer.hr();continue}case"heading":{Q+=this.renderer.heading(this.parseInline(tt.tokens),tt.depth,ve(this.parseInline(tt.tokens,this.textRenderer)),this.slugger);continue}case"code":{Q+=this.renderer.code(tt.text,tt.lang,tt.escaped);continue}case"table":{for(Ve="",ke="",Re=tt.header.length,Oe=0;Oe<Re;Oe++)ke+=this.renderer.tablecell(this.parseInline(tt.tokens.header[Oe]),{header:!0,align:tt.align[Oe]});for(Ve+=this.renderer.tablerow(ke),ht="",Re=tt.cells.length,Oe=0;Oe<Re;Oe++){for(pe=tt.tokens.cells[Oe],ke="",Xe=pe.length,V=0;V<Xe;V++)ke+=this.renderer.tablecell(this.parseInline(pe[V]),{header:!1,align:tt.align[V]});ht+=this.renderer.tablerow(ke)}Q+=this.renderer.table(Ve,ht);continue}case"blockquote":{ht=this.parse(tt.tokens),Q+=this.renderer.blockquote(ht);continue}case"list":{for(at=tt.ordered,ut=tt.start,Ft=tt.loose,Re=tt.items.length,ht="",Oe=0;Oe<Re;Oe++)vt=tt.items[Oe],Bt=vt.checked,Nt=vt.task,St="",vt.task&&(dt=this.renderer.checkbox(Bt),Ft?vt.tokens.length>0&&vt.tokens[0].type==="text"?(vt.tokens[0].text=dt+" "+vt.tokens[0].text,vt.tokens[0].tokens&&vt.tokens[0].tokens.length>0&&vt.tokens[0].tokens[0].type==="text"&&(vt.tokens[0].tokens[0].text=dt+" "+vt.tokens[0].tokens[0].text)):vt.tokens.unshift({type:"text",text:dt}):St+=dt),St+=this.parse(vt.tokens,Ft),ht+=this.renderer.listitem(St,Nt,Bt);Q+=this.renderer.list(ht,at,ut);continue}case"html":{Q+=this.renderer.html(tt.text);continue}case"paragraph":{Q+=this.renderer.paragraph(this.parseInline(tt.tokens));continue}case"text":{for(ht=tt.tokens?this.parseInline(tt.tokens):tt.text;me+1<Ut&&ee[me+1].type==="text";)tt=ee[++me],ht+=`
|
|
|
`+(tt.tokens?this.parseInline(tt.tokens):tt.text);Q+=oe?this.renderer.paragraph(ht):ht;continue}default:{var gt='Token with "'+tt.type+'" type was not found.';if(this.options.silent){console.error(gt);return}else throw new Error(gt)}}}return Q},_e.parseInline=function(ee,oe){oe=oe||this.renderer;var Q="",me,Oe,V=ee.length;for(me=0;me<V;me++){Oe=ee[me];switch(Oe.type){case"escape":{Q+=oe.text(Oe.text);break}case"html":{Q+=oe.html(Oe.text);break}case"link":{Q+=oe.link(Oe.href,Oe.title,this.parseInline(Oe.tokens,oe));break}case"image":{Q+=oe.image(Oe.href,Oe.title,Oe.text);break}case"strong":{Q+=oe.strong(this.parseInline(Oe.tokens,oe));break}case"em":{Q+=oe.em(this.parseInline(Oe.tokens,oe));break}case"codespan":{Q+=oe.codespan(Oe.text);break}case"br":{Q+=oe.br();break}case"del":{Q+=oe.del(this.parseInline(Oe.tokens,oe));break}case"text":{Q+=oe.text(Oe.text);break}default:{var Re='Token with "'+Oe.type+'" type was not found.';if(this.options.silent){console.error(Re);return}else throw new Error(Re)}}}return Q},Ce}(),Me=K.merge,Ye=K.checkSanitizeDeprecation,et=K.escape,je=E.getDefaults,ot=E.changeDefaults,ce=E.defaults;function Pe(Ce,_e,Ee){if(typeof Ce=="undefined"||Ce===null)throw new Error("marked(): input parameter is undefined or null");if(typeof Ce!="string")throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(Ce)+", string expected");if(typeof _e=="function"&&(Ee=_e,_e=null),_e=Me({},Pe.defaults,_e||{}),Ye(_e),Ee){var ee=_e.highlight,oe;try{oe=Je.lex(Ce,_e)}catch(V){return Ee(V)}var Q=function(Re){var Xe;if(!Re)try{Xe=ae.parse(oe,_e)}catch(pe){Re=pe}return _e.highlight=ee,Re?Ee(Re):Ee(null,Xe)};if(!ee||ee.length<3)return Q();if(delete _e.highlight,!oe.length)return Q();var me=0;Pe.walkTokens(oe,function(V){V.type==="code"&&(me++,setTimeout(function(){ee(V.text,V.lang,function(Re,Xe){if(Re)return Q(Re);Xe!=null&&Xe!==V.text&&(V.text=Xe,V.escaped=!0),me--,me===0&&Q()})},0))}),me===0&&Q();return}try{var Oe=Je.lex(Ce,_e);return _e.walkTokens&&Pe.walkTokens(Oe,_e.walkTokens),ae.parse(Oe,_e)}catch(V){if(V.message+=`
|
|
|
Please report this to https://github.com/markedjs/marked.`,_e.silent)return"<p>An error occurred:</p><pre>"+et(V.message+"",!0)+"</pre>";throw V}}Pe.options=Pe.setOptions=function(Ce){return Me(Pe.defaults,Ce),ot(Pe.defaults),Pe},Pe.getDefaults=je,Pe.defaults=ce,Pe.use=function(Ce){var _e=Me({},Ce);if(Ce.renderer&&function(){var ee=Pe.defaults.renderer||new xe,oe=function(Oe){var V=ee[Oe];ee[Oe]=function(){for(var Re=arguments.length,Xe=new Array(Re),pe=0;pe<Re;pe++)Xe[pe]=arguments[pe];var ke=Ce.renderer[Oe].apply(ee,Xe);return ke===!1&&(ke=V.apply(ee,Xe)),ke}};for(var Q in Ce.renderer)oe(Q);_e.renderer=ee}(),Ce.tokenizer&&function(){var ee=Pe.defaults.tokenizer||new Ne,oe=function(Oe){var V=ee[Oe];ee[Oe]=function(){for(var Re=arguments.length,Xe=new Array(Re),pe=0;pe<Re;pe++)Xe[pe]=arguments[pe];var ke=Ce.tokenizer[Oe].apply(ee,Xe);return ke===!1&&(ke=V.apply(ee,Xe)),ke}};for(var Q in Ce.tokenizer)oe(Q);_e.tokenizer=ee}(),Ce.walkTokens){var Ee=Pe.defaults.walkTokens;_e.walkTokens=function(ee){Ce.walkTokens(ee),Ee&&Ee(ee)}}Pe.setOptions(_e)},Pe.walkTokens=function(Ce,_e){for(var Ee=M(Ce),ee;!(ee=Ee()).done;){var oe=ee.value;_e(oe);switch(oe.type){case"table":{for(var Q=M(oe.tokens.header),me;!(me=Q()).done;){var Oe=me.value;Pe.walkTokens(Oe,_e)}for(var V=M(oe.tokens.cells),Re;!(Re=V()).done;)for(var Xe=Re.value,pe=M(Xe),ke;!(ke=pe()).done;){var Ve=ke.value;Pe.walkTokens(Ve,_e)}break}case"list":{Pe.walkTokens(oe.items,_e);break}default:oe.tokens&&Pe.walkTokens(oe.tokens,_e)}}},Pe.Parser=ae,Pe.parser=ae.parse,Pe.Renderer=xe,Pe.TextRenderer=we,Pe.Lexer=Je,Pe.lexer=Je.lex,Pe.Tokenizer=Ne,Pe.Slugger=Te,Pe.parse=Pe;var Fe=Pe;return Fe})},ELLl:function(it,ne,q){(function(G){G(q("VrN/"))})(function(G){var L={pairs:`()[]{}''""`,closeBefore:`)]}'":;>`,triples:"",explode:"[]{}"},I=G.Pos;G.defineOption("autoCloseBrackets",!1,function(t,r,s){s&&s!=G.Init&&(t.removeKeyMap(M),t.state.closeBrackets=null),r&&(p(R(r,"pairs")),t.state.closeBrackets=r,t.addKeyMap(M))});function R(t,r){return r=="pairs"&&typeof t=="string"?t:typeof t=="object"&&t[r]!=null?t[r]:L[r]}var M={Backspace:i,Enter:c};function p(t){for(var r=0;r<t.length;r++){var s=t.charAt(r),u="'"+s+"'";M[u]||(M[u]=E(s))}}p(L.pairs+"`");function E(t){return function(r){return h(r,t)}}function b(t){var r=t.state.closeBrackets;if(!r||r.override)return r;var s=t.getModeAt(t.getCursor());return s.closeBrackets||r}function i(t){var r=b(t);if(!r||t.getOption("disableInput"))return G.Pass;for(var s=R(r,"pairs"),u=t.listSelections(),d=0;d<u.length;d++){if(!u[d].empty())return G.Pass;var f=n(t,u[d].head);if(!f||s.indexOf(f)%2!=0)return G.Pass}for(var d=u.length-1;d>=0;d--){var v=u[d].head;t.replaceRange("",I(v.line,v.ch-1),I(v.line,v.ch+1),"+delete")}}function c(t){var r=b(t),s=r&&R(r,"explode");if(!s||t.getOption("disableInput"))return G.Pass;for(var u=t.listSelections(),d=0;d<u.length;d++){if(!u[d].empty())return G.Pass;var f=n(t,u[d].head);if(!f||s.indexOf(f)%2!=0)return G.Pass}t.operation(function(){var v=t.lineSeparator()||`
|
|
|
`;t.replaceSelection(v+v,null),t.execCommand("goCharLeft"),u=t.listSelections();for(var m=0;m<u.length;m++){var S=u[m].head.line;t.indentLine(S,null,!0),t.indentLine(S+1,null,!0)}})}function o(t){var r=G.cmpPos(t.anchor,t.head)>0;return{anchor:new I(t.anchor.line,t.anchor.ch+(r?-1:1)),head:new I(t.head.line,t.head.ch+(r?1:-1))}}function h(t,r){var s=b(t);if(!s||t.getOption("disableInput"))return G.Pass;var u=R(s,"pairs"),d=u.indexOf(r);if(d==-1)return G.Pass;for(var f=R(s,"closeBefore"),v=R(s,"triples"),m=u.charAt(d+1)==r,S=t.listSelections(),C=d%2==0,_,y=0;y<S.length;y++){var T=S[y],O=T.head,g,F=t.getRange(O,I(O.line,O.ch+1));if(C&&!T.empty())g="surround";else if((m||!C)&&F==r)m&&a(t,O)?g="both":v.indexOf(r)>=0&&t.getRange(O,I(O.line,O.ch+3))==r+r+r?g="skipThree":g="skip";else if(m&&O.ch>1&&v.indexOf(r)>=0&&t.getRange(I(O.line,O.ch-2),O)==r+r){if(O.ch>2&&/\bstring/.test(t.getTokenTypeAt(I(O.line,O.ch-2))))return G.Pass;g="addFour"}else if(m){var P=O.ch==0?" ":t.getRange(I(O.line,O.ch-1),O);if(!G.isWordChar(F)&&P!=r&&!G.isWordChar(P))g="both";else return G.Pass}else if(C&&(F.length===0||/\s/.test(F)||f.indexOf(F)>-1))g="both";else return G.Pass;if(!_)_=g;else if(_!=g)return G.Pass}var N=d%2?u.charAt(d-1):r,X=d%2?r:u.charAt(d+1);t.operation(function(){if(_=="skip")t.execCommand("goCharRight");else if(_=="skipThree")for(var j=0;j<3;j++)t.execCommand("goCharRight");else if(_=="surround"){for(var A=t.getSelections(),j=0;j<A.length;j++)A[j]=N+A[j]+X;t.replaceSelections(A,"around"),A=t.listSelections().slice();for(var j=0;j<A.length;j++)A[j]=o(A[j]);t.setSelections(A)}else _=="both"?(t.replaceSelection(N+X,null),t.triggerElectric(N+X),t.execCommand("goCharLeft")):_=="addFour"&&(t.replaceSelection(N+N+N+N,"before"),t.execCommand("goCharRight"))})}function n(t,r){var s=t.getRange(I(r.line,r.ch-1),I(r.line,r.ch+1));return s.length==2?s:null}function a(t,r){var s=t.getTokenAt(I(r.line,r.ch+1));return/\bstring/.test(s.type)&&s.start==r.ch&&(r.ch==0||!/\bstring/.test(t.getTokenTypeAt(r)))}})},FWmy:function(it,ne,q){"use strict";q.d(ne,"a",function(){return G});function G(L,I){if(!L)throw new Error(I?`Assertion failed (${I})`:"Assertion Failed")}},Fv0C:function(it,ne,q){"use strict";function G(a){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?G=function(r){return typeof r}:G=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},G(a)}Object.defineProperty(ne,"__esModule",{value:!0}),ne.default=void 0;var L=i(q("Lo0S")),I=q("vewr"),R=i(q("8CQX")),M=E(q("mHUz")),p=i(q("GdRQ"));function E(a){return a&&a.__esModule?a:{default:a}}function b(){if(typeof WeakMap!="function")return null;var a=new WeakMap;return b=function(){return a},a}function i(a){if(a&&a.__esModule)return a;if(a===null||G(a)!=="object"&&typeof a!="function")return{default:a};var t=b();if(t&&t.has(a))return t.get(a);var r={},s=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in a)if(Object.prototype.hasOwnProperty.call(a,u)){var d=s?Object.getOwnPropertyDescriptor(a,u):null;d&&(d.get||d.set)?Object.defineProperty(r,u,d):r[u]=a[u]}return r.default=a,t&&t.set(a,r),r}function c(a,t){if(!(a instanceof t))throw new TypeError("Cannot call a class as a function")}function o(a,t){for(var r=0;r<t.length;r++){var s=t[r];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(a,s.key,s)}}function h(a,t,r){return t&&o(a.prototype,t),r&&o(a,r),a}var n=function(){function a(t){c(this,a),this._target=t||null,this._keyDownList={},this._pendingKey=null,this._altGrArmed=!1,this._eventHandlers={keyup:this._handleKeyUp.bind(this),keydown:this._handleKeyDown.bind(this),keypress:this._handleKeyPress.bind(this),blur:this._allKeysUp.bind(this),checkalt:this._checkAlt.bind(this)},this.onkeyevent=function(){}}return h(a,[{key:"_sendKeyEvent",value:function(r,s,u){if(u)this._keyDownList[s]=r;else{if(!(s in this._keyDownList))return;delete this._keyDownList[s]}L.Debug("onkeyevent "+(u?"down":"up")+", keysym: "+r,", code: "+s),this.onkeyevent(r,s,u)}},{key:"_getKeyCode",value:function(r){var s=R.getKeycode(r);if(s!=="Unidentified")return s;if(r.keyCode&&r.type!=="keypress"&&r.keyCode!==229)return"Platform"+r.keyCode;if(r.keyIdentifier){if(r.keyIdentifier.substr(0,2)!=="U+")return r.keyIdentifier;var u=parseInt(r.keyIdentifier.substr(2),16),d=String.fromCharCode(u).toUpperCase();return"Platform"+d.charCodeAt()}return"Unidentified"}},{key:"_handleKeyDown",value:function(r){var s=this._getKeyCode(r),u=R.getKeysym(r);if(this._altGrArmed&&(this._altGrArmed=!1,clearTimeout(this._altGrTimeout),s==="AltRight"&&r.timeStamp-this._altGrCtrlTime<50?u=M.default.XK_ISO_Level3_Shift:this._sendKeyEvent(M.default.XK_Control_L,"ControlLeft",!0)),s==="Unidentified"){u&&(this._sendKeyEvent(u,s,!0),this._sendKeyEvent(u,s,!1)),(0,I.stopEvent)(r);return}if(p.isMac()||p.isIOS())switch(u){case M.default.XK_Super_L:u=M.default.XK_Alt_L;break;case M.default.XK_Super_R:u=M.default.XK_Super_L;break;case M.default.XK_Alt_L:u=M.default.XK_Mode_switch;break;case M.default.XK_Alt_R:u=M.default.XK_ISO_Level3_Shift;break}if(s in this._keyDownList&&(u=this._keyDownList[s]),(p.isMac()||p.isIOS())&&s==="CapsLock"){this._sendKeyEvent(M.default.XK_Caps_Lock,"CapsLock",!0),this._sendKeyEvent(M.default.XK_Caps_Lock,"CapsLock",!1),(0,I.stopEvent)(r);return}if(!u&&(!r.key||p.isIE()||p.isEdge())){this._pendingKey=s,setTimeout(this._handleKeyPressTimeout.bind(this),10,r);return}if(this._pendingKey=null,(0,I.stopEvent)(r),s==="ControlLeft"&&p.isWindows()&&!("ControlLeft"in this._keyDownList)){this._altGrArmed=!0,this._altGrTimeout=setTimeout(this._handleAltGrTimeout.bind(this),100),this._altGrCtrlTime=r.timeStamp;return}this._sendKeyEvent(u,s,!0)}},{key:"_handleKeyPress",value:function(r){if((0,I.stopEvent)(r),this._pendingKey===null)return;var s=this._getKeyCode(r),u=R.getKeysym(r);if(s!=="Unidentified"&&s!=this._pendingKey)return;if(s=this._pendingKey,this._pendingKey=null,!u){L.Info("keypress with no keysym:",r);return}this._sendKeyEvent(u,s,!0)}},{key:"_handleKeyPressTimeout",value:function(r){if(this._pendingKey===null)return;var s,u=this._pendingKey;if(this._pendingKey=null,r.keyCode>=48&&r.keyCode<=57)s=r.keyCode;else if(r.keyCode>=65&&r.keyCode<=90){var d=String.fromCharCode(r.keyCode);r.shiftKey?d=d.toUpperCase():d=d.toLowerCase(),s=d.charCodeAt()}else s=0;this._sendKeyEvent(s,u,!0)}},{key:"_handleKeyUp",value:function(r){(0,I.stopEvent)(r);var s=this._getKeyCode(r);if(this._altGrArmed&&(this._altGrArmed=!1,clearTimeout(this._altGrTimeout),this._sendKeyEvent(M.default.XK_Control_L,"ControlLeft",!0)),(p.isMac()||p.isIOS())&&s==="CapsLock"){this._sendKeyEvent(M.default.XK_Caps_Lock,"CapsLock",!0),this._sendKeyEvent(M.default.XK_Caps_Lock,"CapsLock",!1);return}this._sendKeyEvent(this._keyDownList[s],s,!1),p.isWindows()&&(s==="ShiftLeft"||s==="ShiftRight")&&("ShiftRight"in this._keyDownList&&this._sendKeyEvent(this._keyDownList.ShiftRight,"ShiftRight",!1),"ShiftLeft"in this._keyDownList&&this._sendKeyEvent(this._keyDownList.ShiftLeft,"ShiftLeft",!1))}},{key:"_handleAltGrTimeout",value:function(){this._altGrArmed=!1,clearTimeout(this._altGrTimeout),this._sendKeyEvent(M.default.XK_Control_L,"ControlLeft",!0)}},{key:"_allKeysUp",value:function(){L.Debug(">> Keyboard.allKeysUp");for(var r in this._keyDownList)this._sendKeyEvent(this._keyDownList[r],r,!1);L.Debug("<< Keyboard.allKeysUp")}},{key:"_checkAlt",value:function(r){if(r.skipCheckAlt)return;if(r.altKey)return;var s=this._target,u=this._keyDownList;["AltLeft","AltRight"].forEach(function(d){if(!(d in u))return;var f=new KeyboardEvent("keyup",{key:u[d],code:d});f.skipCheckAlt=!0,s.dispatchEvent(f)})}},{key:"grab",value:function(){if(this._target.addEventListener("keydown",this._eventHandlers.keydown),this._target.addEventListener("keyup",this._eventHandlers.keyup),this._target.addEventListener("keypress",this._eventHandlers.keypress),window.addEventListener("blur",this._eventHandlers.blur),p.isWindows()&&p.isFirefox()){var r=this._eventHandlers.checkalt;["mousedown","mouseup","mousemove","wheel","touchstart","touchend","touchmove","keydown","keyup"].forEach(function(s){return document.addEventListener(s,r,{capture:!0,passive:!0})})}}},{key:"ungrab",value:function(){if(p.isWindows()&&p.isFirefox()){var r=this._eventHandlers.checkalt;["mousedown","mouseup","mousemove","wheel","touchstart","touchend","touchmove","keydown","keyup"].forEach(function(s){return document.removeEventListener(s,r)})}this._target.removeEventListener("keydown",this._eventHandlers.keydown),this._target.removeEventListener("keyup",this._eventHandlers.keyup),this._target.removeEventListener("keypress",this._eventHandlers.keypress),window.removeEventListener("blur",this._eventHandlers.blur),this._allKeysUp()}}]),a}();ne.default=n},GQ8N:function(it,ne,q){"use strict";Object.defineProperty(ne,"__esModule",{value:!0}),ne.toUnsigned32bit=G,ne.toSigned32bit=L;function G(I){return I>>>0}function L(I){return I|0}},GdRQ:function(it,ne,q){"use strict";function G(C){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?G=function(y){return typeof y}:G=function(y){return y&&typeof Symbol=="function"&&y.constructor===Symbol&&y!==Symbol.prototype?"symbol":typeof y},G(C)}Object.defineProperty(ne,"__esModule",{value:!0}),ne.isMac=s,ne.isWindows=u,ne.isIOS=d,ne.isSafari=f,ne.isIE=v,ne.isEdge=m,ne.isFirefox=S,ne.hasScrollbarGutter=ne.supportsImageMetadata=ne.supportsCursorURIs=ne.dragThreshold=ne.isTouchDevice=void 0;var L=R(q("Lo0S"));function I(){if(typeof WeakMap!="function")return null;var C=new WeakMap;return I=function(){return C},C}function R(C){if(C&&C.__esModule)return C;if(C===null||G(C)!=="object"&&typeof C!="function")return{default:C};var _=I();if(_&&_.has(C))return _.get(C);var y={},T=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var O in C)if(Object.prototype.hasOwnProperty.call(C,O)){var g=T?Object.getOwnPropertyDescriptor(C,O):null;g&&(g.get||g.set)?Object.defineProperty(y,O,g):y[O]=C[O]}return y.default=C,_&&_.set(C,y),y}var M="ontouchstart"in document.documentElement||document.ontouchstart!==void 0||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0;ne.isTouchDevice=M,window.addEventListener("touchstart",function C(){ne.isTouchDevice=M=!0,window.removeEventListener("touchstart",C,!1)},!1);var p=10*(window.devicePixelRatio||1);ne.dragThreshold=p;var E=!1;try{var b=document.createElement("canvas");b.style.cursor='url("data:image/x-icon;base64,AAACAAEACAgAAAIAAgA4AQAAFgAAACgAAAAIAAAAEAAAAAEAIAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAD/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////AAAAAAAAAAAAAAAAAAAAAA==") 2 2, default',b.style.cursor.indexOf("url")===0?(L.Info("Data URI scheme cursor supported"),E=!0):L.Warn("Data URI scheme cursor not supported")}catch(C){L.Error("Data URI scheme cursor test exception: "+C)}var i=E;ne.supportsCursorURIs=i;var c=!1;try{new ImageData(new Uint8ClampedArray(4),1,1),c=!0}catch(C){}var o=c;ne.supportsImageMetadata=o;var h=!0;try{var n=document.createElement("div");n.style.visibility="hidden",n.style.overflow="scroll",document.body.appendChild(n);var a=document.createElement("div");n.appendChild(a);var t=n.offsetWidth-a.offsetWidth;n.parentNode.removeChild(n),h=t!=0}catch(C){L.Error("Scrollbar test exception: "+C)}var r=h;ne.hasScrollbarGutter=r;function s(){return navigator&&!!/mac/i.exec(navigator.platform)}function u(){return navigator&&!!/win/i.exec(navigator.platform)}function d(){return navigator&&(!!/ipad/i.exec(navigator.platform)||!!/iphone/i.exec(navigator.platform)||!!/ipod/i.exec(navigator.platform))}function f(){return navigator&&navigator.userAgent.indexOf("Safari")!==-1&&navigator.userAgent.indexOf("Chrome")===-1}function v(){return navigator&&!!/trident/i.exec(navigator.userAgent)}function m(){return navigator&&!!/edge/i.exec(navigator.userAgent)}function S(){return navigator&&!!/firefox/i.exec(navigator.userAgent)}},Gytx:function(it,ne){it.exports=function(G,L,I,R){var M=I?I.call(R,G,L):void 0;if(M!==void 0)return!!M;if(G===L)return!0;if(typeof G!="object"||!G||typeof L!="object"||!L)return!1;var p=Object.keys(G),E=Object.keys(L);if(p.length!==E.length)return!1;for(var b=Object.prototype.hasOwnProperty.bind(L),i=0;i<p.length;i++){var c=p[i];if(!b(c))return!1;var o=G[c],h=L[c];if(M=I?I.call(R,o,h,c):void 0,M===!1||M===void 0&&o!==h)return!1}return!0}},HmJG:function(it,ne,q){},ItS6:function(it,ne,q){"use strict";Object.defineProperty(ne,"__esModule",{value:!0}),ne.default=void 0;var G=q("eP3c"),L=I(q("1q3G"));function I(b){return b&&b.__esModule?b:{default:b}}function R(b,i){if(!(b instanceof i))throw new TypeError("Cannot call a class as a function")}function M(b,i){for(var c=0;c<i.length;c++){var o=i[c];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(b,o.key,o)}}function p(b,i,c){return i&&M(b.prototype,i),c&&M(b,c),b}var E=function(){function b(){R(this,b),this.strm=new L.default,this.chunkSize=1024*10*10,this.strm.output=new Uint8Array(this.chunkSize),this.windowBits=5,(0,G.inflateInit)(this.strm,this.windowBits)}return p(b,[{key:"setInput",value:function(c){c?(this.strm.input=c,this.strm.avail_in=this.strm.input.length,this.strm.next_in=0):(this.strm.input=null,this.strm.avail_in=0,this.strm.next_in=0)}},{key:"inflate",value:function(c){c>this.chunkSize&&(this.chunkSize=c,this.strm.output=new Uint8Array(this.chunkSize)),this.strm.next_out=0,this.strm.avail_out=c;var o=(0,G.inflate)(this.strm,0);if(o<0)throw new Error("zlib inflate failed");if(this.strm.next_out!=c)throw new Error("Incomplete zlib block");return new Uint8Array(this.strm.output.buffer,0,this.strm.next_out)}},{key:"reset",value:function(){(0,G.inflateReset)(this.strm)}}]),b}();ne.default=E},IxHN:function(it,ne,q){"use strict";var G=q("q1tI"),L=q.n(G),I=q("07cG"),R=q.n(I);ne.a=function(M){var p=M.message,E=M.className,b=M.children,i=M.style,c=i===void 0?{}:i;return L.a.createElement("div",{className:"".concat(R.a.idsRingWrapper," ").concat(E)},L.a.createElement("div",{className:R.a.ldsRing},L.a.createElement("div",null),L.a.createElement("div",null),L.a.createElement("div",null),L.a.createElement("div",null)),p?L.a.createElement("p",{style:c},p):null,b)}},J66h:function(it,ne,q){(function(G){var L,I;(function(R,M){it.exports=M(R)})(typeof self!="undefined"?self:typeof window!="undefined"?window:typeof G!="undefined"?G:this,function(R){"use strict";R=R||{};var M=R.Base64,p="2.6.4",E="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",b=function(N){for(var X={},j=0,A=N.length;j<A;j++)X[N.charAt(j)]=j;return X}(E),i=String.fromCharCode,c=function(N){if(N.length<2){var X=N.charCodeAt(0);return X<128?N:X<2048?i(192|X>>>6)+i(128|X&63):i(224|X>>>12&15)+i(128|X>>>6&63)+i(128|X&63)}else{var X=65536+(N.charCodeAt(0)-55296)*1024+(N.charCodeAt(1)-56320);return i(240|X>>>18&7)+i(128|X>>>12&63)+i(128|X>>>6&63)+i(128|X&63)}},o=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,h=function(N){return N.replace(o,c)},n=function(N){var X=[0,2,1][N.length%3],j=N.charCodeAt(0)<<16|(N.length>1?N.charCodeAt(1):0)<<8|(N.length>2?N.charCodeAt(2):0),A=[E.charAt(j>>>18),E.charAt(j>>>12&63),X>=2?"=":E.charAt(j>>>6&63),X>=1?"=":E.charAt(j&63)];return A.join("")},a=R.btoa&&typeof R.btoa=="function"?function(N){return R.btoa(N)}:function(N){if(N.match(/[^\x00-\xFF]/))throw new RangeError("The string contains invalid characters.");return N.replace(/[\s\S]{1,3}/g,n)},t=function(N){return a(h(String(N)))},r=function(N){return N.replace(/[+\/]/g,function(X){return X=="+"?"-":"_"}).replace(/=/g,"")},s=function(N,X){return X?r(t(N)):t(N)},u=function(N){return s(N,!0)},d;R.Uint8Array&&(d=function(N,X){for(var j="",A=0,K=N.length;A<K;A+=3){var U=N[A],k=N[A+1],z=N[A+2],te=U<<16|k<<8|z;j+=E.charAt(te>>>18)+E.charAt(te>>>12&63)+(typeof k!="undefined"?E.charAt(te>>>6&63):"=")+(typeof z!="undefined"?E.charAt(te&63):"=")}return X?r(j):j});var f=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,v=function(N){switch(N.length){case 4:var X=(7&N.charCodeAt(0))<<18|(63&N.charCodeAt(1))<<12|(63&N.charCodeAt(2))<<6|63&N.charCodeAt(3),j=X-65536;return i((j>>>10)+55296)+i((j&1023)+56320);case 3:return i((15&N.charCodeAt(0))<<12|(63&N.charCodeAt(1))<<6|63&N.charCodeAt(2));default:return i((31&N.charCodeAt(0))<<6|63&N.charCodeAt(1))}},m=function(N){return N.replace(f,v)},S=function(N){var X=N.length,j=X%4,A=(X>0?b[N.charAt(0)]<<18:0)|(X>1?b[N.charAt(1)]<<12:0)|(X>2?b[N.charAt(2)]<<6:0)|(X>3?b[N.charAt(3)]:0),K=[i(A>>>16),i(A>>>8&255),i(A&255)];return K.length-=[0,0,2,1][j],K.join("")},C=R.atob&&typeof R.atob=="function"?function(N){return R.atob(N)}:function(N){return N.replace(/\S{1,4}/g,S)},_=function(N){return C(String(N).replace(/[^A-Za-z0-9\+\/]/g,""))},y=function(N){return m(C(N))},T=function(N){return String(N).replace(/[-_]/g,function(X){return X=="-"?"+":"/"}).replace(/[^A-Za-z0-9\+\/]/g,"")},O=function(N){return y(T(N))},g;R.Uint8Array&&(g=function(N){return Uint8Array.from(_(T(N)),function(X){return X.charCodeAt(0)})});var F=function(){var N=R.Base64;return R.Base64=M,N};if(R.Base64={VERSION:p,atob:_,btoa:a,fromBase64:O,toBase64:s,utob:h,encode:s,encodeURI:u,btou:m,decode:O,noConflict:F,fromUint8Array:d,toUint8Array:g},typeof Object.defineProperty=="function"){var P=function(N){return{value:N,enumerable:!1,writable:!0,configurable:!0}};R.Base64.extendString=function(){Object.defineProperty(String.prototype,"fromBase64",P(function(){return O(this)})),Object.defineProperty(String.prototype,"toBase64",P(function(N){return s(this,N)})),Object.defineProperty(String.prototype,"toBase64URI",P(function(){return s(this,!0)}))}}return R.Meteor&&(Base64=R.Base64),it.exports?it.exports.Base64=R.Base64:!(L=[],I=function(){return R.Base64}.apply(ne,L),I!==void 0&&(it.exports=I)),{Base64:R.Base64}})}).call(this,q("IyRk"))},JSwD:function(it,ne,q){"use strict";function G(r){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?G=function(u){return typeof u}:G=function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},G(r)}Object.defineProperty(ne,"__esModule",{value:!0}),ne.default=t;var L=R(q("6BzB"));function I(){if(typeof WeakMap!="function")return null;var r=new WeakMap;return I=function(){return r},r}function R(r){if(r&&r.__esModule)return r;if(r===null||G(r)!=="object"&&typeof r!="function")return{default:r};var s=I();if(s&&s.has(r))return s.get(r);var u={},d=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var f in r)if(Object.prototype.hasOwnProperty.call(r,f)){var v=d?Object.getOwnPropertyDescriptor(r,f):null;v&&(v.get||v.set)?Object.defineProperty(u,f,v):u[f]=r[f]}return u.default=r,s&&s.set(r,u),u}var M=15,p=852,E=592,b=0,i=1,c=2,o=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],h=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],n=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],a=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];function t(r,s,u,d,f,v,m,S){var C=S.bits,_=0,y=0,T=0,O=0,g=0,F=0,P=0,N=0,X=0,j=0,A,K,U,k,z,te=null,de=0,be,We=new L.Buf16(M+1),Ne=new L.Buf16(M+1),Le=null,Ke=0,He,Ae,Se;for(_=0;_<=M;_++)We[_]=0;for(y=0;y<d;y++)We[s[u+y]]++;for(g=C,O=M;O>=1&&!(We[O]!==0);O--);if(g>O&&(g=O),O===0)return f[v++]=1<<24|64<<16|0,f[v++]=1<<24|64<<16|0,S.bits=1,0;for(T=1;T<O&&!(We[T]!==0);T++);for(g<T&&(g=T),N=1,_=1;_<=M;_++)if(N<<=1,N-=We[_],N<0)return-1;if(N>0&&(r===b||O!==1))return-1;for(Ne[1]=0,_=1;_<M;_++)Ne[_+1]=Ne[_]+We[_];for(y=0;y<d;y++)s[u+y]!==0&&(m[Ne[s[u+y]]++]=y);if(r===b?(te=Le=m,be=19):r===i?(te=o,de-=257,Le=h,Ke-=257,be=256):(te=n,Le=a,be=-1),j=0,y=0,_=T,z=v,F=g,P=0,U=-1,X=1<<g,k=X-1,r===i&&X>p||r===c&&X>E)return 1;for(;;){He=_-P,m[y]<be?(Ae=0,Se=m[y]):m[y]>be?(Ae=Le[Ke+m[y]],Se=te[de+m[y]]):(Ae=32+64,Se=0),A=1<<_-P,K=1<<F,T=K;do K-=A,f[z+(j>>P)+K]=He<<24|Ae<<16|Se|0;while(K!==0);for(A=1<<_-1;j&A;)A>>=1;if(A!==0?(j&=A-1,j+=A):j=0,y++,--We[_]===0){if(_===O)break;_=s[u+m[y]]}if(_>g&&(j&k)!==U){for(P===0&&(P=g),z+=T,F=_-P,N=1<<F;F+P<O&&!(N-=We[F+P],N<=0);)F++,N<<=1;if(X+=1<<F,r===i&&X>p||r===c&&X>E)return 1;U=j&k,f[U]=g<<24|F<<16|z-v|0}}return j!==0&&(f[z+j]=_-P<<24|64<<16|0),S.bits=g,0}},JYp7:function(it,ne,q){"use strict";q.d(ne,"a",function(){return G});var G;(function(L){function I(f){return f&&typeof f=="object"&&typeof f[Symbol.iterator]=="function"}L.is=I;const R=Object.freeze([]);function M(){return R}L.empty=M;function*p(f){yield f}L.single=p;function E(f){return f||R}L.from=E;function b(f){return!f||f[Symbol.iterator]().next().done===!0}L.isEmpty=b;function i(f){return f[Symbol.iterator]().next().value}L.first=i;function c(f,v){for(const m of f)if(v(m))return!0;return!1}L.some=c;function o(f,v){for(const m of f)if(v(m))return m;return}L.find=o;function*h(f,v){for(const m of f)v(m)&&(yield m)}L.filter=h;function*n(f,v){let m=0;for(const S of f)yield v(S,m++)}L.map=n;function*a(...f){for(const v of f)for(const m of v)yield m}L.concat=a;function*t(f){for(const v of f)for(const m of v)yield m}L.concatNested=t;function r(f,v,m){let S=m;for(const C of f)S=v(S,C);return S}L.reduce=r;function*s(f,v,m=f.length){for(v<0&&(v+=f.length),m<0?m+=f.length:m>f.length&&(m=f.length);v<m;v++)yield f[v]}L.slice=s;function u(f,v=Number.POSITIVE_INFINITY){const m=[];if(v===0)return[m,f];const S=f[Symbol.iterator]();for(let C=0;C<v;C++){const _=S.next();if(_.done)return[m,L.empty()];m.push(_.value)}return[m,{[Symbol.iterator](){return S}}]}L.consume=u;function d(f,v,m=(S,C)=>S===C){const S=f[Symbol.iterator](),C=v[Symbol.iterator]();for(;;){const _=S.next(),y=C.next();if(_.done!==y.done)return!1;if(_.done)return!0;if(!m(_.value,y.value))return!1}}L.equals=d})(G||(G={}))},LCi9:function(it,ne,q){"use strict";Object.defineProperty(ne,"__esModule",{value:!0}),ne.default=void 0;function G(f,v){if(!(f instanceof v))throw new TypeError("Cannot call a class as a function")}function L(f,v){for(var m=0;m<v.length;m++){var S=v[m];S.enumerable=S.enumerable||!1,S.configurable=!0,"value"in S&&(S.writable=!0),Object.defineProperty(f,S.key,S)}}function I(f,v,m){return v&&L(f.prototype,v),m&&L(f,m),f}var R=0,M=1,p=2,E=4,b=8,i=16,c=32,o=64,h=127,n=50,a=90,t=250,r=1e3,s=1e3,u=50,d=function(){function f(){G(this,f),this._target=null,this._state=h,this._tracked=[],this._ignored=[],this._waitingRelease=!1,this._releaseStart=0,this._longpressTimeoutId=null,this._twoTouchTimeoutId=null,this._boundEventHandler=this._eventHandler.bind(this)}return I(f,[{key:"attach",value:function(m){this.detach(),this._target=m,this._target.addEventListener("touchstart",this._boundEventHandler),this._target.addEventListener("touchmove",this._boundEventHandler),this._target.addEventListener("touchend",this._boundEventHandler),this._target.addEventListener("touchcancel",this._boundEventHandler)}},{key:"detach",value:function(){if(!this._target)return;this._stopLongpressTimeout(),this._stopTwoTouchTimeout(),this._target.removeEventListener("touchstart",this._boundEventHandler),this._target.removeEventListener("touchmove",this._boundEventHandler),this._target.removeEventListener("touchend",this._boundEventHandler),this._target.removeEventListener("touchcancel",this._boundEventHandler),this._target=null}},{key:"_eventHandler",value:function(m){var S;m.stopPropagation(),m.preventDefault();switch(m.type){case"touchstart":S=this._touchStart;break;case"touchmove":S=this._touchMove;break;case"touchend":case"touchcancel":S=this._touchEnd;break}for(var C=0;C<m.changedTouches.length;C++){var _=m.changedTouches[C];S.call(this,_.identifier,_.clientX,_.clientY)}}},{key:"_touchStart",value:function(m,S,C){if(this._hasDetectedGesture()||this._state===R){this._ignored.push(m);return}if(this._tracked.length>0&&Date.now()-this._tracked[0].started>t){this._state=R,this._ignored.push(m);return}if(this._waitingRelease){this._state=R,this._ignored.push(m);return}this._tracked.push({id:m,started:Date.now(),active:!0,firstX:S,firstY:C,lastX:S,lastY:C,angle:0});switch(this._tracked.length){case 1:this._startLongpressTimeout();break;case 2:this._state&=~(M|b|i),this._stopLongpressTimeout();break;case 3:this._state&=~(p|c|o);break;default:this._state=R}}},{key:"_touchMove",value:function(m,S,C){var _=this._tracked.find(function(P){return P.id===m});if(_===void 0)return;_.lastX=S,_.lastY=C;var y=S-_.firstX,T=C-_.firstY;if((_.firstX!==_.lastX||_.firstY!==_.lastY)&&(_.angle=Math.atan2(T,y)*180/Math.PI),!this._hasDetectedGesture()){if(Math.hypot(y,T)<n)return;if(this._state&=~(M|p|E|i),this._stopLongpressTimeout(),this._tracked.length!==1&&(this._state&=~b),this._tracked.length!==2&&(this._state&=~(c|o)),this._tracked.length===2){var O=this._tracked.find(function(P){return P.id!==m}),g=Math.hypot(O.firstX-O.lastX,O.firstY-O.lastY);if(g>n){var F=Math.abs(_.angle-O.angle);F=Math.abs((F+180)%360-180),F>a?this._state&=~c:this._state&=~o,this._isTwoTouchTimeoutRunning()&&this._stopTwoTouchTimeout()}else this._isTwoTouchTimeoutRunning()||this._startTwoTouchTimeout()}if(!this._hasDetectedGesture())return;this._pushEvent("gesturestart")}this._pushEvent("gesturemove")}},{key:"_touchEnd",value:function(m,S,C){if(this._ignored.indexOf(m)!==-1){this._ignored.splice(this._ignored.indexOf(m),1),this._ignored.length===0&&this._tracked.length===0&&(this._state=h,this._waitingRelease=!1);return}if(!this._hasDetectedGesture()&&this._isTwoTouchTimeoutRunning()&&(this._stopTwoTouchTimeout(),this._state=R),!this._hasDetectedGesture()&&(this._state&=~(b|c|o),this._state&=~i,this._stopLongpressTimeout(),!this._waitingRelease)){this._releaseStart=Date.now(),this._waitingRelease=!0;switch(this._tracked.length){case 1:this._state&=~(p|E);break;case 2:this._state&=~(M|E);break}}if(this._waitingRelease){Date.now()-this._releaseStart>t&&(this._state=R),this._tracked.some(function(T){return Date.now()-T.started>r})&&(this._state=R);var _=this._tracked.find(function(T){return T.id===m});if(_.active=!1,this._hasDetectedGesture())this._pushEvent("gesturestart");else if(this._state!==R)return}this._hasDetectedGesture()&&this._pushEvent("gestureend");for(var y=0;y<this._tracked.length;y++)this._tracked[y].active&&this._ignored.push(this._tracked[y].id);this._tracked=[],this._state=R,this._ignored.indexOf(m)!==-1&&this._ignored.splice(this._ignored.indexOf(m),1),this._ignored.length===0&&(this._state=h,this._waitingRelease=!1)}},{key:"_hasDetectedGesture",value:function(){return this._state===R||this._state&this._state-1?!1:!(this._state&(M|p|E)&&this._tracked.some(function(m){return m.active}))}},{key:"_startLongpressTimeout",value:function(){var m=this;this._stopLongpressTimeout(),this._longpressTimeoutId=setTimeout(function(){return m._longpressTimeout()},s)}},{key:"_stopLongpressTimeout",value:function(){clearTimeout(this._longpressTimeoutId),this._longpressTimeoutId=null}},{key:"_longpressTimeout",value:function(){if(this._hasDetectedGesture())throw new Error("A longpress gesture failed, conflict with a different gesture");this._state=i,this._pushEvent("gesturestart")}},{key:"_startTwoTouchTimeout",value:function(){var m=this;this._stopTwoTouchTimeout(),this._twoTouchTimeoutId=setTimeout(function(){return m._twoTouchTimeout()},u)}},{key:"_stopTwoTouchTimeout",value:function(){clearTimeout(this._twoTouchTimeoutId),this._twoTouchTimeoutId=null}},{key:"_isTwoTouchTimeoutRunning",value:function(){return this._twoTouchTimeoutId!==null}},{key:"_twoTouchTimeout",value:function(){if(this._tracked.length===0)throw new Error("A pinch or two drag gesture failed, no tracked touches");var m=this._getAverageMovement(),S=Math.abs(m.x),C=Math.abs(m.y),_=this._getAverageDistance(),y=Math.abs(Math.hypot(_.first.x,_.first.y)-Math.hypot(_.last.x,_.last.y));C<y&&S<y?this._state=o:this._state=c,this._pushEvent("gesturestart"),this._pushEvent("gesturemove")}},{key:"_pushEvent",value:function(m){var S={type:this._stateToGesture(this._state)},C=this._getPosition(),_=C.last;m==="gesturestart"&&(_=C.first);switch(this._state){case c:case o:_=C.first;break}if(S.clientX=_.x,S.clientY=_.y,this._state===o){var y=this._getAverageDistance();m==="gesturestart"?(S.magnitudeX=y.first.x,S.magnitudeY=y.first.y):(S.magnitudeX=y.last.x,S.magnitudeY=y.last.y)}else if(this._state===c)if(m==="gesturestart")S.magnitudeX=0,S.magnitudeY=0;else{var T=this._getAverageMovement();S.magnitudeX=T.x,S.magnitudeY=T.y}var O=new CustomEvent(m,{detail:S});this._target.dispatchEvent(O)}},{key:"_stateToGesture",value:function(m){switch(m){case M:return"onetap";case p:return"twotap";case E:return"threetap";case b:return"drag";case i:return"longpress";case c:return"twodrag";case o:return"pinch"}throw new Error("Unknown gesture state: "+m)}},{key:"_getPosition",value:function(){if(this._tracked.length===0)throw new Error("Failed to get gesture position, no tracked touches");for(var m=this._tracked.length,S=0,C=0,_=0,y=0,T=0;T<this._tracked.length;T++)S+=this._tracked[T].firstX,C+=this._tracked[T].firstY,_+=this._tracked[T].lastX,y+=this._tracked[T].lastY;return{first:{x:S/m,y:C/m},last:{x:_/m,y:y/m}}}},{key:"_getAverageMovement",value:function(){if(this._tracked.length===0)throw new Error("Failed to get gesture movement, no tracked touches");var m,S;m=S=0;for(var C=this._tracked.length,_=0;_<this._tracked.length;_++)m+=this._tracked[_].lastX-this._tracked[_].firstX,S+=this._tracked[_].lastY-this._tracked[_].firstY;return{x:m/C,y:S/C}}},{key:"_getAverageDistance",value:function(){if(this._tracked.length===0)throw new Error("Failed to get gesture distance, no tracked touches");var m=this._tracked[0],S=this._tracked[this._tracked.length-1],C=Math.abs(S.firstX-m.firstX),_=Math.abs(S.firstY-m.firstY),y=Math.abs(S.lastX-m.lastX),T=Math.abs(S.lastY-m.lastY);return{first:{x:C,y:_},last:{x:y,y:T}}}}]),f}();ne.default=d},LdHM:function(it,ne,q){"use strict";q.d(ne,"b",function(){return f}),q.d(ne,"a",function(){return m});var G=q("1OyB"),L=q("vuIU"),I=q("Ji7U"),R=q("LK+K"),M=q("q1tI"),p=q("rePB"),E=q("Ff2n"),b=q("ODXe"),i=q("4IlW"),c=q("bX4T"),o=q("YrtM"),h=q("TSYQ"),n=q.n(h),a=q("+nKL"),t=q("8OUc"),r=function(z,te){var de=z.prefixCls,be=z.id,We=z.flattenOptions,Ne=z.childrenAsData,Le=z.values,Ke=z.searchValue,He=z.multiple,Ae=z.defaultActiveFirstOption,Se=z.height,he=z.itemHeight,Ie=z.notFoundContent,ye=z.open,Ge=z.menuItemSelectedIcon,$e=z.virtual,ze=z.onSelect,Je=z.onToggleOpen,Qe=z.onActiveValue,fe=z.onScroll,ge=z.onMouseEnter,xe="".concat(de,"-item"),we=Object(o.a)(function(){return We},[ye,We],function(Fe,Ce){return Ce[0]&&Fe[1]!==Ce[1]}),Te=M.useRef(null),re=function(Ce){Ce.preventDefault()},ve=function(Ce){Te.current&&Te.current.scrollTo({index:Ce})},ae=function(Ce){for(var _e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,Ee=we.length,ee=0;ee<Ee;ee+=1){var oe=(Ce+ee*_e+Ee)%Ee,Q=we[oe],me=Q.group,Oe=Q.data;if(!me&&!Oe.disabled)return oe}return-1},Me=M.useState(function(){return ae(0)}),Ye=Object(b.a)(Me,2),et=Ye[0],je=Ye[1],ot=function(Ce){je(Ce);var _e=we[Ce];if(!_e){Qe(null,-1);return}Qe(_e.data.value,Ce)};M.useEffect(function(){ot(Ae!==!1?ae(0):-1)},[we.length,Ke]),M.useEffect(function(){var Fe=setTimeout(function(){if(!He&&ye&&Le.size===1){var Ce=Array.from(Le)[0],_e=we.findIndex(function(Ee){var ee=Ee.data;return ee.value===Ce});ot(_e),ve(_e)}});return function(){return clearTimeout(Fe)}},[ye]);var ce=function(Ce){Ce!==void 0&&ze(Ce,{selected:!Le.has(Ce)}),He||Je(!1)};if(M.useImperativeHandle(te,function(){return{onKeyDown:function(Ce){var _e=Ce.which;switch(_e){case i.a.UP:case i.a.DOWN:{var Ee=0;if(_e===i.a.UP?Ee=-1:_e===i.a.DOWN&&(Ee=1),Ee!==0){var ee=ae(et+Ee,Ee);ve(ee),ot(ee)}break}case i.a.ENTER:{var oe=we[et];oe&&!oe.data.disabled?ce(oe.data.value):ce(void 0),ye&&Ce.preventDefault();break}case i.a.ESC:Je(!1)}},onKeyUp:function(){},scrollTo:function(Ce){ve(Ce)}}}),we.length===0)return M.createElement("div",{role:"listbox",id:"".concat(be,"_list"),className:"".concat(xe,"-empty"),onMouseDown:re},Ie);function Pe(Fe){var Ce=we[Fe];if(!Ce)return null;var _e=Ce.data||{},Ee=_e.value,ee=_e.label,oe=_e.children,Q=Object(c.a)(_e,!0),me=Ne?oe:ee;return Ce?M.createElement("div",Object.assign({"aria-label":typeof me=="string"?me:null},Q,{key:Fe,role:"option",id:"".concat(be,"_list_").concat(Fe),"aria-selected":Le.has(Ee)}),Ee):null}return M.createElement(M.Fragment,null,M.createElement("div",{role:"listbox",id:"".concat(be,"_list"),style:{height:0,width:0,overflow:"hidden"}},Pe(et-1),Pe(et),Pe(et+1)),M.createElement(a.a,{itemKey:"key",ref:Te,data:we,height:Se,itemHeight:he,fullHeight:!1,onMouseDown:re,onScroll:fe,virtual:$e,onMouseEnter:ge},function(Fe,Ce){var _e,Ee=Fe.group,ee=Fe.groupOption,oe=Fe.data,Q=oe.label,me=oe.key;if(Ee)return M.createElement("div",{className:n()(xe,"".concat(xe,"-group"))},Q!==void 0?Q:me);var Oe=oe.disabled,V=oe.value,Re=oe.title,Xe=oe.children,pe=oe.style,ke=oe.className,Ve=Object(E.a)(oe,["disabled","value","title","children","style","className"]),ht=Le.has(V),tt="".concat(xe,"-option"),at=n()(xe,tt,ke,(_e={},Object(p.a)(_e,"".concat(tt,"-grouped"),ee),Object(p.a)(_e,"".concat(tt,"-active"),et===Ce&&!Oe),Object(p.a)(_e,"".concat(tt,"-disabled"),Oe),Object(p.a)(_e,"".concat(tt,"-selected"),ht),_e)),ut=Ne?Xe:Q,Ft=!Ge||typeof Ge=="function"||ht;return M.createElement("div",Object.assign({},Ve,{"aria-selected":ht,className:at,title:Re,onMouseMove:function(){if(et===Ce||Oe)return;ot(Ce)},onClick:function(){Oe||ce(V)},style:pe}),M.createElement("div",{className:"".concat(tt,"-content")},ut||V),M.isValidElement(Ge)||ht,Ft&&M.createElement(t.a,{className:"".concat(xe,"-option-state"),customizeIcon:Ge,customizeIconProps:{isSelected:ht}},ht?"\u2713":null))}))},s=M.forwardRef(r);s.displayName="OptionList";var u=s,d=function(){return null};d.isSelectOption=!0;var f=d,v=function(){return null};v.isSelectOptGroup=!0;var m=v,S=q("VTBJ"),C=q("Zm9Q");function _(k){var z=k.key,te=k.props,de=te.children,be=te.value,We=Object(E.a)(te,["children","value"]);return Object(S.a)({key:z,value:be!==void 0?be:z,children:de},We)}function y(k){var z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Object(C.a)(k).map(function(te,de){if(!M.isValidElement(te)||!te.type)return null;var be=te.type.isSelectOptGroup,We=te.key,Ne=te.props,Le=Ne.children,Ke=Object(E.a)(Ne,["children"]);return z||!be?_(te):Object(S.a)(Object(S.a)({key:"__RC_SELECT_GRP__".concat(We===null?de:We,"__"),label:We},Ke),{},{options:y(Le)})}).filter(function(te){return te})}var T=q("2Qr1"),O=q("qNPg"),g=q("U8pU"),F=q("Kwbf"),P=q("WKfj");function N(k){var z=k.mode,te=k.options,de=k.children,be=k.backfill,We=k.allowClear,Ne=k.placeholder,Le=k.getInputElement,Ke=k.showSearch,He=k.onSearch,Ae=k.defaultOpen,Se=k.autoFocus,he=k.labelInValue,Ie=k.value,ye=k.inputValue,Ge=k.optionLabelProp,$e=z==="multiple"||z==="tags",ze=Ke!==void 0?Ke:$e||z==="combobox",Je=te||y(de);if(Object(F.a)(z!=="tags"||Je.every(function(xe){return!xe.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),z==="tags"||z==="combobox"){var Qe=Je.some(function(xe){return xe.options?xe.options.some(function(we){return typeof("value"in we?we.value:we.key)=="number"}):typeof("value"in xe?xe.value:xe.key)=="number"});Object(F.a)(!Qe,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(F.a)(z!=="combobox"||!Ge,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(F.a)(z==="combobox"||!be,"`backfill` only works with `combobox` mode."),Object(F.a)(z==="combobox"||!Le,"`getInputElement` only work with `combobox` mode."),Object(F.b)(z!=="combobox"||!Le||!We||!Ne,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),He&&!ze&&z!=="combobox"&&z!=="tags"&&Object(F.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(F.b)(!Ae||Se,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),Ie!=null){var fe=Object(P.d)(Ie);Object(F.a)(!he||fe.every(function(xe){return Object(g.a)(xe)==="object"&&("key"in xe||"value"in xe)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),Object(F.a)(!$e||Array.isArray(Ie),"`value` should be array when `mode` is `multiple` or `tags`")}if(de){var ge=null;Object(C.a)(de).some(function(xe){if(!M.isValidElement(xe)||!xe.type)return!1;var we=xe.type;if(we.isSelectOption)return!1;if(we.isSelectOptGroup){var Te=Object(C.a)(xe.props.children).every(function(re){return!M.isValidElement(re)||!xe.type||re.type.isSelectOption?!0:(ge=re.type,!1)});return!Te}return ge=we,!0}),ge&&Object(F.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(ge.displayName||ge.name||ge,"`.")),Object(F.a)(ye===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}var X=N,j=Object(O.a)({prefixCls:"rc-select",components:{optionList:u},convertChildrenToData:y,flattenOptions:T.d,getLabeledValue:T.e,filterOptions:T.b,isValueDisabled:T.g,findValueOption:T.c,warningProps:X,fillOptionsWithMissingValue:T.a}),A=function(k){Object(I.a)(te,k);var z=Object(R.a)(te);function te(){var de;return Object(G.a)(this,te),de=z.apply(this,arguments),de.selectRef=M.createRef(),de.focus=function(){de.selectRef.current.focus()},de.blur=function(){de.selectRef.current.blur()},de}return Object(L.a)(te,[{key:"render",value:function(){return M.createElement(j,Object.assign({ref:this.selectRef},this.props))}}]),te}(M.Component);A.Option=f,A.OptGroup=m;var K=A,U=ne.c=K},Lmeb:function(it,ne,q){},Lo0S:function(it,ne,q){"use strict";Object.defineProperty(ne,"__esModule",{value:!0}),ne.initLogging=p,ne.getLogging=E,ne.Error=ne.Warn=ne.Info=ne.Debug=void 0;var G="warn",L=function(){};ne.Debug=L;var I=function(){};ne.Info=I;var R=function(){};ne.Warn=R;var M=function(){};ne.Error=M;function p(b){if(typeof b=="undefined"?b=G:G=b,ne.Debug=L=ne.Info=I=ne.Warn=R=ne.Error=M=function(){},typeof window.console!="undefined")switch(b){case"debug":ne.Debug=L=console.debug.bind(window.console);case"info":ne.Info=I=console.info.bind(window.console);case"warn":ne.Warn=R=console.warn.bind(window.console);case"error":ne.Error=M=console.error.bind(window.console);case"none":break;default:throw new window.Error("invalid logging type '"+b+"'")}}function E(){return G}p()},M8RZ:function(it,ne,q){"use strict";q.d(ne,"a",function(){return i});var G=q("fWQN"),L=q("mtLc"),I=q("yKVA"),R=q("879j"),M=q("q1tI"),p=q.n(M),E=q("i8i4"),b=q.n(E),i=function(c){Object(I.a)(h,c);var o=Object(R.a)(h);function h(n){var a;Object(G.a)(this,h),a=o.call(this,n);var t=window.document;return a.node=t.createElement("div"),t.body.appendChild(a.node),a}return Object(L.a)(h,[{key:"render",value:function(){var a=this.props.children;return Object(E.createPortal)(a,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),h}(p.a.Component)},MI8n:function(it,ne,q){"use strict";q.d(ne,"c",function(){return M}),q.d(ne,"b",function(){return i}),q.d(ne,"e",function(){return c}),q.d(ne,"a",function(){return o}),q.d(ne,"d",function(){return h}),q.d(ne,"f",function(){return n});var G=q("/cxE"),L=q("pmY6"),I=q("24hK"),R=q("5Y4S"),M;(function(a){a.None=()=>L.a.None;function t(N){return(X,j=null,A)=>{let K=!1,U;return U=N(k=>K?void 0:(U?U.dispose():K=!0,X.call(j,k)),null,A),K&&U.dispose(),U}}a.once=t;function r(N,X){return m((j,A=null,K)=>N(U=>j.call(A,X(U)),null,K))}a.map=r;function s(N,X){return m((j,A=null,K)=>N(U=>{X(U),j.call(A,U)},null,K))}a.forEach=s;function u(N,X){return m((j,A=null,K)=>N(U=>X(U)&&j.call(A,U),null,K))}a.filter=u;function d(N){return N}a.signal=d;function f(...N){return(X,j=null,A)=>Object(L.e)(...N.map(K=>K(U=>X.call(j,U),null,A)))}a.any=f;function v(N,X,j){let A=j;return r(N,K=>(A=X(A,K),A))}a.reduce=v;function m(N){let X;const j=new i({onFirstListenerAdd(){X=N(j.fire,j)},onLastListenerRemove(){X.dispose()}});return j.event}function S(N,X,j=100,A=!1,K){let U,k,z,te=0;const de=new i({leakWarningThreshold:K,onFirstListenerAdd(){U=N(be=>{te++,k=X(k,be),A&&!z&&(de.fire(k),k=void 0),clearTimeout(z),z=setTimeout(()=>{const We=k;k=void 0,z=void 0,(!A||te>1)&&de.fire(We),te=0},j)})},onLastListenerRemove(){U.dispose()}});return de.event}a.debounce=S;function C(N,X=(j,A)=>j===A){let j=!0,A;return u(N,K=>{const U=j||!X(K,A);return j=!1,A=K,U})}a.latch=C;function _(N,X){return[a.filter(N,X),a.filter(N,j=>!X(j))]}a.split=_;function y(N,X=!1,j=[]){let A=j.slice(),K=N(z=>{A?A.push(z):k.fire(z)});const U=()=>{A&&A.forEach(z=>k.fire(z)),A=null},k=new i({onFirstListenerAdd(){K||(K=N(z=>k.fire(z)))},onFirstListenerDidAdd(){A&&(X?setTimeout(U):U())},onLastListenerRemove(){K&&K.dispose(),K=null}});return k.event}a.buffer=y;class T{constructor(N){this.event=N}map(N){return new T(r(this.event,N))}forEach(N){return new T(s(this.event,N))}filter(N){return new T(u(this.event,N))}reduce(N,X){return new T(v(this.event,N,X))}latch(){return new T(C(this.event))}debounce(N,X=100,j=!1,A){return new T(S(this.event,N,X,j,A))}on(N,X,j){return this.event(N,X,j)}once(N,X,j){return t(this.event)(N,X,j)}}function O(N){return new T(N)}a.chain=O;function g(N,X,j=A=>A){const A=(...z)=>k.fire(j(...z)),K=()=>N.on(X,A),U=()=>N.removeListener(X,A),k=new i({onFirstListenerAdd:K,onLastListenerRemove:U});return k.event}a.fromNodeEventEmitter=g;function F(N,X,j=A=>A){const A=(...z)=>k.fire(j(...z)),K=()=>N.addEventListener(X,A),U=()=>N.removeEventListener(X,A),k=new i({onFirstListenerAdd:K,onLastListenerRemove:U});return k.event}a.fromDOMEventEmitter=F;function P(N){return new Promise(X=>t(N)(X))}a.toPromise=P})(M||(M={}));class p{constructor(a){this._listenerCount=0,this._invocationCount=0,this._elapsedOverall=0,this._name=`${a}_${p._idPool++}`}start(a){this._stopWatch=new R.a(!0),this._listenerCount=a}stop(){if(this._stopWatch){const a=this._stopWatch.elapsed();this._elapsedOverall+=a,this._invocationCount+=1,console.info(`did FIRE ${this._name}: elapsed_ms: ${a.toFixed(5)}, listener: ${this._listenerCount} (elapsed_overall: ${this._elapsedOverall.toFixed(2)}, invocations: ${this._invocationCount})`),this._stopWatch=void 0}}}p._idPool=0;let E=-1;class b{constructor(a,t=Math.random().toString(18).slice(2,5)){this.customThreshold=a,this.name=t,this._warnCountdown=0}dispose(){this._stacks&&this._stacks.clear()}check(a){let t=E;if(typeof this.customThreshold=="number"&&(t=this.customThreshold),t<=0||a<t)return;this._stacks||(this._stacks=new Map);const r=new Error().stack.split(`
|
|
|
`).slice(3).join(`
|
|
|
`),s=this._stacks.get(r)||0;if(this._stacks.set(r,s+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=t*.5;let u,d=0;for(const[f,v]of this._stacks)(!u||d<v)&&(u=f,d=v);console.warn(`[${this.name}] potential listener LEAK detected, having ${a} listeners already. MOST frequent listener (${d}):`),console.warn(u)}return()=>{const u=this._stacks.get(r)||0;this._stacks.set(r,u-1)}}}class i{constructor(a){var t;this._disposed=!1,this._options=a,this._leakageMon=E>0?new b(this._options&&this._options.leakWarningThreshold):void 0,this._perfMon=((t=this._options)===null||t===void 0?void 0:t._profName)?new p(this._options._profName):void 0}get event(){return this._event||(this._event=(a,t,r)=>{var s;this._listeners||(this._listeners=new I.a);const u=this._listeners.isEmpty();u&&this._options&&this._options.onFirstListenerAdd&&this._options.onFirstListenerAdd(this);const d=this._listeners.push(t?[a,t]:a);u&&this._options&&this._options.onFirstListenerDidAdd&&this._options.onFirstListenerDidAdd(this),this._options&&this._options.onListenerDidAdd&&this._options.onListenerDidAdd(this,a,t);const f=(s=this._leakageMon)===null||s===void 0?void 0:s.check(this._listeners.size),v=Object(L.i)(()=>{if(f&&f(),!this._disposed&&(d(),this._options&&this._options.onLastListenerRemove)){const m=this._listeners&&!this._listeners.isEmpty();m||this._options.onLastListenerRemove(this)}});return r instanceof L.b?r.add(v):Array.isArray(r)&&r.push(v),v}),this._event}fire(a){var t,r;if(this._listeners){this._deliveryQueue||(this._deliveryQueue=new I.a);for(let s of this._listeners)this._deliveryQueue.push([s,a]);for((t=this._perfMon)===null||t===void 0||t.start(this._deliveryQueue.size);this._deliveryQueue.size>0;){const[s,u]=this._deliveryQueue.shift();try{typeof s=="function"?s.call(void 0,u):s[0].call(s[1],u)}catch(d){Object(G.f)(d)}}(r=this._perfMon)===null||r===void 0||r.stop()}}dispose(){var a,t,r,s,u;this._disposed||(this._disposed=!0,(a=this._listeners)===null||a===void 0||a.clear(),(t=this._deliveryQueue)===null||t===void 0||t.clear(),(s=(r=this._options)===null||r===void 0?void 0:r.onLastListenerRemove)===null||s===void 0||s.call(r),(u=this._leakageMon)===null||u===void 0||u.dispose())}}class c extends i{constructor(a){super(a);this._isPaused=0,this._eventQueue=new I.a,this._mergeFn=a==null?void 0:a.merge}pause(){this._isPaused++}resume(){if(this._isPaused!==0&&--this._isPaused===0)if(this._mergeFn){const a=Array.from(this._eventQueue);this._eventQueue.clear(),super.fire(this._mergeFn(a))}else for(;!this._isPaused&&this._eventQueue.size!==0;)super.fire(this._eventQueue.shift())}fire(a){this._listeners&&(this._isPaused!==0?this._eventQueue.push(a):super.fire(a))}}class o extends c{constructor(a){var t;super(a);this._delay=(t=a.delay)!==null&&t!==void 0?t:100}fire(a){this._handle||(this.pause(),this._handle=setTimeout(()=>{this._handle=void 0,this.resume()},this._delay)),super.fire(a)}}class h{constructor(){this.buffers=[]}wrapEvent(a){return(t,r,s)=>a(u=>{const d=this.buffers[this.buffers.length-1];d?d.push(()=>t.call(r,u)):t.call(r,u)},void 0,s)}bufferEvents(a){const t=[];this.buffers.push(t);const r=a();return this.buffers.pop(),t.forEach(s=>s()),r}}class n{constructor(){this.listening=!1,this.inputEvent=M.None,this.inputEventListener=L.a.None,this.emitter=new i({onFirstListenerDidAdd:()=>{this.listening=!0,this.inputEventListener=this.inputEvent(this.emitter.fire,this.emitter)},onLastListenerRemove:()=>{this.listening=!1,this.inputEventListener.dispose()}}),this.event=this.emitter.event}set input(a){this.inputEvent=a,this.listening&&(this.inputEventListener.dispose(),this.inputEventListener=a(this.emitter.fire,this.emitter))}dispose(){this.inputEventListener.dispose(),this.emitter.dispose()}}},MNsG:function(it,ne,q){"use strict";(function(G,L){q.d(ne,"b",function(){return r}),q.d(ne,"i",function(){return f}),q.d(ne,"f",function(){return v}),q.d(ne,"d",function(){return m}),q.d(ne,"g",function(){return S}),q.d(ne,"h",function(){return C}),q.d(ne,"c",function(){return _}),q.d(ne,"k",function(){return y}),q.d(ne,"j",function(){return T}),q.d(ne,"a",function(){return O}),q.d(ne,"e",function(){return P});var I;const R="en";let M=!1,p=!1,E=!1,b=!1,i=!1,c=!1,o=!1,h,n=R,a,t;const r=typeof self=="object"?self:typeof G=="object"?G:{};let s;typeof r.vscode!="undefined"&&typeof r.vscode.process!="undefined"?s=r.vscode.process:typeof L!="undefined"&&(s=L);const u=typeof((I=s==null?void 0:s.versions)===null||I===void 0?void 0:I.electron)=="string"&&s.type==="renderer";if(typeof navigator=="object"&&!u)t=navigator.userAgent,M=t.indexOf("Windows")>=0,p=t.indexOf("Macintosh")>=0,o=(t.indexOf("Macintosh")>=0||t.indexOf("iPad")>=0||t.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,E=t.indexOf("Linux")>=0,c=!0,h=navigator.language,n=h;else if(typeof s=="object"){M=s.platform==="win32",p=s.platform==="darwin",E=s.platform==="linux",b=E&&!!s.env.SNAP&&!!s.env.SNAP_REVISION,h=R,n=R;const N=s.env.VSCODE_NLS_CONFIG;if(N)try{const X=JSON.parse(N),j=X.availableLanguages["*"];h=X.locale,n=j||R,a=X._translationsConfigFile}catch(X){}i=!0}else console.error("Unable to resolve platform.");let d=0;p?d=1:M?d=3:E&&(d=2);const f=M,v=p,m=E,S=i,C=c,_=o,y=t,T=function(){if(r.setImmediate)return r.setImmediate.bind(r);if(typeof r.postMessage=="function"&&!r.importScripts){let j=[];r.addEventListener("message",K=>{if(K.data&&K.data.vscodeSetImmediateId)for(let U=0,k=j.length;U<k;U++){const z=j[U];if(z.id===K.data.vscodeSetImmediateId){j.splice(U,1),z.callback();return}}});let A=0;return K=>{const U=++A;j.push({id:U,callback:K}),r.postMessage({vscodeSetImmediateId:U},"*")}}if(typeof(s==null?void 0:s.nextTick)=="function")return s.nextTick.bind(s);const X=Promise.resolve();return j=>X.then(j)}(),O=p||o?2:M?1:3;let g=!0,F=!1;function P(){if(!F){F=!0;const N=new Uint8Array(2);N[0]=1,N[1]=2;const X=new Uint16Array(N.buffer);g=X[0]===(2<<8)+1}return g}}).call(this,q("IyRk"),q("Q2Ig"))},MZdM:function(it,ne,q){"use strict";function G(n){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?G=function(t){return typeof t}:G=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},G(n)}Object.defineProperty(ne,"__esModule",{value:!0}),ne.default=void 0;var L=b(q("Lo0S")),I=p(q("N/zr")),R=q("GdRQ"),M=q("GQ8N");function p(n){return n&&n.__esModule?n:{default:n}}function E(){if(typeof WeakMap!="function")return null;var n=new WeakMap;return E=function(){return n},n}function b(n){if(n&&n.__esModule)return n;if(n===null||G(n)!=="object"&&typeof n!="function")return{default:n};var a=E();if(a&&a.has(n))return a.get(n);var t={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in n)if(Object.prototype.hasOwnProperty.call(n,s)){var u=r?Object.getOwnPropertyDescriptor(n,s):null;u&&(u.get||u.set)?Object.defineProperty(t,s,u):t[s]=n[s]}return t.default=n,a&&a.set(n,t),t}function i(n,a){if(!(n instanceof a))throw new TypeError("Cannot call a class as a function")}function c(n,a){for(var t=0;t<a.length;t++){var r=a[t];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(n,r.key,r)}}function o(n,a,t){return a&&c(n.prototype,a),t&&c(n,t),n}var h=function(){function n(a){if(i(this,n),this._drawCtx=null,this._renderQ=[],this._flushing=!1,this._fbWidth=0,this._fbHeight=0,this._prevDrawStyle="",this._tile=null,this._tile16x16=null,this._tileX=0,this._tileY=0,L.Debug(">> Display.constructor"),this._target=a,!this._target)throw new Error("Target must be set");if(typeof this._target=="string")throw new Error("target must be a DOM element");if(!this._target.getContext)throw new Error("no getContext method");if(this._targetCtx=this._target.getContext("2d"),this._viewportLoc={x:0,y:0,w:this._target.width,h:this._target.height},this._backbuffer=document.createElement("canvas"),this._drawCtx=this._backbuffer.getContext("2d"),this._damageBounds={left:0,top:0,right:this._backbuffer.width,bottom:this._backbuffer.height},L.Debug("User Agent: "+navigator.userAgent),!("createImageData"in this._drawCtx))throw new Error("Canvas does not support createImageData");this._tile16x16=this._drawCtx.createImageData(16,16),L.Debug("<< Display.constructor"),this._scale=1,this._clipViewport=!1,this.onflush=function(){}}return o(n,[{key:"viewportChangePos",value:function(t,r){var s=this._viewportLoc;t=Math.floor(t),r=Math.floor(r),this._clipViewport||(t=-s.w,r=-s.h);var u=s.x+s.w-1,d=s.y+s.h-1;if(t<0&&s.x+t<0&&(t=-s.x),u+t>=this._fbWidth&&(t-=u+t-this._fbWidth+1),s.y+r<0&&(r=-s.y),d+r>=this._fbHeight&&(r-=d+r-this._fbHeight+1),t===0&&r===0)return;L.Debug("viewportChange deltaX: "+t+", deltaY: "+r),s.x+=t,s.y+=r,this._damage(s.x,s.y,s.w,s.h),this.flip()}},{key:"viewportChangeSize",value:function(t,r){(!this._clipViewport||typeof t=="undefined"||typeof r=="undefined")&&(L.Debug("Setting viewport to full display region"),t=this._fbWidth,r=this._fbHeight),t=Math.floor(t),r=Math.floor(r),t>this._fbWidth&&(t=this._fbWidth),r>this._fbHeight&&(r=this._fbHeight);var s=this._viewportLoc;if(s.w!==t||s.h!==r){s.w=t,s.h=r;var u=this._target;u.width=t,u.height=r,this.viewportChangePos(0,0),this._damage(s.x,s.y,s.w,s.h),this.flip(),this._rescale(this._scale)}}},{key:"absX",value:function(t){return this._scale===0?0:(0,M.toSigned32bit)(t/this._scale+this._viewportLoc.x)}},{key:"absY",value:function(t){return this._scale===0?0:(0,M.toSigned32bit)(t/this._scale+this._viewportLoc.y)}},{key:"resize",value:function(t,r){this._prevDrawStyle="",this._fbWidth=t,this._fbHeight=r;var s=this._backbuffer;if(s.width!==t||s.height!==r){var u=null;s.width>0&&s.height>0&&(u=this._drawCtx.getImageData(0,0,s.width,s.height)),s.width!==t&&(s.width=t),s.height!==r&&(s.height=r),u&&this._drawCtx.putImageData(u,0,0)}var d=this._viewportLoc;this.viewportChangeSize(d.w,d.h),this.viewportChangePos(0,0)}},{key:"_damage",value:function(t,r,s,u){t<this._damageBounds.left&&(this._damageBounds.left=t),r<this._damageBounds.top&&(this._damageBounds.top=r),t+s>this._damageBounds.right&&(this._damageBounds.right=t+s),r+u>this._damageBounds.bottom&&(this._damageBounds.bottom=r+u)}},{key:"flip",value:function(t){if(this._renderQ.length!==0&&!t)this._renderQPush({type:"flip"});else{var r=this._damageBounds.left,s=this._damageBounds.top,u=this._damageBounds.right-r,d=this._damageBounds.bottom-s,f=r-this._viewportLoc.x,v=s-this._viewportLoc.y;f<0&&(u+=f,r-=f,f=0),v<0&&(d+=v,s-=v,v=0),f+u>this._viewportLoc.w&&(u=this._viewportLoc.w-f),v+d>this._viewportLoc.h&&(d=this._viewportLoc.h-v),u>0&&d>0&&this._targetCtx.drawImage(this._backbuffer,r,s,u,d,f,v,u,d),this._damageBounds.left=this._damageBounds.top=65535,this._damageBounds.right=this._damageBounds.bottom=0}}},{key:"pending",value:function(){return this._renderQ.length>0}},{key:"flush",value:function(){this._renderQ.length===0?this.onflush():this._flushing=!0}},{key:"fillRect",value:function(t,r,s,u,d,f){this._renderQ.length!==0&&!f?this._renderQPush({type:"fill",x:t,y:r,width:s,height:u,color:d}):(this._setFillColor(d),this._drawCtx.fillRect(t,r,s,u),this._damage(t,r,s,u))}},{key:"copyImage",value:function(t,r,s,u,d,f,v){this._renderQ.length!==0&&!v?this._renderQPush({type:"copy",oldX:t,oldY:r,x:s,y:u,width:d,height:f}):(this._drawCtx.mozImageSmoothingEnabled=!1,this._drawCtx.webkitImageSmoothingEnabled=!1,this._drawCtx.msImageSmoothingEnabled=!1,this._drawCtx.imageSmoothingEnabled=!1,this._drawCtx.drawImage(this._backbuffer,t,r,d,f,s,u,d,f),this._damage(s,u,d,f))}},{key:"imageRect",value:function(t,r,s,u,d,f){if(s===0||u===0)return;var v=new Image;v.src="data: "+d+";base64,"+I.default.encode(f),this._renderQPush({type:"img",img:v,x:t,y:r,width:s,height:u})}},{key:"startTile",value:function(t,r,s,u,d){this._tileX=t,this._tileY=r,s===16&&u===16?this._tile=this._tile16x16:this._tile=this._drawCtx.createImageData(s,u);for(var f=d[2],v=d[1],m=d[0],S=this._tile.data,C=0;C<s*u*4;C+=4)S[C]=f,S[C+1]=v,S[C+2]=m,S[C+3]=255}},{key:"subTile",value:function(t,r,s,u,d){for(var f=d[2],v=d[1],m=d[0],S=t+s,C=r+u,_=this._tile.data,y=this._tile.width,T=r;T<C;T++)for(var O=t;O<S;O++){var g=(O+T*y)*4;_[g]=f,_[g+1]=v,_[g+2]=m,_[g+3]=255}}},{key:"finishTile",value:function(){this._drawCtx.putImageData(this._tile,this._tileX,this._tileY),this._damage(this._tileX,this._tileY,this._tile.width,this._tile.height)}},{key:"blitImage",value:function(t,r,s,u,d,f,v){if(this._renderQ.length!==0&&!v){var m=new Uint8Array(s*u*4);m.set(new Uint8Array(d.buffer,0,m.length)),this._renderQPush({type:"blit",data:m,x:t,y:r,width:s,height:u})}else this._bgrxImageData(t,r,s,u,d,f)}},{key:"blitRgbImage",value:function(t,r,s,u,d,f,v){if(this._renderQ.length!==0&&!v){var m=new Uint8Array(s*u*3);m.set(new Uint8Array(d.buffer,0,m.length)),this._renderQPush({type:"blitRgb",data:m,x:t,y:r,width:s,height:u})}else this._rgbImageData(t,r,s,u,d,f)}},{key:"blitRgbxImage",value:function(t,r,s,u,d,f,v){if(this._renderQ.length!==0&&!v){var m=new Uint8Array(s*u*4);m.set(new Uint8Array(d.buffer,0,m.length)),this._renderQPush({type:"blitRgbx",data:m,x:t,y:r,width:s,height:u})}else this._rgbxImageData(t,r,s,u,d,f)}},{key:"drawImage",value:function(t,r,s){this._drawCtx.drawImage(t,r,s),this._damage(r,s,t.width,t.height)}},{key:"autoscale",value:function(t,r){var s;if(t===0||r===0)s=0;else{var u=this._viewportLoc,d=t/r,f=u.w/u.h;f>=d?s=t/u.w:s=r/u.h}this._rescale(s)}},{key:"_rescale",value:function(t){this._scale=t;var r=this._viewportLoc,s=t*r.w+"px",u=t*r.h+"px";(this._target.style.width!==s||this._target.style.height!==u)&&(this._target.style.width=s,this._target.style.height=u)}},{key:"_setFillColor",value:function(t){var r="rgb("+t[2]+","+t[1]+","+t[0]+")";r!==this._prevDrawStyle&&(this._drawCtx.fillStyle=r,this._prevDrawStyle=r)}},{key:"_rgbImageData",value:function(t,r,s,u,d,f){for(var v=this._drawCtx.createImageData(s,u),m=v.data,S=0,C=f;S<s*u*4;S+=4,C+=3)m[S]=d[C],m[S+1]=d[C+1],m[S+2]=d[C+2],m[S+3]=255;this._drawCtx.putImageData(v,t,r),this._damage(t,r,v.width,v.height)}},{key:"_bgrxImageData",value:function(t,r,s,u,d,f){for(var v=this._drawCtx.createImageData(s,u),m=v.data,S=0,C=f;S<s*u*4;S+=4,C+=4)m[S]=d[C+2],m[S+1]=d[C+1],m[S+2]=d[C],m[S+3]=255;this._drawCtx.putImageData(v,t,r),this._damage(t,r,v.width,v.height)}},{key:"_rgbxImageData",value:function(t,r,s,u,d,f){var v;R.supportsImageMetadata?v=new ImageData(new Uint8ClampedArray(d.buffer,d.byteOffset,s*u*4),s,u):(v=this._drawCtx.createImageData(s,u),v.data.set(new Uint8ClampedArray(d.buffer,d.byteOffset,s*u*4))),this._drawCtx.putImageData(v,t,r),this._damage(t,r,v.width,v.height)}},{key:"_renderQPush",value:function(t){this._renderQ.push(t),this._renderQ.length===1&&this._scanRenderQ()}},{key:"_resumeRenderQ",value:function(){this.removeEventListener("load",this._noVNCDisplay._resumeRenderQ),this._noVNCDisplay._scanRenderQ()}},{key:"_scanRenderQ",value:function(){for(var t=!0;t&&this._renderQ.length>0;){var r=this._renderQ[0];switch(r.type){case"flip":this.flip(!0);break;case"copy":this.copyImage(r.oldX,r.oldY,r.x,r.y,r.width,r.height,!0);break;case"fill":this.fillRect(r.x,r.y,r.width,r.height,r.color,!0);break;case"blit":this.blitImage(r.x,r.y,r.width,r.height,r.data,0,!0);break;case"blitRgb":this.blitRgbImage(r.x,r.y,r.width,r.height,r.data,0,!0);break;case"blitRgbx":this.blitRgbxImage(r.x,r.y,r.width,r.height,r.data,0,!0);break;case"img":if(r.img.complete&&r.img.width!==0&&r.img.height!==0){if(r.img.width!==r.width||r.img.height!==r.height){L.Error("Decoded image has incorrect dimensions. Got "+r.img.width+"x"+r.img.height+". Expected "+r.width+"x"+r.height+".");return}this.drawImage(r.img,r.x,r.y)}else r.img._noVNCDisplay=this,r.img.addEventListener("load",this._resumeRenderQ),t=!1;break}t&&this._renderQ.shift()}this._renderQ.length===0&&this._flushing&&(this._flushing=!1,this.onflush())}},{key:"scale",get:function(){return this._scale},set:function(t){this._rescale(t)}},{key:"clipViewport",get:function(){return this._clipViewport},set:function(t){this._clipViewport=t;var r=this._viewportLoc;this.viewportChangeSize(r.w,r.h),this.viewportChangePos(0,0)}},{key:"width",get:function(){return this._fbWidth}},{key:"height",get:function(){return this._fbHeight}}]),n}();ne.default=h},Mmt2:function(it,ne,q){"use strict";function G(o){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?G=function(n){return typeof n}:G=function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},G(o)}Object.defineProperty(ne,"__esModule",{value:!0}),ne.default=void 0;var L=R(q("Lo0S"));function I(){if(typeof WeakMap!="function")return null;var o=new WeakMap;return I=function(){return o},o}function R(o){if(o&&o.__esModule)return o;if(o===null||G(o)!=="object"&&typeof o!="function")return{default:o};var h=I();if(h&&h.has(o))return h.get(o);var n={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var t in o)if(Object.prototype.hasOwnProperty.call(o,t)){var r=a?Object.getOwnPropertyDescriptor(o,t):null;r&&(r.get||r.set)?Object.defineProperty(n,t,r):n[t]=o[t]}return n.default=o,h&&h.set(o,n),n}function M(o,h){if(!(o instanceof h))throw new TypeError("Cannot call a class as a function")}function p(o,h){for(var n=0;n<h.length;n++){var a=h[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(o,a.key,a)}}function E(o,h,n){return h&&p(o.prototype,h),n&&p(o,n),o}var b=!1,i=40*1024*1024,c=function(){function o(){M(this,o),this._websocket=null,this._rQi=0,this._rQlen=0,this._rQbufferSize=1024*1024*4,this._rQ=null,this._sQbufferSize=1024*10,this._sQlen=0,this._sQ=null,this._eventHandlers={message:function(){},open:function(){},close:function(){},error:function(){}}}return E(o,[{key:"rQpeek8",value:function(){return this._rQ[this._rQi]}},{key:"rQskipBytes",value:function(n){this._rQi+=n}},{key:"rQshift8",value:function(){return this._rQshift(1)}},{key:"rQshift16",value:function(){return this._rQshift(2)}},{key:"rQshift32",value:function(){return this._rQshift(4)}},{key:"_rQshift",value:function(n){for(var a=0,t=n-1;t>=0;t--)a+=this._rQ[this._rQi++]<<t*8;return a}},{key:"rQshiftStr",value:function(n){typeof n=="undefined"&&(n=this.rQlen);for(var a="",t=0;t<n;t+=4096){var r=this.rQshiftBytes(Math.min(4096,n-t));a+=String.fromCharCode.apply(null,r)}return a}},{key:"rQshiftBytes",value:function(n){return typeof n=="undefined"&&(n=this.rQlen),this._rQi+=n,new Uint8Array(this._rQ.buffer,this._rQi-n,n)}},{key:"rQshiftTo",value:function(n,a){a===void 0&&(a=this.rQlen),n.set(new Uint8Array(this._rQ.buffer,this._rQi,a)),this._rQi+=a}},{key:"rQslice",value:function(n){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.rQlen;return new Uint8Array(this._rQ.buffer,this._rQi+n,a-n)}},{key:"rQwait",value:function(n,a,t){if(this.rQlen<a){if(t){if(this._rQi<t)throw new Error("rQwait cannot backup "+t+" bytes");this._rQi-=t}return!0}return!1}},{key:"flush",value:function(){this._sQlen>0&&this._websocket.readyState===WebSocket.OPEN&&(this._websocket.send(this._encodeMessage()),this._sQlen=0)}},{key:"send",value:function(n){this._sQ.set(n,this._sQlen),this._sQlen+=n.length,this.flush()}},{key:"sendString",value:function(n){this.send(n.split("").map(function(a){return a.charCodeAt(0)}))}},{key:"off",value:function(n){this._eventHandlers[n]=function(){}}},{key:"on",value:function(n,a){this._eventHandlers[n]=a}},{key:"_allocateBuffers",value:function(){this._rQ=new Uint8Array(this._rQbufferSize),this._sQ=new Uint8Array(this._sQbufferSize)}},{key:"init",value:function(){this._allocateBuffers(),this._rQi=0,this._websocket=null}},{key:"open",value:function(n,a){var t=this;this.init(),this._websocket=new WebSocket(n,a),this._websocket.binaryType="arraybuffer",this._websocket.onmessage=this._recvMessage.bind(this),this._websocket.onopen=function(){L.Debug(">> WebSock.onopen"),t._websocket.protocol&&L.Info("Server choose sub-protocol: "+t._websocket.protocol),t._eventHandlers.open(),L.Debug("<< WebSock.onopen")},this._websocket.onclose=function(r){L.Debug(">> WebSock.onclose"),t._eventHandlers.close(r),L.Debug("<< WebSock.onclose")},this._websocket.onerror=function(r){L.Debug(">> WebSock.onerror: "+r),t._eventHandlers.error(r),L.Debug("<< WebSock.onerror: "+r)}}},{key:"close",value:function(){this._websocket&&((this._websocket.readyState===WebSocket.OPEN||this._websocket.readyState===WebSocket.CONNECTING)&&(L.Info("Closing WebSocket connection"),this._websocket.close()),this._websocket.onmessage=function(){})}},{key:"_encodeMessage",value:function(){return new Uint8Array(this._sQ.buffer,0,this._sQlen)}},{key:"_expandCompactRQ",value:function(n){var a=(this._rQlen-this._rQi+n)*8,t=this._rQbufferSize<a;if(t&&(this._rQbufferSize=Math.max(this._rQbufferSize*2,a)),this._rQbufferSize>i&&(this._rQbufferSize=i,this._rQbufferSize-this.rQlen<n))throw new Error("Receive Queue buffer exceeded "+i+" bytes, and the new message could not fit");if(t){var r=this._rQ.buffer;this._rQ=new Uint8Array(this._rQbufferSize),this._rQ.set(new Uint8Array(r,this._rQi,this._rQlen-this._rQi))}else b?this._rQ.copyWithin(0,this._rQi,this._rQlen):this._rQ.set(new Uint8Array(this._rQ.buffer,this._rQi,this._rQlen-this._rQi));this._rQlen=this._rQlen-this._rQi,this._rQi=0}},{key:"_DecodeMessage",value:function(n){var a=new Uint8Array(n);a.length>this._rQbufferSize-this._rQlen&&this._expandCompactRQ(a.length),this._rQ.set(a,this._rQlen),this._rQlen+=a.length}},{key:"_recvMessage",value:function(n){this._DecodeMessage(n.data),this.rQlen>0?(this._eventHandlers.message(),this._rQlen==this._rQi&&(this._rQlen=0,this._rQi=0)):L.Debug("Ignoring empty message")}},{key:"sQ",get:function(){return this._sQ}},{key:"rQ",get:function(){return this._rQ}},{key:"rQi",get:function(){return this._rQi},set:function(n){this._rQi=n}},{key:"rQlen",get:function(){return this._rQlen-this._rQi}}]),o}();ne.default=c},"N/zr":function(it,ne,q){"use strict";function G(p){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?G=function(b){return typeof b}:G=function(b){return b&&typeof Symbol=="function"&&b.constructor===Symbol&&b!==Symbol.prototype?"symbol":typeof b},G(p)}Object.defineProperty(ne,"__esModule",{value:!0}),ne.default=void 0;var L=R(q("Lo0S"));function I(){if(typeof WeakMap!="function")return null;var p=new WeakMap;return I=function(){return p},p}function R(p){if(p&&p.__esModule)return p;if(p===null||G(p)!=="object"&&typeof p!="function")return{default:p};var E=I();if(E&&E.has(p))return E.get(p);var b={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var c in p)if(Object.prototype.hasOwnProperty.call(p,c)){var o=i?Object.getOwnPropertyDescriptor(p,c):null;o&&(o.get||o.set)?Object.defineProperty(b,c,o):b[c]=p[c]}return b.default=p,E&&E.set(p,b),b}var M={toBase64Table:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".split(""),base64Pad:"=",encode:function(E){"use strict";for(var b="",i=E.length,c=i%3,o=0;o<i-2;o+=3)b+=this.toBase64Table[E[o]>>2],b+=this.toBase64Table[((E[o]&3)<<4)+(E[o+1]>>4)],b+=this.toBase64Table[((E[o+1]&15)<<2)+(E[o+2]>>6)],b+=this.toBase64Table[E[o+2]&63];var h=i-c;return c===2?(b+=this.toBase64Table[E[h]>>2],b+=this.toBase64Table[((E[h]&3)<<4)+(E[h+1]>>4)],b+=this.toBase64Table[(E[h+1]&15)<<2],b+=this.toBase64Table[64]):c===1&&(b+=this.toBase64Table[E[h]>>2],b+=this.toBase64Table[(E[h]&3)<<4],b+=this.toBase64Table[64],b+=this.toBase64Table[64]),b},toBinaryTable:[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,62,-1,-1,-1,63,52,53,54,55,56,57,58,59,60,61,-1,-1,-1,0,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,-1,-1,-1,-1,-1,-1,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,-1,-1,-1,-1,-1],decode:function(E){var b=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,i=E.indexOf("=")-b;i<0&&(i=E.length-b);for(var c=(i>>2)*3+Math.floor(i%4/1.5),o=new Array(c),h=0,n=0,a=0,t=b;t<E.length;t++){var r=this.toBinaryTable[E.charCodeAt(t)&127],s=E.charAt(t)===this.base64Pad;if(r===-1){L.Error("Illegal character code "+E.charCodeAt(t)+" at position "+t);continue}n=n<<6|r,h+=6,h>=8&&(h-=8,s||(o[a++]=n>>h&255),n&=(1<<h)-1)}if(h){var u=new Error("Corrupted base64 string");throw u.name="Base64-Error",u}return o}};ne.default=M},N0LK:function(it,ne,q){"use strict";q.d(ne,"C",function(){return G}),q.d(ne,"v",function(){return I}),q.d(ne,"s",function(){return R}),q.d(ne,"t",function(){return M}),q.d(ne,"U",function(){return p}),q.d(ne,"J",function(){return E}),q.d(ne,"O",function(){return b}),q.d(ne,"p",function(){return i}),q.d(ne,"T",function(){return c}),q.d(ne,"q",function(){return o}),q.d(ne,"N",function(){return h}),q.d(ne,"M",function(){return n}),q.d(ne,"Q",function(){return a}),q.d(ne,"u",function(){return t}),q.d(ne,"x",function(){return r}),q.d(ne,"I",function(){return s}),q.d(ne,"f",function(){return u}),q.d(ne,"h",function(){return d}),q.d(ne,"g",function(){return f}),q.d(ne,"i",function(){return v}),q.d(ne,"G",function(){return m}),q.d(ne,"H",function(){return S}),q.d(ne,"r",function(){return C}),q.d(ne,"R",function(){return _}),q.d(ne,"d",function(){return y}),q.d(ne,"e",function(){return T}),q.d(ne,"E",function(){return O}),q.d(ne,"F",function(){return g}),q.d(ne,"j",function(){return F}),q.d(ne,"z",function(){return P}),q.d(ne,"K",function(){return X}),q.d(ne,"L",function(){return j}),q.d(ne,"m",function(){return K}),q.d(ne,"k",function(){return k}),q.d(ne,"A",function(){return te}),q.d(ne,"a",function(){return de}),q.d(ne,"n",function(){return be}),q.d(ne,"l",function(){return We}),q.d(ne,"D",function(){return Ne}),q.d(ne,"B",function(){return Le}),q.d(ne,"b",function(){return Ke}),q.d(ne,"S",function(){return He}),q.d(ne,"o",function(){return Ae}),q.d(ne,"P",function(){return Se}),q.d(ne,"w",function(){return he}),q.d(ne,"c",function(){return Ie}),q.d(ne,"y",function(){return $e});function G(fe){return!fe||typeof fe!="string"?!0:fe.trim().length===0}const L=/{(\d+)}/g;function I(fe,...ge){return ge.length===0?fe:fe.replace(L,function(xe,we){const Te=parseInt(we,10);return isNaN(Te)||Te<0||Te>=ge.length?xe:ge[Te]})}function R(fe){return fe.replace(/[<>&]/g,function(ge){switch(ge){case"<":return"<";case">":return">";case"&":return"&";default:return ge}})}function M(fe){return fe.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}function p(fe,ge=" "){const xe=E(fe,ge);return b(xe,ge)}function E(fe,ge){if(!fe||!ge)return fe;const xe=ge.length;if(xe===0||fe.length===0)return fe;let we=0;for(;fe.indexOf(ge,we)===we;)we=we+xe;return fe.substring(we)}function b(fe,ge){if(!fe||!ge)return fe;const xe=ge.length,we=fe.length;if(xe===0||we===0)return fe;let Te=we,re=-1;for(;!(re=fe.lastIndexOf(ge,Te-1),re===-1||re+xe!==Te);){if(re===0)return"";Te=re}return fe.substring(0,Te)}function i(fe){return fe.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*")}function c(fe){return fe.replace(/\*/g,"")}function o(fe,ge,xe={}){if(!fe)throw new Error("Cannot create regex from empty string");ge||(fe=M(fe)),xe.wholeWord&&(/\B/.test(fe.charAt(0))||(fe="\\b"+fe),/\B/.test(fe.charAt(fe.length-1))||(fe=fe+"\\b"));let we="";return xe.global&&(we+="g"),xe.matchCase||(we+="i"),xe.multiline&&(we+="m"),xe.unicode&&(we+="u"),new RegExp(fe,we)}function h(fe){if(fe.source==="^"||fe.source==="^$"||fe.source==="$"||fe.source==="^\\s*$")return!1;const ge=fe.exec("");return!!(ge&&fe.lastIndex===0)}function n(fe){return(fe.global?"g":"")+(fe.ignoreCase?"i":"")+(fe.multiline?"m":"")+(fe.unicode?"u":"")}function a(fe){return fe.split(/\r\n|\r|\n/)}function t(fe){for(let ge=0,xe=fe.length;ge<xe;ge++){const we=fe.charCodeAt(ge);if(we!==32&&we!==9)return ge}return-1}function r(fe,ge=0,xe=fe.length){for(let we=ge;we<xe;we++){const Te=fe.charCodeAt(we);if(Te!==32&&Te!==9)return fe.substring(ge,we)}return fe.substring(ge,xe)}function s(fe,ge=fe.length-1){for(let xe=ge;xe>=0;xe--){const we=fe.charCodeAt(xe);if(we!==32&&we!==9)return xe}return-1}function u(fe,ge){return fe<ge?-1:fe>ge?1:0}function d(fe,ge,xe=0,we=fe.length,Te=0,re=ge.length){for(;xe<we&&Te<re;xe++,Te++){let Me=fe.charCodeAt(xe),Ye=ge.charCodeAt(Te);if(Me<Ye)return-1;if(Me>Ye)return 1}const ve=we-xe,ae=re-Te;return ve<ae?-1:ve>ae?1:0}function f(fe,ge){return v(fe,ge,0,fe.length,0,ge.length)}function v(fe,ge,xe=0,we=fe.length,Te=0,re=ge.length){for(;xe<we&&Te<re;xe++,Te++){let Me=fe.charCodeAt(xe),Ye=ge.charCodeAt(Te);if(Me===Ye)continue;if(Me>=128||Ye>=128)return d(fe.toLowerCase(),ge.toLowerCase(),xe,we,Te,re);m(Me)&&(Me-=32),m(Ye)&&(Ye-=32);const et=Me-Ye;if(et===0)continue;return et}const ve=we-xe,ae=re-Te;return ve<ae?-1:ve>ae?1:0}function m(fe){return fe>=97&&fe<=122}function S(fe){return fe>=65&&fe<=90}function C(fe,ge){return fe.length===ge.length&&v(fe,ge)===0}function _(fe,ge){const xe=ge.length;return ge.length>fe.length?!1:v(fe,ge,0,xe)===0}function y(fe,ge){let xe,we=Math.min(fe.length,ge.length);for(xe=0;xe<we;xe++)if(fe.charCodeAt(xe)!==ge.charCodeAt(xe))return xe;return we}function T(fe,ge){let xe,we=Math.min(fe.length,ge.length);const Te=fe.length-1,re=ge.length-1;for(xe=0;xe<we;xe++)if(fe.charCodeAt(Te-xe)!==ge.charCodeAt(re-xe))return xe;return we}function O(fe){return 55296<=fe&&fe<=56319}function g(fe){return 56320<=fe&&fe<=57343}function F(fe,ge){return(fe-55296<<10)+(ge-56320)+65536}function P(fe,ge,xe){const we=fe.charCodeAt(xe);if(O(we)&&xe+1<ge){const Te=fe.charCodeAt(xe+1);if(g(Te))return F(we,Te)}return we}function N(fe,ge){const xe=fe.charCodeAt(ge-1);if(g(xe)&&ge>1){const we=fe.charCodeAt(ge-2);if(O(we))return F(we,xe)}return xe}function X(fe,ge){const xe=ye.getInstance(),we=ge,Te=fe.length,re=P(fe,Te,ge);ge+=re>=65536?2:1;let ve=xe.getGraphemeBreakType(re);for(;ge<Te;){const ae=P(fe,Te,ge),Me=xe.getGraphemeBreakType(ae);if(Ie(ve,Me))break;ge+=ae>=65536?2:1,ve=Me}return ge-we}function j(fe,ge){const xe=ye.getInstance(),we=ge,Te=N(fe,ge);ge-=Te>=65536?2:1;let re=xe.getGraphemeBreakType(Te);for(;ge>0;){const ve=N(fe,ge),ae=xe.getGraphemeBreakType(ve);if(Ie(ae,re))break;ge-=ve>=65536?2:1,re=ae}return we-ge}const A=/(?:[\u05BE\u05C0\u05C3\u05C6\u05D0-\u05F4\u0608\u060B\u060D\u061B-\u064A\u066D-\u066F\u0671-\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u0710\u0712-\u072F\u074D-\u07A5\u07B1-\u07EA\u07F4\u07F5\u07FA-\u0815\u081A\u0824\u0828\u0830-\u0858\u085E-\u08BD\u200F\uFB1D\uFB1F-\uFB28\uFB2A-\uFD3D\uFD50-\uFDFC\uFE70-\uFEFC]|\uD802[\uDC00-\uDD1B\uDD20-\uDE00\uDE10-\uDE33\uDE40-\uDEE4\uDEEB-\uDF35\uDF40-\uDFFF]|\uD803[\uDC00-\uDCFF]|\uD83A[\uDC00-\uDCCF\uDD00-\uDD43\uDD50-\uDFFF]|\uD83B[\uDC00-\uDEBB])/;function K(fe){return A.test(fe)}const U=/(?:[\u231A\u231B\u23F0\u23F3\u2600-\u27BF\u2B50\u2B55]|\uD83C[\uDDE6-\uDDFF\uDF00-\uDFFF]|\uD83D[\uDC00-\uDE4F\uDE80-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD00-\uDDFF\uDE70-\uDED6])/;function k(fe){return U.test(fe)}const z=/^[\t\n\r\x20-\x7E]*$/;function te(fe){return z.test(fe)}const de=/[\u2028\u2029]/;function be(fe){return de.test(fe)}function We(fe){for(let ge=0,xe=fe.length;ge<xe;ge++)if(Ne(fe.charCodeAt(ge)))return!0;return!1}function Ne(fe){return fe=+fe,fe>=11904&&fe<=55215||fe>=63744&&fe<=64255||fe>=65281&&fe<=65374}function Le(fe){return fe>=127462&&fe<=127487||fe===8986||fe===8987||fe===9200||fe===9203||fe>=9728&&fe<=10175||fe===11088||fe===11093||fe>=127744&&fe<=128591||fe>=128640&&fe<=128764||fe>=128992&&fe<=129003||fe>=129280&&fe<=129535||fe>=129648&&fe<=129750}const Ke=String.fromCharCode(65279);function He(fe){return!!(fe&&fe.length>0&&fe.charCodeAt(0)===65279)}function Ae(fe,ge=!1){return fe?(ge&&(fe=fe.replace(/\\./g,"")),fe.toLowerCase()!==fe):!1}function Se(fe){const ge=90-65+1;return fe=fe%(2*ge),fe<ge?String.fromCharCode(97+fe):String.fromCharCode(65+fe-ge)}function he(fe){const ge=ye.getInstance();return ge.getGraphemeBreakType(fe)}function Ie(fe,ge){return fe===0?ge!==5&&ge!==7:fe===2&&ge===3?!1:fe===4||fe===2||fe===3||(ge===4||ge===2||ge===3)?!0:fe===8&&(ge===8||ge===9||ge===11||ge===12)||((fe===11||fe===9)&&(ge===9||ge===10)||((fe===12||fe===10)&&ge===10||(ge===5||ge===13||(ge===7||(fe===1||fe===13&&ge===14)))))?!1:!(fe===6&&ge===6)}class ye{constructor(){this._data=Ge()}static getInstance(){return ye._INSTANCE||(ye._INSTANCE=new ye),ye._INSTANCE}getGraphemeBreakType(fe){if(fe<32)return fe===10?3:fe===13?2:4;if(fe<127)return 0;const ge=this._data,xe=ge.length/3;let we=1;for(;we<=xe;)if(fe<ge[3*we])we=2*we;else if(fe>ge[3*we+1])we=2*we+1;else return ge[3*we+2];return 0}}ye._INSTANCE=null;function Ge(){return JSON.parse("[0,0,0,51592,51592,11,44424,44424,11,72251,72254,5,7150,7150,7,48008,48008,11,55176,55176,11,128420,128420,14,3276,3277,5,9979,9980,14,46216,46216,11,49800,49800,11,53384,53384,11,70726,70726,5,122915,122916,5,129320,129327,14,2558,2558,5,5906,5908,5,9762,9763,14,43360,43388,8,45320,45320,11,47112,47112,11,48904,48904,11,50696,50696,11,52488,52488,11,54280,54280,11,70082,70083,1,71350,71350,7,73111,73111,5,127892,127893,14,128726,128727,14,129473,129474,14,2027,2035,5,2901,2902,5,3784,3789,5,6754,6754,5,8418,8420,5,9877,9877,14,11088,11088,14,44008,44008,5,44872,44872,11,45768,45768,11,46664,46664,11,47560,47560,11,48456,48456,11,49352,49352,11,50248,50248,11,51144,51144,11,52040,52040,11,52936,52936,11,53832,53832,11,54728,54728,11,69811,69814,5,70459,70460,5,71096,71099,7,71998,71998,5,72874,72880,5,119149,119149,7,127374,127374,14,128335,128335,14,128482,128482,14,128765,128767,14,129399,129400,14,129680,129685,14,1476,1477,5,2377,2380,7,2759,2760,5,3137,3140,7,3458,3459,7,4153,4154,5,6432,6434,5,6978,6978,5,7675,7679,5,9723,9726,14,9823,9823,14,9919,9923,14,10035,10036,14,42736,42737,5,43596,43596,5,44200,44200,11,44648,44648,11,45096,45096,11,45544,45544,11,45992,45992,11,46440,46440,11,46888,46888,11,47336,47336,11,47784,47784,11,48232,48232,11,48680,48680,11,49128,49128,11,49576,49576,11,50024,50024,11,50472,50472,11,50920,50920,11,51368,51368,11,51816,51816,11,52264,52264,11,52712,52712,11,53160,53160,11,53608,53608,11,54056,54056,11,54504,54504,11,54952,54952,11,68108,68111,5,69933,69940,5,70197,70197,7,70498,70499,7,70845,70845,5,71229,71229,5,71727,71735,5,72154,72155,5,72344,72345,5,73023,73029,5,94095,94098,5,121403,121452,5,126981,127182,14,127538,127546,14,127990,127990,14,128391,128391,14,128445,128449,14,128500,128505,14,128752,128752,14,129160,129167,14,129356,129356,14,129432,129442,14,129648,129651,14,129751,131069,14,173,173,4,1757,1757,1,2274,2274,1,2494,2494,5,2641,2641,5,2876,2876,5,3014,3016,7,3262,3262,7,3393,3396,5,3570,3571,7,3968,3972,5,4228,4228,7,6086,6086,5,6679,6680,5,6912,6915,5,7080,7081,5,7380,7392,5,8252,8252,14,9096,9096,14,9748,9749,14,9784,9786,14,9833,9850,14,9890,9894,14,9938,9938,14,9999,9999,14,10085,10087,14,12349,12349,14,43136,43137,7,43454,43456,7,43755,43755,7,44088,44088,11,44312,44312,11,44536,44536,11,44760,44760,11,44984,44984,11,45208,45208,11,45432,45432,11,45656,45656,11,45880,45880,11,46104,46104,11,46328,46328,11,46552,46552,11,46776,46776,11,47000,47000,11,47224,47224,11,47448,47448,11,47672,47672,11,47896,47896,11,48120,48120,11,48344,48344,11,48568,48568,11,48792,48792,11,49016,49016,11,49240,49240,11,49464,49464,11,49688,49688,11,49912,49912,11,50136,50136,11,50360,50360,11,50584,50584,11,50808,50808,11,51032,51032,11,51256,51256,11,51480,51480,11,51704,51704,11,51928,51928,11,52152,52152,11,52376,52376,11,52600,52600,11,52824,52824,11,53048,53048,11,53272,53272,11,53496,53496,11,53720,53720,11,53944,53944,11,54168,54168,11,54392,54392,11,54616,54616,11,54840,54840,11,55064,55064,11,65438,65439,5,69633,69633,5,69837,69837,1,70018,70018,7,70188,70190,7,70368,70370,7,70465,70468,7,70712,70719,5,70835,70840,5,70850,70851,5,71132,71133,5,71340,71340,7,71458,71461,5,71985,71989,7,72002,72002,7,72193,72202,5,72281,72283,5,72766,72766,7,72885,72886,5,73104,73105,5,92912,92916,5,113824,113827,4,119173,119179,5,121505,121519,5,125136,125142,5,127279,127279,14,127489,127490,14,127570,127743,14,127900,127901,14,128254,128254,14,128369,128370,14,128400,128400,14,128425,128432,14,128468,128475,14,128489,128494,14,128715,128720,14,128745,128745,14,128759,128760,14,129004,129023,14,129296,129304,14,129340,129342,14,129388,129392,14,129404,129407,14,129454,129455,14,129485,129487,14,129659,129663,14,129719,129727,14,917536,917631,5,13,13,2,1160,1161,5,1564,1564,4,1807,1807,1,2085,2087,5,2363,2363,7,2402,2403,5,2507,2508,7,2622,2624,7,2691,2691,7,2786,2787,5,2881,2884,5,3006,3006,5,3072,3072,5,3170,3171,5,3267,3268,7,3330,3331,7,3406,3406,1,3538,3540,5,3655,3662,5,3897,3897,5,4038,4038,5,4184,4185,5,4352,4447,8,6068,6069,5,6155,6157,5,6448,6449,7,6742,6742,5,6783,6783,5,6966,6970,5,7042,7042,7,7143,7143,7,7212,7219,5,7412,7412,5,8206,8207,4,8294,8303,4,8596,8601,14,9410,9410,14,9742,9742,14,9757,9757,14,9770,9770,14,9794,9794,14,9828,9828,14,9855,9855,14,9882,9882,14,9900,9903,14,9929,9933,14,9963,9967,14,9987,9988,14,10006,10006,14,10062,10062,14,10175,10175,14,11744,11775,5,42607,42607,5,43043,43044,7,43263,43263,5,43444,43445,7,43569,43570,5,43698,43700,5,43766,43766,5,44032,44032,11,44144,44144,11,44256,44256,11,44368,44368,11,44480,44480,11,44592,44592,11,44704,44704,11,44816,44816,11,44928,44928,11,45040,45040,11,45152,45152,11,45264,45264,11,45376,45376,11,45488,45488,11,45600,45600,11,45712,45712,11,45824,45824,11,45936,45936,11,46048,46048,11,46160,46160,11,46272,46272,11,46384,46384,11,46496,46496,11,46608,46608,11,46720,46720,11,46832,46832,11,46944,46944,11,47056,47056,11,47168,47168,11,47280,47280,11,47392,47392,11,47504,47504,11,47616,47616,11,47728,47728,11,47840,47840,11,47952,47952,11,48064,48064,11,48176,48176,11,48288,48288,11,48400,48400,11,48512,48512,11,48624,48624,11,48736,48736,11,48848,48848,11,48960,48960,11,49072,49072,11,49184,49184,11,49296,49296,11,49408,49408,11,49520,49520,11,49632,49632,11,49744,49744,11,49856,49856,11,49968,49968,11,50080,50080,11,50192,50192,11,50304,50304,11,50416,50416,11,50528,50528,11,50640,50640,11,50752,50752,11,50864,50864,11,50976,50976,11,51088,51088,11,51200,51200,11,51312,51312,11,51424,51424,11,51536,51536,11,51648,51648,11,51760,51760,11,51872,51872,11,51984,51984,11,52096,52096,11,52208,52208,11,52320,52320,11,52432,52432,11,52544,52544,11,52656,52656,11,52768,52768,11,52880,52880,11,52992,52992,11,53104,53104,11,53216,53216,11,53328,53328,11,53440,53440,11,53552,53552,11,53664,53664,11,53776,53776,11,53888,53888,11,54000,54000,11,54112,54112,11,54224,54224,11,54336,54336,11,54448,54448,11,54560,54560,11,54672,54672,11,54784,54784,11,54896,54896,11,55008,55008,11,55120,55120,11,64286,64286,5,66272,66272,5,68900,68903,5,69762,69762,7,69817,69818,5,69927,69931,5,70003,70003,5,70070,70078,5,70094,70094,7,70194,70195,7,70206,70206,5,70400,70401,5,70463,70463,7,70475,70477,7,70512,70516,5,70722,70724,5,70832,70832,5,70842,70842,5,70847,70848,5,71088,71089,7,71102,71102,7,71219,71226,5,71231,71232,5,71342,71343,7,71453,71455,5,71463,71467,5,71737,71738,5,71995,71996,5,72000,72000,7,72145,72147,7,72160,72160,5,72249,72249,7,72273,72278,5,72330,72342,5,72752,72758,5,72850,72871,5,72882,72883,5,73018,73018,5,73031,73031,5,73109,73109,5,73461,73462,7,94031,94031,5,94192,94193,7,119142,119142,7,119155,119162,4,119362,119364,5,121476,121476,5,122888,122904,5,123184,123190,5,126976,126979,14,127184,127231,14,127344,127345,14,127405,127461,14,127514,127514,14,127561,127567,14,127778,127779,14,127896,127896,14,127985,127986,14,127995,127999,5,128326,128328,14,128360,128366,14,128378,128378,14,128394,128397,14,128405,128406,14,128422,128423,14,128435,128443,14,128453,128464,14,128479,128480,14,128484,128487,14,128496,128498,14,128640,128709,14,128723,128724,14,128736,128741,14,128747,128748,14,128755,128755,14,128762,128762,14,128981,128991,14,129096,129103,14,129292,129292,14,129311,129311,14,129329,129330,14,129344,129349,14,129360,129374,14,129394,129394,14,129402,129402,14,129413,129425,14,129445,129450,14,129466,129471,14,129483,129483,14,129511,129535,14,129653,129655,14,129667,129670,14,129705,129711,14,129731,129743,14,917505,917505,4,917760,917999,5,10,10,3,127,159,4,768,879,5,1471,1471,5,1536,1541,1,1648,1648,5,1767,1768,5,1840,1866,5,2070,2073,5,2137,2139,5,2307,2307,7,2366,2368,7,2382,2383,7,2434,2435,7,2497,2500,5,2519,2519,5,2563,2563,7,2631,2632,5,2677,2677,5,2750,2752,7,2763,2764,7,2817,2817,5,2879,2879,5,2891,2892,7,2914,2915,5,3008,3008,5,3021,3021,5,3076,3076,5,3146,3149,5,3202,3203,7,3264,3265,7,3271,3272,7,3298,3299,5,3390,3390,5,3402,3404,7,3426,3427,5,3535,3535,5,3544,3550,7,3635,3635,7,3763,3763,7,3893,3893,5,3953,3966,5,3981,3991,5,4145,4145,7,4157,4158,5,4209,4212,5,4237,4237,5,4520,4607,10,5970,5971,5,6071,6077,5,6089,6099,5,6277,6278,5,6439,6440,5,6451,6456,7,6683,6683,5,6744,6750,5,6765,6770,7,6846,6846,5,6964,6964,5,6972,6972,5,7019,7027,5,7074,7077,5,7083,7085,5,7146,7148,7,7154,7155,7,7222,7223,5,7394,7400,5,7416,7417,5,8204,8204,5,8233,8233,4,8288,8292,4,8413,8416,5,8482,8482,14,8986,8987,14,9193,9203,14,9654,9654,14,9733,9733,14,9745,9745,14,9752,9752,14,9760,9760,14,9766,9766,14,9774,9775,14,9792,9792,14,9800,9811,14,9825,9826,14,9831,9831,14,9852,9853,14,9872,9873,14,9880,9880,14,9885,9887,14,9896,9897,14,9906,9916,14,9926,9927,14,9936,9936,14,9941,9960,14,9974,9974,14,9982,9985,14,9992,9997,14,10002,10002,14,10017,10017,14,10055,10055,14,10071,10071,14,10145,10145,14,11013,11015,14,11503,11505,5,12334,12335,5,12951,12951,14,42612,42621,5,43014,43014,5,43047,43047,7,43204,43205,5,43335,43345,5,43395,43395,7,43450,43451,7,43561,43566,5,43573,43574,5,43644,43644,5,43710,43711,5,43758,43759,7,44005,44005,5,44012,44012,7,44060,44060,11,44116,44116,11,44172,44172,11,44228,44228,11,44284,44284,11,44340,44340,11,44396,44396,11,44452,44452,11,44508,44508,11,44564,44564,11,44620,44620,11,44676,44676,11,44732,44732,11,44788,44788,11,44844,44844,11,44900,44900,11,44956,44956,11,45012,45012,11,45068,45068,11,45124,45124,11,45180,45180,11,45236,45236,11,45292,45292,11,45348,45348,11,45404,45404,11,45460,45460,11,45516,45516,11,45572,45572,11,45628,45628,11,45684,45684,11,45740,45740,11,45796,45796,11,45852,45852,11,45908,45908,11,45964,45964,11,46020,46020,11,46076,46076,11,46132,46132,11,46188,46188,11,46244,46244,11,46300,46300,11,46356,46356,11,46412,46412,11,46468,46468,11,46524,46524,11,46580,46580,11,46636,46636,11,46692,46692,11,46748,46748,11,46804,46804,11,46860,46860,11,46916,46916,11,46972,46972,11,47028,47028,11,47084,47084,11,47140,47140,11,47196,47196,11,47252,47252,11,47308,47308,11,47364,47364,11,47420,47420,11,47476,47476,11,47532,47532,11,47588,47588,11,47644,47644,11,47700,47700,11,47756,47756,11,47812,47812,11,47868,47868,11,47924,47924,11,47980,47980,11,48036,48036,11,48092,48092,11,48148,48148,11,48204,48204,11,48260,48260,11,48316,48316,11,48372,48372,11,48428,48428,11,48484,48484,11,48540,48540,11,48596,48596,11,48652,48652,11,48708,48708,11,48764,48764,11,48820,48820,11,48876,48876,11,48932,48932,11,48988,48988,11,49044,49044,11,49100,49100,11,49156,49156,11,49212,49212,11,49268,49268,11,49324,49324,11,49380,49380,11,49436,49436,11,49492,49492,11,49548,49548,11,49604,49604,11,49660,49660,11,49716,49716,11,49772,49772,11,49828,49828,11,49884,49884,11,49940,49940,11,49996,49996,11,50052,50052,11,50108,50108,11,50164,50164,11,50220,50220,11,50276,50276,11,50332,50332,11,50388,50388,11,50444,50444,11,50500,50500,11,50556,50556,11,50612,50612,11,50668,50668,11,50724,50724,11,50780,50780,11,50836,50836,11,50892,50892,11,50948,50948,11,51004,51004,11,51060,51060,11,51116,51116,11,51172,51172,11,51228,51228,11,51284,51284,11,51340,51340,11,51396,51396,11,51452,51452,11,51508,51508,11,51564,51564,11,51620,51620,11,51676,51676,11,51732,51732,11,51788,51788,11,51844,51844,11,51900,51900,11,51956,51956,11,52012,52012,11,52068,52068,11,52124,52124,11,52180,52180,11,52236,52236,11,52292,52292,11,52348,52348,11,52404,52404,11,52460,52460,11,52516,52516,11,52572,52572,11,52628,52628,11,52684,52684,11,52740,52740,11,52796,52796,11,52852,52852,11,52908,52908,11,52964,52964,11,53020,53020,11,53076,53076,11,53132,53132,11,53188,53188,11,53244,53244,11,53300,53300,11,53356,53356,11,53412,53412,11,53468,53468,11,53524,53524,11,53580,53580,11,53636,53636,11,53692,53692,11,53748,53748,11,53804,53804,11,53860,53860,11,53916,53916,11,53972,53972,11,54028,54028,11,54084,54084,11,54140,54140,11,54196,54196,11,54252,54252,11,54308,54308,11,54364,54364,11,54420,54420,11,54476,54476,11,54532,54532,11,54588,54588,11,54644,54644,11,54700,54700,11,54756,54756,11,54812,54812,11,54868,54868,11,54924,54924,11,54980,54980,11,55036,55036,11,55092,55092,11,55148,55148,11,55216,55238,9,65056,65071,5,65529,65531,4,68097,68099,5,68159,68159,5,69446,69456,5,69688,69702,5,69808,69810,7,69815,69816,7,69821,69821,1,69888,69890,5,69932,69932,7,69957,69958,7,70016,70017,5,70067,70069,7,70079,70080,7,70089,70092,5,70095,70095,5,70191,70193,5,70196,70196,5,70198,70199,5,70367,70367,5,70371,70378,5,70402,70403,7,70462,70462,5,70464,70464,5,70471,70472,7,70487,70487,5,70502,70508,5,70709,70711,7,70720,70721,7,70725,70725,7,70750,70750,5,70833,70834,7,70841,70841,7,70843,70844,7,70846,70846,7,70849,70849,7,71087,71087,5,71090,71093,5,71100,71101,5,71103,71104,5,71216,71218,7,71227,71228,7,71230,71230,7,71339,71339,5,71341,71341,5,71344,71349,5,71351,71351,5,71456,71457,7,71462,71462,7,71724,71726,7,71736,71736,7,71984,71984,5,71991,71992,7,71997,71997,7,71999,71999,1,72001,72001,1,72003,72003,5,72148,72151,5,72156,72159,7,72164,72164,7,72243,72248,5,72250,72250,1,72263,72263,5,72279,72280,7,72324,72329,1,72343,72343,7,72751,72751,7,72760,72765,5,72767,72767,5,72873,72873,7,72881,72881,7,72884,72884,7,73009,73014,5,73020,73021,5,73030,73030,1,73098,73102,7,73107,73108,7,73110,73110,7,73459,73460,5,78896,78904,4,92976,92982,5,94033,94087,7,94180,94180,5,113821,113822,5,119141,119141,5,119143,119145,5,119150,119154,5,119163,119170,5,119210,119213,5,121344,121398,5,121461,121461,5,121499,121503,5,122880,122886,5,122907,122913,5,122918,122922,5,123628,123631,5,125252,125258,5,126980,126980,14,127183,127183,14,127245,127247,14,127340,127343,14,127358,127359,14,127377,127386,14,127462,127487,6,127491,127503,14,127535,127535,14,127548,127551,14,127568,127569,14,127744,127777,14,127780,127891,14,127894,127895,14,127897,127899,14,127902,127984,14,127987,127989,14,127991,127994,14,128000,128253,14,128255,128317,14,128329,128334,14,128336,128359,14,128367,128368,14,128371,128377,14,128379,128390,14,128392,128393,14,128398,128399,14,128401,128404,14,128407,128419,14,128421,128421,14,128424,128424,14,128433,128434,14,128444,128444,14,128450,128452,14,128465,128467,14,128476,128478,14,128481,128481,14,128483,128483,14,128488,128488,14,128495,128495,14,128499,128499,14,128506,128591,14,128710,128714,14,128721,128722,14,128725,128725,14,128728,128735,14,128742,128744,14,128746,128746,14,128749,128751,14,128753,128754,14,128756,128758,14,128761,128761,14,128763,128764,14,128884,128895,14,128992,129003,14,129036,129039,14,129114,129119,14,129198,129279,14,129293,129295,14,129305,129310,14,129312,129319,14,129328,129328,14,129331,129338,14,129343,129343,14,129351,129355,14,129357,129359,14,129375,129387,14,129393,129393,14,129395,129398,14,129401,129401,14,129403,129403,14,129408,129412,14,129426,129431,14,129443,129444,14,129451,129453,14,129456,129465,14,129472,129472,14,129475,129482,14,129484,129484,14,129488,129510,14,129536,129647,14,129652,129652,14,129656,129658,14,129664,129666,14,129671,129679,14,129686,129704,14,129712,129718,14,129728,129730,14,129744,129750,14,917504,917504,4,917506,917535,4,917632,917759,4,918000,921599,4,0,9,4,11,12,4,14,31,4,169,169,14,174,174,14,1155,1159,5,1425,1469,5,1473,1474,5,1479,1479,5,1552,1562,5,1611,1631,5,1750,1756,5,1759,1764,5,1770,1773,5,1809,1809,5,1958,1968,5,2045,2045,5,2075,2083,5,2089,2093,5,2259,2273,5,2275,2306,5,2362,2362,5,2364,2364,5,2369,2376,5,2381,2381,5,2385,2391,5,2433,2433,5,2492,2492,5,2495,2496,7,2503,2504,7,2509,2509,5,2530,2531,5,2561,2562,5,2620,2620,5,2625,2626,5,2635,2637,5,2672,2673,5,2689,2690,5,2748,2748,5,2753,2757,5,2761,2761,7,2765,2765,5,2810,2815,5,2818,2819,7,2878,2878,5,2880,2880,7,2887,2888,7,2893,2893,5,2903,2903,5,2946,2946,5,3007,3007,7,3009,3010,7,3018,3020,7,3031,3031,5,3073,3075,7,3134,3136,5,3142,3144,5,3157,3158,5,3201,3201,5,3260,3260,5,3263,3263,5,3266,3266,5,3270,3270,5,3274,3275,7,3285,3286,5,3328,3329,5,3387,3388,5,3391,3392,7,3398,3400,7,3405,3405,5,3415,3415,5,3457,3457,5,3530,3530,5,3536,3537,7,3542,3542,5,3551,3551,5,3633,3633,5,3636,3642,5,3761,3761,5,3764,3772,5,3864,3865,5,3895,3895,5,3902,3903,7,3967,3967,7,3974,3975,5,3993,4028,5,4141,4144,5,4146,4151,5,4155,4156,7,4182,4183,7,4190,4192,5,4226,4226,5,4229,4230,5,4253,4253,5,4448,4519,9,4957,4959,5,5938,5940,5,6002,6003,5,6070,6070,7,6078,6085,7,6087,6088,7,6109,6109,5,6158,6158,4,6313,6313,5,6435,6438,7,6441,6443,7,6450,6450,5,6457,6459,5,6681,6682,7,6741,6741,7,6743,6743,7,6752,6752,5,6757,6764,5,6771,6780,5,6832,6845,5,6847,6848,5,6916,6916,7,6965,6965,5,6971,6971,7,6973,6977,7,6979,6980,7,7040,7041,5,7073,7073,7,7078,7079,7,7082,7082,7,7142,7142,5,7144,7145,5,7149,7149,5,7151,7153,5,7204,7211,7,7220,7221,7,7376,7378,5,7393,7393,7,7405,7405,5,7415,7415,7,7616,7673,5,8203,8203,4,8205,8205,13,8232,8232,4,8234,8238,4,8265,8265,14,8293,8293,4,8400,8412,5,8417,8417,5,8421,8432,5,8505,8505,14,8617,8618,14,9000,9000,14,9167,9167,14,9208,9210,14,9642,9643,14,9664,9664,14,9728,9732,14,9735,9741,14,9743,9744,14,9746,9746,14,9750,9751,14,9753,9756,14,9758,9759,14,9761,9761,14,9764,9765,14,9767,9769,14,9771,9773,14,9776,9783,14,9787,9791,14,9793,9793,14,9795,9799,14,9812,9822,14,9824,9824,14,9827,9827,14,9829,9830,14,9832,9832,14,9851,9851,14,9854,9854,14,9856,9861,14,9874,9876,14,9878,9879,14,9881,9881,14,9883,9884,14,9888,9889,14,9895,9895,14,9898,9899,14,9904,9905,14,9917,9918,14,9924,9925,14,9928,9928,14,9934,9935,14,9937,9937,14,9939,9940,14,9961,9962,14,9968,9973,14,9975,9978,14,9981,9981,14,9986,9986,14,9989,9989,14,9998,9998,14,10000,10001,14,10004,10004,14,10013,10013,14,10024,10024,14,10052,10052,14,10060,10060,14,10067,10069,14,10083,10084,14,10133,10135,14,10160,10160,14,10548,10549,14,11035,11036,14,11093,11093,14,11647,11647,5,12330,12333,5,12336,12336,14,12441,12442,5,12953,12953,14,42608,42610,5,42654,42655,5,43010,43010,5,43019,43019,5,43045,43046,5,43052,43052,5,43188,43203,7,43232,43249,5,43302,43309,5,43346,43347,7,43392,43394,5,43443,43443,5,43446,43449,5,43452,43453,5,43493,43493,5,43567,43568,7,43571,43572,7,43587,43587,5,43597,43597,7,43696,43696,5,43703,43704,5,43713,43713,5,43756,43757,5,43765,43765,7,44003,44004,7,44006,44007,7,44009,44010,7,44013,44013,5,44033,44059,12,44061,44087,12,44089,44115,12,44117,44143,12,44145,44171,12,44173,44199,12,44201,44227,12,44229,44255,12,44257,44283,12,44285,44311,12,44313,44339,12,44341,44367,12,44369,44395,12,44397,44423,12,44425,44451,12,44453,44479,12,44481,44507,12,44509,44535,12,44537,44563,12,44565,44591,12,44593,44619,12,44621,44647,12,44649,44675,12,44677,44703,12,44705,44731,12,44733,44759,12,44761,44787,12,44789,44815,12,44817,44843,12,44845,44871,12,44873,44899,12,44901,44927,12,44929,44955,12,44957,44983,12,44985,45011,12,45013,45039,12,45041,45067,12,45069,45095,12,45097,45123,12,45125,45151,12,45153,45179,12,45181,45207,12,45209,45235,12,45237,45263,12,45265,45291,12,45293,45319,12,45321,45347,12,45349,45375,12,45377,45403,12,45405,45431,12,45433,45459,12,45461,45487,12,45489,45515,12,45517,45543,12,45545,45571,12,45573,45599,12,45601,45627,12,45629,45655,12,45657,45683,12,45685,45711,12,45713,45739,12,45741,45767,12,45769,45795,12,45797,45823,12,45825,45851,12,45853,45879,12,45881,45907,12,45909,45935,12,45937,45963,12,45965,45991,12,45993,46019,12,46021,46047,12,46049,46075,12,46077,46103,12,46105,46131,12,46133,46159,12,46161,46187,12,46189,46215,12,46217,46243,12,46245,46271,12,46273,46299,12,46301,46327,12,46329,46355,12,46357,46383,12,46385,46411,12,46413,46439,12,46441,46467,12,46469,46495,12,46497,46523,12,46525,46551,12,46553,46579,12,46581,46607,12,46609,46635,12,46637,46663,12,46665,46691,12,46693,46719,12,46721,46747,12,46749,46775,12,46777,46803,12,46805,46831,12,46833,46859,12,46861,46887,12,46889,46915,12,46917,46943,12,46945,46971,12,46973,46999,12,47001,47027,12,47029,47055,12,47057,47083,12,47085,47111,12,47113,47139,12,47141,47167,12,47169,47195,12,47197,47223,12,47225,47251,12,47253,47279,12,47281,47307,12,47309,47335,12,47337,47363,12,47365,47391,12,47393,47419,12,47421,47447,12,47449,47475,12,47477,47503,12,47505,47531,12,47533,47559,12,47561,47587,12,47589,47615,12,47617,47643,12,47645,47671,12,47673,47699,12,47701,47727,12,47729,47755,12,47757,47783,12,47785,47811,12,47813,47839,12,47841,47867,12,47869,47895,12,47897,47923,12,47925,47951,12,47953,47979,12,47981,48007,12,48009,48035,12,48037,48063,12,48065,48091,12,48093,48119,12,48121,48147,12,48149,48175,12,48177,48203,12,48205,48231,12,48233,48259,12,48261,48287,12,48289,48315,12,48317,48343,12,48345,48371,12,48373,48399,12,48401,48427,12,48429,48455,12,48457,48483,12,48485,48511,12,48513,48539,12,48541,48567,12,48569,48595,12,48597,48623,12,48625,48651,12,48653,48679,12,48681,48707,12,48709,48735,12,48737,48763,12,48765,48791,12,48793,48819,12,48821,48847,12,48849,48875,12,48877,48903,12,48905,48931,12,48933,48959,12,48961,48987,12,48989,49015,12,49017,49043,12,49045,49071,12,49073,49099,12,49101,49127,12,49129,49155,12,49157,49183,12,49185,49211,12,49213,49239,12,49241,49267,12,49269,49295,12,49297,49323,12,49325,49351,12,49353,49379,12,49381,49407,12,49409,49435,12,49437,49463,12,49465,49491,12,49493,49519,12,49521,49547,12,49549,49575,12,49577,49603,12,49605,49631,12,49633,49659,12,49661,49687,12,49689,49715,12,49717,49743,12,49745,49771,12,49773,49799,12,49801,49827,12,49829,49855,12,49857,49883,12,49885,49911,12,49913,49939,12,49941,49967,12,49969,49995,12,49997,50023,12,50025,50051,12,50053,50079,12,50081,50107,12,50109,50135,12,50137,50163,12,50165,50191,12,50193,50219,12,50221,50247,12,50249,50275,12,50277,50303,12,50305,50331,12,50333,50359,12,50361,50387,12,50389,50415,12,50417,50443,12,50445,50471,12,50473,50499,12,50501,50527,12,50529,50555,12,50557,50583,12,50585,50611,12,50613,50639,12,50641,50667,12,50669,50695,12,50697,50723,12,50725,50751,12,50753,50779,12,50781,50807,12,50809,50835,12,50837,50863,12,50865,50891,12,50893,50919,12,50921,50947,12,50949,50975,12,50977,51003,12,51005,51031,12,51033,51059,12,51061,51087,12,51089,51115,12,51117,51143,12,51145,51171,12,51173,51199,12,51201,51227,12,51229,51255,12,51257,51283,12,51285,51311,12,51313,51339,12,51341,51367,12,51369,51395,12,51397,51423,12,51425,51451,12,51453,51479,12,51481,51507,12,51509,51535,12,51537,51563,12,51565,51591,12,51593,51619,12,51621,51647,12,51649,51675,12,51677,51703,12,51705,51731,12,51733,51759,12,51761,51787,12,51789,51815,12,51817,51843,12,51845,51871,12,51873,51899,12,51901,51927,12,51929,51955,12,51957,51983,12,51985,52011,12,52013,52039,12,52041,52067,12,52069,52095,12,52097,52123,12,52125,52151,12,52153,52179,12,52181,52207,12,52209,52235,12,52237,52263,12,52265,52291,12,52293,52319,12,52321,52347,12,52349,52375,12,52377,52403,12,52405,52431,12,52433,52459,12,52461,52487,12,52489,52515,12,52517,52543,12,52545,52571,12,52573,52599,12,52601,52627,12,52629,52655,12,52657,52683,12,52685,52711,12,52713,52739,12,52741,52767,12,52769,52795,12,52797,52823,12,52825,52851,12,52853,52879,12,52881,52907,12,52909,52935,12,52937,52963,12,52965,52991,12,52993,53019,12,53021,53047,12,53049,53075,12,53077,53103,12,53105,53131,12,53133,53159,12,53161,53187,12,53189,53215,12,53217,53243,12,53245,53271,12,53273,53299,12,53301,53327,12,53329,53355,12,53357,53383,12,53385,53411,12,53413,53439,12,53441,53467,12,53469,53495,12,53497,53523,12,53525,53551,12,53553,53579,12,53581,53607,12,53609,53635,12,53637,53663,12,53665,53691,12,53693,53719,12,53721,53747,12,53749,53775,12,53777,53803,12,53805,53831,12,53833,53859,12,53861,53887,12,53889,53915,12,53917,53943,12,53945,53971,12,53973,53999,12,54001,54027,12,54029,54055,12,54057,54083,12,54085,54111,12,54113,54139,12,54141,54167,12,54169,54195,12,54197,54223,12,54225,54251,12,54253,54279,12,54281,54307,12,54309,54335,12,54337,54363,12,54365,54391,12,54393,54419,12,54421,54447,12,54449,54475,12,54477,54503,12,54505,54531,12,54533,54559,12,54561,54587,12,54589,54615,12,54617,54643,12,54645,54671,12,54673,54699,12,54701,54727,12,54729,54755,12,54757,54783,12,54785,54811,12,54813,54839,12,54841,54867,12,54869,54895,12,54897,54923,12,54925,54951,12,54953,54979,12,54981,55007,12,55009,55035,12,55037,55063,12,55065,55091,12,55093,55119,12,55121,55147,12,55149,55175,12,55177,55203,12,55243,55291,10,65024,65039,5,65279,65279,4,65520,65528,4,66045,66045,5,66422,66426,5,68101,68102,5,68152,68154,5,68325,68326,5,69291,69292,5,69632,69632,7,69634,69634,7,69759,69761,5]")}function $e(fe,ge){if(fe===0)return 0;const xe=ze(fe,ge);if(xe!==void 0)return xe;const we=N(ge,fe);return fe-=Je(we),fe}function ze(fe,ge){let xe=N(ge,fe);for(fe-=Je(xe);Qe(xe)||xe===65039||xe===8419;){if(fe===0)return;xe=N(ge,fe),fe-=Je(xe)}if(!Le(xe))return;if(fe>=0){const we=N(ge,fe);we===8205&&(fe-=Je(we))}return fe}function Je(fe){return fe>=65536?2:1}function Qe(fe){return 127995<=fe&&fe<=127999}},NBmB:function(it,ne,q){"use strict";Object.defineProperty(ne,"__esModule",{value:!0}),ne.encodingName=L,ne.encodings=void 0;var G={encodingRaw:0,encodingCopyRect:1,encodingRRE:2,encodingHextile:5,encodingTight:7,encodingTightPNG:-260,pseudoEncodingQualityLevel9:-23,pseudoEncodingQualityLevel0:-32,pseudoEncodingDesktopSize:-223,pseudoEncodingLastRect:-224,pseudoEncodingCursor:-239,pseudoEncodingQEMUExtendedKeyEvent:-258,pseudoEncodingDesktopName:-307,pseudoEncodingExtendedDesktopSize:-308,pseudoEncodingXvp:-309,pseudoEncodingFence:-312,pseudoEncodingContinuousUpdates:-313,pseudoEncodingCompressLevel9:-247,pseudoEncodingCompressLevel0:-256,pseudoEncodingVMwareCursor:1464686180,pseudoEncodingExtendedClipboard:3231835598};ne.encodings=G;function L(I){switch(I){case G.encodingRaw:return"Raw";case G.encodingCopyRect:return"CopyRect";case G.encodingRRE:return"RRE";case G.encodingHextile:return"Hextile";case G.encodingTight:return"Tight";case G.encodingTightPNG:return"TightPNG";default:return"[unknown encoding "+I+"]"}}},OLES:function(it,ne,q){"use strict";var G=q("U8pU"),L=q("VTBJ"),I=q("Ff2n"),R=q("q1tI"),M=q("uciX"),p=q("7ixt"),E=function(n){var a=n.overlay,t=n.prefixCls,r=n.id,s=n.overlayInnerStyle;return R.createElement("div",{className:"".concat(t,"-inner"),id:r,role:"tooltip",style:s},typeof a=="function"?a():a)},b=E,i=function(n,a){var t=n.overlayClassName,r=n.trigger,s=r===void 0?["hover"]:r,u=n.mouseEnterDelay,d=u===void 0?0:u,f=n.mouseLeaveDelay,v=f===void 0?.1:f,m=n.overlayStyle,S=n.prefixCls,C=S===void 0?"rc-tooltip":S,_=n.children,y=n.onVisibleChange,T=n.afterVisibleChange,O=n.transitionName,g=n.animation,F=n.placement,P=F===void 0?"right":F,N=n.align,X=N===void 0?{}:N,j=n.destroyTooltipOnHide,A=j===void 0?!1:j,K=n.defaultVisible,U=n.getTooltipContainer,k=n.overlayInnerStyle,z=Object(I.a)(n,["overlayClassName","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle","prefixCls","children","onVisibleChange","afterVisibleChange","transitionName","animation","placement","align","destroyTooltipOnHide","defaultVisible","getTooltipContainer","overlayInnerStyle"]),te=Object(R.useRef)(null);Object(R.useImperativeHandle)(a,function(){return te.current});var de=Object(L.a)({},z);"visible"in n&&(de.popupVisible=n.visible);var be=function(){var He=n.arrowContent,Ae=He===void 0?null:He,Se=n.overlay,he=n.id;return[R.createElement("div",{className:"".concat(C,"-arrow"),key:"arrow"},Ae),R.createElement(b,{key:"content",prefixCls:C,id:he,overlay:Se,overlayInnerStyle:k})]},We=!1,Ne=!1;if(typeof A=="boolean")We=A;else if(A&&Object(G.a)(A)==="object"){var Le=A.keepParent;We=Le===!0,Ne=Le===!1}return R.createElement(M.a,Object.assign({popupClassName:t,prefixCls:C,popup:be,action:s,builtinPlacements:p.a,popupPlacement:P,ref:te,popupAlign:X,getPopupContainer:U,onPopupVisibleChange:y,afterPopupVisibleChange:T,popupTransitionName:O,popupAnimation:g,defaultPopupVisible:K,destroyPopupOnHide:We,autoDestroy:Ne,mouseLeaveDelay:v,popupStyle:m,mouseEnterDelay:d},de),_)},c=Object(R.forwardRef)(i),o=ne.a=c},OqJ7:function(it,ne,q){it.exports={"xterm-panel":"xterm-panel___Z5hjW"}},Ot1p:function(it,ne,q){"use strict";var G=q("2qtc"),L=q("kLXV"),I=q("rAM+"),R=q("miYZ"),M=q("tsqr"),p=q("9og8"),E=q("tJVT"),b=q("jrin"),i=q("WmNS"),c=q.n(i),o=q("q1tI"),h=q.n(o),n=q("VrN/"),a=q.n(n),t=q("bdgK"),r=q("p77/"),s=q("Bd2K"),u=q("ELLl"),d=q("19Vz"),f=q("lZu9"),v=q("+NIl"),m=q("kSUc"),S=q("9Bee"),C=function(Oe){var V=Oe.value,Re=V===void 0?"":V,Xe=Oe.className,pe=Oe.showTextOnly,ke=Oe.showLines,Ve=Oe.style,ht=Ve===void 0?{}:Ve,tt=Object(o.useMemo)(function(){return""},[Re]);return h.a.createElement(h.a.Fragment,null,h.a.createElement("div",{dangerouslySetInnerHTML:{__html:tt}}))},_=q("0Owb"),y=q("dejd"),T=q("C+DQ"),O=q("1vsH"),g=q("m3rI"),F=[{title:"\u7C97\u4F53",icon:"icon-bold",actionName:"bold"},{title:"\u659C\u4F53",icon:"icon-italic",actionName:"italic"},"|",{title:"\u65E0\u5E8F\u5217\u8868",icon:"icon-unorder-list",actionName:"list-ul"},{title:"\u6709\u5E8F\u5217\u8868",icon:"icon-order-list",actionName:"list-ol"},"|",{title:"\u884C\u5185\u4EE3\u7801",icon:"icon-code",actionName:"code"},{title:"\u4EE3\u7801\u5757\uFF08\u591A\u8BED\u8A00\u98CE\u683C\uFF09",icon:"icon-file-code",actionName:"code-block"},{title:"\u94FE\u63A5",icon:"icon-link",actionName:"link"},"|",{title:"\u884C\u5185\u516C\u5F0F",icon:"icon-sum",actionName:"inline-latex"},{title:"\u591A\u884C\u516C\u5F0F",icon:"icon-formula",actionName:"latex"},"|",{title:"\u6DFB\u52A0\u56FE\u7247",icon:"icon-picture",actionName:"upload-image"},{title:"\u8868\u683C",icon:"icon-table",actionName:"add-table"},"|",{title:"\u6362\u884C",icon:"icon-minus",actionName:"line-break"},{title:"\u6E05\u7A7A",icon:"icon-eraser",actionName:"eraser"}];function P(Oe){var V=Oe.onActionCallback,Re=Oe.title,Xe=Oe.icon,pe=Oe.actionName,ke=Oe.className,Ve=ke===void 0?"":ke,ht=Oe.children;function tt(){V(pe)}return h.a.createElement("a",{title:Re,className:Ve,onClick:tt},h.a.createElement("i",{className:"md-iconfont ".concat(Xe)}),ht)}var N=function(Oe){var V=Oe.watch,Re=Oe.showNullButton,Xe=Oe.onActionCallback,pe=Oe.fullScreen,ke=Oe.insertTemp,Ve=Oe.hidetoolBar,ht=Oe.uuid,tt=Oe.setOpenPhones;console.log("link:","".concat(location.origin,"/upload.html?_educoder_session_login=").concat(Object(O.G)("_educoder_session_login"),"&_educoder_session=").concat(Object(O.G)("_educoder_session"),"&key=").concat(ht,"&api=").concat(encodeURIComponent(g.a.PROXY_SERVER)));var at=[].concat(F,[{title:"".concat(V?"\u5173\u95ED\u5B9E\u65F6\u9884\u89C8":"\u5F00\u542F\u5B9E\u65F6\u9884\u89C8"),icon:"".concat(V?"icon-eye-slash":"icon-eye"),actionName:"trigger-watch"}]);return h.a.createElement("ul",{className:"markdown-toolbar-container"},!Ve&&at.map(function(ut,Ft){return h.a.createElement("li",{key:Ft},ut.actionName?h.a.createElement(P,Object(_.a)({},ut,{onActionCallback:Xe})):h.a.createElement("span",{className:"v-line"}))}),Re?h.a.createElement("li",null,h.a.createElement(P,{icon:"icon-edit",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-null-ch",onActionCallback:Xe},h.a.createElement("span",{className:"fill-tip"},"\u70B9\u51FB\u63D2\u5165\b\u586B\u7A7A\u9879"))):null,ke&&h.a.createElement("li",null,h.a.createElement(P,{icon:"icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:"inster-template-".concat(ke),onActionCallback:Xe},h.a.createElement("span",{className:"fill-tip"},"\u63D2\u5165\u6A21\u677F"))),h.a.createElement("li",{className:"btn-full-screen"},h.a.createElement(P,{icon:"".concat(pe?"icon-shrink":"icon-enlarge"),title:pe?"\u5173\u95ED\u5168\u5C4F":"\u5F00\u542F\u5168\u5C4F",actionName:"trigger-full-screen",onActionCallback:Xe})))},X=q("M8RZ"),j=q("+L6B"),A=q("2/Rp"),K=q("y8nQ"),U=q("Vl3Y"),k=q("5NDa"),z=q("5rEg"),te={labelCol:{span:4},wrapperCol:{span:20}},de=function(Oe){var V=Oe.callback,Re=Oe.onCancel;function Xe(pe){V(pe)}return h.a.createElement(U.a,Object(_.a)({},te,{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:Xe}),h.a.createElement(U.a.Item,{label:"\u94FE\u63A5\u5730\u5740",name:"link",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740"}]},h.a.createElement(z.a,null)),h.a.createElement(U.a.Item,{label:"\u94FE\u63A5\u6807\u9898",name:"title",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u6807\u9898"}]},h.a.createElement(z.a,null)),h.a.createElement("div",{className:"flex-container flex-end"},h.a.createElement(A.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),h.a.createElement(A.a,{type:"ghost",onClick:Re},"\u53D6\u6D88")))},be=q("7ahc"),We=q("HmJG"),Ne=q("BjJ7"),Le=U.a.useForm,Ke={width:280,marginRight:10},He={labelCol:{span:5},wrapperCol:{span:19}},Ae=function(Oe){var V=Oe.callback,Re=Oe.onCancel,Xe=Le(),pe=Object(E.a)(Xe,1),ke=pe[0];function Ve(at){V(at)}function ht(at,ut){if(at.status===-1){M.b.error(at.message);return}ke.setFieldsValue({src:"/api/attachments/".concat(at.id),type:ut.type})}function tt(at){var ut=at.target.files[0];he(ut,ht)}return h.a.createElement(U.a,Object(_.a)({form:ke},He,{className:"upload-image-panel",onFinish:Ve}),h.a.createElement(U.a.Item,{label:"\u56FE\u7247\u5730\u5740",required:!0},h.a.createElement("div",{className:"flex-container"},h.a.createElement(U.a.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u56FE\u7247\u5730\u5740"}]},h.a.createElement(z.a,{style:Ke})),h.a.createElement(Se,{onFileChange:tt}))),h.a.createElement(U.a.Item,{label:"\u56FE\u7247\u63CF\u8FF0",name:"alt"},h.a.createElement(z.a,{style:{width:264}})),h.a.createElement(U.a.Item,{style:{textAlign:"right"}},h.a.createElement(A.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),h.a.createElement(A.a,{type:"ghost",onClick:Re},"\u53D6\u6D88")))};function Se(Oe){var V=Oe.onFileChange;return h.a.createElement("a",{className:"upload-button"},"\u672C\u5730\u4E0A\u4F20",h.a.createElement("input",{type:"file",onChange:V}))}function he(Oe,V){if(!Oe)throw new String("\u6CA1\u6709\u6587\u4EF6");var Re=new FormData;Re.append("editormd-image-file",Oe),Re.append("file_param_name","editormd-image-file"),Re.append("byxhr","true");var Xe=new window.XMLHttpRequest;Xe.withCredentials=!0,Xe.addEventListener("load",function(pe){V(JSON.parse(pe.target.responseText),Oe)},!1),Xe.addEventListener("error",function(pe){console.error(pe)},!1),Xe.open("POST","".concat(Ne.a,"/api/attachments.json")),Xe.send(Re)}var Ie=q("giR+"),ye=q("fyUT"),Ge=q("7Kak"),$e=q("9yH6"),ze=$e.a.Group,Je={margin:"0 8px"},Qe=function(Oe){var V=Oe.callback,Re=Oe.onCancel;function Xe(pe){V(pe)}return h.a.createElement(U.a,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:Xe},h.a.createElement("div",{className:"flex-container",style:{alignItems:"baseline"}},h.a.createElement("span",{style:Je},"\u5355\u5143\u683C\u6570\uFF1A"),h.a.createElement("span",{style:Je},"\u884C\u6570"),h.a.createElement(U.a.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},h.a.createElement(ye.a,null)),h.a.createElement("span",{style:Je},"\u5217\u6570"),h.a.createElement(U.a.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},h.a.createElement(ye.a,null))),h.a.createElement("div",{className:"flex-container",style:{marginTop:12,alignItems:"baseline"}},h.a.createElement("span",{style:Je},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),h.a.createElement(U.a.Item,{name:"align"},h.a.createElement(ze,null,h.a.createElement($e.a,{value:"default"},h.a.createElement("i",{className:"fa fa-align-justify"})),h.a.createElement($e.a,{value:"left"},h.a.createElement("i",{className:"fa fa-align-left"})),h.a.createElement($e.a,{value:"center"},h.a.createElement("i",{className:"fa fa-align-center"})),h.a.createElement($e.a,{value:"right"},h.a.createElement("i",{className:"fa fa-align-right"}))))),h.a.createElement("div",{className:"flex-container flex-end"},h.a.createElement(A.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),h.a.createElement(A.a,{type:"ghost",onClick:Re},"\u53D6\u6D88")))},fe=q("ErOA"),ge=q("7Cbv"),xe="link",we="upload-image",Te="code-block",re="add-table",ve="------------",ae={default:ve,left:":".concat(ve),center:":".concat(ve,":"),right:"".concat(ve,":")},Me=q("9VGf"),Ye,et;function je(){}var ot=0,ce=1e4,Pe="\u2581",Fe=`
|
|
|
**\u6A21\u677F\u6807\u9898**
|
|
|
\u6A21\u677F\u6B63\u6587\u5185\u5BB9\uFF0C\u53EF\u8F93\u5165\u6587\u672C\u5185\u5BB9\u548C\u7C98\u8D34\u56FE\u7247\u7B49\u64CD\u4F5C`;function Ce(Oe){return/^\d+$/.test(Oe)?"".concat(Oe,"px"):Oe}var _e=navigator.platform.toUpperCase().indexOf("MAC")>=0,Ee=_e?"Cmd":"Ctrl",ee=["pptm","pptx","ppt","pot","pps","ppa","potx","ppsx","ppam","pptm","potm","ppsm","doc","docx","dot","dotx","docm","dotm","xls","xlsx","csv","xlt","xla","xltx","xlsm","xltm","xlam","xlsb"],oe=(Ye={},Object(b.a)(Ye,Ee+"-B","bold"),Object(b.a)(Ye,Ee+"-I","italic"),Ye),Q=(et={},Object(b.a)(et,xe,"\u6DFB\u52A0\u94FE\u63A5"),Object(b.a)(et,Te,"\u6DFB\u52A0\u4EE3\u7801\u5757"),Object(b.a)(et,we,"\u6DFB\u52A0\u6587\u4EF6"),Object(b.a)(et,re,"\u6DFB\u52A0\u8868\u683C"),et),me=ne.a=function(Oe){var V=Oe.defaultValue,Re=V===void 0?"":V,Xe=Oe.onChange,pe=Oe.width,ke=pe===void 0?"100%":pe,Ve=Oe.height,ht=Ve===void 0?400:Ve,tt=Oe.miniToolbar,at=tt===void 0?!1:tt,ut=Oe.isFocus,Ft=ut===void 0?!1:ut,St=Oe.watch,vt=Oe.insertTemp,Bt=Oe.mode,Nt=Bt===void 0?"markdown":Bt,dt=Oe.id,Ut=dt===void 0?"markdown-editor-id":dt,gt=Oe.showResizeBar,pt=gt===void 0?!1:gt,Ct=Oe.noStorage,It=Ct===void 0?!1:Ct,Xt=Oe.showNullButton,At=Xt===void 0?!1:Xt,bt=Oe.hidetoolBar,Si=bt===void 0?!1:bt,qt=Oe.fullScreen,ii=qt===void 0?!1:qt,Pt=Oe.onBlur,di=Oe.onCMBeforeChange,Di=Oe.onFullScreen,Yi=Oe.className,ct=Yi===void 0?"":Yi,Dt=Oe.disablePaste,pr=Dt===void 0?!1:Dt,mr=Oe.placeholder,gr=mr===void 0?"":mr,vr=Oe.values,J=vr===void 0?"":vr,B=Object(o.useState)(null),H=Object(E.a)(B,2),Y=H[0],le=H[1],$=Object(o.useState)(Re),Be=Object(E.a)($,2),nt=Be[0],mt=Be[1],wt=Object(o.useState)(St),st=Object(E.a)(wt,2),Rt=st[0],Vt=st[1],ri=Object(o.useState)(ii),Hi=Object(E.a)(ri,2),Ti=Hi[0],Ci=Hi[1],qi=Object(o.useState)(""),kr=Object(E.a)(qi,2),mi=kr[0],zi=kr[1],lr=Object(o.useState)(0),ur=Object(E.a)(lr,2),ji=ur[0],Ir=ur[1],_r=Object(o.useState)(ht),Xr=Object(E.a)(_r,2),zr=Xr[0],$i=Xr[1],Qi=Object(o.useState)(!1),yr=Object(E.a)(Qi,2),cn=yr[0],br=yr[1],oi=Object(o.useRef)(Object(ge.a)()),Yt=Object(o.useRef)(!1),xi=Object(o.useRef)(),jt=Object(o.useRef)(),ui=Object(o.useRef)(),$t=Object(o.useRef)(),rr=Object(o.useRef)(),gi=function(){var Tt=Object(p.a)(c.a.mark(function Mt(){var Ot,Ht;return c.a.wrap(function(ei){for(;;)switch(ei.prev=ei.next){case 0:return ei.next=2,Object(fe.a)("/api/attachments/distinct_hash_val.json",{method:"post",body:{hash_val:oi.current}});case 2:Ht=ei.sent,Ht!=null&&(Ot=Ht.attachments)!==null&&Ot!==void 0&&Ot.length&&(console.log("cm:",Y,jt),Ht.attachments.map(function(zt){zt.content_type.indexOf("image")>-1?Y.replaceSelection(".concat(zt.content_type,")")):zt.content_type.indexOf("video")>-1?Y.replaceSelection('<video width="100%" controls src="'.concat(g.a.API_SERVER,"/api/attachments/").concat(data.id,'"></video>')):zt.content_type.indexOf("pdf")>-1?Y.replaceSelection('<a href="'.concat(g.a.API_SERVER,"/api/attachments/").concat(zt.id,"?type=").concat(zt.content_type,'&disposition=inline" target="_blank">').concat(zt.name,"</a>")):Y.replaceSelection("[".concat(zt.name,"](").concat(g.a.API_SERVER,"/api/attachments/").concat(zt.id,"?type=").concat(zt.content_type,")"))}));case 4:case"end":return ei.stop()}},Mt)}));return function(){return Tt.apply(this,arguments)}}();Object(o.useEffect)(function(){mt(J),Y==null||Y.setValue(J)},[J]),Object(o.useEffect)(function(){Di==null||Di(Ti)},[Ti]),Object(o.useEffect)(function(){if(jt.current){var Tt=a.a.fromTextArea(jt.current,{mode:Nt,lineNumbers:!at,lineWrapping:!0,value:Re,autoCloseTags:!0,autoCloseBrackets:!0});Ft&&Tt.focus();function Mt(Ot,Ht){if(pr){Ht.preventDefault();return}var Gt=Ht.clipboardData;if(Gt){var ei=Gt.types.toString(),zt=Gt.items;if(ei==="Files"||Gt.types.indexOf("Files")>-1){if(Ht.preventDefault(),Nt=="stex")return;try{var fi,Mi=zt[1];((fi=zt[0])===null||fi===void 0?void 0:fi.kind)==="file"&&(Mi=zt[0]);var Wt=Mi.getAsFile(),hr=Wt.name.split(".").pop();he(Wt,function(Qt){if(Qt.id){var Pi,Ai,Zi;(Wt==null||((Pi=Wt.type)===null||Pi===void 0)?void 0:Pi.indexOf("image"))>-1?Tt.replaceSelection(".concat(Qt.content_type,")")):(Wt==null||((Ai=Wt.type)===null||Ai===void 0)?void 0:Ai.indexOf("video"))>-1?Tt.replaceSelection('<video width="100%" controls src="'.concat(g.a.API_SERVER,"/api/attachments/").concat(Qt.id,'"></video>')):(Wt==null||((Zi=Wt.type)===null||Zi===void 0)?void 0:Zi.indexOf("pdf"))>-1?Tt.replaceSelection('<a href="'.concat(g.a.API_SERVER,"/api/attachments/").concat(Qt.id,"?type=").concat(Wt.type,'&disposition=inline" target="_blank">').concat(Wt.name,"</a>")):ee.includes(hr)?Tt.replaceSelection('<a href="'.concat(g.a.API_SERVER,"/api/attachments/").concat(Qt.id,'?type=office&disposition=inline" target="_blank">').concat(Wt.name,"</a>")):Tt.replaceSelection("[".concat(Wt.name,"](").concat(g.a.API_SERVER,"/api/attachments/").concat(Qt.id,"?type=").concat(Qt.content_type,")"))}else(Qt==null?void 0:Qt.status)===401&&(document.location.href="/user/login")})}catch(Qt){M.b.warn("\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668\u7C98\u8D34")}return!0}else return!0}return!0}return Tt.on("paste",Mt),Tt.on("dragleave",function(Ot,Ht){ui.current.classList.remove("mouse-hover-md")}),Tt.on("dragover",function(Ot,Ht){ui.current.classList.add("mouse-hover-md")}),Tt.on("drop",function(Ot,Ht){ui.current.classList.add("mouse-hover-md");var Gt;if(Gt=Ht.dataTransfer.files,Gt.length>0){Ht.preventDefault(),Ht.stopPropagation();for(var ei=function(Mi){var Wt=Gt[Mi],hr=Wt.name.split(".").pop();he(Wt,function(Qt){if(Qt.id){var Pi,Ai,Zi;(Wt==null||((Pi=Wt.type)===null||Pi===void 0)?void 0:Pi.indexOf("image"))>-1?Tt.replaceSelection(".concat(Qt.content_type,")")):(Wt==null||((Ai=Wt.type)===null||Ai===void 0)?void 0:Ai.indexOf("video"))>-1?Tt.replaceSelection('<video width="100%" controls src="'.concat(g.a.API_SERVER,"/api/attachments/").concat(Qt.id,'"></video>')):(Wt==null||((Zi=Wt.type)===null||Zi===void 0)?void 0:Zi.indexOf("pdf"))>-1?Tt.replaceSelection('<a href="'.concat(g.a.API_SERVER,"/api/attachments/").concat(Qt.id,"?type=").concat(Wt.type,'&disposition=inline" target="_blank">').concat(Wt.name,"</a>")):ee.includes(hr)?Tt.replaceSelection('<a href="'.concat(g.a.API_SERVER,"/api/attachments/").concat(Qt.id,'?type=office&disposition=inline" target="_blank">').concat(Wt.name,"</a>")):Tt.replaceSelection("[".concat(Wt.name,"](").concat(g.a.API_SERVER,"/api/attachments/").concat(Qt.id,"?type=").concat(Qt.content_type,")"))}else(Qt==null?void 0:Qt.status)===401&&(document.location.href="/user/login")})},zt=0;zt<Gt.length;zt++)ei(zt)}}),le(Tt),function(){Tt.off("paste",Mt)}}},[]);var Oi=Object(o.useCallback)(function(){if(ui.current)try{}catch(Tt){console.log(Tt,"---- to set md editor body height")}},[zr,ui,Ti]);Object(o.useEffect)(function(){function Tt(){var Ot=new t.default(function(Ht){var Gt=Object(I.a)(Ht),ei;try{for(Gt.s();!(ei=Gt.n()).done;){var zt=ei.value;(zt.target.offsetHeight>0||zt.target.offsetWidth>0)&&(Oi(),Y.setSize("100%","100%"),Y.refresh())}}catch(fi){Gt.e(fi)}finally{Gt.f()}});return Ot.observe(jt.current.parentElement),Ot}if(Y){var Mt=Tt();return function(){Mt.unobserve(jt.current.parentElement)}}},[Y,Oi]),Object(o.useEffect)(function(){if(Y){for(var Tt=[],Mt=function(){var zt=Ht[Ot];Gt=Object(E.a)(zt,2);var fi=Gt[0],Mi=Gt[1],Wt=Object(b.a)({},fi,function(){Gr(Mi)});Tt.push(Wt),Y.addKeyMap(Wt)},Ot=0,Ht=Object.entries(oe);Ot<Ht.length;Ot++){var Gt;Mt()}return xi.current=setInterval(function(){Yt.current&&gi()},4e3),function(){clearInterval(xi.current);var ei=Object(I.a)(Tt),zt;try{for(ei.s();!(zt=ei.n()).done;){var fi=zt.value;Y.removeKeyMap(fi)}}catch(Mi){ei.e(Mi)}finally{ei.f()}}}},[Y]),Object(o.useEffect)(function(){ii!==Ti&&Ci(ii)},[ii]),Object(Me.a)(function(){if(!It&&ji>0){var Tt=new Date().getTime(),Mt=window.sessionStorage.getItem(Ut);Tt>=ji+ce&&(!Mt||Mt!==nt)&&(window.sessionStorage.setItem(Ut,nt),br(!0))}},ce),Object(o.useEffect)(function(){Vt(St)},[Y,St]),Object(o.useEffect)(function(){Y&&(Ft&&Y.focus())},[Y,Ft]),Object(o.useEffect)(function(){if(Rt&&Y){var Tt=Y.getScrollerElement();function Mt(Ot){var Ht=Ot.target;if(rr.current){var Gt=Ht.scrollTop/Ht.scrollHeight;rr.current.scrollTop=rr.current.scrollHeight*Gt}}return Tt.addEventListener("scroll",Mt),function(){Tt.removeEventListener("scroll",Mt)}}},[Y,Rt]),Object(o.useEffect)(function(){if(Y&&di){function Tt(Mt,Ot){di(Mt,Ot)}return Y.on("beforeChange",Tt),function(){Y.off("beforeChange",Tt)}}},[Y,di]),Object(o.useEffect)(function(){if(Y&&Pt){function Tt(){Pt(Y.getValue())}return Y.on("blur",Tt),function(){Y.off("blur",Tt)}}},[Y,Pt]),Object(o.useEffect)(function(){if(Y){function Tt(Mt){var Ot=Mt.getValue();mt(Ot),Ir(new Date().getTime()),Mt.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),Xe&&Xe(Ot)}return Y.on("change",Tt),function(){Y.off("change",Tt)}}},[Y,Xe]),Object(o.useEffect)(function(){Y&&(Re==null?(Y.setValue(""),mt("")):Re!==Y.getValue()&&(Y.setValue(Re),mt(Re),Y.setCursor(Y.lineCount(),0)))},[Y,Re]);var Gr=Object(o.useCallback)(function(Tt){var Mt=Y.getCursor(),Ot=Y.getSelection(),Ht=Ot.split(`
|
|
|
`);switch(Tt){case"bold":return Y.replaceSelection("**"+Ot+"**"),Ot===""&&Y.setCursor(Mt.line,Mt.ch+2),Y.focus();case"italic":return Y.replaceSelection("*"+Ot+"*"),Ot===""&&Y.setCursor(Mt.line,Mt.ch+1),Y.focus();case"code":return Y.replaceSelection("`"+Ot+"`"),Ot===""&&Y.setCursor(Mt.line,Mt.ch+1),Y.focus();case"inline-latex":return Y.replaceSelection("`$$"+Ot+"$$`"),Ot===""&&Y.setCursor(Mt.line,Mt.ch+3),Y.focus();case"latex":return Y.replaceSelection("```latex\n"+Ot+"\n```"),Y.setCursor(Mt.line+1,Ot.length+1),Y.focus();case"line-break":return Y.replaceSelection(`<br/>
|
|
|
`),Y.focus();case"list-ul":return Ot===""?Y.replaceSelection("- "+Ot):Y.replaceSelection(Ht.map(function(Gt){return Gt===""?"":"- ".concat(Gt)}).join(`
|
|
|
`)),Y.focus();case"list-ol":return Ot===""?Y.replaceSelection("1. "+Ot):Y.replaceSelection(Ht.map(function(Gt,ei){return Gt===""?"":"".concat(ei+1,". ").concat(Gt)}).join(`
|
|
|
`)),Y.focus();case"add-null-ch":return Ot===""&&Y.setCursor(Mt.line,Mt.ch+1),Y.replaceSelection(Pe),Y.focus();case"inster-template-1":return Ot===""&&Y.setCursor(Mt.line,Mt.ch),Y.replaceSelection(Fe),Y.focus();case"eraser":return Y.setValue(""),Y.focus();case"trigger-watch":return Vt(!Rt),Y.focus();case"trigger-full-screen":return Ci(!Ti),Y.focus();case xe:zi(xe);return;case Te:zi(Te);return;case we:zi(we);return;case re:zi(re);return;default:throw new Error}},[Y,Rt,Ti]),xr=Object(o.useCallback)(function(Tt){zi("");switch(mi){case xe:var Mt=Tt.title,Ot=Tt.link;return Y.replaceSelection("[".concat(Mt,"](").concat(Ot,")")),Y.focus();case Te:var Ht=Tt.language,Gt=Tt.content;return Y.replaceSelection(["```"+Ht,Gt,"```"].join(`
|
|
|
`)),Y.focus();case we:var ei=Tt.src,zt=Tt.alt;return zt?Y.replaceSelection(".concat(ei,' "').concat(zt,'" )')):Y.replaceSelection("")),Y.focus();case re:for(var fi=Tt.row,Mi=Tt.col,Wt=Tt.align,hr=`
|
|
|
`,Qt=0;Qt<fi;Qt++){for(var Pi=[],Ai=[],Zi=0;Zi<Mi;Zi++)Qt===1&&Ai.push(ae[Wt]),Pi.push(" ");Qt===1&&(hr+="| ".concat(Ai.join(" | "),` |
|
|
|
`)),hr+="| ".concat(Pi.join(Mi===1?"":" | "),` |
|
|
|
`)}return Y.replaceSelection(hr+`
|
|
|
`),Y.focus();default:throw new Error}},[Y,mi]),dn=Object(o.useMemo)(function(){switch(mi){case xe:return h.a.createElement(de,{callback:xr,onCancel:Er});case Te:return h.a.createElement(be.b,{callback:xr,onCancel:Er});case we:return h.a.createElement(Ae,{callback:xr,onCancel:Er});case re:return h.a.createElement(Qe,{callback:xr,onCancel:Er});default:return null}},[mi]);function Er(){zi("")}Object(o.useEffect)(function(){if($t.current){var Tt=$t.current,Mt=!1,Ot=0;function Ht(zt){Mt=!0,Ot=zt.pageY}function Gt(){Mt=!1}function ei(zt){if(Mt){var fi=zt.pageY-Ot;fi<0&&(fi=0),fi>300&&(fi=300);var Mi=ht+fi+"px";$i(Mi)}}return Tt.addEventListener("mousedown",Ht),document.addEventListener("mousemove",ei),document.addEventListener("mouseup",Gt),function(){Tt.removeEventListener("mousedown",Ht),document.removeEventListener("mousemove",ei),document.removeEventListener("mouseup",Gt)}}},[Y,$t]),Object(o.useEffect)(function(){$i(ht)},[ht]);var nr=Ce(ke),fn=Ce(zr),Ji={width:nr,height:fn},pn=Object(o.useMemo)(function(){if(ji){var Tt=new Date(ji),Mt=Tt.getHours(),Ot=Tt.getMinutes(),Ht=Tt.getSeconds();return Mt=Mt<10?"0"+Mt:Mt,Ot=Ot<10?"0"+Ot:Ot,Ht=Ht<10?"0"+Ht:Ht,"".concat(Mt,":").concat(Ot,":").concat(Ht)}return 0},[ji]);function Kn(){window.sessionStorage.removeItem(Ut),br(!1),Ir(0)}function Dr(){br(!1),Ir(0),Y.setValue(window.sessionStorage.getItem(Ut))}function ua(Tt,Mt){var Ot=Y.getValue();Ot=Ot.replace(Tt,Mt),mt(Ot),Y==null||Y.setValue(Ot)}return h.a.createElement(o.Fragment,null,h.a.createElement("div",{className:"markdown-editor-wrapper",ref:ui},h.a.createElement("div",{className:"markdown-editor-container ".concat(ct," ").concat(Rt?"on-preview":""," ").concat(at?"mini":""," ").concat(Ti?"full-screen":""),style:Ji},h.a.createElement(N,{insertTemp:vt,watch:Rt,fullScreen:Ti,showNullButton:At,onActionCallback:Gr,hidetoolBar:Si,uuid:oi.current,setOpenPhones:function(){Yt.current=!0}}),h.a.createElement("div",{className:"markdown-editor-body"},h.a.createElement("div",{className:"codemirror-container"},h.a.createElement("textarea",{ref:jt,placeholder:gr})),Rt?h.a.createElement("div",{ref:rr,className:"preview-container"},Nt==="stex"&&h.a.createElement(C,{value:nt}),Nt!=="stex"&&h.a.createElement(S.a,{edit:!0,value:nt,replaces:ua})):null))),pt?h.a.createElement("a",{ref:$t,className:"editor-resize"}):null,h.a.createElement(X.a,null,Q[mi]?h.a.createElement(L.a,{centered:!0,title:Q[mi],visible:!0,onCancel:Er,footer:null,className:"markdown-popup-form"},dn):null))}},P2ho:function(it,ne,q){"use strict";Object.defineProperty(ne,"__esModule",{value:!0}),ne.default=void 0;var G={Again:57349,AltLeft:56,AltRight:57400,ArrowDown:57424,ArrowLeft:57419,ArrowRight:57421,ArrowUp:57416,AudioVolumeDown:57390,AudioVolumeMute:57376,AudioVolumeUp:57392,Backquote:41,Backslash:43,Backspace:14,BracketLeft:26,BracketRight:27,BrowserBack:57450,BrowserFavorites:57446,BrowserForward:57449,BrowserHome:57394,BrowserRefresh:57447,BrowserSearch:57445,BrowserStop:57448,CapsLock:58,Comma:51,ContextMenu:57437,ControlLeft:29,ControlRight:57373,Convert:121,Copy:57464,Cut:57404,Delete:57427,Digit0:11,Digit1:2,Digit2:3,Digit3:4,Digit4:5,Digit5:6,Digit6:7,Digit7:8,Digit8:9,Digit9:10,Eject:57469,End:57423,Enter:28,Equal:13,Escape:1,F1:59,F10:68,F11:87,F12:88,F13:93,F14:94,F15:95,F16:85,F17:57347,F18:57463,F19:57348,F2:60,F20:90,F21:116,F22:57465,F23:109,F24:111,F3:61,F4:62,F5:63,F6:64,F7:65,F8:66,F9:67,Find:57409,Help:57461,Hiragana:119,Home:57415,Insert:57426,IntlBackslash:86,IntlRo:115,IntlYen:125,KanaMode:112,Katakana:120,KeyA:30,KeyB:48,KeyC:46,KeyD:32,KeyE:18,KeyF:33,KeyG:34,KeyH:35,KeyI:23,KeyJ:36,KeyK:37,KeyL:38,KeyM:50,KeyN:49,KeyO:24,KeyP:25,KeyQ:16,KeyR:19,KeyS:31,KeyT:20,KeyU:22,KeyV:47,KeyW:17,KeyX:45,KeyY:21,KeyZ:44,Lang3:120,Lang4:119,Lang5:118,LaunchApp1:57451,LaunchApp2:57377,LaunchMail:57452,MediaPlayPause:57378,MediaSelect:57453,MediaStop:57380,MediaTrackNext:57369,MediaTrackPrevious:57360,MetaLeft:57435,MetaRight:57436,Minus:12,NonConvert:123,NumLock:69,Numpad0:82,Numpad1:79,Numpad2:80,Numpad3:81,Numpad4:75,Numpad5:76,Numpad6:77,Numpad7:71,Numpad8:72,Numpad9:73,NumpadAdd:78,NumpadComma:126,NumpadDecimal:83,NumpadDivide:57397,NumpadEnter:57372,NumpadEqual:89,NumpadMultiply:55,NumpadParenLeft:57462,NumpadParenRight:57467,NumpadSubtract:74,Open:100,PageDown:57425,PageUp:57417,Paste:101,Pause:57414,Period:52,Power:57438,PrintScreen:84,Props:57350,Quote:40,ScrollLock:70,Semicolon:39,ShiftLeft:42,ShiftRight:54,Slash:53,Sleep:57439,Space:57,Suspend:57381,Tab:15,Undo:57351,WakeUp:57443};ne.default=G},QV2g:function(it,ne,q){"use strict";Object.defineProperty(ne,"__esModule",{value:!0}),ne.default=G;function G(){for(var R,M=[],p=0;p<256;p++){R=p;for(var E=0;E<8;E++)R=R&1?3988292384^R>>>1:R>>>1;M[p]=R}return M}var L=G();function I(R,M,p,E){var b=L,i=E+p;R^=-1;for(var c=E;c<i;c++)R=R>>>8^b[(R^M[c])&255];return R^-1}},SJMd:function(it,ne){/**
|
|
|
* @license
|
|
|
* Copyright (C) 2006 Google Inc.
|
|
|
*
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
* you may not use this file except in compliance with the License.
|
|
|
* You may obtain a copy of the License at
|
|
|
*
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
|
*
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
* See the License for the specific language governing permissions and
|
|
|
* limitations under the License.
|
|
|
*/var q,G,L,I=!1,R,M;window.PR_SHOULD_USE_CONTINUATION=!0;var p,E;(function(){var b=window,i=["break,continue,do,else,for,if,return,while"],c=[i,"auto,case,char,const,default,double,enum,extern,float,goto,inline,int,long,register,restrict,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"],o=[c,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],h=[o,"alignas,alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,delegate,dynamic_cast,explicit,export,friend,generic,late_check,mutable,namespace,noexcept,noreturn,nullptr,property,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"],n=[o,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],a=[o,"abstract,add,alias,as,ascending,async,await,base,bool,by,byte,checked,decimal,delegate,descending,dynamic,event,finally,fixed,foreach,from,get,global,group,implicit,in,interface,internal,into,is,join,let,lock,null,object,out,override,orderby,params,partial,readonly,ref,remove,sbyte,sealed,select,set,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,value,var,virtual,where,yield"],t="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes",r=[o,"abstract,async,await,constructor,debugger,enum,eval,export,function,get,implements,instanceof,interface,let,null,set,undefined,var,with,yield,Infinity,NaN"],s="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",u=[i,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"],d=[i,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"],f=[i,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],v=[h,a,n,r,s,u,d,f],m=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,S="str",C="kwd",_="com",y="typ",T="lit",O="pun",g="pln",F="tag",P="dec",N="src",X="atn",j="atv",A="nocode",K="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<<?=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function U(ze){for(var Je=0,Qe=!1,fe=!1,ge=0,xe=ze.length;ge<xe;++ge){var we=ze[ge];if(we.ignoreCase)fe=!0;else if(/[a-z]/i.test(we.source.replace(/\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi,""))){Qe=!0,fe=!1;break}}var Te={b:8,t:9,n:10,v:11,f:12,r:13};function re(et){var je=et.charCodeAt(0);if(je!==92)return je;var ot=et.charAt(1);return je=Te[ot],je||("0"<=ot&&ot<="7"?parseInt(et.substring(1),8):ot==="u"||ot==="x"?parseInt(et.substring(2),16):et.charCodeAt(1))}function ve(et){if(et<32)return(et<16?"\\x0":"\\x")+et.toString(16);var je=String.fromCharCode(et);return je==="\\"||je==="-"||je==="]"||je==="^"?"\\"+je:je}function ae(et){var je=et.substring(1,et.length-1).match(new RegExp("\\\\u[0-9A-Fa-f]{4}|\\\\x[0-9A-Fa-f]{2}|\\\\[0-3][0-7]{0,2}|\\\\[0-7]{1,2}|\\\\[\\s\\S]|-|[^-\\\\]","g")),ot=[],ce=je[0]==="^",Pe=["["];ce&&Pe.push("^");for(var Fe=ce?1:0,Ce=je.length;Fe<Ce;++Fe){var _e=je[Fe];if(/\\[bdsw]/i.test(_e))Pe.push(_e);else{var Ee=re(_e),ee;Fe+2<Ce&&je[Fe+1]==="-"?(ee=re(je[Fe+2]),Fe+=2):ee=Ee,ot.push([Ee,ee]),ee<65||Ee>122||(ee<65||Ee>90||ot.push([Math.max(65,Ee)|32,Math.min(ee,90)|32]),ee<97||Ee>122||ot.push([Math.max(97,Ee)&~32,Math.min(ee,122)&~32]))}}ot.sort(function(Oe,V){return Oe[0]-V[0]||V[1]-Oe[1]});for(var oe=[],Q=[],Fe=0;Fe<ot.length;++Fe){var me=ot[Fe];me[0]<=Q[1]+1?Q[1]=Math.max(Q[1],me[1]):oe.push(Q=me)}for(var Fe=0;Fe<oe.length;++Fe){var me=oe[Fe];Pe.push(ve(me[0])),me[1]>me[0]&&(me[1]+1>me[0]&&Pe.push("-"),Pe.push(ve(me[1])))}return Pe.push("]"),Pe.join("")}function Me(et){for(var je=et.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g")),ot=je.length,ce=[],Pe=0,Fe=0;Pe<ot;++Pe){var Ce=je[Pe];if(Ce==="(")++Fe;else if(Ce.charAt(0)==="\\"){var _e=+Ce.substring(1);_e&&(_e<=Fe?ce[_e]=-1:je[Pe]=ve(_e))}}for(var Pe=1;Pe<ce.length;++Pe)ce[Pe]===-1&&(ce[Pe]=++Je);for(var Pe=0,Fe=0;Pe<ot;++Pe){var Ce=je[Pe];if(Ce==="(")++Fe,ce[Fe]||(je[Pe]="(?:");else if(Ce.charAt(0)==="\\"){var _e=+Ce.substring(1);_e&&_e<=Fe&&(je[Pe]="\\"+ce[_e])}}for(var Pe=0;Pe<ot;++Pe)je[Pe]==="^"&&je[Pe+1]!=="^"&&(je[Pe]="");if(et.ignoreCase&&Qe)for(var Pe=0;Pe<ot;++Pe){var Ce=je[Pe],Ee=Ce.charAt(0);Ce.length>=2&&Ee==="["?je[Pe]=ae(Ce):Ee!=="\\"&&(je[Pe]=Ce.replace(/[a-zA-Z]/g,function(Q){var me=Q.charCodeAt(0);return"["+String.fromCharCode(me&~32,me|32)+"]"}))}return je.join("")}for(var Ye=[],ge=0,xe=ze.length;ge<xe;++ge){var we=ze[ge];if(we.global||we.multiline)throw new Error(""+we);Ye.push("(?:"+Me(we)+")")}return new RegExp(Ye.join("|"),fe?"gi":"g")}function k(ze,Je){var Qe=/(?:^|\s)nocode(?:\s|$)/,fe=[],ge=0,xe=[],we=0;function Te(re){var ve=re.nodeType;if(ve==1){if(Qe.test(re.className))return;for(var ae=re.firstChild;ae;ae=ae.nextSibling)Te(ae);var Me=re.nodeName.toLowerCase();(Me==="br"||Me==="li")&&(fe[we]=`
|
|
|
`,xe[we<<1]=ge++,xe[we++<<1|1]=re)}else if(ve==3||ve==4){var Ye=re.nodeValue;Ye.length&&(Je?Ye=Ye.replace(/\r\n?/g,`
|
|
|
`):Ye=Ye.replace(/[ \t\r\n]+/g," "),fe[we]=Ye,xe[we<<1]=ge,ge+=Ye.length,xe[we++<<1|1]=re)}}return Te(ze),{sourceCode:fe.join("").replace(/\n$/,""),spans:xe}}function z(ze,Je,Qe,fe,ge){if(!Qe)return;var xe={sourceNode:ze,pre:1,langExtension:null,numberLines:null,sourceCode:Qe,spans:null,basePos:Je,decorations:null};fe(xe),ge.push.apply(ge,xe.decorations)}var te=/\S/;function de(ze){for(var Je=void 0,Qe=ze.firstChild;Qe;Qe=Qe.nextSibling){var fe=Qe.nodeType;Je=fe===1?Je?ze:Qe:fe===3&&te.test(Qe.nodeValue)?ze:Je}return Je===ze?void 0:Je}function be(ze,Je){var Qe={},fe;(function(){for(var we=ze.concat(Je),Te=[],re={},ve=0,ae=we.length;ve<ae;++ve){var Me=we[ve],Ye=Me[3];if(Ye)for(var et=Ye.length;--et>=0;)Qe[Ye.charAt(et)]=Me;var je=Me[1],ot=""+je;re.hasOwnProperty(ot)||(Te.push(je),re[ot]=null)}Te.push(/[\0-\uffff]/),fe=U(Te)})();var ge=Je.length,xe=function(we){for(var Te=we.sourceCode,re=we.basePos,ve=we.sourceNode,ae=[re,g],Me=0,Ye=Te.match(fe)||[],et={},je=0,ot=Ye.length;je<ot;++je){var ce=Ye[je],Pe=et[ce],Fe=void 0,Ce;if(typeof Pe=="string")Ce=!1;else{var _e=Qe[ce.charAt(0)];if(_e)Fe=ce.match(_e[1]),Pe=_e[0];else{for(var Ee=0;Ee<ge;++Ee)if(_e=Je[Ee],Fe=ce.match(_e[1]),Fe){Pe=_e[0];break}Fe||(Pe=g)}Ce=Pe.length>=5&&Pe.substring(0,5)==="lang-",Ce&&!(Fe&&typeof Fe[1]=="string")&&(Ce=!1,Pe=N),Ce||(et[ce]=Pe)}var ee=Me;if(Me+=ce.length,!Ce)ae.push(re+ee,Pe);else{var oe=Fe[1],Q=ce.indexOf(oe),me=Q+oe.length;Fe[2]&&(me=ce.length-Fe[2].length,Q=me-oe.length);var Oe=Pe.substring(5);z(ve,re+ee,ce.substring(0,Q),xe,ae),z(ve,re+ee+Q,oe,Se(Oe,oe),ae),z(ve,re+ee+me,ce.substring(me),xe,ae)}}we.decorations=ae};return xe}function We(ze){var Je=[],Qe=[];ze.tripleQuotedStrings?Je.push([S,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):ze.multiLineStrings?Je.push([S,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):Je.push([S,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),ze.verbatimStrings&&Qe.push([S,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var fe=ze.hashComments;fe&&(ze.cStyleComments?(fe>1?Je.push([_,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):Je.push([_,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),Qe.push([S,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):Je.push([_,/^#[^\r\n]*/,null,"#"])),ze.cStyleComments&&(Qe.push([_,/^\/\/[^\r\n]*/,null]),Qe.push([_,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var ge=ze.regexLiterals;if(ge){var xe=ge>1?"":`
|
|
|
\r`,we=xe?".":"[\\S\\s]",Te="/(?=[^/*"+xe+"])(?:[^/\\x5B\\x5C"+xe+"]|\\x5C"+we+"|\\x5B(?:[^\\x5C\\x5D"+xe+"]|\\x5C"+we+")*(?:\\x5D|$))+/";Qe.push(["lang-regex",RegExp("^"+K+"("+Te+")")])}var re=ze.types;re&&Qe.push([y,re]);var ve=(""+ze.keywords).replace(/^ | $/g,"");ve.length&&Qe.push([C,new RegExp("^(?:"+ve.replace(/[\s,]+/g,"|")+")\\b"),null]),Je.push([g,/^\s+/,null,` \r
|
|
|
\xA0`]);var ae="^.[^\\s\\w.$@'\"`/\\\\]*";return ze.regexLiterals&&(ae+="(?!s*/)"),Qe.push([T,/^@[a-z_$][a-z_$@0-9]*/i,null],[y,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[g,/^[a-z_$][a-z_$@0-9]*/i,null],[T,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[g,/^\\[\s\S]?/,null],[O,new RegExp(ae),null]),be(Je,Qe)}var Ne=We({keywords:v,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function Le(ze,Je,Qe){for(var fe=/(?:^|\s)nocode(?:\s|$)/,ge=/\r\n?|\n/,xe=ze.ownerDocument,we=xe.createElement("li");ze.firstChild;)we.appendChild(ze.firstChild);var Te=[we];function re(je){var ot=je.nodeType;if(ot==1&&!fe.test(je.className))if(je.nodeName==="br")ve(je),je.parentNode&&je.parentNode.removeChild(je);else for(var ce=je.firstChild;ce;ce=ce.nextSibling)re(ce);else if((ot==3||ot==4)&&Qe){var Pe=je.nodeValue,Fe=Pe.match(ge);if(Fe){var Ce=Pe.substring(0,Fe.index);je.nodeValue=Ce;var _e=Pe.substring(Fe.index+Fe[0].length);if(_e){var Ee=je.parentNode;Ee.insertBefore(xe.createTextNode(_e),je.nextSibling)}ve(je),Ce||je.parentNode.removeChild(je)}}}function ve(je){for(;!je.nextSibling;)if(je=je.parentNode,!je)return;function ot(Fe,Ce){var _e=Ce?Fe.cloneNode(!1):Fe,Ee=Fe.parentNode;if(Ee){var ee=ot(Ee,1),oe=Fe.nextSibling;ee.appendChild(_e);for(var Q=oe;Q;Q=oe)oe=Q.nextSibling,ee.appendChild(Q)}return _e}for(var ce=ot(je.nextSibling,0),Pe;(Pe=ce.parentNode)&&Pe.nodeType===1;)ce=Pe;Te.push(ce)}for(var ae=0;ae<Te.length;++ae)re(Te[ae]);Je===(Je|0)&&Te[0].setAttribute("value",Je);var Me=xe.createElement("ol");Me.className="linenums";for(var Ye=Math.max(0,Je-1|0)||0,ae=0,et=Te.length;ae<et;++ae)we=Te[ae],we.className="L"+(ae+Ye)%10,we.firstChild||we.appendChild(xe.createTextNode("\xA0")),Me.appendChild(we);ze.appendChild(Me)}function Ke(ze){var Je=/\bMSIE\s(\d+)/.exec(navigator.userAgent);Je=Je&&+Je[1]<=8;var Qe=/\n/g,fe=ze.sourceCode,ge=fe.length,xe=0,we=ze.spans,Te=we.length,re=0,ve=ze.decorations,ae=ve.length,Me=0;ve[ae]=ge;var Ye,et;for(et=Ye=0;et<ae;)ve[et]!==ve[et+2]?(ve[Ye++]=ve[et++],ve[Ye++]=ve[et++]):et+=2;for(ae=Ye,et=Ye=0;et<ae;){for(var je=ve[et],ot=ve[et+1],ce=et+2;ce+2<=ae&&ve[ce+1]===ot;)ce+=2;ve[Ye++]=je,ve[Ye++]=ot,et=ce}ae=ve.length=Ye;var Pe=ze.sourceNode,Fe="";Pe&&(Fe=Pe.style.display,Pe.style.display="none");try{for(var Ce=null;re<Te;){var _e=we[re],Ee=we[re+2]||ge,ee=ve[Me+2]||ge,ce=Math.min(Ee,ee),oe=we[re+1],Q;if(oe.nodeType!==1&&(Q=fe.substring(xe,ce))){Je&&(Q=Q.replace(Qe,"\r")),oe.nodeValue=Q;var me=oe.ownerDocument,Oe=me.createElement("span");Oe.className=ve[Me+1];var V=oe.parentNode;V.replaceChild(Oe,oe),Oe.appendChild(oe),xe<Ee&&(we[re+1]=oe=me.createTextNode(fe.substring(ce,Ee)),V.insertBefore(oe,Oe.nextSibling))}xe=ce,xe>=Ee&&(re+=2),xe>=ee&&(Me+=2)}}finally{Pe&&(Pe.style.display=Fe)}}var He={};function Ae(ze,Je){for(var Qe=Je.length;--Qe>=0;){var fe=Je[Qe];He.hasOwnProperty(fe)?b.console&&console.warn("cannot override language handler %s",fe):He[fe]=ze}}function Se(ze,Je){return ze&&He.hasOwnProperty(ze)||(ze=/^\s*</.test(Je)?"default-markup":"default-code"),He[ze]}Ae(Ne,["default-code"]),Ae(be([],[[g,/^[^<?]+/],[P,/^<!\w[^>]*(?:>|$)/],[_,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[O,/^(?:<[%?]|[%?]>)/],["lang-",/^<xmp\b[^>]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^<script\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^<style\b[^>]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]),Ae(be([[g,/^[\s]+/,null,` \r
|
|
|
`],[j,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,`"'`]],[[F,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[X,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[O,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]),Ae(be([],[[j,/^[\s\S]+/]]),["uq.val"]),Ae(We({keywords:h,hashComments:!0,cStyleComments:!0,types:m}),["c","cc","cpp","cxx","cyc","m"]),Ae(We({keywords:"null,true,false"}),["json"]),Ae(We({keywords:a,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:m}),["cs"]),Ae(We({keywords:n,cStyleComments:!0}),["java"]),Ae(We({keywords:f,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),Ae(We({keywords:u,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),Ae(We({keywords:s,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),Ae(We({keywords:d,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),Ae(We({keywords:r,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),Ae(We({keywords:t,hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),Ae(be([],[[S,/^[\s\S]+/]]),["regex"]);function he(ze){var Je=ze.langExtension;try{var Qe=k(ze.sourceNode,ze.pre),fe=Qe.sourceCode;ze.sourceCode=fe,ze.spans=Qe.spans,ze.basePos=0,Se(Je,fe)(ze),Ke(ze)}catch(ge){b.console&&console.log(ge&&ge.stack||ge)}}function Ie(ze,Je,Qe){var fe=Qe||!1,ge=Je||null,xe=document.createElement("div");xe.innerHTML="<pre>"+ze+"</pre>",xe=xe.firstChild,fe&&Le(xe,fe,!0);var we={langExtension:ge,numberLines:fe,sourceNode:xe,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null};return he(we),xe.innerHTML}function ye(ze,Je){var Qe=Je||document.body,fe=Qe.ownerDocument||document;function ge(_e){return Qe.getElementsByTagName(_e)}for(var xe=[ge("pre"),ge("code"),ge("xmp")],we=[],Te=0;Te<xe.length;++Te)for(var re=0,ve=xe[Te].length;re<ve;++re)we.push(xe[Te][re]);xe=null;var ae=Date;ae.now||(ae={now:function(){return+new Date}});var Me=0,Ye=/\blang(?:uage)?-([\w.]+)(?!\S)/,et=/\bprettyprint\b/,je=/\bprettyprinted\b/,ot=/pre|xmp/i,ce=/^code$/i,Pe=/^(?:pre|code|xmp)$/i,Fe={};function Ce(){for(var _e=b.PR_SHOULD_USE_CONTINUATION?ae.now()+250:Infinity;Me<we.length&&ae.now()<_e;Me++){for(var Ee=we[Me],ee=Fe,oe=Ee;oe=oe.previousSibling;){var Q=oe.nodeType,me=(Q===7||Q===8)&&oe.nodeValue;if(me?!/^\??prettify\b/.test(me):Q!==3||/\S/.test(oe.nodeValue))break;if(me){ee={},me.replace(/\b(\w+)=([\w:.%+-]+)/g,function(St,vt,Bt){ee[vt]=Bt});break}}var Oe=Ee.className;if((ee!==Fe||et.test(Oe))&&!je.test(Oe)){for(var V=!1,Re=Ee.parentNode;Re;Re=Re.parentNode){var Xe=Re.tagName;if(Pe.test(Xe)&&Re.className&&et.test(Re.className)){V=!0;break}}if(!V){Ee.className+=" prettyprinted";var pe=ee.lang;if(!pe){pe=Oe.match(Ye);var ke;!pe&&(ke=de(Ee))&&ce.test(ke.tagName)&&(pe=ke.className.match(Ye)),pe&&(pe=pe[1])}var Ve;if(ot.test(Ee.tagName))Ve=1;else{var ht=Ee.currentStyle,tt=fe.defaultView,at=ht?ht.whiteSpace:tt&&tt.getComputedStyle?tt.getComputedStyle(Ee,null).getPropertyValue("white-space"):0;Ve=at&&at.substring(0,3)==="pre"}var ut=ee.linenums;(ut=ut==="true"||+ut)||(ut=Oe.match(/\blinenums\b(?::(\d+))?/),ut=ut?ut[1]&&ut[1].length?+ut[1]:!0:!1),ut&&Le(Ee,ut,Ve);var Ft={langExtension:pe,sourceNode:Ee,numberLines:ut,pre:Ve,sourceCode:null,basePos:null,spans:null,decorations:null};he(Ft)}}}Me<we.length?b.setTimeout(Ce,250):typeof ze=="function"&&ze()}Ce()}var Ge=b.PR={createSimpleLexer:be,registerLangHandler:Ae,sourceDecorator:We,PR_ATTRIB_NAME:X,PR_ATTRIB_VALUE:j,PR_COMMENT:_,PR_DECLARATION:P,PR_KEYWORD:C,PR_LITERAL:T,PR_NOCODE:A,PR_PLAIN:g,PR_PUNCTUATION:O,PR_SOURCE:N,PR_STRING:S,PR_TAG:F,PR_TYPE:y,prettyPrintOne:I?b.prettyPrintOne=Ie:p=Ie,prettyPrint:E=I?b.prettyPrint=ye:E=ye},$e=b.define;typeof $e=="function"&&$e.amd&&$e("google-code-prettify",[],function(){return Ge})})()},SZEN:function(it,ne,q){"use strict";Object.defineProperty(ne,"__esModule",{value:!0}),ne.clientToElement=G;function G(L,I,R){var M=R.getBoundingClientRect(),p={x:0,y:0};return L<M.left?p.x=0:L>=M.right?p.x=M.width-1:p.x=L-M.left,I<M.top?p.y=0:I>=M.bottom?p.y=M.height-1:p.y=I-M.top,p}},SgaC:function(it,ne,q){"use strict";Object.defineProperty(ne,"__esModule",{value:!0}),ne.default=void 0;function G(M,p){if(!(M instanceof p))throw new TypeError("Cannot call a class as a function")}function L(M,p){for(var E=0;E<p.length;E++){var b=p[E];b.enumerable=b.enumerable||!1,b.configurable=!0,"value"in b&&(b.writable=!0),Object.defineProperty(M,b.key,b)}}function I(M,p,E){return p&&L(M.prototype,p),E&&L(M,E),M}var R=function(){function M(){G(this,M),this._subrects=0}return I(M,[{key:"decodeRect",value:function(E,b,i,c,o,h,n){if(this._subrects===0){if(o.rQwait("RRE",4+4))return!1;this._subrects=o.rQshift32();var a=o.rQshiftBytes(4);h.fillRect(E,b,i,c,a)}for(;this._subrects>0;){if(o.rQwait("RRE",4+8))return!1;var t=o.rQshiftBytes(4),r=o.rQshift16(),s=o.rQshift16(),u=o.rQshift16(),d=o.rQshift16();h.fillRect(E+r,b+s,u,d,t),this._subrects--}return!0}}]),M}();ne.default=R},T8No:function(it,ne,q){"use strict";q.d(ne,"a",function(){return E}),q.d(ne,"e",function(){return b}),q.d(ne,"c",function(){return O}),q.d(ne,"b",function(){return g}),q.d(ne,"d",function(){return F}),q.d(ne,"f",function(){return X});var G=q("MNsG"),L=q("N0LK"),I=q("Cg/j");let R=G.k||"";const M=new Map;M.set("false",!1),M.set("true",!0),M.set("isMac",G.f),M.set("isLinux",G.d),M.set("isWindows",G.i),M.set("isWeb",G.h),M.set("isMacNative",G.f&&!G.h),M.set("isEdge",R.indexOf("Edg/")>=0),M.set("isFirefox",R.indexOf("Firefox")>=0),M.set("isChrome",R.indexOf("Chrome")>=0),M.set("isSafari",R.indexOf("Safari")>=0);const p=Object.prototype.hasOwnProperty;class E{static has(A){return h.create(A)}static equals(A,K){return n.create(A,K)}static regex(A,K){return S.create(A,K)}static not(A){return s.create(A)}static and(...A){return y.create(A,null)}static or(...A){return T.create(A,null,!0)}static deserialize(A,K=!1){return A?this._deserializeOrExpression(A,K):void 0}static _deserializeOrExpression(A,K){let U=A.split("||");return T.create(U.map(k=>this._deserializeAndExpression(k,K)),null,!0)}static _deserializeAndExpression(A,K){let U=A.split("&&");return y.create(U.map(k=>this._deserializeOne(k,K)),null)}static _deserializeOne(A,K){if(A=A.trim(),A.indexOf("!=")>=0){let U=A.split("!=");return r.create(U[0].trim(),this._deserializeValue(U[1],K))}if(A.indexOf("==")>=0){let U=A.split("==");return n.create(U[0].trim(),this._deserializeValue(U[1],K))}if(A.indexOf("=~")>=0){let U=A.split("=~");return S.create(U[0].trim(),this._deserializeRegexValue(U[1],K))}if(A.indexOf(" in ")>=0){let U=A.split(" in ");return a.create(U[0].trim(),U[1].trim())}if(/^[^<=>]+>=[^<=>]+$/.test(A)){const U=A.split(">=");return f.create(U[0].trim(),U[1].trim())}if(/^[^<=>]+>[^<=>]+$/.test(A)){const U=A.split(">");return d.create(U[0].trim(),U[1].trim())}if(/^[^<=>]+<=[^<=>]+$/.test(A)){const U=A.split("<=");return m.create(U[0].trim(),U[1].trim())}if(/^[^<=>]+<[^<=>]+$/.test(A)){const U=A.split("<");return v.create(U[0].trim(),U[1].trim())}return/^\!\s*/.test(A)?s.create(A.substr(1).trim()):h.create(A)}static _deserializeValue(A,K){if(A=A.trim(),A==="true")return!0;if(A==="false")return!1;let U=/^'([^']*)'$/.exec(A);return U?U[1].trim():A}static _deserializeRegexValue(A,K){if(Object(L.C)(A)){if(K)throw new Error("missing regexp-value for =~-expression");return console.warn("missing regexp-value for =~-expression"),null}let U=A.indexOf("/"),k=A.lastIndexOf("/");if(U===k||U<0){if(K)throw new Error(`bad regexp-value '${A}', missing /-enclosure`);return console.warn(`bad regexp-value '${A}', missing /-enclosure`),null}let z=A.slice(U+1,k),te=A[k+1]==="i"?"i":"";try{return new RegExp(z,te)}catch(de){if(K)throw new Error(`bad regexp-value '${A}', parse error: ${de}`);return console.warn(`bad regexp-value '${A}', parse error: ${de}`),null}}}function b(A,K){const U=A?A.substituteConstants():void 0,k=K?K.substituteConstants():void 0;return!U&&!k?!0:!U||!k?!1:U.equals(k)}function i(A,K){return A.cmp(K)}class c{constructor(){this.type=0}cmp(A){return this.type-A.type}equals(A){return A.type===this.type}substituteConstants(){return this}evaluate(A){return!1}serialize(){return"false"}keys(){return[]}negate(){return o.INSTANCE}}c.INSTANCE=new c;class o{constructor(){this.type=1}cmp(A){return this.type-A.type}equals(A){return A.type===this.type}substituteConstants(){return this}evaluate(A){return!0}serialize(){return"true"}keys(){return[]}negate(){return c.INSTANCE}}o.INSTANCE=new o;class h{constructor(A,K){this.key=A,this.negated=K,this.type=2}static create(A,K=null){const U=M.get(A);return typeof U=="boolean"?U?o.INSTANCE:c.INSTANCE:new h(A,K)}cmp(A){return A.type!==this.type?this.type-A.type:P(this.key,A.key)}equals(A){return A.type===this.type?this.key===A.key:!1}substituteConstants(){const A=M.get(this.key);return typeof A=="boolean"?A?o.INSTANCE:c.INSTANCE:this}evaluate(A){return!!A.getValue(this.key)}serialize(){return this.key}keys(){return[this.key]}negate(){return this.negated||(this.negated=s.create(this.key,this)),this.negated}}class n{constructor(A,K,U){this.key=A,this.value=K,this.negated=U,this.type=4}static create(A,K,U=null){if(typeof K=="boolean")return K?h.create(A,U):s.create(A,U);const k=M.get(A);if(typeof k=="boolean"){const z=k?"true":"false";return K===z?o.INSTANCE:c.INSTANCE}return new n(A,K,U)}cmp(A){return A.type!==this.type?this.type-A.type:N(this.key,this.value,A.key,A.value)}equals(A){return A.type===this.type?this.key===A.key&&this.value===A.value:!1}substituteConstants(){const A=M.get(this.key);if(typeof A=="boolean"){const K=A?"true":"false";return this.value===K?o.INSTANCE:c.INSTANCE}return this}evaluate(A){return A.getValue(this.key)==this.value}serialize(){return`${this.key} == '${this.value}'`}keys(){return[this.key]}negate(){return this.negated||(this.negated=r.create(this.key,this.value,this)),this.negated}}class a{constructor(A,K){this.key=A,this.valueKey=K,this.type=10,this.negated=null}static create(A,K){return new a(A,K)}cmp(A){return A.type!==this.type?this.type-A.type:N(this.key,this.valueKey,A.key,A.valueKey)}equals(A){return A.type===this.type?this.key===A.key&&this.valueKey===A.valueKey:!1}substituteConstants(){return this}evaluate(A){const K=A.getValue(this.valueKey),U=A.getValue(this.key);return Array.isArray(K)?K.indexOf(U)>=0:typeof U=="string"&&typeof K=="object"&&K!==null?p.call(K,U):!1}serialize(){return`${this.key} in '${this.valueKey}'`}keys(){return[this.key,this.valueKey]}negate(){return this.negated||(this.negated=t.create(this)),this.negated}}class t{constructor(A){this._actual=A,this.type=11}static create(A){return new t(A)}cmp(A){return A.type!==this.type?this.type-A.type:this._actual.cmp(A._actual)}equals(A){return A.type===this.type?this._actual.equals(A._actual):!1}substituteConstants(){return this}evaluate(A){return!this._actual.evaluate(A)}serialize(){throw new Error("Method not implemented.")}keys(){return this._actual.keys()}negate(){return this._actual}}class r{constructor(A,K,U){this.key=A,this.value=K,this.negated=U,this.type=5}static create(A,K,U=null){if(typeof K=="boolean")return K?s.create(A,U):h.create(A,U);const k=M.get(A);if(typeof k=="boolean"){const z=k?"true":"false";return K===z?c.INSTANCE:o.INSTANCE}return new r(A,K,U)}cmp(A){return A.type!==this.type?this.type-A.type:N(this.key,this.value,A.key,A.value)}equals(A){return A.type===this.type?this.key===A.key&&this.value===A.value:!1}substituteConstants(){const A=M.get(this.key);if(typeof A=="boolean"){const K=A?"true":"false";return this.value===K?c.INSTANCE:o.INSTANCE}return this}evaluate(A){return A.getValue(this.key)!=this.value}serialize(){return`${this.key} != '${this.value}'`}keys(){return[this.key]}negate(){return this.negated||(this.negated=n.create(this.key,this.value,this)),this.negated}}class s{constructor(A,K){this.key=A,this.negated=K,this.type=3}static create(A,K=null){const U=M.get(A);return typeof U=="boolean"?U?c.INSTANCE:o.INSTANCE:new s(A,K)}cmp(A){return A.type!==this.type?this.type-A.type:P(this.key,A.key)}equals(A){return A.type===this.type?this.key===A.key:!1}substituteConstants(){const A=M.get(this.key);return typeof A=="boolean"?A?c.INSTANCE:o.INSTANCE:this}evaluate(A){return!A.getValue(this.key)}serialize(){return`!${this.key}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=h.create(this.key,this)),this.negated}}function u(A,K){if(typeof A=="string"){const U=parseFloat(A);isNaN(U)||(A=U)}return typeof A=="string"||typeof A=="number"?K(A):c.INSTANCE}class d{constructor(A,K,U){this.key=A,this.value=K,this.negated=U,this.type=12}static create(A,K,U=null){return u(K,k=>new d(A,k,U))}cmp(A){return A.type!==this.type?this.type-A.type:N(this.key,this.value,A.key,A.value)}equals(A){return A.type===this.type?this.key===A.key&&this.value===A.value:!1}substituteConstants(){return this}evaluate(A){return typeof this.value=="string"?!1:parseFloat(A.getValue(this.key))>this.value}serialize(){return`${this.key} > ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=m.create(this.key,this.value,this)),this.negated}}class f{constructor(A,K,U){this.key=A,this.value=K,this.negated=U,this.type=13}static create(A,K,U=null){return u(K,k=>new f(A,k,U))}cmp(A){return A.type!==this.type?this.type-A.type:N(this.key,this.value,A.key,A.value)}equals(A){return A.type===this.type?this.key===A.key&&this.value===A.value:!1}substituteConstants(){return this}evaluate(A){return typeof this.value=="string"?!1:parseFloat(A.getValue(this.key))>=this.value}serialize(){return`${this.key} >= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=v.create(this.key,this.value,this)),this.negated}}class v{constructor(A,K,U){this.key=A,this.value=K,this.negated=U,this.type=14}static create(A,K,U=null){return u(K,k=>new v(A,k,U))}cmp(A){return A.type!==this.type?this.type-A.type:N(this.key,this.value,A.key,A.value)}equals(A){return A.type===this.type?this.key===A.key&&this.value===A.value:!1}substituteConstants(){return this}evaluate(A){return typeof this.value=="string"?!1:parseFloat(A.getValue(this.key))<this.value}serialize(){return`${this.key} < ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=f.create(this.key,this.value,this)),this.negated}}class m{constructor(A,K,U){this.key=A,this.value=K,this.negated=U,this.type=15}static create(A,K,U=null){return u(K,k=>new m(A,k,U))}cmp(A){return A.type!==this.type?this.type-A.type:N(this.key,this.value,A.key,A.value)}equals(A){return A.type===this.type?this.key===A.key&&this.value===A.value:!1}substituteConstants(){return this}evaluate(A){return typeof this.value=="string"?!1:parseFloat(A.getValue(this.key))<=this.value}serialize(){return`${this.key} <= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=d.create(this.key,this.value,this)),this.negated}}class S{constructor(A,K){this.key=A,this.regexp=K,this.type=7,this.negated=null}static create(A,K){return new S(A,K)}cmp(A){if(A.type!==this.type)return this.type-A.type;if(this.key<A.key)return-1;if(this.key>A.key)return 1;const K=this.regexp?this.regexp.source:"",U=A.regexp?A.regexp.source:"";return K<U?-1:K>U?1:0}equals(A){if(A.type===this.type){const K=this.regexp?this.regexp.source:"",U=A.regexp?A.regexp.source:"";return this.key===A.key&&K===U}return!1}substituteConstants(){return this}evaluate(A){let K=A.getValue(this.key);return this.regexp?this.regexp.test(K):!1}serialize(){const A=this.regexp?`/${this.regexp.source}/${this.regexp.ignoreCase?"i":""}`:"/invalid/";return`${this.key} =~ ${A}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=C.create(this)),this.negated}}class C{constructor(A){this._actual=A,this.type=8}static create(A){return new C(A)}cmp(A){return A.type!==this.type?this.type-A.type:this._actual.cmp(A._actual)}equals(A){return A.type===this.type?this._actual.equals(A._actual):!1}substituteConstants(){return this}evaluate(A){return!this._actual.evaluate(A)}serialize(){throw new Error("Method not implemented.")}keys(){return this._actual.keys()}negate(){return this._actual}}function _(A){let K=null;for(let U=0,k=A.length;U<k;U++){const z=A[U].substituteConstants();if(A[U]!==z&&K===null){K=[];for(let te=0;te<U;te++)K[te]=A[te]}K!==null&&(K[U]=z)}return K===null?A:K}class y{constructor(A,K){this.expr=A,this.negated=K,this.type=6}static create(A,K){return y._normalizeArr(A,K)}cmp(A){if(A.type!==this.type)return this.type-A.type;if(this.expr.length<A.expr.length)return-1;if(this.expr.length>A.expr.length)return 1;for(let K=0,U=this.expr.length;K<U;K++){const k=i(this.expr[K],A.expr[K]);if(k!==0)return k}return 0}equals(A){if(A.type===this.type){if(this.expr.length!==A.expr.length)return!1;for(let K=0,U=this.expr.length;K<U;K++)if(!this.expr[K].equals(A.expr[K]))return!1;return!0}return!1}substituteConstants(){const A=_(this.expr);return A===this.expr?this:y.create(A,this.negated)}evaluate(A){for(let K=0,U=this.expr.length;K<U;K++)if(!this.expr[K].evaluate(A))return!1;return!0}static _normalizeArr(A,K){const U=[];let k=!1;for(const z of A){if(!z)continue;if(z.type===1){k=!0;continue}if(z.type===0)return c.INSTANCE;if(z.type===6){U.push(...z.expr);continue}U.push(z)}if(U.length===0&&k)return o.INSTANCE;if(U.length===0)return;if(U.length===1)return U[0];U.sort(i);for(let z=1;z<U.length;z++)U[z-1].equals(U[z])&&(U.splice(z,1),z--);if(U.length===1)return U[0];for(;U.length>1;){const z=U[U.length-1];if(z.type!==9)break;U.pop();const te=U.pop(),de=U.length===0,be=T.create(z.expr.map(We=>y.create([We,te],null)),null,de);be&&(U.push(be),U.sort(i))}return U.length===1?U[0]:new y(U,K)}serialize(){return this.expr.map(A=>A.serialize()).join(" && ")}keys(){const A=[];for(let K of this.expr)A.push(...K.keys());return A}negate(){if(!this.negated){const A=[];for(let K of this.expr)A.push(K.negate());this.negated=T.create(A,this,!0)}return this.negated}}class T{constructor(A,K){this.expr=A,this.negated=K,this.type=9}static create(A,K,U){return T._normalizeArr(A,K,U)}cmp(A){if(A.type!==this.type)return this.type-A.type;if(this.expr.length<A.expr.length)return-1;if(this.expr.length>A.expr.length)return 1;for(let K=0,U=this.expr.length;K<U;K++){const k=i(this.expr[K],A.expr[K]);if(k!==0)return k}return 0}equals(A){if(A.type===this.type){if(this.expr.length!==A.expr.length)return!1;for(let K=0,U=this.expr.length;K<U;K++)if(!this.expr[K].equals(A.expr[K]))return!1;return!0}return!1}substituteConstants(){const A=_(this.expr);return A===this.expr?this:T.create(A,this.negated,!1)}evaluate(A){for(let K=0,U=this.expr.length;K<U;K++)if(this.expr[K].evaluate(A))return!0;return!1}static _normalizeArr(A,K,U){let k=[],z=!1;if(A){for(let te=0,de=A.length;te<de;te++){const be=A[te];if(!be)continue;if(be.type===0){z=!0;continue}if(be.type===1)return o.INSTANCE;if(be.type===9){k=k.concat(be.expr);continue}k.push(be)}if(k.length===0&&z)return c.INSTANCE;k.sort(i)}if(k.length===0)return;if(k.length===1)return k[0];for(let te=1;te<k.length;te++)k[te-1].equals(k[te])&&(k.splice(te,1),te--);if(k.length===1)return k[0];if(U){for(let te=0;te<k.length;te++)for(let de=te+1;de<k.length;de++)X(k[te],k[de])&&(k.splice(de,1),de--);if(k.length===1)return k[0]}return new T(k,K)}serialize(){return this.expr.map(A=>A.serialize()).join(" || ")}keys(){const A=[];for(let K of this.expr)A.push(...K.keys());return A}negate(){if(!this.negated){let A=[];for(let K of this.expr)A.push(K.negate());for(;A.length>1;){const K=A.shift(),U=A.shift(),k=[];for(const te of j(K))for(const de of j(U))k.push(y.create([te,de],null));const z=A.length===0;A.unshift(T.create(k,null,z))}this.negated=A[0]}return this.negated}}class O extends h{constructor(A,K,U){super(A,null);this._defaultValue=K,typeof U=="object"?O._info.push(Object.assign(Object.assign({},U),{key:A})):U!==!0&&O._info.push({key:A,description:U,type:K!=null?typeof K:void 0})}static all(){return O._info.values()}bindTo(A){return A.createKey(this.key,this._defaultValue)}getValue(A){return A.getContextKeyValue(this.key)}toNegated(){return this.negate()}isEqualTo(A){return n.create(this.key,A)}}O._info=[];const g=Object(I.c)("contextKeyService"),F="setContext";function P(A,K){return A<K?-1:A>K?1:0}function N(A,K,U,k){return A<U?-1:A>U?1:K<k?-1:K>k?1:0}function X(A,K){if(K.type===6&&A.type!==9&&A.type!==6){for(const z of K.expr)if(A.equals(z))return!0}const U=A.negate(),k=j(U).concat(j(K));k.sort(i);for(let z=0;z<k.length;z++){const te=k[z],de=te.negate();for(let be=z+1;be<k.length;be++){const We=k[be];if(de.equals(We))return!0}}return!1}function j(A){return A.type===9?A.expr:[A]}},TXwP:function(it,ne,q){var G,L;(function(){var I;(function(){"use strict";var M=[,,function(i){function c(n){this.__parent=n,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=[]}c.prototype.clone_empty=function(){var n=new c(this.__parent);return n.set_indent(this.__indent_count,this.__alignment_count),n},c.prototype.item=function(n){return n<0?this.__items[this.__items.length+n]:this.__items[n]},c.prototype.has_match=function(n){for(var a=this.__items.length-1;a>=0;a--)if(this.__items[a].match(n))return!0;return!1},c.prototype.set_indent=function(n,a){this.is_empty()&&(this.__indent_count=n||0,this.__alignment_count=a||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},c.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)},c.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},c.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var n=this.__parent.current_line;return n.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),n.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),n.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,n.__items[0]===" "&&(n.__items.splice(0,1),n.__character_count-=1),!0}return!1},c.prototype.is_empty=function(){return this.__items.length===0},c.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},c.prototype.push=function(n){this.__items.push(n);var a=n.lastIndexOf(`
|
|
|
`);a!==-1?this.__character_count=n.length-a:this.__character_count+=n.length},c.prototype.pop=function(){var n=null;return this.is_empty()||(n=this.__items.pop(),this.__character_count-=n.length),n},c.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},c.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},c.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},c.prototype.toString=function(){var n="";return this.is_empty()?this.__parent.indent_empty_lines&&(n=this.__parent.get_indent_string(this.__indent_count)):(n=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),n+=this.__items.join("")),n};function o(n,a){this.__cache=[""],this.__indent_size=n.indent_size,this.__indent_string=n.indent_char,n.indent_with_tabs||(this.__indent_string=new Array(n.indent_size+1).join(n.indent_char)),a=a||"",n.indent_level>0&&(a=new Array(n.indent_level+1).join(this.__indent_string)),this.__base_string=a,this.__base_string_length=a.length}o.prototype.get_indent_size=function(n,a){var t=this.__base_string_length;return a=a||0,n<0&&(t=0),t+=n*this.__indent_size,t+=a,t},o.prototype.get_indent_string=function(n,a){var t=this.__base_string;return a=a||0,n<0&&(n=0,t=""),a+=n*this.__indent_size,this.__ensure_cache(a),t+=this.__cache[a],t},o.prototype.__ensure_cache=function(n){for(;n>=this.__cache.length;)this.__add_column()},o.prototype.__add_column=function(){var n=this.__cache.length,a=0,t="";this.__indent_size&&n>=this.__indent_size&&(a=Math.floor(n/this.__indent_size),n-=a*this.__indent_size,t=new Array(a+1).join(this.__indent_string)),n&&(t+=new Array(n+1).join(" ")),this.__cache.push(t)};function h(n,a){this.__indent_cache=new o(n,a),this.raw=!1,this._end_with_newline=n.end_with_newline,this.indent_size=n.indent_size,this.wrap_line_length=n.wrap_line_length,this.indent_empty_lines=n.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new c(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}h.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},h.prototype.get_line_number=function(){return this.__lines.length},h.prototype.get_indent_string=function(n,a){return this.__indent_cache.get_indent_string(n,a)},h.prototype.get_indent_size=function(n,a){return this.__indent_cache.get_indent_size(n,a)},h.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},h.prototype.add_new_line=function(n){return this.is_empty()||!n&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},h.prototype.get_code=function(n){this.trim(!0);var a=this.current_line.pop();a&&(a[a.length-1]===`
|
|
|
`&&(a=a.replace(/\n+$/g,"")),this.current_line.push(a)),this._end_with_newline&&this.__add_outputline();var t=this.__lines.join(`
|
|
|
`);return n!==`
|
|
|
`&&(t=t.replace(/[\n]/g,n)),t},h.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},h.prototype.set_indent=function(n,a){return n=n||0,a=a||0,this.next_line.set_indent(n,a),this.__lines.length>1?(this.current_line.set_indent(n,a),!0):(this.current_line.set_indent(),!1)},h.prototype.add_raw_token=function(n){for(var a=0;a<n.newlines;a++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(n.whitespace_before),this.current_line.push(n.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},h.prototype.add_token=function(n){this.__add_space_before_token(),this.current_line.push(n),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},h.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(" "))},h.prototype.remove_indent=function(n){for(var a=this.__lines.length;n<a;)this.__lines[n]._remove_indent(),n++;this.current_line._remove_wrap_indent()},h.prototype.trim=function(n){for(n=n===void 0?!1:n,this.current_line.trim();n&&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},h.prototype.just_added_newline=function(){return this.current_line.is_empty()},h.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},h.prototype.ensure_empty_line_above=function(n,a){for(var t=this.__lines.length-2;t>=0;){var r=this.__lines[t];if(r.is_empty())break;if(r.item(0).indexOf(n)!==0&&r.item(-1)!==a){this.__lines.splice(t+1,0,new c(this)),this.previous_line=this.__lines[this.__lines.length-2];break}t--}},i.exports.Output=h},,,,function(i){function c(n,a){this.raw_options=o(n,a),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","django","erb","handlebars","php","smarty"],["auto"])}c.prototype._get_array=function(n,a){var t=this.raw_options[n],r=a||[];return typeof t=="object"?t!==null&&typeof t.concat=="function"&&(r=t.concat()):typeof t=="string"&&(r=t.split(/[^a-zA-Z0-9_\/\-]+/)),r},c.prototype._get_boolean=function(n,a){var t=this.raw_options[n],r=t===void 0?!!a:!!t;return r},c.prototype._get_characters=function(n,a){var t=this.raw_options[n],r=a||"";return typeof t=="string"&&(r=t.replace(/\\r/,"\r").replace(/\\n/,`
|
|
|
`).replace(/\\t/," ")),r},c.prototype._get_number=function(n,a){var t=this.raw_options[n];a=parseInt(a,10),isNaN(a)&&(a=0);var r=parseInt(t,10);return isNaN(r)&&(r=a),r},c.prototype._get_selection=function(n,a,t){var r=this._get_selection_list(n,a,t);if(r.length!==1)throw new Error("Invalid Option Value: The option '"+n+`' can only be one of the following values:
|
|
|
`+a+`
|
|
|
You passed in: '`+this.raw_options[n]+"'");return r[0]},c.prototype._get_selection_list=function(n,a,t){if(!a||a.length===0)throw new Error("Selection list cannot be empty.");if(t=t||[a[0]],!this._is_valid_selection(t,a))throw new Error("Invalid Default Value!");var r=this._get_array(n,t);if(!this._is_valid_selection(r,a))throw new Error("Invalid Option Value: The option '"+n+`' can contain only the following values:
|
|
|
`+a+`
|
|
|
You passed in: '`+this.raw_options[n]+"'");return r},c.prototype._is_valid_selection=function(n,a){return n.length&&a.length&&!n.some(function(t){return a.indexOf(t)===-1})};function o(n,a){var t={};n=h(n);var r;for(r in n)r!==a&&(t[r]=n[r]);if(a&&n[a])for(r in n[a])t[r]=n[a][r];return t}function h(n){var a={},t;for(t in n){var r=t.replace(/-/g,"_");a[r]=n[t]}return a}i.exports.Options=c,i.exports.normalizeOpts=h,i.exports.mergeOpts=o},,function(i){var c=RegExp.prototype.hasOwnProperty("sticky");function o(h){this.__input=h||"",this.__input_length=this.__input.length,this.__position=0}o.prototype.restart=function(){this.__position=0},o.prototype.back=function(){this.__position>0&&(this.__position-=1)},o.prototype.hasNext=function(){return this.__position<this.__input_length},o.prototype.next=function(){var h=null;return this.hasNext()&&(h=this.__input.charAt(this.__position),this.__position+=1),h},o.prototype.peek=function(h){var n=null;return h=h||0,h+=this.__position,h>=0&&h<this.__input_length&&(n=this.__input.charAt(h)),n},o.prototype.__match=function(h,n){h.lastIndex=n;var a=h.exec(this.__input);return a&&!(c&&h.sticky)&&(a.index!==n&&(a=null)),a},o.prototype.test=function(h,n){return n=n||0,n+=this.__position,n>=0&&n<this.__input_length?!!this.__match(h,n):!1},o.prototype.testChar=function(h,n){var a=this.peek(n);return h.lastIndex=0,a!==null&&h.test(a)},o.prototype.match=function(h){var n=this.__match(h,this.__position);return n?this.__position+=n[0].length:n=null,n},o.prototype.read=function(h,n,a){var t="",r;return h&&(r=this.match(h),r&&(t+=r[0])),n&&(r||!h)&&(t+=this.readUntil(n,a)),t},o.prototype.readUntil=function(h,n){var a="",t=this.__position;h.lastIndex=this.__position;var r=h.exec(this.__input);return r?(t=r.index,n&&(t+=r[0].length)):t=this.__input_length,a=this.__input.substring(this.__position,t),this.__position=t,a},o.prototype.readUntilAfter=function(h){return this.readUntil(h,!0)},o.prototype.get_regexp=function(h,n){var a=null,t="g";return n&&c&&(t="y"),typeof h=="string"&&h!==""?a=new RegExp(h,t):h&&(a=new RegExp(h.source,t)),a},o.prototype.get_literal_regexp=function(h){return RegExp(h.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},o.prototype.peekUntilAfter=function(h){var n=this.__position,a=this.readUntilAfter(h);return this.__position=n,a},o.prototype.lookBack=function(h){var n=this.__position-1;return n>=h.length&&this.__input.substring(n-h.length,n).toLowerCase()===h},i.exports.InputScanner=o},,,,,function(i){function c(o,h){o=typeof o=="string"?o:o.source,h=typeof h=="string"?h:h.source,this.__directives_block_pattern=new RegExp(o+/ beautify( \w+[:]\w+)+ /.source+h,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(o+/\sbeautify\signore:end\s/.source+h,"g")}c.prototype.get_directives=function(o){if(!o.match(this.__directives_block_pattern))return null;var h={};this.__directive_pattern.lastIndex=0;for(var n=this.__directive_pattern.exec(o);n;)h[n[1]]=n[2],n=this.__directive_pattern.exec(o);return h},c.prototype.readIgnored=function(o){return o.readUntilAfter(this.__directives_end_ignore_pattern)},i.exports.Directives=c},,function(i,c,o){var h=o(16).Beautifier,n=o(17).Options;function a(t,r){var s=new h(t,r);return s.beautify()}i.exports=a,i.exports.defaultOptions=function(){return new n}},function(i,c,o){var h=o(17).Options,n=o(2).Output,a=o(8).InputScanner,t=o(13).Directives,r=new t(/\/\*/,/\*\//),s=/\r\n|[\r\n]/,u=/\r\n|[\r\n]/g,d=/\s/,f=/(?:\s|\n)+/g,v=/\/\*(?:[\s\S]*?)((?:\*\/)|$)/g,m=/\/\/(?:[^\n\r\u2028\u2029]*)/g;function S(C,_){this._source_text=C||"",this._options=new h(_),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"]}S.prototype.eatString=function(C){var _="";for(this._ch=this._input.next();this._ch;){if(_+=this._ch,this._ch==="\\")_+=this._input.next();else if(C.indexOf(this._ch)!==-1||this._ch===`
|
|
|
`)break;this._ch=this._input.next()}return _},S.prototype.eatWhitespace=function(C){for(var _=d.test(this._input.peek()),y=0;d.test(this._input.peek());)this._ch=this._input.next(),C&&this._ch===`
|
|
|
`&&((y===0||y<this._options.max_preserve_newlines)&&(y++,this._output.add_new_line(!0)));return _},S.prototype.foundNestedPseudoClass=function(){for(var C=0,_=1,y=this._input.peek(_);y;){if(y==="{")return!0;if(y==="(")C+=1;else if(y===")"){if(C===0)return!1;C-=1}else if(y===";"||y==="}")return!1;_++,y=this._input.peek(_)}return!1},S.prototype.print_string=function(C){this._output.set_indent(this._indentLevel),this._output.non_breaking_space=!0,this._output.add_token(C)},S.prototype.preserveSingleSpace=function(C){C&&(this._output.space_before_token=!0)},S.prototype.indent=function(){this._indentLevel++},S.prototype.outdent=function(){this._indentLevel>0&&this._indentLevel--},S.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var C=this._source_text,_=this._options.eol;_==="auto"&&(_=`
|
|
|
`,C&&s.test(C||"")&&(_=C.match(s)[0])),C=C.replace(u,`
|
|
|
`);var y=C.match(/^[\t ]*/)[0];this._output=new n(this._options,y),this._input=new a(C),this._indentLevel=0,this._nestedLevel=0,this._ch=null;for(var T=0,O=!1,g=!1,F=!1,P=!1,N=!1,X=!1,j=this._ch,A=!1,K,U,k;K=this._input.read(f),U=K!=="",k=j,this._ch=this._input.next(),this._ch==="\\"&&this._input.hasNext()&&(this._ch+=this._input.next()),j=this._ch,this._ch;)if(this._ch==="/"&&this._input.peek()==="*"){this._output.add_new_line(),this._input.back();var z=this._input.read(v),te=r.get_directives(z);te&&te.ignore==="start"&&(z+=r.readIgnored(this._input)),this.print_string(z),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(m)),this.eatWhitespace(!0);else if(this._ch==="@"||this._ch==="$")if(this.preserveSingleSpace(U),this._input.peek()==="{")this.print_string(this._ch+this.eatString("}"));else{this.print_string(this._ch);var de=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);de.match(/[ :]$/)&&(de=this.eatString(": ").replace(/\s$/,""),this.print_string(de),this._output.space_before_token=!0),de=de.replace(/\s$/,""),de==="extend"?P=!0:de==="import"&&(N=!0),de in this.NESTED_AT_RULE?(this._nestedLevel+=1,de in this.CONDITIONAL_GROUP_RULE&&(F=!0)):!O&&T===0&&de.indexOf(":")!==-1&&(g=!0,this.indent())}else if(this._ch==="#"&&this._input.peek()==="{")this.preserveSingleSpace(U),this.print_string(this._ch+this.eatString("}"));else if(this._ch==="{")g&&(g=!1,this.outdent()),F?(F=!1,O=this._indentLevel>=this._nestedLevel):O=this._indentLevel>=this._nestedLevel-1,this._options.newline_between_rules&&O&&(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)):(k==="("?this._output.space_before_token=!1:k!==","&&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(),k==="{"&&this._output.trim(!0),N=!1,P=!1,g&&(this.outdent(),g=!1),this.print_string(this._ch),O=!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 be=0;be<this.NON_SEMICOLON_NEWLINE_PROPERTY.length;be++)if(this._input.lookBack(this.NON_SEMICOLON_NEWLINE_PROPERTY[be])){A=!0;break}(O||F)&&!(this._input.lookBack("&")||this.foundNestedPseudoClass())&&!this._input.lookBack("(")&&!P&&T===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 We=k==='"'||k==="'";this.preserveSingleSpace(We||U),this.print_string(this._ch+this.eatString(this._ch)),this.eatWhitespace(!0)}else if(this._ch===";")A=!1,T===0?(g&&(this.outdent(),g=!1),P=!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(),T++,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(")")),T&&(T--,this.outdent()));else{var Ne=!1;this._input.lookBack("with")&&(Ne=!0),this.preserveSingleSpace(U||Ne),this.print_string(this._ch),g&&k==="$"&&this._options.selector_separator_newline?(this._output.add_new_line(),X=!0):(this.eatWhitespace(),T++,this.indent())}else if(this._ch===")")T&&(T--,this.outdent()),X&&this._input.peek()===";"&&this._options.selector_separator_newline&&(X=!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||X)&&T===0&&!N&&!P?this._output.add_new_line():this._output.space_before_token=!0;else if((this._ch===">"||this._ch==="+"||this._ch==="~")&&!g&&T===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._ch&&d.test(this._ch)&&(this._ch=""));else if(this._ch==="]")this.print_string(this._ch);else if(this._ch==="[")this.preserveSingleSpace(U),this.print_string(this._ch);else if(this._ch==="=")this.eatWhitespace(),this.print_string("="),d.test(this._ch)&&(this._ch="");else if(this._ch==="!"&&!this._input.lookBack("\\"))this._output.space_before_token=!0,this.print_string(this._ch);else{var Le=k==='"'||k==="'";this.preserveSingleSpace(Le||U),this.print_string(this._ch),!this._output.just_added_newline()&&this._input.peek()===`
|
|
|
`&&A&&this._output.add_new_line()}var Ke=this._output.get_code(_);return Ke},i.exports.Beautifier=S},function(i,c,o){var h=o(6).Options;function n(a){h.call(this,a,"css"),this.selector_separator_newline=this._get_boolean("selector_separator_newline",!0),this.newline_between_rules=this._get_boolean("newline_between_rules",!0);var t=this._get_boolean("space_around_selector_separator");this.space_around_combinator=this._get_boolean("space_around_combinator")||t;var r=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_style="collapse";for(var s=0;s<r.length;s++)r[s]!=="expand"?this.brace_style="collapse":this.brace_style=r[s]}n.prototype=new h,i.exports.Options=n}],p={};function E(i){var c=p[i];if(c!==void 0)return c.exports;var o=p[i]={exports:{}};return M[i](o,o.exports,E),o.exports}var b=E(15);I=b})();var R=I;!(G=[],L=function(){return{css_beautify:R}}.apply(ne,G),L!==void 0&&(it.exports=L))})()},VSMT:function(it,ne,q){"use strict";Object.defineProperty(ne,"__esModule",{value:!0}),ne.decodeUTF8=G,ne.encodeUTF8=L;function G(I){var R=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;try{return decodeURIComponent(escape(I))}catch(M){if(M instanceof URIError&&R)return I;throw M}}function L(I){return unescape(encodeURIComponent(I))}},"VaU+":function(it,ne,q){it.exports={wrp:"wrp___1lJPu",header:"header___2p05v",cuttDown:"cuttDown___1-ls7",container:"container___1Nx55",info:"info___2lI6e",buttons:"buttons___3Q0yr",fullBtn:"fullBtn___18HVx",shrink:"shrink___367DS",elseShrink:"elseShrink___3Anw7",spin:"spin___3h9s3"}},Vhoy:function(it,ne,q){"use strict";q.d(ne,"d",function(){return R}),q.d(ne,"e",function(){return M}),q.d(ne,"c",function(){return p}),q.d(ne,"b",function(){return E}),q.d(ne,"a",function(){return b});var G=q("MI8n");class L{constructor(){this._icons=new Map,this._onDidRegister=new G.b}add(i){const c=this._icons.get(i.id);c?i.description?c.description=i.description:console.error(`Duplicate registration of codicon ${i.id}`):(this._icons.set(i.id,i),this._onDidRegister.fire(i))}get(i){return this._icons.get(i)}get all(){return this._icons.values()}get onDidRegister(){return this._onDidRegister.event}}const I=new L,R=I;function M(i,c){return new E(i,c)}function p(i){return i?i.replace(/\$\((.*?)\)/g,(c,o)=>` ${o} `).trim():""}class E{constructor(i,c,o){this.id=i,this.definition=c,this.description=o,I.add(this)}get classNames(){return"codicon codicon-"+this.id}get classNamesArray(){return["codicon","codicon-"+this.id]}get cssSelector(){return".codicon.codicon-"+this.id}}var b;(function(i){i.iconNameSegment="[A-Za-z0-9]+",i.iconNameExpression="[A-Za-z0-9\\-]+",i.iconModifierExpression="~[A-Za-z]+";const c=new RegExp(`^(${i.iconNameExpression})(${i.iconModifierExpression})?$`);function o(a){if(a instanceof E)return["codicon","codicon-"+a.id];const t=c.exec(a.id);if(!t)return o(E.error);let[,r,s]=t;const u=["codicon","codicon-"+r];return s&&u.push("codicon-modifier-"+s.substr(1)),u}i.asClassNameArray=o;function h(a){return o(a).join(" ")}i.asClassName=h;function n(a){return"."+o(a).join(".")}i.asCSSSelector=n})(b||(b={})),function(i){i.add=new i("add",{fontCharacter:"\\ea60"}),i.plus=new i("plus",i.add.definition),i.gistNew=new i("gist-new",i.add.definition),i.repoCreate=new i("repo-create",i.add.definition),i.lightbulb=new i("lightbulb",{fontCharacter:"\\ea61"}),i.lightBulb=new i("light-bulb",{fontCharacter:"\\ea61"}),i.repo=new i("repo",{fontCharacter:"\\ea62"}),i.repoDelete=new i("repo-delete",{fontCharacter:"\\ea62"}),i.gistFork=new i("gist-fork",{fontCharacter:"\\ea63"}),i.repoForked=new i("repo-forked",{fontCharacter:"\\ea63"}),i.gitPullRequest=new i("git-pull-request",{fontCharacter:"\\ea64"}),i.gitPullRequestAbandoned=new i("git-pull-request-abandoned",{fontCharacter:"\\ea64"}),i.recordKeys=new i("record-keys",{fontCharacter:"\\ea65"}),i.keyboard=new i("keyboard",{fontCharacter:"\\ea65"}),i.tag=new i("tag",{fontCharacter:"\\ea66"}),i.tagAdd=new i("tag-add",{fontCharacter:"\\ea66"}),i.tagRemove=new i("tag-remove",{fontCharacter:"\\ea66"}),i.person=new i("person",{fontCharacter:"\\ea67"}),i.personFollow=new i("person-follow",{fontCharacter:"\\ea67"}),i.personOutline=new i("person-outline",{fontCharacter:"\\ea67"}),i.personFilled=new i("person-filled",{fontCharacter:"\\ea67"}),i.gitBranch=new i("git-branch",{fontCharacter:"\\ea68"}),i.gitBranchCreate=new i("git-branch-create",{fontCharacter:"\\ea68"}),i.gitBranchDelete=new i("git-branch-delete",{fontCharacter:"\\ea68"}),i.sourceControl=new i("source-control",{fontCharacter:"\\ea68"}),i.mirror=new i("mirror",{fontCharacter:"\\ea69"}),i.mirrorPublic=new i("mirror-public",{fontCharacter:"\\ea69"}),i.star=new i("star",{fontCharacter:"\\ea6a"}),i.starAdd=new i("star-add",{fontCharacter:"\\ea6a"}),i.starDelete=new i("star-delete",{fontCharacter:"\\ea6a"}),i.starEmpty=new i("star-empty",{fontCharacter:"\\ea6a"}),i.comment=new i("comment",{fontCharacter:"\\ea6b"}),i.commentAdd=new i("comment-add",{fontCharacter:"\\ea6b"}),i.alert=new i("alert",{fontCharacter:"\\ea6c"}),i.warning=new i("warning",{fontCharacter:"\\ea6c"}),i.search=new i("search",{fontCharacter:"\\ea6d"}),i.searchSave=new i("search-save",{fontCharacter:"\\ea6d"}),i.logOut=new i("log-out",{fontCharacter:"\\ea6e"}),i.signOut=new i("sign-out",{fontCharacter:"\\ea6e"}),i.logIn=new i("log-in",{fontCharacter:"\\ea6f"}),i.signIn=new i("sign-in",{fontCharacter:"\\ea6f"}),i.eye=new i("eye",{fontCharacter:"\\ea70"}),i.eyeUnwatch=new i("eye-unwatch",{fontCharacter:"\\ea70"}),i.eyeWatch=new i("eye-watch",{fontCharacter:"\\ea70"}),i.circleFilled=new i("circle-filled",{fontCharacter:"\\ea71"}),i.primitiveDot=new i("primitive-dot",{fontCharacter:"\\ea71"}),i.closeDirty=new i("close-dirty",{fontCharacter:"\\ea71"}),i.debugBreakpoint=new i("debug-breakpoint",{fontCharacter:"\\ea71"}),i.debugBreakpointDisabled=new i("debug-breakpoint-disabled",{fontCharacter:"\\ea71"}),i.debugHint=new i("debug-hint",{fontCharacter:"\\ea71"}),i.primitiveSquare=new i("primitive-square",{fontCharacter:"\\ea72"}),i.edit=new i("edit",{fontCharacter:"\\ea73"}),i.pencil=new i("pencil",{fontCharacter:"\\ea73"}),i.info=new i("info",{fontCharacter:"\\ea74"}),i.issueOpened=new i("issue-opened",{fontCharacter:"\\ea74"}),i.gistPrivate=new i("gist-private",{fontCharacter:"\\ea75"}),i.gitForkPrivate=new i("git-fork-private",{fontCharacter:"\\ea75"}),i.lock=new i("lock",{fontCharacter:"\\ea75"}),i.mirrorPrivate=new i("mirror-private",{fontCharacter:"\\ea75"}),i.close=new i("close",{fontCharacter:"\\ea76"}),i.removeClose=new i("remove-close",{fontCharacter:"\\ea76"}),i.x=new i("x",{fontCharacter:"\\ea76"}),i.repoSync=new i("repo-sync",{fontCharacter:"\\ea77"}),i.sync=new i("sync",{fontCharacter:"\\ea77"}),i.clone=new i("clone",{fontCharacter:"\\ea78"}),i.desktopDownload=new i("desktop-download",{fontCharacter:"\\ea78"}),i.beaker=new i("beaker",{fontCharacter:"\\ea79"}),i.microscope=new i("microscope",{fontCharacter:"\\ea79"}),i.vm=new i("vm",{fontCharacter:"\\ea7a"}),i.deviceDesktop=new i("device-desktop",{fontCharacter:"\\ea7a"}),i.file=new i("file",{fontCharacter:"\\ea7b"}),i.fileText=new i("file-text",{fontCharacter:"\\ea7b"}),i.more=new i("more",{fontCharacter:"\\ea7c"}),i.ellipsis=new i("ellipsis",{fontCharacter:"\\ea7c"}),i.kebabHorizontal=new i("kebab-horizontal",{fontCharacter:"\\ea7c"}),i.mailReply=new i("mail-reply",{fontCharacter:"\\ea7d"}),i.reply=new i("reply",{fontCharacter:"\\ea7d"}),i.organization=new i("organization",{fontCharacter:"\\ea7e"}),i.organizationFilled=new i("organization-filled",{fontCharacter:"\\ea7e"}),i.organizationOutline=new i("organization-outline",{fontCharacter:"\\ea7e"}),i.newFile=new i("new-file",{fontCharacter:"\\ea7f"}),i.fileAdd=new i("file-add",{fontCharacter:"\\ea7f"}),i.newFolder=new i("new-folder",{fontCharacter:"\\ea80"}),i.fileDirectoryCreate=new i("file-directory-create",{fontCharacter:"\\ea80"}),i.trash=new i("trash",{fontCharacter:"\\ea81"}),i.trashcan=new i("trashcan",{fontCharacter:"\\ea81"}),i.history=new i("history",{fontCharacter:"\\ea82"}),i.clock=new i("clock",{fontCharacter:"\\ea82"}),i.folder=new i("folder",{fontCharacter:"\\ea83"}),i.fileDirectory=new i("file-directory",{fontCharacter:"\\ea83"}),i.symbolFolder=new i("symbol-folder",{fontCharacter:"\\ea83"}),i.logoGithub=new i("logo-github",{fontCharacter:"\\ea84"}),i.markGithub=new i("mark-github",{fontCharacter:"\\ea84"}),i.github=new i("github",{fontCharacter:"\\ea84"}),i.terminal=new i("terminal",{fontCharacter:"\\ea85"}),i.console=new i("console",{fontCharacter:"\\ea85"}),i.repl=new i("repl",{fontCharacter:"\\ea85"}),i.zap=new i("zap",{fontCharacter:"\\ea86"}),i.symbolEvent=new i("symbol-event",{fontCharacter:"\\ea86"}),i.error=new i("error",{fontCharacter:"\\ea87"}),i.stop=new i("stop",{fontCharacter:"\\ea87"}),i.variable=new i("variable",{fontCharacter:"\\ea88"}),i.symbolVariable=new i("symbol-variable",{fontCharacter:"\\ea88"}),i.array=new i("array",{fontCharacter:"\\ea8a"}),i.symbolArray=new i("symbol-array",{fontCharacter:"\\ea8a"}),i.symbolModule=new i("symbol-module",{fontCharacter:"\\ea8b"}),i.symbolPackage=new i("symbol-package",{fontCharacter:"\\ea8b"}),i.symbolNamespace=new i("symbol-namespace",{fontCharacter:"\\ea8b"}),i.symbolObject=new i("symbol-object",{fontCharacter:"\\ea8b"}),i.symbolMethod=new i("symbol-method",{fontCharacter:"\\ea8c"}),i.symbolFunction=new i("symbol-function",{fontCharacter:"\\ea8c"}),i.symbolConstructor=new i("symbol-constructor",{fontCharacter:"\\ea8c"}),i.symbolBoolean=new i("symbol-boolean",{fontCharacter:"\\ea8f"}),i.symbolNull=new i("symbol-null",{fontCharacter:"\\ea8f"}),i.symbolNumeric=new i("symbol-numeric",{fontCharacter:"\\ea90"}),i.symbolNumber=new i("symbol-number",{fontCharacter:"\\ea90"}),i.symbolStructure=new i("symbol-structure",{fontCharacter:"\\ea91"}),i.symbolStruct=new i("symbol-struct",{fontCharacter:"\\ea91"}),i.symbolParameter=new i("symbol-parameter",{fontCharacter:"\\ea92"}),i.symbolTypeParameter=new i("symbol-type-parameter",{fontCharacter:"\\ea92"}),i.symbolKey=new i("symbol-key",{fontCharacter:"\\ea93"}),i.symbolText=new i("symbol-text",{fontCharacter:"\\ea93"}),i.symbolReference=new i("symbol-reference",{fontCharacter:"\\ea94"}),i.goToFile=new i("go-to-file",{fontCharacter:"\\ea94"}),i.symbolEnum=new i("symbol-enum",{fontCharacter:"\\ea95"}),i.symbolValue=new i("symbol-value",{fontCharacter:"\\ea95"}),i.symbolRuler=new i("symbol-ruler",{fontCharacter:"\\ea96"}),i.symbolUnit=new i("symbol-unit",{fontCharacter:"\\ea96"}),i.activateBreakpoints=new i("activate-breakpoints",{fontCharacter:"\\ea97"}),i.archive=new i("archive",{fontCharacter:"\\ea98"}),i.arrowBoth=new i("arrow-both",{fontCharacter:"\\ea99"}),i.arrowDown=new i("arrow-down",{fontCharacter:"\\ea9a"}),i.arrowLeft=new i("arrow-left",{fontCharacter:"\\ea9b"}),i.arrowRight=new i("arrow-right",{fontCharacter:"\\ea9c"}),i.arrowSmallDown=new i("arrow-small-down",{fontCharacter:"\\ea9d"}),i.arrowSmallLeft=new i("arrow-small-left",{fontCharacter:"\\ea9e"}),i.arrowSmallRight=new i("arrow-small-right",{fontCharacter:"\\ea9f"}),i.arrowSmallUp=new i("arrow-small-up",{fontCharacter:"\\eaa0"}),i.arrowUp=new i("arrow-up",{fontCharacter:"\\eaa1"}),i.bell=new i("bell",{fontCharacter:"\\eaa2"}),i.bold=new i("bold",{fontCharacter:"\\eaa3"}),i.book=new i("book",{fontCharacter:"\\eaa4"}),i.bookmark=new i("bookmark",{fontCharacter:"\\eaa5"}),i.debugBreakpointConditionalUnverified=new i("debug-breakpoint-conditional-unverified",{fontCharacter:"\\eaa6"}),i.debugBreakpointConditional=new i("debug-breakpoint-conditional",{fontCharacter:"\\eaa7"}),i.debugBreakpointConditionalDisabled=new i("debug-breakpoint-conditional-disabled",{fontCharacter:"\\eaa7"}),i.debugBreakpointDataUnverified=new i("debug-breakpoint-data-unverified",{fontCharacter:"\\eaa8"}),i.debugBreakpointData=new i("debug-breakpoint-data",{fontCharacter:"\\eaa9"}),i.debugBreakpointDataDisabled=new i("debug-breakpoint-data-disabled",{fontCharacter:"\\eaa9"}),i.debugBreakpointLogUnverified=new i("debug-breakpoint-log-unverified",{fontCharacter:"\\eaaa"}),i.debugBreakpointLog=new i("debug-breakpoint-log",{fontCharacter:"\\eaab"}),i.debugBreakpointLogDisabled=new i("debug-breakpoint-log-disabled",{fontCharacter:"\\eaab"}),i.briefcase=new i("briefcase",{fontCharacter:"\\eaac"}),i.broadcast=new i("broadcast",{fontCharacter:"\\eaad"}),i.browser=new i("browser",{fontCharacter:"\\eaae"}),i.bug=new i("bug",{fontCharacter:"\\eaaf"}),i.calendar=new i("calendar",{fontCharacter:"\\eab0"}),i.caseSensitive=new i("case-sensitive",{fontCharacter:"\\eab1"}),i.check=new i("check",{fontCharacter:"\\eab2"}),i.checklist=new i("checklist",{fontCharacter:"\\eab3"}),i.chevronDown=new i("chevron-down",{fontCharacter:"\\eab4"}),i.dropDownButton=new i("drop-down-button",i.chevronDown.definition),i.chevronLeft=new i("chevron-left",{fontCharacter:"\\eab5"}),i.chevronRight=new i("chevron-right",{fontCharacter:"\\eab6"}),i.chevronUp=new i("chevron-up",{fontCharacter:"\\eab7"}),i.chromeClose=new i("chrome-close",{fontCharacter:"\\eab8"}),i.chromeMaximize=new i("chrome-maximize",{fontCharacter:"\\eab9"}),i.chromeMinimize=new i("chrome-minimize",{fontCharacter:"\\eaba"}),i.chromeRestore=new i("chrome-restore",{fontCharacter:"\\eabb"}),i.circleOutline=new i("circle-outline",{fontCharacter:"\\eabc"}),i.debugBreakpointUnverified=new i("debug-breakpoint-unverified",{fontCharacter:"\\eabc"}),i.circleSlash=new i("circle-slash",{fontCharacter:"\\eabd"}),i.circuitBoard=new i("circuit-board",{fontCharacter:"\\eabe"}),i.clearAll=new i("clear-all",{fontCharacter:"\\eabf"}),i.clippy=new i("clippy",{fontCharacter:"\\eac0"}),i.closeAll=new i("close-all",{fontCharacter:"\\eac1"}),i.cloudDownload=new i("cloud-download",{fontCharacter:"\\eac2"}),i.cloudUpload=new i("cloud-upload",{fontCharacter:"\\eac3"}),i.code=new i("code",{fontCharacter:"\\eac4"}),i.collapseAll=new i("collapse-all",{fontCharacter:"\\eac5"}),i.colorMode=new i("color-mode",{fontCharacter:"\\eac6"}),i.commentDiscussion=new i("comment-discussion",{fontCharacter:"\\eac7"}),i.compareChanges=new i("compare-changes",{fontCharacter:"\\eafd"}),i.creditCard=new i("credit-card",{fontCharacter:"\\eac9"}),i.dash=new i("dash",{fontCharacter:"\\eacc"}),i.dashboard=new i("dashboard",{fontCharacter:"\\eacd"}),i.database=new i("database",{fontCharacter:"\\eace"}),i.debugContinue=new i("debug-continue",{fontCharacter:"\\eacf"}),i.debugDisconnect=new i("debug-disconnect",{fontCharacter:"\\ead0"}),i.debugPause=new i("debug-pause",{fontCharacter:"\\ead1"}),i.debugRestart=new i("debug-restart",{fontCharacter:"\\ead2"}),i.debugStart=new i("debug-start",{fontCharacter:"\\ead3"}),i.debugStepInto=new i("debug-step-into",{fontCharacter:"\\ead4"}),i.debugStepOut=new i("debug-step-out",{fontCharacter:"\\ead5"}),i.debugStepOver=new i("debug-step-over",{fontCharacter:"\\ead6"}),i.debugStop=new i("debug-stop",{fontCharacter:"\\ead7"}),i.debug=new i("debug",{fontCharacter:"\\ead8"}),i.deviceCameraVideo=new i("device-camera-video",{fontCharacter:"\\ead9"}),i.deviceCamera=new i("device-camera",{fontCharacter:"\\eada"}),i.deviceMobile=new i("device-mobile",{fontCharacter:"\\eadb"}),i.diffAdded=new i("diff-added",{fontCharacter:"\\eadc"}),i.diffIgnored=new i("diff-ignored",{fontCharacter:"\\eadd"}),i.diffModified=new i("diff-modified",{fontCharacter:"\\eade"}),i.diffRemoved=new i("diff-removed",{fontCharacter:"\\eadf"}),i.diffRenamed=new i("diff-renamed",{fontCharacter:"\\eae0"}),i.diff=new i("diff",{fontCharacter:"\\eae1"}),i.discard=new i("discard",{fontCharacter:"\\eae2"}),i.editorLayout=new i("editor-layout",{fontCharacter:"\\eae3"}),i.emptyWindow=new i("empty-window",{fontCharacter:"\\eae4"}),i.exclude=new i("exclude",{fontCharacter:"\\eae5"}),i.extensions=new i("extensions",{fontCharacter:"\\eae6"}),i.eyeClosed=new i("eye-closed",{fontCharacter:"\\eae7"}),i.fileBinary=new i("file-binary",{fontCharacter:"\\eae8"}),i.fileCode=new i("file-code",{fontCharacter:"\\eae9"}),i.fileMedia=new i("file-media",{fontCharacter:"\\eaea"}),i.filePdf=new i("file-pdf",{fontCharacter:"\\eaeb"}),i.fileSubmodule=new i("file-submodule",{fontCharacter:"\\eaec"}),i.fileSymlinkDirectory=new i("file-symlink-directory",{fontCharacter:"\\eaed"}),i.fileSymlinkFile=new i("file-symlink-file",{fontCharacter:"\\eaee"}),i.fileZip=new i("file-zip",{fontCharacter:"\\eaef"}),i.files=new i("files",{fontCharacter:"\\eaf0"}),i.filter=new i("filter",{fontCharacter:"\\eaf1"}),i.flame=new i("flame",{fontCharacter:"\\eaf2"}),i.foldDown=new i("fold-down",{fontCharacter:"\\eaf3"}),i.foldUp=new i("fold-up",{fontCharacter:"\\eaf4"}),i.fold=new i("fold",{fontCharacter:"\\eaf5"}),i.folderActive=new i("folder-active",{fontCharacter:"\\eaf6"}),i.folderOpened=new i("folder-opened",{fontCharacter:"\\eaf7"}),i.gear=new i("gear",{fontCharacter:"\\eaf8"}),i.gift=new i("gift",{fontCharacter:"\\eaf9"}),i.gistSecret=new i("gist-secret",{fontCharacter:"\\eafa"}),i.gist=new i("gist",{fontCharacter:"\\eafb"}),i.gitCommit=new i("git-commit",{fontCharacter:"\\eafc"}),i.gitCompare=new i("git-compare",{fontCharacter:"\\eafd"}),i.gitMerge=new i("git-merge",{fontCharacter:"\\eafe"}),i.githubAction=new i("github-action",{fontCharacter:"\\eaff"}),i.githubAlt=new i("github-alt",{fontCharacter:"\\eb00"}),i.globe=new i("globe",{fontCharacter:"\\eb01"}),i.grabber=new i("grabber",{fontCharacter:"\\eb02"}),i.graph=new i("graph",{fontCharacter:"\\eb03"}),i.gripper=new i("gripper",{fontCharacter:"\\eb04"}),i.heart=new i("heart",{fontCharacter:"\\eb05"}),i.home=new i("home",{fontCharacter:"\\eb06"}),i.horizontalRule=new i("horizontal-rule",{fontCharacter:"\\eb07"}),i.hubot=new i("hubot",{fontCharacter:"\\eb08"}),i.inbox=new i("inbox",{fontCharacter:"\\eb09"}),i.issueClosed=new i("issue-closed",{fontCharacter:"\\eba4"}),i.issueReopened=new i("issue-reopened",{fontCharacter:"\\eb0b"}),i.issues=new i("issues",{fontCharacter:"\\eb0c"}),i.italic=new i("italic",{fontCharacter:"\\eb0d"}),i.jersey=new i("jersey",{fontCharacter:"\\eb0e"}),i.json=new i("json",{fontCharacter:"\\eb0f"}),i.kebabVertical=new i("kebab-vertical",{fontCharacter:"\\eb10"}),i.key=new i("key",{fontCharacter:"\\eb11"}),i.law=new i("law",{fontCharacter:"\\eb12"}),i.lightbulbAutofix=new i("lightbulb-autofix",{fontCharacter:"\\eb13"}),i.linkExternal=new i("link-external",{fontCharacter:"\\eb14"}),i.link=new i("link",{fontCharacter:"\\eb15"}),i.listOrdered=new i("list-ordered",{fontCharacter:"\\eb16"}),i.listUnordered=new i("list-unordered",{fontCharacter:"\\eb17"}),i.liveShare=new i("live-share",{fontCharacter:"\\eb18"}),i.loading=new i("loading",{fontCharacter:"\\eb19"}),i.location=new i("location",{fontCharacter:"\\eb1a"}),i.mailRead=new i("mail-read",{fontCharacter:"\\eb1b"}),i.mail=new i("mail",{fontCharacter:"\\eb1c"}),i.markdown=new i("markdown",{fontCharacter:"\\eb1d"}),i.megaphone=new i("megaphone",{fontCharacter:"\\eb1e"}),i.mention=new i("mention",{fontCharacter:"\\eb1f"}),i.milestone=new i("milestone",{fontCharacter:"\\eb20"}),i.mortarBoard=new i("mortar-board",{fontCharacter:"\\eb21"}),i.move=new i("move",{fontCharacter:"\\eb22"}),i.multipleWindows=new i("multiple-windows",{fontCharacter:"\\eb23"}),i.mute=new i("mute",{fontCharacter:"\\eb24"}),i.noNewline=new i("no-newline",{fontCharacter:"\\eb25"}),i.note=new i("note",{fontCharacter:"\\eb26"}),i.octoface=new i("octoface",{fontCharacter:"\\eb27"}),i.openPreview=new i("open-preview",{fontCharacter:"\\eb28"}),i.package_=new i("package",{fontCharacter:"\\eb29"}),i.paintcan=new i("paintcan",{fontCharacter:"\\eb2a"}),i.pin=new i("pin",{fontCharacter:"\\eb2b"}),i.play=new i("play",{fontCharacter:"\\eb2c"}),i.run=new i("run",{fontCharacter:"\\eb2c"}),i.plug=new i("plug",{fontCharacter:"\\eb2d"}),i.preserveCase=new i("preserve-case",{fontCharacter:"\\eb2e"}),i.preview=new i("preview",{fontCharacter:"\\eb2f"}),i.project=new i("project",{fontCharacter:"\\eb30"}),i.pulse=new i("pulse",{fontCharacter:"\\eb31"}),i.question=new i("question",{fontCharacter:"\\eb32"}),i.quote=new i("quote",{fontCharacter:"\\eb33"}),i.radioTower=new i("radio-tower",{fontCharacter:"\\eb34"}),i.reactions=new i("reactions",{fontCharacter:"\\eb35"}),i.references=new i("references",{fontCharacter:"\\eb36"}),i.refresh=new i("refresh",{fontCharacter:"\\eb37"}),i.regex=new i("regex",{fontCharacter:"\\eb38"}),i.remoteExplorer=new i("remote-explorer",{fontCharacter:"\\eb39"}),i.remote=new i("remote",{fontCharacter:"\\eb3a"}),i.remove=new i("remove",{fontCharacter:"\\eb3b"}),i.replaceAll=new i("replace-all",{fontCharacter:"\\eb3c"}),i.replace=new i("replace",{fontCharacter:"\\eb3d"}),i.repoClone=new i("repo-clone",{fontCharacter:"\\eb3e"}),i.repoForcePush=new i("repo-force-push",{fontCharacter:"\\eb3f"}),i.repoPull=new i("repo-pull",{fontCharacter:"\\eb40"}),i.repoPush=new i("repo-push",{fontCharacter:"\\eb41"}),i.report=new i("report",{fontCharacter:"\\eb42"}),i.requestChanges=new i("request-changes",{fontCharacter:"\\eb43"}),i.rocket=new i("rocket",{fontCharacter:"\\eb44"}),i.rootFolderOpened=new i("root-folder-opened",{fontCharacter:"\\eb45"}),i.rootFolder=new i("root-folder",{fontCharacter:"\\eb46"}),i.rss=new i("rss",{fontCharacter:"\\eb47"}),i.ruby=new i("ruby",{fontCharacter:"\\eb48"}),i.saveAll=new i("save-all",{fontCharacter:"\\eb49"}),i.saveAs=new i("save-as",{fontCharacter:"\\eb4a"}),i.save=new i("save",{fontCharacter:"\\eb4b"}),i.screenFull=new i("screen-full",{fontCharacter:"\\eb4c"}),i.screenNormal=new i("screen-normal",{fontCharacter:"\\eb4d"}),i.searchStop=new i("search-stop",{fontCharacter:"\\eb4e"}),i.server=new i("server",{fontCharacter:"\\eb50"}),i.settingsGear=new i("settings-gear",{fontCharacter:"\\eb51"}),i.settings=new i("settings",{fontCharacter:"\\eb52"}),i.shield=new i("shield",{fontCharacter:"\\eb53"}),i.smiley=new i("smiley",{fontCharacter:"\\eb54"}),i.sortPrecedence=new i("sort-precedence",{fontCharacter:"\\eb55"}),i.splitHorizontal=new i("split-horizontal",{fontCharacter:"\\eb56"}),i.splitVertical=new i("split-vertical",{fontCharacter:"\\eb57"}),i.squirrel=new i("squirrel",{fontCharacter:"\\eb58"}),i.starFull=new i("star-full",{fontCharacter:"\\eb59"}),i.starHalf=new i("star-half",{fontCharacter:"\\eb5a"}),i.symbolClass=new i("symbol-class",{fontCharacter:"\\eb5b"}),i.symbolColor=new i("symbol-color",{fontCharacter:"\\eb5c"}),i.symbolConstant=new i("symbol-constant",{fontCharacter:"\\eb5d"}),i.symbolEnumMember=new i("symbol-enum-member",{fontCharacter:"\\eb5e"}),i.symbolField=new i("symbol-field",{fontCharacter:"\\eb5f"}),i.symbolFile=new i("symbol-file",{fontCharacter:"\\eb60"}),i.symbolInterface=new i("symbol-interface",{fontCharacter:"\\eb61"}),i.symbolKeyword=new i("symbol-keyword",{fontCharacter:"\\eb62"}),i.symbolMisc=new i("symbol-misc",{fontCharacter:"\\eb63"}),i.symbolOperator=new i("symbol-operator",{fontCharacter:"\\eb64"}),i.symbolProperty=new i("symbol-property",{fontCharacter:"\\eb65"}),i.wrench=new i("wrench",{fontCharacter:"\\eb65"}),i.wrenchSubaction=new i("wrench-subaction",{fontCharacter:"\\eb65"}),i.symbolSnippet=new i("symbol-snippet",{fontCharacter:"\\eb66"}),i.tasklist=new i("tasklist",{fontCharacter:"\\eb67"}),i.telescope=new i("telescope",{fontCharacter:"\\eb68"}),i.textSize=new i("text-size",{fontCharacter:"\\eb69"}),i.threeBars=new i("three-bars",{fontCharacter:"\\eb6a"}),i.thumbsdown=new i("thumbsdown",{fontCharacter:"\\eb6b"}),i.thumbsup=new i("thumbsup",{fontCharacter:"\\eb6c"}),i.tools=new i("tools",{fontCharacter:"\\eb6d"}),i.triangleDown=new i("triangle-down",{fontCharacter:"\\eb6e"}),i.triangleLeft=new i("triangle-left",{fontCharacter:"\\eb6f"}),i.triangleRight=new i("triangle-right",{fontCharacter:"\\eb70"}),i.triangleUp=new i("triangle-up",{fontCharacter:"\\eb71"}),i.twitter=new i("twitter",{fontCharacter:"\\eb72"}),i.unfold=new i("unfold",{fontCharacter:"\\eb73"}),i.unlock=new i("unlock",{fontCharacter:"\\eb74"}),i.unmute=new i("unmute",{fontCharacter:"\\eb75"}),i.unverified=new i("unverified",{fontCharacter:"\\eb76"}),i.verified=new i("verified",{fontCharacter:"\\eb77"}),i.versions=new i("versions",{fontCharacter:"\\eb78"}),i.vmActive=new i("vm-active",{fontCharacter:"\\eb79"}),i.vmOutline=new i("vm-outline",{fontCharacter:"\\eb7a"}),i.vmRunning=new i("vm-running",{fontCharacter:"\\eb7b"}),i.watch=new i("watch",{fontCharacter:"\\eb7c"}),i.whitespace=new i("whitespace",{fontCharacter:"\\eb7d"}),i.wholeWord=new i("whole-word",{fontCharacter:"\\eb7e"}),i.window=new i("window",{fontCharacter:"\\eb7f"}),i.wordWrap=new i("word-wrap",{fontCharacter:"\\eb80"}),i.zoomIn=new i("zoom-in",{fontCharacter:"\\eb81"}),i.zoomOut=new i("zoom-out",{fontCharacter:"\\eb82"}),i.listFilter=new i("list-filter",{fontCharacter:"\\eb83"}),i.listFlat=new i("list-flat",{fontCharacter:"\\eb84"}),i.listSelection=new i("list-selection",{fontCharacter:"\\eb85"}),i.selection=new i("selection",{fontCharacter:"\\eb85"}),i.listTree=new i("list-tree",{fontCharacter:"\\eb86"}),i.debugBreakpointFunctionUnverified=new i("debug-breakpoint-function-unverified",{fontCharacter:"\\eb87"}),i.debugBreakpointFunction=new i("debug-breakpoint-function",{fontCharacter:"\\eb88"}),i.debugBreakpointFunctionDisabled=new i("debug-breakpoint-function-disabled",{fontCharacter:"\\eb88"}),i.debugStackframeActive=new i("debug-stackframe-active",{fontCharacter:"\\eb89"}),i.debugStackframeDot=new i("debug-stackframe-dot",{fontCharacter:"\\eb8a"}),i.debugStackframe=new i("debug-stackframe",{fontCharacter:"\\eb8b"}),i.debugStackframeFocused=new i("debug-stackframe-focused",{fontCharacter:"\\eb8b"}),i.debugBreakpointUnsupported=new i("debug-breakpoint-unsupported",{fontCharacter:"\\eb8c"}),i.symbolString=new i("symbol-string",{fontCharacter:"\\eb8d"}),i.debugReverseContinue=new i("debug-reverse-continue",{fontCharacter:"\\eb8e"}),i.debugStepBack=new i("debug-step-back",{fontCharacter:"\\eb8f"}),i.debugRestartFrame=new i("debug-restart-frame",{fontCharacter:"\\eb90"}),i.callIncoming=new i("call-incoming",{fontCharacter:"\\eb92"}),i.callOutgoing=new i("call-outgoing",{fontCharacter:"\\eb93"}),i.menu=new i("menu",{fontCharacter:"\\eb94"}),i.expandAll=new i("expand-all",{fontCharacter:"\\eb95"}),i.feedback=new i("feedback",{fontCharacter:"\\eb96"}),i.groupByRefType=new i("group-by-ref-type",{fontCharacter:"\\eb97"}),i.ungroupByRefType=new i("ungroup-by-ref-type",{fontCharacter:"\\eb98"}),i.account=new i("account",{fontCharacter:"\\eb99"}),i.bellDot=new i("bell-dot",{fontCharacter:"\\eb9a"}),i.debugConsole=new i("debug-console",{fontCharacter:"\\eb9b"}),i.library=new i("library",{fontCharacter:"\\eb9c"}),i.output=new i("output",{fontCharacter:"\\eb9d"}),i.runAll=new i("run-all",{fontCharacter:"\\eb9e"}),i.syncIgnored=new i("sync-ignored",{fontCharacter:"\\eb9f"}),i.pinned=new i("pinned",{fontCharacter:"\\eba0"}),i.githubInverted=new i("github-inverted",{fontCharacter:"\\eba1"}),i.debugAlt=new i("debug-alt",{fontCharacter:"\\eb91"}),i.serverProcess=new i("server-process",{fontCharacter:"\\eba2"}),i.serverEnvironment=new i("server-environment",{fontCharacter:"\\eba3"}),i.pass=new i("pass",{fontCharacter:"\\eba4"}),i.stopCircle=new i("stop-circle",{fontCharacter:"\\eba5"}),i.playCircle=new i("play-circle",{fontCharacter:"\\eba6"}),i.record=new i("record",{fontCharacter:"\\eba7"}),i.debugAltSmall=new i("debug-alt-small",{fontCharacter:"\\eba8"}),i.vmConnect=new i("vm-connect",{fontCharacter:"\\eba9"}),i.cloud=new i("cloud",{fontCharacter:"\\ebaa"}),i.merge=new i("merge",{fontCharacter:"\\ebab"}),i.exportIcon=new i("export",{fontCharacter:"\\ebac"}),i.graphLeft=new i("graph-left",{fontCharacter:"\\ebad"}),i.magnet=new i("magnet",{fontCharacter:"\\ebae"}),i.notebook=new i("notebook",{fontCharacter:"\\ebaf"}),i.redo=new i("redo",{fontCharacter:"\\ebb0"}),i.checkAll=new i("check-all",{fontCharacter:"\\ebb1"}),i.pinnedDirty=new i("pinned-dirty",{fontCharacter:"\\ebb2"}),i.passFilled=new i("pass-filled",{fontCharacter:"\\ebb3"}),i.circleLargeFilled=new i("circle-large-filled",{fontCharacter:"\\ebb4"}),i.circleLargeOutline=new i("circle-large-outline",{fontCharacter:"\\ebb5"}),i.combine=new i("combine",{fontCharacter:"\\ebb6"}),i.gather=new i("gather",{fontCharacter:"\\ebb6"}),i.table=new i("table",{fontCharacter:"\\ebb7"}),i.variableGroup=new i("variable-group",{fontCharacter:"\\ebb8"}),i.typeHierarchy=new i("type-hierarchy",{fontCharacter:"\\ebb9"}),i.typeHierarchySub=new i("type-hierarchy-sub",{fontCharacter:"\\ebba"}),i.typeHierarchySuper=new i("type-hierarchy-super",{fontCharacter:"\\ebbb"}),i.gitPullRequestCreate=new i("git-pull-request-create",{fontCharacter:"\\ebbc"}),i.runAbove=new i("run-above",{fontCharacter:"\\ebbd"}),i.runBelow=new i("run-below",{fontCharacter:"\\ebbe"}),i.notebookTemplate=new i("notebook-template",{fontCharacter:"\\ebbf"}),i.debugRerun=new i("debug-rerun",{fontCharacter:"\\ebc0"}),i.workspaceTrusted=new i("workspace-trusted",{fontCharacter:"\\ebc1"}),i.workspaceUntrusted=new i("workspace-untrusted",{fontCharacter:"\\ebc2"}),i.workspaceUnspecified=new i("workspace-unspecified",{fontCharacter:"\\ebc3"}),i.terminalCmd=new i("terminal-cmd",{fontCharacter:"\\ebc4"}),i.terminalDebian=new i("terminal-debian",{fontCharacter:"\\ebc5"}),i.terminalLinux=new i("terminal-linux",{fontCharacter:"\\ebc6"}),i.terminalPowershell=new i("terminal-powershell",{fontCharacter:"\\ebc7"}),i.terminalTmux=new i("terminal-tmux",{fontCharacter:"\\ebc8"}),i.terminalUbuntu=new i("terminal-ubuntu",{fontCharacter:"\\ebc9"}),i.terminalBash=new i("terminal-bash",{fontCharacter:"\\ebca"}),i.arrowSwap=new i("arrow-swap",{fontCharacter:"\\ebcb"}),i.copy=new i("copy",{fontCharacter:"\\ebcc"}),i.personAdd=new i("person-add",{fontCharacter:"\\ebcd"}),i.filterFilled=new i("filter-filled",{fontCharacter:"\\ebce"}),i.wand=new i("wand",{fontCharacter:"\\ebcf"}),i.debugLineByLine=new i("debug-line-by-line",{fontCharacter:"\\ebd0"}),i.inspect=new i("inspect",{fontCharacter:"\\ebd1"}),i.layers=new i("layers",{fontCharacter:"\\ebd2"}),i.layersDot=new i("layers-dot",{fontCharacter:"\\ebd3"}),i.layersActive=new i("layers-active",{fontCharacter:"\\ebd4"}),i.compass=new i("compass",{fontCharacter:"\\ebd5"}),i.compassDot=new i("compass-dot",{fontCharacter:"\\ebd6"}),i.compassActive=new i("compass-active",{fontCharacter:"\\ebd7"}),i.azure=new i("azure",{fontCharacter:"\\ebd8"}),i.issueDraft=new i("issue-draft",{fontCharacter:"\\ebd9"}),i.gitPullRequestClosed=new i("git-pull-request-closed",{fontCharacter:"\\ebda"}),i.gitPullRequestDraft=new i("git-pull-request-draft",{fontCharacter:"\\ebdb"}),i.debugAll=new i("debug-all",{fontCharacter:"\\ebdc"}),i.debugCoverage=new i("debug-coverage",{fontCharacter:"\\ebdd"}),i.runErrors=new i("run-errors",{fontCharacter:"\\ebde"}),i.folderLibrary=new i("folder-library",{fontCharacter:"\\ebdf"}),i.debugContinueSmall=new i("debug-continue-small",{fontCharacter:"\\ebe0"}),i.beakerStop=new i("beaker-stop",{fontCharacter:"\\ebe1"}),i.graphLine=new i("graph-line",{fontCharacter:"\\ebe2"}),i.graphScatter=new i("graph-scatter",{fontCharacter:"\\ebe3"}),i.pieChart=new i("pie-chart",{fontCharacter:"\\ebe4"}),i.bracket=new i("bracket",i.json.definition),i.bracketDot=new i("bracket-dot",{fontCharacter:"\\ebe5"}),i.bracketError=new i("bracket-error",{fontCharacter:"\\ebe6"}),i.lockSmall=new i("lock-small",{fontCharacter:"\\ebe7"}),i.azureDevops=new i("azure-devops",{fontCharacter:"\\ebe8"}),i.verifiedFilled=new i("verified-filled",{fontCharacter:"\\ebe9"})}(E||(E={}))},"VrN/":function(it,ne,q){(function(G,L){it.exports=L()})(this,function(){"use strict";var G=navigator.userAgent,L=navigator.platform,I=/gecko\/\d/i.test(G),R=/MSIE \d/.test(G),M=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(G),p=/Edge\/(\d+)/.exec(G),E=R||M||p,b=E&&(R?document.documentMode||6:+(p||M)[1]),i=!p&&/WebKit\//.test(G),c=i&&/Qt\/\d+\.\d+/.test(G),o=!p&&/Chrome\//.test(G),h=/Opera\//.test(G),n=/Apple Computer/.test(navigator.vendor),a=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(G),t=/PhantomJS/.test(G),r=!p&&/AppleWebKit/.test(G)&&/Mobile\/\w+/.test(G),s=/Android/.test(G),u=r||s||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(G),d=r||/Mac/.test(L),f=/\bCrOS\b/.test(G),v=/win/i.test(L),m=h&&G.match(/Version\/(\d*\.\d*)/);m&&(m=Number(m[1])),m&&m>=15&&(h=!1,i=!0);var S=d&&(c||h&&(m==null||m<12.11)),C=I||E&&b>=9;function _(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var y=function(e,l){var w=e.className,x=_(l).exec(w);if(x){var D=w.slice(x.index+x[0].length);e.className=w.slice(0,x.index)+(D?x[1]+D:"")}};function T(e){for(var l=e.childNodes.length;l>0;--l)e.removeChild(e.firstChild);return e}function O(e,l){return T(e).appendChild(l)}function g(e,l,w,x){var D=document.createElement(e);if(w&&(D.className=w),x&&(D.style.cssText=x),typeof l=="string")D.appendChild(document.createTextNode(l));else if(l)for(var W=0;W<l.length;++W)D.appendChild(l[W]);return D}function F(e,l,w,x){var D=g(e,l,w,x);return D.setAttribute("role","presentation"),D}var P;document.createRange?P=function(e,l,w,x){var D=document.createRange();return D.setEnd(x||e,w),D.setStart(e,l),D}:P=function(e,l,w){var x=document.body.createTextRange();try{x.moveToElementText(e.parentNode)}catch(D){return x}return x.collapse(!0),x.moveEnd("character",w),x.moveStart("character",l),x};function N(e,l){if(l.nodeType==3&&(l=l.parentNode),e.contains)return e.contains(l);do if(l.nodeType==11&&(l=l.host),l==e)return!0;while(l=l.parentNode)}function X(){var e;try{e=document.activeElement}catch(l){e=document.body||null}for(;e&&e.shadowRoot&&e.shadowRoot.activeElement;)e=e.shadowRoot.activeElement;return e}function j(e,l){var w=e.className;_(l).test(w)||(e.className+=(w?" ":"")+l)}function A(e,l){for(var w=e.split(" "),x=0;x<w.length;x++)w[x]&&!_(w[x]).test(l)&&(l+=" "+w[x]);return l}var K=function(e){e.select()};r?K=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:E&&(K=function(e){try{e.select()}catch(l){}});function U(e){var l=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,l)}}function k(e,l,w){l||(l={});for(var x in e)e.hasOwnProperty(x)&&(w!==!1||!l.hasOwnProperty(x))&&(l[x]=e[x]);return l}function z(e,l,w,x,D){l==null&&(l=e.search(/[^\s\u00a0]/),l==-1&&(l=e.length));for(var W=x||0,Z=D||0;;){var ie=e.indexOf(" ",W);if(ie<0||ie>=l)return Z+(l-W);Z+=ie-W,Z+=w-Z%w,W=ie+1}}var te=function(){this.id=null,this.f=null,this.time=0,this.handler=U(this.onTimeout,this)};te.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},te.prototype.set=function(e,l){this.f=l;var w=+new Date+e;(!this.id||w<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,e),this.time=w)};function de(e,l){for(var w=0;w<e.length;++w)if(e[w]==l)return w;return-1}var be=50,We={toString:function(){return"CodeMirror.Pass"}},Ne={scroll:!1},Le={origin:"*mouse"},Ke={origin:"+move"};function He(e,l,w){for(var x=0,D=0;;){var W=e.indexOf(" ",x);W==-1&&(W=e.length);var Z=W-x;if(W==e.length||D+Z>=l)return x+Math.min(Z,l-D);if(D+=W-x,D+=w-D%w,x=W+1,D>=l)return x}}var Ae=[""];function Se(e){for(;Ae.length<=e;)Ae.push(he(Ae)+" ");return Ae[e]}function he(e){return e[e.length-1]}function Ie(e,l){for(var w=[],x=0;x<e.length;x++)w[x]=l(e[x],x);return w}function ye(e,l,w){for(var x=0,D=w(l);x<e.length&&w(e[x])<=D;)x++;e.splice(x,0,l)}function Ge(){}function $e(e,l){var w;return Object.create?w=Object.create(e):(Ge.prototype=e,w=new Ge),l&&k(l,w),w}var ze=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function Je(e){return/\w/.test(e)||e>"\x80"&&(e.toUpperCase()!=e.toLowerCase()||ze.test(e))}function Qe(e,l){return l?l.source.indexOf("\\w")>-1&&Je(e)?!0:l.test(e):Je(e)}function fe(e){for(var l in e)if(e.hasOwnProperty(l)&&e[l])return!1;return!0}var ge=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;function xe(e){return e.charCodeAt(0)>=768&&ge.test(e)}function we(e,l,w){for(;(w<0?l>0:l<e.length)&&xe(e.charAt(l));)l+=w;return l}function Te(e,l,w){for(var x=l>w?-1:1;;){if(l==w)return l;var D=(l+w)/2,W=x<0?Math.ceil(D):Math.floor(D);if(W==l)return e(W)?l:w;e(W)?w=W:l=W+x}}function re(e,l,w,x){if(!e)return x(l,w,"ltr",0);for(var D=!1,W=0;W<e.length;++W){var Z=e[W];(Z.from<w&&Z.to>l||l==w&&Z.to==l)&&(x(Math.max(Z.from,l),Math.min(Z.to,w),Z.level==1?"rtl":"ltr",W),D=!0)}D||x(l,w,"ltr")}var ve=null;function ae(e,l,w){var x;ve=null;for(var D=0;D<e.length;++D){var W=e[D];if(W.from<l&&W.to>l)return D;W.to==l&&(W.from!=W.to&&w=="before"?x=D:ve=D),W.from==l&&(W.from!=W.to&&w!="before"?x=D:ve=D)}return x!=null?x:ve}var Me=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",l="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function w(ue){return ue<=247?e.charAt(ue):1424<=ue&&ue<=1524?"R":1536<=ue&&ue<=1785?l.charAt(ue-1536):1774<=ue&&ue<=2220?"r":8192<=ue&&ue<=8203?"w":ue==8204?"b":"L"}var x=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,D=/[stwN]/,W=/[LRr]/,Z=/[Lb1n]/,ie=/[1n]/;function se(ue,De,Ue){this.level=ue,this.from=De,this.to=Ue}return function(ue,De){var Ue=De=="ltr"?"L":"R";if(ue.length==0||De=="ltr"&&!x.test(ue))return!1;for(var qe=ue.length,Ze=[],rt=0;rt<qe;++rt)Ze.push(w(ue.charCodeAt(rt)));for(var lt=0,ft=Ue;lt<qe;++lt){var _t=Ze[lt];_t=="m"?Ze[lt]=ft:ft=_t}for(var xt=0,yt=Ue;xt<qe;++xt){var Et=Ze[xt];Et=="1"&&yt=="r"?Ze[xt]="n":W.test(Et)&&(yt=Et,Et=="r"&&(Ze[xt]="R"))}for(var kt=1,Lt=Ze[0];kt<qe-1;++kt){var Kt=Ze[kt];Kt=="+"&&Lt=="1"&&Ze[kt+1]=="1"?Ze[kt]="1":Kt==","&&Lt==Ze[kt+1]&&(Lt=="1"||Lt=="n")&&(Ze[kt]=Lt),Lt=Kt}for(var ti=0;ti<qe;++ti){var yi=Ze[ti];if(yi==",")Ze[ti]="N";else if(yi=="%"){var ai=void 0;for(ai=ti+1;ai<qe&&Ze[ai]=="%";++ai);for(var Xi=ti&&Ze[ti-1]=="!"||ai<qe&&Ze[ai]=="1"?"1":"N",Ui=ti;Ui<ai;++Ui)Ze[Ui]=Xi;ti=ai-1}}for(var hi=0,Bi=Ue;hi<qe;++hi){var wi=Ze[hi];Bi=="L"&&wi=="1"?Ze[hi]="L":W.test(wi)&&(Bi=wi)}for(var pi=0;pi<qe;++pi)if(D.test(Ze[pi])){var ci=void 0;for(ci=pi+1;ci<qe&&D.test(Ze[ci]);++ci);for(var si=(pi?Ze[pi-1]:Ue)=="L",Ki=(ci<qe?Ze[ci]:Ue)=="L",un=si==Ki?si?"L":"R":Ue,Or=pi;Or<ci;++Or)Ze[Or]=un;pi=ci-1}for(var Ri=[],or,bi=0;bi<qe;)if(Z.test(Ze[bi])){var Ga=bi;for(++bi;bi<qe&&Z.test(Ze[bi]);++bi);Ri.push(new se(0,Ga,bi))}else{var fr=bi,jr=Ri.length,Wr=De=="rtl"?1:0;for(++bi;bi<qe&&Ze[bi]!="L";++bi);for(var Ii=fr;Ii<bi;)if(ie.test(Ze[Ii])){fr<Ii&&(Ri.splice(jr,0,new se(1,fr,Ii)),jr+=Wr);var hn=Ii;for(++Ii;Ii<bi&&ie.test(Ze[Ii]);++Ii);Ri.splice(jr,0,new se(2,hn,Ii)),jr+=Wr,fr=Ii}else++Ii;fr<bi&&Ri.splice(jr,0,new se(1,fr,bi))}return De=="ltr"&&(Ri[0].level==1&&(or=ue.match(/^\s+/))&&(Ri[0].from=or[0].length,Ri.unshift(new se(0,0,or[0].length))),he(Ri).level==1&&(or=ue.match(/\s+$/))&&(he(Ri).to-=or[0].length,Ri.push(new se(0,qe-or[0].length,qe)))),De=="rtl"?Ri.reverse():Ri}}();function Ye(e,l){var w=e.order;return w==null&&(w=e.order=Me(e.text,l)),w}var et=[],je=function(e,l,w){if(e.addEventListener)e.addEventListener(l,w,!1);else if(e.attachEvent)e.attachEvent("on"+l,w);else{var x=e._handlers||(e._handlers={});x[l]=(x[l]||et).concat(w)}};function ot(e,l){return e._handlers&&e._handlers[l]||et}function ce(e,l,w){if(e.removeEventListener)e.removeEventListener(l,w,!1);else if(e.detachEvent)e.detachEvent("on"+l,w);else{var x=e._handlers,D=x&&x[l];if(D){var W=de(D,w);W>-1&&(x[l]=D.slice(0,W).concat(D.slice(W+1)))}}}function Pe(e,l){var w=ot(e,l);if(!w.length)return;for(var x=Array.prototype.slice.call(arguments,2),D=0;D<w.length;++D)w[D].apply(null,x)}function Fe(e,l,w){return typeof l=="string"&&(l={type:l,preventDefault:function(){this.defaultPrevented=!0}}),Pe(e,w||l.type,e,l),Q(l)||l.codemirrorIgnore}function Ce(e){var l=e._handlers&&e._handlers.cursorActivity;if(!l)return;for(var w=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),x=0;x<l.length;++x)de(w,l[x])==-1&&w.push(l[x])}function _e(e,l){return ot(e,l).length>0}function Ee(e){e.prototype.on=function(l,w){je(this,l,w)},e.prototype.off=function(l,w){ce(this,l,w)}}function ee(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function oe(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function Q(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function me(e){ee(e),oe(e)}function Oe(e){return e.target||e.srcElement}function V(e){var l=e.which;return l==null&&(e.button&1?l=1:e.button&2?l=3:e.button&4&&(l=2)),d&&e.ctrlKey&&l==1&&(l=3),l}var Re=function(){if(E&&b<9)return!1;var e=g("div");return"draggable"in e||"dragDrop"in e}(),Xe;function pe(e){if(Xe==null){var l=g("span","\u200B");O(e,g("span",[l,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(Xe=l.offsetWidth<=1&&l.offsetHeight>2&&!(E&&b<8))}var w=Xe?g("span","\u200B"):g("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return w.setAttribute("cm-text",""),w}var ke;function Ve(e){if(ke!=null)return ke;var l=O(e,document.createTextNode("A\u062EA")),w=P(l,0,1).getBoundingClientRect(),x=P(l,1,2).getBoundingClientRect();return T(e),!w||w.left==w.right?!1:ke=x.right-w.right<3}var ht=`
|
|
|
|
|
|
b`.split(/\n/).length!=3?function(e){for(var l=0,w=[],x=e.length;l<=x;){var D=e.indexOf(`
|
|
|
`,l);D==-1&&(D=e.length);var W=e.slice(l,e.charAt(D-1)=="\r"?D-1:D),Z=W.indexOf("\r");Z!=-1?(w.push(W.slice(0,Z)),l+=Z+1):(w.push(W),l=D+1)}return w}:function(e){return e.split(/\r\n?|\n/)},tt=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(l){return!1}}:function(e){var l;try{l=e.ownerDocument.selection.createRange()}catch(w){}return!l||l.parentElement()!=e?!1:l.compareEndPoints("StartToEnd",l)!=0},at=function(){var e=g("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),ut=null;function Ft(e){if(ut!=null)return ut;var l=O(e,g("span","x")),w=l.getBoundingClientRect(),x=P(l,0,1).getBoundingClientRect();return ut=Math.abs(w.left-x.left)>1}var St={},vt={};function Bt(e,l){arguments.length>2&&(l.dependencies=Array.prototype.slice.call(arguments,2)),St[e]=l}function Nt(e,l){vt[e]=l}function dt(e){if(typeof e=="string"&&vt.hasOwnProperty(e))e=vt[e];else if(e&&typeof e.name=="string"&&vt.hasOwnProperty(e.name)){var l=vt[e.name];typeof l=="string"&&(l={name:l}),e=$e(l,e),e.name=l.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return dt("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return dt("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function Ut(e,l){l=dt(l);var w=St[l.name];if(!w)return Ut(e,"text/plain");var x=w(e,l);if(gt.hasOwnProperty(l.name)){var D=gt[l.name];for(var W in D){if(!D.hasOwnProperty(W))continue;x.hasOwnProperty(W)&&(x["_"+W]=x[W]),x[W]=D[W]}}if(x.name=l.name,l.helperType&&(x.helperType=l.helperType),l.modeProps)for(var Z in l.modeProps)x[Z]=l.modeProps[Z];return x}var gt={};function pt(e,l){var w=gt.hasOwnProperty(e)?gt[e]:gt[e]={};k(l,w)}function Ct(e,l){if(l===!0)return l;if(e.copyState)return e.copyState(l);var w={};for(var x in l){var D=l[x];D instanceof Array&&(D=D.concat([])),w[x]=D}return w}function It(e,l){for(var w;e.innerMode&&!(w=e.innerMode(l),!w||w.mode==e);)l=w.state,e=w.mode;return w||{mode:e,state:l}}function Xt(e,l,w){return e.startState?e.startState(l,w):!0}var At=function(e,l,w){this.pos=this.start=0,this.string=e,this.tabSize=l||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=w};At.prototype.eol=function(){return this.pos>=this.string.length},At.prototype.sol=function(){return this.pos==this.lineStart},At.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},At.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},At.prototype.eat=function(e){var l=this.string.charAt(this.pos),w;if(typeof e=="string"?w=l==e:w=l&&(e.test?e.test(l):e(l)),w)return++this.pos,l},At.prototype.eatWhile=function(e){for(var l=this.pos;this.eat(e););return this.pos>l},At.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},At.prototype.skipToEnd=function(){this.pos=this.string.length},At.prototype.skipTo=function(e){var l=this.string.indexOf(e,this.pos);if(l>-1)return this.pos=l,!0},At.prototype.backUp=function(e){this.pos-=e},At.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=z(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?z(this.string,this.lineStart,this.tabSize):0)},At.prototype.indentation=function(){return z(this.string,null,this.tabSize)-(this.lineStart?z(this.string,this.lineStart,this.tabSize):0)},At.prototype.match=function(e,l,w){if(typeof e=="string"){var x=function(Z){return w?Z.toLowerCase():Z},D=this.string.substr(this.pos,e.length);if(x(D)==x(e))return l!==!1&&(this.pos+=e.length),!0}else{var W=this.string.slice(this.pos).match(e);return W&&W.index>0?null:(W&&l!==!1&&(this.pos+=W[0].length),W)}},At.prototype.current=function(){return this.string.slice(this.start,this.pos)},At.prototype.hideFirstChars=function(e,l){this.lineStart+=e;try{return l()}finally{this.lineStart-=e}},At.prototype.lookAhead=function(e){var l=this.lineOracle;return l&&l.lookAhead(e)},At.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function bt(e,l){if(l-=e.first,l<0||l>=e.size)throw new Error("There is no line "+(l+e.first)+" in the document.");for(var w=e;!w.lines;)for(var x=0;;++x){var D=w.children[x],W=D.chunkSize();if(l<W){w=D;break}l-=W}return w.lines[l]}function Si(e,l,w){var x=[],D=l.line;return e.iter(l.line,w.line+1,function(W){var Z=W.text;D==w.line&&(Z=Z.slice(0,w.ch)),D==l.line&&(Z=Z.slice(l.ch)),x.push(Z),++D}),x}function qt(e,l,w){var x=[];return e.iter(l,w,function(D){x.push(D.text)}),x}function ii(e,l){var w=l-e.height;if(w)for(var x=e;x;x=x.parent)x.height+=w}function Pt(e){if(e.parent==null)return null;for(var l=e.parent,w=de(l.lines,e),x=l.parent;x;l=x,x=x.parent)for(var D=0;!(x.children[D]==l);++D)w+=x.children[D].chunkSize();return w+l.first}function di(e,l){var w=e.first;e:do{for(var x=0;x<e.children.length;++x){var D=e.children[x],W=D.height;if(l<W){e=D;continue e}l-=W,w+=D.chunkSize()}return w}while(!e.lines);for(var Z=0;Z<e.lines.length;++Z){var ie=e.lines[Z],se=ie.height;if(l<se)break;l-=se}return w+Z}function Di(e,l){return l>=e.first&&l<e.first+e.size}function Yi(e,l){return String(e.lineNumberFormatter(l+e.firstLineNumber))}function ct(e,l,w){if(w===void 0&&(w=null),!(this instanceof ct))return new ct(e,l,w);this.line=e,this.ch=l,this.sticky=w}function Dt(e,l){return e.line-l.line||e.ch-l.ch}function pr(e,l){return e.sticky==l.sticky&&Dt(e,l)==0}function mr(e){return ct(e.line,e.ch)}function gr(e,l){return Dt(e,l)<0?l:e}function vr(e,l){return Dt(e,l)<0?e:l}function J(e,l){return Math.max(e.first,Math.min(l,e.first+e.size-1))}function B(e,l){if(l.line<e.first)return ct(e.first,0);var w=e.first+e.size-1;return l.line>w?ct(w,bt(e,w).text.length):H(l,bt(e,l.line).text.length)}function H(e,l){var w=e.ch;return w==null||w>l?ct(e.line,l):w<0?ct(e.line,0):e}function Y(e,l){for(var w=[],x=0;x<l.length;x++)w[x]=B(e,l[x]);return w}var le=function(e,l){this.state=e,this.lookAhead=l},$=function(e,l,w,x){this.state=l,this.doc=e,this.line=w,this.maxLookAhead=x||0,this.baseTokens=null,this.baseTokenPos=1};$.prototype.lookAhead=function(e){var l=this.doc.getLine(this.line+e);return l!=null&&e>this.maxLookAhead&&(this.maxLookAhead=e),l},$.prototype.baseToken=function(e){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=e;)this.baseTokenPos+=2;var l=this.baseTokens[this.baseTokenPos+1];return{type:l&&l.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-e}},$.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},$.fromSaved=function(e,l,w){return l instanceof le?new $(e,Ct(e.mode,l.state),w,l.lookAhead):new $(e,Ct(e.mode,l),w)},$.prototype.save=function(e){var l=e!==!1?Ct(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new le(l,this.maxLookAhead):l};function Be(e,l,w,x){var D=[e.state.modeGen],W={};Ti(e,l.text,e.doc.mode,w,function(ue,De){return D.push(ue,De)},W,x);for(var Z=w.state,ie=function(ue){w.baseTokens=D;var De=e.state.overlays[ue],Ue=1,qe=0;w.state=!0,Ti(e,l.text,De.mode,w,function(Ze,rt){for(var lt=Ue;qe<Ze;){var ft=D[Ue];ft>Ze&&D.splice(Ue,1,Ze,D[Ue+1],ft),Ue+=2,qe=Math.min(Ze,ft)}if(!rt)return;if(De.opaque)D.splice(lt,Ue-lt,Ze,"overlay "+rt),Ue=lt+2;else for(;lt<Ue;lt+=2){var _t=D[lt+1];D[lt+1]=(_t?_t+" ":"")+"overlay "+rt}},W),w.state=Z,w.baseTokens=null,w.baseTokenPos=1},se=0;se<e.state.overlays.length;++se)ie(se);return{styles:D,classes:W.bgClass||W.textClass?W:null}}function nt(e,l,w){if(!l.styles||l.styles[0]!=e.state.modeGen){var x=mt(e,Pt(l)),D=l.text.length>e.options.maxHighlightLength&&Ct(e.doc.mode,x.state),W=Be(e,l,x);D&&(x.state=D),l.stateAfter=x.save(!D),l.styles=W.styles,W.classes?l.styleClasses=W.classes:l.styleClasses&&(l.styleClasses=null),w===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return l.styles}function mt(e,l,w){var x=e.doc,D=e.display;if(!x.mode.startState)return new $(x,!0,l);var W=Ci(e,l,w),Z=W>x.first&&bt(x,W-1).stateAfter,ie=Z?$.fromSaved(x,Z,W):new $(x,Xt(x.mode),W);return x.iter(W,l,function(se){wt(e,se.text,ie);var ue=ie.line;se.stateAfter=ue==l-1||ue%5==0||ue>=D.viewFrom&&ue<D.viewTo?ie.save():null,ie.nextLine()}),w&&(x.modeFrontier=ie.line),ie}function wt(e,l,w,x){var D=e.doc.mode,W=new At(l,e.options.tabSize,w);for(W.start=W.pos=x||0,l==""&&st(D,w.state);!W.eol();)Rt(D,W,w.state),W.start=W.pos}function st(e,l){if(e.blankLine)return e.blankLine(l);if(!e.innerMode)return;var w=It(e,l);if(w.mode.blankLine)return w.mode.blankLine(w.state)}function Rt(e,l,w,x){for(var D=0;D<10;D++){x&&(x[0]=It(e,w).mode);var W=e.token(l,w);if(l.pos>l.start)return W}throw new Error("Mode "+e.name+" failed to advance stream.")}var Vt=function(e,l,w){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=l||null,this.state=w};function ri(e,l,w,x){var D=e.doc,W=D.mode,Z;l=B(D,l);var ie=bt(D,l.line),se=mt(e,l.line,w),ue=new At(ie.text,e.options.tabSize,se),De;for(x&&(De=[]);(x||ue.pos<l.ch)&&!ue.eol();)ue.start=ue.pos,Z=Rt(W,ue,se.state),x&&De.push(new Vt(ue,Z,Ct(D.mode,se.state)));return x?De:new Vt(ue,Z,se.state)}function Hi(e,l){if(e)for(;;){var w=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!w)break;e=e.slice(0,w.index)+e.slice(w.index+w[0].length);var x=w[1]?"bgClass":"textClass";l[x]==null?l[x]=w[2]:new RegExp("(?:^|\\s)"+w[2]+"(?:$|\\s)").test(l[x])||(l[x]+=" "+w[2])}return e}function Ti(e,l,w,x,D,W,Z){var ie=w.flattenSpans;ie==null&&(ie=e.options.flattenSpans);var se=0,ue=null,De=new At(l,e.options.tabSize,x),Ue,qe=e.options.addModeClass&&[null];for(l==""&&Hi(st(w,x.state),W);!De.eol();){if(De.pos>e.options.maxHighlightLength?(ie=!1,Z&&wt(e,l,x,De.pos),De.pos=l.length,Ue=null):Ue=Hi(Rt(w,De,x.state,qe),W),qe){var Ze=qe[0].name;Ze&&(Ue="m-"+(Ue?Ze+" "+Ue:Ze))}if(!ie||ue!=Ue){for(;se<De.start;)se=Math.min(De.start,se+5e3),D(se,ue);ue=Ue}De.start=De.pos}for(;se<De.pos;){var rt=Math.min(De.pos,se+5e3);D(rt,ue),se=rt}}function Ci(e,l,w){for(var x,D,W=e.doc,Z=w?-1:l-(e.doc.mode.innerMode?1e3:100),ie=l;ie>Z;--ie){if(ie<=W.first)return W.first;var se=bt(W,ie-1),ue=se.stateAfter;if(ue&&(!w||ie+(ue instanceof le?ue.lookAhead:0)<=W.modeFrontier))return ie;var De=z(se.text,null,e.options.tabSize);(D==null||x>De)&&(D=ie-1,x=De)}return D}function qi(e,l){if(e.modeFrontier=Math.min(e.modeFrontier,l),e.highlightFrontier<l-10)return;for(var w=e.first,x=l-1;x>w;x--){var D=bt(e,x).stateAfter;if(D&&(!(D instanceof le)||x+D.lookAhead<l)){w=x+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,w)}var kr=!1,mi=!1;function zi(){kr=!0}function lr(){mi=!0}function ur(e,l,w){this.marker=e,this.from=l,this.to=w}function ji(e,l){if(e)for(var w=0;w<e.length;++w){var x=e[w];if(x.marker==l)return x}}function Ir(e,l){for(var w,x=0;x<e.length;++x)e[x]!=l&&(w||(w=[])).push(e[x]);return w}function _r(e,l){e.markedSpans=e.markedSpans?e.markedSpans.concat([l]):[l],l.marker.attachLine(e)}function Xr(e,l,w){var x;if(e)for(var D=0;D<e.length;++D){var W=e[D],Z=W.marker,ie=W.from==null||(Z.inclusiveLeft?W.from<=l:W.from<l);if(ie||W.from==l&&Z.type=="bookmark"&&(!w||!W.marker.insertLeft)){var se=W.to==null||(Z.inclusiveRight?W.to>=l:W.to>l);(x||(x=[])).push(new ur(Z,W.from,se?null:W.to))}}return x}function zr(e,l,w){var x;if(e)for(var D=0;D<e.length;++D){var W=e[D],Z=W.marker,ie=W.to==null||(Z.inclusiveRight?W.to>=l:W.to>l);if(ie||W.from==l&&Z.type=="bookmark"&&(!w||W.marker.insertLeft)){var se=W.from==null||(Z.inclusiveLeft?W.from<=l:W.from<l);(x||(x=[])).push(new ur(Z,se?null:W.from-l,W.to==null?null:W.to-l))}}return x}function $i(e,l){if(l.full)return null;var w=Di(e,l.from.line)&&bt(e,l.from.line).markedSpans,x=Di(e,l.to.line)&&bt(e,l.to.line).markedSpans;if(!w&&!x)return null;var D=l.from.ch,W=l.to.ch,Z=Dt(l.from,l.to)==0,ie=Xr(w,D,Z),se=zr(x,W,Z),ue=l.text.length==1,De=he(l.text).length+(ue?D:0);if(ie)for(var Ue=0;Ue<ie.length;++Ue){var qe=ie[Ue];if(qe.to==null){var Ze=ji(se,qe.marker);Ze?ue&&(qe.to=Ze.to==null?null:Ze.to+De):qe.to=D}}if(se)for(var rt=0;rt<se.length;++rt){var lt=se[rt];if(lt.to!=null&&(lt.to+=De),lt.from==null){var ft=ji(ie,lt.marker);ft||(lt.from=De,ue&&(ie||(ie=[])).push(lt))}else lt.from+=De,ue&&(ie||(ie=[])).push(lt)}ie&&(ie=Qi(ie)),se&&se!=ie&&(se=Qi(se));var _t=[ie];if(!ue){var xt=l.text.length-2,yt;if(xt>0&&ie)for(var Et=0;Et<ie.length;++Et)ie[Et].to==null&&(yt||(yt=[])).push(new ur(ie[Et].marker,null,null));for(var kt=0;kt<xt;++kt)_t.push(yt);_t.push(se)}return _t}function Qi(e){for(var l=0;l<e.length;++l){var w=e[l];w.from!=null&&w.from==w.to&&w.marker.clearWhenEmpty!==!1&&e.splice(l--,1)}return e.length?e:null}function yr(e,l,w){var x=null;if(e.iter(l.line,w.line+1,function(Ze){if(Ze.markedSpans)for(var rt=0;rt<Ze.markedSpans.length;++rt){var lt=Ze.markedSpans[rt].marker;lt.readOnly&&(!x||de(x,lt)==-1)&&(x||(x=[])).push(lt)}}),!x)return null;for(var D=[{from:l,to:w}],W=0;W<x.length;++W)for(var Z=x[W],ie=Z.find(0),se=0;se<D.length;++se){var ue=D[se];if(Dt(ue.to,ie.from)<0||Dt(ue.from,ie.to)>0)continue;var De=[se,1],Ue=Dt(ue.from,ie.from),qe=Dt(ue.to,ie.to);(Ue<0||!Z.inclusiveLeft&&!Ue)&&De.push({from:ue.from,to:ie.from}),(qe>0||!Z.inclusiveRight&&!qe)&&De.push({from:ie.to,to:ue.to}),D.splice.apply(D,De),se+=De.length-3}return D}function cn(e){var l=e.markedSpans;if(!l)return;for(var w=0;w<l.length;++w)l[w].marker.detachLine(e);e.markedSpans=null}function br(e,l){if(!l)return;for(var w=0;w<l.length;++w)l[w].marker.attachLine(e);e.markedSpans=l}function oi(e){return e.inclusiveLeft?-1:0}function Yt(e){return e.inclusiveRight?1:0}function xi(e,l){var w=e.lines.length-l.lines.length;if(w!=0)return w;var x=e.find(),D=l.find(),W=Dt(x.from,D.from)||oi(e)-oi(l);if(W)return-W;var Z=Dt(x.to,D.to)||Yt(e)-Yt(l);return Z||l.id-e.id}function jt(e,l){var w=mi&&e.markedSpans,x;if(w)for(var D=void 0,W=0;W<w.length;++W)D=w[W],D.marker.collapsed&&(l?D.from:D.to)==null&&(!x||xi(x,D.marker)<0)&&(x=D.marker);return x}function ui(e){return jt(e,!0)}function $t(e){return jt(e,!1)}function rr(e,l){var w=mi&&e.markedSpans,x;if(w)for(var D=0;D<w.length;++D){var W=w[D];W.marker.collapsed&&(W.from==null||W.from<l)&&(W.to==null||W.to>l)&&(!x||xi(x,W.marker)<0)&&(x=W.marker)}return x}function gi(e,l,w,x,D){var W=bt(e,l),Z=mi&&W.markedSpans;if(Z)for(var ie=0;ie<Z.length;++ie){var se=Z[ie];if(!se.marker.collapsed)continue;var ue=se.marker.find(0),De=Dt(ue.from,w)||oi(se.marker)-oi(D),Ue=Dt(ue.to,x)||Yt(se.marker)-Yt(D);if(De>=0&&Ue<=0||De<=0&&Ue>=0)continue;if(De<=0&&(se.marker.inclusiveRight&&D.inclusiveLeft?Dt(ue.to,w)>=0:Dt(ue.to,w)>0)||De>=0&&(se.marker.inclusiveRight&&D.inclusiveLeft?Dt(ue.from,x)<=0:Dt(ue.from,x)<0))return!0}}function Oi(e){for(var l;l=ui(e);)e=l.find(-1,!0).line;return e}function Gr(e){for(var l;l=$t(e);)e=l.find(1,!0).line;return e}function xr(e){for(var l,w;l=$t(e);)e=l.find(1,!0).line,(w||(w=[])).push(e);return w}function dn(e,l){var w=bt(e,l),x=Oi(w);return w==x?l:Pt(x)}function Er(e,l){if(l>e.lastLine())return l;var w=bt(e,l),x;if(!nr(e,w))return l;for(;x=$t(w);)w=x.find(1,!0).line;return Pt(w)+1}function nr(e,l){var w=mi&&l.markedSpans;if(w)for(var x=void 0,D=0;D<w.length;++D){if(x=w[D],!x.marker.collapsed)continue;if(x.from==null)return!0;if(x.marker.widgetNode)continue;if(x.from==0&&x.marker.inclusiveLeft&&fn(e,l,x))return!0}}function fn(e,l,w){if(w.to==null){var x=w.marker.find(1,!0);return fn(e,x.line,ji(x.line.markedSpans,w.marker))}if(w.marker.inclusiveRight&&w.to==l.text.length)return!0;for(var D=void 0,W=0;W<l.markedSpans.length;++W)if(D=l.markedSpans[W],D.marker.collapsed&&!D.marker.widgetNode&&D.from==w.to&&(D.to==null||D.to!=w.from)&&(D.marker.inclusiveLeft||w.marker.inclusiveRight)&&fn(e,l,D))return!0}function Ji(e){e=Oi(e);for(var l=0,w=e.parent,x=0;x<w.lines.length;++x){var D=w.lines[x];if(D==e)break;l+=D.height}for(var W=w.parent;W;w=W,W=w.parent)for(var Z=0;Z<W.children.length;++Z){var ie=W.children[Z];if(ie==w)break;l+=ie.height}return l}function pn(e){if(e.height==0)return 0;for(var l=e.text.length,w,x=e;w=ui(x);){var D=w.find(0,!0);x=D.from.line,l+=D.from.ch-D.to.ch}for(x=e;w=$t(x);){var W=w.find(0,!0);l-=x.text.length-W.from.ch,x=W.to.line,l+=x.text.length-W.to.ch}return l}function Kn(e){var l=e.display,w=e.doc;l.maxLine=bt(w,w.first),l.maxLineLength=pn(l.maxLine),l.maxLineChanged=!0,w.iter(function(x){var D=pn(x);D>l.maxLineLength&&(l.maxLineLength=D,l.maxLine=x)})}var Dr=function(e,l,w){this.text=e,br(this,l),this.height=w?w(this):1};Dr.prototype.lineNo=function(){return Pt(this)},Ee(Dr);function ua(e,l,w,x){e.text=l,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),cn(e),br(e,w);var D=x?x(e):1;D!=e.height&&ii(e,D)}function Tt(e){e.parent=null,cn(e)}var Mt={},Ot={};function Ht(e,l){if(!e||/^\s*$/.test(e))return null;var w=l.addModeClass?Ot:Mt;return w[e]||(w[e]=e.replace(/\S+/g,"cm-$&"))}function Gt(e,l){var w=F("span",null,null,i?"padding-right: .1px":null),x={pre:F("pre",[w],"CodeMirror-line"),content:w,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};l.measure={};for(var D=0;D<=(l.rest?l.rest.length:0);D++){var W=D?l.rest[D-1]:l.line,Z=void 0;x.pos=0,x.addToken=zt,Ve(e.display.measure)&&(Z=Ye(W,e.doc.direction))&&(x.addToken=Mi(x.addToken,Z)),x.map=[];var ie=l!=e.display.externalMeasured&&Pt(W);hr(W,x,nt(e,W,ie)),W.styleClasses&&(W.styleClasses.bgClass&&(x.bgClass=A(W.styleClasses.bgClass,x.bgClass||"")),W.styleClasses.textClass&&(x.textClass=A(W.styleClasses.textClass,x.textClass||""))),x.map.length==0&&x.map.push(0,0,x.content.appendChild(pe(e.display.measure))),D==0?(l.measure.map=x.map,l.measure.cache={}):((l.measure.maps||(l.measure.maps=[])).push(x.map),(l.measure.caches||(l.measure.caches=[])).push({}))}if(i){var se=x.content.lastChild;(/\bcm-tab\b/.test(se.className)||se.querySelector&&se.querySelector(".cm-tab"))&&(x.content.className="cm-tab-wrap-hack")}return Pe(e,"renderLine",e,l.line,x.pre),x.pre.className&&(x.textClass=A(x.pre.className,x.textClass||"")),x}function ei(e){var l=g("span","\u2022","cm-invalidchar");return l.title="\\u"+e.charCodeAt(0).toString(16),l.setAttribute("aria-label",l.title),l}function zt(e,l,w,x,D,W,Z){if(!l)return;var ie=e.splitSpaces?fi(l,e.trailingSpace):l,se=e.cm.state.specialChars,ue=!1,De;if(!se.test(l))e.col+=l.length,De=document.createTextNode(ie),e.map.push(e.pos,e.pos+l.length,De),E&&b<9&&(ue=!0),e.pos+=l.length;else{De=document.createDocumentFragment();for(var Ue=0;;){se.lastIndex=Ue;var qe=se.exec(l),Ze=qe?qe.index-Ue:l.length-Ue;if(Ze){var rt=document.createTextNode(ie.slice(Ue,Ue+Ze));E&&b<9?De.appendChild(g("span",[rt])):De.appendChild(rt),e.map.push(e.pos,e.pos+Ze,rt),e.col+=Ze,e.pos+=Ze}if(!qe)break;Ue+=Ze+1;var lt=void 0;if(qe[0]==" "){var ft=e.cm.options.tabSize,_t=ft-e.col%ft;lt=De.appendChild(g("span",Se(_t),"cm-tab")),lt.setAttribute("role","presentation"),lt.setAttribute("cm-text"," "),e.col+=_t}else qe[0]=="\r"||qe[0]==`
|
|
|
`?(lt=De.appendChild(g("span",qe[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),lt.setAttribute("cm-text",qe[0]),e.col+=1):(lt=e.cm.options.specialCharPlaceholder(qe[0]),lt.setAttribute("cm-text",qe[0]),E&&b<9?De.appendChild(g("span",[lt])):De.appendChild(lt),e.col+=1);e.map.push(e.pos,e.pos+1,lt),e.pos++}}if(e.trailingSpace=ie.charCodeAt(l.length-1)==32,w||x||D||ue||W||Z){var xt=w||"";x&&(xt+=x),D&&(xt+=D);var yt=g("span",[De],xt,W);if(Z)for(var Et in Z)Z.hasOwnProperty(Et)&&Et!="style"&&Et!="class"&&yt.setAttribute(Et,Z[Et]);return e.content.appendChild(yt)}e.content.appendChild(De)}function fi(e,l){if(e.length>1&&!/ /.test(e))return e;for(var w=l,x="",D=0;D<e.length;D++){var W=e.charAt(D);W==" "&&w&&(D==e.length-1||e.charCodeAt(D+1)==32)&&(W="\xA0"),x+=W,w=W==" "}return x}function Mi(e,l){return function(w,x,D,W,Z,ie,se){D=D?D+" cm-force-border":"cm-force-border";for(var ue=w.pos,De=ue+x.length;;){for(var Ue=void 0,qe=0;qe<l.length&&!(Ue=l[qe],Ue.to>ue&&Ue.from<=ue);qe++);if(Ue.to>=De)return e(w,x,D,W,Z,ie,se);e(w,x.slice(0,Ue.to-ue),D,W,null,ie,se),W=null,x=x.slice(Ue.to-ue),ue=Ue.to}}}function Wt(e,l,w,x){var D=!x&&w.widgetNode;D&&e.map.push(e.pos,e.pos+l,D),!x&&e.cm.display.input.needsContentAttribute&&(D||(D=e.content.appendChild(document.createElement("span"))),D.setAttribute("cm-marker",w.id)),D&&(e.cm.display.input.setUneditable(D),e.content.appendChild(D)),e.pos+=l,e.trailingSpace=!1}function hr(e,l,w){var x=e.markedSpans,D=e.text,W=0;if(!x){for(var Z=1;Z<w.length;Z+=2)l.addToken(l,D.slice(W,W=w[Z]),Ht(w[Z+1],l.cm.options));return}for(var ie=D.length,se=0,ue=1,De="",Ue,qe,Ze=0,rt,lt,ft,_t,xt;;){if(Ze==se){rt=lt=ft=qe="",xt=null,_t=null,Ze=Infinity;for(var yt=[],Et=void 0,kt=0;kt<x.length;++kt){var Lt=x[kt],Kt=Lt.marker;if(Kt.type=="bookmark"&&Lt.from==se&&Kt.widgetNode)yt.push(Kt);else if(Lt.from<=se&&(Lt.to==null||Lt.to>se||Kt.collapsed&&Lt.to==se&&Lt.from==se)){if(Lt.to!=null&&Lt.to!=se&&Ze>Lt.to&&(Ze=Lt.to,lt=""),Kt.className&&(rt+=" "+Kt.className),Kt.css&&(qe=(qe?qe+";":"")+Kt.css),Kt.startStyle&&Lt.from==se&&(ft+=" "+Kt.startStyle),Kt.endStyle&&Lt.to==Ze&&(Et||(Et=[])).push(Kt.endStyle,Lt.to),Kt.title&&((xt||(xt={})).title=Kt.title),Kt.attributes)for(var ti in Kt.attributes)(xt||(xt={}))[ti]=Kt.attributes[ti];Kt.collapsed&&(!_t||xi(_t.marker,Kt)<0)&&(_t=Lt)}else Lt.from>se&&Ze>Lt.from&&(Ze=Lt.from)}if(Et)for(var yi=0;yi<Et.length;yi+=2)Et[yi+1]==Ze&&(lt+=" "+Et[yi]);if(!_t||_t.from==se)for(var ai=0;ai<yt.length;++ai)Wt(l,0,yt[ai]);if(_t&&(_t.from||0)==se){if(Wt(l,(_t.to==null?ie+1:_t.to)-se,_t.marker,_t.from==null),_t.to==null)return;_t.to==se&&(_t=!1)}}if(se>=ie)break;for(var Xi=Math.min(ie,Ze);;){if(De){var Ui=se+De.length;if(!_t){var hi=Ui>Xi?De.slice(0,Xi-se):De;l.addToken(l,hi,Ue?Ue+rt:rt,ft,se+hi.length==Ze?lt:"",qe,xt)}if(Ui>=Xi){De=De.slice(Xi-se),se=Xi;break}se=Ui,ft=""}De=D.slice(W,W=w[ue++]),Ue=Ht(w[ue++],l.cm.options)}}}function Qt(e,l,w){this.line=l,this.rest=xr(l),this.size=this.rest?Pt(he(this.rest))-w+1:1,this.node=this.text=null,this.hidden=nr(e,l)}function Pi(e,l,w){for(var x=[],D,W=l;W<w;W=D){var Z=new Qt(e.doc,bt(e.doc,W),W);D=W+Z.size,x.push(Z)}return x}var Ai=null;function Zi(e){Ai?Ai.ops.push(e):e.ownsGroup=Ai={ops:[e],delayedCallbacks:[]}}function Oo(e){var l=e.delayedCallbacks,w=0;do{for(;w<l.length;w++)l[w].call(null);for(var x=0;x<e.ops.length;x++){var D=e.ops[x];if(D.cursorActivityHandlers)for(;D.cursorActivityCalled<D.cursorActivityHandlers.length;)D.cursorActivityHandlers[D.cursorActivityCalled++].call(null,D.cm)}}while(w<l.length)}function ko(e,l){var w=e.ownsGroup;if(!w)return;try{Oo(w)}finally{Ai=null,l(w)}}var mn=null;function Ei(e,l){var w=ot(e,l);if(!w.length)return;var x=Array.prototype.slice.call(arguments,2),D;Ai?D=Ai.delayedCallbacks:mn?D=mn:(D=mn=[],setTimeout(Io,0));for(var W=function(ie){D.push(function(){return w[ie].apply(null,x)})},Z=0;Z<w.length;++Z)W(Z)}function Io(){var e=mn;mn=null;for(var l=0;l<e.length;++l)e[l]()}function Ya(e,l,w,x){for(var D=0;D<l.changes.length;D++){var W=l.changes[D];W=="text"?Mo(e,l):W=="gutter"?Za(e,l,w,x):W=="class"?ha(e,l):W=="widget"&&Po(e,l,x)}l.changes=null}function gn(e){return e.node==e.text&&(e.node=g("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),E&&b<8&&(e.node.style.zIndex=2)),e.node}function Do(e,l){var w=l.bgClass?l.bgClass+" "+(l.line.bgClass||""):l.line.bgClass;if(w&&(w+=" CodeMirror-linebackground"),l.background)w?l.background.className=w:(l.background.parentNode.removeChild(l.background),l.background=null);else if(w){var x=gn(l);l.background=x.insertBefore(g("div",null,w),x.firstChild),e.display.input.setUneditable(l.background)}}function Qa(e,l){var w=e.display.externalMeasured;return w&&w.line==l.line?(e.display.externalMeasured=null,l.measure=w.measure,w.built):Gt(e,l)}function Mo(e,l){var w=l.text.className,x=Qa(e,l);l.text==l.node&&(l.node=x.pre),l.text.parentNode.replaceChild(x.pre,l.text),l.text=x.pre,x.bgClass!=l.bgClass||x.textClass!=l.textClass?(l.bgClass=x.bgClass,l.textClass=x.textClass,ha(e,l)):w&&(l.text.className=w)}function ha(e,l){Do(e,l),l.line.wrapClass?gn(l).className=l.line.wrapClass:l.node!=l.text&&(l.node.className="");var w=l.textClass?l.textClass+" "+(l.line.textClass||""):l.line.textClass;l.text.className=w||""}function Za(e,l,w,x){if(l.gutter&&(l.node.removeChild(l.gutter),l.gutter=null),l.gutterBackground&&(l.node.removeChild(l.gutterBackground),l.gutterBackground=null),l.line.gutterClass){var D=gn(l);l.gutterBackground=g("div",null,"CodeMirror-gutter-background "+l.line.gutterClass,"left: "+(e.options.fixedGutter?x.fixedPos:-x.gutterTotalWidth)+"px; width: "+x.gutterTotalWidth+"px"),e.display.input.setUneditable(l.gutterBackground),D.insertBefore(l.gutterBackground,l.text)}var W=l.line.gutterMarkers;if(e.options.lineNumbers||W){var Z=gn(l),ie=l.gutter=g("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?x.fixedPos:-x.gutterTotalWidth)+"px");if(e.display.input.setUneditable(ie),Z.insertBefore(ie,l.text),l.line.gutterClass&&(ie.className+=" "+l.line.gutterClass),e.options.lineNumbers&&(!W||!W["CodeMirror-linenumbers"])&&(l.lineNumber=ie.appendChild(g("div",Yi(e.options,w),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+x.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),W)for(var se=0;se<e.display.gutterSpecs.length;++se){var ue=e.display.gutterSpecs[se].className,De=W.hasOwnProperty(ue)&&W[ue];De&&ie.appendChild(g("div",[De],"CodeMirror-gutter-elt","left: "+x.gutterLeft[ue]+"px; width: "+x.gutterWidth[ue]+"px"))}}}function Po(e,l,w){l.alignable&&(l.alignable=null);for(var x=_("CodeMirror-linewidget"),D=l.node.firstChild,W=void 0;D;D=W)W=D.nextSibling,x.test(D.className)&&l.node.removeChild(D);qa(e,l,w)}function No(e,l,w,x){var D=Qa(e,l);return l.text=l.node=D.pre,D.bgClass&&(l.bgClass=D.bgClass),D.textClass&&(l.textClass=D.textClass),ha(e,l),Za(e,l,w,x),qa(e,l,x),l.node}function qa(e,l,w){if($a(e,l.line,l,w,!0),l.rest)for(var x=0;x<l.rest.length;x++)$a(e,l.rest[x],l,w,!1)}function $a(e,l,w,x,D){if(!l.widgets)return;for(var W=gn(w),Z=0,ie=l.widgets;Z<ie.length;++Z){var se=ie[Z],ue=g("div",[se.node],"CodeMirror-linewidget"+(se.className?" "+se.className:""));se.handleMouseEvents||ue.setAttribute("cm-ignore-events","true"),Fo(se,ue,w,x),e.display.input.setUneditable(ue),D&&se.above?W.insertBefore(ue,w.gutter||w.text):W.appendChild(ue),Ei(se,"redraw")}}function Fo(e,l,w,x){if(e.noHScroll){(w.alignable||(w.alignable=[])).push(l);var D=x.wrapperWidth;l.style.left=x.fixedPos+"px",e.coverGutter||(D-=x.gutterTotalWidth,l.style.paddingLeft=x.gutterTotalWidth+"px"),l.style.width=D+"px"}e.coverGutter&&(l.style.zIndex=5,l.style.position="relative",e.noHScroll||(l.style.marginLeft=-x.gutterTotalWidth+"px"))}function vn(e){if(e.height!=null)return e.height;var l=e.doc.cm;if(!l)return 0;if(!N(document.body,e.node)){var w="position: relative;";e.coverGutter&&(w+="margin-left: -"+l.display.gutters.offsetWidth+"px;"),e.noHScroll&&(w+="width: "+l.display.wrapper.clientWidth+"px;"),O(l.display.measure,g("div",[e.node],null,w))}return e.height=e.node.parentNode.offsetHeight}function cr(e,l){for(var w=Oe(l);w!=e.wrapper;w=w.parentNode)if(!w||w.nodeType==1&&w.getAttribute("cm-ignore-events")=="true"||w.parentNode==e.sizer&&w!=e.mover)return!0}function Hn(e){return e.lineSpace.offsetTop}function ca(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function Ja(e){if(e.cachedPaddingH)return e.cachedPaddingH;var l=O(e.measure,g("pre","x","CodeMirror-line-like")),w=window.getComputedStyle?window.getComputedStyle(l):l.currentStyle,x={left:parseInt(w.paddingLeft),right:parseInt(w.paddingRight)};return!isNaN(x.left)&&!isNaN(x.right)&&(e.cachedPaddingH=x),x}function ar(e){return be-e.display.nativeBarWidth}function Mr(e){return e.display.scroller.clientWidth-ar(e)-e.display.barWidth}function da(e){return e.display.scroller.clientHeight-ar(e)-e.display.barHeight}function Uo(e,l,w){var x=e.options.lineWrapping,D=x&&Mr(e);if(!l.measure.heights||x&&l.measure.width!=D){var W=l.measure.heights=[];if(x){l.measure.width=D;for(var Z=l.text.firstChild.getClientRects(),ie=0;ie<Z.length-1;ie++){var se=Z[ie],ue=Z[ie+1];Math.abs(se.bottom-ue.bottom)>2&&W.push((se.bottom+ue.top)/2-w.top)}}W.push(w.bottom-w.top)}}function es(e,l,w){if(e.line==l)return{map:e.measure.map,cache:e.measure.cache};for(var x=0;x<e.rest.length;x++)if(e.rest[x]==l)return{map:e.measure.maps[x],cache:e.measure.caches[x]};for(var D=0;D<e.rest.length;D++)if(Pt(e.rest[D])>w)return{map:e.measure.maps[D],cache:e.measure.caches[D],before:!0}}function Bo(e,l){l=Oi(l);var w=Pt(l),x=e.display.externalMeasured=new Qt(e.doc,l,w);x.lineN=w;var D=x.built=Gt(e,x);return x.text=D.pre,O(e.display.lineMeasure,D.pre),x}function ts(e,l,w,x){return sr(e,Vr(e,l),w,x)}function fa(e,l){if(l>=e.display.viewFrom&&l<e.display.viewTo)return e.display.view[Fr(e,l)];var w=e.display.externalMeasured;if(w&&l>=w.lineN&&l<w.lineN+w.size)return w}function Vr(e,l){var w=Pt(l),x=fa(e,w);x&&!x.text?x=null:x&&x.changes&&(Ya(e,x,w,ya(e)),e.curOp.forceUpdate=!0),x||(x=Bo(e,l));var D=es(x,l,w);return{line:l,view:x,rect:null,map:D.map,cache:D.cache,before:D.before,hasHeights:!1}}function sr(e,l,w,x,D){l.before&&(w=-1);var W=w+(x||""),Z;return l.cache.hasOwnProperty(W)?Z=l.cache[W]:(l.rect||(l.rect=l.view.text.getBoundingClientRect()),l.hasHeights||(Uo(e,l.view,l.rect),l.hasHeights=!0),Z=Ho(e,l,w,x),Z.bogus||(l.cache[W]=Z)),{left:Z.left,right:Z.right,top:D?Z.rtop:Z.top,bottom:D?Z.rbottom:Z.bottom}}var is={left:0,right:0,top:0,bottom:0};function rs(e,l,w){for(var x,D,W,Z,ie,se,ue=0;ue<e.length;ue+=3)if(ie=e[ue],se=e[ue+1],l<ie?(D=0,W=1,Z="left"):l<se?(D=l-ie,W=D+1):(ue==e.length-3||l==se&&e[ue+3]>l)&&(W=se-ie,D=W-1,l>=se&&(Z="right")),D!=null){if(x=e[ue+2],ie==se&&w==(x.insertLeft?"left":"right")&&(Z=w),w=="left"&&D==0)for(;ue&&e[ue-2]==e[ue-3]&&e[ue-1].insertLeft;)x=e[(ue-=3)+2],Z="left";if(w=="right"&&D==se-ie)for(;ue<e.length-3&&e[ue+3]==e[ue+4]&&!e[ue+5].insertLeft;)x=e[(ue+=3)+2],Z="right";break}return{node:x,start:D,end:W,collapse:Z,coverStart:ie,coverEnd:se}}function Ko(e,l){var w=is;if(l=="left")for(var x=0;x<e.length&&!((w=e[x]).left!=w.right);x++);else for(var D=e.length-1;D>=0&&!((w=e[D]).left!=w.right);D--);return w}function Ho(e,l,w,x){var D=rs(l.map,w,x),W=D.node,Z=D.start,ie=D.end,se=D.collapse,ue;if(W.nodeType==3){for(var De=0;De<4;De++){for(;Z&&xe(l.line.text.charAt(D.coverStart+Z));)--Z;for(;D.coverStart+ie<D.coverEnd&&xe(l.line.text.charAt(D.coverStart+ie));)++ie;if(E&&b<9&&Z==0&&ie==D.coverEnd-D.coverStart?ue=W.parentNode.getBoundingClientRect():ue=Ko(P(W,Z,ie).getClientRects(),x),ue.left||ue.right||Z==0)break;ie=Z,Z=Z-1,se="right"}E&&b<11&&(ue=jo(e.display.measure,ue))}else{Z>0&&(se=x="right");var Ue;e.options.lineWrapping&&(Ue=W.getClientRects()).length>1?ue=Ue[x=="right"?Ue.length-1:0]:ue=W.getBoundingClientRect()}if(E&&b<9&&!Z&&(!ue||!ue.left&&!ue.right)){var qe=W.parentNode.getClientRects()[0];qe?ue={left:qe.left,right:qe.left+Qr(e.display),top:qe.top,bottom:qe.bottom}:ue=is}for(var Ze=ue.top-l.rect.top,rt=ue.bottom-l.rect.top,lt=(Ze+rt)/2,ft=l.view.measure.heights,_t=0;_t<ft.length-1&&!(lt<ft[_t]);_t++);var xt=_t?ft[_t-1]:0,yt=ft[_t],Et={left:(se=="right"?ue.right:ue.left)-l.rect.left,right:(se=="left"?ue.left:ue.right)-l.rect.left,top:xt,bottom:yt};return!ue.left&&!ue.right&&(Et.bogus=!0),e.options.singleCursorHeightPerLine||(Et.rtop=Ze,Et.rbottom=rt),Et}function jo(e,l){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!Ft(e))return l;var w=screen.logicalXDPI/screen.deviceXDPI,x=screen.logicalYDPI/screen.deviceYDPI;return{left:l.left*w,right:l.right*w,top:l.top*x,bottom:l.bottom*x}}function ns(e){if(e.measure&&(e.measure.cache={},e.measure.heights=null,e.rest))for(var l=0;l<e.rest.length;l++)e.measure.caches[l]={}}function as(e){e.display.externalMeasure=null,T(e.display.lineMeasure);for(var l=0;l<e.display.view.length;l++)ns(e.display.view[l])}function _n(e){as(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function ss(){return o&&s?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function os(){return o&&s?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function pa(e){var l=0;if(e.widgets)for(var w=0;w<e.widgets.length;++w)e.widgets[w].above&&(l+=vn(e.widgets[w]));return l}function jn(e,l,w,x,D){if(!D){var W=pa(l);w.top+=W,w.bottom+=W}if(x=="line")return w;x||(x="local");var Z=Ji(l);if(x=="local"?Z+=Hn(e.display):Z-=e.display.viewOffset,x=="page"||x=="window"){var ie=e.display.lineSpace.getBoundingClientRect();Z+=ie.top+(x=="window"?0:os());var se=ie.left+(x=="window"?0:ss());w.left+=se,w.right+=se}return w.top+=Z,w.bottom+=Z,w}function ls(e,l,w){if(w=="div")return l;var x=l.left,D=l.top;if(w=="page")x-=ss(),D-=os();else if(w=="local"||!w){var W=e.display.sizer.getBoundingClientRect();x+=W.left,D+=W.top}var Z=e.display.lineSpace.getBoundingClientRect();return{left:x-Z.left,top:D-Z.top}}function ma(e,l,w,x,D){return x||(x=bt(e.doc,l.line)),jn(e,x,ts(e,x,l.ch,D),w)}function er(e,l,w,x,D,W){x=x||bt(e.doc,l.line),D||(D=Vr(e,x));function Z(rt,lt){var ft=sr(e,D,rt,lt?"right":"left",W);return lt?ft.left=ft.right:ft.right=ft.left,jn(e,x,ft,w)}var ie=Ye(x,e.doc.direction),se=l.ch,ue=l.sticky;if(se>=x.text.length?(se=x.text.length,ue="before"):se<=0&&(se=0,ue="after"),!ie)return Z(ue=="before"?se-1:se,ue=="before");function De(rt,lt,ft){var _t=ie[lt],xt=_t.level==1;return Z(ft?rt-1:rt,xt!=ft)}var Ue=ae(ie,se,ue),qe=ve,Ze=De(se,Ue,ue=="before");return qe!=null&&(Ze.other=De(se,qe,ue!="before")),Ze}function us(e,l){var w=0;l=B(e.doc,l),e.options.lineWrapping||(w=Qr(e.display)*l.ch);var x=bt(e.doc,l.line),D=Ji(x)+Hn(e.display);return{left:w,right:w,top:D,bottom:D+x.height}}function ga(e,l,w,x,D){var W=ct(e,l,w);return W.xRel=D,x&&(W.outside=x),W}function va(e,l,w){var x=e.doc;if(w+=e.display.viewOffset,w<0)return ga(x.first,0,null,-1,-1);var D=di(x,w),W=x.first+x.size-1;if(D>W)return ga(x.first+x.size-1,bt(x,W).text.length,null,1,1);l<0&&(l=0);for(var Z=bt(x,D);;){var ie=Wo(e,Z,D,l,w),se=rr(Z,ie.ch+(ie.xRel>0||ie.outside>0?1:0));if(!se)return ie;var ue=se.find(1);if(ue.line==D)return ue;Z=bt(x,D=ue.line)}}function hs(e,l,w,x){x-=pa(l);var D=l.text.length,W=Te(function(Z){return sr(e,w,Z-1).bottom<=x},D,0);return D=Te(function(Z){return sr(e,w,Z).top>x},W,D),{begin:W,end:D}}function cs(e,l,w,x){w||(w=Vr(e,l));var D=jn(e,l,sr(e,w,x),"line").top;return hs(e,l,w,D)}function _a(e,l,w,x){return e.bottom<=w?!1:e.top>w?!0:(x?e.left:e.right)>l}function Wo(e,l,w,x,D){D-=Ji(l);var W=Vr(e,l),Z=pa(l),ie=0,se=l.text.length,ue=!0,De=Ye(l,e.doc.direction);if(De){var Ue=(e.options.lineWrapping?zo:Xo)(e,l,w,W,De,x,D);ue=Ue.level!=1,ie=ue?Ue.from:Ue.to-1,se=ue?Ue.to:Ue.from-1}var qe=null,Ze=null,rt=Te(function(kt){var Lt=sr(e,W,kt);return Lt.top+=Z,Lt.bottom+=Z,_a(Lt,x,D,!1)?(Lt.top<=D&&Lt.left<=x&&(qe=kt,Ze=Lt),!0):!1},ie,se),lt,ft,_t=!1;if(Ze){var xt=x-Ze.left<Ze.right-x,yt=xt==ue;rt=qe+(yt?0:1),ft=yt?"after":"before",lt=xt?Ze.left:Ze.right}else{!ue&&(rt==se||rt==ie)&&rt++,ft=rt==0?"after":rt==l.text.length?"before":sr(e,W,rt-(ue?1:0)).bottom+Z<=D==ue?"after":"before";var Et=er(e,ct(w,rt,ft),"line",l,W);lt=Et.left,_t=D<Et.top?-1:D>=Et.bottom?1:0}return rt=we(l.text,rt,1),ga(w,rt,ft,_t,x-lt)}function Xo(e,l,w,x,D,W,Z){var ie=Te(function(Ue){var qe=D[Ue],Ze=qe.level!=1;return _a(er(e,ct(w,Ze?qe.to:qe.from,Ze?"before":"after"),"line",l,x),W,Z,!0)},0,D.length-1),se=D[ie];if(ie>0){var ue=se.level!=1,De=er(e,ct(w,ue?se.from:se.to,ue?"after":"before"),"line",l,x);_a(De,W,Z,!0)&&De.top>Z&&(se=D[ie-1])}return se}function zo(e,l,w,x,D,W,Z){var ie=hs(e,l,x,Z),se=ie.begin,ue=ie.end;/\s/.test(l.text.charAt(ue-1))&&ue--;for(var De=null,Ue=null,qe=0;qe<D.length;qe++){var Ze=D[qe];if(Ze.from>=ue||Ze.to<=se)continue;var rt=Ze.level!=1,lt=sr(e,x,rt?Math.min(ue,Ze.to)-1:Math.max(se,Ze.from)).right,ft=lt<W?W-lt+1e9:lt-W;(!De||Ue>ft)&&(De=Ze,Ue=ft)}return De||(De=D[D.length-1]),De.from<se&&(De={from:se,to:De.to,level:De.level}),De.to>ue&&(De={from:De.from,to:ue,level:De.level}),De}var Pr;function Yr(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(Pr==null){Pr=g("pre",null,"CodeMirror-line-like");for(var l=0;l<49;++l)Pr.appendChild(document.createTextNode("x")),Pr.appendChild(g("br"));Pr.appendChild(document.createTextNode("x"))}O(e.measure,Pr);var w=Pr.offsetHeight/50;return w>3&&(e.cachedTextHeight=w),T(e.measure),w||1}function Qr(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var l=g("span","xxxxxxxxxx"),w=g("pre",[l],"CodeMirror-line-like");O(e.measure,w);var x=l.getBoundingClientRect(),D=(x.right-x.left)/10;return D>2&&(e.cachedCharWidth=D),D||10}function ya(e){for(var l=e.display,w={},x={},D=l.gutters.clientLeft,W=l.gutters.firstChild,Z=0;W;W=W.nextSibling,++Z){var ie=e.display.gutterSpecs[Z].className;w[ie]=W.offsetLeft+W.clientLeft+D,x[ie]=W.clientWidth}return{fixedPos:ba(l),gutterTotalWidth:l.gutters.offsetWidth,gutterLeft:w,gutterWidth:x,wrapperWidth:l.wrapper.clientWidth}}function ba(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function ds(e){var l=Yr(e.display),w=e.options.lineWrapping,x=w&&Math.max(5,e.display.scroller.clientWidth/Qr(e.display)-3);return function(D){if(nr(e.doc,D))return 0;var W=0;if(D.widgets)for(var Z=0;Z<D.widgets.length;Z++)D.widgets[Z].height&&(W+=D.widgets[Z].height);return w?W+(Math.ceil(D.text.length/x)||1)*l:W+l}}function xa(e){var l=e.doc,w=ds(e);l.iter(function(x){var D=w(x);D!=x.height&&ii(x,D)})}function Nr(e,l,w,x){var D=e.display;if(!w&&Oe(l).getAttribute("cm-not-content")=="true")return null;var W,Z,ie=D.lineSpace.getBoundingClientRect();try{W=l.clientX-ie.left,Z=l.clientY-ie.top}catch(Ue){return null}var se=va(e,W,Z),ue;if(x&&se.xRel>0&&(ue=bt(e.doc,se.line).text).length==se.ch){var De=z(ue,ue.length,e.options.tabSize)-ue.length;se=ct(se.line,Math.max(0,Math.round((W-Ja(e.display).left)/Qr(e.display))-De))}return se}function Fr(e,l){if(l>=e.display.viewTo)return null;if(l-=e.display.viewFrom,l<0)return null;for(var w=e.display.view,x=0;x<w.length;x++)if(l-=w[x].size,l<0)return x}function Ni(e,l,w,x){l==null&&(l=e.doc.first),w==null&&(w=e.doc.first+e.doc.size),x||(x=0);var D=e.display;if(x&&w<D.viewTo&&(D.updateLineNumbers==null||D.updateLineNumbers>l)&&(D.updateLineNumbers=l),e.curOp.viewChanged=!0,l>=D.viewTo)mi&&dn(e.doc,l)<D.viewTo&&Sr(e);else if(w<=D.viewFrom)mi&&Er(e.doc,w+x)>D.viewFrom?Sr(e):(D.viewFrom+=x,D.viewTo+=x);else if(l<=D.viewFrom&&w>=D.viewTo)Sr(e);else if(l<=D.viewFrom){var W=Wn(e,w,w+x,1);W?(D.view=D.view.slice(W.index),D.viewFrom=W.lineN,D.viewTo+=x):Sr(e)}else if(w>=D.viewTo){var Z=Wn(e,l,l,-1);Z?(D.view=D.view.slice(0,Z.index),D.viewTo=Z.lineN):Sr(e)}else{var ie=Wn(e,l,l,-1),se=Wn(e,w,w+x,1);ie&&se?(D.view=D.view.slice(0,ie.index).concat(Pi(e,ie.lineN,se.lineN)).concat(D.view.slice(se.index)),D.viewTo+=x):Sr(e)}var ue=D.externalMeasured;ue&&(w<ue.lineN?ue.lineN+=x:l<ue.lineN+ue.size&&(D.externalMeasured=null))}function wr(e,l,w){e.curOp.viewChanged=!0;var x=e.display,D=e.display.externalMeasured;if(D&&l>=D.lineN&&l<D.lineN+D.size&&(x.externalMeasured=null),l<x.viewFrom||l>=x.viewTo)return;var W=x.view[Fr(e,l)];if(W.node==null)return;var Z=W.changes||(W.changes=[]);de(Z,w)==-1&&Z.push(w)}function Sr(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function Wn(e,l,w,x){var D=Fr(e,l),W,Z=e.display.view;if(!mi||w==e.doc.first+e.doc.size)return{index:D,lineN:w};for(var ie=e.display.viewFrom,se=0;se<D;se++)ie+=Z[se].size;if(ie!=l){if(x>0){if(D==Z.length-1)return null;W=ie+Z[D].size-l,D++}else W=ie-l;l+=W,w+=W}for(;dn(e.doc,w)!=w;){if(D==(x<0?0:Z.length-1))return null;w+=x*Z[D-(x<0?1:0)].size,D+=x}return{index:D,lineN:w}}function Go(e,l,w){var x=e.display,D=x.view;D.length==0||l>=x.viewTo||w<=x.viewFrom?(x.view=Pi(e,l,w),x.viewFrom=l):(x.viewFrom>l?x.view=Pi(e,l,x.viewFrom).concat(x.view):x.viewFrom<l&&(x.view=x.view.slice(Fr(e,l))),x.viewFrom=l,x.viewTo<w?x.view=x.view.concat(Pi(e,x.viewTo,w)):x.viewTo>w&&(x.view=x.view.slice(0,Fr(e,w)))),x.viewTo=w}function fs(e){for(var l=e.display.view,w=0,x=0;x<l.length;x++){var D=l[x];!D.hidden&&(!D.node||D.changes)&&++w}return w}function yn(e){e.display.input.showSelection(e.display.input.prepareSelection())}function ps(e,l){l===void 0&&(l=!0);for(var w=e.doc,x={},D=x.cursors=document.createDocumentFragment(),W=x.selection=document.createDocumentFragment(),Z=0;Z<w.sel.ranges.length;Z++){if(!l&&Z==w.sel.primIndex)continue;var ie=w.sel.ranges[Z];if(ie.from().line>=e.display.viewTo||ie.to().line<e.display.viewFrom)continue;var se=ie.empty();(se||e.options.showCursorWhenSelecting)&&ms(e,ie.head,D),se||Vo(e,ie,W)}return x}function ms(e,l,w){var x=er(e,l,"div",null,null,!e.options.singleCursorHeightPerLine),D=w.appendChild(g("div","\xA0","CodeMirror-cursor"));if(D.style.left=x.left+"px",D.style.top=x.top+"px",D.style.height=Math.max(0,x.bottom-x.top)*e.options.cursorHeight+"px",x.other){var W=w.appendChild(g("div","\xA0","CodeMirror-cursor CodeMirror-secondarycursor"));W.style.display="",W.style.left=x.other.left+"px",W.style.top=x.other.top+"px",W.style.height=(x.other.bottom-x.other.top)*.85+"px"}}function Xn(e,l){return e.top-l.top||e.left-l.left}function Vo(e,l,w){var x=e.display,D=e.doc,W=document.createDocumentFragment(),Z=Ja(e.display),ie=Z.left,se=Math.max(x.sizerWidth,Mr(e)-x.sizer.offsetLeft)-Z.right,ue=D.direction=="ltr";function De(yt,Et,kt,Lt){Et<0&&(Et=0),Et=Math.round(Et),Lt=Math.round(Lt),W.appendChild(g("div",null,"CodeMirror-selected","position: absolute; left: "+yt+`px;
|
|
|
top: `+Et+"px; width: "+(kt==null?se-yt:kt)+`px;
|
|
|
height: `+(Lt-Et)+"px"))}function Ue(yt,Et,kt){var Lt=bt(D,yt),Kt=Lt.text.length,ti,yi;function ai(hi,Bi){return ma(e,ct(yt,hi),"div",Lt,Bi)}function Xi(hi,Bi,wi){var pi=cs(e,Lt,null,hi),ci=Bi=="ltr"==(wi=="after")?"left":"right",si=wi=="after"?pi.begin:pi.end-(/\s/.test(Lt.text.charAt(pi.end-1))?2:1);return ai(si,ci)[ci]}var Ui=Ye(Lt,D.direction);return re(Ui,Et||0,kt==null?Kt:kt,function(hi,Bi,wi,pi){var ci=wi=="ltr",si=ai(hi,ci?"left":"right"),Ki=ai(Bi-1,ci?"right":"left"),un=Et==null&&hi==0,Or=kt==null&&Bi==Kt,Ri=pi==0,or=!Ui||pi==Ui.length-1;if(Ki.top-si.top<=3){var bi=(ue?un:Or)&&Ri,Ga=(ue?Or:un)&&or,fr=bi?ie:(ci?si:Ki).left,jr=Ga?se:(ci?Ki:si).right;De(fr,si.top,jr-fr,si.bottom)}else{var Wr,Ii,hn,Va;ci?(Wr=ue&&un&&Ri?ie:si.left,Ii=ue?se:Xi(hi,wi,"before"),hn=ue?ie:Xi(Bi,wi,"after"),Va=ue&&Or&&or?se:Ki.right):(Wr=ue?Xi(hi,wi,"before"):ie,Ii=!ue&&un&&Ri?se:si.right,hn=!ue&&Or&&or?ie:Ki.left,Va=ue?Xi(Bi,wi,"after"):se),De(Wr,si.top,Ii-Wr,si.bottom),si.bottom<Ki.top&&De(ie,si.bottom,null,Ki.top),De(hn,Ki.top,Va-hn,Ki.bottom)}(!ti||Xn(si,ti)<0)&&(ti=si),Xn(Ki,ti)<0&&(ti=Ki),(!yi||Xn(si,yi)<0)&&(yi=si),Xn(Ki,yi)<0&&(yi=Ki)}),{start:ti,end:yi}}var qe=l.from(),Ze=l.to();if(qe.line==Ze.line)Ue(qe.line,qe.ch,Ze.ch);else{var rt=bt(D,qe.line),lt=bt(D,Ze.line),ft=Oi(rt)==Oi(lt),_t=Ue(qe.line,qe.ch,ft?rt.text.length+1:null).end,xt=Ue(Ze.line,ft?0:null,Ze.ch).start;ft&&(_t.top<xt.top-2?(De(_t.right,_t.top,null,_t.bottom),De(ie,xt.top,xt.left,xt.bottom)):De(_t.right,_t.top,xt.left-_t.right,_t.bottom)),_t.bottom<xt.top&&De(ie,_t.bottom,null,xt.top)}w.appendChild(W)}function Ea(e){if(!e.state.focused)return;var l=e.display;clearInterval(l.blinker);var w=!0;l.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?l.blinker=setInterval(function(){e.hasFocus()||Zr(e),l.cursorDiv.style.visibility=(w=!w)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(l.cursorDiv.style.visibility="hidden")}function gs(e){e.state.focused||(e.display.input.focus(),wa(e))}function vs(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,Zr(e))},100)}function wa(e,l){if(e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),e.options.readOnly=="nocursor")return;e.state.focused||(Pe(e,"focus",e,l),e.state.focused=!0,j(e.display.wrapper,"CodeMirror-focused"),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(e.display.input.reset(),i&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),Ea(e)}function Zr(e,l){if(e.state.delayingBlurEvent)return;e.state.focused&&(Pe(e,"blur",e,l),e.state.focused=!1,y(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150)}function zn(e){for(var l=e.display,w=l.lineDiv.offsetTop,x=0;x<l.view.length;x++){var D=l.view[x],W=e.options.lineWrapping,Z=void 0,ie=0;if(D.hidden)continue;if(E&&b<8){var se=D.node.offsetTop+D.node.offsetHeight;Z=se-w,w=se}else{var ue=D.node.getBoundingClientRect();Z=ue.bottom-ue.top,!W&&D.text.firstChild&&(ie=D.text.firstChild.getBoundingClientRect().right-ue.left-1)}var De=D.line.height-Z;if((De>.005||De<-.005)&&(ii(D.line,Z),_s(D.line),D.rest))for(var Ue=0;Ue<D.rest.length;Ue++)_s(D.rest[Ue]);if(ie>e.display.sizerWidth){var qe=Math.ceil(ie/Qr(e.display));qe>e.display.maxLineLength&&(e.display.maxLineLength=qe,e.display.maxLine=D.line,e.display.maxLineChanged=!0)}}}function _s(e){if(e.widgets)for(var l=0;l<e.widgets.length;++l){var w=e.widgets[l],x=w.node.parentNode;x&&(w.height=x.offsetHeight)}}function Gn(e,l,w){var x=w&&w.top!=null?Math.max(0,w.top):e.scroller.scrollTop;x=Math.floor(x-Hn(e));var D=w&&w.bottom!=null?w.bottom:x+e.wrapper.clientHeight,W=di(l,x),Z=di(l,D);if(w&&w.ensure){var ie=w.ensure.from.line,se=w.ensure.to.line;ie<W?(W=ie,Z=di(l,Ji(bt(l,ie))+e.wrapper.clientHeight)):Math.min(se,l.lastLine())>=Z&&(W=di(l,Ji(bt(l,se))-e.wrapper.clientHeight),Z=se)}return{from:W,to:Math.max(Z,W+1)}}function Yo(e,l){if(Fe(e,"scrollCursorIntoView"))return;var w=e.display,x=w.sizer.getBoundingClientRect(),D=null;if(l.top+x.top<0?D=!0:l.bottom+x.top>(window.innerHeight||document.documentElement.clientHeight)&&(D=!1),D!=null&&!t){var W=g("div","\u200B",null,`position: absolute;
|
|
|
top: `+(l.top-w.viewOffset-Hn(e.display))+`px;
|
|
|
height: `+(l.bottom-l.top+ar(e)+w.barHeight)+`px;
|
|
|
left: `+l.left+"px; width: "+Math.max(2,l.right-l.left)+"px;");e.display.lineSpace.appendChild(W),W.scrollIntoView(D),e.display.lineSpace.removeChild(W)}}function Qo(e,l,w,x){x==null&&(x=0);var D;!e.options.lineWrapping&&l==w&&(l=l.ch?ct(l.line,l.sticky=="before"?l.ch-1:l.ch,"after"):l,w=l.sticky=="before"?ct(l.line,l.ch+1,"before"):l);for(var W=0;W<5;W++){var Z=!1,ie=er(e,l),se=!w||w==l?ie:er(e,w);D={left:Math.min(ie.left,se.left),top:Math.min(ie.top,se.top)-x,right:Math.max(ie.left,se.left),bottom:Math.max(ie.bottom,se.bottom)+x};var ue=Sa(e,D),De=e.doc.scrollTop,Ue=e.doc.scrollLeft;if(ue.scrollTop!=null&&(xn(e,ue.scrollTop),Math.abs(e.doc.scrollTop-De)>1&&(Z=!0)),ue.scrollLeft!=null&&(Ur(e,ue.scrollLeft),Math.abs(e.doc.scrollLeft-Ue)>1&&(Z=!0)),!Z)break}return D}function Zo(e,l){var w=Sa(e,l);w.scrollTop!=null&&xn(e,w.scrollTop),w.scrollLeft!=null&&Ur(e,w.scrollLeft)}function Sa(e,l){var w=e.display,x=Yr(e.display);l.top<0&&(l.top=0);var D=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:w.scroller.scrollTop,W=da(e),Z={};l.bottom-l.top>W&&(l.bottom=l.top+W);var ie=e.doc.height+ca(w),se=l.top<x,ue=l.bottom>ie-x;if(l.top<D)Z.scrollTop=se?0:l.top;else if(l.bottom>D+W){var De=Math.min(l.top,(ue?ie:l.bottom)-W);De!=D&&(Z.scrollTop=De)}var Ue=e.options.fixedGutter?0:w.gutters.offsetWidth,qe=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:w.scroller.scrollLeft-Ue,Ze=Mr(e)-w.gutters.offsetWidth,rt=l.right-l.left>Ze;return rt&&(l.right=l.left+Ze),l.left<10?Z.scrollLeft=0:l.left<qe?Z.scrollLeft=Math.max(0,l.left+Ue-(rt?0:10)):l.right>Ze+qe-3&&(Z.scrollLeft=l.right+(rt?0:10)-Ze),Z}function Ta(e,l){if(l==null)return;Vn(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+l}function qr(e){Vn(e);var l=e.getCursor();e.curOp.scrollToPos={from:l,to:l,margin:e.options.cursorScrollMargin}}function bn(e,l,w){(l!=null||w!=null)&&Vn(e),l!=null&&(e.curOp.scrollLeft=l),w!=null&&(e.curOp.scrollTop=w)}function qo(e,l){Vn(e),e.curOp.scrollToPos=l}function Vn(e){var l=e.curOp.scrollToPos;if(l){e.curOp.scrollToPos=null;var w=us(e,l.from),x=us(e,l.to);ys(e,w,x,l.margin)}}function ys(e,l,w,x){var D=Sa(e,{left:Math.min(l.left,w.left),top:Math.min(l.top,w.top)-x,right:Math.max(l.right,w.right),bottom:Math.max(l.bottom,w.bottom)+x});bn(e,D.scrollLeft,D.scrollTop)}function xn(e,l){if(Math.abs(e.doc.scrollTop-l)<2)return;I||Aa(e,{top:l}),bs(e,l,!0),I&&Aa(e),Sn(e,100)}function bs(e,l,w){if(l=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,l)),e.display.scroller.scrollTop==l&&!w)return;e.doc.scrollTop=l,e.display.scrollbars.setScrollTop(l),e.display.scroller.scrollTop!=l&&(e.display.scroller.scrollTop=l)}function Ur(e,l,w,x){if(l=Math.max(0,Math.min(l,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),(w?l==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-l)<2)&&!x)return;e.doc.scrollLeft=l,Ts(e),e.display.scroller.scrollLeft!=l&&(e.display.scroller.scrollLeft=l),e.display.scrollbars.setScrollLeft(l)}function En(e){var l=e.display,w=l.gutters.offsetWidth,x=Math.round(e.doc.height+ca(e.display));return{clientHeight:l.scroller.clientHeight,viewHeight:l.wrapper.clientHeight,scrollWidth:l.scroller.scrollWidth,clientWidth:l.scroller.clientWidth,viewWidth:l.wrapper.clientWidth,barLeft:e.options.fixedGutter?w:0,docHeight:x,scrollHeight:x+ar(e)+l.barHeight,nativeBarWidth:l.nativeBarWidth,gutterWidth:w}}var Br=function(e,l,w){this.cm=w;var x=this.vert=g("div",[g("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),D=this.horiz=g("div",[g("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");x.tabIndex=D.tabIndex=-1,e(x),e(D),je(x,"scroll",function(){x.clientHeight&&l(x.scrollTop,"vertical")}),je(D,"scroll",function(){D.clientWidth&&l(D.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,E&&b<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};Br.prototype.update=function(e){var l=e.scrollWidth>e.clientWidth+1,w=e.scrollHeight>e.clientHeight+1,x=e.nativeBarWidth;if(w){this.vert.style.display="block",this.vert.style.bottom=l?x+"px":"0";var D=e.viewHeight-(l?x:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+D)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(l){this.horiz.style.display="block",this.horiz.style.right=w?x+"px":"0",this.horiz.style.left=e.barLeft+"px";var W=e.viewWidth-e.barLeft-(w?x:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+W)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(x==0&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:w?x:0,bottom:l?x:0}},Br.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},Br.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},Br.prototype.zeroWidthHack=function(){var e=d&&!a?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new te,this.disableVert=new te},Br.prototype.enableZeroWidthBar=function(e,l,w){e.style.pointerEvents="auto";function x(){var D=e.getBoundingClientRect(),W=w=="vert"?document.elementFromPoint(D.right-1,(D.top+D.bottom)/2):document.elementFromPoint((D.right+D.left)/2,D.bottom-1);W!=e?e.style.pointerEvents="none":l.set(1e3,x)}l.set(1e3,x)},Br.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var wn=function(){};wn.prototype.update=function(){return{bottom:0,right:0}},wn.prototype.setScrollLeft=function(){},wn.prototype.setScrollTop=function(){},wn.prototype.clear=function(){};function $r(e,l){l||(l=En(e));var w=e.display.barWidth,x=e.display.barHeight;xs(e,l);for(var D=0;D<4&&w!=e.display.barWidth||x!=e.display.barHeight;D++)w!=e.display.barWidth&&e.options.lineWrapping&&zn(e),xs(e,En(e)),w=e.display.barWidth,x=e.display.barHeight}function xs(e,l){var w=e.display,x=w.scrollbars.update(l);w.sizer.style.paddingRight=(w.barWidth=x.right)+"px",w.sizer.style.paddingBottom=(w.barHeight=x.bottom)+"px",w.heightForcer.style.borderBottom=x.bottom+"px solid transparent",x.right&&x.bottom?(w.scrollbarFiller.style.display="block",w.scrollbarFiller.style.height=x.bottom+"px",w.scrollbarFiller.style.width=x.right+"px"):w.scrollbarFiller.style.display="",x.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(w.gutterFiller.style.display="block",w.gutterFiller.style.height=x.bottom+"px",w.gutterFiller.style.width=l.gutterWidth+"px"):w.gutterFiller.style.display=""}var Es={native:Br,null:wn};function ws(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&y(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new Es[e.options.scrollbarStyle](function(l){e.display.wrapper.insertBefore(l,e.display.scrollbarFiller),je(l,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),l.setAttribute("cm-not-content","true")},function(l,w){w=="horizontal"?Ur(e,l):xn(e,l)},e),e.display.scrollbars.addClass&&j(e.display.wrapper,e.display.scrollbars.addClass)}var $o=0;function Kr(e){e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++$o},Zi(e.curOp)}function Hr(e){var l=e.curOp;l&&ko(l,function(w){for(var x=0;x<w.ops.length;x++)w.ops[x].cm.curOp=null;Jo(w)})}function Jo(e){for(var l=e.ops,w=0;w<l.length;w++)el(l[w]);for(var x=0;x<l.length;x++)tl(l[x]);for(var D=0;D<l.length;D++)il(l[D]);for(var W=0;W<l.length;W++)rl(l[W]);for(var Z=0;Z<l.length;Z++)nl(l[Z])}function el(e){var l=e.cm,w=l.display;sl(l),e.updateMaxLine&&Kn(l),e.mustUpdate=e.viewChanged||e.forceUpdate||e.scrollTop!=null||e.scrollToPos&&(e.scrollToPos.from.line<w.viewFrom||e.scrollToPos.to.line>=w.viewTo)||w.maxLineChanged&&l.options.lineWrapping,e.update=e.mustUpdate&&new Yn(l,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function tl(e){e.updatedDisplay=e.mustUpdate&&Ca(e.cm,e.update)}function il(e){var l=e.cm,w=l.display;e.updatedDisplay&&zn(l),e.barMeasure=En(l),w.maxLineChanged&&!l.options.lineWrapping&&(e.adjustWidthTo=ts(l,w.maxLine,w.maxLine.text.length).left+3,l.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(w.scroller.clientWidth,w.sizer.offsetLeft+e.adjustWidthTo+ar(l)+l.display.barWidth),e.maxScrollLeft=Math.max(0,w.sizer.offsetLeft+e.adjustWidthTo-Mr(l))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=w.input.prepareSelection())}function rl(e){var l=e.cm;e.adjustWidthTo!=null&&(l.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<l.doc.scrollLeft&&Ur(l,Math.min(l.display.scroller.scrollLeft,e.maxScrollLeft),!0),l.display.maxLineChanged=!1);var w=e.focus&&e.focus==X();e.preparedSelection&&l.display.input.showSelection(e.preparedSelection,w),(e.updatedDisplay||e.startHeight!=l.doc.height)&&$r(l,e.barMeasure),e.updatedDisplay&&Ra(l,e.barMeasure),e.selectionChanged&&Ea(l),l.state.focused&&e.updateInput&&l.display.input.reset(e.typing),w&&gs(e.cm)}function nl(e){var l=e.cm,w=l.display,x=l.doc;if(e.updatedDisplay&&Ss(l,e.update),w.wheelStartX!=null&&(e.scrollTop!=null||e.scrollLeft!=null||e.scrollToPos)&&(w.wheelStartX=w.wheelStartY=null),e.scrollTop!=null&&bs(l,e.scrollTop,e.forceScroll),e.scrollLeft!=null&&Ur(l,e.scrollLeft,!0,!0),e.scrollToPos){var D=Qo(l,B(x,e.scrollToPos.from),B(x,e.scrollToPos.to),e.scrollToPos.margin);Yo(l,D)}var W=e.maybeHiddenMarkers,Z=e.maybeUnhiddenMarkers;if(W)for(var ie=0;ie<W.length;++ie)W[ie].lines.length||Pe(W[ie],"hide");if(Z)for(var se=0;se<Z.length;++se)Z[se].lines.length&&Pe(Z[se],"unhide");w.wrapper.offsetHeight&&(x.scrollTop=l.display.scroller.scrollTop),e.changeObjs&&Pe(l,"changes",l,e.changeObjs),e.update&&e.update.finish()}function Wi(e,l){if(e.curOp)return l();Kr(e);try{return l()}finally{Hr(e)}}function vi(e,l){return function(){if(e.curOp)return l.apply(e,arguments);Kr(e);try{return l.apply(e,arguments)}finally{Hr(e)}}}function ki(e){return function(){if(this.curOp)return e.apply(this,arguments);Kr(this);try{return e.apply(this,arguments)}finally{Hr(this)}}}function _i(e){return function(){var l=this.cm;if(!l||l.curOp)return e.apply(this,arguments);Kr(l);try{return e.apply(this,arguments)}finally{Hr(l)}}}function Sn(e,l){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(l,U(al,e))}function al(e){var l=e.doc;if(l.highlightFrontier>=e.display.viewTo)return;var w=+new Date+e.options.workTime,x=mt(e,l.highlightFrontier),D=[];l.iter(x.line,Math.min(l.first+l.size,e.display.viewTo+500),function(W){if(x.line>=e.display.viewFrom){var Z=W.styles,ie=W.text.length>e.options.maxHighlightLength?Ct(l.mode,x.state):null,se=Be(e,W,x,!0);ie&&(x.state=ie),W.styles=se.styles;var ue=W.styleClasses,De=se.classes;De?W.styleClasses=De:ue&&(W.styleClasses=null);for(var Ue=!Z||Z.length!=W.styles.length||ue!=De&&(!ue||!De||ue.bgClass!=De.bgClass||ue.textClass!=De.textClass),qe=0;!Ue&&qe<Z.length;++qe)Ue=Z[qe]!=W.styles[qe];Ue&&D.push(x.line),W.stateAfter=x.save(),x.nextLine()}else W.text.length<=e.options.maxHighlightLength&&wt(e,W.text,x),W.stateAfter=x.line%5==0?x.save():null,x.nextLine();if(+new Date>w)return Sn(e,e.options.workDelay),!0}),l.highlightFrontier=x.line,l.modeFrontier=Math.max(l.modeFrontier,x.line),D.length&&Wi(e,function(){for(var W=0;W<D.length;W++)wr(e,D[W],"text")})}var Yn=function(e,l,w){var x=e.display;this.viewport=l,this.visible=Gn(x,e.doc,l),this.editorIsHidden=!x.wrapper.offsetWidth,this.wrapperHeight=x.wrapper.clientHeight,this.wrapperWidth=x.wrapper.clientWidth,this.oldDisplayWidth=Mr(e),this.force=w,this.dims=ya(e),this.events=[]};Yn.prototype.signal=function(e,l){_e(e,l)&&this.events.push(arguments)},Yn.prototype.finish=function(){for(var e=0;e<this.events.length;e++)Pe.apply(null,this.events[e])};function sl(e){var l=e.display;!l.scrollbarsClipped&&l.scroller.offsetWidth&&(l.nativeBarWidth=l.scroller.offsetWidth-l.scroller.clientWidth,l.heightForcer.style.height=ar(e)+"px",l.sizer.style.marginBottom=-l.nativeBarWidth+"px",l.sizer.style.borderRightWidth=ar(e)+"px",l.scrollbarsClipped=!0)}function ol(e){if(e.hasFocus())return null;var l=X();if(!l||!N(e.display.lineDiv,l))return null;var w={activeElt:l};if(window.getSelection){var x=window.getSelection();x.anchorNode&&x.extend&&N(e.display.lineDiv,x.anchorNode)&&(w.anchorNode=x.anchorNode,w.anchorOffset=x.anchorOffset,w.focusNode=x.focusNode,w.focusOffset=x.focusOffset)}return w}function ll(e){if(!e||!e.activeElt||e.activeElt==X())return;if(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&N(document.body,e.anchorNode)&&N(document.body,e.focusNode)){var l=window.getSelection(),w=document.createRange();w.setEnd(e.anchorNode,e.anchorOffset),w.collapse(!1),l.removeAllRanges(),l.addRange(w),l.extend(e.focusNode,e.focusOffset)}}function Ca(e,l){var w=e.display,x=e.doc;if(l.editorIsHidden)return Sr(e),!1;if(!l.force&&l.visible.from>=w.viewFrom&&l.visible.to<=w.viewTo&&(w.updateLineNumbers==null||w.updateLineNumbers>=w.viewTo)&&w.renderedView==w.view&&fs(e)==0)return!1;Cs(e)&&(Sr(e),l.dims=ya(e));var D=x.first+x.size,W=Math.max(l.visible.from-e.options.viewportMargin,x.first),Z=Math.min(D,l.visible.to+e.options.viewportMargin);w.viewFrom<W&&W-w.viewFrom<20&&(W=Math.max(x.first,w.viewFrom)),w.viewTo>Z&&w.viewTo-Z<20&&(Z=Math.min(D,w.viewTo)),mi&&(W=dn(e.doc,W),Z=Er(e.doc,Z));var ie=W!=w.viewFrom||Z!=w.viewTo||w.lastWrapHeight!=l.wrapperHeight||w.lastWrapWidth!=l.wrapperWidth;Go(e,W,Z),w.viewOffset=Ji(bt(e.doc,w.viewFrom)),e.display.mover.style.top=w.viewOffset+"px";var se=fs(e);if(!ie&&se==0&&!l.force&&w.renderedView==w.view&&(w.updateLineNumbers==null||w.updateLineNumbers>=w.viewTo))return!1;var ue=ol(e);return se>4&&(w.lineDiv.style.display="none"),ul(e,w.updateLineNumbers,l.dims),se>4&&(w.lineDiv.style.display=""),w.renderedView=w.view,ll(ue),T(w.cursorDiv),T(w.selectionDiv),w.gutters.style.height=w.sizer.style.minHeight=0,ie&&(w.lastWrapHeight=l.wrapperHeight,w.lastWrapWidth=l.wrapperWidth,Sn(e,400)),w.updateLineNumbers=null,!0}function Ss(e,l){for(var w=l.viewport,x=!0;;x=!1){if(!x||!e.options.lineWrapping||l.oldDisplayWidth==Mr(e)){if(w&&w.top!=null&&(w={top:Math.min(e.doc.height+ca(e.display)-da(e),w.top)}),l.visible=Gn(e.display,e.doc,w),l.visible.from>=e.display.viewFrom&&l.visible.to<=e.display.viewTo)break}else x&&(l.visible=Gn(e.display,e.doc,w));if(!Ca(e,l))break;zn(e);var D=En(e);yn(e),$r(e,D),Ra(e,D),l.force=!1}l.signal(e,"update",e),(e.display.viewFrom!=e.display.reportedViewFrom||e.display.viewTo!=e.display.reportedViewTo)&&(l.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function Aa(e,l){var w=new Yn(e,l);if(Ca(e,w)){zn(e),Ss(e,w);var x=En(e);yn(e),$r(e,x),Ra(e,x),w.finish()}}function ul(e,l,w){var x=e.display,D=e.options.lineNumbers,W=x.lineDiv,Z=W.firstChild;function ie(rt){var lt=rt.nextSibling;return i&&d&&e.display.currentWheelTarget==rt?rt.style.display="none":rt.parentNode.removeChild(rt),lt}for(var se=x.view,ue=x.viewFrom,De=0;De<se.length;De++){var Ue=se[De];if(!Ue.hidden)if(!Ue.node||Ue.node.parentNode!=W){var qe=No(e,Ue,ue,w);W.insertBefore(qe,Z)}else{for(;Z!=Ue.node;)Z=ie(Z);var Ze=D&&l!=null&&l<=ue&&Ue.lineNumber;Ue.changes&&(de(Ue.changes,"gutter")>-1&&(Ze=!1),Ya(e,Ue,ue,w)),Ze&&(T(Ue.lineNumber),Ue.lineNumber.appendChild(document.createTextNode(Yi(e.options,ue)))),Z=Ue.node.nextSibling}ue+=Ue.size}for(;Z;)Z=ie(Z)}function La(e){var l=e.gutters.offsetWidth;e.sizer.style.marginLeft=l+"px"}function Ra(e,l){e.display.sizer.style.minHeight=l.docHeight+"px",e.display.heightForcer.style.top=l.docHeight+"px",e.display.gutters.style.height=l.docHeight+e.display.barHeight+ar(e)+"px"}function Ts(e){var l=e.display,w=l.view;if(!l.alignWidgets&&(!l.gutters.firstChild||!e.options.fixedGutter))return;for(var x=ba(l)-l.scroller.scrollLeft+e.doc.scrollLeft,D=l.gutters.offsetWidth,W=x+"px",Z=0;Z<w.length;Z++)if(!w[Z].hidden){e.options.fixedGutter&&(w[Z].gutter&&(w[Z].gutter.style.left=W),w[Z].gutterBackground&&(w[Z].gutterBackground.style.left=W));var ie=w[Z].alignable;if(ie)for(var se=0;se<ie.length;se++)ie[se].style.left=W}e.options.fixedGutter&&(l.gutters.style.left=x+D+"px")}function Cs(e){if(!e.options.lineNumbers)return!1;var l=e.doc,w=Yi(e.options,l.first+l.size-1),x=e.display;if(w.length!=x.lineNumChars){var D=x.measure.appendChild(g("div",[g("div",w)],"CodeMirror-linenumber CodeMirror-gutter-elt")),W=D.firstChild.offsetWidth,Z=D.offsetWidth-W;return x.lineGutter.style.width="",x.lineNumInnerWidth=Math.max(W,x.lineGutter.offsetWidth-Z)+1,x.lineNumWidth=x.lineNumInnerWidth+Z,x.lineNumChars=x.lineNumInnerWidth?w.length:-1,x.lineGutter.style.width=x.lineNumWidth+"px",La(e.display),!0}return!1}function Oa(e,l){for(var w=[],x=!1,D=0;D<e.length;D++){var W=e[D],Z=null;if(typeof W!="string"&&(Z=W.style,W=W.className),W=="CodeMirror-linenumbers")if(l)x=!0;else continue;w.push({className:W,style:Z})}return l&&!x&&w.push({className:"CodeMirror-linenumbers",style:null}),w}function As(e){var l=e.gutters,w=e.gutterSpecs;T(l),e.lineGutter=null;for(var x=0;x<w.length;++x){var D=w[x],W=D.className,Z=D.style,ie=l.appendChild(g("div",null,"CodeMirror-gutter "+W));Z&&(ie.style.cssText=Z),W=="CodeMirror-linenumbers"&&(e.lineGutter=ie,ie.style.width=(e.lineNumWidth||1)+"px")}l.style.display=w.length?"":"none",La(e)}function Tn(e){As(e.display),Ni(e),Ts(e)}function hl(e,l,w,x){var D=this;this.input=w,D.scrollbarFiller=g("div",null,"CodeMirror-scrollbar-filler"),D.scrollbarFiller.setAttribute("cm-not-content","true"),D.gutterFiller=g("div",null,"CodeMirror-gutter-filler"),D.gutterFiller.setAttribute("cm-not-content","true"),D.lineDiv=F("div",null,"CodeMirror-code"),D.selectionDiv=g("div",null,null,"position: relative; z-index: 1"),D.cursorDiv=g("div",null,"CodeMirror-cursors"),D.measure=g("div",null,"CodeMirror-measure"),D.lineMeasure=g("div",null,"CodeMirror-measure"),D.lineSpace=F("div",[D.measure,D.lineMeasure,D.selectionDiv,D.cursorDiv,D.lineDiv],null,"position: relative; outline: none");var W=F("div",[D.lineSpace],"CodeMirror-lines");D.mover=g("div",[W],null,"position: relative"),D.sizer=g("div",[D.mover],"CodeMirror-sizer"),D.sizerWidth=null,D.heightForcer=g("div",null,null,"position: absolute; height: "+be+"px; width: 1px;"),D.gutters=g("div",null,"CodeMirror-gutters"),D.lineGutter=null,D.scroller=g("div",[D.sizer,D.heightForcer,D.gutters],"CodeMirror-scroll"),D.scroller.setAttribute("tabIndex","-1"),D.wrapper=g("div",[D.scrollbarFiller,D.gutterFiller,D.scroller],"CodeMirror"),E&&b<8&&(D.gutters.style.zIndex=-1,D.scroller.style.paddingRight=0),!i&&!(I&&u)&&(D.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(D.wrapper):e(D.wrapper)),D.viewFrom=D.viewTo=l.first,D.reportedViewFrom=D.reportedViewTo=l.first,D.view=[],D.renderedView=null,D.externalMeasured=null,D.viewOffset=0,D.lastWrapHeight=D.lastWrapWidth=0,D.updateLineNumbers=null,D.nativeBarWidth=D.barHeight=D.barWidth=0,D.scrollbarsClipped=!1,D.lineNumWidth=D.lineNumInnerWidth=D.lineNumChars=null,D.alignWidgets=!1,D.cachedCharWidth=D.cachedTextHeight=D.cachedPaddingH=null,D.maxLine=null,D.maxLineLength=0,D.maxLineChanged=!1,D.wheelDX=D.wheelDY=D.wheelStartX=D.wheelStartY=null,D.shift=!1,D.selForContextMenu=null,D.activeTouch=null,D.gutterSpecs=Oa(x.gutters,x.lineNumbers),As(D),w.init(D)}var Qn=0,Gi=null;E?Gi=-.53:I?Gi=15:o?Gi=-.7:n&&(Gi=-1/3);function Ls(e){var l=e.wheelDeltaX,w=e.wheelDeltaY;return l==null&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(l=e.detail),w==null&&e.detail&&e.axis==e.VERTICAL_AXIS?w=e.detail:w==null&&(w=e.wheelDelta),{x:l,y:w}}function cl(e){var l=Ls(e);return l.x*=Gi,l.y*=Gi,l}function Rs(e,l){var w=Ls(l),x=w.x,D=w.y,W=e.display,Z=W.scroller,ie=Z.scrollWidth>Z.clientWidth,se=Z.scrollHeight>Z.clientHeight;if(!(x&&ie||D&&se))return;if(D&&d&&i){e:for(var ue=l.target,De=W.view;ue!=Z;ue=ue.parentNode)for(var Ue=0;Ue<De.length;Ue++)if(De[Ue].node==ue){e.display.currentWheelTarget=ue;break e}}if(x&&!I&&!h&&Gi!=null){D&&se&&xn(e,Math.max(0,Z.scrollTop+D*Gi)),Ur(e,Math.max(0,Z.scrollLeft+x*Gi)),(!D||D&&se)&&ee(l),W.wheelStartX=null;return}if(D&&Gi!=null){var qe=D*Gi,Ze=e.doc.scrollTop,rt=Ze+W.wrapper.clientHeight;qe<0?Ze=Math.max(0,Ze+qe-50):rt=Math.min(e.doc.height,rt+qe+50),Aa(e,{top:Ze,bottom:rt})}Qn<20&&(W.wheelStartX==null?(W.wheelStartX=Z.scrollLeft,W.wheelStartY=Z.scrollTop,W.wheelDX=x,W.wheelDY=D,setTimeout(function(){if(W.wheelStartX==null)return;var lt=Z.scrollLeft-W.wheelStartX,ft=Z.scrollTop-W.wheelStartY,_t=ft&&W.wheelDY&&ft/W.wheelDY||lt&&W.wheelDX&</W.wheelDX;if(W.wheelStartX=W.wheelStartY=null,!_t)return;Gi=(Gi*Qn+_t)/(Qn+1),++Qn},200)):(W.wheelDX+=x,W.wheelDY+=D))}var Vi=function(e,l){this.ranges=e,this.primIndex=l};Vi.prototype.primary=function(){return this.ranges[this.primIndex]},Vi.prototype.equals=function(e){if(e==this)return!0;if(e.primIndex!=this.primIndex||e.ranges.length!=this.ranges.length)return!1;for(var l=0;l<this.ranges.length;l++){var w=this.ranges[l],x=e.ranges[l];if(!pr(w.anchor,x.anchor)||!pr(w.head,x.head))return!1}return!0},Vi.prototype.deepCopy=function(){for(var e=[],l=0;l<this.ranges.length;l++)e[l]=new Zt(mr(this.ranges[l].anchor),mr(this.ranges[l].head));return new Vi(e,this.primIndex)},Vi.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},Vi.prototype.contains=function(e,l){l||(l=e);for(var w=0;w<this.ranges.length;w++){var x=this.ranges[w];if(Dt(l,x.from())>=0&&Dt(e,x.to())<=0)return w}return-1};var Zt=function(e,l){this.anchor=e,this.head=l};Zt.prototype.from=function(){return vr(this.anchor,this.head)},Zt.prototype.to=function(){return gr(this.anchor,this.head)},Zt.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function tr(e,l,w){var x=e&&e.options.selectionsMayTouch,D=l[w];l.sort(function(qe,Ze){return Dt(qe.from(),Ze.from())}),w=de(l,D);for(var W=1;W<l.length;W++){var Z=l[W],ie=l[W-1],se=Dt(ie.to(),Z.from());if(x&&!Z.empty()?se>0:se>=0){var ue=vr(ie.from(),Z.from()),De=gr(ie.to(),Z.to()),Ue=ie.empty()?Z.from()==Z.head:ie.from()==ie.head;W<=w&&--w,l.splice(--W,2,new Zt(Ue?De:ue,Ue?ue:De))}}return new Vi(l,w)}function Tr(e,l){return new Vi([new Zt(e,l||e)],0)}function Cr(e){return e.text?ct(e.from.line+e.text.length-1,he(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function Os(e,l){if(Dt(e,l.from)<0)return e;if(Dt(e,l.to)<=0)return Cr(l);var w=e.line+l.text.length-(l.to.line-l.from.line)-1,x=e.ch;return e.line==l.to.line&&(x+=Cr(l).ch-l.to.ch),ct(w,x)}function ka(e,l){for(var w=[],x=0;x<e.sel.ranges.length;x++){var D=e.sel.ranges[x];w.push(new Zt(Os(D.anchor,l),Os(D.head,l)))}return tr(e.cm,w,e.sel.primIndex)}function ks(e,l,w){return e.line==l.line?ct(w.line,e.ch-l.ch+w.ch):ct(w.line+(e.line-l.line),e.ch)}function dl(e,l,w){for(var x=[],D=ct(e.first,0),W=D,Z=0;Z<l.length;Z++){var ie=l[Z],se=ks(ie.from,D,W),ue=ks(Cr(ie),D,W);if(D=ie.to,W=ue,w=="around"){var De=e.sel.ranges[Z],Ue=Dt(De.head,De.anchor)<0;x[Z]=new Zt(Ue?ue:se,Ue?se:ue)}else x[Z]=new Zt(se,se)}return new Vi(x,e.sel.primIndex)}function Ia(e){e.doc.mode=Ut(e.options,e.doc.modeOption),Cn(e)}function Cn(e){e.doc.iter(function(l){l.stateAfter&&(l.stateAfter=null),l.styles&&(l.styles=null)}),e.doc.modeFrontier=e.doc.highlightFrontier=e.doc.first,Sn(e,100),e.state.modeGen++,e.curOp&&Ni(e)}function Is(e,l){return l.from.ch==0&&l.to.ch==0&&he(l.text)==""&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function Da(e,l,w,x){function D(xt){return w?w[xt]:null}function W(xt,yt,Et){ua(xt,yt,Et,x),Ei(xt,"change",xt,l)}function Z(xt,yt){for(var Et=[],kt=xt;kt<yt;++kt)Et.push(new Dr(ue[kt],D(kt),x));return Et}var ie=l.from,se=l.to,ue=l.text,De=bt(e,ie.line),Ue=bt(e,se.line),qe=he(ue),Ze=D(ue.length-1),rt=se.line-ie.line;if(l.full)e.insert(0,Z(0,ue.length)),e.remove(ue.length,e.size-ue.length);else if(Is(e,l)){var lt=Z(0,ue.length-1);W(Ue,Ue.text,Ze),rt&&e.remove(ie.line,rt),lt.length&&e.insert(ie.line,lt)}else if(De==Ue)if(ue.length==1)W(De,De.text.slice(0,ie.ch)+qe+De.text.slice(se.ch),Ze);else{var ft=Z(1,ue.length-1);ft.push(new Dr(qe+De.text.slice(se.ch),Ze,x)),W(De,De.text.slice(0,ie.ch)+ue[0],D(0)),e.insert(ie.line+1,ft)}else if(ue.length==1)W(De,De.text.slice(0,ie.ch)+ue[0]+Ue.text.slice(se.ch),D(0)),e.remove(ie.line+1,rt);else{W(De,De.text.slice(0,ie.ch)+ue[0],D(0)),W(Ue,qe+Ue.text.slice(se.ch),Ze);var _t=Z(1,ue.length-1);rt>1&&e.remove(ie.line+1,rt-1),e.insert(ie.line+1,_t)}Ei(e,"change",e,l)}function Ar(e,l,w){function x(D,W,Z){if(D.linked)for(var ie=0;ie<D.linked.length;++ie){var se=D.linked[ie];if(se.doc==W)continue;var ue=Z&&se.sharedHist;if(w&&!ue)continue;l(se.doc,ue),x(se.doc,D,ue)}}x(e,null,!0)}function Ds(e,l){if(l.cm)throw new Error("This document is already in use.");e.doc=l,l.cm=e,xa(e),Ia(e),Ms(e),e.options.lineWrapping||Kn(e),e.options.mode=l.modeOption,Ni(e)}function Ms(e){(e.doc.direction=="rtl"?j:y)(e.display.lineDiv,"CodeMirror-rtl")}function fl(e){Wi(e,function(){Ms(e),Ni(e)})}function Zn(e){this.done=[],this.undone=[],this.undoDepth=Infinity,this.lastModTime=this.lastSelTime=0,this.lastOp=this.lastSelOp=null,this.lastOrigin=this.lastSelOrigin=null,this.generation=this.maxGeneration=e||1}function Ma(e,l){var w={from:mr(l.from),to:Cr(l),text:Si(e,l.from,l.to)};return Fs(e,w,l.from.line,l.to.line+1),Ar(e,function(x){return Fs(x,w,l.from.line,l.to.line+1)},!0),w}function Ps(e){for(;e.length;){var l=he(e);if(l.ranges)e.pop();else break}}function pl(e,l){if(l)return Ps(e.done),he(e.done);if(e.done.length&&!he(e.done).ranges)return he(e.done);if(e.done.length>1&&!e.done[e.done.length-2].ranges)return e.done.pop(),he(e.done)}function Ns(e,l,w,x){var D=e.history;D.undone.length=0;var W=+new Date,Z,ie;if((D.lastOp==x||D.lastOrigin==l.origin&&l.origin&&(l.origin.charAt(0)=="+"&&D.lastModTime>W-(e.cm?e.cm.options.historyEventDelay:500)||l.origin.charAt(0)=="*"))&&(Z=pl(D,D.lastOp==x)))ie=he(Z.changes),Dt(l.from,l.to)==0&&Dt(l.from,ie.to)==0?ie.to=Cr(l):Z.changes.push(Ma(e,l));else{var se=he(D.done);for((!se||!se.ranges)&&qn(e.sel,D.done),Z={changes:[Ma(e,l)],generation:D.generation},D.done.push(Z);D.done.length>D.undoDepth;)D.done.shift(),D.done[0].ranges||D.done.shift()}D.done.push(w),D.generation=++D.maxGeneration,D.lastModTime=D.lastSelTime=W,D.lastOp=D.lastSelOp=x,D.lastOrigin=D.lastSelOrigin=l.origin,ie||Pe(e,"historyAdded")}function ml(e,l,w,x){var D=l.charAt(0);return D=="*"||D=="+"&&w.ranges.length==x.ranges.length&&w.somethingSelected()==x.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function gl(e,l,w,x){var D=e.history,W=x&&x.origin;w==D.lastSelOp||W&&D.lastSelOrigin==W&&(D.lastModTime==D.lastSelTime&&D.lastOrigin==W||ml(e,W,he(D.done),l))?D.done[D.done.length-1]=l:qn(l,D.done),D.lastSelTime=+new Date,D.lastSelOrigin=W,D.lastSelOp=w,x&&x.clearRedo!==!1&&Ps(D.undone)}function qn(e,l){var w=he(l);w&&w.ranges&&w.equals(e)||l.push(e)}function Fs(e,l,w,x){var D=l["spans_"+e.id],W=0;e.iter(Math.max(e.first,w),Math.min(e.first+e.size,x),function(Z){Z.markedSpans&&((D||(D=l["spans_"+e.id]={}))[W]=Z.markedSpans),++W})}function vl(e){if(!e)return null;for(var l,w=0;w<e.length;++w)e[w].marker.explicitlyCleared?l||(l=e.slice(0,w)):l&&l.push(e[w]);return l?l.length?l:null:e}function _l(e,l){var w=l["spans_"+e.id];if(!w)return null;for(var x=[],D=0;D<l.text.length;++D)x.push(vl(w[D]));return x}function Us(e,l){var w=_l(e,l),x=$i(e,l);if(!w)return x;if(!x)return w;for(var D=0;D<w.length;++D){var W=w[D],Z=x[D];if(W&&Z){e:for(var ie=0;ie<Z.length;++ie){for(var se=Z[ie],ue=0;ue<W.length;++ue)if(W[ue].marker==se.marker)continue e;W.push(se)}}else Z&&(w[D]=Z)}return w}function Jr(e,l,w){for(var x=[],D=0;D<e.length;++D){var W=e[D];if(W.ranges){x.push(w?Vi.prototype.deepCopy.call(W):W);continue}var Z=W.changes,ie=[];x.push({changes:ie});for(var se=0;se<Z.length;++se){var ue=Z[se],De=void 0;if(ie.push({from:ue.from,to:ue.to,text:ue.text}),l)for(var Ue in ue)(De=Ue.match(/^spans_(\d+)$/))&&(de(l,Number(De[1]))>-1&&(he(ie)[Ue]=ue[Ue],delete ue[Ue]))}}return x}function Pa(e,l,w,x){if(x){var D=e.anchor;if(w){var W=Dt(l,D)<0;W!=Dt(w,D)<0?(D=l,l=w):W!=Dt(l,w)<0&&(l=w)}return new Zt(D,l)}else return new Zt(w||l,l)}function $n(e,l,w,x,D){D==null&&(D=e.cm&&(e.cm.display.shift||e.extend)),Li(e,new Vi([Pa(e.sel.primary(),l,w,D)],0),x)}function Bs(e,l,w){for(var x=[],D=e.cm&&(e.cm.display.shift||e.extend),W=0;W<e.sel.ranges.length;W++)x[W]=Pa(e.sel.ranges[W],l[W],null,D);var Z=tr(e.cm,x,e.sel.primIndex);Li(e,Z,w)}function Na(e,l,w,x){var D=e.sel.ranges.slice(0);D[l]=w,Li(e,tr(e.cm,D,e.sel.primIndex),x)}function Ks(e,l,w,x){Li(e,Tr(l,w),x)}function yl(e,l,w){var x={ranges:l.ranges,update:function(D){this.ranges=[];for(var W=0;W<D.length;W++)this.ranges[W]=new Zt(B(e,D[W].anchor),B(e,D[W].head))},origin:w&&w.origin};return Pe(e,"beforeSelectionChange",e,x),e.cm&&Pe(e.cm,"beforeSelectionChange",e.cm,x),x.ranges!=l.ranges?tr(e.cm,x.ranges,x.ranges.length-1):l}function Hs(e,l,w){var x=e.history.done,D=he(x);D&&D.ranges?(x[x.length-1]=l,Jn(e,l,w)):Li(e,l,w)}function Li(e,l,w){Jn(e,l,w),gl(e,e.sel,e.cm?e.cm.curOp.id:NaN,w)}function Jn(e,l,w){(_e(e,"beforeSelectionChange")||e.cm&&_e(e.cm,"beforeSelectionChange"))&&(l=yl(e,l,w));var x=w&&w.bias||(Dt(l.primary().head,e.sel.primary().head)<0?-1:1);js(e,Xs(e,l,x,!0)),!(w&&w.scroll===!1)&&e.cm&&qr(e.cm)}function js(e,l){if(l.equals(e.sel))return;e.sel=l,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,Ce(e.cm)),Ei(e,"cursorActivity",e)}function Ws(e){js(e,Xs(e,e.sel,null,!1))}function Xs(e,l,w,x){for(var D,W=0;W<l.ranges.length;W++){var Z=l.ranges[W],ie=l.ranges.length==e.sel.ranges.length&&e.sel.ranges[W],se=ea(e,Z.anchor,ie&&ie.anchor,w,x),ue=ea(e,Z.head,ie&&ie.head,w,x);(D||se!=Z.anchor||ue!=Z.head)&&(D||(D=l.ranges.slice(0,W)),D[W]=new Zt(se,ue))}return D?tr(e.cm,D,l.primIndex):l}function en(e,l,w,x,D){var W=bt(e,l.line);if(W.markedSpans)for(var Z=0;Z<W.markedSpans.length;++Z){var ie=W.markedSpans[Z],se=ie.marker,ue="selectLeft"in se?!se.selectLeft:se.inclusiveLeft,De="selectRight"in se?!se.selectRight:se.inclusiveRight;if((ie.from==null||(ue?ie.from<=l.ch:ie.from<l.ch))&&(ie.to==null||(De?ie.to>=l.ch:ie.to>l.ch))){if(D&&(Pe(se,"beforeCursorEnter"),se.explicitlyCleared))if(W.markedSpans){--Z;continue}else break;if(!se.atomic)continue;if(w){var Ue=se.find(x<0?1:-1),qe=void 0;if((x<0?De:ue)&&(Ue=zs(e,Ue,-x,Ue&&Ue.line==l.line?W:null)),Ue&&Ue.line==l.line&&(qe=Dt(Ue,w))&&(x<0?qe<0:qe>0))return en(e,Ue,l,x,D)}var Ze=se.find(x<0?-1:1);return(x<0?ue:De)&&(Ze=zs(e,Ze,x,Ze.line==l.line?W:null)),Ze?en(e,Ze,l,x,D):null}}return l}function ea(e,l,w,x,D){var W=x||1,Z=en(e,l,w,W,D)||!D&&en(e,l,w,W,!0)||en(e,l,w,-W,D)||!D&&en(e,l,w,-W,!0);return Z||(e.cantEdit=!0,ct(e.first,0))}function zs(e,l,w,x){return w<0&&l.ch==0?l.line>e.first?B(e,ct(l.line-1)):null:w>0&&l.ch==(x||bt(e,l.line)).text.length?l.line<e.first+e.size-1?ct(l.line+1,0):null:new ct(l.line,l.ch+w)}function Gs(e){e.setSelection(ct(e.firstLine(),0),ct(e.lastLine()),Ne)}function Vs(e,l,w){var x={canceled:!1,from:l.from,to:l.to,text:l.text,origin:l.origin,cancel:function(){return x.canceled=!0}};return w&&(x.update=function(D,W,Z,ie){D&&(x.from=B(e,D)),W&&(x.to=B(e,W)),Z&&(x.text=Z),ie!==void 0&&(x.origin=ie)}),Pe(e,"beforeChange",e,x),e.cm&&Pe(e.cm,"beforeChange",e.cm,x),x.canceled?(e.cm&&(e.cm.curOp.updateInput=2),null):{from:x.from,to:x.to,text:x.text,origin:x.origin}}function tn(e,l,w){if(e.cm){if(!e.cm.curOp)return vi(e.cm,tn)(e,l,w);if(e.cm.state.suppressEdits)return}if((_e(e,"beforeChange")||e.cm&&_e(e.cm,"beforeChange"))&&(l=Vs(e,l,!0),!l))return;var x=kr&&!w&&yr(e,l.from,l.to);if(x)for(var D=x.length-1;D>=0;--D)Ys(e,{from:x[D].from,to:x[D].to,text:D?[""]:l.text,origin:l.origin});else Ys(e,l)}function Ys(e,l){if(l.text.length==1&&l.text[0]==""&&Dt(l.from,l.to)==0)return;var w=ka(e,l);Ns(e,l,w,e.cm?e.cm.curOp.id:NaN),An(e,l,w,$i(e,l));var x=[];Ar(e,function(D,W){!W&&de(x,D.history)==-1&&($s(D.history,l),x.push(D.history)),An(D,l,null,$i(D,l))})}function ta(e,l,w){var x=e.cm&&e.cm.state.suppressEdits;if(x&&!w)return;for(var D=e.history,W,Z=e.sel,ie=l=="undo"?D.done:D.undone,se=l=="undo"?D.undone:D.done,ue=0;ue<ie.length&&!(W=ie[ue],w?W.ranges&&!W.equals(e.sel):!W.ranges);ue++);if(ue==ie.length)return;for(D.lastOrigin=D.lastSelOrigin=null;;)if(W=ie.pop(),W.ranges){if(qn(W,se),w&&!W.equals(e.sel)){Li(e,W,{clearRedo:!1});return}Z=W}else if(x){ie.push(W);return}else break;var De=[];qn(Z,se),se.push({changes:De,generation:D.generation}),D.generation=W.generation||++D.maxGeneration;for(var Ue=_e(e,"beforeChange")||e.cm&&_e(e.cm,"beforeChange"),qe=function(lt){var ft=W.changes[lt];if(ft.origin=l,Ue&&!Vs(e,ft,!1))return ie.length=0,{};De.push(Ma(e,ft));var _t=lt?ka(e,ft):he(ie);An(e,ft,_t,Us(e,ft)),!lt&&e.cm&&e.cm.scrollIntoView({from:ft.from,to:Cr(ft)});var xt=[];Ar(e,function(yt,Et){!Et&&de(xt,yt.history)==-1&&($s(yt.history,ft),xt.push(yt.history)),An(yt,ft,null,Us(yt,ft))})},Ze=W.changes.length-1;Ze>=0;--Ze){var rt=qe(Ze);if(rt)return rt.v}}function Qs(e,l){if(l==0)return;if(e.first+=l,e.sel=new Vi(Ie(e.sel.ranges,function(D){return new Zt(ct(D.anchor.line+l,D.anchor.ch),ct(D.head.line+l,D.head.ch))}),e.sel.primIndex),e.cm){Ni(e.cm,e.first,e.first-l,l);for(var w=e.cm.display,x=w.viewFrom;x<w.viewTo;x++)wr(e.cm,x,"gutter")}}function An(e,l,w,x){if(e.cm&&!e.cm.curOp)return vi(e.cm,An)(e,l,w,x);if(l.to.line<e.first){Qs(e,l.text.length-1-(l.to.line-l.from.line));return}if(l.from.line>e.lastLine())return;if(l.from.line<e.first){var D=l.text.length-1-(e.first-l.from.line);Qs(e,D),l={from:ct(e.first,0),to:ct(l.to.line+D,l.to.ch),text:[he(l.text)],origin:l.origin}}var W=e.lastLine();l.to.line>W&&(l={from:l.from,to:ct(W,bt(e,W).text.length),text:[l.text[0]],origin:l.origin}),l.removed=Si(e,l.from,l.to),w||(w=ka(e,l)),e.cm?bl(e.cm,l,x):Da(e,l,x),Jn(e,w,Ne),e.cantEdit&&ea(e,ct(e.firstLine(),0))&&(e.cantEdit=!1)}function bl(e,l,w){var x=e.doc,D=e.display,W=l.from,Z=l.to,ie=!1,se=W.line;e.options.lineWrapping||(se=Pt(Oi(bt(x,W.line))),x.iter(se,Z.line+1,function(Ze){if(Ze==D.maxLine)return ie=!0,!0})),x.sel.contains(l.from,l.to)>-1&&Ce(e),Da(x,l,w,ds(e)),e.options.lineWrapping||(x.iter(se,W.line+l.text.length,function(Ze){var rt=pn(Ze);rt>D.maxLineLength&&(D.maxLine=Ze,D.maxLineLength=rt,D.maxLineChanged=!0,ie=!1)}),ie&&(e.curOp.updateMaxLine=!0)),qi(x,W.line),Sn(e,400);var ue=l.text.length-(Z.line-W.line)-1;l.full?Ni(e):W.line==Z.line&&l.text.length==1&&!Is(e.doc,l)?wr(e,W.line,"text"):Ni(e,W.line,Z.line+1,ue);var De=_e(e,"changes"),Ue=_e(e,"change");if(Ue||De){var qe={from:W,to:Z,text:l.text,removed:l.removed,origin:l.origin};Ue&&Ei(e,"change",e,qe),De&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(qe)}e.display.selForContextMenu=null}function rn(e,l,w,x,D){var W;x||(x=w),Dt(x,w)<0&&(W=[x,w],w=W[0],x=W[1]),typeof l=="string"&&(l=e.splitLines(l)),tn(e,{from:w,to:x,text:l,origin:D})}function Zs(e,l,w,x){w<e.line?e.line+=x:l<e.line&&(e.line=l,e.ch=0)}function qs(e,l,w,x){for(var D=0;D<e.length;++D){var W=e[D],Z=!0;if(W.ranges){W.copied||(W=e[D]=W.deepCopy(),W.copied=!0);for(var ie=0;ie<W.ranges.length;ie++)Zs(W.ranges[ie].anchor,l,w,x),Zs(W.ranges[ie].head,l,w,x);continue}for(var se=0;se<W.changes.length;++se){var ue=W.changes[se];if(w<ue.from.line)ue.from=ct(ue.from.line+x,ue.from.ch),ue.to=ct(ue.to.line+x,ue.to.ch);else if(l<=ue.to.line){Z=!1;break}}Z||(e.splice(0,D+1),D=0)}}function $s(e,l){var w=l.from.line,x=l.to.line,D=l.text.length-(x-w)-1;qs(e.done,w,x,D),qs(e.undone,w,x,D)}function Ln(e,l,w,x){var D=l,W=l;return typeof l=="number"?W=bt(e,J(e,l)):D=Pt(l),D==null?null:(x(W,D)&&e.cm&&wr(e.cm,D,w),W)}function Rn(e){this.lines=e,this.parent=null;for(var l=0,w=0;w<e.length;++w)e[w].parent=this,l+=e[w].height;this.height=l}Rn.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,l){for(var w=e,x=e+l;w<x;++w){var D=this.lines[w];this.height-=D.height,Tt(D),Ei(D,"delete")}this.lines.splice(e,l)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,l,w){this.height+=w,this.lines=this.lines.slice(0,e).concat(l).concat(this.lines.slice(e));for(var x=0;x<l.length;++x)l[x].parent=this},iterN:function(e,l,w){for(var x=e+l;e<x;++e)if(w(this.lines[e]))return!0}};function On(e){this.children=e;for(var l=0,w=0,x=0;x<e.length;++x){var D=e[x];l+=D.chunkSize(),w+=D.height,D.parent=this}this.size=l,this.height=w,this.parent=null}On.prototype={chunkSize:function(){return this.size},removeInner:function(e,l){this.size-=l;for(var w=0;w<this.children.length;++w){var x=this.children[w],D=x.chunkSize();if(e<D){var W=Math.min(l,D-e),Z=x.height;if(x.removeInner(e,W),this.height-=Z-x.height,D==W&&(this.children.splice(w--,1),x.parent=null),(l-=W)==0)break;e=0}else e-=D}if(this.size-l<25&&(this.children.length>1||!(this.children[0]instanceof Rn))){var ie=[];this.collapse(ie),this.children=[new Rn(ie)],this.children[0].parent=this}},collapse:function(e){for(var l=0;l<this.children.length;++l)this.children[l].collapse(e)},insertInner:function(e,l,w){this.size+=l.length,this.height+=w;for(var x=0;x<this.children.length;++x){var D=this.children[x],W=D.chunkSize();if(e<=W){if(D.insertInner(e,l,w),D.lines&&D.lines.length>50){for(var Z=D.lines.length%25+25,ie=Z;ie<D.lines.length;){var se=new Rn(D.lines.slice(ie,ie+=25));D.height-=se.height,this.children.splice(++x,0,se),se.parent=this}D.lines=D.lines.slice(0,Z),this.maybeSpill()}break}e-=W}},maybeSpill:function(){if(this.children.length<=10)return;var e=this;do{var l=e.children.splice(e.children.length-5,5),w=new On(l);if(e.parent){e.size-=w.size,e.height-=w.height;var D=de(e.parent.children,e);e.parent.children.splice(D+1,0,w)}else{var x=new On(e.children);x.parent=e,e.children=[x,w],e=x}w.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()},iterN:function(e,l,w){for(var x=0;x<this.children.length;++x){var D=this.children[x],W=D.chunkSize();if(e<W){var Z=Math.min(l,W-e);if(D.iterN(e,Z,w))return!0;if((l-=Z)==0)break;e=0}else e-=W}}};var kn=function(e,l,w){if(w)for(var x in w)w.hasOwnProperty(x)&&(this[x]=w[x]);this.doc=e,this.node=l};kn.prototype.clear=function(){var e=this.doc.cm,l=this.line.widgets,w=this.line,x=Pt(w);if(x==null||!l)return;for(var D=0;D<l.length;++D)l[D]==this&&l.splice(D--,1);l.length||(w.widgets=null);var W=vn(this);ii(w,Math.max(0,w.height-W)),e&&(Wi(e,function(){Js(e,w,-W),wr(e,x,"widget")}),Ei(e,"lineWidgetCleared",e,this,x))},kn.prototype.changed=function(){var e=this,l=this.height,w=this.doc.cm,x=this.line;this.height=null;var D=vn(this)-l;if(!D)return;nr(this.doc,x)||ii(x,x.height+D),w&&Wi(w,function(){w.curOp.forceUpdate=!0,Js(w,x,D),Ei(w,"lineWidgetChanged",w,e,Pt(x))})},Ee(kn);function Js(e,l,w){Ji(l)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&Ta(e,w)}function xl(e,l,w,x){var D=new kn(e,w,x),W=e.cm;return W&&D.noHScroll&&(W.display.alignWidgets=!0),Ln(e,l,"widget",function(Z){var ie=Z.widgets||(Z.widgets=[]);if(D.insertAt==null?ie.push(D):ie.splice(Math.min(ie.length-1,Math.max(0,D.insertAt)),0,D),D.line=Z,W&&!nr(e,Z)){var se=Ji(Z)<e.scrollTop;ii(Z,Z.height+vn(D)),se&&Ta(W,D.height),W.curOp.forceUpdate=!0}return!0}),W&&Ei(W,"lineWidgetAdded",W,D,typeof l=="number"?l:Pt(l)),D}var eo=0,Lr=function(e,l){this.lines=[],this.type=l,this.doc=e,this.id=++eo};Lr.prototype.clear=function(){if(this.explicitlyCleared)return;var e=this.doc.cm,l=e&&!e.curOp;if(l&&Kr(e),_e(this,"clear")){var w=this.find();w&&Ei(this,"clear",w.from,w.to)}for(var x=null,D=null,W=0;W<this.lines.length;++W){var Z=this.lines[W],ie=ji(Z.markedSpans,this);e&&!this.collapsed?wr(e,Pt(Z),"text"):e&&(ie.to!=null&&(D=Pt(Z)),ie.from!=null&&(x=Pt(Z))),Z.markedSpans=Ir(Z.markedSpans,ie),ie.from==null&&this.collapsed&&!nr(this.doc,Z)&&e&&ii(Z,Yr(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var se=0;se<this.lines.length;++se){var ue=Oi(this.lines[se]),De=pn(ue);De>e.display.maxLineLength&&(e.display.maxLine=ue,e.display.maxLineLength=De,e.display.maxLineChanged=!0)}x!=null&&e&&this.collapsed&&Ni(e,x,D+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&Ws(e.doc)),e&&Ei(e,"markerCleared",e,this,x,D),l&&Hr(e),this.parent&&this.parent.clear()},Lr.prototype.find=function(e,l){e==null&&this.type=="bookmark"&&(e=1);for(var w,x,D=0;D<this.lines.length;++D){var W=this.lines[D],Z=ji(W.markedSpans,this);if(Z.from!=null&&(w=ct(l?W:Pt(W),Z.from),e==-1))return w;if(Z.to!=null&&(x=ct(l?W:Pt(W),Z.to),e==1))return x}return w&&{from:w,to:x}},Lr.prototype.changed=function(){var e=this,l=this.find(-1,!0),w=this,x=this.doc.cm;if(!l||!x)return;Wi(x,function(){var D=l.line,W=Pt(l.line),Z=fa(x,W);if(Z&&(ns(Z),x.curOp.selectionChanged=x.curOp.forceUpdate=!0),x.curOp.updateMaxLine=!0,!nr(w.doc,D)&&w.height!=null){var ie=w.height;w.height=null;var se=vn(w)-ie;se&&ii(D,D.height+se)}Ei(x,"markerChanged",x,e)})},Lr.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var l=this.doc.cm.curOp;(!l.maybeHiddenMarkers||de(l.maybeHiddenMarkers,this)==-1)&&(l.maybeUnhiddenMarkers||(l.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},Lr.prototype.detachLine=function(e){if(this.lines.splice(de(this.lines,e),1),!this.lines.length&&this.doc.cm){var l=this.doc.cm.curOp;(l.maybeHiddenMarkers||(l.maybeHiddenMarkers=[])).push(this)}},Ee(Lr);function nn(e,l,w,x,D){if(x&&x.shared)return El(e,l,w,x,D);if(e.cm&&!e.cm.curOp)return vi(e.cm,nn)(e,l,w,x,D);var W=new Lr(e,D),Z=Dt(l,w);if(x&&k(x,W,!1),Z>0||Z==0&&W.clearWhenEmpty!==!1)return W;if(W.replacedWith&&(W.collapsed=!0,W.widgetNode=F("span",[W.replacedWith],"CodeMirror-widget"),x.handleMouseEvents||W.widgetNode.setAttribute("cm-ignore-events","true"),x.insertLeft&&(W.widgetNode.insertLeft=!0)),W.collapsed){if(gi(e,l.line,l,w,W)||l.line!=w.line&&gi(e,w.line,l,w,W))throw new Error("Inserting collapsed marker partially overlapping an existing one");lr()}W.addToHistory&&Ns(e,{from:l,to:w,origin:"markText"},e.sel,NaN);var ie=l.line,se=e.cm,ue;if(e.iter(ie,w.line+1,function(Ue){se&&W.collapsed&&!se.options.lineWrapping&&Oi(Ue)==se.display.maxLine&&(ue=!0),W.collapsed&&ie!=l.line&&ii(Ue,0),_r(Ue,new ur(W,ie==l.line?l.ch:null,ie==w.line?w.ch:null)),++ie}),W.collapsed&&e.iter(l.line,w.line+1,function(Ue){nr(e,Ue)&&ii(Ue,0)}),W.clearOnEnter&&je(W,"beforeCursorEnter",function(){return W.clear()}),W.readOnly&&(zi(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),W.collapsed&&(W.id=++eo,W.atomic=!0),se){if(ue&&(se.curOp.updateMaxLine=!0),W.collapsed)Ni(se,l.line,w.line+1);else if(W.className||W.startStyle||W.endStyle||W.css||W.attributes||W.title)for(var De=l.line;De<=w.line;De++)wr(se,De,"text");W.atomic&&Ws(se.doc),Ei(se,"markerAdded",se,W)}return W}var In=function(e,l){this.markers=e,this.primary=l;for(var w=0;w<e.length;++w)e[w].parent=this};In.prototype.clear=function(){if(this.explicitlyCleared)return;this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();Ei(this,"clear")},In.prototype.find=function(e,l){return this.primary.find(e,l)},Ee(In);function El(e,l,w,x,D){x=k(x),x.shared=!1;var W=[nn(e,l,w,x,D)],Z=W[0],ie=x.widgetNode;return Ar(e,function(se){ie&&(x.widgetNode=ie.cloneNode(!0)),W.push(nn(se,B(se,l),B(se,w),x,D));for(var ue=0;ue<se.linked.length;++ue)if(se.linked[ue].isParent)return;Z=he(W)}),new In(W,Z)}function to(e){return e.findMarks(ct(e.first,0),e.clipPos(ct(e.lastLine())),function(l){return l.parent})}function wl(e,l){for(var w=0;w<l.length;w++){var x=l[w],D=x.find(),W=e.clipPos(D.from),Z=e.clipPos(D.to);if(Dt(W,Z)){var ie=nn(e,W,Z,x.primary,x.primary.type);x.markers.push(ie),ie.parent=x}}}function Sl(e){for(var l=function(x){var D=e[x],W=[D.primary.doc];Ar(D.primary.doc,function(se){return W.push(se)});for(var Z=0;Z<D.markers.length;Z++){var ie=D.markers[Z];de(W,ie.doc)==-1&&(ie.parent=null,D.markers.splice(Z--,1))}},w=0;w<e.length;w++)l(w)}var Tl=0,Fi=function(e,l,w,x,D){if(!(this instanceof Fi))return new Fi(e,l,w,x,D);w==null&&(w=0),On.call(this,[new Rn([new Dr("",null)])]),this.first=w,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=w;var W=ct(w,0);this.sel=Tr(W),this.history=new Zn(null),this.id=++Tl,this.modeOption=l,this.lineSep=x,this.direction=D=="rtl"?"rtl":"ltr",this.extend=!1,typeof e=="string"&&(e=this.splitLines(e)),Da(this,{from:W,to:W,text:e}),Li(this,Tr(W),Ne)};Fi.prototype=$e(On.prototype,{constructor:Fi,iter:function(e,l,w){w?this.iterN(e-this.first,l-e,w):this.iterN(this.first,this.first+this.size,e)},insert:function(e,l){for(var w=0,x=0;x<l.length;++x)w+=l[x].height;this.insertInner(e-this.first,l,w)},remove:function(e,l){this.removeInner(e-this.first,l)},getValue:function(e){var l=qt(this,this.first,this.first+this.size);return e===!1?l:l.join(e||this.lineSeparator())},setValue:_i(function(e){var l=ct(this.first,0),w=this.first+this.size-1;tn(this,{from:l,to:ct(w,bt(this,w).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&bn(this.cm,0,0),Li(this,Tr(l),Ne)}),replaceRange:function(e,l,w,x){l=B(this,l),w=w?B(this,w):l,rn(this,e,l,w,x)},getRange:function(e,l,w){var x=Si(this,B(this,e),B(this,l));return w===!1?x:x.join(w||this.lineSeparator())},getLine:function(e){var l=this.getLineHandle(e);return l&&l.text},getLineHandle:function(e){if(Di(this,e))return bt(this,e)},getLineNumber:function(e){return Pt(e)},getLineHandleVisualStart:function(e){return typeof e=="number"&&(e=bt(this,e)),Oi(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return B(this,e)},getCursor:function(e){var l=this.sel.primary(),w;return e==null||e=="head"?w=l.head:e=="anchor"?w=l.anchor:e=="end"||e=="to"||e===!1?w=l.to():w=l.from(),w},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:_i(function(e,l,w){Ks(this,B(this,typeof e=="number"?ct(e,l||0):e),null,w)}),setSelection:_i(function(e,l,w){Ks(this,B(this,e),B(this,l||e),w)}),extendSelection:_i(function(e,l,w){$n(this,B(this,e),l&&B(this,l),w)}),extendSelections:_i(function(e,l){Bs(this,Y(this,e),l)}),extendSelectionsBy:_i(function(e,l){var w=Ie(this.sel.ranges,e);Bs(this,Y(this,w),l)}),setSelections:_i(function(e,l,w){if(!e.length)return;for(var x=[],D=0;D<e.length;D++)x[D]=new Zt(B(this,e[D].anchor),B(this,e[D].head));l==null&&(l=Math.min(e.length-1,this.sel.primIndex)),Li(this,tr(this.cm,x,l),w)}),addSelection:_i(function(e,l,w){var x=this.sel.ranges.slice(0);x.push(new Zt(B(this,e),B(this,l||e))),Li(this,tr(this.cm,x,x.length-1),w)}),getSelection:function(e){for(var l=this.sel.ranges,w,x=0;x<l.length;x++){var D=Si(this,l[x].from(),l[x].to());w=w?w.concat(D):D}return e===!1?w:w.join(e||this.lineSeparator())},getSelections:function(e){for(var l=[],w=this.sel.ranges,x=0;x<w.length;x++){var D=Si(this,w[x].from(),w[x].to());e!==!1&&(D=D.join(e||this.lineSeparator())),l[x]=D}return l},replaceSelection:function(e,l,w){for(var x=[],D=0;D<this.sel.ranges.length;D++)x[D]=e;this.replaceSelections(x,l,w||"+input")},replaceSelections:_i(function(e,l,w){for(var x=[],D=this.sel,W=0;W<D.ranges.length;W++){var Z=D.ranges[W];x[W]={from:Z.from(),to:Z.to(),text:this.splitLines(e[W]),origin:w}}for(var ie=l&&l!="end"&&dl(this,x,l),se=x.length-1;se>=0;se--)tn(this,x[se]);ie?Hs(this,ie):this.cm&&qr(this.cm)}),undo:_i(function(){ta(this,"undo")}),redo:_i(function(){ta(this,"redo")}),undoSelection:_i(function(){ta(this,"undo",!0)}),redoSelection:_i(function(){ta(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,l=0,w=0,x=0;x<e.done.length;x++)e.done[x].ranges||++l;for(var D=0;D<e.undone.length;D++)e.undone[D].ranges||++w;return{undo:l,redo:w}},clearHistory:function(){var e=this;this.history=new Zn(this.history.maxGeneration),Ar(this,function(l){return l.history=e.history},!0)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(e){return e&&(this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null),this.history.generation},isClean:function(e){return this.history.generation==(e||this.cleanGeneration)},getHistory:function(){return{done:Jr(this.history.done),undone:Jr(this.history.undone)}},setHistory:function(e){var l=this.history=new Zn(this.history.maxGeneration);l.done=Jr(e.done.slice(0),null,!0),l.undone=Jr(e.undone.slice(0),null,!0)},setGutterMarker:_i(function(e,l,w){return Ln(this,e,"gutter",function(x){var D=x.gutterMarkers||(x.gutterMarkers={});return D[l]=w,!w&&fe(D)&&(x.gutterMarkers=null),!0})}),clearGutter:_i(function(e){var l=this;this.iter(function(w){w.gutterMarkers&&w.gutterMarkers[e]&&Ln(l,w,"gutter",function(){return w.gutterMarkers[e]=null,fe(w.gutterMarkers)&&(w.gutterMarkers=null),!0})})}),lineInfo:function(e){var l;if(typeof e=="number"){if(!Di(this,e))return null;if(l=e,e=bt(this,e),!e)return null}else if(l=Pt(e),l==null)return null;return{line:l,handle:e,text:e.text,gutterMarkers:e.gutterMarkers,textClass:e.textClass,bgClass:e.bgClass,wrapClass:e.wrapClass,widgets:e.widgets}},addLineClass:_i(function(e,l,w){return Ln(this,e,l=="gutter"?"gutter":"class",function(x){var D=l=="text"?"textClass":l=="background"?"bgClass":l=="gutter"?"gutterClass":"wrapClass";if(!x[D])x[D]=w;else{if(_(w).test(x[D]))return!1;x[D]+=" "+w}return!0})}),removeLineClass:_i(function(e,l,w){return Ln(this,e,l=="gutter"?"gutter":"class",function(x){var D=l=="text"?"textClass":l=="background"?"bgClass":l=="gutter"?"gutterClass":"wrapClass",W=x[D];if(W)if(w==null)x[D]=null;else{var Z=W.match(_(w));if(!Z)return!1;var ie=Z.index+Z[0].length;x[D]=W.slice(0,Z.index)+(!Z.index||ie==W.length?"":" ")+W.slice(ie)||null}else return!1;return!0})}),addLineWidget:_i(function(e,l,w){return xl(this,e,l,w)}),removeLineWidget:function(e){e.clear()},markText:function(e,l,w){return nn(this,B(this,e),B(this,l),w,w&&w.type||"range")},setBookmark:function(e,l){var w={replacedWith:l&&(l.nodeType==null?l.widget:l),insertLeft:l&&l.insertLeft,clearWhenEmpty:!1,shared:l&&l.shared,handleMouseEvents:l&&l.handleMouseEvents};return e=B(this,e),nn(this,e,e,w,"bookmark")},findMarksAt:function(e){e=B(this,e);var l=[],w=bt(this,e.line).markedSpans;if(w)for(var x=0;x<w.length;++x){var D=w[x];(D.from==null||D.from<=e.ch)&&(D.to==null||D.to>=e.ch)&&l.push(D.marker.parent||D.marker)}return l},findMarks:function(e,l,w){e=B(this,e),l=B(this,l);var x=[],D=e.line;return this.iter(e.line,l.line+1,function(W){var Z=W.markedSpans;if(Z)for(var ie=0;ie<Z.length;ie++){var se=Z[ie];!(se.to!=null&&D==e.line&&e.ch>=se.to||se.from==null&&D!=e.line||se.from!=null&&D==l.line&&se.from>=l.ch)&&(!w||w(se.marker))&&x.push(se.marker.parent||se.marker)}++D}),x},getAllMarks:function(){var e=[];return this.iter(function(l){var w=l.markedSpans;if(w)for(var x=0;x<w.length;++x)w[x].from!=null&&e.push(w[x].marker)}),e},posFromIndex:function(e){var l,w=this.first,x=this.lineSeparator().length;return this.iter(function(D){var W=D.text.length+x;if(W>e)return l=e,!0;e-=W,++w}),B(this,ct(w,l))},indexFromPos:function(e){e=B(this,e);var l=e.ch;if(e.line<this.first||e.ch<0)return 0;var w=this.lineSeparator().length;return this.iter(this.first,e.line,function(x){l+=x.text.length+w}),l},copy:function(e){var l=new Fi(qt(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);return l.scrollTop=this.scrollTop,l.scrollLeft=this.scrollLeft,l.sel=this.sel,l.extend=!1,e&&(l.history.undoDepth=this.history.undoDepth,l.setHistory(this.getHistory())),l},linkedDoc:function(e){e||(e={});var l=this.first,w=this.first+this.size;e.from!=null&&e.from>l&&(l=e.from),e.to!=null&&e.to<w&&(w=e.to);var x=new Fi(qt(this,l,w),e.mode||this.modeOption,l,this.lineSep,this.direction);return e.sharedHist&&(x.history=this.history),(this.linked||(this.linked=[])).push({doc:x,sharedHist:e.sharedHist}),x.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],wl(x,to(this)),x},unlinkDoc:function(e){if(e instanceof ni&&(e=e.doc),this.linked)for(var l=0;l<this.linked.length;++l){var w=this.linked[l];if(w.doc!=e)continue;this.linked.splice(l,1),e.unlinkDoc(this),Sl(to(this));break}if(e.history==this.history){var x=[e.id];Ar(e,function(D){return x.push(D.id)},!0),e.history=new Zn(null),e.history.done=Jr(this.history.done,x),e.history.undone=Jr(this.history.undone,x)}},iterLinkedDocs:function(e){Ar(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):ht(e)},lineSeparator:function(){return this.lineSep||`
|
|
|
`},setDirection:_i(function(e){if(e!="rtl"&&(e="ltr"),e==this.direction)return;this.direction=e,this.iter(function(l){return l.order=null}),this.cm&&fl(this.cm)})}),Fi.prototype.eachLine=Fi.prototype.iter;var io=0;function Cl(e){var l=this;if(ro(l),Fe(l,e)||cr(l.display,e))return;ee(e),E&&(io=+new Date);var w=Nr(l,e,!0),x=e.dataTransfer.files;if(!w||l.isReadOnly())return;if(x&&x.length&&window.FileReader&&window.File)for(var D=x.length,W=Array(D),Z=0,ie=function(){++Z==D&&vi(l,function(){w=B(l.doc,w);var Ze={from:w,to:w,text:l.doc.splitLines(W.filter(function(rt){return rt!=null}).join(l.doc.lineSeparator())),origin:"paste"};tn(l.doc,Ze),Hs(l.doc,Tr(B(l.doc,w),B(l.doc,Cr(Ze))))})()},se=function(Ze,rt){if(l.options.allowDropFileTypes&&de(l.options.allowDropFileTypes,Ze.type)==-1){ie();return}var lt=new FileReader;lt.onerror=function(){return ie()},lt.onload=function(){var ft=lt.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(ft)){ie();return}W[rt]=ft,ie()},lt.readAsText(Ze)},ue=0;ue<x.length;ue++)se(x[ue],ue);else{if(l.state.draggingText&&l.doc.sel.contains(w)>-1){l.state.draggingText(e),setTimeout(function(){return l.display.input.focus()},20);return}try{var De=e.dataTransfer.getData("Text");if(De){var Ue;if(l.state.draggingText&&!l.state.draggingText.copy&&(Ue=l.listSelections()),Jn(l.doc,Tr(w,w)),Ue)for(var qe=0;qe<Ue.length;++qe)rn(l.doc,"",Ue[qe].anchor,Ue[qe].head,"drag");l.replaceSelection(De,"around","paste"),l.display.input.focus()}}catch(Ze){}}}function Al(e,l){if(E&&(!e.state.draggingText||+new Date-io<100)){me(l);return}if(Fe(e,l)||cr(e.display,l))return;if(l.dataTransfer.setData("Text",e.getSelection()),l.dataTransfer.effectAllowed="copyMove",l.dataTransfer.setDragImage&&!n){var w=g("img",null,null,"position: fixed; left: 0; top: 0;");w.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",h&&(w.width=w.height=1,e.display.wrapper.appendChild(w),w._top=w.offsetTop),l.dataTransfer.setDragImage(w,0,0),h&&w.parentNode.removeChild(w)}}function Ll(e,l){var w=Nr(e,l);if(!w)return;var x=document.createDocumentFragment();ms(e,w,x),e.display.dragCursor||(e.display.dragCursor=g("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),O(e.display.dragCursor,x)}function ro(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function no(e){if(!document.getElementsByClassName)return;for(var l=document.getElementsByClassName("CodeMirror"),w=[],x=0;x<l.length;x++){var D=l[x].CodeMirror;D&&w.push(D)}w.length&&w[0].operation(function(){for(var W=0;W<w.length;W++)e(w[W])})}var ao=!1;function Rl(){if(ao)return;Ol(),ao=!0}function Ol(){var e;je(window,"resize",function(){e==null&&(e=setTimeout(function(){e=null,no(kl)},100))}),je(window,"blur",function(){return no(Zr)})}function kl(e){var l=e.display;l.cachedCharWidth=l.cachedTextHeight=l.cachedPaddingH=null,l.scrollbarsClipped=!1,e.setSize()}for(var Rr={3:"Pause",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",106:"*",107:"=",109:"-",110:".",111:"/",145:"ScrollLock",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",224:"Mod",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"},Dn=0;Dn<10;Dn++)Rr[Dn+48]=Rr[Dn+96]=String(Dn);for(var ia=65;ia<=90;ia++)Rr[ia]=String.fromCharCode(ia);for(var Mn=1;Mn<=12;Mn++)Rr[Mn+111]=Rr[Mn+63235]="F"+Mn;var dr={};dr.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"},dr.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Up":"goLineUp","Ctrl-Down":"goLineDown","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"},dr.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Alt-F":"goWordRight","Alt-B":"goWordLeft","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-D":"delWordAfter","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars","Ctrl-O":"openLine"},dr.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Home":"goDocStart","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineLeft","Cmd-Right":"goLineRight","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delWrappedLineLeft","Cmd-Delete":"delWrappedLineRight","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection","Ctrl-Up":"goDocStart","Ctrl-Down":"goDocEnd",fallthrough:["basic","emacsy"]},dr.default=d?dr.macDefault:dr.pcDefault;function Il(e){var l=e.split(/-(?!$)/);e=l[l.length-1];for(var w,x,D,W,Z=0;Z<l.length-1;Z++){var ie=l[Z];if(/^(cmd|meta|m)$/i.test(ie))W=!0;else if(/^a(lt)?$/i.test(ie))w=!0;else if(/^(c|ctrl|control)$/i.test(ie))x=!0;else if(/^s(hift)?$/i.test(ie))D=!0;else throw new Error("Unrecognized modifier name: "+ie)}return w&&(e="Alt-"+e),x&&(e="Ctrl-"+e),W&&(e="Cmd-"+e),D&&(e="Shift-"+e),e}function Dl(e){var l={};for(var w in e)if(e.hasOwnProperty(w)){var x=e[w];if(/^(name|fallthrough|(de|at)tach)$/.test(w))continue;if(x=="..."){delete e[w];continue}for(var D=Ie(w.split(" "),Il),W=0;W<D.length;W++){var Z=void 0,ie=void 0;W==D.length-1?(ie=D.join(" "),Z=x):(ie=D.slice(0,W+1).join(" "),Z="...");var se=l[ie];if(!se)l[ie]=Z;else if(se!=Z)throw new Error("Inconsistent bindings for "+ie)}delete e[w]}for(var ue in l)e[ue]=l[ue];return e}function an(e,l,w,x){l=ra(l);var D=l.call?l.call(e,x):l[e];if(D===!1)return"nothing";if(D==="...")return"multi";if(D!=null&&w(D))return"handled";if(l.fallthrough){if(Object.prototype.toString.call(l.fallthrough)!="[object Array]")return an(e,l.fallthrough,w,x);for(var W=0;W<l.fallthrough.length;W++){var Z=an(e,l.fallthrough[W],w,x);if(Z)return Z}}}function so(e){var l=typeof e=="string"?e:Rr[e.keyCode];return l=="Ctrl"||l=="Alt"||l=="Shift"||l=="Mod"}function oo(e,l,w){var x=e;return l.altKey&&x!="Alt"&&(e="Alt-"+e),(S?l.metaKey:l.ctrlKey)&&x!="Ctrl"&&(e="Ctrl-"+e),(S?l.ctrlKey:l.metaKey)&&x!="Mod"&&(e="Cmd-"+e),!w&&l.shiftKey&&x!="Shift"&&(e="Shift-"+e),e}function lo(e,l){if(h&&e.keyCode==34&&e.char)return!1;var w=Rr[e.keyCode];return w==null||e.altGraphKey?!1:(e.keyCode==3&&e.code&&(w=e.code),oo(w,e,l))}function ra(e){return typeof e=="string"?dr[e]:e}function sn(e,l){for(var w=e.doc.sel.ranges,x=[],D=0;D<w.length;D++){for(var W=l(w[D]);x.length&&Dt(W.from,he(x).to)<=0;){var Z=x.pop();if(Dt(Z.from,W.from)<0){W.from=Z.from;break}}x.push(W)}Wi(e,function(){for(var ie=x.length-1;ie>=0;ie--)rn(e.doc,"",x[ie].from,x[ie].to,"+delete");qr(e)})}function Fa(e,l,w){var x=we(e.text,l+w,w);return x<0||x>e.text.length?null:x}function Ua(e,l,w){var x=Fa(e,l.ch,w);return x==null?null:new ct(l.line,x,w<0?"after":"before")}function Ba(e,l,w,x,D){if(e){l.doc.direction=="rtl"&&(D=-D);var W=Ye(w,l.doc.direction);if(W){var Z=D<0?he(W):W[0],ie=D<0==(Z.level==1),se=ie?"after":"before",ue;if(Z.level>0||l.doc.direction=="rtl"){var De=Vr(l,w);ue=D<0?w.text.length-1:0;var Ue=sr(l,De,ue).top;ue=Te(function(qe){return sr(l,De,qe).top==Ue},D<0==(Z.level==1)?Z.from:Z.to-1,ue),se=="before"&&(ue=Fa(w,ue,1))}else ue=D<0?Z.to:Z.from;return new ct(x,ue,se)}}return new ct(x,D<0?w.text.length:0,D<0?"before":"after")}function Ml(e,l,w,x){var D=Ye(l,e.doc.direction);if(!D)return Ua(l,w,x);w.ch>=l.text.length?(w.ch=l.text.length,w.sticky="before"):w.ch<=0&&(w.ch=0,w.sticky="after");var W=ae(D,w.ch,w.sticky),Z=D[W];if(e.doc.direction=="ltr"&&Z.level%2==0&&(x>0?Z.to>w.ch:Z.from<w.ch))return Ua(l,w,x);var ie=function(_t,xt){return Fa(l,_t instanceof ct?_t.ch:_t,xt)},se,ue=function(_t){return e.options.lineWrapping?(se=se||Vr(e,l),cs(e,l,se,_t)):{begin:0,end:l.text.length}},De=ue(w.sticky=="before"?ie(w,-1):w.ch);if(e.doc.direction=="rtl"||Z.level==1){var Ue=Z.level==1==x<0,qe=ie(w,Ue?1:-1);if(qe!=null&&(Ue?qe<=Z.to&&qe<=De.end:qe>=Z.from&&qe>=De.begin)){var Ze=Ue?"before":"after";return new ct(w.line,qe,Ze)}}var rt=function(_t,xt,yt){for(var Et=function(ti,yi){return yi?new ct(w.line,ie(ti,1),"before"):new ct(w.line,ti,"after")};_t>=0&&_t<D.length;_t+=xt){var kt=D[_t],Lt=xt>0==(kt.level!=1),Kt=Lt?yt.begin:ie(yt.end,-1);if(kt.from<=Kt&&Kt<kt.to)return Et(Kt,Lt);if(Kt=Lt?kt.from:ie(kt.to,-1),yt.begin<=Kt&&Kt<yt.end)return Et(Kt,Lt)}},lt=rt(W+x,x,De);if(lt)return lt;var ft=x>0?De.end:ie(De.begin,-1);return ft!=null&&!(x>0&&ft==l.text.length)&&(lt=rt(x>0?0:D.length-1,x,ue(ft)),lt)?lt:null}var Pn={selectAll:Gs,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),Ne)},killLine:function(e){return sn(e,function(l){if(l.empty()){var w=bt(e.doc,l.head.line).text.length;return l.head.ch==w&&l.head.line<e.lastLine()?{from:l.head,to:ct(l.head.line+1,0)}:{from:l.head,to:ct(l.head.line,w)}}else return{from:l.from(),to:l.to()}})},deleteLine:function(e){return sn(e,function(l){return{from:ct(l.from().line,0),to:B(e.doc,ct(l.to().line+1,0))}})},delLineLeft:function(e){return sn(e,function(l){return{from:ct(l.from().line,0),to:l.from()}})},delWrappedLineLeft:function(e){return sn(e,function(l){var w=e.charCoords(l.head,"div").top+5,x=e.coordsChar({left:0,top:w},"div");return{from:x,to:l.from()}})},delWrappedLineRight:function(e){return sn(e,function(l){var w=e.charCoords(l.head,"div").top+5,x=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:w},"div");return{from:l.from(),to:x}})},undo:function(e){return e.undo()},redo:function(e){return e.redo()},undoSelection:function(e){return e.undoSelection()},redoSelection:function(e){return e.redoSelection()},goDocStart:function(e){return e.extendSelection(ct(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(ct(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy(function(l){return uo(e,l.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy(function(l){return ho(e,l.head)},{origin:"+move",bias:1})},goLineEnd:function(e){return e.extendSelectionsBy(function(l){return Pl(e,l.head.line)},{origin:"+move",bias:-1})},goLineRight:function(e){return e.extendSelectionsBy(function(l){var w=e.cursorCoords(l.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:w},"div")},Ke)},goLineLeft:function(e){return e.extendSelectionsBy(function(l){var w=e.cursorCoords(l.head,"div").top+5;return e.coordsChar({left:0,top:w},"div")},Ke)},goLineLeftSmart:function(e){return e.extendSelectionsBy(function(l){var w=e.cursorCoords(l.head,"div").top+5,x=e.coordsChar({left:0,top:w},"div");return x.ch<e.getLine(x.line).search(/\S/)?ho(e,l.head):x},Ke)},goLineUp:function(e){return e.moveV(-1,"line")},goLineDown:function(e){return e.moveV(1,"line")},goPageUp:function(e){return e.moveV(-1,"page")},goPageDown:function(e){return e.moveV(1,"page")},goCharLeft:function(e){return e.moveH(-1,"char")},goCharRight:function(e){return e.moveH(1,"char")},goColumnLeft:function(e){return e.moveH(-1,"column")},goColumnRight:function(e){return e.moveH(1,"column")},goWordLeft:function(e){return e.moveH(-1,"word")},goGroupRight:function(e){return e.moveH(1,"group")},goGroupLeft:function(e){return e.moveH(-1,"group")},goWordRight:function(e){return e.moveH(1,"word")},delCharBefore:function(e){return e.deleteH(-1,"codepoint")},delCharAfter:function(e){return e.deleteH(1,"char")},delWordBefore:function(e){return e.deleteH(-1,"word")},delWordAfter:function(e){return e.deleteH(1,"word")},delGroupBefore:function(e){return e.deleteH(-1,"group")},delGroupAfter:function(e){return e.deleteH(1,"group")},indentAuto:function(e){return e.indentSelection("smart")},indentMore:function(e){return e.indentSelection("add")},indentLess:function(e){return e.indentSelection("subtract")},insertTab:function(e){return e.replaceSelection(" ")},insertSoftTab:function(e){for(var l=[],w=e.listSelections(),x=e.options.tabSize,D=0;D<w.length;D++){var W=w[D].from(),Z=z(e.getLine(W.line),W.ch,x);l.push(Se(x-Z%x))}e.replaceSelections(l)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return Wi(e,function(){for(var l=e.listSelections(),w=[],x=0;x<l.length;x++){if(!l[x].empty())continue;var D=l[x].head,W=bt(e.doc,D.line).text;if(W){if(D.ch==W.length&&(D=new ct(D.line,D.ch-1)),D.ch>0)D=new ct(D.line,D.ch+1),e.replaceRange(W.charAt(D.ch-1)+W.charAt(D.ch-2),ct(D.line,D.ch-2),D,"+transpose");else if(D.line>e.doc.first){var Z=bt(e.doc,D.line-1).text;Z&&(D=new ct(D.line,1),e.replaceRange(W.charAt(0)+e.doc.lineSeparator()+Z.charAt(Z.length-1),ct(D.line-1,Z.length-1),D,"+transpose"))}}w.push(new Zt(D,D))}e.setSelections(w)})},newlineAndIndent:function(e){return Wi(e,function(){for(var l=e.listSelections(),w=l.length-1;w>=0;w--)e.replaceRange(e.doc.lineSeparator(),l[w].anchor,l[w].head,"+input");l=e.listSelections();for(var x=0;x<l.length;x++)e.indentLine(l[x].from().line,null,!0);qr(e)})},openLine:function(e){return e.replaceSelection(`
|
|
|
`,"start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function uo(e,l){var w=bt(e.doc,l),x=Oi(w);return x!=w&&(l=Pt(x)),Ba(!0,e,x,l,1)}function Pl(e,l){var w=bt(e.doc,l),x=Gr(w);return x!=w&&(l=Pt(x)),Ba(!0,e,w,l,-1)}function ho(e,l){var w=uo(e,l.line),x=bt(e.doc,w.line),D=Ye(x,e.doc.direction);if(!D||D[0].level==0){var W=Math.max(w.ch,x.text.search(/\S/)),Z=l.line==w.line&&l.ch<=W&&l.ch;return ct(w.line,Z?0:W,w.sticky)}return w}function na(e,l,w){if(typeof l=="string"&&(l=Pn[l],!l))return!1;e.display.input.ensurePolled();var x=e.display.shift,D=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),w&&(e.display.shift=!1),D=l(e)!=We}finally{e.display.shift=x,e.state.suppressEdits=!1}return D}function Nl(e,l,w){for(var x=0;x<e.state.keyMaps.length;x++){var D=an(l,e.state.keyMaps[x],w,e);if(D)return D}return e.options.extraKeys&&an(l,e.options.extraKeys,w,e)||an(l,e.options.keyMap,w,e)}var Fl=new te;function Nn(e,l,w,x){var D=e.state.keySeq;if(D){if(so(l))return"handled";if(/\'$/.test(l)?e.state.keySeq=null:Fl.set(50,function(){e.state.keySeq==D&&(e.state.keySeq=null,e.display.input.reset())}),co(e,D+" "+l,w,x))return!0}return co(e,l,w,x)}function co(e,l,w,x){var D=Nl(e,l,x);return D=="multi"&&(e.state.keySeq=l),D=="handled"&&Ei(e,"keyHandled",e,l,w),(D=="handled"||D=="multi")&&(ee(w),Ea(e)),!!D}function fo(e,l){var w=lo(l,!0);return w?l.shiftKey&&!e.state.keySeq?Nn(e,"Shift-"+w,l,function(x){return na(e,x,!0)})||Nn(e,w,l,function(x){if(typeof x=="string"?/^go[A-Z]/.test(x):x.motion)return na(e,x)}):Nn(e,w,l,function(x){return na(e,x)}):!1}function Ul(e,l,w){return Nn(e,"'"+w+"'",l,function(x){return na(e,x,!0)})}var Ka=null;function po(e){var l=this;if(e.target&&e.target!=l.display.input.getField())return;if(l.curOp.focus=X(),Fe(l,e))return;E&&b<11&&e.keyCode==27&&(e.returnValue=!1);var w=e.keyCode;l.display.shift=w==16||e.shiftKey;var x=fo(l,e);h&&(Ka=x?w:null,!x&&w==88&&!at&&(d?e.metaKey:e.ctrlKey)&&l.replaceSelection("",null,"cut")),I&&!d&&!x&&w==46&&e.shiftKey&&!e.ctrlKey&&document.execCommand&&document.execCommand("cut"),w==18&&!/\bCodeMirror-crosshair\b/.test(l.display.lineDiv.className)&&Bl(l)}function Bl(e){var l=e.display.lineDiv;j(l,"CodeMirror-crosshair");function w(x){(x.keyCode==18||!x.altKey)&&(y(l,"CodeMirror-crosshair"),ce(document,"keyup",w),ce(document,"mouseover",w))}je(document,"keyup",w),je(document,"mouseover",w)}function mo(e){e.keyCode==16&&(this.doc.sel.shift=!1),Fe(this,e)}function go(e){var l=this;if(e.target&&e.target!=l.display.input.getField())return;if(cr(l.display,e)||Fe(l,e)||e.ctrlKey&&!e.altKey||d&&e.metaKey)return;var w=e.keyCode,x=e.charCode;if(h&&w==Ka){Ka=null,ee(e);return}if(h&&(!e.which||e.which<10)&&fo(l,e))return;var D=String.fromCharCode(x==null?w:x);if(D=="\b")return;if(Ul(l,e,D))return;l.display.input.onKeyPress(e)}var Kl=400,Ha=function(e,l,w){this.time=e,this.pos=l,this.button=w};Ha.prototype.compare=function(e,l,w){return this.time+Kl>e&&Dt(l,this.pos)==0&&w==this.button};var Fn,Un;function Hl(e,l){var w=+new Date;return Un&&Un.compare(w,e,l)?(Fn=Un=null,"triple"):Fn&&Fn.compare(w,e,l)?(Un=new Ha(w,e,l),Fn=null,"double"):(Fn=new Ha(w,e,l),Un=null,"single")}function vo(e){var l=this,w=l.display;if(Fe(l,e)||w.activeTouch&&w.input.supportsTouch())return;if(w.input.ensurePolled(),w.shift=e.shiftKey,cr(w,e)){i||(w.scroller.draggable=!1,setTimeout(function(){return w.scroller.draggable=!0},100));return}if(ja(l,e))return;var x=Nr(l,e),D=V(e),W=x?Hl(x,D):"single";if(window.focus(),D==1&&l.state.selectingText&&l.state.selectingText(e),x&&jl(l,D,x,W,e))return;D==1?x?Xl(l,x,W,e):Oe(e)==w.scroller&&ee(e):D==2?(x&&$n(l.doc,x),setTimeout(function(){return w.input.focus()},20)):D==3&&(C?l.display.input.onContextMenu(e):vs(l))}function jl(e,l,w,x,D){var W="Click";return x=="double"?W="Double"+W:x=="triple"&&(W="Triple"+W),W=(l==1?"Left":l==2?"Middle":"Right")+W,Nn(e,oo(W,D),D,function(Z){if(typeof Z=="string"&&(Z=Pn[Z]),!Z)return!1;var ie=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),ie=Z(e,w)!=We}finally{e.state.suppressEdits=!1}return ie})}function Wl(e,l,w){var x=e.getOption("configureMouse"),D=x?x(e,l,w):{};if(D.unit==null){var W=f?w.shiftKey&&w.metaKey:w.altKey;D.unit=W?"rectangle":l=="single"?"char":l=="double"?"word":"line"}return(D.extend==null||e.doc.extend)&&(D.extend=e.doc.extend||w.shiftKey),D.addNew==null&&(D.addNew=d?w.metaKey:w.ctrlKey),D.moveOnDrag==null&&(D.moveOnDrag=!(d?w.altKey:w.ctrlKey)),D}function Xl(e,l,w,x){E?setTimeout(U(gs,e),0):e.curOp.focus=X();var D=Wl(e,w,x),W=e.doc.sel,Z;e.options.dragDrop&&Re&&!e.isReadOnly()&&w=="single"&&(Z=W.contains(l))>-1&&(Dt((Z=W.ranges[Z]).from(),l)<0||l.xRel>0)&&(Dt(Z.to(),l)>0||l.xRel<0)?zl(e,x,l,D):Gl(e,x,l,D)}function zl(e,l,w,x){var D=e.display,W=!1,Z=vi(e,function(ue){i&&(D.scroller.draggable=!1),e.state.draggingText=!1,ce(D.wrapper.ownerDocument,"mouseup",Z),ce(D.wrapper.ownerDocument,"mousemove",ie),ce(D.scroller,"dragstart",se),ce(D.scroller,"drop",Z),W||(ee(ue),x.addNew||$n(e.doc,w,null,null,x.extend),i&&!n||E&&b==9?setTimeout(function(){D.wrapper.ownerDocument.body.focus({preventScroll:!0}),D.input.focus()},20):D.input.focus())}),ie=function(ue){W=W||Math.abs(l.clientX-ue.clientX)+Math.abs(l.clientY-ue.clientY)>=10},se=function(){return W=!0};i&&(D.scroller.draggable=!0),e.state.draggingText=Z,Z.copy=!x.moveOnDrag,D.scroller.dragDrop&&D.scroller.dragDrop(),je(D.wrapper.ownerDocument,"mouseup",Z),je(D.wrapper.ownerDocument,"mousemove",ie),je(D.scroller,"dragstart",se),je(D.scroller,"drop",Z),vs(e),setTimeout(function(){return D.input.focus()},20)}function _o(e,l,w){if(w=="char")return new Zt(l,l);if(w=="word")return e.findWordAt(l);if(w=="line")return new Zt(ct(l.line,0),B(e.doc,ct(l.line+1,0)));var x=w(e,l);return new Zt(x.from,x.to)}function Gl(e,l,w,x){var D=e.display,W=e.doc;ee(l);var Z,ie,se=W.sel,ue=se.ranges;if(x.addNew&&!x.extend?(ie=W.sel.contains(w),ie>-1?Z=ue[ie]:Z=new Zt(w,w)):(Z=W.sel.primary(),ie=W.sel.primIndex),x.unit=="rectangle")x.addNew||(Z=new Zt(w,w)),w=Nr(e,l,!0,!0),ie=-1;else{var De=_o(e,w,x.unit);x.extend?Z=Pa(Z,De.anchor,De.head,x.extend):Z=De}x.addNew?ie==-1?(ie=ue.length,Li(W,tr(e,ue.concat([Z]),ie),{scroll:!1,origin:"*mouse"})):ue.length>1&&ue[ie].empty()&&x.unit=="char"&&!x.extend?(Li(W,tr(e,ue.slice(0,ie).concat(ue.slice(ie+1)),0),{scroll:!1,origin:"*mouse"}),se=W.sel):Na(W,ie,Z,Le):(ie=0,Li(W,new Vi([Z],0),Le),se=W.sel);var Ue=w;function qe(yt){if(Dt(Ue,yt)==0)return;if(Ue=yt,x.unit=="rectangle"){for(var Et=[],kt=e.options.tabSize,Lt=z(bt(W,w.line).text,w.ch,kt),Kt=z(bt(W,yt.line).text,yt.ch,kt),ti=Math.min(Lt,Kt),yi=Math.max(Lt,Kt),ai=Math.min(w.line,yt.line),Xi=Math.min(e.lastLine(),Math.max(w.line,yt.line));ai<=Xi;ai++){var Ui=bt(W,ai).text,hi=He(Ui,ti,kt);ti==yi?Et.push(new Zt(ct(ai,hi),ct(ai,hi))):Ui.length>hi&&Et.push(new Zt(ct(ai,hi),ct(ai,He(Ui,yi,kt))))}Et.length||Et.push(new Zt(w,w)),Li(W,tr(e,se.ranges.slice(0,ie).concat(Et),ie),{origin:"*mouse",scroll:!1}),e.scrollIntoView(yt)}else{var Bi=Z,wi=_o(e,yt,x.unit),pi=Bi.anchor,ci;Dt(wi.anchor,pi)>0?(ci=wi.head,pi=vr(Bi.from(),wi.anchor)):(ci=wi.anchor,pi=gr(Bi.to(),wi.head));var si=se.ranges.slice(0);si[ie]=Vl(e,new Zt(B(W,pi),ci)),Li(W,tr(e,si,ie),Le)}}var Ze=D.wrapper.getBoundingClientRect(),rt=0;function lt(yt){var Et=++rt,kt=Nr(e,yt,!0,x.unit=="rectangle");if(!kt)return;if(Dt(kt,Ue)!=0){e.curOp.focus=X(),qe(kt);var Lt=Gn(D,W);(kt.line>=Lt.to||kt.line<Lt.from)&&setTimeout(vi(e,function(){rt==Et&<(yt)}),150)}else{var Kt=yt.clientY<Ze.top?-20:yt.clientY>Ze.bottom?20:0;Kt&&setTimeout(vi(e,function(){if(rt!=Et)return;D.scroller.scrollTop+=Kt,lt(yt)}),50)}}function ft(yt){e.state.selectingText=!1,rt=Infinity,yt&&(ee(yt),D.input.focus()),ce(D.wrapper.ownerDocument,"mousemove",_t),ce(D.wrapper.ownerDocument,"mouseup",xt),W.history.lastSelOrigin=null}var _t=vi(e,function(yt){yt.buttons===0||!V(yt)?ft(yt):lt(yt)}),xt=vi(e,ft);e.state.selectingText=xt,je(D.wrapper.ownerDocument,"mousemove",_t),je(D.wrapper.ownerDocument,"mouseup",xt)}function Vl(e,l){var w=l.anchor,x=l.head,D=bt(e.doc,w.line);if(Dt(w,x)==0&&w.sticky==x.sticky)return l;var W=Ye(D);if(!W)return l;var Z=ae(W,w.ch,w.sticky),ie=W[Z];if(ie.from!=w.ch&&ie.to!=w.ch)return l;var se=Z+(ie.from==w.ch==(ie.level!=1)?0:1);if(se==0||se==W.length)return l;var ue;if(x.line!=w.line)ue=(x.line-w.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var De=ae(W,x.ch,x.sticky),Ue=De-Z||(x.ch-w.ch)*(ie.level==1?-1:1);De==se-1||De==se?ue=Ue<0:ue=Ue>0}var qe=W[se+(ue?-1:0)],Ze=ue==(qe.level==1),rt=Ze?qe.from:qe.to,lt=Ze?"after":"before";return w.ch==rt&&w.sticky==lt?l:new Zt(new ct(w.line,rt,lt),x)}function yo(e,l,w,x){var D,W;if(l.touches)D=l.touches[0].clientX,W=l.touches[0].clientY;else try{D=l.clientX,W=l.clientY}catch(qe){return!1}if(D>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;x&&ee(l);var Z=e.display,ie=Z.lineDiv.getBoundingClientRect();if(W>ie.bottom||!_e(e,w))return Q(l);W-=ie.top-Z.viewOffset;for(var se=0;se<e.display.gutterSpecs.length;++se){var ue=Z.gutters.childNodes[se];if(ue&&ue.getBoundingClientRect().right>=D){var De=di(e.doc,W),Ue=e.display.gutterSpecs[se];return Pe(e,w,e,De,Ue.className,l),Q(l)}}}function ja(e,l){return yo(e,l,"gutterClick",!0)}function bo(e,l){if(cr(e.display,l)||Yl(e,l))return;if(Fe(e,l,"contextmenu"))return;C||e.display.input.onContextMenu(l)}function Yl(e,l){return _e(e,"gutterContextMenu")?yo(e,l,"gutterContextMenu",!1):!1}function xo(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),_n(e)}var on={toString:function(){return"CodeMirror.Init"}},Eo={},aa={};function Ql(e){var l=e.optionHandlers;function w(x,D,W,Z){e.defaults[x]=D,W&&(l[x]=Z?function(ie,se,ue){ue!=on&&W(ie,se,ue)}:W)}e.defineOption=w,e.Init=on,w("value","",function(x,D){return x.setValue(D)},!0),w("mode",null,function(x,D){x.doc.modeOption=D,Ia(x)},!0),w("indentUnit",2,Ia,!0),w("indentWithTabs",!1),w("smartIndent",!0),w("tabSize",4,function(x){Cn(x),_n(x),Ni(x)},!0),w("lineSeparator",null,function(x,D){if(x.doc.lineSep=D,!D)return;var W=[],Z=x.doc.first;x.doc.iter(function(se){for(var ue=0;;){var De=se.text.indexOf(D,ue);if(De==-1)break;ue=De+D.length,W.push(ct(Z,De))}Z++});for(var ie=W.length-1;ie>=0;ie--)rn(x.doc,D,W[ie],ct(W[ie].line,W[ie].ch+D.length))}),w("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200c\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,function(x,D,W){x.state.specialChars=new RegExp(D.source+(D.test(" ")?"":"| "),"g"),W!=on&&x.refresh()}),w("specialCharPlaceholder",ei,function(x){return x.refresh()},!0),w("electricChars",!0),w("inputStyle",u?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),w("spellcheck",!1,function(x,D){return x.getInputField().spellcheck=D},!0),w("autocorrect",!1,function(x,D){return x.getInputField().autocorrect=D},!0),w("autocapitalize",!1,function(x,D){return x.getInputField().autocapitalize=D},!0),w("rtlMoveVisually",!v),w("wholeLineUpdateBefore",!0),w("theme","default",function(x){xo(x),Tn(x)},!0),w("keyMap","default",function(x,D,W){var Z=ra(D),ie=W!=on&&ra(W);ie&&ie.detach&&ie.detach(x,Z),Z.attach&&Z.attach(x,ie||null)}),w("extraKeys",null),w("configureMouse",null),w("lineWrapping",!1,ql,!0),w("gutters",[],function(x,D){x.display.gutterSpecs=Oa(D,x.options.lineNumbers),Tn(x)},!0),w("fixedGutter",!0,function(x,D){x.display.gutters.style.left=D?ba(x.display)+"px":"0",x.refresh()},!0),w("coverGutterNextToScrollbar",!1,function(x){return $r(x)},!0),w("scrollbarStyle","native",function(x){ws(x),$r(x),x.display.scrollbars.setScrollTop(x.doc.scrollTop),x.display.scrollbars.setScrollLeft(x.doc.scrollLeft)},!0),w("lineNumbers",!1,function(x,D){x.display.gutterSpecs=Oa(x.options.gutters,D),Tn(x)},!0),w("firstLineNumber",1,Tn,!0),w("lineNumberFormatter",function(x){return x},Tn,!0),w("showCursorWhenSelecting",!1,yn,!0),w("resetSelectionOnContextMenu",!0),w("lineWiseCopyCut",!0),w("pasteLinesPerSelection",!0),w("selectionsMayTouch",!1),w("readOnly",!1,function(x,D){D=="nocursor"&&(Zr(x),x.display.input.blur()),x.display.input.readOnlyChanged(D)}),w("screenReaderLabel",null,function(x,D){D=D===""?null:D,x.display.input.screenReaderLabelChanged(D)}),w("disableInput",!1,function(x,D){D||x.display.input.reset()},!0),w("dragDrop",!0,Zl),w("allowDropFileTypes",null),w("cursorBlinkRate",530),w("cursorScrollMargin",0),w("cursorHeight",1,yn,!0),w("singleCursorHeightPerLine",!0,yn,!0),w("workTime",100),w("workDelay",100),w("flattenSpans",!0,Cn,!0),w("addModeClass",!1,Cn,!0),w("pollInterval",100),w("undoDepth",200,function(x,D){return x.doc.history.undoDepth=D}),w("historyEventDelay",1250),w("viewportMargin",10,function(x){return x.refresh()},!0),w("maxHighlightLength",1e4,Cn,!0),w("moveInputWithCursor",!0,function(x,D){D||x.display.input.resetPosition()}),w("tabindex",null,function(x,D){return x.display.input.getField().tabIndex=D||""}),w("autofocus",null),w("direction","ltr",function(x,D){return x.doc.setDirection(D)},!0),w("phrases",null)}function Zl(e,l,w){var x=w&&w!=on;if(!l!=!x){var D=e.display.dragFunctions,W=l?je:ce;W(e.display.scroller,"dragstart",D.start),W(e.display.scroller,"dragenter",D.enter),W(e.display.scroller,"dragover",D.over),W(e.display.scroller,"dragleave",D.leave),W(e.display.scroller,"drop",D.drop)}}function ql(e){e.options.lineWrapping?(j(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(y(e.display.wrapper,"CodeMirror-wrap"),Kn(e)),xa(e),Ni(e),_n(e),setTimeout(function(){return $r(e)},100)}function ni(e,l){var w=this;if(!(this instanceof ni))return new ni(e,l);this.options=l=l?k(l):{},k(Eo,l,!1);var x=l.value;typeof x=="string"?x=new Fi(x,l.mode,null,l.lineSeparator,l.direction):l.mode&&(x.modeOption=l.mode),this.doc=x;var D=new ni.inputStyles[l.inputStyle](this),W=this.display=new hl(e,x,D,l);W.wrapper.CodeMirror=this,xo(this),l.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),ws(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:-1,cutIncoming:-1,selectingText:!1,draggingText:!1,highlight:new te,keySeq:null,specialChars:null},l.autofocus&&!u&&W.input.focus(),E&&b<11&&setTimeout(function(){return w.display.input.reset(!0)},20),$l(this),Rl(),Kr(this),this.curOp.forceUpdate=!0,Ds(this,x),l.autofocus&&!u||this.hasFocus()?setTimeout(function(){w.hasFocus()&&!w.state.focused&&wa(w)},20):Zr(this);for(var Z in aa)aa.hasOwnProperty(Z)&&aa[Z](this,l[Z],on);Cs(this),l.finishInit&&l.finishInit(this);for(var ie=0;ie<Wa.length;++ie)Wa[ie](this);Hr(this),i&&l.lineWrapping&&getComputedStyle(W.lineDiv).textRendering=="optimizelegibility"&&(W.lineDiv.style.textRendering="auto")}ni.defaults=Eo,ni.optionHandlers=aa;function $l(e){var l=e.display;je(l.scroller,"mousedown",vi(e,vo)),E&&b<11?je(l.scroller,"dblclick",vi(e,function(se){if(Fe(e,se))return;var ue=Nr(e,se);if(!ue||ja(e,se)||cr(e.display,se))return;ee(se);var De=e.findWordAt(ue);$n(e.doc,De.anchor,De.head)})):je(l.scroller,"dblclick",function(se){return Fe(e,se)||ee(se)}),je(l.scroller,"contextmenu",function(se){return bo(e,se)}),je(l.input.getField(),"contextmenu",function(se){l.scroller.contains(se.target)||bo(e,se)});var w,x={end:0};function D(){l.activeTouch&&(w=setTimeout(function(){return l.activeTouch=null},1e3),x=l.activeTouch,x.end=+new Date)}function W(se){if(se.touches.length!=1)return!1;var ue=se.touches[0];return ue.radiusX<=1&&ue.radiusY<=1}function Z(se,ue){if(ue.left==null)return!0;var De=ue.left-se.left,Ue=ue.top-se.top;return De*De+Ue*Ue>20*20}je(l.scroller,"touchstart",function(se){if(!Fe(e,se)&&!W(se)&&!ja(e,se)){l.input.ensurePolled(),clearTimeout(w);var ue=+new Date;l.activeTouch={start:ue,moved:!1,prev:ue-x.end<=300?x:null},se.touches.length==1&&(l.activeTouch.left=se.touches[0].pageX,l.activeTouch.top=se.touches[0].pageY)}}),je(l.scroller,"touchmove",function(){l.activeTouch&&(l.activeTouch.moved=!0)}),je(l.scroller,"touchend",function(se){var ue=l.activeTouch;if(ue&&!cr(l,se)&&ue.left!=null&&!ue.moved&&new Date-ue.start<300){var De=e.coordsChar(l.activeTouch,"page"),Ue;!ue.prev||Z(ue,ue.prev)?Ue=new Zt(De,De):!ue.prev.prev||Z(ue,ue.prev.prev)?Ue=e.findWordAt(De):Ue=new Zt(ct(De.line,0),B(e.doc,ct(De.line+1,0))),e.setSelection(Ue.anchor,Ue.head),e.focus(),ee(se)}D()}),je(l.scroller,"touchcancel",D),je(l.scroller,"scroll",function(){l.scroller.clientHeight&&(xn(e,l.scroller.scrollTop),Ur(e,l.scroller.scrollLeft,!0),Pe(e,"scroll",e))}),je(l.scroller,"mousewheel",function(se){return Rs(e,se)}),je(l.scroller,"DOMMouseScroll",function(se){return Rs(e,se)}),je(l.wrapper,"scroll",function(){return l.wrapper.scrollTop=l.wrapper.scrollLeft=0}),l.dragFunctions={enter:function(se){Fe(e,se)||me(se)},over:function(se){Fe(e,se)||(Ll(e,se),me(se))},start:function(se){return Al(e,se)},drop:vi(e,Cl),leave:function(se){Fe(e,se)||ro(e)}};var ie=l.input.getField();je(ie,"keyup",function(se){return mo.call(e,se)}),je(ie,"keydown",vi(e,po)),je(ie,"keypress",vi(e,go)),je(ie,"focus",function(se){return wa(e,se)}),je(ie,"blur",function(se){return Zr(e,se)})}var Wa=[];ni.defineInitHook=function(e){return Wa.push(e)};function Bn(e,l,w,x){var D=e.doc,W;w==null&&(w="add"),w=="smart"&&(D.mode.indent?W=mt(e,l).state:w="prev");var Z=e.options.tabSize,ie=bt(D,l),se=z(ie.text,null,Z);ie.stateAfter&&(ie.stateAfter=null);var ue=ie.text.match(/^\s*/)[0],De;if(!x&&!/\S/.test(ie.text))De=0,w="not";else if(w=="smart"&&(De=D.mode.indent(W,ie.text.slice(ue.length),ie.text),De==We||De>150)){if(!x)return;w="prev"}w=="prev"?l>D.first?De=z(bt(D,l-1).text,null,Z):De=0:w=="add"?De=se+e.options.indentUnit:w=="subtract"?De=se-e.options.indentUnit:typeof w=="number"&&(De=se+w),De=Math.max(0,De);var Ue="",qe=0;if(e.options.indentWithTabs)for(var Ze=Math.floor(De/Z);Ze;--Ze)qe+=Z,Ue+=" ";if(qe<De&&(Ue+=Se(De-qe)),Ue!=ue)return rn(D,Ue,ct(l,0),ct(l,ue.length),"+input"),ie.stateAfter=null,!0;for(var rt=0;rt<D.sel.ranges.length;rt++){var lt=D.sel.ranges[rt];if(lt.head.line==l&<.head.ch<ue.length){var ft=ct(l,ue.length);Na(D,rt,new Zt(ft,ft));break}}}var ir=null;function sa(e){ir=e}function Xa(e,l,w,x,D){var W=e.doc;e.display.shift=!1,x||(x=W.sel);var Z=+new Date-200,ie=D=="paste"||e.state.pasteIncoming>Z,se=ht(l),ue=null;if(ie&&x.ranges.length>1)if(ir&&ir.text.join(`
|
|
|
`)==l){if(x.ranges.length%ir.text.length==0){ue=[];for(var De=0;De<ir.text.length;De++)ue.push(W.splitLines(ir.text[De]))}}else se.length==x.ranges.length&&e.options.pasteLinesPerSelection&&(ue=Ie(se,function(_t){return[_t]}));for(var Ue=e.curOp.updateInput,qe=x.ranges.length-1;qe>=0;qe--){var Ze=x.ranges[qe],rt=Ze.from(),lt=Ze.to();Ze.empty()&&(w&&w>0?rt=ct(rt.line,rt.ch-w):e.state.overwrite&&!ie?lt=ct(lt.line,Math.min(bt(W,lt.line).text.length,lt.ch+he(se).length)):ie&&ir&&ir.lineWise&&ir.text.join(`
|
|
|
`)==se.join(`
|
|
|
`)&&(rt=lt=ct(rt.line,0)));var ft={from:rt,to:lt,text:ue?ue[qe%ue.length]:se,origin:D||(ie?"paste":e.state.cutIncoming>Z?"cut":"+input")};tn(e.doc,ft),Ei(e,"inputRead",e,ft)}l&&!ie&&So(e,l),qr(e),e.curOp.updateInput<2&&(e.curOp.updateInput=Ue),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function wo(e,l){var w=e.clipboardData&&e.clipboardData.getData("Text");if(w)return e.preventDefault(),!l.isReadOnly()&&!l.options.disableInput&&Wi(l,function(){return Xa(l,w,0,null,"paste")}),!0}function So(e,l){if(!e.options.electricChars||!e.options.smartIndent)return;for(var w=e.doc.sel,x=w.ranges.length-1;x>=0;x--){var D=w.ranges[x];if(D.head.ch>100||x&&w.ranges[x-1].head.line==D.head.line)continue;var W=e.getModeAt(D.head),Z=!1;if(W.electricChars){for(var ie=0;ie<W.electricChars.length;ie++)if(l.indexOf(W.electricChars.charAt(ie))>-1){Z=Bn(e,D.head.line,"smart");break}}else W.electricInput&&(W.electricInput.test(bt(e.doc,D.head.line).text.slice(0,D.head.ch))&&(Z=Bn(e,D.head.line,"smart")));Z&&Ei(e,"electricInput",e,D.head.line)}}function To(e){for(var l=[],w=[],x=0;x<e.doc.sel.ranges.length;x++){var D=e.doc.sel.ranges[x].head.line,W={anchor:ct(D,0),head:ct(D+1,0)};w.push(W),l.push(e.getRange(W.anchor,W.head))}return{text:l,ranges:w}}function Co(e,l,w,x){e.setAttribute("autocorrect",w?"":"off"),e.setAttribute("autocapitalize",x?"":"off"),e.setAttribute("spellcheck",!!l)}function Ao(){var e=g("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),l=g("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return i?e.style.width="1000px":e.setAttribute("wrap","off"),r&&(e.style.border="1px solid black"),Co(e),l}function Jl(e){var l=e.optionHandlers,w=e.helpers={};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(x,D){var W=this.options,Z=W[x];if(W[x]==D&&x!="mode")return;W[x]=D,l.hasOwnProperty(x)&&vi(this,l[x])(this,D,Z),Pe(this,"optionChange",this,x)},getOption:function(x){return this.options[x]},getDoc:function(){return this.doc},addKeyMap:function(x,D){this.state.keyMaps[D?"push":"unshift"](ra(x))},removeKeyMap:function(x){for(var D=this.state.keyMaps,W=0;W<D.length;++W)if(D[W]==x||D[W].name==x)return D.splice(W,1),!0},addOverlay:ki(function(x,D){var W=x.token?x:e.getMode(this.options,x);if(W.startState)throw new Error("Overlays may not be stateful.");ye(this.state.overlays,{mode:W,modeSpec:x,opaque:D&&D.opaque,priority:D&&D.priority||0},function(Z){return Z.priority}),this.state.modeGen++,Ni(this)}),removeOverlay:ki(function(x){for(var D=this.state.overlays,W=0;W<D.length;++W){var Z=D[W].modeSpec;if(Z==x||typeof x=="string"&&Z.name==x){D.splice(W,1),this.state.modeGen++,Ni(this);return}}}),indentLine:ki(function(x,D,W){typeof D!="string"&&typeof D!="number"&&(D==null?D=this.options.smartIndent?"smart":"prev":D=D?"add":"subtract"),Di(this.doc,x)&&Bn(this,x,D,W)}),indentSelection:ki(function(x){for(var D=this.doc.sel.ranges,W=-1,Z=0;Z<D.length;Z++){var ie=D[Z];if(ie.empty())ie.head.line>W&&(Bn(this,ie.head.line,x,!0),W=ie.head.line,Z==this.doc.sel.primIndex&&qr(this));else{var se=ie.from(),ue=ie.to(),De=Math.max(W,se.line);W=Math.min(this.lastLine(),ue.line-(ue.ch?0:1))+1;for(var Ue=De;Ue<W;++Ue)Bn(this,Ue,x);var qe=this.doc.sel.ranges;se.ch==0&&D.length==qe.length&&qe[Z].from().ch>0&&Na(this.doc,Z,new Zt(se,qe[Z].to()),Ne)}}}),getTokenAt:function(x,D){return ri(this,x,D)},getLineTokens:function(x,D){return ri(this,ct(x),D,!0)},getTokenTypeAt:function(x){x=B(this.doc,x);var D=nt(this,bt(this.doc,x.line)),W=0,Z=(D.length-1)/2,ie=x.ch,se;if(ie==0)se=D[2];else for(;;){var ue=W+Z>>1;if((ue?D[ue*2-1]:0)>=ie)Z=ue;else if(D[ue*2+1]<ie)W=ue+1;else{se=D[ue*2+2];break}}var De=se?se.indexOf("overlay "):-1;return De<0?se:De==0?null:se.slice(0,De-1)},getModeAt:function(x){var D=this.doc.mode;return D.innerMode?e.innerMode(D,this.getTokenAt(x).state).mode:D},getHelper:function(x,D){return this.getHelpers(x,D)[0]},getHelpers:function(x,D){var W=[];if(!w.hasOwnProperty(D))return W;var Z=w[D],ie=this.getModeAt(x);if(typeof ie[D]=="string")Z[ie[D]]&&W.push(Z[ie[D]]);else if(ie[D])for(var se=0;se<ie[D].length;se++){var ue=Z[ie[D][se]];ue&&W.push(ue)}else ie.helperType&&Z[ie.helperType]?W.push(Z[ie.helperType]):Z[ie.name]&&W.push(Z[ie.name]);for(var De=0;De<Z._global.length;De++){var Ue=Z._global[De];Ue.pred(ie,this)&&de(W,Ue.val)==-1&&W.push(Ue.val)}return W},getStateAfter:function(x,D){var W=this.doc;return x=J(W,x==null?W.first+W.size-1:x),mt(this,x+1,D).state},cursorCoords:function(x,D){var W,Z=this.doc.sel.primary();return x==null?W=Z.head:typeof x=="object"?W=B(this.doc,x):W=x?Z.from():Z.to(),er(this,W,D||"page")},charCoords:function(x,D){return ma(this,B(this.doc,x),D||"page")},coordsChar:function(x,D){return x=ls(this,x,D||"page"),va(this,x.left,x.top)},lineAtHeight:function(x,D){return x=ls(this,{top:x,left:0},D||"page").top,di(this.doc,x+this.display.viewOffset)},heightAtLine:function(x,D,W){var Z=!1,ie;if(typeof x=="number"){var se=this.doc.first+this.doc.size-1;x<this.doc.first?x=this.doc.first:x>se&&(x=se,Z=!0),ie=bt(this.doc,x)}else ie=x;return jn(this,ie,{top:0,left:0},D||"page",W||Z).top+(Z?this.doc.height-Ji(ie):0)},defaultTextHeight:function(){return Yr(this.display)},defaultCharWidth:function(){return Qr(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(x,D,W,Z,ie){var se=this.display;x=er(this,B(this.doc,x));var ue=x.bottom,De=x.left;if(D.style.position="absolute",D.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(D),se.sizer.appendChild(D),Z=="over")ue=x.top;else if(Z=="above"||Z=="near"){var Ue=Math.max(se.wrapper.clientHeight,this.doc.height),qe=Math.max(se.sizer.clientWidth,se.lineSpace.clientWidth);(Z=="above"||x.bottom+D.offsetHeight>Ue)&&x.top>D.offsetHeight?ue=x.top-D.offsetHeight:x.bottom+D.offsetHeight<=Ue&&(ue=x.bottom),De+D.offsetWidth>qe&&(De=qe-D.offsetWidth)}D.style.top=ue+"px",D.style.left=D.style.right="",ie=="right"?(De=se.sizer.clientWidth-D.offsetWidth,D.style.right="0px"):(ie=="left"?De=0:ie=="middle"&&(De=(se.sizer.clientWidth-D.offsetWidth)/2),D.style.left=De+"px"),W&&Zo(this,{left:De,top:ue,right:De+D.offsetWidth,bottom:ue+D.offsetHeight})},triggerOnKeyDown:ki(po),triggerOnKeyPress:ki(go),triggerOnKeyUp:mo,triggerOnMouseDown:ki(vo),execCommand:function(x){if(Pn.hasOwnProperty(x))return Pn[x].call(null,this)},triggerElectric:ki(function(x){So(this,x)}),findPosH:function(x,D,W,Z){var ie=1;D<0&&(ie=-1,D=-D);for(var se=B(this.doc,x),ue=0;ue<D&&!(se=za(this.doc,se,ie,W,Z),se.hitSide);++ue);return se},moveH:ki(function(x,D){var W=this;this.extendSelectionsBy(function(Z){return W.display.shift||W.doc.extend||Z.empty()?za(W.doc,Z.head,x,D,W.options.rtlMoveVisually):x<0?Z.from():Z.to()},Ke)}),deleteH:ki(function(x,D){var W=this.doc.sel,Z=this.doc;W.somethingSelected()?Z.replaceSelection("",null,"+delete"):sn(this,function(ie){var se=za(Z,ie.head,x,D,!1);return x<0?{from:se,to:ie.head}:{from:ie.head,to:se}})}),findPosV:function(x,D,W,Z){var ie=1,se=Z;D<0&&(ie=-1,D=-D);for(var ue=B(this.doc,x),De=0;De<D;++De){var Ue=er(this,ue,"div");if(se==null?se=Ue.left:Ue.left=se,ue=Lo(this,Ue,ie,W),ue.hitSide)break}return ue},moveV:ki(function(x,D){var W=this,Z=this.doc,ie=[],se=!this.display.shift&&!Z.extend&&Z.sel.somethingSelected();if(Z.extendSelectionsBy(function(De){if(se)return x<0?De.from():De.to();var Ue=er(W,De.head,"div");De.goalColumn!=null&&(Ue.left=De.goalColumn),ie.push(Ue.left);var qe=Lo(W,Ue,x,D);return D=="page"&&De==Z.sel.primary()&&Ta(W,ma(W,qe,"div").top-Ue.top),qe},Ke),ie.length)for(var ue=0;ue<Z.sel.ranges.length;ue++)Z.sel.ranges[ue].goalColumn=ie[ue]}),findWordAt:function(x){var D=this.doc,W=bt(D,x.line).text,Z=x.ch,ie=x.ch;if(W){var se=this.getHelper(x,"wordChars");(x.sticky=="before"||ie==W.length)&&Z?--Z:++ie;for(var ue=W.charAt(Z),De=Qe(ue,se)?function(Ue){return Qe(Ue,se)}:/\s/.test(ue)?function(Ue){return/\s/.test(Ue)}:function(Ue){return!/\s/.test(Ue)&&!Qe(Ue)};Z>0&&De(W.charAt(Z-1));)--Z;for(;ie<W.length&&De(W.charAt(ie));)++ie}return new Zt(ct(x.line,Z),ct(x.line,ie))},toggleOverwrite:function(x){if(x!=null&&x==this.state.overwrite)return;(this.state.overwrite=!this.state.overwrite)?j(this.display.cursorDiv,"CodeMirror-overwrite"):y(this.display.cursorDiv,"CodeMirror-overwrite"),Pe(this,"overwriteToggle",this,this.state.overwrite)},hasFocus:function(){return this.display.input.getField()==X()},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:ki(function(x,D){bn(this,x,D)}),getScrollInfo:function(){var x=this.display.scroller;return{left:x.scrollLeft,top:x.scrollTop,height:x.scrollHeight-ar(this)-this.display.barHeight,width:x.scrollWidth-ar(this)-this.display.barWidth,clientHeight:da(this),clientWidth:Mr(this)}},scrollIntoView:ki(function(x,D){x==null?(x={from:this.doc.sel.primary().head,to:null},D==null&&(D=this.options.cursorScrollMargin)):typeof x=="number"?x={from:ct(x,0),to:null}:x.from==null&&(x={from:x,to:null}),x.to||(x.to=x.from),x.margin=D||0,x.from.line!=null?qo(this,x):ys(this,x.from,x.to,x.margin)}),setSize:ki(function(x,D){var W=this,Z=function(se){return typeof se=="number"||/^\d+$/.test(String(se))?se+"px":se};x!=null&&(this.display.wrapper.style.width=Z(x)),D!=null&&(this.display.wrapper.style.height=Z(D)),this.options.lineWrapping&&as(this);var ie=this.display.viewFrom;this.doc.iter(ie,this.display.viewTo,function(se){if(se.widgets){for(var ue=0;ue<se.widgets.length;ue++)if(se.widgets[ue].noHScroll){wr(W,ie,"widget");break}}++ie}),this.curOp.forceUpdate=!0,Pe(this,"refresh",this)}),operation:function(x){return Wi(this,x)},startOperation:function(){return Kr(this)},endOperation:function(){return Hr(this)},refresh:ki(function(){var x=this.display.cachedTextHeight;Ni(this),this.curOp.forceUpdate=!0,_n(this),bn(this,this.doc.scrollLeft,this.doc.scrollTop),La(this.display),(x==null||Math.abs(x-Yr(this.display))>.5||this.options.lineWrapping)&&xa(this),Pe(this,"refresh",this)}),swapDoc:ki(function(x){var D=this.doc;return D.cm=null,this.state.selectingText&&this.state.selectingText(),Ds(this,x),_n(this),this.display.input.reset(),bn(this,x.scrollLeft,x.scrollTop),this.curOp.forceScroll=!0,Ei(this,"swapDoc",this,D),D}),phrase:function(x){var D=this.options.phrases;return D&&Object.prototype.hasOwnProperty.call(D,x)?D[x]:x},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},Ee(e),e.registerHelper=function(x,D,W){w.hasOwnProperty(x)||(w[x]=e[x]={_global:[]}),w[x][D]=W},e.registerGlobalHelper=function(x,D,W,Z){e.registerHelper(x,D,Z),w[x]._global.push({pred:W,val:Z})}}function za(e,l,w,x,D){var W=l,Z=w,ie=bt(e,l.line),se=D&&e.direction=="rtl"?-w:w;function ue(){var xt=l.line+se;return xt<e.first||xt>=e.first+e.size?!1:(l=new ct(xt,l.ch,l.sticky),ie=bt(e,xt))}function De(xt){var yt;if(x=="codepoint"){var Et=ie.text.charCodeAt(l.ch+(x>0?0:-1));isNaN(Et)?yt=null:yt=new ct(l.line,Math.max(0,Math.min(ie.text.length,l.ch+w*(Et>=55296&&Et<56320?2:1))),-w)}else D?yt=Ml(e.cm,ie,l,w):yt=Ua(ie,l,w);if(yt==null)if(!xt&&ue())l=Ba(D,e.cm,ie,l.line,se);else return!1;else l=yt;return!0}if(x=="char"||x=="codepoint")De();else if(x=="column")De(!0);else if(x=="word"||x=="group")for(var Ue=null,qe=x=="group",Ze=e.cm&&e.cm.getHelper(l,"wordChars"),rt=!0;!(w<0&&!De(!rt));rt=!1){var lt=ie.text.charAt(l.ch)||`
|
|
|
`,ft=Qe(lt,Ze)?"w":qe&<==`
|
|
|
`?"n":!qe||/\s/.test(lt)?null:"p";if(qe&&!rt&&!ft&&(ft="s"),Ue&&Ue!=ft){w<0&&(w=1,De(),l.sticky="after");break}if(ft&&(Ue=ft),w>0&&!De(!rt))break}var _t=ea(e,l,W,Z,!0);return pr(W,_t)&&(_t.hitSide=!0),_t}function Lo(e,l,w,x){var D=e.doc,W=l.left,Z;if(x=="page"){var ie=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),se=Math.max(ie-.5*Yr(e.display),3);Z=(w>0?l.bottom:l.top)+w*se}else x=="line"&&(Z=w>0?l.bottom+3:l.top-3);for(var ue;!(ue=va(e,W,Z),!ue.outside);){if(w<0?Z<=0:Z>=D.height){ue.hitSide=!0;break}Z+=w*5}return ue}var Jt=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new te,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};Jt.prototype.init=function(e){var l=this,w=this,x=w.cm,D=w.div=e.lineDiv;Co(D,x.options.spellcheck,x.options.autocorrect,x.options.autocapitalize);function W(ie){for(var se=ie.target;se;se=se.parentNode){if(se==D)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(se.className))break}return!1}je(D,"paste",function(ie){if(!W(ie)||Fe(x,ie)||wo(ie,x))return;b<=11&&setTimeout(vi(x,function(){return l.updateFromDOM()}),20)}),je(D,"compositionstart",function(ie){l.composing={data:ie.data,done:!1}}),je(D,"compositionupdate",function(ie){l.composing||(l.composing={data:ie.data,done:!1})}),je(D,"compositionend",function(ie){l.composing&&(ie.data!=l.composing.data&&l.readFromDOMSoon(),l.composing.done=!0)}),je(D,"touchstart",function(){return w.forceCompositionEnd()}),je(D,"input",function(){l.composing||l.readFromDOMSoon()});function Z(ie){if(!W(ie)||Fe(x,ie))return;if(x.somethingSelected())sa({lineWise:!1,text:x.getSelections()}),ie.type=="cut"&&x.replaceSelection("",null,"cut");else if(x.options.lineWiseCopyCut){var se=To(x);sa({lineWise:!0,text:se.text}),ie.type=="cut"&&x.operation(function(){x.setSelections(se.ranges,0,Ne),x.replaceSelection("",null,"cut")})}else return;if(ie.clipboardData){ie.clipboardData.clearData();var ue=ir.text.join(`
|
|
|
`);if(ie.clipboardData.setData("Text",ue),ie.clipboardData.getData("Text")==ue){ie.preventDefault();return}}var De=Ao(),Ue=De.firstChild;x.display.lineSpace.insertBefore(De,x.display.lineSpace.firstChild),Ue.value=ir.text.join(`
|
|
|
`);var qe=document.activeElement;K(Ue),setTimeout(function(){x.display.lineSpace.removeChild(De),qe.focus(),qe==D&&w.showPrimarySelection()},50)}je(D,"copy",Z),je(D,"cut",Z)},Jt.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},Jt.prototype.prepareSelection=function(){var e=ps(this.cm,!1);return e.focus=document.activeElement==this.div,e},Jt.prototype.showSelection=function(e,l){if(!e||!this.cm.display.view.length)return;(e.focus||l)&&this.showPrimarySelection(),this.showMultipleSelections(e)},Jt.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},Jt.prototype.showPrimarySelection=function(){var e=this.getSelection(),l=this.cm,w=l.doc.sel.primary(),x=w.from(),D=w.to();if(l.display.viewTo==l.display.viewFrom||x.line>=l.display.viewTo||D.line<l.display.viewFrom){e.removeAllRanges();return}var W=oa(l,e.anchorNode,e.anchorOffset),Z=oa(l,e.focusNode,e.focusOffset);if(W&&!W.bad&&Z&&!Z.bad&&Dt(vr(W,Z),x)==0&&Dt(gr(W,Z),D)==0)return;var ie=l.display.view,se=x.line>=l.display.viewFrom&&Ro(l,x)||{node:ie[0].measure.map[2],offset:0},ue=D.line<l.display.viewTo&&Ro(l,D);if(!ue){var De=ie[ie.length-1].measure,Ue=De.maps?De.maps[De.maps.length-1]:De.map;ue={node:Ue[Ue.length-1],offset:Ue[Ue.length-2]-Ue[Ue.length-3]}}if(!se||!ue){e.removeAllRanges();return}var qe=e.rangeCount&&e.getRangeAt(0),Ze;try{Ze=P(se.node,se.offset,ue.offset,ue.node)}catch(rt){}Ze&&(!I&&l.state.focused?(e.collapse(se.node,se.offset),Ze.collapsed||(e.removeAllRanges(),e.addRange(Ze))):(e.removeAllRanges(),e.addRange(Ze)),qe&&e.anchorNode==null?e.addRange(qe):I&&this.startGracePeriod()),this.rememberSelection()},Jt.prototype.startGracePeriod=function(){var e=this;clearTimeout(this.gracePeriod),this.gracePeriod=setTimeout(function(){e.gracePeriod=!1,e.selectionChanged()&&e.cm.operation(function(){return e.cm.curOp.selectionChanged=!0})},20)},Jt.prototype.showMultipleSelections=function(e){O(this.cm.display.cursorDiv,e.cursors),O(this.cm.display.selectionDiv,e.selection)},Jt.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},Jt.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var l=e.getRangeAt(0).commonAncestorContainer;return N(this.div,l)},Jt.prototype.focus=function(){this.cm.options.readOnly!="nocursor"&&((!this.selectionInEditor()||document.activeElement!=this.div)&&this.showSelection(this.prepareSelection(),!0),this.div.focus())},Jt.prototype.blur=function(){this.div.blur()},Jt.prototype.getField=function(){return this.div},Jt.prototype.supportsTouch=function(){return!0},Jt.prototype.receivedFocus=function(){var e=this;this.selectionInEditor()?this.pollSelection():Wi(this.cm,function(){return e.cm.curOp.selectionChanged=!0});function l(){e.cm.state.focused&&(e.pollSelection(),e.polling.set(e.cm.options.pollInterval,l))}this.polling.set(this.cm.options.pollInterval,l)},Jt.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},Jt.prototype.pollSelection=function(){if(this.readDOMTimeout!=null||this.gracePeriod||!this.selectionChanged())return;var e=this.getSelection(),l=this.cm;if(s&&o&&this.cm.display.gutterSpecs.length&&eu(e.anchorNode)){this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),this.focus();return}if(this.composing)return;this.rememberSelection();var w=oa(l,e.anchorNode,e.anchorOffset),x=oa(l,e.focusNode,e.focusOffset);w&&x&&Wi(l,function(){Li(l.doc,Tr(w,x),Ne),(w.bad||x.bad)&&(l.curOp.selectionChanged=!0)})},Jt.prototype.pollContent=function(){this.readDOMTimeout!=null&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e=this.cm,l=e.display,w=e.doc.sel.primary(),x=w.from(),D=w.to();if(x.ch==0&&x.line>e.firstLine()&&(x=ct(x.line-1,bt(e.doc,x.line-1).length)),D.ch==bt(e.doc,D.line).text.length&&D.line<e.lastLine()&&(D=ct(D.line+1,0)),x.line<l.viewFrom||D.line>l.viewTo-1)return!1;var W,Z,ie;x.line==l.viewFrom||(W=Fr(e,x.line))==0?(Z=Pt(l.view[0].line),ie=l.view[0].node):(Z=Pt(l.view[W].line),ie=l.view[W-1].node.nextSibling);var se=Fr(e,D.line),ue,De;if(se==l.view.length-1?(ue=l.viewTo-1,De=l.lineDiv.lastChild):(ue=Pt(l.view[se+1].line)-1,De=l.view[se+1].node.previousSibling),!ie)return!1;for(var Ue=e.doc.splitLines(tu(e,ie,De,Z,ue)),qe=Si(e.doc,ct(Z,0),ct(ue,bt(e.doc,ue).text.length));Ue.length>1&&qe.length>1;)if(he(Ue)==he(qe))Ue.pop(),qe.pop(),ue--;else if(Ue[0]==qe[0])Ue.shift(),qe.shift(),Z++;else break;for(var Ze=0,rt=0,lt=Ue[0],ft=qe[0],_t=Math.min(lt.length,ft.length);Ze<_t&<.charCodeAt(Ze)==ft.charCodeAt(Ze);)++Ze;for(var xt=he(Ue),yt=he(qe),Et=Math.min(xt.length-(Ue.length==1?Ze:0),yt.length-(qe.length==1?Ze:0));rt<Et&&xt.charCodeAt(xt.length-rt-1)==yt.charCodeAt(yt.length-rt-1);)++rt;if(Ue.length==1&&qe.length==1&&Z==x.line)for(;Ze&&Ze>x.ch&&xt.charCodeAt(xt.length-rt-1)==yt.charCodeAt(yt.length-rt-1);)Ze--,rt++;Ue[Ue.length-1]=xt.slice(0,xt.length-rt).replace(/^\u200b+/,""),Ue[0]=Ue[0].slice(Ze).replace(/\u200b+$/,"");var kt=ct(Z,Ze),Lt=ct(ue,qe.length?he(qe).length-rt:0);if(Ue.length>1||Ue[0]||Dt(kt,Lt))return rn(e.doc,Ue,kt,Lt,"+input"),!0},Jt.prototype.ensurePolled=function(){this.forceCompositionEnd()},Jt.prototype.reset=function(){this.forceCompositionEnd()},Jt.prototype.forceCompositionEnd=function(){if(!this.composing)return;clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus()},Jt.prototype.readFromDOMSoon=function(){var e=this;if(this.readDOMTimeout!=null)return;this.readDOMTimeout=setTimeout(function(){if(e.readDOMTimeout=null,e.composing)if(e.composing.done)e.composing=null;else return;e.updateFromDOM()},80)},Jt.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&Wi(this.cm,function(){return Ni(e.cm)})},Jt.prototype.setUneditable=function(e){e.contentEditable="false"},Jt.prototype.onKeyPress=function(e){if(e.charCode==0||this.composing)return;e.preventDefault(),this.cm.isReadOnly()||vi(this.cm,Xa)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0)},Jt.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!="nocursor")},Jt.prototype.onContextMenu=function(){},Jt.prototype.resetPosition=function(){},Jt.prototype.needsContentAttribute=!0;function Ro(e,l){var w=fa(e,l.line);if(!w||w.hidden)return null;var x=bt(e.doc,l.line),D=es(w,x,l.line),W=Ye(x,e.doc.direction),Z="left";if(W){var ie=ae(W,l.ch);Z=ie%2?"right":"left"}var se=rs(D.map,l.ch,Z);return se.offset=se.collapse=="right"?se.end:se.start,se}function eu(e){for(var l=e;l;l=l.parentNode)if(/CodeMirror-gutter-wrapper/.test(l.className))return!0;return!1}function ln(e,l){return l&&(e.bad=!0),e}function tu(e,l,w,x,D){var W="",Z=!1,ie=e.doc.lineSeparator(),se=!1;function ue(Ze){return function(rt){return rt.id==Ze}}function De(){Z&&(W+=ie,se&&(W+=ie),Z=se=!1)}function Ue(Ze){Ze&&(De(),W+=Ze)}function qe(Ze){if(Ze.nodeType==1){var rt=Ze.getAttribute("cm-text");if(rt){Ue(rt);return}var lt=Ze.getAttribute("cm-marker"),ft;if(lt){var _t=e.findMarks(ct(x,0),ct(D+1,0),ue(+lt));_t.length&&(ft=_t[0].find(0))&&Ue(Si(e.doc,ft.from,ft.to).join(ie));return}if(Ze.getAttribute("contenteditable")=="false")return;var xt=/^(pre|div|p|li|table|br)$/i.test(Ze.nodeName);if(!/^br$/i.test(Ze.nodeName)&&Ze.textContent.length==0)return;xt&&De();for(var yt=0;yt<Ze.childNodes.length;yt++)qe(Ze.childNodes[yt]);/^(pre|p)$/i.test(Ze.nodeName)&&(se=!0),xt&&(Z=!0)}else Ze.nodeType==3&&Ue(Ze.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;!(qe(l),l==w);)l=l.nextSibling,se=!1;return W}function oa(e,l,w){var x;if(l==e.display.lineDiv){if(x=e.display.lineDiv.childNodes[w],!x)return ln(e.clipPos(ct(e.display.viewTo-1)),!0);l=null,w=0}else for(x=l;;x=x.parentNode){if(!x||x==e.display.lineDiv)return null;if(x.parentNode&&x.parentNode==e.display.lineDiv)break}for(var D=0;D<e.display.view.length;D++){var W=e.display.view[D];if(W.node==x)return iu(W,l,w)}}function iu(e,l,w){var x=e.text.firstChild,D=!1;if(!l||!N(x,l))return ln(ct(Pt(e.line),0),!0);if(l==x&&(D=!0,l=x.childNodes[w],w=0,!l)){var W=e.rest?he(e.rest):e.line;return ln(ct(Pt(W),W.text.length),D)}var Z=l.nodeType==3?l:null,ie=l;for(!Z&&l.childNodes.length==1&&l.firstChild.nodeType==3&&(Z=l.firstChild,w&&(w=Z.nodeValue.length));ie.parentNode!=x;)ie=ie.parentNode;var se=e.measure,ue=se.maps;function De(ft,_t,xt){for(var yt=-1;yt<(ue?ue.length:0);yt++)for(var Et=yt<0?se.map:ue[yt],kt=0;kt<Et.length;kt+=3){var Lt=Et[kt+2];if(Lt==ft||Lt==_t){var Kt=Pt(yt<0?e.line:e.rest[yt]),ti=Et[kt]+xt;return(xt<0||Lt!=ft)&&(ti=Et[kt+(xt?1:0)]),ct(Kt,ti)}}}var Ue=De(Z,ie,w);if(Ue)return ln(Ue,D);for(var qe=ie.nextSibling,Ze=Z?Z.nodeValue.length-w:0;qe;qe=qe.nextSibling){if(Ue=De(qe,qe.firstChild,0),Ue)return ln(ct(Ue.line,Ue.ch-Ze),D);Ze+=qe.textContent.length}for(var rt=ie.previousSibling,lt=w;rt;rt=rt.previousSibling){if(Ue=De(rt,rt.firstChild,-1),Ue)return ln(ct(Ue.line,Ue.ch+lt),D);lt+=rt.textContent.length}}var li=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new te,this.hasSelection=!1,this.composing=null};li.prototype.init=function(e){var l=this,w=this,x=this.cm;this.createField(e);var D=this.textarea;e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),r&&(D.style.width="0px"),je(D,"input",function(){E&&b>=9&&l.hasSelection&&(l.hasSelection=null),w.poll()}),je(D,"paste",function(Z){if(Fe(x,Z)||wo(Z,x))return;x.state.pasteIncoming=+new Date,w.fastPoll()});function W(Z){if(Fe(x,Z))return;if(x.somethingSelected())sa({lineWise:!1,text:x.getSelections()});else if(x.options.lineWiseCopyCut){var ie=To(x);sa({lineWise:!0,text:ie.text}),Z.type=="cut"?x.setSelections(ie.ranges,null,Ne):(w.prevInput="",D.value=ie.text.join(`
|
|
|
`),K(D))}else return;Z.type=="cut"&&(x.state.cutIncoming=+new Date)}je(D,"cut",W),je(D,"copy",W),je(e.scroller,"paste",function(Z){if(cr(e,Z)||Fe(x,Z))return;if(!D.dispatchEvent){x.state.pasteIncoming=+new Date,w.focus();return}var ie=new Event("paste");ie.clipboardData=Z.clipboardData,D.dispatchEvent(ie)}),je(e.lineSpace,"selectstart",function(Z){cr(e,Z)||ee(Z)}),je(D,"compositionstart",function(){var Z=x.getCursor("from");w.composing&&w.composing.range.clear(),w.composing={start:Z,range:x.markText(Z,x.getCursor("to"),{className:"CodeMirror-composing"})}}),je(D,"compositionend",function(){w.composing&&(w.poll(),w.composing.range.clear(),w.composing=null)})},li.prototype.createField=function(e){this.wrapper=Ao(),this.textarea=this.wrapper.firstChild},li.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},li.prototype.prepareSelection=function(){var e=this.cm,l=e.display,w=e.doc,x=ps(e);if(e.options.moveInputWithCursor){var D=er(e,w.sel.primary().head,"div"),W=l.wrapper.getBoundingClientRect(),Z=l.lineDiv.getBoundingClientRect();x.teTop=Math.max(0,Math.min(l.wrapper.clientHeight-10,D.top+Z.top-W.top)),x.teLeft=Math.max(0,Math.min(l.wrapper.clientWidth-10,D.left+Z.left-W.left))}return x},li.prototype.showSelection=function(e){var l=this.cm,w=l.display;O(w.cursorDiv,e.cursors),O(w.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},li.prototype.reset=function(e){if(this.contextMenuPending||this.composing)return;var l=this.cm;if(l.somethingSelected()){this.prevInput="";var w=l.getSelection();this.textarea.value=w,l.state.focused&&K(this.textarea),E&&b>=9&&(this.hasSelection=w)}else e||(this.prevInput=this.textarea.value="",E&&b>=9&&(this.hasSelection=null))},li.prototype.getField=function(){return this.textarea},li.prototype.supportsTouch=function(){return!1},li.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!u||X()!=this.textarea))try{this.textarea.focus()}catch(e){}},li.prototype.blur=function(){this.textarea.blur()},li.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},li.prototype.receivedFocus=function(){this.slowPoll()},li.prototype.slowPoll=function(){var e=this;if(this.pollingFast)return;this.polling.set(this.cm.options.pollInterval,function(){e.poll(),e.cm.state.focused&&e.slowPoll()})},li.prototype.fastPoll=function(){var e=!1,l=this;l.pollingFast=!0;function w(){var x=l.poll();!x&&!e?(e=!0,l.polling.set(60,w)):(l.pollingFast=!1,l.slowPoll())}l.polling.set(20,w)},li.prototype.poll=function(){var e=this,l=this.cm,w=this.textarea,x=this.prevInput;if(this.contextMenuPending||!l.state.focused||tt(w)&&!x&&!this.composing||l.isReadOnly()||l.options.disableInput||l.state.keySeq)return!1;var D=w.value;if(D==x&&!l.somethingSelected())return!1;if(E&&b>=9&&this.hasSelection===D||d&&/[\uf700-\uf7ff]/.test(D))return l.display.input.reset(),!1;if(l.doc.sel==l.display.selForContextMenu){var W=D.charCodeAt(0);if(W==8203&&!x&&(x="\u200B"),W==8666)return this.reset(),this.cm.execCommand("undo")}for(var Z=0,ie=Math.min(x.length,D.length);Z<ie&&x.charCodeAt(Z)==D.charCodeAt(Z);)++Z;return Wi(l,function(){Xa(l,D.slice(Z),x.length-Z,null,e.composing?"*compose":null),D.length>1e3||D.indexOf(`
|
|
|
`)>-1?w.value=e.prevInput="":e.prevInput=D,e.composing&&(e.composing.range.clear(),e.composing.range=l.markText(e.composing.start,l.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},li.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},li.prototype.onKeyPress=function(){E&&b>=9&&(this.hasSelection=null),this.fastPoll()},li.prototype.onContextMenu=function(e){var l=this,w=l.cm,x=w.display,D=l.textarea;l.contextMenuPending&&l.contextMenuPending();var W=Nr(w,e),Z=x.scroller.scrollTop;if(!W||h)return;var ie=w.options.resetSelectionOnContextMenu;ie&&w.doc.sel.contains(W)==-1&&vi(w,Li)(w.doc,Tr(W),Ne);var se=D.style.cssText,ue=l.wrapper.style.cssText,De=l.wrapper.offsetParent.getBoundingClientRect();l.wrapper.style.cssText="position: static",D.style.cssText=`position: absolute; width: 30px; height: 30px;
|
|
|
top: `+(e.clientY-De.top-5)+"px; left: "+(e.clientX-De.left-5)+`px;
|
|
|
z-index: 1000; background: `+(E?"rgba(255, 255, 255, .05)":"transparent")+`;
|
|
|
outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var Ue;i&&(Ue=window.scrollY),x.input.focus(),i&&window.scrollTo(null,Ue),x.input.reset(),w.somethingSelected()||(D.value=l.prevInput=" "),l.contextMenuPending=Ze,x.selForContextMenu=w.doc.sel,clearTimeout(x.detectingSelectAll);function qe(){if(D.selectionStart!=null){var lt=w.somethingSelected(),ft="\u200B"+(lt?D.value:"");D.value="\u21DA",D.value=ft,l.prevInput=lt?"":"\u200B",D.selectionStart=1,D.selectionEnd=ft.length,x.selForContextMenu=w.doc.sel}}function Ze(){if(l.contextMenuPending!=Ze)return;if(l.contextMenuPending=!1,l.wrapper.style.cssText=ue,D.style.cssText=se,E&&b<9&&x.scrollbars.setScrollTop(x.scroller.scrollTop=Z),D.selectionStart!=null){(!E||E&&b<9)&&qe();var lt=0,ft=function(){x.selForContextMenu==w.doc.sel&&D.selectionStart==0&&D.selectionEnd>0&&l.prevInput=="\u200B"?vi(w,Gs)(w):lt++<10?x.detectingSelectAll=setTimeout(ft,500):(x.selForContextMenu=null,x.input.reset())};x.detectingSelectAll=setTimeout(ft,200)}}if(E&&b>=9&&qe(),C){me(e);var rt=function(){ce(window,"mouseup",rt),setTimeout(Ze,20)};je(window,"mouseup",rt)}else setTimeout(Ze,50)},li.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},li.prototype.setUneditable=function(){},li.prototype.needsContentAttribute=!1;function ru(e,l){if(l=l?k(l):{},l.value=e.value,!l.tabindex&&e.tabIndex&&(l.tabindex=e.tabIndex),!l.placeholder&&e.placeholder&&(l.placeholder=e.placeholder),l.autofocus==null){var w=X();l.autofocus=w==e||e.getAttribute("autofocus")!=null&&w==document.body}function x(){e.value=ie.getValue()}var D;if(e.form&&(je(e.form,"submit",x),!l.leaveSubmitMethodAlone)){var W=e.form;D=W.submit;try{var Z=W.submit=function(){x(),W.submit=D,W.submit(),W.submit=Z}}catch(se){}}l.finishInit=function(se){se.save=x,se.getTextArea=function(){return e},se.toTextArea=function(){se.toTextArea=isNaN,x(),e.parentNode.removeChild(se.getWrapperElement()),e.style.display="",e.form&&(ce(e.form,"submit",x),!l.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=D))}},e.style.display="none";var ie=ni(function(se){return e.parentNode.insertBefore(se,e.nextSibling)},l);return ie}function nu(e){e.off=ce,e.on=je,e.wheelEventPixels=cl,e.Doc=Fi,e.splitLines=ht,e.countColumn=z,e.findColumn=He,e.isWordChar=Je,e.Pass=We,e.signal=Pe,e.Line=Dr,e.changeEnd=Cr,e.scrollbarModel=Es,e.Pos=ct,e.cmpPos=Dt,e.modes=St,e.mimeModes=vt,e.resolveMode=dt,e.getMode=Ut,e.modeExtensions=gt,e.extendMode=pt,e.copyState=Ct,e.startState=Xt,e.innerMode=It,e.commands=Pn,e.keyMap=dr,e.keyName=lo,e.isModifierKey=so,e.lookupKey=an,e.normalizeKeyMap=Dl,e.StringStream=At,e.SharedTextMarker=In,e.TextMarker=Lr,e.LineWidget=kn,e.e_preventDefault=ee,e.e_stopPropagation=oe,e.e_stop=me,e.addClass=j,e.contains=N,e.rmClass=y,e.keyNames=Rr}Ql(ni),Jl(ni);var au="iter insert remove copy getEditor constructor".split(" ");for(var la in Fi.prototype)Fi.prototype.hasOwnProperty(la)&&de(au,la)<0&&(ni.prototype[la]=function(e){return function(){return e.apply(this.doc,arguments)}}(Fi.prototype[la]));return Ee(Fi),ni.inputStyles={textarea:li,contenteditable:Jt},ni.defineMode=function(e){!ni.defaults.mode&&e!="null"&&(ni.defaults.mode=e),Bt.apply(this,arguments)},ni.defineMIME=Nt,ni.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),ni.defineMIME("text/plain","null"),ni.defineExtension=function(e,l){ni.prototype[e]=l},ni.defineDocExtension=function(e,l){Fi.prototype[e]=l},ni.fromTextArea=ru,nu(ni),ni.version="5.58.2",ni})},Y1PL:function(it,ne,q){"use strict";q.r(ne),q.d(ne,"ResizableTextArea",function(){return de});var G=q("wx14"),L=q("1OyB"),I=q("vuIU"),R=q("Ji7U"),M=q("LK+K"),p=q("q1tI"),E=q("VTBJ"),b=q("rePB"),i=q("Zm9Q"),c=q("Kwbf"),o=q("c+Xe"),h=q("m+aA"),n=q("bdgK"),a=new Map;function t(Ne){Ne.forEach(function(Le){var Ke,He=Le.target;(Ke=a.get(He))===null||Ke===void 0||Ke.forEach(function(Ae){return Ae(He)})})}var r=new n.default(t),s=null,u=null;function d(Ne,Le){a.has(Ne)||(a.set(Ne,new Set),r.observe(Ne)),a.get(Ne).add(Le)}function f(Ne,Le){a.has(Ne)&&(a.get(Ne).delete(Le),a.get(Ne).size||(r.unobserve(Ne),a.delete(Ne)))}var v=function(Ne){Object(R.a)(Ke,Ne);var Le=Object(M.a)(Ke);function Ke(){return Object(L.a)(this,Ke),Le.apply(this,arguments)}return Object(I.a)(Ke,[{key:"render",value:function(){return this.props.children}}]),Ke}(p.Component),m=p.createContext(null);function S(Ne){var Le=Ne.children,Ke=Ne.onBatchResize,He=p.useRef(0),Ae=p.useRef([]),Se=p.useContext(m),he=p.useCallback(function(Ie,ye,Ge){He.current+=1;var $e=He.current;Ae.current.push({size:Ie,element:ye,data:Ge}),Promise.resolve().then(function(){$e===He.current&&(Ke==null||Ke(Ae.current),Ae.current=[])}),Se==null||Se(Ie,ye,Ge)},[Ke,Se]);return p.createElement(m.Provider,{value:he},Le)}function C(Ne){var Le=Ne.children,Ke=Ne.disabled,He=p.useRef(null),Ae=p.useRef(null),Se=p.useContext(m),he=p.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),Ie=p.isValidElement(Le)&&Object(o.c)(Le),ye=Ie?Le.ref:null,Ge=p.useMemo(function(){return Object(o.a)(ye,He)},[ye,He]),$e=p.useRef(Ne);$e.current=Ne;var ze=p.useCallback(function(Je){var Qe=$e.current,fe=Qe.onResize,ge=Qe.data,xe=Je.getBoundingClientRect(),we=xe.width,Te=xe.height,re=Je.offsetWidth,ve=Je.offsetHeight,ae=Math.floor(we),Me=Math.floor(Te);if(he.current.width!==ae||he.current.height!==Me||he.current.offsetWidth!==re||he.current.offsetHeight!==ve){var Ye={width:ae,height:Me,offsetWidth:re,offsetHeight:ve};he.current=Ye;var et=re===Math.round(we)?we:re,je=ve===Math.round(Te)?Te:ve,ot=Object(E.a)(Object(E.a)({},Ye),{},{offsetWidth:et,offsetHeight:je});Se==null||Se(ot,Je,ge),fe&&Promise.resolve().then(function(){fe(ot,Je)})}},[]);return p.useEffect(function(){var Je=Object(h.a)(He.current)||Object(h.a)(Ae.current);return Je&&!Ke&&d(Je,ze),function(){return f(Je,ze)}},[He.current,Ke]),p.createElement(v,{ref:Ae},Ie?p.cloneElement(Le,{ref:Ge}):Le)}var _="rc-observer-key";function y(Ne){var Le=Ne.children,Ke=Object(i.a)(Le);return Ke.map(function(He,Ae){var Se=(He==null?void 0:He.key)||"".concat(_,"-").concat(Ae);return p.createElement(C,Object(G.a)({},Ne,{key:Se}),He)})}y.Collection=S;var T=y,O=q("bT9E"),g=q("TSYQ"),F=q.n(g),P=`
|
|
|
min-height:0 !important;
|
|
|
max-height:none !important;
|
|
|
height:0 !important;
|
|
|
visibility:hidden !important;
|
|
|
overflow:hidden !important;
|
|
|
position:absolute !important;
|
|
|
z-index:-1000 !important;
|
|
|
top:0 !important;
|
|
|
right:0 !important
|
|
|
`,N=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","font-variant","text-rendering","text-transform","width","text-indent","padding-left","padding-right","border-width","box-sizing","word-break"],X={},j;function A(Ne){var Le=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Ke=Ne.getAttribute("id")||Ne.getAttribute("data-reactid")||Ne.getAttribute("name");if(Le&&X[Ke])return X[Ke];var He=window.getComputedStyle(Ne),Ae=He.getPropertyValue("box-sizing")||He.getPropertyValue("-moz-box-sizing")||He.getPropertyValue("-webkit-box-sizing"),Se=parseFloat(He.getPropertyValue("padding-bottom"))+parseFloat(He.getPropertyValue("padding-top")),he=parseFloat(He.getPropertyValue("border-bottom-width"))+parseFloat(He.getPropertyValue("border-top-width")),Ie=N.map(function(Ge){return"".concat(Ge,":").concat(He.getPropertyValue(Ge))}).join(";"),ye={sizingStyle:Ie,paddingSize:Se,borderSize:he,boxSizing:Ae};return Le&&Ke&&(X[Ke]=ye),ye}function K(Ne){var Le=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Ke=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,He=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;j||(j=document.createElement("textarea"),j.setAttribute("tab-index","-1"),j.setAttribute("aria-hidden","true"),document.body.appendChild(j)),Ne.getAttribute("wrap")?j.setAttribute("wrap",Ne.getAttribute("wrap")):j.removeAttribute("wrap");var Ae=A(Ne,Le),Se=Ae.paddingSize,he=Ae.borderSize,Ie=Ae.boxSizing,ye=Ae.sizingStyle;j.setAttribute("style","".concat(ye,";").concat(P)),j.value=Ne.value||Ne.placeholder||"";var Ge=Number.MIN_SAFE_INTEGER,$e=Number.MAX_SAFE_INTEGER,ze=j.scrollHeight,Je;if(Ie==="border-box"?ze+=he:Ie==="content-box"&&(ze-=Se),Ke!==null||He!==null){j.value=" ";var Qe=j.scrollHeight-Se;Ke!==null&&(Ge=Qe*Ke,Ie==="border-box"&&(Ge=Ge+Se+he),ze=Math.max(Ge,ze)),He!==null&&($e=Qe*He,Ie==="border-box"&&($e=$e+Se+he),Je=ze>$e?"":"hidden",ze=Math.min($e,ze))}return{height:ze,minHeight:Ge,maxHeight:$e,overflowY:Je,resize:"none"}}var U=q("Gytx"),k=q.n(U),z;(function(Ne){Ne[Ne.NONE=0]="NONE",Ne[Ne.RESIZING=1]="RESIZING",Ne[Ne.RESIZED=2]="RESIZED"})(z||(z={}));var te=function(Ne){Object(R.a)(Ke,Ne);var Le=Object(M.a)(Ke);function Ke(He){var Ae;return Object(L.a)(this,Ke),Ae=Le.call(this,He),Ae.nextFrameActionId=void 0,Ae.resizeFrameId=void 0,Ae.textArea=void 0,Ae.saveTextArea=function(Se){Ae.textArea=Se},Ae.handleResize=function(Se){var he=Ae.state.resizeStatus,Ie=Ae.props,ye=Ie.autoSize,Ge=Ie.onResize;if(he!==z.NONE)return;typeof Ge=="function"&&Ge(Se),ye&&Ae.resizeOnNextFrame()},Ae.resizeOnNextFrame=function(){cancelAnimationFrame(Ae.nextFrameActionId),Ae.nextFrameActionId=requestAnimationFrame(Ae.resizeTextarea)},Ae.resizeTextarea=function(){var Se=Ae.props.autoSize;if(!Se||!Ae.textArea)return;var he=Se.minRows,Ie=Se.maxRows,ye=K(Ae.textArea,!1,he,Ie);Ae.setState({textareaStyles:ye,resizeStatus:z.RESIZING},function(){cancelAnimationFrame(Ae.resizeFrameId),Ae.resizeFrameId=requestAnimationFrame(function(){Ae.setState({resizeStatus:z.RESIZED},function(){Ae.resizeFrameId=requestAnimationFrame(function(){Ae.setState({resizeStatus:z.NONE}),Ae.fixFirefoxAutoScroll()})})})})},Ae.renderTextArea=function(){var Se=Ae.props,he=Se.prefixCls,Ie=he===void 0?"rc-textarea":he,ye=Se.autoSize,Ge=Se.onResize,$e=Se.className,ze=Se.disabled,Je=Ae.state,Qe=Je.textareaStyles,fe=Je.resizeStatus,ge=Object(O.a)(Ae.props,["prefixCls","onPressEnter","autoSize","defaultValue","onResize"]),xe=F()(Ie,$e,Object(b.a)({},"".concat(Ie,"-disabled"),ze));"value"in ge&&(ge.value=ge.value||"");var we=Object(E.a)(Object(E.a)(Object(E.a)({},Ae.props.style),Qe),fe===z.RESIZING?{overflowX:"hidden",overflowY:"hidden"}:null);return p.createElement(T,{onResize:Ae.handleResize,disabled:!(ye||Ge)},p.createElement("textarea",Object(G.a)({},ge,{className:xe,style:we,ref:Ae.saveTextArea})))},Ae.state={textareaStyles:{},resizeStatus:z.NONE},Ae}return Object(I.a)(Ke,[{key:"componentDidUpdate",value:function(Ae){(Ae.value!==this.props.value||!k()(Ae.autoSize,this.props.autoSize))&&this.resizeTextarea()}},{key:"componentWillUnmount",value:function(){cancelAnimationFrame(this.nextFrameActionId),cancelAnimationFrame(this.resizeFrameId)}},{key:"fixFirefoxAutoScroll",value:function(){try{if(document.activeElement===this.textArea){var Ae=this.textArea.selectionStart,Se=this.textArea.selectionEnd;this.textArea.setSelectionRange(Ae,Se)}}catch(he){}}},{key:"render",value:function(){return this.renderTextArea()}}]),Ke}(p.Component),de=te,be=function(Ne){Object(R.a)(Ke,Ne);var Le=Object(M.a)(Ke);function Ke(He){var Ae;Object(L.a)(this,Ke),Ae=Le.call(this,He),Ae.resizableTextArea=void 0,Ae.focus=function(){Ae.resizableTextArea.textArea.focus()},Ae.saveTextArea=function(he){Ae.resizableTextArea=he},Ae.handleChange=function(he){var Ie=Ae.props.onChange;Ae.setValue(he.target.value,function(){Ae.resizableTextArea.resizeTextarea()}),Ie&&Ie(he)},Ae.handleKeyDown=function(he){var Ie=Ae.props,ye=Ie.onPressEnter,Ge=Ie.onKeyDown;he.keyCode===13&&ye&&ye(he),Ge&&Ge(he)};var Se=typeof He.value=="undefined"||He.value===null?He.defaultValue:He.value;return Ae.state={value:Se},Ae}return Object(I.a)(Ke,[{key:"setValue",value:function(Ae,Se){"value"in this.props||this.setState({value:Ae},Se)}},{key:"blur",value:function(){this.resizableTextArea.textArea.blur()}},{key:"render",value:function(){return p.createElement(de,Object(G.a)({},this.props,{value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,ref:this.saveTextArea}))}}],[{key:"getDerivedStateFromProps",value:function(Ae){return"value"in Ae?{value:Ae.value}:null}}]),Ke}(p.Component),We=ne.default=be},YJ9k:function(it,ne,q){"use strict";Object.defineProperty(ne,"__esModule",{value:!0}),ne.default=void 0;function G(M,p){if(!(M instanceof p))throw new TypeError("Cannot call a class as a function")}function L(M,p){for(var E=0;E<p.length;E++){var b=p[E];b.enumerable=b.enumerable||!1,b.configurable=!0,"value"in b&&(b.writable=!0),Object.defineProperty(M,b.key,b)}}function I(M,p,E){return p&&L(M.prototype,p),E&&L(M,E),M}var R=function(){function M(){G(this,M),this._listeners=new Map}return I(M,[{key:"addEventListener",value:function(E,b){this._listeners.has(E)||this._listeners.set(E,new Set),this._listeners.get(E).add(b)}},{key:"removeEventListener",value:function(E,b){this._listeners.has(E)&&this._listeners.get(E).delete(b)}},{key:"dispatchEvent",value:function(E){var b=this;return this._listeners.has(E.type)?(this._listeners.get(E.type).forEach(function(i){return i.call(b,E)}),!E.defaultPrevented):!0}}]),M}();ne.default=R},ZW9T:function(it,ne,q){"use strict";q.d(ne,"a",function(){return U});var G=q("k1fw"),L=q("oBTY"),I=q("miYZ"),R=q("tsqr"),M=q("rAM+"),p=q("tJVT"),E=q("PpiC"),b=q("q1tI"),i=q.n(b),c=q("bdgK"),o=q("9og8"),h=q("WmNS"),n=q.n(h),a={keywords:["print","auto","break","case","char","const","continue","default","do","double","else","enum","extern","float","for","goto","if","int","long","register","return","short","signed","sizeof","static","struct","switch","typedef","union","unsigned","void","volatile","while"]},t={quickKey:[{label:"main",content:["public static void main(String[] args) {"," $0","}"].join(`
|
|
|
`)},{label:"System.out.println",content:["System.out.println($0)"].join(`
|
|
|
`)},{label:"System.out.print",content:["System.out.print($0)"].join(`
|
|
|
`)}],keywords:["abstract","continue","for","new","switch","assert","default","goto","package","synchronized","boolean","do","if","private","this","break","double","implements","protected","throw","byte","else","import","public","throws","case","enum","instanceof","return","transient","catch","extends","int","short","try","char","final","interface","static","void","class","finally","long","strictfp","volatile","const","float","native","super","while","true","false"]},r={keywords:["abstract","amp","array","auto","bool","break","case","catch","char","class","const","constexpr","const_cast","continue","cpu","decltype","default","delegate","delete","do","double","dynamic_cast","each","else","enum","event","explicit","export","extern","false","final","finally","float","friend","gcnew","generic","goto","in","initonly","inline","int","interface","interior_ptr","internal","literal","long","mutable","namespace","new","noexcept","nullptr","__nullptr","operator","override","partial","pascal","pin_ptr","private","property","protected","public","ref","register","reinterpret_cast","restrict","return","safe_cast","sealed","short","signed","sizeof","static","static_assert","static_cast","struct","switch","template","this","thread_local","throw","tile_static","true","try","typedef","typeid","typename","union","unsigned","using","virtual","void","volatile","wchar_t","where","while","_asm","_based","_cdecl","_declspec","_fastcall","_if_exists","_if_not_exists","_inline","_multiple_inheritance","_pascal","_single_inheritance","_stdcall","_virtual_inheritance","_w64","__abstract","__alignof","__asm","__assume","__based","__box","__builtin_alignof","__cdecl","__clrcall","__declspec","__delegate","__event","__except","__fastcall","__finally","__forceinline","__gc","__hook","__identifier","__if_exists","__if_not_exists","__inline","__int128","__int16","__int32","__int64","__int8","__interface","__leave","__m128","__m128d","__m128i","__m256","__m256d","__m256i","__m64","__multiple_inheritance","__newslot","__nogc","__noop","__nounwind","__novtordisp","__pascal","__pin","__pragma","__property","__ptr32","__ptr64","__raise","__restrict","__resume","__sealed","__single_inheritance","__stdcall","__super","__thiscall","__try","__try_cast","__typeof","__unaligned","__unhook","__uuidof","__value","__virtual_inheritance","__w64","__wchar_t"],operators:["=",">","<","!","~","?",":","==","<=",">=","!=","&&","||","++","--","+","-","*","/","&","|","^","%","<<",">>",">>>","+=","-=","*=","/=","&=","|=","^=","%=","<<=",">>=",">>>="],quickKey:[{label:"ifelse",content:["if (${1:condition}) {"," $0","} else {"," ","}"].join(`
|
|
|
`)},{label:"include",content:"include<$0>"},{label:"printf",content:"printf($0)"},{label:"system",content:'system("$0")'},{label:"main",content:["int main () {"," $0","}"].join(`
|
|
|
`)},{label:"if",content:["if () {"," $0","}"].join(`
|
|
|
`)},{label:"for",content:["for(int j=0 ; j<10; j++){"," $0","}"].join(`
|
|
|
`)},{label:"trycatch",content:["try{"," $0","}catch(ExceptionName e){","}"].join(`
|
|
|
`)},{label:"using namespace std;",content:["using namespace std;"].join(`
|
|
|
`)},{label:"include <iostream>",content:["#include <iostream>"].join(`
|
|
|
`)},{label:"include <vector>",content:["#include <vector>"].join(`
|
|
|
`)},{label:"include <cstdio>",content:["#include <cstdio>"].join(`
|
|
|
`)},{label:"include <cstring>",content:["#include <cstring>"].join(`
|
|
|
`)},{label:"include <sstream>",content:["#include <sstream>"].join(`
|
|
|
`)},{label:"include <fstream>",content:["#include <fstream>"].join(`
|
|
|
`)},{label:"include <map>",content:["#include <map>"].join(`
|
|
|
`)},{label:"include <string>",content:["#include <string>"].join(`
|
|
|
`)},{label:"include <cmath>",content:["#include <cmath>"].join(`
|
|
|
`)}]},s={keywords:["and","as","assert","break","class","continue","def","del","elif","else","except","exec","finally","for","from","global","if","import","in","is","lambda","None","not","or","pass","raise","return","self","try","while","with","yield","int","float","long","complex","hex","abs","all","any","apply","basestring","bin","bool","buffer","bytearray","callable","chr","classmethod","cmp","coerce","compile","complex","delattr","dict","dir","divmod","enumerate","eval","execfile","file","filter","format","frozenset","getattr","globals","hasattr","hash","help","id","input","intern","isinstance","issubclass","iter","len","locals","list","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","reversed","range","raw_input","reduce","reload","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","unichr","unicode","vars","xrange","zip","True","False","__dict__","__methods__","__members__","__class__","__bases__","__name__","__mro__","__subclasses__","__init__","__import__"],quickKey:[{label:"print",content:["print($0)"].join(`
|
|
|
`)}]},u=q("5VLF"),d=q.n(u),f={languages:["c","abap","apex","azcli","bat","cameligo","clojure","coffee","cpp","csharp","csp","css","dockerfile","fsharp","go","graphql","handlebars","html","ini","java","javascript","json","kotlin","less","lua","markdown","mips","msdax","mysql","objective-c","pascal","pascaligo","perl","pgsql","php","postiats","powerquery","powershell","pug","python","r","razor","redis","redshift","restructuredtext","ruby","rust","sb","scheme","scss","shell","solidity","sophia","sql","st","swift","tcl","twig","vb","xml","yaml'"],tables:{users:["name","id","email","phone","password"],roles:["id","name","order","created_at","updated_at","deleted_at"]}},v=function(z,te){return te.map(function(de){return{label:de,kind:z.languages.CompletionItemKind.Keyword,insertText:de}})},m=function(z){return Object.keys(f.tables).map(function(te){return{label:te,kind:z.languages.CompletionItemKind.Variable,insertText:te}})},S=function(z,te){var de=f.tables[z];return de?de.map(function(be){return{label:be,kind:te.languages.CompletionItemKind.Field,insertText:be}}):[]};function C(k,z,te,de,be){var We=z.getWordUntilPosition(te),Ne={startLineNumber:te.lineNumber,endLineNumber:te.lineNumber,startColumn:We.startColumn,endColumn:We.endColumn},Le=de.map(function(Ke){return{label:Ke,kind:k.languages.CompletionItemKind.Keyword,insertText:Ke,insertTextRules:k.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Ne}});return be.map(function(Ke){Le.push(Object(G.a)(Object(G.a)({},Ke),{},{range:Ne}))}),Le}var _=function(k){f.languages.map(function(be){return k.languages.registerDocumentFormattingEditProvider(be,{provideDocumentFormattingEdits:function(Ne,Le,Ke){return Object(o.a)(n.a.mark(function He(){var Ae;return n.a.wrap(function(he){for(;;)switch(he.prev=he.next){case 0:return Ae=d()(Ne.getValue(),{indent_size:"2",indent_char:" ",max_preserve_newlines:"2",preserve_newlines:!0,keep_array_indentation:!0,break_chained_methods:!1,indent_scripts:"normal",brace_style:"collapse",space_before_conditional:!0,unescape_strings:!1,jslint_happy:!1,end_with_newline:!0,wrap_line_length:"0",indent_inner_html:!1,comma_first:!1,e4x:!1,indent_empty_lines:!1}),he.abrupt("return",[{range:Ne.getFullModelRange(),text:Ae}]);case 2:case"end":return he.stop()}},He)}))()}}),be});var z=r.quickKey.map(function(be){return{label:be.label,kind:k.languages.CompletionItemKind.Method,insertText:be.content,insertTextRules:k.languages.CompletionItemInsertTextRule.InsertAsSnippet}}),te=s.quickKey.map(function(be){return{label:be.label,kind:k.languages.CompletionItemKind.Method,insertText:be.content,insertTextRules:k.languages.CompletionItemInsertTextRule.InsertAsSnippet}}),de=t.quickKey.map(function(be){return{label:be.label,kind:k.languages.CompletionItemKind.Method,insertText:be.content,insertTextRules:k.languages.CompletionItemInsertTextRule.InsertAsSnippet}});k.languages.registerCompletionItemProvider("cpp",{provideCompletionItems:function(We,Ne){var Le=We.getWordUntilPosition(Ne),Ke={startLineNumber:Ne.lineNumber,endLineNumber:Ne.lineNumber,startColumn:Le.startColumn,endColumn:Le.endColumn},He=We.getLineContent(Ne.lineNumber).substring(Le.startColumn-2,Le.endColumn);return{suggestions:[].concat(Object(L.a)(r.keywords.map(function(Ae){return{label:Ae,kind:k.languages.CompletionItemKind.Function,documentation:Ae,insertText:Ae,insertTextRules:k.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Ke}})),Object(L.a)(r.quickKey.map(function(Ae){return{label:Ae.label,kind:k.languages.CompletionItemKind.Function,documentation:Ae.content,insertText:He.startsWith("#")?Ae.content.replace(/#/,""):Ae.content,insertTextRules:k.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Ke}})))}}}),k.languages.registerCompletionItemProvider("c",{provideCompletionItems:function(We,Ne){var Le=We.getWordUntilPosition(Ne),Ke={startLineNumber:Ne.lineNumber,endLineNumber:Ne.lineNumber,startColumn:Le.startColumn,endColumn:Le.endColumn};return{suggestions:Object(L.a)(a.keywords.map(function(He){return{label:He,kind:k.languages.CompletionItemKind.Function,documentation:He,insertText:He,insertTextRules:k.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Ke}}))}}}),k.languages.registerCompletionItemProvider("java",{provideCompletionItems:function(We,Ne){var Le=We.getWordUntilPosition(Ne),Ke={startLineNumber:Ne.lineNumber,endLineNumber:Ne.lineNumber,startColumn:Le.startColumn,endColumn:Le.endColumn},He=We.getLineContent(Ne.lineNumber).substring(Le.startColumn-2,Le.endColumn);return{suggestions:[].concat(Object(L.a)(t.keywords.map(function(Ae){return{label:Ae,kind:k.languages.CompletionItemKind.Function,documentation:Ae,insertText:Ae,insertTextRules:k.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Ke}})),Object(L.a)(t.quickKey.map(function(Ae){return{label:Ae.label,kind:k.languages.CompletionItemKind.Function,documentation:Ae.content,insertText:He.startsWith("#")?Ae.content.replace(/#/,""):Ae.content,insertTextRules:k.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Ke}})))}}}),k.languages.registerCompletionItemProvider("python",{provideCompletionItems:function(We,Ne){var Le=We.getWordUntilPosition(Ne),Ke={startLineNumber:Ne.lineNumber,endLineNumber:Ne.lineNumber,startColumn:Le.startColumn,endColumn:Le.endColumn},He=We.getLineContent(Ne.lineNumber).substring(Le.startColumn-2,Le.endColumn);return{suggestions:[].concat(Object(L.a)(s.keywords.map(function(Ae){return{label:Ae,kind:k.languages.CompletionItemKind.Function,documentation:Ae,insertText:Ae,insertTextRules:k.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Ke}})),Object(L.a)(s.quickKey.map(function(Ae){return{label:Ae.label,kind:k.languages.CompletionItemKind.Function,documentation:Ae.content,insertText:He.startsWith("#")?Ae.content.replace(/#/,""):Ae.content,insertTextRules:k.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Ke}})))}}})},y="\u8BE5\u4EFB\u52A1\u5173\u5361\u8BBE\u7F6E\u4E86\u7981\u6B62\u590D\u5236\u7C98\u8D34\uFF0C\u8BF7\u624B\u52A8\u8F93\u5165\u4EE3\u7801\u3002",T=q("fjLI"),O=q("LvDl"),g=q("+ua5");function F(k){return/^\d+$/.test(k)?"".concat(k,"px"):k}function P(){}var N=!1,X={"Python3.6":"python","Python2.7":"python",Dynamips:"cpp",Java:"java",Web:"php",Html:"html",Hive:"sql",Hadoop:"java",SDL:"cpp",PHP:"php",Matlab:"python",Git:"python",Python:"python","C/C++":"cpp","C++":"cpp",C:"cpp",Ruby:"ruby",Shell:"shell",JavaScript:"javascript",Perl6:"perl",Kotlin:"kotlin",Elixir:"elixir",Android:"java",JavaWeb:"java",Go:"go",Spark:"sql",MachineLearning:"python",Verilog:"xml","Verilog/VNC":"xml",Docker:"dockerfile","C#":"csharp",SQLite3:"sql",Oracle:"sql",Vhdl:"vhdl",R:"r",Swift:"swift",SQLServer:"mysql",MySQL:"mysql",Mongo:"sql",PostgreSql:"pgsql",Hbase:"powershell",Sqoop:"sql",Nasm:"cpp",Kafka:"java",Flink:"java",Sml:"javascript",OpenGL:"cpp",Perl5:"perl",Orange:"python"};function j(){var k=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],z=k;if(Array.isArray(k)){for(var te=0;te<k.length;te++){var de=X[k[te]];if(de)return de}return z[0]}return X[z]||z}var A=null,K=ne.b=function(k){var z=k.width,te=z===void 0?"100%":z,de=k.height,be=de===void 0?"100%":de,We=k.value,Ne=k.language,Le=Ne===void 0?"javascript":Ne,Ke=k.style,He=Ke===void 0?{}:Ke,Ae=k.options,Se=Ae===void 0?{}:Ae,he=k.overrideServices,Ie=he===void 0?{}:he,ye=k.theme,Ge=ye===void 0?"vs-dark":ye,$e=k.onEditBlur,ze=k.onSave,Je=k.autoHeight,Qe=Je===void 0?!1:Je,fe=k.forbidCopy,ge=fe===void 0?!1:fe,xe=k.onChange,we=xe===void 0?P:xe,Te=k.editorDidMount,re=Te===void 0?P:Te,ve=k.onFocus,ae=ve===void 0?P:ve,Me=k.filename,Ye=Me===void 0?"educoder.txt":Me,et=k.errorLine,je=k.errorContent,ot=je===void 0?"":je,ce=Object(E.a)(k,["width","height","value","language","style","options","overrideServices","theme","onEditBlur","onSave","autoHeight","forbidCopy","onChange","editorDidMount","onFocus","filename","errorLine","errorContent"]),Pe=Object(b.useRef)(),Fe=Object(b.useRef)({}),Ce=Object(b.useRef)(),_e=Object(b.useRef)(),Ee=Object(b.useRef)(!1),ee=Object(b.useRef)(),oe=Object(b.useState)(!1),Q=Object(p.a)(oe,2),me=Q[0],Oe=Q[1];function V(){var gt;return Pe.current&&(gt=new c.default(function(pt){var Ct=Object(M.a)(pt),It;try{for(Ct.s();!(It=Ct.n()).done;){var Xt=It.value;(Xt.target.offsetHeight>0||Xt.target.offsetWidth>0)&&Fe.current.instance.layout()}}catch(At){Ct.e(At)}finally{Ct.f()}}),gt.observe(Pe.current)),gt}function Re(){R.b.warn(decodeURIComponent(y))}var Xe=function(){var pt=Fe.current.instance;if(We!=null&&pt&&me){var Ct=pt.getModel();Ct&&We!==Ct.getValue()&&(N=!0,Ct.setValue(We),pt.layout(),N=!1)}};Object(b.useEffect)(function(){_e.current&&clearTimeout(_e.current),_e.current=setTimeout(function(){Xe()},500)},[We,me,Fe.current]),Object(b.useEffect)(function(){if(et&&Fe.current&&Fe.current.instance){var gt=Fe.current.instance;gt.changeViewZones(function(Ct){var It=document.createElement("div");It.style.padding="10px 20px",It.style.width="calc(100% - 20px)",It.className="my-error-line-wrp",It.innerHTML=ot,Ct.addZone({afterLineNumber:et||11,heightInLines:3,domNode:It})});var pt={domNode:null,getId:function(){return"my.overlay.widget"},getDomNode:function(){return this.domNode||(this.domNode=document.createElement("div"),this.domNode.innerHTML="",this.domNode.style.width="100%",this.domNode.style.padding="20px 100px",this.domNode.style.right="0px",this.domNode.style.top="50px",this.domNode.style.position="relative",this.domNode.style.color="#333"),this.domNode},getPosition:function(){return null}};gt.addOverlayWidget(pt),gt.revealPositionInCenter({lineNumber:20,column:1})}},[et,Fe.current,me]);function pe(){var gt=Fe.current.instance;if(gt){var pt=gt.getSelection(),Ct=Fe.current.pastePos||{},It=new A.Range(Ct.startLineNumber||pt.endLineNumber,Ct.startColumn||pt.endColumn,Ct.endLineNumber||pt.endLineNumber,Ct.endColumn||pt.endColumn);setTimeout(function(){gt.executeEdits("",[{range:It,text:""}])},300)}}function ke(gt){(window.navigator.platform.match("Mac")?gt.metaKey:gt.ctrlKey)&>.keyCode==83&&(gt.preventDefault(),ze())}var Ve=function(){if(Qe&&Fe.current.instance){var pt=Fe.current.instance.getContentHeight();dt(pt<be?be:pt)}else dt(be)};function ht(gt){var pt=document.createEvent("MouseEvents");pt.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),gt.dispatchEvent(pt)}function tt(gt,pt){var Ct=window.URL||window.webkitURL||window,It=new Blob([pt]),Xt=document.createElementNS("http://www.w3.org/1999/xhtml","a");Xt.href=Ct.createObjectURL(It),Xt.download=gt,ht(Xt)}Object(b.useEffect)(function(){Ve()},[Ve]),Object(b.useEffect)(function(){Pe.current&&!me&&Promise.all([q.e(17),q.e(28)]).then(q.t.bind(null,"M/lh",7)).then(function(gt){try{A=gt,Fe.current.instance=A.editor.create(Pe.current,{value:We,language:j(Le),theme:Ge,requireConfig:{"vs/nls":{availableLanguages:{"*":"zh-cn"}}},wordWrap:!0,autoIndent:!0,contextmenu:!0,formatOnType:!0},Ie);var pt=Fe.current.instance,Ct=T.d._menuItems,It=Object(L.a)(Ct).find(function(qt){return qt[0]._debugName=="EditorContext"}),Xt=It[1],At=["editor.action.clipboardCopyWithSyntaxHighlightingAction","editor.action.quickCommand","editor.action.clipboardCopyAction","editor.action.clipboardPasteAction","editor.action.clipboardCutAction"],bt=function(ii,Pt){var di=ii._first;do{var Di,Yi,ct=Pt.includes((Di=di.element)===null||Di===void 0||((Yi=Di.command)===null||Yi===void 0)?void 0:Yi.id);ct&&ii._remove(di)}while(di=di.next)};if(re(pt,A),setTimeout(function(){Ve(),Fe.current.instance.addAction({id:"d123123",label:"Download File",contextMenuGroupId:"9_cutcopypaste",run:function(){tt(Ye||"educoder.txt",pt.getValue())}}),pt.getDomNode().addEventListener("input",function(){Ce.current.autoFormat&&pt.getAction("editor.action.formatDocument").run()})},500),Fe.current.subscription=pt.onDidChangeModelContent(function(qt){Ee.current?clearTimeout(ee.current):(Ve(),we(pt.getValue(),qt)),ee.current=setTimeout(function(){Ee.current=!1},500)}),window.Monaco||_(A,j(Le)),ge&&(bt(Xt,At),Pe.current.classList.add("noCopyPaste"),pt.onKeyDown(function(qt){var ii=qt.keyCode,Pt=qt.ctrlKey,di=qt.metaKey;(ii===33||ii===52)&&(di||Pt)&&(Re(),qt.preventDefault())})),window.Monaco=A,$e&&pt.onDidBlurEditorWidget(function(){$e(pt.getValue())}),ae&&pt.onDidFocusEditorText(function(){ae(pt.getValue())}),ge){pt.addCommand(A.KeyMod.CtrlCmd|A.KeyCode.KEY_V,function(){return Re(),null}),pt.onDidPaste(function(qt){Fe.current.pastePos=qt});try{window.addEventListener("paste",pe)}catch(qt){}}var Si=V();return Oe(!0),function(){var qt=Fe.current.instance;qt.dispose();var ii=qt.getModel();ii&&ii.dispose(),Fe.current.subscription&&Fe.current.subscription.dispose(),ge&&window.removeEventListener("paste",pe),Si.unobserve(Pe.current)}}catch(qt){}})},[]),Object(b.useEffect)(function(){var gt=Fe.current.instance;if(gt&&me)return document.addEventListener("keydown",ke,!1),function(){document.removeEventListener("keydown",ke)}},[ze,me]),Object(b.useEffect)(function(){var gt=Fe.current.instance;if(gt&&me){var pt=j(Le);A.editor.setModelLanguage(gt.getModel(),pt),console.log("language:",Le,gt.getModel(),pt)}},[Le,me]),Object(b.useEffect)(function(){var gt=Fe.current.instance;gt&&me&&A.editor.setTheme(Ge)},[Ge,me]),Object(b.useEffect)(function(){var gt=Fe.current.instance;Ce.current=Se,gt&&me&&(gt.updateOptions(Object(G.a)({},Se)),setTimeout(function(){gt.getModel().updateOptions(Object(G.a)({},Se))},200))},[JSON.stringify(Se),me]),Object(b.useEffect)(function(){var gt=Fe.current.instance;gt&&me&>.layout()},[te,be,me]);var at=Object(b.useState)(F(te)),ut=Object(p.a)(at,2),Ft=ut[0],St=ut[1],vt=Object(b.useState)(F(be)),Bt=Object(p.a)(vt,2),Nt=Bt[0],dt=Bt[1],Ut=Object(G.a)(Object(G.a)({},He),{},{width:Ft,height:Nt});return i.a.createElement("div",{className:"my-monaco-editor",ref:Pe,style:Ut})};function U(k){var z=k.width,te=z===void 0?"100%":z,de=k.height,be=de===void 0?"100%":de,We=k.original,Ne=k.modified,Le=k.language,Ke=k.options,He=Ke===void 0?{}:Ke,Ae=Object(b.useRef)(),Se=Object(b.useState)(null),he=Object(p.a)(Se,2),Ie=he[0],ye=he[1];function Ge(Qe){var fe;return Ae.current&&(fe=new c.default(function(ge){var xe=Object(M.a)(ge),we;try{for(xe.s();!(we=xe.n()).done;){var Te=we.value;(Te.target.offsetHeight>0||Te.target.offsetWidth>0)&&Qe.layout()}}catch(re){xe.e(re)}finally{xe.f()}}),fe.observe(Ae.current)),fe}Object(b.useEffect)(function(){Ae.current&&Promise.all([q.e(17),q.e(28)]).then(q.t.bind(null,"M/lh",7)).then(function(Qe){A=Qe;var fe=A.editor.createDiffEditor(Ae.current,Object(G.a)(Object(G.a)({enableSplitViewResizing:!1,scrollBeyondLastLine:!1,roundedSelection:!1,renderIndicators:!1,useShadows:!1,horizontal:"hidden",lineNumbers:"off",ignoreTrimWhitespace:!1,followsCaret:!0,ignoreCharChanges:!0,minimap:{enabled:!1},readOnly:!0},He),{},{wordWrap:!0}));ye(fe);var ge=Ge(fe);return function(){fe.dispose();var xe=fe.getModel();xe&&xe.dispose(),ge.unobserve(Ae.current)}})},[]),Object(b.useEffect)(function(){Ie&&Ie.setModel({original:A.editor.createModel(We,Le),modified:A.editor.createModel(Ne,Le)})},[We,Ne,Le,Ie]);var $e=F(te),ze=F(be),Je={width:$e,height:ze};return i.a.createElement("div",{className:"my-diff-editor",ref:Ae,style:Je})}},ZpRC:function(it,ne,q){"use strict";function G(o){return typeof o=="object"&&o!=null&&o.nodeType===1}function L(o,h){return(!h||o!=="hidden")&&o!=="visible"&&o!=="clip"}function I(o,h){if(o.clientHeight<o.scrollHeight||o.clientWidth<o.scrollWidth){var n=getComputedStyle(o,null);return L(n.overflowY,h)||L(n.overflowX,h)||function(a){var t=function(r){if(!r.ownerDocument||!r.ownerDocument.defaultView)return null;try{return r.ownerDocument.defaultView.frameElement}catch(s){return null}}(a);return!!t&&(t.clientHeight<a.scrollHeight||t.clientWidth<a.scrollWidth)}(o)}return!1}function R(o,h,n,a,t,r,s,u){return r<o&&s>h||r>o&&s<h?0:r<=o&&u<=n||s>=h&&u>=n?r-o-a:s>h&&u<n||r<o&&u>n?s-h+t:0}var M=function(o,h){var n=window,a=h.scrollMode,t=h.block,r=h.inline,s=h.boundary,u=h.skipOverflowHiddenElements,d=typeof s=="function"?s:function(Qe){return Qe!==s};if(!G(o))throw new TypeError("Invalid target");for(var f=document.scrollingElement||document.documentElement,v=[],m=o;G(m)&&d(m);){if((m=m.parentElement)===f){v.push(m);break}m!=null&&m===document.body&&I(m)&&!I(document.documentElement)||m!=null&&I(m,u)&&v.push(m)}for(var S=n.visualViewport?n.visualViewport.width:innerWidth,C=n.visualViewport?n.visualViewport.height:innerHeight,_=window.scrollX||pageXOffset,y=window.scrollY||pageYOffset,T=o.getBoundingClientRect(),O=T.height,g=T.width,F=T.top,P=T.right,N=T.bottom,X=T.left,j=t==="start"||t==="nearest"?F:t==="end"?N:F+O/2,A=r==="center"?X+g/2:r==="end"?P:X,K=[],U=0;U<v.length;U++){var k=v[U],z=k.getBoundingClientRect(),te=z.height,de=z.width,be=z.top,We=z.right,Ne=z.bottom,Le=z.left;if(a==="if-needed"&&F>=0&&X>=0&&N<=C&&P<=S&&F>=be&&N<=Ne&&X>=Le&&P<=We)return K;var Ke=getComputedStyle(k),He=parseInt(Ke.borderLeftWidth,10),Ae=parseInt(Ke.borderTopWidth,10),Se=parseInt(Ke.borderRightWidth,10),he=parseInt(Ke.borderBottomWidth,10),Ie=0,ye=0,Ge="offsetWidth"in k?k.offsetWidth-k.clientWidth-He-Se:0,$e="offsetHeight"in k?k.offsetHeight-k.clientHeight-Ae-he:0;if(f===k)Ie=t==="start"?j:t==="end"?j-C:t==="nearest"?R(y,y+C,C,Ae,he,y+j,y+j+O,O):j-C/2,ye=r==="start"?A:r==="center"?A-S/2:r==="end"?A-S:R(_,_+S,S,He,Se,_+A,_+A+g,g),Ie=Math.max(0,Ie+y),ye=Math.max(0,ye+_);else{Ie=t==="start"?j-be-Ae:t==="end"?j-Ne+he+$e:t==="nearest"?R(be,Ne,te,Ae,he+$e,j,j+O,O):j-(be+te/2)+$e/2,ye=r==="start"?A-Le-He:r==="center"?A-(Le+de/2)+Ge/2:r==="end"?A-We+Se+Ge:R(Le,We,de,He,Se+Ge,A,A+g,g);var ze=k.scrollLeft,Je=k.scrollTop;j+=Je-(Ie=Math.max(0,Math.min(Je+Ie,k.scrollHeight-te+$e))),A+=ze-(ye=Math.max(0,Math.min(ze+ye,k.scrollWidth-de+Ge)))}K.push({el:k,top:Ie,left:ye})}return K};function p(o){return o===Object(o)&&Object.keys(o).length!==0}function E(o,h){h===void 0&&(h="auto");var n="scrollBehavior"in document.body.style;o.forEach(function(a){var t=a.el,r=a.top,s=a.left;t.scroll&&n?t.scroll({top:r,left:s,behavior:h}):(t.scrollTop=r,t.scrollLeft=s)})}function b(o){return o===!1?{block:"end",inline:"nearest"}:p(o)?o:{block:"start",inline:"nearest"}}function i(o,h){var n=!o.ownerDocument.documentElement.contains(o);if(p(h)&&typeof h.behavior=="function")return h.behavior(n?[]:M(o,h));if(n)return;var a=b(h);return E(M(o,a),a.behavior)}var c=ne.a=i},Zss7:function(it,ne,q){var G;(function(L){var I=/^\s+/,R=/\s+$/,M=0,p=L.round,E=L.min,b=L.max,i=L.random;function c(he,Ie){if(he=he||"",Ie=Ie||{},he instanceof c)return he;if(!(this instanceof c))return new c(he,Ie);var ye=o(he);this._originalInput=he,this._r=ye.r,this._g=ye.g,this._b=ye.b,this._a=ye.a,this._roundA=p(100*this._a)/100,this._format=Ie.format||ye.format,this._gradientType=Ie.gradientType,this._r<1&&(this._r=p(this._r)),this._g<1&&(this._g=p(this._g)),this._b<1&&(this._b=p(this._b)),this._ok=ye.ok,this._tc_id=M++}c.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var he=this.toRgb();return(he.r*299+he.g*587+he.b*114)/1e3},getLuminance:function(){var he=this.toRgb(),Ie,ye,Ge,$e,ze,Je;return Ie=he.r/255,ye=he.g/255,Ge=he.b/255,Ie<=.03928?$e=Ie/12.92:$e=L.pow((Ie+.055)/1.055,2.4),ye<=.03928?ze=ye/12.92:ze=L.pow((ye+.055)/1.055,2.4),Ge<=.03928?Je=Ge/12.92:Je=L.pow((Ge+.055)/1.055,2.4),.2126*$e+.7152*ze+.0722*Je},setAlpha:function(he){return this._a=K(he),this._roundA=p(100*this._a)/100,this},toHsv:function(){var he=t(this._r,this._g,this._b);return{h:he.h*360,s:he.s,v:he.v,a:this._a}},toHsvString:function(){var he=t(this._r,this._g,this._b),Ie=p(he.h*360),ye=p(he.s*100),Ge=p(he.v*100);return this._a==1?"hsv("+Ie+", "+ye+"%, "+Ge+"%)":"hsva("+Ie+", "+ye+"%, "+Ge+"%, "+this._roundA+")"},toHsl:function(){var he=n(this._r,this._g,this._b);return{h:he.h*360,s:he.s,l:he.l,a:this._a}},toHslString:function(){var he=n(this._r,this._g,this._b),Ie=p(he.h*360),ye=p(he.s*100),Ge=p(he.l*100);return this._a==1?"hsl("+Ie+", "+ye+"%, "+Ge+"%)":"hsla("+Ie+", "+ye+"%, "+Ge+"%, "+this._roundA+")"},toHex:function(he){return s(this._r,this._g,this._b,he)},toHexString:function(he){return"#"+this.toHex(he)},toHex8:function(he){return u(this._r,this._g,this._b,this._a,he)},toHex8String:function(he){return"#"+this.toHex8(he)},toRgb:function(){return{r:p(this._r),g:p(this._g),b:p(this._b),a:this._a}},toRgbString:function(){return this._a==1?"rgb("+p(this._r)+", "+p(this._g)+", "+p(this._b)+")":"rgba("+p(this._r)+", "+p(this._g)+", "+p(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:p(U(this._r,255)*100)+"%",g:p(U(this._g,255)*100)+"%",b:p(U(this._b,255)*100)+"%",a:this._a}},toPercentageRgbString:function(){return this._a==1?"rgb("+p(U(this._r,255)*100)+"%, "+p(U(this._g,255)*100)+"%, "+p(U(this._b,255)*100)+"%)":"rgba("+p(U(this._r,255)*100)+"%, "+p(U(this._g,255)*100)+"%, "+p(U(this._b,255)*100)+"%, "+this._roundA+")"},toName:function(){return this._a===0?"transparent":this._a<1?!1:j[s(this._r,this._g,this._b,!0)]||!1},toFilter:function(he){var Ie="#"+d(this._r,this._g,this._b,this._a),ye=Ie,Ge=this._gradientType?"GradientType = 1, ":"";if(he){var $e=c(he);ye="#"+d($e._r,$e._g,$e._b,$e._a)}return"progid:DXImageTransform.Microsoft.gradient("+Ge+"startColorstr="+Ie+",endColorstr="+ye+")"},toString:function(he){var Ie=!!he;he=he||this._format;var ye=!1,Ge=this._a<1&&this._a>=0,$e=!Ie&&Ge&&(he==="hex"||he==="hex6"||he==="hex3"||he==="hex4"||he==="hex8"||he==="name");return $e?he==="name"&&this._a===0?this.toName():this.toRgbString():(he==="rgb"&&(ye=this.toRgbString()),he==="prgb"&&(ye=this.toPercentageRgbString()),(he==="hex"||he==="hex6")&&(ye=this.toHexString()),he==="hex3"&&(ye=this.toHexString(!0)),he==="hex4"&&(ye=this.toHex8String(!0)),he==="hex8"&&(ye=this.toHex8String()),he==="name"&&(ye=this.toName()),he==="hsl"&&(ye=this.toHslString()),he==="hsv"&&(ye=this.toHsvString()),ye||this.toHexString())},clone:function(){return c(this.toString())},_applyModification:function(he,Ie){var ye=he.apply(null,[this].concat([].slice.call(Ie)));return this._r=ye._r,this._g=ye._g,this._b=ye._b,this.setAlpha(ye._a),this},lighten:function(){return this._applyModification(S,arguments)},brighten:function(){return this._applyModification(C,arguments)},darken:function(){return this._applyModification(_,arguments)},desaturate:function(){return this._applyModification(f,arguments)},saturate:function(){return this._applyModification(v,arguments)},greyscale:function(){return this._applyModification(m,arguments)},spin:function(){return this._applyModification(y,arguments)},_applyCombination:function(he,Ie){return he.apply(null,[this].concat([].slice.call(Ie)))},analogous:function(){return this._applyCombination(P,arguments)},complement:function(){return this._applyCombination(T,arguments)},monochromatic:function(){return this._applyCombination(N,arguments)},splitcomplement:function(){return this._applyCombination(F,arguments)},triad:function(){return this._applyCombination(O,arguments)},tetrad:function(){return this._applyCombination(g,arguments)}},c.fromRatio=function(he,Ie){if(typeof he=="object"){var ye={};for(var Ge in he)he.hasOwnProperty(Ge)&&(Ge==="a"?ye[Ge]=he[Ge]:ye[Ge]=We(he[Ge]));he=ye}return c(he,Ie)};function o(he){var Ie={r:0,g:0,b:0},ye=1,Ge=null,$e=null,ze=null,Je=!1,Qe=!1;return typeof he=="string"&&(he=Ae(he)),typeof he=="object"&&(He(he.r)&&He(he.g)&&He(he.b)?(Ie=h(he.r,he.g,he.b),Je=!0,Qe=String(he.r).substr(-1)==="%"?"prgb":"rgb"):He(he.h)&&He(he.s)&&He(he.v)?(Ge=We(he.s),$e=We(he.v),Ie=r(he.h,Ge,$e),Je=!0,Qe="hsv"):He(he.h)&&He(he.s)&&He(he.l)&&(Ge=We(he.s),ze=We(he.l),Ie=a(he.h,Ge,ze),Je=!0,Qe="hsl"),he.hasOwnProperty("a")&&(ye=he.a)),ye=K(ye),{ok:Je,format:he.format||Qe,r:E(255,b(Ie.r,0)),g:E(255,b(Ie.g,0)),b:E(255,b(Ie.b,0)),a:ye}}function h(he,Ie,ye){return{r:U(he,255)*255,g:U(Ie,255)*255,b:U(ye,255)*255}}function n(he,Ie,ye){he=U(he,255),Ie=U(Ie,255),ye=U(ye,255);var Ge=b(he,Ie,ye),$e=E(he,Ie,ye),ze,Je,Qe=(Ge+$e)/2;if(Ge==$e)ze=Je=0;else{var fe=Ge-$e;Je=Qe>.5?fe/(2-Ge-$e):fe/(Ge+$e);switch(Ge){case he:ze=(Ie-ye)/fe+(Ie<ye?6:0);break;case Ie:ze=(ye-he)/fe+2;break;case ye:ze=(he-Ie)/fe+4;break}ze/=6}return{h:ze,s:Je,l:Qe}}function a(he,Ie,ye){var Ge,$e,ze;he=U(he,360),Ie=U(Ie,100),ye=U(ye,100);function Je(ge,xe,we){return we<0&&(we+=1),we>1&&(we-=1),we<1/6?ge+(xe-ge)*6*we:we<1/2?xe:we<2/3?ge+(xe-ge)*(2/3-we)*6:ge}if(Ie===0)Ge=$e=ze=ye;else{var Qe=ye<.5?ye*(1+Ie):ye+Ie-ye*Ie,fe=2*ye-Qe;Ge=Je(fe,Qe,he+1/3),$e=Je(fe,Qe,he),ze=Je(fe,Qe,he-1/3)}return{r:Ge*255,g:$e*255,b:ze*255}}function t(he,Ie,ye){he=U(he,255),Ie=U(Ie,255),ye=U(ye,255);var Ge=b(he,Ie,ye),$e=E(he,Ie,ye),ze,Je,Qe=Ge,fe=Ge-$e;if(Je=Ge===0?0:fe/Ge,Ge==$e)ze=0;else{switch(Ge){case he:ze=(Ie-ye)/fe+(Ie<ye?6:0);break;case Ie:ze=(ye-he)/fe+2;break;case ye:ze=(he-Ie)/fe+4;break}ze/=6}return{h:ze,s:Je,v:Qe}}function r(he,Ie,ye){he=U(he,360)*6,Ie=U(Ie,100),ye=U(ye,100);var Ge=L.floor(he),$e=he-Ge,ze=ye*(1-Ie),Je=ye*(1-$e*Ie),Qe=ye*(1-(1-$e)*Ie),fe=Ge%6,ge=[ye,Je,ze,ze,Qe,ye][fe],xe=[Qe,ye,ye,Je,ze,ze][fe],we=[ze,ze,Qe,ye,ye,Je][fe];return{r:ge*255,g:xe*255,b:we*255}}function s(he,Ie,ye,Ge){var $e=[be(p(he).toString(16)),be(p(Ie).toString(16)),be(p(ye).toString(16))];return Ge&&$e[0].charAt(0)==$e[0].charAt(1)&&$e[1].charAt(0)==$e[1].charAt(1)&&$e[2].charAt(0)==$e[2].charAt(1)?$e[0].charAt(0)+$e[1].charAt(0)+$e[2].charAt(0):$e.join("")}function u(he,Ie,ye,Ge,$e){var ze=[be(p(he).toString(16)),be(p(Ie).toString(16)),be(p(ye).toString(16)),be(Ne(Ge))];return $e&&ze[0].charAt(0)==ze[0].charAt(1)&&ze[1].charAt(0)==ze[1].charAt(1)&&ze[2].charAt(0)==ze[2].charAt(1)&&ze[3].charAt(0)==ze[3].charAt(1)?ze[0].charAt(0)+ze[1].charAt(0)+ze[2].charAt(0)+ze[3].charAt(0):ze.join("")}function d(he,Ie,ye,Ge){var $e=[be(Ne(Ge)),be(p(he).toString(16)),be(p(Ie).toString(16)),be(p(ye).toString(16))];return $e.join("")}c.equals=function(he,Ie){return!he||!Ie?!1:c(he).toRgbString()==c(Ie).toRgbString()},c.random=function(){return c.fromRatio({r:i(),g:i(),b:i()})};function f(he,Ie){Ie=Ie===0?0:Ie||10;var ye=c(he).toHsl();return ye.s-=Ie/100,ye.s=k(ye.s),c(ye)}function v(he,Ie){Ie=Ie===0?0:Ie||10;var ye=c(he).toHsl();return ye.s+=Ie/100,ye.s=k(ye.s),c(ye)}function m(he){return c(he).desaturate(100)}function S(he,Ie){Ie=Ie===0?0:Ie||10;var ye=c(he).toHsl();return ye.l+=Ie/100,ye.l=k(ye.l),c(ye)}function C(he,Ie){Ie=Ie===0?0:Ie||10;var ye=c(he).toRgb();return ye.r=b(0,E(255,ye.r-p(255*-(Ie/100)))),ye.g=b(0,E(255,ye.g-p(255*-(Ie/100)))),ye.b=b(0,E(255,ye.b-p(255*-(Ie/100)))),c(ye)}function _(he,Ie){Ie=Ie===0?0:Ie||10;var ye=c(he).toHsl();return ye.l-=Ie/100,ye.l=k(ye.l),c(ye)}function y(he,Ie){var ye=c(he).toHsl(),Ge=(ye.h+Ie)%360;return ye.h=Ge<0?360+Ge:Ge,c(ye)}function T(he){var Ie=c(he).toHsl();return Ie.h=(Ie.h+180)%360,c(Ie)}function O(he){var Ie=c(he).toHsl(),ye=Ie.h;return[c(he),c({h:(ye+120)%360,s:Ie.s,l:Ie.l}),c({h:(ye+240)%360,s:Ie.s,l:Ie.l})]}function g(he){var Ie=c(he).toHsl(),ye=Ie.h;return[c(he),c({h:(ye+90)%360,s:Ie.s,l:Ie.l}),c({h:(ye+180)%360,s:Ie.s,l:Ie.l}),c({h:(ye+270)%360,s:Ie.s,l:Ie.l})]}function F(he){var Ie=c(he).toHsl(),ye=Ie.h;return[c(he),c({h:(ye+72)%360,s:Ie.s,l:Ie.l}),c({h:(ye+216)%360,s:Ie.s,l:Ie.l})]}function P(he,Ie,ye){Ie=Ie||6,ye=ye||30;var Ge=c(he).toHsl(),$e=360/ye,ze=[c(he)];for(Ge.h=(Ge.h-($e*Ie>>1)+720)%360;--Ie;)Ge.h=(Ge.h+$e)%360,ze.push(c(Ge));return ze}function N(he,Ie){Ie=Ie||6;for(var ye=c(he).toHsv(),Ge=ye.h,$e=ye.s,ze=ye.v,Je=[],Qe=1/Ie;Ie--;)Je.push(c({h:Ge,s:$e,v:ze})),ze=(ze+Qe)%1;return Je}c.mix=function(he,Ie,ye){ye=ye===0?0:ye||50;var Ge=c(he).toRgb(),$e=c(Ie).toRgb(),ze=ye/100,Je={r:($e.r-Ge.r)*ze+Ge.r,g:($e.g-Ge.g)*ze+Ge.g,b:($e.b-Ge.b)*ze+Ge.b,a:($e.a-Ge.a)*ze+Ge.a};return c(Je)},c.readability=function(he,Ie){var ye=c(he),Ge=c(Ie);return(L.max(ye.getLuminance(),Ge.getLuminance())+.05)/(L.min(ye.getLuminance(),Ge.getLuminance())+.05)},c.isReadable=function(he,Ie,ye){var Ge=c.readability(he,Ie),$e,ze;ze=!1,$e=Se(ye);switch($e.level+$e.size){case"AAsmall":case"AAAlarge":ze=Ge>=4.5;break;case"AAlarge":ze=Ge>=3;break;case"AAAsmall":ze=Ge>=7;break}return ze},c.mostReadable=function(he,Ie,ye){var Ge=null,$e=0,ze,Je,Qe,fe;ye=ye||{},Je=ye.includeFallbackColors,Qe=ye.level,fe=ye.size;for(var ge=0;ge<Ie.length;ge++)ze=c.readability(he,Ie[ge]),ze>$e&&($e=ze,Ge=c(Ie[ge]));return c.isReadable(he,Ge,{level:Qe,size:fe})||!Je?Ge:(ye.includeFallbackColors=!1,c.mostReadable(he,["#fff","#000"],ye))};var X=c.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},j=c.hexNames=A(X);function A(he){var Ie={};for(var ye in he)he.hasOwnProperty(ye)&&(Ie[he[ye]]=ye);return Ie}function K(he){return he=parseFloat(he),(isNaN(he)||he<0||he>1)&&(he=1),he}function U(he,Ie){te(he)&&(he="100%");var ye=de(he);return he=E(Ie,b(0,parseFloat(he))),ye&&(he=parseInt(he*Ie,10)/100),L.abs(he-Ie)<1e-6?1:he%Ie/parseFloat(Ie)}function k(he){return E(1,b(0,he))}function z(he){return parseInt(he,16)}function te(he){return typeof he=="string"&&he.indexOf(".")!=-1&&parseFloat(he)===1}function de(he){return typeof he=="string"&&he.indexOf("%")!=-1}function be(he){return he.length==1?"0"+he:""+he}function We(he){return he<=1&&(he=he*100+"%"),he}function Ne(he){return L.round(parseFloat(he)*255).toString(16)}function Le(he){return z(he)/255}var Ke=function(){var he="[-\\+]?\\d+%?",Ie="[-\\+]?\\d*\\.\\d+%?",ye="(?:"+Ie+")|(?:"+he+")",Ge="[\\s|\\(]+("+ye+")[,|\\s]+("+ye+")[,|\\s]+("+ye+")\\s*\\)?",$e="[\\s|\\(]+("+ye+")[,|\\s]+("+ye+")[,|\\s]+("+ye+")[,|\\s]+("+ye+")\\s*\\)?";return{CSS_UNIT:new RegExp(ye),rgb:new RegExp("rgb"+Ge),rgba:new RegExp("rgba"+$e),hsl:new RegExp("hsl"+Ge),hsla:new RegExp("hsla"+$e),hsv:new RegExp("hsv"+Ge),hsva:new RegExp("hsva"+$e),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}}();function He(he){return!!Ke.CSS_UNIT.exec(he)}function Ae(he){he=he.replace(I,"").replace(R,"").toLowerCase();var Ie=!1;if(X[he])he=X[he],Ie=!0;else if(he=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var ye;return(ye=Ke.rgb.exec(he))?{r:ye[1],g:ye[2],b:ye[3]}:(ye=Ke.rgba.exec(he))?{r:ye[1],g:ye[2],b:ye[3],a:ye[4]}:(ye=Ke.hsl.exec(he))?{h:ye[1],s:ye[2],l:ye[3]}:(ye=Ke.hsla.exec(he))?{h:ye[1],s:ye[2],l:ye[3],a:ye[4]}:(ye=Ke.hsv.exec(he))?{h:ye[1],s:ye[2],v:ye[3]}:(ye=Ke.hsva.exec(he))?{h:ye[1],s:ye[2],v:ye[3],a:ye[4]}:(ye=Ke.hex8.exec(he))?{r:z(ye[1]),g:z(ye[2]),b:z(ye[3]),a:Le(ye[4]),format:Ie?"name":"hex8"}:(ye=Ke.hex6.exec(he))?{r:z(ye[1]),g:z(ye[2]),b:z(ye[3]),format:Ie?"name":"hex"}:(ye=Ke.hex4.exec(he))?{r:z(ye[1]+""+ye[1]),g:z(ye[2]+""+ye[2]),b:z(ye[3]+""+ye[3]),a:Le(ye[4]+""+ye[4]),format:Ie?"name":"hex8"}:(ye=Ke.hex3.exec(he))?{r:z(ye[1]+""+ye[1]),g:z(ye[2]+""+ye[2]),b:z(ye[3]+""+ye[3]),format:Ie?"name":"hex"}:!1}function Se(he){var Ie,ye;return he=he||{level:"AA",size:"small"},Ie=(he.level||"AA").toUpperCase(),ye=(he.size||"small").toLowerCase(),Ie!=="AA"&&Ie!=="AAA"&&(Ie="AA"),ye!=="small"&&ye!=="large"&&(ye="small"),{level:Ie,size:ye}}it.exports?it.exports=c:!(G=function(){return c}.call(ne,q,ne,it),G!==void 0&&(it.exports=G))})(Math)},bT9E:function(it,ne,q){"use strict";q.d(ne,"a",function(){return L});var G=q("VTBJ");function L(I,R){var M=Object(G.a)({},I);return Array.isArray(R)&&R.forEach(function(p){delete M[p]}),M}},c5Ni:function(it,ne,q){},c5fP:function(it,ne,q){"use strict";function G(ce){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?G=function(Fe){return typeof Fe}:G=function(Fe){return Fe&&typeof Symbol=="function"&&Fe.constructor===Symbol&&Fe!==Symbol.prototype?"symbol":typeof Fe},G(ce)}Object.defineProperty(ne,"__esModule",{value:!0}),ne._tr_init=Me,ne._tr_stored_block=Ye,ne._tr_flush_block=je,ne._tr_tally=ot,ne._tr_align=et;var L=R(q("6BzB"));function I(){if(typeof WeakMap!="function")return null;var ce=new WeakMap;return I=function(){return ce},ce}function R(ce){if(ce&&ce.__esModule)return ce;if(ce===null||G(ce)!=="object"&&typeof ce!="function")return{default:ce};var Pe=I();if(Pe&&Pe.has(ce))return Pe.get(ce);var Fe={},Ce=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var _e in ce)if(Object.prototype.hasOwnProperty.call(ce,_e)){var Ee=Ce?Object.getOwnPropertyDescriptor(ce,_e):null;Ee&&(Ee.get||Ee.set)?Object.defineProperty(Fe,_e,Ee):Fe[_e]=ce[_e]}return Fe.default=ce,Pe&&Pe.set(ce,Fe),Fe}var M=4,p=0,E=1,b=2;function i(ce){for(var Pe=ce.length;--Pe>=0;)ce[Pe]=0}var c=0,o=1,h=2,n=3,a=258,t=29,r=256,s=r+1+t,u=30,d=19,f=2*s+1,v=15,m=16,S=7,C=256,_=16,y=17,T=18,O=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],g=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],F=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],P=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],N=512,X=new Array((s+2)*2);i(X);var j=new Array(u*2);i(j);var A=new Array(N);i(A);var K=new Array(a-n+1);i(K);var U=new Array(t);i(U);var k=new Array(u);i(k);function z(ce,Pe,Fe,Ce,_e){this.static_tree=ce,this.extra_bits=Pe,this.extra_base=Fe,this.elems=Ce,this.max_length=_e,this.has_stree=ce&&ce.length}var te,de,be;function We(ce,Pe){this.dyn_tree=ce,this.max_code=0,this.stat_desc=Pe}function Ne(ce){return ce<256?A[ce]:A[256+(ce>>>7)]}function Le(ce,Pe){ce.pending_buf[ce.pending++]=Pe&255,ce.pending_buf[ce.pending++]=Pe>>>8&255}function Ke(ce,Pe,Fe){ce.bi_valid>m-Fe?(ce.bi_buf|=Pe<<ce.bi_valid&65535,Le(ce,ce.bi_buf),ce.bi_buf=Pe>>m-ce.bi_valid,ce.bi_valid+=Fe-m):(ce.bi_buf|=Pe<<ce.bi_valid&65535,ce.bi_valid+=Fe)}function He(ce,Pe,Fe){Ke(ce,Fe[Pe*2],Fe[Pe*2+1])}function Ae(ce,Pe){var Fe=0;do Fe|=ce&1,ce>>>=1,Fe<<=1;while(--Pe>0);return Fe>>>1}function Se(ce){ce.bi_valid===16?(Le(ce,ce.bi_buf),ce.bi_buf=0,ce.bi_valid=0):ce.bi_valid>=8&&(ce.pending_buf[ce.pending++]=ce.bi_buf&255,ce.bi_buf>>=8,ce.bi_valid-=8)}function he(ce,Pe){var Fe=Pe.dyn_tree,Ce=Pe.max_code,_e=Pe.stat_desc.static_tree,Ee=Pe.stat_desc.has_stree,ee=Pe.stat_desc.extra_bits,oe=Pe.stat_desc.extra_base,Q=Pe.stat_desc.max_length,me,Oe,V,Re,Xe,pe,ke=0;for(Re=0;Re<=v;Re++)ce.bl_count[Re]=0;for(Fe[ce.heap[ce.heap_max]*2+1]=0,me=ce.heap_max+1;me<f;me++){if(Oe=ce.heap[me],Re=Fe[Fe[Oe*2+1]*2+1]+1,Re>Q&&(Re=Q,ke++),Fe[Oe*2+1]=Re,Oe>Ce)continue;ce.bl_count[Re]++,Xe=0,Oe>=oe&&(Xe=ee[Oe-oe]),pe=Fe[Oe*2],ce.opt_len+=pe*(Re+Xe),Ee&&(ce.static_len+=pe*(_e[Oe*2+1]+Xe))}if(ke===0)return;do{for(Re=Q-1;ce.bl_count[Re]===0;)Re--;ce.bl_count[Re]--,ce.bl_count[Re+1]+=2,ce.bl_count[Q]--,ke-=2}while(ke>0);for(Re=Q;Re!==0;Re--)for(Oe=ce.bl_count[Re];Oe!==0;){if(V=ce.heap[--me],V>Ce)continue;Fe[V*2+1]!==Re&&(ce.opt_len+=(Re-Fe[V*2+1])*Fe[V*2],Fe[V*2+1]=Re),Oe--}}function Ie(ce,Pe,Fe){var Ce=new Array(v+1),_e=0,Ee,ee;for(Ee=1;Ee<=v;Ee++)Ce[Ee]=_e=_e+Fe[Ee-1]<<1;for(ee=0;ee<=Pe;ee++){var oe=ce[ee*2+1];if(oe===0)continue;ce[ee*2]=Ae(Ce[oe]++,oe)}}function ye(){var ce,Pe,Fe,Ce,_e,Ee=new Array(v+1);for(Fe=0,Ce=0;Ce<t-1;Ce++)for(U[Ce]=Fe,ce=0;ce<1<<O[Ce];ce++)K[Fe++]=Ce;for(K[Fe-1]=Ce,_e=0,Ce=0;Ce<16;Ce++)for(k[Ce]=_e,ce=0;ce<1<<g[Ce];ce++)A[_e++]=Ce;for(_e>>=7;Ce<u;Ce++)for(k[Ce]=_e<<7,ce=0;ce<1<<g[Ce]-7;ce++)A[256+_e++]=Ce;for(Pe=0;Pe<=v;Pe++)Ee[Pe]=0;for(ce=0;ce<=143;)X[ce*2+1]=8,ce++,Ee[8]++;for(;ce<=255;)X[ce*2+1]=9,ce++,Ee[9]++;for(;ce<=279;)X[ce*2+1]=7,ce++,Ee[7]++;for(;ce<=287;)X[ce*2+1]=8,ce++,Ee[8]++;for(Ie(X,s+1,Ee),ce=0;ce<u;ce++)j[ce*2+1]=5,j[ce*2]=Ae(ce,5);te=new z(X,O,r+1,s,v),de=new z(j,g,0,u,v),be=new z(new Array(0),F,0,d,S)}function Ge(ce){var Pe;for(Pe=0;Pe<s;Pe++)ce.dyn_ltree[Pe*2]=0;for(Pe=0;Pe<u;Pe++)ce.dyn_dtree[Pe*2]=0;for(Pe=0;Pe<d;Pe++)ce.bl_tree[Pe*2]=0;ce.dyn_ltree[C*2]=1,ce.opt_len=ce.static_len=0,ce.last_lit=ce.matches=0}function $e(ce){ce.bi_valid>8?Le(ce,ce.bi_buf):ce.bi_valid>0&&(ce.pending_buf[ce.pending++]=ce.bi_buf),ce.bi_buf=0,ce.bi_valid=0}function ze(ce,Pe,Fe,Ce){$e(ce),Ce&&(Le(ce,Fe),Le(ce,~Fe)),L.arraySet(ce.pending_buf,ce.window,Pe,Fe,ce.pending),ce.pending+=Fe}function Je(ce,Pe,Fe,Ce){var _e=Pe*2,Ee=Fe*2;return ce[_e]<ce[Ee]||ce[_e]===ce[Ee]&&Ce[Pe]<=Ce[Fe]}function Qe(ce,Pe,Fe){for(var Ce=ce.heap[Fe],_e=Fe<<1;_e<=ce.heap_len&&!(_e<ce.heap_len&&Je(Pe,ce.heap[_e+1],ce.heap[_e],ce.depth)&&_e++,Je(Pe,Ce,ce.heap[_e],ce.depth));)ce.heap[Fe]=ce.heap[_e],Fe=_e,_e<<=1;ce.heap[Fe]=Ce}function fe(ce,Pe,Fe){var Ce,_e,Ee=0,ee,oe;if(ce.last_lit!==0)do Ce=ce.pending_buf[ce.d_buf+Ee*2]<<8|ce.pending_buf[ce.d_buf+Ee*2+1],_e=ce.pending_buf[ce.l_buf+Ee],Ee++,Ce===0?He(ce,_e,Pe):(ee=K[_e],He(ce,ee+r+1,Pe),oe=O[ee],oe!==0&&(_e-=U[ee],Ke(ce,_e,oe)),Ce--,ee=Ne(Ce),He(ce,ee,Fe),oe=g[ee],oe!==0&&(Ce-=k[ee],Ke(ce,Ce,oe)));while(Ee<ce.last_lit);He(ce,C,Pe)}function ge(ce,Pe){var Fe=Pe.dyn_tree,Ce=Pe.stat_desc.static_tree,_e=Pe.stat_desc.has_stree,Ee=Pe.stat_desc.elems,ee,oe,Q=-1,me;for(ce.heap_len=0,ce.heap_max=f,ee=0;ee<Ee;ee++)Fe[ee*2]!==0?(ce.heap[++ce.heap_len]=Q=ee,ce.depth[ee]=0):Fe[ee*2+1]=0;for(;ce.heap_len<2;)me=ce.heap[++ce.heap_len]=Q<2?++Q:0,Fe[me*2]=1,ce.depth[me]=0,ce.opt_len--,_e&&(ce.static_len-=Ce[me*2+1]);for(Pe.max_code=Q,ee=ce.heap_len>>1;ee>=1;ee--)Qe(ce,Fe,ee);me=Ee;do ee=ce.heap[1],ce.heap[1]=ce.heap[ce.heap_len--],Qe(ce,Fe,1),oe=ce.heap[1],ce.heap[--ce.heap_max]=ee,ce.heap[--ce.heap_max]=oe,Fe[me*2]=Fe[ee*2]+Fe[oe*2],ce.depth[me]=(ce.depth[ee]>=ce.depth[oe]?ce.depth[ee]:ce.depth[oe])+1,Fe[ee*2+1]=Fe[oe*2+1]=me,ce.heap[1]=me++,Qe(ce,Fe,1);while(ce.heap_len>=2);ce.heap[--ce.heap_max]=ce.heap[1],he(ce,Pe),Ie(Fe,Q,ce.bl_count)}function xe(ce,Pe,Fe){var Ce,_e=-1,Ee,ee=Pe[0*2+1],oe=0,Q=7,me=4;for(ee===0&&(Q=138,me=3),Pe[(Fe+1)*2+1]=65535,Ce=0;Ce<=Fe;Ce++){if(Ee=ee,ee=Pe[(Ce+1)*2+1],++oe<Q&&Ee===ee)continue;oe<me?ce.bl_tree[Ee*2]+=oe:Ee!==0?(Ee!==_e&&ce.bl_tree[Ee*2]++,ce.bl_tree[_*2]++):oe<=10?ce.bl_tree[y*2]++:ce.bl_tree[T*2]++,oe=0,_e=Ee,ee===0?(Q=138,me=3):Ee===ee?(Q=6,me=3):(Q=7,me=4)}}function we(ce,Pe,Fe){var Ce,_e=-1,Ee,ee=Pe[0*2+1],oe=0,Q=7,me=4;for(ee===0&&(Q=138,me=3),Ce=0;Ce<=Fe;Ce++){if(Ee=ee,ee=Pe[(Ce+1)*2+1],++oe<Q&&Ee===ee)continue;if(oe<me)do He(ce,Ee,ce.bl_tree);while(--oe!==0);else Ee!==0?(Ee!==_e&&(He(ce,Ee,ce.bl_tree),oe--),He(ce,_,ce.bl_tree),Ke(ce,oe-3,2)):oe<=10?(He(ce,y,ce.bl_tree),Ke(ce,oe-3,3)):(He(ce,T,ce.bl_tree),Ke(ce,oe-11,7));oe=0,_e=Ee,ee===0?(Q=138,me=3):Ee===ee?(Q=6,me=3):(Q=7,me=4)}}function Te(ce){var Pe;for(xe(ce,ce.dyn_ltree,ce.l_desc.max_code),xe(ce,ce.dyn_dtree,ce.d_desc.max_code),ge(ce,ce.bl_desc),Pe=d-1;Pe>=3&&!(ce.bl_tree[P[Pe]*2+1]!==0);Pe--);return ce.opt_len+=3*(Pe+1)+5+5+4,Pe}function re(ce,Pe,Fe,Ce){var _e;for(Ke(ce,Pe-257,5),Ke(ce,Fe-1,5),Ke(ce,Ce-4,4),_e=0;_e<Ce;_e++)Ke(ce,ce.bl_tree[P[_e]*2+1],3);we(ce,ce.dyn_ltree,Pe-1),we(ce,ce.dyn_dtree,Fe-1)}function ve(ce){var Pe=4093624447,Fe;for(Fe=0;Fe<=31;Fe++,Pe>>>=1)if(Pe&1&&ce.dyn_ltree[Fe*2]!==0)return p;if(ce.dyn_ltree[9*2]!==0||ce.dyn_ltree[10*2]!==0||ce.dyn_ltree[13*2]!==0)return E;for(Fe=32;Fe<r;Fe++)if(ce.dyn_ltree[Fe*2]!==0)return E;return p}var ae=!1;function Me(ce){ae||(ye(),ae=!0),ce.l_desc=new We(ce.dyn_ltree,te),ce.d_desc=new We(ce.dyn_dtree,de),ce.bl_desc=new We(ce.bl_tree,be),ce.bi_buf=0,ce.bi_valid=0,Ge(ce)}function Ye(ce,Pe,Fe,Ce){Ke(ce,(c<<1)+(Ce?1:0),3),ze(ce,Pe,Fe,!0)}function et(ce){Ke(ce,o<<1,3),He(ce,C,X),Se(ce)}function je(ce,Pe,Fe,Ce){var _e,Ee,ee=0;ce.level>0?(ce.strm.data_type===b&&(ce.strm.data_type=ve(ce)),ge(ce,ce.l_desc),ge(ce,ce.d_desc),ee=Te(ce),_e=ce.opt_len+3+7>>>3,Ee=ce.static_len+3+7>>>3,Ee<=_e&&(_e=Ee)):_e=Ee=Fe+5,Fe+4<=_e&&Pe!==-1?Ye(ce,Pe,Fe,Ce):ce.strategy===M||Ee===_e?(Ke(ce,(o<<1)+(Ce?1:0),3),fe(ce,X,j)):(Ke(ce,(h<<1)+(Ce?1:0),3),re(ce,ce.l_desc.max_code+1,ce.d_desc.max_code+1,ee+1),fe(ce,ce.dyn_ltree,ce.dyn_dtree)),Ge(ce),Ce&&$e(ce)}function ot(ce,Pe,Fe){return ce.pending_buf[ce.d_buf+ce.last_lit*2]=Pe>>>8&255,ce.pending_buf[ce.d_buf+ce.last_lit*2+1]=Pe&255,ce.pending_buf[ce.l_buf+ce.last_lit]=Fe&255,ce.last_lit++,Pe===0?ce.dyn_ltree[Fe*2]++:(ce.matches++,Pe--,ce.dyn_ltree[(K[Fe]+r+1)*2]++,ce.dyn_dtree[Ne(Pe)*2]++),ce.last_lit===ce.lit_bufsize-1}},dejd:function(it,ne,q){},dmUQ:function(it,ne,q){"use strict";var G=q("Ff2n"),L=q("rePB"),I=q("1OyB"),R=q("vuIU"),M=q("Ji7U"),p=q("md7G"),E=q("foSv"),b=q("q1tI"),i=q.n(b),c=q("TSYQ"),o=q.n(c),h=q("4IlW");function n(O,g){var F=Object.keys(O);if(Object.getOwnPropertySymbols){var P=Object.getOwnPropertySymbols(O);g&&(P=P.filter(function(N){return Object.getOwnPropertyDescriptor(O,N).enumerable})),F.push.apply(F,P)}return F}function a(O){for(var g=1;g<arguments.length;g++){var F=arguments[g]!=null?arguments[g]:{};g%2?n(Object(F),!0).forEach(function(P){Object(L.a)(O,P,F[P])}):Object.getOwnPropertyDescriptors?Object.defineProperties(O,Object.getOwnPropertyDescriptors(F)):n(Object(F)).forEach(function(P){Object.defineProperty(O,P,Object.getOwnPropertyDescriptor(F,P))})}return O}function t(O){var g=r();return function(){var P=Object(E.a)(O),N;if(g){var X=Object(E.a)(this).constructor;N=Reflect.construct(P,arguments,X)}else N=P.apply(this,arguments);return Object(p.a)(this,N)}}function r(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(O){return!1}}function s(){}function u(O){O.preventDefault()}var d=function(g){return g.replace(/[^\w.-]+/g,"")},f=200,v=600,m=Number.MAX_SAFE_INTEGER||Math.pow(2,53)-1,S=function(g){return g!=null},C=function(g,F){return F===g||typeof F=="number"&&typeof g=="number"&&isNaN(F)&&isNaN(g)},_=function(O){Object(M.a)(F,O);var g=t(F);function F(P){var N;Object(I.a)(this,F),N=g.call(this,P),N.onKeyDown=function(A){var K=N.props,U=K.onKeyDown,k=K.onPressEnter;if(A.keyCode===h.a.UP){var z=N.getRatio(A);N.up(A,z,null),N.stop()}else if(A.keyCode===h.a.DOWN){var te=N.getRatio(A);N.down(A,te,null),N.stop()}else A.keyCode===h.a.ENTER&&k&&k(A);if(N.recordCursorPosition(),N.lastKeyCode=A.keyCode,U){for(var de=arguments.length,be=new Array(de>1?de-1:0),We=1;We<de;We++)be[We-1]=arguments[We];U.apply(void 0,[A].concat(be))}},N.onKeyUp=function(A){var K=N.props.onKeyUp;if(N.stop(),N.recordCursorPosition(),K){for(var U=arguments.length,k=new Array(U>1?U-1:0),z=1;z<U;z++)k[z-1]=arguments[z];K.apply(void 0,[A].concat(k))}},N.onChange=function(A){var K=N.props.onChange;N.state.focused&&(N.inputting=!0),N.rawInput=N.props.parser(N.getValueFromEvent(A)),N.setState({inputValue:N.rawInput}),K(N.toNumber(N.rawInput))},N.onMouseUp=function(){var A=N.props.onMouseUp;N.recordCursorPosition(),A&&A.apply(void 0,arguments)},N.onFocus=function(){var A;N.setState({focused:!0}),(A=N.props).onFocus.apply(A,arguments)},N.onBlur=function(){var A=N.props.onBlur;N.inputting=!1,N.setState({focused:!1});var K=N.getCurrentValidValue(N.state.inputValue),U=N.setValue(K,s);if(A){var k=N.input.value,z=N.getInputDisplayValue({focus:!1,value:U});N.input.value=z&&Number(z),A.apply(void 0,arguments),N.input.value=k}},N.getRatio=function(A){var K=1;return A.metaKey||A.ctrlKey?K=.1:A.shiftKey&&(K=10),K},N.getFullNum=function(A){return isNaN(A)?A:/e/i.test(String(A))?Number(A).toFixed(18).replace(/\.?0+$/,""):A},N.getPrecision=function(A){if(S(N.props.precision))return N.props.precision;var K=String(A);if(K.indexOf("e-")>=0)return parseInt(K.slice(K.indexOf("e-")+2),10);var U=0;return K.indexOf(".")>=0&&(U=K.length-K.indexOf(".")-1),U},N.getInputDisplayValue=function(A){var K=A||N.state,U=K.focused,k=K.inputValue,z=K.value,te;U?te=k:te=N.toPrecisionAsStep(z),te==null&&(te="");var de=N.formatWrapper(te);return S(N.props.decimalSeparator)&&(de=de.toString().replace(".",N.props.decimalSeparator)),de},N.recordCursorPosition=function(){try{N.cursorStart=N.input.selectionStart,N.cursorEnd=N.input.selectionEnd,N.currentValue=N.input.value,N.cursorBefore=N.input.value.substring(0,N.cursorStart),N.cursorAfter=N.input.value.substring(N.cursorEnd)}catch(A){}},N.restoreByAfter=function(A){if(A===void 0)return!1;var K=N.input.value,U=K.lastIndexOf(A);if(U===-1)return!1;var k=N.cursorBefore.length;return N.lastKeyCode===h.a.DELETE&&N.cursorBefore.charAt(k-1)===A[0]?(N.fixCaret(k,k),!0):U+A.length===K.length?(N.fixCaret(U,U),!0):!1},N.partRestoreByAfter=function(A){return A===void 0?!1:Array.prototype.some.call(A,function(K,U){var k=A.substring(U);return N.restoreByAfter(k)})},N.isNotCompleteNumber=function(A){return isNaN(A)||A===""||A===null||A&&A.toString().indexOf(".")===A.toString().length-1},N.stop=function(){N.autoStepTimer&&clearTimeout(N.autoStepTimer)},N.down=function(A,K,U){N.pressingUpOrDown=!0,N.step("down",A,K,U)},N.up=function(A,K,U){N.pressingUpOrDown=!0,N.step("up",A,K,U)},N.saveInput=function(A){N.input=A};var X=P.value;X===void 0&&(X=P.defaultValue),N.state={focused:P.autoFocus};var j=N.getValidValue(N.toNumber(X));return N.state=a(a({},N.state),{},{inputValue:N.toPrecisionAsStep(j),value:j}),N}return Object(R.a)(F,[{key:"componentDidMount",value:function(){this.componentDidUpdate(null)}},{key:"componentDidUpdate",value:function(N){var X=this.props,j=X.value,A=X.onChange,K=X.max,U=X.min,k=this.state.focused;if(N){if(!C(N.value,j)||!C(N.max,K)||!C(N.min,U)){var z=k?j:this.getValidValue(j),te;this.pressingUpOrDown?te=z:this.inputting?te=this.rawInput:te=this.toPrecisionAsStep(z),this.setState({value:z,inputValue:te})}var de="value"in this.props?j:this.state.value;"max"in this.props&&N.max!==K&&typeof de=="number"&&de>K&&A&&A(K),"min"in this.props&&N.min!==U&&typeof de=="number"&&de<U&&A&&A(U)}try{if(this.cursorStart!==void 0&&this.state.focused){if(!this.partRestoreByAfter(this.cursorAfter)&&this.state.value!==this.props.value){var be=this.cursorStart+1;this.cursorAfter?this.lastKeyCode===h.a.BACKSPACE?be=this.cursorStart-1:this.lastKeyCode===h.a.DELETE&&(be=this.cursorStart):be=this.input.value.length,this.fixCaret(be,be)}else if(this.currentValue===this.input.value)switch(this.lastKeyCode){case h.a.BACKSPACE:this.fixCaret(this.cursorStart-1,this.cursorStart-1);break;case h.a.DELETE:this.fixCaret(this.cursorStart+1,this.cursorStart+1);break;default:}}}catch(We){}if(this.lastKeyCode=null,!this.pressingUpOrDown)return;this.props.focusOnUpDown&&this.state.focused&&(document.activeElement!==this.input&&this.focus())}},{key:"componentWillUnmount",value:function(){this.stop()}},{key:"getCurrentValidValue",value:function(N){var X=N;return X===""?X="":this.isNotCompleteNumber(parseFloat(X))?X=this.state.value:X=this.getValidValue(X),this.toNumber(X)}},{key:"getValueFromEvent",value:function(N){var X=N.target.value.trim().replace(/。/g,".");return S(this.props.decimalSeparator)&&(X=X.replace(this.props.decimalSeparator,".")),X}},{key:"getValidValue",value:function(N){var X=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.props.min,j=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.props.max,A=parseFloat(N);return isNaN(A)?N:(A<X&&(A=X),A>j&&(A=j),A)}},{key:"setValue",value:function(N,X){var j=this.props.precision,A=this.isNotCompleteNumber(parseFloat(N))?null:parseFloat(N),K=this.state.value,U=K===void 0?null:K,k=this.state.inputValue,z=k===void 0?null:k,te=typeof A=="number"?A.toFixed(j):"".concat(A),de=A!==U||te!=="".concat(z);return"value"in this.props?(z=this.toPrecisionAsStep(this.state.value),this.setState({inputValue:z},X)):this.setState({value:A,inputValue:this.toPrecisionAsStep(N)},X),de&&this.props.onChange(A),A}},{key:"getMaxPrecision",value:function(N){var X=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,j=this.props,A=j.precision,K=j.step;if(S(A))return A;var U=this.getPrecision(X),k=this.getPrecision(K),z=this.getPrecision(N);return N?Math.max(z,U+k):U+k}},{key:"getPrecisionFactor",value:function(N){var X=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,j=this.getMaxPrecision(N,X);return Math.pow(10,j)}},{key:"focus",value:function(){this.input.focus(),this.recordCursorPosition()}},{key:"blur",value:function(){this.input.blur()}},{key:"select",value:function(){this.input.select()}},{key:"formatWrapper",value:function(N){return this.props.formatter?this.props.formatter(N):N}},{key:"toPrecisionAsStep",value:function(N){if(this.isNotCompleteNumber(N)||N==="")return N;var X=Math.abs(this.getMaxPrecision(N));return isNaN(X)?N.toString():Number(N).toFixed(X)}},{key:"toNumber",value:function(N){var X=this.props.precision,j=this.state.focused,A=N&&N.length>16&&j;return this.isNotCompleteNumber(N)||A?N:S(X)?Math.round(N*Math.pow(10,X))/Math.pow(10,X):Number(N)}},{key:"upStep",value:function(N,X){var j=this.props.step,A=this.getPrecisionFactor(N,X),K=Math.abs(this.getMaxPrecision(N,X)),U=((A*N+A*j*X)/A).toFixed(K);return this.toNumber(U)}},{key:"downStep",value:function(N,X){var j=this.props.step,A=this.getPrecisionFactor(N,X),K=Math.abs(this.getMaxPrecision(N,X)),U=((A*N-A*j*X)/A).toFixed(K);return this.toNumber(U)}},{key:"step",value:function(N,X){var j=this,A=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,K=arguments.length>3?arguments[3]:void 0;this.stop(),X&&(X.persist(),X.preventDefault());var U=this.props;if(U.disabled)return;var k=this.getCurrentValidValue(this.state.inputValue)||0;if(this.isNotCompleteNumber(k))return;var z=this["".concat(N,"Step")](k,A),te=z>U.max||z<U.min;if(z>U.max?z=U.max:z<U.min&&(z=U.min),this.setValue(z,null),this.setState({focused:!0},function(){j.pressingUpOrDown=!1}),te)return;this.autoStepTimer=setTimeout(function(){j[N](X,A,!0)},K?f:v)}},{key:"fixCaret",value:function(N,X){if(N===void 0||X===void 0||!this.input||!this.input.value)return;try{var j=this.input.selectionStart,A=this.input.selectionEnd;(N!==j||X!==A)&&this.input.setSelectionRange(N,X)}catch(K){}}},{key:"render",value:function(){var N,X=this.props,j=X.prefixCls,A=X.disabled,K=X.readOnly,U=X.useTouch,k=X.autoComplete,z=X.upHandler,te=X.downHandler,de=X.className,be=X.max,We=X.min,Ne=X.style,Le=X.title,Ke=X.onMouseEnter,He=X.onMouseLeave,Ae=X.onMouseOver,Se=X.onMouseOut,he=X.required,Ie=X.onClick,ye=X.tabIndex,Ge=X.type,$e=X.placeholder,ze=X.id,Je=X.inputMode,Qe=X.pattern,fe=X.step,ge=X.maxLength,xe=X.autoFocus,we=X.name,Te=X.onPaste,re=X.onInput,ve=Object(G.a)(X,["prefixCls","disabled","readOnly","useTouch","autoComplete","upHandler","downHandler","className","max","min","style","title","onMouseEnter","onMouseLeave","onMouseOver","onMouseOut","required","onClick","tabIndex","type","placeholder","id","inputMode","pattern","step","maxLength","autoFocus","name","onPaste","onInput"]),ae=this.state,Me=ae.value,Ye=ae.focused,et=o()(j,(N={},Object(L.a)(N,de,!!de),Object(L.a)(N,"".concat(j,"-disabled"),A),Object(L.a)(N,"".concat(j,"-focused"),Ye),N)),je={};Object.keys(ve).forEach(function(me){(me.substr(0,5)==="data-"||me.substr(0,5)==="aria-"||me==="role")&&(je[me]=ve[me])});var ot=!K&&!A,ce=this.getInputDisplayValue(null),Pe=(Me||Me===0)&&(isNaN(Me)||Number(Me)>=be),Fe=(Me||Me===0)&&(isNaN(Me)||Number(Me)<=We),Ce=Pe||A||K,_e=Fe||A||K,Ee=o()("".concat(j,"-handler"),"".concat(j,"-handler-up"),Object(L.a)({},"".concat(j,"-handler-up-disabled"),Ce)),ee=o()("".concat(j,"-handler"),"".concat(j,"-handler-down"),Object(L.a)({},"".concat(j,"-handler-down-disabled"),_e)),oe=U?{onTouchStart:Ce?s:this.up,onTouchEnd:this.stop}:{onMouseDown:Ce?s:this.up,onMouseUp:this.stop,onMouseLeave:this.stop},Q=U?{onTouchStart:_e?s:this.down,onTouchEnd:this.stop}:{onMouseDown:_e?s:this.down,onMouseUp:this.stop,onMouseLeave:this.stop};return i.a.createElement("div",{className:et,style:Ne,title:Le,onMouseEnter:Ke,onMouseLeave:He,onMouseOver:Ae,onMouseOut:Se,onFocus:function(){return null},onBlur:function(){return null}},i.a.createElement("div",{className:"".concat(j,"-handler-wrap")},i.a.createElement("span",Object.assign({unselectable:"on"},oe,{role:"button","aria-label":"Increase Value","aria-disabled":Ce,className:Ee}),z||i.a.createElement("span",{unselectable:"on",className:"".concat(j,"-handler-up-inner"),onClick:u})),i.a.createElement("span",Object.assign({unselectable:"on"},Q,{role:"button","aria-label":"Decrease Value","aria-disabled":_e,className:ee}),te||i.a.createElement("span",{unselectable:"on",className:"".concat(j,"-handler-down-inner"),onClick:u}))),i.a.createElement("div",{className:"".concat(j,"-input-wrap")},i.a.createElement("input",Object.assign({role:"spinbutton","aria-valuemin":We,"aria-valuemax":be,"aria-valuenow":Me,required:he,type:Ge,placeholder:$e,onPaste:Te,onClick:Ie,onMouseUp:this.onMouseUp,className:"".concat(j,"-input"),tabIndex:ye,autoComplete:k,onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:ot?this.onKeyDown:s,onKeyUp:ot?this.onKeyUp:s,autoFocus:xe,maxLength:ge,readOnly:K,disabled:A,max:be,min:We,step:fe,name:we,title:Le,id:ze,onChange:this.onChange,ref:this.saveInput,value:this.getFullNum(ce),pattern:Qe,inputMode:Je,onInput:re},je))))}}]),F}(i.a.Component);_.defaultProps={focusOnUpDown:!0,useTouch:!1,prefixCls:"rc-input-number",max:m,min:-m,step:1,style:{},onChange:s,onKeyDown:s,onPressEnter:s,onFocus:s,onBlur:s,parser:d,required:!1,autoComplete:"off"};var y=_,T=ne.a=y},eP3c:function(it,ne,q){"use strict";function G(ee){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?G=function(Q){return typeof Q}:G=function(Q){return Q&&typeof Symbol=="function"&&Q.constructor===Symbol&&Q!==Symbol.prototype?"symbol":typeof Q},G(ee)}Object.defineProperty(ne,"__esModule",{value:!0}),ne.inflateReset=re,ne.inflateReset2=ve,ne.inflateResetKeep=Te,ne.inflateInit=Me,ne.inflateInit2=ae,ne.inflate=Pe,ne.inflateEnd=Fe,ne.inflateGetHeader=Ce,ne.inflateSetDictionary=_e,ne.inflateInfo=ne.Z_DEFLATED=ne.Z_BUF_ERROR=ne.Z_MEM_ERROR=ne.Z_DATA_ERROR=ne.Z_STREAM_ERROR=ne.Z_NEED_DICT=ne.Z_STREAM_END=ne.Z_OK=ne.Z_TREES=ne.Z_BLOCK=ne.Z_FINISH=void 0;var L=i(q("6BzB")),I=E(q("xlC8")),R=E(q("QV2g")),M=E(q("sjKO")),p=E(q("JSwD"));function E(ee){return ee&&ee.__esModule?ee:{default:ee}}function b(){if(typeof WeakMap!="function")return null;var ee=new WeakMap;return b=function(){return ee},ee}function i(ee){if(ee&&ee.__esModule)return ee;if(ee===null||G(ee)!=="object"&&typeof ee!="function")return{default:ee};var oe=b();if(oe&&oe.has(ee))return oe.get(ee);var Q={},me=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var Oe in ee)if(Object.prototype.hasOwnProperty.call(ee,Oe)){var V=me?Object.getOwnPropertyDescriptor(ee,Oe):null;V&&(V.get||V.set)?Object.defineProperty(Q,Oe,V):Q[Oe]=ee[Oe]}return Q.default=ee,oe&&oe.set(ee,Q),Q}var c=0,o=1,h=2,n=4;ne.Z_FINISH=n;var a=5;ne.Z_BLOCK=a;var t=6;ne.Z_TREES=t;var r=0;ne.Z_OK=r;var s=1;ne.Z_STREAM_END=s;var u=2;ne.Z_NEED_DICT=u;var d=-2;ne.Z_STREAM_ERROR=d;var f=-3;ne.Z_DATA_ERROR=f;var v=-4;ne.Z_MEM_ERROR=v;var m=-5;ne.Z_BUF_ERROR=m;var S=8;ne.Z_DEFLATED=S;var C=1,_=2,y=3,T=4,O=5,g=6,F=7,P=8,N=9,X=10,j=11,A=12,K=13,U=14,k=15,z=16,te=17,de=18,be=19,We=20,Ne=21,Le=22,Ke=23,He=24,Ae=25,Se=26,he=27,Ie=28,ye=29,Ge=30,$e=31,ze=32,Je=852,Qe=592,fe=15,ge=fe;function xe(ee){return(ee>>>24&255)+(ee>>>8&65280)+((ee&65280)<<8)+((ee&255)<<24)}function we(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new L.Buf16(320),this.work=new L.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function Te(ee){var oe;return!ee||!ee.state?d:(oe=ee.state,ee.total_in=ee.total_out=oe.total=0,ee.msg="",oe.wrap&&(ee.adler=oe.wrap&1),oe.mode=C,oe.last=0,oe.havedict=0,oe.dmax=32768,oe.head=null,oe.hold=0,oe.bits=0,oe.lencode=oe.lendyn=new L.Buf32(Je),oe.distcode=oe.distdyn=new L.Buf32(Qe),oe.sane=1,oe.back=-1,r)}function re(ee){var oe;return!ee||!ee.state?d:(oe=ee.state,oe.wsize=0,oe.whave=0,oe.wnext=0,Te(ee))}function ve(ee,oe){var Q,me;return!ee||!ee.state?d:(me=ee.state,oe<0?(Q=0,oe=-oe):(Q=(oe>>4)+1,oe<48&&(oe&=15)),oe&&(oe<8||oe>15)?d:(me.window!==null&&me.wbits!==oe&&(me.window=null),me.wrap=Q,me.wbits=oe,re(ee)))}function ae(ee,oe){var Q,me;return ee?(me=new we,ee.state=me,me.window=null,Q=ve(ee,oe),Q!==r&&(ee.state=null),Q):d}function Me(ee){return ae(ee,ge)}var Ye=!0,et,je;function ot(ee){if(Ye){var oe;for(et=new L.Buf32(512),je=new L.Buf32(32),oe=0;oe<144;)ee.lens[oe++]=8;for(;oe<256;)ee.lens[oe++]=9;for(;oe<280;)ee.lens[oe++]=7;for(;oe<288;)ee.lens[oe++]=8;for((0,p.default)(o,ee.lens,0,288,et,0,ee.work,{bits:9}),oe=0;oe<32;)ee.lens[oe++]=5;(0,p.default)(h,ee.lens,0,32,je,0,ee.work,{bits:5}),Ye=!1}ee.lencode=et,ee.lenbits=9,ee.distcode=je,ee.distbits=5}function ce(ee,oe,Q,me){var Oe,V=ee.state;return V.window===null&&(V.wsize=1<<V.wbits,V.wnext=0,V.whave=0,V.window=new L.Buf8(V.wsize)),me>=V.wsize?(L.arraySet(V.window,oe,Q-V.wsize,V.wsize,0),V.wnext=0,V.whave=V.wsize):(Oe=V.wsize-V.wnext,Oe>me&&(Oe=me),L.arraySet(V.window,oe,Q-me,Oe,V.wnext),me-=Oe,me?(L.arraySet(V.window,oe,Q-me,me,0),V.wnext=me,V.whave=V.wsize):(V.wnext+=Oe,V.wnext===V.wsize&&(V.wnext=0),V.whave<V.wsize&&(V.whave+=Oe))),0}function Pe(ee,oe){var Q,me,Oe,V,Re,Xe,pe,ke,Ve,ht,tt,at,ut,Ft,St=0,vt,Bt,Nt,dt,Ut,gt,pt,Ct,It=new L.Buf8(4),Xt,At,bt=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!ee||!ee.state||!ee.output||!ee.input&&ee.avail_in!==0)return d;Q=ee.state,Q.mode===A&&(Q.mode=K),Re=ee.next_out,Oe=ee.output,pe=ee.avail_out,V=ee.next_in,me=ee.input,Xe=ee.avail_in,ke=Q.hold,Ve=Q.bits,ht=Xe,tt=pe,Ct=r;e:for(;;)switch(Q.mode){case C:if(Q.wrap===0){Q.mode=K;break}for(;Ve<16;){if(Xe===0)break e;Xe--,ke+=me[V++]<<Ve,Ve+=8}if(Q.wrap&2&&ke===35615){Q.check=0,It[0]=ke&255,It[1]=ke>>>8&255,Q.check=(0,R.default)(Q.check,It,2,0),ke=0,Ve=0,Q.mode=_;break}if(Q.flags=0,Q.head&&(Q.head.done=!1),!(Q.wrap&1)||(((ke&255)<<8)+(ke>>8))%31){ee.msg="incorrect header check",Q.mode=Ge;break}if((ke&15)!==S){ee.msg="unknown compression method",Q.mode=Ge;break}if(ke>>>=4,Ve-=4,pt=(ke&15)+8,Q.wbits===0)Q.wbits=pt;else if(pt>Q.wbits){ee.msg="invalid window size",Q.mode=Ge;break}Q.dmax=1<<pt,ee.adler=Q.check=1,Q.mode=ke&512?X:A,ke=0,Ve=0;break;case _:for(;Ve<16;){if(Xe===0)break e;Xe--,ke+=me[V++]<<Ve,Ve+=8}if(Q.flags=ke,(Q.flags&255)!==S){ee.msg="unknown compression method",Q.mode=Ge;break}if(Q.flags&57344){ee.msg="unknown header flags set",Q.mode=Ge;break}Q.head&&(Q.head.text=ke>>8&1),Q.flags&512&&(It[0]=ke&255,It[1]=ke>>>8&255,Q.check=(0,R.default)(Q.check,It,2,0)),ke=0,Ve=0,Q.mode=y;case y:for(;Ve<32;){if(Xe===0)break e;Xe--,ke+=me[V++]<<Ve,Ve+=8}Q.head&&(Q.head.time=ke),Q.flags&512&&(It[0]=ke&255,It[1]=ke>>>8&255,It[2]=ke>>>16&255,It[3]=ke>>>24&255,Q.check=(0,R.default)(Q.check,It,4,0)),ke=0,Ve=0,Q.mode=T;case T:for(;Ve<16;){if(Xe===0)break e;Xe--,ke+=me[V++]<<Ve,Ve+=8}Q.head&&(Q.head.xflags=ke&255,Q.head.os=ke>>8),Q.flags&512&&(It[0]=ke&255,It[1]=ke>>>8&255,Q.check=(0,R.default)(Q.check,It,2,0)),ke=0,Ve=0,Q.mode=O;case O:if(Q.flags&1024){for(;Ve<16;){if(Xe===0)break e;Xe--,ke+=me[V++]<<Ve,Ve+=8}Q.length=ke,Q.head&&(Q.head.extra_len=ke),Q.flags&512&&(It[0]=ke&255,It[1]=ke>>>8&255,Q.check=(0,R.default)(Q.check,It,2,0)),ke=0,Ve=0}else Q.head&&(Q.head.extra=null);Q.mode=g;case g:if(Q.flags&1024&&(at=Q.length,at>Xe&&(at=Xe),at&&(Q.head&&(pt=Q.head.extra_len-Q.length,Q.head.extra||(Q.head.extra=new Array(Q.head.extra_len)),L.arraySet(Q.head.extra,me,V,at,pt)),Q.flags&512&&(Q.check=(0,R.default)(Q.check,me,at,V)),Xe-=at,V+=at,Q.length-=at),Q.length))break e;Q.length=0,Q.mode=F;case F:if(Q.flags&2048){if(Xe===0)break e;at=0;do pt=me[V+at++],Q.head&&pt&&Q.length<65536&&(Q.head.name+=String.fromCharCode(pt));while(pt&&at<Xe);if(Q.flags&512&&(Q.check=(0,R.default)(Q.check,me,at,V)),Xe-=at,V+=at,pt)break e}else Q.head&&(Q.head.name=null);Q.length=0,Q.mode=P;case P:if(Q.flags&4096){if(Xe===0)break e;at=0;do pt=me[V+at++],Q.head&&pt&&Q.length<65536&&(Q.head.comment+=String.fromCharCode(pt));while(pt&&at<Xe);if(Q.flags&512&&(Q.check=(0,R.default)(Q.check,me,at,V)),Xe-=at,V+=at,pt)break e}else Q.head&&(Q.head.comment=null);Q.mode=N;case N:if(Q.flags&512){for(;Ve<16;){if(Xe===0)break e;Xe--,ke+=me[V++]<<Ve,Ve+=8}if(ke!==(Q.check&65535)){ee.msg="header crc mismatch",Q.mode=Ge;break}ke=0,Ve=0}Q.head&&(Q.head.hcrc=Q.flags>>9&1,Q.head.done=!0),ee.adler=Q.check=0,Q.mode=A;break;case X:for(;Ve<32;){if(Xe===0)break e;Xe--,ke+=me[V++]<<Ve,Ve+=8}ee.adler=Q.check=xe(ke),ke=0,Ve=0,Q.mode=j;case j:if(Q.havedict===0)return ee.next_out=Re,ee.avail_out=pe,ee.next_in=V,ee.avail_in=Xe,Q.hold=ke,Q.bits=Ve,u;ee.adler=Q.check=1,Q.mode=A;case A:if(oe===a||oe===t)break e;case K:if(Q.last){ke>>>=Ve&7,Ve-=Ve&7,Q.mode=he;break}for(;Ve<3;){if(Xe===0)break e;Xe--,ke+=me[V++]<<Ve,Ve+=8}Q.last=ke&1,ke>>>=1,Ve-=1;switch(ke&3){case 0:Q.mode=U;break;case 1:if(ot(Q),Q.mode=We,oe===t){ke>>>=2,Ve-=2;break e}break;case 2:Q.mode=te;break;case 3:ee.msg="invalid block type",Q.mode=Ge}ke>>>=2,Ve-=2;break;case U:for(ke>>>=Ve&7,Ve-=Ve&7;Ve<32;){if(Xe===0)break e;Xe--,ke+=me[V++]<<Ve,Ve+=8}if((ke&65535)!==(ke>>>16^65535)){ee.msg="invalid stored block lengths",Q.mode=Ge;break}if(Q.length=ke&65535,ke=0,Ve=0,Q.mode=k,oe===t)break e;case k:Q.mode=z;case z:if(at=Q.length,at){if(at>Xe&&(at=Xe),at>pe&&(at=pe),at===0)break e;L.arraySet(Oe,me,V,at,Re),Xe-=at,V+=at,pe-=at,Re+=at,Q.length-=at;break}Q.mode=A;break;case te:for(;Ve<14;){if(Xe===0)break e;Xe--,ke+=me[V++]<<Ve,Ve+=8}if(Q.nlen=(ke&31)+257,ke>>>=5,Ve-=5,Q.ndist=(ke&31)+1,ke>>>=5,Ve-=5,Q.ncode=(ke&15)+4,ke>>>=4,Ve-=4,Q.nlen>286||Q.ndist>30){ee.msg="too many length or distance symbols",Q.mode=Ge;break}Q.have=0,Q.mode=de;case de:for(;Q.have<Q.ncode;){for(;Ve<3;){if(Xe===0)break e;Xe--,ke+=me[V++]<<Ve,Ve+=8}Q.lens[bt[Q.have++]]=ke&7,ke>>>=3,Ve-=3}for(;Q.have<19;)Q.lens[bt[Q.have++]]=0;if(Q.lencode=Q.lendyn,Q.lenbits=7,Xt={bits:Q.lenbits},Ct=(0,p.default)(c,Q.lens,0,19,Q.lencode,0,Q.work,Xt),Q.lenbits=Xt.bits,Ct){ee.msg="invalid code lengths set",Q.mode=Ge;break}Q.have=0,Q.mode=be;case be:for(;Q.have<Q.nlen+Q.ndist;){for(;!(St=Q.lencode[ke&(1<<Q.lenbits)-1],vt=St>>>24,Bt=St>>>16&255,Nt=St&65535,vt<=Ve);){if(Xe===0)break e;Xe--,ke+=me[V++]<<Ve,Ve+=8}if(Nt<16)ke>>>=vt,Ve-=vt,Q.lens[Q.have++]=Nt;else{if(Nt===16){for(At=vt+2;Ve<At;){if(Xe===0)break e;Xe--,ke+=me[V++]<<Ve,Ve+=8}if(ke>>>=vt,Ve-=vt,Q.have===0){ee.msg="invalid bit length repeat",Q.mode=Ge;break}pt=Q.lens[Q.have-1],at=3+(ke&3),ke>>>=2,Ve-=2}else if(Nt===17){for(At=vt+3;Ve<At;){if(Xe===0)break e;Xe--,ke+=me[V++]<<Ve,Ve+=8}ke>>>=vt,Ve-=vt,pt=0,at=3+(ke&7),ke>>>=3,Ve-=3}else{for(At=vt+7;Ve<At;){if(Xe===0)break e;Xe--,ke+=me[V++]<<Ve,Ve+=8}ke>>>=vt,Ve-=vt,pt=0,at=11+(ke&127),ke>>>=7,Ve-=7}if(Q.have+at>Q.nlen+Q.ndist){ee.msg="invalid bit length repeat",Q.mode=Ge;break}for(;at--;)Q.lens[Q.have++]=pt}}if(Q.mode===Ge)break;if(Q.lens[256]===0){ee.msg="invalid code -- missing end-of-block",Q.mode=Ge;break}if(Q.lenbits=9,Xt={bits:Q.lenbits},Ct=(0,p.default)(o,Q.lens,0,Q.nlen,Q.lencode,0,Q.work,Xt),Q.lenbits=Xt.bits,Ct){ee.msg="invalid literal/lengths set",Q.mode=Ge;break}if(Q.distbits=6,Q.distcode=Q.distdyn,Xt={bits:Q.distbits},Ct=(0,p.default)(h,Q.lens,Q.nlen,Q.ndist,Q.distcode,0,Q.work,Xt),Q.distbits=Xt.bits,Ct){ee.msg="invalid distances set",Q.mode=Ge;break}if(Q.mode=We,oe===t)break e;case We:Q.mode=Ne;case Ne:if(Xe>=6&&pe>=258){ee.next_out=Re,ee.avail_out=pe,ee.next_in=V,ee.avail_in=Xe,Q.hold=ke,Q.bits=Ve,(0,M.default)(ee,tt),Re=ee.next_out,Oe=ee.output,pe=ee.avail_out,V=ee.next_in,me=ee.input,Xe=ee.avail_in,ke=Q.hold,Ve=Q.bits,Q.mode===A&&(Q.back=-1);break}for(Q.back=0;!(St=Q.lencode[ke&(1<<Q.lenbits)-1],vt=St>>>24,Bt=St>>>16&255,Nt=St&65535,vt<=Ve);){if(Xe===0)break e;Xe--,ke+=me[V++]<<Ve,Ve+=8}if(Bt&&(Bt&240)===0){for(dt=vt,Ut=Bt,gt=Nt;!(St=Q.lencode[gt+((ke&(1<<dt+Ut)-1)>>dt)],vt=St>>>24,Bt=St>>>16&255,Nt=St&65535,dt+vt<=Ve);){if(Xe===0)break e;Xe--,ke+=me[V++]<<Ve,Ve+=8}ke>>>=dt,Ve-=dt,Q.back+=dt}if(ke>>>=vt,Ve-=vt,Q.back+=vt,Q.length=Nt,Bt===0){Q.mode=Se;break}if(Bt&32){Q.back=-1,Q.mode=A;break}if(Bt&64){ee.msg="invalid literal/length code",Q.mode=Ge;break}Q.extra=Bt&15,Q.mode=Le;case Le:if(Q.extra){for(At=Q.extra;Ve<At;){if(Xe===0)break e;Xe--,ke+=me[V++]<<Ve,Ve+=8}Q.length+=ke&(1<<Q.extra)-1,ke>>>=Q.extra,Ve-=Q.extra,Q.back+=Q.extra}Q.was=Q.length,Q.mode=Ke;case Ke:for(;!(St=Q.distcode[ke&(1<<Q.distbits)-1],vt=St>>>24,Bt=St>>>16&255,Nt=St&65535,vt<=Ve);){if(Xe===0)break e;Xe--,ke+=me[V++]<<Ve,Ve+=8}if((Bt&240)===0){for(dt=vt,Ut=Bt,gt=Nt;!(St=Q.distcode[gt+((ke&(1<<dt+Ut)-1)>>dt)],vt=St>>>24,Bt=St>>>16&255,Nt=St&65535,dt+vt<=Ve);){if(Xe===0)break e;Xe--,ke+=me[V++]<<Ve,Ve+=8}ke>>>=dt,Ve-=dt,Q.back+=dt}if(ke>>>=vt,Ve-=vt,Q.back+=vt,Bt&64){ee.msg="invalid distance code",Q.mode=Ge;break}Q.offset=Nt,Q.extra=Bt&15,Q.mode=He;case He:if(Q.extra){for(At=Q.extra;Ve<At;){if(Xe===0)break e;Xe--,ke+=me[V++]<<Ve,Ve+=8}Q.offset+=ke&(1<<Q.extra)-1,ke>>>=Q.extra,Ve-=Q.extra,Q.back+=Q.extra}if(Q.offset>Q.dmax){ee.msg="invalid distance too far back",Q.mode=Ge;break}Q.mode=Ae;case Ae:if(pe===0)break e;if(at=tt-pe,Q.offset>at){if(at=Q.offset-at,at>Q.whave&&Q.sane){ee.msg="invalid distance too far back",Q.mode=Ge;break}at>Q.wnext?(at-=Q.wnext,ut=Q.wsize-at):ut=Q.wnext-at,at>Q.length&&(at=Q.length),Ft=Q.window}else Ft=Oe,ut=Re-Q.offset,at=Q.length;at>pe&&(at=pe),pe-=at,Q.length-=at;do Oe[Re++]=Ft[ut++];while(--at);Q.length===0&&(Q.mode=Ne);break;case Se:if(pe===0)break e;Oe[Re++]=Q.length,pe--,Q.mode=Ne;break;case he:if(Q.wrap){for(;Ve<32;){if(Xe===0)break e;Xe--,ke|=me[V++]<<Ve,Ve+=8}if(tt-=pe,ee.total_out+=tt,Q.total+=tt,tt&&(ee.adler=Q.check=Q.flags?(0,R.default)(Q.check,Oe,tt,Re-tt):(0,I.default)(Q.check,Oe,tt,Re-tt)),tt=pe,(Q.flags?ke:xe(ke))!==Q.check){ee.msg="incorrect data check",Q.mode=Ge;break}ke=0,Ve=0}Q.mode=Ie;case Ie:if(Q.wrap&&Q.flags){for(;Ve<32;){if(Xe===0)break e;Xe--,ke+=me[V++]<<Ve,Ve+=8}if(ke!==(Q.total&4294967295)){ee.msg="incorrect length check",Q.mode=Ge;break}ke=0,Ve=0}Q.mode=ye;case ye:Ct=s;break e;case Ge:Ct=f;break e;case $e:return v;case ze:default:return d}return ee.next_out=Re,ee.avail_out=pe,ee.next_in=V,ee.avail_in=Xe,Q.hold=ke,Q.bits=Ve,(Q.wsize||tt!==ee.avail_out&&Q.mode<Ge&&(Q.mode<he||oe!==n))&&ce(ee,ee.output,ee.next_out,tt-ee.avail_out)?(Q.mode=$e,v):(ht-=ee.avail_in,tt-=ee.avail_out,ee.total_in+=ht,ee.total_out+=tt,Q.total+=tt,Q.wrap&&tt&&(ee.adler=Q.check=Q.flags?(0,R.default)(Q.check,Oe,tt,ee.next_out-tt):(0,I.default)(Q.check,Oe,tt,ee.next_out-tt)),ee.data_type=Q.bits+(Q.last?64:0)+(Q.mode===A?128:0)+(Q.mode===We||Q.mode===k?256:0),(ht===0&&tt===0||oe===n)&&Ct===r&&(Ct=m),Ct)}function Fe(ee){if(!ee||!ee.state)return d;var oe=ee.state;return oe.window&&(oe.window=null),ee.state=null,r}function Ce(ee,oe){var Q;return!ee||!ee.state?d:(Q=ee.state,(Q.wrap&2)===0?d:(Q.head=oe,oe.done=!1,r))}function _e(ee,oe){var Q=oe.length,me,Oe,V;return!ee||!ee.state?d:(me=ee.state,me.wrap!==0&&me.mode!==j?d:me.mode===j&&(Oe=1,Oe=(0,I.default)(Oe,oe,Q,0),Oe!==me.check)?f:(V=ce(ee,oe,Q,Q),V?(me.mode=$e,v):(me.havedict=1,r)))}var Ee="pako inflate (from Nodeca project)";ne.inflateInfo=Ee},fjLI:function(it,ne,q){"use strict";q.d(ne,"f",function(){return n}),q.d(ne,"b",function(){return a}),q.d(ne,"a",function(){return t}),q.d(ne,"d",function(){return r}),q.d(ne,"e",function(){return s}),q.d(ne,"c",function(){return u});var G=q("8HAY"),L=q("Vhoy"),I=q("MI8n"),R=q("JYp7"),M=q("pmY6"),p=q("24hK"),E=q("nnTU"),b=q("T8No"),i=q("Cg/j"),c=q("t9D7"),o=function(d,f,v,m){var S=arguments.length,C=S<3?f:m===null?m=Object.getOwnPropertyDescriptor(f,v):m,_;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")C=Reflect.decorate(d,f,v,m);else for(var y=d.length-1;y>=0;y--)(_=d[y])&&(C=(S<3?_(C):S>3?_(f,v,C):_(f,v))||C);return S>3&&C&&Object.defineProperty(f,v,C),C},h=function(d,f){return function(v,m){f(v,m,d)}};function n(d){return d.command!==void 0}class a{constructor(d){this.id=a._idPool++,this._debugName=d}}a._idPool=0,a.CommandPalette=new a("CommandPalette"),a.EditorContext=new a("EditorContext"),a.SimpleEditorContext=new a("SimpleEditorContext"),a.EditorContextCopy=new a("EditorContextCopy"),a.EditorContextPeek=new a("EditorContextPeek"),a.MenubarEditMenu=new a("MenubarEditMenu"),a.MenubarCopy=new a("MenubarCopy"),a.MenubarGoMenu=new a("MenubarGoMenu"),a.MenubarSelectionMenu=new a("MenubarSelectionMenu"),a.InlineCompletionsActions=new a("InlineCompletionsActions");const t=Object(i.c)("menuService"),r=new class{constructor(){this._commands=new Map,this._menuItems=new Map,this._onDidChangeMenu=new I.b,this.onDidChangeMenu=this._onDidChangeMenu.event,this._commandPaletteChangeEvent={has:d=>d===a.CommandPalette}}addCommand(d){return this.addCommands(R.a.single(d))}addCommands(d){for(const f of d)this._commands.set(f.id,f);return this._onDidChangeMenu.fire(this._commandPaletteChangeEvent),Object(M.i)(()=>{let f=!1;for(const v of d)f=this._commands.delete(v.id)||f;f&&this._onDidChangeMenu.fire(this._commandPaletteChangeEvent)})}getCommand(d){return this._commands.get(d)}getCommands(){const d=new Map;return this._commands.forEach((f,v)=>d.set(v,f)),d}appendMenuItem(d,f){return this.appendMenuItems(R.a.single({id:d,item:f}))}appendMenuItems(d){const f=new Set,v=new p.a;for(const{id:m,item:S}of d){let C=this._menuItems.get(m);C||(C=new p.a,this._menuItems.set(m,C)),v.push(C.push(S)),f.add(m)}return this._onDidChangeMenu.fire(f),Object(M.i)(()=>{if(v.size>0){for(let m of v)m();this._onDidChangeMenu.fire(f),v.clear()}})}getMenuItems(d){let f;return this._menuItems.has(d)?f=[...this._menuItems.get(d)]:f=[],d===a.CommandPalette&&this._appendImplicitItems(f),f}_appendImplicitItems(d){const f=new Set;for(const v of d)n(v)&&(f.add(v.command.id),v.alt&&f.add(v.alt.id));this._commands.forEach((v,m)=>{f.has(m)||d.push({command:v})})}};class s extends G.e{constructor(d,f,v,m){super(`submenuitem.${d.submenu.id}`,typeof d.title=="string"?d.title:d.title.value,[],"submenu");this.item=d,this._menuService=f,this._contextKeyService=v,this._options=m}get actions(){const d=[],f=this._menuService.createMenu(this.item.submenu,this._contextKeyService),v=f.getActions(this._options);f.dispose();for(const[,m]of v)m.length>0&&(d.push(...m),d.push(new G.d));return d.length&&d.pop(),d}}let u=class d{constructor(f,v,m,S,C){var _,y;if(this._commandService=C,this.id=f.id,this.label=(m==null?void 0:m.renderShortTitle)&&f.shortTitle?typeof f.shortTitle=="string"?f.shortTitle:f.shortTitle.value:typeof f.title=="string"?f.title:f.title.value,this.tooltip=(y=typeof f.tooltip=="string"?f.tooltip:(_=f.tooltip)===null||_===void 0?void 0:_.value)!==null&&y!==void 0?y:"",this.enabled=!f.precondition||S.contextMatchesRules(f.precondition),this.checked=void 0,f.toggled){const T=f.toggled.condition?f.toggled:{condition:f.toggled};this.checked=S.contextMatchesRules(T.condition),this.checked&&T.tooltip&&(this.tooltip=typeof T.tooltip=="string"?T.tooltip:T.tooltip.value),T.title&&(this.label=typeof T.title=="string"?T.title:T.title.value)}this.item=f,this.alt=v?new d(v,void 0,m,S,C):void 0,this._options=m,c.d.isThemeIcon(f.icon)&&(this.class=L.a.asClassName(f.icon))}dispose(){}run(...f){var v,m;let S=[];return((v=this._options)===null||v===void 0?void 0:v.arg)&&(S=[...S,this._options.arg]),((m=this._options)===null||m===void 0?void 0:m.shouldForwardArgs)&&(S=[...S,...f]),this._commandService.executeCommand(this.id,...S)}};u=o([h(3,b.b),h(4,E.b)],u)},gIYZ:function(it,ne,q){"use strict";Object.defineProperty(ne,"__esModule",{value:!0}),ne.default=void 0;var G={Backspace:"Backspace",AltLeft:"Alt",AltRight:"Alt",CapsLock:"CapsLock",ContextMenu:"ContextMenu",ControlLeft:"Control",ControlRight:"Control",Enter:"Enter",MetaLeft:"Meta",MetaRight:"Meta",ShiftLeft:"Shift",ShiftRight:"Shift",Tab:"Tab",Delete:"Delete",End:"End",Help:"Help",Home:"Home",Insert:"Insert",PageDown:"PageDown",PageUp:"PageUp",ArrowDown:"ArrowDown",ArrowLeft:"ArrowLeft",ArrowRight:"ArrowRight",ArrowUp:"ArrowUp",NumLock:"NumLock",NumpadBackspace:"Backspace",NumpadClear:"Clear",Escape:"Escape",F1:"F1",F2:"F2",F3:"F3",F4:"F4",F5:"F5",F6:"F6",F7:"F7",F8:"F8",F9:"F9",F10:"F10",F11:"F11",F12:"F12",F13:"F13",F14:"F14",F15:"F15",F16:"F16",F17:"F17",F18:"F18",F19:"F19",F20:"F20",F21:"F21",F22:"F22",F23:"F23",F24:"F24",F25:"F25",F26:"F26",F27:"F27",F28:"F28",F29:"F29",F30:"F30",F31:"F31",F32:"F32",F33:"F33",F34:"F34",F35:"F35",PrintScreen:"PrintScreen",ScrollLock:"ScrollLock",Pause:"Pause",BrowserBack:"BrowserBack",BrowserFavorites:"BrowserFavorites",BrowserForward:"BrowserForward",BrowserHome:"BrowserHome",BrowserRefresh:"BrowserRefresh",BrowserSearch:"BrowserSearch",BrowserStop:"BrowserStop",Eject:"Eject",LaunchApp1:"LaunchMyComputer",LaunchApp2:"LaunchCalendar",LaunchMail:"LaunchMail",MediaPlayPause:"MediaPlay",MediaStop:"MediaStop",MediaTrackNext:"MediaTrackNext",MediaTrackPrevious:"MediaTrackPrevious",Power:"Power",Sleep:"Sleep",AudioVolumeDown:"AudioVolumeDown",AudioVolumeMute:"AudioVolumeMute",AudioVolumeUp:"AudioVolumeUp",WakeUp:"WakeUp"};ne.default=G},h78n:function(it,ne,q){"use strict";q.d(ne,"a",function(){return N});var G=q("q1tI"),L=q.n(G),I=q("TSYQ"),R=q.n(I),M={className:"",percent:0,prefixCls:"rc-progress",strokeColor:"#2db7f5",strokeLinecap:"round",strokeWidth:1,style:{},trailColor:"#D9D9D9",trailWidth:1},p=function(A){var K=A.map(function(){return Object(G.useRef)()}),U=Object(G.useRef)();return Object(G.useEffect)(function(){var k=Date.now(),z=!1;Object.keys(K).forEach(function(te){var de=K[te].current;if(!de)return;z=!0;var be=de.style;be.transitionDuration=".3s, .3s, .3s, .06s",U.current&&k-U.current<100&&(be.transitionDuration="0s, 0s")}),z&&(U.current=Date.now())}),[K]};function E(){return E=Object.assign||function(j){for(var A=1;A<arguments.length;A++){var K=arguments[A];for(var U in K)Object.prototype.hasOwnProperty.call(K,U)&&(j[U]=K[U])}return j},E.apply(this,arguments)}function b(j,A){return n(j)||h(j,A)||c(j,A)||i()}function i(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function c(j,A){if(!j)return;if(typeof j=="string")return o(j,A);var K=Object.prototype.toString.call(j).slice(8,-1);if(K==="Object"&&j.constructor&&(K=j.constructor.name),K==="Map"||K==="Set")return Array.from(j);if(K==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(K))return o(j,A)}function o(j,A){(A==null||A>j.length)&&(A=j.length);for(var K=0,U=new Array(A);K<A;K++)U[K]=j[K];return U}function h(j,A){if(typeof Symbol=="undefined"||!(Symbol.iterator in Object(j)))return;var K=[],U=!0,k=!1,z=void 0;try{for(var te=j[Symbol.iterator](),de;!(U=(de=te.next()).done)&&!(K.push(de.value),A&&K.length===A);U=!0);}catch(be){k=!0,z=be}finally{try{!U&&te.return!=null&&te.return()}finally{if(k)throw z}}return K}function n(j){if(Array.isArray(j))return j}function a(j,A){if(j==null)return{};var K=t(j,A),U,k;if(Object.getOwnPropertySymbols){var z=Object.getOwnPropertySymbols(j);for(k=0;k<z.length;k++){if(U=z[k],A.indexOf(U)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(j,U))continue;K[U]=j[U]}}return K}function t(j,A){if(j==null)return{};var K={},U=Object.keys(j),k,z;for(z=0;z<U.length;z++){if(k=U[z],A.indexOf(k)>=0)continue;K[k]=j[k]}return K}var r=function(A){var K=A.className,U=A.percent,k=A.prefixCls,z=A.strokeColor,te=A.strokeLinecap,de=A.strokeWidth,be=A.style,We=A.trailColor,Ne=A.trailWidth,Le=A.transition,Ke=a(A,["className","percent","prefixCls","strokeColor","strokeLinecap","strokeWidth","style","trailColor","trailWidth","transition"]);delete Ke.gapPosition;var He=Array.isArray(U)?U:[U],Ae=Array.isArray(z)?z:[z],Se=p(He),he=b(Se,1),Ie=he[0],ye=de/2,Ge=100-de/2,$e="M ".concat(te==="round"?ye:0,",").concat(ye,`
|
|
|
L `).concat(te==="round"?Ge:100,",").concat(ye),ze="0 0 100 ".concat(de),Je=0;return L.a.createElement("svg",E({className:R()("".concat(k,"-line"),K),viewBox:ze,preserveAspectRatio:"none",style:be},Ke),L.a.createElement("path",{className:"".concat(k,"-line-trail"),d:$e,strokeLinecap:te,stroke:We,strokeWidth:Ne||de,fillOpacity:"0"}),He.map(function(Qe,fe){var ge={strokeDasharray:"".concat(Qe,"px, 100px"),strokeDashoffset:"-".concat(Je,"px"),transition:Le||"stroke-dashoffset 0.3s ease 0s, stroke-dasharray .3s ease 0s, stroke 0.3s linear"},xe=Ae[fe]||Ae[Ae.length-1];return Je+=Qe,L.a.createElement("path",{key:fe,className:"".concat(k,"-line-path"),d:$e,strokeLinecap:te,stroke:xe,strokeWidth:de,fillOpacity:"0",ref:Ie[fe],style:ge})}))};r.defaultProps=M;var s=r;function u(){return u=Object.assign||function(j){for(var A=1;A<arguments.length;A++){var K=arguments[A];for(var U in K)Object.prototype.hasOwnProperty.call(K,U)&&(j[U]=K[U])}return j},u.apply(this,arguments)}function d(j,A){return C(j)||S(j,A)||v(j,A)||f()}function f(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function v(j,A){if(!j)return;if(typeof j=="string")return m(j,A);var K=Object.prototype.toString.call(j).slice(8,-1);if(K==="Object"&&j.constructor&&(K=j.constructor.name),K==="Map"||K==="Set")return Array.from(j);if(K==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(K))return m(j,A)}function m(j,A){(A==null||A>j.length)&&(A=j.length);for(var K=0,U=new Array(A);K<A;K++)U[K]=j[K];return U}function S(j,A){if(typeof Symbol=="undefined"||!(Symbol.iterator in Object(j)))return;var K=[],U=!0,k=!1,z=void 0;try{for(var te=j[Symbol.iterator](),de;!(U=(de=te.next()).done)&&!(K.push(de.value),A&&K.length===A);U=!0);}catch(be){k=!0,z=be}finally{try{!U&&te.return!=null&&te.return()}finally{if(k)throw z}}return K}function C(j){if(Array.isArray(j))return j}function _(j,A){if(j==null)return{};var K=y(j,A),U,k;if(Object.getOwnPropertySymbols){var z=Object.getOwnPropertySymbols(j);for(k=0;k<z.length;k++){if(U=z[k],A.indexOf(U)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(j,U))continue;K[U]=j[U]}}return K}function y(j,A){if(j==null)return{};var K={},U=Object.keys(j),k,z;for(z=0;z<U.length;z++){if(k=U[z],A.indexOf(k)>=0)continue;K[k]=j[k]}return K}var T=0;function O(j){return+j.replace("%","")}function g(j){return Array.isArray(j)?j:[j]}function F(j,A,K,U){var k=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0,z=arguments.length>5?arguments[5]:void 0,te=50-U/2,de=0,be=-te,We=0,Ne=-2*te;switch(z){case"left":de=-te,be=0,We=2*te,Ne=0;break;case"right":de=te,be=0,We=-2*te,Ne=0;break;case"bottom":be=te,Ne=2*te;break;default:}var Le="M 50,50 m ".concat(de,",").concat(be,`
|
|
|
a `).concat(te,",").concat(te," 0 1 1 ").concat(We,",").concat(-Ne,`
|
|
|
a `).concat(te,",").concat(te," 0 1 1 ").concat(-We,",").concat(Ne),Ke=Math.PI*2*te,He={stroke:K,strokeDasharray:"".concat(A/100*(Ke-k),"px ").concat(Ke,"px"),strokeDashoffset:"-".concat(k/2+j/100*(Ke-k),"px"),transition:"stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s, stroke-width .06s ease .3s"};return{pathString:Le,pathStyle:He}}var P=function(A){var K=A.prefixCls,U=A.strokeWidth,k=A.trailWidth,z=A.gapDegree,te=A.gapPosition,de=A.trailColor,be=A.strokeLinecap,We=A.style,Ne=A.className,Le=A.strokeColor,Ke=A.percent,He=_(A,["prefixCls","strokeWidth","trailWidth","gapDegree","gapPosition","trailColor","strokeLinecap","style","className","strokeColor","percent"]),Ae=Object(G.useMemo)(function(){return T+=1,T},[]),Se=F(0,100,de,U,z,te),he=Se.pathString,Ie=Se.pathStyle,ye=g(Ke),Ge=g(Le),$e=Ge.find(function(ge){return Object.prototype.toString.call(ge)==="[object Object]"}),ze=p(ye),Je=d(ze,1),Qe=Je[0],fe=function(){var xe=0;return ye.map(function(we,Te){var re=Ge[Te]||Ge[Ge.length-1],ve=Object.prototype.toString.call(re)==="[object Object]"?"url(#".concat(K,"-gradient-").concat(Ae,")"):"",ae=F(xe,we,re,U,z,te);return xe+=we,L.a.createElement("path",{key:Te,className:"".concat(K,"-circle-path"),d:ae.pathString,stroke:ve,strokeLinecap:be,strokeWidth:U,opacity:we===0?0:1,fillOpacity:"0",style:ae.pathStyle,ref:Qe[Te]})})};return L.a.createElement("svg",u({className:R()("".concat(K,"-circle"),Ne),viewBox:"0 0 100 100",style:We},He),$e&&L.a.createElement("defs",null,L.a.createElement("linearGradient",{id:"".concat(K,"-gradient-").concat(Ae),x1:"100%",y1:"0%",x2:"0%",y2:"0%"},Object.keys($e).sort(function(ge,xe){return O(ge)-O(xe)}).map(function(ge,xe){return L.a.createElement("stop",{key:xe,offset:ge,stopColor:$e[ge]})}))),L.a.createElement("path",{className:"".concat(K,"-circle-trail"),d:he,stroke:de,strokeLinecap:be,strokeWidth:k||U,fillOpacity:"0",style:Ie}),fe().reverse())};P.defaultProps=M;var N=P,X={Line:s,Circle:N}},hXwI:function(it,ne,q){"use strict";Object.defineProperty(ne,"__esModule",{value:!0}),ne.default=void 0;function G(M,p){if(!(M instanceof p))throw new TypeError("Cannot call a class as a function")}function L(M,p){for(var E=0;E<p.length;E++){var b=p[E];b.enumerable=b.enumerable||!1,b.configurable=!0,"value"in b&&(b.writable=!0),Object.defineProperty(M,b.key,b)}}function I(M,p,E){return p&&L(M.prototype,p),E&&L(M,E),M}var R=function(){function M(){G(this,M)}return I(M,[{key:"decodeRect",value:function(E,b,i,c,o,h,n){if(o.rQwait("COPYRECT",4))return!1;var a=o.rQshift16(),t=o.rQshift16();return h.copyImage(a,t,E,b,i,c),!0}}]),M}();ne.default=R},iJb0:function(it,ne,q){"use strict";q.r(ne);var G=q("+L6B"),L=q("2/Rp"),I=q("miYZ"),R=q("tsqr"),M=q("14J3"),p=q("BMrR"),E=q("jCWc"),b=q("kPKH"),i=q("k1fw"),c=q("9og8"),o=q("2qtc"),h=q("kLXV"),n=q("tJVT"),a=q("aHsQ"),t=q("sGsY"),r=q("WmNS"),s=q.n(r),u=q("q1tI"),d=q.n(u),f=q("Ty5D"),v=q("9kvl"),m=q("Lmeb"),S=q("Ot1p"),C=q("rAM+"),_=q("J66h"),y=q("/POA"),T=q("q7KB"),O=q("OqJ7"),g=q.n(O),F=q("dhSg"),P=q("bdgK");function N(Qe,fe,ge){var xe=ge._core._renderService.dimensions.actualCellWidth||9.5,we=ge._core._renderService.dimensions.actualCellHeight||18,Te=Math.floor(fe/we),re=Math.floor(Qe/xe);return[re,Te]}function X(Qe,fe){var ge=new P.default(function(xe){var we=Object(C.a)(xe),Te;try{for(we.s();!(Te=we.n()).done;){var re=Te.value;if(re.target.offsetHeight>0||re.target.offsetWidth>0){var ve=N(re.target.offsetWidth,re.target.offsetHeight,Qe),ae=Object(n.a)(ve,2),Me=ae[0],Ye=ae[1];console.log("cols, rows",Me,Ye),F.a.publish("ssh-xterm-resize",{columns:Me,rows:Ye,width:re.target.offsetWidth,height:re.target.offsetHeight}),Qe.resize(Me,Ye);var et=_.Base64.decode("IA=="),je=_.Base64.decode("CBtbSw==");Qe.write(et),Qe.write(je)}}}catch(ot){we.e(ot)}finally{we.f()}});return ge.observe(fe),ge}var j=3e4,A=function(Qe){var fe=Qe.sshConfigData,ge=Qe.sid,xe=Object(u.useState)(null),we=Object(n.a)(xe,2),Te=we[0],re=we[1],ve=fe.ws_url,ae=fe.password,Me=fe.port,Ye=Object(u.useRef)(),et=Object(u.useRef)(),je=Object(u.useRef)(!1);return Object(u.useEffect)(function(){if(Ye.current&&ve){var ot=new y.Terminal({fontSize:16,rendererType:"dom"});ot.open(Ye.current),ot.onData(function(Pe){et.current&&(et.current.readyState===1&&(et.current.send(JSON.stringify({tp:"client",data:Pe})),F.a.publish("on-operating-ssh")))}),ot.write("Connecting..."),re(ot);var ce=X(ot,Ye.current);return function(){ot.dispose(),ce.unobserve(Ye.current)}}},[ve,Ye.current]),Object(u.useEffect)(function(){if(Te&&ve){function ot(){var Ee=new WebSocket(ve);et.current=Ee,Ee.onopen=function(){var ee=Te.element.parentElement;if(ee){var oe=ee.offsetWidth,Q=ee.offsetHeight;console.log("init",{tp:"init",data:Object(i.a)(Object(i.a)({},fe),{},{secret:ae,width:oe,height:Q,rows:Te.rows,columns:Te.cols})}),Ee.send(JSON.stringify({tp:"init",data:Object(i.a)(Object(i.a)({},fe),{},{secret:ae,width:oe,height:Q,rows:Te.rows,columns:Te.cols})}))}Te.focus()},Ee.onerror=function(ee){console.log("------in socket error----",ee,Ee,ve)},Ee.onmessage=function(ee){je.current||(Te.write("\r"),setTimeout(function(){},1e3)),je.current=!0,console.log("event:",ee);var oe=_.Base64.decode(ee.data.toString()),Q=Te._core._renderService.dimensions.actualCellWidth||9.5;console.log("data:",oe,Q,Te),Te.write(oe)},Ee.onclose=function(ee){ce&&clearInterval(ce),Te.write(`\r
|
|
|
connection closed`)}}var ce=setInterval(function(){et.current&&et.current.send(JSON.stringify({tp:"h"}))},j),Pe=F.a.subscribe("create-socket",function(Ee){ge==Ee&&(et.current&&et.current.readyState===1?Te.focus():ot(),Te.focus())}),Fe=F.a.subscribe("close-socket",function(Ee){ge===Ee&&(et.current&&(et.current.close(),je.current=!1,Te.clear()),et.current=null)}),Ce=F.a.subscribe("ssh-xterm-resize",function(Ee){et.current&&et.current.readyState===1&&et.current.send(JSON.stringify({tp:"resize",data:Object(i.a)({},Ee)}))}),_e=F.a.subscribe("ssh-add-connect-time",function(){et.current&&et.current.readyState===1&&et.current.send(JSON.stringify({tp:"overtime"}))});return function(){Fe(),Pe(),Ce(),_e(),et.current&&(et.current.close(),je.current=!1)}}},[Te,ve,Me]),d.a.createElement("div",{ref:Ye,className:g.a["xterm-panel"]},ve?null:d.a.createElement("p",{style:{color:"#fff"}},"\u6B63\u5728\u8FDE\u63A5\u547D\u4EE4\u884C\u670D\u52A1..."))},K=q("MXD1"),U=q("CFYs"),k=q("IxHN"),z=q("M8RZ"),te=q("1dTM"),de=q.n(te),be=q("HBuW"),We=q("VaU+"),Ne=q.n(We),Le=q("ye1Q"),Ke=d.a.createElement(Le.a,{style:{fontSize:24},spin:!0});function He(Qe){return Qe.replace(/\\u([\dA-Za-z]{4})/g,function(fe,ge){return String.fromCharCode(parseInt("0x"+ge))})}function Ae(Qe){Qe||(Qe=window.location.search);var fe=Qe.substr(1),ge={};return fe.split("&").forEach(function(xe){var we=xe.split("=");ge[we[0]]=decodeURIComponent(we[1])}),ge}var Se={loading:!0,isLarge:!1,showClipBoardBox:!1,transferContent:"",mes:"\u5B9E\u9A8C\u73AF\u5883\u51C6\u5907\u4E2D"},he;(function(Qe){Qe[Qe.SET_LOADING=0]="SET_LOADING",Qe[Qe.SET_IS_LARGE=1]="SET_IS_LARGE",Qe[Qe.SET_MES=2]="SET_MES",Qe[Qe.SET_STATE=3]="SET_STATE",Qe[Qe.SHOW_CLIPBOARD_BOX=4]="SHOW_CLIPBOARD_BOX",Qe[Qe.SET_TRANSFER_CONTENT=5]="SET_TRANSFER_CONTENT"})(he||(he={}));function Ie(Qe,fe){switch(fe.type){case he.SET_LOADING:return Object(i.a)(Object(i.a)({},Qe),{},{loading:fe.payload});case he.SET_IS_LARGE:return Object(i.a)(Object(i.a)({},Qe),{},{isLarge:fe.payload});case he.SET_MES:return Object(i.a)(Object(i.a)({},Qe),{},{mes:fe.payload});case he.SET_STATE:return Object(i.a)(Object(i.a)({},Qe),fe.payload);case he.SET_TRANSFER_CONTENT:return Object(i.a)(Object(i.a)({},Qe),{},{transferContent:fe.payload});case he.SHOW_CLIPBOARD_BOX:return Object(i.a)(Object(i.a)({},Qe),{},{showClipBoardBox:fe.payload});default:throw new Error}}var ye=function(Qe){var fe=Qe.vnc_url,ge=Qe.window_vnc_url,xe=Qe.taskId,we=Object(u.useRef)(),Te=Object(u.useRef)(),re=Object(u.useReducer)(Ie,Se),ve=Object(n.a)(re,2),ae=ve[0],Me=ve[1],Ye=Object(u.useState)(0),et=Object(n.a)(Ye,2),je=et[0],ot=et[1],ce=ae.mes,Pe=ae.loading,Fe=ae.showClipBoardBox,Ce=ae.isLarge,_e=ae.transferContent,Ee=Object(u.useState)(0),ee=Object(n.a)(Ee,2),oe=ee[0],Q=ee[1],me,Oe=Object(u.useRef)(),V=Object(f.i)();function Re(){Me({type:he.SHOW_CLIPBOARD_BOX,payload:!1})}function Xe(){Me({type:he.SET_IS_LARGE,payload:!Ce})}function pe(tt){var at;return we.current&&(at=new P.default(function(ut){var Ft=Object(C.a)(ut),St;try{for(Ft.s();!(St=Ft.n()).done;){var vt=St.value;(vt.target.offsetHeight>0||vt.target.offsetWidth>0)&&tt._eventHandlers.windowResize()}}catch(Bt){Ft.e(Bt)}finally{Ft.f()}}),at.observe(we.current)),at}var ke=function(){var tt=Object(c.a)(s.a.mark(function at(){var ut;return s.a.wrap(function(St){for(;;)switch(St.prev=St.next){case 0:return St.next=2,Object(be.sb)(Object(i.a)({},V));case 2:if(ut=St.sent,!((ut==null?void 0:ut.status)===-3)){St.next=5;break}return St.abrupt("return",new Promise(function(){var vt=Object(c.a)(s.a.mark(function Bt(Nt,dt){return s.a.wrap(function(gt){for(;;)switch(gt.prev=gt.next){case 0:h.a.confirm({content:"\u68C0\u6D4B\u5230\u60A8\u5DF2\u7ECF\u5F00\u542F\u4E86\u5176\u4ED6windows\u73AF\u5883\uFF0C\u8BF7\u5148\u5173\u95ED\u73AF\u5883\u540E\uFF0C\u518D\u8FDE\u63A5",okText:"\u7ACB\u5373\u5173\u95ED",cancelText:"\u7A0D\u540E\u5173\u95ED",onOk:function(){var pt=Object(c.a)(s.a.mark(function It(){return s.a.wrap(function(At){for(;;)switch(At.prev=At.next){case 0:return clearTimeout(me),Q(0),ke(),At.abrupt("return");case 4:case"end":return At.stop()}},It)}));function Ct(){return pt.apply(this,arguments)}return Ct}()});case 1:case"end":return gt.stop()}},Bt)}));return function(Bt,Nt){return vt.apply(this,arguments)}}()));case 5:if(!((ut==null?void 0:ut.status)===-1)){St.next=7;break}throw new String(ut==null?void 0:ut.message);case 7:return F.a.publish("update-windows-time",ut==null?void 0:ut.data),St.abrupt("return",ut);case 9:case"end":return St.stop()}},at)}));return function(){return tt.apply(this,arguments)}}();Object(u.useEffect)(function(){return Oe.current=setTimeout(function(){h.a.confirm({title:d.a.createElement(d.a.Fragment,null,"\u5B9E\u9A8C\u73AF\u5883\u5EF6\u65F6\u63D0\u9192"),content:"\u5F53\u524D\u5B9E\u9A8C\u73AF\u5883\u5C06\u4E8E 5 \u5206\u949F\u540E\u5173\u95ED\uFF0C\u9700\u8981\u5EF6\u957F\u4F7F\u7528\u65F6\u95F4\u5417\uFF1F",okText:"\u7ACB\u5373\u5EF6\u957F",cancelText:"\u4E0D\u9700\u8981",onOk:function(){F.a.publish("delayed-time",1),ot(je+1)}})},1e3*60*60),function(){clearTimeout(Oe.current)}},[]),Object(u.useEffect)(function(){var tt,at;function ut(dt){ge&&(R.b.warn("\u7531\u4E8E\u957F\u65F6\u95F4\u672A\u64CD\u4F5C\uFF0C\u8FDE\u63A5\u5931\u6548\uFF0C\u6B63\u5728\u91CD\u65B0\u8FDE\u63A5Windows VNC\u670D\u52A1"),Me({type:he.SET_LOADING,payload:!0}),ot(je+1))}function Ft(){clearTimeout(me),Q(100),setTimeout(function(){Me({type:he.SET_LOADING,payload:!1})},1300),F.a.subscribe("send-ctrl-alt-delete",function(){var dt;(dt=tt)===null||dt===void 0||dt.sendCtrlAltDel()})}function St(dt){var Ut=He(dt.detail.text);Me({type:he.SET_TRANSFER_CONTENT,payload:Ut})}if((ge||fe)&&we.current){new Promise(Object(c.a)(s.a.mark(function dt(){var Ut,gt,pt,Ct,It,Xt,At,bt,Si,qt;return s.a.wrap(function(Pt){for(;;)switch(Pt.prev=Pt.next){case 0:return Ut=Ae(),gt="",Pt.next=4,ke();case 4:Ct=Pt.sent,ge?(pt="Edu123",gt=decodeURIComponent(Ct==null||((It=Ct.data)===null||It===void 0)?void 0:It.vnc_url)):(At=new URL(Ct==null||((Xt=Ct.data)===null||Xt===void 0)?void 0:Xt.vnc_url),bt=At.protocol,Si=At.searchParams,qt=At.host,pt=Si.get("password"),gt="".concat(bt==="https:"?"wss":"ws","://").concat(qt,"/").concat(Ut.path||"websockify")),tt=new de.a(we.current,gt,{credentials:{password:pt},wsProtocols:["binary"]}),at=pe(tt),tt.viewOnly=Ut.view_only||!1,ge?tt.scaleViewport=!0:tt.scaleViewport=Ut.scale||!1,tt.scaleViewport=Ut.scale||!0,tt.resizeSession=!0,Te.current=tt,tt.addEventListener("disconnect",ut),tt.addEventListener("connect",Ft),tt.addEventListener("clipboard",St);case 16:case"end":return Pt.stop()}},dt)})));var vt=F.a.subscribe("vnc-reseting",function(){Me({type:he.SET_STATE,payload:{loading:!0,mes:"\u5B9E\u9A8C\u73AF\u5883\u91CD\u7F6E\u4E2D"}})}),Bt=F.a.subscribe("vnc-enlarge",function(){Me({type:he.SET_IS_LARGE,payload:!0})}),Nt=F.a.subscribe("show-clipboard-box",function(){Me({type:he.SHOW_CLIPBOARD_BOX,payload:!0})});return Q(0),function(){var dt,Ut,gt,pt;(dt=tt)===null||dt===void 0||dt.removeEventListener("disconnect",ut),(Ut=tt)===null||Ut===void 0||Ut.removeEventListener("connect",Ft),(gt=tt)===null||gt===void 0||gt.removeEventListener("clipboard",St),vt(),Bt(),Nt(),(pt=at)===null||pt===void 0||pt.unobserve(we.current)}}},[fe,ge,je]);function Ve(tt){var at;(at=Te.current)===null||at===void 0||at.clipboardPasteFrom(tt),Me({type:he.SET_TRANSFER_CONTENT,payload:tt}),R.b.success("\u4FDD\u5B58\u6210\u529F\uFF01\u4F60\u53EF\u4EE5\u5728\u5B9E\u9A8C\u73AF\u5883\u4E2D\u7C98\u8D34\u8BE5\u5185\u5BB9"),Re()}Object(u.useEffect)(function(){oe==0&&ht()},[oe]);var ht=function tt(){oe>99?oe=99:(oe=oe+1,me=setTimeout(function(){tt()},1500)),oe<100&&Q(oe)};return d.a.createElement(u.Fragment,null,d.a.createElement("div",{style:{backgroundColor:"#000"},className:"".concat(ge?"vnc-panel-wrapper-windows":"vnc-panel-wrapper"," ").concat(Ce?"full-screen":"")},d.a.createElement("a",{className:"btn-vnc-resize",onClick:Xe},d.a.createElement("i",{className:"iconfont ".concat(Ce?"icon-tuichuquanping1":"icon-quanping1")})),Pe?d.a.createElement(k.a,{className:Ne.a.spin,message:ce,style:{color:"#0152d9"}},d.a.createElement("div",{className:"tc",style:{width:500,margin:"0 auto",color:"#FFF"}},d.a.createElement(U.a,{percent:oe,format:function(at){return d.a.createElement("span",{className:"c-white"},at,"%")}}))):null,d.a.createElement("div",{ref:we,className:"vnc-panel ".concat(Pe?"hide":"animated fadeIn")})),d.a.createElement(z.a,null))},Ge=q("m3rI"),$e=t.a.Countdown,ze=function(fe){var ge,xe,we=fe.shixunsDetail,Te=fe.globalSetting,re=fe.loading,ve=fe.dispatch,ae=fe.user,Me=Object(u.useState)({}),Ye=Object(n.a)(Me,2),et=Ye[0],je=Ye[1],ot=Object(u.useState)(400),ce=Object(n.a)(ot,2),Pe=ce[0],Fe=ce[1],Ce=Object(u.useState)(!1),_e=Object(n.a)(Ce,2),Ee=_e[0],ee=_e[1],oe=Object(u.useState)(""),Q=Object(n.a)(oe,2),me=Q[0],Oe=Q[1],V=Object(u.useState)(Date.now()+1e3*60*60),Re=Object(n.a)(V,2),Xe=Re[0],pe=Re[1],ke=Object(f.i)(),Ve=Object(u.useState)(!1),ht=Object(n.a)(Ve,2),tt=ht[0],at=ht[1],ut=we.mirrorApplies,Ft=Object(u.useRef)();Object(u.useEffect)(function(){return ve({type:"globalSetting/headerFooterToggle",payload:!1}),vt(),Bt(),window.addEventListener("resize",vt),F.a.subscribe("delayed-time",function(){pe(Date.now()+1e3*60*60)}),function(){window.removeEventListener("resize",vt),clearTimeout(Ft.current),ve({type:"globalSetting/headerFooterToggle",payload:!0})}},[]),Object(u.useEffect)(function(){et.host&&setTimeout(function(){F.a.publish("create-socket",1)},1500)},[et]),Object(u.useEffect)(function(){ut.webssh&&(St(),Ft.current=setTimeout(function(){h.a.confirm({title:d.a.createElement(d.a.Fragment,null,"\u5B9E\u9A8C\u73AF\u5883\u5EF6\u65F6\u63D0\u9192"),content:"\u5F53\u524D\u5B9E\u9A8C\u73AF\u5883\u5C06\u4E8E 15 \u5206\u949F\u540E\u5173\u95ED\uFF0C\u9700\u8981\u5EF6\u957F\u4F7F\u7528\u65F6\u95F4\u5417\uFF1F",okText:"\u7ACB\u5373\u5EF6\u957F",cancelText:"\u4E0D\u9700\u8981",onOk:function(){F.a.publish("ssh-add-connect-time",{}),F.a.publish("delayed-time",1)}})},1e3*60*60)),ut.id&&vt()},[ut]);var St=function(){var Nt=Object(c.a)(s.a.mark(function dt(){var Ut;return s.a.wrap(function(pt){for(;;)switch(pt.prev=pt.next){case 0:return pt.next=2,Object(be.tb)(Object(i.a)({},ke));case 2:Ut=pt.sent,je(Object(i.a)({},Ut));case 4:case"end":return pt.stop()}},dt)}));return function(){return Nt.apply(this,arguments)}}(),vt=function(){var dt=window.innerHeight;Fe(dt-(ut.audit_remark?400:270))},Bt=function(){var Nt=Object(c.a)(s.a.mark(function dt(){return s.a.wrap(function(gt){for(;;)switch(gt.prev=gt.next){case 0:ve({type:"shixunsDetail/getMirrorApplies",payload:Object(i.a)({},ke)});case 1:case"end":return gt.stop()}},dt)}));return function(){return Nt.apply(this,arguments)}}();return console.log(ae==null?void 0:ae.userInfo),d.a.createElement("section",{className:Ne.a.wrp},d.a.createElement("header",{className:Ne.a.header},d.a.createElement(p.a,{align:"middle"},d.a.createElement(b.a,{flex:"1"},d.a.createElement("img",{alt:"\u7528\u6237\u5934\u50CF",height:"40",src:"".concat(Ge.a.IMG_SERVER,"/images/").concat(ae==null||((ge=ae.userInfo)===null||ge===void 0)?void 0:ge.image_url),width:"40",style:{borderRadius:"50%"}}),d.a.createElement("span",{className:"ml10"},ae==null||((xe=ae.userInfo)===null||xe===void 0)?void 0:xe.real_name)),d.a.createElement(b.a,{flex:"1"},d.a.createElement("span",{className:"mr10 font18"},ut.name)),d.a.createElement(b.a,null,d.a.createElement("span",null,"\u5269\u4F59\u65F6\u957F:",d.a.createElement($e,{className:Ne.a.cuttDown,value:Xe,format:"mm:ss",valueStyle:{color:"#FFF"}})),d.a.createElement("span",{className:"icon-kaiguan font20 current ml60",onClick:function(){h.a.confirm({title:"\u9000\u51FA\u955C\u50CF",content:"\u4F60\u786E\u5B9A\u8981\u9000\u51FA\u955C\u50CF\u5417\uFF1F",okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",onOk:function(){var Ut;v.d.push("/users/".concat((Ut=ae.userInfo)===null||Ut===void 0?void 0:Ut.login,"/experiment-img"))}})}})))),d.a.createElement("aside",{className:Ne.a.container},d.a.createElement(p.a,null,d.a.createElement(b.a,{style:{position:"relative",width:tt?"0%":"40%"}},d.a.createElement("section",{className:"".concat(Ne.a.info," ml40 mr40"),style:{display:tt?"none":"flex"}},d.a.createElement("aside",null,d.a.createElement(p.a,{align:"middle",style:{height:68,borderBottom:"1px solid #f1f1f1"}},d.a.createElement(b.a,{className:"font18"},"\u5B9E\u9A8C\u73AF\u5883\u8BF4\u660E ",d.a.createElement("span",{className:"font16 ml20 c-grey-999"},"\u8BF7\u6309\u6A21\u677F\u586B\u5199\u5B9E\u9A8C\u73AF\u5883\u8BF4\u660E"))),d.a.createElement("aside",{className:"mt30 flex1"},d.a.createElement(S.a,{height:Pe,defaultValue:ut.description||"",onChange:function(dt){return Oe(dt)}}),ut.audit_remark&&d.a.createElement("aside",{className:"mt10 font16 c-grey-999 mb10"},"\u5BA1\u6838\u4E0D\u901A\u8FC7\u539F\u56E0\uFF1A",d.a.createElement("span",{className:"c-red"},ut.audit_remark))),d.a.createElement("aside",{className:"mb20"},d.a.createElement(p.a,{justify:"center",gutter:[20,20],className:Ne.a.buttons},d.a.createElement(b.a,null,d.a.createElement(L.a,{type:"primary",size:"large",loading:Ee,onClick:Object(c.a)(s.a.mark(function Nt(){var dt;return s.a.wrap(function(gt){for(;;)switch(gt.prev=gt.next){case 0:return ee(!0),h.a.info({title:"\u4FDD\u5B58\u955C\u50CF",centered:!0,content:"\u4E34\u65F6\u955C\u50CF\u7CFB\u7EDF\u9ED8\u8BA4\u53EA\u4FDD\u5B5830\u5929\uFF0C\u8FC7\u671F\u5C06\u4F1A\u81EA\u52A8\u6E05\u7406\u3002\u8BF7\u5C3D\u5FEB\u7533\u8BF7\u53D1\u5E03\u3002",okText:"\u6211\u77E5\u9053\u4E86",onOk:function(){}}),gt.next=4,Object(be.vb)(Object(i.a)(Object(i.a)({},ke),{},{description:me}));case 4:dt=gt.sent,(dt==null?void 0:dt.status)===0&&R.b.success("\u4FDD\u5B58\u6210\u529F"),ee(!1);case 7:case"end":return gt.stop()}},Nt)}))},"\u4FDD\u5B58")),d.a.createElement(b.a,null,d.a.createElement(L.a,{type:"primary",ghost:!0,size:"large",onClick:Object(c.a)(s.a.mark(function Nt(){return s.a.wrap(function(Ut){for(;;)switch(Ut.prev=Ut.next){case 0:h.a.confirm({title:"\u7533\u8BF7\u53D1\u5E03",centered:!0,content:"\u4F60\u786E\u5B9A\u8981\u7533\u8BF7\u53D1\u5E03\u8BE5\u955C\u50CF\uFF1F",okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",onOk:function(){var gt=Object(c.a)(s.a.mark(function Ct(){var It,Xt;return s.a.wrap(function(bt){for(;;)switch(bt.prev=bt.next){case 0:return bt.next=2,Object(be.ub)(Object(i.a)(Object(i.a)({},ke),{},{description:me}));case 2:It=bt.sent,(It==null?void 0:It.status)===0&&(v.d.push("/users/".concat((Xt=ae.userInfo)===null||Xt===void 0?void 0:Xt.login,"/experiment-img")),R.b.success("\u7533\u8BF7\u53D1\u5E03\u6210\u529F"));case 4:case"end":return bt.stop()}},Ct)}));function pt(){return gt.apply(this,arguments)}return pt}()});case 1:case"end":return Ut.stop()}},Nt)}))},"\u7533\u8BF7\u53D1\u5E03")))))),d.a.createElement("div",{className:tt?Ne.a.elseShrink:Ne.a.shrink,onClick:function(){return at(!tt)}},d.a.createElement("i",{className:"iconfont icon-cela"}))),d.a.createElement(b.a,{style:{background:"#000",width:tt?"100%":"60%"}},d.a.createElement("div",null,d.a.createElement("aside",{className:Ne.a.fullBtn},d.a.createElement("span",{className:"icon-quanping"})),ut.webssh&&d.a.createElement(A,{sshConfigData:et,sid:1}),((ut==null?void 0:ut.vnc)||(ut==null?void 0:ut.windows))&&d.a.createElement(ye,{taskId:ut.type==="windows"?"pcf9t4w6vrnz":"ijby95c82nsh",vnc_url:ut.vnc,window_vnc_url:ut.windows}))))))},Je=ne.default=Object(v.a)(function(Qe){var fe=Qe.shixunsDetail,ge=Qe.loading,xe=Qe.user,we=Qe.globalSetting;return{shixunsDetail:fe,globalSetting:we,user:xe,loading:ge.models.shixunsDetail}})(ze)},iUHT:function(it,ne,q){"use strict";Object.defineProperty(ne,"__esModule",{value:!0}),ne.default=void 0;function G(m,S){if(!(m instanceof S))throw new TypeError("Cannot call a class as a function")}function L(m,S){for(var C=0;C<S.length;C++){var _=S[C];_.enumerable=_.enumerable||!1,_.configurable=!0,"value"in _&&(_.writable=!0),Object.defineProperty(m,_.key,_)}}function I(m,S,C){return S&&L(m.prototype,S),C&&L(m,C),m}var R=[13,16,10,23,0,4,2,27,14,5,20,9,22,18,11,3,25,7,15,6,26,19,12,1,40,51,30,36,46,54,29,39,50,44,32,47,43,48,38,55,33,52,45,41,49,35,28,31],M=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28],p=0,E,b,i,c,o,h;E=1<<16,b=1<<24,i=E|b,c=1<<2,o=1<<10,h=c|o;var n=[i|o,p|p,E|p,i|h,i|c,E|h,p|c,E|p,p|o,i|o,i|h,p|o,b|h,i|c,b|p,p|c,p|h,b|o,b|o,E|o,E|o,i|p,i|p,b|h,E|c,b|c,b|c,E|c,p|p,p|h,E|h,b|p,E|p,i|h,p|c,i|p,i|o,b|p,b|p,p|o,i|c,E|p,E|o,b|c,p|o,p|c,b|h,E|h,i|h,E|c,i|p,b|h,b|c,p|h,E|h,i|o,p|h,b|o,b|o,p|p,E|c,E|o,p|p,i|c];E=1<<20,b=1<<31,i=E|b,c=1<<5,o=1<<15,h=c|o;var a=[i|h,b|o,p|o,E|h,E|p,p|c,i|c,b|h,b|c,i|h,i|o,b|p,b|o,E|p,p|c,i|c,E|o,E|c,b|h,p|p,b|p,p|o,E|h,i|p,E|c,b|c,p|p,E|o,p|h,i|o,i|p,p|h,p|p,E|h,i|c,E|p,b|h,i|p,i|o,p|o,i|p,b|o,p|c,i|h,E|h,p|c,p|o,b|p,p|h,i|o,E|p,b|c,E|c,b|h,b|c,E|c,E|o,p|p,b|o,p|h,b|p,i|c,i|h,E|o];E=1<<17,b=1<<27,i=E|b,c=1<<3,o=1<<9,h=c|o;var t=[p|h,i|o,p|p,i|c,b|o,p|p,E|h,b|o,E|c,b|c,b|c,E|p,i|h,E|c,i|p,p|h,b|p,p|c,i|o,p|o,E|o,i|p,i|c,E|h,b|h,E|o,E|p,b|h,p|c,i|h,p|o,b|p,i|o,b|p,E|c,p|h,E|p,i|o,b|o,p|p,p|o,E|c,i|h,b|o,b|c,p|o,p|p,i|c,b|h,E|p,b|p,i|h,p|c,E|h,E|o,b|c,i|p,b|h,p|h,i|p,E|h,p|c,i|c,E|o];E=1<<13,b=1<<23,i=E|b,c=1<<0,o=1<<7,h=c|o;var r=[i|c,E|h,E|h,p|o,i|o,b|h,b|c,E|c,p|p,i|p,i|p,i|h,p|h,p|p,b|o,b|c,p|c,E|p,b|p,i|c,p|o,b|p,E|c,E|o,b|h,p|c,E|o,b|o,E|p,i|o,i|h,p|h,b|o,b|c,i|p,i|h,p|h,p|p,p|p,i|p,E|o,b|o,b|h,p|c,i|c,E|h,E|h,p|o,i|h,p|h,p|c,E|p,b|c,E|c,i|o,b|h,E|c,E|o,b|p,i|c,p|o,b|p,E|p,i|o];E=1<<25,b=1<<30,i=E|b,c=1<<8,o=1<<19,h=c|o;var s=[p|c,E|h,E|o,i|c,p|o,p|c,b|p,E|o,b|h,p|o,E|c,b|h,i|c,i|o,p|h,b|p,E|p,b|o,b|o,p|p,b|c,i|h,i|h,E|c,i|o,b|c,p|p,i|p,E|h,E|p,i|p,p|h,p|o,i|c,p|c,E|p,b|p,E|o,i|c,b|h,E|c,b|p,i|o,E|h,b|h,p|c,E|p,i|o,i|h,p|h,i|p,i|h,E|o,p|p,b|o,i|p,p|h,E|c,b|c,p|o,p|p,b|o,E|h,b|c];E=1<<22,b=1<<29,i=E|b,c=1<<4,o=1<<14,h=c|o;var u=[b|c,i|p,p|o,i|h,i|p,p|c,i|h,E|p,b|o,E|h,E|p,b|c,E|c,b|o,b|p,p|h,p|p,E|c,b|h,p|o,E|o,b|h,p|c,i|c,i|c,p|p,E|h,i|o,p|h,E|o,i|o,b|p,b|o,p|c,i|c,E|o,i|h,E|p,p|h,b|c,E|p,b|o,b|p,p|h,b|c,i|h,E|o,i|p,E|h,i|o,p|p,i|c,p|c,p|o,i|p,E|h,p|o,E|c,b|h,p|p,i|o,b|p,E|c,b|h];E=1<<21,b=1<<26,i=E|b,c=1<<1,o=1<<11,h=c|o;var d=[E|p,i|c,b|h,p|p,p|o,b|h,E|h,i|o,i|h,E|p,p|p,b|c,p|c,b|p,i|c,p|h,b|o,E|h,E|c,b|o,b|c,i|p,i|o,E|c,i|p,p|o,p|h,i|h,E|o,p|c,b|p,E|o,b|p,E|o,E|p,b|h,b|h,i|c,i|c,p|c,E|c,b|p,b|o,E|p,i|o,p|h,E|h,i|o,p|h,b|c,i|h,i|p,E|o,p|p,p|c,i|h,p|p,E|h,i|p,p|o,b|c,b|o,p|o,E|c];E=1<<18,b=1<<28,i=E|b,c=1<<6,o=1<<12,h=c|o;var f=[b|h,p|o,E|p,i|h,b|p,b|h,p|c,b|p,E|c,i|p,i|h,E|o,i|o,E|h,p|o,p|c,i|p,b|c,b|o,p|h,E|o,E|c,i|c,i|o,p|h,p|p,p|p,i|c,b|c,b|o,E|h,E|p,E|h,E|p,i|o,p|o,p|c,i|c,p|o,E|h,b|o,p|c,b|c,i|p,i|c,b|p,E|p,b|h,p|p,i|h,E|c,b|c,i|p,b|o,b|h,p|p,i|h,E|o,E|o,p|h,p|h,E|c,b|p,i|o],v=function(){function m(S){G(this,m),this.keys=[];for(var C=[],_=[],y=[],T=0,O=56;T<56;++T,O-=8){O+=O<-5?65:O<-3?31:O<-1?63:O===27?35:0;var g=O&7;C[T]=(S[O>>>3]&1<<g)!==0?1:0}for(var F=0;F<16;++F){var P=F<<1,N=P+1;y[P]=y[N]=0;for(var X=28;X<59;X+=28)for(var j=X-28;j<X;++j){var A=j+M[F];_[j]=A<X?C[A]:C[A-28]}for(var K=0;K<24;++K)_[R[K]]!==0&&(y[P]|=1<<23-K),_[R[K+24]]!==0&&(y[N]|=1<<23-K)}for(var U=0,k=0,z=0;U<16;++U){var te=y[k++],de=y[k++];this.keys[z]=(te&16515072)<<6,this.keys[z]|=(te&4032)<<10,this.keys[z]|=(de&16515072)>>>10,this.keys[z]|=(de&4032)>>>6,++z,this.keys[z]=(te&258048)<<12,this.keys[z]|=(te&63)<<16,this.keys[z]|=(de&258048)>>>4,this.keys[z]|=de&63,++z}}return I(m,[{key:"enc8",value:function(C){var _=C.slice(),y=0,T,O,g;T=_[y++]<<24|_[y++]<<16|_[y++]<<8|_[y++],O=_[y++]<<24|_[y++]<<16|_[y++]<<8|_[y++],g=(T>>>4^O)&252645135,O^=g,T^=g<<4,g=(T>>>16^O)&65535,O^=g,T^=g<<16,g=(O>>>2^T)&858993459,T^=g,O^=g<<2,g=(O>>>8^T)&16711935,T^=g,O^=g<<8,O=O<<1|O>>>31&1,g=(T^O)&2863311530,T^=g,O^=g,T=T<<1|T>>>31&1;for(var F=0,P=0;F<8;++F){g=O<<28|O>>>4,g^=this.keys[P++];var N=d[g&63];N|=s[g>>>8&63],N|=t[g>>>16&63],N|=n[g>>>24&63],g=O^this.keys[P++],N|=f[g&63],N|=u[g>>>8&63],N|=r[g>>>16&63],N|=a[g>>>24&63],T^=N,g=T<<28|T>>>4,g^=this.keys[P++],N=d[g&63],N|=s[g>>>8&63],N|=t[g>>>16&63],N|=n[g>>>24&63],g=T^this.keys[P++],N|=f[g&63],N|=u[g>>>8&63],N|=r[g>>>16&63],N|=a[g>>>24&63],O^=N}for(O=O<<31|O>>>1,g=(T^O)&2863311530,T^=g,O^=g,T=T<<31|T>>>1,g=(T>>>8^O)&16711935,O^=g,T^=g<<8,g=(T>>>2^O)&858993459,O^=g,T^=g<<2,g=(O>>>16^T)&65535,T^=g,O^=g<<16,g=(O>>>4^T)&252645135,T^=g,O^=g<<4,g=[O,T],y=0;y<8;y++)_[y]=(g[y>>>2]>>>8*(3-y%4))%256,_[y]<0&&(_[y]+=256);return _}},{key:"encrypt",value:function(C){return this.enc8(C.slice(0,8)).concat(this.enc8(C.slice(8,16)))}}]),m}();ne.default=v},ic2d:function(it,ne,q){"use strict";q.d(ne,"a",function(){return R});var G=q("FWmy"),L=q("746U");class I{constructor(){this.data=new Map}add(M,p){G.a(L.l(M)),G.a(L.k(p)),G.a(!this.data.has(M),"There is already an extension with this id"),this.data.set(M,p)}as(M){return this.data.get(M)||null}}const R=new I},kSUc:function(it,ne,q){},lNSK:function(it,ne,q){"use strict";function G(V){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?G=function(Xe){return typeof Xe}:G=function(Xe){return Xe&&typeof Symbol=="function"&&Xe.constructor===Symbol&&Xe!==Symbol.prototype?"symbol":typeof Xe},G(V)}Object.defineProperty(ne,"__esModule",{value:!0}),ne.deflateInit=ee,ne.deflateInit2=Ee,ne.deflateReset=Ce,ne.deflateResetKeep=Fe,ne.deflateSetHeader=_e,ne.deflate=oe,ne.deflateEnd=Q,ne.deflateSetDictionary=me,ne.deflateInfo=ne.Z_DEFLATED=ne.Z_UNKNOWN=ne.Z_DEFAULT_STRATEGY=ne.Z_FIXED=ne.Z_RLE=ne.Z_HUFFMAN_ONLY=ne.Z_FILTERED=ne.Z_DEFAULT_COMPRESSION=ne.Z_BUF_ERROR=ne.Z_DATA_ERROR=ne.Z_STREAM_ERROR=ne.Z_STREAM_END=ne.Z_OK=ne.Z_BLOCK=ne.Z_FINISH=ne.Z_FULL_FLUSH=ne.Z_PARTIAL_FLUSH=ne.Z_NO_FLUSH=void 0;var L=i(q("6BzB")),I=i(q("c5fP")),R=E(q("xlC8")),M=E(q("QV2g")),p=E(q("xSIq"));function E(V){return V&&V.__esModule?V:{default:V}}function b(){if(typeof WeakMap!="function")return null;var V=new WeakMap;return b=function(){return V},V}function i(V){if(V&&V.__esModule)return V;if(V===null||G(V)!=="object"&&typeof V!="function")return{default:V};var Re=b();if(Re&&Re.has(V))return Re.get(V);var Xe={},pe=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var ke in V)if(Object.prototype.hasOwnProperty.call(V,ke)){var Ve=pe?Object.getOwnPropertyDescriptor(V,ke):null;Ve&&(Ve.get||Ve.set)?Object.defineProperty(Xe,ke,Ve):Xe[ke]=V[ke]}return Xe.default=V,Re&&Re.set(V,Xe),Xe}var c=0;ne.Z_NO_FLUSH=c;var o=1;ne.Z_PARTIAL_FLUSH=o;var h=3;ne.Z_FULL_FLUSH=h;var n=4;ne.Z_FINISH=n;var a=5;ne.Z_BLOCK=a;var t=0;ne.Z_OK=t;var r=1;ne.Z_STREAM_END=r;var s=-2;ne.Z_STREAM_ERROR=s;var u=-3;ne.Z_DATA_ERROR=u;var d=-5;ne.Z_BUF_ERROR=d;var f=-1;ne.Z_DEFAULT_COMPRESSION=f;var v=1;ne.Z_FILTERED=v;var m=2;ne.Z_HUFFMAN_ONLY=m;var S=3;ne.Z_RLE=S;var C=4;ne.Z_FIXED=C;var _=0;ne.Z_DEFAULT_STRATEGY=_;var y=2;ne.Z_UNKNOWN=y;var T=8;ne.Z_DEFLATED=T;var O=9,g=15,F=8,P=29,N=256,X=N+1+P,j=30,A=19,K=2*X+1,U=15,k=3,z=258,te=z+k+1,de=32,be=42,We=69,Ne=73,Le=91,Ke=103,He=113,Ae=666,Se=1,he=2,Ie=3,ye=4,Ge=3;function $e(V,Re){return V.msg=p.default[Re],Re}function ze(V){return(V<<1)-(V>4?9:0)}function Je(V){for(var Re=V.length;--Re>=0;)V[Re]=0}function Qe(V){var Re=V.state,Xe=Re.pending;if(Xe>V.avail_out&&(Xe=V.avail_out),Xe===0)return;L.arraySet(V.output,Re.pending_buf,Re.pending_out,Xe,V.next_out),V.next_out+=Xe,Re.pending_out+=Xe,V.total_out+=Xe,V.avail_out-=Xe,Re.pending-=Xe,Re.pending===0&&(Re.pending_out=0)}function fe(V,Re){I._tr_flush_block(V,V.block_start>=0?V.block_start:-1,V.strstart-V.block_start,Re),V.block_start=V.strstart,Qe(V.strm)}function ge(V,Re){V.pending_buf[V.pending++]=Re}function xe(V,Re){V.pending_buf[V.pending++]=Re>>>8&255,V.pending_buf[V.pending++]=Re&255}function we(V,Re,Xe,pe){var ke=V.avail_in;return ke>pe&&(ke=pe),ke===0?0:(V.avail_in-=ke,L.arraySet(Re,V.input,V.next_in,ke,Xe),V.state.wrap===1?V.adler=(0,R.default)(V.adler,Re,ke,Xe):V.state.wrap===2&&(V.adler=(0,M.default)(V.adler,Re,ke,Xe)),V.next_in+=ke,V.total_in+=ke,ke)}function Te(V,Re){var Xe=V.max_chain_length,pe=V.strstart,ke,Ve,ht=V.prev_length,tt=V.nice_match,at=V.strstart>V.w_size-te?V.strstart-(V.w_size-te):0,ut=V.window,Ft=V.w_mask,St=V.prev,vt=V.strstart+z,Bt=ut[pe+ht-1],Nt=ut[pe+ht];V.prev_length>=V.good_match&&(Xe>>=2),tt>V.lookahead&&(tt=V.lookahead);do{if(ke=Re,ut[ke+ht]!==Nt||ut[ke+ht-1]!==Bt||ut[ke]!==ut[pe]||ut[++ke]!==ut[pe+1])continue;pe+=2,ke++;do;while(ut[++pe]===ut[++ke]&&ut[++pe]===ut[++ke]&&ut[++pe]===ut[++ke]&&ut[++pe]===ut[++ke]&&ut[++pe]===ut[++ke]&&ut[++pe]===ut[++ke]&&ut[++pe]===ut[++ke]&&ut[++pe]===ut[++ke]&&pe<vt);if(Ve=z-(vt-pe),pe=vt-z,Ve>ht){if(V.match_start=Re,ht=Ve,Ve>=tt)break;Bt=ut[pe+ht-1],Nt=ut[pe+ht]}}while((Re=St[Re&Ft])>at&&--Xe!==0);return ht<=V.lookahead?ht:V.lookahead}function re(V){var Re=V.w_size,Xe,pe,ke,Ve,ht;do{if(Ve=V.window_size-V.lookahead-V.strstart,V.strstart>=Re+(Re-te)){L.arraySet(V.window,V.window,Re,Re,0),V.match_start-=Re,V.strstart-=Re,V.block_start-=Re,pe=V.hash_size,Xe=pe;do ke=V.head[--Xe],V.head[Xe]=ke>=Re?ke-Re:0;while(--pe);pe=Re,Xe=pe;do ke=V.prev[--Xe],V.prev[Xe]=ke>=Re?ke-Re:0;while(--pe);Ve+=Re}if(V.strm.avail_in===0)break;if(pe=we(V.strm,V.window,V.strstart+V.lookahead,Ve),V.lookahead+=pe,V.lookahead+V.insert>=k)for(ht=V.strstart-V.insert,V.ins_h=V.window[ht],V.ins_h=(V.ins_h<<V.hash_shift^V.window[ht+1])&V.hash_mask;V.insert&&!(V.ins_h=(V.ins_h<<V.hash_shift^V.window[ht+k-1])&V.hash_mask,V.prev[ht&V.w_mask]=V.head[V.ins_h],V.head[V.ins_h]=ht,ht++,V.insert--,V.lookahead+V.insert<k););}while(V.lookahead<te&&V.strm.avail_in!==0)}function ve(V,Re){var Xe=65535;for(Xe>V.pending_buf_size-5&&(Xe=V.pending_buf_size-5);;){if(V.lookahead<=1){if(re(V),V.lookahead===0&&Re===c)return Se;if(V.lookahead===0)break}V.strstart+=V.lookahead,V.lookahead=0;var pe=V.block_start+Xe;if((V.strstart===0||V.strstart>=pe)&&(V.lookahead=V.strstart-pe,V.strstart=pe,fe(V,!1),V.strm.avail_out===0))return Se;if(V.strstart-V.block_start>=V.w_size-te&&(fe(V,!1),V.strm.avail_out===0))return Se}return V.insert=0,Re===n?(fe(V,!0),V.strm.avail_out===0?Ie:ye):(V.strstart>V.block_start&&(fe(V,!1),V.strm.avail_out===0),Se)}function ae(V,Re){for(var Xe,pe;;){if(V.lookahead<te){if(re(V),V.lookahead<te&&Re===c)return Se;if(V.lookahead===0)break}if(Xe=0,V.lookahead>=k&&(V.ins_h=(V.ins_h<<V.hash_shift^V.window[V.strstart+k-1])&V.hash_mask,Xe=V.prev[V.strstart&V.w_mask]=V.head[V.ins_h],V.head[V.ins_h]=V.strstart),Xe!==0&&V.strstart-Xe<=V.w_size-te&&(V.match_length=Te(V,Xe)),V.match_length>=k)if(pe=I._tr_tally(V,V.strstart-V.match_start,V.match_length-k),V.lookahead-=V.match_length,V.match_length<=V.max_lazy_match&&V.lookahead>=k){V.match_length--;do V.strstart++,V.ins_h=(V.ins_h<<V.hash_shift^V.window[V.strstart+k-1])&V.hash_mask,Xe=V.prev[V.strstart&V.w_mask]=V.head[V.ins_h],V.head[V.ins_h]=V.strstart;while(--V.match_length!==0);V.strstart++}else V.strstart+=V.match_length,V.match_length=0,V.ins_h=V.window[V.strstart],V.ins_h=(V.ins_h<<V.hash_shift^V.window[V.strstart+1])&V.hash_mask;else pe=I._tr_tally(V,0,V.window[V.strstart]),V.lookahead--,V.strstart++;if(pe&&(fe(V,!1),V.strm.avail_out===0))return Se}return V.insert=V.strstart<k-1?V.strstart:k-1,Re===n?(fe(V,!0),V.strm.avail_out===0?Ie:ye):V.last_lit&&(fe(V,!1),V.strm.avail_out===0)?Se:he}function Me(V,Re){for(var Xe,pe,ke;;){if(V.lookahead<te){if(re(V),V.lookahead<te&&Re===c)return Se;if(V.lookahead===0)break}if(Xe=0,V.lookahead>=k&&(V.ins_h=(V.ins_h<<V.hash_shift^V.window[V.strstart+k-1])&V.hash_mask,Xe=V.prev[V.strstart&V.w_mask]=V.head[V.ins_h],V.head[V.ins_h]=V.strstart),V.prev_length=V.match_length,V.prev_match=V.match_start,V.match_length=k-1,Xe!==0&&V.prev_length<V.max_lazy_match&&V.strstart-Xe<=V.w_size-te&&(V.match_length=Te(V,Xe),V.match_length<=5&&(V.strategy===v||V.match_length===k&&V.strstart-V.match_start>4096)&&(V.match_length=k-1)),V.prev_length>=k&&V.match_length<=V.prev_length){ke=V.strstart+V.lookahead-k,pe=I._tr_tally(V,V.strstart-1-V.prev_match,V.prev_length-k),V.lookahead-=V.prev_length-1,V.prev_length-=2;do++V.strstart<=ke&&(V.ins_h=(V.ins_h<<V.hash_shift^V.window[V.strstart+k-1])&V.hash_mask,Xe=V.prev[V.strstart&V.w_mask]=V.head[V.ins_h],V.head[V.ins_h]=V.strstart);while(--V.prev_length!==0);if(V.match_available=0,V.match_length=k-1,V.strstart++,pe&&(fe(V,!1),V.strm.avail_out===0))return Se}else if(V.match_available){if(pe=I._tr_tally(V,0,V.window[V.strstart-1]),pe&&fe(V,!1),V.strstart++,V.lookahead--,V.strm.avail_out===0)return Se}else V.match_available=1,V.strstart++,V.lookahead--}return V.match_available&&(pe=I._tr_tally(V,0,V.window[V.strstart-1]),V.match_available=0),V.insert=V.strstart<k-1?V.strstart:k-1,Re===n?(fe(V,!0),V.strm.avail_out===0?Ie:ye):V.last_lit&&(fe(V,!1),V.strm.avail_out===0)?Se:he}function Ye(V,Re){for(var Xe,pe,ke,Ve,ht=V.window;;){if(V.lookahead<=z){if(re(V),V.lookahead<=z&&Re===c)return Se;if(V.lookahead===0)break}if(V.match_length=0,V.lookahead>=k&&V.strstart>0&&(ke=V.strstart-1,pe=ht[ke],pe===ht[++ke]&&pe===ht[++ke]&&pe===ht[++ke])){Ve=V.strstart+z;do;while(pe===ht[++ke]&&pe===ht[++ke]&&pe===ht[++ke]&&pe===ht[++ke]&&pe===ht[++ke]&&pe===ht[++ke]&&pe===ht[++ke]&&pe===ht[++ke]&&ke<Ve);V.match_length=z-(Ve-ke),V.match_length>V.lookahead&&(V.match_length=V.lookahead)}if(V.match_length>=k?(Xe=I._tr_tally(V,1,V.match_length-k),V.lookahead-=V.match_length,V.strstart+=V.match_length,V.match_length=0):(Xe=I._tr_tally(V,0,V.window[V.strstart]),V.lookahead--,V.strstart++),Xe&&(fe(V,!1),V.strm.avail_out===0))return Se}return V.insert=0,Re===n?(fe(V,!0),V.strm.avail_out===0?Ie:ye):V.last_lit&&(fe(V,!1),V.strm.avail_out===0)?Se:he}function et(V,Re){for(var Xe;;){if(V.lookahead===0&&(re(V),V.lookahead===0)){if(Re===c)return Se;break}if(V.match_length=0,Xe=I._tr_tally(V,0,V.window[V.strstart]),V.lookahead--,V.strstart++,Xe&&(fe(V,!1),V.strm.avail_out===0))return Se}return V.insert=0,Re===n?(fe(V,!0),V.strm.avail_out===0?Ie:ye):V.last_lit&&(fe(V,!1),V.strm.avail_out===0)?Se:he}function je(V,Re,Xe,pe,ke){this.good_length=V,this.max_lazy=Re,this.nice_length=Xe,this.max_chain=pe,this.func=ke}var ot;ot=[new je(0,0,0,0,ve),new je(4,4,8,4,ae),new je(4,5,16,8,ae),new je(4,6,32,32,ae),new je(4,4,16,16,Me),new je(8,16,32,32,Me),new je(8,16,128,128,Me),new je(8,32,128,256,Me),new je(32,128,258,1024,Me),new je(32,258,258,4096,Me)];function ce(V){V.window_size=2*V.w_size,Je(V.head),V.max_lazy_match=ot[V.level].max_lazy,V.good_match=ot[V.level].good_length,V.nice_match=ot[V.level].nice_length,V.max_chain_length=ot[V.level].max_chain,V.strstart=0,V.block_start=0,V.lookahead=0,V.insert=0,V.match_length=V.prev_length=k-1,V.match_available=0,V.ins_h=0}function Pe(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=T,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new L.Buf16(K*2),this.dyn_dtree=new L.Buf16((2*j+1)*2),this.bl_tree=new L.Buf16((2*A+1)*2),Je(this.dyn_ltree),Je(this.dyn_dtree),Je(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new L.Buf16(U+1),this.heap=new L.Buf16(2*X+1),Je(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new L.Buf16(2*X+1),Je(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function Fe(V){var Re;return!V||!V.state?$e(V,s):(V.total_in=V.total_out=0,V.data_type=y,Re=V.state,Re.pending=0,Re.pending_out=0,Re.wrap<0&&(Re.wrap=-Re.wrap),Re.status=Re.wrap?be:He,V.adler=Re.wrap===2?0:1,Re.last_flush=c,I._tr_init(Re),t)}function Ce(V){var Re=Fe(V);return Re===t&&ce(V.state),Re}function _e(V,Re){return!V||!V.state||V.state.wrap!==2?s:(V.state.gzhead=Re,t)}function Ee(V,Re,Xe,pe,ke,Ve){if(!V)return s;var ht=1;if(Re===f&&(Re=6),pe<0?(ht=0,pe=-pe):pe>15&&(ht=2,pe-=16),ke<1||ke>O||Xe!==T||pe<8||pe>15||Re<0||Re>9||Ve<0||Ve>C)return $e(V,s);pe===8&&(pe=9);var tt=new Pe;return V.state=tt,tt.strm=V,tt.wrap=ht,tt.gzhead=null,tt.w_bits=pe,tt.w_size=1<<tt.w_bits,tt.w_mask=tt.w_size-1,tt.hash_bits=ke+7,tt.hash_size=1<<tt.hash_bits,tt.hash_mask=tt.hash_size-1,tt.hash_shift=~~((tt.hash_bits+k-1)/k),tt.window=new L.Buf8(tt.w_size*2),tt.head=new L.Buf16(tt.hash_size),tt.prev=new L.Buf16(tt.w_size),tt.lit_bufsize=1<<ke+6,tt.pending_buf_size=tt.lit_bufsize*4,tt.pending_buf=new L.Buf8(tt.pending_buf_size),tt.d_buf=1*tt.lit_bufsize,tt.l_buf=(1+2)*tt.lit_bufsize,tt.level=Re,tt.strategy=Ve,tt.method=Xe,Ce(V)}function ee(V,Re){return Ee(V,Re,T,g,F,_)}function oe(V,Re){var Xe,pe,ke,Ve;if(!V||!V.state||Re>a||Re<0)return V?$e(V,s):s;if(pe=V.state,!V.output||!V.input&&V.avail_in!==0||pe.status===Ae&&Re!==n)return $e(V,V.avail_out===0?d:s);if(pe.strm=V,Xe=pe.last_flush,pe.last_flush=Re,pe.status===be)if(pe.wrap===2)V.adler=0,ge(pe,31),ge(pe,139),ge(pe,8),pe.gzhead?(ge(pe,(pe.gzhead.text?1:0)+(pe.gzhead.hcrc?2:0)+(pe.gzhead.extra?4:0)+(pe.gzhead.name?8:0)+(pe.gzhead.comment?16:0)),ge(pe,pe.gzhead.time&255),ge(pe,pe.gzhead.time>>8&255),ge(pe,pe.gzhead.time>>16&255),ge(pe,pe.gzhead.time>>24&255),ge(pe,pe.level===9?2:pe.strategy>=m||pe.level<2?4:0),ge(pe,pe.gzhead.os&255),pe.gzhead.extra&&pe.gzhead.extra.length&&(ge(pe,pe.gzhead.extra.length&255),ge(pe,pe.gzhead.extra.length>>8&255)),pe.gzhead.hcrc&&(V.adler=(0,M.default)(V.adler,pe.pending_buf,pe.pending,0)),pe.gzindex=0,pe.status=We):(ge(pe,0),ge(pe,0),ge(pe,0),ge(pe,0),ge(pe,0),ge(pe,pe.level===9?2:pe.strategy>=m||pe.level<2?4:0),ge(pe,Ge),pe.status=He);else{var ht=T+(pe.w_bits-8<<4)<<8,tt=-1;pe.strategy>=m||pe.level<2?tt=0:pe.level<6?tt=1:pe.level===6?tt=2:tt=3,ht|=tt<<6,pe.strstart!==0&&(ht|=de),ht+=31-ht%31,pe.status=He,xe(pe,ht),pe.strstart!==0&&(xe(pe,V.adler>>>16),xe(pe,V.adler&65535)),V.adler=1}if(pe.status===We)if(pe.gzhead.extra){for(ke=pe.pending;pe.gzindex<(pe.gzhead.extra.length&65535)&&!(pe.pending===pe.pending_buf_size&&(pe.gzhead.hcrc&&pe.pending>ke&&(V.adler=(0,M.default)(V.adler,pe.pending_buf,pe.pending-ke,ke)),Qe(V),ke=pe.pending,pe.pending===pe.pending_buf_size));)ge(pe,pe.gzhead.extra[pe.gzindex]&255),pe.gzindex++;pe.gzhead.hcrc&&pe.pending>ke&&(V.adler=(0,M.default)(V.adler,pe.pending_buf,pe.pending-ke,ke)),pe.gzindex===pe.gzhead.extra.length&&(pe.gzindex=0,pe.status=Ne)}else pe.status=Ne;if(pe.status===Ne)if(pe.gzhead.name){ke=pe.pending;do{if(pe.pending===pe.pending_buf_size&&(pe.gzhead.hcrc&&pe.pending>ke&&(V.adler=(0,M.default)(V.adler,pe.pending_buf,pe.pending-ke,ke)),Qe(V),ke=pe.pending,pe.pending===pe.pending_buf_size)){Ve=1;break}pe.gzindex<pe.gzhead.name.length?Ve=pe.gzhead.name.charCodeAt(pe.gzindex++)&255:Ve=0,ge(pe,Ve)}while(Ve!==0);pe.gzhead.hcrc&&pe.pending>ke&&(V.adler=(0,M.default)(V.adler,pe.pending_buf,pe.pending-ke,ke)),Ve===0&&(pe.gzindex=0,pe.status=Le)}else pe.status=Le;if(pe.status===Le)if(pe.gzhead.comment){ke=pe.pending;do{if(pe.pending===pe.pending_buf_size&&(pe.gzhead.hcrc&&pe.pending>ke&&(V.adler=(0,M.default)(V.adler,pe.pending_buf,pe.pending-ke,ke)),Qe(V),ke=pe.pending,pe.pending===pe.pending_buf_size)){Ve=1;break}pe.gzindex<pe.gzhead.comment.length?Ve=pe.gzhead.comment.charCodeAt(pe.gzindex++)&255:Ve=0,ge(pe,Ve)}while(Ve!==0);pe.gzhead.hcrc&&pe.pending>ke&&(V.adler=(0,M.default)(V.adler,pe.pending_buf,pe.pending-ke,ke)),Ve===0&&(pe.status=Ke)}else pe.status=Ke;if(pe.status===Ke&&(pe.gzhead.hcrc?(pe.pending+2>pe.pending_buf_size&&Qe(V),pe.pending+2<=pe.pending_buf_size&&(ge(pe,V.adler&255),ge(pe,V.adler>>8&255),V.adler=0,pe.status=He)):pe.status=He),pe.pending!==0){if(Qe(V),V.avail_out===0)return pe.last_flush=-1,t}else if(V.avail_in===0&&ze(Re)<=ze(Xe)&&Re!==n)return $e(V,d);if(pe.status===Ae&&V.avail_in!==0)return $e(V,d);if(V.avail_in!==0||pe.lookahead!==0||Re!==c&&pe.status!==Ae){var at=pe.strategy===m?et(pe,Re):pe.strategy===S?Ye(pe,Re):ot[pe.level].func(pe,Re);if((at===Ie||at===ye)&&(pe.status=Ae),at===Se||at===Ie)return V.avail_out===0&&(pe.last_flush=-1),t;if(at===he&&(Re===o?I._tr_align(pe):Re!==a&&(I._tr_stored_block(pe,0,0,!1),Re===h&&(Je(pe.head),pe.lookahead===0&&(pe.strstart=0,pe.block_start=0,pe.insert=0))),Qe(V),V.avail_out===0))return pe.last_flush=-1,t}return Re!==n?t:pe.wrap<=0?r:(pe.wrap===2?(ge(pe,V.adler&255),ge(pe,V.adler>>8&255),ge(pe,V.adler>>16&255),ge(pe,V.adler>>24&255),ge(pe,V.total_in&255),ge(pe,V.total_in>>8&255),ge(pe,V.total_in>>16&255),ge(pe,V.total_in>>24&255)):(xe(pe,V.adler>>>16),xe(pe,V.adler&65535)),Qe(V),pe.wrap>0&&(pe.wrap=-pe.wrap),pe.pending!==0?t:r)}function Q(V){var Re;return!V||!V.state?s:(Re=V.state.status,Re!==be&&Re!==We&&Re!==Ne&&Re!==Le&&Re!==Ke&&Re!==He&&Re!==Ae?$e(V,s):(V.state=null,Re===He?$e(V,u):t))}function me(V,Re){var Xe=Re.length,pe,ke,Ve,ht,tt,at,ut,Ft;if(!V||!V.state)return s;if(pe=V.state,ht=pe.wrap,ht===2||ht===1&&pe.status!==be||pe.lookahead)return s;for(ht===1&&(V.adler=(0,R.default)(V.adler,Re,Xe,0)),pe.wrap=0,Xe>=pe.w_size&&(ht===0&&(Je(pe.head),pe.strstart=0,pe.block_start=0,pe.insert=0),Ft=new L.Buf8(pe.w_size),L.arraySet(Ft,Re,Xe-pe.w_size,pe.w_size,0),Re=Ft,Xe=pe.w_size),tt=V.avail_in,at=V.next_in,ut=V.input,V.avail_in=Xe,V.next_in=0,V.input=Re,re(pe);pe.lookahead>=k;){ke=pe.strstart,Ve=pe.lookahead-(k-1);do pe.ins_h=(pe.ins_h<<pe.hash_shift^pe.window[ke+k-1])&pe.hash_mask,pe.prev[ke&pe.w_mask]=pe.head[pe.ins_h],pe.head[pe.ins_h]=ke,ke++;while(--Ve);pe.strstart=ke,pe.lookahead=k-1,re(pe)}return pe.strstart+=pe.lookahead,pe.block_start=pe.strstart,pe.insert=pe.lookahead,pe.lookahead=0,pe.match_length=pe.prev_length=k-1,pe.match_available=0,V.next_in=at,V.input=ut,V.avail_in=tt,pe.wrap=ht,t}var Oe="pako deflate (from Nodeca project)";ne.deflateInfo=Oe},lZu9:function(it,ne,q){(function(G){G(q("VrN/"),q("1eCo"),q("8EBN"))})(function(G){"use strict";G.defineMode("markdown",function(L,I){var R=G.getMode(L,"text/html"),M=R.name=="null";function p(U){if(G.findModeByName){var k=G.findModeByName(U);k&&(U=k.mime||k.mimes[0])}var z=G.getMode(L,U);return z.name=="null"?null:z}I.highlightFormatting===void 0&&(I.highlightFormatting=!1),I.maxBlockquoteDepth===void 0&&(I.maxBlockquoteDepth=0),I.taskLists===void 0&&(I.taskLists=!1),I.strikethrough===void 0&&(I.strikethrough=!1),I.emoji===void 0&&(I.emoji=!1),I.fencedCodeBlockHighlighting===void 0&&(I.fencedCodeBlockHighlighting=!0),I.fencedCodeBlockDefaultMode===void 0&&(I.fencedCodeBlockDefaultMode="text/plain"),I.xml===void 0&&(I.xml=!0),I.tokenTypeOverrides===void 0&&(I.tokenTypeOverrides={});var E={header:"header",code:"comment",quote:"quote",list1:"variable-2",list2:"variable-3",list3:"keyword",hr:"hr",image:"image",imageAltText:"image-alt-text",imageMarker:"image-marker",formatting:"formatting",linkInline:"link",linkEmail:"link",linkText:"link",linkHref:"string",em:"em",strong:"strong",strikethrough:"strikethrough",emoji:"builtin"};for(var b in E)E.hasOwnProperty(b)&&I.tokenTypeOverrides[b]&&(E[b]=I.tokenTypeOverrides[b]);var i=/^([*\-_])(?:\s*\1){2,}\s*$/,c=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,o=/^\[(x| )\](?=\s)/i,h=I.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,n=/^ {0,3}(?:\={1,}|-{2,})\s*$/,a=/^[^#!\[\]*_\\<>` "'(~:]+/,t=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,r=/^\s*\[[^\]]+?\]:.*$/,s=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u0AF0\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E42\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC9\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDF3C-\uDF3E]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]/,u=" ";function d(U,k,z){return k.f=k.inline=z,z(U,k)}function f(U,k,z){return k.f=k.block=z,z(U,k)}function v(U){return!U||!/\S/.test(U.string)}function m(U){if(U.linkTitle=!1,U.linkHref=!1,U.linkText=!1,U.em=!1,U.strong=!1,U.strikethrough=!1,U.quote=0,U.indentedCode=!1,U.f==C){var k=M;if(!k){var z=G.innerMode(R,U.htmlState);k=z.mode.name=="xml"&&z.state.tagStart===null&&!z.state.context&&z.state.tokenize.isInText}k&&(U.f=O,U.block=S,U.htmlState=null)}return U.trailingSpace=0,U.trailingSpaceNewLine=!1,U.prevLine=U.thisLine,U.thisLine={stream:null},null}function S(U,k){var z=U.column()===k.indentation,te=v(k.prevLine.stream),de=k.indentedCode,be=k.prevLine.hr,We=k.list!==!1,Ne=(k.listStack[k.listStack.length-1]||0)+3;k.indentedCode=!1;var Le=k.indentation;if(k.indentationDiff===null&&(k.indentationDiff=k.indentation,We)){for(k.list=null;Le<k.listStack[k.listStack.length-1];)k.listStack.pop(),k.listStack.length?k.indentation=k.listStack[k.listStack.length-1]:k.list=!1;k.list!==!1&&(k.indentationDiff=Le-k.listStack[k.listStack.length-1])}var Ke=!te&&!be&&!k.prevLine.header&&(!We||!de)&&!k.prevLine.fencedCodeEnd,He=(k.list===!1||be||te)&&k.indentation<=Ne&&U.match(i),Ae=null;if(k.indentationDiff>=4&&(de||k.prevLine.fencedCodeEnd||k.prevLine.header||te))return U.skipToEnd(),k.indentedCode=!0,E.code;if(U.eatSpace())return null;if(z&&k.indentation<=Ne&&(Ae=U.match(h))&&Ae[1].length<=6)return k.quote=0,k.header=Ae[1].length,k.thisLine.header=!0,I.highlightFormatting&&(k.formatting="header"),k.f=k.inline,y(k);if(k.indentation<=Ne&&U.eat(">"))return k.quote=z?1:k.quote+1,I.highlightFormatting&&(k.formatting="quote"),U.eatSpace(),y(k);if(!He&&!k.setext&&z&&k.indentation<=Ne&&(Ae=U.match(c))){var Se=Ae[1]?"ol":"ul";return k.indentation=Le+U.current().length,k.list=!0,k.quote=0,k.listStack.push(k.indentation),k.em=!1,k.strong=!1,k.code=!1,k.strikethrough=!1,I.taskLists&&U.match(o,!1)&&(k.taskList=!0),k.f=k.inline,I.highlightFormatting&&(k.formatting=["list","list-"+Se]),y(k)}else{if(z&&k.indentation<=Ne&&(Ae=U.match(t,!0)))return k.quote=0,k.fencedEndRE=new RegExp(Ae[1]+"+ *$"),k.localMode=I.fencedCodeBlockHighlighting&&p(Ae[2]||I.fencedCodeBlockDefaultMode),k.localMode&&(k.localState=G.startState(k.localMode)),k.f=k.block=_,I.highlightFormatting&&(k.formatting="code-block"),k.code=-1,y(k);if(k.setext||(!Ke||!We)&&!k.quote&&k.list===!1&&!k.code&&!He&&!r.test(U.string)&&(Ae=U.lookAhead(1))&&(Ae=Ae.match(n)))return k.setext?(k.header=k.setext,k.setext=0,U.skipToEnd(),I.highlightFormatting&&(k.formatting="header")):(k.header=Ae[0].charAt(0)=="="?1:2,k.setext=k.header),k.thisLine.header=!0,k.f=k.inline,y(k);if(He)return U.skipToEnd(),k.hr=!0,k.thisLine.hr=!0,E.hr;if(U.peek()==="[")return d(U,k,X)}return d(U,k,k.inline)}function C(U,k){var z=R.token(U,k.htmlState);if(!M){var te=G.innerMode(R,k.htmlState);(te.mode.name=="xml"&&te.state.tagStart===null&&!te.state.context&&te.state.tokenize.isInText||k.md_inside&&U.current().indexOf(">")>-1)&&(k.f=O,k.block=S,k.htmlState=null)}return z}function _(U,k){var z=k.listStack[k.listStack.length-1]||0,te=k.indentation<z,de=z+3;if(k.fencedEndRE&&k.indentation<=de&&(te||U.match(k.fencedEndRE))){I.highlightFormatting&&(k.formatting="code-block");var be;return te||(be=y(k)),k.localMode=k.localState=null,k.block=S,k.f=O,k.fencedEndRE=null,k.code=0,k.thisLine.fencedCodeEnd=!0,te?f(U,k,k.block):be}else return k.localMode?k.localMode.token(U,k.localState):(U.skipToEnd(),E.code)}function y(U){var k=[];if(U.formatting){k.push(E.formatting),typeof U.formatting=="string"&&(U.formatting=[U.formatting]);for(var z=0;z<U.formatting.length;z++)k.push(E.formatting+"-"+U.formatting[z]),U.formatting[z]==="header"&&k.push(E.formatting+"-"+U.formatting[z]+"-"+U.header),U.formatting[z]==="quote"&&(!I.maxBlockquoteDepth||I.maxBlockquoteDepth>=U.quote?k.push(E.formatting+"-"+U.formatting[z]+"-"+U.quote):k.push("error"))}if(U.taskOpen)return k.push("meta"),k.length?k.join(" "):null;if(U.taskClosed)return k.push("property"),k.length?k.join(" "):null;if(U.linkHref?k.push(E.linkHref,"url"):(U.strong&&k.push(E.strong),U.em&&k.push(E.em),U.strikethrough&&k.push(E.strikethrough),U.emoji&&k.push(E.emoji),U.linkText&&k.push(E.linkText),U.code&&k.push(E.code),U.image&&k.push(E.image),U.imageAltText&&k.push(E.imageAltText,"link"),U.imageMarker&&k.push(E.imageMarker)),U.header&&k.push(E.header,E.header+"-"+U.header),U.quote&&(k.push(E.quote),!I.maxBlockquoteDepth||I.maxBlockquoteDepth>=U.quote?k.push(E.quote+"-"+U.quote):k.push(E.quote+"-"+I.maxBlockquoteDepth)),U.list!==!1){var te=(U.listStack.length-1)%3;te?te===1?k.push(E.list2):k.push(E.list3):k.push(E.list1)}return U.trailingSpaceNewLine?k.push("trailing-space-new-line"):U.trailingSpace&&k.push("trailing-space-"+(U.trailingSpace%2?"a":"b")),k.length?k.join(" "):null}function T(U,k){return U.match(a,!0)?y(k):void 0}function O(U,k){var z=k.text(U,k);if(typeof z!="undefined")return z;if(k.list)return k.list=null,y(k);if(k.taskList){var te=U.match(o,!0)[1]===" ";return te?k.taskOpen=!0:k.taskClosed=!0,I.highlightFormatting&&(k.formatting="task"),k.taskList=!1,y(k)}if(k.taskOpen=!1,k.taskClosed=!1,k.header&&U.match(/^#+$/,!0))return I.highlightFormatting&&(k.formatting="header"),y(k);var de=U.next();if(k.linkTitle){k.linkTitle=!1;var be=de;de==="("&&(be=")"),be=(be+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var We="^\\s*(?:[^"+be+"\\\\]+|\\\\\\\\|\\\\.)"+be;if(U.match(new RegExp(We),!0))return E.linkHref}if(de==="`"){var Ne=k.formatting;I.highlightFormatting&&(k.formatting="code"),U.eatWhile("`");var Le=U.current().length;if(k.code==0&&(!k.quote||Le==1))return k.code=Le,y(k);if(Le==k.code){var Ke=y(k);return k.code=0,Ke}else return k.formatting=Ne,y(k)}else if(k.code)return y(k);if(de==="\\"&&(U.next(),I.highlightFormatting)){var He=y(k),Ae=E.formatting+"-escape";return He?He+" "+Ae:Ae}if(de==="!"&&U.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return k.imageMarker=!0,k.image=!0,I.highlightFormatting&&(k.formatting="image"),y(k);if(de==="["&&k.imageMarker&&U.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return k.imageMarker=!1,k.imageAltText=!0,I.highlightFormatting&&(k.formatting="image"),y(k);if(de==="]"&&k.imageAltText){I.highlightFormatting&&(k.formatting="image");var He=y(k);return k.imageAltText=!1,k.image=!1,k.inline=k.f=F,He}if(de==="["&&!k.image)return k.linkText&&U.match(/^.*?\]/)||(k.linkText=!0,I.highlightFormatting&&(k.formatting="link")),y(k);if(de==="]"&&k.linkText){I.highlightFormatting&&(k.formatting="link");var He=y(k);return k.linkText=!1,k.inline=k.f=U.match(/\(.*?\)| ?\[.*?\]/,!1)?F:O,He}if(de==="<"&&U.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){k.f=k.inline=g,I.highlightFormatting&&(k.formatting="link");var He=y(k);return He?He+=" ":He="",He+E.linkInline}if(de==="<"&&U.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){k.f=k.inline=g,I.highlightFormatting&&(k.formatting="link");var He=y(k);return He?He+=" ":He="",He+E.linkEmail}if(I.xml&&de==="<"&&U.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var Se=U.string.indexOf(">",U.pos);if(Se!=-1){var he=U.string.substring(U.start,Se);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(he)&&(k.md_inside=!0)}return U.backUp(1),k.htmlState=G.startState(R),f(U,k,C)}if(I.xml&&de==="<"&&U.match(/^\/\w*?>/))return k.md_inside=!1,"tag";if(de==="*"||de==="_"){for(var Ie=1,ye=U.pos==1?" ":U.string.charAt(U.pos-2);Ie<3&&U.eat(de);)Ie++;var Ge=U.peek()||" ",$e=!/\s/.test(Ge)&&(!s.test(Ge)||/\s/.test(ye)||s.test(ye)),ze=!/\s/.test(ye)&&(!s.test(ye)||/\s/.test(Ge)||s.test(Ge)),Je=null,Qe=null;if(Ie%2&&(!k.em&&$e&&(de==="*"||!ze||s.test(ye))?Je=!0:k.em==de&&ze&&(de==="*"||!$e||s.test(Ge))&&(Je=!1)),Ie>1&&(!k.strong&&$e&&(de==="*"||!ze||s.test(ye))?Qe=!0:k.strong==de&&ze&&(de==="*"||!$e||s.test(Ge))&&(Qe=!1)),Qe!=null||Je!=null){I.highlightFormatting&&(k.formatting=Je==null?"strong":Qe==null?"em":"strong em"),Je===!0&&(k.em=de),Qe===!0&&(k.strong=de);var Ke=y(k);return Je===!1&&(k.em=!1),Qe===!1&&(k.strong=!1),Ke}}else if(de===" "&&(U.eat("*")||U.eat("_"))){if(U.peek()===" ")return y(k);U.backUp(1)}if(I.strikethrough){if(de==="~"&&U.eatWhile(de)){if(k.strikethrough){I.highlightFormatting&&(k.formatting="strikethrough");var Ke=y(k);return k.strikethrough=!1,Ke}else if(U.match(/^[^\s]/,!1))return k.strikethrough=!0,I.highlightFormatting&&(k.formatting="strikethrough"),y(k)}else if(de===" "&&U.match(/^~~/,!0)){if(U.peek()===" ")return y(k);U.backUp(2)}}if(I.emoji&&de===":"&&U.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){k.emoji=!0,I.highlightFormatting&&(k.formatting="emoji");var fe=y(k);return k.emoji=!1,fe}return de===" "&&(U.match(/^ +$/,!1)?k.trailingSpace++:k.trailingSpace&&(k.trailingSpaceNewLine=!0)),y(k)}function g(U,k){var z=U.next();if(z===">"){k.f=k.inline=O,I.highlightFormatting&&(k.formatting="link");var te=y(k);return te?te+=" ":te="",te+E.linkInline}return U.match(/^[^>]+/,!0),E.linkInline}function F(U,k){if(U.eatSpace())return null;var z=U.next();return z==="("||z==="["?(k.f=k.inline=N(z==="("?")":"]"),I.highlightFormatting&&(k.formatting="link-string"),k.linkHref=!0,y(k)):"error"}var P={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function N(U){return function(k,z){var te=k.next();if(te===U){z.f=z.inline=O,I.highlightFormatting&&(z.formatting="link-string");var de=y(z);return z.linkHref=!1,de}return k.match(P[U]),z.linkHref=!0,y(z)}}function X(U,k){return U.match(/^([^\]\\]|\\.)*\]:/,!1)?(k.f=j,U.next(),I.highlightFormatting&&(k.formatting="link"),k.linkText=!0,y(k)):d(U,k,O)}function j(U,k){if(U.match(/^\]:/,!0)){k.f=k.inline=A,I.highlightFormatting&&(k.formatting="link");var z=y(k);return k.linkText=!1,z}return U.match(/^([^\]\\]|\\.)+/,!0),E.linkText}function A(U,k){return U.eatSpace()?null:(U.match(/^[^\s]+/,!0),U.peek()===void 0?k.linkTitle=!0:U.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),k.f=k.inline=O,E.linkHref+" url")}var K={startState:function(){return{f:S,prevLine:{stream:null},thisLine:{stream:null},block:S,htmlState:null,indentation:0,inline:O,text:T,formatting:!1,linkText:!1,linkHref:!1,linkTitle:!1,code:0,em:!1,strong:!1,header:0,setext:0,hr:!1,taskList:!1,list:!1,listStack:[],quote:0,trailingSpace:0,trailingSpaceNewLine:!1,strikethrough:!1,emoji:!1,fencedEndRE:null}},copyState:function(U){return{f:U.f,prevLine:U.prevLine,thisLine:U.thisLine,block:U.block,htmlState:U.htmlState&&G.copyState(R,U.htmlState),indentation:U.indentation,localMode:U.localMode,localState:U.localMode?G.copyState(U.localMode,U.localState):null,inline:U.inline,text:U.text,formatting:!1,linkText:U.linkText,linkTitle:U.linkTitle,linkHref:U.linkHref,code:U.code,em:U.em,strong:U.strong,strikethrough:U.strikethrough,emoji:U.emoji,header:U.header,setext:U.setext,hr:U.hr,taskList:U.taskList,list:U.list,listStack:U.listStack.slice(0),quote:U.quote,indentedCode:U.indentedCode,trailingSpace:U.trailingSpace,trailingSpaceNewLine:U.trailingSpaceNewLine,md_inside:U.md_inside,fencedEndRE:U.fencedEndRE}},token:function(U,k){if(k.formatting=!1,U!=k.thisLine.stream){if(k.header=0,k.hr=!1,U.match(/^\s*$/,!0))return m(k),null;if(k.prevLine=k.thisLine,k.thisLine={stream:U},k.taskList=!1,k.trailingSpace=0,k.trailingSpaceNewLine=!1,!k.localState&&(k.f=k.block,k.f!=C)){var z=U.match(/^\s*/,!0)[0].replace(/\t/g,u).length;if(k.indentation=z,k.indentationDiff=null,z>0)return null}}return k.f(U,k)},innerMode:function(U){return U.block==C?{state:U.htmlState,mode:R}:U.localState?{state:U.localState,mode:U.localMode}:{state:U,mode:K}},indent:function(U,k,z){return U.block==C&&R.indent?R.indent(U.htmlState,k,z):U.localState&&U.localMode.indent?U.localMode.indent(U.localState,k,z):G.Pass},blankLine:m,getType:y,blockCommentStart:"<!--",blockCommentEnd:"-->",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return K},"xml"),G.defineMIME("text/markdown","markdown"),G.defineMIME("text/x-markdown","markdown")})},mHUz:function(it,ne,q){"use strict";Object.defineProperty(ne,"__esModule",{value:!0}),ne.default=void 0;var G={XK_VoidSymbol:16777215,XK_BackSpace:65288,XK_Tab:65289,XK_Linefeed:65290,XK_Clear:65291,XK_Return:65293,XK_Pause:65299,XK_Scroll_Lock:65300,XK_Sys_Req:65301,XK_Escape:65307,XK_Delete:65535,XK_Multi_key:65312,XK_Codeinput:65335,XK_SingleCandidate:65340,XK_MultipleCandidate:65341,XK_PreviousCandidate:65342,XK_Kanji:65313,XK_Muhenkan:65314,XK_Henkan_Mode:65315,XK_Henkan:65315,XK_Romaji:65316,XK_Hiragana:65317,XK_Katakana:65318,XK_Hiragana_Katakana:65319,XK_Zenkaku:65320,XK_Hankaku:65321,XK_Zenkaku_Hankaku:65322,XK_Touroku:65323,XK_Massyo:65324,XK_Kana_Lock:65325,XK_Kana_Shift:65326,XK_Eisu_Shift:65327,XK_Eisu_toggle:65328,XK_Kanji_Bangou:65335,XK_Zen_Koho:65341,XK_Mae_Koho:65342,XK_Home:65360,XK_Left:65361,XK_Up:65362,XK_Right:65363,XK_Down:65364,XK_Prior:65365,XK_Page_Up:65365,XK_Next:65366,XK_Page_Down:65366,XK_End:65367,XK_Begin:65368,XK_Select:65376,XK_Print:65377,XK_Execute:65378,XK_Insert:65379,XK_Undo:65381,XK_Redo:65382,XK_Menu:65383,XK_Find:65384,XK_Cancel:65385,XK_Help:65386,XK_Break:65387,XK_Mode_switch:65406,XK_script_switch:65406,XK_Num_Lock:65407,XK_KP_Space:65408,XK_KP_Tab:65417,XK_KP_Enter:65421,XK_KP_F1:65425,XK_KP_F2:65426,XK_KP_F3:65427,XK_KP_F4:65428,XK_KP_Home:65429,XK_KP_Left:65430,XK_KP_Up:65431,XK_KP_Right:65432,XK_KP_Down:65433,XK_KP_Prior:65434,XK_KP_Page_Up:65434,XK_KP_Next:65435,XK_KP_Page_Down:65435,XK_KP_End:65436,XK_KP_Begin:65437,XK_KP_Insert:65438,XK_KP_Delete:65439,XK_KP_Equal:65469,XK_KP_Multiply:65450,XK_KP_Add:65451,XK_KP_Separator:65452,XK_KP_Subtract:65453,XK_KP_Decimal:65454,XK_KP_Divide:65455,XK_KP_0:65456,XK_KP_1:65457,XK_KP_2:65458,XK_KP_3:65459,XK_KP_4:65460,XK_KP_5:65461,XK_KP_6:65462,XK_KP_7:65463,XK_KP_8:65464,XK_KP_9:65465,XK_F1:65470,XK_F2:65471,XK_F3:65472,XK_F4:65473,XK_F5:65474,XK_F6:65475,XK_F7:65476,XK_F8:65477,XK_F9:65478,XK_F10:65479,XK_F11:65480,XK_L1:65480,XK_F12:65481,XK_L2:65481,XK_F13:65482,XK_L3:65482,XK_F14:65483,XK_L4:65483,XK_F15:65484,XK_L5:65484,XK_F16:65485,XK_L6:65485,XK_F17:65486,XK_L7:65486,XK_F18:65487,XK_L8:65487,XK_F19:65488,XK_L9:65488,XK_F20:65489,XK_L10:65489,XK_F21:65490,XK_R1:65490,XK_F22:65491,XK_R2:65491,XK_F23:65492,XK_R3:65492,XK_F24:65493,XK_R4:65493,XK_F25:65494,XK_R5:65494,XK_F26:65495,XK_R6:65495,XK_F27:65496,XK_R7:65496,XK_F28:65497,XK_R8:65497,XK_F29:65498,XK_R9:65498,XK_F30:65499,XK_R10:65499,XK_F31:65500,XK_R11:65500,XK_F32:65501,XK_R12:65501,XK_F33:65502,XK_R13:65502,XK_F34:65503,XK_R14:65503,XK_F35:65504,XK_R15:65504,XK_Shift_L:65505,XK_Shift_R:65506,XK_Control_L:65507,XK_Control_R:65508,XK_Caps_Lock:65509,XK_Shift_Lock:65510,XK_Meta_L:65511,XK_Meta_R:65512,XK_Alt_L:65513,XK_Alt_R:65514,XK_Super_L:65515,XK_Super_R:65516,XK_Hyper_L:65517,XK_Hyper_R:65518,XK_ISO_Level3_Shift:65027,XK_ISO_Next_Group:65032,XK_ISO_Prev_Group:65034,XK_ISO_First_Group:65036,XK_ISO_Last_Group:65038,XK_space:32,XK_exclam:33,XK_quotedbl:34,XK_numbersign:35,XK_dollar:36,XK_percent:37,XK_ampersand:38,XK_apostrophe:39,XK_quoteright:39,XK_parenleft:40,XK_parenright:41,XK_asterisk:42,XK_plus:43,XK_comma:44,XK_minus:45,XK_period:46,XK_slash:47,XK_0:48,XK_1:49,XK_2:50,XK_3:51,XK_4:52,XK_5:53,XK_6:54,XK_7:55,XK_8:56,XK_9:57,XK_colon:58,XK_semicolon:59,XK_less:60,XK_equal:61,XK_greater:62,XK_question:63,XK_at:64,XK_A:65,XK_B:66,XK_C:67,XK_D:68,XK_E:69,XK_F:70,XK_G:71,XK_H:72,XK_I:73,XK_J:74,XK_K:75,XK_L:76,XK_M:77,XK_N:78,XK_O:79,XK_P:80,XK_Q:81,XK_R:82,XK_S:83,XK_T:84,XK_U:85,XK_V:86,XK_W:87,XK_X:88,XK_Y:89,XK_Z:90,XK_bracketleft:91,XK_backslash:92,XK_bracketright:93,XK_asciicircum:94,XK_underscore:95,XK_grave:96,XK_quoteleft:96,XK_a:97,XK_b:98,XK_c:99,XK_d:100,XK_e:101,XK_f:102,XK_g:103,XK_h:104,XK_i:105,XK_j:106,XK_k:107,XK_l:108,XK_m:109,XK_n:110,XK_o:111,XK_p:112,XK_q:113,XK_r:114,XK_s:115,XK_t:116,XK_u:117,XK_v:118,XK_w:119,XK_x:120,XK_y:121,XK_z:122,XK_braceleft:123,XK_bar:124,XK_braceright:125,XK_asciitilde:126,XK_nobreakspace:160,XK_exclamdown:161,XK_cent:162,XK_sterling:163,XK_currency:164,XK_yen:165,XK_brokenbar:166,XK_section:167,XK_diaeresis:168,XK_copyright:169,XK_ordfeminine:170,XK_guillemotleft:171,XK_notsign:172,XK_hyphen:173,XK_registered:174,XK_macron:175,XK_degree:176,XK_plusminus:177,XK_twosuperior:178,XK_threesuperior:179,XK_acute:180,XK_mu:181,XK_paragraph:182,XK_periodcentered:183,XK_cedilla:184,XK_onesuperior:185,XK_masculine:186,XK_guillemotright:187,XK_onequarter:188,XK_onehalf:189,XK_threequarters:190,XK_questiondown:191,XK_Agrave:192,XK_Aacute:193,XK_Acircumflex:194,XK_Atilde:195,XK_Adiaeresis:196,XK_Aring:197,XK_AE:198,XK_Ccedilla:199,XK_Egrave:200,XK_Eacute:201,XK_Ecircumflex:202,XK_Ediaeresis:203,XK_Igrave:204,XK_Iacute:205,XK_Icircumflex:206,XK_Idiaeresis:207,XK_ETH:208,XK_Eth:208,XK_Ntilde:209,XK_Ograve:210,XK_Oacute:211,XK_Ocircumflex:212,XK_Otilde:213,XK_Odiaeresis:214,XK_multiply:215,XK_Oslash:216,XK_Ooblique:216,XK_Ugrave:217,XK_Uacute:218,XK_Ucircumflex:219,XK_Udiaeresis:220,XK_Yacute:221,XK_THORN:222,XK_Thorn:222,XK_ssharp:223,XK_agrave:224,XK_aacute:225,XK_acircumflex:226,XK_atilde:227,XK_adiaeresis:228,XK_aring:229,XK_ae:230,XK_ccedilla:231,XK_egrave:232,XK_eacute:233,XK_ecircumflex:234,XK_ediaeresis:235,XK_igrave:236,XK_iacute:237,XK_icircumflex:238,XK_idiaeresis:239,XK_eth:240,XK_ntilde:241,XK_ograve:242,XK_oacute:243,XK_ocircumflex:244,XK_otilde:245,XK_odiaeresis:246,XK_division:247,XK_oslash:248,XK_ooblique:248,XK_ugrave:249,XK_uacute:250,XK_ucircumflex:251,XK_udiaeresis:252,XK_yacute:253,XK_thorn:254,XK_ydiaeresis:255,XK_Hangul:65329,XK_Hangul_Hanja:65332,XK_Hangul_Jeonja:65336,XF86XK_ModeLock:269025025,XF86XK_MonBrightnessUp:269025026,XF86XK_MonBrightnessDown:269025027,XF86XK_KbdLightOnOff:269025028,XF86XK_KbdBrightnessUp:269025029,XF86XK_KbdBrightnessDown:269025030,XF86XK_Standby:269025040,XF86XK_AudioLowerVolume:269025041,XF86XK_AudioMute:269025042,XF86XK_AudioRaiseVolume:269025043,XF86XK_AudioPlay:269025044,XF86XK_AudioStop:269025045,XF86XK_AudioPrev:269025046,XF86XK_AudioNext:269025047,XF86XK_HomePage:269025048,XF86XK_Mail:269025049,XF86XK_Start:269025050,XF86XK_Search:269025051,XF86XK_AudioRecord:269025052,XF86XK_Calculator:269025053,XF86XK_Memo:269025054,XF86XK_ToDoList:269025055,XF86XK_Calendar:269025056,XF86XK_PowerDown:269025057,XF86XK_ContrastAdjust:269025058,XF86XK_RockerUp:269025059,XF86XK_RockerDown:269025060,XF86XK_RockerEnter:269025061,XF86XK_Back:269025062,XF86XK_Forward:269025063,XF86XK_Stop:269025064,XF86XK_Refresh:269025065,XF86XK_PowerOff:269025066,XF86XK_WakeUp:269025067,XF86XK_Eject:269025068,XF86XK_ScreenSaver:269025069,XF86XK_WWW:269025070,XF86XK_Sleep:269025071,XF86XK_Favorites:269025072,XF86XK_AudioPause:269025073,XF86XK_AudioMedia:269025074,XF86XK_MyComputer:269025075,XF86XK_VendorHome:269025076,XF86XK_LightBulb:269025077,XF86XK_Shop:269025078,XF86XK_History:269025079,XF86XK_OpenURL:269025080,XF86XK_AddFavorite:269025081,XF86XK_HotLinks:269025082,XF86XK_BrightnessAdjust:269025083,XF86XK_Finance:269025084,XF86XK_Community:269025085,XF86XK_AudioRewind:269025086,XF86XK_BackForward:269025087,XF86XK_Launch0:269025088,XF86XK_Launch1:269025089,XF86XK_Launch2:269025090,XF86XK_Launch3:269025091,XF86XK_Launch4:269025092,XF86XK_Launch5:269025093,XF86XK_Launch6:269025094,XF86XK_Launch7:269025095,XF86XK_Launch8:269025096,XF86XK_Launch9:269025097,XF86XK_LaunchA:269025098,XF86XK_LaunchB:269025099,XF86XK_LaunchC:269025100,XF86XK_LaunchD:269025101,XF86XK_LaunchE:269025102,XF86XK_LaunchF:269025103,XF86XK_ApplicationLeft:269025104,XF86XK_ApplicationRight:269025105,XF86XK_Book:269025106,XF86XK_CD:269025107,XF86XK_Calculater:269025108,XF86XK_Clear:269025109,XF86XK_Close:269025110,XF86XK_Copy:269025111,XF86XK_Cut:269025112,XF86XK_Display:269025113,XF86XK_DOS:269025114,XF86XK_Documents:269025115,XF86XK_Excel:269025116,XF86XK_Explorer:269025117,XF86XK_Game:269025118,XF86XK_Go:269025119,XF86XK_iTouch:269025120,XF86XK_LogOff:269025121,XF86XK_Market:269025122,XF86XK_Meeting:269025123,XF86XK_MenuKB:269025125,XF86XK_MenuPB:269025126,XF86XK_MySites:269025127,XF86XK_New:269025128,XF86XK_News:269025129,XF86XK_OfficeHome:269025130,XF86XK_Open:269025131,XF86XK_Option:269025132,XF86XK_Paste:269025133,XF86XK_Phone:269025134,XF86XK_Q:269025136,XF86XK_Reply:269025138,XF86XK_Reload:269025139,XF86XK_RotateWindows:269025140,XF86XK_RotationPB:269025141,XF86XK_RotationKB:269025142,XF86XK_Save:269025143,XF86XK_ScrollUp:269025144,XF86XK_ScrollDown:269025145,XF86XK_ScrollClick:269025146,XF86XK_Send:269025147,XF86XK_Spell:269025148,XF86XK_SplitScreen:269025149,XF86XK_Support:269025150,XF86XK_TaskPane:269025151,XF86XK_Terminal:269025152,XF86XK_Tools:269025153,XF86XK_Travel:269025154,XF86XK_UserPB:269025156,XF86XK_User1KB:269025157,XF86XK_User2KB:269025158,XF86XK_Video:269025159,XF86XK_WheelButton:269025160,XF86XK_Word:269025161,XF86XK_Xfer:269025162,XF86XK_ZoomIn:269025163,XF86XK_ZoomOut:269025164,XF86XK_Away:269025165,XF86XK_Messenger:269025166,XF86XK_WebCam:269025167,XF86XK_MailForward:269025168,XF86XK_Pictures:269025169,XF86XK_Music:269025170,XF86XK_Battery:269025171,XF86XK_Bluetooth:269025172,XF86XK_WLAN:269025173,XF86XK_UWB:269025174,XF86XK_AudioForward:269025175,XF86XK_AudioRepeat:269025176,XF86XK_AudioRandomPlay:269025177,XF86XK_Subtitle:269025178,XF86XK_AudioCycleTrack:269025179,XF86XK_CycleAngle:269025180,XF86XK_FrameBack:269025181,XF86XK_FrameForward:269025182,XF86XK_Time:269025183,XF86XK_Select:269025184,XF86XK_View:269025185,XF86XK_TopMenu:269025186,XF86XK_Red:269025187,XF86XK_Green:269025188,XF86XK_Yellow:269025189,XF86XK_Blue:269025190,XF86XK_Suspend:269025191,XF86XK_Hibernate:269025192,XF86XK_TouchpadToggle:269025193,XF86XK_TouchpadOn:269025200,XF86XK_TouchpadOff:269025201,XF86XK_AudioMicMute:269025202,XF86XK_Switch_VT_1:269024769,XF86XK_Switch_VT_2:269024770,XF86XK_Switch_VT_3:269024771,XF86XK_Switch_VT_4:269024772,XF86XK_Switch_VT_5:269024773,XF86XK_Switch_VT_6:269024774,XF86XK_Switch_VT_7:269024775,XF86XK_Switch_VT_8:269024776,XF86XK_Switch_VT_9:269024777,XF86XK_Switch_VT_10:269024778,XF86XK_Switch_VT_11:269024779,XF86XK_Switch_VT_12:269024780,XF86XK_Ungrab:269024800,XF86XK_ClearGrab:269024801,XF86XK_Next_VMode:269024802,XF86XK_Prev_VMode:269024803,XF86XK_LogWindowTree:269024804,XF86XK_LogGrabInfo:269024805};ne.default=G},mTgk:function(it,ne,q){"use strict";Object.defineProperty(ne,"__esModule",{value:!0}),ne.default=void 0;var G=L(q("mHUz"));function L(b){return b&&b.__esModule?b:{default:b}}var I={};function R(b,i){if(i===void 0)throw new Error('Undefined keysym for key "'+b+'"');if(b in I)throw new Error('Duplicate entry for key "'+b+'"');I[b]=[i,i,i,i]}function M(b,i,c){if(i===void 0)throw new Error('Undefined keysym for key "'+b+'"');if(c===void 0)throw new Error('Undefined keysym for key "'+b+'"');if(b in I)throw new Error('Duplicate entry for key "'+b+'"');I[b]=[i,i,c,i]}function p(b,i,c){if(i===void 0)throw new Error('Undefined keysym for key "'+b+'"');if(c===void 0)throw new Error('Undefined keysym for key "'+b+'"');if(b in I)throw new Error('Duplicate entry for key "'+b+'"');I[b]=[i,i,i,c]}M("Alt",G.default.XK_Alt_L,G.default.XK_Alt_R),R("AltGraph",G.default.XK_ISO_Level3_Shift),R("CapsLock",G.default.XK_Caps_Lock),M("Control",G.default.XK_Control_L,G.default.XK_Control_R),M("Meta",G.default.XK_Super_L,G.default.XK_Super_R),R("NumLock",G.default.XK_Num_Lock),R("ScrollLock",G.default.XK_Scroll_Lock),M("Shift",G.default.XK_Shift_L,G.default.XK_Shift_R),p("Enter",G.default.XK_Return,G.default.XK_KP_Enter),R("Tab",G.default.XK_Tab),p(" ",G.default.XK_space,G.default.XK_KP_Space),p("ArrowDown",G.default.XK_Down,G.default.XK_KP_Down),p("ArrowUp",G.default.XK_Up,G.default.XK_KP_Up),p("ArrowLeft",G.default.XK_Left,G.default.XK_KP_Left),p("ArrowRight",G.default.XK_Right,G.default.XK_KP_Right),p("End",G.default.XK_End,G.default.XK_KP_End),p("Home",G.default.XK_Home,G.default.XK_KP_Home),p("PageDown",G.default.XK_Next,G.default.XK_KP_Next),p("PageUp",G.default.XK_Prior,G.default.XK_KP_Prior),R("Backspace",G.default.XK_BackSpace),p("Clear",G.default.XK_Clear,G.default.XK_KP_Begin),R("Copy",G.default.XF86XK_Copy),R("Cut",G.default.XF86XK_Cut),p("Delete",G.default.XK_Delete,G.default.XK_KP_Delete),p("Insert",G.default.XK_Insert,G.default.XK_KP_Insert),R("Paste",G.default.XF86XK_Paste),R("Redo",G.default.XK_Redo),R("Undo",G.default.XK_Undo),R("Cancel",G.default.XK_Cancel),R("ContextMenu",G.default.XK_Menu),R("Escape",G.default.XK_Escape),R("Execute",G.default.XK_Execute),R("Find",G.default.XK_Find),R("Help",G.default.XK_Help),R("Pause",G.default.XK_Pause),R("Select",G.default.XK_Select),R("ZoomIn",G.default.XF86XK_ZoomIn),R("ZoomOut",G.default.XF86XK_ZoomOut),R("BrightnessDown",G.default.XF86XK_MonBrightnessDown),R("BrightnessUp",G.default.XF86XK_MonBrightnessUp),R("Eject",G.default.XF86XK_Eject),R("LogOff",G.default.XF86XK_LogOff),R("Power",G.default.XF86XK_PowerOff),R("PowerOff",G.default.XF86XK_PowerDown),R("PrintScreen",G.default.XK_Print),R("Hibernate",G.default.XF86XK_Hibernate),R("Standby",G.default.XF86XK_Standby),R("WakeUp",G.default.XF86XK_WakeUp),R("AllCandidates",G.default.XK_MultipleCandidate),R("Alphanumeric",G.default.XK_Eisu_Shift),R("CodeInput",G.default.XK_Codeinput),R("Compose",G.default.XK_Multi_key),R("Convert",G.default.XK_Henkan),R("GroupFirst",G.default.XK_ISO_First_Group),R("GroupLast",G.default.XK_ISO_Last_Group),R("GroupNext",G.default.XK_ISO_Next_Group),R("GroupPrevious",G.default.XK_ISO_Prev_Group),R("NonConvert",G.default.XK_Muhenkan),R("PreviousCandidate",G.default.XK_PreviousCandidate),R("SingleCandidate",G.default.XK_SingleCandidate),R("HangulMode",G.default.XK_Hangul),R("HanjaMode",G.default.XK_Hangul_Hanja),R("JunjuaMode",G.default.XK_Hangul_Jeonja),R("Eisu",G.default.XK_Eisu_toggle),R("Hankaku",G.default.XK_Hankaku),R("Hiragana",G.default.XK_Hiragana),R("HiraganaKatakana",G.default.XK_Hiragana_Katakana),R("KanaMode",G.default.XK_Kana_Shift),R("KanjiMode",G.default.XK_Kanji),R("Katakana",G.default.XK_Katakana),R("Romaji",G.default.XK_Romaji),R("Zenkaku",G.default.XK_Zenkaku),R("ZenkakuHanaku",G.default.XK_Zenkaku_Hankaku),R("F1",G.default.XK_F1),R("F2",G.default.XK_F2),R("F3",G.default.XK_F3),R("F4",G.default.XK_F4),R("F5",G.default.XK_F5),R("F6",G.default.XK_F6),R("F7",G.default.XK_F7),R("F8",G.default.XK_F8),R("F9",G.default.XK_F9),R("F10",G.default.XK_F10),R("F11",G.default.XK_F11),R("F12",G.default.XK_F12),R("F13",G.default.XK_F13),R("F14",G.default.XK_F14),R("F15",G.default.XK_F15),R("F16",G.default.XK_F16),R("F17",G.default.XK_F17),R("F18",G.default.XK_F18),R("F19",G.default.XK_F19),R("F20",G.default.XK_F20),R("F21",G.default.XK_F21),R("F22",G.default.XK_F22),R("F23",G.default.XK_F23),R("F24",G.default.XK_F24),R("F25",G.default.XK_F25),R("F26",G.default.XK_F26),R("F27",G.default.XK_F27),R("F28",G.default.XK_F28),R("F29",G.default.XK_F29),R("F30",G.default.XK_F30),R("F31",G.default.XK_F31),R("F32",G.default.XK_F32),R("F33",G.default.XK_F33),R("F34",G.default.XK_F34),R("F35",G.default.XK_F35),R("Close",G.default.XF86XK_Close),R("MailForward",G.default.XF86XK_MailForward),R("MailReply",G.default.XF86XK_Reply),R("MailSend",G.default.XF86XK_Send),R("MediaFastForward",G.default.XF86XK_AudioForward),R("MediaPause",G.default.XF86XK_AudioPause),R("MediaPlay",G.default.XF86XK_AudioPlay),R("MediaRecord",G.default.XF86XK_AudioRecord),R("MediaRewind",G.default.XF86XK_AudioRewind),R("MediaStop",G.default.XF86XK_AudioStop),R("MediaTrackNext",G.default.XF86XK_AudioNext),R("MediaTrackPrevious",G.default.XF86XK_AudioPrev),R("New",G.default.XF86XK_New),R("Open",G.default.XF86XK_Open),R("Print",G.default.XK_Print),R("Save",G.default.XF86XK_Save),R("SpellCheck",G.default.XF86XK_Spell),R("AudioVolumeDown",G.default.XF86XK_AudioLowerVolume),R("AudioVolumeUp",G.default.XF86XK_AudioRaiseVolume),R("AudioVolumeMute",G.default.XF86XK_AudioMute),R("MicrophoneVolumeMute",G.default.XF86XK_AudioMicMute),R("LaunchApplication1",G.default.XF86XK_MyComputer),R("LaunchApplication2",G.default.XF86XK_Calculator),R("LaunchCalendar",G.default.XF86XK_Calendar),R("LaunchMail",G.default.XF86XK_Mail),R("LaunchMediaPlayer",G.default.XF86XK_AudioMedia),R("LaunchMusicPlayer",G.default.XF86XK_Music),R("LaunchPhone",G.default.XF86XK_Phone),R("LaunchScreenSaver",G.default.XF86XK_ScreenSaver),R("LaunchSpreadsheet",G.default.XF86XK_Excel),R("LaunchWebBrowser",G.default.XF86XK_WWW),R("LaunchWebCam",G.default.XF86XK_WebCam),R("LaunchWordProcessor",G.default.XF86XK_Word),R("BrowserBack",G.default.XF86XK_Back),R("BrowserFavorites",G.default.XF86XK_Favorites),R("BrowserForward",G.default.XF86XK_Forward),R("BrowserHome",G.default.XF86XK_HomePage),R("BrowserRefresh",G.default.XF86XK_Refresh),R("BrowserSearch",G.default.XF86XK_Search),R("BrowserStop",G.default.XF86XK_Stop),R("Dimmer",G.default.XF86XK_BrightnessAdjust),R("MediaAudioTrack",G.default.XF86XK_AudioCycleTrack),R("RandomToggle",G.default.XF86XK_AudioRandomPlay),R("SplitScreenToggle",G.default.XF86XK_SplitScreen),R("Subtitle",G.default.XF86XK_Subtitle),R("VideoModeNext",G.default.XF86XK_Next_VMode),p("=",G.default.XK_equal,G.default.XK_KP_Equal),p("+",G.default.XK_plus,G.default.XK_KP_Add),p("-",G.default.XK_minus,G.default.XK_KP_Subtract),p("*",G.default.XK_asterisk,G.default.XK_KP_Multiply),p("/",G.default.XK_slash,G.default.XK_KP_Divide),p(".",G.default.XK_period,G.default.XK_KP_Decimal),p(",",G.default.XK_comma,G.default.XK_KP_Separator),p("0",G.default.XK_0,G.default.XK_KP_0),p("1",G.default.XK_1,G.default.XK_KP_1),p("2",G.default.XK_2,G.default.XK_KP_2),p("3",G.default.XK_3,G.default.XK_KP_3),p("4",G.default.XK_4,G.default.XK_KP_4),p("5",G.default.XK_5,G.default.XK_KP_5),p("6",G.default.XK_6,G.default.XK_KP_6),p("7",G.default.XK_7,G.default.XK_KP_7),p("8",G.default.XK_8,G.default.XK_KP_8),p("9",G.default.XK_9,G.default.XK_KP_9);var E=I;ne.default=E},mdZa:function(it,ne,q){"use strict";typeof Object.assign!="function"&&Object.defineProperty(Object,"assign",{value:function(L,I){"use strict";if(L==null)throw new TypeError("Cannot convert undefined or null to object");for(var R=Object(L),M=1;M<arguments.length;M++){var p=arguments[M];if(p!=null)for(var E in p)Object.prototype.hasOwnProperty.call(p,E)&&(R[E]=p[E])}return R},writable:!0,configurable:!0}),function(){function G(L,I){I=I||{bubbles:!1,cancelable:!1,detail:void 0};var R=document.createEvent("CustomEvent");return R.initCustomEvent(L,I.bubbles,I.cancelable,I.detail),R}G.prototype=window.Event.prototype,typeof window.CustomEvent!="function"&&(window.CustomEvent=G)}(),Number.isInteger=Number.isInteger||function(L){return typeof L=="number"&&isFinite(L)&&Math.floor(L)===L}},nEHx:function(it,ne,q){"use strict";q.d(ne,"a",function(){return G});var G;(function(L){L.DARK="dark",L.LIGHT="light",L.HIGH_CONTRAST="hc"})(G||(G={}))},nnTU:function(it,ne,q){"use strict";q.d(ne,"b",function(){return E}),q.d(ne,"a",function(){return b});var G=q("MI8n"),L=q("JYp7"),I=q("pmY6"),R=q("24hK"),M=q("746U"),p=q("Cg/j");const E=Object(p.c)("commandService"),b=new class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new G.b,this.onDidRegisterCommand=this._onDidRegisterCommand.event}registerCommand(i,c){if(!i)throw new Error("invalid command");if(typeof i=="string"){if(!c)throw new Error("invalid command");return this.registerCommand({id:i,handler:c})}if(i.description){const t=[];for(let s of i.description.args)t.push(s.constraint);const r=i.handler;i.handler=function(s,...u){return Object(M.o)(u,t),r(s,...u)}}const{id:o}=i;let h=this._commands.get(o);h||(h=new R.a,this._commands.set(o,h));let n=h.unshift(i),a=Object(I.i)(()=>{n();const t=this._commands.get(o);(t==null?void 0:t.isEmpty())&&this._commands.delete(o)});return this._onDidRegisterCommand.fire(o),a}registerCommandAlias(i,c){return b.registerCommand(i,(o,...h)=>o.get(E).executeCommand(c,...h))}getCommand(i){const c=this._commands.get(i);return!c||c.isEmpty()?void 0:L.a.first(c)}getCommands(){const i=new Map;for(const c of this._commands.keys()){const o=this.getCommand(c);o&&i.set(c,o)}return i}};b.registerCommand("noop",()=>{})},osHv:function(it,ne,q){(function(G){G(q("VrN/"))})(function(G){"use strict";var L=G.Pos;function I(s,u){return s.line-u.line||s.ch-u.ch}var R="A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",M=R+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",p=new RegExp("<(/?)(["+R+"]["+M+"]*)","g");function E(s,u,d,f){this.line=u,this.ch=d,this.cm=s,this.text=s.getLine(u),this.min=f?Math.max(f.from,s.firstLine()):s.firstLine(),this.max=f?Math.min(f.to-1,s.lastLine()):s.lastLine()}function b(s,u){var d=s.cm.getTokenTypeAt(L(s.line,u));return d&&/\btag\b/.test(d)}function i(s){return s.line>=s.max?void 0:(s.ch=0,s.text=s.cm.getLine(++s.line),!0)}function c(s){return s.line<=s.min?void 0:(s.text=s.cm.getLine(--s.line),s.ch=s.text.length,!0)}function o(s){for(;;){var u=s.text.indexOf(">",s.ch);if(u==-1){if(i(s))continue;return}if(!b(s,u+1)){s.ch=u+1;continue}var d=s.text.lastIndexOf("/",u),f=d>-1&&!/\S/.test(s.text.slice(d+1,u));return s.ch=u+1,f?"selfClose":"regular"}}function h(s){for(;;){var u=s.ch?s.text.lastIndexOf("<",s.ch-1):-1;if(u==-1){if(c(s))continue;return}if(!b(s,u+1)){s.ch=u;continue}p.lastIndex=u,s.ch=u;var d=p.exec(s.text);if(d&&d.index==u)return d}}function n(s){for(;;){p.lastIndex=s.ch;var u=p.exec(s.text);if(!u){if(i(s))continue;return}if(!b(s,u.index+1)){s.ch=u.index+1;continue}return s.ch=u.index+u[0].length,u}}function a(s){for(;;){var u=s.ch?s.text.lastIndexOf(">",s.ch-1):-1;if(u==-1){if(c(s))continue;return}if(!b(s,u+1)){s.ch=u;continue}var d=s.text.lastIndexOf("/",u),f=d>-1&&!/\S/.test(s.text.slice(d+1,u));return s.ch=u+1,f?"selfClose":"regular"}}function t(s,u){for(var d=[];;){var f=n(s),v,m=s.line,S=s.ch-(f?f[0].length:0);if(!f||!(v=o(s)))return;if(v=="selfClose")continue;if(f[1]){for(var C=d.length-1;C>=0;--C)if(d[C]==f[2]){d.length=C;break}if(C<0&&(!u||u==f[2]))return{tag:f[2],from:L(m,S),to:L(s.line,s.ch)}}else d.push(f[2])}}function r(s,u){for(var d=[];;){var f=a(s);if(!f)return;if(f=="selfClose"){h(s);continue}var v=s.line,m=s.ch,S=h(s);if(!S)return;if(S[1])d.push(S[2]);else{for(var C=d.length-1;C>=0;--C)if(d[C]==S[2]){d.length=C;break}if(C<0&&(!u||u==S[2]))return{tag:S[2],from:L(s.line,s.ch),to:L(v,m)}}}}G.registerHelper("fold","xml",function(s,u){for(var d=new E(s,u.line,0);;){var f=n(d);if(!f||d.line!=u.line)return;var v=o(d);if(!v)return;if(!f[1]&&v!="selfClose"){var m=L(d.line,d.ch),S=t(d,f[2]);return S&&I(S.from,m)>0?{from:m,to:S.from}:null}}}),G.findMatchingTag=function(s,u,d){var f=new E(s,u.line,u.ch,d);if(f.text.indexOf(">")==-1&&f.text.indexOf("<")==-1)return;var v=o(f),m=v&&L(f.line,f.ch),S=v&&h(f);if(!v||!S||I(f,u)>0)return;var C={from:L(f.line,f.ch),to:m,tag:S[2]};return v=="selfClose"?{open:C,close:null,at:"open"}:S[1]?{open:r(f,S[2]),close:C,at:"close"}:(f=new E(s,m.line,m.ch,d),{open:C,close:t(f,S[2]),at:"open"})},G.findEnclosingTag=function(s,u,d,f){for(var v=new E(s,u.line,u.ch,d);;){var m=r(v,f);if(!m)break;var S=new E(s,u.line,u.ch,d),C=t(S,m.tag);if(C)return{open:m,close:C}}},G.scanForClosingTag=function(s,u,d,f){var v=new E(s,u.line,u.ch,f?{from:0,to:f}:null);return t(v,d)}})},p5ED:function(it,ne,q){"use strict";var G=q("+L6B"),L=q("2/Rp"),I=q("5Dmo"),R=q("3S7+"),M=q("k1fw"),p=q("9og8"),E=q("tJVT"),b=q("WmNS"),i=q.n(b),c=q("q1tI"),o=q.n(c),h=q("vHTk"),n=q.n(h),a=q("yEEn"),t=q("ZW9T"),r=q("1vsH"),s=q("V0Rq"),u=q("m3rI");ne.a=function(d){var f,v,m,S,C,_,y,T=d.editOffice,O=T===void 0?"view":T,g=d.data,F=d.theme,P=d.type,N=d.filename,X=d.monacoEditor,j=d.className,A=d.style,K=d.close,U=d.onClose,k=d.hasMask,z=d.disabledDownload,te=Object(c.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),de=Object(E.a)(te,2),be=de[0],We=de[1],Ne=Object(c.useState)(""),Le=Object(E.a)(Ne,2),Ke=Le[0],He=Le[1],Ae=Object(c.useState)(),Se=Object(E.a)(Ae,2),he=Se[0],Ie=Se[1],ye=window.ENV==="build"?"/react/build":"",Ge=u.a.PROXY_SERVER||location.origin,$e,ze=1024*1024,Je=10*ze,Qe=Object(c.useRef)();(f=g)!==null&&f!==void 0&&f.startsWith("/api")&&P!=="txt"&&(g=u.a.API_SERVER+g),P==="office"&&($e=Object(r.U)(g).filesize,$e>Je&&(P="other")),N&&X&&(X.filename=N),Object(c.useEffect)(function(){var we,Te,re=(we=document.cookie)===null||we===void 0||((Te=we.replace(/\s/g,""))===null||Te===void 0)?void 0:Te.split(";");re==null||re.map(function(ve){var ae=ve.split("=");ae[0]==="_educoder_session"&&He(ae[1])})},[]),Object(c.useEffect)(function(){P==="office"&&fe()},[P,g]);var fe=function(){var we=Object(p.a)(i.a.mark(function Te(){var re,ve,ae;return i.a.wrap(function(Ye){for(;;)switch(Ye.prev=Ye.next){case 0:return console.log("data:",g),re=g,g.startsWith("http")||(re=location.origin+re),ve=new URL(re).pathname.split("/").pop(),Ye.next=6,Object(s.V)({attachment_id:ve});case 6:ae=Ye.sent,Ie(ae);case 8:case"end":return Ye.stop()}},Te)}));return function(){return we.apply(this,arguments)}}(),ge=function(){if(g.startsWith("http")||g.startsWith("blob:")){xe();return}Object(r.z)(N||"educoder",g,N)},xe=function(){Object(r.x)(N||"educoder",decodeURIComponent(g))};return o.a.createElement("div",{style:Object(M.a)({},A||{}),className:"".concat(k&&n.a.bgBlack," ").concat(P?n.a.wrp:"hide")},K&&o.a.createElement("div",{className:n.a.close,ref:Qe},!z&&o.a.createElement(R.a,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:function(){return Qe.current}},o.a.createElement("span",{onClick:xe},o.a.createElement("i",{className:"icon-quxiaozhiding"}))),o.a.createElement(R.a,{title:"\u5173\u95ED",getPopupContainer:function(){return Qe.current}},o.a.createElement("span",{className:"",onClick:U},o.a.createElement("i",{className:"icon-guanbi1"})))),o.a.createElement("div",{className:"".concat(n.a[j]," ").concat(j," ").concat(n.a.monaco," ").concat(P==="txt"?"show":"hide")},P==="txt"&&o.a.createElement(t.b,X)),P==="audio"&&o.a.createElement("audio",{src:"".concat(((v=g)===null||v===void 0?void 0:v.indexOf("http://"))>-1||((m=g)===null||m===void 0?void 0:m.indexOf("https://"))>-1?"":"data:audio/mp3;base64,").concat(g),autoPlay:!0}),P==="video"&&o.a.createElement(o.a.Fragment,null,((S=g)===null||S===void 0?void 0:S.indexOf("http"))>-1?o.a.createElement("video",{controls:!0,src:"".concat(g),autoPlay:!0}):o.a.createElement("video",{controls:!0,src:"data:video/mp4;base64,".concat(g),autoPlay:!0})),P==="office"&&he&&o.a.createElement("iframe",{src:"".concat(ye,"/office.html?key=").concat(he.key,"&url=").concat(Ge+he.url,"&callbackUrl=").concat(Ge+he.callbackUrl,"&fileType=").concat(he.fileType,"&title=").concat(he.title,"&model=").concat(O,"&officeServer=").concat(u.a.OFFICE_SERVER,"&disabledDownload=").concat(!!z)}),P==="html"&&o.a.createElement("iframe",{src:g+"&disposition=inline"}),P==="pdf"&&o.a.createElement("iframe",{src:"".concat(ye,"/js/pdfview/index.html?url=").concat(g,"&disabledDownload=").concat(!!z)}),P==="image"&&o.a.createElement("img",{src:"".concat(((C=g)===null||C===void 0?void 0:C.indexOf("http://"))>-1||((_=g)===null||_===void 0?void 0:_.indexOf("https://"))>-1||(y=g)!==null&&y!==void 0&&y.startsWith("/api")?"":"data:image/png;base64,").concat(g)}),P==="other"&&o.a.createElement("div",null,o.a.createElement(L.a,{type:"primary",size:"large",onClick:ge},o.a.createElement(a.a,null),"\u70B9\u51FB\u4E0B\u8F7D")),P==="download"&&o.a.createElement(L.a,{type:"primary",size:"large",onClick:ge},o.a.createElement(a.a,null),"\u70B9\u51FB\u4E0B\u8F7D"))}},"p77/":function(it,ne,q){},pmY6:function(it,ne,q){"use strict";q.d(ne,"h",function(){return c}),q.d(ne,"g",function(){return h}),q.d(ne,"f",function(){return n}),q.d(ne,"e",function(){return a}),q.d(ne,"i",function(){return t}),q.d(ne,"b",function(){return r}),q.d(ne,"a",function(){return s}),q.d(ne,"d",function(){return u}),q.d(ne,"c",function(){return d});var G=q("C/vA"),L=q("JYp7");const I=!1;let R=null;function M(f){R=f}if(I){const f="__is_disposable_tracked__";M(new class{trackDisposable(v){const m=new Error("Potentially leaked disposable").stack;setTimeout(()=>{v[f]||console.log(m)},3e3)}setParent(v,m){if(v&&v!==s.None)try{v[f]=!0}catch(S){}}markAsDisposed(v){if(v&&v!==s.None)try{v[f]=!0}catch(m){}}markAsSingleton(v){}})}function p(f){return R==null||R.trackDisposable(f),f}function E(f){R==null||R.markAsDisposed(f)}function b(f,v){R==null||R.setParent(f,v)}function i(f,v){if(!R)return;for(const m of f)R.setParent(m,v)}function c(f){return R==null||R.markAsSingleton(f),f}class o extends Error{constructor(f){super(`Encountered errors while disposing of store. Errors: [${f.join(", ")}]`);this.errors=f}}function h(f){return typeof f.dispose=="function"&&f.dispose.length===0}function n(f){if(L.a.is(f)){let v=[];for(const m of f)if(m)try{m.dispose()}catch(S){v.push(S)}if(v.length===1)throw v[0];if(v.length>1)throw new o(v);return Array.isArray(f)?[]:f}else if(f)return f.dispose(),f}function a(...f){const v=t(()=>n(f));return i(f,v),v}function t(f){const v=p({dispose:Object(G.a)(()=>{E(v),f()})});return v}class r{constructor(){this._toDispose=new Set,this._isDisposed=!1,p(this)}dispose(){if(this._isDisposed)return;E(this),this._isDisposed=!0,this.clear()}clear(){try{n(this._toDispose.values())}finally{this._toDispose.clear()}}add(f){if(!f)return f;if(f===this)throw new Error("Cannot register a disposable on itself!");return b(f,this),this._isDisposed?r.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(f),f}}r.DISABLE_DISPOSED_WARNING=!1;class s{constructor(){this._store=new r,p(this),b(this._store,this)}dispose(){E(this),this._store.dispose()}_register(f){if(f===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(f)}}s.None=Object.freeze({dispose(){}});class u{constructor(){this._isDisposed=!1,p(this)}get value(){return this._isDisposed?void 0:this._value}set value(f){var v;if(this._isDisposed||f===this._value)return;(v=this._value)===null||v===void 0||v.dispose(),f&&b(f,this),this._value=f}clear(){this.value=void 0}dispose(){var f;this._isDisposed=!0,E(this),(f=this._value)===null||f===void 0||f.dispose(),this._value=void 0}clearAndLeak(){const f=this._value;return this._value=void 0,f&&b(f,null),f}}class d{constructor(f){this.object=f}dispose(){}}},psGv:function(it,ne,q){var G,L;(function(){var I;(function(){"use strict";var E=[,,function(o){function h(t){this.__parent=t,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=[]}h.prototype.clone_empty=function(){var t=new h(this.__parent);return t.set_indent(this.__indent_count,this.__alignment_count),t},h.prototype.item=function(t){return t<0?this.__items[this.__items.length+t]:this.__items[t]},h.prototype.has_match=function(t){for(var r=this.__items.length-1;r>=0;r--)if(this.__items[r].match(t))return!0;return!1},h.prototype.set_indent=function(t,r){this.is_empty()&&(this.__indent_count=t||0,this.__alignment_count=r||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},h.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)},h.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},h.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var t=this.__parent.current_line;return t.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),t.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),t.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,t.__items[0]===" "&&(t.__items.splice(0,1),t.__character_count-=1),!0}return!1},h.prototype.is_empty=function(){return this.__items.length===0},h.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},h.prototype.push=function(t){this.__items.push(t);var r=t.lastIndexOf(`
|
|
|
`);r!==-1?this.__character_count=t.length-r:this.__character_count+=t.length},h.prototype.pop=function(){var t=null;return this.is_empty()||(t=this.__items.pop(),this.__character_count-=t.length),t},h.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},h.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},h.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},h.prototype.toString=function(){var t="";return this.is_empty()?this.__parent.indent_empty_lines&&(t=this.__parent.get_indent_string(this.__indent_count)):(t=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),t+=this.__items.join("")),t};function n(t,r){this.__cache=[""],this.__indent_size=t.indent_size,this.__indent_string=t.indent_char,t.indent_with_tabs||(this.__indent_string=new Array(t.indent_size+1).join(t.indent_char)),r=r||"",t.indent_level>0&&(r=new Array(t.indent_level+1).join(this.__indent_string)),this.__base_string=r,this.__base_string_length=r.length}n.prototype.get_indent_size=function(t,r){var s=this.__base_string_length;return r=r||0,t<0&&(s=0),s+=t*this.__indent_size,s+=r,s},n.prototype.get_indent_string=function(t,r){var s=this.__base_string;return r=r||0,t<0&&(t=0,s=""),r+=t*this.__indent_size,this.__ensure_cache(r),s+=this.__cache[r],s},n.prototype.__ensure_cache=function(t){for(;t>=this.__cache.length;)this.__add_column()},n.prototype.__add_column=function(){var t=this.__cache.length,r=0,s="";this.__indent_size&&t>=this.__indent_size&&(r=Math.floor(t/this.__indent_size),t-=r*this.__indent_size,s=new Array(r+1).join(this.__indent_string)),t&&(s+=new Array(t+1).join(" ")),this.__cache.push(s)};function a(t,r){this.__indent_cache=new n(t,r),this.raw=!1,this._end_with_newline=t.end_with_newline,this.indent_size=t.indent_size,this.wrap_line_length=t.wrap_line_length,this.indent_empty_lines=t.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new h(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}a.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},a.prototype.get_line_number=function(){return this.__lines.length},a.prototype.get_indent_string=function(t,r){return this.__indent_cache.get_indent_string(t,r)},a.prototype.get_indent_size=function(t,r){return this.__indent_cache.get_indent_size(t,r)},a.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},a.prototype.add_new_line=function(t){return this.is_empty()||!t&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},a.prototype.get_code=function(t){this.trim(!0);var r=this.current_line.pop();r&&(r[r.length-1]===`
|
|
|
`&&(r=r.replace(/\n+$/g,"")),this.current_line.push(r)),this._end_with_newline&&this.__add_outputline();var s=this.__lines.join(`
|
|
|
`);return t!==`
|
|
|
`&&(s=s.replace(/[\n]/g,t)),s},a.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},a.prototype.set_indent=function(t,r){return t=t||0,r=r||0,this.next_line.set_indent(t,r),this.__lines.length>1?(this.current_line.set_indent(t,r),!0):(this.current_line.set_indent(),!1)},a.prototype.add_raw_token=function(t){for(var r=0;r<t.newlines;r++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(t.whitespace_before),this.current_line.push(t.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},a.prototype.add_token=function(t){this.__add_space_before_token(),this.current_line.push(t),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},a.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(" "))},a.prototype.remove_indent=function(t){for(var r=this.__lines.length;t<r;)this.__lines[t]._remove_indent(),t++;this.current_line._remove_wrap_indent()},a.prototype.trim=function(t){for(t=t===void 0?!1:t,this.current_line.trim();t&&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},a.prototype.just_added_newline=function(){return this.current_line.is_empty()},a.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},a.prototype.ensure_empty_line_above=function(t,r){for(var s=this.__lines.length-2;s>=0;){var u=this.__lines[s];if(u.is_empty())break;if(u.item(0).indexOf(t)!==0&&u.item(-1)!==r){this.__lines.splice(s+1,0,new h(this)),this.previous_line=this.__lines[this.__lines.length-2];break}s--}},o.exports.Output=a},function(o){function h(n,a,t,r){this.type=n,this.text=a,this.comments_before=null,this.newlines=t||0,this.whitespace_before=r||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}o.exports.Token=h},,,function(o){function h(t,r){this.raw_options=n(t,r),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","django","erb","handlebars","php","smarty"],["auto"])}h.prototype._get_array=function(t,r){var s=this.raw_options[t],u=r||[];return typeof s=="object"?s!==null&&typeof s.concat=="function"&&(u=s.concat()):typeof s=="string"&&(u=s.split(/[^a-zA-Z0-9_\/\-]+/)),u},h.prototype._get_boolean=function(t,r){var s=this.raw_options[t],u=s===void 0?!!r:!!s;return u},h.prototype._get_characters=function(t,r){var s=this.raw_options[t],u=r||"";return typeof s=="string"&&(u=s.replace(/\\r/,"\r").replace(/\\n/,`
|
|
|
`).replace(/\\t/," ")),u},h.prototype._get_number=function(t,r){var s=this.raw_options[t];r=parseInt(r,10),isNaN(r)&&(r=0);var u=parseInt(s,10);return isNaN(u)&&(u=r),u},h.prototype._get_selection=function(t,r,s){var u=this._get_selection_list(t,r,s);if(u.length!==1)throw new Error("Invalid Option Value: The option '"+t+`' can only be one of the following values:
|
|
|
`+r+`
|
|
|
You passed in: '`+this.raw_options[t]+"'");return u[0]},h.prototype._get_selection_list=function(t,r,s){if(!r||r.length===0)throw new Error("Selection list cannot be empty.");if(s=s||[r[0]],!this._is_valid_selection(s,r))throw new Error("Invalid Default Value!");var u=this._get_array(t,s);if(!this._is_valid_selection(u,r))throw new Error("Invalid Option Value: The option '"+t+`' can contain only the following values:
|
|
|
`+r+`
|
|
|
You passed in: '`+this.raw_options[t]+"'");return u},h.prototype._is_valid_selection=function(t,r){return t.length&&r.length&&!t.some(function(s){return r.indexOf(s)===-1})};function n(t,r){var s={};t=a(t);var u;for(u in t)u!==r&&(s[u]=t[u]);if(r&&t[r])for(u in t[r])s[u]=t[r][u];return s}function a(t){var r={},s;for(s in t){var u=s.replace(/-/g,"_");r[u]=t[s]}return r}o.exports.Options=h,o.exports.normalizeOpts=a,o.exports.mergeOpts=n},,function(o){var h=RegExp.prototype.hasOwnProperty("sticky");function n(a){this.__input=a||"",this.__input_length=this.__input.length,this.__position=0}n.prototype.restart=function(){this.__position=0},n.prototype.back=function(){this.__position>0&&(this.__position-=1)},n.prototype.hasNext=function(){return this.__position<this.__input_length},n.prototype.next=function(){var a=null;return this.hasNext()&&(a=this.__input.charAt(this.__position),this.__position+=1),a},n.prototype.peek=function(a){var t=null;return a=a||0,a+=this.__position,a>=0&&a<this.__input_length&&(t=this.__input.charAt(a)),t},n.prototype.__match=function(a,t){a.lastIndex=t;var r=a.exec(this.__input);return r&&!(h&&a.sticky)&&(r.index!==t&&(r=null)),r},n.prototype.test=function(a,t){return t=t||0,t+=this.__position,t>=0&&t<this.__input_length?!!this.__match(a,t):!1},n.prototype.testChar=function(a,t){var r=this.peek(t);return a.lastIndex=0,r!==null&&a.test(r)},n.prototype.match=function(a){var t=this.__match(a,this.__position);return t?this.__position+=t[0].length:t=null,t},n.prototype.read=function(a,t,r){var s="",u;return a&&(u=this.match(a),u&&(s+=u[0])),t&&(u||!a)&&(s+=this.readUntil(t,r)),s},n.prototype.readUntil=function(a,t){var r="",s=this.__position;a.lastIndex=this.__position;var u=a.exec(this.__input);return u?(s=u.index,t&&(s+=u[0].length)):s=this.__input_length,r=this.__input.substring(this.__position,s),this.__position=s,r},n.prototype.readUntilAfter=function(a){return this.readUntil(a,!0)},n.prototype.get_regexp=function(a,t){var r=null,s="g";return t&&h&&(s="y"),typeof a=="string"&&a!==""?r=new RegExp(a,s):a&&(r=new RegExp(a.source,s)),r},n.prototype.get_literal_regexp=function(a){return RegExp(a.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},n.prototype.peekUntilAfter=function(a){var t=this.__position,r=this.readUntilAfter(a);return this.__position=t,r},n.prototype.lookBack=function(a){var t=this.__position-1;return t>=a.length&&this.__input.substring(t-a.length,t).toLowerCase()===a},o.exports.InputScanner=n},function(o,h,n){var a=n(8).InputScanner,t=n(3).Token,r=n(10).TokenStream,s=n(11).WhitespacePattern,u={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},d=function(f,v){this._input=new a(f),this._options=v||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new s(this._input)};d.prototype.tokenize=function(){this._input.restart(),this.__tokens=new r,this._reset();for(var f,v=new t(u.START,""),m=null,S=[],C=new r;v.type!==u.EOF;){for(f=this._get_next_token(v,m);this._is_comment(f);)C.add(f),f=this._get_next_token(v,m);C.isEmpty()||(f.comments_before=C,C=new r),f.parent=m,this._is_opening(f)?(S.push(m),m=f):m&&this._is_closing(f,m)&&(f.opened=m,m.closed=f,m=S.pop(),f.parent=m),f.previous=v,v.next=f,this.__tokens.add(f),v=f}return this.__tokens},d.prototype._is_first_token=function(){return this.__tokens.isEmpty()},d.prototype._reset=function(){},d.prototype._get_next_token=function(f,v){this._readWhitespace();var m=this._input.read(/.+/g);return m?this._create_token(u.RAW,m):this._create_token(u.EOF,"")},d.prototype._is_comment=function(f){return!1},d.prototype._is_opening=function(f){return!1},d.prototype._is_closing=function(f,v){return!1},d.prototype._create_token=function(f,v){var m=new t(f,v,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return m},d.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},o.exports.Tokenizer=d,o.exports.TOKEN=u},function(o){function h(n){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=n}h.prototype.restart=function(){this.__position=0},h.prototype.isEmpty=function(){return this.__tokens_length===0},h.prototype.hasNext=function(){return this.__position<this.__tokens_length},h.prototype.next=function(){var n=null;return this.hasNext()&&(n=this.__tokens[this.__position],this.__position+=1),n},h.prototype.peek=function(n){var a=null;return n=n||0,n+=this.__position,n>=0&&n<this.__tokens_length&&(a=this.__tokens[n]),a},h.prototype.add=function(n){this.__parent_token&&(n.parent=this.__parent_token),this.__tokens.push(n),this.__tokens_length+=1},o.exports.TokenStream=h},function(o,h,n){var a=n(12).Pattern;function t(r,s){a.call(this,r,s),s?this._line_regexp=this._input.get_regexp(s._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}t.prototype=new a,t.prototype.__set_whitespace_patterns=function(r,s){r+="\\t ",s+="\\n\\r",this._match_pattern=this._input.get_regexp("["+r+s+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+s+"]")},t.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var r=this._input.read(this._match_pattern);if(r===" ")this.whitespace_before_token=" ";else if(r){var s=this.__split(this._newline_regexp,r);this.newline_count=s.length-1,this.whitespace_before_token=s[this.newline_count]}return r},t.prototype.matching=function(r,s){var u=this._create();return u.__set_whitespace_patterns(r,s),u._update(),u},t.prototype._create=function(){return new t(this._input,this)},t.prototype.__split=function(r,s){r.lastIndex=0;for(var u=0,d=[],f=r.exec(s);f;)d.push(s.substring(u,f.index)),u=f.index+f[0].length,f=r.exec(s);return u<s.length?d.push(s.substring(u,s.length)):d.push(""),d},o.exports.WhitespacePattern=t},function(o){function h(n,a){this._input=n,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,a&&(this._starting_pattern=this._input.get_regexp(a._starting_pattern,!0),this._match_pattern=this._input.get_regexp(a._match_pattern,!0),this._until_pattern=this._input.get_regexp(a._until_pattern),this._until_after=a._until_after)}h.prototype.read=function(){var n=this._input.read(this._starting_pattern);return(!this._starting_pattern||n)&&(n+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),n},h.prototype.read_match=function(){return this._input.match(this._match_pattern)},h.prototype.until_after=function(n){var a=this._create();return a._until_after=!0,a._until_pattern=this._input.get_regexp(n),a._update(),a},h.prototype.until=function(n){var a=this._create();return a._until_after=!1,a._until_pattern=this._input.get_regexp(n),a._update(),a},h.prototype.starting_with=function(n){var a=this._create();return a._starting_pattern=this._input.get_regexp(n,!0),a._update(),a},h.prototype.matching=function(n){var a=this._create();return a._match_pattern=this._input.get_regexp(n,!0),a._update(),a},h.prototype._create=function(){return new h(this._input,this)},h.prototype._update=function(){},o.exports.Pattern=h},function(o){function h(n,a){n=typeof n=="string"?n:n.source,a=typeof a=="string"?a:a.source,this.__directives_block_pattern=new RegExp(n+/ beautify( \w+[:]\w+)+ /.source+a,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(n+/\sbeautify\signore:end\s/.source+a,"g")}h.prototype.get_directives=function(n){if(!n.match(this.__directives_block_pattern))return null;var a={};this.__directive_pattern.lastIndex=0;for(var t=this.__directive_pattern.exec(n);t;)a[t[1]]=t[2],t=this.__directive_pattern.exec(n);return a},h.prototype.readIgnored=function(n){return n.readUntilAfter(this.__directives_end_ignore_pattern)},o.exports.Directives=h},function(o,h,n){var a=n(12).Pattern,t={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1};function r(s,u){a.call(this,s,u),this.__template_pattern=null,this._disabled=Object.assign({},t),this._excluded=Object.assign({},t),u&&(this.__template_pattern=this._input.get_regexp(u.__template_pattern),this._excluded=Object.assign(this._excluded,u._excluded),this._disabled=Object.assign(this._disabled,u._disabled));var d=new a(s);this.__patterns={handlebars_comment:d.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:d.starting_with(/{{{/).until_after(/}}}/),handlebars:d.starting_with(/{{/).until_after(/}}/),php:d.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),erb:d.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:d.starting_with(/{%/).until_after(/%}/),django_value:d.starting_with(/{{/).until_after(/}}/),django_comment:d.starting_with(/{#/).until_after(/#}/),smarty:d.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:d.starting_with(/{\*/).until_after(/\*}/),smarty_literal:d.starting_with(/{literal}/).until_after(/{\/literal}/)}}r.prototype=new a,r.prototype._create=function(){return new r(this._input,this)},r.prototype._update=function(){this.__set_templated_pattern()},r.prototype.disable=function(s){var u=this._create();return u._disabled[s]=!0,u._update(),u},r.prototype.read_options=function(s){var u=this._create();for(var d in t)u._disabled[d]=s.templating.indexOf(d)===-1;return u._update(),u},r.prototype.exclude=function(s){var u=this._create();return u._excluded[s]=!0,u._update(),u},r.prototype.read=function(){var s="";this._match_pattern?s=this._input.read(this._starting_pattern):s=this._input.read(this._starting_pattern,this.__template_pattern);for(var u=this._read_template();u;)this._match_pattern?u+=this._input.read(this._match_pattern):u+=this._input.readUntil(this.__template_pattern),s+=u,u=this._read_template();return this._until_after&&(s+=this._input.readUntilAfter(this._until_pattern)),s},r.prototype.__set_templated_pattern=function(){var s=[];this._disabled.php||s.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||s.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||s.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(s.push(this.__patterns.django._starting_pattern.source),s.push(this.__patterns.django_value._starting_pattern.source),s.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||s.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&s.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+s.join("|")+")")},r.prototype._read_template=function(){var s="",u=this._input.peek();if(u==="<"){var d=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&d==="?"&&(s=s||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&d==="%"&&(s=s||this.__patterns.erb.read())}else u==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(s=s||this.__patterns.handlebars_comment.read(),s=s||this.__patterns.handlebars_unescaped.read(),s=s||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(s=s||this.__patterns.django_value.read()),this._excluded.django||(s=s||this.__patterns.django_comment.read(),s=s||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(s=s||this.__patterns.smarty_comment.read(),s=s||this.__patterns.smarty_literal.read(),s=s||this.__patterns.smarty.read()));return s},o.exports.TemplatablePattern=r},,,,function(o,h,n){var a=n(19).Beautifier,t=n(20).Options;function r(s,u,d,f){var v=new a(s,u,d,f);return v.beautify()}o.exports=r,o.exports.defaultOptions=function(){return new t}},function(o,h,n){var a=n(20).Options,t=n(2).Output,r=n(21).Tokenizer,s=n(21).TOKEN,u=/\r\n|[\r\n]/,d=/\r\n|[\r\n]/g,f=function(F,P){this.indent_level=0,this.alignment_size=0,this.max_preserve_newlines=F.max_preserve_newlines,this.preserve_newlines=F.preserve_newlines,this._output=new t(F,P)};f.prototype.current_line_has_match=function(F){return this._output.current_line.has_match(F)},f.prototype.set_space_before_token=function(F,P){this._output.space_before_token=F,this._output.non_breaking_space=P},f.prototype.set_wrap_point=function(){this._output.set_indent(this.indent_level,this.alignment_size),this._output.set_wrap_point()},f.prototype.add_raw_token=function(F){this._output.add_raw_token(F)},f.prototype.print_preserved_newlines=function(F){var P=0;F.type!==s.TEXT&&F.previous.type!==s.TEXT&&(P=F.newlines?1:0),this.preserve_newlines&&(P=F.newlines<this.max_preserve_newlines+1?F.newlines:this.max_preserve_newlines+1);for(var N=0;N<P;N++)this.print_newline(N>0);return P!==0},f.prototype.traverse_whitespace=function(F){return F.whitespace_before||F.newlines?(this.print_preserved_newlines(F)||(this._output.space_before_token=!0),!0):!1},f.prototype.previous_token_wrapped=function(){return this._output.previous_token_wrapped},f.prototype.print_newline=function(F){this._output.add_new_line(F)},f.prototype.print_token=function(F){F.text&&(this._output.set_indent(this.indent_level,this.alignment_size),this._output.add_token(F.text))},f.prototype.indent=function(){this.indent_level++},f.prototype.get_full_indent=function(F){return F=this.indent_level+(F||0),F<1?"":this._output.get_indent_string(F)};var v=function(F){for(var P=null,N=F.next;N.type!==s.EOF&&F.closed!==N;){if(N.type===s.ATTRIBUTE&&N.text==="type"){N.next&&N.next.type===s.EQUALS&&N.next.next&&N.next.next.type===s.VALUE&&(P=N.next.next.text);break}N=N.next}return P},m=function(F,P){var N=null,X=null;return P.closed?(F==="script"?N="text/javascript":F==="style"&&(N="text/css"),N=v(P)||N,N.search("text/css")>-1?X="css":N.search(/module|((text|application|dojo)\/(x-)?(javascript|ecmascript|jscript|livescript|(ld\+)?json|method|aspect))/)>-1?X="javascript":N.search(/(text|application|dojo)\/(x-)?(html)/)>-1?X="html":N.search(/test\/null/)>-1&&(X="null"),X):null};function S(F,P){return P.indexOf(F)!==-1}function C(F,P,N){this.parent=F||null,this.tag=P?P.tag_name:"",this.indent_level=N||0,this.parser_token=P||null}function _(F){this._printer=F,this._current_frame=null}_.prototype.get_parser_token=function(){return this._current_frame?this._current_frame.parser_token:null},_.prototype.record_tag=function(F){var P=new C(this._current_frame,F,this._printer.indent_level);this._current_frame=P},_.prototype._try_pop_frame=function(F){var P=null;return F&&(P=F.parser_token,this._printer.indent_level=F.indent_level,this._current_frame=F.parent),P},_.prototype._get_frame=function(F,P){for(var N=this._current_frame;N&&!(F.indexOf(N.tag)!==-1);){if(P&&P.indexOf(N.tag)!==-1){N=null;break}N=N.parent}return N},_.prototype.try_pop=function(F,P){var N=this._get_frame([F],P);return this._try_pop_frame(N)},_.prototype.indent_to_tag=function(F){var P=this._get_frame(F);P&&(this._printer.indent_level=P.indent_level)};function y(F,P,N,X){this._source_text=F||"",P=P||{},this._js_beautify=N,this._css_beautify=X,this._tag_stack=null;var j=new a(P,"html");this._options=j,this._is_wrap_attributes_force=this._options.wrap_attributes.substr(0,"force".length)==="force",this._is_wrap_attributes_force_expand_multiline=this._options.wrap_attributes==="force-expand-multiline",this._is_wrap_attributes_force_aligned=this._options.wrap_attributes==="force-aligned",this._is_wrap_attributes_aligned_multiple=this._options.wrap_attributes==="aligned-multiple",this._is_wrap_attributes_preserve=this._options.wrap_attributes.substr(0,"preserve".length)==="preserve",this._is_wrap_attributes_preserve_aligned=this._options.wrap_attributes==="preserve-aligned"}y.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var F=this._source_text,P=this._options.eol;this._options.eol==="auto"&&(P=`
|
|
|
`,F&&u.test(F)&&(P=F.match(u)[0])),F=F.replace(d,`
|
|
|
`);var N=F.match(/^[\t ]*/)[0],X={text:"",type:""},j=new T,A=new f(this._options,N),K=new r(F,this._options).tokenize();this._tag_stack=new _(A);for(var U=null,k=K.next();k.type!==s.EOF;)k.type===s.TAG_OPEN||k.type===s.COMMENT?(U=this._handle_tag_open(A,k,j,X),j=U):k.type===s.ATTRIBUTE||k.type===s.EQUALS||k.type===s.VALUE||k.type===s.TEXT&&!j.tag_complete?U=this._handle_inside_tag(A,k,j,K):k.type===s.TAG_CLOSE?U=this._handle_tag_close(A,k,j):k.type===s.TEXT?U=this._handle_text(A,k,j):A.add_raw_token(k),X=U,k=K.next();var z=A._output.get_code(P);return z},y.prototype._handle_tag_close=function(F,P,N){var X={text:P.text,type:P.type};return F.alignment_size=0,N.tag_complete=!0,F.set_space_before_token(P.newlines||P.whitespace_before!=="",!0),N.is_unformatted?F.add_raw_token(P):(N.tag_start_char==="<"&&(F.set_space_before_token(P.text[0]==="/",!0),this._is_wrap_attributes_force_expand_multiline&&N.has_wrapped_attrs&&F.print_newline(!1)),F.print_token(P)),N.indent_content&&!(N.is_unformatted||N.is_content_unformatted)&&(F.indent(),N.indent_content=!1),!N.is_inline_element&&!(N.is_unformatted||N.is_content_unformatted)&&F.set_wrap_point(),X},y.prototype._handle_inside_tag=function(F,P,N,X){var j=N.has_wrapped_attrs,A={text:P.text,type:P.type};if(F.set_space_before_token(P.newlines||P.whitespace_before!=="",!0),N.is_unformatted)F.add_raw_token(P);else if(N.tag_start_char==="{"&&P.type===s.TEXT)F.print_preserved_newlines(P)?(P.newlines=0,F.add_raw_token(P)):F.print_token(P);else{if(P.type===s.ATTRIBUTE?(F.set_space_before_token(!0),N.attr_count+=1):(P.type===s.EQUALS||P.type===s.VALUE&&P.previous.type===s.EQUALS)&&F.set_space_before_token(!1),P.type===s.ATTRIBUTE&&N.tag_start_char==="<"&&((this._is_wrap_attributes_preserve||this._is_wrap_attributes_preserve_aligned)&&(F.traverse_whitespace(P),j=j||P.newlines!==0),this._is_wrap_attributes_force)){var K=N.attr_count>1;if(this._is_wrap_attributes_force_expand_multiline&&N.attr_count===1){var U=!0,k=0,z;do{if(z=X.peek(k),z.type===s.ATTRIBUTE){U=!1;break}k+=1}while(k<4&&z.type!==s.EOF&&z.type!==s.TAG_CLOSE);K=!U}K&&(F.print_newline(!1),j=!0)}F.print_token(P),j=j||F.previous_token_wrapped(),N.has_wrapped_attrs=j}return A},y.prototype._handle_text=function(F,P,N){var X={text:P.text,type:"TK_CONTENT"};return N.custom_beautifier_name?this._print_custom_beatifier_text(F,P,N):N.is_unformatted||N.is_content_unformatted?F.add_raw_token(P):(F.traverse_whitespace(P),F.print_token(P)),X},y.prototype._print_custom_beatifier_text=function(F,P,N){var X=this;if(P.text!==""){var j=P.text,A,K=1,U="",k="";N.custom_beautifier_name==="javascript"&&typeof this._js_beautify=="function"?A=this._js_beautify:N.custom_beautifier_name==="css"&&typeof this._css_beautify=="function"?A=this._css_beautify:N.custom_beautifier_name==="html"&&(A=function(Ne,Le){var Ke=new y(Ne,Le,X._js_beautify,X._css_beautify);return Ke.beautify()}),this._options.indent_scripts==="keep"?K=0:this._options.indent_scripts==="separate"&&(K=-F.indent_level);var z=F.get_full_indent(K);if(j=j.replace(/\n[ \t]*$/,""),N.custom_beautifier_name!=="html"&&j[0]==="<"&&j.match(/^(<!--|<!\[CDATA\[)/)){var te=/^(<!--[^\n]*|<!\[CDATA\[)(\n?)([ \t\n]*)([\s\S]*)(-->|]]>)$/.exec(j);if(!te){F.add_raw_token(P);return}U=z+te[1]+`
|
|
|
`,j=te[4],te[5]&&(k=z+te[5]),j=j.replace(/\n[ \t]*$/,""),(te[2]||te[3].indexOf(`
|
|
|
`)!==-1)&&(te=te[3].match(/[ \t]+$/),te&&(P.whitespace_before=te[0]))}if(j)if(A){var de=function(){this.eol=`
|
|
|
`};de.prototype=this._options.raw_options;var be=new de;j=A(z+j,be)}else{var We=P.whitespace_before;We&&(j=j.replace(new RegExp(`
|
|
|
(`+We+")?","g"),`
|
|
|
`)),j=z+j.replace(/\n/g,`
|
|
|
`+z)}U&&(j?j=U+j+`
|
|
|
`+k:j=U+k),F.print_newline(!1),j&&(P.text=j,P.whitespace_before="",P.newlines=0,F.add_raw_token(P),F.print_newline(!0))}},y.prototype._handle_tag_open=function(F,P,N,X){var j=this._get_tag_open_token(P);return(N.is_unformatted||N.is_content_unformatted)&&!N.is_empty_element&&P.type===s.TAG_OPEN&&P.text.indexOf("</")===0?(F.add_raw_token(P),j.start_tag_token=this._tag_stack.try_pop(j.tag_name)):(F.traverse_whitespace(P),this._set_tag_position(F,P,j,N,X),j.is_inline_element||F.set_wrap_point(),F.print_token(P)),(this._is_wrap_attributes_force_aligned||this._is_wrap_attributes_aligned_multiple||this._is_wrap_attributes_preserve_aligned)&&(j.alignment_size=P.text.length+1),!j.tag_complete&&!j.is_unformatted&&(F.alignment_size=j.alignment_size),j};var T=function(F,P){if(this.parent=F||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="",!P)this.tag_complete=!0;else{var N;this.tag_start_char=P.text[0],this.text=P.text,this.tag_start_char==="<"?(N=P.text.match(/^<([^\s>]*)/),this.tag_check=N?N[1]:""):(N=P.text.match(/^{{~?(?:[\^]|#\*?)?([^\s}]+)/),this.tag_check=N?N[1]:"",(P.text.startsWith("{{#>")||P.text.startsWith("{{~#>"))&&this.tag_check[0]===">"&&(this.tag_check===">"&&P.next!==null?this.tag_check=P.next.text.split(" ")[0]:this.tag_check=P.text.split(">")[1])),this.tag_check=this.tag_check.toLowerCase(),P.type===s.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||P.closed&&P.closed.text==="/>";var X=2;this.tag_start_char==="{"&&this.text.length>=3&&(this.text.charAt(2)==="~"&&(X=3)),this.is_end_tag=this.is_end_tag||this.tag_start_char==="{"&&(this.text.length<3||/[^#\^]/.test(this.text.charAt(X)))}};y.prototype._get_tag_open_token=function(F){var P=new T(this._tag_stack.get_parser_token(),F);return P.alignment_size=this._options.wrap_attributes_indent_size,P.is_end_tag=P.is_end_tag||S(P.tag_check,this._options.void_elements),P.is_empty_element=P.tag_complete||P.is_start_tag&&P.is_end_tag,P.is_unformatted=!P.tag_complete&&S(P.tag_check,this._options.unformatted),P.is_content_unformatted=!P.is_empty_element&&S(P.tag_check,this._options.content_unformatted),P.is_inline_element=S(P.tag_name,this._options.inline)||P.tag_name.includes("-")||P.tag_start_char==="{",P},y.prototype._set_tag_position=function(F,P,N,X,j){if(N.is_empty_element||(N.is_end_tag?N.start_tag_token=this._tag_stack.try_pop(N.tag_name):(this._do_optional_end_element(N)&&(N.is_inline_element||F.print_newline(!1)),this._tag_stack.record_tag(N),(N.tag_name==="script"||N.tag_name==="style")&&!(N.is_unformatted||N.is_content_unformatted)&&(N.custom_beautifier_name=m(N.tag_check,P)))),S(N.tag_check,this._options.extra_liners)&&(F.print_newline(!1),F._output.just_added_blankline()||F.print_newline(!0)),N.is_empty_element){if(N.tag_start_char==="{"&&N.tag_check==="else"){this._tag_stack.indent_to_tag(["if","unless","each"]),N.indent_content=!0;var A=F.current_line_has_match(/{{#if/);A||F.print_newline(!1)}N.tag_name==="!--"&&j.type===s.TAG_CLOSE&&X.is_end_tag&&N.text.indexOf(`
|
|
|
`)===-1||(N.is_inline_element||N.is_unformatted||F.print_newline(!1),this._calcluate_parent_multiline(F,N))}else if(N.is_end_tag){var K=!1;K=N.start_tag_token&&N.start_tag_token.multiline_content,K=K||!N.is_inline_element&&!(X.is_inline_element||X.is_unformatted)&&!(j.type===s.TAG_CLOSE&&N.start_tag_token===X)&&j.type!=="TK_CONTENT",(N.is_content_unformatted||N.is_unformatted)&&(K=!1),K&&F.print_newline(!1)}else N.indent_content=!N.custom_beautifier_name,N.tag_start_char==="<"&&(N.tag_name==="html"?N.indent_content=this._options.indent_inner_html:N.tag_name==="head"?N.indent_content=this._options.indent_head_inner_html:N.tag_name==="body"&&(N.indent_content=this._options.indent_body_inner_html)),!(N.is_inline_element||N.is_unformatted)&&(j.type!=="TK_CONTENT"||N.is_content_unformatted)&&F.print_newline(!1),this._calcluate_parent_multiline(F,N)},y.prototype._calcluate_parent_multiline=function(F,P){P.parent&&F._output.just_added_newline()&&!((P.is_inline_element||P.is_unformatted)&&P.parent.is_inline_element)&&(P.parent.multiline_content=!0)};var O=["address","article","aside","blockquote","details","div","dl","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hr","main","nav","ol","p","pre","section","table","ul"],g=["a","audio","del","ins","map","noscript","video"];y.prototype._do_optional_end_element=function(F){var P=null;if(F.is_empty_element||!F.is_start_tag||!F.parent)return;if(F.tag_name==="body")P=P||this._tag_stack.try_pop("head");else if(F.tag_name==="li")P=P||this._tag_stack.try_pop("li",["ol","ul"]);else if(F.tag_name==="dd"||F.tag_name==="dt")P=P||this._tag_stack.try_pop("dt",["dl"]),P=P||this._tag_stack.try_pop("dd",["dl"]);else if(F.parent.tag_name==="p"&&O.indexOf(F.tag_name)!==-1){var N=F.parent.parent;(!N||g.indexOf(N.tag_name)===-1)&&(P=P||this._tag_stack.try_pop("p"))}else F.tag_name==="rp"||F.tag_name==="rt"?(P=P||this._tag_stack.try_pop("rt",["ruby","rtc"]),P=P||this._tag_stack.try_pop("rp",["ruby","rtc"])):F.tag_name==="optgroup"?P=P||this._tag_stack.try_pop("optgroup",["select"]):F.tag_name==="option"?P=P||this._tag_stack.try_pop("option",["select","datalist","optgroup"]):F.tag_name==="colgroup"?P=P||this._tag_stack.try_pop("caption",["table"]):F.tag_name==="thead"?(P=P||this._tag_stack.try_pop("caption",["table"]),P=P||this._tag_stack.try_pop("colgroup",["table"])):F.tag_name==="tbody"||F.tag_name==="tfoot"?(P=P||this._tag_stack.try_pop("caption",["table"]),P=P||this._tag_stack.try_pop("colgroup",["table"]),P=P||this._tag_stack.try_pop("thead",["table"]),P=P||this._tag_stack.try_pop("tbody",["table"])):F.tag_name==="tr"?(P=P||this._tag_stack.try_pop("caption",["table"]),P=P||this._tag_stack.try_pop("colgroup",["table"]),P=P||this._tag_stack.try_pop("tr",["table","thead","tbody","tfoot"])):(F.tag_name==="th"||F.tag_name==="td")&&(P=P||this._tag_stack.try_pop("td",["table","thead","tbody","tfoot","tr"]),P=P||this._tag_stack.try_pop("th",["table","thead","tbody","tfoot","tr"]));return F.parent=this._tag_stack.get_parser_token(),P},o.exports.Beautifier=y},function(o,h,n){var a=n(6).Options;function t(r){a.call(this,r,"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_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.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","separate"])}t.prototype=new a,o.exports.Options=t},function(o,h,n){var a=n(9).Tokenizer,t=n(9).TOKEN,r=n(13).Directives,s=n(14).TemplatablePattern,u=n(12).Pattern,d={TAG_OPEN:"TK_TAG_OPEN",TAG_CLOSE:"TK_TAG_CLOSE",ATTRIBUTE:"TK_ATTRIBUTE",EQUALS:"TK_EQUALS",VALUE:"TK_VALUE",COMMENT:"TK_COMMENT",TEXT:"TK_TEXT",UNKNOWN:"TK_UNKNOWN",START:t.START,RAW:t.RAW,EOF:t.EOF},f=new r(/<\!--/,/-->/),v=function(m,S){a.call(this,m,S),this._current_tag_name="";var C=new s(this._input).read_options(this._options),_=new u(this._input);if(this.__patterns={word:C.until(/[\n\r\t <]/),single_quote:C.until_after(/'/),double_quote:C.until_after(/"/),attribute:C.until(/[\n\r\t =>]|\/>/),element_name:C.until(/[\n\r\t >\/]/),handlebars_comment:_.starting_with(/{{!--/).until_after(/--}}/),handlebars:_.starting_with(/{{/).until_after(/}}/),handlebars_open:_.until(/[\n\r\t }]/),handlebars_raw_close:_.until(/}}/),comment:_.starting_with(/<!--/).until_after(/-->/),cdata:_.starting_with(/<!\[CDATA\[/).until_after(/]]>/),conditional_comment:_.starting_with(/<!\[/).until_after(/]>/),processing:_.starting_with(/<\?/).until_after(/\?>/)},this._options.indent_handlebars&&(this.__patterns.word=this.__patterns.word.exclude("handlebars")),this._unformatted_content_delimiter=null,this._options.unformatted_content_delimiter){var y=this._input.get_literal_regexp(this._options.unformatted_content_delimiter);this.__patterns.unformatted_content_delimiter=_.matching(y).until_after(y)}};v.prototype=new a,v.prototype._is_comment=function(m){return!1},v.prototype._is_opening=function(m){return m.type===d.TAG_OPEN},v.prototype._is_closing=function(m,S){return m.type===d.TAG_CLOSE&&S&&((m.text===">"||m.text==="/>")&&S.text[0]==="<"||m.text==="}}"&&S.text[0]==="{"&&S.text[1]==="{")},v.prototype._reset=function(){this._current_tag_name=""},v.prototype._get_next_token=function(m,S){var C=null;this._readWhitespace();var _=this._input.peek();return _===null?this._create_token(d.EOF,""):(C=C||this._read_open_handlebars(_,S),C=C||this._read_attribute(_,m,S),C=C||this._read_close(_,S),C=C||this._read_raw_content(_,m,S),C=C||this._read_content_word(_),C=C||this._read_comment_or_cdata(_),C=C||this._read_processing(_),C=C||this._read_open(_,S),C=C||this._create_token(d.UNKNOWN,this._input.next()),C)},v.prototype._read_comment_or_cdata=function(m){var S=null,C=null,_=null;if(m==="<"){var y=this._input.peek(1);y==="!"&&(C=this.__patterns.comment.read(),C?(_=f.get_directives(C),_&&_.ignore==="start"&&(C+=f.readIgnored(this._input))):C=this.__patterns.cdata.read()),C&&(S=this._create_token(d.COMMENT,C),S.directives=_)}return S},v.prototype._read_processing=function(m){var S=null,C=null,_=null;if(m==="<"){var y=this._input.peek(1);(y==="!"||y==="?")&&(C=this.__patterns.conditional_comment.read(),C=C||this.__patterns.processing.read()),C&&(S=this._create_token(d.COMMENT,C),S.directives=_)}return S},v.prototype._read_open=function(m,S){var C=null,_=null;return S||m==="<"&&(C=this._input.next(),this._input.peek()==="/"&&(C+=this._input.next()),C+=this.__patterns.element_name.read(),_=this._create_token(d.TAG_OPEN,C)),_},v.prototype._read_open_handlebars=function(m,S){var C=null,_=null;return S||this._options.indent_handlebars&&m==="{"&&this._input.peek(1)==="{"&&(this._input.peek(2)==="!"?(C=this.__patterns.handlebars_comment.read(),C=C||this.__patterns.handlebars.read(),_=this._create_token(d.COMMENT,C)):(C=this.__patterns.handlebars_open.read(),_=this._create_token(d.TAG_OPEN,C))),_},v.prototype._read_close=function(m,S){var C=null,_=null;return S&&(S.text[0]==="<"&&(m===">"||m==="/"&&this._input.peek(1)===">")?(C=this._input.next(),m==="/"&&(C+=this._input.next()),_=this._create_token(d.TAG_CLOSE,C)):S.text[0]==="{"&&m==="}"&&this._input.peek(1)==="}"&&(this._input.next(),this._input.next(),_=this._create_token(d.TAG_CLOSE,"}}"))),_},v.prototype._read_attribute=function(m,S,C){var _=null,y="";if(C&&C.text[0]==="<")if(m==="=")_=this._create_token(d.EQUALS,this._input.next());else if(m==='"'||m==="'"){var T=this._input.next();m==='"'?T+=this.__patterns.double_quote.read():T+=this.__patterns.single_quote.read(),_=this._create_token(d.VALUE,T)}else y=this.__patterns.attribute.read(),y&&(S.type===d.EQUALS?_=this._create_token(d.VALUE,y):_=this._create_token(d.ATTRIBUTE,y));return _},v.prototype._is_content_unformatted=function(m){return this._options.void_elements.indexOf(m)===-1&&(this._options.content_unformatted.indexOf(m)!==-1||this._options.unformatted.indexOf(m)!==-1)},v.prototype._read_raw_content=function(m,S,C){var _="";if(C&&C.text[0]==="{")_=this.__patterns.handlebars_raw_close.read();else if(S.type===d.TAG_CLOSE&&S.opened.text[0]==="<"&&S.text[0]!=="/"){var y=S.opened.text.substr(1).toLowerCase();if(y==="script"||y==="style"){var T=this._read_comment_or_cdata(m);if(T)return T.type=d.TEXT,T;_=this._input.readUntil(new RegExp("</"+y+"[\\n\\r\\t ]*?>","ig"))}else this._is_content_unformatted(y)&&(_=this._input.readUntil(new RegExp("</"+y+"[\\n\\r\\t ]*?>","ig")))}return _?this._create_token(d.TEXT,_):null},v.prototype._read_content_word=function(m){var S="";if(this._options.unformatted_content_delimiter&&(m===this._options.unformatted_content_delimiter[0]&&(S=this.__patterns.unformatted_content_delimiter.read())),S||(S=this.__patterns.word.read()),S)return this._create_token(d.TEXT,S)},o.exports.Tokenizer=v,o.exports.TOKEN=d}],b={};function i(o){var h=b[o];if(h!==void 0)return h.exports;var n=b[o]={exports:{}};return E[o](n,n.exports,i),n.exports}var c=i(18);I=c})();var R=I;if(!0)!(G=[q,q("6UM0"),q("TXwP")],L=function(E){var b=q("6UM0"),i=q("TXwP");return{html_beautify:function(c,o){return R(c,o,b.js_beautify,i.css_beautify)}}}.apply(ne,G),L!==void 0&&(it.exports=L));else var M,p})()},q7KB:function(it,ne,q){},"rAM+":function(it,ne,q){"use strict";q.d(ne,"a",function(){return L});var G=q("Qw5x");function L(I,R){var M;if(typeof Symbol=="undefined"||I[Symbol.iterator]==null){if(Array.isArray(I)||(M=Object(G.a)(I))||R&&I&&typeof I.length=="number"){M&&(I=M);var p=0,E=function(){};return{s:E,n:function(){return p>=I.length?{done:!0}:{done:!1,value:I[p++]}},e:function(h){throw h},f:E}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var b=!0,i=!1,c;return{s:function(){M=I[Symbol.iterator]()},n:function(){var h=M.next();return b=h.done,h},e:function(h){i=!0,c=h},f:function(){try{!b&&M.return!=null&&M.return()}finally{if(i)throw c}}}}},rUJ1:function(it,ne){const q=/[&<>"']/,G=/[&<>"']/g,L=/[<>"']|&(?!#?\w+;)/,I=/[<>"']|&(?!#?\w+;)/g,R={"&":"&","<":"<",">":">",'"':""","'":"'"},M=_=>R[_];function p(_,y){if(y){if(q.test(_))return _.replace(G,M)}else if(L.test(_))return _.replace(I,M);return _}const E=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function b(_){return _.replace(E,(y,T)=>(T=T.toLowerCase(),T==="colon"?":":T.charAt(0)==="#"?T.charAt(1)==="x"?String.fromCharCode(parseInt(T.substring(2),16)):String.fromCharCode(+T.substring(1)):""))}const i=/(^|[^\[])\^/g;function c(_,y){_=_.source||_,y=y||"";const T={replace:(O,g)=>(g=g.source||g,g=g.replace(i,"$1"),_=_.replace(O,g),T),getRegex:()=>new RegExp(_,y)};return T}const o=/[^\w:]/g,h=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function n(_,y,T){if(_){let O;try{O=decodeURIComponent(b(T)).replace(o,"").toLowerCase()}catch(g){return null}if(O.indexOf("javascript:")===0||O.indexOf("vbscript:")===0||O.indexOf("data:")===0)return null}y&&!h.test(T)&&(T=u(y,T));try{T=encodeURI(T).replace(/%25/g,"%")}catch(O){return null}return T}const a={},t=/^[^:]+:\/*[^/]*$/,r=/^([^:]+:)[\s\S]*$/,s=/^([^:]+:\/*[^/]*)[\s\S]*$/;function u(_,y){a[" "+_]||(t.test(_)?a[" "+_]=_+"/":a[" "+_]=m(_,"/",!0)),_=a[" "+_];const T=_.indexOf(":")===-1;return y.substring(0,2)==="//"?T?y:_.replace(r,"$1")+y:y.charAt(0)==="/"?T?y:_.replace(s,"$1")+y:_+y}const d={exec:function(){}};function f(_){let y=1,T,O;for(;y<arguments.length;y++){T=arguments[y];for(O in T)Object.prototype.hasOwnProperty.call(T,O)&&(_[O]=T[O])}return _}function v(_,y){const T=_.replace(/\|/g,(F,P,N)=>{let X=!1,j=P;for(;--j>=0&&N[j]==="\\";)X=!X;return X?"|":" |"}),O=T.split(/ \|/);let g=0;if(O.length>y)O.splice(y);else for(;O.length<y;)O.push("");for(;g<O.length;g++)O[g]=O[g].trim().replace(/\\\|/g,"|");return O}function m(_,y,T){const O=_.length;if(O===0)return"";let g=0;for(;g<O;){const F=_.charAt(O-g-1);if(F===y&&!T)g++;else if(F!==y&&T)g++;else break}return _.substr(0,O-g)}function S(_,y){if(_.indexOf(y[1])===-1)return-1;const T=_.length;let O=0,g=0;for(;g<T;g++)if(_[g]==="\\")g++;else if(_[g]===y[0])O++;else if(_[g]===y[1]&&(O--,O<0))return g;return-1}function C(_){_&&_.sanitize&&!_.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}it.exports={escape:p,unescape:b,edit:c,cleanUrl:n,resolveUrl:u,noopTest:d,merge:f,splitCells:v,rtrim:m,findClosingBracket:S,checkSanitizeDeprecation:C}},rwxt:function(it,ne,q){"use strict";Object.defineProperty(ne,"__esModule",{value:!0}),ne.default=void 0;var G=q("GdRQ");function L(E,b){if(!(E instanceof b))throw new TypeError("Cannot call a class as a function")}function I(E,b){for(var i=0;i<b.length;i++){var c=b[i];c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(E,c.key,c)}}function R(E,b,i){return b&&I(E.prototype,b),i&&I(E,i),E}var M=!G.supportsCursorURIs||G.isTouchDevice,p=function(){function E(){L(this,E),this._target=null,this._canvas=document.createElement("canvas"),M&&(this._canvas.style.position="fixed",this._canvas.style.zIndex="65535",this._canvas.style.pointerEvents="none",this._canvas.style.visibility="hidden"),this._position={x:0,y:0},this._hotSpot={x:0,y:0},this._eventHandlers={mouseover:this._handleMouseOver.bind(this),mouseleave:this._handleMouseLeave.bind(this),mousemove:this._handleMouseMove.bind(this),mouseup:this._handleMouseUp.bind(this)}}return R(E,[{key:"attach",value:function(i){if(this._target&&this.detach(),this._target=i,M){document.body.appendChild(this._canvas);var c={capture:!0,passive:!0};this._target.addEventListener("mouseover",this._eventHandlers.mouseover,c),this._target.addEventListener("mouseleave",this._eventHandlers.mouseleave,c),this._target.addEventListener("mousemove",this._eventHandlers.mousemove,c),this._target.addEventListener("mouseup",this._eventHandlers.mouseup,c)}this.clear()}},{key:"detach",value:function(){if(!this._target)return;if(M){var i={capture:!0,passive:!0};this._target.removeEventListener("mouseover",this._eventHandlers.mouseover,i),this._target.removeEventListener("mouseleave",this._eventHandlers.mouseleave,i),this._target.removeEventListener("mousemove",this._eventHandlers.mousemove,i),this._target.removeEventListener("mouseup",this._eventHandlers.mouseup,i),document.body.removeChild(this._canvas)}this._target=null}},{key:"change",value:function(i,c,o,h,n){if(h===0||n===0){this.clear();return}this._position.x=this._position.x+this._hotSpot.x-c,this._position.y=this._position.y+this._hotSpot.y-o,this._hotSpot.x=c,this._hotSpot.y=o;var a=this._canvas.getContext("2d");this._canvas.width=h,this._canvas.height=n;var t;try{t=new ImageData(new Uint8ClampedArray(i),h,n)}catch(s){t=a.createImageData(h,n),t.data.set(new Uint8ClampedArray(i))}if(a.clearRect(0,0,h,n),a.putImageData(t,0,0),M)this._updatePosition();else{var r=this._canvas.toDataURL();this._target.style.cursor="url("+r+")"+c+" "+o+", default"}}},{key:"clear",value:function(){this._target.style.cursor="none",this._canvas.width=0,this._canvas.height=0,this._position.x=this._position.x+this._hotSpot.x,this._position.y=this._position.y+this._hotSpot.y,this._hotSpot.x=0,this._hotSpot.y=0}},{key:"move",value:function(i,c){if(!M)return;window.visualViewport?(this._position.x=i+window.visualViewport.offsetLeft,this._position.y=c+window.visualViewport.offsetTop):(this._position.x=i,this._position.y=c),this._updatePosition();var o=document.elementFromPoint(i,c);this._updateVisibility(o)}},{key:"_handleMouseOver",value:function(i){this._handleMouseMove(i)}},{key:"_handleMouseLeave",value:function(i){this._updateVisibility(i.relatedTarget)}},{key:"_handleMouseMove",value:function(i){this._updateVisibility(i.target),this._position.x=i.clientX-this._hotSpot.x,this._position.y=i.clientY-this._hotSpot.y,this._updatePosition()}},{key:"_handleMouseUp",value:function(i){var c=this,o=document.elementFromPoint(i.clientX,i.clientY);this._updateVisibility(o),this._captureIsActive()&&window.setTimeout(function(){if(!c._target)return;o=document.elementFromPoint(i.clientX,i.clientY),c._updateVisibility(o)},0)}},{key:"_showCursor",value:function(){this._canvas.style.visibility==="hidden"&&(this._canvas.style.visibility="")}},{key:"_hideCursor",value:function(){this._canvas.style.visibility!=="hidden"&&(this._canvas.style.visibility="hidden")}},{key:"_shouldShowCursor",value:function(i){return i?i===this._target?!0:this._target.contains(i)?!(window.getComputedStyle(i).cursor!=="none"):!1:!1}},{key:"_updateVisibility",value:function(i){this._captureIsActive()&&(i=document.captureElement),this._shouldShowCursor(i)?this._showCursor():this._hideCursor()}},{key:"_updatePosition",value:function(){this._canvas.style.left=this._position.x+"px",this._canvas.style.top=this._position.y+"px"}},{key:"_captureIsActive",value:function(){return document.captureElement&&document.documentElement.contains(document.captureElement)}}]),E}();ne.default=p},sjKO:function(it,ne,q){"use strict";Object.defineProperty(ne,"__esModule",{value:!0}),ne.default=I;var G=30,L=12;function I(R,M){var p,E,b,i,c,o,h,n,a,t,r,s,u,d,f,v,m,S,C,_,y,T,O,g,F;p=R.state,E=R.next_in,g=R.input,b=E+(R.avail_in-5),i=R.next_out,F=R.output,c=i-(M-R.avail_out),o=i+(R.avail_out-257),h=p.dmax,n=p.wsize,a=p.whave,t=p.wnext,r=p.window,s=p.hold,u=p.bits,d=p.lencode,f=p.distcode,v=(1<<p.lenbits)-1,m=(1<<p.distbits)-1;e:do{u<15&&(s+=g[E++]<<u,u+=8,s+=g[E++]<<u,u+=8),S=d[s&v];t:for(;;){if(C=S>>>24,s>>>=C,u-=C,C=S>>>16&255,C===0)F[i++]=S&65535;else if(C&16){_=S&65535,C&=15,C&&(u<C&&(s+=g[E++]<<u,u+=8),_+=s&(1<<C)-1,s>>>=C,u-=C),u<15&&(s+=g[E++]<<u,u+=8,s+=g[E++]<<u,u+=8),S=f[s&m];i:for(;;){if(C=S>>>24,s>>>=C,u-=C,C=S>>>16&255,C&16){if(y=S&65535,C&=15,u<C&&(s+=g[E++]<<u,u+=8,u<C&&(s+=g[E++]<<u,u+=8)),y+=s&(1<<C)-1,y>h){R.msg="invalid distance too far back",p.mode=G;break e}if(s>>>=C,u-=C,C=i-c,y>C){if(C=y-C,C>a&&p.sane){R.msg="invalid distance too far back",p.mode=G;break e}if(T=0,O=r,t===0){if(T+=n-C,C<_){_-=C;do F[i++]=r[T++];while(--C);T=i-y,O=F}}else if(t<C){if(T+=n+t-C,C-=t,C<_){_-=C;do F[i++]=r[T++];while(--C);if(T=0,t<_){C=t,_-=C;do F[i++]=r[T++];while(--C);T=i-y,O=F}}}else if(T+=t-C,C<_){_-=C;do F[i++]=r[T++];while(--C);T=i-y,O=F}for(;_>2;)F[i++]=O[T++],F[i++]=O[T++],F[i++]=O[T++],_-=3;_&&(F[i++]=O[T++],_>1&&(F[i++]=O[T++]))}else{T=i-y;do F[i++]=F[T++],F[i++]=F[T++],F[i++]=F[T++],_-=3;while(_>2);_&&(F[i++]=F[T++],_>1&&(F[i++]=F[T++]))}}else if((C&64)===0){S=f[(S&65535)+(s&(1<<C)-1)];continue i}else{R.msg="invalid distance code",p.mode=G;break e}break}}else if((C&64)===0){S=d[(S&65535)+(s&(1<<C)-1)];continue t}else if(C&32){p.mode=L;break e}else{R.msg="invalid literal/length code",p.mode=G;break e}break}}while(E<b&&i<o);_=u>>3,E-=_,u-=_<<3,s&=(1<<u)-1,R.next_in=E,R.next_out=i,R.avail_in=E<b?5+(b-E):5-(E-b),R.avail_out=i<o?257+(o-i):257-(i-o),p.hold=s,p.bits=u;return}},t9D7:function(it,ne,q){"use strict";q.d(ne,"b",function(){return E}),q.d(ne,"g",function(){return i}),q.d(ne,"d",function(){return c}),q.d(ne,"e",function(){return o}),q.d(ne,"a",function(){return h}),q.d(ne,"f",function(){return t}),q.d(ne,"c",function(){return r});var G=q("Vhoy"),L=q("MI8n"),I=q("pmY6"),R=q("Cg/j"),M=q("ic2d"),p=q("nEHx");const E=Object(R.c)("themeService");var b;(function(s){function u(d){return d&&typeof d=="object"&&typeof d.id=="string"}s.isThemeColor=u})(b||(b={}));function i(s){return{id:s}}var c;(function(s){function u(C){return C&&typeof C=="object"&&typeof C.id=="string"&&(typeof C.color=="undefined"||b.isThemeColor(C.color))}s.isThemeIcon=u;const d=new RegExp(`^\\$\\((${G.a.iconNameExpression}(?:${G.a.iconModifierExpression})?)\\)$`);function f(C){const _=d.exec(C);if(!_)return;let[,y]=_;return{id:y}}s.fromString=f;function v(C,_){let y=C.id;const T=y.lastIndexOf("~");return T!==-1&&(y=y.substring(0,T)),_&&(y=`${y}~${_}`),{id:y}}s.modify=v;function m(C,_){var y,T;return C.id===_.id&&((y=C.color)===null||y===void 0?void 0:y.id)===((T=_.color)===null||T===void 0?void 0:T.id)}s.isEqual=m;function S(C,_){return{id:C.id,color:_?i(_):void 0}}s.asThemeIcon=S,s.asClassNameArray=G.a.asClassNameArray,s.asClassName=G.a.asClassName,s.asCSSSelector=G.a.asCSSSelector})(c||(c={}));function o(s){switch(s){case p.a.DARK:return"vs-dark";case p.a.HIGH_CONTRAST:return"hc-black";default:return"vs"}}const h={ThemingContribution:"base.contributions.theming"};class n{constructor(){this.themingParticipants=[],this.themingParticipants=[],this.onThemingParticipantAddedEmitter=new L.b}onColorThemeChange(s){return this.themingParticipants.push(s),this.onThemingParticipantAddedEmitter.fire(s),Object(I.i)(()=>{const u=this.themingParticipants.indexOf(s);this.themingParticipants.splice(u,1)})}getThemingParticipants(){return this.themingParticipants}}let a=new n;M.a.add(h.ThemingContribution,a);function t(s){return a.onColorThemeChange(s)}class r extends I.a{constructor(s){super();this.themeService=s,this.theme=s.getColorTheme(),this._register(this.themeService.onDidColorThemeChange(u=>this.onThemeChange(u)))}onThemeChange(s){this.theme=s,this.updateStyles()}updateStyles(){}}},ulZh:function(it,ne,q){typeof window!="undefined"&&function(L,I){it.exports=I()}(this,function(){return function(G){var L={};function I(R){if(L[R])return L[R].exports;var M=L[R]={i:R,l:!1,exports:{}};return G[R].call(M.exports,M,M.exports,I),M.l=!0,M.exports}return I.m=G,I.c=L,I.d=function(R,M,p){I.o(R,M)||Object.defineProperty(R,M,{enumerable:!0,get:p})},I.r=function(R){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(R,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(R,"__esModule",{value:!0})},I.t=function(R,M){if(M&1&&(R=I(R)),M&8)return R;if(M&4&&typeof R=="object"&&R&&R.__esModule)return R;var p=Object.create(null);if(I.r(p),Object.defineProperty(p,"default",{enumerable:!0,value:R}),M&2&&typeof R!="string")for(var E in R)I.d(p,E,function(b){return R[b]}.bind(null,E));return p},I.n=function(R){var M=R&&R.__esModule?function(){return R.default}:function(){return R};return I.d(M,"a",M),M},I.o=function(R,M){return Object.prototype.hasOwnProperty.call(R,M)},I.p="/dist/",I(I.s="./src/hls.ts")}({"./node_modules/eventemitter3/index.js":function(G,L,I){"use strict";var R=Object.prototype.hasOwnProperty,M="~";function p(){}Object.create&&(p.prototype=Object.create(null),new p().__proto__||(M=!1));function E(o,h,n){this.fn=o,this.context=h,this.once=n||!1}function b(o,h,n,a,t){if(typeof n!="function")throw new TypeError("The listener must be a function");var r=new E(n,a||o,t),s=M?M+h:h;return o._events[s]?o._events[s].fn?o._events[s]=[o._events[s],r]:o._events[s].push(r):(o._events[s]=r,o._eventsCount++),o}function i(o,h){--o._eventsCount===0?o._events=new p:delete o._events[h]}function c(){this._events=new p,this._eventsCount=0}c.prototype.eventNames=function(){var h=[],n,a;if(this._eventsCount===0)return h;for(a in n=this._events)R.call(n,a)&&h.push(M?a.slice(1):a);return Object.getOwnPropertySymbols?h.concat(Object.getOwnPropertySymbols(n)):h},c.prototype.listeners=function(h){var n=M?M+h:h,a=this._events[n];if(!a)return[];if(a.fn)return[a.fn];for(var t=0,r=a.length,s=new Array(r);t<r;t++)s[t]=a[t].fn;return s},c.prototype.listenerCount=function(h){var n=M?M+h:h,a=this._events[n];return a?a.fn?1:a.length:0},c.prototype.emit=function(h,n,a,t,r,s){var u=M?M+h:h;if(!this._events[u])return!1;var d=this._events[u],f=arguments.length,v,m;if(d.fn){d.once&&this.removeListener(h,d.fn,void 0,!0);switch(f){case 1:return d.fn.call(d.context),!0;case 2:return d.fn.call(d.context,n),!0;case 3:return d.fn.call(d.context,n,a),!0;case 4:return d.fn.call(d.context,n,a,t),!0;case 5:return d.fn.call(d.context,n,a,t,r),!0;case 6:return d.fn.call(d.context,n,a,t,r,s),!0}for(m=1,v=new Array(f-1);m<f;m++)v[m-1]=arguments[m];d.fn.apply(d.context,v)}else{var S=d.length,C;for(m=0;m<S;m++){d[m].once&&this.removeListener(h,d[m].fn,void 0,!0);switch(f){case 1:d[m].fn.call(d[m].context);break;case 2:d[m].fn.call(d[m].context,n);break;case 3:d[m].fn.call(d[m].context,n,a);break;case 4:d[m].fn.call(d[m].context,n,a,t);break;default:if(!v)for(C=1,v=new Array(f-1);C<f;C++)v[C-1]=arguments[C];d[m].fn.apply(d[m].context,v)}}}return!0},c.prototype.on=function(h,n,a){return b(this,h,n,a,!1)},c.prototype.once=function(h,n,a){return b(this,h,n,a,!0)},c.prototype.removeListener=function(h,n,a,t){var r=M?M+h:h;if(!this._events[r])return this;if(!n)return i(this,r),this;var s=this._events[r];if(s.fn)s.fn===n&&(!t||s.once)&&(!a||s.context===a)&&i(this,r);else{for(var u=0,d=[],f=s.length;u<f;u++)(s[u].fn!==n||t&&!s[u].once||a&&s[u].context!==a)&&d.push(s[u]);d.length?this._events[r]=d.length===1?d[0]:d:i(this,r)}return this},c.prototype.removeAllListeners=function(h){var n;return h?(n=M?M+h:h,this._events[n]&&i(this,n)):(this._events=new p,this._eventsCount=0),this},c.prototype.off=c.prototype.removeListener,c.prototype.addListener=c.prototype.on,c.prefixed=M,c.EventEmitter=c,G.exports=c},"./node_modules/url-toolkit/src/url-toolkit.js":function(G,L,I){(function(R){var M=/^((?:[a-zA-Z0-9+\-.]+:)?)(\/\/[^\/?#]*)?((?:[^\/?#]*\/)*[^;?#]*)?(;[^?#]*)?(\?[^#]*)?(#[^]*)?$/,p=/^([^\/?#]*)([^]*)$/,E=/(?:\/|^)\.(?=\/)/g,b=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,i={buildAbsoluteURL:function(c,o,h){if(h=h||{},c=c.trim(),o=o.trim(),!o){if(!h.alwaysNormalize)return c;var n=i.parseURL(c);if(!n)throw new Error("Error trying to parse base URL.");return n.path=i.normalizePath(n.path),i.buildURLFromParts(n)}var a=i.parseURL(o);if(!a)throw new Error("Error trying to parse relative URL.");if(a.scheme)return h.alwaysNormalize?(a.path=i.normalizePath(a.path),i.buildURLFromParts(a)):o;var t=i.parseURL(c);if(!t)throw new Error("Error trying to parse base URL.");if(!t.netLoc&&t.path&&t.path[0]!=="/"){var r=p.exec(t.path);t.netLoc=r[1],t.path=r[2]}t.netLoc&&!t.path&&(t.path="/");var s={scheme:t.scheme,netLoc:a.netLoc,path:null,params:a.params,query:a.query,fragment:a.fragment};if(!a.netLoc&&(s.netLoc=t.netLoc,a.path[0]!=="/"))if(!a.path)s.path=t.path,a.params||(s.params=t.params,a.query||(s.query=t.query));else{var u=t.path,d=u.substring(0,u.lastIndexOf("/")+1)+a.path;s.path=i.normalizePath(d)}return s.path===null&&(s.path=h.alwaysNormalize?i.normalizePath(a.path):a.path),i.buildURLFromParts(s)},parseURL:function(c){var o=M.exec(c);return o?{scheme:o[1]||"",netLoc:o[2]||"",path:o[3]||"",params:o[4]||"",query:o[5]||"",fragment:o[6]||""}:null},normalizePath:function(c){for(c=c.split("").reverse().join("").replace(E,"");c.length!==(c=c.replace(b,"")).length;);return c.split("").reverse().join("")},buildURLFromParts:function(c){return c.scheme+c.netLoc+c.path+c.params+c.query+c.fragment}};G.exports=i})(this)},"./node_modules/webworkify-webpack/index.js":function(G,L,I){function R(h){var n={};function a(r){if(n[r])return n[r].exports;var s=n[r]={i:r,l:!1,exports:{}};return h[r].call(s.exports,s,s.exports,a),s.l=!0,s.exports}a.m=h,a.c=n,a.i=function(r){return r},a.d=function(r,s,u){a.o(r,s)||Object.defineProperty(r,s,{configurable:!1,enumerable:!0,get:u})},a.r=function(r){Object.defineProperty(r,"__esModule",{value:!0})},a.n=function(r){var s=r&&r.__esModule?function(){return r.default}:function(){return r};return a.d(s,"a",s),s},a.o=function(r,s){return Object.prototype.hasOwnProperty.call(r,s)},a.p="/",a.oe=function(r){throw console.error(r),r};var t=a(a.s=ENTRY_MODULE);return t.default||t}var M="[\\.|\\-|\\+|\\w|/|@]+",p="\\(\\s*(/\\*.*?\\*/)?\\s*.*?("+M+").*?\\)";function E(h){return(h+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function b(h){return!isNaN(1*h)}function i(h,n,a){var t={};t[a]=[];var r=n.toString(),s=r.match(/^function\s?\w*\(\w+,\s*\w+,\s*(\w+)\)/);if(!s)return t;for(var u=s[1],d=new RegExp("(\\\\n|\\W)"+E(u)+p,"g"),f;f=d.exec(r);){if(f[3]==="dll-reference")continue;t[a].push(f[3])}for(d=new RegExp("\\("+E(u)+'\\("(dll-reference\\s('+M+'))"\\)\\)'+p,"g");f=d.exec(r);)h[f[2]]||(t[a].push(f[1]),h[f[2]]=I(f[1]).m),t[f[2]]=t[f[2]]||[],t[f[2]].push(f[4]);for(var v=Object.keys(t),m=0;m<v.length;m++)for(var S=0;S<t[v[m]].length;S++)b(t[v[m]][S])&&(t[v[m]][S]=1*t[v[m]][S]);return t}function c(h){var n=Object.keys(h);return n.reduce(function(a,t){return a||h[t].length>0},!1)}function o(h,n){for(var a={main:[n]},t={main:[]},r={main:{}};c(a);)for(var s=Object.keys(a),u=0;u<s.length;u++){var d=s[u],f=a[d],v=f.pop();if(r[d]=r[d]||{},r[d][v]||!h[d][v])continue;r[d][v]=!0,t[d]=t[d]||[],t[d].push(v);for(var m=i(h,h[d][v],d),S=Object.keys(m),C=0;C<S.length;C++)a[S[C]]=a[S[C]]||[],a[S[C]]=a[S[C]].concat(m[S[C]])}return t}G.exports=function(h,n){n=n||{};var a={main:I.m},t=n.all?{main:Object.keys(a.main)}:o(a,h),r="";Object.keys(t).filter(function(v){return v!=="main"}).forEach(function(v){for(var m=0;t[v][m];)m++;t[v].push(m),a[v][m]="(function(module, exports, __webpack_require__) { module.exports = __webpack_require__; })",r=r+"var "+v+" = ("+R.toString().replace("ENTRY_MODULE",JSON.stringify(m))+")({"+t[v].map(function(S){return""+JSON.stringify(S)+": "+a[v][S].toString()}).join(",")+`});
|
|
|
`}),r=r+"new (("+R.toString().replace("ENTRY_MODULE",JSON.stringify(h))+")({"+t.main.map(function(v){return""+JSON.stringify(v)+": "+a.main[v].toString()}).join(",")+"}))(self);";var s=new window.Blob([r],{type:"text/javascript"});if(n.bare)return s;var u=window.URL||window.webkitURL||window.mozURL||window.msURL,d=u.createObjectURL(s),f=new window.Worker(d);return f.objectURL=d,f}},"./src/config.ts":function(G,L,I){"use strict";I.r(L),I.d(L,"hlsDefaultConfig",function(){return C}),I.d(L,"mergeConfig",function(){return y}),I.d(L,"enableStreamingMode",function(){return T});var R=I("./src/controller/abr-controller.ts"),M=I("./src/controller/audio-stream-controller.ts"),p=I("./src/controller/audio-track-controller.ts"),E=I("./src/controller/subtitle-stream-controller.ts"),b=I("./src/controller/subtitle-track-controller.ts"),i=I("./src/controller/buffer-controller.ts"),c=I("./src/controller/timeline-controller.ts"),o=I("./src/controller/cap-level-controller.ts"),h=I("./src/controller/fps-controller.ts"),n=I("./src/controller/eme-controller.ts"),a=I("./src/controller/cmcd-controller.ts"),t=I("./src/utils/xhr-loader.ts"),r=I("./src/utils/fetch-loader.ts"),s=I("./src/utils/cues.ts"),u=I("./src/utils/mediakeys-helper.ts"),d=I("./src/utils/logger.ts");function f(){return f=Object.assign||function(O){for(var g=1;g<arguments.length;g++){var F=arguments[g];for(var P in F)Object.prototype.hasOwnProperty.call(F,P)&&(O[P]=F[P])}return O},f.apply(this,arguments)}function v(O,g){var F=Object.keys(O);if(Object.getOwnPropertySymbols){var P=Object.getOwnPropertySymbols(O);g&&(P=P.filter(function(N){return Object.getOwnPropertyDescriptor(O,N).enumerable})),F.push.apply(F,P)}return F}function m(O){for(var g=1;g<arguments.length;g++){var F=arguments[g]!=null?arguments[g]:{};g%2?v(Object(F),!0).forEach(function(P){S(O,P,F[P])}):Object.getOwnPropertyDescriptors?Object.defineProperties(O,Object.getOwnPropertyDescriptors(F)):v(Object(F)).forEach(function(P){Object.defineProperty(O,P,Object.getOwnPropertyDescriptor(F,P))})}return O}function S(O,g,F){return g in O?Object.defineProperty(O,g,{value:F,enumerable:!0,configurable:!0,writable:!0}):O[g]=F,O}var C=m(m({autoStartLoad:!0,startPosition:-1,defaultAudioCodec:void 0,debug:!1,capLevelOnFPSDrop:!1,capLevelToPlayerSize:!1,initialLiveManifestSize:1,maxBufferLength:30,backBufferLength:Infinity,maxBufferSize:60*1e3*1e3,maxBufferHole:.1,highBufferWatchdogPeriod:2,nudgeOffset:.1,nudgeMaxRetry:3,maxFragLookUpTolerance:.25,liveSyncDurationCount:3,liveMaxLatencyDurationCount:Infinity,liveSyncDuration:void 0,liveMaxLatencyDuration:void 0,maxLiveSyncPlaybackRate:1,liveDurationInfinity:!1,liveBackBufferLength:null,maxMaxBufferLength:600,enableWorker:!0,enableSoftwareAES:!0,manifestLoadingTimeOut:1e4,manifestLoadingMaxRetry:1,manifestLoadingRetryDelay:1e3,manifestLoadingMaxRetryTimeout:64e3,startLevel:void 0,levelLoadingTimeOut:1e4,levelLoadingMaxRetry:4,levelLoadingRetryDelay:1e3,levelLoadingMaxRetryTimeout:64e3,fragLoadingTimeOut:2e4,fragLoadingMaxRetry:6,fragLoadingRetryDelay:1e3,fragLoadingMaxRetryTimeout:64e3,startFragPrefetch:!1,fpsDroppedMonitoringPeriod:5e3,fpsDroppedMonitoringThreshold:.2,appendErrorMaxRetry:3,loader:t.default,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,licenseResponseCallback:void 0,abrController:R.default,bufferController:i.default,capLevelController:o.default,fpsController:h.default,stretchShortVideoTrack:!1,maxAudioFramesDrift:1,forceKeyFrameOnDiscontinuity:!0,abrEwmaFastLive:3,abrEwmaSlowLive:9,abrEwmaFastVoD:3,abrEwmaSlowVoD:9,abrEwmaDefaultEstimate:5e5,abrBandWidthFactor:.95,abrBandWidthUpFactor:.7,abrMaxWithRealBitrate:!1,maxStarvationDelay:4,maxLoadingDelay:4,minAutoBitrate:0,emeEnabled:!1,widevineLicenseUrl:void 0,drmSystemOptions:{},requestMediaKeySystemAccessFunc:u.requestMediaKeySystemAccess,testBandwidth:!0,progressive:!1,lowLatencyMode:!0,cmcd:void 0},_()),{},{subtitleStreamController:E.SubtitleStreamController,subtitleTrackController:b.default,timelineController:c.TimelineController,audioStreamController:M.default,audioTrackController:p.default,emeController:n.default,cmcdController:a.default});function _(){return{cueHandler:s.default,enableCEA708Captions:!0,enableWebVTT:!0,enableIMSC1:!0,captionsTextTrack1Label:"English",captionsTextTrack1LanguageCode:"en",captionsTextTrack2Label:"Spanish",captionsTextTrack2LanguageCode:"es",captionsTextTrack3Label:"Unknown CC",captionsTextTrack3LanguageCode:"",captionsTextTrack4Label:"Unknown CC",captionsTextTrack4LanguageCode:"",renderTextTracksNatively:!0}}function y(O,g){if((g.liveSyncDurationCount||g.liveMaxLatencyDurationCount)&&(g.liveSyncDuration||g.liveMaxLatencyDuration))throw new Error("Illegal hls.js config: don't mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration");if(g.liveMaxLatencyDurationCount!==void 0&&(g.liveSyncDurationCount===void 0||g.liveMaxLatencyDurationCount<=g.liveSyncDurationCount))throw new Error('Illegal hls.js config: "liveMaxLatencyDurationCount" must be greater than "liveSyncDurationCount"');if(g.liveMaxLatencyDuration!==void 0&&(g.liveSyncDuration===void 0||g.liveMaxLatencyDuration<=g.liveSyncDuration))throw new Error('Illegal hls.js config: "liveMaxLatencyDuration" must be greater than "liveSyncDuration"');return f({},O,g)}function T(O){var g=O.loader;if(g!==r.default&&g!==t.default)d.logger.log("[config]: Custom loader detected, cannot enable progressive streaming"),O.progressive=!1;else{var F=Object(r.fetchSupported)();F&&(O.loader=r.default,O.progressive=!0,O.enableSoftwareAES=!0,d.logger.log("[config]: Progressive streaming enabled, using FetchLoader"))}}},"./src/controller/abr-controller.ts":function(G,L,I){"use strict";I.r(L);var R=I("./src/polyfills/number.ts"),M=I("./src/utils/ewma-bandwidth-estimator.ts"),p=I("./src/events.ts"),E=I("./src/utils/buffer-helper.ts"),b=I("./src/errors.ts"),i=I("./src/types/loader.ts"),c=I("./src/utils/logger.ts");function o(a,t){for(var r=0;r<t.length;r++){var s=t[r];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(a,s.key,s)}}function h(a,t,r){return t&&o(a.prototype,t),r&&o(a,r),a}var n=function(){function a(r){this.hls=void 0,this.lastLoadedFragLevel=0,this._nextAutoLevel=-1,this.timer=void 0,this.onCheck=this._abandonRulesCheck.bind(this),this.fragCurrent=null,this.partCurrent=null,this.bitrateTestDelay=0,this.bwEstimator=void 0,this.hls=r;var s=r.config;this.bwEstimator=new M.default(s.abrEwmaSlowVoD,s.abrEwmaFastVoD,s.abrEwmaDefaultEstimate),this.registerListeners()}var t=a.prototype;return t.registerListeners=function(){var s=this.hls;s.on(p.Events.FRAG_LOADING,this.onFragLoading,this),s.on(p.Events.FRAG_LOADED,this.onFragLoaded,this),s.on(p.Events.FRAG_BUFFERED,this.onFragBuffered,this),s.on(p.Events.LEVEL_LOADED,this.onLevelLoaded,this),s.on(p.Events.ERROR,this.onError,this)},t.unregisterListeners=function(){var s=this.hls;s.off(p.Events.FRAG_LOADING,this.onFragLoading,this),s.off(p.Events.FRAG_LOADED,this.onFragLoaded,this),s.off(p.Events.FRAG_BUFFERED,this.onFragBuffered,this),s.off(p.Events.LEVEL_LOADED,this.onLevelLoaded,this),s.off(p.Events.ERROR,this.onError,this)},t.destroy=function(){this.unregisterListeners(),this.clearTimer(),this.hls=this.onCheck=null,this.fragCurrent=this.partCurrent=null},t.onFragLoading=function(s,u){var d=u.frag;if(d.type===i.PlaylistLevelType.MAIN&&!this.timer){var f;this.fragCurrent=d,this.partCurrent=(f=u.part)!=null?f:null,this.timer=self.setInterval(this.onCheck,100)}},t.onLevelLoaded=function(s,u){var d=this.hls.config;u.details.live?this.bwEstimator.update(d.abrEwmaSlowLive,d.abrEwmaFastLive):this.bwEstimator.update(d.abrEwmaSlowVoD,d.abrEwmaFastVoD)},t._abandonRulesCheck=function(){var s=this.fragCurrent,u=this.partCurrent,d=this.hls,f=d.autoLevelEnabled,v=d.config,m=d.media;if(!s||!m)return;var S=u?u.stats:s.stats,C=u?u.duration:s.duration;if(S.aborted){c.logger.warn("frag loader destroy or aborted, disarm abandonRules"),this.clearTimer(),this._nextAutoLevel=-1;return}if(!f||m.paused||!m.playbackRate||!m.readyState)return;var _=performance.now()-S.loading.start,y=Math.abs(m.playbackRate);if(_<=500*C/y)return;var T=d.levels,O=d.minAutoLevel,g=T[s.level],F=S.total||Math.max(S.loaded,Math.round(C*g.maxBitrate/8)),P=Math.max(1,S.bwEstimate?S.bwEstimate/8:S.loaded*1e3/_),N=(F-S.loaded)/P,X=m.currentTime,j=(E.BufferHelper.bufferInfo(m,X,v.maxBufferHole).end-X)/y;if(j>=2*C/y||N<=j)return;var A=Number.POSITIVE_INFINITY,K;for(K=s.level-1;K>O;K--){var U=T[K].maxBitrate;if(A=C*U/(8*.8*P),A<j)break}if(A>=N)return;var k=this.bwEstimator.getEstimate();c.logger.warn("Fragment "+s.sn+(u?" part "+u.index:"")+" of level "+s.level+" is loading too slowly and will cause an underbuffer; aborting and switching to level "+K+`
|
|
|
Current BW estimate: `+(Object(R.isFiniteNumber)(k)?(k/1024).toFixed(3):"Unknown")+` Kb/s
|
|
|
Estimated load time for current fragment: `+N.toFixed(3)+` s
|
|
|
Estimated load time for the next fragment: `+A.toFixed(3)+` s
|
|
|
Time to underbuffer: `+j.toFixed(3)+" s"),d.nextLoadLevel=K,this.bwEstimator.sample(_,S.loaded),this.clearTimer(),s.loader&&(this.fragCurrent=this.partCurrent=null,s.loader.abort()),d.trigger(p.Events.FRAG_LOAD_EMERGENCY_ABORTED,{frag:s,part:u,stats:S})},t.onFragLoaded=function(s,u){var d=u.frag,f=u.part;if(d.type===i.PlaylistLevelType.MAIN&&Object(R.isFiniteNumber)(d.sn)){var v=f?f.stats:d.stats,m=f?f.duration:d.duration;if(this.clearTimer(),this.lastLoadedFragLevel=d.level,this._nextAutoLevel=-1,this.hls.config.abrMaxWithRealBitrate){var S=this.hls.levels[d.level],C=(S.loaded?S.loaded.bytes:0)+v.loaded,_=(S.loaded?S.loaded.duration:0)+m;S.loaded={bytes:C,duration:_},S.realBitrate=Math.round(8*C/_)}if(d.bitrateTest){var y={stats:v,frag:d,part:f,id:d.type};this.onFragBuffered(p.Events.FRAG_BUFFERED,y),d.bitrateTest=!1}}},t.onFragBuffered=function(s,u){var d=u.frag,f=u.part,v=f?f.stats:d.stats;if(v.aborted)return;if(d.type!==i.PlaylistLevelType.MAIN||d.sn==="initSegment")return;var m=v.parsing.end-v.loading.start;this.bwEstimator.sample(m,v.loaded),v.bwEstimate=this.bwEstimator.getEstimate(),d.bitrateTest?this.bitrateTestDelay=m/1e3:this.bitrateTestDelay=0},t.onError=function(s,u){switch(u.details){case b.ErrorDetails.FRAG_LOAD_ERROR:case b.ErrorDetails.FRAG_LOAD_TIMEOUT:this.clearTimer();break;default:break}},t.clearTimer=function(){self.clearInterval(this.timer),this.timer=void 0},t.getNextABRAutoLevel=function(){var s=this.fragCurrent,u=this.partCurrent,d=this.hls,f=d.maxAutoLevel,v=d.config,m=d.minAutoLevel,S=d.media,C=u?u.duration:s?s.duration:0,_=S?S.currentTime:0,y=S&&S.playbackRate!==0?Math.abs(S.playbackRate):1,T=this.bwEstimator?this.bwEstimator.getEstimate():v.abrEwmaDefaultEstimate,O=(E.BufferHelper.bufferInfo(S,_,v.maxBufferHole).end-_)/y,g=this.findBestLevel(T,m,f,O,v.abrBandWidthFactor,v.abrBandWidthUpFactor);if(g>=0)return g;c.logger.trace((O?"rebuffering expected":"buffer is empty")+", finding optimal quality level");var F=C?Math.min(C,v.maxStarvationDelay):v.maxStarvationDelay,P=v.abrBandWidthFactor,N=v.abrBandWidthUpFactor;if(!O){var X=this.bitrateTestDelay;if(X){var j=C?Math.min(C,v.maxLoadingDelay):v.maxLoadingDelay;F=j-X,c.logger.trace("bitrate test took "+Math.round(1e3*X)+"ms, set first fragment max fetchDuration to "+Math.round(1e3*F)+" ms"),P=N=1}}return g=this.findBestLevel(T,m,f,O+F,P,N),Math.max(g,0)},t.findBestLevel=function(s,u,d,f,v,m){for(var S,C=this.fragCurrent,_=this.partCurrent,y=this.lastLoadedFragLevel,T=this.hls.levels,O=T[y],g=!!(O!=null&&(S=O.details)!==null&&S!==void 0&&S.live),F=O==null?void 0:O.codecSet,P=_?_.duration:C?C.duration:0,N=d;N>=u;N--){var X=T[N];if(!X||F&&X.codecSet!==F)continue;var j=X.details,A=(_?j==null?void 0:j.partTarget:j==null?void 0:j.averagetargetduration)||P,K=void 0;N<=y?K=v*s:K=m*s;var U=T[N].maxBitrate,k=U*A/K;if(c.logger.trace("level/adjustedbw/bitrate/avgDuration/maxFetchDuration/fetchDuration: "+N+"/"+Math.round(K)+"/"+U+"/"+A+"/"+f+"/"+k),K>U&&(!k||g&&!this.bitrateTestDelay||k<f))return N}return-1},h(a,[{key:"nextAutoLevel",get:function(){var s=this._nextAutoLevel,u=this.bwEstimator;if(s!==-1&&(!u||!u.canEstimate()))return s;var d=this.getNextABRAutoLevel();return s!==-1&&(d=Math.min(s,d)),d},set:function(s){this._nextAutoLevel=s}}]),a}();L.default=n},"./src/controller/audio-stream-controller.ts":function(G,L,I){"use strict";I.r(L);var R=I("./src/polyfills/number.ts"),M=I("./src/controller/base-stream-controller.ts"),p=I("./src/events.ts"),E=I("./src/utils/buffer-helper.ts"),b=I("./src/controller/fragment-tracker.ts"),i=I("./src/types/level.ts"),c=I("./src/types/loader.ts"),o=I("./src/loader/fragment.ts"),h=I("./src/demux/chunk-cache.ts"),n=I("./src/demux/transmuxer-interface.ts"),a=I("./src/types/transmuxer.ts"),t=I("./src/controller/fragment-finders.ts"),r=I("./src/utils/discontinuities.ts"),s=I("./src/errors.ts"),u=I("./src/utils/logger.ts");function d(){return d=Object.assign||function(C){for(var _=1;_<arguments.length;_++){var y=arguments[_];for(var T in y)Object.prototype.hasOwnProperty.call(y,T)&&(C[T]=y[T])}return C},d.apply(this,arguments)}function f(C,_){C.prototype=Object.create(_.prototype),C.prototype.constructor=C,v(C,_)}function v(C,_){return v=Object.setPrototypeOf||function(T,O){return T.__proto__=O,T},v(C,_)}var m=100,S=function(C){f(_,C);function _(T,O){var g;return g=C.call(this,T,O,"[audio-stream-controller]")||this,g.videoBuffer=null,g.videoTrackCC=-1,g.waitingVideoCC=-1,g.audioSwitch=!1,g.trackId=-1,g.waitingData=null,g.mainDetails=null,g.bufferFlushed=!1,g._registerListeners(),g}var y=_.prototype;return y.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},y._registerListeners=function(){var O=this.hls;O.on(p.Events.MEDIA_ATTACHED,this.onMediaAttached,this),O.on(p.Events.MEDIA_DETACHING,this.onMediaDetaching,this),O.on(p.Events.MANIFEST_LOADING,this.onManifestLoading,this),O.on(p.Events.LEVEL_LOADED,this.onLevelLoaded,this),O.on(p.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),O.on(p.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),O.on(p.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),O.on(p.Events.ERROR,this.onError,this),O.on(p.Events.BUFFER_RESET,this.onBufferReset,this),O.on(p.Events.BUFFER_CREATED,this.onBufferCreated,this),O.on(p.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),O.on(p.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),O.on(p.Events.FRAG_BUFFERED,this.onFragBuffered,this)},y._unregisterListeners=function(){var O=this.hls;O.off(p.Events.MEDIA_ATTACHED,this.onMediaAttached,this),O.off(p.Events.MEDIA_DETACHING,this.onMediaDetaching,this),O.off(p.Events.MANIFEST_LOADING,this.onManifestLoading,this),O.off(p.Events.LEVEL_LOADED,this.onLevelLoaded,this),O.off(p.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),O.off(p.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),O.off(p.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),O.off(p.Events.ERROR,this.onError,this),O.off(p.Events.BUFFER_RESET,this.onBufferReset,this),O.off(p.Events.BUFFER_CREATED,this.onBufferCreated,this),O.off(p.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),O.off(p.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),O.off(p.Events.FRAG_BUFFERED,this.onFragBuffered,this)},y.onInitPtsFound=function(O,g){var F=g.frag,P=g.id,N=g.initPTS;if(P==="main"){var X=F.cc;this.initPTS[F.cc]=N,this.log("InitPTS for cc: "+X+" found from main: "+N),this.videoTrackCC=X,this.state===M.State.WAITING_INIT_PTS&&this.tick()}},y.startLoad=function(O){if(!this.levels){this.startPosition=O,this.state=M.State.STOPPED;return}var g=this.lastCurrentTime;this.stopLoad(),this.setInterval(m),this.fragLoadError=0,g>0&&O===-1?(this.log("Override startPosition with lastCurrentTime @"+g.toFixed(3)),this.state=M.State.IDLE):(this.loadedmetadata=!1,this.state=M.State.WAITING_TRACK),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=O,this.tick()},y.doTick=function(){switch(this.state){case M.State.IDLE:this.doTickIdle();break;case M.State.WAITING_TRACK:{var O,g=this.levels,F=this.trackId,P=g==null||((O=g[F])===null||O===void 0)?void 0:O.details;if(P){if(this.waitForCdnTuneIn(P))break;this.state=M.State.WAITING_INIT_PTS}break}case M.State.FRAG_LOADING_WAITING_RETRY:{var N,X=performance.now(),j=this.retryDate;(!j||X>=j||(N=this.media)!==null&&N!==void 0&&N.seeking)&&(this.log("RetryDate reached, switch back to IDLE state"),this.state=M.State.IDLE);break}case M.State.WAITING_INIT_PTS:{var A=this.waitingData;if(A){var K=A.frag,U=A.part,k=A.cache,z=A.complete;if(this.initPTS[K.cc]!==void 0){this.waitingData=null,this.waitingVideoCC=-1,this.state=M.State.FRAG_LOADING;var te=k.flush(),de={frag:K,part:U,payload:te,networkDetails:null};this._handleFragmentLoadProgress(de),z&&C.prototype._handleFragmentLoadComplete.call(this,de)}else if(this.videoTrackCC!==this.waitingVideoCC)u.logger.log("Waiting fragment cc ("+K.cc+") cancelled because video is at cc "+this.videoTrackCC),this.clearWaitingFragment();else{var be=this.getLoadPosition(),We=E.BufferHelper.bufferInfo(this.mediaBuffer,be,this.config.maxBufferHole),Ne=Object(t.fragmentWithinToleranceTest)(We.end,this.config.maxFragLookUpTolerance,K);Ne<0&&(u.logger.log("Waiting fragment cc ("+K.cc+") @ "+K.start+" cancelled because another fragment at "+We.end+" is needed"),this.clearWaitingFragment())}}else this.state=M.State.IDLE}}this.onTickEnd()},y.clearWaitingFragment=function(){var O=this.waitingData;O&&(this.fragmentTracker.removeFragment(O.frag),this.waitingData=null,this.waitingVideoCC=-1,this.state=M.State.IDLE)},y.onTickEnd=function(){var O=this.media;if(!O||!O.readyState)return;var g=this.mediaBuffer?this.mediaBuffer:O,F=g.buffered;!this.loadedmetadata&&F.length&&(this.loadedmetadata=!0),this.lastCurrentTime=O.currentTime},y.doTickIdle=function(){var O,g,F=this.hls,P=this.levels,N=this.media,X=this.trackId,j=F.config;if(!P||!P[X])return;if(!N&&(this.startFragRequested||!j.startFragPrefetch))return;var A=P[X],K=A.details;if(!K||K.live&&this.levelLastLoaded!==X||this.waitForCdnTuneIn(K)){this.state=M.State.WAITING_TRACK;return}this.bufferFlushed&&(this.bufferFlushed=!1,this.afterBufferFlushed(this.mediaBuffer?this.mediaBuffer:this.media,o.ElementaryStreamTypes.AUDIO,c.PlaylistLevelType.AUDIO));var U=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:this.media,c.PlaylistLevelType.AUDIO);if(U===null)return;var k=U.len,z=this.getMaxBufferLength(),te=this.audioSwitch;if(k>=z&&!te)return;if(!te&&this._streamEnded(U,K)){F.trigger(p.Events.BUFFER_EOS,{type:"audio"}),this.state=M.State.ENDED;return}var de=K.fragments,be=de[0].start,We=U.end;if(te){var Ne=this.getLoadPosition();We=Ne,K.PTSKnown&&Ne<be&&((U.end>be||U.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),N.currentTime=be+.05))}var Le=this.getNextFragment(We,K);if(!Le){this.bufferFlushed=!0;return}((O=Le.decryptdata)===null||O===void 0?void 0:O.keyFormat)==="identity"&&!((g=Le.decryptdata)!==null&&g!==void 0&&g.key)?this.loadKey(Le,K):this.loadFragment(Le,K,We)},y.getMaxBufferLength=function(){var O=C.prototype.getMaxBufferLength.call(this),g=this.getFwdBufferInfo(this.videoBuffer?this.videoBuffer:this.media,c.PlaylistLevelType.MAIN);return g===null?O:Math.max(O,g.len)},y.onMediaDetaching=function(){this.videoBuffer=null,C.prototype.onMediaDetaching.call(this)},y.onAudioTracksUpdated=function(O,g){var F=g.audioTracks;this.resetTransmuxer(),this.levels=F.map(function(P){return new i.Level(P)})},y.onAudioTrackSwitching=function(O,g){var F=!!g.url;this.trackId=g.id;var P=this.fragCurrent;P!=null&&P.loader&&P.loader.abort(),this.fragCurrent=null,this.clearWaitingFragment(),F?this.setInterval(m):this.resetTransmuxer(),F?(this.audioSwitch=!0,this.state=M.State.IDLE):this.state=M.State.STOPPED,this.tick()},y.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments(),this.startPosition=this.lastCurrentTime=0,this.bufferFlushed=!1},y.onLevelLoaded=function(O,g){this.mainDetails=g.details},y.onAudioTrackLoaded=function(O,g){var F,P=this.levels,N=g.details,X=g.id;if(!P){this.warn("Audio tracks were reset while loading level "+X);return}this.log("Track "+X+" loaded ["+N.startSN+","+N.endSN+"],duration:"+N.totalduration);var j=P[X],A=0;if(N.live||(F=j.details)!==null&&F!==void 0&&F.live){var K=this.mainDetails;if(N.fragments[0]||(N.deltaUpdateFailed=!0),N.deltaUpdateFailed||!K)return;!j.details&&N.hasProgramDateTime&&K.hasProgramDateTime?(Object(r.alignMediaPlaylistByPDT)(N,K),A=N.fragments[0].start):A=this.alignPlaylists(N,j.details)}j.details=N,this.levelLastLoaded=X,!this.startFragRequested&&(this.mainDetails||!N.live)&&this.setStartPosition(j.details,A),this.state===M.State.WAITING_TRACK&&!this.waitForCdnTuneIn(N)&&(this.state=M.State.IDLE),this.tick()},y._handleFragmentLoadProgress=function(O){var g,F=O.frag,P=O.part,N=O.payload,X=this.config,j=this.trackId,A=this.levels;if(!A){this.warn("Audio tracks were reset while fragment load was in progress. Fragment "+F.sn+" of level "+F.level+" will not be buffered");return}var K=A[j];console.assert(K,"Audio track is defined on fragment load progress");var U=K.details;console.assert(U,"Audio track details are defined on fragment load progress");var k=X.defaultAudioCodec||K.audioCodec||"mp4a.40.2",z=this.transmuxer;z||(z=this.transmuxer=new n.default(this.hls,c.PlaylistLevelType.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));var te=this.initPTS[F.cc],de=(g=F.initSegment)===null||g===void 0?void 0:g.data;if(te!==void 0){var be=!1,We=P?P.index:-1,Ne=We!==-1,Le=new a.ChunkMetadata(F.level,F.sn,F.stats.chunkCount,N.byteLength,We,Ne);z.push(N,de,k,"",F,P,U.totalduration,be,Le,te)}else{u.logger.log("Unknown video PTS for cc "+F.cc+", waiting for video PTS before demuxing audio frag "+F.sn+" of ["+U.startSN+" ,"+U.endSN+"],track "+j);var Ke=this.waitingData=this.waitingData||{frag:F,part:P,cache:new h.default,complete:!1},He=Ke.cache;He.push(new Uint8Array(N)),this.waitingVideoCC=this.videoTrackCC,this.state=M.State.WAITING_INIT_PTS}},y._handleFragmentLoadComplete=function(O){if(this.waitingData){this.waitingData.complete=!0;return}C.prototype._handleFragmentLoadComplete.call(this,O)},y.onBufferReset=function(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1},y.onBufferCreated=function(O,g){var F=g.tracks.audio;F&&(this.mediaBuffer=F.buffer),g.tracks.video&&(this.videoBuffer=g.tracks.video.buffer)},y.onFragBuffered=function(O,g){var F=g.frag,P=g.part;if(F.type!==c.PlaylistLevelType.AUDIO)return;if(this.fragContextChanged(F)){this.warn("Fragment "+F.sn+(P?" p: "+P.index:"")+" of level "+F.level+" finished buffering, but was aborted. state: "+this.state+", audioSwitch: "+this.audioSwitch);return}F.sn!=="initSegment"&&(this.fragPrevious=F,this.audioSwitch&&(this.audioSwitch=!1,this.hls.trigger(p.Events.AUDIO_TRACK_SWITCHED,{id:this.trackId}))),this.fragBufferedComplete(F,P)},y.onError=function(O,g){switch(g.details){case s.ErrorDetails.FRAG_LOAD_ERROR:case s.ErrorDetails.FRAG_LOAD_TIMEOUT:case s.ErrorDetails.KEY_LOAD_ERROR:case s.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(c.PlaylistLevelType.AUDIO,g);break;case s.ErrorDetails.AUDIO_TRACK_LOAD_ERROR:case s.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:this.state!==M.State.ERROR&&this.state!==M.State.STOPPED&&(this.state=g.fatal?M.State.ERROR:M.State.IDLE,this.warn(g.details+" while loading frag, switching to "+this.state+" state"));break;case s.ErrorDetails.BUFFER_FULL_ERROR:if(g.parent==="audio"&&(this.state===M.State.PARSING||this.state===M.State.PARSED)){var F=!0,P=this.getFwdBufferInfo(this.mediaBuffer,c.PlaylistLevelType.AUDIO);P&&P.len>.5&&(F=!this.reduceMaxBufferLength(P.len)),F&&(this.warn("Buffer full error also media.currentTime is not buffered, flush audio buffer"),this.fragCurrent=null,C.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.resetLoadingState()}break;default:break}},y.onBufferFlushed=function(O,g){var F=g.type;F===o.ElementaryStreamTypes.AUDIO&&(this.bufferFlushed=!0)},y._handleTransmuxComplete=function(O){var g,F="audio",P=this.hls,N=O.remuxResult,X=O.chunkMeta,j=this.getCurrentContext(X);if(!j){this.warn("The loading context changed while buffering fragment "+X.sn+" of level "+X.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(X.level);return}var A=j.frag,K=j.part,U=N.audio,k=N.text,z=N.id3,te=N.initSegment;if(this.fragContextChanged(A))return;if(this.state=M.State.PARSING,this.audioSwitch&&U&&this.completeAudioSwitch(),te!=null&&te.tracks&&(this._bufferInitSegment(te.tracks,A,X),P.trigger(p.Events.FRAG_PARSING_INIT_SEGMENT,{frag:A,id:F,tracks:te.tracks})),U){var de=U.startPTS,be=U.endPTS,We=U.startDTS,Ne=U.endDTS;K&&(K.elementaryStreams[o.ElementaryStreamTypes.AUDIO]={startPTS:de,endPTS:be,startDTS:We,endDTS:Ne}),A.setElementaryStreamInfo(o.ElementaryStreamTypes.AUDIO,de,be,We,Ne),this.bufferFragmentData(U,A,K,X)}if(z!=null&&(g=z.samples)!==null&&g!==void 0&&g.length){var Le=d({frag:A,id:F},z);P.trigger(p.Events.FRAG_PARSING_METADATA,Le)}if(k){var Ke=d({frag:A,id:F},k);P.trigger(p.Events.FRAG_PARSING_USERDATA,Ke)}},y._bufferInitSegment=function(O,g,F){if(this.state!==M.State.PARSING)return;O.video&&delete O.video;var P=O.audio;if(!P)return;P.levelCodec=P.codec,P.id="audio",this.log("Init audio buffer, container:"+P.container+", codecs[parsed]=["+P.codec+"]"),this.hls.trigger(p.Events.BUFFER_CODECS,O);var N=P.initSegment;if(N!=null&&N.byteLength){var X={type:"audio",frag:g,part:null,chunkMeta:F,parent:g.type,data:N};this.hls.trigger(p.Events.BUFFER_APPENDING,X)}this.tick()},y.loadFragment=function(O,g,F){var P=this.fragmentTracker.getState(O);this.fragCurrent=O,(this.audioSwitch||P===b.FragmentState.NOT_LOADED||P===b.FragmentState.PARTIAL)&&(O.sn==="initSegment"?this._loadInitSegment(O):g.live&&!Object(R.isFiniteNumber)(this.initPTS[O.cc])?(this.log("Waiting for video PTS in continuity counter "+O.cc+" of live stream before loading audio fragment "+O.sn+" of level "+this.trackId),this.state=M.State.WAITING_INIT_PTS):(this.startFragRequested=!0,C.prototype.loadFragment.call(this,O,g,F)))},y.completeAudioSwitch=function(){var O=this.hls,g=this.media,F=this.trackId;g&&(this.log("Switching audio track : flushing all audio"),C.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.audioSwitch=!1,O.trigger(p.Events.AUDIO_TRACK_SWITCHED,{id:F})},_}(M.default);L.default=S},"./src/controller/audio-track-controller.ts":function(G,L,I){"use strict";I.r(L);var R=I("./src/events.ts"),M=I("./src/errors.ts"),p=I("./src/controller/base-playlist-controller.ts"),E=I("./src/types/loader.ts");function b(n,a){for(var t=0;t<a.length;t++){var r=a[t];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(n,r.key,r)}}function i(n,a,t){return a&&b(n.prototype,a),t&&b(n,t),n}function c(n,a){n.prototype=Object.create(a.prototype),n.prototype.constructor=n,o(n,a)}function o(n,a){return o=Object.setPrototypeOf||function(r,s){return r.__proto__=s,r},o(n,a)}var h=function(n){c(a,n);function a(r){var s;return s=n.call(this,r,"[audio-track-controller]")||this,s.tracks=[],s.groupId=null,s.tracksInGroup=[],s.trackId=-1,s.trackName="",s.selectDefaultTrack=!0,s.registerListeners(),s}var t=a.prototype;return t.registerListeners=function(){var s=this.hls;s.on(R.Events.MANIFEST_LOADING,this.onManifestLoading,this),s.on(R.Events.MANIFEST_PARSED,this.onManifestParsed,this),s.on(R.Events.LEVEL_LOADING,this.onLevelLoading,this),s.on(R.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),s.on(R.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),s.on(R.Events.ERROR,this.onError,this)},t.unregisterListeners=function(){var s=this.hls;s.off(R.Events.MANIFEST_LOADING,this.onManifestLoading,this),s.off(R.Events.MANIFEST_PARSED,this.onManifestParsed,this),s.off(R.Events.LEVEL_LOADING,this.onLevelLoading,this),s.off(R.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),s.off(R.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),s.off(R.Events.ERROR,this.onError,this)},t.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,n.prototype.destroy.call(this)},t.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.trackName="",this.selectDefaultTrack=!0},t.onManifestParsed=function(s,u){this.tracks=u.audioTracks||[]},t.onAudioTrackLoaded=function(s,u){var d=u.id,f=u.details,v=this.tracksInGroup[d];if(!v){this.warn("Invalid audio track id "+d);return}var m=v.details;v.details=u.details,this.log("audioTrack "+d+" loaded ["+f.startSN+"-"+f.endSN+"]"),d===this.trackId&&(this.retryCount=0,this.playlistLoaded(d,u,m))},t.onLevelLoading=function(s,u){this.switchLevel(u.level)},t.onLevelSwitching=function(s,u){this.switchLevel(u.level)},t.switchLevel=function(s){var u=this.hls.levels[s];if(!(u!=null&&u.audioGroupIds))return;var d=u.audioGroupIds[u.urlId];if(this.groupId!==d){this.groupId=d;var f=this.tracks.filter(function(m){return!d||m.groupId===d});this.selectDefaultTrack&&!f.some(function(m){return m.default})&&(this.selectDefaultTrack=!1),this.tracksInGroup=f;var v={audioTracks:f};this.log("Updating audio tracks, "+f.length+' track(s) found in "'+d+'" group-id'),this.hls.trigger(R.Events.AUDIO_TRACKS_UPDATED,v),this.selectInitialTrack()}},t.onError=function(s,u){if(n.prototype.onError.call(this,s,u),u.fatal||!u.context)return;u.context.type===E.PlaylistContextType.AUDIO_TRACK&&u.context.id===this.trackId&&u.context.groupId===this.groupId&&this.retryLoadingOrFail(u)},t.setAudioTrack=function(s){var u=this.tracksInGroup;if(s<0||s>=u.length){this.warn("Invalid id passed to audio-track controller");return}this.clearTimer();var d=u[this.trackId];this.log("Now switching to audio-track index "+s);var f=u[s],v=f.id,m=f.groupId,S=m===void 0?"":m,C=f.name,_=f.type,y=f.url;if(this.trackId=s,this.trackName=C,this.selectDefaultTrack=!1,this.hls.trigger(R.Events.AUDIO_TRACK_SWITCHING,{id:v,groupId:S,name:C,type:_,url:y}),f.details&&!f.details.live)return;var T=this.switchParams(f.url,d==null?void 0:d.details);this.loadPlaylist(T)},t.selectInitialTrack=function(){var s=this.tracksInGroup;console.assert(s.length,"Initial audio track should be selected when tracks are known");var u=this.trackName,d=this.findTrackId(u)||this.findTrackId();d!==-1?this.setAudioTrack(d):(this.warn("No track found for running audio group-ID: "+this.groupId),this.hls.trigger(R.Events.ERROR,{type:M.ErrorTypes.MEDIA_ERROR,details:M.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,fatal:!0}))},t.findTrackId=function(s){for(var u=this.tracksInGroup,d=0;d<u.length;d++){var f=u[d];if((!this.selectDefaultTrack||f.default)&&(!s||s===f.name))return f.id}return-1},t.loadPlaylist=function(s){var u=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(u)){var d=u.id,f=u.groupId,v=u.url;if(s)try{v=s.addDirectives(v)}catch(m){this.warn("Could not construct new URL with HLS Delivery Directives: "+m)}this.log("loading audio-track playlist for id: "+d),this.clearTimer(),this.hls.trigger(R.Events.AUDIO_TRACK_LOADING,{url:v,id:d,groupId:f,deliveryDirectives:s||null})}},i(a,[{key:"audioTracks",get:function(){return this.tracksInGroup}},{key:"audioTrack",get:function(){return this.trackId},set:function(s){this.selectDefaultTrack=!1,this.setAudioTrack(s)}}]),a}(p.default);L.default=h},"./src/controller/base-playlist-controller.ts":function(G,L,I){"use strict";I.r(L),I.d(L,"default",function(){return i});var R=I("./src/polyfills/number.ts"),M=I("./src/types/level.ts"),p=I("./src/controller/level-helper.ts"),E=I("./src/utils/logger.ts"),b=I("./src/errors.ts"),i=function(){function c(h,n){this.hls=void 0,this.timer=-1,this.canLoad=!1,this.retryCount=0,this.log=void 0,this.warn=void 0,this.log=E.logger.log.bind(E.logger,n+":"),this.warn=E.logger.warn.bind(E.logger,n+":"),this.hls=h}var o=c.prototype;return o.destroy=function(){this.clearTimer(),this.hls=this.log=this.warn=null},o.onError=function(n,a){a.fatal&&a.type===b.ErrorTypes.NETWORK_ERROR&&this.clearTimer()},o.clearTimer=function(){clearTimeout(this.timer),this.timer=-1},o.startLoad=function(){this.canLoad=!0,this.retryCount=0,this.loadPlaylist()},o.stopLoad=function(){this.canLoad=!1,this.clearTimer()},o.switchParams=function(n,a){var t=a==null?void 0:a.renditionReports;if(t)for(var r=0;r<t.length;r++){var s=t[r],u=""+s.URI;if(u===n.substr(-u.length)){var d=parseInt(s["LAST-MSN"]),f=parseInt(s["LAST-PART"]);if(a&&this.hls.config.lowLatencyMode){var v=Math.min(a.age-a.partTarget,a.targetduration);f!==void 0&&v>a.partTarget&&(f+=1)}if(Object(R.isFiniteNumber)(d))return new M.HlsUrlParameters(d,Object(R.isFiniteNumber)(f)?f:void 0,M.HlsSkip.No)}}},o.loadPlaylist=function(n){},o.shouldLoadTrack=function(n){return this.canLoad&&n&&!!n.url&&(!n.details||n.details.live)},o.playlistLoaded=function(n,a,t){var r=this,s=a.details,u=a.stats,d=u.loading.end?Math.max(0,self.performance.now()-u.loading.end):0;if(s.advancedDateTime=Date.now()-d,s.live||t!=null&&t.live){if(s.reloaded(t),t&&this.log("live playlist "+n+" "+(s.advanced?"REFRESHED "+s.lastPartSn+"-"+s.lastPartIndex:"MISSED")),t&&s.fragments.length>0&&Object(p.mergeDetails)(t,s),!this.canLoad||!s.live)return;var f,v=void 0,m=void 0;if(s.canBlockReload&&s.endSN&&s.advanced){var S=this.hls.config.lowLatencyMode,C=s.lastPartSn,_=s.endSN,y=s.lastPartIndex,T=y!==-1,O=C===_,g=S?0:y;T?(v=O?_+1:C,m=O?g:y+1):v=_+1;var F=s.age,P=F+s.ageHeader,N=Math.min(P-s.partTarget,s.targetduration*1.5);if(N>0){if(t&&N>t.tuneInGoal)this.warn("CDN Tune-in goal increased from: "+t.tuneInGoal+" to: "+N+" with playlist age: "+s.age),N=0;else{var X=Math.floor(N/s.targetduration);if(v+=X,m!==void 0){var j=Math.round(N%s.targetduration/s.partTarget);m+=j}this.log("CDN Tune-in age: "+s.ageHeader+"s last advanced "+F.toFixed(2)+"s goal: "+N+" skip sn "+X+" to part "+m)}s.tuneInGoal=N}if(f=this.getDeliveryDirectives(s,a.deliveryDirectives,v,m),S||!O){this.loadPlaylist(f);return}}else f=this.getDeliveryDirectives(s,a.deliveryDirectives,v,m);var A=Object(p.computeReloadInterval)(s,u);v!==void 0&&s.canBlockReload&&(A-=s.partTarget||1),this.log("reload live playlist "+n+" in "+Math.round(A)+" ms"),this.timer=self.setTimeout(function(){return r.loadPlaylist(f)},A)}else this.clearTimer()},o.getDeliveryDirectives=function(n,a,t,r){var s=Object(M.getSkipValue)(n,t);return a!=null&&a.skip&&n.deltaUpdateFailed&&(t=a.msn,r=a.part,s=M.HlsSkip.No),new M.HlsUrlParameters(t,r,s)},o.retryLoadingOrFail=function(n){var a=this,t=this.hls.config,r=this.retryCount<t.levelLoadingMaxRetry;if(r){var s;if(this.retryCount++,n.details.indexOf("LoadTimeOut")>-1&&(s=n.context)!==null&&s!==void 0&&s.deliveryDirectives)this.warn("retry playlist loading #"+this.retryCount+' after "'+n.details+'"'),this.loadPlaylist();else{var u=Math.min(Math.pow(2,this.retryCount)*t.levelLoadingRetryDelay,t.levelLoadingMaxRetryTimeout);this.timer=self.setTimeout(function(){return a.loadPlaylist()},u),this.warn("retry playlist loading #"+this.retryCount+" in "+u+' ms after "'+n.details+'"')}}else this.warn('cannot recover from error "'+n.details+'"'),this.clearTimer(),n.fatal=!0;return r},c}()},"./src/controller/base-stream-controller.ts":function(G,L,I){"use strict";I.r(L),I.d(L,"State",function(){return _}),I.d(L,"default",function(){return y});var R=I("./src/polyfills/number.ts"),M=I("./src/task-loop.ts"),p=I("./src/controller/fragment-tracker.ts"),E=I("./src/utils/buffer-helper.ts"),b=I("./src/utils/logger.ts"),i=I("./src/events.ts"),c=I("./src/errors.ts"),o=I("./src/types/transmuxer.ts"),h=I("./src/utils/mp4-tools.ts"),n=I("./src/utils/discontinuities.ts"),a=I("./src/controller/fragment-finders.ts"),t=I("./src/controller/level-helper.ts"),r=I("./src/loader/fragment-loader.ts"),s=I("./src/crypt/decrypter.ts"),u=I("./src/utils/time-ranges.ts"),d=I("./src/types/loader.ts");function f(T,O){for(var g=0;g<O.length;g++){var F=O[g];F.enumerable=F.enumerable||!1,F.configurable=!0,"value"in F&&(F.writable=!0),Object.defineProperty(T,F.key,F)}}function v(T,O,g){return O&&f(T.prototype,O),g&&f(T,g),T}function m(T){if(T===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return T}function S(T,O){T.prototype=Object.create(O.prototype),T.prototype.constructor=T,C(T,O)}function C(T,O){return C=Object.setPrototypeOf||function(F,P){return F.__proto__=P,F},C(T,O)}var _={STOPPED:"STOPPED",IDLE:"IDLE",KEY_LOADING:"KEY_LOADING",FRAG_LOADING:"FRAG_LOADING",FRAG_LOADING_WAITING_RETRY:"FRAG_LOADING_WAITING_RETRY",WAITING_TRACK:"WAITING_TRACK",PARSING:"PARSING",PARSED:"PARSED",BACKTRACKING:"BACKTRACKING",ENDED:"ENDED",ERROR:"ERROR",WAITING_INIT_PTS:"WAITING_INIT_PTS",WAITING_LEVEL:"WAITING_LEVEL"},y=function(T){S(O,T);function O(F,P,N){var X;return X=T.call(this)||this,X.hls=void 0,X.fragPrevious=null,X.fragCurrent=null,X.fragmentTracker=void 0,X.transmuxer=null,X._state=_.STOPPED,X.media=void 0,X.mediaBuffer=void 0,X.config=void 0,X.bitrateTest=!1,X.lastCurrentTime=0,X.nextLoadPosition=0,X.startPosition=0,X.loadedmetadata=!1,X.fragLoadError=0,X.retryDate=0,X.levels=null,X.fragmentLoader=void 0,X.levelLastLoaded=null,X.startFragRequested=!1,X.decrypter=void 0,X.initPTS=[],X.onvseeking=null,X.onvended=null,X.logPrefix="",X.log=void 0,X.warn=void 0,X.logPrefix=N,X.log=b.logger.log.bind(b.logger,N+":"),X.warn=b.logger.warn.bind(b.logger,N+":"),X.hls=F,X.fragmentLoader=new r.default(F.config),X.fragmentTracker=P,X.config=F.config,X.decrypter=new s.default(F,F.config),F.on(i.Events.KEY_LOADED,X.onKeyLoaded,m(X)),X}var g=O.prototype;return g.doTick=function(){this.onTickEnd()},g.onTickEnd=function(){},g.startLoad=function(P){},g.stopLoad=function(){this.fragmentLoader.abort();var P=this.fragCurrent;P&&this.fragmentTracker.removeFragment(P),this.resetTransmuxer(),this.fragCurrent=null,this.fragPrevious=null,this.clearInterval(),this.clearNextTick(),this.state=_.STOPPED},g._streamEnded=function(P,N){var X=this.fragCurrent,j=this.fragmentTracker;if(!N.live&&X&&X.sn===N.endSN&&!P.nextStart){var A=j.getState(X);return A===p.FragmentState.PARTIAL||A===p.FragmentState.OK}return!1},g.onMediaAttached=function(P,N){var X=this.media=this.mediaBuffer=N.media;this.onvseeking=this.onMediaSeeking.bind(this),this.onvended=this.onMediaEnded.bind(this),X.addEventListener("seeking",this.onvseeking),X.addEventListener("ended",this.onvended);var j=this.config;this.levels&&j.autoStartLoad&&this.state===_.STOPPED&&this.startLoad(j.startPosition)},g.onMediaDetaching=function(){var P=this.media;P!=null&&P.ended&&(this.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0),P&&(P.removeEventListener("seeking",this.onvseeking),P.removeEventListener("ended",this.onvended),this.onvseeking=this.onvended=null),this.media=this.mediaBuffer=null,this.loadedmetadata=!1,this.fragmentTracker.removeAllFragments(),this.stopLoad()},g.onMediaSeeking=function(){var P=this.config,N=this.fragCurrent,X=this.media,j=this.mediaBuffer,A=this.state,K=X?X.currentTime:0,U=E.BufferHelper.bufferInfo(j||X,K,P.maxBufferHole);if(this.log("media seeking to "+(Object(R.isFiniteNumber)(K)?K.toFixed(3):K)+", state: "+A),A===_.ENDED)this.resetLoadingState();else if(N&&!U.len){var k=P.maxFragLookUpTolerance,z=N.start-k,te=N.start+N.duration+k,de=K>te;(K<z||de)&&(de&&N.loader&&(this.log("seeking outside of buffer while fragment load in progress, cancel fragment load"),N.loader.abort()),this.resetLoadingState())}X&&(this.lastCurrentTime=K),!this.loadedmetadata&&!U.len&&(this.nextLoadPosition=this.startPosition=K),this.tickImmediate()},g.onMediaEnded=function(){this.startPosition=this.lastCurrentTime=0},g.onKeyLoaded=function(P,N){if(this.state!==_.KEY_LOADING||N.frag!==this.fragCurrent||!this.levels)return;this.state=_.IDLE;var X=this.levels[N.frag.level].details;X&&this.loadFragment(N.frag,X,N.frag.start)},g.onHandlerDestroying=function(){this.stopLoad(),T.prototype.onHandlerDestroying.call(this)},g.onHandlerDestroyed=function(){this.state=_.STOPPED,this.hls.off(i.Events.KEY_LOADED,this.onKeyLoaded,this),this.fragmentLoader&&this.fragmentLoader.destroy(),this.decrypter&&this.decrypter.destroy(),this.hls=this.log=this.warn=this.decrypter=this.fragmentLoader=this.fragmentTracker=null,T.prototype.onHandlerDestroyed.call(this)},g.loadKey=function(P,N){this.log("Loading key for "+P.sn+" of ["+N.startSN+"-"+N.endSN+"], "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+P.level),this.state=_.KEY_LOADING,this.fragCurrent=P,this.hls.trigger(i.Events.KEY_LOADING,{frag:P})},g.loadFragment=function(P,N,X){this._loadFragForPlayback(P,N,X)},g._loadFragForPlayback=function(P,N,X){var j=this,A=function(U){if(j.fragContextChanged(P)){j.warn("Fragment "+P.sn+(U.part?" p: "+U.part.index:"")+" of level "+P.level+" was dropped during download."),j.fragmentTracker.removeFragment(P);return}P.stats.chunkCount++,j._handleFragmentLoadProgress(U)};this._doFragLoad(P,N,X,A).then(function(K){if(!K)return;j.fragLoadError=0;var U=j.state;if(j.fragContextChanged(P)){(U===_.FRAG_LOADING||U===_.BACKTRACKING||!j.fragCurrent&&U===_.PARSING)&&(j.fragmentTracker.removeFragment(P),j.state=_.IDLE);return}if("payload"in K&&(j.log("Loaded fragment "+P.sn+" of level "+P.level),j.hls.trigger(i.Events.FRAG_LOADED,K),j.state===_.BACKTRACKING)){j.fragmentTracker.backtrack(P,K),j.resetFragmentLoading(P);return}j._handleFragmentLoadComplete(K)}).catch(function(K){j.warn(K),j.resetFragmentLoading(P)})},g.flushMainBuffer=function(P,N,X){if(X===void 0&&(X=null),!(P-N))return;var j={startOffset:P,endOffset:N,type:X};this.fragLoadError=0,this.hls.trigger(i.Events.BUFFER_FLUSHING,j)},g._loadInitSegment=function(P){var N=this;this._doFragLoad(P).then(function(X){if(!X||N.fragContextChanged(P)||!N.levels)throw new Error("init load aborted");return X}).then(function(X){var j=N.hls,A=X.payload,K=P.decryptdata;if(A&&A.byteLength>0&&K&&K.key&&K.iv&&K.method==="AES-128"){var U=self.performance.now();return N.decrypter.webCryptoDecrypt(new Uint8Array(A),K.key.buffer,K.iv.buffer).then(function(k){var z=self.performance.now();return j.trigger(i.Events.FRAG_DECRYPTED,{frag:P,payload:k,stats:{tstart:U,tdecrypt:z}}),X.payload=k,X})}return X}).then(function(X){var j=N.fragCurrent,A=N.hls,K=N.levels;if(!K)throw new Error("init load aborted, missing levels");var U=K[P.level].details;console.assert(U,"Level details are defined when init segment is loaded");var k=P.stats;N.state=_.IDLE,N.fragLoadError=0,P.data=new Uint8Array(X.payload),k.parsing.start=k.buffering.start=self.performance.now(),k.parsing.end=k.buffering.end=self.performance.now(),X.frag===j&&A.trigger(i.Events.FRAG_BUFFERED,{stats:k,frag:j,part:null,id:P.type}),N.tick()}).catch(function(X){N.warn(X),N.resetFragmentLoading(P)})},g.fragContextChanged=function(P){var N=this.fragCurrent;return!P||!N||P.level!==N.level||P.sn!==N.sn||P.urlId!==N.urlId},g.fragBufferedComplete=function(P,N){var X=this.mediaBuffer?this.mediaBuffer:this.media;this.log("Buffered "+P.type+" sn: "+P.sn+(N?" part: "+N.index:"")+" of "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+P.level+" "+u.default.toString(E.BufferHelper.getBuffered(X))),this.state=_.IDLE,this.tick()},g._handleFragmentLoadComplete=function(P){var N=this.transmuxer;if(!N)return;var X=P.frag,j=P.part,A=P.partsLoaded,K=!A||A.length===0||A.some(function(k){return!k}),U=new o.ChunkMetadata(X.level,X.sn,X.stats.chunkCount+1,0,j?j.index:-1,!K);N.flush(U)},g._handleFragmentLoadProgress=function(P){},g._doFragLoad=function(P,N,X,j){var A=this;if(X===void 0&&(X=null),!this.levels)throw new Error("frag load aborted, missing levels");if(X=Math.max(P.start,X||0),this.config.lowLatencyMode&&N){var K=N.partList;if(K&&j){X>P.end&&N.fragmentHint&&(P=N.fragmentHint);var U=this.getNextPart(K,P,X);if(U>-1){var k=K[U];return this.log("Loading part sn: "+P.sn+" p: "+k.index+" cc: "+P.cc+" of playlist ["+N.startSN+"-"+N.endSN+"] parts [0-"+U+"-"+(K.length-1)+"] "+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+P.level+", target: "+parseFloat(X.toFixed(3))),this.nextLoadPosition=k.start+k.duration,this.state=_.FRAG_LOADING,this.hls.trigger(i.Events.FRAG_LOADING,{frag:P,part:K[U],targetBufferTime:X}),this.doFragPartsLoad(P,K,U,j).catch(function(z){return A.handleFragLoadError(z)})}else if(!P.url||this.loadedEndOfParts(K,X))return Promise.resolve(null)}}return this.log("Loading fragment "+P.sn+" cc: "+P.cc+" "+(N?"of ["+N.startSN+"-"+N.endSN+"] ":"")+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+P.level+", target: "+parseFloat(X.toFixed(3))),Object(R.isFiniteNumber)(P.sn)&&!this.bitrateTest&&(this.nextLoadPosition=P.start+P.duration),this.state=_.FRAG_LOADING,this.hls.trigger(i.Events.FRAG_LOADING,{frag:P,targetBufferTime:X}),this.fragmentLoader.load(P,j).catch(function(z){return A.handleFragLoadError(z)})},g.doFragPartsLoad=function(P,N,X,j){var A=this;return new Promise(function(K,U){var k=[],z=function te(de){var be=N[de];A.fragmentLoader.loadPart(P,be,j).then(function(We){k[be.index]=We;var Ne=We.part;A.hls.trigger(i.Events.FRAG_LOADED,We);var Le=N[de+1];if(Le&&Le.fragment===P)te(de+1);else return K({frag:P,part:Ne,partsLoaded:k})}).catch(U)};z(X)})},g.handleFragLoadError=function(P){var N=P.data;return N&&N.details===c.ErrorDetails.INTERNAL_ABORTED?this.handleFragLoadAborted(N.frag,N.part):this.hls.trigger(i.Events.ERROR,N),null},g._handleTransmuxerFlush=function(P){var N=this.getCurrentContext(P);if(!N||this.state!==_.PARSING){this.fragCurrent||(this.state=_.IDLE);return}var X=N.frag,j=N.part,A=N.level,K=self.performance.now();X.stats.parsing.end=K,j&&(j.stats.parsing.end=K),this.updateLevelTiming(X,j,A,P.partial)},g.getCurrentContext=function(P){var N=this.levels,X=P.level,j=P.sn,A=P.part;if(!N||!N[X])return this.warn("Levels object was unset while buffering fragment "+j+" of level "+X+". The current chunk will not be buffered."),null;var K=N[X],U=A>-1?Object(t.getPartWith)(K,j,A):null,k=U?U.fragment:Object(t.getFragmentWithSN)(K,j,this.fragCurrent);return k?{frag:k,part:U,level:K}:null},g.bufferFragmentData=function(P,N,X,j){if(!P||this.state!==_.PARSING)return;var A=P.data1,K=P.data2,U=A;if(A&&K&&(U=Object(h.appendUint8Array)(A,K)),!U||!U.length)return;var k={type:P.type,frag:N,part:X,chunkMeta:j,parent:N.type,data:U};this.hls.trigger(i.Events.BUFFER_APPENDING,k),P.dropped&&P.independent&&!X&&this.flushBufferGap(N)},g.flushBufferGap=function(P){var N=this.media;if(!N)return;if(!E.BufferHelper.isBuffered(N,N.currentTime)){this.flushMainBuffer(0,P.start);return}var X=N.currentTime,j=E.BufferHelper.bufferInfo(N,X,0),A=P.duration,K=Math.min(this.config.maxFragLookUpTolerance*2,A*.25),U=Math.max(Math.min(P.start-K,j.end-K),X+K);P.start-U>K&&this.flushMainBuffer(U,P.start)},g.getFwdBufferInfo=function(P,N){var X=this.config,j=this.getLoadPosition();if(!Object(R.isFiniteNumber)(j))return null;var A=E.BufferHelper.bufferInfo(P,j,X.maxBufferHole);if(A.len===0&&A.nextStart!==void 0){var K=this.fragmentTracker.getBufferedFrag(j,N);if(K&&A.nextStart<K.end)return E.BufferHelper.bufferInfo(P,j,Math.max(A.nextStart,X.maxBufferHole))}return A},g.getMaxBufferLength=function(P){var N=this.config,X;return P?X=Math.max(8*N.maxBufferSize/P,N.maxBufferLength):X=N.maxBufferLength,Math.min(X,N.maxMaxBufferLength)},g.reduceMaxBufferLength=function(P){var N=this.config,X=P||N.maxBufferLength;return N.maxMaxBufferLength>=X?(N.maxMaxBufferLength/=2,this.warn("Reduce max buffer length to "+N.maxMaxBufferLength+"s"),!0):!1},g.getNextFragment=function(P,N){var X,j,A=N.fragments,K=A.length;if(!K)return null;var U=this.config,k=A[0].start,z;if(N.live){var te=U.initialLiveManifestSize;if(K<te)return this.warn("Not enough fragments to start playback (have: "+K+", need: "+te+")"),null;!N.PTSKnown&&!this.startFragRequested&&this.startPosition===-1&&(z=this.getInitialLiveFragment(N,A),this.startPosition=z?this.hls.liveSyncPosition||z.start:P)}else P<=k&&(z=A[0]);if(!z){var de=U.lowLatencyMode?N.partEnd:N.fragmentEnd;z=this.getFragmentAtPosition(P,de,N)}return(X=z)!==null&&X!==void 0&&X.initSegment&&!((j=z)!==null&&j!==void 0&&j.initSegment.data)&&!this.bitrateTest&&(z=z.initSegment),z},g.getNextPart=function(P,N,X){for(var j=-1,A=!1,K=!0,U=0,k=P.length;U<k;U++){var z=P[U];if(K=K&&!z.independent,j>-1&&X<z.start)break;var te=z.loaded;!te&&(A||z.independent||K)&&z.fragment===N&&(j=U),A=te}return j},g.loadedEndOfParts=function(P,N){var X=P[P.length-1];return X&&N>X.start&&X.loaded},g.getInitialLiveFragment=function(P,N){var X=this.fragPrevious,j=null;if(X){if(P.hasProgramDateTime&&(this.log("Live playlist, switching playlist, load frag with same PDT: "+X.programDateTime),j=Object(a.findFragmentByPDT)(N,X.endProgramDateTime,this.config.maxFragLookUpTolerance)),!j){var A=X.sn+1;if(A>=P.startSN&&A<=P.endSN){var K=N[A-P.startSN];X.cc===K.cc&&(j=K,this.log("Live playlist, switching playlist, load frag with next SN: "+j.sn))}j||(j=Object(a.findFragWithCC)(N,X.cc),j&&this.log("Live playlist, switching playlist, load frag with same CC: "+j.sn))}}else{var U=this.hls.liveSyncPosition;U!==null&&(j=this.getFragmentAtPosition(U,this.bitrateTest?P.fragmentEnd:P.edge,P))}return j},g.getFragmentAtPosition=function(P,N,X){var j=this.config,A=this.fragPrevious,K=X.fragments,U=X.endSN,k=X.fragmentHint,z=j.maxFragLookUpTolerance,te=!!(j.lowLatencyMode&&X.partList&&k);te&&k&&!this.bitrateTest&&(K=K.concat(k),U=k.sn);var de;if(P<N){var be=P>N-z?0:z;de=Object(a.findFragmentByPTS)(A,K,P,be)}else de=K[K.length-1];if(de){var We=de.sn-X.startSN,Ne=A&&de.level===A.level,Le=K[We+1],Ke=this.fragmentTracker.getState(de);if(Ke===p.FragmentState.BACKTRACKED){de=null;for(var He=We;K[He]&&this.fragmentTracker.getState(K[He])===p.FragmentState.BACKTRACKED;)A?de=K[He--]:de=K[--He];de||(de=Le)}else A&&de.sn===A.sn&&!te&&(Ne&&(de.sn<U&&this.fragmentTracker.getState(Le)!==p.FragmentState.OK?(this.log("SN "+de.sn+" just loaded, load next one: "+Le.sn),de=Le):de=null))}return de},g.synchronizeToLiveEdge=function(P){var N=this.config,X=this.media;if(!X)return;var j=this.hls.liveSyncPosition,A=X.currentTime,K=P.fragments[0].start,U=P.edge,k=A>=K-N.maxFragLookUpTolerance&&A<=U;if(j!==null&&X.duration>j&&(A<j||!k)){var z=N.liveMaxLatencyDuration!==void 0?N.liveMaxLatencyDuration:N.liveMaxLatencyDurationCount*P.targetduration;(!k&&X.readyState<4||A<U-z)&&(this.loadedmetadata||(this.nextLoadPosition=j),X.readyState&&(this.warn("Playback: "+A.toFixed(3)+" is located too far from the end of live sliding playlist: "+U+", reset currentTime to : "+j.toFixed(3)),X.currentTime=j))}},g.alignPlaylists=function(P,N){var X=this.levels,j=this.levelLastLoaded,A=this.fragPrevious,K=j!==null?X[j]:null,U=P.fragments.length;if(!U)return this.warn("No fragments in live playlist"),0;var k=P.fragments[0].start,z=!N,te=P.alignedSliding&&Object(R.isFiniteNumber)(k);if(z||!te&&!k){Object(n.alignStream)(A,K,P);var de=P.fragments[0].start;return this.log("Live playlist sliding: "+de.toFixed(2)+" start-sn: "+(N?N.startSN:"na")+"->"+P.startSN+" prev-sn: "+(A?A.sn:"na")+" fragments: "+U),de}return k},g.waitForCdnTuneIn=function(P){var N=3;return P.live&&P.canBlockReload&&P.tuneInGoal>Math.max(P.partHoldBack,P.partTarget*N)},g.setStartPosition=function(P,N){var X=this.startPosition;if(X<N&&(X=-1),X===-1||this.lastCurrentTime===-1){var j=P.startTimeOffset;Object(R.isFiniteNumber)(j)?(X=N+j,j<0&&(X+=P.totalduration),X=Math.min(Math.max(N,X),N+P.totalduration),this.log("Start time offset "+j+" found in playlist, adjust startPosition to "+X),this.startPosition=X):P.live?X=this.hls.liveSyncPosition||N:this.startPosition=X=0,this.lastCurrentTime=X}this.nextLoadPosition=X},g.getLoadPosition=function(){var P=this.media,N=0;return this.loadedmetadata&&P?N=P.currentTime:this.nextLoadPosition&&(N=this.nextLoadPosition),N},g.handleFragLoadAborted=function(P,N){this.transmuxer&&P.sn!=="initSegment"&&P.stats.aborted&&(this.warn("Fragment "+P.sn+(N?" part"+N.index:"")+" of level "+P.level+" was aborted"),this.resetFragmentLoading(P))},g.resetFragmentLoading=function(P){(!this.fragCurrent||!this.fragContextChanged(P))&&(this.state=_.IDLE)},g.onFragmentOrKeyLoadError=function(P,N){if(N.fatal)return;var X=N.frag;if(!X||X.type!==P)return;var j=this.fragCurrent;console.assert(j&&X.sn===j.sn&&X.level===j.level&&X.urlId===j.urlId,"Frag load error must match current frag to retry");var A=this.config;if(this.fragLoadError+1<=A.fragLoadingMaxRetry){if(this.resetLiveStartWhenNotLoaded(X.level))return;var K=Math.min(Math.pow(2,this.fragLoadError)*A.fragLoadingRetryDelay,A.fragLoadingMaxRetryTimeout);this.warn("Fragment "+X.sn+" of "+P+" "+X.level+" failed to load, retrying in "+K+"ms"),this.retryDate=self.performance.now()+K,this.fragLoadError++,this.state=_.FRAG_LOADING_WAITING_RETRY}else N.levelRetry?(P===d.PlaylistLevelType.AUDIO&&(this.fragCurrent=null),this.fragLoadError=0,this.state=_.IDLE):(b.logger.error(N.details+" reaches max retry, redispatch as fatal ..."),N.fatal=!0,this.hls.stopLoad(),this.state=_.ERROR)},g.afterBufferFlushed=function(P,N,X){if(!P)return;var j=E.BufferHelper.getBuffered(P);this.fragmentTracker.detectEvictedFragments(N,j,X),this.state===_.ENDED&&this.resetLoadingState()},g.resetLoadingState=function(){this.fragCurrent=null,this.fragPrevious=null,this.state=_.IDLE},g.resetLiveStartWhenNotLoaded=function(P){if(!this.loadedmetadata){this.startFragRequested=!1;var N=this.levels?this.levels[P].details:null;if(N!=null&&N.live)return this.startPosition=-1,this.setStartPosition(N,0),this.resetLoadingState(),!0;this.nextLoadPosition=this.startPosition}return!1},g.updateLevelTiming=function(P,N,X,j){var A=this,K=X.details;console.assert(!!K,"level.details must be defined");var U=Object.keys(P.elementaryStreams).reduce(function(k,z){var te=P.elementaryStreams[z];if(te){var de=te.endPTS-te.startPTS;if(de<=0)return A.warn("Could not parse fragment "+P.sn+" "+z+" duration reliably ("+de+") resetting transmuxer to fallback to playlist timing"),A.resetTransmuxer(),k||!1;var be=j?0:Object(t.updateFragPTSDTS)(K,P,te.startPTS,te.endPTS,te.startDTS,te.endDTS);return A.hls.trigger(i.Events.LEVEL_PTS_UPDATED,{details:K,level:X,drift:be,type:z,frag:P,start:te.startPTS,end:te.endPTS}),!0}return k},!1);U?(this.state=_.PARSED,this.hls.trigger(i.Events.FRAG_PARSED,{frag:P,part:N})):this.resetLoadingState()},g.resetTransmuxer=function(){this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null)},v(O,[{key:"state",get:function(){return this._state},set:function(P){var N=this._state;N!==P&&(this._state=P,this.log(N+"->"+P))}}]),O}(M.default)},"./src/controller/buffer-controller.ts":function(G,L,I){"use strict";I.r(L),I.d(L,"default",function(){return a});var R=I("./src/polyfills/number.ts"),M=I("./src/events.ts"),p=I("./src/utils/logger.ts"),E=I("./src/errors.ts"),b=I("./src/utils/buffer-helper.ts"),i=I("./src/utils/mediasource-helper.ts"),c=I("./src/loader/fragment.ts"),o=I("./src/controller/buffer-operation-queue.ts"),h=Object(i.getMediaSource)(),n=/([ha]vc.)(?:\.[^.,]+)+/,a=function(){function t(s){var u=this;this.details=null,this._objectUrl=null,this.operationQueue=void 0,this.listeners=void 0,this.hls=void 0,this.bufferCodecEventsExpected=0,this._bufferCodecEventsTotal=0,this.media=null,this.mediaSource=null,this.appendError=0,this.tracks={},this.pendingTracks={},this.sourceBuffer=void 0,this._onMediaSourceOpen=function(){var d=u.hls,f=u.media,v=u.mediaSource;p.logger.log("[buffer-controller]: Media source opened"),f&&(u.updateMediaElementDuration(),d.trigger(M.Events.MEDIA_ATTACHED,{media:f})),v&&v.removeEventListener("sourceopen",u._onMediaSourceOpen),u.checkPendingTracks()},this._onMediaSourceClose=function(){p.logger.log("[buffer-controller]: Media source closed")},this._onMediaSourceEnded=function(){p.logger.log("[buffer-controller]: Media source ended")},this.hls=s,this._initSourceBuffer(),this.registerListeners()}var r=t.prototype;return r.hasSourceTypes=function(){return this.getSourceBufferTypes().length>0||Object.keys(this.pendingTracks).length>0},r.destroy=function(){this.unregisterListeners(),this.details=null},r.registerListeners=function(){var u=this.hls;u.on(M.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),u.on(M.Events.MEDIA_DETACHING,this.onMediaDetaching,this),u.on(M.Events.MANIFEST_PARSED,this.onManifestParsed,this),u.on(M.Events.BUFFER_RESET,this.onBufferReset,this),u.on(M.Events.BUFFER_APPENDING,this.onBufferAppending,this),u.on(M.Events.BUFFER_CODECS,this.onBufferCodecs,this),u.on(M.Events.BUFFER_EOS,this.onBufferEos,this),u.on(M.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),u.on(M.Events.LEVEL_UPDATED,this.onLevelUpdated,this),u.on(M.Events.FRAG_PARSED,this.onFragParsed,this),u.on(M.Events.FRAG_CHANGED,this.onFragChanged,this)},r.unregisterListeners=function(){var u=this.hls;u.off(M.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),u.off(M.Events.MEDIA_DETACHING,this.onMediaDetaching,this),u.off(M.Events.MANIFEST_PARSED,this.onManifestParsed,this),u.off(M.Events.BUFFER_RESET,this.onBufferReset,this),u.off(M.Events.BUFFER_APPENDING,this.onBufferAppending,this),u.off(M.Events.BUFFER_CODECS,this.onBufferCodecs,this),u.off(M.Events.BUFFER_EOS,this.onBufferEos,this),u.off(M.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),u.off(M.Events.LEVEL_UPDATED,this.onLevelUpdated,this),u.off(M.Events.FRAG_PARSED,this.onFragParsed,this),u.off(M.Events.FRAG_CHANGED,this.onFragChanged,this)},r._initSourceBuffer=function(){this.sourceBuffer={},this.operationQueue=new o.default(this.sourceBuffer),this.listeners={audio:[],video:[],audiovideo:[]}},r.onManifestParsed=function(u,d){var f=2;(d.audio&&!d.video||!d.altAudio)&&(f=1),this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=f,this.details=null,p.logger.log(this.bufferCodecEventsExpected+" bufferCodec event(s) expected")},r.onMediaAttaching=function(u,d){var f=this.media=d.media;if(f&&h){var v=this.mediaSource=new h;v.addEventListener("sourceopen",this._onMediaSourceOpen),v.addEventListener("sourceended",this._onMediaSourceEnded),v.addEventListener("sourceclose",this._onMediaSourceClose),f.src=self.URL.createObjectURL(v),this._objectUrl=f.src}},r.onMediaDetaching=function(){var u=this.media,d=this.mediaSource,f=this._objectUrl;if(d){if(p.logger.log("[buffer-controller]: media source detaching"),d.readyState==="open")try{d.endOfStream()}catch(v){p.logger.warn("[buffer-controller]: onMediaDetaching: "+v.message+" while calling endOfStream")}this.onBufferReset(),d.removeEventListener("sourceopen",this._onMediaSourceOpen),d.removeEventListener("sourceended",this._onMediaSourceEnded),d.removeEventListener("sourceclose",this._onMediaSourceClose),u&&(f&&self.URL.revokeObjectURL(f),u.src===f?(u.removeAttribute("src"),u.load()):p.logger.warn("[buffer-controller]: media.src was changed by a third party - skip cleanup")),this.mediaSource=null,this.media=null,this._objectUrl=null,this.bufferCodecEventsExpected=this._bufferCodecEventsTotal,this.pendingTracks={},this.tracks={}}this.hls.trigger(M.Events.MEDIA_DETACHED,void 0)},r.onBufferReset=function(){var u=this;this.getSourceBufferTypes().forEach(function(d){var f=u.sourceBuffer[d];try{f&&(u.removeBufferListeners(d),u.mediaSource&&u.mediaSource.removeSourceBuffer(f),u.sourceBuffer[d]=void 0)}catch(v){p.logger.warn("[buffer-controller]: Failed to reset the "+d+" buffer",v)}}),this._initSourceBuffer()},r.onBufferCodecs=function(u,d){var f=this,v=this.getSourceBufferTypes().length;if(Object.keys(d).forEach(function(m){if(v){var S=f.tracks[m];if(S&&typeof S.buffer.changeType=="function"){var C=d[m],_=C.codec,y=C.levelCodec,T=C.container,O=(S.levelCodec||S.codec).replace(n,"$1"),g=(y||_).replace(n,"$1");if(O!==g){var F=T+";codecs="+(y||_);f.appendChangeType(m,F)}}}else f.pendingTracks[m]=d[m]}),v)return;this.bufferCodecEventsExpected=Math.max(this.bufferCodecEventsExpected-1,0),this.mediaSource&&this.mediaSource.readyState==="open"&&this.checkPendingTracks()},r.appendChangeType=function(u,d){var f=this,v=this.operationQueue,m={execute:function(){var C=f.sourceBuffer[u];C&&(p.logger.log("[buffer-controller]: changing "+u+" sourceBuffer type to "+d),C.changeType(d)),v.shiftAndExecuteNext(u)},onStart:function(){},onComplete:function(){},onError:function(C){p.logger.warn("[buffer-controller]: Failed to change "+u+" SourceBuffer type",C)}};v.append(m,u)},r.onBufferAppending=function(u,d){var f=this,v=this.hls,m=this.operationQueue,S=this.tracks,C=d.data,_=d.type,y=d.frag,T=d.part,O=d.chunkMeta,g=O.buffering[_],F=self.performance.now();g.start=F;var P=y.stats.buffering,N=T?T.stats.buffering:null;P.start===0&&(P.start=F),N&&N.start===0&&(N.start=F);var X=S.audio,j=_==="audio"&&O.id===1&&(X==null?void 0:X.container)==="audio/mpeg",A={execute:function(){if(g.executeStart=self.performance.now(),j){var U=f.sourceBuffer[_];if(U){var k=y.start-U.timestampOffset;Math.abs(k)>=.1&&(p.logger.log("[buffer-controller]: Updating audio SourceBuffer timestampOffset to "+y.start+" (delta: "+k+") sn: "+y.sn+")"),U.timestampOffset=y.start)}}f.appendExecutor(C,_)},onStart:function(){},onComplete:function(){var U=self.performance.now();g.executeEnd=g.end=U,P.first===0&&(P.first=U),N&&N.first===0&&(N.first=U);var k=f.sourceBuffer,z={};for(var te in k)z[te]=b.BufferHelper.getBuffered(k[te]);f.appendError=0,f.hls.trigger(M.Events.BUFFER_APPENDED,{type:_,frag:y,part:T,chunkMeta:O,parent:y.type,timeRanges:z})},onError:function(U){p.logger.error("[buffer-controller]: Error encountered while trying to append to the "+_+" SourceBuffer",U);var k={type:E.ErrorTypes.MEDIA_ERROR,parent:y.type,details:E.ErrorDetails.BUFFER_APPEND_ERROR,err:U,fatal:!1};U.code===DOMException.QUOTA_EXCEEDED_ERR?k.details=E.ErrorDetails.BUFFER_FULL_ERROR:(f.appendError++,k.details=E.ErrorDetails.BUFFER_APPEND_ERROR,f.appendError>v.config.appendErrorMaxRetry&&(p.logger.error("[buffer-controller]: Failed "+v.config.appendErrorMaxRetry+" times to append segment in sourceBuffer"),k.fatal=!0)),v.trigger(M.Events.ERROR,k)}};m.append(A,_)},r.onBufferFlushing=function(u,d){var f=this,v=this.operationQueue,m=function(C){return{execute:f.removeExecutor.bind(f,C,d.startOffset,d.endOffset),onStart:function(){},onComplete:function(){f.hls.trigger(M.Events.BUFFER_FLUSHED,{type:C})},onError:function(y){p.logger.warn("[buffer-controller]: Failed to remove from "+C+" SourceBuffer",y)}}};d.type?v.append(m(d.type),d.type):this.getSourceBufferTypes().forEach(function(S){v.append(m(S),S)})},r.onFragParsed=function(u,d){var f=this,v=d.frag,m=d.part,S=[],C=m?m.elementaryStreams:v.elementaryStreams;C[c.ElementaryStreamTypes.AUDIOVIDEO]?S.push("audiovideo"):(C[c.ElementaryStreamTypes.AUDIO]&&S.push("audio"),C[c.ElementaryStreamTypes.VIDEO]&&S.push("video"));var _=function(){var T=self.performance.now();v.stats.buffering.end=T,m&&(m.stats.buffering.end=T);var O=m?m.stats:v.stats;f.hls.trigger(M.Events.FRAG_BUFFERED,{frag:v,part:m,stats:O,id:v.type})};S.length===0&&p.logger.warn("Fragments must have at least one ElementaryStreamType set. type: "+v.type+" level: "+v.level+" sn: "+v.sn),this.blockBuffers(_,S)},r.onFragChanged=function(u,d){this.flushBackBuffer()},r.onBufferEos=function(u,d){var f=this,v=this.getSourceBufferTypes().reduce(function(m,S){var C=f.sourceBuffer[S];return(!d.type||d.type===S)&&(C&&!C.ended&&(C.ended=!0,p.logger.log("[buffer-controller]: "+S+" sourceBuffer now EOS"))),m&&!!(!C||C.ended)},!0);v&&this.blockBuffers(function(){var m=f.mediaSource;if(!m||m.readyState!=="open")return;m.endOfStream()})},r.onLevelUpdated=function(u,d){var f=d.details;if(!f.fragments.length)return;this.details=f,this.getSourceBufferTypes().length?this.blockBuffers(this.updateMediaElementDuration.bind(this)):this.updateMediaElementDuration()},r.flushBackBuffer=function(){var u=this.hls,d=this.details,f=this.media,v=this.sourceBuffer;if(!f||d===null)return;var m=this.getSourceBufferTypes();if(!m.length)return;var S=d.live&&u.config.liveBackBufferLength!==null?u.config.liveBackBufferLength:u.config.backBufferLength;if(!Object(R.isFiniteNumber)(S)||S<0)return;var C=f.currentTime,_=d.levelTargetDuration,y=Math.max(S,_),T=Math.floor(C/_)*_-y;m.forEach(function(O){var g=v[O];if(g){var F=b.BufferHelper.getBuffered(g);F.length>0&&T>F.start(0)&&(u.trigger(M.Events.BACK_BUFFER_REACHED,{bufferEnd:T}),d.live&&u.trigger(M.Events.LIVE_BACK_BUFFER_REACHED,{bufferEnd:T}),u.trigger(M.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:T,type:O}))}})},r.updateMediaElementDuration=function(){if(!this.details||!this.media||!this.mediaSource||this.mediaSource.readyState!=="open")return;var u=this.details,d=this.hls,f=this.media,v=this.mediaSource,m=u.fragments[0].start+u.totalduration,S=f.duration,C=Object(R.isFiniteNumber)(v.duration)?v.duration:0;u.live&&d.config.liveDurationInfinity?(p.logger.log("[buffer-controller]: Media Source duration is set to Infinity"),v.duration=Infinity,this.updateSeekableRange(u)):(m>C&&m>S||!Object(R.isFiniteNumber)(S))&&(p.logger.log("[buffer-controller]: Updating Media Source duration to "+m.toFixed(3)),v.duration=m)},r.updateSeekableRange=function(u){var d=this.mediaSource,f=u.fragments,v=f.length;if(v&&u.live&&d!==null&&d!==void 0&&d.setLiveSeekableRange){var m=Math.max(0,f[0].start),S=Math.max(m,m+u.totalduration);d.setLiveSeekableRange(m,S)}},r.checkPendingTracks=function(){var u=this.bufferCodecEventsExpected,d=this.operationQueue,f=this.pendingTracks,v=Object.keys(f).length;if(v&&!u||v===2){this.createSourceBuffers(f),this.pendingTracks={};var m=this.getSourceBufferTypes();if(m.length===0){this.hls.trigger(M.Events.ERROR,{type:E.ErrorTypes.MEDIA_ERROR,details:E.ErrorDetails.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,reason:"could not create source buffer for media codec(s)"});return}m.forEach(function(S){d.executeNext(S)})}},r.createSourceBuffers=function(u){var d=this.sourceBuffer,f=this.mediaSource;if(!f)throw Error("createSourceBuffers called when mediaSource was null");var v=0;for(var m in u)if(!d[m]){var S=u[m];if(!S)throw Error("source buffer exists for track "+m+", however track does not");var C=S.levelCodec||S.codec,_=S.container+";codecs="+C;p.logger.log("[buffer-controller]: creating sourceBuffer("+_+")");try{var y=d[m]=f.addSourceBuffer(_),T=m;this.addBufferListener(T,"updatestart",this._onSBUpdateStart),this.addBufferListener(T,"updateend",this._onSBUpdateEnd),this.addBufferListener(T,"error",this._onSBUpdateError),this.tracks[m]={buffer:y,codec:C,container:S.container,levelCodec:S.levelCodec,id:S.id},v++}catch(O){p.logger.error("[buffer-controller]: error while trying to add sourceBuffer: "+O.message),this.hls.trigger(M.Events.ERROR,{type:E.ErrorTypes.MEDIA_ERROR,details:E.ErrorDetails.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:O,mimeType:_})}}v&&this.hls.trigger(M.Events.BUFFER_CREATED,{tracks:this.tracks})},r._onSBUpdateStart=function(u){var d=this.operationQueue,f=d.current(u);f.onStart()},r._onSBUpdateEnd=function(u){var d=this.operationQueue,f=d.current(u);f.onComplete(),d.shiftAndExecuteNext(u)},r._onSBUpdateError=function(u,d){p.logger.error("[buffer-controller]: "+u+" SourceBuffer error",d),this.hls.trigger(M.Events.ERROR,{type:E.ErrorTypes.MEDIA_ERROR,details:E.ErrorDetails.BUFFER_APPENDING_ERROR,fatal:!1});var f=this.operationQueue.current(u);f&&f.onError(d)},r.removeExecutor=function(u,d,f){var v=this.media,m=this.mediaSource,S=this.operationQueue,C=this.sourceBuffer,_=C[u];if(!v||!m||!_){p.logger.warn("[buffer-controller]: Attempting to remove from the "+u+" SourceBuffer, but it does not exist"),S.shiftAndExecuteNext(u);return}var y=Object(R.isFiniteNumber)(v.duration)?v.duration:Infinity,T=Object(R.isFiniteNumber)(m.duration)?m.duration:Infinity,O=Math.max(0,d),g=Math.min(f,y,T);g>O?(p.logger.log("[buffer-controller]: Removing ["+O+","+g+"] from the "+u+" SourceBuffer"),console.assert(!_.updating,u+" sourceBuffer must not be updating"),_.remove(O,g)):S.shiftAndExecuteNext(u)},r.appendExecutor=function(u,d){var f=this.operationQueue,v=this.sourceBuffer,m=v[d];if(!m){p.logger.warn("[buffer-controller]: Attempting to append to the "+d+" SourceBuffer, but it does not exist"),f.shiftAndExecuteNext(d);return}m.ended=!1,console.assert(!m.updating,d+" sourceBuffer must not be updating"),m.appendBuffer(u)},r.blockBuffers=function(u,d){var f=this;if(d===void 0&&(d=this.getSourceBufferTypes()),!d.length){p.logger.log("[buffer-controller]: Blocking operation requested, but no SourceBuffers exist"),Promise.resolve(u);return}var v=this.operationQueue,m=d.map(function(S){return v.appendBlocker(S)});Promise.all(m).then(function(){u(),d.forEach(function(S){var C=f.sourceBuffer[S];(!C||!C.updating)&&v.shiftAndExecuteNext(S)})})},r.getSourceBufferTypes=function(){return Object.keys(this.sourceBuffer)},r.addBufferListener=function(u,d,f){var v=this.sourceBuffer[u];if(!v)return;var m=f.bind(this,u);this.listeners[u].push({event:d,listener:m}),v.addEventListener(d,m)},r.removeBufferListeners=function(u){var d=this.sourceBuffer[u];if(!d)return;this.listeners[u].forEach(function(f){d.removeEventListener(f.event,f.listener)})},t}()},"./src/controller/buffer-operation-queue.ts":function(G,L,I){"use strict";I.r(L),I.d(L,"default",function(){return M});var R=I("./src/utils/logger.ts"),M=function(){function p(b){this.buffers=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.buffers=b}var E=p.prototype;return E.append=function(i,c){var o=this.queues[c];o.push(i),o.length===1&&this.buffers[c]&&this.executeNext(c)},E.insertAbort=function(i,c){var o=this.queues[c];o.unshift(i),this.executeNext(c)},E.appendBlocker=function(i){var c,o=new Promise(function(n){c=n}),h={execute:c,onStart:function(){},onComplete:function(){},onError:function(){}};return this.append(h,i),o},E.executeNext=function(i){var c=this.buffers,o=this.queues,h=c[i],n=o[i];if(n.length){var a=n[0];try{a.execute()}catch(t){R.logger.warn("[buffer-operation-queue]: Unhandled exception executing the current operation"),a.onError(t),(!h||!h.updating)&&(n.shift(),this.executeNext(i))}}},E.shiftAndExecuteNext=function(i){this.queues[i].shift(),this.executeNext(i)},E.current=function(i){return this.queues[i][0]},p}()},"./src/controller/cap-level-controller.ts":function(G,L,I){"use strict";I.r(L);var R=I("./src/events.ts");function M(b,i){for(var c=0;c<i.length;c++){var o=i[c];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(b,o.key,o)}}function p(b,i,c){return i&&M(b.prototype,i),c&&M(b,c),b}var E=function(){function b(c){this.autoLevelCapping=void 0,this.firstLevel=void 0,this.media=void 0,this.restrictedLevels=void 0,this.timer=void 0,this.hls=void 0,this.streamController=void 0,this.clientRect=void 0,this.hls=c,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.firstLevel=-1,this.media=null,this.restrictedLevels=[],this.timer=void 0,this.clientRect=null,this.registerListeners()}var i=b.prototype;return i.setStreamController=function(o){this.streamController=o},i.destroy=function(){this.unregisterListener(),this.hls.config.capLevelToPlayerSize&&this.stopCapping(),this.media=null,this.clientRect=null,this.hls=this.streamController=null},i.registerListeners=function(){var o=this.hls;o.on(R.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),o.on(R.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),o.on(R.Events.MANIFEST_PARSED,this.onManifestParsed,this),o.on(R.Events.BUFFER_CODECS,this.onBufferCodecs,this),o.on(R.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},i.unregisterListener=function(){var o=this.hls;o.off(R.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),o.off(R.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),o.off(R.Events.MANIFEST_PARSED,this.onManifestParsed,this),o.off(R.Events.BUFFER_CODECS,this.onBufferCodecs,this),o.off(R.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},i.onFpsDropLevelCapping=function(o,h){b.isLevelAllowed(h.droppedLevel,this.restrictedLevels)&&this.restrictedLevels.push(h.droppedLevel)},i.onMediaAttaching=function(o,h){this.media=h.media instanceof HTMLVideoElement?h.media:null},i.onManifestParsed=function(o,h){var n=this.hls;this.restrictedLevels=[],this.firstLevel=h.firstLevel,n.config.capLevelToPlayerSize&&h.video&&this.startCapping()},i.onBufferCodecs=function(o,h){var n=this.hls;n.config.capLevelToPlayerSize&&h.video&&this.startCapping()},i.onMediaDetaching=function(){this.stopCapping()},i.detectPlayerSize=function(){if(this.media&&this.mediaHeight>0&&this.mediaWidth>0){var o=this.hls.levels;if(o.length){var h=this.hls;h.autoLevelCapping=this.getMaxLevel(o.length-1),h.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=h.autoLevelCapping}}},i.getMaxLevel=function(o){var h=this,n=this.hls.levels;if(!n.length)return-1;var a=n.filter(function(t,r){return b.isLevelAllowed(r,h.restrictedLevels)&&r<=o});return this.clientRect=null,b.getMaxLevelByMediaSize(a,this.mediaWidth,this.mediaHeight)},i.startCapping=function(){if(this.timer)return;this.autoLevelCapping=Number.POSITIVE_INFINITY,this.hls.firstLevel=this.getMaxLevel(this.firstLevel),self.clearInterval(this.timer),this.timer=self.setInterval(this.detectPlayerSize.bind(this),1e3),this.detectPlayerSize()},i.stopCapping=function(){this.restrictedLevels=[],this.firstLevel=-1,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.timer&&(self.clearInterval(this.timer),this.timer=void 0)},i.getDimensions=function(){if(this.clientRect)return this.clientRect;var o=this.media,h={width:0,height:0};if(o){var n=o.getBoundingClientRect();h.width=n.width,h.height=n.height,!h.width&&!h.height&&(h.width=n.right-n.left||o.width||0,h.height=n.bottom-n.top||o.height||0)}return this.clientRect=h,h},b.isLevelAllowed=function(o,h){return h===void 0&&(h=[]),h.indexOf(o)===-1},b.getMaxLevelByMediaSize=function(o,h,n){if(!o||!o.length)return-1;for(var a=function(d,f){return f?d.width!==f.width||d.height!==f.height:!0},t=o.length-1,r=0;r<o.length;r+=1){var s=o[r];if((s.width>=h||s.height>=n)&&a(s,o[r+1])){t=r;break}}return t},p(b,[{key:"mediaWidth",get:function(){return this.getDimensions().width*b.contentScaleFactor}},{key:"mediaHeight",get:function(){return this.getDimensions().height*b.contentScaleFactor}}],[{key:"contentScaleFactor",get:function(){var o=1;try{o=self.devicePixelRatio}catch(h){}return o}}]),b}();L.default=E},"./src/controller/cmcd-controller.ts":function(G,L,I){"use strict";I.r(L),I.d(L,"default",function(){return a});var R=I("./src/events.ts"),M=I("./src/types/cmcd.ts"),p=I("./src/utils/buffer-helper.ts"),E=I("./src/utils/logger.ts");function b(t,r){for(var s=0;s<r.length;s++){var u=r[s];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(t,u.key,u)}}function i(t,r,s){return r&&b(t.prototype,r),s&&b(t,s),t}function c(t,r){var s=typeof Symbol!="undefined"&&t[Symbol.iterator]||t["@@iterator"];if(s)return(s=s.call(t)).next.bind(s);if(Array.isArray(t)||(s=o(t))||r&&t&&typeof t.length=="number"){s&&(t=s);var u=0;return function(){return u>=t.length?{done:!0}:{done:!1,value:t[u++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function o(t,r){if(!t)return;if(typeof t=="string")return h(t,r);var s=Object.prototype.toString.call(t).slice(8,-1);if(s==="Object"&&t.constructor&&(s=t.constructor.name),s==="Map"||s==="Set")return Array.from(t);if(s==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(s))return h(t,r)}function h(t,r){(r==null||r>t.length)&&(r=t.length);for(var s=0,u=new Array(r);s<r;s++)u[s]=t[s];return u}function n(){return n=Object.assign||function(t){for(var r=1;r<arguments.length;r++){var s=arguments[r];for(var u in s)Object.prototype.hasOwnProperty.call(s,u)&&(t[u]=s[u])}return t},n.apply(this,arguments)}var a=function(){function t(s){var u=this;this.hls=void 0,this.config=void 0,this.media=void 0,this.sid=void 0,this.cid=void 0,this.useHeaders=!1,this.initialized=!1,this.starved=!1,this.buffering=!0,this.audioBuffer=void 0,this.videoBuffer=void 0,this.onWaiting=function(){u.initialized&&(u.starved=!0),u.buffering=!0},this.onPlaying=function(){u.initialized||(u.initialized=!0),u.buffering=!1},this.applyPlaylistData=function(v){try{u.apply(v,{ot:M.CMCDObjectType.MANIFEST,su:!u.initialized})}catch(m){E.logger.warn("Could not generate manifest CMCD data.",m)}},this.applyFragmentData=function(v){try{var m=v.frag,S=u.hls.levels[m.level],C=u.getObjectType(m),_={d:m.duration*1e3,ot:C};(C===M.CMCDObjectType.VIDEO||C===M.CMCDObjectType.AUDIO||C==M.CMCDObjectType.MUXED)&&(_.br=S.bitrate/1e3,_.tb=u.getTopBandwidth(C),_.bl=u.getBufferLength(C)),u.apply(v,_)}catch(y){E.logger.warn("Could not generate segment CMCD data.",y)}},this.hls=s;var d=this.config=s.config,f=d.cmcd;f!=null&&(d.pLoader=this.createPlaylistLoader(),d.fLoader=this.createFragmentLoader(),this.sid=f.sessionId||t.uuid(),this.cid=f.contentId,this.useHeaders=f.useHeaders===!0,this.registerListeners())}var r=t.prototype;return r.registerListeners=function(){var u=this.hls;u.on(R.Events.MEDIA_ATTACHED,this.onMediaAttached,this),u.on(R.Events.MEDIA_DETACHED,this.onMediaDetached,this),u.on(R.Events.BUFFER_CREATED,this.onBufferCreated,this)},r.unregisterListeners=function(){var u=this.hls;u.off(R.Events.MEDIA_ATTACHED,this.onMediaAttached,this),u.off(R.Events.MEDIA_DETACHED,this.onMediaDetached,this),u.off(R.Events.BUFFER_CREATED,this.onBufferCreated,this),this.onMediaDetached()},r.destroy=function(){this.unregisterListeners(),this.hls=this.config=this.audioBuffer=this.videoBuffer=null},r.onMediaAttached=function(u,d){this.media=d.media,this.media.addEventListener("waiting",this.onWaiting),this.media.addEventListener("playing",this.onPlaying)},r.onMediaDetached=function(){if(!this.media)return;this.media.removeEventListener("waiting",this.onWaiting),this.media.removeEventListener("playing",this.onPlaying),this.media=null},r.onBufferCreated=function(u,d){var f,v;this.audioBuffer=(f=d.tracks.audio)===null||f===void 0?void 0:f.buffer,this.videoBuffer=(v=d.tracks.video)===null||v===void 0?void 0:v.buffer},r.createData=function(){var u;return{v:M.CMCDVersion,sf:M.CMCDStreamingFormat.HLS,sid:this.sid,cid:this.cid,pr:(u=this.media)===null||u===void 0?void 0:u.playbackRate,mtp:this.hls.bandwidthEstimate/1e3}},r.apply=function(u,d){d===void 0&&(d={}),n(d,this.createData());var f=d.ot===M.CMCDObjectType.INIT||d.ot===M.CMCDObjectType.VIDEO||d.ot===M.CMCDObjectType.MUXED;if(this.starved&&f&&(d.bs=!0,d.su=!0,this.starved=!1),d.su==null&&(d.su=this.buffering),this.useHeaders){var v=t.toHeaders(d);if(!Object.keys(v).length)return;u.headers||(u.headers={}),n(u.headers,v)}else{var m=t.toQuery(d);if(!m)return;u.url=t.appendQueryToUri(u.url,m)}},r.getObjectType=function(u){var d=u.type;return d==="subtitle"?M.CMCDObjectType.TIMED_TEXT:u.sn==="initSegment"?M.CMCDObjectType.INIT:d==="audio"?M.CMCDObjectType.AUDIO:d==="main"?this.hls.audioTracks.length?M.CMCDObjectType.VIDEO:M.CMCDObjectType.MUXED:void 0},r.getTopBandwidth=function(u){for(var d=0,f=u===M.CMCDObjectType.AUDIO?this.hls.audioTracks:this.hls.levels,v=c(f),m;!(m=v()).done;){var S=m.value;S.bitrate>d&&(d=S.bitrate)}return d>0?d:NaN},r.getBufferLength=function(u){var d=this.hls.media,f=u===M.CMCDObjectType.AUDIO?this.audioBuffer:this.videoBuffer;if(!f||!d)return NaN;var v=p.BufferHelper.bufferInfo(f,d.currentTime,this.config.maxBufferHole);return v.len*1e3},r.createPlaylistLoader=function(){var u=this.config.pLoader,d=this.applyPlaylistData,f=u||this.config.loader;return function(){function v(S){this.loader=void 0,this.loader=new f(S)}var m=v.prototype;return m.destroy=function(){this.loader.destroy()},m.abort=function(){this.loader.abort()},m.load=function(C,_,y){d(C),this.loader.load(C,_,y)},i(v,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),v}()},r.createFragmentLoader=function(){var u=this.config.fLoader,d=this.applyFragmentData,f=u||this.config.loader;return function(){function v(S){this.loader=void 0,this.loader=new f(S)}var m=v.prototype;return m.destroy=function(){this.loader.destroy()},m.abort=function(){this.loader.abort()},m.load=function(C,_,y){d(C),this.loader.load(C,_,y)},i(v,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),v}()},t.uuid=function(){var u=URL.createObjectURL(new Blob),d=u.toString();return URL.revokeObjectURL(u),d.substr(d.lastIndexOf("/")+1)},t.serialize=function(u){for(var d=[],f=function(j){return!Number.isNaN(j)&&j!=null&&j!==""&&j!==!1},v=function(j){return Math.round(j)},m=function(j){return v(j/100)*100},S=function(j){return encodeURIComponent(j)},C={br:v,d:v,bl:m,dl:m,mtp:m,nor:S,rtp:m,tb:v},_=Object.keys(u||{}).sort(),y=c(_),T;!(T=y()).done;){var O=T.value,g=u[O];if(!f(g))continue;if(O==="v"&&g===1)continue;if(O=="pr"&&g===1)continue;var F=C[O];F&&(g=F(g));var P=typeof g,N=void 0;O==="ot"||O==="sf"||O==="st"?N=O+"="+g:P==="boolean"?N=O:P==="number"?N=O+"="+g:N=O+"="+JSON.stringify(g),d.push(N)}return d.join(",")},t.toHeaders=function(u){for(var d=Object.keys(u),f={},v=["Object","Request","Session","Status"],m=[{},{},{},{}],S={br:0,d:0,ot:0,tb:0,bl:1,dl:1,mtp:1,nor:1,nrr:1,su:1,cid:2,pr:2,sf:2,sid:2,st:2,v:2,bs:3,rtp:3},C=0,_=d;C<_.length;C++){var y=_[C],T=S[y]!=null?S[y]:1;m[T][y]=u[y]}for(var O=0;O<m.length;O++){var g=t.serialize(m[O]);g&&(f["CMCD-"+v[O]]=g)}return f},t.toQuery=function(u){return"CMCD="+encodeURIComponent(t.serialize(u))},t.appendQueryToUri=function(u,d){if(!d)return u;var f=u.includes("?")?"&":"?";return""+u+f+d},t}()},"./src/controller/eme-controller.ts":function(G,L,I){"use strict";I.r(L);var R=I("./src/events.ts"),M=I("./src/errors.ts"),p=I("./src/utils/logger.ts"),E=I("./src/utils/mediakeys-helper.ts");function b(a,t){for(var r=0;r<t.length;r++){var s=t[r];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(a,s.key,s)}}function i(a,t,r){return t&&b(a.prototype,t),r&&b(a,r),a}var c=3,o=function(t,r,s){var u={audioCapabilities:[],videoCapabilities:[]};return t.forEach(function(d){u.audioCapabilities.push({contentType:'audio/mp4; codecs="'+d+'"',robustness:s.audioRobustness||""})}),r.forEach(function(d){u.videoCapabilities.push({contentType:'video/mp4; codecs="'+d+'"',robustness:s.videoRobustness||""})}),[u]},h=function(t,r,s,u){switch(t){case E.KeySystems.WIDEVINE:return o(r,s,u);default:throw new Error("Unknown key-system: "+t)}},n=function(){function a(r){this.hls=void 0,this._widevineLicenseUrl=void 0,this._licenseXhrSetup=void 0,this._licenseResponseCallback=void 0,this._emeEnabled=void 0,this._requestMediaKeySystemAccess=void 0,this._drmSystemOptions=void 0,this._config=void 0,this._mediaKeysList=[],this._media=null,this._hasSetMediaKeys=!1,this._requestLicenseFailureCount=0,this.mediaKeysPromise=null,this._onMediaEncrypted=this.onMediaEncrypted.bind(this),this.hls=r,this._config=r.config,this._widevineLicenseUrl=this._config.widevineLicenseUrl,this._licenseXhrSetup=this._config.licenseXhrSetup,this._licenseResponseCallback=this._config.licenseResponseCallback,this._emeEnabled=this._config.emeEnabled,this._requestMediaKeySystemAccess=this._config.requestMediaKeySystemAccessFunc,this._drmSystemOptions=this._config.drmSystemOptions,this._registerListeners()}var t=a.prototype;return t.destroy=function(){this._unregisterListeners(),this.hls=this._onMediaEncrypted=null,this._requestMediaKeySystemAccess=null},t._registerListeners=function(){this.hls.on(R.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(R.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.on(R.Events.MANIFEST_PARSED,this.onManifestParsed,this)},t._unregisterListeners=function(){this.hls.off(R.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(R.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.off(R.Events.MANIFEST_PARSED,this.onManifestParsed,this)},t.getLicenseServerUrl=function(s){switch(s){case E.KeySystems.WIDEVINE:if(!this._widevineLicenseUrl)break;return this._widevineLicenseUrl}throw new Error('no license server URL configured for key-system "'+s+'"')},t._attemptKeySystemAccess=function(s,u,d){var f=this,v=h(s,u,d,this._drmSystemOptions);p.logger.log("Requesting encrypted media key-system access");var m=this.requestMediaKeySystemAccess(s,v);this.mediaKeysPromise=m.then(function(S){return f._onMediaKeySystemAccessObtained(s,S)}),m.catch(function(S){p.logger.error('Failed to obtain key-system "'+s+'" access:',S)})},t._onMediaKeySystemAccessObtained=function(s,u){var d=this;p.logger.log('Access for key-system "'+s+'" obtained');var f={mediaKeysSessionInitialized:!1,mediaKeySystemAccess:u,mediaKeySystemDomain:s};this._mediaKeysList.push(f);var v=Promise.resolve().then(function(){return u.createMediaKeys()}).then(function(m){return f.mediaKeys=m,p.logger.log('Media-keys created for key-system "'+s+'"'),d._onMediaKeysCreated(),m});return v.catch(function(m){p.logger.error("Failed to create media-keys:",m)}),v},t._onMediaKeysCreated=function(){var s=this;this._mediaKeysList.forEach(function(u){u.mediaKeysSession||(u.mediaKeysSession=u.mediaKeys.createSession(),s._onNewMediaKeySession(u.mediaKeysSession))})},t._onNewMediaKeySession=function(s){var u=this;p.logger.log("New key-system session "+s.sessionId),s.addEventListener("message",function(d){u._onKeySessionMessage(s,d.message)},!1)},t._onKeySessionMessage=function(s,u){p.logger.log("Got EME message event, creating license request"),this._requestLicense(u,function(d){p.logger.log("Received license data (length: "+(d&&d.byteLength)+"), updating key-session"),s.update(d)})},t.onMediaEncrypted=function(s){var u=this;if(p.logger.log('Media is encrypted using "'+s.initDataType+'" init data type'),!this.mediaKeysPromise){p.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been requested"),this.hls.trigger(R.Events.ERROR,{type:M.ErrorTypes.KEY_SYSTEM_ERROR,details:M.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}var d=function(v){if(!u._media)return;u._attemptSetMediaKeys(v),u._generateRequestWithPreferredKeySession(s.initDataType,s.initData)};this.mediaKeysPromise.then(d).catch(d)},t._attemptSetMediaKeys=function(s){if(!this._media)throw new Error("Attempted to set mediaKeys without first attaching a media element");if(!this._hasSetMediaKeys){var u=this._mediaKeysList[0];if(!u||!u.mediaKeys){p.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been obtained yet"),this.hls.trigger(R.Events.ERROR,{type:M.ErrorTypes.KEY_SYSTEM_ERROR,details:M.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}p.logger.log("Setting keys for encrypted media"),this._media.setMediaKeys(u.mediaKeys),this._hasSetMediaKeys=!0}},t._generateRequestWithPreferredKeySession=function(s,u){var d=this,f=this._mediaKeysList[0];if(!f){p.logger.error("Fatal: Media is encrypted but not any key-system access has been obtained yet"),this.hls.trigger(R.Events.ERROR,{type:M.ErrorTypes.KEY_SYSTEM_ERROR,details:M.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}if(f.mediaKeysSessionInitialized){p.logger.warn("Key-Session already initialized but requested again");return}var v=f.mediaKeysSession;if(!v){p.logger.error("Fatal: Media is encrypted but no key-session existing"),this.hls.trigger(R.Events.ERROR,{type:M.ErrorTypes.KEY_SYSTEM_ERROR,details:M.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!0});return}if(!u){p.logger.warn("Fatal: initData required for generating a key session is null"),this.hls.trigger(R.Events.ERROR,{type:M.ErrorTypes.KEY_SYSTEM_ERROR,details:M.ErrorDetails.KEY_SYSTEM_NO_INIT_DATA,fatal:!0});return}p.logger.log('Generating key-session request for "'+s+'" init data type'),f.mediaKeysSessionInitialized=!0,v.generateRequest(s,u).then(function(){p.logger.debug("Key-session generation succeeded")}).catch(function(m){p.logger.error("Error generating key-session request:",m),d.hls.trigger(R.Events.ERROR,{type:M.ErrorTypes.KEY_SYSTEM_ERROR,details:M.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!1})})},t._createLicenseXhr=function(s,u,d){var f=new XMLHttpRequest;f.responseType="arraybuffer",f.onreadystatechange=this._onLicenseRequestReadyStageChange.bind(this,f,s,u,d);var v=this._licenseXhrSetup;if(v)try{v.call(this.hls,f,s),v=void 0}catch(m){p.logger.error(m)}try{f.readyState||f.open("POST",s,!0),v&&v.call(this.hls,f,s)}catch(m){throw new Error("issue setting up KeySystem license XHR "+m)}return f},t._onLicenseRequestReadyStageChange=function(s,u,d,f){switch(s.readyState){case 4:if(s.status===200){this._requestLicenseFailureCount=0,p.logger.log("License request succeeded");var v=s.response,m=this._licenseResponseCallback;if(m)try{v=m.call(this.hls,s,u)}catch(C){p.logger.error(C)}f(v)}else{if(p.logger.error("License Request XHR failed ("+u+"). Status: "+s.status+" ("+s.statusText+")"),this._requestLicenseFailureCount++,this._requestLicenseFailureCount>c){this.hls.trigger(R.Events.ERROR,{type:M.ErrorTypes.KEY_SYSTEM_ERROR,details:M.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0});return}var S=c-this._requestLicenseFailureCount+1;p.logger.warn("Retrying license request, "+S+" attempts left"),this._requestLicense(d,f)}break}},t._generateLicenseRequestChallenge=function(s,u){switch(s.mediaKeySystemDomain){case E.KeySystems.WIDEVINE:return u}throw new Error("unsupported key-system: "+s.mediaKeySystemDomain)},t._requestLicense=function(s,u){p.logger.log("Requesting content license for key-system");var d=this._mediaKeysList[0];if(!d){p.logger.error("Fatal error: Media is encrypted but no key-system access has been obtained yet"),this.hls.trigger(R.Events.ERROR,{type:M.ErrorTypes.KEY_SYSTEM_ERROR,details:M.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}try{var f=this.getLicenseServerUrl(d.mediaKeySystemDomain),v=this._createLicenseXhr(f,s,u);p.logger.log("Sending license request to URL: "+f);var m=this._generateLicenseRequestChallenge(d,s);v.send(m)}catch(S){p.logger.error("Failure requesting DRM license: "+S),this.hls.trigger(R.Events.ERROR,{type:M.ErrorTypes.KEY_SYSTEM_ERROR,details:M.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0})}},t.onMediaAttached=function(s,u){if(!this._emeEnabled)return;var d=u.media;this._media=d,d.addEventListener("encrypted",this._onMediaEncrypted)},t.onMediaDetached=function(){var s=this._media,u=this._mediaKeysList;if(!s)return;s.removeEventListener("encrypted",this._onMediaEncrypted),this._media=null,this._mediaKeysList=[],Promise.all(u.map(function(d){if(d.mediaKeysSession)return d.mediaKeysSession.close().catch(function(){})})).then(function(){return s.setMediaKeys(null)}).catch(function(){})},t.onManifestParsed=function(s,u){if(!this._emeEnabled)return;var d=u.levels.map(function(v){return v.audioCodec}).filter(function(v){return!!v}),f=u.levels.map(function(v){return v.videoCodec}).filter(function(v){return!!v});this._attemptKeySystemAccess(E.KeySystems.WIDEVINE,d,f)},i(a,[{key:"requestMediaKeySystemAccess",get:function(){if(!this._requestMediaKeySystemAccess)throw new Error("No requestMediaKeySystemAccess function configured");return this._requestMediaKeySystemAccess}}]),a}();L.default=n},"./src/controller/fps-controller.ts":function(G,L,I){"use strict";I.r(L);var R=I("./src/events.ts"),M=I("./src/utils/logger.ts"),p=function(){function E(i){this.hls=void 0,this.isVideoPlaybackQualityAvailable=!1,this.timer=void 0,this.media=null,this.lastTime=void 0,this.lastDroppedFrames=0,this.lastDecodedFrames=0,this.streamController=void 0,this.hls=i,this.registerListeners()}var b=E.prototype;return b.setStreamController=function(c){this.streamController=c},b.registerListeners=function(){this.hls.on(R.Events.MEDIA_ATTACHING,this.onMediaAttaching,this)},b.unregisterListeners=function(){this.hls.off(R.Events.MEDIA_ATTACHING,this.onMediaAttaching)},b.destroy=function(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null},b.onMediaAttaching=function(c,o){var h=this.hls.config;if(h.capLevelOnFPSDrop){var n=o.media instanceof self.HTMLVideoElement?o.media:null;this.media=n,n&&typeof n.getVideoPlaybackQuality=="function"&&(this.isVideoPlaybackQualityAvailable=!0),self.clearInterval(this.timer),this.timer=self.setInterval(this.checkFPSInterval.bind(this),h.fpsDroppedMonitoringPeriod)}},b.checkFPS=function(c,o,h){var n=performance.now();if(o){if(this.lastTime){var a=n-this.lastTime,t=h-this.lastDroppedFrames,r=o-this.lastDecodedFrames,s=1e3*t/a,u=this.hls;if(u.trigger(R.Events.FPS_DROP,{currentDropped:t,currentDecoded:r,totalDroppedFrames:h}),s>0&&t>u.config.fpsDroppedMonitoringThreshold*r){var d=u.currentLevel;M.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+d),d>0&&(u.autoLevelCapping===-1||u.autoLevelCapping>=d)&&(d=d-1,u.trigger(R.Events.FPS_DROP_LEVEL_CAPPING,{level:d,droppedLevel:u.currentLevel}),u.autoLevelCapping=d,this.streamController.nextLevelSwitch())}}this.lastTime=n,this.lastDroppedFrames=h,this.lastDecodedFrames=o}},b.checkFPSInterval=function(){var c=this.media;if(c)if(this.isVideoPlaybackQualityAvailable){var o=c.getVideoPlaybackQuality();this.checkFPS(c,o.totalVideoFrames,o.droppedVideoFrames)}else this.checkFPS(c,c.webkitDecodedFrameCount,c.webkitDroppedFrameCount)},E}();L.default=p},"./src/controller/fragment-finders.ts":function(G,L,I){"use strict";I.r(L),I.d(L,"findFragmentByPDT",function(){return p}),I.d(L,"findFragmentByPTS",function(){return E}),I.d(L,"fragmentWithinToleranceTest",function(){return b}),I.d(L,"pdtWithinToleranceTest",function(){return i}),I.d(L,"findFragWithCC",function(){return c});var R=I("./src/polyfills/number.ts"),M=I("./src/utils/binary-search.ts");function p(o,h,n){if(h===null||!Array.isArray(o)||!o.length||!Object(R.isFiniteNumber)(h))return null;var a=o[0].programDateTime;if(h<(a||0))return null;var t=o[o.length-1].endProgramDateTime;if(h>=(t||0))return null;n=n||0;for(var r=0;r<o.length;++r){var s=o[r];if(i(h,n,s))return s}return null}function E(o,h,n,a){n===void 0&&(n=0),a===void 0&&(a=0);var t=null;if(o?t=h[o.sn-h[0].sn+1]||null:n===0&&h[0].start===0&&(t=h[0]),t&&b(n,a,t)===0)return t;var r=M.default.search(h,b.bind(null,n,a));return r||t}function b(o,h,n){o===void 0&&(o=0),h===void 0&&(h=0);var a=Math.min(h,n.duration+(n.deltaPTS?n.deltaPTS:0));return n.start+n.duration-a<=o?1:n.start-a>o&&n.start?-1:0}function i(o,h,n){var a=Math.min(h,n.duration+(n.deltaPTS?n.deltaPTS:0))*1e3,t=n.endProgramDateTime||0;return t-a>o}function c(o,h){return M.default.search(o,function(n){return n.cc<h?1:n.cc>h?-1:0})}},"./src/controller/fragment-tracker.ts":function(G,L,I){"use strict";I.r(L),I.d(L,"FragmentState",function(){return p}),I.d(L,"FragmentTracker",function(){return E});var R=I("./src/events.ts"),M=I("./src/types/loader.ts"),p;(function(c){c.NOT_LOADED="NOT_LOADED",c.BACKTRACKED="BACKTRACKED",c.APPENDING="APPENDING",c.PARTIAL="PARTIAL",c.OK="OK"})(p||(p={}));var E=function(){function c(h){this.activeFragment=null,this.activeParts=null,this.fragments=Object.create(null),this.timeRanges=Object.create(null),this.bufferPadding=.2,this.hls=void 0,this.hls=h,this._registerListeners()}var o=c.prototype;return o._registerListeners=function(){var n=this.hls;n.on(R.Events.BUFFER_APPENDED,this.onBufferAppended,this),n.on(R.Events.FRAG_BUFFERED,this.onFragBuffered,this),n.on(R.Events.FRAG_LOADED,this.onFragLoaded,this)},o._unregisterListeners=function(){var n=this.hls;n.off(R.Events.BUFFER_APPENDED,this.onBufferAppended,this),n.off(R.Events.FRAG_BUFFERED,this.onFragBuffered,this),n.off(R.Events.FRAG_LOADED,this.onFragLoaded,this)},o.destroy=function(){this._unregisterListeners(),this.fragments=this.timeRanges=null},o.getAppendedFrag=function(n,a){if(a===M.PlaylistLevelType.MAIN){var t=this.activeFragment,r=this.activeParts;if(!t)return null;if(r)for(var s=r.length;s--;){var u=r[s],d=u?u.end:t.appendedPTS;if(u.start<=n&&d!==void 0&&n<=d)return s>9&&(this.activeParts=r.slice(s-9)),u}else if(t.start<=n&&t.appendedPTS!==void 0&&n<=t.appendedPTS)return t}return this.getBufferedFrag(n,a)},o.getBufferedFrag=function(n,a){for(var t=this.fragments,r=Object.keys(t),s=r.length;s--;){var u=t[r[s]];if((u==null?void 0:u.body.type)===a&&u.buffered){var d=u.body;if(d.start<=n&&n<=d.end)return d}}return null},o.detectEvictedFragments=function(n,a,t){var r=this;Object.keys(this.fragments).forEach(function(s){var u=r.fragments[s];if(!u)return;if(!u.buffered){u.body.type===t&&r.removeFragment(u.body);return}var d=u.range[n];if(!d)return;d.time.some(function(f){var v=!r.isTimeBuffered(f.startPTS,f.endPTS,a);return v&&r.removeFragment(u.body),v})})},o.detectPartialFragments=function(n){var a=this,t=this.timeRanges,r=n.frag,s=n.part;if(!t||r.sn==="initSegment")return;var u=i(r),d=this.fragments[u];if(!d)return;Object.keys(t).forEach(function(f){var v=r.elementaryStreams[f];if(!v)return;var m=t[f],S=s!==null||v.partial===!0;d.range[f]=a.getBufferedTimes(r,s,S,m)}),d.backtrack=d.loaded=null,Object.keys(d.range).length?d.buffered=!0:this.removeFragment(d.body)},o.fragBuffered=function(n){var a=i(n),t=this.fragments[a];t&&(t.backtrack=t.loaded=null,t.buffered=!0)},o.getBufferedTimes=function(n,a,t,r){for(var s={time:[],partial:t},u=a?a.start:n.start,d=a?a.end:n.end,f=n.minEndPTS||d,v=n.maxStartPTS||u,m=0;m<r.length;m++){var S=r.start(m)-this.bufferPadding,C=r.end(m)+this.bufferPadding;if(v>=S&&f<=C){s.time.push({startPTS:Math.max(u,r.start(m)),endPTS:Math.min(d,r.end(m))});break}else if(u<C&&d>S)s.partial=!0,s.time.push({startPTS:Math.max(u,r.start(m)),endPTS:Math.min(d,r.end(m))});else if(d<=S)break}return s},o.getPartialFragment=function(n){var a=null,t,r,s,u=0,d=this.bufferPadding,f=this.fragments;return Object.keys(f).forEach(function(v){var m=f[v];if(!m)return;b(m)&&(r=m.body.start-d,s=m.body.end+d,n>=r&&n<=s&&(t=Math.min(n-r,s-n),u<=t&&(a=m.body,u=t)))}),a},o.getState=function(n){var a=i(n),t=this.fragments[a];return t?t.buffered?b(t)?p.PARTIAL:p.OK:t.backtrack?p.BACKTRACKED:p.APPENDING:p.NOT_LOADED},o.backtrack=function(n,a){var t=i(n),r=this.fragments[t];if(!r||r.backtrack)return null;var s=r.backtrack=a||r.loaded;return r.loaded=null,s},o.getBacktrackData=function(n){var a=i(n),t=this.fragments[a];if(t){var r,s=t.backtrack;if(s!=null&&(r=s.payload)!==null&&r!==void 0&&r.byteLength)return s;this.removeFragment(n)}return null},o.isTimeBuffered=function(n,a,t){for(var r,s,u=0;u<t.length;u++){if(r=t.start(u)-this.bufferPadding,s=t.end(u)+this.bufferPadding,n>=r&&a<=s)return!0;if(a<=r)return!1}return!1},o.onFragLoaded=function(n,a){var t=a.frag,r=a.part;if(t.sn==="initSegment"||t.bitrateTest||r)return;var s=i(t);this.fragments[s]={body:t,loaded:a,backtrack:null,buffered:!1,range:Object.create(null)}},o.onBufferAppended=function(n,a){var t=this,r=a.frag,s=a.part,u=a.timeRanges;if(r.type===M.PlaylistLevelType.MAIN)if(this.activeFragment=r,s){var d=this.activeParts;d||(this.activeParts=d=[]),d.push(s)}else this.activeParts=null;this.timeRanges=u,Object.keys(u).forEach(function(f){var v=u[f];if(t.detectEvictedFragments(f,v),!s)for(var m=0;m<v.length;m++)r.appendedPTS=Math.max(v.end(m),r.appendedPTS||0)})},o.onFragBuffered=function(n,a){this.detectPartialFragments(a)},o.hasFragment=function(n){var a=i(n);return!!this.fragments[a]},o.removeFragmentsInRange=function(n,a,t){var r=this;Object.keys(this.fragments).forEach(function(s){var u=r.fragments[s];if(!u)return;if(u.buffered){var d=u.body;d.type===t&&d.start<a&&d.end>n&&r.removeFragment(d)}})},o.removeFragment=function(n){var a=i(n);n.stats.loaded=0,n.clearElementaryStreamInfo(),delete this.fragments[a]},o.removeAllFragments=function(){this.fragments=Object.create(null),this.activeFragment=null,this.activeParts=null},c}();function b(c){var o,h;return c.buffered&&(((o=c.range.video)===null||o===void 0?void 0:o.partial)||((h=c.range.audio)===null||h===void 0?void 0:h.partial))}function i(c){return c.type+"_"+c.level+"_"+c.urlId+"_"+c.sn}},"./src/controller/gap-controller.ts":function(G,L,I){"use strict";I.r(L),I.d(L,"STALL_MINIMUM_DURATION_MS",function(){return b}),I.d(L,"MAX_START_GAP_JUMP",function(){return i}),I.d(L,"SKIP_BUFFER_HOLE_STEP_SECONDS",function(){return c}),I.d(L,"SKIP_BUFFER_RANGE_START",function(){return o}),I.d(L,"default",function(){return h});var R=I("./src/utils/buffer-helper.ts"),M=I("./src/errors.ts"),p=I("./src/events.ts"),E=I("./src/utils/logger.ts"),b=250,i=2,c=.1,o=.05,h=function(){function n(t,r,s,u){this.config=void 0,this.media=void 0,this.fragmentTracker=void 0,this.hls=void 0,this.nudgeRetry=0,this.stallReported=!1,this.stalled=null,this.moved=!1,this.seeking=!1,this.config=t,this.media=r,this.fragmentTracker=s,this.hls=u}var a=n.prototype;return a.destroy=function(){this.hls=this.fragmentTracker=this.media=null},a.poll=function(r){var s=this.config,u=this.media,d=this.stalled,f=u.currentTime,v=u.seeking,m=this.seeking&&!v,S=!this.seeking&&v;if(this.seeking=v,f!==r){if(this.moved=!0,d!==null){if(this.stallReported){var C=self.performance.now()-d;E.logger.warn("playback not stuck anymore @"+f+", after "+Math.round(C)+"ms"),this.stallReported=!1}this.stalled=null,this.nudgeRetry=0}return}if((S||m)&&(this.stalled=null),u.paused||u.ended||u.playbackRate===0||!R.BufferHelper.getBuffered(u).length)return;var _=R.BufferHelper.bufferInfo(u,f,0),y=_.len>0,T=_.nextStart||0;if(!y&&!T)return;if(v){var O=_.len>i,g=!T||T-f>i&&!this.fragmentTracker.getPartialFragment(f);if(O||g)return;this.moved=!1}if(!this.moved&&this.stalled!==null){var F,P=Math.max(T,_.start||0)-f,N=this.hls.levels?this.hls.levels[this.hls.currentLevel]:null,X=N==null||((F=N.details)===null||F===void 0)?void 0:F.live,j=X?N.details.targetduration*2:i;if(P>0&&P<=j){this._trySkipBufferHole(null);return}}var A=self.performance.now();if(d===null){this.stalled=A;return}var K=A-d;!v&&K>=b&&this._reportStall(_.len);var U=R.BufferHelper.bufferInfo(u,f,s.maxBufferHole);this._tryFixBufferStall(U,K)},a._tryFixBufferStall=function(r,s){var u=this.config,d=this.fragmentTracker,f=this.media,v=f.currentTime,m=d.getPartialFragment(v);if(m){var S=this._trySkipBufferHole(m);if(S)return}r.len>u.maxBufferHole&&s>u.highBufferWatchdogPeriod*1e3&&(E.logger.warn("Trying to nudge playhead over buffer-hole"),this.stalled=null,this._tryNudgeBuffer())},a._reportStall=function(r){var s=this.hls,u=this.media,d=this.stallReported;d||(this.stallReported=!0,E.logger.warn("Playback stalling at @"+u.currentTime+" due to low buffer (buffer="+r+")"),s.trigger(p.Events.ERROR,{type:M.ErrorTypes.MEDIA_ERROR,details:M.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!1,buffer:r}))},a._trySkipBufferHole=function(r){for(var s=this.config,u=this.hls,d=this.media,f=d.currentTime,v=0,m=R.BufferHelper.getBuffered(d),S=0;S<m.length;S++){var C=m.start(S);if(f+s.maxBufferHole>=v&&f<C){var _=Math.max(C+o,d.currentTime+c);return E.logger.warn("skipping hole, adjusting currentTime from "+f+" to "+_),this.moved=!0,this.stalled=null,d.currentTime=_,r&&u.trigger(p.Events.ERROR,{type:M.ErrorTypes.MEDIA_ERROR,details:M.ErrorDetails.BUFFER_SEEK_OVER_HOLE,fatal:!1,reason:"fragment loaded with buffer holes, seeking from "+f+" to "+_,frag:r}),_}v=m.end(S)}return 0},a._tryNudgeBuffer=function(){var r=this.config,s=this.hls,u=this.media,d=u.currentTime,f=(this.nudgeRetry||0)+1;if(this.nudgeRetry=f,f<r.nudgeMaxRetry){var v=d+f*r.nudgeOffset;E.logger.warn("Nudging 'currentTime' from "+d+" to "+v),u.currentTime=v,s.trigger(p.Events.ERROR,{type:M.ErrorTypes.MEDIA_ERROR,details:M.ErrorDetails.BUFFER_NUDGE_ON_STALL,fatal:!1})}else E.logger.error("Playhead still not moving while enough data buffered @"+d+" after "+r.nudgeMaxRetry+" nudges"),s.trigger(p.Events.ERROR,{type:M.ErrorTypes.MEDIA_ERROR,details:M.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!0})},n}()},"./src/controller/id3-track-controller.ts":function(G,L,I){"use strict";I.r(L);var R=I("./src/events.ts"),M=I("./src/utils/texttrack-utils.ts"),p=I("./src/demux/id3.ts"),E=.25,b=function(){function i(o){this.hls=void 0,this.id3Track=null,this.media=null,this.hls=o,this._registerListeners()}var c=i.prototype;return c.destroy=function(){this._unregisterListeners()},c._registerListeners=function(){var h=this.hls;h.on(R.Events.MEDIA_ATTACHED,this.onMediaAttached,this),h.on(R.Events.MEDIA_DETACHING,this.onMediaDetaching,this),h.on(R.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),h.on(R.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},c._unregisterListeners=function(){var h=this.hls;h.off(R.Events.MEDIA_ATTACHED,this.onMediaAttached,this),h.off(R.Events.MEDIA_DETACHING,this.onMediaDetaching,this),h.off(R.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),h.off(R.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},c.onMediaAttached=function(h,n){this.media=n.media},c.onMediaDetaching=function(){if(!this.id3Track)return;Object(M.clearCurrentCues)(this.id3Track),this.id3Track=null,this.media=null},c.getID3Track=function(h){if(!this.media)return;for(var n=0;n<h.length;n++){var a=h[n];if(a.kind==="metadata"&&a.label==="id3")return Object(M.sendAddTrackEvent)(a,this.media),a}return this.media.addTextTrack("metadata","id3")},c.onFragParsingMetadata=function(h,n){if(!this.media)return;var a=n.frag,t=n.samples;this.id3Track||(this.id3Track=this.getID3Track(this.media.textTracks),this.id3Track.mode="hidden");for(var r=self.WebKitDataCue||self.VTTCue||self.TextTrackCue,s=0;s<t.length;s++){var u=p.getID3Frames(t[s].data);if(u){var d=t[s].pts,f=s<t.length-1?t[s+1].pts:a.end,v=f-d;v<=0&&(f=d+E);for(var m=0;m<u.length;m++){var S=u[m];if(!p.isTimeStampFrame(S)){var C=new r(d,f,"");C.value=S,this.id3Track.addCue(C)}}}}},c.onBufferFlushing=function(h,n){var a=n.startOffset,t=n.endOffset,r=n.type;if(!r||r==="audio"){var s=this.id3Track;s&&Object(M.removeCuesInRange)(s,a,t)}},i}();L.default=b},"./src/controller/latency-controller.ts":function(G,L,I){"use strict";I.r(L),I.d(L,"default",function(){return i});var R=I("./src/errors.ts"),M=I("./src/events.ts"),p=I("./src/utils/logger.ts");function E(c,o){for(var h=0;h<o.length;h++){var n=o[h];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(c,n.key,n)}}function b(c,o,h){return o&&E(c.prototype,o),h&&E(c,h),c}var i=function(){function c(h){var n=this;this.hls=void 0,this.config=void 0,this.media=null,this.levelDetails=null,this.currentTime=0,this.stallCount=0,this._latency=null,this.timeupdateHandler=function(){return n.timeupdate()},this.hls=h,this.config=h.config,this.registerListeners()}var o=c.prototype;return o.destroy=function(){this.unregisterListeners(),this.onMediaDetaching(),this.levelDetails=null,this.hls=this.timeupdateHandler=null},o.registerListeners=function(){this.hls.on(M.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(M.Events.MEDIA_DETACHING,this.onMediaDetaching,this),this.hls.on(M.Events.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(M.Events.LEVEL_UPDATED,this.onLevelUpdated,this),this.hls.on(M.Events.ERROR,this.onError,this)},o.unregisterListeners=function(){this.hls.off(M.Events.MEDIA_ATTACHED,this.onMediaAttached),this.hls.off(M.Events.MEDIA_DETACHING,this.onMediaDetaching),this.hls.off(M.Events.MANIFEST_LOADING,this.onManifestLoading),this.hls.off(M.Events.LEVEL_UPDATED,this.onLevelUpdated),this.hls.off(M.Events.ERROR,this.onError)},o.onMediaAttached=function(n,a){this.media=a.media,this.media.addEventListener("timeupdate",this.timeupdateHandler)},o.onMediaDetaching=function(){this.media&&(this.media.removeEventListener("timeupdate",this.timeupdateHandler),this.media=null)},o.onManifestLoading=function(){this.levelDetails=null,this._latency=null,this.stallCount=0},o.onLevelUpdated=function(n,a){var t=a.details;this.levelDetails=t,t.advanced&&this.timeupdate(),!t.live&&this.media&&this.media.removeEventListener("timeupdate",this.timeupdateHandler)},o.onError=function(n,a){if(a.details!==R.ErrorDetails.BUFFER_STALLED_ERROR)return;this.stallCount++,p.logger.warn("[playback-rate-controller]: Stall detected, adjusting target latency")},o.timeupdate=function(){var n=this.media,a=this.levelDetails;if(!n||!a)return;this.currentTime=n.currentTime;var t=this.computeLatency();if(t===null)return;this._latency=t;var r=this.config,s=r.lowLatencyMode,u=r.maxLiveSyncPlaybackRate;if(!s||u===1)return;var d=this.targetLatency;if(d===null)return;var f=t-d,v=Math.min(this.maxLatency,d+a.targetduration),m=f<v;if(a.live&&m&&f>.05&&this.forwardBufferLength>1){var S=Math.min(2,Math.max(1,u)),C=Math.round(2/(1+Math.exp(-.75*f-this.edgeStalled))*20)/20;n.playbackRate=Math.min(S,Math.max(1,C))}else n.playbackRate!==1&&n.playbackRate!==0&&(n.playbackRate=1)},o.estimateLiveEdge=function(){var n=this.levelDetails;return n===null?null:n.edge+n.age},o.computeLatency=function(){var n=this.estimateLiveEdge();return n===null?null:n-this.currentTime},b(c,[{key:"latency",get:function(){return this._latency||0}},{key:"maxLatency",get:function(){var n=this.config,a=this.levelDetails;return n.liveMaxLatencyDuration!==void 0?n.liveMaxLatencyDuration:a?n.liveMaxLatencyDurationCount*a.targetduration:0}},{key:"targetLatency",get:function(){var n=this.levelDetails;if(n===null)return null;var a=n.holdBack,t=n.partHoldBack,r=n.targetduration,s=this.config,u=s.liveSyncDuration,d=s.liveSyncDurationCount,f=s.lowLatencyMode,v=this.hls.userConfig,m=f&&t||a;(v.liveSyncDuration||v.liveSyncDurationCount||m===0)&&(m=u!==void 0?u:d*r);var S=r,C=1;return m+Math.min(this.stallCount*C,S)}},{key:"liveSyncPosition",get:function(){var n=this.estimateLiveEdge(),a=this.targetLatency,t=this.levelDetails;if(n===null||a===null||t===null)return null;var r=t.edge,s=n-a-this.edgeStalled,u=r-t.totalduration,d=r-(this.config.lowLatencyMode&&t.partTarget||t.targetduration);return Math.min(Math.max(u,s),d)}},{key:"drift",get:function(){var n=this.levelDetails;return n===null?1:n.drift}},{key:"edgeStalled",get:function(){var n=this.levelDetails;if(n===null)return 0;var a=(this.config.lowLatencyMode&&n.partTarget||n.targetduration)*3;return Math.max(n.age-a,0)}},{key:"forwardBufferLength",get:function(){var n=this.media,a=this.levelDetails;if(!n||!a)return 0;var t=n.buffered.length;return t?n.buffered.end(t-1):a.edge-this.currentTime}}]),c}()},"./src/controller/level-controller.ts":function(G,L,I){"use strict";I.r(L),I.d(L,"default",function(){return s});var R=I("./src/types/level.ts"),M=I("./src/events.ts"),p=I("./src/errors.ts"),E=I("./src/utils/codecs.ts"),b=I("./src/controller/level-helper.ts"),i=I("./src/controller/base-playlist-controller.ts"),c=I("./src/types/loader.ts");function o(){return o=Object.assign||function(u){for(var d=1;d<arguments.length;d++){var f=arguments[d];for(var v in f)Object.prototype.hasOwnProperty.call(f,v)&&(u[v]=f[v])}return u},o.apply(this,arguments)}function h(u,d){for(var f=0;f<d.length;f++){var v=d[f];v.enumerable=v.enumerable||!1,v.configurable=!0,"value"in v&&(v.writable=!0),Object.defineProperty(u,v.key,v)}}function n(u,d,f){return d&&h(u.prototype,d),f&&h(u,f),u}function a(u,d){u.prototype=Object.create(d.prototype),u.prototype.constructor=u,t(u,d)}function t(u,d){return t=Object.setPrototypeOf||function(v,m){return v.__proto__=m,v},t(u,d)}var r=/chrome|firefox/.test(navigator.userAgent.toLowerCase()),s=function(u){a(d,u);function d(v){var m;return m=u.call(this,v,"[level-controller]")||this,m._levels=[],m._firstLevel=-1,m._startLevel=void 0,m.currentLevelIndex=-1,m.manualLevelIndex=-1,m.onParsedComplete=void 0,m._registerListeners(),m}var f=d.prototype;return f._registerListeners=function(){var m=this.hls;m.on(M.Events.MANIFEST_LOADED,this.onManifestLoaded,this),m.on(M.Events.LEVEL_LOADED,this.onLevelLoaded,this),m.on(M.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),m.on(M.Events.FRAG_LOADED,this.onFragLoaded,this),m.on(M.Events.ERROR,this.onError,this)},f._unregisterListeners=function(){var m=this.hls;m.off(M.Events.MANIFEST_LOADED,this.onManifestLoaded,this),m.off(M.Events.LEVEL_LOADED,this.onLevelLoaded,this),m.off(M.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),m.off(M.Events.FRAG_LOADED,this.onFragLoaded,this),m.off(M.Events.ERROR,this.onError,this)},f.destroy=function(){this._unregisterListeners(),this.manualLevelIndex=-1,this._levels.length=0,u.prototype.destroy.call(this)},f.startLoad=function(){var m=this._levels;m.forEach(function(S){S.loadError=0}),u.prototype.startLoad.call(this)},f.onManifestLoaded=function(m,S){var C=[],_=[],y=[],T,O={},g,F=!1,P=!1,N=!1;if(S.levels.forEach(function(K){var U=K.attrs;F=F||!!(K.width&&K.height),P=P||!!K.videoCodec,N=N||!!K.audioCodec,r&&K.audioCodec&&K.audioCodec.indexOf("mp4a.40.34")!==-1&&(K.audioCodec=void 0);var k=K.bitrate+"-"+K.attrs.RESOLUTION+"-"+K.attrs.CODECS;g=O[k],g?g.url.push(K.url):(g=new R.Level(K),O[k]=g,C.push(g)),U&&(U.AUDIO&&Object(b.addGroupId)(g,"audio",U.AUDIO),U.SUBTITLES&&Object(b.addGroupId)(g,"text",U.SUBTITLES))}),(F||P)&&N&&(C=C.filter(function(K){var U=K.videoCodec,k=K.width,z=K.height;return!!U||!!(k&&z)})),C=C.filter(function(K){var U=K.audioCodec,k=K.videoCodec;return(!U||Object(E.isCodecSupportedInMp4)(U,"audio"))&&(!k||Object(E.isCodecSupportedInMp4)(k,"video"))}),S.audioTracks&&(_=S.audioTracks.filter(function(K){return!K.audioCodec||Object(E.isCodecSupportedInMp4)(K.audioCodec,"audio")}),Object(b.assignTrackIdsByGroup)(_)),S.subtitles&&(y=S.subtitles,Object(b.assignTrackIdsByGroup)(y)),C.length>0){T=C[0].bitrate,C.sort(function(K,U){return K.bitrate-U.bitrate}),this._levels=C;for(var X=0;X<C.length;X++)if(C[X].bitrate===T){this._firstLevel=X,this.log("manifest loaded, "+C.length+" level(s) found, first bitrate: "+T);break}var j=N&&!P,A={levels:C,audioTracks:_,subtitleTracks:y,firstLevel:this._firstLevel,stats:S.stats,audio:N,video:P,altAudio:!j&&_.some(function(K){return!!K.url})};this.hls.trigger(M.Events.MANIFEST_PARSED,A),(this.hls.config.autoStartLoad||this.hls.forceStartLoad)&&this.hls.startLoad(this.hls.config.startPosition)}else this.hls.trigger(M.Events.ERROR,{type:p.ErrorTypes.MEDIA_ERROR,details:p.ErrorDetails.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:S.url,reason:"no level with compatible codecs found in manifest"})},f.onError=function(m,S){if(u.prototype.onError.call(this,m,S),S.fatal)return;var C=S.context,_=this._levels[this.currentLevelIndex];if(C&&(C.type===c.PlaylistContextType.AUDIO_TRACK&&_.audioGroupIds&&C.groupId===_.audioGroupIds[_.urlId]||C.type===c.PlaylistContextType.SUBTITLE_TRACK&&_.textGroupIds&&C.groupId===_.textGroupIds[_.urlId])){this.redundantFailover(this.currentLevelIndex);return}var y=!1,T=!0,O;switch(S.details){case p.ErrorDetails.FRAG_LOAD_ERROR:case p.ErrorDetails.FRAG_LOAD_TIMEOUT:case p.ErrorDetails.KEY_LOAD_ERROR:case p.ErrorDetails.KEY_LOAD_TIMEOUT:if(S.frag){var g=this._levels[S.frag.level];g?(g.fragmentError++,g.fragmentError>this.hls.config.fragLoadingMaxRetry&&(O=S.frag.level)):O=S.frag.level}break;case p.ErrorDetails.LEVEL_LOAD_ERROR:case p.ErrorDetails.LEVEL_LOAD_TIMEOUT:C&&(C.deliveryDirectives&&(T=!1),O=C.level),y=!0;break;case p.ErrorDetails.REMUX_ALLOC_ERROR:O=S.level,y=!0;break}O!==void 0&&this.recoverLevel(S,O,y,T)},f.recoverLevel=function(m,S,C,_){var y=m.details,T=this._levels[S];if(T.loadError++,C){var O=this.retryLoadingOrFail(m);if(O)m.levelRetry=!0;else{this.currentLevelIndex=-1;return}}if(_){var g=T.url.length;if(g>1&&T.loadError<g)m.levelRetry=!0,this.redundantFailover(S);else if(this.manualLevelIndex===-1){var F=S===0?this._levels.length-1:S-1;this.currentLevelIndex!==F&&this._levels[F].loadError===0&&(this.warn(y+": switch to "+F),m.levelRetry=!0,this.hls.nextAutoLevel=F)}}},f.redundantFailover=function(m){var S=this._levels[m],C=S.url.length;if(C>1){var _=(S.urlId+1)%C;this.warn("Switching to redundant URL-id "+_),this._levels.forEach(function(y){y.urlId=_}),this.level=m}},f.onFragLoaded=function(m,S){var C=S.frag;if(C!==void 0&&C.type===c.PlaylistLevelType.MAIN){var _=this._levels[C.level];_!==void 0&&(_.fragmentError=0,_.loadError=0)}},f.onLevelLoaded=function(m,S){var C,_=S.level,y=S.details,T=this._levels[_];if(!T){var O;this.warn("Invalid level index "+_),(O=S.deliveryDirectives)!==null&&O!==void 0&&O.skip&&(y.deltaUpdateFailed=!0);return}_===this.currentLevelIndex?(T.fragmentError===0&&(T.loadError=0,this.retryCount=0),this.playlistLoaded(_,S,T.details)):(C=S.deliveryDirectives)!==null&&C!==void 0&&C.skip&&(y.deltaUpdateFailed=!0)},f.onAudioTrackSwitched=function(m,S){var C=this.hls.levels[this.currentLevelIndex];if(!C)return;if(C.audioGroupIds){for(var _=-1,y=this.hls.audioTracks[S.id].groupId,T=0;T<C.audioGroupIds.length;T++)if(C.audioGroupIds[T]===y){_=T;break}_!==C.urlId&&(C.urlId=_,this.startLoad())}},f.loadPlaylist=function(m){var S=this.currentLevelIndex,C=this._levels[S];if(this.canLoad&&C&&C.url.length>0){var _=C.urlId,y=C.url[_];if(m)try{y=m.addDirectives(y)}catch(T){this.warn("Could not construct new URL with HLS Delivery Directives: "+T)}this.log("Attempt loading level index "+S+(m?" at sn "+m.msn+" part "+m.part:"")+" with URL-id "+_+" "+y),this.clearTimer(),this.hls.trigger(M.Events.LEVEL_LOADING,{url:y,level:S,id:_,deliveryDirectives:m||null})}},f.removeLevel=function(m,S){var C=function(T,O){return O!==S},_=this._levels.filter(function(y,T){return T!==m?!0:y.url.length>1&&S!==void 0?(y.url=y.url.filter(C),y.audioGroupIds&&(y.audioGroupIds=y.audioGroupIds.filter(C)),y.textGroupIds&&(y.textGroupIds=y.textGroupIds.filter(C)),y.urlId=0,!0):!1}).map(function(y,T){var O=y.details;return O!=null&&O.fragments&&O.fragments.forEach(function(g){g.level=T}),y});this._levels=_,this.hls.trigger(M.Events.LEVELS_UPDATED,{levels:_})},n(d,[{key:"levels",get:function(){return this._levels.length===0?null:this._levels}},{key:"level",get:function(){return this.currentLevelIndex},set:function(m){var S,C=this._levels;if(C.length===0)return;if(this.currentLevelIndex===m&&(S=C[m])!==null&&S!==void 0&&S.details)return;if(m<0||m>=C.length){var _=m<0;if(this.hls.trigger(M.Events.ERROR,{type:p.ErrorTypes.OTHER_ERROR,details:p.ErrorDetails.LEVEL_SWITCH_ERROR,level:m,fatal:_,reason:"invalid level idx"}),_)return;m=Math.min(m,C.length-1)}this.clearTimer();var y=this.currentLevelIndex,T=C[y],O=C[m];this.log("switching to level "+m+" from "+y),this.currentLevelIndex=m;var g=o({},O,{level:m,maxBitrate:O.maxBitrate,uri:O.uri,urlId:O.urlId});delete g._urlId,this.hls.trigger(M.Events.LEVEL_SWITCHING,g);var F=O.details;if(!F||F.live){var P=this.switchParams(O.uri,T==null?void 0:T.details);this.loadPlaylist(P)}}},{key:"manualLevel",get:function(){return this.manualLevelIndex},set:function(m){this.manualLevelIndex=m,this._startLevel===void 0&&(this._startLevel=m),m!==-1&&(this.level=m)}},{key:"firstLevel",get:function(){return this._firstLevel},set:function(m){this._firstLevel=m}},{key:"startLevel",get:function(){if(this._startLevel===void 0){var m=this.hls.config.startLevel;return m!==void 0?m:this._firstLevel}else return this._startLevel},set:function(m){this._startLevel=m}},{key:"nextLoadLevel",get:function(){return this.manualLevelIndex!==-1?this.manualLevelIndex:this.hls.nextAutoLevel},set:function(m){this.level=m,this.manualLevelIndex===-1&&(this.hls.nextAutoLevel=m)}}]),d}(i.default)},"./src/controller/level-helper.ts":function(G,L,I){"use strict";I.r(L),I.d(L,"addGroupId",function(){return p}),I.d(L,"assignTrackIdsByGroup",function(){return E}),I.d(L,"updatePTS",function(){return b}),I.d(L,"updateFragPTSDTS",function(){return c}),I.d(L,"mergeDetails",function(){return o}),I.d(L,"mapPartIntersection",function(){return h}),I.d(L,"mapFragmentIntersection",function(){return n}),I.d(L,"adjustSliding",function(){return a}),I.d(L,"addSliding",function(){return t}),I.d(L,"computeReloadInterval",function(){return r}),I.d(L,"getFragmentWithSN",function(){return s}),I.d(L,"getPartWith",function(){return u});var R=I("./src/polyfills/number.ts"),M=I("./src/utils/logger.ts");function p(d,f,v){switch(f){case"audio":d.audioGroupIds||(d.audioGroupIds=[]),d.audioGroupIds.push(v);break;case"text":d.textGroupIds||(d.textGroupIds=[]),d.textGroupIds.push(v);break}}function E(d){var f={};d.forEach(function(v){var m=v.groupId||"";v.id=f[m]=f[m]||0,f[m]++})}function b(d,f,v){var m=d[f],S=d[v];i(m,S)}function i(d,f){var v=f.startPTS;if(Object(R.isFiniteNumber)(v)){var m=0,S;f.sn>d.sn?(m=v-d.start,S=d):(m=d.start-v,S=f),S.duration!==m&&(S.duration=m)}else if(f.sn>d.sn){var C=d.cc===f.cc;C&&d.minEndPTS?f.start=d.start+(d.minEndPTS-d.start):f.start=d.start+d.duration}else f.start=Math.max(d.start-f.duration,0)}function c(d,f,v,m,S,C){var _=m-v;_<=0&&(M.logger.warn("Fragment should have a positive duration",f),m=v+f.duration,C=S+f.duration);var y=v,T=m,O=f.startPTS,g=f.endPTS;if(Object(R.isFiniteNumber)(O)){var F=Math.abs(O-v);Object(R.isFiniteNumber)(f.deltaPTS)?f.deltaPTS=Math.max(F,f.deltaPTS):f.deltaPTS=F,y=Math.max(v,O),v=Math.min(v,O),S=Math.min(S,f.startDTS),T=Math.min(m,g),m=Math.max(m,g),C=Math.max(C,f.endDTS)}f.duration=m-v;var P=v-f.start;f.appendedPTS=m,f.start=f.startPTS=v,f.maxStartPTS=y,f.startDTS=S,f.endPTS=m,f.minEndPTS=T,f.endDTS=C;var N=f.sn;if(!d||N<d.startSN||N>d.endSN)return 0;var X,j=N-d.startSN,A=d.fragments;for(A[j]=f,X=j;X>0;X--)i(A[X],A[X-1]);for(X=j;X<A.length-1;X++)i(A[X],A[X+1]);return d.fragmentHint&&i(A[A.length-1],d.fragmentHint),d.PTSKnown=d.alignedSliding=!0,P}function o(d,f){for(var v=null,m=d.fragments,S=m.length-1;S>=0;S--){var C=m[S].initSegment;if(C){v=C;break}}d.fragmentHint&&delete d.fragmentHint.endPTS;var _=0,y;if(n(d,f,function(X,j){X.relurl&&(_=X.cc-j.cc),Object(R.isFiniteNumber)(X.startPTS)&&Object(R.isFiniteNumber)(X.endPTS)&&(j.start=j.startPTS=X.startPTS,j.startDTS=X.startDTS,j.appendedPTS=X.appendedPTS,j.maxStartPTS=X.maxStartPTS,j.endPTS=X.endPTS,j.endDTS=X.endDTS,j.minEndPTS=X.minEndPTS,j.duration=X.endPTS-X.startPTS,j.duration&&(y=j),f.PTSKnown=f.alignedSliding=!0),j.elementaryStreams=X.elementaryStreams,j.loader=X.loader,j.stats=X.stats,j.urlId=X.urlId,X.initSegment&&(j.initSegment=X.initSegment,v=X.initSegment)}),v){var T=f.fragmentHint?f.fragments.concat(f.fragmentHint):f.fragments;T.forEach(function(X){var j;(!X.initSegment||X.initSegment.relurl===((j=v)===null||j===void 0?void 0:j.relurl))&&(X.initSegment=v)})}if(f.skippedSegments&&(f.deltaUpdateFailed=f.fragments.some(function(X){return!X}),f.deltaUpdateFailed)){M.logger.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(var O=f.skippedSegments;O--;)f.fragments.shift();f.startSN=f.fragments[0].sn,f.startCC=f.fragments[0].cc}var g=f.fragments;if(_){M.logger.warn("discontinuity sliding from playlist, take drift into account");for(var F=0;F<g.length;F++)g[F].cc+=_}f.skippedSegments&&(f.startCC=f.fragments[0].cc),h(d.partList,f.partList,function(X,j){j.elementaryStreams=X.elementaryStreams,j.stats=X.stats}),y?c(f,y,y.startPTS,y.endPTS,y.startDTS,y.endDTS):a(d,f),g.length&&(f.totalduration=f.edge-g[0].start),f.driftStartTime=d.driftStartTime,f.driftStart=d.driftStart;var P=f.advancedDateTime;if(f.advanced&&P){var N=f.edge;f.driftStart||(f.driftStartTime=P,f.driftStart=N),f.driftEndTime=P,f.driftEnd=N}else f.driftEndTime=d.driftEndTime,f.driftEnd=d.driftEnd,f.advancedDateTime=d.advancedDateTime}function h(d,f,v){if(d&&f)for(var m=0,S=0,C=d.length;S<=C;S++){var _=d[S],y=f[S+m];_&&y&&_.index===y.index&&_.fragment.sn===y.fragment.sn?v(_,y):m--}}function n(d,f,v){for(var m=f.skippedSegments,S=Math.max(d.startSN,f.startSN)-f.startSN,C=(d.fragmentHint?1:0)+(m?f.endSN:Math.min(d.endSN,f.endSN))-f.startSN,_=f.startSN-d.startSN,y=f.fragmentHint?f.fragments.concat(f.fragmentHint):f.fragments,T=d.fragmentHint?d.fragments.concat(d.fragmentHint):d.fragments,O=S;O<=C;O++){var g=T[_+O],F=y[O];m&&!F&&O<m&&(F=f.fragments[O]=g),g&&F&&v(g,F)}}function a(d,f){var v=f.startSN+f.skippedSegments-d.startSN,m=d.fragments;if(v<0||v>=m.length)return;t(f,m[v].start)}function t(d,f){if(f){for(var v=d.fragments,m=d.skippedSegments;m<v.length;m++)v[m].start+=f;d.fragmentHint&&(d.fragmentHint.start+=f)}}function r(d,f){var v=1e3*d.levelTargetDuration,m=v/2,S=d.age,C=S>0&&S<v*3,_=f.loading.end-f.loading.start,y,T=d.availabilityDelay;if(d.updated===!1)if(C){var O=333*d.misses;y=Math.max(Math.min(m,_*2),O),d.availabilityDelay=(d.availabilityDelay||0)+y}else y=m;else C?(T=Math.min(T||v/2,S),d.availabilityDelay=T,y=T+v-S):y=v-_;return Math.round(y)}function s(d,f,v){if(!d||!d.details)return null;var m=d.details,S=m.fragments[f-m.startSN];return S||(S=m.fragmentHint,S&&S.sn===f?S:f<m.startSN&&v&&v.sn===f?v:null)}function u(d,f,v){if(!d||!d.details)return null;var m=d.details.partList;if(m)for(var S=m.length;S--;){var C=m[S];if(C.index===v&&C.fragment.sn===f)return C}return null}},"./src/controller/stream-controller.ts":function(G,L,I){"use strict";I.r(L),I.d(L,"default",function(){return m});var R=I("./src/polyfills/number.ts"),M=I("./src/controller/base-stream-controller.ts"),p=I("./src/is-supported.ts"),E=I("./src/events.ts"),b=I("./src/utils/buffer-helper.ts"),i=I("./src/controller/fragment-tracker.ts"),c=I("./src/types/loader.ts"),o=I("./src/loader/fragment.ts"),h=I("./src/demux/transmuxer-interface.ts"),n=I("./src/types/transmuxer.ts"),a=I("./src/controller/gap-controller.ts"),t=I("./src/errors.ts"),r=I("./src/utils/logger.ts");function s(S,C){for(var _=0;_<C.length;_++){var y=C[_];y.enumerable=y.enumerable||!1,y.configurable=!0,"value"in y&&(y.writable=!0),Object.defineProperty(S,y.key,y)}}function u(S,C,_){return C&&s(S.prototype,C),_&&s(S,_),S}function d(S,C){S.prototype=Object.create(C.prototype),S.prototype.constructor=S,f(S,C)}function f(S,C){return f=Object.setPrototypeOf||function(y,T){return y.__proto__=T,y},f(S,C)}var v=100,m=function(S){d(C,S);function C(y,T){var O;return O=S.call(this,y,T,"[stream-controller]")||this,O.audioCodecSwap=!1,O.gapController=null,O.level=-1,O._forceStartLoad=!1,O.altAudio=!1,O.audioOnly=!1,O.fragPlaying=null,O.onvplaying=null,O.onvseeked=null,O.fragLastKbps=0,O.stalled=!1,O.couldBacktrack=!1,O.audioCodecSwitch=!1,O.videoBuffer=null,O._registerListeners(),O}var _=C.prototype;return _._registerListeners=function(){var T=this.hls;T.on(E.Events.MEDIA_ATTACHED,this.onMediaAttached,this),T.on(E.Events.MEDIA_DETACHING,this.onMediaDetaching,this),T.on(E.Events.MANIFEST_LOADING,this.onManifestLoading,this),T.on(E.Events.MANIFEST_PARSED,this.onManifestParsed,this),T.on(E.Events.LEVEL_LOADING,this.onLevelLoading,this),T.on(E.Events.LEVEL_LOADED,this.onLevelLoaded,this),T.on(E.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),T.on(E.Events.ERROR,this.onError,this),T.on(E.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),T.on(E.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),T.on(E.Events.BUFFER_CREATED,this.onBufferCreated,this),T.on(E.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),T.on(E.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),T.on(E.Events.FRAG_BUFFERED,this.onFragBuffered,this)},_._unregisterListeners=function(){var T=this.hls;T.off(E.Events.MEDIA_ATTACHED,this.onMediaAttached,this),T.off(E.Events.MEDIA_DETACHING,this.onMediaDetaching,this),T.off(E.Events.MANIFEST_LOADING,this.onManifestLoading,this),T.off(E.Events.MANIFEST_PARSED,this.onManifestParsed,this),T.off(E.Events.LEVEL_LOADED,this.onLevelLoaded,this),T.off(E.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),T.off(E.Events.ERROR,this.onError,this),T.off(E.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),T.off(E.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),T.off(E.Events.BUFFER_CREATED,this.onBufferCreated,this),T.off(E.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),T.off(E.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),T.off(E.Events.FRAG_BUFFERED,this.onFragBuffered,this)},_.onHandlerDestroying=function(){this._unregisterListeners(),this.onMediaDetaching()},_.startLoad=function(T){if(this.levels){var O=this.lastCurrentTime,g=this.hls;if(this.stopLoad(),this.setInterval(v),this.level=-1,this.fragLoadError=0,!this.startFragRequested){var F=g.startLevel;F===-1&&(g.config.testBandwidth?(F=0,this.bitrateTest=!0):F=g.nextAutoLevel),this.level=g.nextLoadLevel=F,this.loadedmetadata=!1}O>0&&T===-1&&(this.log("Override startPosition with lastCurrentTime @"+O.toFixed(3)),T=O),this.state=M.State.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=T,this.tick()}else this._forceStartLoad=!0,this.state=M.State.STOPPED},_.stopLoad=function(){this._forceStartLoad=!1,S.prototype.stopLoad.call(this)},_.doTick=function(){switch(this.state){case M.State.IDLE:this.doTickIdle();break;case M.State.WAITING_LEVEL:{var T,O=this.levels,g=this.level,F=O==null||((T=O[g])===null||T===void 0)?void 0:T.details;if(F&&(!F.live||this.levelLastLoaded===this.level)){if(this.waitForCdnTuneIn(F))break;this.state=M.State.IDLE;break}break}case M.State.FRAG_LOADING_WAITING_RETRY:{var P,N=self.performance.now(),X=this.retryDate;(!X||N>=X||(P=this.media)!==null&&P!==void 0&&P.seeking)&&(this.log("retryDate reached, switch back to IDLE state"),this.state=M.State.IDLE)}break;default:break}this.onTickEnd()},_.onTickEnd=function(){S.prototype.onTickEnd.call(this),this.checkBuffer(),this.checkFragmentChanged()},_.doTickIdle=function(){var T,O,g=this.hls,F=this.levelLastLoaded,P=this.levels,N=this.media,X=g.config,j=g.nextLoadLevel;if(F===null||!N&&(this.startFragRequested||!X.startFragPrefetch))return;if(this.altAudio&&this.audioOnly)return;if(!P||!P[j])return;var A=P[j];this.level=g.nextLoadLevel=j;var K=A.details;if(!K||this.state===M.State.WAITING_LEVEL||K.live&&this.levelLastLoaded!==j){this.state=M.State.WAITING_LEVEL;return}var U=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:N,c.PlaylistLevelType.MAIN);if(U===null)return;var k=U.len,z=this.getMaxBufferLength(A.maxBitrate);if(k>=z)return;if(this._streamEnded(U,K)){var te={};this.altAudio&&(te.type="video"),this.hls.trigger(E.Events.BUFFER_EOS,te),this.state=M.State.ENDED;return}var de=U.end,be=this.getNextFragment(de,K);if(this.couldBacktrack&&!this.fragPrevious&&be&&be.sn!=="initSegment"){var We=be.sn-K.startSN;We>1&&(be=K.fragments[We-1],this.fragmentTracker.removeFragment(be))}if(be&&this.fragmentTracker.getState(be)===i.FragmentState.OK&&this.nextLoadPosition>de){var Ne=this.audioOnly&&!this.altAudio?o.ElementaryStreamTypes.AUDIO:o.ElementaryStreamTypes.VIDEO;this.afterBufferFlushed(N,Ne,c.PlaylistLevelType.MAIN),be=this.getNextFragment(this.nextLoadPosition,K)}if(!be)return;be.initSegment&&!be.initSegment.data&&!this.bitrateTest&&(be=be.initSegment),((T=be.decryptdata)===null||T===void 0?void 0:T.keyFormat)==="identity"&&!((O=be.decryptdata)!==null&&O!==void 0&&O.key)?this.loadKey(be,K):this.loadFragment(be,K,de)},_.loadFragment=function(T,O,g){var F,P=this.fragmentTracker.getState(T);if(this.fragCurrent=T,P===i.FragmentState.BACKTRACKED){var N=this.fragmentTracker.getBacktrackData(T);if(N){this._handleFragmentLoadProgress(N),this._handleFragmentLoadComplete(N);return}else P=i.FragmentState.NOT_LOADED}P===i.FragmentState.NOT_LOADED||P===i.FragmentState.PARTIAL?T.sn==="initSegment"?this._loadInitSegment(T):this.bitrateTest?(T.bitrateTest=!0,this.log("Fragment "+T.sn+" of level "+T.level+" is being downloaded to test bitrate and will not be buffered"),this._loadBitrateTestFrag(T)):(this.startFragRequested=!0,S.prototype.loadFragment.call(this,T,O,g)):P===i.FragmentState.APPENDING?this.reduceMaxBufferLength(T.duration)&&this.fragmentTracker.removeFragment(T):((F=this.media)===null||F===void 0?void 0:F.buffered.length)===0&&this.fragmentTracker.removeAllFragments()},_.getAppendedFrag=function(T){var O=this.fragmentTracker.getAppendedFrag(T,c.PlaylistLevelType.MAIN);return O&&"fragment"in O?O.fragment:O},_.getBufferedFrag=function(T){return this.fragmentTracker.getBufferedFrag(T,c.PlaylistLevelType.MAIN)},_.followingBufferedFrag=function(T){return T?this.getBufferedFrag(T.end+.5):null},_.immediateLevelSwitch=function(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)},_.nextLevelSwitch=function(){var T=this.levels,O=this.media;if(O!=null&&O.readyState){var g,F=this.getAppendedFrag(O.currentTime);if(F&&F.start>1&&this.flushMainBuffer(0,F.start-1),!O.paused&&T){var P=this.hls.nextLoadLevel,N=T[P],X=this.fragLastKbps;X&&this.fragCurrent?g=this.fragCurrent.duration*N.maxBitrate/(1e3*X)+1:g=0}else g=0;var j=this.getBufferedFrag(O.currentTime+g);if(j){var A=this.followingBufferedFrag(j);if(A){this.abortCurrentFrag();var K=A.maxStartPTS?A.maxStartPTS:A.start,U=A.duration,k=Math.max(j.end,K+Math.min(Math.max(U-this.config.maxFragLookUpTolerance,U*.5),U*.75));this.flushMainBuffer(k,Number.POSITIVE_INFINITY)}}}},_.abortCurrentFrag=function(){var T=this.fragCurrent;this.fragCurrent=null,T!=null&&T.loader&&T.loader.abort(),this.state===M.State.KEY_LOADING&&(this.state=M.State.IDLE),this.nextLoadPosition=this.getLoadPosition()},_.flushMainBuffer=function(T,O){S.prototype.flushMainBuffer.call(this,T,O,this.altAudio?"video":null)},_.onMediaAttached=function(T,O){S.prototype.onMediaAttached.call(this,T,O);var g=O.media;this.onvplaying=this.onMediaPlaying.bind(this),this.onvseeked=this.onMediaSeeked.bind(this),g.addEventListener("playing",this.onvplaying),g.addEventListener("seeked",this.onvseeked),this.gapController=new a.default(this.config,g,this.fragmentTracker,this.hls)},_.onMediaDetaching=function(){var T=this.media;T&&(T.removeEventListener("playing",this.onvplaying),T.removeEventListener("seeked",this.onvseeked),this.onvplaying=this.onvseeked=null,this.videoBuffer=null),this.fragPlaying=null,this.gapController&&(this.gapController.destroy(),this.gapController=null),S.prototype.onMediaDetaching.call(this)},_.onMediaPlaying=function(){this.tick()},_.onMediaSeeked=function(){var T=this.media,O=T?T.currentTime:null;Object(R.isFiniteNumber)(O)&&this.log("Media seeked to "+O.toFixed(3)),this.tick()},_.onManifestLoading=function(){this.log("Trigger BUFFER_RESET"),this.hls.trigger(E.Events.BUFFER_RESET,void 0),this.fragmentTracker.removeAllFragments(),this.couldBacktrack=this.stalled=!1,this.startPosition=this.lastCurrentTime=0,this.fragPlaying=null},_.onManifestParsed=function(T,O){var g=!1,F=!1,P;O.levels.forEach(function(N){P=N.audioCodec,P&&(P.indexOf("mp4a.40.2")!==-1&&(g=!0),P.indexOf("mp4a.40.5")!==-1&&(F=!0))}),this.audioCodecSwitch=g&&F&&!Object(p.changeTypeSupported)(),this.audioCodecSwitch&&this.log("Both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=O.levels,this.startFragRequested=!1},_.onLevelLoading=function(T,O){var g=this.levels;if(!g||this.state!==M.State.IDLE)return;var F=g[O.level];(!F.details||F.details.live&&this.levelLastLoaded!==O.level||this.waitForCdnTuneIn(F.details))&&(this.state=M.State.WAITING_LEVEL)},_.onLevelLoaded=function(T,O){var g,F=this.levels,P=O.level,N=O.details,X=N.totalduration;if(!F){this.warn("Levels were reset while loading level "+P);return}this.log("Level "+P+" loaded ["+N.startSN+","+N.endSN+"], cc ["+N.startCC+", "+N.endCC+"] duration:"+X);var j=this.fragCurrent;j&&(this.state===M.State.FRAG_LOADING||this.state===M.State.FRAG_LOADING_WAITING_RETRY)&&(j.level!==O.level&&j.loader&&(this.state=M.State.IDLE,j.loader.abort()));var A=F[P],K=0;if(N.live||(g=A.details)!==null&&g!==void 0&&g.live){if(N.fragments[0]||(N.deltaUpdateFailed=!0),N.deltaUpdateFailed)return;K=this.alignPlaylists(N,A.details)}if(A.details=N,this.levelLastLoaded=P,this.hls.trigger(E.Events.LEVEL_UPDATED,{details:N,level:P}),this.state===M.State.WAITING_LEVEL){if(this.waitForCdnTuneIn(N))return;this.state=M.State.IDLE}this.startFragRequested?N.live&&this.synchronizeToLiveEdge(N):this.setStartPosition(N,K),this.tick()},_._handleFragmentLoadProgress=function(T){var O,g=T.frag,F=T.part,P=T.payload,N=this.levels;if(!N){this.warn("Levels were reset while fragment load was in progress. Fragment "+g.sn+" of level "+g.level+" will not be buffered");return}var X=N[g.level],j=X.details;if(!j){this.warn("Dropping fragment "+g.sn+" of level "+g.level+" after level details were reset");return}var A=X.videoCodec,K=j.PTSKnown||!j.live,U=(O=g.initSegment)===null||O===void 0?void 0:O.data,k=this._getAudioCodec(X),z=this.transmuxer=this.transmuxer||new h.default(this.hls,c.PlaylistLevelType.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),te=F?F.index:-1,de=te!==-1,be=new n.ChunkMetadata(g.level,g.sn,g.stats.chunkCount,P.byteLength,te,de),We=this.initPTS[g.cc];z.push(P,U,k,A,g,F,j.totalduration,K,be,We)},_.onAudioTrackSwitching=function(T,O){var g=this.altAudio,F=!!O.url,P=O.id;if(!F){if(this.mediaBuffer!==this.media){this.log("Switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;var N=this.fragCurrent;N!=null&&N.loader&&(this.log("Switching to main audio track, cancel main fragment load"),N.loader.abort()),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();var X=this.hls;g&&X.trigger(E.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),X.trigger(E.Events.AUDIO_TRACK_SWITCHED,{id:P})}},_.onAudioTrackSwitched=function(T,O){var g=O.id,F=!!this.hls.audioTracks[g].url;if(F){var P=this.videoBuffer;P&&this.mediaBuffer!==P&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=P)}this.altAudio=F,this.tick()},_.onBufferCreated=function(T,O){var g=O.tracks,F,P,N=!1;for(var X in g){var j=g[X];if(j.id==="main"){if(P=X,F=j,X==="video"){var A=g[X];A&&(this.videoBuffer=A.buffer)}}else N=!0}N&&F?(this.log("Alternate track found, use "+P+".buffered to schedule main fragment loading"),this.mediaBuffer=F.buffer):this.mediaBuffer=this.media},_.onFragBuffered=function(T,O){var g=O.frag,F=O.part;if(g&&g.type!==c.PlaylistLevelType.MAIN)return;if(this.fragContextChanged(g)){this.warn("Fragment "+g.sn+(F?" p: "+F.index:"")+" of level "+g.level+" finished buffering, but was aborted. state: "+this.state),this.state===M.State.PARSED&&(this.state=M.State.IDLE);return}var P=F?F.stats:g.stats;this.fragLastKbps=Math.round(8*P.total/(P.buffering.end-P.loading.first)),g.sn!=="initSegment"&&(this.fragPrevious=g),this.fragBufferedComplete(g,F)},_.onError=function(T,O){switch(O.details){case t.ErrorDetails.FRAG_LOAD_ERROR:case t.ErrorDetails.FRAG_LOAD_TIMEOUT:case t.ErrorDetails.KEY_LOAD_ERROR:case t.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(c.PlaylistLevelType.MAIN,O);break;case t.ErrorDetails.LEVEL_LOAD_ERROR:case t.ErrorDetails.LEVEL_LOAD_TIMEOUT:this.state!==M.State.ERROR&&(O.fatal?(this.warn(""+O.details),this.state=M.State.ERROR):!O.levelRetry&&this.state===M.State.WAITING_LEVEL&&(this.state=M.State.IDLE));break;case t.ErrorDetails.BUFFER_FULL_ERROR:if(O.parent==="main"&&(this.state===M.State.PARSING||this.state===M.State.PARSED)){var g=!0,F=this.getFwdBufferInfo(this.media,c.PlaylistLevelType.MAIN);F&&F.len>.5&&(g=!this.reduceMaxBufferLength(F.len)),g&&(this.warn("buffer full error also media.currentTime is not buffered, flush main"),this.immediateLevelSwitch()),this.resetLoadingState()}break;default:break}},_.checkBuffer=function(){var T=this.media,O=this.gapController;if(!T||!O||!T.readyState)return;var g=b.BufferHelper.getBuffered(T);!this.loadedmetadata&&g.length?(this.loadedmetadata=!0,this.seekToStartPos()):O.poll(this.lastCurrentTime),this.lastCurrentTime=T.currentTime},_.onFragLoadEmergencyAborted=function(){this.state=M.State.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tickImmediate()},_.onBufferFlushed=function(T,O){var g=O.type;if(g!==o.ElementaryStreamTypes.AUDIO||this.audioOnly&&!this.altAudio){var F=(g===o.ElementaryStreamTypes.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;this.afterBufferFlushed(F,g,c.PlaylistLevelType.MAIN)}},_.onLevelsUpdated=function(T,O){this.levels=O.levels},_.swapAudioCodec=function(){this.audioCodecSwap=!this.audioCodecSwap},_.seekToStartPos=function(){var T=this.media,O=T.currentTime,g=this.startPosition;if(g>=0&&O<g){if(T.seeking){r.logger.log("could not seek to "+g+", already seeking at "+O);return}var F=b.BufferHelper.getBuffered(T),P=F.length?F.start(0):0,N=P-g;N>0&&(N<this.config.maxBufferHole||N<this.config.maxFragLookUpTolerance)&&(r.logger.log("adjusting start position by "+N+" to match buffer start"),g+=N,this.startPosition=g),this.log("seek to target start position "+g+" from current time "+O),T.currentTime=g}},_._getAudioCodec=function(T){var O=this.config.defaultAudioCodec||T.audioCodec;return this.audioCodecSwap&&O&&(this.log("Swapping audio codec"),O.indexOf("mp4a.40.5")!==-1?O="mp4a.40.2":O="mp4a.40.5"),O},_._loadBitrateTestFrag=function(T){var O=this;this._doFragLoad(T).then(function(g){var F=O.hls;if(!g||F.nextLoadLevel||O.fragContextChanged(T))return;O.fragLoadError=0,O.state=M.State.IDLE,O.startFragRequested=!1,O.bitrateTest=!1;var P=T.stats;P.parsing.start=P.parsing.end=P.buffering.start=P.buffering.end=self.performance.now(),F.trigger(E.Events.FRAG_LOADED,g)})},_._handleTransmuxComplete=function(T){var O,g="main",F=this.hls,P=T.remuxResult,N=T.chunkMeta,X=this.getCurrentContext(N);if(!X){this.warn("The loading context changed while buffering fragment "+N.sn+" of level "+N.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(N.level);return}var j=X.frag,A=X.part,K=X.level,U=P.video,k=P.text,z=P.id3,te=P.initSegment,de=this.altAudio?void 0:P.audio;if(this.fragContextChanged(j))return;if(this.state=M.State.PARSING,te){te.tracks&&(this._bufferInitSegment(K,te.tracks,j,N),F.trigger(E.Events.FRAG_PARSING_INIT_SEGMENT,{frag:j,id:g,tracks:te.tracks}));var be=te.initPTS,We=te.timescale;Object(R.isFiniteNumber)(be)&&(this.initPTS[j.cc]=be,F.trigger(E.Events.INIT_PTS_FOUND,{frag:j,id:g,initPTS:be,timescale:We}))}if(U&&P.independent!==!1){if(K.details){var Ne=U.startPTS,Le=U.endPTS,Ke=U.startDTS,He=U.endDTS;if(A)A.elementaryStreams[U.type]={startPTS:Ne,endPTS:Le,startDTS:Ke,endDTS:He};else if(U.firstKeyFrame&&U.independent&&(this.couldBacktrack=!0),U.dropped&&U.independent){var Ae=this.getLoadPosition()+this.config.maxBufferHole;if(Ae<Ne){this.backtrack(j);return}j.setElementaryStreamInfo(U.type,j.start,Le,j.start,He,!0)}j.setElementaryStreamInfo(U.type,Ne,Le,Ke,He),this.bufferFragmentData(U,j,A,N)}}else if(P.independent===!1){this.backtrack(j);return}if(de){var Se=de.startPTS,he=de.endPTS,Ie=de.startDTS,ye=de.endDTS;A&&(A.elementaryStreams[o.ElementaryStreamTypes.AUDIO]={startPTS:Se,endPTS:he,startDTS:Ie,endDTS:ye}),j.setElementaryStreamInfo(o.ElementaryStreamTypes.AUDIO,Se,he,Ie,ye),this.bufferFragmentData(de,j,A,N)}if(z!=null&&(O=z.samples)!==null&&O!==void 0&&O.length){var Ge={frag:j,id:g,samples:z.samples};F.trigger(E.Events.FRAG_PARSING_METADATA,Ge)}if(k){var $e={frag:j,id:g,samples:k.samples};F.trigger(E.Events.FRAG_PARSING_USERDATA,$e)}},_._bufferInitSegment=function(T,O,g,F){var P=this;if(this.state!==M.State.PARSING)return;this.audioOnly=!!O.audio&&!O.video,this.altAudio&&!this.audioOnly&&delete O.audio;var N=O.audio,X=O.video,j=O.audiovideo;if(N){var A=T.audioCodec,K=navigator.userAgent.toLowerCase();this.audioCodecSwitch&&(A&&(A.indexOf("mp4a.40.5")!==-1?A="mp4a.40.2":A="mp4a.40.5"),N.metadata.channelCount!==1&&K.indexOf("firefox")===-1&&(A="mp4a.40.5")),K.indexOf("android")!==-1&&N.container!=="audio/mpeg"&&(A="mp4a.40.2",this.log("Android: force audio codec to "+A)),T.audioCodec&&T.audioCodec!==A&&this.log('Swapping manifest audio codec "'+T.audioCodec+'" for "'+A+'"'),N.levelCodec=A,N.id="main",this.log("Init audio buffer, container:"+N.container+", codecs[selected/level/parsed]=["+(A||"")+"/"+(T.audioCodec||"")+"/"+N.codec+"]")}X&&(X.levelCodec=T.videoCodec,X.id="main",this.log("Init video buffer, container:"+X.container+", codecs[level/parsed]=["+(T.videoCodec||"")+"/"+X.codec+"]")),j&&this.log("Init audiovideo buffer, container:"+j.container+", codecs[level/parsed]=["+(T.attrs.CODECS||"")+"/"+j.codec+"]"),this.hls.trigger(E.Events.BUFFER_CODECS,O),Object.keys(O).forEach(function(U){var k=O[U],z=k.initSegment;z!=null&&z.byteLength&&P.hls.trigger(E.Events.BUFFER_APPENDING,{type:U,data:z,frag:g,part:null,chunkMeta:F,parent:g.type})}),this.tick()},_.backtrack=function(T){this.couldBacktrack=!0,this.resetTransmuxer(),this.flushBufferGap(T);var O=this.fragmentTracker.backtrack(T);this.fragPrevious=null,this.nextLoadPosition=T.start,O?this.resetFragmentLoading(T):this.state=M.State.BACKTRACKING},_.checkFragmentChanged=function(){var T=this.media,O=null;if(T&&T.readyState>1&&T.seeking===!1){var g=T.currentTime;if(b.BufferHelper.isBuffered(T,g)?O=this.getAppendedFrag(g):b.BufferHelper.isBuffered(T,g+.1)&&(O=this.getAppendedFrag(g+.1)),O){var F=this.fragPlaying,P=O.level;(!F||O.sn!==F.sn||F.level!==P||O.urlId!==F.urlId)&&(this.hls.trigger(E.Events.FRAG_CHANGED,{frag:O}),(!F||F.level!==P)&&this.hls.trigger(E.Events.LEVEL_SWITCHED,{level:P}),this.fragPlaying=O)}}},u(C,[{key:"nextLevel",get:function(){var T=this.nextBufferedFrag;return T?T.level:-1}},{key:"currentLevel",get:function(){var T=this.media;if(T){var O=this.getAppendedFrag(T.currentTime);if(O)return O.level}return-1}},{key:"nextBufferedFrag",get:function(){var T=this.media;if(T){var O=this.getAppendedFrag(T.currentTime);return this.followingBufferedFrag(O)}else return null}},{key:"forceStartLoad",get:function(){return this._forceStartLoad}}]),C}(M.default)},"./src/controller/subtitle-stream-controller.ts":function(G,L,I){"use strict";I.r(L),I.d(L,"SubtitleStreamController",function(){return d});var R=I("./src/events.ts"),M=I("./src/utils/logger.ts"),p=I("./src/utils/buffer-helper.ts"),E=I("./src/controller/fragment-finders.ts"),b=I("./src/utils/discontinuities.ts"),i=I("./src/controller/level-helper.ts"),c=I("./src/controller/fragment-tracker.ts"),o=I("./src/controller/base-stream-controller.ts"),h=I("./src/types/loader.ts"),n=I("./src/types/level.ts");function a(f,v){for(var m=0;m<v.length;m++){var S=v[m];S.enumerable=S.enumerable||!1,S.configurable=!0,"value"in S&&(S.writable=!0),Object.defineProperty(f,S.key,S)}}function t(f,v,m){return v&&a(f.prototype,v),m&&a(f,m),f}function r(f,v){f.prototype=Object.create(v.prototype),f.prototype.constructor=f,s(f,v)}function s(f,v){return s=Object.setPrototypeOf||function(S,C){return S.__proto__=C,S},s(f,v)}var u=500,d=function(f){r(v,f);function v(S,C){var _;return _=f.call(this,S,C,"[subtitle-stream-controller]")||this,_.levels=[],_.currentTrackId=-1,_.tracksBuffered=[],_.mainDetails=null,_._registerListeners(),_}var m=v.prototype;return m.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},m._registerListeners=function(){var C=this.hls;C.on(R.Events.MEDIA_ATTACHED,this.onMediaAttached,this),C.on(R.Events.MEDIA_DETACHING,this.onMediaDetaching,this),C.on(R.Events.MANIFEST_LOADING,this.onManifestLoading,this),C.on(R.Events.LEVEL_LOADED,this.onLevelLoaded,this),C.on(R.Events.ERROR,this.onError,this),C.on(R.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),C.on(R.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),C.on(R.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),C.on(R.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),C.on(R.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},m._unregisterListeners=function(){var C=this.hls;C.off(R.Events.MEDIA_ATTACHED,this.onMediaAttached,this),C.off(R.Events.MEDIA_DETACHING,this.onMediaDetaching,this),C.off(R.Events.MANIFEST_LOADING,this.onManifestLoading,this),C.off(R.Events.LEVEL_LOADED,this.onLevelLoaded,this),C.off(R.Events.ERROR,this.onError,this),C.off(R.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),C.off(R.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),C.off(R.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),C.off(R.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),C.off(R.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},m.startLoad=function(){this.stopLoad(),this.state=o.State.IDLE,this.setInterval(u),this.tick()},m.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments()},m.onLevelLoaded=function(C,_){this.mainDetails=_.details},m.onSubtitleFragProcessed=function(C,_){var y=_.frag,T=_.success;if(this.fragPrevious=y,this.state=o.State.IDLE,!T)return;var O=this.tracksBuffered[this.currentTrackId];if(!O)return;for(var g,F=y.start,P=0;P<O.length;P++)if(F>=O[P].start&&F<=O[P].end){g=O[P];break}var N=y.start+y.duration;g?g.end=N:(g={start:F,end:N},O.push(g)),this.fragmentTracker.fragBuffered(y)},m.onBufferFlushing=function(C,_){var y=_.startOffset,T=_.endOffset;if(y===0&&T!==Number.POSITIVE_INFINITY){var O=this.currentTrackId,g=this.levels;if(!g.length||!g[O]||!g[O].details)return;var F=g[O].details,P=F.targetduration,N=T-P;if(N<=0)return;_.endOffsetSubtitles=Math.max(0,N),this.tracksBuffered.forEach(function(X){for(var j=0;j<X.length;){if(X[j].end<=N){X.shift();continue}else if(X[j].start<N)X[j].start=N;else break;j++}}),this.fragmentTracker.removeFragmentsInRange(y,N,h.PlaylistLevelType.SUBTITLE)}},m.onError=function(C,_){var y,T=_.frag;if(!T||T.type!==h.PlaylistLevelType.SUBTITLE)return;(y=this.fragCurrent)!==null&&y!==void 0&&y.loader&&this.fragCurrent.loader.abort(),this.state=o.State.IDLE},m.onSubtitleTracksUpdated=function(C,_){var y=this,T=_.subtitleTracks;this.tracksBuffered=[],this.levels=T.map(function(O){return new n.Level(O)}),this.fragmentTracker.removeAllFragments(),this.fragPrevious=null,this.levels.forEach(function(O){y.tracksBuffered[O.id]=[]}),this.mediaBuffer=null},m.onSubtitleTrackSwitch=function(C,_){if(this.currentTrackId=_.id,!this.levels.length||this.currentTrackId===-1){this.clearInterval();return}var y=this.levels[this.currentTrackId];y!=null&&y.details?this.mediaBuffer=this.mediaBufferTimeRanges:this.mediaBuffer=null,y&&this.setInterval(u)},m.onSubtitleTrackLoaded=function(C,_){var y,T=_.details,O=_.id,g=this.currentTrackId,F=this.levels;if(!F.length)return;var P=F[g];if(O>=F.length||O!==g||!P)return;if(this.mediaBuffer=this.mediaBufferTimeRanges,T.live||(y=P.details)!==null&&y!==void 0&&y.live){var N=this.mainDetails;if(T.deltaUpdateFailed||!N)return;var X=N.fragments[0];if(!P.details)T.hasProgramDateTime&&N.hasProgramDateTime?Object(b.alignMediaPlaylistByPDT)(T,N):X&&Object(i.addSliding)(T,X.start);else{var j=this.alignPlaylists(T,P.details);j===0&&X&&Object(i.addSliding)(T,X.start)}}if(P.details=T,this.levelLastLoaded=O,this.tick(),T.live&&!this.fragCurrent&&this.media&&this.state===o.State.IDLE){var A=Object(E.findFragmentByPTS)(null,T.fragments,this.media.currentTime,0);A||(this.warn("Subtitle playlist not aligned with playback"),P.details=void 0)}},m._handleFragmentLoadComplete=function(C){var _=C.frag,y=C.payload,T=_.decryptdata,O=this.hls;if(this.fragContextChanged(_))return;if(y&&y.byteLength>0&&T&&T.key&&T.iv&&T.method==="AES-128"){var g=performance.now();this.decrypter.webCryptoDecrypt(new Uint8Array(y),T.key.buffer,T.iv.buffer).then(function(F){var P=performance.now();O.trigger(R.Events.FRAG_DECRYPTED,{frag:_,payload:F,stats:{tstart:g,tdecrypt:P}})})}},m.doTick=function(){if(!this.media){this.state=o.State.IDLE;return}if(this.state===o.State.IDLE){var C,_=this.currentTrackId,y=this.levels;if(!y.length||!y[_]||!y[_].details)return;var T=y[_].details,O=T.targetduration,g=this.config,F=this.media,P=p.BufferHelper.bufferedInfo(this.mediaBufferTimeRanges,F.currentTime-O,g.maxBufferHole),N=P.end,X=P.len,j=this.getMaxBufferLength()+O;if(X>j)return;console.assert(T,"Subtitle track details are defined on idle subtitle stream controller tick");var A=T.fragments,K=A.length,U=T.edge,k,z=this.fragPrevious;if(N<U){var te=g.maxFragLookUpTolerance;z&&T.hasProgramDateTime&&(k=Object(E.findFragmentByPDT)(A,z.endProgramDateTime,te)),k||(k=Object(E.findFragmentByPTS)(z,A,N,te),!k&&z&&z.start<A[0].start&&(k=A[0]))}else k=A[K-1];(C=k)!==null&&C!==void 0&&C.encrypted?(M.logger.log("Loading key for "+k.sn),this.state=o.State.KEY_LOADING,this.hls.trigger(R.Events.KEY_LOADING,{frag:k})):k&&this.fragmentTracker.getState(k)===c.FragmentState.NOT_LOADED&&this.loadFragment(k,T,N)}},m.loadFragment=function(C,_,y){this.fragCurrent=C,f.prototype.loadFragment.call(this,C,_,y)},t(v,[{key:"mediaBufferTimeRanges",get:function(){return this.tracksBuffered[this.currentTrackId]||[]}}]),v}(o.default)},"./src/controller/subtitle-track-controller.ts":function(G,L,I){"use strict";I.r(L);var R=I("./src/events.ts"),M=I("./src/utils/texttrack-utils.ts"),p=I("./src/controller/base-playlist-controller.ts"),E=I("./src/types/loader.ts");function b(a,t){for(var r=0;r<t.length;r++){var s=t[r];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(a,s.key,s)}}function i(a,t,r){return t&&b(a.prototype,t),r&&b(a,r),a}function c(a,t){a.prototype=Object.create(t.prototype),a.prototype.constructor=a,o(a,t)}function o(a,t){return o=Object.setPrototypeOf||function(s,u){return s.__proto__=u,s},o(a,t)}var h=function(a){c(t,a);function t(s){var u;return u=a.call(this,s,"[subtitle-track-controller]")||this,u.media=null,u.tracks=[],u.groupId=null,u.tracksInGroup=[],u.trackId=-1,u.selectDefaultTrack=!0,u.queuedDefaultTrack=-1,u.trackChangeListener=function(){return u.onTextTracksChanged()},u.asyncPollTrackChange=function(){return u.pollTrackChange(0)},u.useTextTrackPolling=!1,u.subtitlePollingInterval=-1,u.subtitleDisplay=!0,u.registerListeners(),u}var r=t.prototype;return r.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.trackChangeListener=this.asyncPollTrackChange=null,a.prototype.destroy.call(this)},r.registerListeners=function(){var u=this.hls;u.on(R.Events.MEDIA_ATTACHED,this.onMediaAttached,this),u.on(R.Events.MEDIA_DETACHING,this.onMediaDetaching,this),u.on(R.Events.MANIFEST_LOADING,this.onManifestLoading,this),u.on(R.Events.MANIFEST_PARSED,this.onManifestParsed,this),u.on(R.Events.LEVEL_LOADING,this.onLevelLoading,this),u.on(R.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),u.on(R.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),u.on(R.Events.ERROR,this.onError,this)},r.unregisterListeners=function(){var u=this.hls;u.off(R.Events.MEDIA_ATTACHED,this.onMediaAttached,this),u.off(R.Events.MEDIA_DETACHING,this.onMediaDetaching,this),u.off(R.Events.MANIFEST_LOADING,this.onManifestLoading,this),u.off(R.Events.MANIFEST_PARSED,this.onManifestParsed,this),u.off(R.Events.LEVEL_LOADING,this.onLevelLoading,this),u.off(R.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),u.off(R.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),u.off(R.Events.ERROR,this.onError,this)},r.onMediaAttached=function(u,d){if(this.media=d.media,!this.media)return;this.queuedDefaultTrack>-1&&(this.subtitleTrack=this.queuedDefaultTrack,this.queuedDefaultTrack=-1),this.useTextTrackPolling=!(this.media.textTracks&&"onchange"in this.media.textTracks),this.useTextTrackPolling?this.pollTrackChange(500):this.media.textTracks.addEventListener("change",this.asyncPollTrackChange)},r.pollTrackChange=function(u){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.trackChangeListener,u)},r.onMediaDetaching=function(){if(!this.media)return;self.clearInterval(this.subtitlePollingInterval),this.useTextTrackPolling||this.media.textTracks.removeEventListener("change",this.asyncPollTrackChange),this.trackId>-1&&(this.queuedDefaultTrack=this.trackId);var u=n(this.media.textTracks);u.forEach(function(d){Object(M.clearCurrentCues)(d)}),this.subtitleTrack=-1,this.media=null},r.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.selectDefaultTrack=!0},r.onManifestParsed=function(u,d){this.tracks=d.subtitleTracks},r.onSubtitleTrackLoaded=function(u,d){var f=d.id,v=d.details,m=this.trackId,S=this.tracksInGroup[m];if(!S){this.warn("Invalid subtitle track id "+f);return}var C=S.details;S.details=d.details,this.log("subtitle track "+f+" loaded ["+v.startSN+"-"+v.endSN+"]"),f===this.trackId&&(this.retryCount=0,this.playlistLoaded(f,d,C))},r.onLevelLoading=function(u,d){this.switchLevel(d.level)},r.onLevelSwitching=function(u,d){this.switchLevel(d.level)},r.switchLevel=function(u){var d=this.hls.levels[u];if(!(d!=null&&d.textGroupIds))return;var f=d.textGroupIds[d.urlId];if(this.groupId!==f){var v=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0,m=this.tracks.filter(function(_){return!f||_.groupId===f});this.tracksInGroup=m;var S=this.findTrackId(v==null?void 0:v.name)||this.findTrackId();this.groupId=f;var C={subtitleTracks:m};this.log("Updating subtitle tracks, "+m.length+' track(s) found in "'+f+'" group-id'),this.hls.trigger(R.Events.SUBTITLE_TRACKS_UPDATED,C),S!==-1&&this.setSubtitleTrack(S,v)}},r.findTrackId=function(u){for(var d=this.tracksInGroup,f=0;f<d.length;f++){var v=d[f];if((!this.selectDefaultTrack||v.default)&&(!u||u===v.name))return v.id}return-1},r.onError=function(u,d){if(a.prototype.onError.call(this,u,d),d.fatal||!d.context)return;d.context.type===E.PlaylistContextType.SUBTITLE_TRACK&&d.context.id===this.trackId&&d.context.groupId===this.groupId&&this.retryLoadingOrFail(d)},r.loadPlaylist=function(u){var d=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(d)){var f=d.id,v=d.groupId,m=d.url;if(u)try{m=u.addDirectives(m)}catch(S){this.warn("Could not construct new URL with HLS Delivery Directives: "+S)}this.log("Loading subtitle playlist for id "+f),this.hls.trigger(R.Events.SUBTITLE_TRACK_LOADING,{url:m,id:f,groupId:v,deliveryDirectives:u||null})}},r.toggleTrackModes=function(u){var d=this,f=this.media,v=this.subtitleDisplay,m=this.trackId;if(!f)return;var S=n(f.textTracks),C=S.filter(function(T){return T.groupId===d.groupId});if(u===-1)[].slice.call(S).forEach(function(T){T.mode="disabled"});else{var _=C[m];_&&(_.mode="disabled")}var y=C[u];y&&(y.mode=v?"showing":"hidden")},r.setSubtitleTrack=function(u,d){var f,v=this.tracksInGroup;if(!this.media){this.queuedDefaultTrack=u;return}if(this.trackId!==u&&this.toggleTrackModes(u),this.trackId===u&&(u===-1||(f=v[u])!==null&&f!==void 0&&f.details)||u<-1||u>=v.length)return;this.clearTimer();var m=v[u];if(this.log("Switching to subtitle track "+u),this.trackId=u,m){var S=m.id,C=m.groupId,_=C===void 0?"":C,y=m.name,T=m.type,O=m.url;this.hls.trigger(R.Events.SUBTITLE_TRACK_SWITCH,{id:S,groupId:_,name:y,type:T,url:O});var g=this.switchParams(m.url,d==null?void 0:d.details);this.loadPlaylist(g)}else this.hls.trigger(R.Events.SUBTITLE_TRACK_SWITCH,{id:u})},r.onTextTracksChanged=function(){if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),!this.media||!this.hls.config.renderTextTracksNatively)return;for(var u=-1,d=n(this.media.textTracks),f=0;f<d.length;f++)if(d[f].mode==="hidden")u=f;else if(d[f].mode==="showing"){u=f;break}this.subtitleTrack!==u&&(this.subtitleTrack=u)},i(t,[{key:"subtitleTracks",get:function(){return this.tracksInGroup}},{key:"subtitleTrack",get:function(){return this.trackId},set:function(u){this.selectDefaultTrack=!1;var d=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0;this.setSubtitleTrack(u,d)}}]),t}(p.default);function n(a){for(var t=[],r=0;r<a.length;r++){var s=a[r];s.kind==="subtitles"&&s.label&&t.push(a[r])}return t}L.default=h},"./src/controller/timeline-controller.ts":function(G,L,I){"use strict";I.r(L),I.d(L,"TimelineController",function(){return n});var R=I("./src/polyfills/number.ts"),M=I("./src/events.ts"),p=I("./src/utils/cea-608-parser.ts"),E=I("./src/utils/output-filter.ts"),b=I("./src/utils/webvtt-parser.ts"),i=I("./src/utils/texttrack-utils.ts"),c=I("./src/utils/imsc1-ttml-parser.ts"),o=I("./src/types/loader.ts"),h=I("./src/utils/logger.ts"),n=function(){function s(d){if(this.hls=void 0,this.media=null,this.config=void 0,this.enabled=!0,this.Cues=void 0,this.textTracks=[],this.tracks=[],this.initPTS=[],this.timescale=[],this.unparsedVttFrags=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.cea608Parser1=void 0,this.cea608Parser2=void 0,this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=r(),this.captionsProperties=void 0,this.hls=d,this.config=d.config,this.Cues=d.config.cueHandler,this.captionsProperties={textTrack1:{label:this.config.captionsTextTrack1Label,languageCode:this.config.captionsTextTrack1LanguageCode},textTrack2:{label:this.config.captionsTextTrack2Label,languageCode:this.config.captionsTextTrack2LanguageCode},textTrack3:{label:this.config.captionsTextTrack3Label,languageCode:this.config.captionsTextTrack3LanguageCode},textTrack4:{label:this.config.captionsTextTrack4Label,languageCode:this.config.captionsTextTrack4LanguageCode}},this.config.enableCEA708Captions){var f=new E.default(this,"textTrack1"),v=new E.default(this,"textTrack2"),m=new E.default(this,"textTrack3"),S=new E.default(this,"textTrack4");this.cea608Parser1=new p.default(1,f,v),this.cea608Parser2=new p.default(3,m,S)}d.on(M.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),d.on(M.Events.MEDIA_DETACHING,this.onMediaDetaching,this),d.on(M.Events.MANIFEST_LOADING,this.onManifestLoading,this),d.on(M.Events.MANIFEST_LOADED,this.onManifestLoaded,this),d.on(M.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),d.on(M.Events.FRAG_LOADING,this.onFragLoading,this),d.on(M.Events.FRAG_LOADED,this.onFragLoaded,this),d.on(M.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),d.on(M.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),d.on(M.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),d.on(M.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),d.on(M.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)}var u=s.prototype;return u.destroy=function(){var f=this.hls;f.off(M.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),f.off(M.Events.MEDIA_DETACHING,this.onMediaDetaching,this),f.off(M.Events.MANIFEST_LOADING,this.onManifestLoading,this),f.off(M.Events.MANIFEST_LOADED,this.onManifestLoaded,this),f.off(M.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),f.off(M.Events.FRAG_LOADING,this.onFragLoading,this),f.off(M.Events.FRAG_LOADED,this.onFragLoaded,this),f.off(M.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),f.off(M.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),f.off(M.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),f.off(M.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),f.off(M.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),this.hls=this.config=this.cea608Parser1=this.cea608Parser2=null},u.addCues=function(f,v,m,S,C){for(var _=!1,y=C.length;y--;){var T=C[y],O=t(T[0],T[1],v,m);if(O>=0&&(T[0]=Math.min(T[0],v),T[1]=Math.max(T[1],m),_=!0,O/(m-v)>.5))return}if(_||C.push([v,m]),this.config.renderTextTracksNatively){var g=this.captionsTracks[f];this.Cues.newCue(g,v,m,S)}else{var F=this.Cues.newCue(null,v,m,S);this.hls.trigger(M.Events.CUES_PARSED,{type:"captions",cues:F,track:f})}},u.onInitPtsFound=function(f,v){var m=this,S=v.frag,C=v.id,_=v.initPTS,y=v.timescale,T=this.unparsedVttFrags;C==="main"&&(this.initPTS[S.cc]=_,this.timescale[S.cc]=y),T.length&&(this.unparsedVttFrags=[],T.forEach(function(O){m.onFragLoaded(M.Events.FRAG_LOADED,O)}))},u.getExistingTrack=function(f){var v=this.media;if(v)for(var m=0;m<v.textTracks.length;m++){var S=v.textTracks[m];if(S[f])return S}return null},u.createCaptionsTrack=function(f){this.config.renderTextTracksNatively?this.createNativeTrack(f):this.createNonNativeTrack(f)},u.createNativeTrack=function(f){if(this.captionsTracks[f])return;var v=this.captionsProperties,m=this.captionsTracks,S=this.media,C=v[f],_=C.label,y=C.languageCode,T=this.getExistingTrack(f);if(T)m[f]=T,Object(i.clearCurrentCues)(m[f]),Object(i.sendAddTrackEvent)(m[f],S);else{var O=this.createTextTrack("captions",_,y);O&&(O[f]=!0,m[f]=O)}},u.createNonNativeTrack=function(f){if(this.nonNativeCaptionsTracks[f])return;var v=this.captionsProperties[f];if(!v)return;var m=v.label,S={_id:f,label:m,kind:"captions",default:v.media?!!v.media.default:!1,closedCaptions:v.media};this.nonNativeCaptionsTracks[f]=S,this.hls.trigger(M.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:[S]})},u.createTextTrack=function(f,v,m){var S=this.media;return S?S.addTextTrack(f,v,m):void 0},u.onMediaAttaching=function(f,v){this.media=v.media,this._cleanTracks()},u.onMediaDetaching=function(){var f=this.captionsTracks;Object.keys(f).forEach(function(v){Object(i.clearCurrentCues)(f[v]),delete f[v]}),this.nonNativeCaptionsTracks={}},u.onManifestLoading=function(){this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=r(),this._cleanTracks(),this.tracks=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.textTracks=[],this.unparsedVttFrags=this.unparsedVttFrags||[],this.initPTS=[],this.timescale=[],this.cea608Parser1&&this.cea608Parser2&&(this.cea608Parser1.reset(),this.cea608Parser2.reset())},u._cleanTracks=function(){var f=this.media;if(!f)return;var v=f.textTracks;if(v)for(var m=0;m<v.length;m++)Object(i.clearCurrentCues)(v[m])},u.onSubtitleTracksUpdated=function(f,v){var m=this;this.textTracks=[];var S=v.subtitleTracks||[],C=S.some(function(O){return O.textCodec===c.IMSC1_CODEC});if(this.config.enableWebVTT||C&&this.config.enableIMSC1){var _=this.tracks&&S&&this.tracks.length===S.length;if(this.tracks=S||[],this.config.renderTextTracksNatively){var y=this.media?this.media.textTracks:[];this.tracks.forEach(function(O,g){var F;if(g<y.length){for(var P=null,N=0;N<y.length;N++)if(a(y[N],O)){P=y[N];break}P&&(F=P)}F?Object(i.clearCurrentCues)(F):(F=m.createTextTrack("subtitles",O.name,O.lang),F&&(F.mode="disabled")),F&&(F.groupId=O.groupId,m.textTracks.push(F))})}else if(!_&&this.tracks&&this.tracks.length){var T=this.tracks.map(function(O){return{label:O.name,kind:O.type.toLowerCase(),default:O.default,subtitleTrack:O}});this.hls.trigger(M.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:T})}}},u.onManifestLoaded=function(f,v){var m=this;this.config.enableCEA708Captions&&v.captions&&v.captions.forEach(function(S){var C=/(?:CC|SERVICE)([1-4])/.exec(S.instreamId);if(!C)return;var _="textTrack"+C[1],y=m.captionsProperties[_];if(!y)return;y.label=S.name,S.lang&&(y.languageCode=S.lang),y.media=S})},u.onFragLoading=function(f,v){var m=this.cea608Parser1,S=this.cea608Parser2,C=this.lastSn,_=this.lastPartIndex;if(!this.enabled||!(m&&S))return;if(v.frag.type===o.PlaylistLevelType.MAIN){var y,T,O=v.frag.sn,g=(y=v==null||((T=v.part)===null||T===void 0)?void 0:T.index)!=null?y:-1;O===C+1||O===C&&g===_+1||(m.reset(),S.reset()),this.lastSn=O,this.lastPartIndex=g}},u.onFragLoaded=function(f,v){var m=v.frag,S=v.payload,C=this.initPTS,_=this.unparsedVttFrags;if(m.type===o.PlaylistLevelType.SUBTITLE)if(S.byteLength){if(!Object(R.isFiniteNumber)(C[m.cc])){_.push(v),C.length&&this.hls.trigger(M.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:m,error:new Error("Missing initial subtitle PTS")});return}var y=m.decryptdata;if(y==null||y.key==null||y.method!=="AES-128"){var T=this.tracks[m.level],O=this.vttCCs;O[m.cc]||(O[m.cc]={start:m.start,prevCC:this.prevCC,new:!0},this.prevCC=m.cc),T&&T.textCodec===c.IMSC1_CODEC?this._parseIMSC1(m,S):this._parseVTTs(m,S,O)}}else this.hls.trigger(M.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:m,error:new Error("Empty subtitle payload")})},u._parseIMSC1=function(f,v){var m=this,S=this.hls;Object(c.parseIMSC1)(v,this.initPTS[f.cc],this.timescale[f.cc],function(C){m._appendCues(C,f.level),S.trigger(M.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:f})},function(C){h.logger.log("Failed to parse IMSC1: "+C),S.trigger(M.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:f,error:C})})},u._parseVTTs=function(f,v,m){var S=this,C=this.hls;Object(b.parseWebVTT)(v,this.initPTS[f.cc],this.timescale[f.cc],m,f.cc,f.start,function(_){S._appendCues(_,f.level),C.trigger(M.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:f})},function(_){S._fallbackToIMSC1(f,v),h.logger.log("Failed to parse VTT cue: "+_),C.trigger(M.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:f,error:_})})},u._fallbackToIMSC1=function(f,v){var m=this,S=this.tracks[f.level];S.textCodec||Object(c.parseIMSC1)(v,this.initPTS[f.cc],this.timescale[f.cc],function(){S.textCodec=c.IMSC1_CODEC,m._parseIMSC1(f,v)},function(){S.textCodec="wvtt"})},u._appendCues=function(f,v){var m=this.hls;if(this.config.renderTextTracksNatively){var S=this.textTracks[v];if(S.mode==="disabled")return;f.forEach(function(y){return Object(i.addCueToTrack)(S,y)})}else{var C=this.tracks[v],_=C.default?"default":"subtitles"+v;m.trigger(M.Events.CUES_PARSED,{type:"subtitles",cues:f,track:_})}},u.onFragDecrypted=function(f,v){var m=v.frag;if(m.type===o.PlaylistLevelType.SUBTITLE){if(!Object(R.isFiniteNumber)(this.initPTS[m.cc])){this.unparsedVttFrags.push(v);return}this.onFragLoaded(M.Events.FRAG_LOADED,v)}},u.onSubtitleTracksCleared=function(){this.tracks=[],this.captionsTracks={}},u.onFragParsingUserdata=function(f,v){var m=this.cea608Parser1,S=this.cea608Parser2;if(!this.enabled||!(m&&S))return;for(var C=0;C<v.samples.length;C++){var _=v.samples[C].bytes;if(_){var y=this.extractCea608Data(_);m.addData(v.samples[C].pts,y[0]),S.addData(v.samples[C].pts,y[1])}}},u.onBufferFlushing=function(f,v){var m=v.startOffset,S=v.endOffset,C=v.endOffsetSubtitles,_=v.type,y=this.media;if(!y||y.currentTime<S)return;if(!_||_==="video"){var T=this.captionsTracks;Object.keys(T).forEach(function(g){return Object(i.removeCuesInRange)(T[g],m,S)})}if(this.config.renderTextTracksNatively&&(m===0&&C!==void 0)){var O=this.textTracks;Object.keys(O).forEach(function(g){return Object(i.removeCuesInRange)(O[g],m,C)})}},u.extractCea608Data=function(f){for(var v=f[0]&31,m=2,S=[[],[]],C=0;C<v;C++){var _=f[m++],y=127&f[m++],T=127&f[m++],O=(4&_)!==0,g=3&_;if(y===0&&T===0)continue;O&&((g===0||g===1)&&(S[g].push(y),S[g].push(T)))}return S},s}();function a(s,u){return s&&s.label===u.name&&!(s.textTrack1||s.textTrack2)}function t(s,u,d,f){return Math.min(u,f)-Math.max(s,d)}function r(){return{ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!1}}}},"./src/crypt/aes-crypto.ts":function(G,L,I){"use strict";I.r(L),I.d(L,"default",function(){return R});var R=function(){function M(E,b){this.subtle=void 0,this.aesIV=void 0,this.subtle=E,this.aesIV=b}var p=M.prototype;return p.decrypt=function(b,i){return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},i,b)},M}()},"./src/crypt/aes-decryptor.ts":function(G,L,I){"use strict";I.r(L),I.d(L,"removePadding",function(){return M}),I.d(L,"default",function(){return p});var R=I("./src/utils/typed-array.ts");function M(E){var b=E.byteLength,i=b&&new DataView(E.buffer).getUint8(b-1);return i?Object(R.sliceUint8)(E,0,b-i):E}var p=function(){function E(){this.rcon=[0,1,2,4,8,16,32,64,128,27,54],this.subMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.invSubMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.sBox=new Uint32Array(256),this.invSBox=new Uint32Array(256),this.key=new Uint32Array(0),this.ksRows=0,this.keySize=0,this.keySchedule=void 0,this.invKeySchedule=void 0,this.initTable()}var b=E.prototype;return b.uint8ArrayToUint32Array_=function(c){for(var o=new DataView(c),h=new Uint32Array(4),n=0;n<4;n++)h[n]=o.getUint32(n*4);return h},b.initTable=function(){var c=this.sBox,o=this.invSBox,h=this.subMix,n=h[0],a=h[1],t=h[2],r=h[3],s=this.invSubMix,u=s[0],d=s[1],f=s[2],v=s[3],m=new Uint32Array(256),S=0,C=0,_=0;for(_=0;_<256;_++)_<128?m[_]=_<<1:m[_]=_<<1^283;for(_=0;_<256;_++){var y=C^C<<1^C<<2^C<<3^C<<4;y=y>>>8^y&255^99,c[S]=y,o[y]=S;var T=m[S],O=m[T],g=m[O],F=m[y]*257^y*16843008;n[S]=F<<24|F>>>8,a[S]=F<<16|F>>>16,t[S]=F<<8|F>>>24,r[S]=F,F=g*16843009^O*65537^T*257^S*16843008,u[y]=F<<24|F>>>8,d[y]=F<<16|F>>>16,f[y]=F<<8|F>>>24,v[y]=F,S?(S=T^m[m[m[g^T]]],C^=m[m[C]]):S=C=1}},b.expandKey=function(c){for(var o=this.uint8ArrayToUint32Array_(c),h=!0,n=0;n<o.length&&h;)h=o[n]===this.key[n],n++;if(h)return;this.key=o;var a=this.keySize=o.length;if(a!==4&&a!==6&&a!==8)throw new Error("Invalid aes key size="+a);var t=this.ksRows=(a+6+1)*4,r,s,u=this.keySchedule=new Uint32Array(t),d=this.invKeySchedule=new Uint32Array(t),f=this.sBox,v=this.rcon,m=this.invSubMix,S=m[0],C=m[1],_=m[2],y=m[3],T,O;for(r=0;r<t;r++){if(r<a){T=u[r]=o[r];continue}O=T,r%a===0?(O=O<<8|O>>>24,O=f[O>>>24]<<24|f[O>>>16&255]<<16|f[O>>>8&255]<<8|f[O&255],O^=v[r/a|0]<<24):a>6&&r%a===4&&(O=f[O>>>24]<<24|f[O>>>16&255]<<16|f[O>>>8&255]<<8|f[O&255]),u[r]=T=(u[r-a]^O)>>>0}for(s=0;s<t;s++)r=t-s,s&3?O=u[r]:O=u[r-4],s<4||r<=4?d[s]=O:d[s]=S[f[O>>>24]]^C[f[O>>>16&255]]^_[f[O>>>8&255]]^y[f[O&255]],d[s]=d[s]>>>0},b.networkToHostOrderSwap=function(c){return c<<24|(c&65280)<<8|(c&16711680)>>8|c>>>24},b.decrypt=function(c,o,h){for(var n=this.keySize+6,a=this.invKeySchedule,t=this.invSBox,r=this.invSubMix,s=r[0],u=r[1],d=r[2],f=r[3],v=this.uint8ArrayToUint32Array_(h),m=v[0],S=v[1],C=v[2],_=v[3],y=new Int32Array(c),T=new Int32Array(y.length),O,g,F,P,N,X,j,A,K,U,k,z,te,de,be=this.networkToHostOrderSwap;o<y.length;){for(K=be(y[o]),U=be(y[o+1]),k=be(y[o+2]),z=be(y[o+3]),N=K^a[0],X=z^a[1],j=k^a[2],A=U^a[3],te=4,de=1;de<n;de++)O=s[N>>>24]^u[X>>16&255]^d[j>>8&255]^f[A&255]^a[te],g=s[X>>>24]^u[j>>16&255]^d[A>>8&255]^f[N&255]^a[te+1],F=s[j>>>24]^u[A>>16&255]^d[N>>8&255]^f[X&255]^a[te+2],P=s[A>>>24]^u[N>>16&255]^d[X>>8&255]^f[j&255]^a[te+3],N=O,X=g,j=F,A=P,te=te+4;O=t[N>>>24]<<24^t[X>>16&255]<<16^t[j>>8&255]<<8^t[A&255]^a[te],g=t[X>>>24]<<24^t[j>>16&255]<<16^t[A>>8&255]<<8^t[N&255]^a[te+1],F=t[j>>>24]<<24^t[A>>16&255]<<16^t[N>>8&255]<<8^t[X&255]^a[te+2],P=t[A>>>24]<<24^t[N>>16&255]<<16^t[X>>8&255]<<8^t[j&255]^a[te+3],T[o]=be(O^m),T[o+1]=be(P^S),T[o+2]=be(F^C),T[o+3]=be(g^_),m=K,S=U,C=k,_=z,o=o+4}return T.buffer},E}()},"./src/crypt/decrypter.ts":function(G,L,I){"use strict";I.r(L),I.d(L,"default",function(){return o});var R=I("./src/crypt/aes-crypto.ts"),M=I("./src/crypt/fast-aes-key.ts"),p=I("./src/crypt/aes-decryptor.ts"),E=I("./src/utils/logger.ts"),b=I("./src/utils/mp4-tools.ts"),i=I("./src/utils/typed-array.ts"),c=16,o=function(){function h(a,t,r){var s=r===void 0?{}:r,u=s.removePKCS7Padding,d=u===void 0?!0:u;if(this.logEnabled=!0,this.observer=void 0,this.config=void 0,this.removePKCS7Padding=void 0,this.subtle=null,this.softwareDecrypter=null,this.key=null,this.fastAesKey=null,this.remainderData=null,this.currentIV=null,this.currentResult=null,this.observer=a,this.config=t,this.removePKCS7Padding=d,d)try{var f=self.crypto;f&&(this.subtle=f.subtle||f.webkitSubtle)}catch(v){}this.subtle===null&&(this.config.enableSoftwareAES=!0)}var n=h.prototype;return n.destroy=function(){this.observer=null},n.isSync=function(){return this.config.enableSoftwareAES},n.flush=function(){var t=this.currentResult;if(!t){this.reset();return}var r=new Uint8Array(t);return this.reset(),this.removePKCS7Padding?Object(p.removePadding)(r):r},n.reset=function(){this.currentResult=null,this.currentIV=null,this.remainderData=null,this.softwareDecrypter&&(this.softwareDecrypter=null)},n.decrypt=function(t,r,s,u){if(this.config.enableSoftwareAES){this.softwareDecrypt(new Uint8Array(t),r,s);var d=this.flush();d&&u(d.buffer)}else this.webCryptoDecrypt(new Uint8Array(t),r,s).then(u)},n.softwareDecrypt=function(t,r,s){var u=this.currentIV,d=this.currentResult,f=this.remainderData;this.logOnce("JS AES decrypt"),f&&(t=Object(b.appendUint8Array)(f,t),this.remainderData=null);var v=this.getValidChunk(t);if(!v.length)return null;u&&(s=u);var m=this.softwareDecrypter;m||(m=this.softwareDecrypter=new p.default),m.expandKey(r);var S=d;return this.currentResult=m.decrypt(v.buffer,0,s),this.currentIV=Object(i.sliceUint8)(v,-16).buffer,S||null},n.webCryptoDecrypt=function(t,r,s){var u=this,d=this.subtle;return(this.key!==r||!this.fastAesKey)&&(this.key=r,this.fastAesKey=new M.default(d,r)),this.fastAesKey.expandKey().then(function(f){if(!d)return Promise.reject(new Error("web crypto not initialized"));var v=new R.default(d,s);return v.decrypt(t.buffer,f)}).catch(function(f){return u.onWebCryptoError(f,t,r,s)})},n.onWebCryptoError=function(t,r,s,u){return E.logger.warn("[decrypter.ts]: WebCrypto Error, disable WebCrypto API:",t),this.config.enableSoftwareAES=!0,this.logEnabled=!0,this.softwareDecrypt(r,s,u)},n.getValidChunk=function(t){var r=t,s=t.length-t.length%c;return s!==t.length&&(r=Object(i.sliceUint8)(t,0,s),this.remainderData=Object(i.sliceUint8)(t,s)),r},n.logOnce=function(t){if(!this.logEnabled)return;E.logger.log("[decrypter.ts]: "+t),this.logEnabled=!1},h}()},"./src/crypt/fast-aes-key.ts":function(G,L,I){"use strict";I.r(L),I.d(L,"default",function(){return R});var R=function(){function M(E,b){this.subtle=void 0,this.key=void 0,this.subtle=E,this.key=b}var p=M.prototype;return p.expandKey=function(){return this.subtle.importKey("raw",this.key,{name:"AES-CBC"},!1,["encrypt","decrypt"])},M}()},"./src/demux/aacdemuxer.ts":function(G,L,I){"use strict";I.r(L);var R=I("./src/demux/base-audio-demuxer.ts"),M=I("./src/demux/adts.ts"),p=I("./src/utils/logger.ts"),E=I("./src/demux/id3.ts");function b(o,h){o.prototype=Object.create(h.prototype),o.prototype.constructor=o,i(o,h)}function i(o,h){return i=Object.setPrototypeOf||function(a,t){return a.__proto__=t,a},i(o,h)}var c=function(o){b(h,o);function h(a,t){var r;return r=o.call(this)||this,r.observer=void 0,r.config=void 0,r.observer=a,r.config=t,r}var n=h.prototype;return n.resetInitSegment=function(t,r,s){o.prototype.resetInitSegment.call(this,t,r,s),this._audioTrack={container:"audio/adts",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!0,samples:[],manifestCodec:t,duration:s,inputTimeScale:9e4,dropped:0}},h.probe=function(t){if(!t)return!1;for(var r=E.getID3Data(t,0)||[],s=r.length,u=t.length;s<u;s++)if(M.probe(t,s))return p.logger.log("ADTS sync word found !"),!0;return!1},n.canParse=function(t,r){return M.canParse(t,r)},n.appendFrame=function(t,r,s){M.initTrackConfig(t,this.observer,r,s,t.manifestCodec);var u=M.appendFrame(t,r,s,this.initPTS,this.frameIndex);if(u&&u.missing===0)return u},h}(R.default);c.minProbeByteLength=9,L.default=c},"./src/demux/adts.ts":function(G,L,I){"use strict";I.r(L),I.d(L,"getAudioConfig",function(){return E}),I.d(L,"isHeaderPattern",function(){return b}),I.d(L,"getHeaderLength",function(){return i}),I.d(L,"getFullFrameLength",function(){return c}),I.d(L,"canGetFrameLength",function(){return o}),I.d(L,"isHeader",function(){return h}),I.d(L,"canParse",function(){return n}),I.d(L,"probe",function(){return a}),I.d(L,"initTrackConfig",function(){return t}),I.d(L,"getFrameDuration",function(){return r}),I.d(L,"parseFrameHeader",function(){return s}),I.d(L,"appendFrame",function(){return u});var R=I("./src/utils/logger.ts"),M=I("./src/errors.ts"),p=I("./src/events.ts");function E(d,f,v,m){var S,C,_,y,T=navigator.userAgent.toLowerCase(),O=m,g=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];S=((f[v+2]&192)>>>6)+1;var F=(f[v+2]&60)>>>2;if(F>g.length-1){d.trigger(p.Events.ERROR,{type:M.ErrorTypes.MEDIA_ERROR,details:M.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"invalid ADTS sampling index:"+F});return}return _=(f[v+2]&1)<<2,_|=(f[v+3]&192)>>>6,R.logger.log("manifest codec:"+m+", ADTS type:"+S+", samplingIndex:"+F),/firefox/i.test(T)?F>=6?(S=5,y=new Array(4),C=F-3):(S=2,y=new Array(2),C=F):T.indexOf("android")!==-1?(S=2,y=new Array(2),C=F):(S=5,y=new Array(4),m&&(m.indexOf("mp4a.40.29")!==-1||m.indexOf("mp4a.40.5")!==-1)||!m&&F>=6?C=F-3:((m&&m.indexOf("mp4a.40.2")!==-1&&(F>=6&&_===1||/vivaldi/i.test(T))||!m&&_===1)&&(S=2,y=new Array(2)),C=F)),y[0]=S<<3,y[0]|=(F&14)>>1,y[1]|=(F&1)<<7,y[1]|=_<<3,S===5&&(y[1]|=(C&14)>>1,y[2]=(C&1)<<7,y[2]|=2<<2,y[3]=0),{config:y,samplerate:g[F],channelCount:_,codec:"mp4a.40."+S,manifestCodec:O}}function b(d,f){return d[f]===255&&(d[f+1]&246)===240}function i(d,f){return d[f+1]&1?7:9}function c(d,f){return(d[f+3]&3)<<11|d[f+4]<<3|(d[f+5]&224)>>>5}function o(d,f){return f+5<d.length}function h(d,f){return f+1<d.length&&b(d,f)}function n(d,f){return o(d,f)&&b(d,f)&&c(d,f)<=d.length-f}function a(d,f){if(h(d,f)){var v=i(d,f);if(f+v>=d.length)return!1;var m=c(d,f);if(m<=v)return!1;var S=f+m;return S===d.length||h(d,S)}return!1}function t(d,f,v,m,S){if(!d.samplerate){var C=E(f,v,m,S);if(!C)return;d.config=C.config,d.samplerate=C.samplerate,d.channelCount=C.channelCount,d.codec=C.codec,d.manifestCodec=C.manifestCodec,R.logger.log("parsed codec:"+d.codec+", rate:"+C.samplerate+", channels:"+C.channelCount)}}function r(d){return 1024*9e4/d}function s(d,f,v,m,S){var C=i(d,f),_=c(d,f);if(_-=C,_>0){var y=v+m*S;return{headerLength:C,frameLength:_,stamp:y}}}function u(d,f,v,m,S){var C=r(d.samplerate),_=s(f,v,m,S,C);if(_){var y=_.frameLength,T=_.headerLength,O=_.stamp,g=T+y,F=Math.max(0,v+g-f.length),P;F?(P=new Uint8Array(g-T),P.set(f.subarray(v+T,f.length),0)):P=f.subarray(v+T,v+g);var N={unit:P,pts:O};return F||d.samples.push(N),{sample:N,length:g,missing:F}}}},"./src/demux/base-audio-demuxer.ts":function(G,L,I){"use strict";I.r(L),I.d(L,"initPTSFn",function(){return c});var R=I("./src/polyfills/number.ts"),M=I("./src/demux/id3.ts"),p=I("./src/demux/dummy-demuxed-track.ts"),E=I("./src/utils/mp4-tools.ts"),b=I("./src/utils/typed-array.ts"),i=function(){function o(){this._audioTrack=void 0,this._id3Track=void 0,this.frameIndex=0,this.cachedData=null,this.initPTS=null}var h=o.prototype;return h.resetInitSegment=function(a,t,r){this._id3Track={type:"id3",id:3,pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0}},h.resetTimeStamp=function(){},h.resetContiguity=function(){},h.canParse=function(a,t){return!1},h.appendFrame=function(a,t,r){},h.demux=function(a,t){this.cachedData&&(a=Object(E.appendUint8Array)(this.cachedData,a),this.cachedData=null);var r=M.getID3Data(a,0),s=r?r.length:0,u,d,f=this._audioTrack,v=this._id3Track,m=r?M.getTimeStamp(r):void 0,S=a.length;for((this.frameIndex===0||this.initPTS===null)&&(this.initPTS=c(m,t)),r&&r.length>0&&v.samples.push({pts:this.initPTS,dts:this.initPTS,data:r}),d=this.initPTS;s<S;){if(this.canParse(a,s)){var C=this.appendFrame(f,a,s);C?(this.frameIndex++,d=C.sample.pts,s+=C.length,u=s):s=S}else M.canParse(a,s)?(r=M.getID3Data(a,s),v.samples.push({pts:d,dts:d,data:r}),s+=r.length,u=s):s++;if(s===S&&u!==S){var _=Object(b.sliceUint8)(a,u);this.cachedData?this.cachedData=Object(E.appendUint8Array)(this.cachedData,_):this.cachedData=_}}return{audioTrack:f,avcTrack:Object(p.dummyTrack)(),id3Track:v,textTrack:Object(p.dummyTrack)()}},h.demuxSampleAes=function(a,t,r){return Promise.reject(new Error("["+this+"] This demuxer does not support Sample-AES decryption"))},h.flush=function(a){var t=this.cachedData;return t&&(this.cachedData=null,this.demux(t,0)),this.frameIndex=0,{audioTrack:this._audioTrack,avcTrack:Object(p.dummyTrack)(),id3Track:this._id3Track,textTrack:Object(p.dummyTrack)()}},h.destroy=function(){},o}(),c=function(h,n){return Object(R.isFiniteNumber)(h)?h*90:n*9e4};L.default=i},"./src/demux/chunk-cache.ts":function(G,L,I){"use strict";I.r(L),I.d(L,"default",function(){return R});var R=function(){function p(){this.chunks=[],this.dataLength=0}var E=p.prototype;return E.push=function(i){this.chunks.push(i),this.dataLength+=i.length},E.flush=function(){var i=this.chunks,c=this.dataLength,o;if(i.length)i.length===1?o=i[0]:o=M(i,c);else return new Uint8Array(0);return this.reset(),o},E.reset=function(){this.chunks.length=0,this.dataLength=0},p}();function M(p,E){for(var b=new Uint8Array(E),i=0,c=0;c<p.length;c++){var o=p[c];b.set(o,i),i+=o.length}return b}},"./src/demux/dummy-demuxed-track.ts":function(G,L,I){"use strict";I.r(L),I.d(L,"dummyTrack",function(){return R});function R(){return{type:"",id:-1,pid:-1,inputTimeScale:9e4,sequenceNumber:-1,samples:[],dropped:0}}},"./src/demux/exp-golomb.ts":function(G,L,I){"use strict";I.r(L);var R=I("./src/utils/logger.ts"),M=function(){function p(b){this.data=void 0,this.bytesAvailable=void 0,this.word=void 0,this.bitsAvailable=void 0,this.data=b,this.bytesAvailable=b.byteLength,this.word=0,this.bitsAvailable=0}var E=p.prototype;return E.loadWord=function(){var i=this.data,c=this.bytesAvailable,o=i.byteLength-c,h=new Uint8Array(4),n=Math.min(4,c);if(n===0)throw new Error("no bytes available");h.set(i.subarray(o,o+n)),this.word=new DataView(h.buffer).getUint32(0),this.bitsAvailable=n*8,this.bytesAvailable-=n},E.skipBits=function(i){var c;this.bitsAvailable>i?(this.word<<=i,this.bitsAvailable-=i):(i-=this.bitsAvailable,c=i>>3,i-=c>>3,this.bytesAvailable-=c,this.loadWord(),this.word<<=i,this.bitsAvailable-=i)},E.readBits=function(i){var c=Math.min(this.bitsAvailable,i),o=this.word>>>32-c;return i>32&&R.logger.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=c,this.bitsAvailable>0?this.word<<=c:this.bytesAvailable>0&&this.loadWord(),c=i-c,c>0&&this.bitsAvailable?o<<c|this.readBits(c):o},E.skipLZ=function(){var i;for(i=0;i<this.bitsAvailable;++i)if((this.word&2147483648>>>i)!==0)return this.word<<=i,this.bitsAvailable-=i,i;return this.loadWord(),i+this.skipLZ()},E.skipUEG=function(){this.skipBits(1+this.skipLZ())},E.skipEG=function(){this.skipBits(1+this.skipLZ())},E.readUEG=function(){var i=this.skipLZ();return this.readBits(i+1)-1},E.readEG=function(){var i=this.readUEG();return 1&i?1+i>>>1:-1*(i>>>1)},E.readBoolean=function(){return this.readBits(1)===1},E.readUByte=function(){return this.readBits(8)},E.readUShort=function(){return this.readBits(16)},E.readUInt=function(){return this.readBits(32)},E.skipScalingList=function(i){for(var c=8,o=8,h,n=0;n<i;n++)o!==0&&(h=this.readEG(),o=(c+h+256)%256),c=o===0?c:o},E.readSPS=function(){var i=0,c=0,o=0,h=0,n,a,t,r=this.readUByte.bind(this),s=this.readBits.bind(this),u=this.readUEG.bind(this),d=this.readBoolean.bind(this),f=this.skipBits.bind(this),v=this.skipEG.bind(this),m=this.skipUEG.bind(this),S=this.skipScalingList.bind(this);r();var C=r();if(s(5),f(3),r(),m(),C===100||C===110||C===122||C===244||C===44||C===83||C===86||C===118||C===128){var _=u();if(_===3&&f(1),m(),m(),f(1),d())for(a=_!==3?8:12,t=0;t<a;t++)d()&&(t<6?S(16):S(64))}m();var y=u();if(y===0)u();else if(y===1)for(f(1),v(),v(),n=u(),t=0;t<n;t++)v();m(),f(1);var T=u(),O=u(),g=s(1);g===0&&f(1),f(1),d()&&(i=u(),c=u(),o=u(),h=u());var F=[1,1];if(d()&&d()){var P=r();switch(P){case 1:F=[1,1];break;case 2:F=[12,11];break;case 3:F=[10,11];break;case 4:F=[16,11];break;case 5:F=[40,33];break;case 6:F=[24,11];break;case 7:F=[20,11];break;case 8:F=[32,11];break;case 9:F=[80,33];break;case 10:F=[18,11];break;case 11:F=[15,11];break;case 12:F=[64,33];break;case 13:F=[160,99];break;case 14:F=[4,3];break;case 15:F=[3,2];break;case 16:F=[2,1];break;case 255:{F=[r()<<8|r(),r()<<8|r()];break}}}return{width:Math.ceil((T+1)*16-i*2-c*2),height:(2-g)*(O+1)*16-(g?2:4)*(o+h),pixelRatio:F}},E.readSliceType=function(){return this.readUByte(),this.readUEG(),this.readUEG()},p}();L.default=M},"./src/demux/id3.ts":function(G,L,I){"use strict";I.r(L),I.d(L,"isHeader",function(){return R}),I.d(L,"isFooter",function(){return M}),I.d(L,"getID3Data",function(){return p}),I.d(L,"canParse",function(){return b}),I.d(L,"getTimeStamp",function(){return i}),I.d(L,"isTimeStampFrame",function(){return c}),I.d(L,"getID3Frames",function(){return h}),I.d(L,"decodeFrame",function(){return n}),I.d(L,"utf8ArrayToStr",function(){return u}),I.d(L,"testables",function(){return d});var R=function(S,C){return C+10<=S.length&&(S[C]===73&&S[C+1]===68&&S[C+2]===51&&(S[C+3]<255&&S[C+4]<255&&(S[C+6]<128&&S[C+7]<128&&S[C+8]<128&&S[C+9]<128)))},M=function(S,C){return C+10<=S.length&&(S[C]===51&&S[C+1]===68&&S[C+2]===73&&(S[C+3]<255&&S[C+4]<255&&(S[C+6]<128&&S[C+7]<128&&S[C+8]<128&&S[C+9]<128)))},p=function(S,C){for(var _=C,y=0;R(S,C);){y+=10;var T=E(S,C+6);y+=T,M(S,C+10)&&(y+=10),C+=y}return y>0?S.subarray(_,_+y):void 0},E=function(S,C){var _=0;return _=(S[C]&127)<<21,_|=(S[C+1]&127)<<14,_|=(S[C+2]&127)<<7,_|=S[C+3]&127,_},b=function(S,C){return R(S,C)&&E(S,C+6)+10<=S.length-C},i=function(S){for(var C=h(S),_=0;_<C.length;_++){var y=C[_];if(c(y))return s(y)}return},c=function(S){return S&&S.key==="PRIV"&&S.info==="com.apple.streaming.transportStreamTimestamp"},o=function(S){var C=String.fromCharCode(S[0],S[1],S[2],S[3]),_=E(S,4),y=10;return{type:C,size:_,data:S.subarray(y,y+_)}},h=function(S){for(var C=0,_=[];R(S,C);){var y=E(S,C+6);C+=10;for(var T=C+y;C+8<T;){var O=o(S.subarray(C)),g=n(O);g&&_.push(g),C+=O.size+10}M(S,C)&&(C+=10)}return _},n=function(S){return S.type==="PRIV"?a(S):S.type[0]==="W"?r(S):t(S)},a=function(S){if(S.size<2)return;var C=u(S.data,!0),_=new Uint8Array(S.data.subarray(C.length+1));return{key:S.type,info:C,data:_.buffer}},t=function(S){if(S.size<2)return;if(S.type==="TXXX"){var C=1,_=u(S.data.subarray(C),!0);C+=_.length+1;var y=u(S.data.subarray(C));return{key:S.type,info:_,data:y}}var T=u(S.data.subarray(1));return{key:S.type,data:T}},r=function(S){if(S.type==="WXXX"){if(S.size<2)return;var C=1,_=u(S.data.subarray(C),!0);C+=_.length+1;var y=u(S.data.subarray(C));return{key:S.type,info:_,data:y}}var T=u(S.data);return{key:S.type,data:T}},s=function(S){if(S.data.byteLength===8){var C=new Uint8Array(S.data),_=C[3]&1,y=(C[4]<<23)+(C[5]<<15)+(C[6]<<7)+C[7];return y/=45,_&&(y+=4772185884e-2),Math.round(y)}return},u=function(S,C){C===void 0&&(C=!1);var _=v();if(_){var y=_.decode(S);if(C){var T=y.indexOf("\0");return T!==-1?y.substring(0,T):y}return y.replace(/\0/g,"")}for(var O=S.length,g,F,P,N="",X=0;X<O;){if(g=S[X++],g===0&&C)return N;if(g===0||g===3)continue;switch(g>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:N+=String.fromCharCode(g);break;case 12:case 13:F=S[X++],N+=String.fromCharCode((g&31)<<6|F&63);break;case 14:F=S[X++],P=S[X++],N+=String.fromCharCode((g&15)<<12|(F&63)<<6|(P&63)<<0);break;default:}}return N},d={decodeTextFrame:t},f;function v(){return!f&&typeof self.TextDecoder!="undefined"&&(f=new self.TextDecoder("utf-8")),f}},"./src/demux/mp3demuxer.ts":function(G,L,I){"use strict";I.r(L);var R=I("./src/demux/base-audio-demuxer.ts"),M=I("./src/demux/id3.ts"),p=I("./src/utils/logger.ts"),E=I("./src/demux/mpegaudio.ts");function b(o,h){o.prototype=Object.create(h.prototype),o.prototype.constructor=o,i(o,h)}function i(o,h){return i=Object.setPrototypeOf||function(a,t){return a.__proto__=t,a},i(o,h)}var c=function(o){b(h,o);function h(){return o.apply(this,arguments)||this}var n=h.prototype;return n.resetInitSegment=function(t,r,s){o.prototype.resetInitSegment.call(this,t,r,s),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!1,samples:[],manifestCodec:t,duration:s,inputTimeScale:9e4,dropped:0}},h.probe=function(t){if(!t)return!1;for(var r=M.getID3Data(t,0)||[],s=r.length,u=t.length;s<u;s++)if(E.probe(t,s))return p.logger.log("MPEG Audio sync word found !"),!0;return!1},n.canParse=function(t,r){return E.canParse(t,r)},n.appendFrame=function(t,r,s){return this.initPTS===null?void 0:E.appendFrame(t,r,s,this.initPTS,this.frameIndex)},h}(R.default);c.minProbeByteLength=4,L.default=c},"./src/demux/mp4demuxer.ts":function(G,L,I){"use strict";I.r(L);var R=I("./src/utils/mp4-tools.ts"),M=I("./src/demux/dummy-demuxed-track.ts"),p=function(){function E(i,c){this.remainderData=null,this.config=void 0,this.config=c}var b=E.prototype;return b.resetTimeStamp=function(){},b.resetInitSegment=function(){},b.resetContiguity=function(){},E.probe=function(c){return Object(R.findBox)({data:c,start:0,end:Math.min(c.length,16384)},["moof"]).length>0},b.demux=function(c){var o=c,h=Object(M.dummyTrack)();if(this.config.progressive){this.remainderData&&(o=Object(R.appendUint8Array)(this.remainderData,c));var n=Object(R.segmentValidRange)(o);this.remainderData=n.remainder,h.samples=n.valid||new Uint8Array}else h.samples=o;return{audioTrack:Object(M.dummyTrack)(),avcTrack:h,id3Track:Object(M.dummyTrack)(),textTrack:Object(M.dummyTrack)()}},b.flush=function(){var c=Object(M.dummyTrack)();return c.samples=this.remainderData||new Uint8Array,this.remainderData=null,{audioTrack:Object(M.dummyTrack)(),avcTrack:c,id3Track:Object(M.dummyTrack)(),textTrack:Object(M.dummyTrack)()}},b.demuxSampleAes=function(c,o,h){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))},b.destroy=function(){},E}();p.minProbeByteLength=1024,L.default=p},"./src/demux/mpegaudio.ts":function(G,L,I){"use strict";I.r(L),I.d(L,"appendFrame",function(){return i}),I.d(L,"parseHeader",function(){return c}),I.d(L,"isHeaderPattern",function(){return o}),I.d(L,"isHeader",function(){return h}),I.d(L,"canParse",function(){return n}),I.d(L,"probe",function(){return a});var R=null,M=[32,64,96,128,160,192,224,256,288,320,352,384,416,448,32,48,56,64,80,96,112,128,160,192,224,256,320,384,32,40,48,56,64,80,96,112,128,160,192,224,256,320,32,48,56,64,80,96,112,128,144,160,176,192,224,256,8,16,24,32,40,48,56,64,80,96,112,128,144,160],p=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],E=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],b=[0,1,1,4];function i(t,r,s,u,d){if(s+24>r.length)return;var f=c(r,s);if(f&&s+f.frameLength<=r.length){var v=f.samplesPerFrame*9e4/f.sampleRate,m=u+d*v,S={unit:r.subarray(s,s+f.frameLength),pts:m,dts:m};return t.config=[],t.channelCount=f.channelCount,t.samplerate=f.sampleRate,t.samples.push(S),{sample:S,length:f.frameLength,missing:0}}}function c(t,r){var s=t[r+1]>>3&3,u=t[r+1]>>1&3,d=t[r+2]>>4&15,f=t[r+2]>>2&3;if(s!==1&&d!==0&&d!==15&&f!==3){var v=t[r+2]>>1&1,m=t[r+3]>>6,S=s===3?3-u:u===3?3:4,C=M[S*14+d-1]*1e3,_=s===3?0:s===2?1:2,y=p[_*3+f],T=m===3?1:2,O=E[s][u],g=b[u],F=O*8*g,P=Math.floor(O*C/y+v)*g;if(R===null){var N=navigator.userAgent||"",X=N.match(/Chrome\/(\d+)/i);R=X?parseInt(X[1]):0}var j=!!R&&R<=87;return j&&u===2&&C>=224e3&&m===0&&(t[r+3]=t[r+3]|128),{sampleRate:y,channelCount:T,frameLength:P,samplesPerFrame:F}}}function o(t,r){return t[r]===255&&(t[r+1]&224)===224&&(t[r+1]&6)!==0}function h(t,r){return r+1<t.length&&o(t,r)}function n(t,r){var s=4;return o(t,r)&&s<=t.length-r}function a(t,r){if(r+1<t.length&&o(t,r)){var s=4,u=c(t,r),d=s;u!=null&&u.frameLength&&(d=u.frameLength);var f=r+d;return f===t.length||h(t,f)}return!1}},"./src/demux/sample-aes.ts":function(G,L,I){"use strict";I.r(L);var R=I("./src/crypt/decrypter.ts"),M=I("./src/demux/tsdemuxer.ts"),p=function(){function E(i,c,o){this.keyData=void 0,this.decrypter=void 0,this.keyData=o,this.decrypter=new R.default(i,c,{removePKCS7Padding:!1})}var b=E.prototype;return b.decryptBuffer=function(c,o){this.decrypter.decrypt(c,this.keyData.key.buffer,this.keyData.iv.buffer,o)},b.decryptAacSample=function(c,o,h,n){var a=c[o].unit,t=a.subarray(16,a.length-a.length%16),r=t.buffer.slice(t.byteOffset,t.byteOffset+t.length),s=this;this.decryptBuffer(r,function(u){var d=new Uint8Array(u);a.set(d,16),n||s.decryptAacSamples(c,o+1,h)})},b.decryptAacSamples=function(c,o,h){for(;;o++){if(o>=c.length){h();return}if(c[o].unit.length<32)continue;var n=this.decrypter.isSync();if(this.decryptAacSample(c,o,h,n),!n)return}},b.getAvcEncryptedData=function(c){for(var o=Math.floor((c.length-48)/160)*16+16,h=new Int8Array(o),n=0,a=32;a<=c.length-16;a+=160,n+=16)h.set(c.subarray(a,a+16),n);return h},b.getAvcDecryptedUnit=function(c,o){for(var h=new Uint8Array(o),n=0,a=32;a<=c.length-16;a+=160,n+=16)c.set(h.subarray(n,n+16),a);return c},b.decryptAvcSample=function(c,o,h,n,a,t){var r=Object(M.discardEPB)(a.data),s=this.getAvcEncryptedData(r),u=this;this.decryptBuffer(s.buffer,function(d){a.data=u.getAvcDecryptedUnit(r,d),t||u.decryptAvcSamples(c,o,h+1,n)})},b.decryptAvcSamples=function(c,o,h,n){if(c instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;o++,h=0){if(o>=c.length){n();return}for(var a=c[o].units;!(h>=a.length);h++){var t=a[h];if(t.data.length<=48||t.type!==1&&t.type!==5)continue;var r=this.decrypter.isSync();if(this.decryptAvcSample(c,o,h,n,t,r),!r)return}}},E}();L.default=p},"./src/demux/transmuxer-interface.ts":function(G,L,I){"use strict";I.r(L),I.d(L,"default",function(){return a});var R=I("./node_modules/webworkify-webpack/index.js"),M=I.n(R),p=I("./src/events.ts"),E=I("./src/demux/transmuxer.ts"),b=I("./src/utils/logger.ts"),i=I("./src/errors.ts"),c=I("./src/utils/mediasource-helper.ts"),o=I("./node_modules/eventemitter3/index.js"),h=I.n(o),n=Object(c.getMediaSource)()||{isTypeSupported:function(){return!1}},a=function(){function t(s,u,d,f){var v=this;this.hls=void 0,this.id=void 0,this.observer=void 0,this.frag=null,this.part=null,this.worker=void 0,this.onwmsg=void 0,this.transmuxer=null,this.onTransmuxComplete=void 0,this.onFlush=void 0,this.hls=s,this.id=u,this.onTransmuxComplete=d,this.onFlush=f;var m=s.config,S=function(O,g){g=g||{},g.frag=v.frag,g.id=v.id,s.trigger(O,g)};this.observer=new o.EventEmitter,this.observer.on(p.Events.FRAG_DECRYPTED,S),this.observer.on(p.Events.ERROR,S);var C={mp4:n.isTypeSupported("video/mp4"),mpeg:n.isTypeSupported("audio/mpeg"),mp3:n.isTypeSupported('audio/mp4; codecs="mp3"')},_=navigator.vendor;if(m.enableWorker&&typeof Worker!="undefined"){b.logger.log("demuxing in webworker");var y;try{y=this.worker=R("./src/demux/transmuxer-worker.ts"),this.onwmsg=this.onWorkerMessage.bind(this),y.addEventListener("message",this.onwmsg),y.onerror=function(T){s.trigger(p.Events.ERROR,{type:i.ErrorTypes.OTHER_ERROR,details:i.ErrorDetails.INTERNAL_EXCEPTION,fatal:!0,event:"demuxerWorker",error:new Error(T.message+" ("+T.filename+":"+T.lineno+")")})},y.postMessage({cmd:"init",typeSupported:C,vendor:_,id:u,config:JSON.stringify(m)})}catch(T){b.logger.warn("Error in worker:",T),b.logger.error("Error while initializing DemuxerWorker, fallback to inline"),y&&self.URL.revokeObjectURL(y.objectURL),this.transmuxer=new E.default(this.observer,C,m,_,u),this.worker=null}}else this.transmuxer=new E.default(this.observer,C,m,_,u)}var r=t.prototype;return r.destroy=function(){var u=this.worker;if(u)u.removeEventListener("message",this.onwmsg),u.terminate(),this.worker=null;else{var d=this.transmuxer;d&&(d.destroy(),this.transmuxer=null)}var f=this.observer;f&&f.removeAllListeners(),this.observer=null},r.push=function(u,d,f,v,m,S,C,_,y,T){var O=this;y.transmuxing.start=self.performance.now();var g=this.transmuxer,F=this.worker,P=S?S.start:m.start,N=m.decryptdata,X=this.frag,j=!(X&&m.cc===X.cc),A=!(X&&y.level===X.level),K=X?y.sn-X.sn:-1,U=this.part?y.part-this.part.index:1,k=!A&&(K===1||K===0&&U===1),z=self.performance.now();(A||K||m.stats.parsing.start===0)&&(m.stats.parsing.start=z),S&&(U||!k)&&(S.stats.parsing.start=z);var te=new E.TransmuxState(j,k,_,A,P);if(!k||j){b.logger.log("[transmuxer-interface, "+m.type+"]: Starting new transmux session for sn: "+y.sn+" p: "+y.part+" level: "+y.level+" id: "+y.id+`
|
|
|
discontinuity: `+j+`
|
|
|
trackSwitch: `+A+`
|
|
|
contiguous: `+k+`
|
|
|
accurateTimeOffset: `+_+`
|
|
|
timeOffset: `+P);var de=new E.TransmuxConfig(f,v,d,C,T);this.configureTransmuxer(de)}if(this.frag=m,this.part=S,F)F.postMessage({cmd:"demux",data:u,decryptdata:N,chunkMeta:y,state:te},u instanceof ArrayBuffer?[u]:[]);else if(g){var be=g.push(u,N,y,te);Object(E.isPromise)(be)?be.then(function(We){O.handleTransmuxComplete(We)}):this.handleTransmuxComplete(be)}},r.flush=function(u){var d=this;u.transmuxing.start=self.performance.now();var f=this.transmuxer,v=this.worker;if(v)v.postMessage({cmd:"flush",chunkMeta:u});else if(f){var m=f.flush(u);Object(E.isPromise)(m)?m.then(function(S){d.handleFlushResult(S,u)}):this.handleFlushResult(m,u)}},r.handleFlushResult=function(u,d){var f=this;u.forEach(function(v){f.handleTransmuxComplete(v)}),this.onFlush(d)},r.onWorkerMessage=function(u){var d=u.data,f=this.hls;switch(d.event){case"init":{self.URL.revokeObjectURL(this.worker.objectURL);break}case"transmuxComplete":{this.handleTransmuxComplete(d.data);break}case"flush":{this.onFlush(d.data);break}default:{d.data=d.data||{},d.data.frag=this.frag,d.data.id=this.id,f.trigger(d.event,d.data);break}}},r.configureTransmuxer=function(u){var d=this.worker,f=this.transmuxer;d?d.postMessage({cmd:"configure",config:u}):f&&f.configure(u)},r.handleTransmuxComplete=function(u){u.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(u)},t}()},"./src/demux/transmuxer-worker.ts":function(G,L,I){"use strict";I.r(L),I.d(L,"default",function(){return i});var R=I("./src/demux/transmuxer.ts"),M=I("./src/events.ts"),p=I("./src/utils/logger.ts"),E=I("./node_modules/eventemitter3/index.js"),b=I.n(E);function i(a){var t=new E.EventEmitter,r=function(u,d){a.postMessage({event:u,data:d})};t.on(M.Events.FRAG_DECRYPTED,r),t.on(M.Events.ERROR,r),a.addEventListener("message",function(s){var u=s.data;switch(u.cmd){case"init":{var d=JSON.parse(u.config);a.transmuxer=new R.default(t,u.typeSupported,d,u.vendor,u.id),Object(p.enableLogs)(d.debug),r("init",null);break}case"configure":{a.transmuxer.configure(u.config);break}case"demux":{var f=a.transmuxer.push(u.data,u.decryptdata,u.chunkMeta,u.state);Object(R.isPromise)(f)?f.then(function(S){c(a,S)}):c(a,f);break}case"flush":{var v=u.chunkMeta,m=a.transmuxer.flush(v);Object(R.isPromise)(m)?m.then(function(S){h(a,S,v)}):h(a,m,v);break}default:break}})}function c(a,t){if(n(t.remuxResult))return;var r=[],s=t.remuxResult,u=s.audio,d=s.video;u&&o(r,u),d&&o(r,d),a.postMessage({event:"transmuxComplete",data:t},r)}function o(a,t){t.data1&&a.push(t.data1.buffer),t.data2&&a.push(t.data2.buffer)}function h(a,t,r){t.forEach(function(s){c(a,s)}),a.postMessage({event:"flush",data:r})}function n(a){return!a.audio&&!a.video&&!a.text&&!a.id3&&!a.initSegment}},"./src/demux/transmuxer.ts":function(G,L,I){"use strict";I.r(L),I.d(L,"default",function(){return d}),I.d(L,"isPromise",function(){return m}),I.d(L,"TransmuxConfig",function(){return S}),I.d(L,"TransmuxState",function(){return C});var R=I("./src/events.ts"),M=I("./src/errors.ts"),p=I("./src/crypt/decrypter.ts"),E=I("./src/demux/aacdemuxer.ts"),b=I("./src/demux/mp4demuxer.ts"),i=I("./src/demux/tsdemuxer.ts"),c=I("./src/demux/mp3demuxer.ts"),o=I("./src/remux/mp4-remuxer.ts"),h=I("./src/remux/passthrough-remuxer.ts"),n=I("./src/demux/chunk-cache.ts"),a=I("./src/utils/mp4-tools.ts"),t=I("./src/utils/logger.ts"),r;try{r=self.performance.now.bind(self.performance)}catch(_){t.logger.debug("Unable to use Performance API on this environment"),r=self.Date.now}var s=[{demux:i.default,remux:o.default},{demux:b.default,remux:h.default},{demux:E.default,remux:o.default},{demux:c.default,remux:o.default}],u=1024;s.forEach(function(_){var y=_.demux;u=Math.max(u,y.minProbeByteLength)});var d=function(){function _(T,O,g,F,P){this.observer=void 0,this.typeSupported=void 0,this.config=void 0,this.vendor=void 0,this.id=void 0,this.demuxer=void 0,this.remuxer=void 0,this.decrypter=void 0,this.probe=void 0,this.decryptionPromise=null,this.transmuxConfig=void 0,this.currentTransmuxState=void 0,this.cache=new n.default,this.observer=T,this.typeSupported=O,this.config=g,this.vendor=F,this.id=P}var y=_.prototype;return y.configure=function(O){this.transmuxConfig=O,this.decrypter&&this.decrypter.reset()},y.push=function(O,g,F,P){var N=this,X=F.transmuxing;X.executeStart=r();var j=new Uint8Array(O),A=this.cache,K=this.config,U=this.currentTransmuxState,k=this.transmuxConfig;P&&(this.currentTransmuxState=P);var z=f(j,g);if(z&&z.method==="AES-128"){var te=this.getDecrypter();if(K.enableSoftwareAES){var de=te.softwareDecrypt(j,z.key.buffer,z.iv.buffer);if(!de)return X.executeEnd=r(),v(F);j=new Uint8Array(de)}else return this.decryptionPromise=te.webCryptoDecrypt(j,z.key.buffer,z.iv.buffer).then(function(Je){var Qe=N.push(Je,null,F);return N.decryptionPromise=null,Qe}),this.decryptionPromise}var be=P||U,We=be.contiguous,Ne=be.discontinuity,Le=be.trackSwitch,Ke=be.accurateTimeOffset,He=be.timeOffset,Ae=k.audioCodec,Se=k.videoCodec,he=k.defaultInitPts,Ie=k.duration,ye=k.initSegmentData;if((Ne||Le)&&this.resetInitSegment(ye,Ae,Se,Ie),Ne&&this.resetInitialTimestamp(he),We||this.resetContiguity(),this.needsProbing(j,Ne,Le)){if(A.dataLength){var Ge=A.flush();j=Object(a.appendUint8Array)(Ge,j)}this.configureTransmuxer(j,k)}var $e=this.transmux(j,z,He,Ke,F),ze=this.currentTransmuxState;return ze.contiguous=!0,ze.discontinuity=!1,ze.trackSwitch=!1,X.executeEnd=r(),$e},y.flush=function(O){var g=this,F=O.transmuxing;F.executeStart=r();var P=this.decrypter,N=this.cache,X=this.currentTransmuxState,j=this.decryptionPromise;if(j)return j.then(function(){return g.flush(O)});var A=[],K=X.timeOffset;if(P){var U=P.flush();U&&A.push(this.push(U,null,O))}var k=N.dataLength;N.reset();var z=this.demuxer,te=this.remuxer;if(!z||!te)return k>=u&&this.observer.emit(R.Events.ERROR,R.Events.ERROR,{type:M.ErrorTypes.MEDIA_ERROR,details:M.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"no demux matching with content found"}),F.executeEnd=r(),[v(O)];var de=z.flush(K);return m(de)?de.then(function(be){return g.flushRemux(A,be,O),A}):(this.flushRemux(A,de,O),A)},y.flushRemux=function(O,g,F){var P=g.audioTrack,N=g.avcTrack,X=g.id3Track,j=g.textTrack,A=this.currentTransmuxState,K=A.accurateTimeOffset,U=A.timeOffset;t.logger.log("[transmuxer.ts]: Flushed fragment "+F.sn+(F.part>-1?" p: "+F.part:"")+" of level "+F.level);var k=this.remuxer.remux(P,N,X,j,U,K,!0,this.id);O.push({remuxResult:k,chunkMeta:F}),F.transmuxing.executeEnd=r()},y.resetInitialTimestamp=function(O){var g=this.demuxer,F=this.remuxer;if(!g||!F)return;g.resetTimeStamp(O),F.resetTimeStamp(O)},y.resetContiguity=function(){var O=this.demuxer,g=this.remuxer;if(!O||!g)return;O.resetContiguity(),g.resetNextTimestamp()},y.resetInitSegment=function(O,g,F,P){var N=this.demuxer,X=this.remuxer;if(!N||!X)return;N.resetInitSegment(g,F,P),X.resetInitSegment(O,g,F)},y.destroy=function(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)},y.transmux=function(O,g,F,P,N){var X;return g&&g.method==="SAMPLE-AES"?X=this.transmuxSampleAes(O,g,F,P,N):X=this.transmuxUnencrypted(O,F,P,N),X},y.transmuxUnencrypted=function(O,g,F,P){var N=this.demuxer.demux(O,g,!1,!this.config.progressive),X=N.audioTrack,j=N.avcTrack,A=N.id3Track,K=N.textTrack,U=this.remuxer.remux(X,j,A,K,g,F,!1,this.id);return{remuxResult:U,chunkMeta:P}},y.transmuxSampleAes=function(O,g,F,P,N){var X=this;return this.demuxer.demuxSampleAes(O,g,F).then(function(j){var A=X.remuxer.remux(j.audioTrack,j.avcTrack,j.id3Track,j.textTrack,F,P,!1,X.id);return{remuxResult:A,chunkMeta:N}})},y.configureTransmuxer=function(O,g){for(var F=this.config,P=this.observer,N=this.typeSupported,X=this.vendor,j=g.audioCodec,A=g.defaultInitPts,K=g.duration,U=g.initSegmentData,k=g.videoCodec,z,te=0,de=s.length;te<de;te++)if(s[te].demux.probe(O)){z=s[te];break}z||(t.logger.warn("Failed to find demuxer by probing frag, treating as mp4 passthrough"),z={demux:b.default,remux:h.default});var be=this.demuxer,We=this.remuxer,Ne=z.remux,Le=z.demux;(!We||!(We instanceof Ne))&&(this.remuxer=new Ne(P,F,N,X)),(!be||!(be instanceof Le))&&(this.demuxer=new Le(P,F,N),this.probe=Le.probe),this.resetInitSegment(U,j,k,K),this.resetInitialTimestamp(A)},y.needsProbing=function(O,g,F){return!this.demuxer||!this.remuxer||g||F},y.getDecrypter=function(){var O=this.decrypter;return O||(O=this.decrypter=new p.default(this.observer,this.config)),O},_}();function f(_,y){var T=null;return _.byteLength>0&&y!=null&&y.key!=null&&y.iv!==null&&y.method!=null&&(T=y),T}var v=function(y){return{remuxResult:{},chunkMeta:y}};function m(_){return"then"in _&&_.then instanceof Function}var S=function(y,T,O,g,F){this.audioCodec=void 0,this.videoCodec=void 0,this.initSegmentData=void 0,this.duration=void 0,this.defaultInitPts=void 0,this.audioCodec=y,this.videoCodec=T,this.initSegmentData=O,this.duration=g,this.defaultInitPts=F},C=function(y,T,O,g,F){this.discontinuity=void 0,this.contiguous=void 0,this.accurateTimeOffset=void 0,this.trackSwitch=void 0,this.timeOffset=void 0,this.discontinuity=y,this.contiguous=T,this.accurateTimeOffset=O,this.trackSwitch=g,this.timeOffset=F}},"./src/demux/tsdemuxer.ts":function(G,L,I){"use strict";I.r(L),I.d(L,"discardEPB",function(){return v});var R=I("./src/demux/adts.ts"),M=I("./src/demux/mpegaudio.ts"),p=I("./src/demux/exp-golomb.ts"),E=I("./src/demux/id3.ts"),b=I("./src/demux/sample-aes.ts"),i=I("./src/events.ts"),c=I("./src/utils/mp4-tools.ts"),o=I("./src/utils/logger.ts"),h=I("./src/errors.ts"),n={video:1,audio:2,id3:3,text:4},a=function(){function m(C,_,y){this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.sampleAes=null,this.pmtParsed=!1,this.audioCodec=void 0,this.videoCodec=void 0,this._duration=0,this.aacLastPTS=null,this._initPTS=null,this._initDTS=null,this._pmtId=-1,this._avcTrack=void 0,this._audioTrack=void 0,this._id3Track=void 0,this._txtTrack=void 0,this.aacOverFlow=null,this.avcSample=null,this.remainderData=null,this.observer=C,this.config=_,this.typeSupported=y}m.probe=function(_){var y=m.syncOffset(_);return y<0?!1:(y&&o.logger.warn("MPEG2-TS detected but first sync word found @ offset "+y+", junk ahead ?"),!0)},m.syncOffset=function(_){for(var y=Math.min(1e3,_.length-3*188),T=0;T<y;){if(_[T]===71&&_[T+188]===71&&_[T+2*188]===71)return T;T++}return-1},m.createTrack=function(_,y){return{container:_==="video"||_==="audio"?"video/mp2t":void 0,type:_,id:n[_],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0,duration:_==="audio"?y:void 0}};var S=m.prototype;return S.resetInitSegment=function(_,y,T){this.pmtParsed=!1,this._pmtId=-1,this._avcTrack=m.createTrack("video",T),this._audioTrack=m.createTrack("audio",T),this._id3Track=m.createTrack("id3",T),this._txtTrack=m.createTrack("text",T),this._audioTrack.isAAC=!0,this.aacOverFlow=null,this.aacLastPTS=null,this.avcSample=null,this.audioCodec=_,this.videoCodec=y,this._duration=T},S.resetTimeStamp=function(){},S.resetContiguity=function(){var _=this._audioTrack,y=this._avcTrack,T=this._id3Track;_&&(_.pesData=null),y&&(y.pesData=null),T&&(T.pesData=null),this.aacOverFlow=null,this.aacLastPTS=null},S.demux=function(_,y,T,O){T===void 0&&(T=!1),O===void 0&&(O=!1),T||(this.sampleAes=null);var g,F=this._avcTrack,P=this._audioTrack,N=this._id3Track,X=F.pid,j=F.pesData,A=P.pid,K=N.pid,U=P.pesData,k=N.pesData,z=!1,te=this.pmtParsed,de=this._pmtId,be=_.length;if(this.remainderData&&(_=Object(c.appendUint8Array)(this.remainderData,_),be=_.length,this.remainderData=null),be<188&&!O)return this.remainderData=_,{audioTrack:P,avcTrack:F,id3Track:N,textTrack:this._txtTrack};var We=Math.max(0,m.syncOffset(_));be-=(be+We)%188,be<_.byteLength&&!O&&(this.remainderData=new Uint8Array(_.buffer,be,_.buffer.byteLength-be));for(var Ne=We;Ne<be;Ne+=188)if(_[Ne]===71){var Le=!!(_[Ne+1]&64),Ke=((_[Ne+1]&31)<<8)+_[Ne+2],He=(_[Ne+3]&48)>>4,Ae=void 0;if(He>1){if(Ae=Ne+5+_[Ne+4],Ae===Ne+188)continue}else Ae=Ne+4;switch(Ke){case X:Le&&(j&&(g=u(j))&&this.parseAVCPES(g,!1),j={data:[],size:0}),j&&(j.data.push(_.subarray(Ae,Ne+188)),j.size+=Ne+188-Ae);break;case A:Le&&(U&&(g=u(U))&&(P.isAAC?this.parseAACPES(g):this.parseMPEGPES(g)),U={data:[],size:0}),U&&(U.data.push(_.subarray(Ae,Ne+188)),U.size+=Ne+188-Ae);break;case K:Le&&(k&&(g=u(k))&&this.parseID3PES(g),k={data:[],size:0}),k&&(k.data.push(_.subarray(Ae,Ne+188)),k.size+=Ne+188-Ae);break;case 0:Le&&(Ae+=_[Ae]+1),de=this._pmtId=r(_,Ae);break;case de:{Le&&(Ae+=_[Ae]+1);var Se=s(_,Ae,this.typeSupported.mpeg===!0||this.typeSupported.mp3===!0,T);X=Se.avc,X>0&&(F.pid=X),A=Se.audio,A>0&&(P.pid=A,P.isAAC=Se.isAAC),K=Se.id3,K>0&&(N.pid=K),z&&!te&&(o.logger.log("reparse from beginning"),z=!1,Ne=We-188),te=this.pmtParsed=!0;break}case 17:case 8191:break;default:z=!0;break}}else this.observer.emit(i.Events.ERROR,i.Events.ERROR,{type:h.ErrorTypes.MEDIA_ERROR,details:h.ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,reason:"TS packet did not start with 0x47"});F.pesData=j,P.pesData=U,N.pesData=k;var he={audioTrack:P,avcTrack:F,id3Track:N,textTrack:this._txtTrack};return O&&this.extractRemainingSamples(he),he},S.flush=function(){var _=this.remainderData;this.remainderData=null;var y;return _?y=this.demux(_,-1,!1,!0):y={audioTrack:this._audioTrack,avcTrack:this._avcTrack,textTrack:this._txtTrack,id3Track:this._id3Track},this.extractRemainingSamples(y),this.sampleAes?this.decrypt(y,this.sampleAes):y},S.extractRemainingSamples=function(_){var y=_.audioTrack,T=_.avcTrack,O=_.id3Track,g=T.pesData,F=y.pesData,P=O.pesData,N;g&&(N=u(g))?(this.parseAVCPES(N,!0),T.pesData=null):T.pesData=g,F&&(N=u(F))?(y.isAAC?this.parseAACPES(N):this.parseMPEGPES(N),y.pesData=null):(F!=null&&F.size&&o.logger.log("last AAC PES packet truncated,might overlap between fragments"),y.pesData=F),P&&(N=u(P))?(this.parseID3PES(N),O.pesData=null):O.pesData=P},S.demuxSampleAes=function(_,y,T){var O=this.demux(_,T,!0,!this.config.progressive),g=this.sampleAes=new b.default(this.observer,this.config,y);return this.decrypt(O,g)},S.decrypt=function(_,y){return new Promise(function(T){var O=_.audioTrack,g=_.avcTrack;O.samples&&O.isAAC?y.decryptAacSamples(O.samples,0,function(){g.samples?y.decryptAvcSamples(g.samples,0,0,function(){T(_)}):T(_)}):g.samples&&y.decryptAvcSamples(g.samples,0,0,function(){T(_)})})},S.destroy=function(){this._initPTS=this._initDTS=null,this._duration=0},S.parseAVCPES=function(_,y){var T=this,O=this._avcTrack,g=this.parseAVCNALu(_.data),F=!1,P=this.avcSample,N,X=!1;_.data=null,P&&g.length&&!O.audFound&&(d(P,O),P=this.avcSample=t(!1,_.pts,_.dts,"")),g.forEach(function(j){switch(j.type){case 1:{N=!0,P||(P=T.avcSample=t(!0,_.pts,_.dts,"")),F&&(P.debug+="NDR "),P.frame=!0;var A=j.data;if(X&&A.length>4){var K=new p.default(A).readSliceType();(K===2||K===4||K===7||K===9)&&(P.key=!0)}break}case 5:N=!0,P||(P=T.avcSample=t(!0,_.pts,_.dts,"")),F&&(P.debug+="IDR "),P.key=!0,P.frame=!0;break;case 6:{N=!0,F&&P&&(P.debug+="SEI ");var U=new p.default(v(j.data));U.readUByte();for(var k=0,z=0,te=!1,de=0;!te&&U.bytesAvailable>1;){k=0;do de=U.readUByte(),k+=de;while(de===255);z=0;do de=U.readUByte(),z+=de;while(de===255);if(k===4&&U.bytesAvailable!==0){te=!0;var be=U.readUByte();if(be===181){var We=U.readUShort();if(We===49){var Ne=U.readUInt();if(Ne===1195456820){var Le=U.readUByte();if(Le===3){for(var Ke=U.readUByte(),He=U.readUByte(),Ae=31&Ke,Se=[Ke,He],he=0;he<Ae;he++)Se.push(U.readUByte()),Se.push(U.readUByte()),Se.push(U.readUByte());f(T._txtTrack.samples,{type:3,pts:_.pts,bytes:Se})}}}}}else if(k===5&&U.bytesAvailable!==0){if(te=!0,z>16){for(var Ie=[],ye=0;ye<16;ye++)Ie.push(U.readUByte().toString(16)),(ye===3||ye===5||ye===7||ye===9)&&Ie.push("-");for(var Ge=z-16,$e=new Uint8Array(Ge),ze=0;ze<Ge;ze++)$e[ze]=U.readUByte();f(T._txtTrack.samples,{pts:_.pts,payloadType:k,uuid:Ie.join(""),userData:Object(E.utf8ArrayToStr)($e),userDataBytes:$e})}}else if(z<U.bytesAvailable)for(var Je=0;Je<z;Je++)U.readUByte()}break}case 7:if(N=!0,X=!0,F&&P&&(P.debug+="SPS "),!O.sps){var Qe=new p.default(j.data),fe=Qe.readSPS();O.width=fe.width,O.height=fe.height,O.pixelRatio=fe.pixelRatio,O.sps=[j.data],O.duration=T._duration;for(var ge=j.data.subarray(1,4),xe="avc1.",we=0;we<3;we++){var Te=ge[we].toString(16);Te.length<2&&(Te="0"+Te),xe+=Te}O.codec=xe}break;case 8:N=!0,F&&P&&(P.debug+="PPS "),O.pps||(O.pps=[j.data]);break;case 9:N=!1,O.audFound=!0,P&&d(P,O),P=T.avcSample=t(!1,_.pts,_.dts,F?"AUD ":"");break;case 12:N=!1;break;default:N=!1,P&&(P.debug+="unknown NAL "+j.type+" ");break}if(P&&N){var re=P.units;re.push(j)}}),y&&P&&(d(P,O),this.avcSample=null)},S.getLastNalUnit=function(){var _,y=this.avcSample,T;if(!y||y.units.length===0){var O=this._avcTrack.samples;y=O[O.length-1]}if((_=y)!==null&&_!==void 0&&_.units){var g=y.units;T=g[g.length-1]}return T},S.parseAVCNALu=function(_){var y=_.byteLength,T=this._avcTrack,O=T.naluState||0,g=O,F=[],P=0,N,X,j,A=-1,K=0;for(O===-1&&(A=0,K=_[0]&31,O=0,P=1);P<y;){if(N=_[P++],!O){O=N?0:1;continue}if(O===1){O=N?0:2;continue}if(!N)O=3;else if(N===1){if(A>=0){var U={data:_.subarray(A,P-O-1),type:K};F.push(U)}else{var k=this.getLastNalUnit();if(k&&(g&&P<=4-g&&(k.state&&(k.data=k.data.subarray(0,k.data.byteLength-g))),X=P-O-1,X>0)){var z=new Uint8Array(k.data.byteLength+X);z.set(k.data,0),z.set(_.subarray(0,X),k.data.byteLength),k.data=z,k.state=0}}P<y?(j=_[P]&31,A=P,K=j,O=0):O=-1}else O=0}if(A>=0&&O>=0){var te={data:_.subarray(A,y),type:K,state:O};F.push(te)}if(F.length===0){var de=this.getLastNalUnit();if(de){var be=new Uint8Array(de.data.byteLength+_.byteLength);be.set(de.data,0),be.set(_,de.data.byteLength),de.data=be}}return T.naluState=O,F},S.parseAACPES=function(_){var y=0,T=this._audioTrack,O=this.aacOverFlow,g=_.data;if(O){this.aacOverFlow=null;var F=O.sample.unit.byteLength,P=Math.min(O.missing,F),N=F-P;O.sample.unit.set(g.subarray(0,P),N),T.samples.push(O.sample),y=O.missing}var X,j;for(X=y,j=g.length;X<j-1&&!R.isHeader(g,X);X++);if(X!==y){var A,K;if(X<j-1?(A="AAC PES did not start with ADTS header,offset:"+X,K=!1):(A="no ADTS header found in AAC PES",K=!0),o.logger.warn("parsing error:"+A),this.observer.emit(i.Events.ERROR,i.Events.ERROR,{type:h.ErrorTypes.MEDIA_ERROR,details:h.ErrorDetails.FRAG_PARSING_ERROR,fatal:K,reason:A}),K)return}R.initTrackConfig(T,this.observer,g,X,this.audioCodec);var U;if(_.pts!==void 0)U=_.pts;else if(O){var k=R.getFrameDuration(T.samplerate);U=O.sample.pts+k}else{o.logger.warn("[tsdemuxer]: AAC PES unknown PTS");return}for(var z=0;X<j;)if(R.isHeader(g,X)){if(X+5<j){var te=R.appendFrame(T,g,X,U,z);if(te)if(te.missing)this.aacOverFlow=te;else{X+=te.length,z++;continue}}break}else X++},S.parseMPEGPES=function(_){var y=_.data,T=y.length,O=0,g=0,F=_.pts;if(F===void 0){o.logger.warn("[tsdemuxer]: MPEG PES unknown PTS");return}for(;g<T;)if(M.isHeader(y,g)){var P=M.appendFrame(this._audioTrack,y,g,F,O);if(P)g+=P.length,O++;else break}else g++},S.parseID3PES=function(_){if(_.pts===void 0){o.logger.warn("[tsdemuxer]: ID3 PES unknown PTS");return}this._id3Track.samples.push(_)},m}();a.minProbeByteLength=188;function t(m,S,C,_){return{key:m,frame:!1,pts:S,dts:C,units:[],debug:_,length:0}}function r(m,S){return(m[S+10]&31)<<8|m[S+11]}function s(m,S,C,_){var y={audio:-1,avc:-1,id3:-1,isAAC:!0},T=(m[S+1]&15)<<8|m[S+2],O=S+3+T-4,g=(m[S+10]&15)<<8|m[S+11];for(S+=12+g;S<O;){var F=(m[S+1]&31)<<8|m[S+2];switch(m[S]){case 207:if(!_){o.logger.log("ADTS AAC with AES-128-CBC frame encryption found in unencrypted stream");break}case 15:y.audio===-1&&(y.audio=F);break;case 21:y.id3===-1&&(y.id3=F);break;case 219:if(!_){o.logger.log("H.264 with AES-128-CBC slice encryption found in unencrypted stream");break}case 27:y.avc===-1&&(y.avc=F);break;case 3:case 4:C?y.audio===-1&&(y.audio=F,y.isAAC=!1):o.logger.log("MPEG audio found, not supported in this browser");break;case 36:o.logger.warn("Unsupported HEVC stream type found");break;default:break}S+=((m[S+3]&15)<<8|m[S+4])+5}return y}function u(m){var S=0,C,_,y,T,O,g=m.data;if(!m||m.size===0)return null;for(;g[0].length<19&&g.length>1;){var F=new Uint8Array(g[0].length+g[1].length);F.set(g[0]),F.set(g[1],g[0].length),g[0]=F,g.splice(1,1)}C=g[0];var P=(C[0]<<16)+(C[1]<<8)+C[2];if(P===1){if(_=(C[4]<<8)+C[5],_&&_>m.size-6)return null;var N=C[7];N&192&&(T=(C[9]&14)*536870912+(C[10]&255)*4194304+(C[11]&254)*16384+(C[12]&255)*128+(C[13]&254)/2,N&64?(O=(C[14]&14)*536870912+(C[15]&255)*4194304+(C[16]&254)*16384+(C[17]&255)*128+(C[18]&254)/2,T-O>60*9e4&&(o.logger.warn(Math.round((T-O)/9e4)+"s delta between PTS and DTS, align them"),T=O)):O=T),y=C[8];var X=y+9;if(m.size<=X)return null;m.size-=X;for(var j=new Uint8Array(m.size),A=0,K=g.length;A<K;A++){C=g[A];var U=C.byteLength;if(X)if(X>U){X-=U;continue}else C=C.subarray(X),U-=X,X=0;j.set(C,S),S+=U}return _&&(_-=y+3),{data:j,pts:T,dts:O,len:_}}return null}function d(m,S){if(m.units.length&&m.frame){if(m.pts===void 0){var C=S.samples,_=C.length;if(_){var y=C[_-1];m.pts=y.pts,m.dts=y.dts}else{S.dropped++;return}}S.samples.push(m)}m.debug.length&&o.logger.log(m.pts+"/"+m.dts+":"+m.debug)}function f(m,S){var C=m.length;if(C>0){if(S.pts>=m[C-1].pts)m.push(S);else for(var _=C-1;_>=0;_--)if(S.pts<m[_].pts){m.splice(_,0,S);break}}else m.push(S)}function v(m){for(var S=m.byteLength,C=[],_=1;_<S-2;)m[_]===0&&m[_+1]===0&&m[_+2]===3?(C.push(_+2),_+=2):_++;if(C.length===0)return m;var y=S-C.length,T=new Uint8Array(y),O=0;for(_=0;_<y;O++,_++)O===C[0]&&(O++,C.shift()),T[_]=m[O];return T}L.default=a},"./src/errors.ts":function(G,L,I){"use strict";I.r(L),I.d(L,"ErrorTypes",function(){return R}),I.d(L,"ErrorDetails",function(){return M});var R;(function(p){p.NETWORK_ERROR="networkError",p.MEDIA_ERROR="mediaError",p.KEY_SYSTEM_ERROR="keySystemError",p.MUX_ERROR="muxError",p.OTHER_ERROR="otherError"})(R||(R={}));var M;(function(p){p.KEY_SYSTEM_NO_KEYS="keySystemNoKeys",p.KEY_SYSTEM_NO_ACCESS="keySystemNoAccess",p.KEY_SYSTEM_NO_SESSION="keySystemNoSession",p.KEY_SYSTEM_LICENSE_REQUEST_FAILED="keySystemLicenseRequestFailed",p.KEY_SYSTEM_NO_INIT_DATA="keySystemNoInitData",p.MANIFEST_LOAD_ERROR="manifestLoadError",p.MANIFEST_LOAD_TIMEOUT="manifestLoadTimeOut",p.MANIFEST_PARSING_ERROR="manifestParsingError",p.MANIFEST_INCOMPATIBLE_CODECS_ERROR="manifestIncompatibleCodecsError",p.LEVEL_EMPTY_ERROR="levelEmptyError",p.LEVEL_LOAD_ERROR="levelLoadError",p.LEVEL_LOAD_TIMEOUT="levelLoadTimeOut",p.LEVEL_SWITCH_ERROR="levelSwitchError",p.AUDIO_TRACK_LOAD_ERROR="audioTrackLoadError",p.AUDIO_TRACK_LOAD_TIMEOUT="audioTrackLoadTimeOut",p.SUBTITLE_LOAD_ERROR="subtitleTrackLoadError",p.SUBTITLE_TRACK_LOAD_TIMEOUT="subtitleTrackLoadTimeOut",p.FRAG_LOAD_ERROR="fragLoadError",p.FRAG_LOAD_TIMEOUT="fragLoadTimeOut",p.FRAG_DECRYPT_ERROR="fragDecryptError",p.FRAG_PARSING_ERROR="fragParsingError",p.REMUX_ALLOC_ERROR="remuxAllocError",p.KEY_LOAD_ERROR="keyLoadError",p.KEY_LOAD_TIMEOUT="keyLoadTimeOut",p.BUFFER_ADD_CODEC_ERROR="bufferAddCodecError",p.BUFFER_INCOMPATIBLE_CODECS_ERROR="bufferIncompatibleCodecsError",p.BUFFER_APPEND_ERROR="bufferAppendError",p.BUFFER_APPENDING_ERROR="bufferAppendingError",p.BUFFER_STALLED_ERROR="bufferStalledError",p.BUFFER_FULL_ERROR="bufferFullError",p.BUFFER_SEEK_OVER_HOLE="bufferSeekOverHole",p.BUFFER_NUDGE_ON_STALL="bufferNudgeOnStall",p.INTERNAL_EXCEPTION="internalException",p.INTERNAL_ABORTED="aborted",p.UNKNOWN="unknown"})(M||(M={}))},"./src/events.ts":function(G,L,I){"use strict";I.r(L),I.d(L,"Events",function(){return R});var R;(function(M){M.MEDIA_ATTACHING="hlsMediaAttaching",M.MEDIA_ATTACHED="hlsMediaAttached",M.MEDIA_DETACHING="hlsMediaDetaching",M.MEDIA_DETACHED="hlsMediaDetached",M.BUFFER_RESET="hlsBufferReset",M.BUFFER_CODECS="hlsBufferCodecs",M.BUFFER_CREATED="hlsBufferCreated",M.BUFFER_APPENDING="hlsBufferAppending",M.BUFFER_APPENDED="hlsBufferAppended",M.BUFFER_EOS="hlsBufferEos",M.BUFFER_FLUSHING="hlsBufferFlushing",M.BUFFER_FLUSHED="hlsBufferFlushed",M.MANIFEST_LOADING="hlsManifestLoading",M.MANIFEST_LOADED="hlsManifestLoaded",M.MANIFEST_PARSED="hlsManifestParsed",M.LEVEL_SWITCHING="hlsLevelSwitching",M.LEVEL_SWITCHED="hlsLevelSwitched",M.LEVEL_LOADING="hlsLevelLoading",M.LEVEL_LOADED="hlsLevelLoaded",M.LEVEL_UPDATED="hlsLevelUpdated",M.LEVEL_PTS_UPDATED="hlsLevelPtsUpdated",M.LEVELS_UPDATED="hlsLevelsUpdated",M.AUDIO_TRACKS_UPDATED="hlsAudioTracksUpdated",M.AUDIO_TRACK_SWITCHING="hlsAudioTrackSwitching",M.AUDIO_TRACK_SWITCHED="hlsAudioTrackSwitched",M.AUDIO_TRACK_LOADING="hlsAudioTrackLoading",M.AUDIO_TRACK_LOADED="hlsAudioTrackLoaded",M.SUBTITLE_TRACKS_UPDATED="hlsSubtitleTracksUpdated",M.SUBTITLE_TRACKS_CLEARED="hlsSubtitleTracksCleared",M.SUBTITLE_TRACK_SWITCH="hlsSubtitleTrackSwitch",M.SUBTITLE_TRACK_LOADING="hlsSubtitleTrackLoading",M.SUBTITLE_TRACK_LOADED="hlsSubtitleTrackLoaded",M.SUBTITLE_FRAG_PROCESSED="hlsSubtitleFragProcessed",M.CUES_PARSED="hlsCuesParsed",M.NON_NATIVE_TEXT_TRACKS_FOUND="hlsNonNativeTextTracksFound",M.INIT_PTS_FOUND="hlsInitPtsFound",M.FRAG_LOADING="hlsFragLoading",M.FRAG_LOAD_EMERGENCY_ABORTED="hlsFragLoadEmergencyAborted",M.FRAG_LOADED="hlsFragLoaded",M.FRAG_DECRYPTED="hlsFragDecrypted",M.FRAG_PARSING_INIT_SEGMENT="hlsFragParsingInitSegment",M.FRAG_PARSING_USERDATA="hlsFragParsingUserdata",M.FRAG_PARSING_METADATA="hlsFragParsingMetadata",M.FRAG_PARSED="hlsFragParsed",M.FRAG_BUFFERED="hlsFragBuffered",M.FRAG_CHANGED="hlsFragChanged",M.FPS_DROP="hlsFpsDrop",M.FPS_DROP_LEVEL_CAPPING="hlsFpsDropLevelCapping",M.ERROR="hlsError",M.DESTROYING="hlsDestroying",M.KEY_LOADING="hlsKeyLoading",M.KEY_LOADED="hlsKeyLoaded",M.LIVE_BACK_BUFFER_REACHED="hlsLiveBackBufferReached",M.BACK_BUFFER_REACHED="hlsBackBufferReached"})(R||(R={}))},"./src/hls.ts":function(G,L,I){"use strict";I.r(L),I.d(L,"default",function(){return m});var R=I("./node_modules/url-toolkit/src/url-toolkit.js"),M=I.n(R),p=I("./src/loader/playlist-loader.ts"),E=I("./src/loader/key-loader.ts"),b=I("./src/controller/id3-track-controller.ts"),i=I("./src/controller/latency-controller.ts"),c=I("./src/controller/level-controller.ts"),o=I("./src/controller/fragment-tracker.ts"),h=I("./src/controller/stream-controller.ts"),n=I("./src/is-supported.ts"),a=I("./src/utils/logger.ts"),t=I("./src/config.ts"),r=I("./node_modules/eventemitter3/index.js"),s=I.n(r),u=I("./src/events.ts"),d=I("./src/errors.ts");function f(S,C){for(var _=0;_<C.length;_++){var y=C[_];y.enumerable=y.enumerable||!1,y.configurable=!0,"value"in y&&(y.writable=!0),Object.defineProperty(S,y.key,y)}}function v(S,C,_){return C&&f(S.prototype,C),_&&f(S,_),S}var m=function(){S.isSupported=function(){return Object(n.isSupported)()};function S(_){_===void 0&&(_={}),this.config=void 0,this.userConfig=void 0,this.coreComponents=void 0,this.networkControllers=void 0,this._emitter=new r.EventEmitter,this._autoLevelCapping=void 0,this.abrController=void 0,this.bufferController=void 0,this.capLevelController=void 0,this.latencyController=void 0,this.levelController=void 0,this.streamController=void 0,this.audioTrackController=void 0,this.subtitleTrackController=void 0,this.emeController=void 0,this.cmcdController=void 0,this._media=null,this.url=null;var y=this.config=Object(t.mergeConfig)(S.DefaultConfig,_);this.userConfig=_,Object(a.enableLogs)(y.debug),this._autoLevelCapping=-1,y.progressive&&Object(t.enableStreamingMode)(y);var T=y.abrController,O=y.bufferController,g=y.capLevelController,F=y.fpsController,P=this.abrController=new T(this),N=this.bufferController=new O(this),X=this.capLevelController=new g(this),j=new F(this),A=new p.default(this),K=new E.default(this),U=new b.default(this),k=this.levelController=new c.default(this),z=new o.FragmentTracker(this),te=this.streamController=new h.default(this,z);X.setStreamController(te),j.setStreamController(te);var de=[k,te];this.networkControllers=de;var be=[A,K,P,N,X,j,U,z];this.audioTrackController=this.createController(y.audioTrackController,null,de),this.createController(y.audioStreamController,z,de),this.subtitleTrackController=this.createController(y.subtitleTrackController,null,de),this.createController(y.subtitleStreamController,z,de),this.createController(y.timelineController,null,be),this.emeController=this.createController(y.emeController,null,be),this.cmcdController=this.createController(y.cmcdController,null,be),this.latencyController=this.createController(i.default,null,be),this.coreComponents=be}var C=S.prototype;return C.createController=function(y,T,O){if(y){var g=T?new y(this,T):new y(this);return O&&O.push(g),g}return null},C.on=function(y,T,O){O===void 0&&(O=this),this._emitter.on(y,T,O)},C.once=function(y,T,O){O===void 0&&(O=this),this._emitter.once(y,T,O)},C.removeAllListeners=function(y){this._emitter.removeAllListeners(y)},C.off=function(y,T,O,g){O===void 0&&(O=this),this._emitter.off(y,T,O,g)},C.listeners=function(y){return this._emitter.listeners(y)},C.emit=function(y,T,O){return this._emitter.emit(y,T,O)},C.trigger=function(y,T){if(this.config.debug)return this.emit(y,y,T);try{return this.emit(y,y,T)}catch(O){a.logger.error("An internal error happened while handling event "+y+'. Error message: "'+O.message+'". Here is a stacktrace:',O),this.trigger(u.Events.ERROR,{type:d.ErrorTypes.OTHER_ERROR,details:d.ErrorDetails.INTERNAL_EXCEPTION,fatal:!1,event:y,error:O})}return!1},C.listenerCount=function(y){return this._emitter.listenerCount(y)},C.destroy=function(){a.logger.log("destroy"),this.trigger(u.Events.DESTROYING,void 0),this.detachMedia(),this.removeAllListeners(),this._autoLevelCapping=-1,this.url=null,this.networkControllers.forEach(function(y){return y.destroy()}),this.networkControllers.length=0,this.coreComponents.forEach(function(y){return y.destroy()}),this.coreComponents.length=0},C.attachMedia=function(y){a.logger.log("attachMedia"),this._media=y,this.trigger(u.Events.MEDIA_ATTACHING,{media:y})},C.detachMedia=function(){a.logger.log("detachMedia"),this.trigger(u.Events.MEDIA_DETACHING,void 0),this._media=null},C.loadSource=function(y){this.stopLoad();var T=this.media,O=this.url,g=this.url=R.buildAbsoluteURL(self.location.href,y,{alwaysNormalize:!0});a.logger.log("loadSource:"+g),T&&O&&O!==g&&this.bufferController.hasSourceTypes()&&(this.detachMedia(),this.attachMedia(T)),this.trigger(u.Events.MANIFEST_LOADING,{url:y})},C.startLoad=function(y){y===void 0&&(y=-1),a.logger.log("startLoad("+y+")"),this.networkControllers.forEach(function(T){T.startLoad(y)})},C.stopLoad=function(){a.logger.log("stopLoad"),this.networkControllers.forEach(function(y){y.stopLoad()})},C.swapAudioCodec=function(){a.logger.log("swapAudioCodec"),this.streamController.swapAudioCodec()},C.recoverMediaError=function(){a.logger.log("recoverMediaError");var y=this._media;this.detachMedia(),y&&this.attachMedia(y)},C.removeLevel=function(y,T){T===void 0&&(T=0),this.levelController.removeLevel(y,T)},v(S,[{key:"levels",get:function(){var y=this.levelController.levels;return y||[]}},{key:"currentLevel",get:function(){return this.streamController.currentLevel},set:function(y){a.logger.log("set currentLevel:"+y),this.loadLevel=y,this.abrController.clearTimer(),this.streamController.immediateLevelSwitch()}},{key:"nextLevel",get:function(){return this.streamController.nextLevel},set:function(y){a.logger.log("set nextLevel:"+y),this.levelController.manualLevel=y,this.streamController.nextLevelSwitch()}},{key:"loadLevel",get:function(){return this.levelController.level},set:function(y){a.logger.log("set loadLevel:"+y),this.levelController.manualLevel=y}},{key:"nextLoadLevel",get:function(){return this.levelController.nextLoadLevel},set:function(y){this.levelController.nextLoadLevel=y}},{key:"firstLevel",get:function(){return Math.max(this.levelController.firstLevel,this.minAutoLevel)},set:function(y){a.logger.log("set firstLevel:"+y),this.levelController.firstLevel=y}},{key:"startLevel",get:function(){return this.levelController.startLevel},set:function(y){a.logger.log("set startLevel:"+y),y!==-1&&(y=Math.max(y,this.minAutoLevel)),this.levelController.startLevel=y}},{key:"capLevelToPlayerSize",get:function(){return this.config.capLevelToPlayerSize},set:function(y){var T=!!y;T!==this.config.capLevelToPlayerSize&&(T?this.capLevelController.startCapping():(this.capLevelController.stopCapping(),this.autoLevelCapping=-1,this.streamController.nextLevelSwitch()),this.config.capLevelToPlayerSize=T)}},{key:"autoLevelCapping",get:function(){return this._autoLevelCapping},set:function(y){this._autoLevelCapping!==y&&(a.logger.log("set autoLevelCapping:"+y),this._autoLevelCapping=y)}},{key:"bandwidthEstimate",get:function(){var y=this.abrController.bwEstimator;return y?y.getEstimate():NaN}},{key:"autoLevelEnabled",get:function(){return this.levelController.manualLevel===-1}},{key:"manualLevel",get:function(){return this.levelController.manualLevel}},{key:"minAutoLevel",get:function(){var y=this.levels,T=this.config.minAutoBitrate;if(!y)return 0;for(var O=y.length,g=0;g<O;g++)if(y[g].maxBitrate>T)return g;return 0}},{key:"maxAutoLevel",get:function(){var y=this.levels,T=this.autoLevelCapping,O;return T===-1&&y&&y.length?O=y.length-1:O=T,O}},{key:"nextAutoLevel",get:function(){return Math.min(Math.max(this.abrController.nextAutoLevel,this.minAutoLevel),this.maxAutoLevel)},set:function(y){this.abrController.nextAutoLevel=Math.max(this.minAutoLevel,y)}},{key:"audioTracks",get:function(){var y=this.audioTrackController;return y?y.audioTracks:[]}},{key:"audioTrack",get:function(){var y=this.audioTrackController;return y?y.audioTrack:-1},set:function(y){var T=this.audioTrackController;T&&(T.audioTrack=y)}},{key:"subtitleTracks",get:function(){var y=this.subtitleTrackController;return y?y.subtitleTracks:[]}},{key:"subtitleTrack",get:function(){var y=this.subtitleTrackController;return y?y.subtitleTrack:-1},set:function(y){var T=this.subtitleTrackController;T&&(T.subtitleTrack=y)}},{key:"media",get:function(){return this._media}},{key:"subtitleDisplay",get:function(){var y=this.subtitleTrackController;return y?y.subtitleDisplay:!1},set:function(y){var T=this.subtitleTrackController;T&&(T.subtitleDisplay=y)}},{key:"lowLatencyMode",get:function(){return this.config.lowLatencyMode},set:function(y){this.config.lowLatencyMode=y}},{key:"liveSyncPosition",get:function(){return this.latencyController.liveSyncPosition}},{key:"latency",get:function(){return this.latencyController.latency}},{key:"maxLatency",get:function(){return this.latencyController.maxLatency}},{key:"targetLatency",get:function(){return this.latencyController.targetLatency}},{key:"drift",get:function(){return this.latencyController.drift}},{key:"forceStartLoad",get:function(){return this.streamController.forceStartLoad}}],[{key:"version",get:function(){return"1.1.2"}},{key:"Events",get:function(){return u.Events}},{key:"ErrorTypes",get:function(){return d.ErrorTypes}},{key:"ErrorDetails",get:function(){return d.ErrorDetails}},{key:"DefaultConfig",get:function(){return S.defaultConfig?S.defaultConfig:t.hlsDefaultConfig},set:function(y){S.defaultConfig=y}}]),S}();m.defaultConfig=void 0},"./src/is-supported.ts":function(G,L,I){"use strict";I.r(L),I.d(L,"isSupported",function(){return p}),I.d(L,"changeTypeSupported",function(){return E});var R=I("./src/utils/mediasource-helper.ts");function M(){return self.SourceBuffer||self.WebKitSourceBuffer}function p(){var b=Object(R.getMediaSource)();if(!b)return!1;var i=M(),c=b&&typeof b.isTypeSupported=="function"&&b.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"'),o=!i||i.prototype&&typeof i.prototype.appendBuffer=="function"&&typeof i.prototype.remove=="function";return!!c&&!!o}function E(){var b,i=M();return typeof(i==null||((b=i.prototype)===null||b===void 0)?void 0:b.changeType)=="function"}},"./src/loader/fragment-loader.ts":function(G,L,I){"use strict";I.r(L),I.d(L,"default",function(){return a}),I.d(L,"LoadError",function(){return r});var R=I("./src/polyfills/number.ts"),M=I("./src/errors.ts");function p(s,u){s.prototype=Object.create(u.prototype),s.prototype.constructor=s,o(s,u)}function E(s){var u=typeof Map=="function"?new Map:void 0;return E=function(f){if(f===null||!c(f))return f;if(typeof f!="function")throw new TypeError("Super expression must either be null or a function");if(typeof u!="undefined"){if(u.has(f))return u.get(f);u.set(f,v)}function v(){return b(f,arguments,h(this).constructor)}return v.prototype=Object.create(f.prototype,{constructor:{value:v,enumerable:!1,writable:!0,configurable:!0}}),o(v,f)},E(s)}function b(s,u,d){return i()?b=Reflect.construct:b=function(v,m,S){var C=[null];C.push.apply(C,m);var _=Function.bind.apply(v,C),y=new _;return S&&o(y,S.prototype),y},b.apply(null,arguments)}function i(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(s){return!1}}function c(s){return Function.toString.call(s).indexOf("[native code]")!==-1}function o(s,u){return o=Object.setPrototypeOf||function(f,v){return f.__proto__=v,f},o(s,u)}function h(s){return h=Object.setPrototypeOf?Object.getPrototypeOf:function(d){return d.__proto__||Object.getPrototypeOf(d)},h(s)}var n=Math.pow(2,17),a=function(){function s(d){this.config=void 0,this.loader=null,this.partLoadTimeout=-1,this.config=d}var u=s.prototype;return u.destroy=function(){this.loader&&(this.loader.destroy(),this.loader=null)},u.abort=function(){this.loader&&this.loader.abort()},u.load=function(f,v){var m=this,S=f.url;if(!S)return Promise.reject(new r({type:M.ErrorTypes.NETWORK_ERROR,details:M.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:f,networkDetails:null},"Fragment does not have a "+(S?"part list":"url")));this.abort();var C=this.config,_=C.fLoader,y=C.loader;return new Promise(function(T,O){m.loader&&m.loader.destroy();var g=m.loader=f.loader=_?new _(C):new y(C),F=t(f),P={timeout:C.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:C.fragLoadingMaxRetryTimeout,highWaterMark:n};f.stats=g.stats,g.load(F,P,{onSuccess:function(X,j,A,K){m.resetLoader(f,g),T({frag:f,part:null,payload:X.data,networkDetails:K})},onError:function(X,j,A){m.resetLoader(f,g),O(new r({type:M.ErrorTypes.NETWORK_ERROR,details:M.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:f,response:X,networkDetails:A}))},onAbort:function(X,j,A){m.resetLoader(f,g),O(new r({type:M.ErrorTypes.NETWORK_ERROR,details:M.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:f,networkDetails:A}))},onTimeout:function(X,j,A){m.resetLoader(f,g),O(new r({type:M.ErrorTypes.NETWORK_ERROR,details:M.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:f,networkDetails:A}))},onProgress:function(X,j,A,K){v&&v({frag:f,part:null,payload:A,networkDetails:K})}})})},u.loadPart=function(f,v,m){var S=this;this.abort();var C=this.config,_=C.fLoader,y=C.loader;return new Promise(function(T,O){S.loader&&S.loader.destroy();var g=S.loader=f.loader=_?new _(C):new y(C),F=t(f,v),P={timeout:C.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:C.fragLoadingMaxRetryTimeout,highWaterMark:n};v.stats=g.stats,g.load(F,P,{onSuccess:function(X,j,A,K){S.resetLoader(f,g),S.updateStatsFromPart(f,v);var U={frag:f,part:v,payload:X.data,networkDetails:K};m(U),T(U)},onError:function(X,j,A){S.resetLoader(f,g),O(new r({type:M.ErrorTypes.NETWORK_ERROR,details:M.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:f,part:v,response:X,networkDetails:A}))},onAbort:function(X,j,A){f.stats.aborted=v.stats.aborted,S.resetLoader(f,g),O(new r({type:M.ErrorTypes.NETWORK_ERROR,details:M.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:f,part:v,networkDetails:A}))},onTimeout:function(X,j,A){S.resetLoader(f,g),O(new r({type:M.ErrorTypes.NETWORK_ERROR,details:M.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:f,part:v,networkDetails:A}))}})})},u.updateStatsFromPart=function(f,v){var m=f.stats,S=v.stats,C=S.total;if(m.loaded+=S.loaded,C){var _=Math.round(f.duration/v.duration),y=Math.min(Math.round(m.loaded/C),_),T=_-y,O=T*Math.round(m.loaded/y);m.total=m.loaded+O}else m.total=Math.max(m.loaded,m.total);var g=m.loading,F=S.loading;g.start?g.first+=F.first-F.start:(g.start=F.start,g.first=F.first),g.end=F.end},u.resetLoader=function(f,v){f.loader=null,this.loader===v&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),v.destroy()},s}();function t(s,u){u===void 0&&(u=null);var d=u||s,f={frag:s,part:u,responseType:"arraybuffer",url:d.url,headers:{},rangeStart:0,rangeEnd:0},v=d.byteRangeStartOffset,m=d.byteRangeEndOffset;return Object(R.isFiniteNumber)(v)&&Object(R.isFiniteNumber)(m)&&(f.rangeStart=v,f.rangeEnd=m),f}var r=function(s){p(u,s);function u(d){for(var f,v=arguments.length,m=new Array(v>1?v-1:0),S=1;S<v;S++)m[S-1]=arguments[S];return f=s.call.apply(s,[this].concat(m))||this,f.data=void 0,f.data=d,f}return u}(E(Error))},"./src/loader/fragment.ts":function(G,L,I){"use strict";I.r(L),I.d(L,"ElementaryStreamTypes",function(){return a}),I.d(L,"BaseSegment",function(){return t}),I.d(L,"Fragment",function(){return r}),I.d(L,"Part",function(){return s});var R=I("./src/polyfills/number.ts"),M=I("./node_modules/url-toolkit/src/url-toolkit.js"),p=I.n(M),E=I("./src/utils/logger.ts"),b=I("./src/loader/level-key.ts"),i=I("./src/loader/load-stats.ts");function c(u,d){u.prototype=Object.create(d.prototype),u.prototype.constructor=u,o(u,d)}function o(u,d){return o=Object.setPrototypeOf||function(v,m){return v.__proto__=m,v},o(u,d)}function h(u,d){for(var f=0;f<d.length;f++){var v=d[f];v.enumerable=v.enumerable||!1,v.configurable=!0,"value"in v&&(v.writable=!0),Object.defineProperty(u,v.key,v)}}function n(u,d,f){return d&&h(u.prototype,d),f&&h(u,f),u}var a;(function(u){u.AUDIO="audio",u.VIDEO="video",u.AUDIOVIDEO="audiovideo"})(a||(a={}));var t=function(){function u(f){var v;this._byteRange=null,this._url=null,this.baseurl=void 0,this.relurl=void 0,this.elementaryStreams=(v={},v[a.AUDIO]=null,v[a.VIDEO]=null,v[a.AUDIOVIDEO]=null,v),this.baseurl=f}var d=u.prototype;return d.setByteRange=function(v,m){var S=v.split("@",2),C=[];S.length===1?C[0]=m?m.byteRangeEndOffset:0:C[0]=parseInt(S[1]),C[1]=parseInt(S[0])+C[0],this._byteRange=C},n(u,[{key:"byteRange",get:function(){return this._byteRange?this._byteRange:[]}},{key:"byteRangeStartOffset",get:function(){return this.byteRange[0]}},{key:"byteRangeEndOffset",get:function(){return this.byteRange[1]}},{key:"url",get:function(){return!this._url&&this.baseurl&&this.relurl&&(this._url=Object(M.buildAbsoluteURL)(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url||""},set:function(v){this._url=v}}]),u}(),r=function(u){c(d,u);function d(v,m){var S;return S=u.call(this,m)||this,S._decryptdata=null,S.rawProgramDateTime=null,S.programDateTime=null,S.tagList=[],S.duration=0,S.sn=0,S.levelkey=void 0,S.type=void 0,S.loader=null,S.level=-1,S.cc=0,S.startPTS=void 0,S.endPTS=void 0,S.appendedPTS=void 0,S.startDTS=void 0,S.endDTS=void 0,S.start=0,S.deltaPTS=void 0,S.maxStartPTS=void 0,S.minEndPTS=void 0,S.stats=new i.LoadStats,S.urlId=0,S.data=void 0,S.bitrateTest=!1,S.title=null,S.initSegment=null,S.type=v,S}var f=d.prototype;return f.createInitializationVector=function(m){for(var S=new Uint8Array(16),C=12;C<16;C++)S[C]=m>>8*(15-C)&255;return S},f.setDecryptDataFromLevelKey=function(m,S){var C=m;return(m==null?void 0:m.method)==="AES-128"&&m.uri&&!m.iv&&(C=b.LevelKey.fromURI(m.uri),C.method=m.method,C.iv=this.createInitializationVector(S),C.keyFormat="identity"),C},f.setElementaryStreamInfo=function(m,S,C,_,y,T){T===void 0&&(T=!1);var O=this.elementaryStreams,g=O[m];if(!g){O[m]={startPTS:S,endPTS:C,startDTS:_,endDTS:y,partial:T};return}g.startPTS=Math.min(g.startPTS,S),g.endPTS=Math.max(g.endPTS,C),g.startDTS=Math.min(g.startDTS,_),g.endDTS=Math.max(g.endDTS,y)},f.clearElementaryStreamInfo=function(){var m=this.elementaryStreams;m[a.AUDIO]=null,m[a.VIDEO]=null,m[a.AUDIOVIDEO]=null},n(d,[{key:"decryptdata",get:function(){if(!this.levelkey&&!this._decryptdata)return null;if(!this._decryptdata&&this.levelkey){var m=this.sn;typeof m!="number"&&(this.levelkey&&this.levelkey.method==="AES-128"&&!this.levelkey.iv&&E.logger.warn('missing IV for initialization segment with method="'+this.levelkey.method+'" - compliance issue'),m=0),this._decryptdata=this.setDecryptDataFromLevelKey(this.levelkey,m)}return this._decryptdata}},{key:"end",get:function(){return this.start+this.duration}},{key:"endProgramDateTime",get:function(){if(this.programDateTime===null)return null;if(!Object(R.isFiniteNumber)(this.programDateTime))return null;var m=Object(R.isFiniteNumber)(this.duration)?this.duration:0;return this.programDateTime+m*1e3}},{key:"encrypted",get:function(){var m;return!!((m=this.decryptdata)!==null&&m!==void 0&&m.keyFormat&&this.decryptdata.uri)}}]),d}(t),s=function(u){c(d,u);function d(f,v,m,S,C){var _;_=u.call(this,m)||this,_.fragOffset=0,_.duration=0,_.gap=!1,_.independent=!1,_.relurl=void 0,_.fragment=void 0,_.index=void 0,_.stats=new i.LoadStats,_.duration=f.decimalFloatingPoint("DURATION"),_.gap=f.bool("GAP"),_.independent=f.bool("INDEPENDENT"),_.relurl=f.enumeratedString("URI"),_.fragment=v,_.index=S;var y=f.enumeratedString("BYTERANGE");return y&&_.setByteRange(y,C),C&&(_.fragOffset=C.fragOffset+C.duration),_}return n(d,[{key:"start",get:function(){return this.fragment.start+this.fragOffset}},{key:"end",get:function(){return this.start+this.duration}},{key:"loaded",get:function(){var v=this.elementaryStreams;return!!(v.audio||v.video||v.audiovideo)}}]),d}(t)},"./src/loader/key-loader.ts":function(G,L,I){"use strict";I.r(L),I.d(L,"default",function(){return E});var R=I("./src/events.ts"),M=I("./src/errors.ts"),p=I("./src/utils/logger.ts"),E=function(){function b(c){this.hls=void 0,this.loaders={},this.decryptkey=null,this.decrypturl=null,this.hls=c,this._registerListeners()}var i=b.prototype;return i._registerListeners=function(){this.hls.on(R.Events.KEY_LOADING,this.onKeyLoading,this)},i._unregisterListeners=function(){this.hls.off(R.Events.KEY_LOADING,this.onKeyLoading)},i.destroy=function(){this._unregisterListeners();for(var o in this.loaders){var h=this.loaders[o];h&&h.destroy()}this.loaders={}},i.onKeyLoading=function(o,h){var n=h.frag,a=n.type,t=this.loaders[a];if(!n.decryptdata){p.logger.warn("Missing decryption data on fragment in onKeyLoading");return}var r=n.decryptdata.uri;if(r!==this.decrypturl||this.decryptkey===null){var s=this.hls.config;if(t&&(p.logger.warn("abort previous key loader for type:"+a),t.abort()),!r){p.logger.warn("key uri is falsy");return}var u=s.loader,d=n.loader=this.loaders[a]=new u(s);this.decrypturl=r,this.decryptkey=null;var f={url:r,frag:n,responseType:"arraybuffer"},v={timeout:s.fragLoadingTimeOut,maxRetry:0,retryDelay:s.fragLoadingRetryDelay,maxRetryDelay:s.fragLoadingMaxRetryTimeout,highWaterMark:0},m={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};d.load(f,v,m)}else this.decryptkey&&(n.decryptdata.key=this.decryptkey,this.hls.trigger(R.Events.KEY_LOADED,{frag:n}))},i.loadsuccess=function(o,h,n){var a=n.frag;if(!a.decryptdata){p.logger.error("after key load, decryptdata unset");return}this.decryptkey=a.decryptdata.key=new Uint8Array(o.data),a.loader=null,delete this.loaders[a.type],this.hls.trigger(R.Events.KEY_LOADED,{frag:a})},i.loaderror=function(o,h){var n=h.frag,a=n.loader;a&&a.abort(),delete this.loaders[n.type],this.hls.trigger(R.Events.ERROR,{type:M.ErrorTypes.NETWORK_ERROR,details:M.ErrorDetails.KEY_LOAD_ERROR,fatal:!1,frag:n,response:o})},i.loadtimeout=function(o,h){var n=h.frag,a=n.loader;a&&a.abort(),delete this.loaders[n.type],this.hls.trigger(R.Events.ERROR,{type:M.ErrorTypes.NETWORK_ERROR,details:M.ErrorDetails.KEY_LOAD_TIMEOUT,fatal:!1,frag:n})},b}()},"./src/loader/level-details.ts":function(G,L,I){"use strict";I.r(L),I.d(L,"LevelDetails",function(){return b});var R=I("./src/polyfills/number.ts");function M(i,c){for(var o=0;o<c.length;o++){var h=c[o];h.enumerable=h.enumerable||!1,h.configurable=!0,"value"in h&&(h.writable=!0),Object.defineProperty(i,h.key,h)}}function p(i,c,o){return c&&M(i.prototype,c),o&&M(i,o),i}var E=10,b=function(){function i(o){this.PTSKnown=!1,this.alignedSliding=!1,this.averagetargetduration=void 0,this.endCC=0,this.endSN=0,this.fragments=void 0,this.fragmentHint=void 0,this.partList=null,this.live=!0,this.ageHeader=0,this.advancedDateTime=void 0,this.updated=!0,this.advanced=!0,this.availabilityDelay=void 0,this.misses=0,this.needSidxRanges=!1,this.startCC=0,this.startSN=0,this.startTimeOffset=null,this.targetduration=0,this.totalduration=0,this.type=null,this.url=void 0,this.m3u8="",this.version=null,this.canBlockReload=!1,this.canSkipUntil=0,this.canSkipDateRanges=!1,this.skippedSegments=0,this.recentlyRemovedDateranges=void 0,this.partHoldBack=0,this.holdBack=0,this.partTarget=0,this.preloadHint=void 0,this.renditionReports=void 0,this.tuneInGoal=0,this.deltaUpdateFailed=void 0,this.driftStartTime=0,this.driftEndTime=0,this.driftStart=0,this.driftEnd=0,this.fragments=[],this.url=o}var c=i.prototype;return c.reloaded=function(h){if(!h){this.advanced=!0,this.updated=!0;return}var n=this.lastPartSn-h.lastPartSn,a=this.lastPartIndex-h.lastPartIndex;this.updated=this.endSN!==h.endSN||!!a||!!n,this.advanced=this.endSN>h.endSN||n>0||n===0&&a>0,this.updated||this.advanced?this.misses=Math.floor(h.misses*.6):this.misses=h.misses+1,this.availabilityDelay=h.availabilityDelay},p(i,[{key:"hasProgramDateTime",get:function(){return this.fragments.length?Object(R.isFiniteNumber)(this.fragments[this.fragments.length-1].programDateTime):!1}},{key:"levelTargetDuration",get:function(){return this.averagetargetduration||this.targetduration||E}},{key:"drift",get:function(){var h=this.driftEndTime-this.driftStartTime;if(h>0){var n=this.driftEnd-this.driftStart;return n*1e3/h}return 1}},{key:"edge",get:function(){return this.partEnd||this.fragmentEnd}},{key:"partEnd",get:function(){var h;return(h=this.partList)!==null&&h!==void 0&&h.length?this.partList[this.partList.length-1].end:this.fragmentEnd}},{key:"fragmentEnd",get:function(){var h;return(h=this.fragments)!==null&&h!==void 0&&h.length?this.fragments[this.fragments.length-1].end:0}},{key:"age",get:function(){return this.advancedDateTime?Math.max(Date.now()-this.advancedDateTime,0)/1e3:0}},{key:"lastPartIndex",get:function(){var h;return(h=this.partList)!==null&&h!==void 0&&h.length?this.partList[this.partList.length-1].index:-1}},{key:"lastPartSn",get:function(){var h;return(h=this.partList)!==null&&h!==void 0&&h.length?this.partList[this.partList.length-1].fragment.sn:this.endSN}}]),i}()},"./src/loader/level-key.ts":function(G,L,I){"use strict";I.r(L),I.d(L,"LevelKey",function(){return b});var R=I("./node_modules/url-toolkit/src/url-toolkit.js"),M=I.n(R);function p(i,c){for(var o=0;o<c.length;o++){var h=c[o];h.enumerable=h.enumerable||!1,h.configurable=!0,"value"in h&&(h.writable=!0),Object.defineProperty(i,h.key,h)}}function E(i,c,o){return c&&p(i.prototype,c),o&&p(i,o),i}var b=function(){i.fromURL=function(o,h){return new i(o,h)},i.fromURI=function(o){return new i(o)};function i(c,o){this._uri=null,this.method=null,this.keyFormat=null,this.keyFormatVersions=null,this.keyID=null,this.key=null,this.iv=null,o?this._uri=Object(R.buildAbsoluteURL)(c,o,{alwaysNormalize:!0}):this._uri=c}return E(i,[{key:"uri",get:function(){return this._uri}}]),i}()},"./src/loader/load-stats.ts":function(G,L,I){"use strict";I.r(L),I.d(L,"LoadStats",function(){return R});var R=function(){this.aborted=!1,this.loaded=0,this.retry=0,this.total=0,this.chunkCount=0,this.bwEstimate=0,this.loading={start:0,first:0,end:0},this.parsing={start:0,end:0},this.buffering={start:0,first:0,end:0}}},"./src/loader/m3u8-parser.ts":function(G,L,I){"use strict";I.r(L),I.d(L,"default",function(){return d});var R=I("./src/polyfills/number.ts"),M=I("./node_modules/url-toolkit/src/url-toolkit.js"),p=I.n(M),E=I("./src/loader/fragment.ts"),b=I("./src/loader/level-details.ts"),i=I("./src/loader/level-key.ts"),c=I("./src/utils/attr-list.ts"),o=I("./src/utils/logger.ts"),h=I("./src/utils/codecs.ts"),n=/#EXT-X-STREAM-INF:([^\r\n]*)(?:[\r\n](?:#[^\r\n]*)?)*([^\r\n]+)|#EXT-X-SESSION-DATA:([^\r\n]*)[\r\n]+/g,a=/#EXT-X-MEDIA:(.*)/g,t=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/(?!#) *(\S[\S ]*)/.source,/#EXT-X-BYTERANGE:*(.+)/.source,/#EXT-X-PROGRAM-DATE-TIME:(.+)/.source,/#.*/.source].join("|"),"g"),r=new RegExp([/#(EXTM3U)/.source,/#EXT-X-(PLAYLIST-TYPE):(.+)/.source,/#EXT-X-(MEDIA-SEQUENCE): *(\d+)/.source,/#EXT-X-(SKIP):(.+)/.source,/#EXT-X-(TARGETDURATION): *(\d+)/.source,/#EXT-X-(KEY):(.+)/.source,/#EXT-X-(START):(.+)/.source,/#EXT-X-(ENDLIST)/.source,/#EXT-X-(DISCONTINUITY-SEQ)UENCE: *(\d+)/.source,/#EXT-X-(DIS)CONTINUITY/.source,/#EXT-X-(VERSION):(\d+)/.source,/#EXT-X-(MAP):(.+)/.source,/#EXT-X-(SERVER-CONTROL):(.+)/.source,/#EXT-X-(PART-INF):(.+)/.source,/#EXT-X-(GAP)/.source,/#EXT-X-(BITRATE):\s*(\d+)/.source,/#EXT-X-(PART):(.+)/.source,/#EXT-X-(PRELOAD-HINT):(.+)/.source,/#EXT-X-(RENDITION-REPORT):(.+)/.source,/(#)([^:]*):(.*)/.source,/(#)(.*)(?:.*)\r?\n?/.source].join("|")),s=/\.(mp4|m4s|m4v|m4a)$/i;function u(C){var _,y;return s.test((_=(y=M.parseURL(C))===null||y===void 0?void 0:y.path)!=null?_:"")}var d=function(){function C(){}return C.findGroup=function(y,T){for(var O=0;O<y.length;O++){var g=y[O];if(g.id===T)return g}},C.convertAVC1ToAVCOTI=function(y){var T=y.split(".");if(T.length>2){var O=T.shift()+".";return O+=parseInt(T.shift()).toString(16),O+=("000"+parseInt(T.shift()).toString(16)).substr(-4),O}return y},C.resolve=function(y,T){return M.buildAbsoluteURL(T,y,{alwaysNormalize:!0})},C.parseMasterPlaylist=function(y,T){var O=[],g={},F=!1;n.lastIndex=0;for(var P;(P=n.exec(y))!=null;)if(P[1]){var N=new c.AttrList(P[1]),X={attrs:N,bitrate:N.decimalInteger("AVERAGE-BANDWIDTH")||N.decimalInteger("BANDWIDTH"),name:N.NAME,url:C.resolve(P[2],T)},j=N.decimalResolution("RESOLUTION");j&&(X.width=j.width,X.height=j.height),f((N.CODECS||"").split(/[ ,]+/).filter(function(K){return K}),X),X.videoCodec&&X.videoCodec.indexOf("avc1")!==-1&&(X.videoCodec=C.convertAVC1ToAVCOTI(X.videoCodec)),O.push(X)}else if(P[3]){var A=new c.AttrList(P[3]);A["DATA-ID"]&&(F=!0,g[A["DATA-ID"]]=A)}return{levels:O,sessionData:F?g:null}},C.parseMasterPlaylistMedia=function(y,T,O,g){g===void 0&&(g=[]);var F,P=[],N=0;for(a.lastIndex=0;(F=a.exec(y))!==null;){var X=new c.AttrList(F[1]);if(X.TYPE===O){var j={attrs:X,bitrate:0,id:N++,groupId:X["GROUP-ID"],instreamId:X["INSTREAM-ID"],name:X.NAME||X.LANGUAGE||"",type:O,default:X.bool("DEFAULT"),autoselect:X.bool("AUTOSELECT"),forced:X.bool("FORCED"),lang:X.LANGUAGE,url:X.URI?C.resolve(X.URI,T):""};if(g.length){var A=C.findGroup(g,j.groupId)||g[0];v(j,A,"audioCodec"),v(j,A,"textCodec")}P.push(j)}}return P},C.parseLevelPlaylist=function(y,T,O,g,F){var P=new b.LevelDetails(T),N=P.fragments,X=null,j=0,A=0,K=0,U=0,k=null,z=new E.Fragment(g,T),te,de,be,We=-1,Ne=!1;for(t.lastIndex=0,P.m3u8=y;(te=t.exec(y))!==null;){Ne&&(Ne=!1,z=new E.Fragment(g,T),z.start=K,z.sn=j,z.cc=U,z.level=O,X&&(z.initSegment=X,z.rawProgramDateTime=X.rawProgramDateTime));var Le=te[1];if(Le){z.duration=parseFloat(Le);var Ke=(" "+te[2]).slice(1);z.title=Ke||null,z.tagList.push(Ke?["INF",Le,Ke]:["INF",Le])}else if(te[3])Object(R.isFiniteNumber)(z.duration)&&(z.start=K,be&&(z.levelkey=be),z.sn=j,z.level=O,z.cc=U,z.urlId=F,N.push(z),z.relurl=(" "+te[3]).slice(1),S(z,k),k=z,K+=z.duration,j++,A=0,Ne=!0);else if(te[4]){var He=(" "+te[4]).slice(1);k?z.setByteRange(He,k):z.setByteRange(He)}else if(te[5])z.rawProgramDateTime=(" "+te[5]).slice(1),z.tagList.push(["PROGRAM-DATE-TIME",z.rawProgramDateTime]),We===-1&&(We=N.length);else{if(te=te[0].match(r),!te){o.logger.warn("No matches on slow regex match for level playlist!");continue}for(de=1;de<te.length&&!(typeof te[de]!="undefined");de++);var Ae=(" "+te[de]).slice(1),Se=(" "+te[de+1]).slice(1),he=te[de+2]?(" "+te[de+2]).slice(1):"";switch(Ae){case"PLAYLIST-TYPE":P.type=Se.toUpperCase();break;case"MEDIA-SEQUENCE":j=P.startSN=parseInt(Se);break;case"SKIP":{var Ie=new c.AttrList(Se),ye=Ie.decimalInteger("SKIPPED-SEGMENTS");if(Object(R.isFiniteNumber)(ye)){P.skippedSegments=ye;for(var Ge=ye;Ge--;)N.unshift(null);j+=ye}var $e=Ie.enumeratedString("RECENTLY-REMOVED-DATERANGES");$e&&(P.recentlyRemovedDateranges=$e.split(" "));break}case"TARGETDURATION":P.targetduration=parseFloat(Se);break;case"VERSION":P.version=parseInt(Se);break;case"EXTM3U":break;case"ENDLIST":P.live=!1;break;case"#":(Se||he)&&z.tagList.push(he?[Se,he]:[Se]);break;case"DIS":U++;case"GAP":z.tagList.push([Ae]);break;case"BITRATE":z.tagList.push([Ae,Se]);break;case"DISCONTINUITY-SEQ":U=parseInt(Se);break;case"KEY":{var ze,Je=new c.AttrList(Se),Qe=Je.enumeratedString("METHOD"),fe=Je.URI,ge=Je.hexadecimalInteger("IV"),xe=Je.enumeratedString("KEYFORMATVERSIONS"),we=Je.enumeratedString("KEYID"),Te=(ze=Je.enumeratedString("KEYFORMAT"))!=null?ze:"identity",re=["com.apple.streamingkeydelivery","com.microsoft.playready","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed","com.widevine"];if(re.indexOf(Te)>-1){o.logger.warn("Keyformat "+Te+" is not supported from the manifest");continue}else if(Te!=="identity")continue;Qe&&(be=i.LevelKey.fromURL(T,fe),fe&&["AES-128","SAMPLE-AES","SAMPLE-AES-CENC"].indexOf(Qe)>=0&&(be.method=Qe,be.keyFormat=Te,we&&(be.keyID=we),xe&&(be.keyFormatVersions=xe),be.iv=ge));break}case"START":{var ve=new c.AttrList(Se),ae=ve.decimalFloatingPoint("TIME-OFFSET");Object(R.isFiniteNumber)(ae)&&(P.startTimeOffset=ae);break}case"MAP":{var Me=new c.AttrList(Se);z.relurl=Me.URI,Me.BYTERANGE&&z.setByteRange(Me.BYTERANGE),z.level=O,z.sn="initSegment",be&&(z.levelkey=be),z.initSegment=null,X=z,Ne=!0;break}case"SERVER-CONTROL":{var Ye=new c.AttrList(Se);P.canBlockReload=Ye.bool("CAN-BLOCK-RELOAD"),P.canSkipUntil=Ye.optionalFloat("CAN-SKIP-UNTIL",0),P.canSkipDateRanges=P.canSkipUntil>0&&Ye.bool("CAN-SKIP-DATERANGES"),P.partHoldBack=Ye.optionalFloat("PART-HOLD-BACK",0),P.holdBack=Ye.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{var et=new c.AttrList(Se);P.partTarget=et.decimalFloatingPoint("PART-TARGET");break}case"PART":{var je=P.partList;je||(je=P.partList=[]);var ot=A>0?je[je.length-1]:void 0,ce=A++,Pe=new E.Part(new c.AttrList(Se),z,T,ce,ot);je.push(Pe),z.duration+=Pe.duration;break}case"PRELOAD-HINT":{var Fe=new c.AttrList(Se);P.preloadHint=Fe;break}case"RENDITION-REPORT":{var Ce=new c.AttrList(Se);P.renditionReports=P.renditionReports||[],P.renditionReports.push(Ce);break}default:o.logger.warn("line parsed but not handled: "+te);break}}}k&&!k.relurl?(N.pop(),K-=k.duration,P.partList&&(P.fragmentHint=k)):P.partList&&(S(z,k),z.cc=U,P.fragmentHint=z);var _e=N.length,Ee=N[0],ee=N[_e-1];if(K+=P.skippedSegments*P.targetduration,K>0&&_e&&ee){P.averagetargetduration=K/_e;var oe=ee.sn;P.endSN=oe!=="initSegment"?oe:0,Ee&&(P.startCC=Ee.cc,Ee.initSegment||P.fragments.every(function(Q){return Q.relurl&&u(Q.relurl)})&&(o.logger.warn("MP4 fragments found but no init segment (probably no MAP, incomplete M3U8), trying to fetch SIDX"),z=new E.Fragment(g,T),z.relurl=ee.relurl,z.level=O,z.sn="initSegment",Ee.initSegment=z,P.needSidxRanges=!0))}else P.endSN=0,P.startCC=0;return P.fragmentHint&&(K+=P.fragmentHint.duration),P.totalduration=K,P.endCC=U,We>0&&m(N,We),P},C}();function f(C,_){["video","audio","text"].forEach(function(y){var T=C.filter(function(g){return Object(h.isCodecType)(g,y)});if(T.length){var O=T.filter(function(g){return g.lastIndexOf("avc1",0)===0||g.lastIndexOf("mp4a",0)===0});_[y+"Codec"]=O.length>0?O[0]:T[0],C=C.filter(function(g){return T.indexOf(g)===-1})}}),_.unknownCodecs=C}function v(C,_,y){var T=_[y];T&&(C[y]=T)}function m(C,_){for(var y=C[_],T=_;T--;){var O=C[T];if(!O)return;O.programDateTime=y.programDateTime-O.duration*1e3,y=O}}function S(C,_){C.rawProgramDateTime?C.programDateTime=Date.parse(C.rawProgramDateTime):_!=null&&_.programDateTime&&(C.programDateTime=_.endProgramDateTime),Object(R.isFiniteNumber)(C.programDateTime)||(C.programDateTime=null,C.rawProgramDateTime=null)}},"./src/loader/playlist-loader.ts":function(G,L,I){"use strict";I.r(L);var R=I("./src/polyfills/number.ts"),M=I("./src/events.ts"),p=I("./src/errors.ts"),E=I("./src/utils/logger.ts"),b=I("./src/utils/mp4-tools.ts"),i=I("./src/loader/m3u8-parser.ts"),c=I("./src/types/loader.ts"),o=I("./src/utils/attr-list.ts");function h(t){var r=t.type;switch(r){case c.PlaylistContextType.AUDIO_TRACK:return c.PlaylistLevelType.AUDIO;case c.PlaylistContextType.SUBTITLE_TRACK:return c.PlaylistLevelType.SUBTITLE;default:return c.PlaylistLevelType.MAIN}}function n(t,r){var s=t.url;return(s===void 0||s.indexOf("data:")===0)&&(s=r.url),s}var a=function(){function t(s){this.hls=void 0,this.loaders=Object.create(null),this.hls=s,this.registerListeners()}var r=t.prototype;return r.registerListeners=function(){var u=this.hls;u.on(M.Events.MANIFEST_LOADING,this.onManifestLoading,this),u.on(M.Events.LEVEL_LOADING,this.onLevelLoading,this),u.on(M.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),u.on(M.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},r.unregisterListeners=function(){var u=this.hls;u.off(M.Events.MANIFEST_LOADING,this.onManifestLoading,this),u.off(M.Events.LEVEL_LOADING,this.onLevelLoading,this),u.off(M.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),u.off(M.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},r.createInternalLoader=function(u){var d=this.hls.config,f=d.pLoader,v=d.loader,m=f||v,S=new m(d);return u.loader=S,this.loaders[u.type]=S,S},r.getInternalLoader=function(u){return this.loaders[u.type]},r.resetInternalLoader=function(u){this.loaders[u]&&delete this.loaders[u]},r.destroyInternalLoaders=function(){for(var u in this.loaders){var d=this.loaders[u];d&&d.destroy(),this.resetInternalLoader(u)}},r.destroy=function(){this.unregisterListeners(),this.destroyInternalLoaders()},r.onManifestLoading=function(u,d){var f=d.url;this.load({id:null,groupId:null,level:0,responseType:"text",type:c.PlaylistContextType.MANIFEST,url:f,deliveryDirectives:null})},r.onLevelLoading=function(u,d){var f=d.id,v=d.level,m=d.url,S=d.deliveryDirectives;this.load({id:f,groupId:null,level:v,responseType:"text",type:c.PlaylistContextType.LEVEL,url:m,deliveryDirectives:S})},r.onAudioTrackLoading=function(u,d){var f=d.id,v=d.groupId,m=d.url,S=d.deliveryDirectives;this.load({id:f,groupId:v,level:null,responseType:"text",type:c.PlaylistContextType.AUDIO_TRACK,url:m,deliveryDirectives:S})},r.onSubtitleTrackLoading=function(u,d){var f=d.id,v=d.groupId,m=d.url,S=d.deliveryDirectives;this.load({id:f,groupId:v,level:null,responseType:"text",type:c.PlaylistContextType.SUBTITLE_TRACK,url:m,deliveryDirectives:S})},r.load=function(u){var d,f=this.hls.config,v=this.getInternalLoader(u);if(v){var m=v.context;if(m&&m.url===u.url){E.logger.trace("[playlist-loader]: playlist request ongoing");return}E.logger.log("[playlist-loader]: aborting previous loader for type: "+u.type),v.abort()}var S,C,_,y;switch(u.type){case c.PlaylistContextType.MANIFEST:S=f.manifestLoadingMaxRetry,C=f.manifestLoadingTimeOut,_=f.manifestLoadingRetryDelay,y=f.manifestLoadingMaxRetryTimeout;break;case c.PlaylistContextType.LEVEL:case c.PlaylistContextType.AUDIO_TRACK:case c.PlaylistContextType.SUBTITLE_TRACK:S=0,C=f.levelLoadingTimeOut;break;default:S=f.levelLoadingMaxRetry,C=f.levelLoadingTimeOut,_=f.levelLoadingRetryDelay,y=f.levelLoadingMaxRetryTimeout;break}if(v=this.createInternalLoader(u),(d=u.deliveryDirectives)!==null&&d!==void 0&&d.part){var T;if(u.type===c.PlaylistContextType.LEVEL&&u.level!==null?T=this.hls.levels[u.level].details:u.type===c.PlaylistContextType.AUDIO_TRACK&&u.id!==null?T=this.hls.audioTracks[u.id].details:u.type===c.PlaylistContextType.SUBTITLE_TRACK&&u.id!==null&&(T=this.hls.subtitleTracks[u.id].details),T){var O=T.partTarget,g=T.targetduration;O&&g&&(C=Math.min(Math.max(O*3,g*.8)*1e3,C))}}var F={timeout:C,maxRetry:S,retryDelay:_,maxRetryDelay:y,highWaterMark:0},P={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};v.load(u,F,P)},r.loadsuccess=function(u,d,f,v){if(v===void 0&&(v=null),f.isSidxRequest){this.handleSidxRequest(u,f),this.handlePlaylistLoaded(u,d,f,v);return}this.resetInternalLoader(f.type);var m=u.data;if(m.indexOf("#EXTM3U")!==0){this.handleManifestParsingError(u,f,"no EXTM3U delimiter",v);return}d.parsing.start=performance.now(),m.indexOf("#EXTINF:")>0||m.indexOf("#EXT-X-TARGETDURATION:")>0?this.handleTrackOrLevelPlaylist(u,d,f,v):this.handleMasterPlaylist(u,d,f,v)},r.loaderror=function(u,d,f){f===void 0&&(f=null),this.handleNetworkError(d,f,!1,u)},r.loadtimeout=function(u,d,f){f===void 0&&(f=null),this.handleNetworkError(d,f,!0)},r.handleMasterPlaylist=function(u,d,f,v){var m=this.hls,S=u.data,C=n(u,f),_=i.default.parseMasterPlaylist(S,C),y=_.levels,T=_.sessionData;if(!y.length){this.handleManifestParsingError(u,f,"no level found in manifest",v);return}var O=y.map(function(j){return{id:j.attrs.AUDIO,audioCodec:j.audioCodec}}),g=y.map(function(j){return{id:j.attrs.SUBTITLES,textCodec:j.textCodec}}),F=i.default.parseMasterPlaylistMedia(S,C,"AUDIO",O),P=i.default.parseMasterPlaylistMedia(S,C,"SUBTITLES",g),N=i.default.parseMasterPlaylistMedia(S,C,"CLOSED-CAPTIONS");if(F.length){var X=F.some(function(j){return!j.url});!X&&y[0].audioCodec&&!y[0].attrs.AUDIO&&(E.logger.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),F.unshift({type:"main",name:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new o.AttrList({}),bitrate:0,url:""}))}m.trigger(M.Events.MANIFEST_LOADED,{levels:y,audioTracks:F,subtitles:P,captions:N,url:C,stats:d,networkDetails:v,sessionData:T})},r.handleTrackOrLevelPlaylist=function(u,d,f,v){var m=this.hls,S=f.id,C=f.level,_=f.type,y=n(u,f),T=Object(R.isFiniteNumber)(S)?S:0,O=Object(R.isFiniteNumber)(C)?C:T,g=h(f),F=i.default.parseLevelPlaylist(u.data,y,O,g,T);if(!F.fragments.length){m.trigger(M.Events.ERROR,{type:p.ErrorTypes.NETWORK_ERROR,details:p.ErrorDetails.LEVEL_EMPTY_ERROR,fatal:!1,url:y,reason:"no fragments found in level",level:typeof f.level=="number"?f.level:void 0});return}if(_===c.PlaylistContextType.MANIFEST){var P={attrs:new o.AttrList({}),bitrate:0,details:F,name:"",url:y};m.trigger(M.Events.MANIFEST_LOADED,{levels:[P],audioTracks:[],url:y,stats:d,networkDetails:v,sessionData:null})}if(d.parsing.end=performance.now(),F.needSidxRanges){var N,X=(N=F.fragments[0].initSegment)===null||N===void 0?void 0:N.url;this.load({url:X,isSidxRequest:!0,type:_,level:C,levelDetails:F,id:S,groupId:null,rangeStart:0,rangeEnd:2048,responseType:"arraybuffer",deliveryDirectives:null});return}f.levelDetails=F,this.handlePlaylistLoaded(u,d,f,v)},r.handleSidxRequest=function(u,d){var f=Object(b.parseSegmentIndex)(new Uint8Array(u.data));if(!f)return;var v=f.references,m=d.levelDetails;v.forEach(function(S,C){var _=S.info,y=m.fragments[C];y.byteRange.length===0&&y.setByteRange(String(1+_.end-_.start)+"@"+String(_.start)),y.initSegment&&y.initSegment.setByteRange(String(f.moovEndOffset)+"@0")})},r.handleManifestParsingError=function(u,d,f,v){this.hls.trigger(M.Events.ERROR,{type:p.ErrorTypes.NETWORK_ERROR,details:p.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:d.type===c.PlaylistContextType.MANIFEST,url:u.url,reason:f,response:u,context:d,networkDetails:v})},r.handleNetworkError=function(u,d,f,v){f===void 0&&(f=!1),E.logger.warn("[playlist-loader]: A network "+(f?"timeout":"error")+" occurred while loading "+u.type+" level: "+u.level+" id: "+u.id+' group-id: "'+u.groupId+'"');var m=p.ErrorDetails.UNKNOWN,S=!1,C=this.getInternalLoader(u);switch(u.type){case c.PlaylistContextType.MANIFEST:m=f?p.ErrorDetails.MANIFEST_LOAD_TIMEOUT:p.ErrorDetails.MANIFEST_LOAD_ERROR,S=!0;break;case c.PlaylistContextType.LEVEL:m=f?p.ErrorDetails.LEVEL_LOAD_TIMEOUT:p.ErrorDetails.LEVEL_LOAD_ERROR,S=!1;break;case c.PlaylistContextType.AUDIO_TRACK:m=f?p.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:p.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,S=!1;break;case c.PlaylistContextType.SUBTITLE_TRACK:m=f?p.ErrorDetails.SUBTITLE_TRACK_LOAD_TIMEOUT:p.ErrorDetails.SUBTITLE_LOAD_ERROR,S=!1;break}C&&this.resetInternalLoader(u.type);var _={type:p.ErrorTypes.NETWORK_ERROR,details:m,fatal:S,url:u.url,loader:C,context:u,networkDetails:d};v&&(_.response=v),this.hls.trigger(M.Events.ERROR,_)},r.handlePlaylistLoaded=function(u,d,f,v){var m=f.type,S=f.level,C=f.id,_=f.groupId,y=f.loader,T=f.levelDetails,O=f.deliveryDirectives;if(!(T!=null&&T.targetduration)){this.handleManifestParsingError(u,f,"invalid target duration",v);return}if(!y)return;T.live&&(y.getCacheAge&&(T.ageHeader=y.getCacheAge()||0),(!y.getCacheAge||isNaN(T.ageHeader))&&(T.ageHeader=0));switch(m){case c.PlaylistContextType.MANIFEST:case c.PlaylistContextType.LEVEL:this.hls.trigger(M.Events.LEVEL_LOADED,{details:T,level:S||0,id:C||0,stats:d,networkDetails:v,deliveryDirectives:O});break;case c.PlaylistContextType.AUDIO_TRACK:this.hls.trigger(M.Events.AUDIO_TRACK_LOADED,{details:T,id:C||0,groupId:_||"",stats:d,networkDetails:v,deliveryDirectives:O});break;case c.PlaylistContextType.SUBTITLE_TRACK:this.hls.trigger(M.Events.SUBTITLE_TRACK_LOADED,{details:T,id:C||0,groupId:_||"",stats:d,networkDetails:v,deliveryDirectives:O});break}},t}();L.default=a},"./src/polyfills/number.ts":function(G,L,I){"use strict";I.r(L),I.d(L,"isFiniteNumber",function(){return R}),I.d(L,"MAX_SAFE_INTEGER",function(){return M});var R=Number.isFinite||function(p){return typeof p=="number"&&isFinite(p)},M=Number.MAX_SAFE_INTEGER||9007199254740991},"./src/remux/aac-helper.ts":function(G,L,I){"use strict";I.r(L);var R=function(){function M(){}return M.getSilentFrame=function(E,b){switch(E){case"mp4a.40.2":if(b===1)return new Uint8Array([0,200,0,128,35,128]);if(b===2)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(b===3)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(b===4)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(b===5)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,56]);if(b===6)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,0,178,0,32,8,224]);break;default:if(b===1)return new Uint8Array([1,64,34,128,163,78,230,128,186,8,0,0,0,28,6,241,193,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(b===2)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(b===3)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);break}return},M}();L.default=R},"./src/remux/mp4-generator.ts":function(G,L,I){"use strict";I.r(L);var R=Math.pow(2,32)-1,M=function(){function p(){}return p.init=function(){p.types={avc1:[],avcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],".mp3":[],mvex:[],mvhd:[],pasp:[],sdtp:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[],smhd:[]};var b;for(b in p.types)p.types.hasOwnProperty(b)&&(p.types[b]=[b.charCodeAt(0),b.charCodeAt(1),b.charCodeAt(2),b.charCodeAt(3)]);var i=new Uint8Array([0,0,0,0,0,0,0,0,118,105,100,101,0,0,0,0,0,0,0,0,0,0,0,0,86,105,100,101,111,72,97,110,100,108,101,114,0]),c=new Uint8Array([0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0]);p.HDLR_TYPES={video:i,audio:c};var o=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),h=new Uint8Array([0,0,0,0,0,0,0,0]);p.STTS=p.STSC=p.STCO=h,p.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),p.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),p.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),p.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);var n=new Uint8Array([105,115,111,109]),a=new Uint8Array([97,118,99,49]),t=new Uint8Array([0,0,0,1]);p.FTYP=p.box(p.types.ftyp,n,t,n,a),p.DINF=p.box(p.types.dinf,p.box(p.types.dref,o))},p.box=function(b){for(var i=8,c=arguments.length,o=new Array(c>1?c-1:0),h=1;h<c;h++)o[h-1]=arguments[h];for(var n=o.length,a=n;n--;)i+=o[n].byteLength;var t=new Uint8Array(i);for(t[0]=i>>24&255,t[1]=i>>16&255,t[2]=i>>8&255,t[3]=i&255,t.set(b,4),n=0,i=8;n<a;n++)t.set(o[n],i),i+=o[n].byteLength;return t},p.hdlr=function(b){return p.box(p.types.hdlr,p.HDLR_TYPES[b])},p.mdat=function(b){return p.box(p.types.mdat,b)},p.mdhd=function(b,i){i*=b;var c=Math.floor(i/(R+1)),o=Math.floor(i%(R+1));return p.box(p.types.mdhd,new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,b>>24&255,b>>16&255,b>>8&255,b&255,c>>24,c>>16&255,c>>8&255,c&255,o>>24,o>>16&255,o>>8&255,o&255,85,196,0,0]))},p.mdia=function(b){return p.box(p.types.mdia,p.mdhd(b.timescale,b.duration),p.hdlr(b.type),p.minf(b))},p.mfhd=function(b){return p.box(p.types.mfhd,new Uint8Array([0,0,0,0,b>>24,b>>16&255,b>>8&255,b&255]))},p.minf=function(b){return b.type==="audio"?p.box(p.types.minf,p.box(p.types.smhd,p.SMHD),p.DINF,p.stbl(b)):p.box(p.types.minf,p.box(p.types.vmhd,p.VMHD),p.DINF,p.stbl(b))},p.moof=function(b,i,c){return p.box(p.types.moof,p.mfhd(b),p.traf(c,i))},p.moov=function(b){for(var i=b.length,c=[];i--;)c[i]=p.trak(b[i]);return p.box.apply(null,[p.types.moov,p.mvhd(b[0].timescale,b[0].duration)].concat(c).concat(p.mvex(b)))},p.mvex=function(b){for(var i=b.length,c=[];i--;)c[i]=p.trex(b[i]);return p.box.apply(null,[p.types.mvex].concat(c))},p.mvhd=function(b,i){i*=b;var c=Math.floor(i/(R+1)),o=Math.floor(i%(R+1)),h=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,b>>24&255,b>>16&255,b>>8&255,b&255,c>>24,c>>16&255,c>>8&255,c&255,o>>24,o>>16&255,o>>8&255,o&255,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]);return p.box(p.types.mvhd,h)},p.sdtp=function(b){var i=b.samples||[],c=new Uint8Array(4+i.length),o,h;for(o=0;o<i.length;o++)h=i[o].flags,c[o+4]=h.dependsOn<<4|h.isDependedOn<<2|h.hasRedundancy;return p.box(p.types.sdtp,c)},p.stbl=function(b){return p.box(p.types.stbl,p.stsd(b),p.box(p.types.stts,p.STTS),p.box(p.types.stsc,p.STSC),p.box(p.types.stsz,p.STSZ),p.box(p.types.stco,p.STCO))},p.avc1=function(b){var i=[],c=[],o,h,n;for(o=0;o<b.sps.length;o++)h=b.sps[o],n=h.byteLength,i.push(n>>>8&255),i.push(n&255),i=i.concat(Array.prototype.slice.call(h));for(o=0;o<b.pps.length;o++)h=b.pps[o],n=h.byteLength,c.push(n>>>8&255),c.push(n&255),c=c.concat(Array.prototype.slice.call(h));var a=p.box(p.types.avcC,new Uint8Array([1,i[3],i[4],i[5],252|3,224|b.sps.length].concat(i).concat([b.pps.length]).concat(c))),t=b.width,r=b.height,s=b.pixelRatio[0],u=b.pixelRatio[1];return p.box(p.types.avc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,t>>8&255,t&255,r>>8&255,r&255,0,72,0,0,0,72,0,0,0,0,0,0,0,1,18,100,97,105,108,121,109,111,116,105,111,110,47,104,108,115,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),a,p.box(p.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),p.box(p.types.pasp,new Uint8Array([s>>24,s>>16&255,s>>8&255,s&255,u>>24,u>>16&255,u>>8&255,u&255])))},p.esds=function(b){var i=b.config.length;return new Uint8Array([0,0,0,0,3,23+i,0,1,0,4,15+i,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([i]).concat(b.config).concat([6,1,2]))},p.mp4a=function(b){var i=b.samplerate;return p.box(p.types.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,b.channelCount,0,16,0,0,0,0,i>>8&255,i&255,0,0]),p.box(p.types.esds,p.esds(b)))},p.mp3=function(b){var i=b.samplerate;return p.box(p.types[".mp3"],new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,b.channelCount,0,16,0,0,0,0,i>>8&255,i&255,0,0]))},p.stsd=function(b){return b.type==="audio"?!b.isAAC&&b.codec==="mp3"?p.box(p.types.stsd,p.STSD,p.mp3(b)):p.box(p.types.stsd,p.STSD,p.mp4a(b)):p.box(p.types.stsd,p.STSD,p.avc1(b))},p.tkhd=function(b){var i=b.id,c=b.duration*b.timescale,o=b.width,h=b.height,n=Math.floor(c/(R+1)),a=Math.floor(c%(R+1));return p.box(p.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,i>>24&255,i>>16&255,i>>8&255,i&255,0,0,0,0,n>>24,n>>16&255,n>>8&255,n&255,a>>24,a>>16&255,a>>8&255,a&255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,o>>8&255,o&255,0,0,h>>8&255,h&255,0,0]))},p.traf=function(b,i){var c=p.sdtp(b),o=b.id,h=Math.floor(i/(R+1)),n=Math.floor(i%(R+1));return p.box(p.types.traf,p.box(p.types.tfhd,new Uint8Array([0,0,0,0,o>>24,o>>16&255,o>>8&255,o&255])),p.box(p.types.tfdt,new Uint8Array([1,0,0,0,h>>24,h>>16&255,h>>8&255,h&255,n>>24,n>>16&255,n>>8&255,n&255])),p.trun(b,c.length+16+20+8+16+8+8),c)},p.trak=function(b){return b.duration=b.duration||4294967295,p.box(p.types.trak,p.tkhd(b),p.mdia(b))},p.trex=function(b){var i=b.id;return p.box(p.types.trex,new Uint8Array([0,0,0,0,i>>24,i>>16&255,i>>8&255,i&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))},p.trun=function(b,i){var c=b.samples||[],o=c.length,h=12+16*o,n=new Uint8Array(h),a,t,r,s,u,d;for(i+=8+h,n.set([0,0,15,1,o>>>24&255,o>>>16&255,o>>>8&255,o&255,i>>>24&255,i>>>16&255,i>>>8&255,i&255],0),a=0;a<o;a++)t=c[a],r=t.duration,s=t.size,u=t.flags,d=t.cts,n.set([r>>>24&255,r>>>16&255,r>>>8&255,r&255,s>>>24&255,s>>>16&255,s>>>8&255,s&255,u.isLeading<<2|u.dependsOn,u.isDependedOn<<6|u.hasRedundancy<<4|u.paddingValue<<1|u.isNonSync,u.degradPrio&240<<8,u.degradPrio&15,d>>>24&255,d>>>16&255,d>>>8&255,d&255],12+16*a);return p.box(p.types.trun,n)},p.initSegment=function(b){p.types||p.init();var i=p.moov(b),c=new Uint8Array(p.FTYP.byteLength+i.byteLength);return c.set(p.FTYP),c.set(i,p.FTYP.byteLength),c},p}();M.types=void 0,M.HDLR_TYPES=void 0,M.STTS=void 0,M.STSC=void 0,M.STCO=void 0,M.STSZ=void 0,M.VMHD=void 0,M.SMHD=void 0,M.STSD=void 0,M.FTYP=void 0,M.DINF=void 0,L.default=M},"./src/remux/mp4-remuxer.ts":function(G,L,I){"use strict";I.r(L),I.d(L,"default",function(){return d}),I.d(L,"normalizePts",function(){return f});var R=I("./src/polyfills/number.ts"),M=I("./src/remux/aac-helper.ts"),p=I("./src/remux/mp4-generator.ts"),E=I("./src/events.ts"),b=I("./src/errors.ts"),i=I("./src/utils/logger.ts"),c=I("./src/types/loader.ts"),o=I("./src/utils/timescale-conversion.ts");function h(){return h=Object.assign||function(C){for(var _=1;_<arguments.length;_++){var y=arguments[_];for(var T in y)Object.prototype.hasOwnProperty.call(y,T)&&(C[T]=y[T])}return C},h.apply(this,arguments)}var n=10*1e3,a=1024,t=1152,r=null,s=null,u=!1,d=function(){function C(y,T,O,g){if(g===void 0&&(g=""),this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.ISGenerated=!1,this._initPTS=void 0,this._initDTS=void 0,this.nextAvcDts=null,this.nextAudioPts=null,this.isAudioContiguous=!1,this.isVideoContiguous=!1,this.observer=y,this.config=T,this.typeSupported=O,this.ISGenerated=!1,r===null){var F=navigator.userAgent||"",P=F.match(/Chrome\/(\d+)/i);r=P?parseInt(P[1]):0}if(s===null){var N=navigator.userAgent.match(/Safari\/(\d+)/i);s=N?parseInt(N[1]):0}u=!!r&&r<75||!!s&&s<600}var _=C.prototype;return _.destroy=function(){},_.resetTimeStamp=function(T){i.logger.log("[mp4-remuxer]: initPTS & initDTS reset"),this._initPTS=this._initDTS=T},_.resetNextTimestamp=function(){i.logger.log("[mp4-remuxer]: reset next timestamp"),this.isVideoContiguous=!1,this.isAudioContiguous=!1},_.resetInitSegment=function(){i.logger.log("[mp4-remuxer]: ISGenerated flag reset"),this.ISGenerated=!1},_.getVideoStartPts=function(T){var O=!1,g=T.reduce(function(F,P){var N=P.pts-F;return N<-4294967296?(O=!0,f(F,P.pts)):N>0?F:P.pts},T[0].pts);return O&&i.logger.debug("PTS rollover detected"),g},_.remux=function(T,O,g,F,P,N,X,j){var A,K,U,k,z,te,de=P,be=P,We=T.pid>-1,Ne=O.pid>-1,Le=O.samples.length,Ke=T.samples.length>0,He=Le>1,Ae=(!We||Ke)&&(!Ne||He)||this.ISGenerated||X;if(Ae){this.ISGenerated||(U=this.generateIS(T,O,P));var Se=this.isVideoContiguous,he=-1;if(He&&(he=v(O.samples),!Se&&this.config.forceKeyFrameOnDiscontinuity))if(te=!0,he>0){i.logger.warn("[mp4-remuxer]: Dropped "+he+" out of "+Le+" video samples due to a missing keyframe");var Ie=this.getVideoStartPts(O.samples);O.samples=O.samples.slice(he),O.dropped+=he,be+=(O.samples[0].pts-Ie)/(O.timescale||9e4)}else he===-1&&(i.logger.warn("[mp4-remuxer]: No keyframe found out of "+Le+" video samples"),te=!1);if(this.ISGenerated){if(Ke&&He){var ye=this.getVideoStartPts(O.samples),Ge=f(T.samples[0].pts,ye)-ye,$e=Ge/O.inputTimeScale;de+=Math.max(0,$e),be+=Math.max(0,-$e)}if(Ke){if(T.samplerate||(i.logger.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),U=this.generateIS(T,O,P)),K=this.remuxAudio(T,de,this.isAudioContiguous,N,Ne||He||j===c.PlaylistLevelType.AUDIO?be:void 0),He){var ze=K?K.endPTS-K.startPTS:0;O.inputTimeScale||(i.logger.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),U=this.generateIS(T,O,P)),A=this.remuxVideo(O,be,Se,ze)}}else He&&(A=this.remuxVideo(O,be,Se,0));A&&(A.firstKeyFrame=he,A.independent=he!==-1)}}return this.ISGenerated&&(g.samples.length&&(z=this.remuxID3(g,P)),F.samples.length&&(k=this.remuxText(F,P))),{audio:K,video:A,initSegment:U,independent:te,text:k,id3:z}},_.generateIS=function(T,O,g){var F=T.samples,P=O.samples,N=this.typeSupported,X={},j=!Object(R.isFiniteNumber)(this._initPTS),A="audio/mp4",K,U,k;if(j&&(K=U=Infinity),T.config&&F.length&&(T.timescale=T.samplerate,T.isAAC||(N.mpeg?(A="audio/mpeg",T.codec=""):N.mp3&&(T.codec="mp3")),X.audio={id:"audio",container:A,codec:T.codec,initSegment:!T.isAAC&&N.mpeg?new Uint8Array(0):p.default.initSegment([T]),metadata:{channelCount:T.channelCount}},j&&(k=T.inputTimeScale,K=U=F[0].pts-Math.round(k*g))),O.sps&&O.pps&&P.length&&(O.timescale=O.inputTimeScale,X.video={id:"main",container:"video/mp4",codec:O.codec,initSegment:p.default.initSegment([O]),metadata:{width:O.width,height:O.height}},j)){k=O.inputTimeScale;var z=this.getVideoStartPts(P),te=Math.round(k*g);U=Math.min(U,f(P[0].dts,z)-te),K=Math.min(K,z-te)}if(Object.keys(X).length)return this.ISGenerated=!0,j&&(this._initPTS=K,this._initDTS=U),{tracks:X,initPTS:K,timescale:k}},_.remuxVideo=function(T,O,g,F){var P=T.inputTimeScale,N=T.samples,X=[],j=N.length,A=this._initPTS,K=this.nextAvcDts,U=8,k,z,te,de=Number.POSITIVE_INFINITY,be=Number.NEGATIVE_INFINITY,We=0,Ne=!1;if(!g||K===null){var Le=O*P,Ke=N[0].pts-f(N[0].dts,N[0].pts);K=Le-Ke}for(var He=0;He<j;He++){var Ae=N[He];if(Ae.pts=f(Ae.pts-A,K),Ae.dts=f(Ae.dts-A,K),Ae.dts>Ae.pts){var Se=9e4*.2;We=Math.max(Math.min(We,Ae.pts-Ae.dts),-1*Se)}Ae.dts<N[He>0?He-1:He].dts&&(Ne=!0)}Ne&&N.sort(function(Ve,ht){var tt=Ve.dts-ht.dts,at=Ve.pts-ht.pts;return tt||at}),z=N[0].dts,te=N[N.length-1].dts;var he=Math.round((te-z)/(j-1));if(We<0){if(We<he*-2){i.logger.warn("PTS < DTS detected in video samples, offsetting DTS from PTS by "+Object(o.toMsFromMpegTsClock)(-he,!0)+" ms");for(var Ie=We,ye=0;ye<j;ye++)N[ye].dts=Ie=Math.max(Ie,N[ye].pts-he),N[ye].pts=Math.max(Ie,N[ye].pts)}else{i.logger.warn("PTS < DTS detected in video samples, shifting DTS by "+Object(o.toMsFromMpegTsClock)(We,!0)+" ms to overcome this issue");for(var Ge=0;Ge<j;Ge++)N[Ge].dts=N[Ge].dts+We}z=N[0].dts}if(g){var $e=z-K,ze=$e>he,Je=$e<-1;if(ze||Je){ze?i.logger.warn("AVC: "+Object(o.toMsFromMpegTsClock)($e,!0)+" ms ("+$e+"dts) hole between fragments detected, filling it"):i.logger.warn("AVC: "+Object(o.toMsFromMpegTsClock)(-$e,!0)+" ms ("+$e+"dts) overlapping between fragments detected"),z=K;var Qe=N[0].pts-$e;N[0].dts=z,N[0].pts=Qe,i.logger.log("Video: First PTS/DTS adjusted: "+Object(o.toMsFromMpegTsClock)(Qe,!0)+"/"+Object(o.toMsFromMpegTsClock)(z,!0)+", delta: "+Object(o.toMsFromMpegTsClock)($e,!0)+" ms")}}u&&(z=Math.max(0,z));for(var fe=0,ge=0,xe=0;xe<j;xe++){for(var we=N[xe],Te=we.units,re=Te.length,ve=0,ae=0;ae<re;ae++)ve+=Te[ae].data.length;ge+=ve,fe+=re,we.length=ve,we.dts=Math.max(we.dts,z),we.pts=Math.max(we.pts,we.dts,0),de=Math.min(we.pts,de),be=Math.max(we.pts,be)}te=N[j-1].dts;var Me=ge+4*fe+8,Ye;try{Ye=new Uint8Array(Me)}catch(Ve){this.observer.emit(E.Events.ERROR,E.Events.ERROR,{type:b.ErrorTypes.MUX_ERROR,details:b.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:Me,reason:"fail allocating video mdat "+Me});return}var et=new DataView(Ye.buffer);et.setUint32(0,Me),Ye.set(p.default.types.mdat,4);for(var je=0;je<j;je++){for(var ot=N[je],ce=ot.units,Pe=0,Fe=0,Ce=ce.length;Fe<Ce;Fe++){var _e=ce[Fe],Ee=_e.data,ee=_e.data.byteLength;et.setUint32(U,ee),U+=4,Ye.set(Ee,U),U+=ee,Pe+=4+ee}if(je<j-1)k=N[je+1].dts-ot.dts;else{var oe=this.config,Q=ot.dts-N[je>0?je-1:je].dts;if(oe.stretchShortVideoTrack&&this.nextAudioPts!==null){var me=Math.floor(oe.maxBufferHole*P),Oe=(F?de+F*P:this.nextAudioPts)-ot.pts;Oe>me?(k=Oe-Q,k<0&&(k=Q),i.logger.log("[mp4-remuxer]: It is approximately "+Oe/90+" ms to the next segment; using duration "+k/90+" ms for the last video frame.")):k=Q}else k=Q}var V=Math.round(ot.pts-ot.dts);X.push(new m(ot.key,k,Pe,V))}if(X.length&&r&&r<70){var Re=X[0].flags;Re.dependsOn=2,Re.isNonSync=0}console.assert(k!==void 0,"mp4SampleDuration must be computed"),this.nextAvcDts=K=te+k,this.isVideoContiguous=!0;var Xe=p.default.moof(T.sequenceNumber++,z,h({},T,{samples:X})),pe="video",ke={data1:Xe,data2:Ye,startPTS:de/P,endPTS:(be+k)/P,startDTS:z/P,endDTS:K/P,type:pe,hasAudio:!1,hasVideo:!0,nb:X.length,dropped:T.dropped};return T.samples=[],T.dropped=0,console.assert(Ye.length,"MDAT length must not be zero"),ke},_.remuxAudio=function(T,O,g,F,P){var N=T.inputTimeScale,X=T.samplerate?T.samplerate:N,j=N/X,A=T.isAAC?a:t,K=A*j,U=this._initPTS,k=!T.isAAC&&this.typeSupported.mpeg,z=[],te=T.samples,de=k?0:8,be=this.nextAudioPts||-1,We=O*N;if(this.isAudioContiguous=g=g||te.length&&be>0&&(F&&Math.abs(We-be)<9e3||Math.abs(f(te[0].pts-U,We)-be)<20*K),te.forEach(function(Ee){Ee.pts=f(Ee.pts-U,We)}),!g||be<0){if(te=te.filter(function(Ee){return Ee.pts>=0}),!te.length)return;P===0?be=0:F?be=Math.max(0,We):be=te[0].pts}if(T.isAAC)for(var Ne=P!==void 0,Le=this.config.maxAudioFramesDrift,Ke=0,He=be;Ke<te.length;Ke++){var Ae=te[Ke],Se=Ae.pts,he=Se-He,Ie=Math.abs(1e3*he/N);if(he<=-Le*K&&Ne)Ke===0&&(i.logger.warn("Audio frame @ "+(Se/N).toFixed(3)+"s overlaps nextAudioPts by "+Math.round(1e3*he/N)+" ms."),this.nextAudioPts=be=He=Se);else if(he>=Le*K&&Ie<n&&Ne){var ye=Math.round(he/K);He=Se-ye*K,He<0&&(ye--,He+=K),Ke===0&&(this.nextAudioPts=be=He),i.logger.warn("[mp4-remuxer]: Injecting "+ye+" audio frame @ "+(He/N).toFixed(3)+"s due to "+Math.round(1e3*he/N)+" ms gap.");for(var Ge=0;Ge<ye;Ge++){var $e=Math.max(He,0),ze=M.default.getSilentFrame(T.manifestCodec||T.codec,T.channelCount);ze||(i.logger.log("[mp4-remuxer]: Unable to get silent frame for given audio codec; duplicating last frame instead."),ze=Ae.unit.subarray()),te.splice(Ke,0,{unit:ze,pts:$e}),He+=K,Ke++}}Ae.pts=He,He+=K}for(var Je=null,Qe=null,fe,ge=0,xe=te.length;xe--;)ge+=te[xe].unit.byteLength;for(var we=0,Te=te.length;we<Te;we++){var re=te[we],ve=re.unit,ae=re.pts;if(Qe!==null){var Me=z[we-1];Me.duration=Math.round((ae-Qe)/j)}else if(g&&T.isAAC&&(ae=be),Je=ae,ge>0){ge+=de;try{fe=new Uint8Array(ge)}catch(Ee){this.observer.emit(E.Events.ERROR,E.Events.ERROR,{type:b.ErrorTypes.MUX_ERROR,details:b.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:ge,reason:"fail allocating audio mdat "+ge});return}if(!k){var Ye=new DataView(fe.buffer);Ye.setUint32(0,ge),fe.set(p.default.types.mdat,4)}}else return;fe.set(ve,de);var et=ve.byteLength;de+=et,z.push(new m(!0,A,et,0)),Qe=ae}var je=z.length;if(!je)return;var ot=z[z.length-1];this.nextAudioPts=be=Qe+j*ot.duration;var ce=k?new Uint8Array(0):p.default.moof(T.sequenceNumber++,Je/j,h({},T,{samples:z}));T.samples=[];var Pe=Je/N,Fe=be/N,Ce="audio",_e={data1:ce,data2:fe,startPTS:Pe,endPTS:Fe,startDTS:Pe,endDTS:Fe,type:Ce,hasAudio:!0,hasVideo:!1,nb:je};return this.isAudioContiguous=!0,console.assert(fe.length,"MDAT length must not be zero"),_e},_.remuxEmptyAudio=function(T,O,g,F){var P=T.inputTimeScale,N=T.samplerate?T.samplerate:P,X=P/N,j=this.nextAudioPts,A=(j!==null?j:F.startDTS*P)+this._initDTS,K=F.endDTS*P+this._initDTS,U=X*a,k=Math.ceil((K-A)/U),z=M.default.getSilentFrame(T.manifestCodec||T.codec,T.channelCount);if(i.logger.warn("[mp4-remuxer]: remux empty Audio"),!z){i.logger.trace("[mp4-remuxer]: Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec");return}for(var te=[],de=0;de<k;de++){var be=A+de*U;te.push({unit:z,pts:be,dts:be})}return T.samples=te,this.remuxAudio(T,O,g,!1)},_.remuxID3=function(T,O){var g=T.samples.length;if(!g)return;for(var F=T.inputTimeScale,P=this._initPTS,N=this._initDTS,X=0;X<g;X++){var j=T.samples[X];j.pts=f(j.pts-P,O*F)/F,j.dts=f(j.dts-N,O*F)/F}var A=T.samples;return T.samples=[],{samples:A}},_.remuxText=function(T,O){var g=T.samples.length;if(!g)return;for(var F=T.inputTimeScale,P=this._initPTS,N=0;N<g;N++){var X=T.samples[N];X.pts=f(X.pts-P,O*F)/F}T.samples.sort(function(A,K){return A.pts-K.pts});var j=T.samples;return T.samples=[],{samples:j}},C}();function f(C,_){var y;if(_===null)return C;for(_<C?y=-8589934592:y=8589934592;Math.abs(C-_)>4294967296;)C+=y;return C}function v(C){for(var _=0;_<C.length;_++)if(C[_].key)return _;return-1}var m=function(_,y,T,O){this.size=void 0,this.duration=void 0,this.cts=void 0,this.flags=void 0,this.duration=y,this.size=T,this.cts=O,this.flags=new S(_)},S=function(_){this.isLeading=0,this.isDependedOn=0,this.hasRedundancy=0,this.degradPrio=0,this.dependsOn=1,this.isNonSync=1,this.dependsOn=_?2:1,this.isNonSync=_?0:1}},"./src/remux/passthrough-remuxer.ts":function(G,L,I){"use strict";I.r(L);var R=I("./src/polyfills/number.ts"),M=I("./src/utils/mp4-tools.ts"),p=I("./src/loader/fragment.ts"),E=I("./src/utils/logger.ts"),b=function(){function o(){this.emitInitSegment=!1,this.audioCodec=void 0,this.videoCodec=void 0,this.initData=void 0,this.initPTS=void 0,this.initTracks=void 0,this.lastEndDTS=null}var h=o.prototype;return h.destroy=function(){},h.resetTimeStamp=function(a){this.initPTS=a,this.lastEndDTS=null},h.resetNextTimestamp=function(){this.lastEndDTS=null},h.resetInitSegment=function(a,t,r){this.audioCodec=t,this.videoCodec=r,this.generateInitSegment(a),this.emitInitSegment=!0},h.generateInitSegment=function(a){var t=this.audioCodec,r=this.videoCodec;if(!a||!a.byteLength){this.initTracks=void 0,this.initData=void 0;return}var s=this.initData=Object(M.parseInitSegment)(a);t||(t=c(s.audio,p.ElementaryStreamTypes.AUDIO)),r||(r=c(s.video,p.ElementaryStreamTypes.VIDEO));var u={};s.audio&&s.video?u.audiovideo={container:"video/mp4",codec:t+","+r,initSegment:a,id:"main"}:s.audio?u.audio={container:"audio/mp4",codec:t,initSegment:a,id:"audio"}:s.video?u.video={container:"video/mp4",codec:r,initSegment:a,id:"main"}:E.logger.warn("[passthrough-remuxer.ts]: initSegment does not contain moov or trak boxes."),this.initTracks=u},h.remux=function(a,t,r,s,u){var d=this.initPTS,f=this.lastEndDTS,v={audio:void 0,video:void 0,text:s,id3:r,initSegment:void 0};Object(R.isFiniteNumber)(f)||(f=this.lastEndDTS=u||0);var m=t.samples;if(!m||!m.length)return v;var S={initPTS:void 0,timescale:1},C=this.initData;if((!C||!C.length)&&(this.generateInitSegment(m),C=this.initData),!C||!C.length)return E.logger.warn("[passthrough-remuxer.ts]: Failed to generate initSegment."),v;this.emitInitSegment&&(S.tracks=this.initTracks,this.emitInitSegment=!1),Object(R.isFiniteNumber)(d)||(this.initPTS=S.initPTS=d=i(C,m,f));var _=Object(M.getDuration)(m,C),y=f,T=_+y;Object(M.offsetStartDTS)(C,m,d),_>0?this.lastEndDTS=T:(E.logger.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());var O=!!C.audio,g=!!C.video,F="";O&&(F+="audio"),g&&(F+="video");var P={data1:m,startPTS:y,startDTS:y,endPTS:T,endDTS:T,type:F,hasAudio:O,hasVideo:g,nb:1,dropped:0};return v.audio=P.type==="audio"?P:void 0,v.video=P.type!=="audio"?P:void 0,v.text=s,v.id3=r,v.initSegment=S,v},o}(),i=function(h,n,a){return Object(M.getStartDTS)(h,n)-a};function c(o,h){var n=o==null?void 0:o.codec;return n&&n.length>4?n:n==="hvc1"?"hvc1.1.c.L120.90":n==="av01"?"av01.0.04M.08":n==="avc1"||h===p.ElementaryStreamTypes.VIDEO?"avc1.42e01e":"mp4a.40.5"}L.default=b},"./src/task-loop.ts":function(G,L,I){"use strict";I.r(L),I.d(L,"default",function(){return R});var R=function(){function M(){this._boundTick=void 0,this._tickTimer=null,this._tickInterval=null,this._tickCallCount=0,this._boundTick=this.tick.bind(this)}var p=M.prototype;return p.destroy=function(){this.onHandlerDestroying(),this.onHandlerDestroyed()},p.onHandlerDestroying=function(){this.clearNextTick(),this.clearInterval()},p.onHandlerDestroyed=function(){},p.hasInterval=function(){return!!this._tickInterval},p.hasNextTick=function(){return!!this._tickTimer},p.setInterval=function(b){return this._tickInterval?!1:(this._tickInterval=self.setInterval(this._boundTick,b),!0)},p.clearInterval=function(){return this._tickInterval?(self.clearInterval(this._tickInterval),this._tickInterval=null,!0):!1},p.clearNextTick=function(){return this._tickTimer?(self.clearTimeout(this._tickTimer),this._tickTimer=null,!0):!1},p.tick=function(){this._tickCallCount++,this._tickCallCount===1&&(this.doTick(),this._tickCallCount>1&&this.tickImmediate(),this._tickCallCount=0)},p.tickImmediate=function(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)},p.doTick=function(){},M}()},"./src/types/cmcd.ts":function(G,L,I){"use strict";I.r(L),I.d(L,"CMCDVersion",function(){return R}),I.d(L,"CMCDObjectType",function(){return M}),I.d(L,"CMCDStreamingFormat",function(){return p}),I.d(L,"CMCDStreamType",function(){return E});var R=1,M;(function(b){b.MANIFEST="m",b.AUDIO="a",b.VIDEO="v",b.MUXED="av",b.INIT="i",b.CAPTION="c",b.TIMED_TEXT="tt",b.KEY="k",b.OTHER="o"})(M||(M={}));var p;(function(b){b.DASH="d",b.HLS="h",b.SMOOTH="s",b.OTHER="o"})(p||(p={}));var E;(function(b){b.VOD="v",b.LIVE="l"})(E||(E={}))},"./src/types/level.ts":function(G,L,I){"use strict";I.r(L),I.d(L,"HlsSkip",function(){return p}),I.d(L,"getSkipValue",function(){return E}),I.d(L,"HlsUrlParameters",function(){return b}),I.d(L,"Level",function(){return i});function R(c,o){for(var h=0;h<o.length;h++){var n=o[h];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(c,n.key,n)}}function M(c,o,h){return o&&R(c.prototype,o),h&&R(c,h),c}var p;(function(c){c.No="",c.Yes="YES",c.v2="v2"})(p||(p={}));function E(c,o){var h=c.canSkipUntil,n=c.canSkipDateRanges,a=c.endSN,t=o!==void 0?o-a:0;return h&&t<h?n?p.v2:p.Yes:p.No}var b=function(){function c(h,n,a){this.msn=void 0,this.part=void 0,this.skip=void 0,this.msn=h,this.part=n,this.skip=a}var o=c.prototype;return o.addDirectives=function(n){var a=new self.URL(n);return this.msn!==void 0&&a.searchParams.set("_HLS_msn",this.msn.toString()),this.part!==void 0&&a.searchParams.set("_HLS_part",this.part.toString()),this.skip&&a.searchParams.set("_HLS_skip",this.skip),a.toString()},c}(),i=function(){function c(o){this.attrs=void 0,this.audioCodec=void 0,this.bitrate=void 0,this.codecSet=void 0,this.height=void 0,this.id=void 0,this.name=void 0,this.videoCodec=void 0,this.width=void 0,this.unknownCodecs=void 0,this.audioGroupIds=void 0,this.details=void 0,this.fragmentError=0,this.loadError=0,this.loaded=void 0,this.realBitrate=0,this.textGroupIds=void 0,this.url=void 0,this._urlId=0,this.url=[o.url],this.attrs=o.attrs,this.bitrate=o.bitrate,o.details&&(this.details=o.details),this.id=o.id||0,this.name=o.name,this.width=o.width||0,this.height=o.height||0,this.audioCodec=o.audioCodec,this.videoCodec=o.videoCodec,this.unknownCodecs=o.unknownCodecs,this.codecSet=[o.videoCodec,o.audioCodec].filter(function(h){return h}).join(",").replace(/\.[^.,]+/g,"")}return M(c,[{key:"maxBitrate",get:function(){return Math.max(this.realBitrate,this.bitrate)}},{key:"uri",get:function(){return this.url[this._urlId]||""}},{key:"urlId",get:function(){return this._urlId},set:function(h){var n=h%this.url.length;this._urlId!==n&&(this.details=void 0,this._urlId=n)}}]),c}()},"./src/types/loader.ts":function(G,L,I){"use strict";I.r(L),I.d(L,"PlaylistContextType",function(){return R}),I.d(L,"PlaylistLevelType",function(){return M});var R;(function(p){p.MANIFEST="manifest",p.LEVEL="level",p.AUDIO_TRACK="audioTrack",p.SUBTITLE_TRACK="subtitleTrack"})(R||(R={}));var M;(function(p){p.MAIN="main",p.AUDIO="audio",p.SUBTITLE="subtitle"})(M||(M={}))},"./src/types/transmuxer.ts":function(G,L,I){"use strict";I.r(L),I.d(L,"ChunkMetadata",function(){return R});var R=function(E,b,i,c,o,h){c===void 0&&(c=0),o===void 0&&(o=-1),h===void 0&&(h=!1),this.level=void 0,this.sn=void 0,this.part=void 0,this.id=void 0,this.size=void 0,this.partial=void 0,this.transmuxing=M(),this.buffering={audio:M(),video:M(),audiovideo:M()},this.level=E,this.sn=b,this.id=i,this.size=c,this.part=o,this.partial=h};function M(){return{start:0,executeStart:0,executeEnd:0,end:0}}},"./src/utils/attr-list.ts":function(G,L,I){"use strict";I.r(L),I.d(L,"AttrList",function(){return p});var R=/^(\d+)x(\d+)$/,M=/\s*(.+?)\s*=((?:\".*?\")|.*?)(?:,|$)/g,p=function(){function E(i){typeof i=="string"&&(i=E.parseAttrList(i));for(var c in i)i.hasOwnProperty(c)&&(this[c]=i[c])}var b=E.prototype;return b.decimalInteger=function(c){var o=parseInt(this[c],10);return o>Number.MAX_SAFE_INTEGER?Infinity:o},b.hexadecimalInteger=function(c){if(this[c]){var o=(this[c]||"0x").slice(2);o=(o.length&1?"0":"")+o;for(var h=new Uint8Array(o.length/2),n=0;n<o.length/2;n++)h[n]=parseInt(o.slice(n*2,n*2+2),16);return h}else return null},b.hexadecimalIntegerAsNumber=function(c){var o=parseInt(this[c],16);return o>Number.MAX_SAFE_INTEGER?Infinity:o},b.decimalFloatingPoint=function(c){return parseFloat(this[c])},b.optionalFloat=function(c,o){var h=this[c];return h?parseFloat(h):o},b.enumeratedString=function(c){return this[c]},b.bool=function(c){return this[c]==="YES"},b.decimalResolution=function(c){var o=R.exec(this[c]);return o===null?void 0:{width:parseInt(o[1],10),height:parseInt(o[2],10)}},E.parseAttrList=function(c){var o,h={},n='"';for(M.lastIndex=0;(o=M.exec(c))!==null;){var a=o[2];a.indexOf(n)===0&&a.lastIndexOf(n)===a.length-1&&(a=a.slice(1,-1)),h[o[1]]=a}return h},E}()},"./src/utils/binary-search.ts":function(G,L,I){"use strict";I.r(L);var R={search:function(p,E){for(var b=0,i=p.length-1,c=null,o=null;b<=i;){c=(b+i)/2|0,o=p[c];var h=E(o);if(h>0)b=c+1;else if(h<0)i=c-1;else return o}return null}};L.default=R},"./src/utils/buffer-helper.ts":function(G,L,I){"use strict";I.r(L),I.d(L,"BufferHelper",function(){return p});var R=I("./src/utils/logger.ts"),M={length:0,start:function(){return 0},end:function(){return 0}},p=function(){function E(){}return E.isBuffered=function(i,c){try{if(i){for(var o=E.getBuffered(i),h=0;h<o.length;h++)if(c>=o.start(h)&&c<=o.end(h))return!0}}catch(n){}return!1},E.bufferInfo=function(i,c,o){try{if(i){var h=E.getBuffered(i),n=[],a;for(a=0;a<h.length;a++)n.push({start:h.start(a),end:h.end(a)});return this.bufferedInfo(n,c,o)}}catch(t){}return{len:0,start:c,end:c,nextStart:void 0}},E.bufferedInfo=function(i,c,o){c=Math.max(0,c),i.sort(function(S,C){var _=S.start-C.start;return _||C.end-S.end});var h=[];if(o)for(var n=0;n<i.length;n++){var a=h.length;if(a){var t=h[a-1].end;i[n].start-t<o?i[n].end>t&&(h[a-1].end=i[n].end):h.push(i[n])}else h.push(i[n])}else h=i;for(var r=0,s,u=c,d=c,f=0;f<h.length;f++){var v=h[f].start,m=h[f].end;if(c+o>=v&&c<m)u=v,d=m,r=d-c;else if(c+o<v){s=v;break}}return{len:r,start:u||0,end:d||0,nextStart:s}},E.getBuffered=function(i){try{return i.buffered}catch(c){return R.logger.log("failed to get media.buffered",c),M}},E}()},"./src/utils/cea-608-parser.ts":function(G,L,I){"use strict";I.r(L),I.d(L,"Row",function(){return d}),I.d(L,"CaptionScreen",function(){return f});var R=I("./src/utils/logger.ts"),M={42:225,92:233,94:237,95:243,96:250,123:231,124:247,125:209,126:241,127:9608,128:174,129:176,130:189,131:191,132:8482,133:162,134:163,135:9834,136:224,137:32,138:232,139:226,140:234,141:238,142:244,143:251,144:193,145:201,146:211,147:218,148:220,149:252,150:8216,151:161,152:42,153:8217,154:9473,155:169,156:8480,157:8226,158:8220,159:8221,160:192,161:194,162:199,163:200,164:202,165:203,166:235,167:206,168:207,169:239,170:212,171:217,172:249,173:219,174:171,175:187,176:195,177:227,178:205,179:204,180:236,181:210,182:242,183:213,184:245,185:123,186:125,187:92,188:94,189:95,190:124,191:8764,192:196,193:228,194:214,195:246,196:223,197:165,198:164,199:9475,200:197,201:229,202:216,203:248,204:9487,205:9491,206:9495,207:9499},p=function(T){var O=T;return M.hasOwnProperty(T)&&(O=M[T]),String.fromCharCode(O)},E=15,b=100,i={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},c={17:2,18:4,21:6,22:8,23:10,19:13,20:15},o={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},h={25:2,26:4,29:6,30:8,31:10,27:13,28:15},n=["white","green","blue","cyan","red","yellow","magenta","black","transparent"],a;(function(y){y[y.ERROR=0]="ERROR",y[y.TEXT=1]="TEXT",y[y.WARNING=2]="WARNING",y[y.INFO=2]="INFO",y[y.DEBUG=3]="DEBUG",y[y.DATA=3]="DATA"})(a||(a={}));var t=function(){function y(){this.time=null,this.verboseLevel=a.ERROR}var T=y.prototype;return T.log=function(g,F){this.verboseLevel>=g&&R.logger.log(this.time+" ["+g+"] "+F)},y}(),r=function(T){for(var O=[],g=0;g<T.length;g++)O.push(T[g].toString(16));return O},s=function(){function y(O,g,F,P,N){this.foreground=void 0,this.underline=void 0,this.italics=void 0,this.background=void 0,this.flash=void 0,this.foreground=O||"white",this.underline=g||!1,this.italics=F||!1,this.background=P||"black",this.flash=N||!1}var T=y.prototype;return T.reset=function(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1},T.setStyles=function(g){for(var F=["foreground","underline","italics","background","flash"],P=0;P<F.length;P++){var N=F[P];g.hasOwnProperty(N)&&(this[N]=g[N])}},T.isDefault=function(){return this.foreground==="white"&&!this.underline&&!this.italics&&this.background==="black"&&!this.flash},T.equals=function(g){return this.foreground===g.foreground&&this.underline===g.underline&&this.italics===g.italics&&this.background===g.background&&this.flash===g.flash},T.copy=function(g){this.foreground=g.foreground,this.underline=g.underline,this.italics=g.italics,this.background=g.background,this.flash=g.flash},T.toString=function(){return"color="+this.foreground+", underline="+this.underline+", italics="+this.italics+", background="+this.background+", flash="+this.flash},y}(),u=function(){function y(O,g,F,P,N,X){this.uchar=void 0,this.penState=void 0,this.uchar=O||" ",this.penState=new s(g,F,P,N,X)}var T=y.prototype;return T.reset=function(){this.uchar=" ",this.penState.reset()},T.setChar=function(g,F){this.uchar=g,this.penState.copy(F)},T.setPenState=function(g){this.penState.copy(g)},T.equals=function(g){return this.uchar===g.uchar&&this.penState.equals(g.penState)},T.copy=function(g){this.uchar=g.uchar,this.penState.copy(g.penState)},T.isEmpty=function(){return this.uchar===" "&&this.penState.isDefault()},y}(),d=function(){function y(O){this.chars=void 0,this.pos=void 0,this.currPenState=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chars=[];for(var g=0;g<b;g++)this.chars.push(new u);this.logger=O,this.pos=0,this.currPenState=new s}var T=y.prototype;return T.equals=function(g){for(var F=!0,P=0;P<b;P++)if(!this.chars[P].equals(g.chars[P])){F=!1;break}return F},T.copy=function(g){for(var F=0;F<b;F++)this.chars[F].copy(g.chars[F])},T.isEmpty=function(){for(var g=!0,F=0;F<b;F++)if(!this.chars[F].isEmpty()){g=!1;break}return g},T.setCursor=function(g){this.pos!==g&&(this.pos=g),this.pos<0?(this.logger.log(a.DEBUG,"Negative cursor position "+this.pos),this.pos=0):this.pos>b&&(this.logger.log(a.DEBUG,"Too large cursor position "+this.pos),this.pos=b)},T.moveCursor=function(g){var F=this.pos+g;if(g>1)for(var P=this.pos+1;P<F+1;P++)this.chars[P].setPenState(this.currPenState);this.setCursor(F)},T.backSpace=function(){this.moveCursor(-1),this.chars[this.pos].setChar(" ",this.currPenState)},T.insertChar=function(g){g>=144&&this.backSpace();var F=p(g);if(this.pos>=b){this.logger.log(a.ERROR,"Cannot insert "+g.toString(16)+" ("+F+") at position "+this.pos+". Skipping it!");return}this.chars[this.pos].setChar(F,this.currPenState),this.moveCursor(1)},T.clearFromPos=function(g){var F;for(F=g;F<b;F++)this.chars[F].reset()},T.clear=function(){this.clearFromPos(0),this.pos=0,this.currPenState.reset()},T.clearToEndOfRow=function(){this.clearFromPos(this.pos)},T.getTextString=function(){for(var g=[],F=!0,P=0;P<b;P++){var N=this.chars[P].uchar;N!==" "&&(F=!1),g.push(N)}return F?"":g.join("")},T.setPenStyles=function(g){this.currPenState.setStyles(g);var F=this.chars[this.pos];F.setPenState(this.currPenState)},y}(),f=function(){function y(O){this.rows=void 0,this.currRow=void 0,this.nrRollUpRows=void 0,this.lastOutputScreen=void 0,this.logger=void 0,this.rows=[];for(var g=0;g<E;g++)this.rows.push(new d(O));this.logger=O,this.currRow=E-1,this.nrRollUpRows=null,this.lastOutputScreen=null,this.reset()}var T=y.prototype;return T.reset=function(){for(var g=0;g<E;g++)this.rows[g].clear();this.currRow=E-1},T.equals=function(g){for(var F=!0,P=0;P<E;P++)if(!this.rows[P].equals(g.rows[P])){F=!1;break}return F},T.copy=function(g){for(var F=0;F<E;F++)this.rows[F].copy(g.rows[F])},T.isEmpty=function(){for(var g=!0,F=0;F<E;F++)if(!this.rows[F].isEmpty()){g=!1;break}return g},T.backSpace=function(){var g=this.rows[this.currRow];g.backSpace()},T.clearToEndOfRow=function(){var g=this.rows[this.currRow];g.clearToEndOfRow()},T.insertChar=function(g){var F=this.rows[this.currRow];F.insertChar(g)},T.setPen=function(g){var F=this.rows[this.currRow];F.setPenStyles(g)},T.moveCursor=function(g){var F=this.rows[this.currRow];F.moveCursor(g)},T.setCursor=function(g){this.logger.log(a.INFO,"setCursor: "+g);var F=this.rows[this.currRow];F.setCursor(g)},T.setPAC=function(g){this.logger.log(a.INFO,"pacData = "+JSON.stringify(g));var F=g.row-1;if(this.nrRollUpRows&&F<this.nrRollUpRows-1&&(F=this.nrRollUpRows-1),this.nrRollUpRows&&this.currRow!==F){for(var P=0;P<E;P++)this.rows[P].clear();var N=this.currRow+1-this.nrRollUpRows,X=this.lastOutputScreen;if(X){var j=X.rows[N].cueStartTime,A=this.logger.time;if(j&&A!==null&&j<A)for(var K=0;K<this.nrRollUpRows;K++)this.rows[F-this.nrRollUpRows+K+1].copy(X.rows[N+K])}}this.currRow=F;var U=this.rows[this.currRow];if(g.indent!==null){var k=g.indent,z=Math.max(k-1,0);U.setCursor(g.indent),g.color=U.chars[z].penState.foreground}var te={foreground:g.color,underline:g.underline,italics:g.italics,background:"black",flash:!1};this.setPen(te)},T.setBkgData=function(g){this.logger.log(a.INFO,"bkgData = "+JSON.stringify(g)),this.backSpace(),this.setPen(g),this.insertChar(32)},T.setRollUpRows=function(g){this.nrRollUpRows=g},T.rollUp=function(){if(this.nrRollUpRows===null){this.logger.log(a.DEBUG,"roll_up but nrRollUpRows not set yet");return}this.logger.log(a.TEXT,this.getDisplayText());var g=this.currRow+1-this.nrRollUpRows,F=this.rows.splice(g,1)[0];F.clear(),this.rows.splice(this.currRow,0,F),this.logger.log(a.INFO,"Rolling up")},T.getDisplayText=function(g){g=g||!1;for(var F=[],P="",N=-1,X=0;X<E;X++){var j=this.rows[X].getTextString();j&&(N=X+1,g?F.push("Row "+N+": '"+j+"'"):F.push(j.trim()))}return F.length>0&&(g?P="["+F.join(" | ")+"]":P=F.join(`
|
|
|
`)),P},T.getTextAndFormat=function(){return this.rows},y}(),v=function(){function y(O,g,F){this.chNr=void 0,this.outputFilter=void 0,this.mode=void 0,this.verbose=void 0,this.displayedMemory=void 0,this.nonDisplayedMemory=void 0,this.lastOutputScreen=void 0,this.currRollUpRow=void 0,this.writeScreen=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chNr=O,this.outputFilter=g,this.mode=null,this.verbose=0,this.displayedMemory=new f(F),this.nonDisplayedMemory=new f(F),this.lastOutputScreen=new f(F),this.currRollUpRow=this.displayedMemory.rows[E-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=F}var T=y.prototype;return T.reset=function(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.outputFilter.reset(),this.currRollUpRow=this.displayedMemory.rows[E-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null},T.getHandler=function(){return this.outputFilter},T.setHandler=function(g){this.outputFilter=g},T.setPAC=function(g){this.writeScreen.setPAC(g)},T.setBkgData=function(g){this.writeScreen.setBkgData(g)},T.setMode=function(g){if(g===this.mode)return;this.mode=g,this.logger.log(a.INFO,"MODE="+g),this.mode==="MODE_POP-ON"?this.writeScreen=this.nonDisplayedMemory:(this.writeScreen=this.displayedMemory,this.writeScreen.reset()),this.mode!=="MODE_ROLL-UP"&&(this.displayedMemory.nrRollUpRows=null,this.nonDisplayedMemory.nrRollUpRows=null),this.mode=g},T.insertChars=function(g){for(var F=0;F<g.length;F++)this.writeScreen.insertChar(g[F]);var P=this.writeScreen===this.displayedMemory?"DISP":"NON_DISP";this.logger.log(a.INFO,P+": "+this.writeScreen.getDisplayText(!0)),(this.mode==="MODE_PAINT-ON"||this.mode==="MODE_ROLL-UP")&&(this.logger.log(a.TEXT,"DISPLAYED: "+this.displayedMemory.getDisplayText(!0)),this.outputDataUpdate())},T.ccRCL=function(){this.logger.log(a.INFO,"RCL - Resume Caption Loading"),this.setMode("MODE_POP-ON")},T.ccBS=function(){if(this.logger.log(a.INFO,"BS - BackSpace"),this.mode==="MODE_TEXT")return;this.writeScreen.backSpace(),this.writeScreen===this.displayedMemory&&this.outputDataUpdate()},T.ccAOF=function(){},T.ccAON=function(){},T.ccDER=function(){this.logger.log(a.INFO,"DER- Delete to End of Row"),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate()},T.ccRU=function(g){this.logger.log(a.INFO,"RU("+g+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(g)},T.ccFON=function(){this.logger.log(a.INFO,"FON - Flash On"),this.writeScreen.setPen({flash:!0})},T.ccRDC=function(){this.logger.log(a.INFO,"RDC - Resume Direct Captioning"),this.setMode("MODE_PAINT-ON")},T.ccTR=function(){this.logger.log(a.INFO,"TR"),this.setMode("MODE_TEXT")},T.ccRTD=function(){this.logger.log(a.INFO,"RTD"),this.setMode("MODE_TEXT")},T.ccEDM=function(){this.logger.log(a.INFO,"EDM - Erase Displayed Memory"),this.displayedMemory.reset(),this.outputDataUpdate(!0)},T.ccCR=function(){this.logger.log(a.INFO,"CR - Carriage Return"),this.writeScreen.rollUp(),this.outputDataUpdate(!0)},T.ccENM=function(){this.logger.log(a.INFO,"ENM - Erase Non-displayed Memory"),this.nonDisplayedMemory.reset()},T.ccEOC=function(){if(this.logger.log(a.INFO,"EOC - End Of Caption"),this.mode==="MODE_POP-ON"){var g=this.displayedMemory;this.displayedMemory=this.nonDisplayedMemory,this.nonDisplayedMemory=g,this.writeScreen=this.nonDisplayedMemory,this.logger.log(a.TEXT,"DISP: "+this.displayedMemory.getDisplayText())}this.outputDataUpdate(!0)},T.ccTO=function(g){this.logger.log(a.INFO,"TO("+g+") - Tab Offset"),this.writeScreen.moveCursor(g)},T.ccMIDROW=function(g){var F={flash:!1};if(F.underline=g%2===1,F.italics=g>=46,F.italics)F.foreground="white";else{var P=Math.floor(g/2)-16,N=["white","green","blue","cyan","red","yellow","magenta"];F.foreground=N[P]}this.logger.log(a.INFO,"MIDROW: "+JSON.stringify(F)),this.writeScreen.setPen(F)},T.outputDataUpdate=function(g){g===void 0&&(g=!1);var F=this.logger.time;if(F===null)return;this.outputFilter&&(this.cueStartTime===null&&!this.displayedMemory.isEmpty()?this.cueStartTime=F:this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime,F,this.lastOutputScreen),g&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:F),this.lastOutputScreen.copy(this.displayedMemory))},T.cueSplitAtTime=function(g){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,g,this.displayedMemory),this.cueStartTime=g))},y}(),m=function(){function y(O,g,F){this.channels=void 0,this.currentChannel=0,this.cmdHistory=void 0,this.logger=void 0;var P=new t;this.channels=[null,new v(O,g,P),new v(O+1,F,P)],this.cmdHistory=_(),this.logger=P}var T=y.prototype;return T.getHandler=function(g){return this.channels[g].getHandler()},T.setHandler=function(g,F){this.channels[g].setHandler(F)},T.addData=function(g,F){var P,N,X,j=!1;this.logger.time=g;for(var A=0;A<F.length;A+=2){if(N=F[A]&127,X=F[A+1]&127,N===0&&X===0)continue;if(this.logger.log(a.DATA,"["+r([F[A],F[A+1]])+"] -> ("+r([N,X])+")"),P=this.parseCmd(N,X),P||(P=this.parseMidrow(N,X)),P||(P=this.parsePAC(N,X)),P||(P=this.parseBackgroundAttributes(N,X)),!P&&(j=this.parseChars(N,X),j)){var K=this.currentChannel;if(K&&K>0){var U=this.channels[K];U.insertChars(j)}else this.logger.log(a.WARNING,"No channel found yet. TEXT-MODE?")}!P&&!j&&this.logger.log(a.WARNING,"Couldn't parse cleaned data "+r([N,X])+" orig: "+r([F[A],F[A+1]]))}},T.parseCmd=function(g,F){var P=this.cmdHistory,N=(g===20||g===28||g===21||g===29)&&F>=32&&F<=47,X=(g===23||g===31)&&F>=33&&F<=35;if(!(N||X))return!1;if(C(g,F,P))return S(null,null,P),this.logger.log(a.DEBUG,"Repeated command ("+r([g,F])+") is dropped"),!0;var j=g===20||g===21||g===23?1:2,A=this.channels[j];return g===20||g===21||g===28||g===29?F===32?A.ccRCL():F===33?A.ccBS():F===34?A.ccAOF():F===35?A.ccAON():F===36?A.ccDER():F===37?A.ccRU(2):F===38?A.ccRU(3):F===39?A.ccRU(4):F===40?A.ccFON():F===41?A.ccRDC():F===42?A.ccTR():F===43?A.ccRTD():F===44?A.ccEDM():F===45?A.ccCR():F===46?A.ccENM():F===47&&A.ccEOC():A.ccTO(F-32),S(g,F,P),this.currentChannel=j,!0},T.parseMidrow=function(g,F){var P=0;if((g===17||g===25)&&F>=32&&F<=47){if(g===17?P=1:P=2,P!==this.currentChannel)return this.logger.log(a.ERROR,"Mismatch channel in midrow parsing"),!1;var N=this.channels[P];return N?(N.ccMIDROW(F),this.logger.log(a.DEBUG,"MIDROW ("+r([g,F])+")"),!0):!1}return!1},T.parsePAC=function(g,F){var P,N=this.cmdHistory,X=(g>=17&&g<=23||g>=25&&g<=31)&&F>=64&&F<=127,j=(g===16||g===24)&&F>=64&&F<=95;if(!(X||j))return!1;if(C(g,F,N))return S(null,null,N),!0;var A=g<=23?1:2;F>=64&&F<=95?P=A===1?i[g]:o[g]:P=A===1?c[g]:h[g];var K=this.channels[A];return K?(K.setPAC(this.interpretPAC(P,F)),S(g,F,N),this.currentChannel=A,!0):!1},T.interpretPAC=function(g,F){var P,N={color:null,italics:!1,indent:null,underline:!1,row:g};return F>95?P=F-96:P=F-64,N.underline=(P&1)===1,P<=13?N.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(P/2)]:P<=15?(N.italics=!0,N.color="white"):N.indent=Math.floor((P-16)/2)*4,N},T.parseChars=function(g,F){var P,N=null,X=null;if(g>=25?(P=2,X=g-8):(P=1,X=g),X>=17&&X<=19){var j;X===17?j=F+80:X===18?j=F+112:j=F+144,this.logger.log(a.INFO,"Special char '"+p(j)+"' in channel "+P),N=[j]}else g>=32&&g<=127&&(N=F===0?[g]:[g,F]);if(N){var A=r(N);this.logger.log(a.DEBUG,"Char codes = "+A.join(",")),S(g,F,this.cmdHistory)}return N},T.parseBackgroundAttributes=function(g,F){var P=(g===16||g===24)&&F>=32&&F<=47,N=(g===23||g===31)&&F>=45&&F<=47;if(!(P||N))return!1;var X,j={};g===16||g===24?(X=Math.floor((F-32)/2),j.background=n[X],F%2===1&&(j.background=j.background+"_semi")):F===45?j.background="transparent":(j.foreground="black",F===47&&(j.underline=!0));var A=g<=23?1:2,K=this.channels[A];return K.setBkgData(j),S(g,F,this.cmdHistory),!0},T.reset=function(){for(var g=0;g<Object.keys(this.channels).length;g++){var F=this.channels[g];F&&F.reset()}this.cmdHistory=_()},T.cueSplitAtTime=function(g){for(var F=0;F<this.channels.length;F++){var P=this.channels[F];P&&P.cueSplitAtTime(g)}},y}();function S(y,T,O){O.a=y,O.b=T}function C(y,T,O){return O.a===y&&O.b===T}function _(){return{a:null,b:null}}L.default=m},"./src/utils/codecs.ts":function(G,L,I){"use strict";I.r(L),I.d(L,"isCodecType",function(){return M}),I.d(L,"isCodecSupportedInMp4",function(){return p});var R={audio:{a3ds:!0,"ac-3":!0,"ac-4":!0,alac:!0,alaw:!0,dra1:!0,"dts+":!0,"dts-":!0,dtsc:!0,dtse:!0,dtsh:!0,"ec-3":!0,enca:!0,g719:!0,g726:!0,m4ae:!0,mha1:!0,mha2:!0,mhm1:!0,mhm2:!0,mlpa:!0,mp4a:!0,"raw ":!0,Opus:!0,samr:!0,sawb:!0,sawp:!0,sevc:!0,sqcp:!0,ssmv:!0,twos:!0,ulaw:!0},video:{avc1:!0,avc2:!0,avc3:!0,avc4:!0,avcp:!0,av01:!0,drac:!0,dvav:!0,dvhe:!0,encv:!0,hev1:!0,hvc1:!0,mjp2:!0,mp4v:!0,mvc1:!0,mvc2:!0,mvc3:!0,mvc4:!0,resv:!0,rv60:!0,s263:!0,svc1:!0,svc2:!0,"vc-1":!0,vp08:!0,vp09:!0},text:{stpp:!0,wvtt:!0}};function M(E,b){var i=R[b];return!!i&&i[E.slice(0,4)]===!0}function p(E,b){return MediaSource.isTypeSupported((b||"video")+'/mp4;codecs="'+E+'"')}},"./src/utils/cues.ts":function(G,L,I){"use strict";I.r(L);var R=I("./src/utils/vttparser.ts"),M=I("./src/utils/webvtt-parser.ts"),p=I("./src/utils/texttrack-utils.ts"),E=/\s/,b={newCue:function(c,o,h,n){for(var a=[],t,r,s,u,d,f=self.VTTCue||self.TextTrackCue,v=0;v<n.rows.length;v++)if(t=n.rows[v],s=!0,u=0,d="",!t.isEmpty()){for(var m=0;m<t.chars.length;m++)E.test(t.chars[m].uchar)&&s?u++:(d+=t.chars[m].uchar,s=!1);t.cueStartTime=o,o===h&&(h+=1e-4),u>=16?u--:u++;var S=Object(R.fixLineBreaks)(d.trim()),C=Object(M.generateCueId)(o,h,S);(!c||!c.cues||!c.cues.getCueById(C))&&(r=new f(o,h,S),r.id=C,r.line=v+1,r.align="left",r.position=10+Math.min(80,Math.floor(u*8/32)*10),a.push(r))}return c&&a.length&&(a.sort(function(_,y){return _.line==="auto"||y.line==="auto"?0:_.line>8&&y.line>8?y.line-_.line:_.line-y.line}),a.forEach(function(_){return Object(p.addCueToTrack)(c,_)})),a}};L.default=b},"./src/utils/discontinuities.ts":function(G,L,I){"use strict";I.r(L),I.d(L,"findFirstFragWithCC",function(){return E}),I.d(L,"shouldAlignOnDiscontinuities",function(){return b}),I.d(L,"findDiscontinuousReferenceFrag",function(){return i}),I.d(L,"adjustSlidingStart",function(){return o}),I.d(L,"alignStream",function(){return h}),I.d(L,"alignPDT",function(){return a}),I.d(L,"alignFragmentByPDTDelta",function(){return t}),I.d(L,"alignMediaPlaylistByPDT",function(){return r});var R=I("./src/polyfills/number.ts"),M=I("./src/utils/logger.ts"),p=I("./src/controller/level-helper.ts");function E(s,u){for(var d=null,f=0,v=s.length;f<v;f++){var m=s[f];if(m&&m.cc===u){d=m;break}}return d}function b(s,u,d){return!!(u.details&&(d.endCC>d.startCC||s&&s.cc<d.startCC))}function i(s,u){var d=s.fragments,f=u.fragments;if(!f.length||!d.length){M.logger.log("No fragments to align");return}var v=E(d,f[0].cc);if(!v||v&&!v.startPTS){M.logger.log("No frag in previous level to align on");return}return v}function c(s,u){if(s){var d=s.start+u;s.start=s.startPTS=d,s.endPTS=d+s.duration}}function o(s,u){for(var d=u.fragments,f=0,v=d.length;f<v;f++)c(d[f],s);u.fragmentHint&&c(u.fragmentHint,s),u.alignedSliding=!0}function h(s,u,d){if(!u)return;n(s,d,u),!d.alignedSliding&&u.details&&a(d,u.details),!d.alignedSliding&&u.details&&!d.skippedSegments&&Object(p.adjustSliding)(u.details,d)}function n(s,u,d){if(b(s,d,u)){var f=i(d.details,u);f&&Object(R.isFiniteNumber)(f.start)&&(M.logger.log("Adjusting PTS using last level due to CC increase within current level "+u.url),o(f.start,u))}}function a(s,u){if(!u.fragments.length||!s.hasProgramDateTime||!u.hasProgramDateTime)return;var d=u.fragments[0].programDateTime,f=s.fragments[0].programDateTime,v=(f-d)/1e3+u.fragments[0].start;v&&Object(R.isFiniteNumber)(v)&&(M.logger.log("Adjusting PTS using programDateTime delta "+(f-d)+"ms, sliding:"+v.toFixed(3)+" "+s.url+" "),o(v,s))}function t(s,u){var d=s.programDateTime;if(!d)return;var f=(d-u)/1e3;s.start=s.startPTS=f,s.endPTS=f+s.duration}function r(s,u){if(!u.fragments.length||!s.hasProgramDateTime||!u.hasProgramDateTime)return;var d=u.fragments[0].programDateTime,f=u.fragments[0].start,v=d-f*1e3;s.fragments.forEach(function(m){t(m,v)}),s.fragmentHint&&t(s.fragmentHint,v),s.alignedSliding=!0}},"./src/utils/ewma-bandwidth-estimator.ts":function(G,L,I){"use strict";I.r(L);var R=I("./src/utils/ewma.ts"),M=function(){function p(b,i,c){this.defaultEstimate_=void 0,this.minWeight_=void 0,this.minDelayMs_=void 0,this.slow_=void 0,this.fast_=void 0,this.defaultEstimate_=c,this.minWeight_=.001,this.minDelayMs_=50,this.slow_=new R.default(b),this.fast_=new R.default(i)}var E=p.prototype;return E.update=function(i,c){var o=this.slow_,h=this.fast_;this.slow_.halfLife!==i&&(this.slow_=new R.default(i,o.getEstimate(),o.getTotalWeight())),this.fast_.halfLife!==c&&(this.fast_=new R.default(c,h.getEstimate(),h.getTotalWeight()))},E.sample=function(i,c){i=Math.max(i,this.minDelayMs_);var o=8*c,h=i/1e3,n=o/h;this.fast_.sample(h,n),this.slow_.sample(h,n)},E.canEstimate=function(){var i=this.fast_;return i&&i.getTotalWeight()>=this.minWeight_},E.getEstimate=function(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_},E.destroy=function(){},p}();L.default=M},"./src/utils/ewma.ts":function(G,L,I){"use strict";I.r(L);var R=function(){function M(E,b,i){b===void 0&&(b=0),i===void 0&&(i=0),this.halfLife=void 0,this.alpha_=void 0,this.estimate_=void 0,this.totalWeight_=void 0,this.halfLife=E,this.alpha_=E?Math.exp(Math.log(.5)/E):0,this.estimate_=b,this.totalWeight_=i}var p=M.prototype;return p.sample=function(b,i){var c=Math.pow(this.alpha_,b);this.estimate_=i*(1-c)+c*this.estimate_,this.totalWeight_+=b},p.getTotalWeight=function(){return this.totalWeight_},p.getEstimate=function(){if(this.alpha_){var b=1-Math.pow(this.alpha_,this.totalWeight_);if(b)return this.estimate_/b}return this.estimate_},M}();L.default=R},"./src/utils/fetch-loader.ts":function(G,L,I){"use strict";I.r(L),I.d(L,"fetchSupported",function(){return t});var R=I("./src/polyfills/number.ts"),M=I("./src/loader/load-stats.ts"),p=I("./src/demux/chunk-cache.ts");function E(f,v){f.prototype=Object.create(v.prototype),f.prototype.constructor=f,h(f,v)}function b(f){var v=typeof Map=="function"?new Map:void 0;return b=function(S){if(S===null||!o(S))return S;if(typeof S!="function")throw new TypeError("Super expression must either be null or a function");if(typeof v!="undefined"){if(v.has(S))return v.get(S);v.set(S,C)}function C(){return i(S,arguments,n(this).constructor)}return C.prototype=Object.create(S.prototype,{constructor:{value:C,enumerable:!1,writable:!0,configurable:!0}}),h(C,S)},b(f)}function i(f,v,m){return c()?i=Reflect.construct:i=function(C,_,y){var T=[null];T.push.apply(T,_);var O=Function.bind.apply(C,T),g=new O;return y&&h(g,y.prototype),g},i.apply(null,arguments)}function c(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(f){return!1}}function o(f){return Function.toString.call(f).indexOf("[native code]")!==-1}function h(f,v){return h=Object.setPrototypeOf||function(S,C){return S.__proto__=C,S},h(f,v)}function n(f){return n=Object.setPrototypeOf?Object.getPrototypeOf:function(m){return m.__proto__||Object.getPrototypeOf(m)},n(f)}function a(){return a=Object.assign||function(f){for(var v=1;v<arguments.length;v++){var m=arguments[v];for(var S in m)Object.prototype.hasOwnProperty.call(m,S)&&(f[S]=m[S])}return f},a.apply(this,arguments)}function t(){if(self.fetch&&self.AbortController&&self.ReadableStream&&self.Request)try{return new self.ReadableStream({}),!0}catch(f){}return!1}var r=function(){function f(m){this.fetchSetup=void 0,this.requestTimeout=void 0,this.request=void 0,this.response=void 0,this.controller=void 0,this.context=void 0,this.config=null,this.callbacks=null,this.stats=void 0,this.loader=null,this.fetchSetup=m.fetchSetup||u,this.controller=new self.AbortController,this.stats=new M.LoadStats}var v=f.prototype;return v.destroy=function(){this.loader=this.callbacks=null,this.abortInternal()},v.abortInternal=function(){var S=this.response;(!S||!S.ok)&&(this.stats.aborted=!0,this.controller.abort())},v.abort=function(){var S;this.abortInternal(),(S=this.callbacks)!==null&&S!==void 0&&S.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.response)},v.load=function(S,C,_){var y=this,T=this.stats;if(T.loading.start)throw new Error("Loader can only be used once.");T.loading.start=self.performance.now();var O=s(S,this.controller.signal),g=_.onProgress,F=S.responseType==="arraybuffer",P=F?"byteLength":"length";this.context=S,this.config=C,this.callbacks=_,this.request=this.fetchSetup(S,O),self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(function(){y.abortInternal(),_.onTimeout(T,S,y.response)},C.timeout),self.fetch(this.request).then(function(N){if(y.response=y.loader=N,!N.ok){var X=N.status,j=N.statusText;throw new d(j||"fetch, bad network response",X,N)}return T.loading.first=Math.max(self.performance.now(),T.loading.start),T.total=parseInt(N.headers.get("Content-Length")||"0"),g&&Object(R.isFiniteNumber)(C.highWaterMark)?y.loadProgressively(N,T,S,C.highWaterMark,g):F?N.arrayBuffer():N.text()}).then(function(N){var X=y.response;self.clearTimeout(y.requestTimeout),T.loading.end=Math.max(self.performance.now(),T.loading.first),T.loaded=T.total=N[P];var j={url:X.url,data:N};g&&!Object(R.isFiniteNumber)(C.highWaterMark)&&g(T,S,N,X),_.onSuccess(j,T,S,X)}).catch(function(N){if(self.clearTimeout(y.requestTimeout),T.aborted)return;var X=N.code||0;_.onError({code:X,text:N.message},S,N.details)})},v.getCacheAge=function(){var S=null;if(this.response){var C=this.response.headers.get("age");S=C?parseFloat(C):null}return S},v.loadProgressively=function(S,C,_,y,T){y===void 0&&(y=0);var O=new p.default,g=S.body.getReader(),F=function P(){return g.read().then(function(N){if(N.done)return O.dataLength&&T(C,_,O.flush(),S),Promise.resolve(new ArrayBuffer(0));var X=N.value,j=X.length;return C.loaded+=j,j<y||O.dataLength?(O.push(X),O.dataLength>=y&&T(C,_,O.flush(),S)):T(C,_,X,S),P()}).catch(function(){return Promise.reject()})};return F()},f}();function s(f,v){var m={method:"GET",mode:"cors",credentials:"same-origin",signal:v,headers:new self.Headers(a({},f.headers))};return f.rangeEnd&&m.headers.set("Range","bytes="+f.rangeStart+"-"+String(f.rangeEnd-1)),m}function u(f,v){return new self.Request(f.url,v)}var d=function(f){E(v,f);function v(m,S,C){var _;return _=f.call(this,m)||this,_.code=void 0,_.details=void 0,_.code=S,_.details=C,_}return v}(b(Error));L.default=r},"./src/utils/imsc1-ttml-parser.ts":function(G,L,I){"use strict";I.r(L),I.d(L,"IMSC1_CODEC",function(){return o}),I.d(L,"parseIMSC1",function(){return t});var R=I("./src/utils/mp4-tools.ts"),M=I("./src/utils/vttparser.ts"),p=I("./src/utils/vttcue.ts"),E=I("./src/demux/id3.ts"),b=I("./src/utils/timescale-conversion.ts"),i=I("./src/utils/webvtt-parser.ts");function c(){return c=Object.assign||function(y){for(var T=1;T<arguments.length;T++){var O=arguments[T];for(var g in O)Object.prototype.hasOwnProperty.call(O,g)&&(y[g]=O[g])}return y},c.apply(this,arguments)}var o="stpp.ttml.im1t",h=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,n=/^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/,a={left:"start",center:"center",right:"end",start:"start",end:"end"};function t(y,T,O,g,F){var P=Object(R.findBox)(new Uint8Array(y),["mdat"]);if(P.length===0){F(new Error("Could not parse IMSC1 mdat"));return}var N=P[0],X=Object(E.utf8ArrayToStr)(new Uint8Array(y,N.start,N.end-N.start)),j=Object(b.toTimescaleFromScale)(T,1,O);try{g(r(X,j))}catch(A){F(A)}}function r(y,T){var O=new DOMParser,g=O.parseFromString(y,"text/xml"),F=g.getElementsByTagName("tt")[0];if(!F)throw new Error("Invalid ttml");var P={frameRate:30,subFrameRate:1,frameRateMultiplier:0,tickRate:0},N=Object.keys(P).reduce(function(U,k){return U[k]=F.getAttribute("ttp:"+k)||P[k],U},{}),X=F.getAttribute("xml:space")!=="preserve",j=u(s(F,"styling","style")),A=u(s(F,"layout","region")),K=s(F,"body","[begin]");return[].map.call(K,function(U){var k=d(U,X);if(!k||!U.hasAttribute("begin"))return null;var z=S(U.getAttribute("begin"),N),te=S(U.getAttribute("dur"),N),de=S(U.getAttribute("end"),N);if(z===null)throw m(U);if(de===null){if(te===null)throw m(U);de=z+te}var be=new p.default(z-T,de-T,k);be.id=Object(i.generateCueId)(be.startTime,be.endTime,be.text);var We=A[U.getAttribute("region")],Ne=j[U.getAttribute("style")];be.position=10,be.size=80;var Le=f(We,Ne),Ke=Le.textAlign;if(Ke){var He=a[Ke];He&&(be.lineAlign=He),be.align=Ke}return c(be,Le),be}).filter(function(U){return U!==null})}function s(y,T,O){var g=y.getElementsByTagName(T)[0];return g?[].slice.call(g.querySelectorAll(O)):[]}function u(y){return y.reduce(function(T,O){var g=O.getAttribute("xml:id");return g&&(T[g]=O),T},{})}function d(y,T){return[].slice.call(y.childNodes).reduce(function(O,g,F){var P;return g.nodeName==="br"&&F?O+`
|
|
|
`:(P=g.childNodes)!==null&&P!==void 0&&P.length?d(g,T):T?O+g.textContent.trim().replace(/\s+/g," "):O+g.textContent},"")}function f(y,T){var O="http://www.w3.org/ns/ttml#styling",g=["displayAlign","textAlign","color","backgroundColor","fontSize","fontFamily"];return g.reduce(function(F,P){var N=v(T,O,P)||v(y,O,P);return N&&(F[P]=N),F},{})}function v(y,T,O){return y.hasAttributeNS(T,O)?y.getAttributeNS(T,O):null}function m(y){return new Error("Could not parse ttml timestamp "+y)}function S(y,T){if(!y)return null;var O=Object(M.parseTimeStamp)(y);return O===null&&(h.test(y)?O=C(y,T):n.test(y)&&(O=_(y,T))),O}function C(y,T){var O=h.exec(y),g=(O[4]|0)+(O[5]|0)/T.subFrameRate;return(O[1]|0)*3600+(O[2]|0)*60+(O[3]|0)+g/T.frameRate}function _(y,T){var O=n.exec(y),g=Number(O[1]),F=O[2];switch(F){case"h":return g*3600;case"m":return g*60;case"ms":return g*1e3;case"f":return g/T.frameRate;case"t":return g/T.tickRate}return g}},"./src/utils/logger.ts":function(G,L,I){"use strict";I.r(L),I.d(L,"enableLogs",function(){return i}),I.d(L,"logger",function(){return c});var R=function(){},M={trace:R,debug:R,log:R,warn:R,info:R,error:R},p=M;function E(o){var h=self.console[o];return h?h.bind(self.console,"["+o+"] >"):R}function b(o){for(var h=arguments.length,n=new Array(h>1?h-1:0),a=1;a<h;a++)n[a-1]=arguments[a];n.forEach(function(t){p[t]=o[t]?o[t].bind(o):E(t)})}function i(o){if(self.console&&o===!0||typeof o=="object"){b(o,"debug","log","info","warn","error");try{p.log()}catch(h){p=M}}else p=M}var c=p},"./src/utils/mediakeys-helper.ts":function(G,L,I){"use strict";I.r(L),I.d(L,"KeySystems",function(){return R}),I.d(L,"requestMediaKeySystemAccess",function(){return M});var R;(function(p){p.WIDEVINE="com.widevine.alpha",p.PLAYREADY="com.microsoft.playready"})(R||(R={}));var M=function(){return typeof self!="undefined"&&self.navigator&&self.navigator.requestMediaKeySystemAccess?self.navigator.requestMediaKeySystemAccess.bind(self.navigator):null}()},"./src/utils/mediasource-helper.ts":function(G,L,I){"use strict";I.r(L),I.d(L,"getMediaSource",function(){return R});function R(){return self.MediaSource||self.WebKitMediaSource}},"./src/utils/mp4-tools.ts":function(G,L,I){"use strict";I.r(L),I.d(L,"bin2str",function(){return b}),I.d(L,"readUint16",function(){return i}),I.d(L,"readUint32",function(){return c}),I.d(L,"writeUint32",function(){return o}),I.d(L,"findBox",function(){return h}),I.d(L,"parseSegmentIndex",function(){return n}),I.d(L,"parseInitSegment",function(){return a}),I.d(L,"getStartDTS",function(){return t}),I.d(L,"getDuration",function(){return r}),I.d(L,"computeRawDurationFromSamples",function(){return s}),I.d(L,"offsetStartDTS",function(){return u}),I.d(L,"segmentValidRange",function(){return d}),I.d(L,"appendUint8Array",function(){return f});var R=I("./src/utils/typed-array.ts"),M=I("./src/loader/fragment.ts"),p=Math.pow(2,32)-1,E=[].push;function b(v){return String.fromCharCode.apply(null,v)}function i(v,m){"data"in v&&(m+=v.start,v=v.data);var S=v[m]<<8|v[m+1];return S<0?65536+S:S}function c(v,m){"data"in v&&(m+=v.start,v=v.data);var S=v[m]<<24|v[m+1]<<16|v[m+2]<<8|v[m+3];return S<0?4294967296+S:S}function o(v,m,S){"data"in v&&(m+=v.start,v=v.data),v[m]=S>>24,v[m+1]=S>>16&255,v[m+2]=S>>8&255,v[m+3]=S&255}function h(v,m){var S=[];if(!m.length)return S;var C,_,y;"data"in v?(C=v.data,_=v.start,y=v.end):(C=v,_=0,y=C.byteLength);for(var T=_;T<y;){var O=c(C,T),g=b(C.subarray(T+4,T+8)),F=O>1?T+O:y;if(g===m[0])if(m.length===1)S.push({data:C,start:T+8,end:F});else{var P=h({data:C,start:T+8,end:F},m.slice(1));P.length&&E.apply(S,P)}T=F}return S}function n(v){var m=h(v,["moov"]),S=m[0],C=S?S.end:null,_=h(v,["sidx"]);if(!_||!_[0])return null;var y=[],T=_[0],O=T.data[0],g=O===0?8:16,F=c(T,g);g+=4;var P=0,N=0;O===0?g+=8:g+=16,g+=2;var X=T.end+N,j=i(T,g);g+=2;for(var A=0;A<j;A++){var K=g,U=c(T,K);K+=4;var k=U&2147483647,z=(U&2147483648)>>>31;if(z===1)return console.warn("SIDX has hierarchical references (not supported)"),null;var te=c(T,K);K+=4,y.push({referenceSize:k,subsegmentDuration:te,info:{duration:te/F,start:X,end:X+k-1}}),X+=k,K+=4,g=K}return{earliestPresentationTime:P,timescale:F,version:O,referencesCount:j,references:y,moovEndOffset:C}}function a(v){for(var m=[],S=h(v,["moov","trak"]),C=0;C<S.length;C++){var _=S[C],y=h(_,["tkhd"])[0];if(y){var T=y.data[y.start],O=T===0?12:20,g=c(y,O),F=h(_,["mdia","mdhd"])[0];if(F){T=F.data[F.start],O=T===0?12:20;var P=c(F,O),N=h(_,["mdia","hdlr"])[0];if(N){var X=b(N.data.subarray(N.start+8,N.start+12)),j={soun:M.ElementaryStreamTypes.AUDIO,vide:M.ElementaryStreamTypes.VIDEO}[X];if(j){var A=h(_,["mdia","minf","stbl","stsd"])[0],K=void 0;A&&(K=b(A.data.subarray(A.start+12,A.start+16))),m[g]={timescale:P,type:j},m[j]={timescale:P,id:g,codec:K}}}}}}var U=h(v,["moov","mvex","trex"]);return U.forEach(function(k){var z=c(k,4),te=m[z];te&&(te.default={duration:c(k,12),flags:c(k,20)})}),m}function t(v,m){return h(m,["moof","traf"]).reduce(function(S,C){var _=h(C,["tfdt"])[0],y=_.data[_.start],T=h(C,["tfhd"]).reduce(function(O,g){var F=c(g,4),P=v[F];if(P){var N=c(_,4);y===1&&(N*=Math.pow(2,32),N+=c(_,8));var X=P.timescale||9e4,j=N/X;if(isFinite(j)&&(O===null||j<O))return j}return O},null);return T!==null&&isFinite(T)&&(S===null||T<S)?T:S},null)||0}function r(v,m){for(var S=0,C=0,_=0,y=h(v,["moof","traf"]),T=0;T<y.length;T++){var O=y[T],g=h(O,["tfhd"])[0],F=c(g,4),P=m[F];if(!P)continue;var N=P.default,X=c(g,0)|(N==null?void 0:N.flags),j=N==null?void 0:N.duration;X&8&&(X&2?j=c(g,12):j=c(g,8));for(var A=P.timescale||9e4,K=h(O,["trun"]),U=0;U<K.length;U++){if(j){var k=c(K[U],4);S=j*k}else S=s(K[U]);P.type===M.ElementaryStreamTypes.VIDEO?C+=S/A:P.type===M.ElementaryStreamTypes.AUDIO&&(_+=S/A)}}if(C===0&&_===0){var z=n(v);if(z!=null&&z.references)return z.references.reduce(function(te,de){return te+de.info.duration||0},0)}return C||_}function s(v){var m=c(v,0),S=8;m&1&&(S+=4),m&4&&(S+=4);for(var C=0,_=c(v,4),y=0;y<_;y++){if(m&256){var T=c(v,S);C+=T,S+=4}m&512&&(S+=4),m&1024&&(S+=4),m&2048&&(S+=4)}return C}function u(v,m,S){h(m,["moof","traf"]).forEach(function(C){h(C,["tfhd"]).forEach(function(_){var y=c(_,4),T=v[y];if(!T)return;var O=T.timescale||9e4;h(C,["tfdt"]).forEach(function(g){var F=g.data[g.start],P=c(g,4);if(F===0)o(g,4,P-S*O);else{P*=Math.pow(2,32),P+=c(g,8),P-=S*O,P=Math.max(P,0);var N=Math.floor(P/(p+1)),X=Math.floor(P%(p+1));o(g,4,N),o(g,8,X)}})})})}function d(v){var m={valid:null,remainder:null},S=h(v,["moof"]);if(S){if(S.length<2)return m.remainder=v,m}else return m;var C=S[S.length-1];return m.valid=Object(R.sliceUint8)(v,0,C.start-8),m.remainder=Object(R.sliceUint8)(v,C.start-8),m}function f(v,m){var S=new Uint8Array(v.length+m.length);return S.set(v),S.set(m,v.length),S}},"./src/utils/output-filter.ts":function(G,L,I){"use strict";I.r(L),I.d(L,"default",function(){return R});var R=function(){function M(E,b){this.timelineController=void 0,this.cueRanges=[],this.trackName=void 0,this.startTime=null,this.endTime=null,this.screen=null,this.timelineController=E,this.trackName=b}var p=M.prototype;return p.dispatchCue=function(){if(this.startTime===null)return;this.timelineController.addCues(this.trackName,this.startTime,this.endTime,this.screen,this.cueRanges),this.startTime=null},p.newCue=function(b,i,c){(this.startTime===null||this.startTime>b)&&(this.startTime=b),this.endTime=i,this.screen=c,this.timelineController.createCaptionsTrack(this.trackName)},p.reset=function(){this.cueRanges=[]},M}()},"./src/utils/texttrack-utils.ts":function(G,L,I){"use strict";I.r(L),I.d(L,"sendAddTrackEvent",function(){return M}),I.d(L,"addCueToTrack",function(){return p}),I.d(L,"clearCurrentCues",function(){return E}),I.d(L,"removeCuesInRange",function(){return b}),I.d(L,"getCuesInRange",function(){return c});var R=I("./src/utils/logger.ts");function M(o,h){var n;try{n=new Event("addtrack")}catch(a){n=document.createEvent("Event"),n.initEvent("addtrack",!1,!1)}n.track=o,h.dispatchEvent(n)}function p(o,h){var n=o.mode;if(n==="disabled"&&(o.mode="hidden"),o.cues&&!o.cues.getCueById(h.id))try{if(o.addCue(h),!o.cues.getCueById(h.id))throw new Error("addCue is failed for: "+h)}catch(t){R.logger.debug("[texttrack-utils]: "+t);var a=new self.TextTrackCue(h.startTime,h.endTime,h.text);a.id=h.id,o.addCue(a)}n==="disabled"&&(o.mode=n)}function E(o){var h=o.mode;if(h==="disabled"&&(o.mode="hidden"),o.cues)for(var n=o.cues.length;n--;)o.removeCue(o.cues[n]);h==="disabled"&&(o.mode=h)}function b(o,h,n){var a=o.mode;if(a==="disabled"&&(o.mode="hidden"),o.cues&&o.cues.length>0)for(var t=c(o.cues,h,n),r=0;r<t.length;r++)o.removeCue(t[r]);a==="disabled"&&(o.mode=a)}function i(o,h){if(h<o[0].startTime)return 0;var n=o.length-1;if(h>o[n].endTime)return-1;for(var a=0,t=n;a<=t;){var r=Math.floor((t+a)/2);if(h<o[r].startTime)t=r-1;else if(h>o[r].startTime&&a<n)a=r+1;else return r}return o[a].startTime-h<h-o[t].startTime?a:t}function c(o,h,n){var a=[],t=i(o,h);if(t>-1)for(var r=t,s=o.length;r<s;r++){var u=o[r];if(u.startTime>=h&&u.endTime<=n)a.push(u);else if(u.startTime>n)return a}return a}},"./src/utils/time-ranges.ts":function(G,L,I){"use strict";I.r(L);var R={toString:function(p){for(var E="",b=p.length,i=0;i<b;i++)E+="["+p.start(i).toFixed(3)+","+p.end(i).toFixed(3)+"]";return E}};L.default=R},"./src/utils/timescale-conversion.ts":function(G,L,I){"use strict";I.r(L),I.d(L,"toTimescaleFromBase",function(){return M}),I.d(L,"toTimescaleFromScale",function(){return p}),I.d(L,"toMsFromMpegTsClock",function(){return E}),I.d(L,"toMpegTsClockFromTimescale",function(){return b});var R=9e4;function M(i,c,o,h){o===void 0&&(o=1),h===void 0&&(h=!1);var n=i*c*o;return h?Math.round(n):n}function p(i,c,o,h){return o===void 0&&(o=1),h===void 0&&(h=!1),M(i,c,1/o,h)}function E(i,c){return c===void 0&&(c=!1),M(i,1e3,1/R,c)}function b(i,c){return c===void 0&&(c=1),M(i,R,1/c)}},"./src/utils/typed-array.ts":function(G,L,I){"use strict";I.r(L),I.d(L,"sliceUint8",function(){return R});function R(M,p,E){return Uint8Array.prototype.slice?M.slice(p,E):new Uint8Array(Array.prototype.slice.call(M,p,E))}},"./src/utils/vttcue.ts":function(G,L,I){"use strict";I.r(L),L.default=function(){if(typeof self!="undefined"&&self.VTTCue)return self.VTTCue;var R=["","lr","rl"],M=["start","middle","end","left","right"];function p(o,h){if(typeof h!="string")return!1;if(!Array.isArray(o))return!1;var n=h.toLowerCase();return~o.indexOf(n)?n:!1}function E(o){return p(R,o)}function b(o){return p(M,o)}function i(o){for(var h=arguments.length,n=new Array(h>1?h-1:0),a=1;a<h;a++)n[a-1]=arguments[a];for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var s in r)o[s]=r[s]}return o}function c(o,h,n){var a=this,t={enumerable:!0};a.hasBeenReset=!1;var r="",s=!1,u=o,d=h,f=n,v=null,m="",S=!0,C="auto",_="start",y=50,T="middle",O=50,g="middle";Object.defineProperty(a,"id",i({},t,{get:function(){return r},set:function(P){r=""+P}})),Object.defineProperty(a,"pauseOnExit",i({},t,{get:function(){return s},set:function(P){s=!!P}})),Object.defineProperty(a,"startTime",i({},t,{get:function(){return u},set:function(P){if(typeof P!="number")throw new TypeError("Start time must be set to a number.");u=P,this.hasBeenReset=!0}})),Object.defineProperty(a,"endTime",i({},t,{get:function(){return d},set:function(P){if(typeof P!="number")throw new TypeError("End time must be set to a number.");d=P,this.hasBeenReset=!0}})),Object.defineProperty(a,"text",i({},t,{get:function(){return f},set:function(P){f=""+P,this.hasBeenReset=!0}})),Object.defineProperty(a,"region",i({},t,{get:function(){return v},set:function(P){v=P,this.hasBeenReset=!0}})),Object.defineProperty(a,"vertical",i({},t,{get:function(){return m},set:function(P){var N=E(P);if(N===!1)throw new SyntaxError("An invalid or illegal string was specified.");m=N,this.hasBeenReset=!0}})),Object.defineProperty(a,"snapToLines",i({},t,{get:function(){return S},set:function(P){S=!!P,this.hasBeenReset=!0}})),Object.defineProperty(a,"line",i({},t,{get:function(){return C},set:function(P){if(typeof P!="number"&&P!=="auto")throw new SyntaxError("An invalid number or illegal string was specified.");C=P,this.hasBeenReset=!0}})),Object.defineProperty(a,"lineAlign",i({},t,{get:function(){return _},set:function(P){var N=b(P);if(!N)throw new SyntaxError("An invalid or illegal string was specified.");_=N,this.hasBeenReset=!0}})),Object.defineProperty(a,"position",i({},t,{get:function(){return y},set:function(P){if(P<0||P>100)throw new Error("Position must be between 0 and 100.");y=P,this.hasBeenReset=!0}})),Object.defineProperty(a,"positionAlign",i({},t,{get:function(){return T},set:function(P){var N=b(P);if(!N)throw new SyntaxError("An invalid or illegal string was specified.");T=N,this.hasBeenReset=!0}})),Object.defineProperty(a,"size",i({},t,{get:function(){return O},set:function(P){if(P<0||P>100)throw new Error("Size must be between 0 and 100.");O=P,this.hasBeenReset=!0}})),Object.defineProperty(a,"align",i({},t,{get:function(){return g},set:function(P){var N=b(P);if(!N)throw new SyntaxError("An invalid or illegal string was specified.");g=N,this.hasBeenReset=!0}})),a.displayState=void 0}return c.prototype.getCueAsHTML=function(){var o=self.WebVTT;return o.convertCueToDOMTree(self,this.text)},c}()},"./src/utils/vttparser.ts":function(G,L,I){"use strict";I.r(L),I.d(L,"parseTimeStamp",function(){return p}),I.d(L,"fixLineBreaks",function(){return h}),I.d(L,"VTTParser",function(){return n});var R=I("./src/utils/vttcue.ts"),M=function(){function a(){}var t=a.prototype;return t.decode=function(s,u){if(!s)return"";if(typeof s!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(s))},a}();function p(a){function t(s,u,d,f){return(s|0)*3600+(u|0)*60+(d|0)+parseFloat(f||0)}var r=a.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return r?parseFloat(r[2])>59?t(r[2],r[3],0,r[4]):t(r[1],r[2],r[3],r[4]):null}var E=function(){function a(){this.values=Object.create(null)}var t=a.prototype;return t.set=function(s,u){!this.get(s)&&u!==""&&(this.values[s]=u)},t.get=function(s,u,d){return d?this.has(s)?this.values[s]:u[d]:this.has(s)?this.values[s]:u},t.has=function(s){return s in this.values},t.alt=function(s,u,d){for(var f=0;f<d.length;++f)if(u===d[f]){this.set(s,u);break}},t.integer=function(s,u){/^-?\d+$/.test(u)&&this.set(s,parseInt(u,10))},t.percent=function(s,u){if(/^([\d]{1,3})(\.[\d]*)?%$/.test(u)){var d=parseFloat(u);if(d>=0&&d<=100)return this.set(s,d),!0}return!1},a}();function b(a,t,r,s){var u=s?a.split(s):[a];for(var d in u){if(typeof u[d]!="string")continue;var f=u[d].split(r);if(f.length!==2)continue;var v=f[0],m=f[1];t(v,m)}}var i=new R.default(0,0,""),c=i.align==="middle"?"middle":"center";function o(a,t,r){var s=a;function u(){var v=p(a);if(v===null)throw new Error("Malformed timestamp: "+s);return a=a.replace(/^[^\sa-zA-Z-]+/,""),v}function d(v,m){var S=new E;b(v,function(y,T){var O;switch(y){case"region":for(var g=r.length-1;g>=0;g--)if(r[g].id===T){S.set(y,r[g].region);break}break;case"vertical":S.alt(y,T,["rl","lr"]);break;case"line":O=T.split(","),S.integer(y,O[0]),S.percent(y,O[0])&&S.set("snapToLines",!1),S.alt(y,O[0],["auto"]),O.length===2&&S.alt("lineAlign",O[1],["start",c,"end"]);break;case"position":O=T.split(","),S.percent(y,O[0]),O.length===2&&S.alt("positionAlign",O[1],["start",c,"end","line-left","line-right","auto"]);break;case"size":S.percent(y,T);break;case"align":S.alt(y,T,["start",c,"end","left","right"]);break}},/:/,/\s/),m.region=S.get("region",null),m.vertical=S.get("vertical","");var C=S.get("line","auto");C==="auto"&&i.line===-1&&(C=-1),m.line=C,m.lineAlign=S.get("lineAlign","start"),m.snapToLines=S.get("snapToLines",!0),m.size=S.get("size",100),m.align=S.get("align",c);var _=S.get("position","auto");_==="auto"&&i.position===50&&(_=m.align==="start"||m.align==="left"?0:m.align==="end"||m.align==="right"?100:50),m.position=_}function f(){a=a.replace(/^\s+/,"")}if(f(),t.startTime=u(),f(),a.substr(0,3)!=="-->")throw new Error("Malformed time stamp (time stamps must be separated by '-->'): "+s);a=a.substr(3),f(),t.endTime=u(),f(),d(a,t)}function h(a){return a.replace(/<br(?: \/)?>/gi,`
|
|
|
`)}var n=function(){function a(){this.state="INITIAL",this.buffer="",this.decoder=new M,this.regionList=[],this.cue=null,this.oncue=void 0,this.onparsingerror=void 0,this.onflush=void 0}var t=a.prototype;return t.parse=function(s){var u=this;s&&(u.buffer+=u.decoder.decode(s,{stream:!0}));function d(){var _=u.buffer,y=0;for(_=h(_);y<_.length&&_[y]!=="\r"&&_[y]!==`
|
|
|
`;)++y;var T=_.substr(0,y);return _[y]==="\r"&&++y,_[y]===`
|
|
|
`&&++y,u.buffer=_.substr(y),T}function f(_){b(_,function(y,T){},/:/)}try{var v="";if(u.state==="INITIAL"){if(!/\r\n|\n/.test(u.buffer))return this;v=d();var m=v.match(/^()?WEBVTT([ \t].*)?$/);if(!m||!m[0])throw new Error("Malformed WebVTT signature.");u.state="HEADER"}for(var S=!1;u.buffer;){if(!/\r\n|\n/.test(u.buffer))return this;S?S=!1:v=d();switch(u.state){case"HEADER":/:/.test(v)?f(v):v||(u.state="ID");continue;case"NOTE":v||(u.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(v)){u.state="NOTE";break}if(!v)continue;if(u.cue=new R.default(0,0,""),u.state="CUE",v.indexOf("-->")===-1){u.cue.id=v;continue}case"CUE":if(!u.cue){u.state="BADCUE";continue}try{o(v,u.cue,u.regionList)}catch(_){u.cue=null,u.state="BADCUE";continue}u.state="CUETEXT";continue;case"CUETEXT":{var C=v.indexOf("-->")!==-1;if(!v||C&&(S=!0)){u.oncue&&u.cue&&u.oncue(u.cue),u.cue=null,u.state="ID";continue}if(u.cue===null)continue;u.cue.text&&(u.cue.text+=`
|
|
|
`),u.cue.text+=v}continue;case"BADCUE":v||(u.state="ID")}}}catch(_){u.state==="CUETEXT"&&u.cue&&u.oncue&&u.oncue(u.cue),u.cue=null,u.state=u.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this},t.flush=function(){var s=this;try{if((s.cue||s.state==="HEADER")&&(s.buffer+=`
|
|
|
|
|
|
`,s.parse()),s.state==="INITIAL"||s.state==="BADWEBVTT")throw new Error("Malformed WebVTT signature.")}catch(u){s.onparsingerror&&s.onparsingerror(u)}return s.onflush&&s.onflush(),this},a}()},"./src/utils/webvtt-parser.ts":function(G,L,I){"use strict";I.r(L),I.d(L,"generateCueId",function(){return n}),I.d(L,"parseWebVTT",function(){return t});var R=I("./src/polyfills/number.ts"),M=I("./src/utils/vttparser.ts"),p=I("./src/demux/id3.ts"),E=I("./src/utils/timescale-conversion.ts"),b=I("./src/remux/mp4-remuxer.ts"),i=/\r\n|\n\r|\n|\r/g,c=function(s,u,d){return d===void 0&&(d=0),s.substr(d,u.length)===u},o=function(s){var u=parseInt(s.substr(-3)),d=parseInt(s.substr(-6,2)),f=parseInt(s.substr(-9,2)),v=s.length>9?parseInt(s.substr(0,s.indexOf(":"))):0;if(!Object(R.isFiniteNumber)(u)||!Object(R.isFiniteNumber)(d)||!Object(R.isFiniteNumber)(f)||!Object(R.isFiniteNumber)(v))throw Error("Malformed X-TIMESTAMP-MAP: Local:"+s);return u+=1e3*d,u+=60*1e3*f,u+=60*60*1e3*v,u},h=function(s){for(var u=5381,d=s.length;d;)u=u*33^s.charCodeAt(--d);return(u>>>0).toString()};function n(r,s,u){return h(r.toString())+h(s.toString())+h(u)}var a=function(s,u,d){var f=s[u],v=s[f.prevCC];if(!v||!v.new&&f.new){s.ccOffset=s.presentationOffset=f.start,f.new=!1;return}for(;(m=v)!==null&&m!==void 0&&m.new;){var m;s.ccOffset+=f.start-v.start,f.new=!1,f=v,v=s[f.prevCC]}s.presentationOffset=d};function t(r,s,u,d,f,v,m,S){var C=new M.VTTParser,_=Object(p.utf8ArrayToStr)(new Uint8Array(r)).trim().replace(i,`
|
|
|
`).split(`
|
|
|
`),y=[],T=Object(E.toMpegTsClockFromTimescale)(s,u),O="00:00.000",g=0,F=0,P,N=!0,X=!1;C.oncue=function(j){var A=d[f],K=d.ccOffset,U=(g-T)/9e4;if(A!=null&&A.new&&(F!==void 0?K=d.ccOffset=A.start:a(d,f,U)),U&&(K=U-d.presentationOffset),X){var k=j.endTime-j.startTime,z=Object(b.normalizePts)((j.startTime+K-F)*9e4,v*9e4)/9e4;j.startTime=z,j.endTime=z+k}var te=j.text.trim();j.text=decodeURIComponent(encodeURIComponent(te)),j.id||(j.id=n(j.startTime,j.endTime,te)),j.endTime>0&&y.push(j)},C.onparsingerror=function(j){P=j},C.onflush=function(){if(P){S(P);return}m(y)},_.forEach(function(j){if(N)if(c(j,"X-TIMESTAMP-MAP=")){N=!1,X=!0,j.substr(16).split(",").forEach(function(A){c(A,"LOCAL:")?O=A.substr(6):c(A,"MPEGTS:")&&(g=parseInt(A.substr(7)))});try{F=o(O)/1e3}catch(A){X=!1,P=A}return}else j===""&&(N=!1);C.parse(j+`
|
|
|
`)}),C.flush()}},"./src/utils/xhr-loader.ts":function(G,L,I){"use strict";I.r(L);var R=I("./src/utils/logger.ts"),M=I("./src/loader/load-stats.ts"),p=/^age:\s*[\d.]+\s*$/m,E=function(){function b(c){this.xhrSetup=void 0,this.requestTimeout=void 0,this.retryTimeout=void 0,this.retryDelay=void 0,this.config=null,this.callbacks=null,this.context=void 0,this.loader=null,this.stats=void 0,this.xhrSetup=c?c.xhrSetup:null,this.stats=new M.LoadStats,this.retryDelay=0}var i=b.prototype;return i.destroy=function(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null},i.abortInternal=function(){var o=this.loader;self.clearTimeout(this.requestTimeout),self.clearTimeout(this.retryTimeout),o&&(o.onreadystatechange=null,o.onprogress=null,o.readyState!==4&&(this.stats.aborted=!0,o.abort()))},i.abort=function(){var o;this.abortInternal(),(o=this.callbacks)!==null&&o!==void 0&&o.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)},i.load=function(o,h,n){if(this.stats.loading.start)throw new Error("Loader can only be used once.");this.stats.loading.start=self.performance.now(),this.context=o,this.config=h,this.callbacks=n,this.retryDelay=h.retryDelay,this.loadInternal()},i.loadInternal=function(){var o=this.config,h=this.context;if(!o)return;var n=this.loader=new self.XMLHttpRequest,a=this.stats;a.loading.first=0,a.loaded=0;var t=this.xhrSetup;try{if(t)try{t(n,h.url)}catch(u){n.open("GET",h.url,!0),t(n,h.url)}n.readyState||n.open("GET",h.url,!0);var r=this.context.headers;if(r)for(var s in r)n.setRequestHeader(s,r[s])}catch(u){this.callbacks.onError({code:n.status,text:u.message},h,n);return}h.rangeEnd&&n.setRequestHeader("Range","bytes="+h.rangeStart+"-"+(h.rangeEnd-1)),n.onreadystatechange=this.readystatechange.bind(this),n.onprogress=this.loadprogress.bind(this),n.responseType=h.responseType,self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),o.timeout),n.send()},i.readystatechange=function(){var o=this.context,h=this.loader,n=this.stats;if(!o||!h)return;var a=h.readyState,t=this.config;if(n.aborted)return;if(a>=2)if(self.clearTimeout(this.requestTimeout),n.loading.first===0&&(n.loading.first=Math.max(self.performance.now(),n.loading.start)),a===4){h.onreadystatechange=null,h.onprogress=null;var r=h.status;if(r>=200&&r<300){n.loading.end=Math.max(self.performance.now(),n.loading.first);var s,u;if(o.responseType==="arraybuffer"?(s=h.response,u=s.byteLength):(s=h.responseText,u=s.length),n.loaded=n.total=u,!this.callbacks)return;var d=this.callbacks.onProgress;if(d&&d(n,o,s,h),!this.callbacks)return;var f={url:h.responseURL,data:s};this.callbacks.onSuccess(f,n,o,h)}else n.retry>=t.maxRetry||r>=400&&r<499?(R.logger.error(r+" while loading "+o.url),this.callbacks.onError({code:r,text:h.statusText},o,h)):(R.logger.warn(r+" while loading "+o.url+", retrying in "+this.retryDelay+"..."),this.abortInternal(),this.loader=null,self.clearTimeout(this.retryTimeout),this.retryTimeout=self.setTimeout(this.loadInternal.bind(this),this.retryDelay),this.retryDelay=Math.min(2*this.retryDelay,t.maxRetryDelay),n.retry++)}else self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),t.timeout)},i.loadtimeout=function(){R.logger.warn("timeout while loading "+this.context.url);var o=this.callbacks;o&&(this.abortInternal(),o.onTimeout(this.stats,this.context,this.loader))},i.loadprogress=function(o){var h=this.stats;h.loaded=o.loaded,o.lengthComputable&&(h.total=o.total)},i.getCacheAge=function(){var o=null;if(this.loader&&p.test(this.loader.getAllResponseHeaders())){var h=this.loader.getResponseHeader("age");o=h?parseFloat(h):null}return o},b}();L.default=E}}).default})},vHTk:function(it,ne,q){it.exports={wrp:"wrp___z2l1F",bgBlack:"bgBlack___3ezfX",monaco:"monaco___1ypjT",darkBlue:"darkBlue___2ViJc",close:"close___3q-z4",embed:"embed___3dQqc"}},vewr:function(it,ne,q){"use strict";Object.defineProperty(ne,"__esModule",{value:!0}),ne.getPointerEvent=G,ne.stopEvent=L,ne.setCapture=b,ne.releaseCapture=i;function G(c){return c.changedTouches?c.changedTouches[0]:c.touches?c.touches[0]:c}function L(c){c.stopPropagation(),c.preventDefault()}var I=!1,R=null;document.captureElement=null;function M(c){if(I)return;var o=new c.constructor(c.type,c);I=!0,document.captureElement?document.captureElement.dispatchEvent(o):R.dispatchEvent(o),I=!1,c.stopPropagation(),o.defaultPrevented&&c.preventDefault(),c.type==="mouseup"&&i()}function p(){var c=document.getElementById("noVNC_mouse_capture_elem");c.style.cursor=window.getComputedStyle(document.captureElement).cursor}var E=new MutationObserver(p);function b(c){if(c.setCapture)c.setCapture(),document.captureElement=c,c.addEventListener("mouseup",i);else{i();var o=document.getElementById("noVNC_mouse_capture_elem");o===null&&(o=document.createElement("div"),o.id="noVNC_mouse_capture_elem",o.style.position="fixed",o.style.top="0px",o.style.left="0px",o.style.width="100%",o.style.height="100%",o.style.zIndex=1e4,o.style.display="none",document.body.appendChild(o),o.addEventListener("contextmenu",M),o.addEventListener("mousemove",M),o.addEventListener("mouseup",M)),document.captureElement=c,E.observe(c,{attributes:!0}),p(),o.style.display="",window.addEventListener("mousemove",M),window.addEventListener("mouseup",M)}}function i(){if(document.releaseCapture)document.releaseCapture(),document.captureElement=null;else{if(!document.captureElement)return;R=document.captureElement,document.captureElement=null,E.disconnect();var c=document.getElementById("noVNC_mouse_capture_elem");c.style.display="none",window.removeEventListener("mousemove",M),window.removeEventListener("mouseup",M)}}},whVF:function(it,ne,q){"use strict";Object.defineProperty(ne,"__esModule",{value:!0}),ne.default=void 0;var G=q("lNSK"),L=I(q("1q3G"));function I(b){return b&&b.__esModule?b:{default:b}}function R(b,i){if(!(b instanceof i))throw new TypeError("Cannot call a class as a function")}function M(b,i){for(var c=0;c<i.length;c++){var o=i[c];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(b,o.key,o)}}function p(b,i,c){return i&&M(b.prototype,i),c&&M(b,c),b}var E=function(){function b(){R(this,b),this.strm=new L.default,this.chunkSize=1024*10*10,this.outputBuffer=new Uint8Array(this.chunkSize),this.windowBits=5,(0,G.deflateInit)(this.strm,this.windowBits)}return p(b,[{key:"deflate",value:function(c){this.strm.input=c,this.strm.avail_in=this.strm.input.length,this.strm.next_in=0,this.strm.output=this.outputBuffer,this.strm.avail_out=this.chunkSize,this.strm.next_out=0;var o=(0,G.deflate)(this.strm,G.Z_FULL_FLUSH),h=new Uint8Array(this.strm.output.buffer,0,this.strm.next_out);if(o<0)throw new Error("zlib deflate failed");if(this.strm.avail_in>0){var n=[h],a=h.length;do{if(this.strm.output=new Uint8Array(this.chunkSize),this.strm.next_out=0,this.strm.avail_out=this.chunkSize,o=(0,G.deflate)(this.strm,G.Z_FULL_FLUSH),o<0)throw new Error("zlib deflate failed");var t=new Uint8Array(this.strm.output.buffer,0,this.strm.next_out);a+=t.length,n.push(t)}while(this.strm.avail_in>0);for(var r=new Uint8Array(a),s=0,u=0;u<n.length;u++)r.set(n[u],s),s+=n[u].length;h=r}return this.strm.input=null,this.strm.avail_in=0,this.strm.next_in=0,h}}]),b}();ne.default=E},xO64:function(it,ne,q){"use strict";Object.defineProperty(ne,"__esModule",{value:!0}),ne.default=void 0;var G=L(q("8K/p"));function L(t){return t&&t.__esModule?t:{default:t}}function I(t){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?I=function(s){return typeof s}:I=function(s){return s&&typeof Symbol=="function"&&s.constructor===Symbol&&s!==Symbol.prototype?"symbol":typeof s},I(t)}function R(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function M(t,r){for(var s=0;s<r.length;s++){var u=r[s];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(t,u.key,u)}}function p(t,r,s){return r&&M(t.prototype,r),s&&M(t,s),t}function E(t,r){if(typeof r!="function"&&r!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(r&&r.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),r&&b(t,r)}function b(t,r){return b=Object.setPrototypeOf||function(u,d){return u.__proto__=d,u},b(t,r)}function i(t){var r=h();return function(){var u=n(t),d;if(r){var f=n(this).constructor;d=Reflect.construct(u,arguments,f)}else d=u.apply(this,arguments);return c(this,d)}}function c(t,r){return r&&(I(r)==="object"||typeof r=="function")?r:o(t)}function o(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function h(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(t){return!1}}function n(t){return n=Object.setPrototypeOf?Object.getPrototypeOf:function(s){return s.__proto__||Object.getPrototypeOf(s)},n(t)}var a=function(t){E(s,t);var r=i(s);function s(){return R(this,s),r.apply(this,arguments)}return p(s,[{key:"_pngRect",value:function(d,f,v,m,S,C,_){var y=this._readData(S);return y===null?!1:(C.imageRect(d,f,v,m,"image/png",y),!0)}},{key:"_basicRect",value:function(d,f,v,m,S,C,_,y){throw new Error("BasicCompression received in TightPNG rect")}}]),s}(G.default);ne.default=a},xSIq:function(it,ne,q){"use strict";Object.defineProperty(ne,"__esModule",{value:!0}),ne.default=void 0;var G={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"};ne.default=G},xlC8:function(it,ne,q){"use strict";Object.defineProperty(ne,"__esModule",{value:!0}),ne.default=G;function G(L,I,R,M){for(var p=L&65535|0,E=L>>>16&65535|0,b=0;R!==0;){b=R>2e3?2e3:R,R-=b;do p=p+I[M++]|0,E=E+p|0;while(--b);p%=65521,E%=65521}return p|E<<16|0}}}]);
|