|
|
(window.webpackJsonp=window.webpackJsonp||[]).push([[252,5,6,7,18],{"+NIl":function(Je,le,re){(function(j){j(re("VrN/"))})(function(j){"use strict";j.defineMode("stex",function(k,D){"use strict";function R(l,r){l.cmdState.push(r)}function O(l){return l.cmdState.length>0?l.cmdState[l.cmdState.length-1]:null}function d(l){var r=l.cmdState.pop();r&&r.closeBracket()}function E(l){for(var r=l.cmdState,n=r.length-1;n>=0;n--){var o=r[n];if(o.name=="DEFAULT")continue;return o}return{styleIdentifier:function(){return null}}}function y(l,r,n){return function(){this.name=l,this.bracketNo=0,this.style=r,this.styles=n,this.argument=null,this.styleIdentifier=function(){return this.styles[this.bracketNo-1]||null},this.openBracket=function(){return this.bracketNo++,"bracket"},this.closeBracket=function(){}}}var v={};v.importmodule=y("importmodule","tag",["string","builtin"]),v.documentclass=y("documentclass","tag",["","atom"]),v.usepackage=y("usepackage","tag",["atom"]),v.begin=y("begin","tag",["atom"]),v.end=y("end","tag",["atom"]),v.label=y("label","tag",["atom"]),v.ref=y("ref","tag",["atom"]),v.eqref=y("eqref","tag",["atom"]),v.cite=y("cite","tag",["atom"]),v.bibitem=y("bibitem","tag",["atom"]),v.Bibitem=y("Bibitem","tag",["atom"]),v.RBibitem=y("RBibitem","tag",["atom"]),v.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}};function u(l,r){l.f=r}function a(l,r){var n;if(l.match(/^\\[a-zA-Z@]+/)){var o=l.current().slice(1);return n=v.hasOwnProperty(o)?v[o]:v.DEFAULT,n=new n,R(r,n),u(r,s),n.style}if(l.match(/^\\[$&%#{}_]/))return"tag";if(l.match(/^\\[,;!\/\\]/))return"tag";if(l.match("\\["))return u(r,function(f,h){return c(f,h,"\\]")}),"keyword";if(l.match("\\("))return u(r,function(f,h){return c(f,h,"\\)")}),"keyword";if(l.match("$$"))return u(r,function(f,h){return c(f,h,"$$")}),"keyword";if(l.match("$"))return u(r,function(f,h){return c(f,h,"$")}),"keyword";var i=l.next();if(i=="%")return l.skipToEnd(),"comment";if(i=="}"||i=="]"){if(n=O(r),n)n.closeBracket(i),u(r,s);else return"error";return"bracket"}else return i=="{"||i=="["?(n=v.DEFAULT,n=new n,R(r,n),"bracket"):/\d/.test(i)?(l.eatWhile(/[\w.%]/),"atom"):(l.eatWhile(/[\w\-_]/),n=E(r),n.name=="begin"&&(n.argument=l.current()),n.styleIdentifier())}function c(l,r,n){if(l.eatSpace())return null;if(n&&l.match(n))return u(r,a),"keyword";if(l.match(/^\\[a-zA-Z@]+/))return"tag";if(l.match(/^[a-zA-Z]+/))return"variable-2";if(l.match(/^\\[$&%#{}_]/))return"tag";if(l.match(/^\\[,;!\/]/))return"tag";if(l.match(/^[\^_&]/))return"tag";if(l.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(l.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var o=l.next();return o=="{"||o=="}"||o=="["||o=="]"||o=="("||o==")"?"bracket":o=="%"?(l.skipToEnd(),"comment"):"error"}function s(l,r){var n=l.peek(),o;return n=="{"||n=="["?(o=O(r),o.openBracket(n),l.eat(n),u(r,a),"bracket"):/[ \t\r]/.test(n)?(l.eat(n),null):(u(r,a),d(r),a(l,r))}return{startState:function(){var l=D.inMathMode?function(r,n){return c(r,n)}:a;return{cmdState:[],f:l}},copyState:function(l){return{cmdState:l.cmdState.slice(),f:l.f}},token:function(l,r){return r.f(l,r)},blankLine:function(l){l.f=a,l.cmdState.length=0},lineComment:"%"}}),j.defineMIME("text/x-stex","stex"),j.defineMIME("text/x-latex","stex")})},"+ua5":function(Je,le,re){},"/POA":function(Je,le,re){!function(j,k){if(!0)Je.exports=k();else var D,R}(window,function(){return function(j){var k={};function D(R){if(k[R])return k[R].exports;var O=k[R]={i:R,l:!1,exports:{}};return j[R].call(O.exports,O,O.exports,D),O.l=!0,O.exports}return D.m=j,D.c=k,D.d=function(R,O,d){D.o(R,O)||Object.defineProperty(R,O,{enumerable:!0,get:d})},D.r=function(R){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(R,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(R,"__esModule",{value:!0})},D.t=function(R,O){if(1&O&&(R=D(R)),8&O)return R;if(4&O&&typeof R=="object"&&R&&R.__esModule)return R;var d=Object.create(null);if(D.r(d),Object.defineProperty(d,"default",{enumerable:!0,value:R}),2&O&&typeof R!="string")for(var E in R)D.d(d,E,function(y){return R[y]}.bind(null,E));return d},D.n=function(R){var O=R&&R.__esModule?function(){return R.default}:function(){return R};return D.d(O,"a",O),O},D.o=function(R,O){return Object.prototype.hasOwnProperty.call(R,O)},D.p="",D(D.s=34)}([function(j,k,D){"use strict";Object.defineProperty(k,"__esModule",{value:!0}),k.forwardEvent=k.EventEmitter=void 0;var R=function(){function O(){this._listeners=[],this._disposed=!1}return Object.defineProperty(O.prototype,"event",{get:function(){var d=this;return this._event||(this._event=function(E){return d._listeners.push(E),{dispose:function(){if(!d._disposed){for(var y=0;y<d._listeners.length;y++)if(d._listeners[y]===E)return void d._listeners.splice(y,1)}}}}),this._event},enumerable:!1,configurable:!0}),O.prototype.fire=function(d,E){for(var y=[],v=0;v<this._listeners.length;v++)y.push(this._listeners[v]);for(v=0;v<y.length;v++)y[v].call(void 0,d,E)},O.prototype.dispose=function(){this._listeners&&(this._listeners.length=0),this._disposed=!0},O}();k.EventEmitter=R,k.forwardEvent=function(O,d){return O(function(E){return d.fire(E)})}},function(j,k,D){"use strict";Object.defineProperty(k,"__esModule",{value:!0}),k.IUnicodeService=k.IOptionsService=k.ILogService=k.IInstantiationService=k.IDirtyRowService=k.ICharsetService=k.ICoreService=k.ICoreMouseService=k.IBufferService=void 0;var R=D(14);k.IBufferService=R.createDecorator("BufferService"),k.ICoreMouseService=R.createDecorator("CoreMouseService"),k.ICoreService=R.createDecorator("CoreService"),k.ICharsetService=R.createDecorator("CharsetService"),k.IDirtyRowService=R.createDecorator("DirtyRowService"),k.IInstantiationService=R.createDecorator("InstantiationService"),k.ILogService=R.createDecorator("LogService"),k.IOptionsService=R.createDecorator("OptionsService"),k.IUnicodeService=R.createDecorator("UnicodeService")},function(j,k,D){"use strict";Object.defineProperty(k,"__esModule",{value:!0}),k.getDisposeArrayDisposable=k.disposeArray=k.Disposable=void 0;var R=function(){function d(){this._disposables=[],this._isDisposed=!1}return d.prototype.dispose=function(){this._isDisposed=!0;for(var E=0,y=this._disposables;E<y.length;E++)y[E].dispose();this._disposables.length=0},d.prototype.register=function(E){return this._disposables.push(E),E},d.prototype.unregister=function(E){var y=this._disposables.indexOf(E);y!==-1&&this._disposables.splice(y,1)},d}();function O(d){for(var E=0,y=d;E<y.length;E++)y[E].dispose();d.length=0}k.Disposable=R,k.disposeArray=O,k.getDisposeArrayDisposable=function(d){return{dispose:function(){return O(d)}}}},function(j,k,D){"use strict";Object.defineProperty(k,"__esModule",{value:!0}),k.WHITESPACE_CELL_CODE=k.WHITESPACE_CELL_WIDTH=k.WHITESPACE_CELL_CHAR=k.NULL_CELL_CODE=k.NULL_CELL_WIDTH=k.NULL_CELL_CHAR=k.CHAR_DATA_CODE_INDEX=k.CHAR_DATA_WIDTH_INDEX=k.CHAR_DATA_CHAR_INDEX=k.CHAR_DATA_ATTR_INDEX=k.DEFAULT_ATTR=k.DEFAULT_COLOR=void 0,k.DEFAULT_COLOR=256,k.DEFAULT_ATTR=256|k.DEFAULT_COLOR<<9,k.CHAR_DATA_ATTR_INDEX=0,k.CHAR_DATA_CHAR_INDEX=1,k.CHAR_DATA_WIDTH_INDEX=2,k.CHAR_DATA_CODE_INDEX=3,k.NULL_CELL_CHAR="",k.NULL_CELL_WIDTH=1,k.NULL_CELL_CODE=0,k.WHITESPACE_CELL_CHAR=" ",k.WHITESPACE_CELL_WIDTH=1,k.WHITESPACE_CELL_CODE=32},function(j,k,D){"use strict";var R,O=this&&this.__extends||(R=function(u,a){return(R=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(c,s){c.__proto__=s}||function(c,s){for(var l in s)s.hasOwnProperty(l)&&(c[l]=s[l])})(u,a)},function(u,a){function c(){this.constructor=u}R(u,a),u.prototype=a===null?Object.create(a):(c.prototype=a.prototype,new c)});Object.defineProperty(k,"__esModule",{value:!0}),k.CellData=void 0;var d=D(8),E=D(3),y=D(6),v=function(u){function a(){var c=u!==null&&u.apply(this,arguments)||this;return c.content=0,c.fg=0,c.bg=0,c.extended=new y.ExtendedAttrs,c.combinedData="",c}return O(a,u),a.fromCharData=function(c){var s=new a;return s.setFromCharData(c),s},a.prototype.isCombined=function(){return 2097152&this.content},a.prototype.getWidth=function(){return this.content>>22},a.prototype.getChars=function(){return 2097152&this.content?this.combinedData:2097151&this.content?d.stringFromCodePoint(2097151&this.content):""},a.prototype.getCode=function(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content},a.prototype.setFromCharData=function(c){this.fg=c[E.CHAR_DATA_ATTR_INDEX],this.bg=0;var s=!1;if(c[E.CHAR_DATA_CHAR_INDEX].length>2)s=!0;else if(c[E.CHAR_DATA_CHAR_INDEX].length===2){var l=c[E.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=l&&l<=56319){var r=c[E.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=r&&r<=57343?this.content=1024*(l-55296)+r-56320+65536|c[E.CHAR_DATA_WIDTH_INDEX]<<22:s=!0}else s=!0}else this.content=c[E.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|c[E.CHAR_DATA_WIDTH_INDEX]<<22;s&&(this.combinedData=c[E.CHAR_DATA_CHAR_INDEX],this.content=2097152|c[E.CHAR_DATA_WIDTH_INDEX]<<22)},a.prototype.getAsCharData=function(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]},a}(y.AttributeData);k.CellData=v},function(j,k,D){"use strict";Object.defineProperty(k,"__esModule",{value:!0}),k.ISoundService=k.ISelectionService=k.IRenderService=k.IMouseService=k.ICoreBrowserService=k.ICharSizeService=void 0;var R=D(14);k.ICharSizeService=R.createDecorator("CharSizeService"),k.ICoreBrowserService=R.createDecorator("CoreBrowserService"),k.IMouseService=R.createDecorator("MouseService"),k.IRenderService=R.createDecorator("RenderService"),k.ISelectionService=R.createDecorator("SelectionService"),k.ISoundService=R.createDecorator("SoundService")},function(j,k,D){"use strict";Object.defineProperty(k,"__esModule",{value:!0}),k.ExtendedAttrs=k.AttributeData=void 0;var R=function(){function d(){this.fg=0,this.bg=0,this.extended=new O}return d.toColorRGB=function(E){return[E>>>16&255,E>>>8&255,255&E]},d.fromColorRGB=function(E){return(255&E[0])<<16|(255&E[1])<<8|255&E[2]},d.prototype.clone=function(){var E=new d;return E.fg=this.fg,E.bg=this.bg,E.extended=this.extended.clone(),E},d.prototype.isInverse=function(){return 67108864&this.fg},d.prototype.isBold=function(){return 134217728&this.fg},d.prototype.isUnderline=function(){return 268435456&this.fg},d.prototype.isBlink=function(){return 536870912&this.fg},d.prototype.isInvisible=function(){return 1073741824&this.fg},d.prototype.isItalic=function(){return 67108864&this.bg},d.prototype.isDim=function(){return 134217728&this.bg},d.prototype.getFgColorMode=function(){return 50331648&this.fg},d.prototype.getBgColorMode=function(){return 50331648&this.bg},d.prototype.isFgRGB=function(){return(50331648&this.fg)==50331648},d.prototype.isBgRGB=function(){return(50331648&this.bg)==50331648},d.prototype.isFgPalette=function(){return(50331648&this.fg)==16777216||(50331648&this.fg)==33554432},d.prototype.isBgPalette=function(){return(50331648&this.bg)==16777216||(50331648&this.bg)==33554432},d.prototype.isFgDefault=function(){return(50331648&this.fg)==0},d.prototype.isBgDefault=function(){return(50331648&this.bg)==0},d.prototype.isAttributeDefault=function(){return this.fg===0&&this.bg===0},d.prototype.getFgColor=function(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}},d.prototype.getBgColor=function(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}},d.prototype.hasExtendedAttrs=function(){return 268435456&this.bg},d.prototype.updateExtended=function(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456},d.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()},d.prototype.getUnderlineColorMode=function(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()},d.prototype.isUnderlineColorRGB=function(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==50331648:this.isFgRGB()},d.prototype.isUnderlineColorPalette=function(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==16777216||(50331648&this.extended.underlineColor)==33554432:this.isFgPalette()},d.prototype.isUnderlineColorDefault=function(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==0:this.isFgDefault()},d.prototype.getUnderlineStyle=function(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0},d}();k.AttributeData=R;var O=function(){function d(E,y){E===void 0&&(E=0),y===void 0&&(y=-1),this.underlineStyle=E,this.underlineColor=y}return d.prototype.clone=function(){return new d(this.underlineStyle,this.underlineColor)},d.prototype.isEmpty=function(){return this.underlineStyle===0},d}();k.ExtendedAttrs=O},function(j,k,D){"use strict";Object.defineProperty(k,"__esModule",{value:!0}),k.addDisposableDomListener=void 0,k.addDisposableDomListener=function(R,O,d,E){R.addEventListener(O,d,E);var y=!1;return{dispose:function(){y||(y=!0,R.removeEventListener(O,d,E))}}}},function(j,k,D){"use strict";Object.defineProperty(k,"__esModule",{value:!0}),k.Utf8ToUtf32=k.StringToUtf32=k.utf32ToString=k.stringFromCodePoint=void 0,k.stringFromCodePoint=function(d){return d>65535?(d-=65536,String.fromCharCode(55296+(d>>10))+String.fromCharCode(d%1024+56320)):String.fromCharCode(d)},k.utf32ToString=function(d,E,y){E===void 0&&(E=0),y===void 0&&(y=d.length);for(var v="",u=E;u<y;++u){var a=d[u];a>65535?(a-=65536,v+=String.fromCharCode(55296+(a>>10))+String.fromCharCode(a%1024+56320)):v+=String.fromCharCode(a)}return v};var R=function(){function d(){this._interim=0}return d.prototype.clear=function(){this._interim=0},d.prototype.decode=function(E,y){var v=E.length;if(!v)return 0;var u=0,a=0;this._interim&&(56320<=(l=E.charCodeAt(a++))&&l<=57343?y[u++]=1024*(this._interim-55296)+l-56320+65536:(y[u++]=this._interim,y[u++]=l),this._interim=0);for(var c=a;c<v;++c){var s=E.charCodeAt(c);if(55296<=s&&s<=56319){if(++c>=v)return this._interim=s,u;var l;56320<=(l=E.charCodeAt(c))&&l<=57343?y[u++]=1024*(s-55296)+l-56320+65536:(y[u++]=s,y[u++]=l)}else y[u++]=s}return u},d}();k.StringToUtf32=R;var O=function(){function d(){this.interim=new Uint8Array(3)}return d.prototype.clear=function(){this.interim.fill(0)},d.prototype.decode=function(E,y){var v=E.length;if(!v)return 0;var u,a,c,s,l=0,r=0,n=0;if(this.interim[0]){var o=!1,i=this.interim[0];i&=(224&i)==192?31:(240&i)==224?15:7;for(var f=0,h=void 0;(h=63&this.interim[++f])&&f<4;)i<<=6,i|=h;for(var T=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,g=T-f;n<g;){if(n>=v)return 0;if((192&(h=E[n++]))!=128){n--,o=!0;break}this.interim[f++]=h,i<<=6,i|=63&h}o||(T===2?i<128?n--:y[l++]=i:T===3?i<2048||i>=55296&&i<=57343||(y[l++]=i):i<65536||i>1114111||(y[l++]=i)),this.interim.fill(0)}for(var w=v-4,C=n;C<v;){for(;!(!(C<w)||128&(u=E[C])||128&(a=E[C+1])||128&(c=E[C+2])||128&(s=E[C+3]));)y[l++]=u,y[l++]=a,y[l++]=c,y[l++]=s,C+=4;if((u=E[C++])<128)y[l++]=u;else if((224&u)==192){if(C>=v)return this.interim[0]=u,l;if((192&(a=E[C++]))!=128){C--;continue}if((r=(31&u)<<6|63&a)<128){C--;continue}y[l++]=r}else if((240&u)==224){if(C>=v)return this.interim[0]=u,l;if((192&(a=E[C++]))!=128){C--;continue}if(C>=v)return this.interim[0]=u,this.interim[1]=a,l;if((192&(c=E[C++]))!=128){C--;continue}if((r=(15&u)<<12|(63&a)<<6|63&c)<2048||r>=55296&&r<=57343)continue;y[l++]=r}else if((248&u)==240){if(C>=v)return this.interim[0]=u,l;if((192&(a=E[C++]))!=128){C--;continue}if(C>=v)return this.interim[0]=u,this.interim[1]=a,l;if((192&(c=E[C++]))!=128){C--;continue}if(C>=v)return this.interim[0]=u,this.interim[1]=a,this.interim[2]=c,l;if((192&(s=E[C++]))!=128){C--;continue}if((r=(7&u)<<18|(63&a)<<12|(63&c)<<6|63&s)<65536||r>1114111)continue;y[l++]=r}}return l},d}();k.Utf8ToUtf32=O},function(j,k,D){"use strict";Object.defineProperty(k,"__esModule",{value:!0}),k.CHAR_ATLAS_CELL_SPACING=k.DIM_OPACITY=k.INVERTED_DEFAULT_COLOR=void 0,k.INVERTED_DEFAULT_COLOR=257,k.DIM_OPACITY=.5,k.CHAR_ATLAS_CELL_SPACING=1},function(j,k,D){"use strict";var R,O,d,E;function y(u){var a=u.toString(16);return a.length<2?"0"+a:a}function v(u,a){return u<a?(a+.05)/(u+.05):(u+.05)/(a+.05)}Object.defineProperty(k,"__esModule",{value:!0}),k.contrastRatio=k.toPaddedHex=k.rgba=k.rgb=k.css=k.color=k.channels=void 0,function(u){u.toCss=function(a,c,s,l){return l!==void 0?"#"+y(a)+y(c)+y(s)+y(l):"#"+y(a)+y(c)+y(s)},u.toRgba=function(a,c,s,l){return l===void 0&&(l=255),(a<<24|c<<16|s<<8|l)>>>0}}(R=k.channels||(k.channels={})),(O=k.color||(k.color={})).blend=function(u,a){var c=(255&a.rgba)/255;if(c===1)return{css:a.css,rgba:a.rgba};var s=a.rgba>>24&255,l=a.rgba>>16&255,r=a.rgba>>8&255,n=u.rgba>>24&255,o=u.rgba>>16&255,i=u.rgba>>8&255,f=n+Math.round((s-n)*c),h=o+Math.round((l-o)*c),T=i+Math.round((r-i)*c);return{css:R.toCss(f,h,T),rgba:R.toRgba(f,h,T)}},O.isOpaque=function(u){return(255&u.rgba)==255},O.ensureContrastRatio=function(u,a,c){var s=E.ensureContrastRatio(u.rgba,a.rgba,c);if(s)return E.toColor(s>>24&255,s>>16&255,s>>8&255)},O.opaque=function(u){var a=(255|u.rgba)>>>0,c=E.toChannels(a),s=c[0],l=c[1],r=c[2];return{css:R.toCss(s,l,r),rgba:a}},O.opacity=function(u,a){var c=Math.round(255*a),s=E.toChannels(u.rgba),l=s[0],r=s[1],n=s[2];return{css:R.toCss(l,r,n,c),rgba:R.toRgba(l,r,n,c)}},(k.css||(k.css={})).toColor=function(u){switch(u.length){case 7:return{css:u,rgba:(parseInt(u.slice(1),16)<<8|255)>>>0};case 9:return{css:u,rgba:parseInt(u.slice(1),16)>>>0}}throw new Error("css.toColor: Unsupported css format")},function(u){function a(c,s,l){var r=c/255,n=s/255,o=l/255;return .2126*(r<=.03928?r/12.92:Math.pow((r+.055)/1.055,2.4))+.7152*(n<=.03928?n/12.92:Math.pow((n+.055)/1.055,2.4))+.0722*(o<=.03928?o/12.92:Math.pow((o+.055)/1.055,2.4))}u.relativeLuminance=function(c){return a(c>>16&255,c>>8&255,255&c)},u.relativeLuminance2=a}(d=k.rgb||(k.rgb={})),function(u){function a(s,l,r){for(var n=s>>24&255,o=s>>16&255,i=s>>8&255,f=l>>24&255,h=l>>16&255,T=l>>8&255,g=v(d.relativeLuminance2(f,T,h),d.relativeLuminance2(n,o,i));g<r&&(f>0||h>0||T>0);)f-=Math.max(0,Math.ceil(.1*f)),h-=Math.max(0,Math.ceil(.1*h)),T-=Math.max(0,Math.ceil(.1*T)),g=v(d.relativeLuminance2(f,T,h),d.relativeLuminance2(n,o,i));return(f<<24|h<<16|T<<8|255)>>>0}function c(s,l,r){for(var n=s>>24&255,o=s>>16&255,i=s>>8&255,f=l>>24&255,h=l>>16&255,T=l>>8&255,g=v(d.relativeLuminance2(f,T,h),d.relativeLuminance2(n,o,i));g<r&&(f<255||h<255||T<255);)f=Math.min(255,f+Math.ceil(.1*(255-f))),h=Math.min(255,h+Math.ceil(.1*(255-h))),T=Math.min(255,T+Math.ceil(.1*(255-T))),g=v(d.relativeLuminance2(f,T,h),d.relativeLuminance2(n,o,i));return(f<<24|h<<16|T<<8|255)>>>0}u.ensureContrastRatio=function(s,l,r){var n=d.relativeLuminance(s>>8),o=d.relativeLuminance(l>>8);if(v(n,o)<r)return o<n?a(s,l,r):c(s,l,r)},u.reduceLuminance=a,u.increaseLuminance=c,u.toChannels=function(s){return[s>>24&255,s>>16&255,s>>8&255,255&s]},u.toColor=function(s,l,r){return{css:R.toCss(s,l,r),rgba:R.toRgba(s,l,r)}}}(E=k.rgba||(k.rgba={})),k.toPaddedHex=y,k.contrastRatio=v},function(j,k,D){"use strict";Object.defineProperty(k,"__esModule",{value:!0}),k.isLinux=k.isWindows=k.isIphone=k.isIpad=k.isMac=k.isSafari=k.isFirefox=void 0;var R=typeof navigator=="undefined",O=R?"node":navigator.userAgent,d=R?"node":navigator.platform;function E(y,v){return y.indexOf(v)>=0}k.isFirefox=!!~O.indexOf("Firefox"),k.isSafari=/^((?!chrome|android).)*safari/i.test(O),k.isMac=E(["Macintosh","MacIntel","MacPPC","Mac68K"],d),k.isIpad=d==="iPad",k.isIphone=d==="iPhone",k.isWindows=E(["Windows","Win16","Win32","WinCE"],d),k.isLinux=d.indexOf("Linux")>=0},function(j,k,D){"use strict";Object.defineProperty(k,"__esModule",{value:!0}),k.C1=k.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"}(k.C0||(k.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"}(k.C1||(k.C1={}))},function(j,k,D){"use strict";Object.defineProperty(k,"__esModule",{value:!0}),k.BaseRenderLayer=void 0;var R=D(3),O=D(9),d=D(25),E=D(6),y=D(28),v=D(10),u=D(17),a=function(){function c(s,l,r,n,o,i,f,h){this._container=s,this._alpha=n,this._colors=o,this._rendererId=i,this._bufferService=f,this._optionsService=h,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-"+l+"-layer"),this._canvas.style.zIndex=r.toString(),this._initCanvas(),this._container.appendChild(this._canvas)}return c.prototype.dispose=function(){var s;u.removeElementFromParent(this._canvas),(s=this._charAtlas)===null||s===void 0||s.dispose()},c.prototype._initCanvas=function(){this._ctx=y.throwIfFalsy(this._canvas.getContext("2d",{alpha:this._alpha})),this._alpha||this._clearAll()},c.prototype.onOptionsChanged=function(){},c.prototype.onBlur=function(){},c.prototype.onFocus=function(){},c.prototype.onCursorMove=function(){},c.prototype.onGridChanged=function(s,l){},c.prototype.onSelectionChanged=function(s,l,r){r===void 0&&(r=!1)},c.prototype.setColors=function(s){this._refreshCharAtlas(s)},c.prototype._setTransparency=function(s){if(s!==this._alpha){var l=this._canvas;this._alpha=s,this._canvas=this._canvas.cloneNode(),this._initCanvas(),this._container.replaceChild(this._canvas,l),this._refreshCharAtlas(this._colors),this.onGridChanged(0,this._bufferService.rows-1)}},c.prototype._refreshCharAtlas=function(s){this._scaledCharWidth<=0&&this._scaledCharHeight<=0||(this._charAtlas=d.acquireCharAtlas(this._optionsService.options,this._rendererId,s,this._scaledCharWidth,this._scaledCharHeight),this._charAtlas.warmUp())},c.prototype.resize=function(s){this._scaledCellWidth=s.scaledCellWidth,this._scaledCellHeight=s.scaledCellHeight,this._scaledCharWidth=s.scaledCharWidth,this._scaledCharHeight=s.scaledCharHeight,this._scaledCharLeft=s.scaledCharLeft,this._scaledCharTop=s.scaledCharTop,this._canvas.width=s.scaledCanvasWidth,this._canvas.height=s.scaledCanvasHeight,this._canvas.style.width=s.canvasWidth+"px",this._canvas.style.height=s.canvasHeight+"px",this._alpha||this._clearAll(),this._refreshCharAtlas(this._colors)},c.prototype._fillCells=function(s,l,r,n){this._ctx.fillRect(s*this._scaledCellWidth,l*this._scaledCellHeight,r*this._scaledCellWidth,n*this._scaledCellHeight)},c.prototype._fillBottomLineAtCells=function(s,l,r){r===void 0&&(r=1),this._ctx.fillRect(s*this._scaledCellWidth,(l+1)*this._scaledCellHeight-window.devicePixelRatio-1,r*this._scaledCellWidth,window.devicePixelRatio)},c.prototype._fillLeftLineAtCell=function(s,l,r){this._ctx.fillRect(s*this._scaledCellWidth,l*this._scaledCellHeight,window.devicePixelRatio*r,this._scaledCellHeight)},c.prototype._strokeRectAtCell=function(s,l,r,n){this._ctx.lineWidth=window.devicePixelRatio,this._ctx.strokeRect(s*this._scaledCellWidth+window.devicePixelRatio/2,l*this._scaledCellHeight+window.devicePixelRatio/2,r*this._scaledCellWidth-window.devicePixelRatio,n*this._scaledCellHeight-window.devicePixelRatio)},c.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))},c.prototype._clearCells=function(s,l,r,n){this._alpha?this._ctx.clearRect(s*this._scaledCellWidth,l*this._scaledCellHeight,r*this._scaledCellWidth,n*this._scaledCellHeight):(this._ctx.fillStyle=this._colors.background.css,this._ctx.fillRect(s*this._scaledCellWidth,l*this._scaledCellHeight,r*this._scaledCellWidth,n*this._scaledCellHeight))},c.prototype._fillCharTrueColor=function(s,l,r){this._ctx.font=this._getFont(!1,!1),this._ctx.textBaseline="middle",this._clipRow(r),this._ctx.fillText(s.getChars(),l*this._scaledCellWidth+this._scaledCharLeft,r*this._scaledCellHeight+this._scaledCharTop+this._scaledCharHeight/2)},c.prototype._drawChars=function(s,l,r){var n,o,i=this._getContrastColor(s);i||s.isFgRGB()||s.isBgRGB()?this._drawUncachedChars(s,l,r,i):(s.isInverse()?(n=s.isBgDefault()?O.INVERTED_DEFAULT_COLOR:s.getBgColor(),o=s.isFgDefault()?O.INVERTED_DEFAULT_COLOR:s.getFgColor()):(o=s.isBgDefault()?R.DEFAULT_COLOR:s.getBgColor(),n=s.isFgDefault()?R.DEFAULT_COLOR:s.getFgColor()),n+=this._optionsService.options.drawBoldTextInBrightColors&&s.isBold()&&n<8?8:0,this._currentGlyphIdentifier.chars=s.getChars()||R.WHITESPACE_CELL_CHAR,this._currentGlyphIdentifier.code=s.getCode()||R.WHITESPACE_CELL_CODE,this._currentGlyphIdentifier.bg=o,this._currentGlyphIdentifier.fg=n,this._currentGlyphIdentifier.bold=!!s.isBold(),this._currentGlyphIdentifier.dim=!!s.isDim(),this._currentGlyphIdentifier.italic=!!s.isItalic(),this._charAtlas&&this._charAtlas.draw(this._ctx,this._currentGlyphIdentifier,l*this._scaledCellWidth+this._scaledCharLeft,r*this._scaledCellHeight+this._scaledCharTop)||this._drawUncachedChars(s,l,r))},c.prototype._drawUncachedChars=function(s,l,r,n){if(this._ctx.save(),this._ctx.font=this._getFont(!!s.isBold(),!!s.isItalic()),this._ctx.textBaseline="middle",s.isInverse())if(n)this._ctx.fillStyle=n.css;else if(s.isBgDefault())this._ctx.fillStyle=v.color.opaque(this._colors.background).css;else if(s.isBgRGB())this._ctx.fillStyle="rgb("+E.AttributeData.toColorRGB(s.getBgColor()).join(",")+")";else{var o=s.getBgColor();this._optionsService.options.drawBoldTextInBrightColors&&s.isBold()&&o<8&&(o+=8),this._ctx.fillStyle=this._colors.ansi[o].css}else if(n)this._ctx.fillStyle=n.css;else if(s.isFgDefault())this._ctx.fillStyle=this._colors.foreground.css;else if(s.isFgRGB())this._ctx.fillStyle="rgb("+E.AttributeData.toColorRGB(s.getFgColor()).join(",")+")";else{var i=s.getFgColor();this._optionsService.options.drawBoldTextInBrightColors&&s.isBold()&&i<8&&(i+=8),this._ctx.fillStyle=this._colors.ansi[i].css}this._clipRow(r),s.isDim()&&(this._ctx.globalAlpha=O.DIM_OPACITY),this._ctx.fillText(s.getChars(),l*this._scaledCellWidth+this._scaledCharLeft,r*this._scaledCellHeight+this._scaledCharTop+this._scaledCharHeight/2),this._ctx.restore()},c.prototype._clipRow=function(s){this._ctx.beginPath(),this._ctx.rect(0,s*this._scaledCellHeight,this._bufferService.cols*this._scaledCellWidth,this._scaledCellHeight),this._ctx.clip()},c.prototype._getFont=function(s,l){return(l?"italic":"")+" "+(s?this._optionsService.options.fontWeightBold:this._optionsService.options.fontWeight)+" "+this._optionsService.options.fontSize*window.devicePixelRatio+"px "+this._optionsService.options.fontFamily},c.prototype._getContrastColor=function(s){if(this._optionsService.options.minimumContrastRatio!==1){var l=this._colors.contrastCache.getColor(s.bg,s.fg);if(l!==void 0)return l||void 0;var r=s.getFgColor(),n=s.getFgColorMode(),o=s.getBgColor(),i=s.getBgColorMode(),f=!!s.isInverse(),h=!!s.isInverse();if(f){var T=r;r=o,o=T;var g=n;n=i,i=g}var w=this._resolveBackgroundRgba(i,o,f),C=this._resolveForegroundRgba(n,r,f,h),x=v.rgba.ensureContrastRatio(w,C,this._optionsService.options.minimumContrastRatio);if(x){var b={css:v.channels.toCss(x>>24&255,x>>16&255,x>>8&255),rgba:x};return this._colors.contrastCache.setColor(s.bg,s.fg,b),b}this._colors.contrastCache.setColor(s.bg,s.fg,null)}},c.prototype._resolveBackgroundRgba=function(s,l,r){switch(s){case 16777216:case 33554432:return this._colors.ansi[l].rgba;case 50331648:return l<<8;case 0:default:return r?this._colors.foreground.rgba:this._colors.background.rgba}},c.prototype._resolveForegroundRgba=function(s,l,r,n){switch(s){case 16777216:case 33554432:return this._optionsService.options.drawBoldTextInBrightColors&&n&&l<8&&(l+=8),this._colors.ansi[l].rgba;case 50331648:return l<<8;case 0:default:return r?this._colors.background.rgba:this._colors.foreground.rgba}},c}();k.BaseRenderLayer=a},function(j,k,D){"use strict";Object.defineProperty(k,"__esModule",{value:!0}),k.createDecorator=k.getServiceDependencies=k.serviceRegistry=void 0;function R(O,d,E){d.di$target===d?d.di$dependencies.push({id:O,index:E}):(d.di$dependencies=[{id:O,index:E}],d.di$target=d)}k.serviceRegistry=new Map,k.getServiceDependencies=function(O){return O.di$dependencies||[]},k.createDecorator=function(O){if(k.serviceRegistry.has(O))return k.serviceRegistry.get(O);var d=function(E,y,v){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");R(d,E,v)};return d.toString=function(){return O},k.serviceRegistry.set(O,d),d}},function(j,k,D){"use strict";function R(O,d,E,y){if(E===void 0&&(E=0),y===void 0&&(y=O.length),E>=O.length)return O;E=(O.length+E)%O.length,y=y>=O.length?O.length:(O.length+y)%O.length;for(var v=E;v<y;++v)O[v]=d;return O}Object.defineProperty(k,"__esModule",{value:!0}),k.concat=k.fillFallback=k.fill=void 0,k.fill=function(O,d,E,y){return O.fill?O.fill(d,E,y):R(O,d,E,y)},k.fillFallback=R,k.concat=function(O,d){var E=new O.constructor(O.length+d.length);return E.set(O),E.set(d,O.length),E}},function(j,k,D){"use strict";Object.defineProperty(k,"__esModule",{value:!0}),k.BufferLine=k.DEFAULT_ATTR_DATA=void 0;var R=D(8),O=D(3),d=D(4),E=D(6);k.DEFAULT_ATTR_DATA=Object.freeze(new E.AttributeData);var y=function(){function v(u,a,c){c===void 0&&(c=!1),this.isWrapped=c,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*u);for(var s=a||d.CellData.fromCharData([0,O.NULL_CELL_CHAR,O.NULL_CELL_WIDTH,O.NULL_CELL_CODE]),l=0;l<u;++l)this.setCell(l,s);this.length=u}return v.prototype.get=function(u){var a=this._data[3*u+0],c=2097151&a;return[this._data[3*u+1],2097152&a?this._combined[u]:c?R.stringFromCodePoint(c):"",a>>22,2097152&a?this._combined[u].charCodeAt(this._combined[u].length-1):c]},v.prototype.set=function(u,a){this._data[3*u+1]=a[O.CHAR_DATA_ATTR_INDEX],a[O.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[u]=a[1],this._data[3*u+0]=2097152|u|a[O.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*u+0]=a[O.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|a[O.CHAR_DATA_WIDTH_INDEX]<<22},v.prototype.getWidth=function(u){return this._data[3*u+0]>>22},v.prototype.hasWidth=function(u){return 12582912&this._data[3*u+0]},v.prototype.getFg=function(u){return this._data[3*u+1]},v.prototype.getBg=function(u){return this._data[3*u+2]},v.prototype.hasContent=function(u){return 4194303&this._data[3*u+0]},v.prototype.getCodePoint=function(u){var a=this._data[3*u+0];return 2097152&a?this._combined[u].charCodeAt(this._combined[u].length-1):2097151&a},v.prototype.isCombined=function(u){return 2097152&this._data[3*u+0]},v.prototype.getString=function(u){var a=this._data[3*u+0];return 2097152&a?this._combined[u]:2097151&a?R.stringFromCodePoint(2097151&a):""},v.prototype.loadCell=function(u,a){var c=3*u;return a.content=this._data[c+0],a.fg=this._data[c+1],a.bg=this._data[c+2],2097152&a.content&&(a.combinedData=this._combined[u]),268435456&a.bg&&(a.extended=this._extendedAttrs[u]),a},v.prototype.setCell=function(u,a){2097152&a.content&&(this._combined[u]=a.combinedData),268435456&a.bg&&(this._extendedAttrs[u]=a.extended),this._data[3*u+0]=a.content,this._data[3*u+1]=a.fg,this._data[3*u+2]=a.bg},v.prototype.setCellFromCodePoint=function(u,a,c,s,l,r){268435456&l&&(this._extendedAttrs[u]=r),this._data[3*u+0]=a|c<<22,this._data[3*u+1]=s,this._data[3*u+2]=l},v.prototype.addCodepointToCell=function(u,a){var c=this._data[3*u+0];2097152&c?this._combined[u]+=R.stringFromCodePoint(a):(2097151&c?(this._combined[u]=R.stringFromCodePoint(2097151&c)+R.stringFromCodePoint(a),c&=-2097152,c|=2097152):c=a|1<<22,this._data[3*u+0]=c)},v.prototype.insertCells=function(u,a,c,s){if((u%=this.length)&&this.getWidth(u-1)===2&&this.setCellFromCodePoint(u-1,0,1,(s==null?void 0:s.fg)||0,(s==null?void 0:s.bg)||0,(s==null?void 0:s.extended)||new E.ExtendedAttrs),a<this.length-u){for(var l=new d.CellData,r=this.length-u-a-1;r>=0;--r)this.setCell(u+a+r,this.loadCell(u+r,l));for(r=0;r<a;++r)this.setCell(u+r,c)}else for(r=u;r<this.length;++r)this.setCell(r,c);this.getWidth(this.length-1)===2&&this.setCellFromCodePoint(this.length-1,0,1,(s==null?void 0:s.fg)||0,(s==null?void 0:s.bg)||0,(s==null?void 0:s.extended)||new E.ExtendedAttrs)},v.prototype.deleteCells=function(u,a,c,s){if(u%=this.length,a<this.length-u){for(var l=new d.CellData,r=0;r<this.length-u-a;++r)this.setCell(u+r,this.loadCell(u+a+r,l));for(r=this.length-a;r<this.length;++r)this.setCell(r,c)}else for(r=u;r<this.length;++r)this.setCell(r,c);u&&this.getWidth(u-1)===2&&this.setCellFromCodePoint(u-1,0,1,(s==null?void 0:s.fg)||0,(s==null?void 0:s.bg)||0,(s==null?void 0:s.extended)||new E.ExtendedAttrs),this.getWidth(u)!==0||this.hasContent(u)||this.setCellFromCodePoint(u,0,1,(s==null?void 0:s.fg)||0,(s==null?void 0:s.bg)||0,(s==null?void 0:s.extended)||new E.ExtendedAttrs)},v.prototype.replaceCells=function(u,a,c,s){for(u&&this.getWidth(u-1)===2&&this.setCellFromCodePoint(u-1,0,1,(s==null?void 0:s.fg)||0,(s==null?void 0:s.bg)||0,(s==null?void 0:s.extended)||new E.ExtendedAttrs),a<this.length&&this.getWidth(a-1)===2&&this.setCellFromCodePoint(a,0,1,(s==null?void 0:s.fg)||0,(s==null?void 0:s.bg)||0,(s==null?void 0:s.extended)||new E.ExtendedAttrs);u<a&&u<this.length;)this.setCell(u++,c)},v.prototype.resize=function(u,a){if(u!==this.length){if(u>this.length){var c=new Uint32Array(3*u);this.length&&(3*u<this._data.length?c.set(this._data.subarray(0,3*u)):c.set(this._data)),this._data=c;for(var s=this.length;s<u;++s)this.setCell(s,a)}else if(u){(c=new Uint32Array(3*u)).set(this._data.subarray(0,3*u)),this._data=c;var l=Object.keys(this._combined);for(s=0;s<l.length;s++){var r=parseInt(l[s],10);r>=u&&delete this._combined[r]}}else this._data=new Uint32Array(0),this._combined={};this.length=u}},v.prototype.fill=function(u){this._combined={},this._extendedAttrs={};for(var a=0;a<this.length;++a)this.setCell(a,u)},v.prototype.copyFrom=function(u){for(var a in this.length!==u.length?this._data=new Uint32Array(u._data):this._data.set(u._data),this.length=u.length,this._combined={},u._combined)this._combined[a]=u._combined[a];for(var a in this._extendedAttrs={},u._extendedAttrs)this._extendedAttrs[a]=u._extendedAttrs[a];this.isWrapped=u.isWrapped},v.prototype.clone=function(){var u=new v(0);for(var a in u._data=new Uint32Array(this._data),u.length=this.length,this._combined)u._combined[a]=this._combined[a];for(var a in this._extendedAttrs)u._extendedAttrs[a]=this._extendedAttrs[a];return u.isWrapped=this.isWrapped,u},v.prototype.getTrimmedLength=function(){for(var u=this.length-1;u>=0;--u)if(4194303&this._data[3*u+0])return u+(this._data[3*u+0]>>22);return 0},v.prototype.copyCellsFrom=function(u,a,c,s,l){var r=u._data;if(l)for(var n=s-1;n>=0;n--)for(var o=0;o<3;o++)this._data[3*(c+n)+o]=r[3*(a+n)+o];else for(n=0;n<s;n++)for(o=0;o<3;o++)this._data[3*(c+n)+o]=r[3*(a+n)+o];var i=Object.keys(u._combined);for(o=0;o<i.length;o++){var f=parseInt(i[o],10);f>=a&&(this._combined[f-a+c]=u._combined[f])}},v.prototype.translateToString=function(u,a,c){u===void 0&&(u=!1),a===void 0&&(a=0),c===void 0&&(c=this.length),u&&(c=Math.min(c,this.getTrimmedLength()));for(var s="";a<c;){var l=this._data[3*a+0],r=2097151&l;s+=2097152&l?this._combined[a]:r?R.stringFromCodePoint(r):O.WHITESPACE_CELL_CHAR,a+=l>>22||1}return s},v}();k.BufferLine=y},function(j,k,D){"use strict";Object.defineProperty(k,"__esModule",{value:!0}),k.removeElementFromParent=void 0,k.removeElementFromParent=function(){for(var R,O=[],d=0;d<arguments.length;d++)O[d]=arguments[d];for(var E=0,y=O;E<y.length;E++){var v=y[E];(R=v==null?void 0:v.parentElement)===null||R===void 0||R.removeChild(v)}}},function(j,k,D){"use strict";Object.defineProperty(k,"__esModule",{value:!0}),k.tooMuchOutput=k.promptLabel=void 0,k.promptLabel="Terminal input",k.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},function(j,k,D){"use strict";var R,O=this&&this.__extends||(R=function(C,x){return(R=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(b,S){b.__proto__=S}||function(b,S){for(var A in S)S.hasOwnProperty(A)&&(b[A]=S[A])})(C,x)},function(C,x){function b(){this.constructor=C}R(C,x),C.prototype=x===null?Object.create(x):(b.prototype=x.prototype,new b)});Object.defineProperty(k,"__esModule",{value:!0}),k.InputHandler=k.WindowsOptionsReportType=void 0;var d,E=D(12),y=D(20),v=D(39),u=D(2),a=D(15),c=D(8),s=D(16),l=D(0),r=D(3),n=D(4),o=D(6),i=D(22),f=D(24),h={"(":0,")":1,"*":2,"+":3,"-":1,".":2};function T(C,x){if(C>24)return x.setWinLines||!1;switch(C){case 1:return!!x.restoreWin;case 2:return!!x.minimizeWin;case 3:return!!x.setWinPosition;case 4:return!!x.setWinSizePixels;case 5:return!!x.raiseWin;case 6:return!!x.lowerWin;case 7:return!!x.refreshWin;case 8:return!!x.setWinSizeChars;case 9:return!!x.maximizeWin;case 10:return!!x.fullscreenWin;case 11:return!!x.getWinState;case 13:return!!x.getWinPosition;case 14:return!!x.getWinSizePixels;case 15:return!!x.getScreenSizePixels;case 16:return!!x.getCellSizePixels;case 18:return!!x.getWinSizeChars;case 19:return!!x.getScreenSizeChars;case 20:return!!x.getIconTitle;case 21:return!!x.getWinTitle;case 22:return!!x.pushTitle;case 23:return!!x.popTitle;case 24:return!!x.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"}(d=k.WindowsOptionsReportType||(k.WindowsOptionsReportType={}));var g=function(){function C(x,b,S,A){this._bufferService=x,this._coreService=b,this._logService=S,this._optionsService=A,this._data=new Uint32Array(0)}return C.prototype.hook=function(x){this._data=new Uint32Array(0)},C.prototype.put=function(x,b,S){this._data=a.concat(this._data,x.subarray(b,S))},C.prototype.unhook=function(x){if(x){var b=c.utf32ToString(this._data);switch(this._data=new Uint32Array(0),b){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 S=this._bufferService.buffer.scrollTop+1+";"+(this._bufferService.buffer.scrollBottom+1)+"r";return this._coreService.triggerDataEvent(E.C0.ESC+"P1$r"+S+E.C0.ESC+"\\");case"m":return this._coreService.triggerDataEvent(E.C0.ESC+"P1$r0m"+E.C0.ESC+"\\");case" q":var A={block:2,underline:4,bar:6}[this._optionsService.options.cursorStyle];return A-=this._optionsService.options.cursorBlink?1:0,this._coreService.triggerDataEvent(E.C0.ESC+"P1$r"+A+" q"+E.C0.ESC+"\\");default:this._logService.debug("Unknown DCS $q %s",b),this._coreService.triggerDataEvent(E.C0.ESC+"P0$r"+E.C0.ESC+"\\")}}else this._data=new Uint32Array(0)},C}(),w=function(C){function x(b,S,A,p,I,M,P,B,H){H===void 0&&(H=new v.EscapeSequenceParser);var F=C.call(this)||this;F._bufferService=b,F._charsetService=S,F._coreService=A,F._dirtyRowService=p,F._logService=I,F._optionsService=M,F._coreMouseService=P,F._unicodeService=B,F._parser=H,F._parseBuffer=new Uint32Array(4096),F._stringDecoder=new c.StringToUtf32,F._utf8Decoder=new c.Utf8ToUtf32,F._workCell=new n.CellData,F._windowTitle="",F._iconName="",F._windowTitleStack=[],F._iconNameStack=[],F._curAttrData=s.DEFAULT_ATTR_DATA.clone(),F._eraseAttrDataInternal=s.DEFAULT_ATTR_DATA.clone(),F._onRequestBell=new l.EventEmitter,F._onRequestRefreshRows=new l.EventEmitter,F._onRequestReset=new l.EventEmitter,F._onRequestScroll=new l.EventEmitter,F._onRequestSyncScrollBar=new l.EventEmitter,F._onRequestWindowsOptionsReport=new l.EventEmitter,F._onA11yChar=new l.EventEmitter,F._onA11yTab=new l.EventEmitter,F._onCursorMove=new l.EventEmitter,F._onLineFeed=new l.EventEmitter,F._onScroll=new l.EventEmitter,F._onTitleChange=new l.EventEmitter,F.register(F._parser),F._parser.setCsiHandlerFallback(function(G,ae){F._logService.debug("Unknown CSI code: ",{identifier:F._parser.identToString(G),params:ae.toArray()})}),F._parser.setEscHandlerFallback(function(G){F._logService.debug("Unknown ESC code: ",{identifier:F._parser.identToString(G)})}),F._parser.setExecuteHandlerFallback(function(G){F._logService.debug("Unknown EXECUTE code: ",{code:G})}),F._parser.setOscHandlerFallback(function(G,ae,fe){F._logService.debug("Unknown OSC code: ",{identifier:G,action:ae,data:fe})}),F._parser.setDcsHandlerFallback(function(G,ae,fe){ae==="HOOK"&&(fe=fe.toArray()),F._logService.debug("Unknown DCS code: ",{identifier:F._parser.identToString(G),action:ae,payload:fe})}),F._parser.setPrintHandler(function(G,ae,fe){return F.print(G,ae,fe)}),F._parser.setCsiHandler({final:"@"},function(G){return F.insertChars(G)}),F._parser.setCsiHandler({intermediates:" ",final:"@"},function(G){return F.scrollLeft(G)}),F._parser.setCsiHandler({final:"A"},function(G){return F.cursorUp(G)}),F._parser.setCsiHandler({intermediates:" ",final:"A"},function(G){return F.scrollRight(G)}),F._parser.setCsiHandler({final:"B"},function(G){return F.cursorDown(G)}),F._parser.setCsiHandler({final:"C"},function(G){return F.cursorForward(G)}),F._parser.setCsiHandler({final:"D"},function(G){return F.cursorBackward(G)}),F._parser.setCsiHandler({final:"E"},function(G){return F.cursorNextLine(G)}),F._parser.setCsiHandler({final:"F"},function(G){return F.cursorPrecedingLine(G)}),F._parser.setCsiHandler({final:"G"},function(G){return F.cursorCharAbsolute(G)}),F._parser.setCsiHandler({final:"H"},function(G){return F.cursorPosition(G)}),F._parser.setCsiHandler({final:"I"},function(G){return F.cursorForwardTab(G)}),F._parser.setCsiHandler({final:"J"},function(G){return F.eraseInDisplay(G)}),F._parser.setCsiHandler({prefix:"?",final:"J"},function(G){return F.eraseInDisplay(G)}),F._parser.setCsiHandler({final:"K"},function(G){return F.eraseInLine(G)}),F._parser.setCsiHandler({prefix:"?",final:"K"},function(G){return F.eraseInLine(G)}),F._parser.setCsiHandler({final:"L"},function(G){return F.insertLines(G)}),F._parser.setCsiHandler({final:"M"},function(G){return F.deleteLines(G)}),F._parser.setCsiHandler({final:"P"},function(G){return F.deleteChars(G)}),F._parser.setCsiHandler({final:"S"},function(G){return F.scrollUp(G)}),F._parser.setCsiHandler({final:"T"},function(G){return F.scrollDown(G)}),F._parser.setCsiHandler({final:"X"},function(G){return F.eraseChars(G)}),F._parser.setCsiHandler({final:"Z"},function(G){return F.cursorBackwardTab(G)}),F._parser.setCsiHandler({final:"`"},function(G){return F.charPosAbsolute(G)}),F._parser.setCsiHandler({final:"a"},function(G){return F.hPositionRelative(G)}),F._parser.setCsiHandler({final:"b"},function(G){return F.repeatPrecedingCharacter(G)}),F._parser.setCsiHandler({final:"c"},function(G){return F.sendDeviceAttributesPrimary(G)}),F._parser.setCsiHandler({prefix:">",final:"c"},function(G){return F.sendDeviceAttributesSecondary(G)}),F._parser.setCsiHandler({final:"d"},function(G){return F.linePosAbsolute(G)}),F._parser.setCsiHandler({final:"e"},function(G){return F.vPositionRelative(G)}),F._parser.setCsiHandler({final:"f"},function(G){return F.hVPosition(G)}),F._parser.setCsiHandler({final:"g"},function(G){return F.tabClear(G)}),F._parser.setCsiHandler({final:"h"},function(G){return F.setMode(G)}),F._parser.setCsiHandler({prefix:"?",final:"h"},function(G){return F.setModePrivate(G)}),F._parser.setCsiHandler({final:"l"},function(G){return F.resetMode(G)}),F._parser.setCsiHandler({prefix:"?",final:"l"},function(G){return F.resetModePrivate(G)}),F._parser.setCsiHandler({final:"m"},function(G){return F.charAttributes(G)}),F._parser.setCsiHandler({final:"n"},function(G){return F.deviceStatus(G)}),F._parser.setCsiHandler({prefix:"?",final:"n"},function(G){return F.deviceStatusPrivate(G)}),F._parser.setCsiHandler({intermediates:"!",final:"p"},function(G){return F.softReset(G)}),F._parser.setCsiHandler({intermediates:" ",final:"q"},function(G){return F.setCursorStyle(G)}),F._parser.setCsiHandler({final:"r"},function(G){return F.setScrollRegion(G)}),F._parser.setCsiHandler({final:"s"},function(G){return F.saveCursor(G)}),F._parser.setCsiHandler({final:"t"},function(G){return F.windowOptions(G)}),F._parser.setCsiHandler({final:"u"},function(G){return F.restoreCursor(G)}),F._parser.setCsiHandler({intermediates:"'",final:"}"},function(G){return F.insertColumns(G)}),F._parser.setCsiHandler({intermediates:"'",final:"~"},function(G){return F.deleteColumns(G)}),F._parser.setExecuteHandler(E.C0.BEL,function(){return F.bell()}),F._parser.setExecuteHandler(E.C0.LF,function(){return F.lineFeed()}),F._parser.setExecuteHandler(E.C0.VT,function(){return F.lineFeed()}),F._parser.setExecuteHandler(E.C0.FF,function(){return F.lineFeed()}),F._parser.setExecuteHandler(E.C0.CR,function(){return F.carriageReturn()}),F._parser.setExecuteHandler(E.C0.BS,function(){return F.backspace()}),F._parser.setExecuteHandler(E.C0.HT,function(){return F.tab()}),F._parser.setExecuteHandler(E.C0.SO,function(){return F.shiftOut()}),F._parser.setExecuteHandler(E.C0.SI,function(){return F.shiftIn()}),F._parser.setExecuteHandler(E.C1.IND,function(){return F.index()}),F._parser.setExecuteHandler(E.C1.NEL,function(){return F.nextLine()}),F._parser.setExecuteHandler(E.C1.HTS,function(){return F.tabSet()}),F._parser.setOscHandler(0,new i.OscHandler(function(G){F.setTitle(G),F.setIconName(G)})),F._parser.setOscHandler(1,new i.OscHandler(function(G){return F.setIconName(G)})),F._parser.setOscHandler(2,new i.OscHandler(function(G){return F.setTitle(G)})),F._parser.setEscHandler({final:"7"},function(){return F.saveCursor()}),F._parser.setEscHandler({final:"8"},function(){return F.restoreCursor()}),F._parser.setEscHandler({final:"D"},function(){return F.index()}),F._parser.setEscHandler({final:"E"},function(){return F.nextLine()}),F._parser.setEscHandler({final:"H"},function(){return F.tabSet()}),F._parser.setEscHandler({final:"M"},function(){return F.reverseIndex()}),F._parser.setEscHandler({final:"="},function(){return F.keypadApplicationMode()}),F._parser.setEscHandler({final:">"},function(){return F.keypadNumericMode()}),F._parser.setEscHandler({final:"c"},function(){return F.fullReset()}),F._parser.setEscHandler({final:"n"},function(){return F.setgLevel(2)}),F._parser.setEscHandler({final:"o"},function(){return F.setgLevel(3)}),F._parser.setEscHandler({final:"|"},function(){return F.setgLevel(3)}),F._parser.setEscHandler({final:"}"},function(){return F.setgLevel(2)}),F._parser.setEscHandler({final:"~"},function(){return F.setgLevel(1)}),F._parser.setEscHandler({intermediates:"%",final:"@"},function(){return F.selectDefaultCharset()}),F._parser.setEscHandler({intermediates:"%",final:"G"},function(){return F.selectDefaultCharset()});var W=function(G){U._parser.setEscHandler({intermediates:"(",final:G},function(){return F.selectCharset("("+G)}),U._parser.setEscHandler({intermediates:")",final:G},function(){return F.selectCharset(")"+G)}),U._parser.setEscHandler({intermediates:"*",final:G},function(){return F.selectCharset("*"+G)}),U._parser.setEscHandler({intermediates:"+",final:G},function(){return F.selectCharset("+"+G)}),U._parser.setEscHandler({intermediates:"-",final:G},function(){return F.selectCharset("-"+G)}),U._parser.setEscHandler({intermediates:".",final:G},function(){return F.selectCharset("."+G)}),U._parser.setEscHandler({intermediates:"/",final:G},function(){return F.selectCharset("/"+G)})},U=this;for(var K in y.CHARSETS)W(K);return F._parser.setEscHandler({intermediates:"#",final:"8"},function(){return F.screenAlignmentPattern()}),F._parser.setErrorHandler(function(G){return F._logService.error("Parsing error: ",G),G}),F._parser.setDcsHandler({intermediates:"$",final:"q"},new g(F._bufferService,F._coreService,F._logService,F._optionsService)),F}return O(x,C),Object.defineProperty(x.prototype,"onRequestBell",{get:function(){return this._onRequestBell.event},enumerable:!1,configurable:!0}),Object.defineProperty(x.prototype,"onRequestRefreshRows",{get:function(){return this._onRequestRefreshRows.event},enumerable:!1,configurable:!0}),Object.defineProperty(x.prototype,"onRequestReset",{get:function(){return this._onRequestReset.event},enumerable:!1,configurable:!0}),Object.defineProperty(x.prototype,"onRequestScroll",{get:function(){return this._onRequestScroll.event},enumerable:!1,configurable:!0}),Object.defineProperty(x.prototype,"onRequestSyncScrollBar",{get:function(){return this._onRequestSyncScrollBar.event},enumerable:!1,configurable:!0}),Object.defineProperty(x.prototype,"onRequestWindowsOptionsReport",{get:function(){return this._onRequestWindowsOptionsReport.event},enumerable:!1,configurable:!0}),Object.defineProperty(x.prototype,"onA11yChar",{get:function(){return this._onA11yChar.event},enumerable:!1,configurable:!0}),Object.defineProperty(x.prototype,"onA11yTab",{get:function(){return this._onA11yTab.event},enumerable:!1,configurable:!0}),Object.defineProperty(x.prototype,"onCursorMove",{get:function(){return this._onCursorMove.event},enumerable:!1,configurable:!0}),Object.defineProperty(x.prototype,"onLineFeed",{get:function(){return this._onLineFeed.event},enumerable:!1,configurable:!0}),Object.defineProperty(x.prototype,"onScroll",{get:function(){return this._onScroll.event},enumerable:!1,configurable:!0}),Object.defineProperty(x.prototype,"onTitleChange",{get:function(){return this._onTitleChange.event},enumerable:!1,configurable:!0}),x.prototype.dispose=function(){C.prototype.dispose.call(this)},x.prototype.parse=function(b){var S=this._bufferService.buffer,A=S.x,p=S.y;if(this._logService.debug("parsing data",b),this._parseBuffer.length<b.length&&this._parseBuffer.length<131072&&(this._parseBuffer=new Uint32Array(Math.min(b.length,131072))),this._dirtyRowService.clearRange(),b.length>131072)for(var I=0;I<b.length;I+=131072){var M=I+131072<b.length?I+131072:b.length,P=typeof b=="string"?this._stringDecoder.decode(b.substring(I,M),this._parseBuffer):this._utf8Decoder.decode(b.subarray(I,M),this._parseBuffer);this._parser.parse(this._parseBuffer,P)}else P=typeof b=="string"?this._stringDecoder.decode(b,this._parseBuffer):this._utf8Decoder.decode(b,this._parseBuffer),this._parser.parse(this._parseBuffer,P);(S=this._bufferService.buffer).x===A&&S.y===p||this._onCursorMove.fire(),this._onRequestRefreshRows.fire(this._dirtyRowService.start,this._dirtyRowService.end)},x.prototype.print=function(b,S,A){var p,I,M=this._bufferService.buffer,P=this._charsetService.charset,B=this._optionsService.options.screenReaderMode,H=this._bufferService.cols,F=this._coreService.decPrivateModes.wraparound,W=this._coreService.modes.insertMode,U=this._curAttrData,K=M.lines.get(M.ybase+M.y);this._dirtyRowService.markDirty(M.y),M.x&&A-S>0&&K.getWidth(M.x-1)===2&&K.setCellFromCodePoint(M.x-1,0,1,U.fg,U.bg,U.extended);for(var G=S;G<A;++G){if(p=b[G],I=this._unicodeService.wcwidth(p),p<127&&P){var ae=P[String.fromCharCode(p)];ae&&(p=ae.charCodeAt(0))}if(B&&this._onA11yChar.fire(c.stringFromCodePoint(p)),I||!M.x){if(M.x+I-1>=H){if(F){for(;M.x<H;)K.setCellFromCodePoint(M.x++,0,1,U.fg,U.bg,U.extended);M.x=0,M.y++,M.y===M.scrollBottom+1?(M.y--,this._onRequestScroll.fire(this._eraseAttrData(),!0)):(M.y>=this._bufferService.rows&&(M.y=this._bufferService.rows-1),M.lines.get(M.ybase+M.y).isWrapped=!0),K=M.lines.get(M.ybase+M.y)}else if(M.x=H-1,I===2)continue}if(W&&(K.insertCells(M.x,I,M.getNullCell(U),U),K.getWidth(H-1)===2&&K.setCellFromCodePoint(H-1,r.NULL_CELL_CODE,r.NULL_CELL_WIDTH,U.fg,U.bg,U.extended)),K.setCellFromCodePoint(M.x++,p,I,U.fg,U.bg,U.extended),I>0)for(;--I;)K.setCellFromCodePoint(M.x++,0,0,U.fg,U.bg,U.extended)}else K.getWidth(M.x-1)?K.addCodepointToCell(M.x-1,p):K.addCodepointToCell(M.x-2,p)}A-S>0&&(K.loadCell(M.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),M.x<H&&A-S>0&&K.getWidth(M.x)===0&&!K.hasContent(M.x)&&K.setCellFromCodePoint(M.x,0,1,U.fg,U.bg,U.extended),this._dirtyRowService.markDirty(M.y)},x.prototype.addCsiHandler=function(b,S){var A=this;return b.final!=="t"||b.prefix||b.intermediates?this._parser.addCsiHandler(b,S):this._parser.addCsiHandler(b,function(p){return!T(p.params[0],A._optionsService.options.windowOptions)||S(p)})},x.prototype.addDcsHandler=function(b,S){return this._parser.addDcsHandler(b,new f.DcsHandler(S))},x.prototype.addEscHandler=function(b,S){return this._parser.addEscHandler(b,S)},x.prototype.addOscHandler=function(b,S){return this._parser.addOscHandler(b,new i.OscHandler(S))},x.prototype.bell=function(){this._onRequestBell.fire()},x.prototype.lineFeed=function(){var b=this._bufferService.buffer;this._dirtyRowService.markDirty(b.y),this._optionsService.options.convertEol&&(b.x=0),b.y++,b.y===b.scrollBottom+1?(b.y--,this._onRequestScroll.fire(this._eraseAttrData())):b.y>=this._bufferService.rows&&(b.y=this._bufferService.rows-1),b.x>=this._bufferService.cols&&b.x--,this._dirtyRowService.markDirty(b.y),this._onLineFeed.fire()},x.prototype.carriageReturn=function(){this._bufferService.buffer.x=0},x.prototype.backspace=function(){var b,S=this._bufferService.buffer;if(!this._coreService.decPrivateModes.reverseWraparound)return this._restrictCursor(),void(S.x>0&&S.x--);if(this._restrictCursor(this._bufferService.cols),S.x>0)S.x--;else if(S.x===0&&S.y>S.scrollTop&&S.y<=S.scrollBottom&&((b=S.lines.get(S.ybase+S.y))===null||b===void 0?void 0:b.isWrapped)){S.lines.get(S.ybase+S.y).isWrapped=!1,S.y--,S.x=this._bufferService.cols-1;var A=S.lines.get(S.ybase+S.y);A.hasWidth(S.x)&&!A.hasContent(S.x)&&S.x--}this._restrictCursor()},x.prototype.tab=function(){if(!(this._bufferService.buffer.x>=this._bufferService.cols)){var b=this._bufferService.buffer.x;this._bufferService.buffer.x=this._bufferService.buffer.nextStop(),this._optionsService.options.screenReaderMode&&this._onA11yTab.fire(this._bufferService.buffer.x-b)}},x.prototype.shiftOut=function(){this._charsetService.setgLevel(1)},x.prototype.shiftIn=function(){this._charsetService.setgLevel(0)},x.prototype._restrictCursor=function(b){b===void 0&&(b=this._bufferService.cols-1),this._bufferService.buffer.x=Math.min(b,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)},x.prototype._setCursor=function(b,S){this._dirtyRowService.markDirty(this._bufferService.buffer.y),this._coreService.decPrivateModes.origin?(this._bufferService.buffer.x=b,this._bufferService.buffer.y=this._bufferService.buffer.scrollTop+S):(this._bufferService.buffer.x=b,this._bufferService.buffer.y=S),this._restrictCursor(),this._dirtyRowService.markDirty(this._bufferService.buffer.y)},x.prototype._moveCursor=function(b,S){this._restrictCursor(),this._setCursor(this._bufferService.buffer.x+b,this._bufferService.buffer.y+S)},x.prototype.cursorUp=function(b){var S=this._bufferService.buffer.y-this._bufferService.buffer.scrollTop;S>=0?this._moveCursor(0,-Math.min(S,b.params[0]||1)):this._moveCursor(0,-(b.params[0]||1))},x.prototype.cursorDown=function(b){var S=this._bufferService.buffer.scrollBottom-this._bufferService.buffer.y;S>=0?this._moveCursor(0,Math.min(S,b.params[0]||1)):this._moveCursor(0,b.params[0]||1)},x.prototype.cursorForward=function(b){this._moveCursor(b.params[0]||1,0)},x.prototype.cursorBackward=function(b){this._moveCursor(-(b.params[0]||1),0)},x.prototype.cursorNextLine=function(b){this.cursorDown(b),this._bufferService.buffer.x=0},x.prototype.cursorPrecedingLine=function(b){this.cursorUp(b),this._bufferService.buffer.x=0},x.prototype.cursorCharAbsolute=function(b){this._setCursor((b.params[0]||1)-1,this._bufferService.buffer.y)},x.prototype.cursorPosition=function(b){this._setCursor(b.length>=2?(b.params[1]||1)-1:0,(b.params[0]||1)-1)},x.prototype.charPosAbsolute=function(b){this._setCursor((b.params[0]||1)-1,this._bufferService.buffer.y)},x.prototype.hPositionRelative=function(b){this._moveCursor(b.params[0]||1,0)},x.prototype.linePosAbsolute=function(b){this._setCursor(this._bufferService.buffer.x,(b.params[0]||1)-1)},x.prototype.vPositionRelative=function(b){this._moveCursor(0,b.params[0]||1)},x.prototype.hVPosition=function(b){this.cursorPosition(b)},x.prototype.tabClear=function(b){var S=b.params[0];S===0?delete this._bufferService.buffer.tabs[this._bufferService.buffer.x]:S===3&&(this._bufferService.buffer.tabs={})},x.prototype.cursorForwardTab=function(b){if(!(this._bufferService.buffer.x>=this._bufferService.cols))for(var S=b.params[0]||1;S--;)this._bufferService.buffer.x=this._bufferService.buffer.nextStop()},x.prototype.cursorBackwardTab=function(b){if(!(this._bufferService.buffer.x>=this._bufferService.cols))for(var S=b.params[0]||1,A=this._bufferService.buffer;S--;)A.x=A.prevStop()},x.prototype._eraseInBufferLine=function(b,S,A,p){p===void 0&&(p=!1);var I=this._bufferService.buffer.lines.get(this._bufferService.buffer.ybase+b);I.replaceCells(S,A,this._bufferService.buffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),p&&(I.isWrapped=!1)},x.prototype._resetBufferLine=function(b){var S=this._bufferService.buffer.lines.get(this._bufferService.buffer.ybase+b);S.fill(this._bufferService.buffer.getNullCell(this._eraseAttrData())),S.isWrapped=!1},x.prototype.eraseInDisplay=function(b){var S;switch(this._restrictCursor(),b.params[0]){case 0:for(S=this._bufferService.buffer.y,this._dirtyRowService.markDirty(S),this._eraseInBufferLine(S++,this._bufferService.buffer.x,this._bufferService.cols,this._bufferService.buffer.x===0);S<this._bufferService.rows;S++)this._resetBufferLine(S);this._dirtyRowService.markDirty(S);break;case 1:for(S=this._bufferService.buffer.y,this._dirtyRowService.markDirty(S),this._eraseInBufferLine(S,0,this._bufferService.buffer.x+1,!0),this._bufferService.buffer.x+1>=this._bufferService.cols&&(this._bufferService.buffer.lines.get(S+1).isWrapped=!1);S--;)this._resetBufferLine(S);this._dirtyRowService.markDirty(0);break;case 2:for(S=this._bufferService.rows,this._dirtyRowService.markDirty(S-1);S--;)this._resetBufferLine(S);this._dirtyRowService.markDirty(0);break;case 3:var A=this._bufferService.buffer.lines.length-this._bufferService.rows;A>0&&(this._bufferService.buffer.lines.trimStart(A),this._bufferService.buffer.ybase=Math.max(this._bufferService.buffer.ybase-A,0),this._bufferService.buffer.ydisp=Math.max(this._bufferService.buffer.ydisp-A,0),this._onScroll.fire(0))}},x.prototype.eraseInLine=function(b){switch(this._restrictCursor(),b.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)},x.prototype.insertLines=function(b){this._restrictCursor();var S=b.params[0]||1,A=this._bufferService.buffer;if(!(A.y>A.scrollBottom||A.y<A.scrollTop)){for(var p=A.ybase+A.y,I=this._bufferService.rows-1-A.scrollBottom,M=this._bufferService.rows-1+A.ybase-I+1;S--;)A.lines.splice(M-1,1),A.lines.splice(p,0,A.getBlankLine(this._eraseAttrData()));this._dirtyRowService.markRangeDirty(A.y,A.scrollBottom),A.x=0}},x.prototype.deleteLines=function(b){this._restrictCursor();var S=b.params[0]||1,A=this._bufferService.buffer;if(!(A.y>A.scrollBottom||A.y<A.scrollTop)){var p,I=A.ybase+A.y;for(p=this._bufferService.rows-1-A.scrollBottom,p=this._bufferService.rows-1+A.ybase-p;S--;)A.lines.splice(I,1),A.lines.splice(p,0,A.getBlankLine(this._eraseAttrData()));this._dirtyRowService.markRangeDirty(A.y,A.scrollBottom),A.x=0}},x.prototype.insertChars=function(b){this._restrictCursor();var S=this._bufferService.buffer.lines.get(this._bufferService.buffer.ybase+this._bufferService.buffer.y);S&&(S.insertCells(this._bufferService.buffer.x,b.params[0]||1,this._bufferService.buffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),this._dirtyRowService.markDirty(this._bufferService.buffer.y))},x.prototype.deleteChars=function(b){this._restrictCursor();var S=this._bufferService.buffer.lines.get(this._bufferService.buffer.ybase+this._bufferService.buffer.y);S&&(S.deleteCells(this._bufferService.buffer.x,b.params[0]||1,this._bufferService.buffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),this._dirtyRowService.markDirty(this._bufferService.buffer.y))},x.prototype.scrollUp=function(b){for(var S=b.params[0]||1,A=this._bufferService.buffer;S--;)A.lines.splice(A.ybase+A.scrollTop,1),A.lines.splice(A.ybase+A.scrollBottom,0,A.getBlankLine(this._eraseAttrData()));this._dirtyRowService.markRangeDirty(A.scrollTop,A.scrollBottom)},x.prototype.scrollDown=function(b){for(var S=b.params[0]||1,A=this._bufferService.buffer;S--;)A.lines.splice(A.ybase+A.scrollBottom,1),A.lines.splice(A.ybase+A.scrollTop,0,A.getBlankLine(s.DEFAULT_ATTR_DATA));this._dirtyRowService.markRangeDirty(A.scrollTop,A.scrollBottom)},x.prototype.scrollLeft=function(b){var S=this._bufferService.buffer;if(!(S.y>S.scrollBottom||S.y<S.scrollTop)){for(var A=b.params[0]||1,p=S.scrollTop;p<=S.scrollBottom;++p){var I=S.lines.get(S.ybase+p);I.deleteCells(0,A,S.getNullCell(this._eraseAttrData()),this._eraseAttrData()),I.isWrapped=!1}this._dirtyRowService.markRangeDirty(S.scrollTop,S.scrollBottom)}},x.prototype.scrollRight=function(b){var S=this._bufferService.buffer;if(!(S.y>S.scrollBottom||S.y<S.scrollTop)){for(var A=b.params[0]||1,p=S.scrollTop;p<=S.scrollBottom;++p){var I=S.lines.get(S.ybase+p);I.insertCells(0,A,S.getNullCell(this._eraseAttrData()),this._eraseAttrData()),I.isWrapped=!1}this._dirtyRowService.markRangeDirty(S.scrollTop,S.scrollBottom)}},x.prototype.insertColumns=function(b){var S=this._bufferService.buffer;if(!(S.y>S.scrollBottom||S.y<S.scrollTop)){for(var A=b.params[0]||1,p=S.scrollTop;p<=S.scrollBottom;++p){var I=this._bufferService.buffer.lines.get(S.ybase+p);I.insertCells(S.x,A,S.getNullCell(this._eraseAttrData()),this._eraseAttrData()),I.isWrapped=!1}this._dirtyRowService.markRangeDirty(S.scrollTop,S.scrollBottom)}},x.prototype.deleteColumns=function(b){var S=this._bufferService.buffer;if(!(S.y>S.scrollBottom||S.y<S.scrollTop)){for(var A=b.params[0]||1,p=S.scrollTop;p<=S.scrollBottom;++p){var I=S.lines.get(S.ybase+p);I.deleteCells(S.x,A,S.getNullCell(this._eraseAttrData()),this._eraseAttrData()),I.isWrapped=!1}this._dirtyRowService.markRangeDirty(S.scrollTop,S.scrollBottom)}},x.prototype.eraseChars=function(b){this._restrictCursor();var S=this._bufferService.buffer.lines.get(this._bufferService.buffer.ybase+this._bufferService.buffer.y);S&&(S.replaceCells(this._bufferService.buffer.x,this._bufferService.buffer.x+(b.params[0]||1),this._bufferService.buffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),this._dirtyRowService.markDirty(this._bufferService.buffer.y))},x.prototype.repeatPrecedingCharacter=function(b){if(this._parser.precedingCodepoint){for(var S=b.params[0]||1,A=new Uint32Array(S),p=0;p<S;++p)A[p]=this._parser.precedingCodepoint;this.print(A,0,A.length)}},x.prototype.sendDeviceAttributesPrimary=function(b){b.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"))},x.prototype.sendDeviceAttributesSecondary=function(b){b.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(b.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(E.C0.ESC+"[>83;40003;0c"))},x.prototype._is=function(b){return(this._optionsService.options.termName+"").indexOf(b)===0},x.prototype.setMode=function(b){for(var S=0;S<b.length;S++)switch(b.params[S]){case 4:this._coreService.modes.insertMode=!0}},x.prototype.setModePrivate=function(b){for(var S=0;S<b.length;S++)switch(b.params[S]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,y.DEFAULT_CHARSET),this._charsetService.setgCharset(1,y.DEFAULT_CHARSET),this._charsetService.setgCharset(2,y.DEFAULT_CHARSET),this._charsetService.setgCharset(3,y.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}},x.prototype.resetMode=function(b){for(var S=0;S<b.length;S++)switch(b.params[S]){case 4:this._coreService.modes.insertMode=!1}},x.prototype.resetModePrivate=function(b){for(var S=0;S<b.length;S++)switch(b.params[S]){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(),b.params[S]===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}},x.prototype._updateAttrColor=function(b,S,A,p,I){return S===2?(b|=50331648,b&=-16777216,b|=o.AttributeData.fromColorRGB([A,p,I])):S===5&&(b&=-50331904,b|=33554432|255&A),b},x.prototype._extractColor=function(b,S,A){var p=[0,0,-1,0,0,0],I=0,M=0;do{if(p[M+I]=b.params[S+M],b.hasSubParams(S+M)){var P=b.getSubParams(S+M),B=0;do p[1]===5&&(I=1),p[M+B+1+I]=P[B];while(++B<P.length&&B+M+1+I<p.length);break}if(p[1]===5&&M+I>=2||p[1]===2&&M+I>=5)break;p[1]&&(I=1)}while(++M+S<b.length&&M+I<p.length);for(B=2;B<p.length;++B)p[B]===-1&&(p[B]=0);switch(p[0]){case 38:A.fg=this._updateAttrColor(A.fg,p[1],p[3],p[4],p[5]);break;case 48:A.bg=this._updateAttrColor(A.bg,p[1],p[3],p[4],p[5]);break;case 58:A.extended=A.extended.clone(),A.extended.underlineColor=this._updateAttrColor(A.extended.underlineColor,p[1],p[3],p[4],p[5])}return M},x.prototype._processUnderline=function(b,S){S.extended=S.extended.clone(),(!~b||b>5)&&(b=1),S.extended.underlineStyle=b,S.fg|=268435456,b===0&&(S.fg&=-268435457),S.updateExtended()},x.prototype.charAttributes=function(b){if(b.length===1&&b.params[0]===0)return this._curAttrData.fg=s.DEFAULT_ATTR_DATA.fg,void(this._curAttrData.bg=s.DEFAULT_ATTR_DATA.bg);for(var S,A=b.length,p=this._curAttrData,I=0;I<A;I++)(S=b.params[I])>=30&&S<=37?(p.fg&=-50331904,p.fg|=16777216|S-30):S>=40&&S<=47?(p.bg&=-50331904,p.bg|=16777216|S-40):S>=90&&S<=97?(p.fg&=-50331904,p.fg|=16777224|S-90):S>=100&&S<=107?(p.bg&=-50331904,p.bg|=16777224|S-100):S===0?(p.fg=s.DEFAULT_ATTR_DATA.fg,p.bg=s.DEFAULT_ATTR_DATA.bg):S===1?p.fg|=134217728:S===3?p.bg|=67108864:S===4?(p.fg|=268435456,this._processUnderline(b.hasSubParams(I)?b.getSubParams(I)[0]:1,p)):S===5?p.fg|=536870912:S===7?p.fg|=67108864:S===8?p.fg|=1073741824:S===2?p.bg|=134217728:S===21?this._processUnderline(2,p):S===22?(p.fg&=-134217729,p.bg&=-134217729):S===23?p.bg&=-67108865:S===24?p.fg&=-268435457:S===25?p.fg&=-536870913:S===27?p.fg&=-67108865:S===28?p.fg&=-1073741825:S===39?(p.fg&=-67108864,p.fg|=16777215&s.DEFAULT_ATTR_DATA.fg):S===49?(p.bg&=-67108864,p.bg|=16777215&s.DEFAULT_ATTR_DATA.bg):S===38||S===48||S===58?I+=this._extractColor(b,I,p):S===59?(p.extended=p.extended.clone(),p.extended.underlineColor=-1,p.updateExtended()):S===100?(p.fg&=-67108864,p.fg|=16777215&s.DEFAULT_ATTR_DATA.fg,p.bg&=-67108864,p.bg|=16777215&s.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",S)},x.prototype.deviceStatus=function(b){switch(b.params[0]){case 5:this._coreService.triggerDataEvent(E.C0.ESC+"[0n");break;case 6:var S=this._bufferService.buffer.y+1,A=this._bufferService.buffer.x+1;this._coreService.triggerDataEvent(E.C0.ESC+"["+S+";"+A+"R")}},x.prototype.deviceStatusPrivate=function(b){switch(b.params[0]){case 6:var S=this._bufferService.buffer.y+1,A=this._bufferService.buffer.x+1;this._coreService.triggerDataEvent(E.C0.ESC+"[?"+S+";"+A+"R")}},x.prototype.softReset=function(b){this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._bufferService.buffer.scrollTop=0,this._bufferService.buffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=s.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},x.prototype.setCursorStyle=function(b){var S=b.params[0]||1;switch(S){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 A=S%2==1;this._optionsService.options.cursorBlink=A},x.prototype.setScrollRegion=function(b){var S,A=b.params[0]||1;(b.length<2||(S=b.params[1])>this._bufferService.rows||S===0)&&(S=this._bufferService.rows),S>A&&(this._bufferService.buffer.scrollTop=A-1,this._bufferService.buffer.scrollBottom=S-1,this._setCursor(0,0))},x.prototype.windowOptions=function(b){if(T(b.params[0],this._optionsService.options.windowOptions)){var S=b.length>1?b.params[1]:0;switch(b.params[0]){case 14:S!==2&&this._onRequestWindowsOptionsReport.fire(d.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(d.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:S!==0&&S!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),S!==0&&S!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:S!==0&&S!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),S!==0&&S!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}}},x.prototype.saveCursor=function(b){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},x.prototype.restoreCursor=function(b){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()},x.prototype.setTitle=function(b){this._windowTitle=b,this._onTitleChange.fire(b)},x.prototype.setIconName=function(b){this._iconName=b},x.prototype.nextLine=function(){this._bufferService.buffer.x=0,this.index()},x.prototype.keypadApplicationMode=function(){this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire()},x.prototype.keypadNumericMode=function(){this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire()},x.prototype.selectDefaultCharset=function(){this._charsetService.setgLevel(0),this._charsetService.setgCharset(0,y.DEFAULT_CHARSET)},x.prototype.selectCharset=function(b){b.length===2?b[0]!=="/"&&this._charsetService.setgCharset(h[b[0]],y.CHARSETS[b[1]]||y.DEFAULT_CHARSET):this.selectDefaultCharset()},x.prototype.index=function(){this._restrictCursor();var b=this._bufferService.buffer;this._bufferService.buffer.y++,b.y===b.scrollBottom+1?(b.y--,this._onRequestScroll.fire(this._eraseAttrData())):b.y>=this._bufferService.rows&&(b.y=this._bufferService.rows-1),this._restrictCursor()},x.prototype.tabSet=function(){this._bufferService.buffer.tabs[this._bufferService.buffer.x]=!0},x.prototype.reverseIndex=function(){this._restrictCursor();var b=this._bufferService.buffer;if(b.y===b.scrollTop){var S=b.scrollBottom-b.scrollTop;b.lines.shiftElements(b.ybase+b.y,S,1),b.lines.set(b.ybase+b.y,b.getBlankLine(this._eraseAttrData())),this._dirtyRowService.markRangeDirty(b.scrollTop,b.scrollBottom)}else b.y--,this._restrictCursor()},x.prototype.fullReset=function(){this._parser.reset(),this._onRequestReset.fire()},x.prototype.reset=function(){this._curAttrData=s.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=s.DEFAULT_ATTR_DATA.clone()},x.prototype._eraseAttrData=function(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal},x.prototype.setgLevel=function(b){this._charsetService.setgLevel(b)},x.prototype.screenAlignmentPattern=function(){var b=new n.CellData;b.content=1<<22|"E".charCodeAt(0),b.fg=this._curAttrData.fg,b.bg=this._curAttrData.bg;var S=this._bufferService.buffer;this._setCursor(0,0);for(var A=0;A<this._bufferService.rows;++A){var p=S.ybase+S.y+A,I=S.lines.get(p);I&&(I.fill(b),I.isWrapped=!1)}this._dirtyRowService.markAllDirty(),this._setCursor(0,0)},x}(u.Disposable);k.InputHandler=w},function(j,k,D){"use strict";Object.defineProperty(k,"__esModule",{value:!0}),k.DEFAULT_CHARSET=k.CHARSETS=void 0,k.CHARSETS={},k.DEFAULT_CHARSET=k.CHARSETS.B,k.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"},k.CHARSETS.A={"#":"\xA3"},k.CHARSETS.B=void 0,k.CHARSETS[4]={"#":"\xA3","@":"\xBE","[":"ij","\\":"\xBD","]":"|","{":"\xA8","|":"f","}":"\xBC","~":"\xB4"},k.CHARSETS.C=k.CHARSETS[5]={"[":"\xC4","\\":"\xD6","]":"\xC5","^":"\xDC","`":"\xE9","{":"\xE4","|":"\xF6","}":"\xE5","~":"\xFC"},k.CHARSETS.R={"#":"\xA3","@":"\xE0","[":"\xB0","\\":"\xE7","]":"\xA7","{":"\xE9","|":"\xF9","}":"\xE8","~":"\xA8"},k.CHARSETS.Q={"@":"\xE0","[":"\xE2","\\":"\xE7","]":"\xEA","^":"\xEE","`":"\xF4","{":"\xE9","|":"\xF9","}":"\xE8","~":"\xFB"},k.CHARSETS.K={"@":"\xA7","[":"\xC4","\\":"\xD6","]":"\xDC","{":"\xE4","|":"\xF6","}":"\xFC","~":"\xDF"},k.CHARSETS.Y={"#":"\xA3","@":"\xA7","[":"\xB0","\\":"\xE7","]":"\xE9","`":"\xF9","{":"\xE0","|":"\xF2","}":"\xE8","~":"\xEC"},k.CHARSETS.E=k.CHARSETS[6]={"@":"\xC4","[":"\xC6","\\":"\xD8","]":"\xC5","^":"\xDC","`":"\xE4","{":"\xE6","|":"\xF8","}":"\xE5","~":"\xFC"},k.CHARSETS.Z={"#":"\xA3","@":"\xA7","[":"\xA1","\\":"\xD1","]":"\xBF","{":"\xB0","|":"\xF1","}":"\xE7"},k.CHARSETS.H=k.CHARSETS[7]={"@":"\xC9","[":"\xC4","\\":"\xD6","]":"\xC5","^":"\xDC","`":"\xE9","{":"\xE4","|":"\xF6","}":"\xE5","~":"\xFC"},k.CHARSETS["="]={"#":"\xF9","@":"\xE0","[":"\xE9","\\":"\xE7","]":"\xEA","^":"\xEE",_:"\xE8","`":"\xF4","{":"\xE4","|":"\xF6","}":"\xFC","~":"\xFB"}},function(j,k,D){"use strict";Object.defineProperty(k,"__esModule",{value:!0}),k.Params=void 0;var R=function(){function O(d,E){if(d===void 0&&(d=32),E===void 0&&(E=32),this.maxLength=d,this.maxSubParamsLength=E,E>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(d),this.length=0,this._subParams=new Int32Array(E),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(d),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}return O.fromArray=function(d){var E=new O;if(!d.length)return E;for(var y=d[0]instanceof Array?1:0;y<d.length;++y){var v=d[y];if(v instanceof Array)for(var u=0;u<v.length;++u)E.addSubParam(v[u]);else E.addParam(v)}return E},O.prototype.clone=function(){var d=new O(this.maxLength,this.maxSubParamsLength);return d.params.set(this.params),d.length=this.length,d._subParams.set(this._subParams),d._subParamsLength=this._subParamsLength,d._subParamsIdx.set(this._subParamsIdx),d._rejectDigits=this._rejectDigits,d._rejectSubDigits=this._rejectSubDigits,d._digitIsSub=this._digitIsSub,d},O.prototype.toArray=function(){for(var d=[],E=0;E<this.length;++E){d.push(this.params[E]);var y=this._subParamsIdx[E]>>8,v=255&this._subParamsIdx[E];v-y>0&&d.push(Array.prototype.slice.call(this._subParams,y,v))}return d},O.prototype.reset=function(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1},O.prototype.addParam=function(d){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(d<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=d>2147483647?2147483647:d}},O.prototype.addSubParam=function(d){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(d<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=d>2147483647?2147483647:d,this._subParamsIdx[this.length-1]++}},O.prototype.hasSubParams=function(d){return(255&this._subParamsIdx[d])-(this._subParamsIdx[d]>>8)>0},O.prototype.getSubParams=function(d){var E=this._subParamsIdx[d]>>8,y=255&this._subParamsIdx[d];return y-E>0?this._subParams.subarray(E,y):null},O.prototype.getSubParamsAll=function(){for(var d={},E=0;E<this.length;++E){var y=this._subParamsIdx[E]>>8,v=255&this._subParamsIdx[E];v-y>0&&(d[E]=this._subParams.slice(y,v))}return d},O.prototype.addDigit=function(d){var E;if(!(this._rejectDigits||!(E=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)){var y=this._digitIsSub?this._subParams:this.params,v=y[E-1];y[E-1]=~v?Math.min(10*v+d,2147483647):d}},O}();k.Params=R},function(j,k,D){"use strict";Object.defineProperty(k,"__esModule",{value:!0}),k.OscHandler=k.OscParser=void 0;var R=D(23),O=D(8),d=function(){function y(){this._state=0,this._id=-1,this._handlers=Object.create(null),this._handlerFb=function(){}}return y.prototype.addHandler=function(v,u){this._handlers[v]===void 0&&(this._handlers[v]=[]);var a=this._handlers[v];return a.push(u),{dispose:function(){var c=a.indexOf(u);c!==-1&&a.splice(c,1)}}},y.prototype.setHandler=function(v,u){this._handlers[v]=[u]},y.prototype.clearHandler=function(v){this._handlers[v]&&delete this._handlers[v]},y.prototype.setHandlerFallback=function(v){this._handlerFb=v},y.prototype.dispose=function(){this._handlers=Object.create(null),this._handlerFb=function(){}},y.prototype.reset=function(){this._state===2&&this.end(!1),this._id=-1,this._state=0},y.prototype._start=function(){var v=this._handlers[this._id];if(v)for(var u=v.length-1;u>=0;u--)v[u].start();else this._handlerFb(this._id,"START")},y.prototype._put=function(v,u,a){var c=this._handlers[this._id];if(c)for(var s=c.length-1;s>=0;s--)c[s].put(v,u,a);else this._handlerFb(this._id,"PUT",O.utf32ToString(v,u,a))},y.prototype._end=function(v){var u=this._handlers[this._id];if(u){for(var a=u.length-1;a>=0&&u[a].end(v)===!1;a--);for(a--;a>=0;a--)u[a].end(!1)}else this._handlerFb(this._id,"END",v)},y.prototype.start=function(){this.reset(),this._id=-1,this._state=1},y.prototype.put=function(v,u,a){if(this._state!==3){if(this._state===1)for(;u<a;){var c=v[u++];if(c===59){this._state=2,this._start();break}if(c<48||57<c)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+c-48}this._state===2&&a-u>0&&this._put(v,u,a)}},y.prototype.end=function(v){this._state!==0&&(this._state!==3&&(this._state===1&&this._start(),this._end(v)),this._id=-1,this._state=0)},y}();k.OscParser=d;var E=function(){function y(v){this._handler=v,this._data="",this._hitLimit=!1}return y.prototype.start=function(){this._data="",this._hitLimit=!1},y.prototype.put=function(v,u,a){this._hitLimit||(this._data+=O.utf32ToString(v,u,a),this._data.length>R.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))},y.prototype.end=function(v){var u;return this._hitLimit?u=!1:v&&(u=this._handler(this._data)),this._data="",this._hitLimit=!1,u},y}();k.OscHandler=E},function(j,k,D){"use strict";Object.defineProperty(k,"__esModule",{value:!0}),k.PAYLOAD_LIMIT=void 0,k.PAYLOAD_LIMIT=1e7},function(j,k,D){"use strict";Object.defineProperty(k,"__esModule",{value:!0}),k.DcsHandler=k.DcsParser=void 0;var R=D(8),O=D(21),d=D(23),E=[],y=function(){function u(){this._handlers=Object.create(null),this._active=E,this._ident=0,this._handlerFb=function(){}}return u.prototype.dispose=function(){this._handlers=Object.create(null),this._handlerFb=function(){}},u.prototype.addHandler=function(a,c){this._handlers[a]===void 0&&(this._handlers[a]=[]);var s=this._handlers[a];return s.push(c),{dispose:function(){var l=s.indexOf(c);l!==-1&&s.splice(l,1)}}},u.prototype.setHandler=function(a,c){this._handlers[a]=[c]},u.prototype.clearHandler=function(a){this._handlers[a]&&delete this._handlers[a]},u.prototype.setHandlerFallback=function(a){this._handlerFb=a},u.prototype.reset=function(){this._active.length&&this.unhook(!1),this._active=E,this._ident=0},u.prototype.hook=function(a,c){if(this.reset(),this._ident=a,this._active=this._handlers[a]||E,this._active.length)for(var s=this._active.length-1;s>=0;s--)this._active[s].hook(c);else this._handlerFb(this._ident,"HOOK",c)},u.prototype.put=function(a,c,s){if(this._active.length)for(var l=this._active.length-1;l>=0;l--)this._active[l].put(a,c,s);else this._handlerFb(this._ident,"PUT",R.utf32ToString(a,c,s))},u.prototype.unhook=function(a){if(this._active.length){for(var c=this._active.length-1;c>=0&&this._active[c].unhook(a)===!1;c--);for(c--;c>=0;c--)this._active[c].unhook(!1)}else this._handlerFb(this._ident,"UNHOOK",a);this._active=E,this._ident=0},u}();k.DcsParser=y;var v=function(){function u(a){this._handler=a,this._data="",this._hitLimit=!1}return u.prototype.hook=function(a){this._params=a.clone(),this._data="",this._hitLimit=!1},u.prototype.put=function(a,c,s){this._hitLimit||(this._data+=R.utf32ToString(a,c,s),this._data.length>d.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))},u.prototype.unhook=function(a){var c;return this._hitLimit?c=!1:a&&(c=this._handler(this._data,this._params||new O.Params)),this._params=void 0,this._data="",this._hitLimit=!1,c},u}();k.DcsHandler=v},function(j,k,D){"use strict";Object.defineProperty(k,"__esModule",{value:!0}),k.removeTerminalFromCache=k.acquireCharAtlas=void 0;var R=D(26),O=D(43),d=[];k.acquireCharAtlas=function(E,y,v,u,a){for(var c=R.generateConfig(u,a,E,v),s=0;s<d.length;s++){var l=(r=d[s]).ownedBy.indexOf(y);if(l>=0){if(R.configEquals(r.config,c))return r.atlas;r.ownedBy.length===1?(r.atlas.dispose(),d.splice(s,1)):r.ownedBy.splice(l,1);break}}for(s=0;s<d.length;s++){var r=d[s];if(R.configEquals(r.config,c))return r.ownedBy.push(y),r.atlas}var n={atlas:new O.DynamicCharAtlas(document,c),config:c,ownedBy:[y]};return d.push(n),n.atlas},k.removeTerminalFromCache=function(E){for(var y=0;y<d.length;y++){var v=d[y].ownedBy.indexOf(E);if(v!==-1){d[y].ownedBy.length===1?(d[y].atlas.dispose(),d.splice(y,1)):d[y].ownedBy.splice(v,1);break}}}},function(j,k,D){"use strict";Object.defineProperty(k,"__esModule",{value:!0}),k.is256Color=k.configEquals=k.generateConfig=void 0;var R=D(3);k.generateConfig=function(O,d,E,y){var v={foreground:y.foreground,background:y.background,cursor:void 0,cursorAccent:void 0,selection:void 0,ansi:y.ansi.slice(0,16)};return{devicePixelRatio:window.devicePixelRatio,scaledCharWidth:O,scaledCharHeight:d,fontFamily:E.fontFamily,fontSize:E.fontSize,fontWeight:E.fontWeight,fontWeightBold:E.fontWeightBold,allowTransparency:E.allowTransparency,colors:v}},k.configEquals=function(O,d){for(var E=0;E<O.colors.ansi.length;E++)if(O.colors.ansi[E].rgba!==d.colors.ansi[E].rgba)return!1;return O.devicePixelRatio===d.devicePixelRatio&&O.fontFamily===d.fontFamily&&O.fontSize===d.fontSize&&O.fontWeight===d.fontWeight&&O.fontWeightBold===d.fontWeightBold&&O.allowTransparency===d.allowTransparency&&O.scaledCharWidth===d.scaledCharWidth&&O.scaledCharHeight===d.scaledCharHeight&&O.colors.foreground===d.colors.foreground&&O.colors.background===d.colors.background},k.is256Color=function(O){return O<R.DEFAULT_COLOR}},function(j,k,D){"use strict";Object.defineProperty(k,"__esModule",{value:!0}),k.ColorManager=k.DEFAULT_ANSI_COLORS=void 0;var R=D(10),O=D(45),d=R.css.toColor("#ffffff"),E=R.css.toColor("#000000"),y=R.css.toColor("#ffffff"),v=R.css.toColor("#000000"),u={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};k.DEFAULT_ANSI_COLORS=function(){for(var c=[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")],s=[0,95,135,175,215,255],l=0;l<216;l++){var r=s[l/36%6|0],n=s[l/6%6|0],o=s[l%6];c.push({css:R.channels.toCss(r,n,o),rgba:R.channels.toRgba(r,n,o)})}for(l=0;l<24;l++){var i=8+10*l;c.push({css:R.channels.toCss(i,i,i),rgba:R.channels.toRgba(i,i,i)})}return c}();var a=function(){function c(s,l){this.allowTransparency=l;var r=s.createElement("canvas");r.width=1,r.height=1;var n=r.getContext("2d");if(!n)throw new Error("Could not get rendering context");this._ctx=n,this._ctx.globalCompositeOperation="copy",this._litmusColor=this._ctx.createLinearGradient(0,0,1,1),this._contrastCache=new O.ColorContrastCache,this.colors={foreground:d,background:E,cursor:y,cursorAccent:v,selectionTransparent:u,selectionOpaque:R.color.blend(E,u),ansi:k.DEFAULT_ANSI_COLORS.slice(),contrastCache:this._contrastCache}}return c.prototype.onOptionsChange=function(s){s==="minimumContrastRatio"&&this._contrastCache.clear()},c.prototype.setTheme=function(s){(s===void 0&&(s={}),this.colors.foreground=this._parseColor(s.foreground,d),this.colors.background=this._parseColor(s.background,E),this.colors.cursor=this._parseColor(s.cursor,y,!0),this.colors.cursorAccent=this._parseColor(s.cursorAccent,v,!0),this.colors.selectionTransparent=this._parseColor(s.selection,u,!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(s.black,k.DEFAULT_ANSI_COLORS[0]),this.colors.ansi[1]=this._parseColor(s.red,k.DEFAULT_ANSI_COLORS[1]),this.colors.ansi[2]=this._parseColor(s.green,k.DEFAULT_ANSI_COLORS[2]),this.colors.ansi[3]=this._parseColor(s.yellow,k.DEFAULT_ANSI_COLORS[3]),this.colors.ansi[4]=this._parseColor(s.blue,k.DEFAULT_ANSI_COLORS[4]),this.colors.ansi[5]=this._parseColor(s.magenta,k.DEFAULT_ANSI_COLORS[5]),this.colors.ansi[6]=this._parseColor(s.cyan,k.DEFAULT_ANSI_COLORS[6]),this.colors.ansi[7]=this._parseColor(s.white,k.DEFAULT_ANSI_COLORS[7]),this.colors.ansi[8]=this._parseColor(s.brightBlack,k.DEFAULT_ANSI_COLORS[8]),this.colors.ansi[9]=this._parseColor(s.brightRed,k.DEFAULT_ANSI_COLORS[9]),this.colors.ansi[10]=this._parseColor(s.brightGreen,k.DEFAULT_ANSI_COLORS[10]),this.colors.ansi[11]=this._parseColor(s.brightYellow,k.DEFAULT_ANSI_COLORS[11]),this.colors.ansi[12]=this._parseColor(s.brightBlue,k.DEFAULT_ANSI_COLORS[12]),this.colors.ansi[13]=this._parseColor(s.brightMagenta,k.DEFAULT_ANSI_COLORS[13]),this.colors.ansi[14]=this._parseColor(s.brightCyan,k.DEFAULT_ANSI_COLORS[14]),this.colors.ansi[15]=this._parseColor(s.brightWhite,k.DEFAULT_ANSI_COLORS[15]),this._contrastCache.clear()},c.prototype._parseColor=function(s,l,r){if(r===void 0&&(r=this.allowTransparency),s===void 0)return l;if(this._ctx.fillStyle=this._litmusColor,this._ctx.fillStyle=s,typeof this._ctx.fillStyle!="string")return console.warn("Color: "+s+" is invalid using fallback "+l.css),l;this._ctx.fillRect(0,0,1,1);var n=this._ctx.getImageData(0,0,1,1).data;if(n[3]!==255){if(!r)return console.warn("Color: "+s+" is using transparency, but allowTransparency is false. Using fallback "+l.css+"."),l;var o=this._ctx.fillStyle.substring(5,this._ctx.fillStyle.length-1).split(",").map(function(w){return Number(w)}),i=o[0],f=o[1],h=o[2],T=o[3],g=Math.round(255*T);return{rgba:R.channels.toRgba(i,f,h,g),css:s}}return{css:this._ctx.fillStyle,rgba:R.channels.toRgba(n[0],n[1],n[2],n[3])}},c}();k.ColorManager=a},function(j,k,D){"use strict";Object.defineProperty(k,"__esModule",{value:!0}),k.throwIfFalsy=void 0,k.throwIfFalsy=function(R){if(!R)throw new Error("value must not be falsy");return R}},function(j,k,D){"use strict";var R,O=this&&this.__extends||(R=function(a,c){return(R=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(s,l){s.__proto__=l}||function(s,l){for(var r in l)l.hasOwnProperty(r)&&(s[r]=l[r])})(a,c)},function(a,c){function s(){this.constructor=a}R(a,c),a.prototype=c===null?Object.create(c):(s.prototype=c.prototype,new s)});Object.defineProperty(k,"__esModule",{value:!0}),k.CharacterJoinerRegistry=k.JoinedCellData=void 0;var d=D(6),E=D(3),y=D(4),v=function(a){function c(s,l,r){var n=a.call(this)||this;return n.content=0,n.combinedData="",n.fg=s.fg,n.bg=s.bg,n.combinedData=l,n._width=r,n}return O(c,a),c.prototype.isCombined=function(){return 2097152},c.prototype.getWidth=function(){return this._width},c.prototype.getChars=function(){return this.combinedData},c.prototype.getCode=function(){return 2097151},c.prototype.setFromCharData=function(s){throw new Error("not implemented")},c.prototype.getAsCharData=function(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]},c}(d.AttributeData);k.JoinedCellData=v;var u=function(){function a(c){this._bufferService=c,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new y.CellData}return a.prototype.registerCharacterJoiner=function(c){var s={id:this._nextCharacterJoinerId++,handler:c};return this._characterJoiners.push(s),s.id},a.prototype.deregisterCharacterJoiner=function(c){for(var s=0;s<this._characterJoiners.length;s++)if(this._characterJoiners[s].id===c)return this._characterJoiners.splice(s,1),!0;return!1},a.prototype.getJoinedCharacters=function(c){if(this._characterJoiners.length===0)return[];var s=this._bufferService.buffer.lines.get(c);if(!s||s.length===0)return[];for(var l=[],r=s.translateToString(!0),n=0,o=0,i=0,f=s.getFg(0),h=s.getBg(0),T=0;T<s.getTrimmedLength();T++)if(s.loadCell(T,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==f||this._workCell.bg!==h){if(T-n>1)for(var g=this._getJoinedRanges(r,i,o,s,n),w=0;w<g.length;w++)l.push(g[w]);n=T,i=o,f=this._workCell.fg,h=this._workCell.bg}o+=this._workCell.getChars().length||E.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-n>1)for(g=this._getJoinedRanges(r,i,o,s,n),w=0;w<g.length;w++)l.push(g[w]);return l},a.prototype._getJoinedRanges=function(c,s,l,r,n){for(var o=c.substring(s,l),i=this._characterJoiners[0].handler(o),f=1;f<this._characterJoiners.length;f++)for(var h=this._characterJoiners[f].handler(o),T=0;T<h.length;T++)a._mergeRanges(i,h[T]);return this._stringRangesToCellRanges(i,r,n),i},a.prototype._stringRangesToCellRanges=function(c,s,l){var r=0,n=!1,o=0,i=c[r];if(i){for(var f=l;f<this._bufferService.cols;f++){var h=s.getWidth(f),T=s.getString(f).length||E.WHITESPACE_CELL_CHAR.length;if(h!==0){if(!n&&i[0]<=o&&(i[0]=f,n=!0),i[1]<=o){if(i[1]=f,!(i=c[++r]))break;i[0]<=o?(i[0]=f,n=!0):n=!1}o+=T}}i&&(i[1]=this._bufferService.cols)}},a._mergeRanges=function(c,s){for(var l=!1,r=0;r<c.length;r++){var n=c[r];if(l){if(s[1]<=n[0])return c[r-1][1]=s[1],c;if(s[1]<=n[1])return c[r-1][1]=Math.max(s[1],n[1]),c.splice(r,1),c;c.splice(r,1),r--}else{if(s[1]<=n[0])return c.splice(r,0,s),c;if(s[1]<=n[1])return n[0]=Math.min(s[0],n[0]),c;s[0]<n[1]&&(n[0]=Math.min(s[0],n[0]),l=!0)}}return l?c[c.length-1][1]=s[1]:c.push(s),c},a}();k.CharacterJoinerRegistry=u},function(j,k,D){"use strict";function R(O,d){var E=d.getBoundingClientRect();return[O.clientX-E.left,O.clientY-E.top]}Object.defineProperty(k,"__esModule",{value:!0}),k.getRawByteCoords=k.getCoords=k.getCoordsRelativeToElement=void 0,k.getCoordsRelativeToElement=R,k.getCoords=function(O,d,E,y,v,u,a,c){if(v){var s=R(O,d);if(s)return s[0]=Math.ceil((s[0]+(c?u/2:0))/u),s[1]=Math.ceil(s[1]/a),s[0]=Math.min(Math.max(s[0],1),E+(c?1:0)),s[1]=Math.min(Math.max(s[1],1),y),s}},k.getRawByteCoords=function(O){if(O)return{x:O[0]+32,y:O[1]+32}}},function(j,k,D){"use strict";Object.defineProperty(k,"__esModule",{value:!0}),k.RenderDebouncer=void 0;var R=function(){function O(d){this._renderCallback=d}return O.prototype.dispose=function(){this._animationFrame&&(window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)},O.prototype.refresh=function(d,E,y){var v=this;this._rowCount=y,d=d!==void 0?d:0,E=E!==void 0?E:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,d):d,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,E):E,this._animationFrame||(this._animationFrame=window.requestAnimationFrame(function(){return v._innerRefresh()}))},O.prototype._innerRefresh=function(){if(this._rowStart!==void 0&&this._rowEnd!==void 0&&this._rowCount!==void 0){var d=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(d,E)}},O}();k.RenderDebouncer=R},function(j,k,D){"use strict";var R,O=this&&this.__extends||(R=function(E,y){return(R=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(v,u){v.__proto__=u}||function(v,u){for(var a in u)u.hasOwnProperty(a)&&(v[a]=u[a])})(E,y)},function(E,y){function v(){this.constructor=E}R(E,y),E.prototype=y===null?Object.create(y):(v.prototype=y.prototype,new v)});Object.defineProperty(k,"__esModule",{value:!0}),k.ScreenDprMonitor=void 0;var d=function(E){function y(){var v=E!==null&&E.apply(this,arguments)||this;return v._currentDevicePixelRatio=window.devicePixelRatio,v}return O(y,E),y.prototype.setListener=function(v){var u=this;this._listener&&this.clearListener(),this._listener=v,this._outerListener=function(){u._listener&&(u._listener(window.devicePixelRatio,u._currentDevicePixelRatio),u._updateDpr())},this._updateDpr()},y.prototype.dispose=function(){E.prototype.dispose.call(this),this.clearListener()},y.prototype._updateDpr=function(){var v;this._outerListener&&((v=this._resolutionMediaMatchList)===null||v===void 0||v.removeListener(this._outerListener),this._currentDevicePixelRatio=window.devicePixelRatio,this._resolutionMediaMatchList=window.matchMedia("screen and (resolution: "+window.devicePixelRatio+"dppx)"),this._resolutionMediaMatchList.addListener(this._outerListener))},y.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)},y}(D(2).Disposable);k.ScreenDprMonitor=d},function(j,k,D){"use strict";Object.defineProperty(k,"__esModule",{value:!0}),k.clone=void 0,k.clone=function R(O,d){if(d===void 0&&(d=5),typeof O!="object")return O;var E=Array.isArray(O)?[]:{};for(var y in O)E[y]=d<=1?O[y]:O[y]?R(O[y],d-1):O[y];return E}},function(j,k,D){"use strict";Object.defineProperty(k,"__esModule",{value:!0}),k.Terminal=void 0;var R=D(4),O=D(35),d=D(18),E=D(0),y=D(83),v=function(){function r(n){this._core=new O.Terminal(n),this._addonManager=new y.AddonManager}return r.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(r.prototype,"onCursorMove",{get:function(){return this._core.onCursorMove},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"onLineFeed",{get:function(){return this._core.onLineFeed},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"onSelectionChange",{get:function(){return this._core.onSelectionChange},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"onData",{get:function(){return this._core.onData},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"onBinary",{get:function(){return this._core.onBinary},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"onTitleChange",{get:function(){return this._core.onTitleChange},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"onScroll",{get:function(){return this._core.onScroll},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"onKey",{get:function(){return this._core.onKey},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"onRender",{get:function(){return this._core.onRender},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"onResize",{get:function(){return this._core.onResize},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"element",{get:function(){return this._core.element},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"parser",{get:function(){return this._checkProposedApi(),this._parser||(this._parser=new s(this._core)),this._parser},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"unicode",{get:function(){return this._checkProposedApi(),new l(this._core)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"textarea",{get:function(){return this._core.textarea},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"rows",{get:function(){return this._core.rows},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"cols",{get:function(){return this._core.cols},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"buffer",{get:function(){return this._checkProposedApi(),new a(this._core.buffers)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"markers",{get:function(){return this._checkProposedApi(),this._core.markers},enumerable:!1,configurable:!0}),r.prototype.blur=function(){this._core.blur()},r.prototype.focus=function(){this._core.focus()},r.prototype.resize=function(n,o){this._verifyIntegers(n,o),this._core.resize(n,o)},r.prototype.open=function(n){this._core.open(n)},r.prototype.attachCustomKeyEventHandler=function(n){this._core.attachCustomKeyEventHandler(n)},r.prototype.registerLinkMatcher=function(n,o,i){return this._checkProposedApi(),this._core.registerLinkMatcher(n,o,i)},r.prototype.deregisterLinkMatcher=function(n){this._checkProposedApi(),this._core.deregisterLinkMatcher(n)},r.prototype.registerLinkProvider=function(n){return this._checkProposedApi(),this._core.registerLinkProvider(n)},r.prototype.registerCharacterJoiner=function(n){return this._checkProposedApi(),this._core.registerCharacterJoiner(n)},r.prototype.deregisterCharacterJoiner=function(n){this._checkProposedApi(),this._core.deregisterCharacterJoiner(n)},r.prototype.registerMarker=function(n){return this._checkProposedApi(),this._verifyIntegers(n),this._core.addMarker(n)},r.prototype.addMarker=function(n){return this.registerMarker(n)},r.prototype.hasSelection=function(){return this._core.hasSelection()},r.prototype.select=function(n,o,i){this._verifyIntegers(n,o,i),this._core.select(n,o,i)},r.prototype.getSelection=function(){return this._core.getSelection()},r.prototype.getSelectionPosition=function(){return this._core.getSelectionPosition()},r.prototype.clearSelection=function(){this._core.clearSelection()},r.prototype.selectAll=function(){this._core.selectAll()},r.prototype.selectLines=function(n,o){this._verifyIntegers(n,o),this._core.selectLines(n,o)},r.prototype.dispose=function(){this._addonManager.dispose(),this._core.dispose()},r.prototype.scrollLines=function(n){this._verifyIntegers(n),this._core.scrollLines(n)},r.prototype.scrollPages=function(n){this._verifyIntegers(n),this._core.scrollPages(n)},r.prototype.scrollToTop=function(){this._core.scrollToTop()},r.prototype.scrollToBottom=function(){this._core.scrollToBottom()},r.prototype.scrollToLine=function(n){this._verifyIntegers(n),this._core.scrollToLine(n)},r.prototype.clear=function(){this._core.clear()},r.prototype.write=function(n,o){this._core.write(n,o)},r.prototype.writeUtf8=function(n,o){this._core.write(n,o)},r.prototype.writeln=function(n,o){this._core.write(n),this._core.write(`\r
|
|
|
`,o)},r.prototype.paste=function(n){this._core.paste(n)},r.prototype.getOption=function(n){return this._core.optionsService.getOption(n)},r.prototype.setOption=function(n,o){this._core.optionsService.setOption(n,o)},r.prototype.refresh=function(n,o){this._verifyIntegers(n,o),this._core.refresh(n,o)},r.prototype.reset=function(){this._core.reset()},r.prototype.loadAddon=function(n){return this._addonManager.loadAddon(this,n)},Object.defineProperty(r,"strings",{get:function(){return d},enumerable:!1,configurable:!0}),r.prototype._verifyIntegers=function(){for(var n=[],o=0;o<arguments.length;o++)n[o]=arguments[o];for(var i=0,f=n;i<f.length;i++){var h=f[i];if(h===1/0||isNaN(h)||h%1!=0)throw new Error("This API only accepts integers")}},r}();k.Terminal=v;var u=function(){function r(n,o){this._buffer=n,this.type=o}return r.prototype.init=function(n){return this._buffer=n,this},Object.defineProperty(r.prototype,"cursorY",{get:function(){return this._buffer.y},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"cursorX",{get:function(){return this._buffer.x},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"viewportY",{get:function(){return this._buffer.ydisp},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"baseY",{get:function(){return this._buffer.ybase},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"length",{get:function(){return this._buffer.lines.length},enumerable:!1,configurable:!0}),r.prototype.getLine=function(n){var o=this._buffer.lines.get(n);if(o)return new c(o)},r.prototype.getNullCell=function(){return new R.CellData},r}(),a=function(){function r(n){var o=this;this._buffers=n,this._onBufferChange=new E.EventEmitter,this._normal=new u(this._buffers.normal,"normal"),this._alternate=new u(this._buffers.alt,"alternate"),this._buffers.onBufferActivate(function(){return o._onBufferChange.fire(o.active)})}return Object.defineProperty(r.prototype,"onBufferChange",{get:function(){return this._onBufferChange.event},enumerable:!1,configurable:!0}),Object.defineProperty(r.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(r.prototype,"normal",{get:function(){return this._normal.init(this._buffers.normal)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"alternate",{get:function(){return this._alternate.init(this._buffers.alt)},enumerable:!1,configurable:!0}),r}(),c=function(){function r(n){this._line=n}return Object.defineProperty(r.prototype,"isWrapped",{get:function(){return this._line.isWrapped},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"length",{get:function(){return this._line.length},enumerable:!1,configurable:!0}),r.prototype.getCell=function(n,o){if(!(n<0||n>=this._line.length))return o?(this._line.loadCell(n,o),o):this._line.loadCell(n,new R.CellData)},r.prototype.translateToString=function(n,o,i){return this._line.translateToString(n,o,i)},r}(),s=function(){function r(n){this._core=n}return r.prototype.registerCsiHandler=function(n,o){return this._core.addCsiHandler(n,function(i){return o(i.toArray())})},r.prototype.addCsiHandler=function(n,o){return this.registerCsiHandler(n,o)},r.prototype.registerDcsHandler=function(n,o){return this._core.addDcsHandler(n,function(i,f){return o(i,f.toArray())})},r.prototype.addDcsHandler=function(n,o){return this.registerDcsHandler(n,o)},r.prototype.registerEscHandler=function(n,o){return this._core.addEscHandler(n,o)},r.prototype.addEscHandler=function(n,o){return this.registerEscHandler(n,o)},r.prototype.registerOscHandler=function(n,o){return this._core.addOscHandler(n,o)},r.prototype.addOscHandler=function(n,o){return this.registerOscHandler(n,o)},r}(),l=function(){function r(n){this._core=n}return r.prototype.register=function(n){this._core.unicodeService.register(n)},Object.defineProperty(r.prototype,"versions",{get:function(){return this._core.unicodeService.versions},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"activeVersion",{get:function(){return this._core.unicodeService.activeVersion},set:function(n){this._core.unicodeService.activeVersion=n},enumerable:!1,configurable:!0}),r}()},function(j,k,D){"use strict";var R,O=this&&this.__extends||(R=function(H,F){return(R=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(W,U){W.__proto__=U}||function(W,U){for(var K in U)U.hasOwnProperty(K)&&(W[K]=U[K])})(H,F)},function(H,F){function W(){this.constructor=H}R(H,F),H.prototype=F===null?Object.create(F):(W.prototype=F.prototype,new W)});Object.defineProperty(k,"__esModule",{value:!0}),k.Terminal=void 0;var d=D(36),E=D(37),y=D(38),v=D(12),u=D(19),a=D(40),c=D(50),s=D(51),l=D(11),r=D(7),n=D(18),o=D(54),i=D(55),f=D(56),h=D(57),T=D(59),g=D(0),w=D(16),C=D(27),x=D(60),b=D(5),S=D(61),A=D(62),p=D(63),I=D(64),M=D(65),P=typeof window!="undefined"?window.document:null,B=function(H){function F(W){W===void 0&&(W={});var U=H.call(this,W)||this;return U.browser=l,U._keyDownHandled=!1,U._onCursorMove=new g.EventEmitter,U._onKey=new g.EventEmitter,U._onRender=new g.EventEmitter,U._onSelectionChange=new g.EventEmitter,U._onTitleChange=new g.EventEmitter,U._onFocus=new g.EventEmitter,U._onBlur=new g.EventEmitter,U._onA11yCharEmitter=new g.EventEmitter,U._onA11yTabEmitter=new g.EventEmitter,U._setup(),U.linkifier=U._instantiationService.createInstance(c.Linkifier),U.linkifier2=U.register(U._instantiationService.createInstance(p.Linkifier2)),U.register(U._inputHandler.onRequestBell(function(){return U.bell()})),U.register(U._inputHandler.onRequestRefreshRows(function(K,G){return U.refresh(K,G)})),U.register(U._inputHandler.onRequestReset(function(){return U.reset()})),U.register(U._inputHandler.onRequestScroll(function(K,G){return U.scroll(K,G||void 0)})),U.register(U._inputHandler.onRequestWindowsOptionsReport(function(K){return U._reportWindowsOptions(K)})),U.register(g.forwardEvent(U._inputHandler.onCursorMove,U._onCursorMove)),U.register(g.forwardEvent(U._inputHandler.onTitleChange,U._onTitleChange)),U.register(g.forwardEvent(U._inputHandler.onA11yChar,U._onA11yCharEmitter)),U.register(g.forwardEvent(U._inputHandler.onA11yTab,U._onA11yTabEmitter)),U.register(U._bufferService.onResize(function(K){return U._afterResize(K.cols,K.rows)})),U}return O(F,H),Object.defineProperty(F.prototype,"options",{get:function(){return this.optionsService.options},enumerable:!1,configurable:!0}),Object.defineProperty(F.prototype,"onCursorMove",{get:function(){return this._onCursorMove.event},enumerable:!1,configurable:!0}),Object.defineProperty(F.prototype,"onKey",{get:function(){return this._onKey.event},enumerable:!1,configurable:!0}),Object.defineProperty(F.prototype,"onRender",{get:function(){return this._onRender.event},enumerable:!1,configurable:!0}),Object.defineProperty(F.prototype,"onSelectionChange",{get:function(){return this._onSelectionChange.event},enumerable:!1,configurable:!0}),Object.defineProperty(F.prototype,"onTitleChange",{get:function(){return this._onTitleChange.event},enumerable:!1,configurable:!0}),Object.defineProperty(F.prototype,"onFocus",{get:function(){return this._onFocus.event},enumerable:!1,configurable:!0}),Object.defineProperty(F.prototype,"onBlur",{get:function(){return this._onBlur.event},enumerable:!1,configurable:!0}),Object.defineProperty(F.prototype,"onA11yChar",{get:function(){return this._onA11yCharEmitter.event},enumerable:!1,configurable:!0}),Object.defineProperty(F.prototype,"onA11yTab",{get:function(){return this._onA11yTabEmitter.event},enumerable:!1,configurable:!0}),F.prototype.dispose=function(){var W,U,K;this._isDisposed||(H.prototype.dispose.call(this),(W=this._renderService)===null||W===void 0||W.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))},F.prototype._setup=function(){H.prototype._setup.call(this),this._customKeyEventHandler=void 0},Object.defineProperty(F.prototype,"buffer",{get:function(){return this.buffers.active},enumerable:!1,configurable:!0}),F.prototype.focus=function(){this.textarea&&this.textarea.focus({preventScroll:!0})},F.prototype._updateOptions=function(W){var U,K,G,ae;switch(H.prototype._updateOptions.call(this,W),W){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":(G=this.viewport)===null||G===void 0||G.syncScrollArea();break;case"screenReaderMode":this.optionsService.options.screenReaderMode?!this._accessibilityManager&&this._renderService&&(this._accessibilityManager=new f.AccessibilityManager(this,this._renderService)):((ae=this._accessibilityManager)===null||ae===void 0||ae.dispose(),this._accessibilityManager=void 0);break;case"tabStopWidth":this.buffers.setupTabStops();break;case"theme":this._setTheme(this.optionsService.options.theme)}},F.prototype._onTextAreaFocus=function(W){this._coreService.decPrivateModes.sendFocus&&this._coreService.triggerDataEvent(v.C0.ESC+"[I"),this.updateCursorStyle(W),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()},F.prototype.blur=function(){var W;return(W=this.textarea)===null||W===void 0?void 0:W.blur()},F.prototype._onTextAreaBlur=function(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this._coreService.decPrivateModes.sendFocus&&this._coreService.triggerDataEvent(v.C0.ESC+"[O"),this.element.classList.remove("focus"),this._onBlur.fire()},F.prototype._syncTextArea=function(){if(this.textarea&&this.buffer.isCursorInViewport&&!this._compositionHelper.isComposing){var W=Math.ceil(this._charSizeService.height*this.optionsService.options.lineHeight),U=this._bufferService.buffer.y*W,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=W+"px",this.textarea.style.lineHeight=W+"px",this.textarea.style.zIndex="-5"}},F.prototype._initGlobal=function(){var W=this;this._bindKeys(),this.register(r.addDisposableDomListener(this.element,"copy",function(K){W.hasSelection()&&y.copyHandler(K,W._selectionService)}));var U=function(K){return y.handlePasteEvent(K,W.textarea,W._coreService)};this.register(r.addDisposableDomListener(this.textarea,"paste",U)),this.register(r.addDisposableDomListener(this.element,"paste",U)),l.isFirefox?this.register(r.addDisposableDomListener(this.element,"mousedown",function(K){K.button===2&&y.rightClickHandler(K,W.textarea,W.screenElement,W._selectionService,W.options.rightClickSelectsWord)})):this.register(r.addDisposableDomListener(this.element,"contextmenu",function(K){y.rightClickHandler(K,W.textarea,W.screenElement,W._selectionService,W.options.rightClickSelectsWord)})),l.isLinux&&this.register(r.addDisposableDomListener(this.element,"auxclick",function(K){K.button===1&&y.moveTextAreaUnderMouseCursor(K,W.textarea,W.screenElement)}))},F.prototype._bindKeys=function(){var W=this;this.register(r.addDisposableDomListener(this.textarea,"keyup",function(U){return W._keyUp(U)},!0)),this.register(r.addDisposableDomListener(this.textarea,"keydown",function(U){return W._keyDown(U)},!0)),this.register(r.addDisposableDomListener(this.textarea,"keypress",function(U){return W._keyPress(U)},!0)),this.register(r.addDisposableDomListener(this.textarea,"compositionstart",function(){return W._compositionHelper.compositionstart()})),this.register(r.addDisposableDomListener(this.textarea,"compositionupdate",function(U){return W._compositionHelper.compositionupdate(U)})),this.register(r.addDisposableDomListener(this.textarea,"compositionend",function(){return W._compositionHelper.compositionend()})),this.register(this.onRender(function(){return W._compositionHelper.updateCompositionElements()})),this.register(this.onRender(function(U){return W._queueLinkification(U.start,U.end)}))},F.prototype.open=function(W){var U=this;if(!W)throw new Error("Terminal requires a parent element.");P.body.contains(W)||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),this._document=W.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"),W.appendChild(this.element);var K=P.createDocumentFragment();this._viewportElement=P.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),K.appendChild(this._viewportElement),this._viewportScrollArea=P.createElement("div"),this._viewportScrollArea.classList.add("xterm-scroll-area"),this._viewportElement.appendChild(this._viewportScrollArea),this.screenElement=P.createElement("div"),this.screenElement.classList.add("xterm-screen"),this._helperContainer=P.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),K.appendChild(this.screenElement),this.textarea=P.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",n.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(r.addDisposableDomListener(this.textarea,"focus",function(fe){return U._onTextAreaFocus(fe)})),this.register(r.addDisposableDomListener(this.textarea,"blur",function(){return U._onTextAreaBlur()})),this._helperContainer.appendChild(this.textarea);var G=this._instantiationService.createInstance(I.CoreBrowserService,this.textarea);this._instantiationService.setService(b.ICoreBrowserService,G),this._charSizeService=this._instantiationService.createInstance(S.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(b.ICharSizeService,this._charSizeService),this._compositionView=P.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(d.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(P,this.options.allowTransparency),this.register(this.optionsService.onOptionChange(function(fe){return U._colorManager.onOptionsChange(fe)})),this._colorManager.setTheme(this._theme);var ae=this._createRenderer();this._renderService=this.register(this._instantiationService.createInstance(x.RenderService,ae,this.rows,this.screenElement)),this._instantiationService.setService(b.IRenderService,this._renderService),this.register(this._renderService.onRenderedBufferChange(function(fe){return U._onRender.fire(fe)})),this.onResize(function(fe){return U._renderService.resize(fe.cols,fe.rows)}),this._soundService=this._instantiationService.createInstance(o.SoundService),this._instantiationService.setService(b.ISoundService,this._soundService),this._mouseService=this._instantiationService.createInstance(A.MouseService),this._instantiationService.setService(b.IMouseService,this._mouseService),this.viewport=this._instantiationService.createInstance(E.Viewport,function(fe,Se){return U.scrollLines(fe,Se)},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(s.SelectionService,this.element,this.screenElement)),this._instantiationService.setService(b.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines(function(fe){return U.scrollLines(fe.amount,fe.suppressScrollEvent)})),this.register(this._selectionService.onSelectionChange(function(){return U._onSelectionChange.fire()})),this.register(this._selectionService.onRequestRedraw(function(fe){return U._renderService.onSelectionChanged(fe.start,fe.end,fe.columnSelectMode)})),this.register(this._selectionService.onLinuxMouseSelection(function(fe){U.textarea.value=fe,U.textarea.focus(),U.textarea.select()})),this.register(this.onScroll(function(){U.viewport.syncScrollArea(),U._selectionService.refresh()})),this.register(r.addDisposableDomListener(this._viewportElement,"scroll",function(){return U._selectionService.refresh()})),this._mouseZoneManager=this._instantiationService.createInstance(i.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(r.addDisposableDomListener(this.element,"mousedown",function(fe){return U._selectionService.onMouseDown(fe)})),this._coreMouseService.areMouseEventsActive?(this._selectionService.disable(),this.element.classList.add("enable-mouse-events")):this._selectionService.enable(),this.options.screenReaderMode&&(this._accessibilityManager=new f.AccessibilityManager(this,this._renderService)),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()},F.prototype._createRenderer=function(){switch(this.options.rendererType){case"canvas":return this._instantiationService.createInstance(a.Renderer,this._colorManager.colors,this.screenElement,this.linkifier,this.linkifier2);case"dom":return this._instantiationService.createInstance(h.DomRenderer,this._colorManager.colors,this.element,this.screenElement,this._viewportElement,this.linkifier,this.linkifier2);default:throw new Error('Unrecognized rendererType "'+this.options.rendererType+'"')}},F.prototype._setTheme=function(W){var U,K,G;this._theme=W,(U=this._colorManager)===null||U===void 0||U.setTheme(W),(K=this._renderService)===null||K===void 0||K.setColors(this._colorManager.colors),(G=this.viewport)===null||G===void 0||G.onThemeChange(this._colorManager.colors)},F.prototype.bindMouse=function(){var W=this,U=this,K=this.element;function G(xe){var Ce,De,ve=U._mouseService.getRawByteCoords(xe,U.screenElement,U.cols,U.rows);if(!ve)return!1;switch(xe.overrideType||xe.type){case"mousemove":De=32,xe.buttons===void 0?(Ce=3,xe.button!==void 0&&(Ce=xe.button<3?xe.button:3)):Ce=1&xe.buttons?0:4&xe.buttons?1:2&xe.buttons?2:3;break;case"mouseup":De=0,Ce=xe.button<3?xe.button:3;break;case"mousedown":De=1,Ce=xe.button<3?xe.button:3;break;case"wheel":xe.deltaY!==0&&(De=xe.deltaY<0?0:1),Ce=4;break;default:return!1}return!(De===void 0||Ce===void 0||Ce>4)&&U._coreMouseService.triggerMouseEvent({col:ve.x-33,row:ve.y-33,button:Ce,action:De,ctrl:xe.ctrlKey,alt:xe.altKey,shift:xe.shiftKey})}var ae={mouseup:null,wheel:null,mousedrag:null,mousemove:null},fe=function(xe){return G(xe),xe.buttons||(W._document.removeEventListener("mouseup",ae.mouseup),ae.mousedrag&&W._document.removeEventListener("mousemove",ae.mousedrag)),W.cancel(xe)},Se=function(xe){return G(xe),xe.preventDefault(),W.cancel(xe)},Ue=function(xe){xe.buttons&&G(xe)},Ne=function(xe){xe.buttons||G(xe)};this.register(this._coreMouseService.onProtocolChange(function(xe){xe?(W.optionsService.options.logLevel==="debug"&&W._logService.debug("Binding to mouse events:",W._coreMouseService.explainEvents(xe)),W.element.classList.add("enable-mouse-events"),W._selectionService.disable()):(W._logService.debug("Unbinding from mouse events."),W.element.classList.remove("enable-mouse-events"),W._selectionService.enable()),8&xe?ae.mousemove||(K.addEventListener("mousemove",Ne),ae.mousemove=Ne):(K.removeEventListener("mousemove",ae.mousemove),ae.mousemove=null),16&xe?ae.wheel||(K.addEventListener("wheel",Se,{passive:!1}),ae.wheel=Se):(K.removeEventListener("wheel",ae.wheel),ae.wheel=null),2&xe?ae.mouseup||(ae.mouseup=fe):(W._document.removeEventListener("mouseup",ae.mouseup),ae.mouseup=null),4&xe?ae.mousedrag||(ae.mousedrag=Ue):(W._document.removeEventListener("mousemove",ae.mousedrag),ae.mousedrag=null)})),this._coreMouseService.activeProtocol=this._coreMouseService.activeProtocol,this.register(r.addDisposableDomListener(K,"mousedown",function(xe){if(xe.preventDefault(),W.focus(),W._coreMouseService.areMouseEventsActive&&!W._selectionService.shouldForceSelection(xe))return G(xe),ae.mouseup&&W._document.addEventListener("mouseup",ae.mouseup),ae.mousedrag&&W._document.addEventListener("mousemove",ae.mousedrag),W.cancel(xe)})),this.register(r.addDisposableDomListener(K,"wheel",function(xe){if(!ae.wheel){if(!W.buffer.hasScrollback){var Ce=W.viewport.getLinesScrolled(xe);if(Ce===0)return;for(var De=v.C0.ESC+(W._coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(xe.deltaY<0?"A":"B"),ve="",Re=0;Re<Math.abs(Ce);Re++)ve+=De;W._coreService.triggerDataEvent(ve,!0)}}},{passive:!0})),this.register(r.addDisposableDomListener(K,"wheel",function(xe){if(!ae.wheel)return W.viewport.onWheel(xe)?void 0:W.cancel(xe)},{passive:!1})),this.register(r.addDisposableDomListener(K,"touchstart",function(xe){if(!W._coreMouseService.areMouseEventsActive)return W.viewport.onTouchStart(xe),W.cancel(xe)},{passive:!0})),this.register(r.addDisposableDomListener(K,"touchmove",function(xe){if(!W._coreMouseService.areMouseEventsActive)return W.viewport.onTouchMove(xe)?void 0:W.cancel(xe)},{passive:!1}))},F.prototype.refresh=function(W,U){var K;(K=this._renderService)===null||K===void 0||K.refreshRows(W,U)},F.prototype._queueLinkification=function(W,U){var K;(K=this.linkifier)===null||K===void 0||K.linkifyRows(W,U)},F.prototype.updateCursorStyle=function(W){this._selectionService&&this._selectionService.shouldColumnSelect(W)?this.element.classList.add("column-select"):this.element.classList.remove("column-select")},F.prototype._showCursor=function(){this._coreService.isCursorInitialized||(this._coreService.isCursorInitialized=!0,this.refresh(this.buffer.y,this.buffer.y))},F.prototype.scrollLines=function(W,U){H.prototype.scrollLines.call(this,W,U),this.refresh(0,this.rows-1)},F.prototype.paste=function(W){y.paste(W,this.textarea,this._coreService)},F.prototype.attachCustomKeyEventHandler=function(W){this._customKeyEventHandler=W},F.prototype.registerLinkMatcher=function(W,U,K){var G=this.linkifier.registerLinkMatcher(W,U,K);return this.refresh(0,this.rows-1),G},F.prototype.deregisterLinkMatcher=function(W){this.linkifier.deregisterLinkMatcher(W)&&this.refresh(0,this.rows-1)},F.prototype.registerLinkProvider=function(W){return this.linkifier2.registerLinkProvider(W)},F.prototype.registerCharacterJoiner=function(W){var U=this._renderService.registerCharacterJoiner(W);return this.refresh(0,this.rows-1),U},F.prototype.deregisterCharacterJoiner=function(W){this._renderService.deregisterCharacterJoiner(W)&&this.refresh(0,this.rows-1)},Object.defineProperty(F.prototype,"markers",{get:function(){return this.buffer.markers},enumerable:!1,configurable:!0}),F.prototype.addMarker=function(W){if(this.buffer===this.buffers.normal)return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+W)},F.prototype.hasSelection=function(){return!!this._selectionService&&this._selectionService.hasSelection},F.prototype.select=function(W,U,K){this._selectionService.setSelection(W,U,K)},F.prototype.getSelection=function(){return this._selectionService?this._selectionService.selectionText:""},F.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]}},F.prototype.clearSelection=function(){var W;(W=this._selectionService)===null||W===void 0||W.clearSelection()},F.prototype.selectAll=function(){var W;(W=this._selectionService)===null||W===void 0||W.selectAll()},F.prototype.selectLines=function(W,U){var K;(K=this._selectionService)===null||K===void 0||K.selectLines(W,U)},F.prototype._keyDown=function(W){if(this._keyDownHandled=!1,this._customKeyEventHandler&&this._customKeyEventHandler(W)===!1)return!1;if(!this._compositionHelper.keydown(W))return this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;var U=T.evaluateKeyboardEvent(W,this._coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(W),U.type===3||U.type===2){var K=this.rows-1;return this.scrollLines(U.type===2?-K:K),this.cancel(W,!0)}return U.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,W)||(U.cancel&&this.cancel(W,!0),!U.key||(U.key!==v.C0.ETX&&U.key!==v.C0.CR||(this.textarea.value=""),this._onKey.fire({key:U.key,domEvent:W}),this._showCursor(),this._coreService.triggerDataEvent(U.key,!0),this.optionsService.options.screenReaderMode?void(this._keyDownHandled=!0):this.cancel(W,!0)))},F.prototype._isThirdLevelShift=function(W,U){var K=W.isMac&&!this.options.macOptionIsMeta&&U.altKey&&!U.ctrlKey&&!U.metaKey||W.isWindows&&U.altKey&&U.ctrlKey&&!U.metaKey;return U.type==="keypress"?K:K&&(!U.keyCode||U.keyCode>47)},F.prototype._keyUp=function(W){this._customKeyEventHandler&&this._customKeyEventHandler(W)===!1||(function(U){return U.keyCode===16||U.keyCode===17||U.keyCode===18}(W)||this.focus(),this.updateCursorStyle(W))},F.prototype._keyPress=function(W){var U;if(this._keyDownHandled)return!1;if(this._customKeyEventHandler&&this._customKeyEventHandler(W)===!1)return!1;if(this.cancel(W),W.charCode)U=W.charCode;else if(W.which===null||W.which===void 0)U=W.keyCode;else{if(W.which===0||W.charCode===0)return!1;U=W.which}return!(!U||(W.altKey||W.ctrlKey||W.metaKey)&&!this._isThirdLevelShift(this.browser,W))&&(U=String.fromCharCode(U),this._onKey.fire({key:U,domEvent:W}),this._showCursor(),this._coreService.triggerDataEvent(U,!0),!0)},F.prototype.bell=function(){this._soundBell()&&this._soundService.playBellSound()},F.prototype.resize=function(W,U){W!==this.cols||U!==this.rows?H.prototype.resize.call(this,W,U):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()},F.prototype._afterResize=function(W,U){var K,G;(K=this._charSizeService)===null||K===void 0||K.measure(),(G=this.viewport)===null||G===void 0||G.syncScrollArea(!0)},F.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 W=1;W<this.rows;W++)this.buffer.lines.push(this.buffer.getBlankLine(w.DEFAULT_ATTR_DATA));this.refresh(0,this.rows-1),this._onScroll.fire(this.buffer.ydisp)}},F.prototype.reset=function(){var W,U;this.options.rows=this.rows,this.options.cols=this.cols;var K=this._customKeyEventHandler;this._setup(),H.prototype.reset.call(this),(W=this._selectionService)===null||W===void 0||W.reset(),this._customKeyEventHandler=K,this.refresh(0,this.rows-1),(U=this.viewport)===null||U===void 0||U.syncScrollArea()},F.prototype._reportWindowsOptions=function(W){if(this._renderService)switch(W){case u.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:var U=this._renderService.dimensions.scaledCanvasWidth.toFixed(0),K=this._renderService.dimensions.scaledCanvasHeight.toFixed(0);this._coreService.triggerDataEvent(v.C0.ESC+"[4;"+K+";"+U+"t");break;case u.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:var G=this._renderService.dimensions.scaledCellWidth.toFixed(0),ae=this._renderService.dimensions.scaledCellHeight.toFixed(0);this._coreService.triggerDataEvent(v.C0.ESC+"[6;"+ae+";"+G+"t")}},F.prototype.cancel=function(W,U){if(this.options.cancelEvents||U)return W.preventDefault(),W.stopPropagation(),!1},F.prototype._visualBell=function(){return!1},F.prototype._soundBell=function(){return this.options.bellStyle==="sound"},F}(M.CoreTerminal);k.Terminal=B},function(j,k,D){"use strict";var R=this&&this.__decorate||function(v,u,a,c){var s,l=arguments.length,r=l<3?u:c===null?c=Object.getOwnPropertyDescriptor(u,a):c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(v,u,a,c);else for(var n=v.length-1;n>=0;n--)(s=v[n])&&(r=(l<3?s(r):l>3?s(u,a,r):s(u,a))||r);return l>3&&r&&Object.defineProperty(u,a,r),r},O=this&&this.__param||function(v,u){return function(a,c){u(a,c,v)}};Object.defineProperty(k,"__esModule",{value:!0}),k.CompositionHelper=void 0;var d=D(5),E=D(1),y=function(){function v(u,a,c,s,l,r){this._textarea=u,this._compositionView=a,this._bufferService=c,this._optionsService=s,this._charSizeService=l,this._coreService=r,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0}}return Object.defineProperty(v.prototype,"isComposing",{get:function(){return this._isComposing},enumerable:!1,configurable:!0}),v.prototype.compositionstart=function(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent="",this._compositionView.classList.add("active")},v.prototype.compositionupdate=function(u){var a=this;this._compositionView.textContent=u.data,this.updateCompositionElements(),setTimeout(function(){a._compositionPosition.end=a._textarea.value.length},0)},v.prototype.compositionend=function(){this._finalizeComposition(!0)},v.prototype.keydown=function(u){if(this._isComposing||this._isSendingComposition){if(u.keyCode===229)return!1;if(u.keyCode===16||u.keyCode===17||u.keyCode===18)return!1;this._finalizeComposition(!1)}return u.keyCode!==229||(this._handleAnyTextareaChanges(),!1)},v.prototype._finalizeComposition=function(u){var a=this;if(this._compositionView.classList.remove("active"),this._isComposing=!1,u){var c={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout(function(){if(a._isSendingComposition){a._isSendingComposition=!1;var l=void 0;l=a._isComposing?a._textarea.value.substring(c.start,c.end):a._textarea.value.substring(c.start),a._coreService.triggerDataEvent(l,!0)}},0)}else{this._isSendingComposition=!1;var s=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(s,!0)}},v.prototype._handleAnyTextareaChanges=function(){var u=this,a=this._textarea.value;setTimeout(function(){if(!u._isComposing){var c=u._textarea.value.replace(a,"");c.length>0&&u._coreService.triggerDataEvent(c,!0)}},0)},v.prototype.updateCompositionElements=function(u){var a=this;if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){var c=Math.ceil(this._charSizeService.height*this._optionsService.options.lineHeight),s=this._bufferService.buffer.y*c,l=this._bufferService.buffer.x*this._charSizeService.width;this._compositionView.style.left=l+"px",this._compositionView.style.top=s+"px",this._compositionView.style.height=c+"px",this._compositionView.style.lineHeight=c+"px",this._compositionView.style.fontFamily=this._optionsService.options.fontFamily,this._compositionView.style.fontSize=this._optionsService.options.fontSize+"px";var r=this._compositionView.getBoundingClientRect();this._textarea.style.left=l+"px",this._textarea.style.top=s+"px",this._textarea.style.width=r.width+"px",this._textarea.style.height=r.height+"px",this._textarea.style.lineHeight=r.height+"px"}u||setTimeout(function(){return a.updateCompositionElements(!0)},0)}},v=R([O(2,E.IBufferService),O(3,E.IOptionsService),O(4,d.ICharSizeService),O(5,E.ICoreService)],v)}();k.CompositionHelper=y},function(j,k,D){"use strict";var R,O=this&&this.__extends||(R=function(s,l){return(R=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var o in n)n.hasOwnProperty(o)&&(r[o]=n[o])})(s,l)},function(s,l){function r(){this.constructor=s}R(s,l),s.prototype=l===null?Object.create(l):(r.prototype=l.prototype,new r)}),d=this&&this.__decorate||function(s,l,r,n){var o,i=arguments.length,f=i<3?l:n===null?n=Object.getOwnPropertyDescriptor(l,r):n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")f=Reflect.decorate(s,l,r,n);else for(var h=s.length-1;h>=0;h--)(o=s[h])&&(f=(i<3?o(f):i>3?o(l,r,f):o(l,r))||f);return i>3&&f&&Object.defineProperty(l,r,f),f},E=this&&this.__param||function(s,l){return function(r,n){l(r,n,s)}};Object.defineProperty(k,"__esModule",{value:!0}),k.Viewport=void 0;var y=D(2),v=D(7),u=D(5),a=D(1),c=function(s){function l(r,n,o,i,f,h,T){var g=s.call(this)||this;return g._scrollLines=r,g._viewportElement=n,g._scrollArea=o,g._bufferService=i,g._optionsService=f,g._charSizeService=h,g._renderService=T,g.scrollBarWidth=0,g._currentRowHeight=0,g._lastRecordedBufferLength=0,g._lastRecordedViewportHeight=0,g._lastRecordedBufferHeight=0,g._lastTouchY=0,g._lastScrollTop=0,g._wheelPartialScroll=0,g._refreshAnimationFrame=null,g._ignoreNextScrollEvent=!1,g.scrollBarWidth=g._viewportElement.offsetWidth-g._scrollArea.offsetWidth||15,g.register(v.addDisposableDomListener(g._viewportElement,"scroll",g._onScroll.bind(g))),setTimeout(function(){return g.syncScrollArea()},0),g}return O(l,s),l.prototype.onThemeChange=function(r){this._viewportElement.style.backgroundColor=r.background.css},l.prototype._refresh=function(r){var n=this;if(r)return this._innerRefresh(),void(this._refreshAnimationFrame!==null&&cancelAnimationFrame(this._refreshAnimationFrame));this._refreshAnimationFrame===null&&(this._refreshAnimationFrame=requestAnimationFrame(function(){return n._innerRefresh()}))},l.prototype._innerRefresh=function(){if(this._charSizeService.height>0){this._currentRowHeight=this._renderService.dimensions.scaledCellHeight/window.devicePixelRatio,this._lastRecordedViewportHeight=this._viewportElement.offsetHeight;var r=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderService.dimensions.canvasHeight);this._lastRecordedBufferHeight!==r&&(this._lastRecordedBufferHeight=r,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}var n=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==n&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=n),this._refreshAnimationFrame=null},l.prototype.syncScrollArea=function(r){if(r===void 0&&(r=!1),this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(r);if(this._lastRecordedViewportHeight===this._renderService.dimensions.canvasHeight){var n=this._bufferService.buffer.ydisp*this._currentRowHeight;this._lastScrollTop===n&&this._lastScrollTop===this._viewportElement.scrollTop&&this._renderService.dimensions.scaledCellHeight/window.devicePixelRatio===this._currentRowHeight||this._refresh(r)}else this._refresh(r)},l.prototype._onScroll=function(r){if(this._lastScrollTop=this._viewportElement.scrollTop,this._viewportElement.offsetParent)if(this._ignoreNextScrollEvent)this._ignoreNextScrollEvent=!1;else{var n=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._scrollLines(n,!0)}},l.prototype._bubbleScroll=function(r,n){var o=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(n<0&&this._viewportElement.scrollTop!==0||n>0&&o<this._lastRecordedBufferHeight)||(r.cancelable&&r.preventDefault(),!1)},l.prototype.onWheel=function(r){var n=this._getPixelsScrolled(r);return n!==0&&(this._viewportElement.scrollTop+=n,this._bubbleScroll(r,n))},l.prototype._getPixelsScrolled=function(r){if(r.deltaY===0)return 0;var n=this._applyScrollModifier(r.deltaY,r);return r.deltaMode===WheelEvent.DOM_DELTA_LINE?n*=this._currentRowHeight:r.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(n*=this._currentRowHeight*this._bufferService.rows),n},l.prototype.getLinesScrolled=function(r){if(r.deltaY===0)return 0;var n=this._applyScrollModifier(r.deltaY,r);return r.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(n/=this._currentRowHeight+0,this._wheelPartialScroll+=n,n=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):r.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(n*=this._bufferService.rows),n},l.prototype._applyScrollModifier=function(r,n){var o=this._optionsService.options.fastScrollModifier;return o==="alt"&&n.altKey||o==="ctrl"&&n.ctrlKey||o==="shift"&&n.shiftKey?r*this._optionsService.options.fastScrollSensitivity*this._optionsService.options.scrollSensitivity:r*this._optionsService.options.scrollSensitivity},l.prototype.onTouchStart=function(r){this._lastTouchY=r.touches[0].pageY},l.prototype.onTouchMove=function(r){var n=this._lastTouchY-r.touches[0].pageY;return this._lastTouchY=r.touches[0].pageY,n!==0&&(this._viewportElement.scrollTop+=n,this._bubbleScroll(r,n))},l=d([E(3,a.IBufferService),E(4,a.IOptionsService),E(5,u.ICharSizeService),E(6,u.IRenderService)],l)}(y.Disposable);k.Viewport=c},function(j,k,D){"use strict";function R(y){return y.replace(/\r?\n/g,"\r")}function O(y,v){return v?"[200~"+y+"[201~":y}function d(y,v,u){y=O(y=R(y),u.decPrivateModes.bracketedPasteMode),u.triggerDataEvent(y,!0),v.value=""}function E(y,v,u){var a=u.getBoundingClientRect(),c=y.clientX-a.left-10,s=y.clientY-a.top-10;v.style.width="20px",v.style.height="20px",v.style.left=c+"px",v.style.top=s+"px",v.style.zIndex="1000",v.focus()}Object.defineProperty(k,"__esModule",{value:!0}),k.rightClickHandler=k.moveTextAreaUnderMouseCursor=k.paste=k.handlePasteEvent=k.copyHandler=k.bracketTextForPaste=k.prepareTextForTerminal=void 0,k.prepareTextForTerminal=R,k.bracketTextForPaste=O,k.copyHandler=function(y,v){y.clipboardData&&y.clipboardData.setData("text/plain",v.selectionText),y.preventDefault()},k.handlePasteEvent=function(y,v,u){y.stopPropagation(),y.clipboardData&&d(y.clipboardData.getData("text/plain"),v,u)},k.paste=d,k.moveTextAreaUnderMouseCursor=E,k.rightClickHandler=function(y,v,u,a,c){E(y,v,u),c&&!a.isClickInSelection(y)&&a.selectWordAtCursor(y),v.value=a.selectionText,v.select()}},function(j,k,D){"use strict";var R,O=this&&this.__extends||(R=function(s,l){return(R=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var o in n)n.hasOwnProperty(o)&&(r[o]=n[o])})(s,l)},function(s,l){function r(){this.constructor=s}R(s,l),s.prototype=l===null?Object.create(l):(r.prototype=l.prototype,new r)});Object.defineProperty(k,"__esModule",{value:!0}),k.EscapeSequenceParser=k.VT500_TRANSITION_TABLE=k.TransitionTable=void 0;var d=D(2),E=D(15),y=D(21),v=D(22),u=D(24),a=function(){function s(l){this.table=new Uint8Array(l)}return s.prototype.setDefault=function(l,r){E.fill(this.table,l<<4|r)},s.prototype.add=function(l,r,n,o){this.table[r<<8|l]=n<<4|o},s.prototype.addMany=function(l,r,n,o){for(var i=0;i<l.length;i++)this.table[r<<8|l[i]]=n<<4|o},s}();k.TransitionTable=a,k.VT500_TRANSITION_TABLE=function(){var s=new a(4095),l=Array.apply(null,Array(256)).map(function(h,T){return T}),r=function(h,T){return l.slice(h,T)},n=r(32,127),o=r(0,24);o.push(25),o.push.apply(o,r(28,32));var i,f=r(0,14);for(i in s.setDefault(1,0),s.addMany(n,0,2,0),f)s.addMany([24,26,153,154],i,3,0),s.addMany(r(128,144),i,3,0),s.addMany(r(144,152),i,3,0),s.add(156,i,0,0),s.add(27,i,11,1),s.add(157,i,4,8),s.addMany([152,158,159],i,0,7),s.add(155,i,11,3),s.add(144,i,11,9);return s.addMany(o,0,3,0),s.addMany(o,1,3,1),s.add(127,1,0,1),s.addMany(o,8,0,8),s.addMany(o,3,3,3),s.add(127,3,0,3),s.addMany(o,4,3,4),s.add(127,4,0,4),s.addMany(o,6,3,6),s.addMany(o,5,3,5),s.add(127,5,0,5),s.addMany(o,2,3,2),s.add(127,2,0,2),s.add(93,1,4,8),s.addMany(n,8,5,8),s.add(127,8,5,8),s.addMany([156,27,24,26,7],8,6,0),s.addMany(r(28,32),8,0,8),s.addMany([88,94,95],1,0,7),s.addMany(n,7,0,7),s.addMany(o,7,0,7),s.add(156,7,0,0),s.add(127,7,0,7),s.add(91,1,11,3),s.addMany(r(64,127),3,7,0),s.addMany(r(48,60),3,8,4),s.addMany([60,61,62,63],3,9,4),s.addMany(r(48,60),4,8,4),s.addMany(r(64,127),4,7,0),s.addMany([60,61,62,63],4,0,6),s.addMany(r(32,64),6,0,6),s.add(127,6,0,6),s.addMany(r(64,127),6,0,0),s.addMany(r(32,48),3,9,5),s.addMany(r(32,48),5,9,5),s.addMany(r(48,64),5,0,6),s.addMany(r(64,127),5,7,0),s.addMany(r(32,48),4,9,5),s.addMany(r(32,48),1,9,2),s.addMany(r(32,48),2,9,2),s.addMany(r(48,127),2,10,0),s.addMany(r(48,80),1,10,0),s.addMany(r(81,88),1,10,0),s.addMany([89,90,92],1,10,0),s.addMany(r(96,127),1,10,0),s.add(80,1,11,9),s.addMany(o,9,0,9),s.add(127,9,0,9),s.addMany(r(28,32),9,0,9),s.addMany(r(32,48),9,9,12),s.addMany(r(48,60),9,8,10),s.addMany([60,61,62,63],9,9,10),s.addMany(o,11,0,11),s.addMany(r(32,128),11,0,11),s.addMany(r(28,32),11,0,11),s.addMany(o,10,0,10),s.add(127,10,0,10),s.addMany(r(28,32),10,0,10),s.addMany(r(48,60),10,8,10),s.addMany([60,61,62,63],10,0,11),s.addMany(r(32,48),10,9,12),s.addMany(o,12,0,12),s.add(127,12,0,12),s.addMany(r(28,32),12,0,12),s.addMany(r(32,48),12,9,12),s.addMany(r(48,64),12,0,11),s.addMany(r(64,127),12,12,13),s.addMany(r(64,127),10,12,13),s.addMany(r(64,127),9,12,13),s.addMany(o,13,13,13),s.addMany(n,13,13,13),s.add(127,13,0,13),s.addMany([27,156,24,26],13,14,0),s.add(160,0,2,0),s.add(160,8,5,8),s.add(160,6,0,6),s.add(160,11,0,11),s.add(160,13,13,13),s}();var c=function(s){function l(r){r===void 0&&(r=k.VT500_TRANSITION_TABLE);var n=s.call(this)||this;return n._transitions=r,n.initialState=0,n.currentState=n.initialState,n._params=new y.Params,n._params.addParam(0),n._collect=0,n.precedingCodepoint=0,n._printHandlerFb=function(o,i,f){},n._executeHandlerFb=function(o){},n._csiHandlerFb=function(o,i){},n._escHandlerFb=function(o){},n._errorHandlerFb=function(o){return o},n._printHandler=n._printHandlerFb,n._executeHandlers=Object.create(null),n._csiHandlers=Object.create(null),n._escHandlers=Object.create(null),n._oscParser=new v.OscParser,n._dcsParser=new u.DcsParser,n._errorHandler=n._errorHandlerFb,n.setEscHandler({final:"\\"},function(){}),n}return O(l,s),l.prototype._identifier=function(r,n){n===void 0&&(n=[64,126]);var o=0;if(r.prefix){if(r.prefix.length>1)throw new Error("only one byte as prefix supported");if((o=r.prefix.charCodeAt(0))&&60>o||o>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(r.intermediates){if(r.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(var i=0;i<r.intermediates.length;++i){var f=r.intermediates.charCodeAt(i);if(32>f||f>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");o<<=8,o|=f}}if(r.final.length!==1)throw new Error("final must be a single byte");var h=r.final.charCodeAt(0);if(n[0]>h||h>n[1])throw new Error("final must be in range "+n[0]+" .. "+n[1]);return o<<=8,o|=h},l.prototype.identToString=function(r){for(var n=[];r;)n.push(String.fromCharCode(255&r)),r>>=8;return n.reverse().join("")},l.prototype.dispose=function(){this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null),this._oscParser.dispose(),this._dcsParser.dispose()},l.prototype.setPrintHandler=function(r){this._printHandler=r},l.prototype.clearPrintHandler=function(){this._printHandler=this._printHandlerFb},l.prototype.addEscHandler=function(r,n){var o=this._identifier(r,[48,126]);this._escHandlers[o]===void 0&&(this._escHandlers[o]=[]);var i=this._escHandlers[o];return i.push(n),{dispose:function(){var f=i.indexOf(n);f!==-1&&i.splice(f,1)}}},l.prototype.setEscHandler=function(r,n){this._escHandlers[this._identifier(r,[48,126])]=[n]},l.prototype.clearEscHandler=function(r){this._escHandlers[this._identifier(r,[48,126])]&&delete this._escHandlers[this._identifier(r,[48,126])]},l.prototype.setEscHandlerFallback=function(r){this._escHandlerFb=r},l.prototype.setExecuteHandler=function(r,n){this._executeHandlers[r.charCodeAt(0)]=n},l.prototype.clearExecuteHandler=function(r){this._executeHandlers[r.charCodeAt(0)]&&delete this._executeHandlers[r.charCodeAt(0)]},l.prototype.setExecuteHandlerFallback=function(r){this._executeHandlerFb=r},l.prototype.addCsiHandler=function(r,n){var o=this._identifier(r);this._csiHandlers[o]===void 0&&(this._csiHandlers[o]=[]);var i=this._csiHandlers[o];return i.push(n),{dispose:function(){var f=i.indexOf(n);f!==-1&&i.splice(f,1)}}},l.prototype.setCsiHandler=function(r,n){this._csiHandlers[this._identifier(r)]=[n]},l.prototype.clearCsiHandler=function(r){this._csiHandlers[this._identifier(r)]&&delete this._csiHandlers[this._identifier(r)]},l.prototype.setCsiHandlerFallback=function(r){this._csiHandlerFb=r},l.prototype.addDcsHandler=function(r,n){return this._dcsParser.addHandler(this._identifier(r),n)},l.prototype.setDcsHandler=function(r,n){this._dcsParser.setHandler(this._identifier(r),n)},l.prototype.clearDcsHandler=function(r){this._dcsParser.clearHandler(this._identifier(r))},l.prototype.setDcsHandlerFallback=function(r){this._dcsParser.setHandlerFallback(r)},l.prototype.addOscHandler=function(r,n){return this._oscParser.addHandler(r,n)},l.prototype.setOscHandler=function(r,n){this._oscParser.setHandler(r,n)},l.prototype.clearOscHandler=function(r){this._oscParser.clearHandler(r)},l.prototype.setOscHandlerFallback=function(r){this._oscParser.setHandlerFallback(r)},l.prototype.setErrorHandler=function(r){this._errorHandler=r},l.prototype.clearErrorHandler=function(){this._errorHandler=this._errorHandlerFb},l.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},l.prototype.parse=function(r,n){for(var o=0,i=0,f=this.currentState,h=this._oscParser,T=this._dcsParser,g=this._collect,w=this._params,C=this._transitions.table,x=0;x<n;++x){switch((i=C[f<<8|((o=r[x])<160?o:160)])>>4){case 2:for(var b=x+1;;++b){if(b>=n||(o=r[b])<32||o>126&&o<160){this._printHandler(r,x,b),x=b-1;break}if(++b>=n||(o=r[b])<32||o>126&&o<160){this._printHandler(r,x,b),x=b-1;break}if(++b>=n||(o=r[b])<32||o>126&&o<160){this._printHandler(r,x,b),x=b-1;break}if(++b>=n||(o=r[b])<32||o>126&&o<160){this._printHandler(r,x,b),x=b-1;break}}break;case 3:this._executeHandlers[o]?this._executeHandlers[o]():this._executeHandlerFb(o),this.precedingCodepoint=0;break;case 0:break;case 1:if(this._errorHandler({position:x,code:o,currentState:f,collect:g,params:w,abort:!1}).abort)return;break;case 7:for(var S=this._csiHandlers[g<<8|o],A=S?S.length-1:-1;A>=0&&S[A](w)===!1;A--);A<0&&this._csiHandlerFb(g<<8|o,w),this.precedingCodepoint=0;break;case 8:do switch(o){case 59:w.addParam(0);break;case 58:w.addSubParam(-1);break;default:w.addDigit(o-48)}while(++x<n&&(o=r[x])>47&&o<60);x--;break;case 9:g<<=8,g|=o;break;case 10:for(var p=this._escHandlers[g<<8|o],I=p?p.length-1:-1;I>=0&&p[I]()===!1;I--);I<0&&this._escHandlerFb(g<<8|o),this.precedingCodepoint=0;break;case 11:w.reset(),w.addParam(0),g=0;break;case 12:T.hook(g<<8|o,w);break;case 13:for(var M=x+1;;++M)if(M>=n||(o=r[M])===24||o===26||o===27||o>127&&o<160){T.put(r,x,M),x=M-1;break}break;case 14:T.unhook(o!==24&&o!==26),o===27&&(i|=1),w.reset(),w.addParam(0),g=0,this.precedingCodepoint=0;break;case 4:h.start();break;case 5:for(var P=x+1;;P++)if(P>=n||(o=r[P])<32||o>127&&o<=159){h.put(r,x,P),x=P-1;break}break;case 6:h.end(o!==24&&o!==26),o===27&&(i|=1),w.reset(),w.addParam(0),g=0,this.precedingCodepoint=0}f=15&i}this._collect=g,this.currentState=f},l}(d.Disposable);k.EscapeSequenceParser=c},function(j,k,D){"use strict";var R,O=this&&this.__extends||(R=function(h,T){return(R=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,w){g.__proto__=w}||function(g,w){for(var C in w)w.hasOwnProperty(C)&&(g[C]=w[C])})(h,T)},function(h,T){function g(){this.constructor=h}R(h,T),h.prototype=T===null?Object.create(T):(g.prototype=T.prototype,new g)}),d=this&&this.__decorate||function(h,T,g,w){var C,x=arguments.length,b=x<3?T:w===null?w=Object.getOwnPropertyDescriptor(T,g):w;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")b=Reflect.decorate(h,T,g,w);else for(var S=h.length-1;S>=0;S--)(C=h[S])&&(b=(x<3?C(b):x>3?C(T,g,b):C(T,g))||b);return x>3&&b&&Object.defineProperty(T,g,b),b},E=this&&this.__param||function(h,T){return function(g,w){T(g,w,h)}};Object.defineProperty(k,"__esModule",{value:!0}),k.Renderer=void 0;var y=D(41),v=D(47),u=D(48),a=D(49),c=D(29),s=D(2),l=D(5),r=D(1),n=D(25),o=D(0),i=1,f=function(h){function T(g,w,C,x,b,S,A,p,I){var M=h.call(this)||this;M._colors=g,M._screenElement=w,M._bufferService=b,M._charSizeService=S,M._optionsService=A,M._id=i++,M._onRequestRedraw=new o.EventEmitter;var P=M._optionsService.options.allowTransparency;return M._characterJoinerRegistry=new c.CharacterJoinerRegistry(M._bufferService),M._renderLayers=[new y.TextRenderLayer(M._screenElement,0,M._colors,M._characterJoinerRegistry,P,M._id,M._bufferService,A),new v.SelectionRenderLayer(M._screenElement,1,M._colors,M._id,M._bufferService,A),new a.LinkRenderLayer(M._screenElement,2,M._colors,M._id,C,x,M._bufferService,A),new u.CursorRenderLayer(M._screenElement,3,M._colors,M._id,M._onRequestRedraw,M._bufferService,A,p,I)],M.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},M._devicePixelRatio=window.devicePixelRatio,M._updateDimensions(),M.onOptionsChanged(),M}return O(T,h),Object.defineProperty(T.prototype,"onRequestRedraw",{get:function(){return this._onRequestRedraw.event},enumerable:!1,configurable:!0}),T.prototype.dispose=function(){for(var g=0,w=this._renderLayers;g<w.length;g++)w[g].dispose();h.prototype.dispose.call(this),n.removeTerminalFromCache(this._id)},T.prototype.onDevicePixelRatioChange=function(){this._devicePixelRatio!==window.devicePixelRatio&&(this._devicePixelRatio=window.devicePixelRatio,this.onResize(this._bufferService.cols,this._bufferService.rows))},T.prototype.setColors=function(g){this._colors=g;for(var w=0,C=this._renderLayers;w<C.length;w++){var x=C[w];x.setColors(this._colors),x.reset()}},T.prototype.onResize=function(g,w){this._updateDimensions();for(var C=0,x=this._renderLayers;C<x.length;C++)x[C].resize(this.dimensions);this._screenElement.style.width=this.dimensions.canvasWidth+"px",this._screenElement.style.height=this.dimensions.canvasHeight+"px"},T.prototype.onCharSizeChanged=function(){this.onResize(this._bufferService.cols,this._bufferService.rows)},T.prototype.onBlur=function(){this._runOperation(function(g){return g.onBlur()})},T.prototype.onFocus=function(){this._runOperation(function(g){return g.onFocus()})},T.prototype.onSelectionChanged=function(g,w,C){C===void 0&&(C=!1),this._runOperation(function(x){return x.onSelectionChanged(g,w,C)})},T.prototype.onCursorMove=function(){this._runOperation(function(g){return g.onCursorMove()})},T.prototype.onOptionsChanged=function(){this._runOperation(function(g){return g.onOptionsChanged()})},T.prototype.clear=function(){this._runOperation(function(g){return g.reset()})},T.prototype._runOperation=function(g){for(var w=0,C=this._renderLayers;w<C.length;w++)g(C[w])},T.prototype.renderRows=function(g,w){for(var C=0,x=this._renderLayers;C<x.length;C++)x[C].onGridChanged(g,w)},T.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)},T.prototype.registerCharacterJoiner=function(g){return this._characterJoinerRegistry.registerCharacterJoiner(g)},T.prototype.deregisterCharacterJoiner=function(g){return this._characterJoinerRegistry.deregisterCharacterJoiner(g)},T=d([E(4,r.IBufferService),E(5,l.ICharSizeService),E(6,r.IOptionsService),E(7,r.ICoreService),E(8,l.ICoreBrowserService)],T)}(s.Disposable);k.Renderer=f},function(j,k,D){"use strict";var R,O=this&&this.__extends||(R=function(s,l){return(R=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var o in n)n.hasOwnProperty(o)&&(r[o]=n[o])})(s,l)},function(s,l){function r(){this.constructor=s}R(s,l),s.prototype=l===null?Object.create(l):(r.prototype=l.prototype,new r)});Object.defineProperty(k,"__esModule",{value:!0}),k.TextRenderLayer=void 0;var d=D(42),E=D(13),y=D(6),v=D(3),u=D(29),a=D(4),c=function(s){function l(r,n,o,i,f,h,T,g){var w=s.call(this,r,"text",n,f,o,h,T,g)||this;return w._characterWidth=0,w._characterFont="",w._characterOverlapCache={},w._workCell=new a.CellData,w._state=new d.GridCache,w._characterJoinerRegistry=i,w}return O(l,s),l.prototype.resize=function(r){s.prototype.resize.call(this,r);var n=this._getFont(!1,!1);this._characterWidth===r.scaledCharWidth&&this._characterFont===n||(this._characterWidth=r.scaledCharWidth,this._characterFont=n,this._characterOverlapCache={}),this._state.clear(),this._state.resize(this._bufferService.cols,this._bufferService.rows)},l.prototype.reset=function(){this._state.clear(),this._clearAll()},l.prototype._forEachCell=function(r,n,o,i){for(var f=r;f<=n;f++)for(var h=f+this._bufferService.buffer.ydisp,T=this._bufferService.buffer.lines.get(h),g=o?o.getJoinedCharacters(h):[],w=0;w<this._bufferService.cols;w++){T.loadCell(w,this._workCell);var C=this._workCell,x=!1,b=w;if(C.getWidth()!==0){if(g.length>0&&w===g[0][0]){x=!0;var S=g.shift();C=new u.JoinedCellData(this._workCell,T.translateToString(!0,S[0],S[1]),S[1]-S[0]),b=S[1]-1}!x&&this._isOverlapping(C)&&b<T.length-1&&T.getCodePoint(b+1)===v.NULL_CELL_CODE&&(C.content&=-12582913,C.content|=2<<22),i(C,w,f),w=b}}},l.prototype._drawBackground=function(r,n){var o=this,i=this._ctx,f=this._bufferService.cols,h=0,T=0,g=null;i.save(),this._forEachCell(r,n,null,function(w,C,x){var b=null;w.isInverse()?b=w.isFgDefault()?o._colors.foreground.css:w.isFgRGB()?"rgb("+y.AttributeData.toColorRGB(w.getFgColor()).join(",")+")":o._colors.ansi[w.getFgColor()].css:w.isBgRGB()?b="rgb("+y.AttributeData.toColorRGB(w.getBgColor()).join(",")+")":w.isBgPalette()&&(b=o._colors.ansi[w.getBgColor()].css),g===null&&(h=C,T=x),x!==T?(i.fillStyle=g||"",o._fillCells(h,T,f-h,1),h=C,T=x):g!==b&&(i.fillStyle=g||"",o._fillCells(h,T,C-h,1),h=C,T=x),g=b}),g!==null&&(i.fillStyle=g,this._fillCells(h,T,f-h,1)),i.restore()},l.prototype._drawForeground=function(r,n){var o=this;this._forEachCell(r,n,this._characterJoinerRegistry,function(i,f,h){if(!i.isInvisible()&&(o._drawChars(i,f,h),i.isUnderline())){if(o._ctx.save(),i.isInverse())if(i.isBgDefault())o._ctx.fillStyle=o._colors.background.css;else if(i.isBgRGB())o._ctx.fillStyle="rgb("+y.AttributeData.toColorRGB(i.getBgColor()).join(",")+")";else{var T=i.getBgColor();o._optionsService.options.drawBoldTextInBrightColors&&i.isBold()&&T<8&&(T+=8),o._ctx.fillStyle=o._colors.ansi[T].css}else if(i.isFgDefault())o._ctx.fillStyle=o._colors.foreground.css;else if(i.isFgRGB())o._ctx.fillStyle="rgb("+y.AttributeData.toColorRGB(i.getFgColor()).join(",")+")";else{var g=i.getFgColor();o._optionsService.options.drawBoldTextInBrightColors&&i.isBold()&&g<8&&(g+=8),o._ctx.fillStyle=o._colors.ansi[g].css}o._fillBottomLineAtCells(f,h,i.getWidth()),o._ctx.restore()}})},l.prototype.onGridChanged=function(r,n){this._state.cache.length!==0&&(this._charAtlas&&this._charAtlas.beginFrame(),this._clearCells(0,r,this._bufferService.cols,n-r+1),this._drawBackground(r,n),this._drawForeground(r,n))},l.prototype.onOptionsChanged=function(){this._setTransparency(this._optionsService.options.allowTransparency)},l.prototype._isOverlapping=function(r){if(r.getWidth()!==1)return!1;if(r.getCode()<256)return!1;var n=r.getChars();if(this._characterOverlapCache.hasOwnProperty(n))return this._characterOverlapCache[n];this._ctx.save(),this._ctx.font=this._characterFont;var o=Math.floor(this._ctx.measureText(n).width)>this._characterWidth;return this._ctx.restore(),this._characterOverlapCache[n]=o,o},l}(E.BaseRenderLayer);k.TextRenderLayer=c},function(j,k,D){"use strict";Object.defineProperty(k,"__esModule",{value:!0}),k.GridCache=void 0;var R=function(){function O(){this.cache=[]}return O.prototype.resize=function(d,E){for(var y=0;y<d;y++){this.cache.length<=y&&this.cache.push([]);for(var v=this.cache[y].length;v<E;v++)this.cache[y].push(void 0);this.cache[y].length=E}this.cache.length=d},O.prototype.clear=function(){for(var d=0;d<this.cache.length;d++)for(var E=0;E<this.cache[d].length;E++)this.cache[d][E]=void 0},O}();k.GridCache=R},function(j,k,D){"use strict";var R,O=this&&this.__extends||(R=function(o,i){return(R=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(f,h){f.__proto__=h}||function(f,h){for(var T in h)h.hasOwnProperty(T)&&(f[T]=h[T])})(o,i)},function(o,i){function f(){this.constructor=o}R(o,i),o.prototype=i===null?Object.create(i):(f.prototype=i.prototype,new f)});Object.defineProperty(k,"__esModule",{value:!0}),k.NoneCharAtlas=k.DynamicCharAtlas=k.getGlyphCacheKey=void 0;var d=D(9),E=D(44),y=D(27),v=D(46),u=D(11),a=D(28),c=D(10),s={css:"rgba(0, 0, 0, 0)",rgba:0};function l(o){return o.code<<21|o.bg<<12|o.fg<<3|(o.bold?0:4)+(o.dim?0:2)+(o.italic?0:1)}k.getGlyphCacheKey=l;var r=function(o){function i(f,h){var T=o.call(this)||this;T._config=h,T._drawToCacheCount=0,T._glyphsWaitingOnBitmap=[],T._bitmapCommitTimeout=null,T._bitmap=null,T._cacheCanvas=f.createElement("canvas"),T._cacheCanvas.width=1024,T._cacheCanvas.height=1024,T._cacheCtx=a.throwIfFalsy(T._cacheCanvas.getContext("2d",{alpha:!0}));var g=f.createElement("canvas");g.width=T._config.scaledCharWidth,g.height=T._config.scaledCharHeight,T._tmpCtx=a.throwIfFalsy(g.getContext("2d",{alpha:T._config.allowTransparency})),T._width=Math.floor(1024/T._config.scaledCharWidth),T._height=Math.floor(1024/T._config.scaledCharHeight);var w=T._width*T._height;return T._cacheMap=new v.LRUMap(w),T._cacheMap.prealloc(w),T}return O(i,o),i.prototype.dispose=function(){this._bitmapCommitTimeout!==null&&(window.clearTimeout(this._bitmapCommitTimeout),this._bitmapCommitTimeout=null)},i.prototype.beginFrame=function(){this._drawToCacheCount=0},i.prototype.draw=function(f,h,T,g){if(h.code===32)return!0;if(!this._canCache(h))return!1;var w=l(h),C=this._cacheMap.get(w);if(C!=null)return this._drawFromCache(f,C,T,g),!0;if(this._drawToCacheCount<100){var x=void 0;x=this._cacheMap.size<this._cacheMap.capacity?this._cacheMap.size:this._cacheMap.peek().index;var b=this._drawToCache(h,x);return this._cacheMap.set(w,b),this._drawFromCache(f,b,T,g),!0}return!1},i.prototype._canCache=function(f){return f.code<256},i.prototype._toCoordinateX=function(f){return f%this._width*this._config.scaledCharWidth},i.prototype._toCoordinateY=function(f){return Math.floor(f/this._width)*this._config.scaledCharHeight},i.prototype._drawFromCache=function(f,h,T,g){if(!h.isEmpty){var w=this._toCoordinateX(h.index),C=this._toCoordinateY(h.index);f.drawImage(h.inBitmap?this._bitmap:this._cacheCanvas,w,C,this._config.scaledCharWidth,this._config.scaledCharHeight,T,g,this._config.scaledCharWidth,this._config.scaledCharHeight)}},i.prototype._getColorFromAnsiIndex=function(f){return f<this._config.colors.ansi.length?this._config.colors.ansi[f]:y.DEFAULT_ANSI_COLORS[f]},i.prototype._getBackgroundColor=function(f){return this._config.allowTransparency?s:f.bg===d.INVERTED_DEFAULT_COLOR?this._config.colors.foreground:f.bg<256?this._getColorFromAnsiIndex(f.bg):this._config.colors.background},i.prototype._getForegroundColor=function(f){return f.fg===d.INVERTED_DEFAULT_COLOR?c.color.opaque(this._config.colors.background):f.fg<256?this._getColorFromAnsiIndex(f.fg):this._config.colors.foreground},i.prototype._drawToCache=function(f,h){this._drawToCacheCount++,this._tmpCtx.save();var T=this._getBackgroundColor(f);this._tmpCtx.globalCompositeOperation="copy",this._tmpCtx.fillStyle=T.css,this._tmpCtx.fillRect(0,0,this._config.scaledCharWidth,this._config.scaledCharHeight),this._tmpCtx.globalCompositeOperation="source-over";var g=f.bold?this._config.fontWeightBold:this._config.fontWeight,w=f.italic?"italic":"";this._tmpCtx.font=w+" "+g+" "+this._config.fontSize*this._config.devicePixelRatio+"px "+this._config.fontFamily,this._tmpCtx.textBaseline="middle",this._tmpCtx.fillStyle=this._getForegroundColor(f).css,f.dim&&(this._tmpCtx.globalAlpha=d.DIM_OPACITY),this._tmpCtx.fillText(f.chars,0,this._config.scaledCharHeight/2),this._tmpCtx.restore();var C=this._tmpCtx.getImageData(0,0,this._config.scaledCharWidth,this._config.scaledCharHeight),x=!1;this._config.allowTransparency||(x=function(p,I){for(var M=!0,P=I.rgba>>>24,B=I.rgba>>>16&255,H=I.rgba>>>8&255,F=0;F<p.data.length;F+=4)p.data[F]===P&&p.data[F+1]===B&&p.data[F+2]===H?p.data[F+3]=0:M=!1;return M}(C,T));var b=this._toCoordinateX(h),S=this._toCoordinateY(h);this._cacheCtx.putImageData(C,b,S);var A={index:h,isEmpty:x,inBitmap:!1};return this._addGlyphToBitmap(A),A},i.prototype._addGlyphToBitmap=function(f){var h=this;!("createImageBitmap"in window)||u.isFirefox||u.isSafari||(this._glyphsWaitingOnBitmap.push(f),this._bitmapCommitTimeout===null&&(this._bitmapCommitTimeout=window.setTimeout(function(){return h._generateBitmap()},100)))},i.prototype._generateBitmap=function(){var f=this,h=this._glyphsWaitingOnBitmap;this._glyphsWaitingOnBitmap=[],window.createImageBitmap(this._cacheCanvas).then(function(T){f._bitmap=T;for(var g=0;g<h.length;g++)h[g].inBitmap=!0}),this._bitmapCommitTimeout=null},i}(E.BaseCharAtlas);k.DynamicCharAtlas=r;var n=function(o){function i(f,h){return o.call(this)||this}return O(i,o),i.prototype.draw=function(f,h,T,g){return!1},i}(E.BaseCharAtlas);k.NoneCharAtlas=n},function(j,k,D){"use strict";Object.defineProperty(k,"__esModule",{value:!0}),k.BaseCharAtlas=void 0;var R=function(){function O(){this._didWarmUp=!1}return O.prototype.dispose=function(){},O.prototype.warmUp=function(){this._didWarmUp||(this._doWarmUp(),this._didWarmUp=!0)},O.prototype._doWarmUp=function(){},O.prototype.beginFrame=function(){},O}();k.BaseCharAtlas=R},function(j,k,D){"use strict";Object.defineProperty(k,"__esModule",{value:!0}),k.ColorContrastCache=void 0;var R=function(){function O(){this._color={},this._rgba={}}return O.prototype.clear=function(){this._color={},this._rgba={}},O.prototype.setCss=function(d,E,y){this._rgba[d]||(this._rgba[d]={}),this._rgba[d][E]=y},O.prototype.getCss=function(d,E){return this._rgba[d]?this._rgba[d][E]:void 0},O.prototype.setColor=function(d,E,y){this._color[d]||(this._color[d]={}),this._color[d][E]=y},O.prototype.getColor=function(d,E){return this._color[d]?this._color[d][E]:void 0},O}();k.ColorContrastCache=R},function(j,k,D){"use strict";Object.defineProperty(k,"__esModule",{value:!0}),k.LRUMap=void 0;var R=function(){function O(d){this.capacity=d,this._map={},this._head=null,this._tail=null,this._nodePool=[],this.size=0}return O.prototype._unlinkNode=function(d){var E=d.prev,y=d.next;d===this._head&&(this._head=y),d===this._tail&&(this._tail=E),E!==null&&(E.next=y),y!==null&&(y.prev=E)},O.prototype._appendNode=function(d){var E=this._tail;E!==null&&(E.next=d),d.prev=E,d.next=null,this._tail=d,this._head===null&&(this._head=d)},O.prototype.prealloc=function(d){for(var E=this._nodePool,y=0;y<d;y++)E.push({prev:null,next:null,key:null,value:null})},O.prototype.get=function(d){var E=this._map[d];return E!==void 0?(this._unlinkNode(E),this._appendNode(E),E.value):null},O.prototype.peekValue=function(d){var E=this._map[d];return E!==void 0?E.value:null},O.prototype.peek=function(){var d=this._head;return d===null?null:d.value},O.prototype.set=function(d,E){var y=this._map[d];if(y!==void 0)y=this._map[d],this._unlinkNode(y),y.value=E;else if(this.size>=this.capacity)y=this._head,this._unlinkNode(y),delete this._map[y.key],y.key=d,y.value=E,this._map[d]=y;else{var v=this._nodePool;v.length>0?((y=v.pop()).key=d,y.value=E):y={prev:null,next:null,key:d,value:E},this._map[d]=y,this.size++}this._appendNode(y)},O}();k.LRUMap=R},function(j,k,D){"use strict";var R,O=this&&this.__extends||(R=function(E,y){return(R=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(v,u){v.__proto__=u}||function(v,u){for(var a in u)u.hasOwnProperty(a)&&(v[a]=u[a])})(E,y)},function(E,y){function v(){this.constructor=E}R(E,y),E.prototype=y===null?Object.create(y):(v.prototype=y.prototype,new v)});Object.defineProperty(k,"__esModule",{value:!0}),k.SelectionRenderLayer=void 0;var d=function(E){function y(v,u,a,c,s,l){var r=E.call(this,v,"selection",u,!0,a,c,s,l)||this;return r._clearState(),r}return O(y,E),y.prototype._clearState=function(){this._state={start:void 0,end:void 0,columnSelectMode:void 0,ydisp:void 0}},y.prototype.resize=function(v){E.prototype.resize.call(this,v),this._clearState()},y.prototype.reset=function(){this._state.start&&this._state.end&&(this._clearState(),this._clearAll())},y.prototype.onSelectionChanged=function(v,u,a){if(this._didStateChange(v,u,a,this._bufferService.buffer.ydisp))if(this._clearAll(),v&&u){var c=v[1]-this._bufferService.buffer.ydisp,s=u[1]-this._bufferService.buffer.ydisp,l=Math.max(c,0),r=Math.min(s,this._bufferService.rows-1);if(!(l>=this._bufferService.rows||r<0)){if(this._ctx.fillStyle=this._colors.selectionTransparent.css,a){var n=v[0],o=u[0]-n,i=r-l+1;this._fillCells(n,l,o,i)}else{n=c===l?v[0]:0;var f=l===r?u[0]:this._bufferService.cols;this._fillCells(n,l,f-n,1);var h=Math.max(r-l-1,0);if(this._fillCells(0,l+1,this._bufferService.cols,h),l!==r){var T=s===r?u[0]:this._bufferService.cols;this._fillCells(0,r,T,1)}}this._state.start=[v[0],v[1]],this._state.end=[u[0],u[1]],this._state.columnSelectMode=a,this._state.ydisp=this._bufferService.buffer.ydisp}}else this._clearState()},y.prototype._didStateChange=function(v,u,a,c){return!this._areCoordinatesEqual(v,this._state.start)||!this._areCoordinatesEqual(u,this._state.end)||a!==this._state.columnSelectMode||c!==this._state.ydisp},y.prototype._areCoordinatesEqual=function(v,u){return!(!v||!u)&&v[0]===u[0]&&v[1]===u[1]},y}(D(13).BaseRenderLayer);k.SelectionRenderLayer=d},function(j,k,D){"use strict";var R,O=this&&this.__extends||(R=function(u,a){return(R=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(c,s){c.__proto__=s}||function(c,s){for(var l in s)s.hasOwnProperty(l)&&(c[l]=s[l])})(u,a)},function(u,a){function c(){this.constructor=u}R(u,a),u.prototype=a===null?Object.create(a):(c.prototype=a.prototype,new c)});Object.defineProperty(k,"__esModule",{value:!0}),k.CursorRenderLayer=void 0;var d=D(13),E=D(4),y=function(u){function a(c,s,l,r,n,o,i,f,h){var T=u.call(this,c,"cursor",s,!0,l,r,o,i)||this;return T._onRequestRedraw=n,T._coreService=f,T._coreBrowserService=h,T._cell=new E.CellData,T._state={x:0,y:0,isFocused:!1,style:"",width:0},T._cursorRenderers={bar:T._renderBarCursor.bind(T),block:T._renderBlockCursor.bind(T),underline:T._renderUnderlineCursor.bind(T)},T}return O(a,u),a.prototype.resize=function(c){u.prototype.resize.call(this,c),this._state={x:0,y:0,isFocused:!1,style:"",width:0}},a.prototype.reset=function(){this._clearCursor(),this._cursorBlinkStateManager&&(this._cursorBlinkStateManager.dispose(),this._cursorBlinkStateManager=void 0,this.onOptionsChanged())},a.prototype.onBlur=function(){this._cursorBlinkStateManager&&this._cursorBlinkStateManager.pause(),this._onRequestRedraw.fire({start:this._bufferService.buffer.y,end:this._bufferService.buffer.y})},a.prototype.onFocus=function(){this._cursorBlinkStateManager?this._cursorBlinkStateManager.resume():this._onRequestRedraw.fire({start:this._bufferService.buffer.y,end:this._bufferService.buffer.y})},a.prototype.onOptionsChanged=function(){var c,s=this;this._optionsService.options.cursorBlink?this._cursorBlinkStateManager||(this._cursorBlinkStateManager=new v(this._coreBrowserService.isFocused,function(){s._render(!0)})):((c=this._cursorBlinkStateManager)===null||c===void 0||c.dispose(),this._cursorBlinkStateManager=void 0),this._onRequestRedraw.fire({start:this._bufferService.buffer.y,end:this._bufferService.buffer.y})},a.prototype.onCursorMove=function(){this._cursorBlinkStateManager&&this._cursorBlinkStateManager.restartBlinkAnimation()},a.prototype.onGridChanged=function(c,s){!this._cursorBlinkStateManager||this._cursorBlinkStateManager.isPaused?this._render(!1):this._cursorBlinkStateManager.restartBlinkAnimation()},a.prototype._render=function(c){if(this._coreService.isCursorInitialized&&!this._coreService.isCursorHidden){var s=this._bufferService.buffer.ybase+this._bufferService.buffer.y,l=s-this._bufferService.buffer.ydisp;if(l<0||l>=this._bufferService.rows)this._clearCursor();else{var r=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1);if(this._bufferService.buffer.lines.get(s).loadCell(r,this._cell),this._cell.content!==void 0){if(!this._coreBrowserService.isFocused){this._clearCursor(),this._ctx.save(),this._ctx.fillStyle=this._colors.cursor.css;var n=this._optionsService.options.cursorStyle;return n&&n!=="block"?this._cursorRenderers[n](r,l,this._cell):this._renderBlurCursor(r,l,this._cell),this._ctx.restore(),this._state.x=r,this._state.y=l,this._state.isFocused=!1,this._state.style=n,void(this._state.width=this._cell.getWidth())}if(!this._cursorBlinkStateManager||this._cursorBlinkStateManager.isCursorVisible){if(this._state){if(this._state.x===r&&this._state.y===l&&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"](r,l,this._cell),this._ctx.restore(),this._state.x=r,this._state.y=l,this._state.isFocused=!1,this._state.style=this._optionsService.options.cursorStyle,this._state.width=this._cell.getWidth()}else this._clearCursor()}}}else this._clearCursor()},a.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})},a.prototype._renderBarCursor=function(c,s,l){this._ctx.save(),this._ctx.fillStyle=this._colors.cursor.css,this._fillLeftLineAtCell(c,s,this._optionsService.options.cursorWidth),this._ctx.restore()},a.prototype._renderBlockCursor=function(c,s,l){this._ctx.save(),this._ctx.fillStyle=this._colors.cursor.css,this._fillCells(c,s,l.getWidth(),1),this._ctx.fillStyle=this._colors.cursorAccent.css,this._fillCharTrueColor(l,c,s),this._ctx.restore()},a.prototype._renderUnderlineCursor=function(c,s,l){this._ctx.save(),this._ctx.fillStyle=this._colors.cursor.css,this._fillBottomLineAtCells(c,s),this._ctx.restore()},a.prototype._renderBlurCursor=function(c,s,l){this._ctx.save(),this._ctx.strokeStyle=this._colors.cursor.css,this._strokeRectAtCell(c,s,l.getWidth(),1),this._ctx.restore()},a}(d.BaseRenderLayer);k.CursorRenderLayer=y;var v=function(){function u(a,c){this._renderCallback=c,this.isCursorVisible=!0,a&&this._restartInterval()}return Object.defineProperty(u.prototype,"isPaused",{get:function(){return!(this._blinkStartTimeout||this._blinkInterval)},enumerable:!1,configurable:!0}),u.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)},u.prototype.restartBlinkAnimation=function(){var a=this;this.isPaused||(this._animationTimeRestarted=Date.now(),this.isCursorVisible=!0,this._animationFrame||(this._animationFrame=window.requestAnimationFrame(function(){a._renderCallback(),a._animationFrame=void 0})))},u.prototype._restartInterval=function(a){var c=this;a===void 0&&(a=600),this._blinkInterval&&window.clearInterval(this._blinkInterval),this._blinkStartTimeout=window.setTimeout(function(){if(c._animationTimeRestarted){var s=600-(Date.now()-c._animationTimeRestarted);if(c._animationTimeRestarted=void 0,s>0)return void c._restartInterval(s)}c.isCursorVisible=!1,c._animationFrame=window.requestAnimationFrame(function(){c._renderCallback(),c._animationFrame=void 0}),c._blinkInterval=window.setInterval(function(){if(c._animationTimeRestarted){var l=600-(Date.now()-c._animationTimeRestarted);return c._animationTimeRestarted=void 0,void c._restartInterval(l)}c.isCursorVisible=!c.isCursorVisible,c._animationFrame=window.requestAnimationFrame(function(){c._renderCallback(),c._animationFrame=void 0})},600)},a)},u.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)},u.prototype.resume=function(){this.pause(),this._animationTimeRestarted=void 0,this._restartInterval(),this.restartBlinkAnimation()},u}()},function(j,k,D){"use strict";var R,O=this&&this.__extends||(R=function(u,a){return(R=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(c,s){c.__proto__=s}||function(c,s){for(var l in s)s.hasOwnProperty(l)&&(c[l]=s[l])})(u,a)},function(u,a){function c(){this.constructor=u}R(u,a),u.prototype=a===null?Object.create(a):(c.prototype=a.prototype,new c)});Object.defineProperty(k,"__esModule",{value:!0}),k.LinkRenderLayer=void 0;var d=D(13),E=D(9),y=D(26),v=function(u){function a(c,s,l,r,n,o,i,f){var h=u.call(this,c,"link",s,!0,l,r,i,f)||this;return n.onShowLinkUnderline(function(T){return h._onShowLinkUnderline(T)}),n.onHideLinkUnderline(function(T){return h._onHideLinkUnderline(T)}),o.onShowLinkUnderline(function(T){return h._onShowLinkUnderline(T)}),o.onHideLinkUnderline(function(T){return h._onHideLinkUnderline(T)}),h}return O(a,u),a.prototype.resize=function(c){u.prototype.resize.call(this,c),this._state=void 0},a.prototype.reset=function(){this._clearCurrentLink()},a.prototype._clearCurrentLink=function(){if(this._state){this._clearCells(this._state.x1,this._state.y1,this._state.cols-this._state.x1,1);var c=this._state.y2-this._state.y1-1;c>0&&this._clearCells(0,this._state.y1+1,this._state.cols,c),this._clearCells(0,this._state.y2,this._state.x2,1),this._state=void 0}},a.prototype._onShowLinkUnderline=function(c){if(c.fg===E.INVERTED_DEFAULT_COLOR?this._ctx.fillStyle=this._colors.background.css:c.fg&&y.is256Color(c.fg)?this._ctx.fillStyle=this._colors.ansi[c.fg].css:this._ctx.fillStyle=this._colors.foreground.css,c.y1===c.y2)this._fillBottomLineAtCells(c.x1,c.y1,c.x2-c.x1);else{this._fillBottomLineAtCells(c.x1,c.y1,c.cols-c.x1);for(var s=c.y1+1;s<c.y2;s++)this._fillBottomLineAtCells(0,s,c.cols);this._fillBottomLineAtCells(0,c.y2,c.x2)}this._state=c},a.prototype._onHideLinkUnderline=function(c){this._clearCurrentLink()},a}(d.BaseRenderLayer);k.LinkRenderLayer=v},function(j,k,D){"use strict";var R=this&&this.__decorate||function(u,a,c,s){var l,r=arguments.length,n=r<3?a:s===null?s=Object.getOwnPropertyDescriptor(a,c):s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(u,a,c,s);else for(var o=u.length-1;o>=0;o--)(l=u[o])&&(n=(r<3?l(n):r>3?l(a,c,n):l(a,c))||n);return r>3&&n&&Object.defineProperty(a,c,n),n},O=this&&this.__param||function(u,a){return function(c,s){a(c,s,u)}};Object.defineProperty(k,"__esModule",{value:!0}),k.MouseZone=k.Linkifier=void 0;var d=D(0),E=D(1),y=function(){function u(a,c,s){this._bufferService=a,this._logService=c,this._unicodeService=s,this._linkMatchers=[],this._nextLinkMatcherId=0,this._onShowLinkUnderline=new d.EventEmitter,this._onHideLinkUnderline=new d.EventEmitter,this._onLinkTooltip=new d.EventEmitter,this._rowsToLinkify={start:void 0,end:void 0}}return Object.defineProperty(u.prototype,"onShowLinkUnderline",{get:function(){return this._onShowLinkUnderline.event},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"onHideLinkUnderline",{get:function(){return this._onHideLinkUnderline.event},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"onLinkTooltip",{get:function(){return this._onLinkTooltip.event},enumerable:!1,configurable:!0}),u.prototype.attachToDom=function(a,c){this._element=a,this._mouseZoneManager=c},u.prototype.linkifyRows=function(a,c){var s=this;this._mouseZoneManager&&(this._rowsToLinkify.start===void 0||this._rowsToLinkify.end===void 0?(this._rowsToLinkify.start=a,this._rowsToLinkify.end=c):(this._rowsToLinkify.start=Math.min(this._rowsToLinkify.start,a),this._rowsToLinkify.end=Math.max(this._rowsToLinkify.end,c)),this._mouseZoneManager.clearAll(a,c),this._rowsTimeoutId&&clearTimeout(this._rowsTimeoutId),this._rowsTimeoutId=setTimeout(function(){return s._linkifyRows()},u._timeBeforeLatency))},u.prototype._linkifyRows=function(){this._rowsTimeoutId=void 0;var a=this._bufferService.buffer;if(this._rowsToLinkify.start!==void 0&&this._rowsToLinkify.end!==void 0){var c=a.ydisp+this._rowsToLinkify.start;if(!(c>=a.lines.length)){for(var s=a.ydisp+Math.min(this._rowsToLinkify.end,this._bufferService.rows)+1,l=Math.ceil(2e3/this._bufferService.cols),r=this._bufferService.buffer.iterator(!1,c,s,l,l);r.hasNext();)for(var n=r.next(),o=0;o<this._linkMatchers.length;o++)this._doLinkifyRow(n.range.first,n.content,this._linkMatchers[o]);this._rowsToLinkify.start=void 0,this._rowsToLinkify.end=void 0}}else this._logService.debug("_rowToLinkify was unset before _linkifyRows was called")},u.prototype.registerLinkMatcher=function(a,c,s){if(s===void 0&&(s={}),!c)throw new Error("handler must be defined");var l={id:this._nextLinkMatcherId++,regex:a,handler:c,matchIndex:s.matchIndex,validationCallback:s.validationCallback,hoverTooltipCallback:s.tooltipCallback,hoverLeaveCallback:s.leaveCallback,willLinkActivate:s.willLinkActivate,priority:s.priority||0};return this._addLinkMatcherToList(l),l.id},u.prototype._addLinkMatcherToList=function(a){if(this._linkMatchers.length!==0){for(var c=this._linkMatchers.length-1;c>=0;c--)if(a.priority<=this._linkMatchers[c].priority)return void this._linkMatchers.splice(c+1,0,a);this._linkMatchers.splice(0,0,a)}else this._linkMatchers.push(a)},u.prototype.deregisterLinkMatcher=function(a){for(var c=0;c<this._linkMatchers.length;c++)if(this._linkMatchers[c].id===a)return this._linkMatchers.splice(c,1),!0;return!1},u.prototype._doLinkifyRow=function(a,c,s){for(var l,r=this,n=new RegExp(s.regex.source,(s.regex.flags||"")+"g"),o=-1,i=function(){var h=l[typeof s.matchIndex!="number"?0:s.matchIndex];if(!h)return f._logService.debug("match found without corresponding matchIndex",l,s),"break";if(o=c.indexOf(h,o+1),n.lastIndex=o+h.length,o<0)return"break";var T=f._bufferService.buffer.stringIndexToBufferIndex(a,o);if(T[0]<0)return"break";var g=f._bufferService.buffer.lines.get(T[0]);if(!g)return"break";var w=g.getFg(T[1]),C=w?w>>9&511:void 0;s.validationCallback?s.validationCallback(h,function(x){r._rowsTimeoutId||x&&r._addLink(T[1],T[0]-r._bufferService.buffer.ydisp,h,s,C)}):f._addLink(T[1],T[0]-f._bufferService.buffer.ydisp,h,s,C)},f=this;(l=n.exec(c))!==null&&!(i()==="break"););},u.prototype._addLink=function(a,c,s,l,r){var n=this;if(this._mouseZoneManager&&this._element){var o=this._unicodeService.getStringCellWidth(s),i=a%this._bufferService.cols,f=c+Math.floor(a/this._bufferService.cols),h=(i+o)%this._bufferService.cols,T=f+Math.floor((i+o)/this._bufferService.cols);h===0&&(h=this._bufferService.cols,T--),this._mouseZoneManager.add(new v(i+1,f+1,h+1,T+1,function(g){if(l.handler)return l.handler(g,s);var w=window.open();w?(w.opener=null,w.location.href=s):console.warn("Opening link blocked as opener could not be cleared")},function(){n._onShowLinkUnderline.fire(n._createLinkHoverEvent(i,f,h,T,r)),n._element.classList.add("xterm-cursor-pointer")},function(g){n._onLinkTooltip.fire(n._createLinkHoverEvent(i,f,h,T,r)),l.hoverTooltipCallback&&l.hoverTooltipCallback(g,s,{start:{x:i,y:f},end:{x:h,y:T}})},function(){n._onHideLinkUnderline.fire(n._createLinkHoverEvent(i,f,h,T,r)),n._element.classList.remove("xterm-cursor-pointer"),l.hoverLeaveCallback&&l.hoverLeaveCallback()},function(g){return!l.willLinkActivate||l.willLinkActivate(g,s)}))}},u.prototype._createLinkHoverEvent=function(a,c,s,l,r){return{x1:a,y1:c,x2:s,y2:l,cols:this._bufferService.cols,fg:r}},u._timeBeforeLatency=200,u=R([O(0,E.IBufferService),O(1,E.ILogService),O(2,E.IUnicodeService)],u)}();k.Linkifier=y;var v=function(u,a,c,s,l,r,n,o,i){this.x1=u,this.y1=a,this.x2=c,this.y2=s,this.clickCallback=l,this.hoverCallback=r,this.tooltipCallback=n,this.leaveCallback=o,this.willLinkActivate=i};k.MouseZone=v},function(j,k,D){"use strict";var R,O=this&&this.__extends||(R=function(h,T){return(R=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,w){g.__proto__=w}||function(g,w){for(var C in w)w.hasOwnProperty(C)&&(g[C]=w[C])})(h,T)},function(h,T){function g(){this.constructor=h}R(h,T),h.prototype=T===null?Object.create(T):(g.prototype=T.prototype,new g)}),d=this&&this.__decorate||function(h,T,g,w){var C,x=arguments.length,b=x<3?T:w===null?w=Object.getOwnPropertyDescriptor(T,g):w;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")b=Reflect.decorate(h,T,g,w);else for(var S=h.length-1;S>=0;S--)(C=h[S])&&(b=(x<3?C(b):x>3?C(T,g,b):C(T,g))||b);return x>3&&b&&Object.defineProperty(T,g,b),b},E=this&&this.__param||function(h,T){return function(g,w){T(g,w,h)}};Object.defineProperty(k,"__esModule",{value:!0}),k.SelectionService=void 0;var y=D(11),v=D(52),u=D(4),a=D(0),c=D(5),s=D(1),l=D(30),r=D(53),n=D(2),o=String.fromCharCode(160),i=new RegExp(o,"g"),f=function(h){function T(g,w,C,x,b,S,A){var p=h.call(this)||this;return p._element=g,p._screenElement=w,p._bufferService=C,p._coreService=x,p._mouseService=b,p._optionsService=S,p._renderService=A,p._dragScrollAmount=0,p._enabled=!0,p._workCell=new u.CellData,p._mouseDownTimeStamp=0,p._onLinuxMouseSelection=p.register(new a.EventEmitter),p._onRedrawRequest=p.register(new a.EventEmitter),p._onSelectionChange=p.register(new a.EventEmitter),p._onRequestScrollLines=p.register(new a.EventEmitter),p._mouseMoveListener=function(I){return p._onMouseMove(I)},p._mouseUpListener=function(I){return p._onMouseUp(I)},p._coreService.onUserInput(function(){p.hasSelection&&p.clearSelection()}),p._trimListener=p._bufferService.buffer.lines.onTrim(function(I){return p._onTrim(I)}),p.register(p._bufferService.buffers.onBufferActivate(function(I){return p._onBufferActivate(I)})),p.enable(),p._model=new v.SelectionModel(p._bufferService),p._activeSelectionMode=0,p}return O(T,h),Object.defineProperty(T.prototype,"onLinuxMouseSelection",{get:function(){return this._onLinuxMouseSelection.event},enumerable:!1,configurable:!0}),Object.defineProperty(T.prototype,"onRequestRedraw",{get:function(){return this._onRedrawRequest.event},enumerable:!1,configurable:!0}),Object.defineProperty(T.prototype,"onSelectionChange",{get:function(){return this._onSelectionChange.event},enumerable:!1,configurable:!0}),Object.defineProperty(T.prototype,"onRequestScrollLines",{get:function(){return this._onRequestScrollLines.event},enumerable:!1,configurable:!0}),T.prototype.dispose=function(){this._removeMouseDownListeners()},T.prototype.reset=function(){this.clearSelection()},T.prototype.disable=function(){this.clearSelection(),this._enabled=!1},T.prototype.enable=function(){this._enabled=!0},Object.defineProperty(T.prototype,"selectionStart",{get:function(){return this._model.finalSelectionStart},enumerable:!1,configurable:!0}),Object.defineProperty(T.prototype,"selectionEnd",{get:function(){return this._model.finalSelectionEnd},enumerable:!1,configurable:!0}),Object.defineProperty(T.prototype,"hasSelection",{get:function(){var g=this._model.finalSelectionStart,w=this._model.finalSelectionEnd;return!(!g||!w)&&(g[0]!==w[0]||g[1]!==w[1])},enumerable:!1,configurable:!0}),Object.defineProperty(T.prototype,"selectionText",{get:function(){var g=this._model.finalSelectionStart,w=this._model.finalSelectionEnd;if(!g||!w)return"";var C=this._bufferService.buffer,x=[];if(this._activeSelectionMode===3){if(g[0]===w[0])return"";for(var b=g[1];b<=w[1];b++){var S=C.translateBufferLineToString(b,!0,g[0],w[0]);x.push(S)}}else{var A=g[1]===w[1]?w[0]:void 0;for(x.push(C.translateBufferLineToString(g[1],!0,g[0],A)),b=g[1]+1;b<=w[1]-1;b++){var p=C.lines.get(b);S=C.translateBufferLineToString(b,!0),p&&p.isWrapped?x[x.length-1]+=S:x.push(S)}g[1]!==w[1]&&(p=C.lines.get(w[1]),S=C.translateBufferLineToString(w[1],!0,0,w[0]),p&&p.isWrapped?x[x.length-1]+=S:x.push(S))}return x.map(function(I){return I.replace(i," ")}).join(y.isWindows?`\r
|
|
|
`:`
|
|
|
`)},enumerable:!1,configurable:!0}),T.prototype.clearSelection=function(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()},T.prototype.refresh=function(g){var w=this;(this._refreshAnimationFrame||(this._refreshAnimationFrame=window.requestAnimationFrame(function(){return w._refresh()})),y.isLinux&&g)&&this.selectionText.length&&this._onLinuxMouseSelection.fire(this.selectionText)},T.prototype._refresh=function(){this._refreshAnimationFrame=void 0,this._onRedrawRequest.fire({start:this._model.finalSelectionStart,end:this._model.finalSelectionEnd,columnSelectMode:this._activeSelectionMode===3})},T.prototype.isClickInSelection=function(g){var w=this._getMouseBufferCoords(g),C=this._model.finalSelectionStart,x=this._model.finalSelectionEnd;return!!(C&&x&&w)&&this._areCoordsInSelection(w,C,x)},T.prototype._areCoordsInSelection=function(g,w,C){return g[1]>w[1]&&g[1]<C[1]||w[1]===C[1]&&g[1]===w[1]&&g[0]>=w[0]&&g[0]<C[0]||w[1]<C[1]&&g[1]===C[1]&&g[0]<C[0]||w[1]<C[1]&&g[1]===w[1]&&g[0]>=w[0]},T.prototype.selectWordAtCursor=function(g){var w=this._getMouseBufferCoords(g);w&&(this._selectWordAt(w,!1),this._model.selectionEnd=void 0,this.refresh(!0))},T.prototype.selectAll=function(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()},T.prototype.selectLines=function(g,w){this._model.clearSelection(),g=Math.max(g,0),w=Math.min(w,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,g],this._model.selectionEnd=[this._bufferService.cols,w],this.refresh(),this._onSelectionChange.fire()},T.prototype._onTrim=function(g){this._model.onTrim(g)&&this.refresh()},T.prototype._getMouseBufferCoords=function(g){var w=this._mouseService.getCoords(g,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(w)return w[0]--,w[1]--,w[1]+=this._bufferService.buffer.ydisp,w},T.prototype._getMouseEventScrollAmount=function(g){var w=l.getCoordsRelativeToElement(g,this._screenElement)[1],C=this._renderService.dimensions.canvasHeight;return w>=0&&w<=C?0:(w>C&&(w-=C),w=Math.min(Math.max(w,-50),50),(w/=50)/Math.abs(w)+Math.round(14*w))},T.prototype.shouldForceSelection=function(g){return y.isMac?g.altKey&&this._optionsService.options.macOptionClickForcesSelection:g.shiftKey},T.prototype.onMouseDown=function(g){if(this._mouseDownTimeStamp=g.timeStamp,(g.button!==2||!this.hasSelection)&&g.button===0){if(!this._enabled){if(!this.shouldForceSelection(g))return;g.stopPropagation()}g.preventDefault(),this._dragScrollAmount=0,this._enabled&&g.shiftKey?this._onIncrementalClick(g):g.detail===1?this._onSingleClick(g):g.detail===2?this._onDoubleClick(g):g.detail===3&&this._onTripleClick(g),this._addMouseDownListeners(),this.refresh(!0)}},T.prototype._addMouseDownListeners=function(){var g=this;this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.addEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.addEventListener("mouseup",this._mouseUpListener)),this._dragScrollIntervalTimer=window.setInterval(function(){return g._dragScroll()},50)},T.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},T.prototype._onIncrementalClick=function(g){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(g))},T.prototype._onSingleClick=function(g){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(g)?3:0,this._model.selectionStart=this._getMouseBufferCoords(g),this._model.selectionStart){this._model.selectionEnd=void 0;var w=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);w&&w.length!==this._model.selectionStart[0]&&w.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}},T.prototype._onDoubleClick=function(g){var w=this._getMouseBufferCoords(g);w&&(this._activeSelectionMode=1,this._selectWordAt(w,!0))},T.prototype._onTripleClick=function(g){var w=this._getMouseBufferCoords(g);w&&(this._activeSelectionMode=2,this._selectLineAt(w[1]))},T.prototype.shouldColumnSelect=function(g){return g.altKey&&!(y.isMac&&this._optionsService.options.macOptionClickForcesSelection)},T.prototype._onMouseMove=function(g){if(g.stopImmediatePropagation(),this._model.selectionStart){var w=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(g),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(g),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 x=C.lines.get(this._model.selectionEnd[1]);x&&x.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]++}w&&w[0]===this._model.selectionEnd[0]&&w[1]===this._model.selectionEnd[1]||this.refresh(!0)}else this.refresh(!0)}},T.prototype._dragScroll=function(){if(this._model.selectionEnd&&this._model.selectionStart&&this._dragScrollAmount){this._onRequestScrollLines.fire({amount:this._dragScrollAmount,suppressScrollEvent:!1});var g=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(g.ydisp+this._bufferService.rows,g.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=g.ydisp),this.refresh()}},T.prototype._onMouseUp=function(g){var w=g.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&w<500&&g.altKey){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){var C=this._mouseService.getCoords(g,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(C&&C[0]!==void 0&&C[1]!==void 0){var x=r.moveToCellSequence(C[0]-1,C[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(x,!0)}}}else this.hasSelection&&this._onSelectionChange.fire()},T.prototype._onBufferActivate=function(g){var w=this;this.clearSelection(),this._trimListener.dispose(),this._trimListener=g.activeBuffer.lines.onTrim(function(C){return w._onTrim(C)})},T.prototype._convertViewportColToCharacterIndex=function(g,w){for(var C=w[0],x=0;w[0]>=x;x++){var b=g.loadCell(x,this._workCell).getChars().length;this._workCell.getWidth()===0?C--:b>1&&w[0]!==x&&(C+=b-1)}return C},T.prototype.setSelection=function(g,w,C){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[g,w],this._model.selectionStartLength=C,this.refresh()},T.prototype._getWordAt=function(g,w,C,x){if(C===void 0&&(C=!0),x===void 0&&(x=!0),!(g[0]>=this._bufferService.cols)){var b=this._bufferService.buffer,S=b.lines.get(g[1]);if(S){var A=b.translateBufferLineToString(g[1],!1),p=this._convertViewportColToCharacterIndex(S,g),I=p,M=g[0]-p,P=0,B=0,H=0,F=0;if(A.charAt(p)===" "){for(;p>0&&A.charAt(p-1)===" ";)p--;for(;I<A.length&&A.charAt(I+1)===" ";)I++}else{var W=g[0],U=g[0];S.getWidth(W)===0&&(P++,W--),S.getWidth(U)===2&&(B++,U++);var K=S.getString(U).length;for(K>1&&(F+=K-1,I+=K-1);W>0&&p>0&&!this._isCharWordSeparator(S.loadCell(W-1,this._workCell));){S.loadCell(W-1,this._workCell);var G=this._workCell.getChars().length;this._workCell.getWidth()===0?(P++,W--):G>1&&(H+=G-1,p-=G-1),p--,W--}for(;U<S.length&&I+1<A.length&&!this._isCharWordSeparator(S.loadCell(U+1,this._workCell));){S.loadCell(U+1,this._workCell);var ae=this._workCell.getChars().length;this._workCell.getWidth()===2?(B++,U++):ae>1&&(F+=ae-1,I+=ae-1),I++,U++}}I++;var fe=p+M-P+H,Se=Math.min(this._bufferService.cols,I-p+P+B-H-F);if(w||A.slice(p,I).trim()!==""){if(C&&fe===0&&S.getCodePoint(0)!==32){var Ue=b.lines.get(g[1]-1);if(Ue&&S.isWrapped&&Ue.getCodePoint(this._bufferService.cols-1)!==32){var Ne=this._getWordAt([this._bufferService.cols-1,g[1]-1],!1,!0,!1);if(Ne){var xe=this._bufferService.cols-Ne.start;fe-=xe,Se+=xe}}}if(x&&fe+Se===this._bufferService.cols&&S.getCodePoint(this._bufferService.cols-1)!==32){var Ce=b.lines.get(g[1]+1);if(Ce&&Ce.isWrapped&&Ce.getCodePoint(0)!==32){var De=this._getWordAt([0,g[1]+1],!1,!1,!0);De&&(Se+=De.length)}}return{start:fe,length:Se}}}}},T.prototype._selectWordAt=function(g,w){var C=this._getWordAt(g,w);if(C){for(;C.start<0;)C.start+=this._bufferService.cols,g[1]--;this._model.selectionStart=[C.start,g[1]],this._model.selectionStartLength=C.length}},T.prototype._selectToWordAt=function(g){var w=this._getWordAt(g,!0);if(w){for(var C=g[1];w.start<0;)w.start+=this._bufferService.cols,C--;if(!this._model.areSelectionValuesReversed())for(;w.start+w.length>this._bufferService.cols;)w.length-=this._bufferService.cols,C++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?w.start:w.start+w.length,C]}},T.prototype._isCharWordSeparator=function(g){return g.getWidth()!==0&&this._optionsService.options.wordSeparator.indexOf(g.getChars())>=0},T.prototype._selectLineAt=function(g){var w=this._bufferService.buffer.getWrappedRangeForLine(g);this._model.selectionStart=[0,w.first],this._model.selectionEnd=[this._bufferService.cols,w.last],this._model.selectionStartLength=0},T=d([E(2,s.IBufferService),E(3,s.ICoreService),E(4,c.IMouseService),E(5,s.IOptionsService),E(6,c.IRenderService)],T)}(n.Disposable);k.SelectionService=f},function(j,k,D){"use strict";Object.defineProperty(k,"__esModule",{value:!0}),k.SelectionModel=void 0;var R=function(){function O(d){this._bufferService=d,this.isSelectAllActive=!1,this.selectionStartLength=0}return O.prototype.clearSelection=function(){this.selectionStart=void 0,this.selectionEnd=void 0,this.isSelectAllActive=!1,this.selectionStartLength=0},Object.defineProperty(O.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(O.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 d=this.selectionStart[0]+this.selectionStartLength;return d>this._bufferService.cols?[d%this._bufferService.cols,this.selectionStart[1]+Math.floor(d/this._bufferService.cols)]:[d,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}),O.prototype.areSelectionValuesReversed=function(){var d=this.selectionStart,E=this.selectionEnd;return!(!d||!E)&&(d[1]>E[1]||d[1]===E[1]&&d[0]>E[0])},O.prototype.onTrim=function(d){return this.selectionStart&&(this.selectionStart[1]-=d),this.selectionEnd&&(this.selectionEnd[1]-=d),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)},O}();k.SelectionModel=R},function(j,k,D){"use strict";Object.defineProperty(k,"__esModule",{value:!0}),k.moveToCellSequence=void 0;var R=D(12);function O(a,c,s,l){var r=a-d(s,a),n=c-d(s,c);return u(Math.abs(r-n)-function(o,i,f){for(var h=0,T=o-d(f,o),g=i-d(f,i),w=0;w<Math.abs(T-g);w++){var C=E(o,i)==="A"?-1:1,x=f.buffer.lines.get(T+C*w);x&&x.isWrapped&&h++}return h}(a,c,s),v(E(a,c),l))}function d(a,c){for(var s=0,l=a.buffer.lines.get(c),r=l&&l.isWrapped;r&&c>=0&&c<a.rows;)s++,r=(l=a.buffer.lines.get(--c))&&l.isWrapped;return s}function E(a,c){return a>c?"A":"B"}function y(a,c,s,l,r,n){for(var o=a,i=c,f="";o!==s||i!==l;)o+=r?1:-1,r&&o>n.cols-1?(f+=n.buffer.translateBufferLineToString(i,!1,a,o),o=0,a=0,i++):!r&&o<0&&(f+=n.buffer.translateBufferLineToString(i,!1,0,a+1),a=o=n.cols-1,i--);return f+n.buffer.translateBufferLineToString(i,!1,a,o)}function v(a,c){var s=c?"O":"[";return R.C0.ESC+s+a}function u(a,c){a=Math.floor(a);for(var s="",l=0;l<a;l++)s+=c;return s}k.moveToCellSequence=function(a,c,s,l){var r,n=s.buffer.x,o=s.buffer.y;if(!s.buffer.hasScrollback)return function(f,h,T,g,w,C){return O(h,g,w,C).length===0?"":u(y(f,h,f,h-d(w,h),!1,w).length,v("D",C))}(n,o,0,c,s,l)+O(o,c,s,l)+function(f,h,T,g,w,C){var x;x=O(h,g,w,C).length>0?g-d(w,g):h;var b=g,S=function(A,p,I,M,P,B){var H;return H=O(I,M,P,B).length>0?M-d(P,M):p,A<I&&H<=M||A>=I&&H<M?"C":"D"}(f,h,T,g,w,C);return u(y(f,x,T,b,S==="C",w).length,v(S,C))}(n,o,a,c,s,l);if(o===c)return r=n>a?"D":"C",u(Math.abs(n-a),v(r,l));r=o>c?"D":"C";var i=Math.abs(o-c);return u(function(f,h){return h.cols-f}(o>c?a:n,s)+(i-1)*s.cols+1+((o>c?n:a)-1),v(r,l))}},function(j,k,D){"use strict";var R=this&&this.__decorate||function(y,v,u,a){var c,s=arguments.length,l=s<3?v:a===null?a=Object.getOwnPropertyDescriptor(v,u):a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")l=Reflect.decorate(y,v,u,a);else for(var r=y.length-1;r>=0;r--)(c=y[r])&&(l=(s<3?c(l):s>3?c(v,u,l):c(v,u))||l);return s>3&&l&&Object.defineProperty(v,u,l),l},O=this&&this.__param||function(y,v){return function(u,a){v(u,a,y)}};Object.defineProperty(k,"__esModule",{value:!0}),k.SoundService=void 0;var d=D(1),E=function(){function y(v){this._optionsService=v}return Object.defineProperty(y,"audioContext",{get:function(){if(!y._audioContext){var v=window.AudioContext||window.webkitAudioContext;if(!v)return console.warn("Web Audio API is not supported by this browser. Consider upgrading to the latest version"),null;y._audioContext=new v}return y._audioContext},enumerable:!1,configurable:!0}),y.prototype.playBellSound=function(){var v=y.audioContext;if(v){var u=v.createBufferSource();v.decodeAudioData(this._base64ToArrayBuffer(this._removeMimeType(this._optionsService.options.bellSound)),function(a){u.buffer=a,u.connect(v.destination),u.start(0)})}},y.prototype._base64ToArrayBuffer=function(v){for(var u=window.atob(v),a=u.length,c=new Uint8Array(a),s=0;s<a;s++)c[s]=u.charCodeAt(s);return c.buffer},y.prototype._removeMimeType=function(v){return v.split(",")[1]},y=R([O(0,d.IOptionsService)],y)}();k.SoundService=E},function(j,k,D){"use strict";var R,O=this&&this.__extends||(R=function(s,l){return(R=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var o in n)n.hasOwnProperty(o)&&(r[o]=n[o])})(s,l)},function(s,l){function r(){this.constructor=s}R(s,l),s.prototype=l===null?Object.create(l):(r.prototype=l.prototype,new r)}),d=this&&this.__decorate||function(s,l,r,n){var o,i=arguments.length,f=i<3?l:n===null?n=Object.getOwnPropertyDescriptor(l,r):n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")f=Reflect.decorate(s,l,r,n);else for(var h=s.length-1;h>=0;h--)(o=s[h])&&(f=(i<3?o(f):i>3?o(l,r,f):o(l,r))||f);return i>3&&f&&Object.defineProperty(l,r,f),f},E=this&&this.__param||function(s,l){return function(r,n){l(r,n,s)}};Object.defineProperty(k,"__esModule",{value:!0}),k.MouseZoneManager=void 0;var y=D(2),v=D(7),u=D(5),a=D(1),c=function(s){function l(r,n,o,i,f,h){var T=s.call(this)||this;return T._element=r,T._screenElement=n,T._bufferService=o,T._mouseService=i,T._selectionService=f,T._optionsService=h,T._zones=[],T._areZonesActive=!1,T._lastHoverCoords=[void 0,void 0],T._initialSelectionLength=0,T.register(v.addDisposableDomListener(T._element,"mousedown",function(g){return T._onMouseDown(g)})),T._mouseMoveListener=function(g){return T._onMouseMove(g)},T._mouseLeaveListener=function(g){return T._onMouseLeave(g)},T._clickListener=function(g){return T._onClick(g)},T}return O(l,s),l.prototype.dispose=function(){s.prototype.dispose.call(this),this._deactivate()},l.prototype.add=function(r){this._zones.push(r),this._zones.length===1&&this._activate()},l.prototype.clearAll=function(r,n){if(this._zones.length!==0){r&&n||(r=0,n=this._bufferService.rows-1);for(var o=0;o<this._zones.length;o++){var i=this._zones[o];(i.y1>r&&i.y1<=n+1||i.y2>r&&i.y2<=n+1||i.y1<r&&i.y2>n+1)&&(this._currentZone&&this._currentZone===i&&(this._currentZone.leaveCallback(),this._currentZone=void 0),this._zones.splice(o--,1))}this._zones.length===0&&this._deactivate()}},l.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))},l.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))},l.prototype._onMouseMove=function(r){this._lastHoverCoords[0]===r.pageX&&this._lastHoverCoords[1]===r.pageY||(this._onHover(r),this._lastHoverCoords=[r.pageX,r.pageY])},l.prototype._onHover=function(r){var n=this,o=this._findZoneEventAt(r);o!==this._currentZone&&(this._currentZone&&(this._currentZone.leaveCallback(),this._currentZone=void 0,this._tooltipTimeout&&clearTimeout(this._tooltipTimeout)),o&&(this._currentZone=o,o.hoverCallback&&o.hoverCallback(r),this._tooltipTimeout=window.setTimeout(function(){return n._onTooltip(r)},this._optionsService.options.linkTooltipHoverDuration)))},l.prototype._onTooltip=function(r){this._tooltipTimeout=void 0;var n=this._findZoneEventAt(r);n&&n.tooltipCallback&&n.tooltipCallback(r)},l.prototype._onMouseDown=function(r){if(this._initialSelectionLength=this._getSelectionLength(),this._areZonesActive){var n=this._findZoneEventAt(r);(n==null?void 0:n.willLinkActivate(r))&&(r.preventDefault(),r.stopImmediatePropagation())}},l.prototype._onMouseLeave=function(r){this._currentZone&&(this._currentZone.leaveCallback(),this._currentZone=void 0,this._tooltipTimeout&&clearTimeout(this._tooltipTimeout))},l.prototype._onClick=function(r){var n=this._findZoneEventAt(r),o=this._getSelectionLength();n&&o===this._initialSelectionLength&&(n.clickCallback(r),r.preventDefault(),r.stopImmediatePropagation())},l.prototype._getSelectionLength=function(){var r=this._selectionService.selectionText;return r?r.length:0},l.prototype._findZoneEventAt=function(r){var n=this._mouseService.getCoords(r,this._screenElement,this._bufferService.cols,this._bufferService.rows);if(n)for(var o=n[0],i=n[1],f=0;f<this._zones.length;f++){var h=this._zones[f];if(h.y1===h.y2){if(i===h.y1&&o>=h.x1&&o<h.x2)return h}else if(i===h.y1&&o>=h.x1||i===h.y2&&o<h.x2||i>h.y1&&i<h.y2)return h}},l=d([E(2,a.IBufferService),E(3,u.IMouseService),E(4,u.ISelectionService),E(5,a.IOptionsService)],l)}(y.Disposable);k.MouseZoneManager=c},function(j,k,D){"use strict";var R,O=this&&this.__extends||(R=function(l,r){return(R=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])})(l,r)},function(l,r){function n(){this.constructor=l}R(l,r),l.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)});Object.defineProperty(k,"__esModule",{value:!0}),k.AccessibilityManager=void 0;var d=D(18),E=D(11),y=D(31),v=D(7),u=D(2),a=D(32),c=D(17),s=function(l){function r(n,o){var i=l.call(this)||this;i._terminal=n,i._renderService=o,i._liveRegionLineCount=0,i._charsToConsume=[],i._charsToAnnounce="",i._accessibilityTreeRoot=document.createElement("div"),i._accessibilityTreeRoot.classList.add("xterm-accessibility"),i._rowContainer=document.createElement("div"),i._rowContainer.classList.add("xterm-accessibility-tree"),i._rowContainer.setAttribute("role","list"),i._rowElements=[];for(var f=0;f<i._terminal.rows;f++)i._rowElements[f]=i._createAccessibilityTreeNode(),i._rowContainer.appendChild(i._rowElements[f]);if(i._topBoundaryFocusListener=function(h){return i._onBoundaryFocus(h,0)},i._bottomBoundaryFocusListener=function(h){return i._onBoundaryFocus(h,1)},i._rowElements[0].addEventListener("focus",i._topBoundaryFocusListener),i._rowElements[i._rowElements.length-1].addEventListener("focus",i._bottomBoundaryFocusListener),i._refreshRowsDimensions(),i._accessibilityTreeRoot.appendChild(i._rowContainer),i._renderRowsDebouncer=new y.RenderDebouncer(i._renderRows.bind(i)),i._refreshRows(),i._liveRegion=document.createElement("div"),i._liveRegion.classList.add("live-region"),i._liveRegion.setAttribute("aria-live","assertive"),i._accessibilityTreeRoot.appendChild(i._liveRegion),!i._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");return i._terminal.element.insertAdjacentElement("afterbegin",i._accessibilityTreeRoot),i.register(i._renderRowsDebouncer),i.register(i._terminal.onResize(function(h){return i._onResize(h.rows)})),i.register(i._terminal.onRender(function(h){return i._refreshRows(h.start,h.end)})),i.register(i._terminal.onScroll(function(){return i._refreshRows()})),i.register(i._terminal.onA11yChar(function(h){return i._onChar(h)})),i.register(i._terminal.onLineFeed(function(){return i._onChar(`
|
|
|
`)})),i.register(i._terminal.onA11yTab(function(h){return i._onTab(h)})),i.register(i._terminal.onKey(function(h){return i._onKey(h.key)})),i.register(i._terminal.onBlur(function(){return i._clearLiveRegion()})),i.register(i._renderService.onDimensionsChange(function(){return i._refreshRowsDimensions()})),i._screenDprMonitor=new a.ScreenDprMonitor,i.register(i._screenDprMonitor),i._screenDprMonitor.setListener(function(){return i._refreshRowsDimensions()}),i.register(v.addDisposableDomListener(window,"resize",function(){return i._refreshRowsDimensions()})),i}return O(r,l),r.prototype.dispose=function(){l.prototype.dispose.call(this),c.removeElementFromParent(this._accessibilityTreeRoot),this._rowElements.length=0},r.prototype._onBoundaryFocus=function(n,o){var i=n.target,f=this._rowElements[o===0?1:this._rowElements.length-2];if(i.getAttribute("aria-posinset")!==(o===0?"1":""+this._terminal.buffer.lines.length)&&n.relatedTarget===f){var h,T;if(o===0?(h=i,T=this._rowElements.pop(),this._rowContainer.removeChild(T)):(h=this._rowElements.shift(),T=i,this._rowContainer.removeChild(h)),h.removeEventListener("focus",this._topBoundaryFocusListener),T.removeEventListener("focus",this._bottomBoundaryFocusListener),o===0){var g=this._createAccessibilityTreeNode();this._rowElements.unshift(g),this._rowContainer.insertAdjacentElement("afterbegin",g)}else g=this._createAccessibilityTreeNode(),this._rowElements.push(g),this._rowContainer.appendChild(g);this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(o===0?-1:1),this._rowElements[o===0?1:this._rowElements.length-2].focus(),n.preventDefault(),n.stopImmediatePropagation()}},r.prototype._onResize=function(n){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(var o=this._rowContainer.children.length;o<this._terminal.rows;o++)this._rowElements[o]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[o]);for(;this._rowElements.length>n;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()},r.prototype._createAccessibilityTreeNode=function(){var n=document.createElement("div");return n.setAttribute("role","listitem"),n.tabIndex=-1,this._refreshRowDimensions(n),n},r.prototype._onTab=function(n){for(var o=0;o<n;o++)this._onChar(" ")},r.prototype._onChar=function(n){var o=this;this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==n&&(this._charsToAnnounce+=n):this._charsToAnnounce+=n,n===`
|
|
|
`&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=d.tooMuchOutput)),E.isMac&&this._liveRegion.textContent&&this._liveRegion.textContent.length>0&&!this._liveRegion.parentNode&&setTimeout(function(){o._accessibilityTreeRoot.appendChild(o._liveRegion)},0))},r.prototype._clearLiveRegion=function(){this._liveRegion.textContent="",this._liveRegionLineCount=0,E.isMac&&c.removeElementFromParent(this._liveRegion)},r.prototype._onKey=function(n){this._clearLiveRegion(),this._charsToConsume.push(n)},r.prototype._refreshRows=function(n,o){this._renderRowsDebouncer.refresh(n,o,this._terminal.rows)},r.prototype._renderRows=function(n,o){for(var i=this._terminal.buffer,f=i.lines.length.toString(),h=n;h<=o;h++){var T=i.translateBufferLineToString(i.ydisp+h,!0),g=(i.ydisp+h+1).toString(),w=this._rowElements[h];w&&(T.length===0?w.innerHTML=" ":w.textContent=T,w.setAttribute("aria-posinset",g),w.setAttribute("aria-setsize",f))}this._announceCharacters()},r.prototype._refreshRowsDimensions=function(){if(this._renderService.dimensions.actualCellHeight){this._rowElements.length!==this._terminal.rows&&this._onResize(this._terminal.rows);for(var n=0;n<this._terminal.rows;n++)this._refreshRowDimensions(this._rowElements[n])}},r.prototype._refreshRowDimensions=function(n){n.style.height=this._renderService.dimensions.actualCellHeight+"px"},r.prototype._announceCharacters=function(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")},r}(u.Disposable);k.AccessibilityManager=s},function(j,k,D){"use strict";var R,O=this&&this.__extends||(R=function(i,f){return(R=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(h,T){h.__proto__=T}||function(h,T){for(var g in T)T.hasOwnProperty(g)&&(h[g]=T[g])})(i,f)},function(i,f){function h(){this.constructor=i}R(i,f),i.prototype=f===null?Object.create(f):(h.prototype=f.prototype,new h)}),d=this&&this.__decorate||function(i,f,h,T){var g,w=arguments.length,C=w<3?f:T===null?T=Object.getOwnPropertyDescriptor(f,h):T;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")C=Reflect.decorate(i,f,h,T);else for(var x=i.length-1;x>=0;x--)(g=i[x])&&(C=(w<3?g(C):w>3?g(f,h,C):g(f,h))||C);return w>3&&C&&Object.defineProperty(f,h,C),C},E=this&&this.__param||function(i,f){return function(h,T){f(h,T,i)}};Object.defineProperty(k,"__esModule",{value:!0}),k.DomRenderer=void 0;var y=D(58),v=D(9),u=D(2),a=D(5),c=D(1),s=D(0),l=D(10),r=D(17),n=1,o=function(i){function f(h,T,g,w,C,x,b,S,A){var p=i.call(this)||this;return p._colors=h,p._element=T,p._screenElement=g,p._viewportElement=w,p._linkifier=C,p._linkifier2=x,p._charSizeService=b,p._optionsService=S,p._bufferService=A,p._terminalClass=n++,p._rowElements=[],p._rowContainer=document.createElement("div"),p._rowContainer.classList.add("xterm-rows"),p._rowContainer.style.lineHeight="normal",p._rowContainer.setAttribute("aria-hidden","true"),p._refreshRowElements(p._bufferService.cols,p._bufferService.rows),p._selectionContainer=document.createElement("div"),p._selectionContainer.classList.add("xterm-selection"),p._selectionContainer.setAttribute("aria-hidden","true"),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._updateDimensions(),p._injectCss(),p._rowFactory=new y.DomRendererRowFactory(document,p._optionsService,p._colors),p._element.classList.add("xterm-dom-renderer-owner-"+p._terminalClass),p._screenElement.appendChild(p._rowContainer),p._screenElement.appendChild(p._selectionContainer),p._linkifier.onShowLinkUnderline(function(I){return p._onLinkHover(I)}),p._linkifier.onHideLinkUnderline(function(I){return p._onLinkLeave(I)}),p._linkifier2.onShowLinkUnderline(function(I){return p._onLinkHover(I)}),p._linkifier2.onHideLinkUnderline(function(I){return p._onLinkLeave(I)}),p}return O(f,i),Object.defineProperty(f.prototype,"onRequestRedraw",{get:function(){return new s.EventEmitter().event},enumerable:!1,configurable:!0}),f.prototype.dispose=function(){this._element.classList.remove("xterm-dom-renderer-owner-"+this._terminalClass),r.removeElementFromParent(this._rowContainer,this._selectionContainer,this._themeStyleElement,this._dimensionsStyleElement),i.prototype.dispose.call(this)},f.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 h=0,T=this._rowElements;h<T.length;h++){var g=T[h];g.style.width=this.dimensions.canvasWidth+"px",g.style.height=this.dimensions.actualCellHeight+"px",g.style.lineHeight=this.dimensions.actualCellHeight+"px",g.style.overflow="hidden"}this._dimensionsStyleElement||(this._dimensionsStyleElement=document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));var w=this._terminalSelector+" .xterm-rows span { display: inline-block; height: 100%; vertical-align: top; width: "+this.dimensions.actualCellWidth+"px}";this._dimensionsStyleElement.innerHTML=w,this._selectionContainer.style.height=this._viewportElement.style.height,this._screenElement.style.width=this.dimensions.canvasWidth+"px",this._screenElement.style.height=this.dimensions.canvasHeight+"px"},f.prototype.setColors=function(h){this._colors=h,this._injectCss()},f.prototype._injectCss=function(){var h=this;this._themeStyleElement||(this._themeStyleElement=document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));var T=this._terminalSelector+" .xterm-rows { color: "+this._colors.foreground.css+"; font-family: "+this._optionsService.options.fontFamily+"; font-size: "+this._optionsService.options.fontSize+"px;}";T+=this._terminalSelector+" span:not(."+y.BOLD_CLASS+") { font-weight: "+this._optionsService.options.fontWeight+";}"+this._terminalSelector+" span."+y.BOLD_CLASS+" { font-weight: "+this._optionsService.options.fontWeightBold+";}"+this._terminalSelector+" span."+y.ITALIC_CLASS+" { font-style: italic;}",T+="@keyframes blink_box_shadow_"+this._terminalClass+" { 50% { box-shadow: none; }}",T+="@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+"; }}",T+=this._terminalSelector+" .xterm-rows:not(.xterm-focus) ."+y.CURSOR_CLASS+"."+y.CURSOR_STYLE_BLOCK_CLASS+" { outline: 1px solid "+this._colors.cursor.css+"; outline-offset: -1px;}"+this._terminalSelector+" .xterm-rows.xterm-focus ."+y.CURSOR_CLASS+"."+y.CURSOR_BLINK_CLASS+":not(."+y.CURSOR_STYLE_BLOCK_CLASS+") { animation: blink_box_shadow_"+this._terminalClass+" 1s step-end infinite;}"+this._terminalSelector+" .xterm-rows.xterm-focus ."+y.CURSOR_CLASS+"."+y.CURSOR_BLINK_CLASS+"."+y.CURSOR_STYLE_BLOCK_CLASS+" { animation: blink_block_"+this._terminalClass+" 1s step-end infinite;}"+this._terminalSelector+" .xterm-rows.xterm-focus ."+y.CURSOR_CLASS+"."+y.CURSOR_STYLE_BLOCK_CLASS+" { background-color: "+this._colors.cursor.css+"; color: "+this._colors.cursorAccent.css+";}"+this._terminalSelector+" .xterm-rows ."+y.CURSOR_CLASS+"."+y.CURSOR_STYLE_BAR_CLASS+" { box-shadow: "+this._optionsService.options.cursorWidth+"px 0 0 "+this._colors.cursor.css+" inset;}"+this._terminalSelector+" .xterm-rows ."+y.CURSOR_CLASS+"."+y.CURSOR_STYLE_UNDERLINE_CLASS+" { box-shadow: 0 -1px 0 "+this._colors.cursor.css+" inset;}",T+=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(g,w){T+=h._terminalSelector+" .xterm-fg-"+w+" { color: "+g.css+"; }"+h._terminalSelector+" .xterm-bg-"+w+" { background-color: "+g.css+"; }"}),T+=this._terminalSelector+" .xterm-fg-"+v.INVERTED_DEFAULT_COLOR+" { color: "+l.color.opaque(this._colors.background).css+"; }"+this._terminalSelector+" .xterm-bg-"+v.INVERTED_DEFAULT_COLOR+" { background-color: "+this._colors.foreground.css+"; }",this._themeStyleElement.innerHTML=T},f.prototype.onDevicePixelRatioChange=function(){this._updateDimensions()},f.prototype._refreshRowElements=function(h,T){for(var g=this._rowElements.length;g<=T;g++){var w=document.createElement("div");this._rowContainer.appendChild(w),this._rowElements.push(w)}for(;this._rowElements.length>T;)this._rowContainer.removeChild(this._rowElements.pop())},f.prototype.onResize=function(h,T){this._refreshRowElements(h,T),this._updateDimensions()},f.prototype.onCharSizeChanged=function(){this._updateDimensions()},f.prototype.onBlur=function(){this._rowContainer.classList.remove("xterm-focus")},f.prototype.onFocus=function(){this._rowContainer.classList.add("xterm-focus")},f.prototype.onSelectionChanged=function(h,T,g){for(;this._selectionContainer.children.length;)this._selectionContainer.removeChild(this._selectionContainer.children[0]);if(h&&T){var w=h[1]-this._bufferService.buffer.ydisp,C=T[1]-this._bufferService.buffer.ydisp,x=Math.max(w,0),b=Math.min(C,this._bufferService.rows-1);if(!(x>=this._bufferService.rows||b<0)){var S=document.createDocumentFragment();if(g)S.appendChild(this._createSelectionElement(x,h[0],T[0],b-x+1));else{var A=w===x?h[0]:0,p=x===b?T[0]:this._bufferService.cols;S.appendChild(this._createSelectionElement(x,A,p));var I=b-x-1;if(S.appendChild(this._createSelectionElement(x+1,0,this._bufferService.cols,I)),x!==b){var M=C===b?T[0]:this._bufferService.cols;S.appendChild(this._createSelectionElement(b,0,M))}}this._selectionContainer.appendChild(S)}}},f.prototype._createSelectionElement=function(h,T,g,w){w===void 0&&(w=1);var C=document.createElement("div");return C.style.height=w*this.dimensions.actualCellHeight+"px",C.style.top=h*this.dimensions.actualCellHeight+"px",C.style.left=T*this.dimensions.actualCellWidth+"px",C.style.width=this.dimensions.actualCellWidth*(g-T)+"px",C},f.prototype.onCursorMove=function(){},f.prototype.onOptionsChanged=function(){this._updateDimensions(),this._injectCss()},f.prototype.clear=function(){for(var h=0,T=this._rowElements;h<T.length;h++)T[h].innerHTML=""},f.prototype.renderRows=function(h,T){for(var g=this._bufferService.buffer.ybase+this._bufferService.buffer.y,w=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),C=this._optionsService.options.cursorBlink,x=h;x<=T;x++){var b=this._rowElements[x];b.innerHTML="";var S=x+this._bufferService.buffer.ydisp,A=this._bufferService.buffer.lines.get(S),p=this._optionsService.options.cursorStyle;b.appendChild(this._rowFactory.createRow(A,S===g,p,w,C,this.dimensions.actualCellWidth,this._bufferService.cols))}},Object.defineProperty(f.prototype,"_terminalSelector",{get:function(){return".xterm-dom-renderer-owner-"+this._terminalClass},enumerable:!1,configurable:!0}),f.prototype.registerCharacterJoiner=function(h){return-1},f.prototype.deregisterCharacterJoiner=function(h){return!1},f.prototype._onLinkHover=function(h){this._setCellUnderline(h.x1,h.x2,h.y1,h.y2,h.cols,!0)},f.prototype._onLinkLeave=function(h){this._setCellUnderline(h.x1,h.x2,h.y1,h.y2,h.cols,!1)},f.prototype._setCellUnderline=function(h,T,g,w,C,x){for(;h!==T||g!==w;){var b=this._rowElements[g];if(!b)return;var S=b.children[h];S&&(S.style.textDecoration=x?"underline":"none"),++h>=C&&(h=0,g++)}},f=d([E(6,a.ICharSizeService),E(7,c.IOptionsService),E(8,c.IBufferService)],f)}(u.Disposable);k.DomRenderer=o},function(j,k,D){"use strict";Object.defineProperty(k,"__esModule",{value:!0}),k.DomRendererRowFactory=k.CURSOR_STYLE_UNDERLINE_CLASS=k.CURSOR_STYLE_BAR_CLASS=k.CURSOR_STYLE_BLOCK_CLASS=k.CURSOR_BLINK_CLASS=k.CURSOR_CLASS=k.UNDERLINE_CLASS=k.ITALIC_CLASS=k.DIM_CLASS=k.BOLD_CLASS=void 0;var R=D(9),O=D(3),d=D(4),E=D(10);k.BOLD_CLASS="xterm-bold",k.DIM_CLASS="xterm-dim",k.ITALIC_CLASS="xterm-italic",k.UNDERLINE_CLASS="xterm-underline",k.CURSOR_CLASS="xterm-cursor",k.CURSOR_BLINK_CLASS="xterm-cursor-blink",k.CURSOR_STYLE_BLOCK_CLASS="xterm-cursor-block",k.CURSOR_STYLE_BAR_CLASS="xterm-cursor-bar",k.CURSOR_STYLE_UNDERLINE_CLASS="xterm-cursor-underline";var y=function(){function u(a,c,s){this._document=a,this._optionsService=c,this._colors=s,this._workCell=new d.CellData}return u.prototype.setColors=function(a){this._colors=a},u.prototype.createRow=function(a,c,s,l,r,n,o){for(var i=this._document.createDocumentFragment(),f=0,h=Math.min(a.length,o)-1;h>=0;h--)if(a.loadCell(h,this._workCell).getCode()!==O.NULL_CELL_CODE||c&&h===l){f=h+1;break}for(h=0;h<f;h++){a.loadCell(h,this._workCell);var T=this._workCell.getWidth();if(T!==0){var g=this._document.createElement("span");if(T>1&&(g.style.width=n*T+"px"),c&&h===l)switch(g.classList.add(k.CURSOR_CLASS),r&&g.classList.add(k.CURSOR_BLINK_CLASS),s){case"bar":g.classList.add(k.CURSOR_STYLE_BAR_CLASS);break;case"underline":g.classList.add(k.CURSOR_STYLE_UNDERLINE_CLASS);break;default:g.classList.add(k.CURSOR_STYLE_BLOCK_CLASS)}this._workCell.isBold()&&g.classList.add(k.BOLD_CLASS),this._workCell.isItalic()&&g.classList.add(k.ITALIC_CLASS),this._workCell.isDim()&&g.classList.add(k.DIM_CLASS),this._workCell.isUnderline()&&g.classList.add(k.UNDERLINE_CLASS),this._workCell.isInvisible()?g.textContent=O.WHITESPACE_CELL_CHAR:g.textContent=this._workCell.getChars()||O.WHITESPACE_CELL_CHAR;var w=this._workCell.getFgColor(),C=this._workCell.getFgColorMode(),x=this._workCell.getBgColor(),b=this._workCell.getBgColorMode(),S=!!this._workCell.isInverse();if(S){var A=w;w=x,x=A;var p=C;C=b,b=p}switch(C){case 16777216:case 33554432:this._workCell.isBold()&&w<8&&this._optionsService.options.drawBoldTextInBrightColors&&(w+=8),this._applyMinimumContrast(g,this._colors.background,this._colors.ansi[w])||g.classList.add("xterm-fg-"+w);break;case 50331648:var I=E.rgba.toColor(w>>16&255,w>>8&255,255&w);this._applyMinimumContrast(g,this._colors.background,I)||this._addStyle(g,"color:#"+v(w.toString(16),"0",6));break;case 0:default:this._applyMinimumContrast(g,this._colors.background,this._colors.foreground)||S&&g.classList.add("xterm-fg-"+R.INVERTED_DEFAULT_COLOR)}switch(b){case 16777216:case 33554432:g.classList.add("xterm-bg-"+x);break;case 50331648:this._addStyle(g,"background-color:#"+v(x.toString(16),"0",6));break;case 0:default:S&&g.classList.add("xterm-bg-"+R.INVERTED_DEFAULT_COLOR)}i.appendChild(g)}}return i},u.prototype._applyMinimumContrast=function(a,c,s){if(this._optionsService.options.minimumContrastRatio===1)return!1;var l=this._colors.contrastCache.getColor(this._workCell.bg,this._workCell.fg);return l===void 0&&(l=E.color.ensureContrastRatio(c,s,this._optionsService.options.minimumContrastRatio),this._colors.contrastCache.setColor(this._workCell.bg,this._workCell.fg,l!=null?l:null)),!!l&&(this._addStyle(a,"color:"+l.css),!0)},u.prototype._addStyle=function(a,c){a.setAttribute("style",""+(a.getAttribute("style")||"")+c+";")},u}();function v(u,a,c){for(;u.length<c;)u=a+u;return u}k.DomRendererRowFactory=y},function(j,k,D){"use strict";Object.defineProperty(k,"__esModule",{value:!0}),k.evaluateKeyboardEvent=void 0;var R=D(12),O={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:["'",'"']};k.evaluateKeyboardEvent=function(d,E,y,v){var u={type:0,cancel:!1,key:void 0},a=(d.shiftKey?1:0)|(d.altKey?2:0)|(d.ctrlKey?4:0)|(d.metaKey?8:0);switch(d.keyCode){case 0:d.key==="UIKeyInputUpArrow"?u.key=E?R.C0.ESC+"OA":R.C0.ESC+"[A":d.key==="UIKeyInputLeftArrow"?u.key=E?R.C0.ESC+"OD":R.C0.ESC+"[D":d.key==="UIKeyInputRightArrow"?u.key=E?R.C0.ESC+"OC":R.C0.ESC+"[C":d.key==="UIKeyInputDownArrow"&&(u.key=E?R.C0.ESC+"OB":R.C0.ESC+"[B");break;case 8:if(d.shiftKey){u.key=R.C0.BS;break}if(d.altKey){u.key=R.C0.ESC+R.C0.DEL;break}u.key=R.C0.DEL;break;case 9:if(d.shiftKey){u.key=R.C0.ESC+"[Z";break}u.key=R.C0.HT,u.cancel=!0;break;case 13:u.key=d.altKey?R.C0.ESC+R.C0.CR:R.C0.CR,u.cancel=!0;break;case 27:u.key=R.C0.ESC,d.altKey&&(u.key=R.C0.ESC+R.C0.ESC),u.cancel=!0;break;case 37:if(d.metaKey)break;a?(u.key=R.C0.ESC+"[1;"+(a+1)+"D",u.key===R.C0.ESC+"[1;3D"&&(u.key=R.C0.ESC+(y?"b":"[1;5D"))):u.key=E?R.C0.ESC+"OD":R.C0.ESC+"[D";break;case 39:if(d.metaKey)break;a?(u.key=R.C0.ESC+"[1;"+(a+1)+"C",u.key===R.C0.ESC+"[1;3C"&&(u.key=R.C0.ESC+(y?"f":"[1;5C"))):u.key=E?R.C0.ESC+"OC":R.C0.ESC+"[C";break;case 38:if(d.metaKey)break;a?(u.key=R.C0.ESC+"[1;"+(a+1)+"A",y||u.key!==R.C0.ESC+"[1;3A"||(u.key=R.C0.ESC+"[1;5A")):u.key=E?R.C0.ESC+"OA":R.C0.ESC+"[A";break;case 40:if(d.metaKey)break;a?(u.key=R.C0.ESC+"[1;"+(a+1)+"B",y||u.key!==R.C0.ESC+"[1;3B"||(u.key=R.C0.ESC+"[1;5B")):u.key=E?R.C0.ESC+"OB":R.C0.ESC+"[B";break;case 45:d.shiftKey||d.ctrlKey||(u.key=R.C0.ESC+"[2~");break;case 46:u.key=a?R.C0.ESC+"[3;"+(a+1)+"~":R.C0.ESC+"[3~";break;case 36:u.key=a?R.C0.ESC+"[1;"+(a+1)+"H":E?R.C0.ESC+"OH":R.C0.ESC+"[H";break;case 35:u.key=a?R.C0.ESC+"[1;"+(a+1)+"F":E?R.C0.ESC+"OF":R.C0.ESC+"[F";break;case 33:d.shiftKey?u.type=2:u.key=R.C0.ESC+"[5~";break;case 34:d.shiftKey?u.type=3:u.key=R.C0.ESC+"[6~";break;case 112:u.key=a?R.C0.ESC+"[1;"+(a+1)+"P":R.C0.ESC+"OP";break;case 113:u.key=a?R.C0.ESC+"[1;"+(a+1)+"Q":R.C0.ESC+"OQ";break;case 114:u.key=a?R.C0.ESC+"[1;"+(a+1)+"R":R.C0.ESC+"OR";break;case 115:u.key=a?R.C0.ESC+"[1;"+(a+1)+"S":R.C0.ESC+"OS";break;case 116:u.key=a?R.C0.ESC+"[15;"+(a+1)+"~":R.C0.ESC+"[15~";break;case 117:u.key=a?R.C0.ESC+"[17;"+(a+1)+"~":R.C0.ESC+"[17~";break;case 118:u.key=a?R.C0.ESC+"[18;"+(a+1)+"~":R.C0.ESC+"[18~";break;case 119:u.key=a?R.C0.ESC+"[19;"+(a+1)+"~":R.C0.ESC+"[19~";break;case 120:u.key=a?R.C0.ESC+"[20;"+(a+1)+"~":R.C0.ESC+"[20~";break;case 121:u.key=a?R.C0.ESC+"[21;"+(a+1)+"~":R.C0.ESC+"[21~";break;case 122:u.key=a?R.C0.ESC+"[23;"+(a+1)+"~":R.C0.ESC+"[23~";break;case 123:u.key=a?R.C0.ESC+"[24;"+(a+1)+"~":R.C0.ESC+"[24~";break;default:if(!d.ctrlKey||d.shiftKey||d.altKey||d.metaKey)if(y&&!v||!d.altKey||d.metaKey)y&&!d.altKey&&!d.ctrlKey&&d.metaKey?d.keyCode===65&&(u.type=1):d.key&&!d.ctrlKey&&!d.altKey&&!d.metaKey&&d.keyCode>=48&&d.key.length===1?u.key=d.key:d.key&&d.ctrlKey&&d.key==="_"&&(u.key=R.C0.US);else{var c=O[d.keyCode],s=c&&c[d.shiftKey?1:0];if(s)u.key=R.C0.ESC+s;else if(d.keyCode>=65&&d.keyCode<=90){var l=d.ctrlKey?d.keyCode-64:d.keyCode+32;u.key=R.C0.ESC+String.fromCharCode(l)}}else d.keyCode>=65&&d.keyCode<=90?u.key=String.fromCharCode(d.keyCode-64):d.keyCode===32?u.key=R.C0.NUL:d.keyCode>=51&&d.keyCode<=55?u.key=String.fromCharCode(d.keyCode-51+27):d.keyCode===56?u.key=R.C0.DEL:d.keyCode===219?u.key=R.C0.ESC:d.keyCode===220?u.key=R.C0.FS:d.keyCode===221&&(u.key=R.C0.GS)}return u}},function(j,k,D){"use strict";var R,O=this&&this.__extends||(R=function(n,o){return(R=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,f){i.__proto__=f}||function(i,f){for(var h in f)f.hasOwnProperty(h)&&(i[h]=f[h])})(n,o)},function(n,o){function i(){this.constructor=n}R(n,o),n.prototype=o===null?Object.create(o):(i.prototype=o.prototype,new i)}),d=this&&this.__decorate||function(n,o,i,f){var h,T=arguments.length,g=T<3?o:f===null?f=Object.getOwnPropertyDescriptor(o,i):f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")g=Reflect.decorate(n,o,i,f);else for(var w=n.length-1;w>=0;w--)(h=n[w])&&(g=(T<3?h(g):T>3?h(o,i,g):h(o,i))||g);return T>3&&g&&Object.defineProperty(o,i,g),g},E=this&&this.__param||function(n,o){return function(i,f){o(i,f,n)}};Object.defineProperty(k,"__esModule",{value:!0}),k.RenderService=void 0;var y=D(31),v=D(0),u=D(2),a=D(32),c=D(7),s=D(1),l=D(5),r=function(n){function o(i,f,h,T,g,w){var C=n.call(this)||this;if(C._renderer=i,C._rowCount=f,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 v.EventEmitter,C._onRender=new v.EventEmitter,C._onRefreshRequest=new v.EventEmitter,C.register({dispose:function(){return C._renderer.dispose()}}),C._renderDebouncer=new y.RenderDebouncer(function(b,S){return C._renderRows(b,S)}),C.register(C._renderDebouncer),C._screenDprMonitor=new a.ScreenDprMonitor,C._screenDprMonitor.setListener(function(){return C.onDevicePixelRatioChange()}),C.register(C._screenDprMonitor),C.register(w.onResize(function(b){return C._fullRefresh()})),C.register(T.onOptionChange(function(){return C._renderer.onOptionsChanged()})),C.register(g.onCharSizeChange(function(){return C.onCharSizeChanged()})),C._renderer.onRequestRedraw(function(b){return C.refreshRows(b.start,b.end,!0)}),C.register(c.addDisposableDomListener(window,"resize",function(){return C.onDevicePixelRatioChange()})),"IntersectionObserver"in window){var x=new IntersectionObserver(function(b){return C._onIntersectionChange(b[b.length-1])},{threshold:0});x.observe(h),C.register({dispose:function(){return x.disconnect()}})}return C}return O(o,n),Object.defineProperty(o.prototype,"onDimensionsChange",{get:function(){return this._onDimensionsChange.event},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"onRenderedBufferChange",{get:function(){return this._onRender.event},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"onRefreshRequest",{get:function(){return this._onRefreshRequest.event},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"dimensions",{get:function(){return this._renderer.dimensions},enumerable:!1,configurable:!0}),o.prototype._onIntersectionChange=function(i){this._isPaused=i.intersectionRatio===0,!this._isPaused&&this._needsFullRefresh&&(this.refreshRows(0,this._rowCount-1),this._needsFullRefresh=!1)},o.prototype.refreshRows=function(i,f,h){h===void 0&&(h=!1),this._isPaused?this._needsFullRefresh=!0:(h||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(i,f,this._rowCount))},o.prototype._renderRows=function(i,f){this._renderer.renderRows(i,f),this._needsSelectionRefresh&&(this._renderer.onSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRender.fire({start:i,end:f}),this._isNextRenderRedrawOnly=!0},o.prototype.resize=function(i,f){this._rowCount=f,this._fireOnCanvasResize()},o.prototype.changeOptions=function(){this._renderer.onOptionsChanged(),this.refreshRows(0,this._rowCount-1),this._fireOnCanvasResize()},o.prototype._fireOnCanvasResize=function(){this._renderer.dimensions.canvasWidth===this._canvasWidth&&this._renderer.dimensions.canvasHeight===this._canvasHeight||this._onDimensionsChange.fire(this._renderer.dimensions)},o.prototype.dispose=function(){n.prototype.dispose.call(this)},o.prototype.setRenderer=function(i){var f=this;this._renderer.dispose(),this._renderer=i,this._renderer.onRequestRedraw(function(h){return f.refreshRows(h.start,h.end,!0)}),this._needsSelectionRefresh=!0,this._fullRefresh()},o.prototype._fullRefresh=function(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)},o.prototype.setColors=function(i){this._renderer.setColors(i),this._fullRefresh()},o.prototype.onDevicePixelRatioChange=function(){this._renderer.onDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1)},o.prototype.onResize=function(i,f){this._renderer.onResize(i,f),this._fullRefresh()},o.prototype.onCharSizeChanged=function(){this._renderer.onCharSizeChanged()},o.prototype.onBlur=function(){this._renderer.onBlur()},o.prototype.onFocus=function(){this._renderer.onFocus()},o.prototype.onSelectionChanged=function(i,f,h){this._selectionState.start=i,this._selectionState.end=f,this._selectionState.columnSelectMode=h,this._renderer.onSelectionChanged(i,f,h)},o.prototype.onCursorMove=function(){this._renderer.onCursorMove()},o.prototype.clear=function(){this._renderer.clear()},o.prototype.registerCharacterJoiner=function(i){return this._renderer.registerCharacterJoiner(i)},o.prototype.deregisterCharacterJoiner=function(i){return this._renderer.deregisterCharacterJoiner(i)},o=d([E(3,s.IOptionsService),E(4,l.ICharSizeService),E(5,s.IBufferService)],o)}(u.Disposable);k.RenderService=r},function(j,k,D){"use strict";var R=this&&this.__decorate||function(u,a,c,s){var l,r=arguments.length,n=r<3?a:s===null?s=Object.getOwnPropertyDescriptor(a,c):s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(u,a,c,s);else for(var o=u.length-1;o>=0;o--)(l=u[o])&&(n=(r<3?l(n):r>3?l(a,c,n):l(a,c))||n);return r>3&&n&&Object.defineProperty(a,c,n),n},O=this&&this.__param||function(u,a){return function(c,s){a(c,s,u)}};Object.defineProperty(k,"__esModule",{value:!0}),k.CharSizeService=void 0;var d=D(1),E=D(0),y=function(){function u(a,c,s){this._optionsService=s,this.width=0,this.height=0,this._onCharSizeChange=new E.EventEmitter,this._measureStrategy=new v(a,c,this._optionsService)}return Object.defineProperty(u.prototype,"hasValidSize",{get:function(){return this.width>0&&this.height>0},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"onCharSizeChange",{get:function(){return this._onCharSizeChange.event},enumerable:!1,configurable:!0}),u.prototype.measure=function(){var a=this._measureStrategy.measure();a.width===this.width&&a.height===this.height||(this.width=a.width,this.height=a.height,this._onCharSizeChange.fire())},u=R([O(2,d.IOptionsService)],u)}();k.CharSizeService=y;var v=function(){function u(a,c,s){this._document=a,this._parentElement=c,this._optionsService=s,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 u.prototype.measure=function(){this._measureElement.style.fontFamily=this._optionsService.options.fontFamily,this._measureElement.style.fontSize=this._optionsService.options.fontSize+"px";var a=this._measureElement.getBoundingClientRect();return a.width!==0&&a.height!==0&&(this._result.width=a.width,this._result.height=Math.ceil(a.height)),this._result},u}()},function(j,k,D){"use strict";var R=this&&this.__decorate||function(v,u,a,c){var s,l=arguments.length,r=l<3?u:c===null?c=Object.getOwnPropertyDescriptor(u,a):c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(v,u,a,c);else for(var n=v.length-1;n>=0;n--)(s=v[n])&&(r=(l<3?s(r):l>3?s(u,a,r):s(u,a))||r);return l>3&&r&&Object.defineProperty(u,a,r),r},O=this&&this.__param||function(v,u){return function(a,c){u(a,c,v)}};Object.defineProperty(k,"__esModule",{value:!0}),k.MouseService=void 0;var d=D(5),E=D(30),y=function(){function v(u,a){this._renderService=u,this._charSizeService=a}return v.prototype.getCoords=function(u,a,c,s,l){return E.getCoords(u,a,c,s,this._charSizeService.hasValidSize,this._renderService.dimensions.actualCellWidth,this._renderService.dimensions.actualCellHeight,l)},v.prototype.getRawByteCoords=function(u,a,c,s){var l=this.getCoords(u,a,c,s);return E.getRawByteCoords(l)},v=R([O(0,d.IRenderService),O(1,d.ICharSizeService)],v)}();k.MouseService=y},function(j,k,D){"use strict";var R,O=this&&this.__extends||(R=function(s,l){return(R=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var o in n)n.hasOwnProperty(o)&&(r[o]=n[o])})(s,l)},function(s,l){function r(){this.constructor=s}R(s,l),s.prototype=l===null?Object.create(l):(r.prototype=l.prototype,new r)}),d=this&&this.__decorate||function(s,l,r,n){var o,i=arguments.length,f=i<3?l:n===null?n=Object.getOwnPropertyDescriptor(l,r):n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")f=Reflect.decorate(s,l,r,n);else for(var h=s.length-1;h>=0;h--)(o=s[h])&&(f=(i<3?o(f):i>3?o(l,r,f):o(l,r))||f);return i>3&&f&&Object.defineProperty(l,r,f),f},E=this&&this.__param||function(s,l){return function(r,n){l(r,n,s)}};Object.defineProperty(k,"__esModule",{value:!0}),k.Linkifier2=void 0;var y=D(1),v=D(0),u=D(2),a=D(7),c=function(s){function l(r){var n=s.call(this)||this;return n._bufferService=r,n._linkProviders=[],n._linkCacheDisposables=[],n._isMouseOut=!0,n._activeLine=-1,n._onShowLinkUnderline=n.register(new v.EventEmitter),n._onHideLinkUnderline=n.register(new v.EventEmitter),n.register(u.getDisposeArrayDisposable(n._linkCacheDisposables)),n}return O(l,s),Object.defineProperty(l.prototype,"onShowLinkUnderline",{get:function(){return this._onShowLinkUnderline.event},enumerable:!1,configurable:!0}),Object.defineProperty(l.prototype,"onHideLinkUnderline",{get:function(){return this._onHideLinkUnderline.event},enumerable:!1,configurable:!0}),l.prototype.registerLinkProvider=function(r){var n=this;return this._linkProviders.push(r),{dispose:function(){var o=n._linkProviders.indexOf(r);o!==-1&&n._linkProviders.splice(o,1)}}},l.prototype.attachToDom=function(r,n,o){var i=this;this._element=r,this._mouseService=n,this._renderService=o,this.register(a.addDisposableDomListener(this._element,"mouseleave",function(){i._isMouseOut=!0,i._clearCurrentLink()})),this.register(a.addDisposableDomListener(this._element,"mousemove",this._onMouseMove.bind(this))),this.register(a.addDisposableDomListener(this._element,"click",this._onClick.bind(this)))},l.prototype._onMouseMove=function(r){if(this._lastMouseEvent=r,this._element&&this._mouseService){var n=this._positionFromMouseEvent(r,this._element,this._mouseService);if(n){this._isMouseOut=!1;for(var o=r.composedPath(),i=0;i<o.length;i++){var f=o[i];if(f.classList.contains("xterm"))break;if(f.classList.contains("xterm-hover"))return}this._lastBufferCell&&n.x===this._lastBufferCell.x&&n.y===this._lastBufferCell.y||(this._onHover(n),this._lastBufferCell=n)}}},l.prototype._onHover=function(r){if(this._activeLine!==r.y)return this._clearCurrentLink(),void this._askForLink(r,!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,r)||(this._clearCurrentLink(),this._askForLink(r,!0))},l.prototype._askForLink=function(r,n){var o=this;this._activeProviderReplies&&n||(this._activeProviderReplies=new Map,this._activeLine=r.y);var i=!1;this._linkProviders.forEach(function(f,h){var T;n?((T=o._activeProviderReplies)===null||T===void 0?void 0:T.get(h))&&(i=o._checkLinkProviderResult(h,r,i)):f.provideLinks(r.y,function(g){var w,C;if(!o._isMouseOut){var x=g==null?void 0:g.map(function(b){return{link:b}});(w=o._activeProviderReplies)===null||w===void 0||w.set(h,x),i=o._checkLinkProviderResult(h,r,i),((C=o._activeProviderReplies)===null||C===void 0?void 0:C.size)===o._linkProviders.length&&o._removeIntersectingLinks(r.y,o._activeProviderReplies)}})})},l.prototype._removeIntersectingLinks=function(r,n){for(var o=new Set,i=0;i<n.size;i++){var f=n.get(i);if(f)for(var h=0;h<f.length;h++)for(var T=f[h],g=T.link.range.start.y<r?0:T.link.range.start.x,w=T.link.range.end.y>r?this._bufferService.cols:T.link.range.end.x,C=g;C<=w;C++){if(o.has(C)){f.splice(h--,1);break}o.add(C)}}},l.prototype._checkLinkProviderResult=function(r,n,o){var i,f=this;if(!this._activeProviderReplies)return o;for(var h=this._activeProviderReplies.get(r),T=!1,g=0;g<r;g++)this._activeProviderReplies.has(g)&&!this._activeProviderReplies.get(g)||(T=!0);if(!T&&h){var w=h.find(function(x){return f._linkAtPosition(x.link,n)});w&&(o=!0,this._handleNewLink(w))}if(this._activeProviderReplies.size===this._linkProviders.length&&!o)for(g=0;g<this._activeProviderReplies.size;g++){var C=(i=this._activeProviderReplies.get(g))===null||i===void 0?void 0:i.find(function(x){return f._linkAtPosition(x.link,n)});if(C){o=!0,this._handleNewLink(C);break}}return o},l.prototype._onClick=function(r){if(this._element&&this._mouseService&&this._currentLink){var n=this._positionFromMouseEvent(r,this._element,this._mouseService);n&&this._linkAtPosition(this._currentLink.link,n)&&this._currentLink.link.activate(r,this._currentLink.link.text)}},l.prototype._clearCurrentLink=function(r,n){this._element&&this._currentLink&&this._lastMouseEvent&&(!r||!n||this._currentLink.link.range.start.y>=r&&this._currentLink.link.range.end.y<=n)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,u.disposeArray(this._linkCacheDisposables))},l.prototype._handleNewLink=function(r){var n=this;if(this._element&&this._lastMouseEvent&&this._mouseService){var o=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);o&&this._linkAtPosition(r.link,o)&&(this._currentLink=r,this._currentLink.state={decorations:{underline:r.link.decorations===void 0||r.link.decorations.underline,pointerCursor:r.link.decorations===void 0||r.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,r.link,this._lastMouseEvent),r.link.decorations={},Object.defineProperties(r.link.decorations,{pointerCursor:{get:function(){var i,f;return(f=(i=n._currentLink)===null||i===void 0?void 0:i.state)===null||f===void 0?void 0:f.decorations.pointerCursor},set:function(i){var f,h;((f=n._currentLink)===null||f===void 0?void 0:f.state)&&n._currentLink.state.decorations.pointerCursor!==i&&(n._currentLink.state.decorations.pointerCursor=i,n._currentLink.state.isHovered&&((h=n._element)===null||h===void 0||h.classList.toggle("xterm-cursor-pointer",i)))}},underline:{get:function(){var i,f;return(f=(i=n._currentLink)===null||i===void 0?void 0:i.state)===null||f===void 0?void 0:f.decorations.underline},set:function(i){var f,h,T;((f=n._currentLink)===null||f===void 0?void 0:f.state)&&((T=(h=n._currentLink)===null||h===void 0?void 0:h.state)===null||T===void 0?void 0:T.decorations.underline)!==i&&(n._currentLink.state.decorations.underline=i,n._currentLink.state.isHovered&&n._fireUnderlineEvent(r.link,i))}}}),this._renderService&&this._linkCacheDisposables.push(this._renderService.onRenderedBufferChange(function(i){var f=i.start===0?0:i.start+1+n._bufferService.buffer.ydisp;n._clearCurrentLink(f,i.end+1+n._bufferService.buffer.ydisp)})))}},l.prototype._linkHover=function(r,n,o){var i;((i=this._currentLink)===null||i===void 0?void 0:i.state)&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(n,!0),this._currentLink.state.decorations.pointerCursor&&r.classList.add("xterm-cursor-pointer")),n.hover&&n.hover(o,n.text)},l.prototype._fireUnderlineEvent=function(r,n){var o=r.range,i=this._bufferService.buffer.ydisp,f=this._createLinkUnderlineEvent(o.start.x-1,o.start.y-i-1,o.end.x,o.end.y-i-1,void 0);(n?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(f)},l.prototype._linkLeave=function(r,n,o){var i;((i=this._currentLink)===null||i===void 0?void 0:i.state)&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(n,!1),this._currentLink.state.decorations.pointerCursor&&r.classList.remove("xterm-cursor-pointer")),n.leave&&n.leave(o,n.text)},l.prototype._linkAtPosition=function(r,n){var o=r.range.start.y===r.range.end.y,i=r.range.start.y<n.y,f=r.range.end.y>n.y;return(o&&r.range.start.x<=n.x&&r.range.end.x>=n.x||i&&r.range.end.x>=n.x||f&&r.range.start.x<=n.x||i&&f)&&r.range.start.y<=n.y&&r.range.end.y>=n.y},l.prototype._positionFromMouseEvent=function(r,n,o){var i=o.getCoords(r,n,this._bufferService.cols,this._bufferService.rows);if(i)return{x:i[0],y:i[1]+this._bufferService.buffer.ydisp}},l.prototype._createLinkUnderlineEvent=function(r,n,o,i,f){return{x1:r,y1:n,x2:o,y2:i,cols:this._bufferService.cols,fg:f}},l=d([E(0,y.IBufferService)],l)}(u.Disposable);k.Linkifier2=c},function(j,k,D){"use strict";Object.defineProperty(k,"__esModule",{value:!0}),k.CoreBrowserService=void 0;var R=function(){function O(d){this._textarea=d}return Object.defineProperty(O.prototype,"isFocused",{get:function(){return document.activeElement===this._textarea&&document.hasFocus()},enumerable:!1,configurable:!0}),O}();k.CoreBrowserService=R},function(j,k,D){"use strict";var R,O=this&&this.__extends||(R=function(g,w){return(R=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(C,x){C.__proto__=x}||function(C,x){for(var b in x)x.hasOwnProperty(b)&&(C[b]=x[b])})(g,w)},function(g,w){function C(){this.constructor=g}R(g,w),g.prototype=w===null?Object.create(w):(C.prototype=w.prototype,new C)});Object.defineProperty(k,"__esModule",{value:!0}),k.CoreTerminal=void 0;var d=D(2),E=D(1),y=D(66),v=D(67),u=D(68),a=D(74),c=D(75),s=D(0),l=D(76),r=D(77),n=D(78),o=D(80),i=D(81),f=D(19),h=D(82),T=function(g){function w(C){var x=g.call(this)||this;return x._onBinary=new s.EventEmitter,x._onData=new s.EventEmitter,x._onLineFeed=new s.EventEmitter,x._onResize=new s.EventEmitter,x._onScroll=new s.EventEmitter,x._instantiationService=new y.InstantiationService,x.optionsService=new a.OptionsService(C),x._instantiationService.setService(E.IOptionsService,x.optionsService),x._bufferService=x.register(x._instantiationService.createInstance(u.BufferService)),x._instantiationService.setService(E.IBufferService,x._bufferService),x._logService=x._instantiationService.createInstance(v.LogService),x._instantiationService.setService(E.ILogService,x._logService),x._coreService=x.register(x._instantiationService.createInstance(c.CoreService,function(){return x.scrollToBottom()})),x._instantiationService.setService(E.ICoreService,x._coreService),x._coreMouseService=x._instantiationService.createInstance(l.CoreMouseService),x._instantiationService.setService(E.ICoreMouseService,x._coreMouseService),x._dirtyRowService=x._instantiationService.createInstance(r.DirtyRowService),x._instantiationService.setService(E.IDirtyRowService,x._dirtyRowService),x.unicodeService=x._instantiationService.createInstance(n.UnicodeService),x._instantiationService.setService(E.IUnicodeService,x.unicodeService),x._charsetService=x._instantiationService.createInstance(o.CharsetService),x._instantiationService.setService(E.ICharsetService,x._charsetService),x._inputHandler=new f.InputHandler(x._bufferService,x._charsetService,x._coreService,x._dirtyRowService,x._logService,x.optionsService,x._coreMouseService,x.unicodeService),x.register(s.forwardEvent(x._inputHandler.onLineFeed,x._onLineFeed)),x.register(x._inputHandler),x.register(s.forwardEvent(x._bufferService.onResize,x._onResize)),x.register(s.forwardEvent(x._coreService.onData,x._onData)),x.register(s.forwardEvent(x._coreService.onBinary,x._onBinary)),x.register(x.optionsService.onOptionChange(function(b){return x._updateOptions(b)})),x._writeBuffer=new h.WriteBuffer(function(b){return x._inputHandler.parse(b)}),x}return O(w,g),Object.defineProperty(w.prototype,"onBinary",{get:function(){return this._onBinary.event},enumerable:!1,configurable:!0}),Object.defineProperty(w.prototype,"onData",{get:function(){return this._onData.event},enumerable:!1,configurable:!0}),Object.defineProperty(w.prototype,"onLineFeed",{get:function(){return this._onLineFeed.event},enumerable:!1,configurable:!0}),Object.defineProperty(w.prototype,"onResize",{get:function(){return this._onResize.event},enumerable:!1,configurable:!0}),Object.defineProperty(w.prototype,"onScroll",{get:function(){return this._onScroll.event},enumerable:!1,configurable:!0}),Object.defineProperty(w.prototype,"cols",{get:function(){return this._bufferService.cols},enumerable:!1,configurable:!0}),Object.defineProperty(w.prototype,"rows",{get:function(){return this._bufferService.rows},enumerable:!1,configurable:!0}),Object.defineProperty(w.prototype,"buffers",{get:function(){return this._bufferService.buffers},enumerable:!1,configurable:!0}),w.prototype.dispose=function(){var C;this._isDisposed||(g.prototype.dispose.call(this),(C=this._windowsMode)===null||C===void 0||C.dispose(),this._windowsMode=void 0)},w.prototype.write=function(C,x){this._writeBuffer.write(C,x)},w.prototype.writeSync=function(C){this._writeBuffer.writeSync(C)},w.prototype.resize=function(C,x){isNaN(C)||isNaN(x)||(C=Math.max(C,u.MINIMUM_COLS),x=Math.max(x,u.MINIMUM_ROWS),this._bufferService.resize(C,x))},w.prototype.scroll=function(C,x){x===void 0&&(x=!1);var b,S=this._bufferService.buffer;(b=this._cachedBlankLine)&&b.length===this.cols&&b.getFg(0)===C.fg&&b.getBg(0)===C.bg||(b=S.getBlankLine(C,x),this._cachedBlankLine=b),b.isWrapped=x;var A=S.ybase+S.scrollTop,p=S.ybase+S.scrollBottom;if(S.scrollTop===0){var I=S.lines.isFull;p===S.lines.length-1?I?S.lines.recycle().copyFrom(b):S.lines.push(b.clone()):S.lines.splice(p+1,0,b.clone()),I?this._bufferService.isUserScrolling&&(S.ydisp=Math.max(S.ydisp-1,0)):(S.ybase++,this._bufferService.isUserScrolling||S.ydisp++)}else{var M=p-A+1;S.lines.shiftElements(A+1,M-1,-1),S.lines.set(p,b.clone())}this._bufferService.isUserScrolling||(S.ydisp=S.ybase),this._dirtyRowService.markRangeDirty(S.scrollTop,S.scrollBottom),this._onScroll.fire(S.ydisp)},w.prototype.scrollLines=function(C,x){var b=this._bufferService.buffer;if(C<0){if(b.ydisp===0)return;this._bufferService.isUserScrolling=!0}else C+b.ydisp>=b.ybase&&(this._bufferService.isUserScrolling=!1);var S=b.ydisp;b.ydisp=Math.max(Math.min(b.ydisp+C,b.ybase),0),S!==b.ydisp&&(x||this._onScroll.fire(b.ydisp))},w.prototype.scrollPages=function(C){this.scrollLines(C*(this.rows-1))},w.prototype.scrollToTop=function(){this.scrollLines(-this._bufferService.buffer.ydisp)},w.prototype.scrollToBottom=function(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)},w.prototype.scrollToLine=function(C){var x=C-this._bufferService.buffer.ydisp;x!==0&&this.scrollLines(x)},w.prototype.addEscHandler=function(C,x){return this._inputHandler.addEscHandler(C,x)},w.prototype.addDcsHandler=function(C,x){return this._inputHandler.addDcsHandler(C,x)},w.prototype.addCsiHandler=function(C,x){return this._inputHandler.addCsiHandler(C,x)},w.prototype.addOscHandler=function(C,x){return this._inputHandler.addOscHandler(C,x)},w.prototype._setup=function(){this.optionsService.options.windowsMode&&this._enableWindowsMode()},w.prototype.reset=function(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this._coreService.reset(),this._coreMouseService.reset()},w.prototype._updateOptions=function(C){var x;switch(C){case"scrollback":this.buffers.resize(this.cols,this.rows);break;case"windowsMode":this.optionsService.options.windowsMode?this._enableWindowsMode():((x=this._windowsMode)===null||x===void 0||x.dispose(),this._windowsMode=void 0)}},w.prototype._enableWindowsMode=function(){var C=this;if(!this._windowsMode){var x=[];x.push(this.onLineFeed(i.updateWindowsModeWrappedState.bind(null,this._bufferService))),x.push(this.addCsiHandler({final:"H"},function(){return i.updateWindowsModeWrappedState(C._bufferService),!1})),this._windowsMode={dispose:function(){for(var b=0,S=x;b<S.length;b++)S[b].dispose()}}}},w}(d.Disposable);k.CoreTerminal=T},function(j,k,D){"use strict";var R=this&&this.__spreadArrays||function(){for(var v=0,u=0,a=arguments.length;u<a;u++)v+=arguments[u].length;var c=Array(v),s=0;for(u=0;u<a;u++)for(var l=arguments[u],r=0,n=l.length;r<n;r++,s++)c[s]=l[r];return c};Object.defineProperty(k,"__esModule",{value:!0}),k.InstantiationService=k.ServiceCollection=void 0;var O=D(1),d=D(14),E=function(){function v(){for(var u=[],a=0;a<arguments.length;a++)u[a]=arguments[a];this._entries=new Map;for(var c=0,s=u;c<s.length;c++){var l=s[c],r=l[0],n=l[1];this.set(r,n)}}return v.prototype.set=function(u,a){var c=this._entries.get(u);return this._entries.set(u,a),c},v.prototype.forEach=function(u){this._entries.forEach(function(a,c){return u(c,a)})},v.prototype.has=function(u){return this._entries.has(u)},v.prototype.get=function(u){return this._entries.get(u)},v}();k.ServiceCollection=E;var y=function(){function v(){this._services=new E,this._services.set(O.IInstantiationService,this)}return v.prototype.setService=function(u,a){this._services.set(u,a)},v.prototype.getService=function(u){return this._services.get(u)},v.prototype.createInstance=function(u){for(var a=[],c=1;c<arguments.length;c++)a[c-1]=arguments[c];for(var s=d.getServiceDependencies(u).sort(function(h,T){return h.index-T.index}),l=[],r=0,n=s;r<n.length;r++){var o=n[r],i=this._services.get(o.id);if(!i)throw new Error("[createInstance] "+u.name+" depends on UNKNOWN service "+o.id+".");l.push(i)}var f=s.length>0?s[0].index:a.length;if(a.length!==f)throw new Error("[createInstance] First service dependency of "+u.name+" at position "+(f+1)+" conflicts with "+a.length+" static arguments");return new(u.bind.apply(u,R([void 0],R(a,l))))},v}();k.InstantiationService=y},function(j,k,D){"use strict";var R=this&&this.__decorate||function(a,c,s,l){var r,n=arguments.length,o=n<3?c:l===null?l=Object.getOwnPropertyDescriptor(c,s):l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(a,c,s,l);else for(var i=a.length-1;i>=0;i--)(r=a[i])&&(o=(n<3?r(o):n>3?r(c,s,o):r(c,s))||o);return n>3&&o&&Object.defineProperty(c,s,o),o},O=this&&this.__param||function(a,c){return function(s,l){c(s,l,a)}},d=this&&this.__spreadArrays||function(){for(var a=0,c=0,s=arguments.length;c<s;c++)a+=arguments[c].length;var l=Array(a),r=0;for(c=0;c<s;c++)for(var n=arguments[c],o=0,i=n.length;o<i;o++,r++)l[r]=n[o];return l};Object.defineProperty(k,"__esModule",{value:!0}),k.LogService=k.LogLevel=void 0;var E,y=D(1);!function(a){a[a.DEBUG=0]="DEBUG",a[a.INFO=1]="INFO",a[a.WARN=2]="WARN",a[a.ERROR=3]="ERROR",a[a.OFF=4]="OFF"}(E=k.LogLevel||(k.LogLevel={}));var v={debug:E.DEBUG,info:E.INFO,warn:E.WARN,error:E.ERROR,off:E.OFF},u=function(){function a(c){var s=this;this._optionsService=c,this._updateLogLevel(),this._optionsService.onOptionChange(function(l){l==="logLevel"&&s._updateLogLevel()})}return a.prototype._updateLogLevel=function(){this._logLevel=v[this._optionsService.options.logLevel]},a.prototype._evalLazyOptionalParams=function(c){for(var s=0;s<c.length;s++)typeof c[s]=="function"&&(c[s]=c[s]())},a.prototype._log=function(c,s,l){this._evalLazyOptionalParams(l),c.call.apply(c,d([console,"xterm.js: "+s],l))},a.prototype.debug=function(c){for(var s=[],l=1;l<arguments.length;l++)s[l-1]=arguments[l];this._logLevel<=E.DEBUG&&this._log(console.log,c,s)},a.prototype.info=function(c){for(var s=[],l=1;l<arguments.length;l++)s[l-1]=arguments[l];this._logLevel<=E.INFO&&this._log(console.info,c,s)},a.prototype.warn=function(c){for(var s=[],l=1;l<arguments.length;l++)s[l-1]=arguments[l];this._logLevel<=E.WARN&&this._log(console.warn,c,s)},a.prototype.error=function(c){for(var s=[],l=1;l<arguments.length;l++)s[l-1]=arguments[l];this._logLevel<=E.ERROR&&this._log(console.error,c,s)},a=R([O(0,y.IOptionsService)],a)}();k.LogService=u},function(j,k,D){"use strict";var R,O=this&&this.__extends||(R=function(s,l){return(R=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var o in n)n.hasOwnProperty(o)&&(r[o]=n[o])})(s,l)},function(s,l){function r(){this.constructor=s}R(s,l),s.prototype=l===null?Object.create(l):(r.prototype=l.prototype,new r)}),d=this&&this.__decorate||function(s,l,r,n){var o,i=arguments.length,f=i<3?l:n===null?n=Object.getOwnPropertyDescriptor(l,r):n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")f=Reflect.decorate(s,l,r,n);else for(var h=s.length-1;h>=0;h--)(o=s[h])&&(f=(i<3?o(f):i>3?o(l,r,f):o(l,r))||f);return i>3&&f&&Object.defineProperty(l,r,f),f},E=this&&this.__param||function(s,l){return function(r,n){l(r,n,s)}};Object.defineProperty(k,"__esModule",{value:!0}),k.BufferService=k.MINIMUM_ROWS=k.MINIMUM_COLS=void 0;var y=D(1),v=D(69),u=D(0),a=D(2);k.MINIMUM_COLS=2,k.MINIMUM_ROWS=1;var c=function(s){function l(r){var n=s.call(this)||this;return n._optionsService=r,n.isUserScrolling=!1,n._onResize=new u.EventEmitter,n.cols=Math.max(r.options.cols,k.MINIMUM_COLS),n.rows=Math.max(r.options.rows,k.MINIMUM_ROWS),n.buffers=new v.BufferSet(r,n),n}return O(l,s),Object.defineProperty(l.prototype,"onResize",{get:function(){return this._onResize.event},enumerable:!1,configurable:!0}),Object.defineProperty(l.prototype,"buffer",{get:function(){return this.buffers.active},enumerable:!1,configurable:!0}),l.prototype.dispose=function(){s.prototype.dispose.call(this),this.buffers.dispose()},l.prototype.resize=function(r,n){this.cols=r,this.rows=n,this.buffers.resize(r,n),this.buffers.setupTabStops(this.cols),this._onResize.fire({cols:r,rows:n})},l.prototype.reset=function(){this.buffers.dispose(),this.buffers=new v.BufferSet(this._optionsService,this),this.isUserScrolling=!1},l=d([E(0,y.IOptionsService)],l)}(a.Disposable);k.BufferService=c},function(j,k,D){"use strict";var R,O=this&&this.__extends||(R=function(v,u){return(R=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,c){a.__proto__=c}||function(a,c){for(var s in c)c.hasOwnProperty(s)&&(a[s]=c[s])})(v,u)},function(v,u){function a(){this.constructor=v}R(v,u),v.prototype=u===null?Object.create(u):(a.prototype=u.prototype,new a)});Object.defineProperty(k,"__esModule",{value:!0}),k.BufferSet=void 0;var d=D(70),E=D(0),y=function(v){function u(a,c){var s=v.call(this)||this;return s._onBufferActivate=s.register(new E.EventEmitter),s._normal=new d.Buffer(!0,a,c),s._normal.fillViewportRows(),s._alt=new d.Buffer(!1,a,c),s._activeBuffer=s._normal,s.setupTabStops(),s}return O(u,v),Object.defineProperty(u.prototype,"onBufferActivate",{get:function(){return this._onBufferActivate.event},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"alt",{get:function(){return this._alt},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"active",{get:function(){return this._activeBuffer},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"normal",{get:function(){return this._normal},enumerable:!1,configurable:!0}),u.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}))},u.prototype.activateAltBuffer=function(a){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(a),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}))},u.prototype.resize=function(a,c){this._normal.resize(a,c),this._alt.resize(a,c)},u.prototype.setupTabStops=function(a){this._normal.setupTabStops(a),this._alt.setupTabStops(a)},u}(D(2).Disposable);k.BufferSet=y},function(j,k,D){"use strict";Object.defineProperty(k,"__esModule",{value:!0}),k.BufferStringIterator=k.Buffer=k.MAX_BUFFER_SIZE=void 0;var R=D(71),O=D(16),d=D(4),E=D(3),y=D(72),v=D(73),u=D(20),a=D(6);k.MAX_BUFFER_SIZE=4294967295;var c=function(){function l(r,n,o){this._hasScrollback=r,this._optionsService=n,this._bufferService=o,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.savedY=0,this.savedX=0,this.savedCurAttrData=O.DEFAULT_ATTR_DATA.clone(),this.savedCharset=u.DEFAULT_CHARSET,this.markers=[],this._nullCell=d.CellData.fromCharData([0,E.NULL_CELL_CHAR,E.NULL_CELL_WIDTH,E.NULL_CELL_CODE]),this._whitespaceCell=d.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 l.prototype.getNullCell=function(r){return r?(this._nullCell.fg=r.fg,this._nullCell.bg=r.bg,this._nullCell.extended=r.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new a.ExtendedAttrs),this._nullCell},l.prototype.getWhitespaceCell=function(r){return r?(this._whitespaceCell.fg=r.fg,this._whitespaceCell.bg=r.bg,this._whitespaceCell.extended=r.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new a.ExtendedAttrs),this._whitespaceCell},l.prototype.getBlankLine=function(r,n){return new O.BufferLine(this._bufferService.cols,this.getNullCell(r),n)},Object.defineProperty(l.prototype,"hasScrollback",{get:function(){return this._hasScrollback&&this.lines.maxLength>this._rows},enumerable:!1,configurable:!0}),Object.defineProperty(l.prototype,"isCursorInViewport",{get:function(){var r=this.ybase+this.y-this.ydisp;return r>=0&&r<this._rows},enumerable:!1,configurable:!0}),l.prototype._getCorrectBufferLength=function(r){if(!this._hasScrollback)return r;var n=r+this._optionsService.options.scrollback;return n>k.MAX_BUFFER_SIZE?k.MAX_BUFFER_SIZE:n},l.prototype.fillViewportRows=function(r){if(this.lines.length===0){r===void 0&&(r=O.DEFAULT_ATTR_DATA);for(var n=this._rows;n--;)this.lines.push(this.getBlankLine(r))}},l.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()},l.prototype.resize=function(r,n){var o=this.getNullCell(O.DEFAULT_ATTR_DATA),i=this._getCorrectBufferLength(n);if(i>this.lines.maxLength&&(this.lines.maxLength=i),this.lines.length>0){if(this._cols<r)for(var f=0;f<this.lines.length;f++)this.lines.get(f).resize(r,o);var h=0;if(this._rows<n)for(var T=this._rows;T<n;T++)this.lines.length<n+this.ybase&&(this._optionsService.options.windowsMode?this.lines.push(new O.BufferLine(r,o)):this.ybase>0&&this.lines.length<=this.ybase+this.y+h+1?(this.ybase--,h++,this.ydisp>0&&this.ydisp--):this.lines.push(new O.BufferLine(r,o)));else for(T=this._rows;T>n;T--)this.lines.length>n+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(i<this.lines.maxLength){var g=this.lines.length-i;g>0&&(this.lines.trimStart(g),this.ybase=Math.max(this.ybase-g,0),this.ydisp=Math.max(this.ydisp-g,0),this.savedY=Math.max(this.savedY-g,0)),this.lines.maxLength=i}this.x=Math.min(this.x,r-1),this.y=Math.min(this.y,n-1),h&&(this.y+=h),this.savedX=Math.min(this.savedX,r-1),this.scrollTop=0}if(this.scrollBottom=n-1,this._isReflowEnabled&&(this._reflow(r,n),this._cols>r))for(f=0;f<this.lines.length;f++)this.lines.get(f).resize(r,o);this._cols=r,this._rows=n},Object.defineProperty(l.prototype,"_isReflowEnabled",{get:function(){return this._hasScrollback&&!this._optionsService.options.windowsMode},enumerable:!1,configurable:!0}),l.prototype._reflow=function(r,n){this._cols!==r&&(r>this._cols?this._reflowLarger(r,n):this._reflowSmaller(r,n))},l.prototype._reflowLarger=function(r,n){var o=y.reflowLargerGetLinesToRemove(this.lines,this._cols,r,this.ybase+this.y,this.getNullCell(O.DEFAULT_ATTR_DATA));if(o.length>0){var i=y.reflowLargerCreateNewLayout(this.lines,o);y.reflowLargerApplyNewLayout(this.lines,i.layout),this._reflowLargerAdjustViewport(r,n,i.countRemoved)}},l.prototype._reflowLargerAdjustViewport=function(r,n,o){for(var i=this.getNullCell(O.DEFAULT_ATTR_DATA),f=o;f-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<n&&this.lines.push(new O.BufferLine(r,i))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-o,0)},l.prototype._reflowSmaller=function(r,n){for(var o=this.getNullCell(O.DEFAULT_ATTR_DATA),i=[],f=0,h=this.lines.length-1;h>=0;h--){var T=this.lines.get(h);if(!(!T||!T.isWrapped&&T.getTrimmedLength()<=r)){for(var g=[T];T.isWrapped&&h>0;)T=this.lines.get(--h),g.unshift(T);var w=this.ybase+this.y;if(!(w>=h&&w<h+g.length)){var C=g[g.length-1].getTrimmedLength(),x=y.reflowSmallerGetNewLineLengths(g,this._cols,r),b=x.length-g.length,S=void 0;S=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+b):Math.max(0,this.lines.length-this.lines.maxLength+b);for(var A=[],p=0;p<b;p++){var I=this.getBlankLine(O.DEFAULT_ATTR_DATA,!0);A.push(I)}A.length>0&&(i.push({start:h+g.length+f,newLines:A}),f+=A.length),g.push.apply(g,A);var M=x.length-1,P=x[M];P===0&&(P=x[--M]);for(var B=g.length-b-1,H=C;B>=0;){var F=Math.min(H,P);if(g[M].copyCellsFrom(g[B],H-F,P-F,F,!0),(P-=F)===0&&(P=x[--M]),(H-=F)===0){B--;var W=Math.max(B,0);H=y.getWrappedLineTrimmedLength(g,W,this._cols)}}for(p=0;p<g.length;p++)x[p]<r&&g[p].setCell(x[p],o);for(var U=b-S;U-- >0;)this.ybase===0?this.y<n-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+f)-n&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+b,this.ybase+n-1)}}}if(i.length>0){var K=[],G=[];for(p=0;p<this.lines.length;p++)G.push(this.lines.get(p));var ae=this.lines.length,fe=ae-1,Se=0,Ue=i[Se];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+f);var Ne=0;for(p=Math.min(this.lines.maxLength-1,ae+f-1);p>=0;p--)if(Ue&&Ue.start>fe+Ne){for(var xe=Ue.newLines.length-1;xe>=0;xe--)this.lines.set(p--,Ue.newLines[xe]);p++,K.push({index:fe+1,amount:Ue.newLines.length}),Ne+=Ue.newLines.length,Ue=i[++Se]}else this.lines.set(p,G[fe--]);var Ce=0;for(p=K.length-1;p>=0;p--)K[p].index+=Ce,this.lines.onInsertEmitter.fire(K[p]),Ce+=K[p].amount;var De=Math.max(0,ae+f-this.lines.maxLength);De>0&&this.lines.onTrimEmitter.fire(De)}},l.prototype.stringIndexToBufferIndex=function(r,n,o){for(o===void 0&&(o=!1);n;){var i=this.lines.get(r);if(!i)return[-1,-1];for(var f=o?i.getTrimmedLength():i.length,h=0;h<f;++h)if(i.get(h)[E.CHAR_DATA_WIDTH_INDEX]&&(n-=i.get(h)[E.CHAR_DATA_CHAR_INDEX].length||1),n<0)return[r,h];r++}return[r,0]},l.prototype.translateBufferLineToString=function(r,n,o,i){o===void 0&&(o=0);var f=this.lines.get(r);return f?f.translateToString(n,o,i):""},l.prototype.getWrappedRangeForLine=function(r){for(var n=r,o=r;n>0&&this.lines.get(n).isWrapped;)n--;for(;o+1<this.lines.length&&this.lines.get(o+1).isWrapped;)o++;return{first:n,last:o}},l.prototype.setupTabStops=function(r){for(r!=null?this.tabs[r]||(r=this.prevStop(r)):(this.tabs={},r=0);r<this._cols;r+=this._optionsService.options.tabStopWidth)this.tabs[r]=!0},l.prototype.prevStop=function(r){for(r==null&&(r=this.x);!this.tabs[--r]&&r>0;);return r>=this._cols?this._cols-1:r<0?0:r},l.prototype.nextStop=function(r){for(r==null&&(r=this.x);!this.tabs[++r]&&r<this._cols;);return r>=this._cols?this._cols-1:r<0?0:r},l.prototype.addMarker=function(r){var n=this,o=new v.Marker(r);return this.markers.push(o),o.register(this.lines.onTrim(function(i){o.line-=i,o.line<0&&o.dispose()})),o.register(this.lines.onInsert(function(i){o.line>=i.index&&(o.line+=i.amount)})),o.register(this.lines.onDelete(function(i){o.line>=i.index&&o.line<i.index+i.amount&&o.dispose(),o.line>i.index&&(o.line-=i.amount)})),o.register(o.onDispose(function(){return n._removeMarker(o)})),o},l.prototype._removeMarker=function(r){this.markers.splice(this.markers.indexOf(r),1)},l.prototype.iterator=function(r,n,o,i,f){return new s(this,r,n,o,i,f)},l}();k.Buffer=c;var s=function(){function l(r,n,o,i,f,h){o===void 0&&(o=0),i===void 0&&(i=r.lines.length),f===void 0&&(f=0),h===void 0&&(h=0),this._buffer=r,this._trimRight=n,this._startIndex=o,this._endIndex=i,this._startOverscan=f,this._endOverscan=h,this._startIndex<0&&(this._startIndex=0),this._endIndex>this._buffer.lines.length&&(this._endIndex=this._buffer.lines.length),this._current=this._startIndex}return l.prototype.hasNext=function(){return this._current<this._endIndex},l.prototype.next=function(){var r=this._buffer.getWrappedRangeForLine(this._current);r.first<this._startIndex-this._startOverscan&&(r.first=this._startIndex-this._startOverscan),r.last>this._endIndex+this._endOverscan&&(r.last=this._endIndex+this._endOverscan),r.first=Math.max(r.first,0),r.last=Math.min(r.last,this._buffer.lines.length);for(var n="",o=r.first;o<=r.last;++o)n+=this._buffer.translateBufferLineToString(o,this._trimRight);return this._current=r.last+1,{range:r,content:n}},l}();k.BufferStringIterator=s},function(j,k,D){"use strict";Object.defineProperty(k,"__esModule",{value:!0}),k.CircularList=void 0;var R=D(0),O=function(){function d(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(d.prototype,"onDelete",{get:function(){return this.onDeleteEmitter.event},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"onInsert",{get:function(){return this.onInsertEmitter.event},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"onTrim",{get:function(){return this.onTrimEmitter.event},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"maxLength",{get:function(){return this._maxLength},set:function(E){if(this._maxLength!==E){for(var y=new Array(E),v=0;v<Math.min(E,this.length);v++)y[v]=this._array[this._getCyclicIndex(v)];this._array=y,this._maxLength=E,this._startIndex=0}},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"length",{get:function(){return this._length},set:function(E){if(E>this._length)for(var y=this._length;y<E;y++)this._array[y]=void 0;this._length=E},enumerable:!1,configurable:!0}),d.prototype.get=function(E){return this._array[this._getCyclicIndex(E)]},d.prototype.set=function(E,y){this._array[this._getCyclicIndex(E)]=y},d.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++},d.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(d.prototype,"isFull",{get:function(){return this._length===this._maxLength},enumerable:!1,configurable:!0}),d.prototype.pop=function(){return this._array[this._getCyclicIndex(this._length---1)]},d.prototype.splice=function(E,y){for(var v=[],u=2;u<arguments.length;u++)v[u-2]=arguments[u];if(y){for(var a=E;a<this._length-y;a++)this._array[this._getCyclicIndex(a)]=this._array[this._getCyclicIndex(a+y)];this._length-=y}for(a=this._length-1;a>=E;a--)this._array[this._getCyclicIndex(a+v.length)]=this._array[this._getCyclicIndex(a)];for(a=0;a<v.length;a++)this._array[this._getCyclicIndex(E+a)]=v[a];if(this._length+v.length>this._maxLength){var c=this._length+v.length-this._maxLength;this._startIndex+=c,this._length=this._maxLength,this.onTrimEmitter.fire(c)}else this._length+=v.length},d.prototype.trimStart=function(E){E>this._length&&(E=this._length),this._startIndex+=E,this._length-=E,this.onTrimEmitter.fire(E)},d.prototype.shiftElements=function(E,y,v){if(!(y<=0)){if(E<0||E>=this._length)throw new Error("start argument out of range");if(E+v<0)throw new Error("Cannot shift elements in list beyond index 0");if(v>0){for(var u=y-1;u>=0;u--)this.set(E+u+v,this.get(E+u));var a=E+y+v-this._length;if(a>0)for(this._length+=a;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(u=0;u<y;u++)this.set(E+u+v,this.get(E+u))}},d.prototype._getCyclicIndex=function(E){return(this._startIndex+E)%this._maxLength},d}();k.CircularList=O},function(j,k,D){"use strict";function R(O,d,E){if(d===O.length-1)return O[d].getTrimmedLength();var y=!O[d].hasContent(E-1)&&O[d].getWidth(E-1)===1,v=O[d+1].getWidth(0)===2;return y&&v?E-1:E}Object.defineProperty(k,"__esModule",{value:!0}),k.getWrappedLineTrimmedLength=k.reflowSmallerGetNewLineLengths=k.reflowLargerApplyNewLayout=k.reflowLargerCreateNewLayout=k.reflowLargerGetLinesToRemove=void 0,k.reflowLargerGetLinesToRemove=function(O,d,E,y,v){for(var u=[],a=0;a<O.length-1;a++){var c=a,s=O.get(++c);if(s.isWrapped){for(var l=[O.get(a)];c<O.length&&s.isWrapped;)l.push(s),s=O.get(++c);if(y>=a&&y<c)a+=l.length-1;else{for(var r=0,n=R(l,r,d),o=1,i=0;o<l.length;){var f=R(l,o,d),h=f-i,T=E-n,g=Math.min(h,T);l[r].copyCellsFrom(l[o],i,n,g,!1),(n+=g)===E&&(r++,n=0),(i+=g)===f&&(o++,i=0),n===0&&r!==0&&l[r-1].getWidth(E-1)===2&&(l[r].copyCellsFrom(l[r-1],E-1,n++,1,!1),l[r-1].setCell(E-1,v))}l[r].replaceCells(n,E,v);for(var w=0,C=l.length-1;C>0&&(C>r||l[C].getTrimmedLength()===0);C--)w++;w>0&&(u.push(a+l.length-w),u.push(w)),a+=l.length-1}}}return u},k.reflowLargerCreateNewLayout=function(O,d){for(var E=[],y=0,v=d[y],u=0,a=0;a<O.length;a++)if(v===a){var c=d[++y];O.onDeleteEmitter.fire({index:a-u,amount:c}),a+=c-1,u+=c,v=d[++y]}else E.push(a);return{layout:E,countRemoved:u}},k.reflowLargerApplyNewLayout=function(O,d){for(var E=[],y=0;y<d.length;y++)E.push(O.get(d[y]));for(y=0;y<E.length;y++)O.set(y,E[y]);O.length=d.length},k.reflowSmallerGetNewLineLengths=function(O,d,E){for(var y=[],v=O.map(function(n,o){return R(O,o,d)}).reduce(function(n,o){return n+o}),u=0,a=0,c=0;c<v;){if(v-c<E){y.push(v-c);break}u+=E;var s=R(O,a,d);u>s&&(u-=s,a++);var l=O[a].getWidth(u-1)===2;l&&u--;var r=l?E-1:E;y.push(r),c+=r}return y},k.getWrappedLineTrimmedLength=R},function(j,k,D){"use strict";var R,O=this&&this.__extends||(R=function(y,v){return(R=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(u,a){u.__proto__=a}||function(u,a){for(var c in a)a.hasOwnProperty(c)&&(u[c]=a[c])})(y,v)},function(y,v){function u(){this.constructor=y}R(y,v),y.prototype=v===null?Object.create(v):(u.prototype=v.prototype,new u)});Object.defineProperty(k,"__esModule",{value:!0}),k.Marker=void 0;var d=D(0),E=function(y){function v(u){var a=y.call(this)||this;return a.line=u,a._id=v._nextId++,a.isDisposed=!1,a._onDispose=new d.EventEmitter,a}return O(v,y),Object.defineProperty(v.prototype,"id",{get:function(){return this._id},enumerable:!1,configurable:!0}),Object.defineProperty(v.prototype,"onDispose",{get:function(){return this._onDispose.event},enumerable:!1,configurable:!0}),v.prototype.dispose=function(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire())},v._nextId=1,v}(D(2).Disposable);k.Marker=E},function(j,k,D){"use strict";Object.defineProperty(k,"__esModule",{value:!0}),k.OptionsService=k.DEFAULT_OPTIONS=k.DEFAULT_BELL_SOUND=void 0;var R=D(0),O=D(11),d=D(33);k.DEFAULT_BELL_SOUND="data:audio/mp3;base64,SUQzBAAAAAAAI1RTU0UAAAAPAAADTGF2ZjU4LjMyLjEwNAAAAAAAAAAAAAAA//tQxAADB8AhSmxhIIEVCSiJrDCQBTcu3UrAIwUdkRgQbFAZC1CQEwTJ9mjRvBA4UOLD8nKVOWfh+UlK3z/177OXrfOdKl7pyn3Xf//WreyTRUoAWgBgkOAGbZHBgG1OF6zM82DWbZaUmMBptgQhGjsyYqc9ae9XFz280948NMBWInljyzsNRFLPWdnZGWrddDsjK1unuSrVN9jJsK8KuQtQCtMBjCEtImISdNKJOopIpBFpNSMbIHCSRpRR5iakjTiyzLhchUUBwCgyKiweBv/7UsQbg8isVNoMPMjAAAA0gAAABEVFGmgqK////9bP/6XCykxBTUUzLjEwMKqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq",k.DEFAULT_OPTIONS=Object.freeze({cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,bellSound:k.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:O.isMac,rendererType:"canvas",windowOptions:{},windowsMode:!1,wordSeparator:" ()[]{}',\"`",convertEol:!1,termName:"xterm",cancelEvents:!1});var E=["cols","rows"],y=function(){function v(u){this._onOptionChange=new R.EventEmitter,this.options=d.clone(k.DEFAULT_OPTIONS);for(var a=0,c=Object.keys(u);a<c.length;a++){var s=c[a];if(s in this.options){var l=u[s];this.options[s]=l}}}return Object.defineProperty(v.prototype,"onOptionChange",{get:function(){return this._onOptionChange.event},enumerable:!1,configurable:!0}),v.prototype.setOption=function(u,a){if(!(u in k.DEFAULT_OPTIONS))throw new Error('No option with key "'+u+'"');if(E.indexOf(u)!==-1)throw new Error('Option "'+u+'" can only be set in the constructor');this.options[u]!==a&&(a=this._sanitizeAndValidateOption(u,a),this.options[u]!==a&&(this.options[u]=a,this._onOptionChange.fire(u)))},v.prototype._sanitizeAndValidateOption=function(u,a){switch(u){case"bellStyle":case"cursorStyle":case"fontWeight":case"fontWeightBold":case"rendererType":case"wordSeparator":a||(a=k.DEFAULT_OPTIONS[u]);break;case"cursorWidth":a=Math.floor(a);case"lineHeight":case"tabStopWidth":if(a<1)throw new Error(u+" cannot be less than 1, value: "+a);break;case"minimumContrastRatio":a=Math.max(1,Math.min(21,Math.round(10*a)/10));break;case"scrollback":if((a=Math.min(a,4294967295))<0)throw new Error(u+" cannot be less than 0, value: "+a);break;case"fastScrollSensitivity":case"scrollSensitivity":if(a<=0)throw new Error(u+" cannot be less than or equal to 0, value: "+a)}return a},v.prototype.getOption=function(u){if(!(u in k.DEFAULT_OPTIONS))throw new Error('No option with key "'+u+'"');return this.options[u]},v}();k.OptionsService=y},function(j,k,D){"use strict";var R,O=this&&this.__extends||(R=function(r,n){return(R=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,i){o.__proto__=i}||function(o,i){for(var f in i)i.hasOwnProperty(f)&&(o[f]=i[f])})(r,n)},function(r,n){function o(){this.constructor=r}R(r,n),r.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}),d=this&&this.__decorate||function(r,n,o,i){var f,h=arguments.length,T=h<3?n:i===null?i=Object.getOwnPropertyDescriptor(n,o):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(r,n,o,i);else for(var g=r.length-1;g>=0;g--)(f=r[g])&&(T=(h<3?f(T):h>3?f(n,o,T):f(n,o))||T);return h>3&&T&&Object.defineProperty(n,o,T),T},E=this&&this.__param||function(r,n){return function(o,i){n(o,i,r)}};Object.defineProperty(k,"__esModule",{value:!0}),k.CoreService=void 0;var y=D(1),v=D(0),u=D(33),a=D(2),c=Object.freeze({insertMode:!1}),s=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0}),l=function(r){function n(o,i,f,h){var T=r.call(this)||this;return T._bufferService=i,T._logService=f,T._optionsService=h,T.isCursorInitialized=!1,T.isCursorHidden=!1,T._onData=T.register(new v.EventEmitter),T._onUserInput=T.register(new v.EventEmitter),T._onBinary=T.register(new v.EventEmitter),T._scrollToBottom=o,T.register({dispose:function(){return T._scrollToBottom=void 0}}),T.modes=u.clone(c),T.decPrivateModes=u.clone(s),T}return O(n,r),Object.defineProperty(n.prototype,"onData",{get:function(){return this._onData.event},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"onUserInput",{get:function(){return this._onUserInput.event},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"onBinary",{get:function(){return this._onBinary.event},enumerable:!1,configurable:!0}),n.prototype.reset=function(){this.modes=u.clone(c),this.decPrivateModes=u.clone(s)},n.prototype.triggerDataEvent=function(o,i){if(i===void 0&&(i=!1),!this._optionsService.options.disableStdin){var f=this._bufferService.buffer;f.ybase!==f.ydisp&&this._scrollToBottom(),i&&this._onUserInput.fire(),this._logService.debug('sending data "'+o+'"',function(){return o.split("").map(function(h){return h.charCodeAt(0)})}),this._onData.fire(o)}},n.prototype.triggerBinaryEvent=function(o){this._optionsService.options.disableStdin||(this._logService.debug('sending binary "'+o+'"',function(){return o.split("").map(function(i){return i.charCodeAt(0)})}),this._onBinary.fire(o))},n=d([E(1,y.IBufferService),E(2,y.ILogService),E(3,y.IOptionsService)],n)}(a.Disposable);k.CoreService=l},function(j,k,D){"use strict";var R=this&&this.__decorate||function(s,l,r,n){var o,i=arguments.length,f=i<3?l:n===null?n=Object.getOwnPropertyDescriptor(l,r):n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")f=Reflect.decorate(s,l,r,n);else for(var h=s.length-1;h>=0;h--)(o=s[h])&&(f=(i<3?o(f):i>3?o(l,r,f):o(l,r))||f);return i>3&&f&&Object.defineProperty(l,r,f),f},O=this&&this.__param||function(s,l){return function(r,n){l(r,n,s)}};Object.defineProperty(k,"__esModule",{value:!0}),k.CoreMouseService=void 0;var d=D(1),E=D(0),y={NONE:{events:0,restrict:function(){return!1}},X10:{events:1,restrict:function(s){return s.button!==4&&s.action===1&&(s.ctrl=!1,s.alt=!1,s.shift=!1,!0)}},VT200:{events:19,restrict:function(s){return s.action!==32}},DRAG:{events:23,restrict:function(s){return s.action!==32||s.button!==3}},ANY:{events:31,restrict:function(s){return!0}}};function v(s,l){var r=(s.ctrl?16:0)|(s.shift?4:0)|(s.alt?8:0);return s.button===4?(r|=64,r|=s.action):(r|=3&s.button,4&s.button&&(r|=64),8&s.button&&(r|=128),s.action===32?r|=32:s.action!==0||l||(r|=3)),r}var u=String.fromCharCode,a={DEFAULT:function(s){var l=[v(s,!1)+32,s.col+32,s.row+32];return l[0]>255||l[1]>255||l[2]>255?"":"[M"+u(l[0])+u(l[1])+u(l[2])},SGR:function(s){var l=s.action===0&&s.button!==4?"m":"M";return"[<"+v(s,!0)+";"+s.col+";"+s.row+l}},c=function(){function s(l,r){this._bufferService=l,this._coreService=r,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._onProtocolChange=new E.EventEmitter,this._lastEvent=null;for(var n=0,o=Object.keys(y);n<o.length;n++){var i=o[n];this.addProtocol(i,y[i])}for(var f=0,h=Object.keys(a);f<h.length;f++){var T=h[f];this.addEncoding(T,a[T])}this.reset()}return s.prototype.addProtocol=function(l,r){this._protocols[l]=r},s.prototype.addEncoding=function(l,r){this._encodings[l]=r},Object.defineProperty(s.prototype,"activeProtocol",{get:function(){return this._activeProtocol},set:function(l){if(!this._protocols[l])throw new Error('unknown protocol "'+l+'"');this._activeProtocol=l,this._onProtocolChange.fire(this._protocols[l].events)},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"areMouseEventsActive",{get:function(){return this._protocols[this._activeProtocol].events!==0},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"activeEncoding",{get:function(){return this._activeEncoding},set:function(l){if(!this._encodings[l])throw new Error('unknown encoding "'+l+'"');this._activeEncoding=l},enumerable:!1,configurable:!0}),s.prototype.reset=function(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null},Object.defineProperty(s.prototype,"onProtocolChange",{get:function(){return this._onProtocolChange.event},enumerable:!1,configurable:!0}),s.prototype.triggerMouseEvent=function(l){if(l.col<0||l.col>=this._bufferService.cols||l.row<0||l.row>=this._bufferService.rows)return!1;if(l.button===4&&l.action===32)return!1;if(l.button===3&&l.action!==32)return!1;if(l.button!==4&&(l.action===2||l.action===3))return!1;if(l.col++,l.row++,l.action===32&&this._lastEvent&&this._compareEvents(this._lastEvent,l))return!1;if(!this._protocols[this._activeProtocol].restrict(l))return!1;var r=this._encodings[this._activeEncoding](l);return r&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(r):this._coreService.triggerDataEvent(r,!0)),this._lastEvent=l,!0},s.prototype.explainEvents=function(l){return{down:!!(1&l),up:!!(2&l),drag:!!(4&l),move:!!(8&l),wheel:!!(16&l)}},s.prototype._compareEvents=function(l,r){return l.col===r.col&&(l.row===r.row&&(l.button===r.button&&(l.action===r.action&&(l.ctrl===r.ctrl&&l.alt===r.alt))))&&l.shift===r.shift},s=R([O(0,d.IBufferService),O(1,d.ICoreService)],s)}();k.CoreMouseService=c},function(j,k,D){"use strict";var R=this&&this.__decorate||function(y,v,u,a){var c,s=arguments.length,l=s<3?v:a===null?a=Object.getOwnPropertyDescriptor(v,u):a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")l=Reflect.decorate(y,v,u,a);else for(var r=y.length-1;r>=0;r--)(c=y[r])&&(l=(s<3?c(l):s>3?c(v,u,l):c(v,u))||l);return s>3&&l&&Object.defineProperty(v,u,l),l},O=this&&this.__param||function(y,v){return function(u,a){v(u,a,y)}};Object.defineProperty(k,"__esModule",{value:!0}),k.DirtyRowService=void 0;var d=D(1),E=function(){function y(v){this._bufferService=v,this.clearRange()}return Object.defineProperty(y.prototype,"start",{get:function(){return this._start},enumerable:!1,configurable:!0}),Object.defineProperty(y.prototype,"end",{get:function(){return this._end},enumerable:!1,configurable:!0}),y.prototype.clearRange=function(){this._start=this._bufferService.buffer.y,this._end=this._bufferService.buffer.y},y.prototype.markDirty=function(v){v<this._start?this._start=v:v>this._end&&(this._end=v)},y.prototype.markRangeDirty=function(v,u){if(v>u){var a=v;v=u,u=a}v<this._start&&(this._start=v),u>this._end&&(this._end=u)},y.prototype.markAllDirty=function(){this.markRangeDirty(0,this._bufferService.rows-1)},y=R([O(0,d.IBufferService)],y)}();k.DirtyRowService=E},function(j,k,D){"use strict";Object.defineProperty(k,"__esModule",{value:!0}),k.UnicodeService=void 0;var R=D(0),O=D(79),d=function(){function E(){this._providers=Object.create(null),this._active="",this._onChange=new R.EventEmitter;var y=new O.UnicodeV6;this.register(y),this._active=y.version,this._activeProvider=y}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(y){if(!this._providers[y])throw new Error('unknown Unicode version "'+y+'"');this._active=y,this._activeProvider=this._providers[y],this._onChange.fire(y)},enumerable:!1,configurable:!0}),E.prototype.register=function(y){this._providers[y.version]=y},E.prototype.wcwidth=function(y){return this._activeProvider.wcwidth(y)},E.prototype.getStringCellWidth=function(y){for(var v=0,u=y.length,a=0;a<u;++a){var c=y.charCodeAt(a);if(55296<=c&&c<=56319){if(++a>=u)return v+this.wcwidth(c);var s=y.charCodeAt(a);56320<=s&&s<=57343?c=1024*(c-55296)+s-56320+65536:v+=this.wcwidth(s)}v+=this.wcwidth(c)}return v},E}();k.UnicodeService=d},function(j,k,D){"use strict";Object.defineProperty(k,"__esModule",{value:!0}),k.UnicodeV6=void 0;var R,O=D(15),d=[[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]],y=function(){function v(){if(this.version="6",!R){R=new Uint8Array(65536),O.fill(R,1),R[0]=0,O.fill(R,0,1,32),O.fill(R,0,127,160),O.fill(R,2,4352,4448),R[9001]=2,R[9002]=2,O.fill(R,2,11904,42192),R[12351]=1,O.fill(R,2,44032,55204),O.fill(R,2,63744,64256),O.fill(R,2,65040,65050),O.fill(R,2,65072,65136),O.fill(R,2,65280,65377),O.fill(R,2,65504,65511);for(var u=0;u<d.length;++u)O.fill(R,0,d[u][0],d[u][1]+1)}}return v.prototype.wcwidth=function(u){return u<32?0:u<127?1:u<65536?R[u]:function(a,c){var s,l=0,r=c.length-1;if(a<c[0][0]||a>c[r][1])return!1;for(;r>=l;)if(a>c[s=l+r>>1][1])l=s+1;else{if(!(a<c[s][0]))return!0;r=s-1}return!1}(u,E)?0:u>=131072&&u<=196605||u>=196608&&u<=262141?2:1},v}();k.UnicodeV6=y},function(j,k,D){"use strict";Object.defineProperty(k,"__esModule",{value:!0}),k.CharsetService=void 0;var R=function(){function O(){this.glevel=0,this._charsets=[]}return O.prototype.reset=function(){this.charset=void 0,this._charsets=[],this.glevel=0},O.prototype.setgLevel=function(d){this.glevel=d,this.charset=this._charsets[d]},O.prototype.setgCharset=function(d,E){this._charsets[d]=E,this.glevel===d&&(this.charset=E)},O}();k.CharsetService=R},function(j,k,D){"use strict";Object.defineProperty(k,"__esModule",{value:!0}),k.updateWindowsModeWrappedState=void 0;var R=D(3);k.updateWindowsModeWrappedState=function(O){var d=O.buffer.lines.get(O.buffer.ybase+O.buffer.y-1),E=d==null?void 0:d.get(O.cols-1),y=O.buffer.lines.get(O.buffer.ybase+O.buffer.y);y&&E&&(y.isWrapped=E[R.CHAR_DATA_CODE_INDEX]!==R.NULL_CELL_CODE&&E[R.CHAR_DATA_CODE_INDEX]!==R.WHITESPACE_CELL_CODE)}},function(j,k,D){"use strict";Object.defineProperty(k,"__esModule",{value:!0}),k.WriteBuffer=void 0;var R=function(){function O(d){this._action=d,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0}return O.prototype.writeSync=function(d){if(this._writeBuffer.length){for(var E=this._bufferOffset;E<this._writeBuffer.length;++E){var y=this._writeBuffer[E],v=this._callbacks[E];this._action(y),v&&v()}this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=2147483647}this._action(d)},O.prototype.write=function(d,E){var y=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 y._innerWrite()})),this._pendingData+=d.length,this._writeBuffer.push(d),this._callbacks.push(E)},O.prototype._innerWrite=function(){for(var d=this,E=Date.now();this._writeBuffer.length>this._bufferOffset;){var y=this._writeBuffer[this._bufferOffset],v=this._callbacks[this._bufferOffset];if(this._bufferOffset++,this._action(y),this._pendingData-=y.length,v&&v(),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 d._innerWrite()},0)):(this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0)},O}();k.WriteBuffer=R},function(j,k,D){"use strict";Object.defineProperty(k,"__esModule",{value:!0}),k.AddonManager=void 0;var R=function(){function O(){this._addons=[]}return O.prototype.dispose=function(){for(var d=this._addons.length-1;d>=0;d--)this._addons[d].instance.dispose()},O.prototype.loadAddon=function(d,E){var y=this,v={instance:E,dispose:E.dispose,isDisposed:!1};this._addons.push(v),E.dispose=function(){return y._wrappedAddonDispose(v)},E.activate(d)},O.prototype._wrappedAddonDispose=function(d){if(!d.isDisposed){for(var E=-1,y=0;y<this._addons.length;y++)if(this._addons[y]===d){E=y;break}if(E===-1)throw new Error("Could not dispose an addon that has not been loaded");d.isDisposed=!0,d.dispose.apply(d.instance),this._addons.splice(E,1)}},O}();k.AddonManager=R}])})},"07cG":function(Je,le,re){Je.exports={ldsRing:"ldsRing___2F8W7",idsRingWrapper:"idsRingWrapper___fC2cF",ldsring:"ldsring___3A88y"}},"19Vz":function(Je,le,re){(function(j){j(re("VrN/"))})(function(j){j.defineOption("placeholder","",function(y,v,u){var a=u&&u!=j.Init;if(v&&!a)y.on("blur",O),y.on("change",d),y.on("swapDoc",d),j.on(y.getInputField(),"compositionupdate",y.state.placeholderCompose=function(){R(y)}),d(y);else if(!v&&a){y.off("blur",O),y.off("change",d),y.off("swapDoc",d),j.off(y.getInputField(),"compositionupdate",y.state.placeholderCompose),k(y);var c=y.getWrapperElement();c.className=c.className.replace(" CodeMirror-empty","")}v&&!y.hasFocus()&&O(y)});function k(y){y.state.placeholder&&(y.state.placeholder.parentNode.removeChild(y.state.placeholder),y.state.placeholder=null)}function D(y){k(y);var v=y.state.placeholder=document.createElement("pre");v.style.cssText="height: 0; overflow: visible",v.style.direction=y.getOption("direction"),v.className="CodeMirror-placeholder CodeMirror-line-like";var u=y.getOption("placeholder");typeof u=="string"&&(u=document.createTextNode(u)),v.appendChild(u),y.display.lineSpace.insertBefore(v,y.display.lineSpace.firstChild)}function R(y){setTimeout(function(){var v=!1,u=y.getInputField();u.nodeName=="TEXTAREA"?v=!u.value:y.lineCount()==1&&(v=!/[^\u200b]/.test(u.querySelector(".CodeMirror-line").textContent)),v?D(y):k(y)},20)}function O(y){E(y)&&D(y)}function d(y){var v=y.getWrapperElement(),u=E(y);v.className=v.className.replace(" CodeMirror-empty","")+(u?" CodeMirror-empty":""),u?D(y):k(y)}function E(y){return y.lineCount()===1&&y.getLine(0)===""}})},"1dTM":function(Je,le,re){"use strict";Object.defineProperty(le,"__esModule",{value:!0}),le.default=void 0;var j=re("GQ8N"),k=S(re("Lo0S")),D=re("VSMT"),R=re("GdRQ"),O=re("SZEN"),d=re("vewr"),E=x(re("YJ9k")),y=x(re("MZdM")),v=x(re("ItS6")),u=x(re("whVF")),a=x(re("Fv0C")),c=x(re("LCi9")),s=x(re("rwxt")),l=x(re("Mmt2")),r=x(re("iUHT")),n=x(re("mHUz")),o=x(re("P2ho")),i=re("NBmB");re("mdZa");var f=x(re("34/K")),h=x(re("hXwI")),T=x(re("SgaC")),g=x(re("3690")),w=x(re("8K/p")),C=x(re("xO64"));function x(Ie){return Ie&&Ie.__esModule?Ie:{default:Ie}}function b(){if(typeof WeakMap!="function")return null;var Ie=new WeakMap;return b=function(){return Ie},Ie}function S(Ie){if(Ie&&Ie.__esModule)return Ie;if(Ie===null||A(Ie)!=="object"&&typeof Ie!="function")return{default:Ie};var ke=b();if(ke&&ke.has(Ie))return ke.get(Ie);var Ae={},Te=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var Z in Ie)if(Object.prototype.hasOwnProperty.call(Ie,Z)){var ce=Te?Object.getOwnPropertyDescriptor(Ie,Z):null;ce&&(ce.get||ce.set)?Object.defineProperty(Ae,Z,ce):Ae[Z]=Ie[Z]}return Ae.default=Ie,ke&&ke.set(Ie,Ae),Ae}function A(Ie){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?A=function(Ae){return typeof Ae}:A=function(Ae){return Ae&&typeof Symbol=="function"&&Ae.constructor===Symbol&&Ae!==Symbol.prototype?"symbol":typeof Ae},A(Ie)}function p(Ie,ke){if(!(Ie instanceof ke))throw new TypeError("Cannot call a class as a function")}function I(Ie,ke){for(var Ae=0;Ae<ke.length;Ae++){var Te=ke[Ae];Te.enumerable=Te.enumerable||!1,Te.configurable=!0,"value"in Te&&(Te.writable=!0),Object.defineProperty(Ie,Te.key,Te)}}function M(Ie,ke,Ae){return ke&&I(Ie.prototype,ke),Ae&&I(Ie,Ae),Ie}function P(Ie,ke){if(typeof ke!="function"&&ke!==null)throw new TypeError("Super expression must either be null or a function");Ie.prototype=Object.create(ke&&ke.prototype,{constructor:{value:Ie,writable:!0,configurable:!0}}),ke&&B(Ie,ke)}function B(Ie,ke){return B=Object.setPrototypeOf||function(Te,Z){return Te.__proto__=Z,Te},B(Ie,ke)}function H(Ie){var ke=U();return function(){var Te=K(Ie),Z;if(ke){var ce=K(this).constructor;Z=Reflect.construct(Te,arguments,ce)}else Z=Te.apply(this,arguments);return F(this,Z)}}function F(Ie,ke){return ke&&(A(ke)==="object"||typeof ke=="function")?ke:W(Ie)}function W(Ie){if(Ie===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return Ie}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(Ie){return!1}}function K(Ie){return K=Object.setPrototypeOf?Object.getPrototypeOf:function(Ae){return Ae.__proto__||Object.getPrototypeOf(Ae)},K(Ie)}var G=3,ae="rgb(40, 40, 40)",fe=17,Se=50,Ue=19,Ne=75,xe=50,Ce=1e3,De=50,ve=1,Re=1<<1,ee=1<<2,ge=1<<3,se=1<<4,Fe=1<<24,je=1<<25,Ke=1<<26,ze=1<<27,Ge=1<<28,He=function(Ie){P(Ae,Ie);var ke=H(Ae);function Ae(Te,Z,ce){var J;if(p(this,Ae),!Te)throw new Error("Must specify target");if(!Z)throw new Error("Must specify URL");J=ke.call(this),J._target=Te,J._url=Z,ce=ce||{},J._rfbCredentials=ce.credentials||{},J._shared="shared"in ce?!!ce.shared:!0,J._repeaterID=ce.repeaterID||"",J._wsProtocols=ce.wsProtocols||[],J._rfbConnectionState="",J._rfbInitState="",J._rfbAuthScheme=-1,J._rfbCleanDisconnect=!0,J._rfbVersion=0,J._rfbMaxVersion=3.8,J._rfbTightVNC=!1,J._rfbVeNCryptState=0,J._rfbXvpVer=0,J._fbWidth=0,J._fbHeight=0,J._fbName="",J._capabilities={power:!1},J._supportsFence=!1,J._supportsContinuousUpdates=!1,J._enabledContinuousUpdates=!1,J._supportsSetDesktopSize=!1,J._screenID=0,J._screenFlags=0,J._qemuExtKeyEventSupported=!1,J._clipboardText=null,J._clipboardServerCapabilitiesActions={},J._clipboardServerCapabilitiesFormats={},J._sock=null,J._display=null,J._flushing=!1,J._keyboard=null,J._gestures=null,J._disconnTimer=null,J._resizeTimeout=null,J._mouseMoveTimer=null,J._decoders={},J._FBU={rects:0,x:0,y:0,width:0,height:0,encoding:null},J._mousePos={},J._mouseButtonMask=0,J._mouseLastMoveTime=0,J._viewportDragging=!1,J._viewportDragPos={},J._viewportHasMoved=!1,J._accumulatedWheelDeltaX=0,J._accumulatedWheelDeltaY=0,J._gestureLastTapTime=null,J._gestureFirstDoubleTapEv=null,J._gestureLastMagnitudeX=0,J._gestureLastMagnitudeY=0,J._eventHandlers={focusCanvas:J._focusCanvas.bind(W(J)),windowResize:J._windowResize.bind(W(J)),handleMouse:J._handleMouse.bind(W(J)),handleWheel:J._handleWheel.bind(W(J)),handleGesture:J._handleGesture.bind(W(J))},k.Debug(">> RFB.constructor"),J._screen=document.createElement("div"),J._screen.style.display="flex",J._screen.style.width="100%",J._screen.style.height="100%",J._screen.style.overflow="auto",J._screen.style.background=ae,J._canvas=document.createElement("canvas"),J._canvas.style.margin="auto",J._canvas.style.outline="none",J._canvas.style.flexShrink="0",J._canvas.width=0,J._canvas.height=0,J._canvas.tabIndex=-1,J._screen.appendChild(J._canvas),J._cursor=new s.default,J._cursorImage=Ae.cursors.none,J._decoders[i.encodings.encodingRaw]=new f.default,J._decoders[i.encodings.encodingCopyRect]=new h.default,J._decoders[i.encodings.encodingRRE]=new T.default,J._decoders[i.encodings.encodingHextile]=new g.default,J._decoders[i.encodings.encodingTight]=new w.default,J._decoders[i.encodings.encodingTightPNG]=new C.default;try{J._display=new y.default(J._canvas)}catch(Le){throw k.Error("Display exception: "+Le),Le}return J._display.onflush=J._onFlush.bind(W(J)),J._keyboard=new a.default(J._canvas),J._keyboard.onkeyevent=J._handleKeyEvent.bind(W(J)),J._gestures=new c.default,J._sock=new l.default,J._sock.on("message",function(){J._handleMessage()}),J._sock.on("open",function(){J._rfbConnectionState==="connecting"&&J._rfbInitState===""?(J._rfbInitState="ProtocolVersion",k.Debug("Starting VNC handshake")):J._fail("Unexpected server connection while "+J._rfbConnectionState)}),J._sock.on("close",function(Le){k.Debug("WebSocket on-close event");var We="";Le.code&&(We="(code: "+Le.code,Le.reason&&(We+=", reason: "+Le.reason),We+=")");switch(J._rfbConnectionState){case"connecting":J._fail("Connection closed "+We);break;case"connected":J._updateConnectionState("disconnecting"),J._updateConnectionState("disconnected");break;case"disconnecting":J._updateConnectionState("disconnected");break;case"disconnected":J._fail("Unexpected server disconnect when already disconnected "+We);break;default:J._fail("Unexpected server disconnect before connecting "+We);break}J._sock.off("close")}),J._sock.on("error",function(Le){return k.Warn("WebSocket on-error event")}),setTimeout(J._updateConnectionState.bind(W(J),"connecting")),k.Debug("<< RFB.constructor"),J.dragViewport=!1,J.focusOnClick=!0,J._viewOnly=!1,J._clipViewport=!1,J._scaleViewport=!1,J._resizeSession=!1,J._showDotCursor=!1,ce.showDotCursor!==void 0&&(k.Warn("Specifying showDotCursor as a RFB constructor argument is deprecated"),J._showDotCursor=ce.showDotCursor),J._qualityLevel=6,J._compressionLevel=2,J}return M(Ae,[{key:"disconnect",value:function(){this._updateConnectionState("disconnecting"),this._sock.off("error"),this._sock.off("message"),this._sock.off("open")}},{key:"sendCredentials",value:function(Z){this._rfbCredentials=Z,setTimeout(this._initMsg.bind(this),0)}},{key:"sendCtrlAltDel",value:function(){if(this._rfbConnectionState!=="connected"||this._viewOnly)return;k.Info("Sending Ctrl-Alt-Del"),this.sendKey(n.default.XK_Control_L,"ControlLeft",!0),this.sendKey(n.default.XK_Alt_L,"AltLeft",!0),this.sendKey(n.default.XK_Delete,"Delete",!0),this.sendKey(n.default.XK_Delete,"Delete",!1),this.sendKey(n.default.XK_Alt_L,"AltLeft",!1),this.sendKey(n.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(Z,ce,J){if(this._rfbConnectionState!=="connected"||this._viewOnly)return;if(J===void 0){this.sendKey(Z,ce,!0),this.sendKey(Z,ce,!1);return}var Le=o.default[ce];if(this._qemuExtKeyEventSupported&&Le)Z=Z||0,k.Info("Sending key ("+(J?"down":"up")+"): keysym "+Z+", scancode "+Le),Ae.messages.QEMUExtendedKeyEvent(this._sock,Z,J,Le);else{if(!Z)return;k.Info("Sending keysym ("+(J?"down":"up")+"): "+Z),Ae.messages.keyEvent(this._sock,Z,J?1:0)}}},{key:"focus",value:function(){this._canvas.focus()}},{key:"blur",value:function(){this._canvas.blur()}},{key:"clipboardPasteFrom",value:function(Z){if(this._rfbConnectionState!=="connected"||this._viewOnly)return;if(this._clipboardServerCapabilitiesFormats[ve]&&this._clipboardServerCapabilitiesActions[ze])this._clipboardText=Z,Ae.messages.extendedClipboardNotify(this._sock,[ve]);else{for(var ce=new Uint8Array(Z.length),J=0;J<Z.length;J++)ce[J]=Z.charCodeAt(J);Ae.messages.clientCutText(this._sock,ce)}}},{key:"_connect",value:function(){k.Debug(">> RFB.connect"),k.Info("connecting to "+this._url);try{this._sock.open(this._url,this._wsProtocols)}catch(Z){Z.name==="SyntaxError"?this._fail("Invalid host or port ("+Z+")"):this._fail("Error when opening socket ("+Z+")")}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),k.Debug("<< RFB.connect")}},{key:"_disconnect",value:function(){k.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(Z){if(!(Z.name==="NotFoundError"))throw Z}clearTimeout(this._resizeTimeout),clearTimeout(this._mouseMoveTimer),k.Debug("<< RFB.disconnect")}},{key:"_focusCanvas",value:function(Z){if(!this.focusOnClick)return;this.focus()}},{key:"_setDesktopName",value:function(Z){this._fbName=Z,this.dispatchEvent(new CustomEvent("desktopname",{detail:{name:this._fbName}}))}},{key:"_windowResize",value:function(Z){var ce=this;window.requestAnimationFrame(function(){ce._updateClip(),ce._updateScale()}),this._resizeSession&&(clearTimeout(this._resizeTimeout),this._resizeTimeout=setTimeout(this._requestRemoteResize.bind(this),500))}},{key:"_updateClip",value:function(){var Z=this._display.clipViewport,ce=this._clipViewport;if(this._scaleViewport&&(ce=!1),Z!==ce&&(this._display.clipViewport=ce),ce){var J=this._screenSize();this._display.viewportChangeSize(J.w,J.h),this._fixScrollbars()}}},{key:"_updateScale",value:function(){if(!this._scaleViewport)this._display.scale=1;else{var Z=this._screenSize();this._display.autoscale(Z.w,Z.h)}this._fixScrollbars()}},{key:"_requestRemoteResize",value:function(){if(clearTimeout(this._resizeTimeout),this._resizeTimeout=null,!this._resizeSession||this._viewOnly||!this._supportsSetDesktopSize)return;var Z=this._screenSize();Ae.messages.setDesktopSize(this._sock,Math.floor(Z.w),Math.floor(Z.h),this._screenID,this._screenFlags),k.Debug("Requested new desktop size: "+Z.w+"x"+Z.h)}},{key:"_screenSize",value:function(){var Z=this._screen.getBoundingClientRect();return{w:Z.width,h:Z.height}}},{key:"_fixScrollbars",value:function(){var Z=this._screen.style.overflow;this._screen.style.overflow="hidden",this._screen.getBoundingClientRect(),this._screen.style.overflow=Z}},{key:"_updateConnectionState",value:function(Z){var ce=this,J=this._rfbConnectionState;if(Z===J){k.Debug("Already in state '"+Z+"', ignoring");return}if(J==="disconnected"){k.Error("Tried changing state of a disconnected RFB object");return}switch(Z){case"connected":if(J!=="connecting"){k.Error("Bad transition to connected state, previous connection state: "+J);return}break;case"disconnected":if(J!=="disconnecting"){k.Error("Bad transition to disconnected state, previous connection state: "+J);return}break;case"connecting":if(J!==""){k.Error("Bad transition to connecting state, previous connection state: "+J);return}break;case"disconnecting":if(J!=="connected"&&J!=="connecting"){k.Error("Bad transition to disconnecting state, previous connection state: "+J);return}break;default:k.Error("Unknown connection state: "+Z);return}this._rfbConnectionState=Z,k.Debug("New state '"+Z+"', was '"+J+"'."),this._disconnTimer&&Z!=="disconnecting"&&(k.Debug("Clearing disconnect timer"),clearTimeout(this._disconnTimer),this._disconnTimer=null,this._sock.off("close"));switch(Z){case"connecting":this._connect();break;case"connected":this.dispatchEvent(new CustomEvent("connect",{detail:{}}));break;case"disconnecting":this._disconnect(),this._disconnTimer=setTimeout(function(){k.Error("Disconnection timed out."),ce._updateConnectionState("disconnected")},G*1e3);break;case"disconnected":this.dispatchEvent(new CustomEvent("disconnect",{detail:{clean:this._rfbCleanDisconnect}}));break}}},{key:"_fail",value:function(Z){switch(this._rfbConnectionState){case"disconnecting":k.Error("Failed when disconnecting: "+Z);break;case"connected":k.Error("Failed while connected: "+Z);break;case"connecting":k.Error("Failed when connecting: "+Z);break;default:k.Error("RFB failure: "+Z);break}return this._rfbCleanDisconnect=!1,this._updateConnectionState("disconnecting"),this._updateConnectionState("disconnected"),!1}},{key:"_setCapability",value:function(Z,ce){this._capabilities[Z]=ce,this.dispatchEvent(new CustomEvent("capabilities",{detail:{capabilities:this._capabilities}}))}},{key:"_handleMessage",value:function(){if(this._sock.rQlen===0){k.Warn("handleMessage called on an empty receive queue");return}switch(this._rfbConnectionState){case"disconnected":k.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(Z,ce,J){this.sendKey(Z,ce,J)}},{key:"_handleMouse",value:function(Z){if(Z.type==="click"&&Z.target!==this._canvas)return;if(Z.stopPropagation(),Z.preventDefault(),Z.type==="click"||Z.type==="contextmenu")return;var ce=(0,O.clientToElement)(Z.clientX,Z.clientY,this._canvas);switch(Z.type){case"mousedown":(0,d.setCapture)(this._canvas),this._handleMouseButton(ce.x,ce.y,!0,1<<Z.button);break;case"mouseup":this._handleMouseButton(ce.x,ce.y,!1,1<<Z.button);break;case"mousemove":this._handleMouseMove(ce.x,ce.y);break}}},{key:"_handleMouseButton",value:function(Z,ce,J,Le){if(this.dragViewport)if(J&&!this._viewportDragging){this._viewportDragging=!0,this._viewportDragPos={x:Z,y:ce},this._viewportHasMoved=!1;return}else{if(this._viewportDragging=!1,this._viewportHasMoved)return;this._sendMouse(Z,ce,Le)}this._mouseMoveTimer!==null&&(clearTimeout(this._mouseMoveTimer),this._mouseMoveTimer=null,this._sendMouse(Z,ce,this._mouseButtonMask)),J?this._mouseButtonMask|=Le:this._mouseButtonMask&=~Le,this._sendMouse(Z,ce,this._mouseButtonMask)}},{key:"_handleMouseMove",value:function(Z,ce){var J=this;if(this._viewportDragging){var Le=this._viewportDragPos.x-Z,We=this._viewportDragPos.y-ce;(this._viewportHasMoved||Math.abs(Le)>R.dragThreshold||Math.abs(We)>R.dragThreshold)&&(this._viewportHasMoved=!0,this._viewportDragPos={x:Z,y:ce},this._display.viewportChangePos(Le,We));return}if(this._mousePos={x:Z,y:ce},this._mouseMoveTimer==null){var Ve=Date.now()-this._mouseLastMoveTime;Ve>fe?(this._sendMouse(Z,ce,this._mouseButtonMask),this._mouseLastMoveTime=Date.now()):this._mouseMoveTimer=setTimeout(function(){J._handleDelayedMouseMove()},fe-Ve)}}},{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(Z,ce,J){if(this._rfbConnectionState!=="connected")return;if(this._viewOnly)return;Ae.messages.pointerEvent(this._sock,this._display.absX(Z),this._display.absY(ce),J)}},{key:"_handleWheel",value:function(Z){if(this._rfbConnectionState!=="connected")return;if(this._viewOnly)return;Z.stopPropagation(),Z.preventDefault();var ce=(0,O.clientToElement)(Z.clientX,Z.clientY,this._canvas),J=Z.deltaX,Le=Z.deltaY;Z.deltaMode!==0&&(J*=Ue,Le*=Ue),this._accumulatedWheelDeltaX+=J,this._accumulatedWheelDeltaY+=Le,Math.abs(this._accumulatedWheelDeltaX)>=Se&&(this._accumulatedWheelDeltaX<0?(this._handleMouseButton(ce.x,ce.y,!0,1<<5),this._handleMouseButton(ce.x,ce.y,!1,1<<5)):this._accumulatedWheelDeltaX>0&&(this._handleMouseButton(ce.x,ce.y,!0,1<<6),this._handleMouseButton(ce.x,ce.y,!1,1<<6)),this._accumulatedWheelDeltaX=0),Math.abs(this._accumulatedWheelDeltaY)>=Se&&(this._accumulatedWheelDeltaY<0?(this._handleMouseButton(ce.x,ce.y,!0,1<<3),this._handleMouseButton(ce.x,ce.y,!1,1<<3)):this._accumulatedWheelDeltaY>0&&(this._handleMouseButton(ce.x,ce.y,!0,1<<4),this._handleMouseButton(ce.x,ce.y,!1,1<<4)),this._accumulatedWheelDeltaY=0)}},{key:"_fakeMouseMove",value:function(Z,ce,J){this._handleMouseMove(ce,J),this._cursor.move(Z.detail.clientX,Z.detail.clientY)}},{key:"_handleTapEvent",value:function(Z,ce){var J=(0,O.clientToElement)(Z.detail.clientX,Z.detail.clientY,this._canvas);if(this._gestureLastTapTime!==null&&Date.now()-this._gestureLastTapTime<Ce&&this._gestureFirstDoubleTapEv.detail.type===Z.detail.type){var Le=this._gestureFirstDoubleTapEv.detail.clientX-Z.detail.clientX,We=this._gestureFirstDoubleTapEv.detail.clientY-Z.detail.clientY,Ve=Math.hypot(Le,We);Ve<De?J=(0,O.clientToElement)(this._gestureFirstDoubleTapEv.detail.clientX,this._gestureFirstDoubleTapEv.detail.clientY,this._canvas):this._gestureFirstDoubleTapEv=Z}else this._gestureFirstDoubleTapEv=Z;this._gestureLastTapTime=Date.now(),this._fakeMouseMove(this._gestureFirstDoubleTapEv,J.x,J.y),this._handleMouseButton(J.x,J.y,!0,ce),this._handleMouseButton(J.x,J.y,!1,ce)}},{key:"_handleGesture",value:function(Z){var ce,J=(0,O.clientToElement)(Z.detail.clientX,Z.detail.clientY,this._canvas);switch(Z.type){case"gesturestart":switch(Z.detail.type){case"onetap":this._handleTapEvent(Z,1);break;case"twotap":this._handleTapEvent(Z,4);break;case"threetap":this._handleTapEvent(Z,2);break;case"drag":this._fakeMouseMove(Z,J.x,J.y),this._handleMouseButton(J.x,J.y,!0,1);break;case"longpress":this._fakeMouseMove(Z,J.x,J.y),this._handleMouseButton(J.x,J.y,!0,4);break;case"twodrag":this._gestureLastMagnitudeX=Z.detail.magnitudeX,this._gestureLastMagnitudeY=Z.detail.magnitudeY,this._fakeMouseMove(Z,J.x,J.y);break;case"pinch":this._gestureLastMagnitudeX=Math.hypot(Z.detail.magnitudeX,Z.detail.magnitudeY),this._fakeMouseMove(Z,J.x,J.y);break}break;case"gesturemove":switch(Z.detail.type){case"onetap":case"twotap":case"threetap":break;case"drag":case"longpress":this._fakeMouseMove(Z,J.x,J.y);break;case"twodrag":for(this._fakeMouseMove(Z,J.x,J.y);Z.detail.magnitudeY-this._gestureLastMagnitudeY>xe;)this._handleMouseButton(J.x,J.y,!0,8),this._handleMouseButton(J.x,J.y,!1,8),this._gestureLastMagnitudeY+=xe;for(;Z.detail.magnitudeY-this._gestureLastMagnitudeY<-xe;)this._handleMouseButton(J.x,J.y,!0,16),this._handleMouseButton(J.x,J.y,!1,16),this._gestureLastMagnitudeY-=xe;for(;Z.detail.magnitudeX-this._gestureLastMagnitudeX>xe;)this._handleMouseButton(J.x,J.y,!0,32),this._handleMouseButton(J.x,J.y,!1,32),this._gestureLastMagnitudeX+=xe;for(;Z.detail.magnitudeX-this._gestureLastMagnitudeX<-xe;)this._handleMouseButton(J.x,J.y,!0,64),this._handleMouseButton(J.x,J.y,!1,64),this._gestureLastMagnitudeX-=xe;break;case"pinch":if(this._fakeMouseMove(Z,J.x,J.y),ce=Math.hypot(Z.detail.magnitudeX,Z.detail.magnitudeY),Math.abs(ce-this._gestureLastMagnitudeX)>Ne){for(this._handleKeyEvent(n.default.XK_Control_L,"ControlLeft",!0);ce-this._gestureLastMagnitudeX>Ne;)this._handleMouseButton(J.x,J.y,!0,8),this._handleMouseButton(J.x,J.y,!1,8),this._gestureLastMagnitudeX+=Ne;for(;ce-this._gestureLastMagnitudeX<-Ne;)this._handleMouseButton(J.x,J.y,!0,16),this._handleMouseButton(J.x,J.y,!1,16),this._gestureLastMagnitudeX-=Ne}this._handleKeyEvent(n.default.XK_Control_L,"ControlLeft",!1);break}break;case"gestureend":switch(Z.detail.type){case"onetap":case"twotap":case"threetap":case"pinch":case"twodrag":break;case"drag":this._fakeMouseMove(Z,J.x,J.y),this._handleMouseButton(J.x,J.y,!1,1);break;case"longpress":this._fakeMouseMove(Z,J.x,J.y),this._handleMouseButton(J.x,J.y,!1,4);break}break}}},{key:"_negotiateProtocolVersion",value:function(){if(this._sock.rQwait("version",12))return!1;var Z=this._sock.rQshiftStr(12).substr(4,7);k.Info("Server ProtocolVersion: "+Z);var ce=0;switch(Z){case"000.000":ce=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 "+Z)}if(ce){for(var J="ID:"+this._repeaterID;J.length<250;)J+="\0";return this._sock.sendString(J),!0}this._rfbVersion>this._rfbMaxVersion&&(this._rfbVersion=this._rfbMaxVersion);var Le="00"+parseInt(this._rfbVersion,10)+".00"+this._rfbVersion*10%10;this._sock.sendString("RFB "+Le+`
|
|
|
`),k.Debug("Sent ProtocolVersion: "+Le),this._rfbInitState="Security"}},{key:"_negotiateSecurity",value:function(){function Z(Le,We){for(var Ve=0;Ve<We.length;Ve++)if(We[Ve]===Le)return!0;return!1}if(this._rfbVersion>=3.7){var ce=this._sock.rQshift8();if(this._sock.rQwait("security type",ce,1))return!1;if(ce===0)return this._rfbInitState="SecurityReason",this._securityContext="no security types",this._securityStatus=1,this._initMsg();var J=this._sock.rQshiftBytes(ce);if(k.Debug("Server security types: "+J),Z(1,J))this._rfbAuthScheme=1;else if(Z(22,J))this._rfbAuthScheme=22;else if(Z(16,J))this._rfbAuthScheme=16;else if(Z(2,J))this._rfbAuthScheme=2;else if(Z(19,J))this._rfbAuthScheme=19;else return this._fail("Unsupported security types (types: "+J+")");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",k.Debug("Authenticating using scheme: "+this._rfbAuthScheme),this._initMsg()}},{key:"_handleSecurityReason",value:function(){if(this._sock.rQwait("reason length",4))return!1;var Z=this._sock.rQshift32(),ce="";if(Z>0){if(this._sock.rQwait("reason",Z,4))return!1;ce=this._sock.rQshiftStr(Z)}return ce!==""?(this.dispatchEvent(new CustomEvent("securityfailure",{detail:{status:this._securityStatus,reason:ce}})),this._fail("Security negotiation failed on "+this._securityContext+" (reason: "+ce+")")):(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 Z=String.fromCharCode(this._rfbCredentials.username.length)+String.fromCharCode(this._rfbCredentials.target.length)+this._rfbCredentials.username+this._rfbCredentials.target;return this._sock.sendString(Z),this._rfbAuthScheme=2,this._negotiateAuthentication()}},{key:"_negotiateVeNCryptAuth",value:function(){if(this._rfbVeNCryptState==0){if(this._sock.rQwait("vencrypt version",2))return!1;var Z=this._sock.rQshift8(),ce=this._sock.rQshift8();if(!(Z==0&&ce==2))return this._fail("Unsupported VeNCrypt version "+Z+"."+ce);this._sock.send([0,2]),this._rfbVeNCryptState=1}if(this._rfbVeNCryptState==1){if(this._sock.rQwait("vencrypt ack",1))return!1;var J=this._sock.rQshift8();if(J!=0)return this._fail("VeNCrypt failure "+J);this._rfbVeNCryptState=2}if(this._rfbVeNCryptState==2){if(this._sock.rQwait("vencrypt subtypes length",1))return!1;var Le=this._sock.rQshift8();if(Le<1)return this._fail("VeNCrypt subtypes empty");this._rfbVeNCryptSubtypesLength=Le,this._rfbVeNCryptState=3}if(this._rfbVeNCryptState==3){if(this._sock.rQwait("vencrypt subtypes",4*this._rfbVeNCryptSubtypesLength))return!1;for(var We=[],Ve=0;Ve<this._rfbVeNCryptSubtypesLength;Ve++)We.push(this._sock.rQshift32());if(We.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 Me=(0,D.encodeUTF8)(this._rfbCredentials.username),et=(0,D.encodeUTF8)(this._rfbCredentials.password);return this._sock.send([0,0,0,Me.length]),this._sock.send([0,0,0,et.length]),this._sock.sendString(Me),this._sock.sendString(et),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 Z=Array.prototype.slice.call(this._sock.rQshiftBytes(16)),ce=Ae.genDES(this._rfbCredentials.password,Z);return this._sock.send(ce),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(Z){for(var ce={0:{vendor:"TGHT",signature:"NOTUNNEL"}},J={},Le=0;Le<Z;Le++){var We=this._sock.rQshift32(),Ve=this._sock.rQshiftStr(4),Me=this._sock.rQshiftStr(8);J[We]={vendor:Ve,signature:Me}}return k.Debug("Server Tight tunnel types: "+J),J[1]&&J[1].vendor==="SICR"&&J[1].signature==="SCHANNEL"&&(k.Debug("Detected Siemens server. Assuming NOTUNNEL support."),J[0]={vendor:"TGHT",signature:"NOTUNNEL"}),J[0]?J[0].vendor!=ce[0].vendor||J[0].signature!=ce[0].signature?this._fail("Client's tunnel type had the incorrect vendor or signature"):(k.Debug("Selected tunnel type: "+ce[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 Z=this._sock.rQshift32();if(Z>0&&this._sock.rQwait("tunnel capabilities",16*Z,4))return!1;if(this._rfbTightVNC=!0,Z>0)return this._negotiateTightTunnels(Z),!1}if(this._sock.rQwait("sub auth count",4))return!1;var ce=this._sock.rQshift32();if(ce===0)return this._rfbInitState="SecurityResult",!0;if(this._sock.rQwait("sub auth capabilities",16*ce,4))return!1;for(var J={STDVNOAUTH__:1,STDVVNCAUTH_:2,TGHTULGNAUTH:129},Le=[],We=0;We<ce;We++){this._sock.rQshift32();var Ve=this._sock.rQshiftStr(12);Le.push(Ve)}k.Debug("Server Tight authentication types: "+Le);for(var Me in J)if(Le.indexOf(Me)!=-1){this._sock.send([0,0,0,J[Me]]),k.Debug("Selected authentication type: "+Me);switch(Me){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: "+Me+")")}}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 Z=this._sock.rQshift32();return Z===0?(this._rfbInitState="ClientInitialisation",k.Debug("Authentication OK"),this._initMsg()):this._rfbVersion>=3.8?(this._rfbInitState="SecurityReason",this._securityContext="security result",this._securityStatus=Z,this._initMsg()):(this.dispatchEvent(new CustomEvent("securityfailure",{detail:{status:Z}})),this._fail("Security handshake failed"))}},{key:"_negotiateServerInit",value:function(){if(this._sock.rQwait("server initialization",24))return!1;var Z=this._sock.rQshift16(),ce=this._sock.rQshift16(),J=this._sock.rQshift8(),Le=this._sock.rQshift8(),We=this._sock.rQshift8(),Ve=this._sock.rQshift8(),Me=this._sock.rQshift16(),et=this._sock.rQshift16(),ne=this._sock.rQshift16(),Ee=this._sock.rQshift8(),Oe=this._sock.rQshift8(),me=this._sock.rQshift8();this._sock.rQskipBytes(3);var ue=this._sock.rQshift32();if(this._sock.rQwait("server init name",ue,24))return!1;var he=this._sock.rQshiftStr(ue);if(he=(0,D.decodeUTF8)(he,!0),this._rfbTightVNC){if(this._sock.rQwait("TightVNC extended server init header",8,24+ue))return!1;var Y=this._sock.rQshift16(),$=this._sock.rQshift16(),z=this._sock.rQshift16();this._sock.rQskipBytes(2);var oe=(Y+$+z)*16;if(this._sock.rQwait("TightVNC extended server init header",oe,32+ue))return!1;this._sock.rQskipBytes(16*Y),this._sock.rQskipBytes(16*$),this._sock.rQskipBytes(16*z)}return k.Info("Screen: "+Z+"x"+ce+", bpp: "+J+", depth: "+Le+", bigEndian: "+We+", trueColor: "+Ve+", redMax: "+Me+", greenMax: "+et+", blueMax: "+ne+", redShift: "+Ee+", greenShift: "+Oe+", blueShift: "+me),this._setDesktopName(he),this._resize(Z,ce),this._viewOnly||this._keyboard.grab(),this._fbDepth=24,this._fbName==="Intel(r) AMT KVM"&&(k.Warn("Intel AMT KVM only supports 8/16 bit depths. Using low color mode."),this._fbDepth=8),Ae.messages.pixelFormat(this._sock,this._fbDepth,!0),this._sendEncodings(),Ae.messages.fbUpdateRequest(this._sock,!1,0,0,this._fbWidth,this._fbHeight),this._updateConnectionState("connected"),!0}},{key:"_sendEncodings",value:function(){var Z=[];Z.push(i.encodings.encodingCopyRect),this._fbDepth==24&&(Z.push(i.encodings.encodingTight),Z.push(i.encodings.encodingTightPNG),Z.push(i.encodings.encodingHextile),Z.push(i.encodings.encodingRRE)),Z.push(i.encodings.encodingRaw),Z.push(i.encodings.pseudoEncodingQualityLevel0+this._qualityLevel),Z.push(i.encodings.pseudoEncodingCompressLevel0+this._compressionLevel),Z.push(i.encodings.pseudoEncodingDesktopSize),Z.push(i.encodings.pseudoEncodingLastRect),Z.push(i.encodings.pseudoEncodingQEMUExtendedKeyEvent),Z.push(i.encodings.pseudoEncodingExtendedDesktopSize),Z.push(i.encodings.pseudoEncodingXvp),Z.push(i.encodings.pseudoEncodingFence),Z.push(i.encodings.pseudoEncodingContinuousUpdates),Z.push(i.encodings.pseudoEncodingDesktopName),Z.push(i.encodings.pseudoEncodingExtendedClipboard),this._fbDepth==24&&(Z.push(i.encodings.pseudoEncodingVMwareCursor),Z.push(i.encodings.pseudoEncodingCursor)),Ae.messages.clientEncodings(this._sock,Z)}},{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 k.Debug("SetColorMapEntries"),this._fail("Unexpected SetColorMapEntries message")}},{key:"_handleServerCutText",value:function(){if(k.Debug("ServerCutText"),this._sock.rQwait("ServerCutText header",7,1))return!1;this._sock.rQskipBytes(3);var Z=this._sock.rQshift32();if(Z=(0,j.toSigned32bit)(Z),this._sock.rQwait("ServerCutText content",Math.abs(Z),8))return!1;if(Z>=0){var ce=this._sock.rQshiftStr(Z);if(this._viewOnly)return!0;this.dispatchEvent(new CustomEvent("clipboard",{detail:{text:ce}}))}else{Z=Math.abs(Z);var J=this._sock.rQshift32(),Le=J&65535,We=J&4278190080,Ve=!!(We&Fe);if(Ve){this._clipboardServerCapabilitiesFormats={},this._clipboardServerCapabilitiesActions={};for(var Me=0;Me<=15;Me++){var et=1<<Me;Le&et&&(this._clipboardServerCapabilitiesFormats[et]=!0,this._sock.rQshift32())}for(var ne=24;ne<=31;ne++){var Ee=1<<ne;this._clipboardServerCapabilitiesActions[Ee]=!!(We&Ee)}var Oe=[Fe,je,Ke,ze,Ge];Ae.messages.extendedClipboardCaps(this._sock,Oe,{extendedClipboardFormatText:0})}else if(We===je){if(this._viewOnly)return!0;this._clipboardText!=null&&this._clipboardServerCapabilitiesActions[Ge]&&(Le&ve&&Ae.messages.extendedClipboardProvide(this._sock,[ve],[this._clipboardText]))}else if(We===Ke){if(this._viewOnly)return!0;this._clipboardServerCapabilitiesActions[ze]&&(this._clipboardText!=null?Ae.messages.extendedClipboardNotify(this._sock,[ve]):Ae.messages.extendedClipboardNotify(this._sock,[]))}else if(We===ze){if(this._viewOnly)return!0;this._clipboardServerCapabilitiesActions[je]&&(Le&ve&&Ae.messages.extendedClipboardRequest(this._sock,[ve]))}else if(We===Ge){if(this._viewOnly)return!0;if(!(Le&ve))return!0;this._clipboardText=null;var me=this._sock.rQshiftBytes(Z-4),ue=new v.default,he=null;ue.setInput(me);for(var Y=0;Y<=15;Y++){var $=1<<Y;if(Le&$){var z=0,oe=ue.inflate(4);z|=oe[0]<<24,z|=oe[1]<<16,z|=oe[2]<<8,z|=oe[3];var _e=ue.inflate(z);$===ve&&(he=_e)}}if(ue.setInput(null),he!==null){for(var X="",de=0;de<he.length;de++)X+=String.fromCharCode(he[de]);he=X,he=(0,D.decodeUTF8)(he),he.length>0&&he.charAt(he.length-1)==="\0"&&(he=he.slice(0,-1)),he=he.replace(`\r
|
|
|
`,`
|
|
|
`),this.dispatchEvent(new CustomEvent("clipboard",{detail:{text:he}}))}}else return this._fail("Unexpected action in extended clipboard message: "+We)}return!0}},{key:"_handleServerFenceMsg",value:function(){if(this._sock.rQwait("ServerFence header",8,1))return!1;this._sock.rQskipBytes(3);var Z=this._sock.rQshift32(),ce=this._sock.rQshift8();if(this._sock.rQwait("ServerFence payload",ce,9))return!1;ce>64&&(k.Warn("Bad payload length ("+ce+") in fence response"),ce=64);var J=this._sock.rQshiftStr(ce);return this._supportsFence=!0,Z&1<<31?(Z&=1<<0|1<<1,Ae.messages.clientFence(this._sock,Z,J),!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 Z=this._sock.rQshift8(),ce=this._sock.rQshift8();switch(ce){case 0:k.Error("XVP Operation Failed");break;case 1:this._rfbXvpVer=Z,k.Info("XVP extensions enabled (version "+this._rfbXvpVer+")"),this._setCapability("power",!0);break;default:this._fail("Illegal server XVP message (msg: "+ce+")");break}return!0}},{key:"_normalMsg",value:function(){var Z;this._FBU.rects>0?Z=0:Z=this._sock.rQshift8();var ce,J;switch(Z){case 0:return J=this._framebufferUpdate(),J&&!this._enabledContinuousUpdates&&Ae.messages.fbUpdateRequest(this._sock,!0,0,0,this._fbWidth,this._fbHeight),J;case 1:return this._handleSetColourMapMsg();case 2:return k.Debug("Bell"),this.dispatchEvent(new CustomEvent("bell",{detail:{}})),!0;case 3:return this._handleServerCutText();case 150:return ce=!this._supportsContinuousUpdates,this._supportsContinuousUpdates=!0,this._enabledContinuousUpdates=!1,ce&&(this._enabledContinuousUpdates=!0,this._updateContinuousUpdates(),k.Info("Enabling continuous updates.")),!0;case 248:return this._handleServerFenceMsg();case 250:return this._handleXvpMsg();default:return this._fail("Unexpected server message (type "+Z+")"),k.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 Z=this._sock.rQshiftBytes(12);this._FBU.x=(Z[0]<<8)+Z[1],this._FBU.y=(Z[2]<<8)+Z[3],this._FBU.width=(Z[4]<<8)+Z[5],this._FBU.height=(Z[6]<<8)+Z[7],this._FBU.encoding=parseInt((Z[8]<<24)+(Z[9]<<16)+(Z[10]<<8)+Z[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 i.encodings.pseudoEncodingLastRect:return this._FBU.rects=1,!0;case i.encodings.pseudoEncodingVMwareCursor:return this._handleVMwareCursor();case i.encodings.pseudoEncodingCursor:return this._handleCursor();case i.encodings.pseudoEncodingQEMUExtendedKeyEvent:try{var Z=document.createEvent("keyboardEvent");Z.code!==void 0&&(this._qemuExtKeyEventSupported=!0)}catch(ce){}return!0;case i.encodings.pseudoEncodingDesktopName:return this._handleDesktopName();case i.encodings.pseudoEncodingDesktopSize:return this._resize(this._FBU.width,this._FBU.height),!0;case i.encodings.pseudoEncodingExtendedDesktopSize:return this._handleExtendedDesktopSize();default:return this._handleDataRect()}}},{key:"_handleVMwareCursor",value:function(){var Z=this._FBU.x,ce=this._FBU.y,J=this._FBU.width,Le=this._FBU.height;if(this._sock.rQwait("VMware cursor encoding",1))return!1;var We=this._sock.rQshift8();this._sock.rQshift8();var Ve,Me=4;if(We==0){var et=4294967040|0;if(Ve=new Array(J*Le*Me),this._sock.rQwait("VMware cursor classic encoding",J*Le*Me*2,2))return!1;for(var ne=new Array(J*Le),Ee=0;Ee<J*Le;Ee++)ne[Ee]=this._sock.rQshift32();for(var Oe=new Array(J*Le),me=0;me<J*Le;me++)Oe[me]=this._sock.rQshift32();for(var ue=0;ue<J*Le;ue++)if(ne[ue]==0){var he=Oe[ue],Y=he>>8&255,$=he>>16&255,z=he>>24&255;Ve[ue*Me]=Y,Ve[ue*Me+1]=$,Ve[ue*Me+2]=z,Ve[ue*Me+3]=255}else(ne[ue]&et)==et?Oe[ue]==0?(Ve[ue*Me]=0,Ve[ue*Me+1]=0,Ve[ue*Me+2]=0,Ve[ue*Me+3]=0):((Oe[ue]&et)==et,Ve[ue*Me]=0,Ve[ue*Me+1]=0,Ve[ue*Me+2]=0,Ve[ue*Me+3]=255):(Ve[ue*Me]=0,Ve[ue*Me+1]=0,Ve[ue*Me+2]=0,Ve[ue*Me+3]=255)}else if(We==1){if(this._sock.rQwait("VMware cursor alpha encoding",J*Le*4,2))return!1;Ve=new Array(J*Le*Me);for(var oe=0;oe<J*Le;oe++){var _e=this._sock.rQshift32();Ve[oe*4]=_e>>24&255,Ve[oe*4+1]=_e>>16&255,Ve[oe*4+2]=_e>>8&255,Ve[oe*4+3]=_e&255}}else return k.Warn("The given cursor type is not supported: "+We+" given."),!1;return this._updateCursor(Ve,Z,ce,J,Le),!0}},{key:"_handleCursor",value:function(){var Z=this._FBU.x,ce=this._FBU.y,J=this._FBU.width,Le=this._FBU.height,We=J*Le*4,Ve=Math.ceil(J/8)*Le,Me=We+Ve;if(this._sock.rQwait("cursor encoding",Me))return!1;for(var et=this._sock.rQshiftBytes(We),ne=this._sock.rQshiftBytes(Ve),Ee=new Uint8Array(J*Le*4),Oe=0,me=0;me<Le;me++)for(var ue=0;ue<J;ue++){var he=me*Math.ceil(J/8)+Math.floor(ue/8),Y=ne[he]<<ue%8&128?255:0;Ee[Oe]=et[Oe+2],Ee[Oe+1]=et[Oe+1],Ee[Oe+2]=et[Oe],Ee[Oe+3]=Y,Oe+=4}return this._updateCursor(Ee,Z,ce,J,Le),!0}},{key:"_handleDesktopName",value:function(){if(this._sock.rQwait("DesktopName",4))return!1;var Z=this._sock.rQshift32();if(this._sock.rQwait("DesktopName",Z,4))return!1;var ce=this._sock.rQshiftStr(Z);return ce=(0,D.decodeUTF8)(ce,!0),this._setDesktopName(ce),!0}},{key:"_handleExtendedDesktopSize",value:function(){if(this._sock.rQwait("ExtendedDesktopSize",4))return!1;var Z=this._sock.rQpeek8(),ce=4+Z*16;if(this._sock.rQwait("ExtendedDesktopSize",ce))return!1;var J=!this._supportsSetDesktopSize;this._supportsSetDesktopSize=!0,J&&this._requestRemoteResize(),this._sock.rQskipBytes(1),this._sock.rQskipBytes(3);for(var Le=0;Le<Z;Le+=1)Le===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 We="";switch(this._FBU.y){case 1:We="Resize is administratively prohibited";break;case 2:We="Out of resources";break;case 3:We="Invalid screen layout";break;default:We="Unknown reason";break}k.Warn("Server did not accept the resize request: "+We)}else this._resize(this._FBU.width,this._FBU.height);return!0}},{key:"_handleDataRect",value:function(){var Z=this._decoders[this._FBU.encoding];if(!Z)return this._fail("Unsupported encoding (encoding: "+this._FBU.encoding+")"),!1;try{return Z.decodeRect(this._FBU.x,this._FBU.y,this._FBU.width,this._FBU.height,this._sock,this._display,this._fbDepth)}catch(ce){return this._fail("Error decoding rect: "+ce),!1}}},{key:"_updateContinuousUpdates",value:function(){if(!this._enabledContinuousUpdates)return;Ae.messages.enableContinuousUpdates(this._sock,!0,0,0,this._fbWidth,this._fbHeight)}},{key:"_resize",value:function(Z,ce){this._fbWidth=Z,this._fbHeight=ce,this._display.resize(this._fbWidth,this._fbHeight),this._updateClip(),this._updateScale(),this._updateContinuousUpdates()}},{key:"_xvpOp",value:function(Z,ce){if(this._rfbXvpVer<Z)return;k.Info("Sending XVP operation "+ce+" (version "+Z+")"),Ae.messages.xvpOp(this._sock,Z,ce)}},{key:"_updateCursor",value:function(Z,ce,J,Le,We){this._cursorImage={rgbaPixels:Z,hotx:ce,hoty:J,w:Le,h:We},this._refreshCursor()}},{key:"_shouldShowDotCursor",value:function(){if(!this._showDotCursor)return!1;for(var Z=3;Z<this._cursorImage.rgbaPixels.length;Z+=4)if(this._cursorImage.rgbaPixels[Z])return!1;return!0}},{key:"_refreshCursor",value:function(){if(this._rfbConnectionState!=="connecting"&&this._rfbConnectionState!=="connected")return;var Z=this._shouldShowDotCursor()?Ae.cursors.dot:this._cursorImage;this._cursor.change(Z.rgbaPixels,Z.hotx,Z.hoty,Z.w,Z.h)}},{key:"viewOnly",get:function(){return this._viewOnly},set:function(Z){this._viewOnly=Z,(this._rfbConnectionState==="connecting"||this._rfbConnectionState==="connected")&&(Z?this._keyboard.ungrab():this._keyboard.grab())}},{key:"capabilities",get:function(){return this._capabilities}},{key:"touchButton",get:function(){return 0},set:function(Z){k.Warn("Using old API!")}},{key:"clipViewport",get:function(){return this._clipViewport},set:function(Z){this._clipViewport=Z,this._updateClip()}},{key:"scaleViewport",get:function(){return this._scaleViewport},set:function(Z){this._scaleViewport=Z,Z&&this._clipViewport&&this._updateClip(),this._updateScale(),!Z&&this._clipViewport&&this._updateClip()}},{key:"resizeSession",get:function(){return this._resizeSession},set:function(Z){this._resizeSession=Z,Z&&this._requestRemoteResize()}},{key:"showDotCursor",get:function(){return this._showDotCursor},set:function(Z){this._showDotCursor=Z,this._refreshCursor()}},{key:"background",get:function(){return this._screen.style.background},set:function(Z){this._screen.style.background=Z}},{key:"qualityLevel",get:function(){return this._qualityLevel},set:function(Z){if(!Number.isInteger(Z)||Z<0||Z>9){k.Error("qualityLevel must be an integer between 0 and 9");return}if(this._qualityLevel===Z)return;this._qualityLevel=Z,this._rfbConnectionState==="connected"&&this._sendEncodings()}},{key:"compressionLevel",get:function(){return this._compressionLevel},set:function(Z){if(!Number.isInteger(Z)||Z<0||Z>9){k.Error("compressionLevel must be an integer between 0 and 9");return}if(this._compressionLevel===Z)return;this._compressionLevel=Z,this._rfbConnectionState==="connected"&&this._sendEncodings()}}],[{key:"genDES",value:function(Z,ce){var J=Z.split("").map(function(Le){return Le.charCodeAt(0)});return new r.default(J).encrypt(ce)}}]),Ae}(E.default);le.default=He,He.messages={keyEvent:function(ke,Ae,Te){var Z=ke._sQ,ce=ke._sQlen;Z[ce]=4,Z[ce+1]=Te,Z[ce+2]=0,Z[ce+3]=0,Z[ce+4]=Ae>>24,Z[ce+5]=Ae>>16,Z[ce+6]=Ae>>8,Z[ce+7]=Ae,ke._sQlen+=8,ke.flush()},QEMUExtendedKeyEvent:function(ke,Ae,Te,Z){function ce(Ve){var Me=Z>>8,et=Z&255;return Me===224&&et<127?et|128:Ve}var J=ke._sQ,Le=ke._sQlen;J[Le]=255,J[Le+1]=0,J[Le+2]=Te>>8,J[Le+3]=Te,J[Le+4]=Ae>>24,J[Le+5]=Ae>>16,J[Le+6]=Ae>>8,J[Le+7]=Ae;var We=ce(Z);J[Le+8]=We>>24,J[Le+9]=We>>16,J[Le+10]=We>>8,J[Le+11]=We,ke._sQlen+=12,ke.flush()},pointerEvent:function(ke,Ae,Te,Z){var ce=ke._sQ,J=ke._sQlen;ce[J]=5,ce[J+1]=Z,ce[J+2]=Ae>>8,ce[J+3]=Ae,ce[J+4]=Te>>8,ce[J+5]=Te,ke._sQlen+=6,ke.flush()},_buildExtendedClipboardFlags:function(ke,Ae){for(var Te=new Uint8Array(4),Z=0,ce=0,J=0;J<ke.length;J++)ce|=ke[J];for(var Le=0;Le<Ae.length;Le++)Z|=Ae[Le];return Te[0]=ce>>24,Te[1]=0,Te[2]=0,Te[3]=Z,Te},extendedClipboardProvide:function(ke,Ae,Te){for(var Z=new u.default,ce=[],J=0;J<Ae.length;J++){if(Ae[J]!=ve)throw new Error("Unsupported extended clipboard format for Provide message.");Te[J]=Te[J].replace(/\r\n|\r|\n/gm,`\r
|
|
|
`);var Le=(0,D.encodeUTF8)(Te[J]+"\0");ce.push(Le.length>>24&255,Le.length>>16&255,Le.length>>8&255,Le.length&255);for(var We=0;We<Le.length;We++)ce.push(Le.charCodeAt(We))}var Ve=Z.deflate(new Uint8Array(ce)),Me=new Uint8Array(4+Ve.length);Me.set(He.messages._buildExtendedClipboardFlags([Ge],Ae)),Me.set(Ve,4),He.messages.clientCutText(ke,Me,!0)},extendedClipboardNotify:function(ke,Ae){var Te=He.messages._buildExtendedClipboardFlags([ze],Ae);He.messages.clientCutText(ke,Te,!0)},extendedClipboardRequest:function(ke,Ae){var Te=He.messages._buildExtendedClipboardFlags([je],Ae);He.messages.clientCutText(ke,Te,!0)},extendedClipboardCaps:function(ke,Ae,Te){var Z=Object.keys(Te),ce=new Uint8Array(4+4*Z.length);Z.map(function(We){return parseInt(We)}),Z.sort(function(We,Ve){return We-Ve}),ce.set(He.messages._buildExtendedClipboardFlags(Ae,[]));for(var J=4,Le=0;Le<Z.length;Le++)ce[J]=Te[Z[Le]]>>24,ce[J+1]=Te[Z[Le]]>>16,ce[J+2]=Te[Z[Le]]>>8,ce[J+3]=Te[Z[Le]]>>0,J+=4,ce[3]|=1<<Z[Le];He.messages.clientCutText(ke,ce,!0)},clientCutText:function(ke,Ae){var Te=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,Z=ke._sQ,ce=ke._sQlen;Z[ce]=6,Z[ce+1]=0,Z[ce+2]=0,Z[ce+3]=0;var J;Te?J=(0,j.toUnsigned32bit)(-Ae.length):J=Ae.length,Z[ce+4]=J>>24,Z[ce+5]=J>>16,Z[ce+6]=J>>8,Z[ce+7]=J,ke._sQlen+=8;for(var Le=0,We=Ae.length;We>0;){for(var Ve=Math.min(We,ke._sQbufferSize-ke._sQlen),Me=0;Me<Ve;Me++)Z[ke._sQlen+Me]=Ae[Le+Me];ke._sQlen+=Ve,ke.flush(),We-=Ve,Le+=Ve}},setDesktopSize:function(ke,Ae,Te,Z,ce){var J=ke._sQ,Le=ke._sQlen;J[Le]=251,J[Le+1]=0,J[Le+2]=Ae>>8,J[Le+3]=Ae,J[Le+4]=Te>>8,J[Le+5]=Te,J[Le+6]=1,J[Le+7]=0,J[Le+8]=Z>>24,J[Le+9]=Z>>16,J[Le+10]=Z>>8,J[Le+11]=Z,J[Le+12]=0,J[Le+13]=0,J[Le+14]=0,J[Le+15]=0,J[Le+16]=Ae>>8,J[Le+17]=Ae,J[Le+18]=Te>>8,J[Le+19]=Te,J[Le+20]=ce>>24,J[Le+21]=ce>>16,J[Le+22]=ce>>8,J[Le+23]=ce,ke._sQlen+=24,ke.flush()},clientFence:function(ke,Ae,Te){var Z=ke._sQ,ce=ke._sQlen;Z[ce]=248,Z[ce+1]=0,Z[ce+2]=0,Z[ce+3]=0,Z[ce+4]=Ae>>24,Z[ce+5]=Ae>>16,Z[ce+6]=Ae>>8,Z[ce+7]=Ae;var J=Te.length;Z[ce+8]=J;for(var Le=0;Le<J;Le++)Z[ce+9+Le]=Te.charCodeAt(Le);ke._sQlen+=9+J,ke.flush()},enableContinuousUpdates:function(ke,Ae,Te,Z,ce,J){var Le=ke._sQ,We=ke._sQlen;Le[We]=150,Le[We+1]=Ae,Le[We+2]=Te>>8,Le[We+3]=Te,Le[We+4]=Z>>8,Le[We+5]=Z,Le[We+6]=ce>>8,Le[We+7]=ce,Le[We+8]=J>>8,Le[We+9]=J,ke._sQlen+=10,ke.flush()},pixelFormat:function(ke,Ae,Te){var Z=ke._sQ,ce=ke._sQlen,J;Ae>16?J=32:Ae>8?J=16:J=8;var Le=Math.floor(Ae/3);Z[ce]=0,Z[ce+1]=0,Z[ce+2]=0,Z[ce+3]=0,Z[ce+4]=J,Z[ce+5]=Ae,Z[ce+6]=0,Z[ce+7]=Te?1:0,Z[ce+8]=0,Z[ce+9]=(1<<Le)-1,Z[ce+10]=0,Z[ce+11]=(1<<Le)-1,Z[ce+12]=0,Z[ce+13]=(1<<Le)-1,Z[ce+14]=Le*2,Z[ce+15]=Le*1,Z[ce+16]=Le*0,Z[ce+17]=0,Z[ce+18]=0,Z[ce+19]=0,ke._sQlen+=20,ke.flush()},clientEncodings:function(ke,Ae){var Te=ke._sQ,Z=ke._sQlen;Te[Z]=2,Te[Z+1]=0,Te[Z+2]=Ae.length>>8,Te[Z+3]=Ae.length;for(var ce=Z+4,J=0;J<Ae.length;J++){var Le=Ae[J];Te[ce]=Le>>24,Te[ce+1]=Le>>16,Te[ce+2]=Le>>8,Te[ce+3]=Le,ce+=4}ke._sQlen+=ce-Z,ke.flush()},fbUpdateRequest:function(ke,Ae,Te,Z,ce,J){var Le=ke._sQ,We=ke._sQlen;typeof Te=="undefined"&&(Te=0),typeof Z=="undefined"&&(Z=0),Le[We]=3,Le[We+1]=Ae?1:0,Le[We+2]=Te>>8&255,Le[We+3]=Te&255,Le[We+4]=Z>>8&255,Le[We+5]=Z&255,Le[We+6]=ce>>8&255,Le[We+7]=ce&255,Le[We+8]=J>>8&255,Le[We+9]=J&255,ke._sQlen+=10,ke.flush()},xvpOp:function(ke,Ae,Te){var Z=ke._sQ,ce=ke._sQlen;Z[ce]=250,Z[ce+1]=0,Z[ce+2]=Ae,Z[ce+3]=Te,ke._sQlen+=4,ke.flush()}},He.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(Je,le,re){(function(j){j(re("VrN/"))})(function(j){"use strict";var k={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},D={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};j.defineMode("xml",function(R,O){var d=R.indentUnit,E={},y=O.htmlMode?k:D;for(var v in y)E[v]=y[v];for(var v in O)E[v]=O[v];var u,a;function c(p,I){function M(H){return I.tokenize=H,H(p,I)}var P=p.next();if(P=="<")return p.eat("!")?p.eat("[")?p.match("CDATA[")?M(r("atom","]]>")):null:p.match("--")?M(r("comment","-->")):p.match("DOCTYPE",!0,!0)?(p.eatWhile(/[\w\._\-]/),M(n(1))):null:p.eat("?")?(p.eatWhile(/[\w\._\-]/),I.tokenize=r("meta","?>"),"meta"):(u=p.eat("/")?"closeTag":"openTag",I.tokenize=s,"tag bracket");if(P=="&"){var B;return p.eat("#")?p.eat("x")?B=p.eatWhile(/[a-fA-F\d]/)&&p.eat(";"):B=p.eatWhile(/[\d]/)&&p.eat(";"):B=p.eatWhile(/[\w\.\-:]/)&&p.eat(";"),B?"atom":"error"}else return p.eatWhile(/[^&<]/),null}c.isInText=!0;function s(p,I){var M=p.next();if(M==">"||M=="/"&&p.eat(">"))return I.tokenize=c,u=M==">"?"endTag":"selfcloseTag","tag bracket";if(M=="=")return u="equals",null;if(M=="<"){I.tokenize=c,I.state=h,I.tagName=I.tagStart=null;var P=I.tokenize(p,I);return P?P+" tag error":"tag error"}else return/[\'\"]/.test(M)?(I.tokenize=l(M),I.stringStartCol=p.column(),I.tokenize(p,I)):(p.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function l(p){var I=function(M,P){for(;!M.eol();)if(M.next()==p){P.tokenize=s;break}return"string"};return I.isInAttribute=!0,I}function r(p,I){return function(M,P){for(;!M.eol();){if(M.match(I)){P.tokenize=c;break}M.next()}return p}}function n(p){return function(I,M){for(var P;(P=I.next())!=null;){if(P=="<")return M.tokenize=n(p+1),M.tokenize(I,M);if(P==">")if(p==1){M.tokenize=c;break}else return M.tokenize=n(p-1),M.tokenize(I,M)}return"meta"}}function o(p,I,M){this.prev=p.context,this.tagName=I,this.indent=p.indented,this.startOfLine=M,(E.doNotIndent.hasOwnProperty(I)||p.context&&p.context.noIndent)&&(this.noIndent=!0)}function i(p){p.context&&(p.context=p.context.prev)}function f(p,I){for(var M;;){if(!p.context)return;if(M=p.context.tagName,!E.contextGrabbers.hasOwnProperty(M)||!E.contextGrabbers[M].hasOwnProperty(I))return;i(p)}}function h(p,I,M){return p=="openTag"?(M.tagStart=I.column(),T):p=="closeTag"?g:h}function T(p,I,M){return p=="word"?(M.tagName=I.current(),a="tag",x):E.allowMissingTagName&&p=="endTag"?(a="tag bracket",x(p,I,M)):(a="error",T)}function g(p,I,M){if(p=="word"){var P=I.current();return M.context&&M.context.tagName!=P&&E.implicitlyClosed.hasOwnProperty(M.context.tagName)&&i(M),M.context&&M.context.tagName==P||E.matchClosing===!1?(a="tag",w):(a="tag error",C)}else return E.allowMissingTagName&&p=="endTag"?(a="tag bracket",w(p,I,M)):(a="error",C)}function w(p,I,M){return p!="endTag"?(a="error",w):(i(M),h)}function C(p,I,M){return a="error",w(p,I,M)}function x(p,I,M){if(p=="word")return a="attribute",b;if(p=="endTag"||p=="selfcloseTag"){var P=M.tagName,B=M.tagStart;return M.tagName=M.tagStart=null,p=="selfcloseTag"||E.autoSelfClosers.hasOwnProperty(P)?f(M,P):(f(M,P),M.context=new o(M,P,B==M.indented)),h}return a="error",x}function b(p,I,M){return p=="equals"?S:(E.allowMissing||(a="error"),x(p,I,M))}function S(p,I,M){return p=="string"?A:p=="word"&&E.allowUnquoted?(a="string",x):(a="error",x(p,I,M))}function A(p,I,M){return p=="string"?A:x(p,I,M)}return{startState:function(p){var I={tokenize:c,state:h,indented:p||0,tagName:null,tagStart:null,context:null};return p!=null&&(I.baseIndent=p),I},token:function(p,I){if(!I.tagName&&p.sol()&&(I.indented=p.indentation()),p.eatSpace())return null;u=null;var M=I.tokenize(p,I);return(M||u)&&M!="comment"&&(a=null,I.state=I.state(u||M,p,I),a&&(M=a=="error"?M+" error":a)),M},indent:function(p,I,M){var P=p.context;if(p.tokenize.isInAttribute)return p.tagStart==p.indented?p.stringStartCol+1:p.indented+d;if(P&&P.noIndent)return j.Pass;if(p.tokenize!=s&&p.tokenize!=c)return M?M.match(/^(\s*)/)[0].length:0;if(p.tagName)return E.multilineTagIndentPastTag!==!1?p.tagStart+p.tagName.length+2:p.tagStart+d*(E.multilineTagIndentFactor||1);if(E.alignCDATA&&/<!\[CDATA\[/.test(I))return 0;var B=I&&/^<(\/)?([\w_:\.-]*)/.exec(I);if(B&&B[1])for(;P;)if(P.tagName==B[2]){P=P.prev;break}else if(E.implicitlyClosed.hasOwnProperty(P.tagName))P=P.prev;else break;else if(B)for(;P;){var H=E.contextGrabbers[P.tagName];if(H&&H.hasOwnProperty(B[2]))P=P.prev;else break}for(;P&&P.prev&&!P.startOfLine;)P=P.prev;return P?P.indent+d:p.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:E.htmlMode?"html":"xml",helperType:E.htmlMode?"html":"xml",skipAttribute:function(p){p.state==S&&(p.state=x)},xmlCurrentTag:function(p){return p.tagName?{name:p.tagName,close:p.type=="closeTag"}:null},xmlCurrentContext:function(p){for(var I=[],M=p.context;M;M=M.prev)M.tagName&&I.push(M.tagName);return I.reverse()}}}),j.defineMIME("text/xml","xml"),j.defineMIME("application/xml","xml"),j.mimeModes.hasOwnProperty("text/html")||j.defineMIME("text/html",{name:"xml",htmlMode:!0})})},"1q3G":function(Je,le,re){"use strict";Object.defineProperty(le,"__esModule",{value:!0}),le.default=j;function j(){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}},"34/K":function(Je,le,re){"use strict";Object.defineProperty(le,"__esModule",{value:!0}),le.default=void 0;function j(O,d){if(!(O instanceof d))throw new TypeError("Cannot call a class as a function")}function k(O,d){for(var E=0;E<d.length;E++){var y=d[E];y.enumerable=y.enumerable||!1,y.configurable=!0,"value"in y&&(y.writable=!0),Object.defineProperty(O,y.key,y)}}function D(O,d,E){return d&&k(O.prototype,d),E&&k(O,E),O}var R=function(){function O(){j(this,O),this._lines=0}return D(O,[{key:"decodeRect",value:function(E,y,v,u,a,c,s){this._lines===0&&(this._lines=u);var l=s==8?1:4,r=v*l;if(a.rQwait("RAW",r))return!1;var n=y+(u-this._lines),o=Math.min(this._lines,Math.floor(a.rQlen/r)),i=a.rQ,f=a.rQi;if(s==8){for(var h=v*o,T=new Uint8Array(h*4),g=0;g<h;g++)T[g*4+0]=(i[f+g]>>0&3)*255/3,T[g*4+1]=(i[f+g]>>2&3)*255/3,T[g*4+2]=(i[f+g]>>4&3)*255/3,T[g*4+4]=0;i=T,f=0}return c.blitImage(E,n,v,o,i,f),a.rQskipBytes(o*r),this._lines-=o,!(this._lines>0)}}]),O}();le.default=R},"3690":function(Je,le,re){"use strict";function j(v){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?j=function(a){return typeof a}:j=function(a){return a&&typeof Symbol=="function"&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},j(v)}Object.defineProperty(le,"__esModule",{value:!0}),le.default=void 0;var k=R(re("Lo0S"));function D(){if(typeof WeakMap!="function")return null;var v=new WeakMap;return D=function(){return v},v}function R(v){if(v&&v.__esModule)return v;if(v===null||j(v)!=="object"&&typeof v!="function")return{default:v};var u=D();if(u&&u.has(v))return u.get(v);var a={},c=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in v)if(Object.prototype.hasOwnProperty.call(v,s)){var l=c?Object.getOwnPropertyDescriptor(v,s):null;l&&(l.get||l.set)?Object.defineProperty(a,s,l):a[s]=v[s]}return a.default=v,u&&u.set(v,a),a}function O(v,u){if(!(v instanceof u))throw new TypeError("Cannot call a class as a function")}function d(v,u){for(var a=0;a<u.length;a++){var c=u[a];c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(v,c.key,c)}}function E(v,u,a){return u&&d(v.prototype,u),a&&d(v,a),v}var y=function(){function v(){O(this,v),this._tiles=0,this._lastsubencoding=0}return E(v,[{key:"decodeRect",value:function(a,c,s,l,r,n,o){for(this._tiles===0&&(this._tilesX=Math.ceil(s/16),this._tilesY=Math.ceil(l/16),this._totalTiles=this._tilesX*this._tilesY,this._tiles=this._totalTiles);this._tiles>0;){var i=1;if(r.rQwait("HEXTILE",i))return!1;var f=r.rQ,h=r.rQi,T=f[h];if(T>30)throw new Error("Illegal hextile subencoding (subencoding: "+T+")");var g=this._totalTiles-this._tiles,w=g%this._tilesX,C=Math.floor(g/this._tilesX),x=a+w*16,b=c+C*16,S=Math.min(16,a+s-x),A=Math.min(16,c+l-b);if(T&1)i+=S*A*4;else if(T&2&&(i+=4),T&4&&(i+=4),T&8){if(i++,r.rQwait("HEXTILE",i))return!1;var p=f[h+i-1];T&16?i+=p*(4+2):i+=p*2}if(r.rQwait("HEXTILE",i))return!1;if(h++,T===0)this._lastsubencoding&1?k.Debug(" Ignoring blank after RAW"):n.fillRect(x,b,S,A,this._background);else if(T&1)n.blitImage(x,b,S,A,f,h),h+=i-1;else{if(T&2&&(this._background=[f[h],f[h+1],f[h+2],f[h+3]],h+=4),T&4&&(this._foreground=[f[h],f[h+1],f[h+2],f[h+3]],h+=4),n.startTile(x,b,S,A,this._background),T&8){var I=f[h];h++;for(var M=0;M<I;M++){var P=void 0;T&16?(P=[f[h],f[h+1],f[h+2],f[h+3]],h+=4):P=this._foreground;var B=f[h];h++;var H=B>>4,F=B&15,W=f[h];h++;var U=(W>>4)+1,K=(W&15)+1;n.subTile(H,F,U,K,P)}}n.finishTile()}r.rQi=h,this._lastsubencoding=T,this._tiles--}return!0}}]),v}();le.default=y},"6BzB":function(Je,le,re){"use strict";Object.defineProperty(le,"__esModule",{value:!0}),le.shrinkBuf=j,le.arraySet=k,le.flattenChunks=D,le.Buf32=le.Buf16=le.Buf8=void 0;function j(E,y){return E.length===y?E:E.subarray?E.subarray(0,y):(E.length=y,E)}function k(E,y,v,u,a){if(y.subarray&&E.subarray){E.set(y.subarray(v,v+u),a);return}for(var c=0;c<u;c++)E[a+c]=y[v+c]}function D(E){var y,v,u,a,c,s;for(u=0,y=0,v=E.length;y<v;y++)u+=E[y].length;for(s=new Uint8Array(u),a=0,y=0,v=E.length;y<v;y++)c=E[y],s.set(c,a),a+=c.length;return s}var R=Uint8Array;le.Buf8=R;var O=Uint16Array;le.Buf16=O;var d=Int32Array;le.Buf32=d},"6Qwc":function(Je,le,re){"use strict";Object.defineProperty(le,"__esModule",{value:!0}),le.default=void 0;var j={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"};le.default=j},"7Cbv":function(Je,le,re){"use strict";var j=typeof crypto!="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto!="undefined"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),k=new Uint8Array(16);function D(){if(!j)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return j(k)}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 O(s){return typeof s=="string"&&R.test(s)}for(var d=O,E=[],y=0;y<256;++y)E.push((y+256).toString(16).substr(1));function v(s){var l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=(E[s[l+0]]+E[s[l+1]]+E[s[l+2]]+E[s[l+3]]+"-"+E[s[l+4]]+E[s[l+5]]+"-"+E[s[l+6]]+E[s[l+7]]+"-"+E[s[l+8]]+E[s[l+9]]+"-"+E[s[l+10]]+E[s[l+11]]+E[s[l+12]]+E[s[l+13]]+E[s[l+14]]+E[s[l+15]]).toLowerCase();if(!d(r))throw TypeError("Stringified UUID is invalid");return r}var u=v;function a(s,l,r){s=s||{};var n=s.random||(s.rng||D)();if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,l){r=r||0;for(var o=0;o<16;++o)l[r+o]=n[o];return l}return u(n)}var c=le.a=a},"7ahc":function(Je,le,re){"use strict";re.d(le,"a",function(){return T});var j=re("k1fw"),k=re("0Owb"),D=re("+L6B"),R=re("2/Rp"),O=re("y8nQ"),d=re("Vl3Y"),E=re("tJVT"),y=re("OaEy"),v=re("2fM7"),u=re("cDcd"),a=re.n(u),c=re("VrN/"),s=re.n(c),l=re("p77/"),r=re.n(l),n=re("c5Ni"),o=re.n(n),i=v.a.Option,f={labelCol:{span:4},wrapperCol:{span:20}},h={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"]};le.b=function(g){var w=g.callback,C=g.onCancel,x=Object(u.useState)("python"),b=Object(E.a)(x,2),S=b[0],A=b[1];function p(M){A(h[M][1])}function I(M){w(M)}return a.a.createElement(d.a,Object(k.a)({},f,{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:I}),a.a.createElement(d.a.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},a.a.createElement(v.a,{onChange:p},Object.keys(h).map(function(M){return a.a.createElement(i,{key:M,value:M},h[M][0])}))),a.a.createElement(d.a.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},a.a.createElement(T,{mode:S})),a.a.createElement("div",{className:"flex-container flex-end"},a.a.createElement(R.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),a.a.createElement(R.a,{type:"ghost",onClick:C},"\u53D6\u6D88")))};function T(g){var w=g.value,C=g.onChange,x=g.mode,b=g.options,S=b===void 0?{}:b,A=Object(u.useRef)(),p=Object(u.useState)(),I=Object(E.a)(p,2),M=I[0],P=I[1];return Object(u.useEffect)(function(){if(M){function B(H){var F=H.getValue();C&&C(F)}return M.on("change",B),function(){M.off("change",B)}}},[M,C]),Object(u.useEffect)(function(){M&&M.setOption("mode",x)},[M,x]),Object(u.useEffect)(function(){M&&((w!==M.getValue()||w==="")&&setTimeout(function(){M.setValue(w||" ")},300))},[M,w]),Object(u.useEffect)(function(){if(A.current&&!M){var B=s.a.fromTextArea(A.current,Object(j.a)({mode:x,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},S));P(B)}},[A.current,M]),a.a.createElement("div",{className:"my-codemirror-container"},a.a.createElement("textarea",{ref:A}))}},"7ixt":function(Je,le,re){"use strict";re.d(le,"a",function(){return D});var j={adjustX:1,adjustY:1},k=[0,0],D={left:{points:["cr","cl"],overflow:j,offset:[-4,0],targetOffset:k},right:{points:["cl","cr"],overflow:j,offset:[4,0],targetOffset:k},top:{points:["bc","tc"],overflow:j,offset:[0,-4],targetOffset:k},bottom:{points:["tc","bc"],overflow:j,offset:[0,4],targetOffset:k},topLeft:{points:["bl","tl"],overflow:j,offset:[0,-4],targetOffset:k},leftTop:{points:["tr","tl"],overflow:j,offset:[-4,0],targetOffset:k},topRight:{points:["br","tr"],overflow:j,offset:[0,-4],targetOffset:k},rightTop:{points:["tl","tr"],overflow:j,offset:[4,0],targetOffset:k},bottomRight:{points:["tr","br"],overflow:j,offset:[0,4],targetOffset:k},rightBottom:{points:["bl","br"],overflow:j,offset:[4,0],targetOffset:k},bottomLeft:{points:["tl","bl"],overflow:j,offset:[0,4],targetOffset:k},leftBottom:{points:["br","bl"],overflow:j,offset:[-4,0],targetOffset:k}},R=D},"8+yF":function(Je,le,re){"use strict";Object.defineProperty(le,"__esModule",{value:!0}),le.default=void 0;var j={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},k={lookup:function(R){if(R>=32&&R<=255)return R;var O=j[R];return O!==void 0?O:16777216|R}};le.default=k},"8CQX":function(Je,le,re){"use strict";function j(l){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?j=function(n){return typeof n}:j=function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},j(l)}Object.defineProperty(le,"__esModule",{value:!0}),le.getKeycode=a,le.getKey=c,le.getKeysym=s;var k=u(re("mHUz")),D=u(re("8+yF")),R=u(re("6Qwc")),O=u(re("gIYZ")),d=u(re("mTgk")),E=v(re("GdRQ"));function y(){if(typeof WeakMap!="function")return null;var l=new WeakMap;return y=function(){return l},l}function v(l){if(l&&l.__esModule)return l;if(l===null||j(l)!=="object"&&typeof l!="function")return{default:l};var r=y();if(r&&r.has(l))return r.get(l);var n={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in l)if(Object.prototype.hasOwnProperty.call(l,i)){var f=o?Object.getOwnPropertyDescriptor(l,i):null;f&&(f.get||f.set)?Object.defineProperty(n,i,f):n[i]=l[i]}return n.default=l,r&&r.set(l,n),n}function u(l){return l&&l.__esModule?l:{default:l}}function a(l){if(l.code){switch(l.code){case"OSLeft":return"MetaLeft";case"OSRight":return"MetaRight"}return l.code}if(l.type!=="keypress"&&l.keyCode in R.default){var r=R.default[l.keyCode];if(E.isMac()&&r==="ContextMenu"&&(r="MetaRight"),l.location===2)switch(r){case"ShiftLeft":return"ShiftRight";case"ControlLeft":return"ControlRight";case"AltLeft":return"AltRight"}if(l.location===3)switch(r){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 r}return"Unidentified"}function c(l){if(l.key!==void 0){switch(l.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 l.char}switch(l.key){case"OS":return"Meta";case"LaunchMyComputer":return"LaunchApplication1";case"LaunchCalculator":return"LaunchApplication2"}switch(l.key){case"UIKeyInputUpArrow":return"ArrowUp";case"UIKeyInputDownArrow":return"ArrowDown";case"UIKeyInputLeftArrow":return"ArrowLeft";case"UIKeyInputRightArrow":return"ArrowRight";case"UIKeyInputEscape":return"Escape"}if(l.key==="\0"&&l.code==="NumpadDecimal")return"Delete";if(!E.isIE()&&!E.isEdge())return l.key;if(l.key.length!==1&&l.key!=="Unidentified")return l.key}var r=a(l);return r in O.default?O.default[r]:l.charCode?String.fromCharCode(l.charCode):"Unidentified"}function s(l){var r=c(l);if(r==="Unidentified")return null;if(r in d.default){var n=l.location;if(r==="Meta"&&n===0&&(n=2),r==="Clear"&&n===3){var o=a(l);o==="NumLock"&&(n=0)}if((n===void 0||n>3)&&(n=0),r==="Meta"){var i=a(l);if(i==="AltLeft")return k.default.XK_Meta_L;if(i==="AltRight")return k.default.XK_Meta_R}if(r==="Clear"){var f=a(l);if(f==="NumLock")return k.default.XK_Num_Lock}return d.default[r][n]}if(r.length!==1)return null;var h=r.charCodeAt();return h?D.default.lookup(h):null}},"8EBN":function(Je,le,re){(function(j){j(re("VrN/"))})(function(j){"use strict";j.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 k=0;k<j.modeInfo.length;k++){var D=j.modeInfo[k];D.mimes&&(D.mime=D.mimes[0])}j.findModeByMIME=function(R){R=R.toLowerCase();for(var O=0;O<j.modeInfo.length;O++){var d=j.modeInfo[O];if(d.mime==R)return d;if(d.mimes){for(var E=0;E<d.mimes.length;E++)if(d.mimes[E]==R)return d}}if(/\+xml$/.test(R))return j.findModeByMIME("application/xml");if(/\+json$/.test(R))return j.findModeByMIME("application/json")},j.findModeByExtension=function(R){R=R.toLowerCase();for(var O=0;O<j.modeInfo.length;O++){var d=j.modeInfo[O];if(d.ext){for(var E=0;E<d.ext.length;E++)if(d.ext[E]==R)return d}}},j.findModeByFileName=function(R){for(var O=0;O<j.modeInfo.length;O++){var d=j.modeInfo[O];if(d.file&&d.file.test(R))return d}var E=R.lastIndexOf("."),y=E>-1&&R.substring(E+1,R.length);if(y)return j.findModeByExtension(y)},j.findModeByName=function(R){R=R.toLowerCase();for(var O=0;O<j.modeInfo.length;O++){var d=j.modeInfo[O];if(d.name.toLowerCase()==R)return d;if(d.alias){for(var E=0;E<d.alias.length;E++)if(d.alias[E].toLowerCase()==R)return d}}}})},"8K/p":function(Je,le,re){"use strict";function j(a){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?j=function(s){return typeof s}:j=function(s){return s&&typeof Symbol=="function"&&s.constructor===Symbol&&s!==Symbol.prototype?"symbol":typeof s},j(a)}Object.defineProperty(le,"__esModule",{value:!0}),le.default=void 0;var k=d(re("Lo0S")),D=R(re("ItS6"));function R(a){return a&&a.__esModule?a:{default:a}}function O(){if(typeof WeakMap!="function")return null;var a=new WeakMap;return O=function(){return a},a}function d(a){if(a&&a.__esModule)return a;if(a===null||j(a)!=="object"&&typeof a!="function")return{default:a};var c=O();if(c&&c.has(a))return c.get(a);var s={},l=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var r in a)if(Object.prototype.hasOwnProperty.call(a,r)){var n=l?Object.getOwnPropertyDescriptor(a,r):null;n&&(n.get||n.set)?Object.defineProperty(s,r,n):s[r]=a[r]}return s.default=a,c&&c.set(a,s),s}function E(a,c){if(!(a instanceof c))throw new TypeError("Cannot call a class as a function")}function y(a,c){for(var s=0;s<c.length;s++){var l=c[s];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(a,l.key,l)}}function v(a,c,s){return c&&y(a.prototype,c),s&&y(a,s),a}var u=function(){function a(){E(this,a),this._ctl=null,this._filter=null,this._numColors=0,this._palette=new Uint8Array(1024),this._len=0,this._zlibs=[];for(var c=0;c<4;c++)this._zlibs[c]=new D.default}return v(a,[{key:"decodeRect",value:function(s,l,r,n,o,i,f){if(this._ctl===null){if(o.rQwait("TIGHT compression-control",1))return!1;this._ctl=o.rQshift8();for(var h=0;h<4;h++)this._ctl>>h&1&&(this._zlibs[h].reset(),k.Info("Reset zlib stream "+h));this._ctl=this._ctl>>4}var T;if(this._ctl===8)T=this._fillRect(s,l,r,n,o,i,f);else if(this._ctl===9)T=this._jpegRect(s,l,r,n,o,i,f);else if(this._ctl===10)T=this._pngRect(s,l,r,n,o,i,f);else if((this._ctl&128)==0)T=this._basicRect(this._ctl,s,l,r,n,o,i,f);else throw new Error("Illegal tight compression received (ctl: "+this._ctl+")");return T&&(this._ctl=null),T}},{key:"_fillRect",value:function(s,l,r,n,o,i,f){if(o.rQwait("TIGHT",3))return!1;var h=o.rQi,T=o.rQ;return i.fillRect(s,l,r,n,[T[h+2],T[h+1],T[h]],!1),o.rQskipBytes(3),!0}},{key:"_jpegRect",value:function(s,l,r,n,o,i,f){var h=this._readData(o);return h===null?!1:(i.imageRect(s,l,r,n,"image/jpeg",h),!0)}},{key:"_pngRect",value:function(s,l,r,n,o,i,f){throw new Error("PNG received in standard Tight rect")}},{key:"_basicRect",value:function(s,l,r,n,o,i,f,h){if(this._filter===null)if(s&4){if(i.rQwait("TIGHT",1))return!1;this._filter=i.rQshift8()}else this._filter=0;var T=s&3,g;switch(this._filter){case 0:g=this._copyFilter(T,l,r,n,o,i,f,h);break;case 1:g=this._paletteFilter(T,l,r,n,o,i,f,h);break;case 2:g=this._gradientFilter(T,l,r,n,o,i,f,h);break;default:throw new Error("Illegal tight filter received (ctl: "+this._filter+")")}return g&&(this._filter=null),g}},{key:"_copyFilter",value:function(s,l,r,n,o,i,f,h){var T=n*o*3,g;if(T<12){if(i.rQwait("TIGHT",T))return!1;g=i.rQshiftBytes(T)}else{if(g=this._readData(i),g===null)return!1;this._zlibs[s].setInput(g),g=this._zlibs[s].inflate(T),this._zlibs[s].setInput(null)}return f.blitRgbImage(l,r,n,o,g,0,!1),!0}},{key:"_paletteFilter",value:function(s,l,r,n,o,i,f,h){if(this._numColors===0){if(i.rQwait("TIGHT palette",1))return!1;var T=i.rQpeek8()+1,g=T*3;if(i.rQwait("TIGHT palette",1+g))return!1;this._numColors=T,i.rQskipBytes(1),i.rQshiftTo(this._palette,g)}var w=this._numColors<=2?1:8,C=Math.floor((n*w+7)/8),x=C*o,b;if(x<12){if(i.rQwait("TIGHT",x))return!1;b=i.rQshiftBytes(x)}else{if(b=this._readData(i),b===null)return!1;this._zlibs[s].setInput(b),b=this._zlibs[s].inflate(x),this._zlibs[s].setInput(null)}return this._numColors==2?this._monoRect(l,r,n,o,b,this._palette,f):this._paletteRect(l,r,n,o,b,this._palette,f),this._numColors=0,!0}},{key:"_monoRect",value:function(s,l,r,n,o,i,f){for(var h=this._getScratchBuffer(r*n*4),T=Math.floor((r+7)/8),g=Math.floor(r/8),w=0;w<n;w++){var C=void 0,x=void 0,b=void 0;for(b=0;b<g;b++)for(var S=7;S>=0;S--)C=(w*r+b*8+7-S)*4,x=(o[w*T+b]>>S&1)*3,h[C]=i[x],h[C+1]=i[x+1],h[C+2]=i[x+2],h[C+3]=255;for(var A=7;A>=8-r%8;A--)C=(w*r+b*8+7-A)*4,x=(o[w*T+b]>>A&1)*3,h[C]=i[x],h[C+1]=i[x+1],h[C+2]=i[x+2],h[C+3]=255}f.blitRgbxImage(s,l,r,n,h,0,!1)}},{key:"_paletteRect",value:function(s,l,r,n,o,i,f){for(var h=this._getScratchBuffer(r*n*4),T=r*n*4,g=0,w=0;g<T;g+=4,w++){var C=o[w]*3;h[g]=i[C],h[g+1]=i[C+1],h[g+2]=i[C+2],h[g+3]=255}f.blitRgbxImage(s,l,r,n,h,0,!1)}},{key:"_gradientFilter",value:function(s,l,r,n,o,i,f,h){throw new Error("Gradient filter not implemented")}},{key:"_readData",value:function(s){if(this._len===0){if(s.rQwait("TIGHT",3))return null;var l;l=s.rQshift8(),this._len=l&127,l&128&&(l=s.rQshift8(),this._len|=(l&127)<<7,l&128&&(l=s.rQshift8(),this._len|=l<<14))}if(s.rQwait("TIGHT",this._len))return null;var r=s.rQshiftBytes(this._len);return this._len=0,r}},{key:"_getScratchBuffer",value:function(s){return(!this._scratchBuffer||this._scratchBuffer.length<s)&&(this._scratchBuffer=new Uint8Array(s)),this._scratchBuffer}}]),a}();le.default=u},"8hTe":function(Je,le,re){Je.exports={button:"button___1wy9m"}},"9Bee":function(Je,le,re){"use strict";var j=re("DYRE"),k=re("zeV3"),D=re("+L6B"),R=re("2/Rp"),O=re("k1fw"),d=re("tJVT"),E=re("cDcd"),y=re.n(E),v=re("vg9a"),u=re("DlQD"),a=re.n(u),c=re("rUJ1");function s(xe,Ce){var De=xe.match(/^(\s+)(?:```)/);if(De===null)return Ce;var ve=De[1];return Ce.split(`
|
|
|
`).map(function(Re){var ee=Re.match(/^\s+/);if(ee===null)return Re;var ge=Object(d.a)(ee,1),se=ge[0];return se.length>=ve.length?Re.slice(ve.length):Re}).join(`
|
|
|
`)}var l=[],r=["<ul>"],n=new a.a.Renderer,o=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function i(){l.length=0,r=["<ul>"]}var f={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function h(xe,Ce,De,ve){if(Ce>=xe.length||xe[Ce].level<=De)return Ce;var Re=xe[Ce];ve.push("<li><a href='#"+Re.anchor+"'>"+Re.text+"</a>"),Ce++;var ee=[];return Ce=h(xe,Ce,Re.level,ee),ee.length>0&&(ve.push("<ul>"),ee.forEach(function(ge){ve.push(ge)}),ve.push("</ul>")),ve.push("</li>"),Ce=h(xe,Ce,De,ve),Ce}function T(){return h(l,0,0,r),r.push("</ul>"),r.join("")}var g={heading:function(Ce){var De=o.exec(Ce);if(De)return{type:"heading",raw:De[0],depth:De[1].length,text:De[2]}},fences:function(Ce){var De=this.rules.block.fences.exec(Ce);if(De){var ve=De[0],Re=s(ve,De[3]||""),ee=De[2]?De[2].trim():De[2];if(["latex","katex","math"].indexOf(ee)>=0){var ge=x(),se=Re;Re=ge,b[ge]={type:"block",expression:se}}return{type:"code",raw:ve,lang:ee,text:Re}}}},w=/(?:\${2})([^\n`]+?)(?:\${2})/gi,C=0,x=function(){return"__special_katext_id_".concat(C++,"__")},b={};function S(){return b}function A(){C=0,b={}}function p(xe){return xe=xe.replace(w,function(Ce,De){var ve=x();return b[ve]={type:"inline",expression:De},ve}),xe}var I=n.listitem;n.listitem=function(xe){return I(p(xe))};var M=n.paragraph;n.paragraph=function(xe){return M(p(xe))};var P=n.tablecell;n.tablecell=function(xe,Ce){return P(p(xe),Ce)},n.code=function(xe,Ce,De){var ve=(Ce||"").match(/\S*/)[0];return ve?["latex","katex","math"].indexOf(ve)>=0?"<p class='editormd-tex'>".concat(xe,"</p>"):'<pre class="prettyprint linenums"><code class="language-'.concat(Ce,'">').concat(De?xe:Object(c.escape)(xe,!0),`</code></pre>
|
|
|
`):'<pre class="prettyprint linenums"><code>'+(De?xe:Object(c.escape)(xe,!0))+"</code></pre>"},n.heading=function(xe,Ce,De){var ve=this.options.headerPrefix+De.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return l.push({anchor:ve,level:Ce,text:xe}),"<h"+Ce+' id="'+ve+'">'+xe+"</h"+Ce+">"},a.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),a.a.use({tokenizer:g,renderer:n});var B=a.a,H=re("SJMd"),F=re("ulZh"),W=re.n(F),U=re("m3rI"),K=re("Oy/b"),G=re("p5ED"),ae=re("8hTe"),fe=re.n(ae),Se=/<pre[^>]*>/g;function Ue(xe){var Ce=document.createElement("div");return Ce.innerHTML=xe,Ce.childNodes.length===0?"":Ce.childNodes[0].nodeValue}var Ne=le.a=function(xe){var Ce=xe.value,De=Ce===void 0?"":Ce,ve=xe.edit,Re=ve===void 0?!1:ve,ee=xe.className,ge=xe.showTextOnly,se=xe.showLines,Fe=xe.replaces,je=xe.zoomImg,Ke=xe.hasMask,ze=xe.style,Ge=ze===void 0?{}:ze,He=xe.stylesPrev,Ie=He===void 0?{}:He,ke=String(De),Ae=Object(E.useRef)(),Te=Object(E.useRef)(),Z=Object(E.useState)(""),ce=Object(d.a)(Z,2),J=ce[0],Le=ce[1],We=Object(E.useState)("office"),Ve=Object(d.a)(We,2),Me=Ve[0],et=Ve[1],ne=Object(E.useMemo)(function(){try{var he=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,Y=/\"\/api\/attachments\/|\"\/attachments\/download\//g,$=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;ke=ke.replace(he,"("+U.a.API_SERVER+"/api/attachments/").replace(Y,'"'+U.a.API_SERVER+"/api/attachments/").replace($,'"'+U.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(X){}var z=B(ke),oe=S();if(ke.match(/\[TOC\]/)&&(z=z.replace("<p>[TOC]</p>",T()),i()),z=z.replace(/(__special_katext_id_\d+__)/g,function(X,de){var ye=oe[de],ie=ye.type,pe=ye.expression;return Object(K.renderToString)(Ue(pe)||"",{displayMode:ie==="block",throwOnError:!1,output:"html"})}),z=z.replace(/▁/g,"\u2581\u2581\u2581"),A(),ge){var _e=document.createElement("div");return _e.innerHTML=z,_e.innerText}return setTimeout(function(){return me()},500),z},[ke]),Ee=Object(E.useRef)();f.WebkitLineClamp=se,se&&(Ge=Object(O.a)(Object(O.a)({},Ge),f));function Oe(he){var Y=he.target;if(Y.tagName.toUpperCase()==="IMG"){if(je){var $=Y.getAttribute("src");Le($),et("image")}}else if(Y.tagName.toUpperCase()==="A"){var z=Y.getAttribute("href");if(z.indexOf("office")>-1)he.preventDefault(),Le(z),et("office");else if(z.indexOf("application/pdf")>-1)he.preventDefault(),Le(z),et("pdf");else if(z.indexOf("text/html")>-1)he.preventDefault(),Le(z),et("html");else if(z.startsWith("#")){he.preventDefault();var oe=document.getElementById(z.replace("#",""));oe&&oe.scrollIntoView(!0)}}}var me=function(){var Y,$=(Y=Ee.current)===null||Y===void 0?void 0:Y.querySelectorAll("video");$==null||$.forEach(function(z){if(z.oncontextmenu=function(){return!1},z.src.indexOf(".m3u8")>-1&&!z.canPlayType("application/vnd.apple.mpegurl")){if(W.a.isSupported()){var oe=new W.a;oe.loadSource(z.src),oe.attachMedia(z)}}})};Object(E.useEffect)(function(){if(Ee.current&&ne&&(ne.match(Se)&&window.PR.prettyPrint()),Ee.current)return Ee.current.addEventListener("click",Oe),function(){Ee.current.removeEventListener("click",Oe),A(),i()}},[ne,Ee.current,Oe]);var ue=function(Y){if(!Re)return;Y.target.nodeName==="IMG"?(Ae.current.style.display="flex",Ae.current.style.width=Y.target.clientWidth+"px",Ae.current.style.height=Y.target.clientHeight+"px",Ae.current.style.top=Y.target.offsetTop+"px",Ae.current.style.left=Y.target.offsetLeft+"px",Te.current.src=Y.target.getAttribute("src")):Ae.current.style.display="none"};return y.a.createElement("div",{style:{position:"relative"}},y.a.createElement("div",{ref:Ee,style:Object(O.a)({},Ge),className:"".concat(ee||""," markdown-body ").concat(fe.a.mdBody),onMouseOver:ue,dangerouslySetInnerHTML:{__html:ne}}),y.a.createElement("div",{ref:Ae,className:fe.a.button},y.a.createElement(k.a,null,y.a.createElement(R.a,{onClick:function(){return openCrop()}},"\u88C1\u526A"),y.a.createElement(R.a,{onClick:function(){return openEditor()}},"\u7F16\u8F91"))),y.a.createElement("img",{ref:Te,src:"",alt:"sample",crossOrigin:"anonymous",style:{maxWidth:"90%",opacity:0,position:"absolute",zIndex:-1,top:"-10000px"}}),y.a.createElement(G.a,{close:!0,data:J,type:J!=null&&J.length?Me:"",style:Object(O.a)({},Ie),onClose:function(){return Le("")}}))}},"9VGf":function(Je,le,re){"use strict";re.d(le,"a",function(){return D});var j=re("cDcd"),k=re.n(j);function D(R,O){var d=Object(j.useRef)();Object(j.useEffect)(function(){d.current=R}),Object(j.useEffect)(function(){function E(){d.current()}if(O!==null){var y=setInterval(E,O);return function(){return clearInterval(y)}}},[O])}},BU3w:function(Je,le,re){"use strict";re.d(le,"a",function(){return d});var j=re("MNnm"),k="rc-util-key";function D(E){if(E.attachTo)return E.attachTo;var y=document.querySelector("head");return y||document.body}function R(E){var y,v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!Object(j.a)())return null;var u=document.createElement("style");if((y=v.csp)===null||y===void 0?void 0:y.nonce){var a;u.nonce=(a=v.csp)===null||a===void 0?void 0:a.nonce}u.innerHTML=E;var c=D(v),s=c.firstChild;return v.prepend&&c.prepend?c.prepend(u):v.prepend&&s?c.insertBefore(u,s):c.appendChild(u),u}var O=new Map;function d(E,y){var v=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},u=D(v);if(!O.has(u)){var a=R("",v),c=a.parentNode;O.set(u,c),c.removeChild(a)}var s=Array.from(O.get(u).children).find(function(i){return i.tagName==="STYLE"&&i[k]===y});if(s){var l,r;if(((l=v.csp)===null||l===void 0?void 0:l.nonce)&&s.nonce!==((r=v.csp)===null||r===void 0?void 0:r.nonce)){var n;s.nonce=(n=v.csp)===null||n===void 0?void 0:n.nonce}return s.innerHTML!==E&&(s.innerHTML=E),s}var o=R(E,v);return o[k]=y,o}},Bd2K:function(Je,le,re){(function(j){j(re("VrN/"),re("osHv"))})(function(j){j.defineOption("autoCloseTags",!1,function(v,u,a){if(a!=j.Init&&a&&v.removeKeyMap("autoCloseTags"),!u)return;var c={name:"autoCloseTags"};(typeof u!="object"||u.whenClosing!==!1)&&(c["'/'"]=function(s){return d(s)}),(typeof u!="object"||u.whenOpening!==!1)&&(c["'>'"]=function(s){return R(s)}),v.addKeyMap(c)});var k=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],D=["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(v){if(v.getOption("disableInput"))return j.Pass;for(var u=v.listSelections(),a=[],c=v.getOption("autoCloseTags"),s=0;s<u.length;s++){if(!u[s].empty())return j.Pass;var l=u[s].head,r=v.getTokenAt(l),n=j.innerMode(v.getMode(),r.state),o=n.state,i=n.mode.xmlCurrentTag&&n.mode.xmlCurrentTag(o),f=i&&i.name;if(!f)return j.Pass;var h=n.mode.configuration=="html",T=typeof c=="object"&&c.dontCloseTags||h&&k,g=typeof c=="object"&&c.indentTags||h&&D;r.end>l.ch&&(f=f.slice(0,f.length-r.end+l.ch));var w=f.toLowerCase();if(!f||r.type=="string"&&(r.end!=l.ch||!/[\"\']/.test(r.string.charAt(r.string.length-1))||r.string.length==1)||r.type=="tag"&&i.close||r.string.indexOf("/")==l.ch-r.start-1||T&&E(T,w)>-1||y(v,n.mode.xmlCurrentContext&&n.mode.xmlCurrentContext(o)||[],f,l,!0))return j.Pass;var C=typeof c=="object"&&c.emptyTags;if(C&&E(C,f)>-1){a[s]={text:"/>",newPos:j.Pos(l.line,l.ch+2)};continue}var x=g&&E(g,w)>-1;a[s]={indent:x,text:">"+(x?`
|
|
|
|
|
|
`:"")+"</"+f+">",newPos:x?j.Pos(l.line+1,0):j.Pos(l.line,l.ch+1)}}for(var b=typeof c=="object"&&c.dontIndentOnAutoClose,s=u.length-1;s>=0;s--){var S=a[s];v.replaceRange(S.text,u[s].head,u[s].anchor,"+insert");var A=v.listSelections().slice(0);A[s]={head:S.newPos,anchor:S.newPos},v.setSelections(A),!b&&S.indent&&(v.indentLine(S.newPos.line,null,!0),v.indentLine(S.newPos.line+1,null,!0))}}function O(v,u){for(var a=v.listSelections(),c=[],s=u?"/":"</",l=v.getOption("autoCloseTags"),r=typeof l=="object"&&l.dontIndentOnSlash,n=0;n<a.length;n++){if(!a[n].empty())return j.Pass;var o=a[n].head,i=v.getTokenAt(o),f=j.innerMode(v.getMode(),i.state),h=f.state;if(u&&(i.type=="string"||i.string.charAt(0)!="<"||i.start!=o.ch-1))return j.Pass;var T,g=f.mode.name!="xml"&&v.getMode().name=="htmlmixed";if(g&&f.mode.name=="javascript")T=s+"script";else if(g&&f.mode.name=="css")T=s+"style";else{var w=f.mode.xmlCurrentContext&&f.mode.xmlCurrentContext(h);if(!w||w.length&&y(v,w,w[w.length-1],o))return j.Pass;T=s+w[w.length-1]}v.getLine(o.line).charAt(i.end)!=">"&&(T+=">"),c[n]=T}if(v.replaceSelections(c),a=v.listSelections(),!r)for(var n=0;n<a.length;n++)(n==a.length-1||a[n].head.line<a[n+1].head.line)&&v.indentLine(a[n].head.line)}function d(v){return v.getOption("disableInput")?j.Pass:O(v,!0)}j.commands.closeTag=function(v){return O(v)};function E(v,u){if(v.indexOf)return v.indexOf(u);for(var a=0,c=v.length;a<c;++a)if(v[a]==u)return a;return-1}function y(v,u,a,c,s){if(!j.scanForClosingTag)return!1;var l=Math.min(v.lastLine()+1,c.line+500),r=j.scanForClosingTag(v,c,null,l);if(!r||r.tag!=a)return!1;for(var n=s?1:0,o=u.length-1;o>=0&&u[o]==a;o--)++n;c=r.to;for(var o=1;o<n;o++){var i=j.scanForClosingTag(v,c,null,l);if(!i||i.tag!=a)return!1;c=i.to}return!0}})},BjJ7:function(Je,le,re){"use strict";re.d(le,"d",function(){return k}),re.d(le,"c",function(){return D}),re.d(le,"e",function(){return R}),re.d(le,"b",function(){return O}),re.d(le,"a",function(){return E});var j=re("m3rI");function k(y){var v=!0;if(y.length>0){for(var u=0;u<y.length;u++)if(y[u].compile_success==0||!y[u].compile_success){v=!1;break}}else v=!1;return v}function D(y){for(var v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",u=[],a=0;a<y.length;a++){var c=y[a],s=v?"".concat(v,"/").concat(c.name):"".concat(c.name);u.push({title:c.name,isLeaf:!(c.type==="tree"),key:s})}return u}function R(y,v,u){for(var a=0;a<y.length;a++){var c=y[a];if(c.key===v){c.children=u;break}c.children&&R(c.children,v,u)}return y}function O(y,v,u){var a;return function(){var c=this,s=arguments,l=function(){a=null,u||y.apply(c,s)},r=u&&!a;clearTimeout(a),a=setTimeout(l,v),r&&y.apply(c,s)}}var d=!0,E=j.a.API_SERVER},"C+DQ":function(Je,le,re){},DlQD:function(Je,le,re){(function(j,k){Je.exports=k()})(this,function(){"use strict";function j(me,ue){for(var he=0;he<ue.length;he++){var Y=ue[he];Y.enumerable=Y.enumerable||!1,Y.configurable=!0,"value"in Y&&(Y.writable=!0),Object.defineProperty(me,Y.key,Y)}}function k(me,ue,he){return ue&&j(me.prototype,ue),he&&j(me,he),me}function D(me,ue){if(!me)return;if(typeof me=="string")return R(me,ue);var he=Object.prototype.toString.call(me).slice(8,-1);if(he==="Object"&&me.constructor&&(he=me.constructor.name),he==="Map"||he==="Set")return Array.from(me);if(he==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(he))return R(me,ue)}function R(me,ue){(ue==null||ue>me.length)&&(ue=me.length);for(var he=0,Y=new Array(ue);he<ue;he++)Y[he]=me[he];return Y}function O(me,ue){var he;if(typeof Symbol=="undefined"||me[Symbol.iterator]==null){if(Array.isArray(me)||(he=D(me))||ue&&me&&typeof me.length=="number"){he&&(me=he);var Y=0;return function(){return Y>=me.length?{done:!0}:{done:!1,value:me[Y++]}}}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 he=me[Symbol.iterator](),he.next.bind(he)}function d(me,ue){return ue={exports:{}},me(ue,ue.exports),ue.exports}var E=d(function(me){function ue(){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 he(Y){me.exports.defaults=Y}me.exports={defaults:ue(),getDefaults:ue,changeDefaults:he}}),y=E.defaults,v=E.getDefaults,u=E.changeDefaults,a=/[&<>"']/,c=/[&<>"']/g,s=/[<>"']|&(?!#?\w+;)/,l=/[<>"']|&(?!#?\w+;)/g,r={"&":"&","<":"<",">":">",'"':""","'":"'"},n=function(ue){return r[ue]};function o(me,ue){if(ue){if(a.test(me))return me.replace(c,n)}else if(s.test(me))return me.replace(l,n);return me}var i=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function f(me){return me.replace(i,function(ue,he){return he=he.toLowerCase(),he==="colon"?":":he.charAt(0)==="#"?he.charAt(1)==="x"?String.fromCharCode(parseInt(he.substring(2),16)):String.fromCharCode(+he.substring(1)):""})}var h=/(^|[^\[])\^/g;function T(me,ue){me=me.source||me,ue=ue||"";var he={replace:function($,z){return z=z.source||z,z=z.replace(h,"$1"),me=me.replace($,z),he},getRegex:function(){return new RegExp(me,ue)}};return he}var g=/[^\w:]/g,w=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function C(me,ue,he){if(me){var Y;try{Y=decodeURIComponent(f(he)).replace(g,"").toLowerCase()}catch($){return null}if(Y.indexOf("javascript:")===0||Y.indexOf("vbscript:")===0||Y.indexOf("data:")===0)return null}ue&&!w.test(he)&&(he=p(ue,he));try{he=encodeURI(he).replace(/%25/g,"%")}catch($){return null}return he}var x={},b=/^[^:]+:\/*[^/]*$/,S=/^([^:]+:)[\s\S]*$/,A=/^([^:]+:\/*[^/]*)[\s\S]*$/;function p(me,ue){x[" "+me]||(b.test(me)?x[" "+me]=me+"/":x[" "+me]=B(me,"/",!0)),me=x[" "+me];var he=me.indexOf(":")===-1;return ue.substring(0,2)==="//"?he?ue:me.replace(S,"$1")+ue:ue.charAt(0)==="/"?he?ue:me.replace(A,"$1")+ue:me+ue}var I={exec:function(){}};function M(me){for(var ue=1,he,Y;ue<arguments.length;ue++){he=arguments[ue];for(Y in he)Object.prototype.hasOwnProperty.call(he,Y)&&(me[Y]=he[Y])}return me}function P(me,ue){var he=me.replace(/\|/g,function(z,oe,_e){for(var X=!1,de=oe;--de>=0&&_e[de]==="\\";)X=!X;return X?"|":" |"}),Y=he.split(/ \|/),$=0;if(Y.length>ue)Y.splice(ue);else for(;Y.length<ue;)Y.push("");for(;$<Y.length;$++)Y[$]=Y[$].trim().replace(/\\\|/g,"|");return Y}function B(me,ue,he){var Y=me.length;if(Y===0)return"";for(var $=0;$<Y;){var z=me.charAt(Y-$-1);if(z===ue&&!he)$++;else if(z!==ue&&he)$++;else break}return me.substr(0,Y-$)}function H(me,ue){if(me.indexOf(ue[1])===-1)return-1;for(var he=me.length,Y=0,$=0;$<he;$++)if(me[$]==="\\")$++;else if(me[$]===ue[0])Y++;else if(me[$]===ue[1]&&(Y--,Y<0))return $;return-1}function F(me){me&&me.sanitize&&!me.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 W={escape:o,unescape:f,edit:T,cleanUrl:C,resolveUrl:p,noopTest:I,merge:M,splitCells:P,rtrim:B,findClosingBracket:H,checkSanitizeDeprecation:F},U=E.defaults,K=W.rtrim,G=W.splitCells,ae=W.escape,fe=W.findClosingBracket;function Se(me,ue,he){var Y=ue.href,$=ue.title?ae(ue.title):null,z=me[1].replace(/\\([\[\]])/g,"$1");return me[0].charAt(0)!=="!"?{type:"link",raw:he,href:Y,title:$,text:z}:{type:"image",raw:he,href:Y,title:$,text:ae(z)}}function Ue(me,ue){var he=me.match(/^(\s+)(?:```)/);if(he===null)return ue;var Y=he[1];return ue.split(`
|
|
|
`).map(function($){var z=$.match(/^\s+/);if(z===null)return $;var oe=z[0];return oe.length>=Y.length?$.slice(Y.length):$}).join(`
|
|
|
`)}var Ne=function(){function me(he){this.options=he||U}var ue=me.prototype;return ue.space=function(Y){var $=this.rules.block.newline.exec(Y);if($)return $[0].length>1?{type:"space",raw:$[0]}:{raw:`
|
|
|
`}},ue.code=function(Y,$){var z=this.rules.block.code.exec(Y);if(z){var oe=$[$.length-1];if(oe&&oe.type==="paragraph")return{raw:z[0],text:z[0].trimRight()};var _e=z[0].replace(/^ {4}/gm,"");return{type:"code",raw:z[0],codeBlockStyle:"indented",text:this.options.pedantic?_e:K(_e,`
|
|
|
`)}}},ue.fences=function(Y){var $=this.rules.block.fences.exec(Y);if($){var z=$[0],oe=Ue(z,$[3]||"");return{type:"code",raw:z,lang:$[2]?$[2].trim():$[2],text:oe}}},ue.heading=function(Y){var $=this.rules.block.heading.exec(Y);if($)return{type:"heading",raw:$[0],depth:$[1].length,text:$[2]}},ue.nptable=function(Y){var $=this.rules.block.nptable.exec(Y);if($){var z={type:"table",header:G($[1].replace(/^ *| *\| *$/g,"")),align:$[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:$[3]?$[3].replace(/\n$/,"").split(`
|
|
|
`):[],raw:$[0]};if(z.header.length===z.align.length){var oe=z.align.length,_e;for(_e=0;_e<oe;_e++)/^ *-+: *$/.test(z.align[_e])?z.align[_e]="right":/^ *:-+: *$/.test(z.align[_e])?z.align[_e]="center":/^ *:-+ *$/.test(z.align[_e])?z.align[_e]="left":z.align[_e]=null;for(oe=z.cells.length,_e=0;_e<oe;_e++)z.cells[_e]=G(z.cells[_e],z.header.length);return z}}},ue.hr=function(Y){var $=this.rules.block.hr.exec(Y);if($)return{type:"hr",raw:$[0]}},ue.blockquote=function(Y){var $=this.rules.block.blockquote.exec(Y);if($){var z=$[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:$[0],text:z}}},ue.list=function(Y){var $=this.rules.block.list.exec(Y);if($){for(var z=$[0],oe=$[2],_e=oe.length>1,X=oe[oe.length-1]===")",de={type:"list",raw:z,ordered:_e,start:_e?+oe.slice(0,-1):"",loose:!1,items:[]},ye=$[0].match(this.rules.block.item),ie=!1,pe,Pe,$e,Ye,qe,st,mt,ct=ye.length,it=0;it<ct;it++)pe=ye[it],z=pe,Pe=pe.length,pe=pe.replace(/^ *([*+-]|\d+[.)]) */,""),~pe.indexOf(`
|
|
|
`)&&(Pe-=pe.length,pe=this.options.pedantic?pe.replace(/^ {1,4}/gm,""):pe.replace(new RegExp("^ {1,"+Pe+"}","gm"),"")),it!==ct-1&&($e=this.rules.block.bullet.exec(ye[it+1])[0],(_e?$e.length===1||!X&&$e[$e.length-1]===")":$e.length>1||this.options.smartLists&&$e!==oe)&&(Ye=ye.slice(it+1).join(`
|
|
|
`),de.raw=de.raw.substring(0,de.raw.length-Ye.length),it=ct-1)),qe=ie||/\n\n(?!\s*$)/.test(pe),it!==ct-1&&(ie=pe.charAt(pe.length-1)===`
|
|
|
`,qe||(qe=ie)),qe&&(de.loose=!0),st=/^\[[ xX]\] /.test(pe),mt=void 0,st&&(mt=pe[1]!==" ",pe=pe.replace(/^\[[ xX]\] +/,"")),de.items.push({type:"list_item",raw:z,task:st,checked:mt,loose:qe,text:pe});return de}},ue.html=function(Y){var $=this.rules.block.html.exec(Y);if($)return{type:this.options.sanitize?"paragraph":"html",raw:$[0],pre:!this.options.sanitizer&&($[1]==="pre"||$[1]==="script"||$[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer($[0]):ae($[0]):$[0]}},ue.def=function(Y){var $=this.rules.block.def.exec(Y);if($){$[3]&&($[3]=$[3].substring(1,$[3].length-1));var z=$[1].toLowerCase().replace(/\s+/g," ");return{tag:z,raw:$[0],href:$[2],title:$[3]}}},ue.table=function(Y){var $=this.rules.block.table.exec(Y);if($){var z={type:"table",header:G($[1].replace(/^ *| *\| *$/g,"")),align:$[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:$[3]?$[3].replace(/\n$/,"").split(`
|
|
|
`):[]};if(z.header.length===z.align.length){z.raw=$[0];var oe=z.align.length,_e;for(_e=0;_e<oe;_e++)/^ *-+: *$/.test(z.align[_e])?z.align[_e]="right":/^ *:-+: *$/.test(z.align[_e])?z.align[_e]="center":/^ *:-+ *$/.test(z.align[_e])?z.align[_e]="left":z.align[_e]=null;for(oe=z.cells.length,_e=0;_e<oe;_e++)z.cells[_e]=G(z.cells[_e].replace(/^ *\| *| *\| *$/g,""),z.header.length);return z}}},ue.lheading=function(Y){var $=this.rules.block.lheading.exec(Y);if($)return{type:"heading",raw:$[0],depth:$[2].charAt(0)==="="?1:2,text:$[1]}},ue.paragraph=function(Y){var $=this.rules.block.paragraph.exec(Y);if($)return{type:"paragraph",raw:$[0],text:$[1].charAt($[1].length-1)===`
|
|
|
`?$[1].slice(0,-1):$[1]}},ue.text=function(Y,$){var z=this.rules.block.text.exec(Y);if(z){var oe=$[$.length-1];return oe&&oe.type==="text"?{raw:z[0],text:z[0]}:{type:"text",raw:z[0],text:z[0]}}},ue.escape=function(Y){var $=this.rules.inline.escape.exec(Y);if($)return{type:"escape",raw:$[0],text:ae($[1])}},ue.tag=function(Y,$,z){var oe=this.rules.inline.tag.exec(Y);if(oe)return!$&&/^<a /i.test(oe[0])?$=!0:$&&/^<\/a>/i.test(oe[0])&&($=!1),!z&&/^<(pre|code|kbd|script)(\s|>)/i.test(oe[0])?z=!0:z&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(oe[0])&&(z=!1),{type:this.options.sanitize?"text":"html",raw:oe[0],inLink:$,inRawBlock:z,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(oe[0]):ae(oe[0]):oe[0]}},ue.link=function(Y){var $=this.rules.inline.link.exec(Y);if($){var z=fe($[2],"()");if(z>-1){var oe=$[0].indexOf("!")===0?5:4,_e=oe+$[1].length+z;$[2]=$[2].substring(0,z),$[0]=$[0].substring(0,_e).trim(),$[3]=""}var X=$[2],de="";if(this.options.pedantic){var ye=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(X);ye?(X=ye[1],de=ye[3]):de=""}else de=$[3]?$[3].slice(1,-1):"";X=X.trim().replace(/^<([\s\S]*)>$/,"$1");var ie=Se($,{href:X&&X.replace(this.rules.inline._escapes,"$1"),title:de&&de.replace(this.rules.inline._escapes,"$1")},$[0]);return ie}},ue.reflink=function(Y,$){var z;if((z=this.rules.inline.reflink.exec(Y))||(z=this.rules.inline.nolink.exec(Y))){var oe=(z[2]||z[1]).replace(/\s+/g," ");if(oe=$[oe.toLowerCase()],!oe||!oe.href){var _e=z[0].charAt(0);return{type:"text",raw:_e,text:_e}}var X=Se(z,oe,z[0]);return X}},ue.strong=function(Y,$,z){z===void 0&&(z="");var oe=this.rules.inline.strong.start.exec(Y);if(oe&&(!oe[1]||oe[1]&&(z===""||this.rules.inline.punctuation.exec(z)))){$=$.slice(-1*Y.length);var _e=oe[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;_e.lastIndex=0;for(var X;(oe=_e.exec($))!=null;)if(X=this.rules.inline.strong.middle.exec($.slice(0,oe.index+3)),X)return{type:"strong",raw:Y.slice(0,X[0].length),text:Y.slice(2,X[0].length-2)}}},ue.em=function(Y,$,z){z===void 0&&(z="");var oe=this.rules.inline.em.start.exec(Y);if(oe&&(!oe[1]||oe[1]&&(z===""||this.rules.inline.punctuation.exec(z)))){$=$.slice(-1*Y.length);var _e=oe[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;_e.lastIndex=0;for(var X;(oe=_e.exec($))!=null;)if(X=this.rules.inline.em.middle.exec($.slice(0,oe.index+2)),X)return{type:"em",raw:Y.slice(0,X[0].length),text:Y.slice(1,X[0].length-1)}}},ue.codespan=function(Y){var $=this.rules.inline.code.exec(Y);if($){var z=$[2].replace(/\n/g," "),oe=/[^ ]/.test(z),_e=z.startsWith(" ")&&z.endsWith(" ");return oe&&_e&&(z=z.substring(1,z.length-1)),z=ae(z,!0),{type:"codespan",raw:$[0],text:z}}},ue.br=function(Y){var $=this.rules.inline.br.exec(Y);if($)return{type:"br",raw:$[0]}},ue.del=function(Y){var $=this.rules.inline.del.exec(Y);if($)return{type:"del",raw:$[0],text:$[1]}},ue.autolink=function(Y,$){var z=this.rules.inline.autolink.exec(Y);if(z){var oe,_e;return z[2]==="@"?(oe=ae(this.options.mangle?$(z[1]):z[1]),_e="mailto:"+oe):(oe=ae(z[1]),_e=oe),{type:"link",raw:z[0],text:oe,href:_e,tokens:[{type:"text",raw:oe,text:oe}]}}},ue.url=function(Y,$){var z;if(z=this.rules.inline.url.exec(Y)){var oe,_e;if(z[2]==="@")oe=ae(this.options.mangle?$(z[0]):z[0]),_e="mailto:"+oe;else{var X;do X=z[0],z[0]=this.rules.inline._backpedal.exec(z[0])[0];while(X!==z[0]);oe=ae(z[0]),z[1]==="www."?_e="http://"+oe:_e=oe}return{type:"link",raw:z[0],text:oe,href:_e,tokens:[{type:"text",raw:oe,text:oe}]}}},ue.inlineText=function(Y,$,z){var oe=this.rules.inline.text.exec(Y);if(oe){var _e;return $?_e=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(oe[0]):ae(oe[0]):oe[0]:_e=ae(this.options.smartypants?z(oe[0]):oe[0]),{type:"text",raw:oe[0],text:_e}}},me}(),xe=W.noopTest,Ce=W.edit,De=W.merge,ve={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:xe,table:xe,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/};ve._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,ve._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,ve.def=Ce(ve.def).replace("label",ve._label).replace("title",ve._title).getRegex(),ve.bullet=/(?:[*+-]|\d{1,9}[.)])/,ve.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,ve.item=Ce(ve.item,"gm").replace(/bull/g,ve.bullet).getRegex(),ve.list=Ce(ve.list).replace(/bull/g,ve.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+ve.def.source+")").getRegex(),ve._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",ve._comment=/<!--(?!-?>)[\s\S]*?-->/,ve.html=Ce(ve.html,"i").replace("comment",ve._comment).replace("tag",ve._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),ve.paragraph=Ce(ve._paragraph).replace("hr",ve.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",ve._tag).getRegex(),ve.blockquote=Ce(ve.blockquote).replace("paragraph",ve.paragraph).getRegex(),ve.normal=De({},ve),ve.gfm=De({},ve.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*|$)"}),ve.gfm.nptable=Ce(ve.gfm.nptable).replace("hr",ve.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",ve._tag).getRegex(),ve.gfm.table=Ce(ve.gfm.table).replace("hr",ve.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",ve._tag).getRegex(),ve.pedantic=De({},ve.normal,{html:Ce(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",ve._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:xe,paragraph:Ce(ve.normal._paragraph).replace("hr",ve.hr).replace("heading",` *#{1,6} *[^
|
|
|
]`).replace("lheading",ve.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var Re={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:xe,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:xe,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*]|\b_|$)|[^ ](?= {2,}\n))|(?= {2,}\n))/,punctuation:/^([\s*punctuation])/};Re._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",Re.punctuation=Ce(Re.punctuation).replace(/punctuation/g,Re._punctuation).getRegex(),Re._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",Re._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",Re.em.start=Ce(Re.em.start).replace(/punctuation/g,Re._punctuation).getRegex(),Re.em.middle=Ce(Re.em.middle).replace(/punctuation/g,Re._punctuation).replace(/overlapSkip/g,Re._overlapSkip).getRegex(),Re.em.endAst=Ce(Re.em.endAst,"g").replace(/punctuation/g,Re._punctuation).getRegex(),Re.em.endUnd=Ce(Re.em.endUnd,"g").replace(/punctuation/g,Re._punctuation).getRegex(),Re.strong.start=Ce(Re.strong.start).replace(/punctuation/g,Re._punctuation).getRegex(),Re.strong.middle=Ce(Re.strong.middle).replace(/punctuation/g,Re._punctuation).replace(/blockSkip/g,Re._blockSkip).getRegex(),Re.strong.endAst=Ce(Re.strong.endAst,"g").replace(/punctuation/g,Re._punctuation).getRegex(),Re.strong.endUnd=Ce(Re.strong.endUnd,"g").replace(/punctuation/g,Re._punctuation).getRegex(),Re.blockSkip=Ce(Re._blockSkip,"g").getRegex(),Re.overlapSkip=Ce(Re._overlapSkip,"g").getRegex(),Re._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,Re._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,Re._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])?)+(?![-_])/,Re.autolink=Ce(Re.autolink).replace("scheme",Re._scheme).replace("email",Re._email).getRegex(),Re._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,Re.tag=Ce(Re.tag).replace("comment",ve._comment).replace("attribute",Re._attribute).getRegex(),Re._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,Re._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,Re._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,Re.link=Ce(Re.link).replace("label",Re._label).replace("href",Re._href).replace("title",Re._title).getRegex(),Re.reflink=Ce(Re.reflink).replace("label",Re._label).getRegex(),Re.reflinkSearch=Ce(Re.reflinkSearch,"g").replace("reflink",Re.reflink).replace("nolink",Re.nolink).getRegex(),Re.normal=De({},Re),Re.pedantic=De({},Re.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:Ce(/^!?\[(label)\]\((.*?)\)/).replace("label",Re._label).getRegex(),reflink:Ce(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Re._label).getRegex()}),Re.gfm=De({},Re.normal,{escape:Ce(Re.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.!#$%&'*+\/=?_`{\|}~-]+@))/}),Re.gfm.url=Ce(Re.gfm.url,"i").replace("email",Re.gfm._extended_email).getRegex(),Re.breaks=De({},Re.gfm,{br:Ce(Re.br).replace("{2,}","*").getRegex(),text:Ce(Re.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});var ee={block:ve,inline:Re},ge=E.defaults,se=ee.block,Fe=ee.inline;function je(me){return me.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 Ke(me){var ue="",he,Y,$=me.length;for(he=0;he<$;he++)Y=me.charCodeAt(he),Math.random()>.5&&(Y="x"+Y.toString(16)),ue+="&#"+Y+";";return ue}var ze=function(){function me(he){this.tokens=[],this.tokens.links=Object.create(null),this.options=he||ge,this.options.tokenizer=this.options.tokenizer||new Ne,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var Y={block:se.normal,inline:Fe.normal};this.options.pedantic?(Y.block=se.pedantic,Y.inline=Fe.pedantic):this.options.gfm&&(Y.block=se.gfm,this.options.breaks?Y.inline=Fe.breaks:Y.inline=Fe.gfm),this.tokenizer.rules=Y}me.lex=function(Y,$){var z=new me($);return z.lex(Y)};var ue=me.prototype;return ue.lex=function(Y){return Y=Y.replace(/\r\n|\r/g,`
|
|
|
`).replace(/\t/g," "),this.blockTokens(Y,this.tokens,!0),this.inline(this.tokens),this.tokens},ue.blockTokens=function(Y,$,z){$===void 0&&($=[]),z===void 0&&(z=!0),Y=Y.replace(/^ +$/gm,"");for(var oe,_e,X,de;Y;){if(oe=this.tokenizer.space(Y)){Y=Y.substring(oe.raw.length),oe.type&&$.push(oe);continue}if(oe=this.tokenizer.code(Y,$)){Y=Y.substring(oe.raw.length),oe.type?$.push(oe):(de=$[$.length-1],de.raw+=`
|
|
|
`+oe.raw,de.text+=`
|
|
|
`+oe.text);continue}if(oe=this.tokenizer.fences(Y)){Y=Y.substring(oe.raw.length),$.push(oe);continue}if(oe=this.tokenizer.heading(Y)){Y=Y.substring(oe.raw.length),$.push(oe);continue}if(oe=this.tokenizer.nptable(Y)){Y=Y.substring(oe.raw.length),$.push(oe);continue}if(oe=this.tokenizer.hr(Y)){Y=Y.substring(oe.raw.length),$.push(oe);continue}if(oe=this.tokenizer.blockquote(Y)){Y=Y.substring(oe.raw.length),oe.tokens=this.blockTokens(oe.text,[],z),$.push(oe);continue}if(oe=this.tokenizer.list(Y)){for(Y=Y.substring(oe.raw.length),X=oe.items.length,_e=0;_e<X;_e++)oe.items[_e].tokens=this.blockTokens(oe.items[_e].text,[],!1);$.push(oe);continue}if(oe=this.tokenizer.html(Y)){Y=Y.substring(oe.raw.length),$.push(oe);continue}if(z&&(oe=this.tokenizer.def(Y))){Y=Y.substring(oe.raw.length),this.tokens.links[oe.tag]||(this.tokens.links[oe.tag]={href:oe.href,title:oe.title});continue}if(oe=this.tokenizer.table(Y)){Y=Y.substring(oe.raw.length),$.push(oe);continue}if(oe=this.tokenizer.lheading(Y)){Y=Y.substring(oe.raw.length),$.push(oe);continue}if(z&&(oe=this.tokenizer.paragraph(Y))){Y=Y.substring(oe.raw.length),$.push(oe);continue}if(oe=this.tokenizer.text(Y,$)){Y=Y.substring(oe.raw.length),oe.type?$.push(oe):(de=$[$.length-1],de.raw+=`
|
|
|
`+oe.raw,de.text+=`
|
|
|
`+oe.text);continue}if(Y){var ye="Infinite loop on byte: "+Y.charCodeAt(0);if(this.options.silent){console.error(ye);break}else throw new Error(ye)}}return $},ue.inline=function(Y){var $,z,oe,_e,X,de,ye=Y.length;for($=0;$<ye;$++){de=Y[$];switch(de.type){case"paragraph":case"text":case"heading":{de.tokens=[],this.inlineTokens(de.text,de.tokens);break}case"table":{for(de.tokens={header:[],cells:[]},_e=de.header.length,z=0;z<_e;z++)de.tokens.header[z]=[],this.inlineTokens(de.header[z],de.tokens.header[z]);for(_e=de.cells.length,z=0;z<_e;z++)for(X=de.cells[z],de.tokens.cells[z]=[],oe=0;oe<X.length;oe++)de.tokens.cells[z][oe]=[],this.inlineTokens(X[oe],de.tokens.cells[z][oe]);break}case"blockquote":{this.inline(de.tokens);break}case"list":{for(_e=de.items.length,z=0;z<_e;z++)this.inline(de.items[z].tokens);break}}}return Y},ue.inlineTokens=function(Y,$,z,oe,_e){$===void 0&&($=[]),z===void 0&&(z=!1),oe===void 0&&(oe=!1),_e===void 0&&(_e="");var X,de=Y,ye;if(this.tokens.links){var ie=Object.keys(this.tokens.links);if(ie.length>0)for(;(ye=this.tokenizer.rules.inline.reflinkSearch.exec(de))!=null;)ie.includes(ye[0].slice(ye[0].lastIndexOf("[")+1,-1))&&(de=de.slice(0,ye.index)+"["+"a".repeat(ye[0].length-2)+"]"+de.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(ye=this.tokenizer.rules.inline.blockSkip.exec(de))!=null;)de=de.slice(0,ye.index)+"["+"a".repeat(ye[0].length-2)+"]"+de.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;Y;){if(X=this.tokenizer.escape(Y)){Y=Y.substring(X.raw.length),$.push(X);continue}if(X=this.tokenizer.tag(Y,z,oe)){Y=Y.substring(X.raw.length),z=X.inLink,oe=X.inRawBlock,$.push(X);continue}if(X=this.tokenizer.link(Y)){Y=Y.substring(X.raw.length),X.type==="link"&&(X.tokens=this.inlineTokens(X.text,[],!0,oe)),$.push(X);continue}if(X=this.tokenizer.reflink(Y,this.tokens.links)){Y=Y.substring(X.raw.length),X.type==="link"&&(X.tokens=this.inlineTokens(X.text,[],!0,oe)),$.push(X);continue}if(X=this.tokenizer.strong(Y,de,_e)){Y=Y.substring(X.raw.length),X.tokens=this.inlineTokens(X.text,[],z,oe),$.push(X);continue}if(X=this.tokenizer.em(Y,de,_e)){Y=Y.substring(X.raw.length),X.tokens=this.inlineTokens(X.text,[],z,oe),$.push(X);continue}if(X=this.tokenizer.codespan(Y)){Y=Y.substring(X.raw.length),$.push(X);continue}if(X=this.tokenizer.br(Y)){Y=Y.substring(X.raw.length),$.push(X);continue}if(X=this.tokenizer.del(Y)){Y=Y.substring(X.raw.length),X.tokens=this.inlineTokens(X.text,[],z,oe),$.push(X);continue}if(X=this.tokenizer.autolink(Y,Ke)){Y=Y.substring(X.raw.length),$.push(X);continue}if(!z&&(X=this.tokenizer.url(Y,Ke))){Y=Y.substring(X.raw.length),$.push(X);continue}if(X=this.tokenizer.inlineText(Y,oe,je)){Y=Y.substring(X.raw.length),_e=X.raw.slice(-1),$.push(X);continue}if(Y){var pe="Infinite loop on byte: "+Y.charCodeAt(0);if(this.options.silent){console.error(pe);break}else throw new Error(pe)}}return $},k(me,null,[{key:"rules",get:function(){return{block:se,inline:Fe}}}]),me}(),Ge=E.defaults,He=W.cleanUrl,Ie=W.escape,ke=function(){function me(he){this.options=he||Ge}var ue=me.prototype;return ue.code=function(Y,$,z){var oe=($||"").match(/\S*/)[0];if(this.options.highlight){var _e=this.options.highlight(Y,oe);_e!=null&&_e!==Y&&(z=!0,Y=_e)}return oe?'<pre><code class="'+this.options.langPrefix+Ie(oe,!0)+'">'+(z?Y:Ie(Y,!0))+`</code></pre>
|
|
|
`:"<pre><code>"+(z?Y:Ie(Y,!0))+`</code></pre>
|
|
|
`},ue.blockquote=function(Y){return`<blockquote>
|
|
|
`+Y+`</blockquote>
|
|
|
`},ue.html=function(Y){return Y},ue.heading=function(Y,$,z,oe){return this.options.headerIds?"<h"+$+' id="'+this.options.headerPrefix+oe.slug(z)+'">'+Y+"</h"+$+`>
|
|
|
`:"<h"+$+">"+Y+"</h"+$+`>
|
|
|
`},ue.hr=function(){return this.options.xhtml?`<hr/>
|
|
|
`:`<hr>
|
|
|
`},ue.list=function(Y,$,z){var oe=$?"ol":"ul",_e=$&&z!==1?' start="'+z+'"':"";return"<"+oe+_e+`>
|
|
|
`+Y+"</"+oe+`>
|
|
|
`},ue.listitem=function(Y){return"<li>"+Y+`</li>
|
|
|
`},ue.checkbox=function(Y){return"<input "+(Y?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},ue.paragraph=function(Y){return"<p>"+Y+`</p>
|
|
|
`},ue.table=function(Y,$){return $&&($="<tbody>"+$+"</tbody>"),`<table>
|
|
|
<thead>
|
|
|
`+Y+`</thead>
|
|
|
`+$+`</table>
|
|
|
`},ue.tablerow=function(Y){return`<tr>
|
|
|
`+Y+`</tr>
|
|
|
`},ue.tablecell=function(Y,$){var z=$.header?"th":"td",oe=$.align?"<"+z+' align="'+$.align+'">':"<"+z+">";return oe+Y+"</"+z+`>
|
|
|
`},ue.strong=function(Y){return"<strong>"+Y+"</strong>"},ue.em=function(Y){return"<em>"+Y+"</em>"},ue.codespan=function(Y){return"<code>"+Y+"</code>"},ue.br=function(){return this.options.xhtml?"<br/>":"<br>"},ue.del=function(Y){return"<del>"+Y+"</del>"},ue.link=function(Y,$,z){if(Y=He(this.options.sanitize,this.options.baseUrl,Y),Y===null)return z;var oe='<a href="'+Ie(Y)+'"';return $&&(oe+=' title="'+$+'"'),oe+=">"+z+"</a>",oe},ue.image=function(Y,$,z){if(Y=He(this.options.sanitize,this.options.baseUrl,Y),Y===null)return z;var oe='<img src="'+Y+'" alt="'+z+'"';return $&&(oe+=' title="'+$+'"'),oe+=this.options.xhtml?"/>":">",oe},ue.text=function(Y){return Y},me}(),Ae=function(){function me(){}var ue=me.prototype;return ue.strong=function(Y){return Y},ue.em=function(Y){return Y},ue.codespan=function(Y){return Y},ue.del=function(Y){return Y},ue.html=function(Y){return Y},ue.text=function(Y){return Y},ue.link=function(Y,$,z){return""+z},ue.image=function(Y,$,z){return""+z},ue.br=function(){return""},me}(),Te=function(){function me(){this.seen={}}var ue=me.prototype;return ue.slug=function(Y){var $=Y.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty($)){var z=$;do this.seen[z]++,$=z+"-"+this.seen[z];while(this.seen.hasOwnProperty($))}return this.seen[$]=0,$},me}(),Z=E.defaults,ce=W.unescape,J=function(){function me(he){this.options=he||Z,this.options.renderer=this.options.renderer||new ke,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Ae,this.slugger=new Te}me.parse=function(Y,$){var z=new me($);return z.parse(Y)};var ue=me.prototype;return ue.parse=function(Y,$){$===void 0&&($=!0);var z="",oe,_e,X,de,ye,ie,pe,Pe,$e,Ye,qe,st,mt,ct,it,yt,Et,St,Kt=Y.length;for(oe=0;oe<Kt;oe++){Ye=Y[oe];switch(Ye.type){case"space":continue;case"hr":{z+=this.renderer.hr();continue}case"heading":{z+=this.renderer.heading(this.parseInline(Ye.tokens),Ye.depth,ce(this.parseInline(Ye.tokens,this.textRenderer)),this.slugger);continue}case"code":{z+=this.renderer.code(Ye.text,Ye.lang,Ye.escaped);continue}case"table":{for(Pe="",pe="",de=Ye.header.length,_e=0;_e<de;_e++)pe+=this.renderer.tablecell(this.parseInline(Ye.tokens.header[_e]),{header:!0,align:Ye.align[_e]});for(Pe+=this.renderer.tablerow(pe),$e="",de=Ye.cells.length,_e=0;_e<de;_e++){for(ie=Ye.tokens.cells[_e],pe="",ye=ie.length,X=0;X<ye;X++)pe+=this.renderer.tablecell(this.parseInline(ie[X]),{header:!1,align:Ye.align[X]});$e+=this.renderer.tablerow(pe)}z+=this.renderer.table(Pe,$e);continue}case"blockquote":{$e=this.parse(Ye.tokens),z+=this.renderer.blockquote($e);continue}case"list":{for(qe=Ye.ordered,st=Ye.start,mt=Ye.loose,de=Ye.items.length,$e="",_e=0;_e<de;_e++)it=Ye.items[_e],yt=it.checked,Et=it.task,ct="",it.task&&(St=this.renderer.checkbox(yt),mt?it.tokens.length>0&&it.tokens[0].type==="text"?(it.tokens[0].text=St+" "+it.tokens[0].text,it.tokens[0].tokens&&it.tokens[0].tokens.length>0&&it.tokens[0].tokens[0].type==="text"&&(it.tokens[0].tokens[0].text=St+" "+it.tokens[0].tokens[0].text)):it.tokens.unshift({type:"text",text:St}):ct+=St),ct+=this.parse(it.tokens,mt),$e+=this.renderer.listitem(ct,Et,yt);z+=this.renderer.list($e,qe,st);continue}case"html":{z+=this.renderer.html(Ye.text);continue}case"paragraph":{z+=this.renderer.paragraph(this.parseInline(Ye.tokens));continue}case"text":{for($e=Ye.tokens?this.parseInline(Ye.tokens):Ye.text;oe+1<Kt&&Y[oe+1].type==="text";)Ye=Y[++oe],$e+=`
|
|
|
`+(Ye.tokens?this.parseInline(Ye.tokens):Ye.text);z+=$?this.renderer.paragraph($e):$e;continue}default:{var Bt='Token with "'+Ye.type+'" type was not found.';if(this.options.silent){console.error(Bt);return}else throw new Error(Bt)}}}return z},ue.parseInline=function(Y,$){$=$||this.renderer;var z="",oe,_e,X=Y.length;for(oe=0;oe<X;oe++){_e=Y[oe];switch(_e.type){case"escape":{z+=$.text(_e.text);break}case"html":{z+=$.html(_e.text);break}case"link":{z+=$.link(_e.href,_e.title,this.parseInline(_e.tokens,$));break}case"image":{z+=$.image(_e.href,_e.title,_e.text);break}case"strong":{z+=$.strong(this.parseInline(_e.tokens,$));break}case"em":{z+=$.em(this.parseInline(_e.tokens,$));break}case"codespan":{z+=$.codespan(_e.text);break}case"br":{z+=$.br();break}case"del":{z+=$.del(this.parseInline(_e.tokens,$));break}case"text":{z+=$.text(_e.text);break}default:{var de='Token with "'+_e.type+'" type was not found.';if(this.options.silent){console.error(de);return}else throw new Error(de)}}}return z},me}(),Le=W.merge,We=W.checkSanitizeDeprecation,Ve=W.escape,Me=E.getDefaults,et=E.changeDefaults,ne=E.defaults;function Ee(me,ue,he){if(typeof me=="undefined"||me===null)throw new Error("marked(): input parameter is undefined or null");if(typeof me!="string")throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(me)+", string expected");if(typeof ue=="function"&&(he=ue,ue=null),ue=Le({},Ee.defaults,ue||{}),We(ue),he){var Y=ue.highlight,$;try{$=ze.lex(me,ue)}catch(X){return he(X)}var z=function(de){var ye;if(!de)try{ye=J.parse($,ue)}catch(ie){de=ie}return ue.highlight=Y,de?he(de):he(null,ye)};if(!Y||Y.length<3)return z();if(delete ue.highlight,!$.length)return z();var oe=0;Ee.walkTokens($,function(X){X.type==="code"&&(oe++,setTimeout(function(){Y(X.text,X.lang,function(de,ye){if(de)return z(de);ye!=null&&ye!==X.text&&(X.text=ye,X.escaped=!0),oe--,oe===0&&z()})},0))}),oe===0&&z();return}try{var _e=ze.lex(me,ue);return ue.walkTokens&&Ee.walkTokens(_e,ue.walkTokens),J.parse(_e,ue)}catch(X){if(X.message+=`
|
|
|
Please report this to https://github.com/markedjs/marked.`,ue.silent)return"<p>An error occurred:</p><pre>"+Ve(X.message+"",!0)+"</pre>";throw X}}Ee.options=Ee.setOptions=function(me){return Le(Ee.defaults,me),et(Ee.defaults),Ee},Ee.getDefaults=Me,Ee.defaults=ne,Ee.use=function(me){var ue=Le({},me);if(me.renderer&&function(){var Y=Ee.defaults.renderer||new ke,$=function(_e){var X=Y[_e];Y[_e]=function(){for(var de=arguments.length,ye=new Array(de),ie=0;ie<de;ie++)ye[ie]=arguments[ie];var pe=me.renderer[_e].apply(Y,ye);return pe===!1&&(pe=X.apply(Y,ye)),pe}};for(var z in me.renderer)$(z);ue.renderer=Y}(),me.tokenizer&&function(){var Y=Ee.defaults.tokenizer||new Ne,$=function(_e){var X=Y[_e];Y[_e]=function(){for(var de=arguments.length,ye=new Array(de),ie=0;ie<de;ie++)ye[ie]=arguments[ie];var pe=me.tokenizer[_e].apply(Y,ye);return pe===!1&&(pe=X.apply(Y,ye)),pe}};for(var z in me.tokenizer)$(z);ue.tokenizer=Y}(),me.walkTokens){var he=Ee.defaults.walkTokens;ue.walkTokens=function(Y){me.walkTokens(Y),he&&he(Y)}}Ee.setOptions(ue)},Ee.walkTokens=function(me,ue){for(var he=O(me),Y;!(Y=he()).done;){var $=Y.value;ue($);switch($.type){case"table":{for(var z=O($.tokens.header),oe;!(oe=z()).done;){var _e=oe.value;Ee.walkTokens(_e,ue)}for(var X=O($.tokens.cells),de;!(de=X()).done;)for(var ye=de.value,ie=O(ye),pe;!(pe=ie()).done;){var Pe=pe.value;Ee.walkTokens(Pe,ue)}break}case"list":{Ee.walkTokens($.items,ue);break}default:$.tokens&&Ee.walkTokens($.tokens,ue)}}},Ee.Parser=J,Ee.parser=J.parse,Ee.Renderer=ke,Ee.TextRenderer=Ae,Ee.Lexer=ze,Ee.lexer=ze.lex,Ee.Tokenizer=Ne,Ee.Slugger=Te,Ee.parse=Ee;var Oe=Ee;return Oe})},Dqnf:function(Je,le,re){"use strict";var j=re("k1fw"),k=re("tJVT"),D=re("rAM+"),R=re("cDcd"),O=re.n(R),d=re("J66h"),E=re.n(d),y=re("/POA"),v=re.n(y),u=re("q7KB"),a=re.n(u),c=re("ER/M"),s=re.n(c),l=re("dhSg"),r=re("bdgK");function n(f,h,T){var g=T._core._renderService.dimensions.actualCellWidth||9.5,w=T._core._renderService.dimensions.actualCellHeight||18,C=Math.floor(h/w),x=Math.floor(f/g);return[x,C]}function o(f,h){var T=new r.default(function(g){var w=Object(D.a)(g),C;try{for(w.s();!(C=w.n()).done;){var x=C.value;if(x.target.offsetHeight>0||x.target.offsetWidth>0){var b=n(x.target.offsetWidth,x.target.offsetHeight,f),S=Object(k.a)(b,2),A=S[0],p=S[1];console.log("cols, rows",A,p),l.a.publish("ssh-xterm-resize",{columns:A,rows:p,width:x.target.offsetWidth,height:x.target.offsetHeight}),f.resize(A,p);var I=d.Base64.decode("IA=="),M=d.Base64.decode("CBtbSw==");f.write(I),f.write(M)}}}catch(P){w.e(P)}finally{w.f()}});return T.observe(h),T}var i=3e4;le.a=function(f){var h=f.sshConfigData,T=f.sid,g=Object(R.useState)(null),w=Object(k.a)(g,2),C=w[0],x=w[1],b=h.link_url,S=h.password,A=h.port,p=Object(R.useRef)(),I=Object(R.useRef)(),M=Object(R.useRef)(!1);return Object(R.useEffect)(function(){if(p.current&&b){var P=new y.Terminal({fontSize:16,rendererType:"dom"});P.open(p.current),P.onData(function(H){I.current&&(I.current.readyState===1&&(I.current.send(JSON.stringify({tp:"client",data:H})),l.a.publish("on-operating-ssh")))}),P.write("Connecting..."),x(P);var B=o(P,p.current);return function(){P.dispose(),B.unobserve(p.current)}}},[b,p.current]),Object(R.useEffect)(function(){if(C&&b){function P(){var K=new WebSocket(b);I.current=K,K.onopen=function(){var G=C.element.parentElement;if(G){var ae=G.offsetWidth,fe=G.offsetHeight;console.log("init",{tp:"init",data:Object(j.a)(Object(j.a)({},h),{},{secret:S,width:ae,height:fe,rows:C.rows,columns:C.cols})}),K.send(JSON.stringify({tp:"init",data:Object(j.a)(Object(j.a)({},h),{},{secret:S,width:ae,height:fe,rows:C.rows,columns:C.cols})}))}C.focus()},K.onerror=function(G){console.log("------in socket error----",G,K,b)},K.onmessage=function(G){M.current||(C.write("\r"),setTimeout(function(){},1e3)),M.current=!0,console.log("event:",G);var ae=d.Base64.decode(G.data.toString()),fe=C._core._renderService.dimensions.actualCellWidth||9.5;console.log("data:",ae,fe,C),C.write(ae)},K.onclose=function(G){B&&clearInterval(B),C.write(`\r
|
|
|
connection closed`)}}var B=setInterval(function(){I.current&&I.current.send(JSON.stringify({tp:"h"}))},i),H=l.a.subscribe("create-socket",function(K){T==K&&(I.current&&I.current.readyState===1?C.focus():P(),C.focus())}),F=l.a.subscribe("close-socket",function(K){T===K&&(I.current&&(I.current.close(),M.current=!1,C.clear()),I.current=null)}),W=l.a.subscribe("ssh-xterm-resize",function(K){I.current&&I.current.readyState===1&&I.current.send(JSON.stringify({tp:"resize",data:Object(j.a)({},K)}))}),U=l.a.subscribe("ssh-add-connect-time",function(){I.current&&I.current.readyState===1&&I.current.send(JSON.stringify({tp:"overtime"}))});return function(){F(),H(),W(),U(),I.current&&(I.current.close(),M.current=!1)}}},[C,b,A]),O.a.createElement("div",{ref:p,className:s.a["xterm-panel"]},b?null:O.a.createElement("p",{style:{color:"#fff"}},"\u6B63\u5728\u8FDE\u63A5\u547D\u4EE4\u884C\u670D\u52A1..."))}},ELLl:function(Je,le,re){(function(j){j(re("VrN/"))})(function(j){var k={pairs:`()[]{}''""`,closeBefore:`)]}'":;>`,triples:"",explode:"[]{}"},D=j.Pos;j.defineOption("autoCloseBrackets",!1,function(r,n,o){o&&o!=j.Init&&(r.removeKeyMap(O),r.state.closeBrackets=null),n&&(d(R(n,"pairs")),r.state.closeBrackets=n,r.addKeyMap(O))});function R(r,n){return n=="pairs"&&typeof r=="string"?r:typeof r=="object"&&r[n]!=null?r[n]:k[n]}var O={Backspace:v,Enter:u};function d(r){for(var n=0;n<r.length;n++){var o=r.charAt(n),i="'"+o+"'";O[i]||(O[i]=E(o))}}d(k.pairs+"`");function E(r){return function(n){return c(n,r)}}function y(r){var n=r.state.closeBrackets;if(!n||n.override)return n;var o=r.getModeAt(r.getCursor());return o.closeBrackets||n}function v(r){var n=y(r);if(!n||r.getOption("disableInput"))return j.Pass;for(var o=R(n,"pairs"),i=r.listSelections(),f=0;f<i.length;f++){if(!i[f].empty())return j.Pass;var h=s(r,i[f].head);if(!h||o.indexOf(h)%2!=0)return j.Pass}for(var f=i.length-1;f>=0;f--){var T=i[f].head;r.replaceRange("",D(T.line,T.ch-1),D(T.line,T.ch+1),"+delete")}}function u(r){var n=y(r),o=n&&R(n,"explode");if(!o||r.getOption("disableInput"))return j.Pass;for(var i=r.listSelections(),f=0;f<i.length;f++){if(!i[f].empty())return j.Pass;var h=s(r,i[f].head);if(!h||o.indexOf(h)%2!=0)return j.Pass}r.operation(function(){var T=r.lineSeparator()||`
|
|
|
`;r.replaceSelection(T+T,null),r.execCommand("goCharLeft"),i=r.listSelections();for(var g=0;g<i.length;g++){var w=i[g].head.line;r.indentLine(w,null,!0),r.indentLine(w+1,null,!0)}})}function a(r){var n=j.cmpPos(r.anchor,r.head)>0;return{anchor:new D(r.anchor.line,r.anchor.ch+(n?-1:1)),head:new D(r.head.line,r.head.ch+(n?1:-1))}}function c(r,n){var o=y(r);if(!o||r.getOption("disableInput"))return j.Pass;var i=R(o,"pairs"),f=i.indexOf(n);if(f==-1)return j.Pass;for(var h=R(o,"closeBefore"),T=R(o,"triples"),g=i.charAt(f+1)==n,w=r.listSelections(),C=f%2==0,x,b=0;b<w.length;b++){var S=w[b],A=S.head,p,I=r.getRange(A,D(A.line,A.ch+1));if(C&&!S.empty())p="surround";else if((g||!C)&&I==n)g&&l(r,A)?p="both":T.indexOf(n)>=0&&r.getRange(A,D(A.line,A.ch+3))==n+n+n?p="skipThree":p="skip";else if(g&&A.ch>1&&T.indexOf(n)>=0&&r.getRange(D(A.line,A.ch-2),A)==n+n){if(A.ch>2&&/\bstring/.test(r.getTokenTypeAt(D(A.line,A.ch-2))))return j.Pass;p="addFour"}else if(g){var M=A.ch==0?" ":r.getRange(D(A.line,A.ch-1),A);if(!j.isWordChar(I)&&M!=n&&!j.isWordChar(M))p="both";else return j.Pass}else if(C&&(I.length===0||/\s/.test(I)||h.indexOf(I)>-1))p="both";else return j.Pass;if(!x)x=p;else if(x!=p)return j.Pass}var P=f%2?i.charAt(f-1):n,B=f%2?n:i.charAt(f+1);r.operation(function(){if(x=="skip")r.execCommand("goCharRight");else if(x=="skipThree")for(var H=0;H<3;H++)r.execCommand("goCharRight");else if(x=="surround"){for(var F=r.getSelections(),H=0;H<F.length;H++)F[H]=P+F[H]+B;r.replaceSelections(F,"around"),F=r.listSelections().slice();for(var H=0;H<F.length;H++)F[H]=a(F[H]);r.setSelections(F)}else x=="both"?(r.replaceSelection(P+B,null),r.triggerElectric(P+B),r.execCommand("goCharLeft")):x=="addFour"&&(r.replaceSelection(P+P+P+P,"before"),r.execCommand("goCharRight"))})}function s(r,n){var o=r.getRange(D(n.line,n.ch-1),D(n.line,n.ch+1));return o.length==2?o:null}function l(r,n){var o=r.getTokenAt(D(n.line,n.ch+1));return/\bstring/.test(o.type)&&o.start==n.ch&&(n.ch==0||!/\bstring/.test(r.getTokenTypeAt(n)))}})},"ER/M":function(Je,le,re){Je.exports={"xterm-panel":"xterm-panel___2r2xx"}},Fv0C:function(Je,le,re){"use strict";function j(l){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?j=function(n){return typeof n}:j=function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},j(l)}Object.defineProperty(le,"__esModule",{value:!0}),le.default=void 0;var k=v(re("Lo0S")),D=re("vewr"),R=v(re("8CQX")),O=E(re("mHUz")),d=v(re("GdRQ"));function E(l){return l&&l.__esModule?l:{default:l}}function y(){if(typeof WeakMap!="function")return null;var l=new WeakMap;return y=function(){return l},l}function v(l){if(l&&l.__esModule)return l;if(l===null||j(l)!=="object"&&typeof l!="function")return{default:l};var r=y();if(r&&r.has(l))return r.get(l);var n={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in l)if(Object.prototype.hasOwnProperty.call(l,i)){var f=o?Object.getOwnPropertyDescriptor(l,i):null;f&&(f.get||f.set)?Object.defineProperty(n,i,f):n[i]=l[i]}return n.default=l,r&&r.set(l,n),n}function u(l,r){if(!(l instanceof r))throw new TypeError("Cannot call a class as a function")}function a(l,r){for(var n=0;n<r.length;n++){var o=r[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(l,o.key,o)}}function c(l,r,n){return r&&a(l.prototype,r),n&&a(l,n),l}var s=function(){function l(r){u(this,l),this._target=r||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 c(l,[{key:"_sendKeyEvent",value:function(n,o,i){if(i)this._keyDownList[o]=n;else{if(!(o in this._keyDownList))return;delete this._keyDownList[o]}k.Debug("onkeyevent "+(i?"down":"up")+", keysym: "+n,", code: "+o),this.onkeyevent(n,o,i)}},{key:"_getKeyCode",value:function(n){var o=R.getKeycode(n);if(o!=="Unidentified")return o;if(n.keyCode&&n.type!=="keypress"&&n.keyCode!==229)return"Platform"+n.keyCode;if(n.keyIdentifier){if(n.keyIdentifier.substr(0,2)!=="U+")return n.keyIdentifier;var i=parseInt(n.keyIdentifier.substr(2),16),f=String.fromCharCode(i).toUpperCase();return"Platform"+f.charCodeAt()}return"Unidentified"}},{key:"_handleKeyDown",value:function(n){var o=this._getKeyCode(n),i=R.getKeysym(n);if(this._altGrArmed&&(this._altGrArmed=!1,clearTimeout(this._altGrTimeout),o==="AltRight"&&n.timeStamp-this._altGrCtrlTime<50?i=O.default.XK_ISO_Level3_Shift:this._sendKeyEvent(O.default.XK_Control_L,"ControlLeft",!0)),o==="Unidentified"){i&&(this._sendKeyEvent(i,o,!0),this._sendKeyEvent(i,o,!1)),(0,D.stopEvent)(n);return}if(d.isMac()||d.isIOS())switch(i){case O.default.XK_Super_L:i=O.default.XK_Alt_L;break;case O.default.XK_Super_R:i=O.default.XK_Super_L;break;case O.default.XK_Alt_L:i=O.default.XK_Mode_switch;break;case O.default.XK_Alt_R:i=O.default.XK_ISO_Level3_Shift;break}if(o in this._keyDownList&&(i=this._keyDownList[o]),(d.isMac()||d.isIOS())&&o==="CapsLock"){this._sendKeyEvent(O.default.XK_Caps_Lock,"CapsLock",!0),this._sendKeyEvent(O.default.XK_Caps_Lock,"CapsLock",!1),(0,D.stopEvent)(n);return}if(!i&&(!n.key||d.isIE()||d.isEdge())){this._pendingKey=o,setTimeout(this._handleKeyPressTimeout.bind(this),10,n);return}if(this._pendingKey=null,(0,D.stopEvent)(n),o==="ControlLeft"&&d.isWindows()&&!("ControlLeft"in this._keyDownList)){this._altGrArmed=!0,this._altGrTimeout=setTimeout(this._handleAltGrTimeout.bind(this),100),this._altGrCtrlTime=n.timeStamp;return}this._sendKeyEvent(i,o,!0)}},{key:"_handleKeyPress",value:function(n){if((0,D.stopEvent)(n),this._pendingKey===null)return;var o=this._getKeyCode(n),i=R.getKeysym(n);if(o!=="Unidentified"&&o!=this._pendingKey)return;if(o=this._pendingKey,this._pendingKey=null,!i){k.Info("keypress with no keysym:",n);return}this._sendKeyEvent(i,o,!0)}},{key:"_handleKeyPressTimeout",value:function(n){if(this._pendingKey===null)return;var o,i=this._pendingKey;if(this._pendingKey=null,n.keyCode>=48&&n.keyCode<=57)o=n.keyCode;else if(n.keyCode>=65&&n.keyCode<=90){var f=String.fromCharCode(n.keyCode);n.shiftKey?f=f.toUpperCase():f=f.toLowerCase(),o=f.charCodeAt()}else o=0;this._sendKeyEvent(o,i,!0)}},{key:"_handleKeyUp",value:function(n){(0,D.stopEvent)(n);var o=this._getKeyCode(n);if(this._altGrArmed&&(this._altGrArmed=!1,clearTimeout(this._altGrTimeout),this._sendKeyEvent(O.default.XK_Control_L,"ControlLeft",!0)),(d.isMac()||d.isIOS())&&o==="CapsLock"){this._sendKeyEvent(O.default.XK_Caps_Lock,"CapsLock",!0),this._sendKeyEvent(O.default.XK_Caps_Lock,"CapsLock",!1);return}this._sendKeyEvent(this._keyDownList[o],o,!1),d.isWindows()&&(o==="ShiftLeft"||o==="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(O.default.XK_Control_L,"ControlLeft",!0)}},{key:"_allKeysUp",value:function(){k.Debug(">> Keyboard.allKeysUp");for(var n in this._keyDownList)this._sendKeyEvent(this._keyDownList[n],n,!1);k.Debug("<< Keyboard.allKeysUp")}},{key:"_checkAlt",value:function(n){if(n.skipCheckAlt)return;if(n.altKey)return;var o=this._target,i=this._keyDownList;["AltLeft","AltRight"].forEach(function(f){if(!(f in i))return;var h=new KeyboardEvent("keyup",{key:i[f],code:f});h.skipCheckAlt=!0,o.dispatchEvent(h)})}},{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),d.isWindows()&&d.isFirefox()){var n=this._eventHandlers.checkalt;["mousedown","mouseup","mousemove","wheel","touchstart","touchend","touchmove","keydown","keyup"].forEach(function(o){return document.addEventListener(o,n,{capture:!0,passive:!0})})}}},{key:"ungrab",value:function(){if(d.isWindows()&&d.isFirefox()){var n=this._eventHandlers.checkalt;["mousedown","mouseup","mousemove","wheel","touchstart","touchend","touchmove","keydown","keyup"].forEach(function(o){return document.removeEventListener(o,n)})}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()}}]),l}();le.default=s},GQ8N:function(Je,le,re){"use strict";Object.defineProperty(le,"__esModule",{value:!0}),le.toUnsigned32bit=j,le.toSigned32bit=k;function j(D){return D>>>0}function k(D){return D|0}},GdRQ:function(Je,le,re){"use strict";function j(C){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?j=function(b){return typeof b}:j=function(b){return b&&typeof Symbol=="function"&&b.constructor===Symbol&&b!==Symbol.prototype?"symbol":typeof b},j(C)}Object.defineProperty(le,"__esModule",{value:!0}),le.isMac=o,le.isWindows=i,le.isIOS=f,le.isSafari=h,le.isIE=T,le.isEdge=g,le.isFirefox=w,le.hasScrollbarGutter=le.supportsImageMetadata=le.supportsCursorURIs=le.dragThreshold=le.isTouchDevice=void 0;var k=R(re("Lo0S"));function D(){if(typeof WeakMap!="function")return null;var C=new WeakMap;return D=function(){return C},C}function R(C){if(C&&C.__esModule)return C;if(C===null||j(C)!=="object"&&typeof C!="function")return{default:C};var x=D();if(x&&x.has(C))return x.get(C);var b={},S=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var A in C)if(Object.prototype.hasOwnProperty.call(C,A)){var p=S?Object.getOwnPropertyDescriptor(C,A):null;p&&(p.get||p.set)?Object.defineProperty(b,A,p):b[A]=C[A]}return b.default=C,x&&x.set(C,b),b}var O="ontouchstart"in document.documentElement||document.ontouchstart!==void 0||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0;le.isTouchDevice=O,window.addEventListener("touchstart",function C(){le.isTouchDevice=O=!0,window.removeEventListener("touchstart",C,!1)},!1);var d=10*(window.devicePixelRatio||1);le.dragThreshold=d;var E=!1;try{var y=document.createElement("canvas");y.style.cursor='url("data:image/x-icon;base64,AAACAAEACAgAAAIAAgA4AQAAFgAAACgAAAAIAAAAEAAAAAEAIAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAD/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////AAAAAAAAAAAAAAAAAAAAAA==") 2 2, default',y.style.cursor.indexOf("url")===0?(k.Info("Data URI scheme cursor supported"),E=!0):k.Warn("Data URI scheme cursor not supported")}catch(C){k.Error("Data URI scheme cursor test exception: "+C)}var v=E;le.supportsCursorURIs=v;var u=!1;try{new ImageData(new Uint8ClampedArray(4),1,1),u=!0}catch(C){}var a=u;le.supportsImageMetadata=a;var c=!0;try{var s=document.createElement("div");s.style.visibility="hidden",s.style.overflow="scroll",document.body.appendChild(s);var l=document.createElement("div");s.appendChild(l);var r=s.offsetWidth-l.offsetWidth;s.parentNode.removeChild(s),c=r!=0}catch(C){k.Error("Scrollbar test exception: "+C)}var n=c;le.hasScrollbarGutter=n;function o(){return navigator&&!!/mac/i.exec(navigator.platform)}function i(){return navigator&&!!/win/i.exec(navigator.platform)}function f(){return navigator&&(!!/ipad/i.exec(navigator.platform)||!!/iphone/i.exec(navigator.platform)||!!/ipod/i.exec(navigator.platform))}function h(){return navigator&&navigator.userAgent.indexOf("Safari")!==-1&&navigator.userAgent.indexOf("Chrome")===-1}function T(){return navigator&&!!/trident/i.exec(navigator.userAgent)}function g(){return navigator&&!!/edge/i.exec(navigator.userAgent)}function w(){return navigator&&!!/firefox/i.exec(navigator.userAgent)}},Gytx:function(Je,le){Je.exports=function(j,k,D,R){var O=D?D.call(R,j,k):void 0;if(O!==void 0)return!!O;if(j===k)return!0;if(typeof j!="object"||!j||typeof k!="object"||!k)return!1;var d=Object.keys(j),E=Object.keys(k);if(d.length!==E.length)return!1;for(var y=Object.prototype.hasOwnProperty.bind(k),v=0;v<d.length;v++){var u=d[v];if(!y(u))return!1;var a=j[u],c=k[u];if(O=D?D.call(R,a,c,u):void 0,O===!1||O===void 0&&a!==c)return!1}return!0}},HmJG:function(Je,le,re){},ItS6:function(Je,le,re){"use strict";Object.defineProperty(le,"__esModule",{value:!0}),le.default=void 0;var j=re("eP3c"),k=D(re("1q3G"));function D(y){return y&&y.__esModule?y:{default:y}}function R(y,v){if(!(y instanceof v))throw new TypeError("Cannot call a class as a function")}function O(y,v){for(var u=0;u<v.length;u++){var a=v[u];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(y,a.key,a)}}function d(y,v,u){return v&&O(y.prototype,v),u&&O(y,u),y}var E=function(){function y(){R(this,y),this.strm=new k.default,this.chunkSize=1024*10*10,this.strm.output=new Uint8Array(this.chunkSize),this.windowBits=5,(0,j.inflateInit)(this.strm,this.windowBits)}return d(y,[{key:"setInput",value:function(u){u?(this.strm.input=u,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(u){u>this.chunkSize&&(this.chunkSize=u,this.strm.output=new Uint8Array(this.chunkSize)),this.strm.next_out=0,this.strm.avail_out=u;var a=(0,j.inflate)(this.strm,0);if(a<0)throw new Error("zlib inflate failed");if(this.strm.next_out!=u)throw new Error("Incomplete zlib block");return new Uint8Array(this.strm.output.buffer,0,this.strm.next_out)}},{key:"reset",value:function(){(0,j.inflateReset)(this.strm)}}]),y}();le.default=E},IxHN:function(Je,le,re){"use strict";var j=re("cDcd"),k=re.n(j),D=re("07cG"),R=re.n(D);le.a=function(O){var d=O.message,E=O.className,y=O.children,v=O.style,u=v===void 0?{}:v;return k.a.createElement("div",{className:"".concat(R.a.idsRingWrapper," ").concat(E)},k.a.createElement("div",{className:R.a.ldsRing},k.a.createElement("div",null),k.a.createElement("div",null),k.a.createElement("div",null),k.a.createElement("div",null)),d?k.a.createElement("p",{style:u},d):null,y)}},J66h:function(Je,le,re){(function(j){var k,D;(function(R,O){Je.exports=O(R)})(typeof self!="undefined"?self:typeof window!="undefined"?window:typeof j!="undefined"?j:this,function(R){"use strict";R=R||{};var O=R.Base64,d="2.6.4",E="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",y=function(P){for(var B={},H=0,F=P.length;H<F;H++)B[P.charAt(H)]=H;return B}(E),v=String.fromCharCode,u=function(P){if(P.length<2){var B=P.charCodeAt(0);return B<128?P:B<2048?v(192|B>>>6)+v(128|B&63):v(224|B>>>12&15)+v(128|B>>>6&63)+v(128|B&63)}else{var B=65536+(P.charCodeAt(0)-55296)*1024+(P.charCodeAt(1)-56320);return v(240|B>>>18&7)+v(128|B>>>12&63)+v(128|B>>>6&63)+v(128|B&63)}},a=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,c=function(P){return P.replace(a,u)},s=function(P){var B=[0,2,1][P.length%3],H=P.charCodeAt(0)<<16|(P.length>1?P.charCodeAt(1):0)<<8|(P.length>2?P.charCodeAt(2):0),F=[E.charAt(H>>>18),E.charAt(H>>>12&63),B>=2?"=":E.charAt(H>>>6&63),B>=1?"=":E.charAt(H&63)];return F.join("")},l=R.btoa&&typeof R.btoa=="function"?function(P){return R.btoa(P)}:function(P){if(P.match(/[^\x00-\xFF]/))throw new RangeError("The string contains invalid characters.");return P.replace(/[\s\S]{1,3}/g,s)},r=function(P){return l(c(String(P)))},n=function(P){return P.replace(/[+\/]/g,function(B){return B=="+"?"-":"_"}).replace(/=/g,"")},o=function(P,B){return B?n(r(P)):r(P)},i=function(P){return o(P,!0)},f;R.Uint8Array&&(f=function(P,B){for(var H="",F=0,W=P.length;F<W;F+=3){var U=P[F],K=P[F+1],G=P[F+2],ae=U<<16|K<<8|G;H+=E.charAt(ae>>>18)+E.charAt(ae>>>12&63)+(typeof K!="undefined"?E.charAt(ae>>>6&63):"=")+(typeof G!="undefined"?E.charAt(ae&63):"=")}return B?n(H):H});var h=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,T=function(P){switch(P.length){case 4:var B=(7&P.charCodeAt(0))<<18|(63&P.charCodeAt(1))<<12|(63&P.charCodeAt(2))<<6|63&P.charCodeAt(3),H=B-65536;return v((H>>>10)+55296)+v((H&1023)+56320);case 3:return v((15&P.charCodeAt(0))<<12|(63&P.charCodeAt(1))<<6|63&P.charCodeAt(2));default:return v((31&P.charCodeAt(0))<<6|63&P.charCodeAt(1))}},g=function(P){return P.replace(h,T)},w=function(P){var B=P.length,H=B%4,F=(B>0?y[P.charAt(0)]<<18:0)|(B>1?y[P.charAt(1)]<<12:0)|(B>2?y[P.charAt(2)]<<6:0)|(B>3?y[P.charAt(3)]:0),W=[v(F>>>16),v(F>>>8&255),v(F&255)];return W.length-=[0,0,2,1][H],W.join("")},C=R.atob&&typeof R.atob=="function"?function(P){return R.atob(P)}:function(P){return P.replace(/\S{1,4}/g,w)},x=function(P){return C(String(P).replace(/[^A-Za-z0-9\+\/]/g,""))},b=function(P){return g(C(P))},S=function(P){return String(P).replace(/[-_]/g,function(B){return B=="-"?"+":"/"}).replace(/[^A-Za-z0-9\+\/]/g,"")},A=function(P){return b(S(P))},p;R.Uint8Array&&(p=function(P){return Uint8Array.from(x(S(P)),function(B){return B.charCodeAt(0)})});var I=function(){var P=R.Base64;return R.Base64=O,P};if(R.Base64={VERSION:d,atob:x,btoa:l,fromBase64:A,toBase64:o,utob:c,encode:o,encodeURI:i,btou:g,decode:A,noConflict:I,fromUint8Array:f,toUint8Array:p},typeof Object.defineProperty=="function"){var M=function(P){return{value:P,enumerable:!1,writable:!0,configurable:!0}};R.Base64.extendString=function(){Object.defineProperty(String.prototype,"fromBase64",M(function(){return A(this)})),Object.defineProperty(String.prototype,"toBase64",M(function(P){return o(this,P)})),Object.defineProperty(String.prototype,"toBase64URI",M(function(){return o(this,!0)}))}}return R.Meteor&&(Base64=R.Base64),Je.exports?Je.exports.Base64=R.Base64:!(k=[],D=function(){return R.Base64}.apply(le,k),D!==void 0&&(Je.exports=D)),{Base64:R.Base64}})}).call(this,re("IyRk"))},JSwD:function(Je,le,re){"use strict";function j(n){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?j=function(i){return typeof i}:j=function(i){return i&&typeof Symbol=="function"&&i.constructor===Symbol&&i!==Symbol.prototype?"symbol":typeof i},j(n)}Object.defineProperty(le,"__esModule",{value:!0}),le.default=r;var k=R(re("6BzB"));function D(){if(typeof WeakMap!="function")return null;var n=new WeakMap;return D=function(){return n},n}function R(n){if(n&&n.__esModule)return n;if(n===null||j(n)!=="object"&&typeof n!="function")return{default:n};var o=D();if(o&&o.has(n))return o.get(n);var i={},f=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var h in n)if(Object.prototype.hasOwnProperty.call(n,h)){var T=f?Object.getOwnPropertyDescriptor(n,h):null;T&&(T.get||T.set)?Object.defineProperty(i,h,T):i[h]=n[h]}return i.default=n,o&&o.set(n,i),i}var O=15,d=852,E=592,y=0,v=1,u=2,a=[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],c=[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],s=[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],l=[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 r(n,o,i,f,h,T,g,w){var C=w.bits,x=0,b=0,S=0,A=0,p=0,I=0,M=0,P=0,B=0,H=0,F,W,U,K,G,ae=null,fe=0,Se,Ue=new k.Buf16(O+1),Ne=new k.Buf16(O+1),xe=null,Ce=0,De,ve,Re;for(x=0;x<=O;x++)Ue[x]=0;for(b=0;b<f;b++)Ue[o[i+b]]++;for(p=C,A=O;A>=1&&!(Ue[A]!==0);A--);if(p>A&&(p=A),A===0)return h[T++]=1<<24|64<<16|0,h[T++]=1<<24|64<<16|0,w.bits=1,0;for(S=1;S<A&&!(Ue[S]!==0);S++);for(p<S&&(p=S),P=1,x=1;x<=O;x++)if(P<<=1,P-=Ue[x],P<0)return-1;if(P>0&&(n===y||A!==1))return-1;for(Ne[1]=0,x=1;x<O;x++)Ne[x+1]=Ne[x]+Ue[x];for(b=0;b<f;b++)o[i+b]!==0&&(g[Ne[o[i+b]]++]=b);if(n===y?(ae=xe=g,Se=19):n===v?(ae=a,fe-=257,xe=c,Ce-=257,Se=256):(ae=s,xe=l,Se=-1),H=0,b=0,x=S,G=T,I=p,M=0,U=-1,B=1<<p,K=B-1,n===v&&B>d||n===u&&B>E)return 1;for(;;){De=x-M,g[b]<Se?(ve=0,Re=g[b]):g[b]>Se?(ve=xe[Ce+g[b]],Re=ae[fe+g[b]]):(ve=32+64,Re=0),F=1<<x-M,W=1<<I,S=W;do W-=F,h[G+(H>>M)+W]=De<<24|ve<<16|Re|0;while(W!==0);for(F=1<<x-1;H&F;)F>>=1;if(F!==0?(H&=F-1,H+=F):H=0,b++,--Ue[x]===0){if(x===A)break;x=o[i+g[b]]}if(x>p&&(H&K)!==U){for(M===0&&(M=p),G+=S,I=x-M,P=1<<I;I+M<A&&!(P-=Ue[I+M],P<=0);)I++,P<<=1;if(B+=1<<I,n===v&&B>d||n===u&&B>E)return 1;U=H&K,h[U]=p<<24|I<<16|G-T|0}}return H!==0&&(h[G+H]=x-M<<24|64<<16|0),w.bits=p,0}},LCi9:function(Je,le,re){"use strict";Object.defineProperty(le,"__esModule",{value:!0}),le.default=void 0;function j(h,T){if(!(h instanceof T))throw new TypeError("Cannot call a class as a function")}function k(h,T){for(var g=0;g<T.length;g++){var w=T[g];w.enumerable=w.enumerable||!1,w.configurable=!0,"value"in w&&(w.writable=!0),Object.defineProperty(h,w.key,w)}}function D(h,T,g){return T&&k(h.prototype,T),g&&k(h,g),h}var R=0,O=1,d=2,E=4,y=8,v=16,u=32,a=64,c=127,s=50,l=90,r=250,n=1e3,o=1e3,i=50,f=function(){function h(){j(this,h),this._target=null,this._state=c,this._tracked=[],this._ignored=[],this._waitingRelease=!1,this._releaseStart=0,this._longpressTimeoutId=null,this._twoTouchTimeoutId=null,this._boundEventHandler=this._eventHandler.bind(this)}return D(h,[{key:"attach",value:function(g){this.detach(),this._target=g,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(g){var w;g.stopPropagation(),g.preventDefault();switch(g.type){case"touchstart":w=this._touchStart;break;case"touchmove":w=this._touchMove;break;case"touchend":case"touchcancel":w=this._touchEnd;break}for(var C=0;C<g.changedTouches.length;C++){var x=g.changedTouches[C];w.call(this,x.identifier,x.clientX,x.clientY)}}},{key:"_touchStart",value:function(g,w,C){if(this._hasDetectedGesture()||this._state===R){this._ignored.push(g);return}if(this._tracked.length>0&&Date.now()-this._tracked[0].started>r){this._state=R,this._ignored.push(g);return}if(this._waitingRelease){this._state=R,this._ignored.push(g);return}this._tracked.push({id:g,started:Date.now(),active:!0,firstX:w,firstY:C,lastX:w,lastY:C,angle:0});switch(this._tracked.length){case 1:this._startLongpressTimeout();break;case 2:this._state&=~(O|y|v),this._stopLongpressTimeout();break;case 3:this._state&=~(d|u|a);break;default:this._state=R}}},{key:"_touchMove",value:function(g,w,C){var x=this._tracked.find(function(M){return M.id===g});if(x===void 0)return;x.lastX=w,x.lastY=C;var b=w-x.firstX,S=C-x.firstY;if((x.firstX!==x.lastX||x.firstY!==x.lastY)&&(x.angle=Math.atan2(S,b)*180/Math.PI),!this._hasDetectedGesture()){if(Math.hypot(b,S)<s)return;if(this._state&=~(O|d|E|v),this._stopLongpressTimeout(),this._tracked.length!==1&&(this._state&=~y),this._tracked.length!==2&&(this._state&=~(u|a)),this._tracked.length===2){var A=this._tracked.find(function(M){return M.id!==g}),p=Math.hypot(A.firstX-A.lastX,A.firstY-A.lastY);if(p>s){var I=Math.abs(x.angle-A.angle);I=Math.abs((I+180)%360-180),I>l?this._state&=~u:this._state&=~a,this._isTwoTouchTimeoutRunning()&&this._stopTwoTouchTimeout()}else this._isTwoTouchTimeoutRunning()||this._startTwoTouchTimeout()}if(!this._hasDetectedGesture())return;this._pushEvent("gesturestart")}this._pushEvent("gesturemove")}},{key:"_touchEnd",value:function(g,w,C){if(this._ignored.indexOf(g)!==-1){this._ignored.splice(this._ignored.indexOf(g),1),this._ignored.length===0&&this._tracked.length===0&&(this._state=c,this._waitingRelease=!1);return}if(!this._hasDetectedGesture()&&this._isTwoTouchTimeoutRunning()&&(this._stopTwoTouchTimeout(),this._state=R),!this._hasDetectedGesture()&&(this._state&=~(y|u|a),this._state&=~v,this._stopLongpressTimeout(),!this._waitingRelease)){this._releaseStart=Date.now(),this._waitingRelease=!0;switch(this._tracked.length){case 1:this._state&=~(d|E);break;case 2:this._state&=~(O|E);break}}if(this._waitingRelease){Date.now()-this._releaseStart>r&&(this._state=R),this._tracked.some(function(S){return Date.now()-S.started>n})&&(this._state=R);var x=this._tracked.find(function(S){return S.id===g});if(x.active=!1,this._hasDetectedGesture())this._pushEvent("gesturestart");else if(this._state!==R)return}this._hasDetectedGesture()&&this._pushEvent("gestureend");for(var b=0;b<this._tracked.length;b++)this._tracked[b].active&&this._ignored.push(this._tracked[b].id);this._tracked=[],this._state=R,this._ignored.indexOf(g)!==-1&&this._ignored.splice(this._ignored.indexOf(g),1),this._ignored.length===0&&(this._state=c,this._waitingRelease=!1)}},{key:"_hasDetectedGesture",value:function(){return this._state===R||this._state&this._state-1?!1:!(this._state&(O|d|E)&&this._tracked.some(function(g){return g.active}))}},{key:"_startLongpressTimeout",value:function(){var g=this;this._stopLongpressTimeout(),this._longpressTimeoutId=setTimeout(function(){return g._longpressTimeout()},o)}},{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=v,this._pushEvent("gesturestart")}},{key:"_startTwoTouchTimeout",value:function(){var g=this;this._stopTwoTouchTimeout(),this._twoTouchTimeoutId=setTimeout(function(){return g._twoTouchTimeout()},i)}},{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 g=this._getAverageMovement(),w=Math.abs(g.x),C=Math.abs(g.y),x=this._getAverageDistance(),b=Math.abs(Math.hypot(x.first.x,x.first.y)-Math.hypot(x.last.x,x.last.y));C<b&&w<b?this._state=a:this._state=u,this._pushEvent("gesturestart"),this._pushEvent("gesturemove")}},{key:"_pushEvent",value:function(g){var w={type:this._stateToGesture(this._state)},C=this._getPosition(),x=C.last;g==="gesturestart"&&(x=C.first);switch(this._state){case u:case a:x=C.first;break}if(w.clientX=x.x,w.clientY=x.y,this._state===a){var b=this._getAverageDistance();g==="gesturestart"?(w.magnitudeX=b.first.x,w.magnitudeY=b.first.y):(w.magnitudeX=b.last.x,w.magnitudeY=b.last.y)}else if(this._state===u)if(g==="gesturestart")w.magnitudeX=0,w.magnitudeY=0;else{var S=this._getAverageMovement();w.magnitudeX=S.x,w.magnitudeY=S.y}var A=new CustomEvent(g,{detail:w});this._target.dispatchEvent(A)}},{key:"_stateToGesture",value:function(g){switch(g){case O:return"onetap";case d:return"twotap";case E:return"threetap";case y:return"drag";case v:return"longpress";case u:return"twodrag";case a:return"pinch"}throw new Error("Unknown gesture state: "+g)}},{key:"_getPosition",value:function(){if(this._tracked.length===0)throw new Error("Failed to get gesture position, no tracked touches");for(var g=this._tracked.length,w=0,C=0,x=0,b=0,S=0;S<this._tracked.length;S++)w+=this._tracked[S].firstX,C+=this._tracked[S].firstY,x+=this._tracked[S].lastX,b+=this._tracked[S].lastY;return{first:{x:w/g,y:C/g},last:{x:x/g,y:b/g}}}},{key:"_getAverageMovement",value:function(){if(this._tracked.length===0)throw new Error("Failed to get gesture movement, no tracked touches");var g,w;g=w=0;for(var C=this._tracked.length,x=0;x<this._tracked.length;x++)g+=this._tracked[x].lastX-this._tracked[x].firstX,w+=this._tracked[x].lastY-this._tracked[x].firstY;return{x:g/C,y:w/C}}},{key:"_getAverageDistance",value:function(){if(this._tracked.length===0)throw new Error("Failed to get gesture distance, no tracked touches");var g=this._tracked[0],w=this._tracked[this._tracked.length-1],C=Math.abs(w.firstX-g.firstX),x=Math.abs(w.firstY-g.firstY),b=Math.abs(w.lastX-g.lastX),S=Math.abs(w.lastY-g.lastY);return{first:{x:C,y:x},last:{x:b,y:S}}}}]),h}();le.default=f},LdHM:function(Je,le,re){"use strict";re.d(le,"b",function(){return h}),re.d(le,"a",function(){return g});var j=re("1OyB"),k=re("vuIU"),D=re("Ji7U"),R=re("LK+K"),O=re("cDcd"),d=re("rePB"),E=re("Ff2n"),y=re("ODXe"),v=re("4IlW"),u=re("bX4T"),a=re("YrtM"),c=re("TSYQ"),s=re.n(c),l=re("+nKL"),r=re("8OUc"),n=function(G,ae){var fe=G.prefixCls,Se=G.id,Ue=G.flattenOptions,Ne=G.childrenAsData,xe=G.values,Ce=G.searchValue,De=G.multiple,ve=G.defaultActiveFirstOption,Re=G.height,ee=G.itemHeight,ge=G.notFoundContent,se=G.open,Fe=G.menuItemSelectedIcon,je=G.virtual,Ke=G.onSelect,ze=G.onToggleOpen,Ge=G.onActiveValue,He=G.onScroll,Ie=G.onMouseEnter,ke="".concat(fe,"-item"),Ae=Object(a.a)(function(){return Ue},[se,Ue],function(Oe,me){return me[0]&&Oe[1]!==me[1]}),Te=O.useRef(null),Z=function(me){me.preventDefault()},ce=function(me){Te.current&&Te.current.scrollTo({index:me})},J=function(me){for(var ue=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,he=Ae.length,Y=0;Y<he;Y+=1){var $=(me+Y*ue+he)%he,z=Ae[$],oe=z.group,_e=z.data;if(!oe&&!_e.disabled)return $}return-1},Le=O.useState(function(){return J(0)}),We=Object(y.a)(Le,2),Ve=We[0],Me=We[1],et=function(me){Me(me);var ue=Ae[me];if(!ue){Ge(null,-1);return}Ge(ue.data.value,me)};O.useEffect(function(){et(ve!==!1?J(0):-1)},[Ae.length,Ce]),O.useEffect(function(){var Oe=setTimeout(function(){if(!De&&se&&xe.size===1){var me=Array.from(xe)[0],ue=Ae.findIndex(function(he){var Y=he.data;return Y.value===me});et(ue),ce(ue)}});return function(){return clearTimeout(Oe)}},[se]);var ne=function(me){me!==void 0&&Ke(me,{selected:!xe.has(me)}),De||ze(!1)};if(O.useImperativeHandle(ae,function(){return{onKeyDown:function(me){var ue=me.which;switch(ue){case v.a.UP:case v.a.DOWN:{var he=0;if(ue===v.a.UP?he=-1:ue===v.a.DOWN&&(he=1),he!==0){var Y=J(Ve+he,he);ce(Y),et(Y)}break}case v.a.ENTER:{var $=Ae[Ve];$&&!$.data.disabled?ne($.data.value):ne(void 0),se&&me.preventDefault();break}case v.a.ESC:ze(!1)}},onKeyUp:function(){},scrollTo:function(me){ce(me)}}}),Ae.length===0)return O.createElement("div",{role:"listbox",id:"".concat(Se,"_list"),className:"".concat(ke,"-empty"),onMouseDown:Z},ge);function Ee(Oe){var me=Ae[Oe];if(!me)return null;var ue=me.data||{},he=ue.value,Y=ue.label,$=ue.children,z=Object(u.a)(ue,!0),oe=Ne?$:Y;return me?O.createElement("div",Object.assign({"aria-label":typeof oe=="string"?oe:null},z,{key:Oe,role:"option",id:"".concat(Se,"_list_").concat(Oe),"aria-selected":xe.has(he)}),he):null}return O.createElement(O.Fragment,null,O.createElement("div",{role:"listbox",id:"".concat(Se,"_list"),style:{height:0,width:0,overflow:"hidden"}},Ee(Ve-1),Ee(Ve),Ee(Ve+1)),O.createElement(l.a,{itemKey:"key",ref:Te,data:Ae,height:Re,itemHeight:ee,fullHeight:!1,onMouseDown:Z,onScroll:He,virtual:je,onMouseEnter:Ie},function(Oe,me){var ue,he=Oe.group,Y=Oe.groupOption,$=Oe.data,z=$.label,oe=$.key;if(he)return O.createElement("div",{className:s()(ke,"".concat(ke,"-group"))},z!==void 0?z:oe);var _e=$.disabled,X=$.value,de=$.title,ye=$.children,ie=$.style,pe=$.className,Pe=Object(E.a)($,["disabled","value","title","children","style","className"]),$e=xe.has(X),Ye="".concat(ke,"-option"),qe=s()(ke,Ye,pe,(ue={},Object(d.a)(ue,"".concat(Ye,"-grouped"),Y),Object(d.a)(ue,"".concat(Ye,"-active"),Ve===me&&!_e),Object(d.a)(ue,"".concat(Ye,"-disabled"),_e),Object(d.a)(ue,"".concat(Ye,"-selected"),$e),ue)),st=Ne?ye:z,mt=!Fe||typeof Fe=="function"||$e;return O.createElement("div",Object.assign({},Pe,{"aria-selected":$e,className:qe,title:de,onMouseMove:function(){if(Ve===me||_e)return;et(me)},onClick:function(){_e||ne(X)},style:ie}),O.createElement("div",{className:"".concat(Ye,"-content")},st||X),O.isValidElement(Fe)||$e,mt&&O.createElement(r.a,{className:"".concat(ke,"-option-state"),customizeIcon:Fe,customizeIconProps:{isSelected:$e}},$e?"\u2713":null))}))},o=O.forwardRef(n);o.displayName="OptionList";var i=o,f=function(){return null};f.isSelectOption=!0;var h=f,T=function(){return null};T.isSelectOptGroup=!0;var g=T,w=re("VTBJ"),C=re("Zm9Q");function x(K){var G=K.key,ae=K.props,fe=ae.children,Se=ae.value,Ue=Object(E.a)(ae,["children","value"]);return Object(w.a)({key:G,value:Se!==void 0?Se:G,children:fe},Ue)}function b(K){var G=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Object(C.a)(K).map(function(ae,fe){if(!O.isValidElement(ae)||!ae.type)return null;var Se=ae.type.isSelectOptGroup,Ue=ae.key,Ne=ae.props,xe=Ne.children,Ce=Object(E.a)(Ne,["children"]);return G||!Se?x(ae):Object(w.a)(Object(w.a)({key:"__RC_SELECT_GRP__".concat(Ue===null?fe:Ue,"__"),label:Ue},Ce),{},{options:b(xe)})}).filter(function(ae){return ae})}var S=re("2Qr1"),A=re("qNPg"),p=re("U8pU"),I=re("Kwbf"),M=re("WKfj");function P(K){var G=K.mode,ae=K.options,fe=K.children,Se=K.backfill,Ue=K.allowClear,Ne=K.placeholder,xe=K.getInputElement,Ce=K.showSearch,De=K.onSearch,ve=K.defaultOpen,Re=K.autoFocus,ee=K.labelInValue,ge=K.value,se=K.inputValue,Fe=K.optionLabelProp,je=G==="multiple"||G==="tags",Ke=Ce!==void 0?Ce:je||G==="combobox",ze=ae||b(fe);if(Object(I.a)(G!=="tags"||ze.every(function(ke){return!ke.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),G==="tags"||G==="combobox"){var Ge=ze.some(function(ke){return ke.options?ke.options.some(function(Ae){return typeof("value"in Ae?Ae.value:Ae.key)=="number"}):typeof("value"in ke?ke.value:ke.key)=="number"});Object(I.a)(!Ge,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(I.a)(G!=="combobox"||!Fe,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(I.a)(G==="combobox"||!Se,"`backfill` only works with `combobox` mode."),Object(I.a)(G==="combobox"||!xe,"`getInputElement` only work with `combobox` mode."),Object(I.b)(G!=="combobox"||!xe||!Ue||!Ne,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),De&&!Ke&&G!=="combobox"&&G!=="tags"&&Object(I.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(I.b)(!ve||Re,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),ge!=null){var He=Object(M.d)(ge);Object(I.a)(!ee||He.every(function(ke){return Object(p.a)(ke)==="object"&&("key"in ke||"value"in ke)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),Object(I.a)(!je||Array.isArray(ge),"`value` should be array when `mode` is `multiple` or `tags`")}if(fe){var Ie=null;Object(C.a)(fe).some(function(ke){if(!O.isValidElement(ke)||!ke.type)return!1;var Ae=ke.type;if(Ae.isSelectOption)return!1;if(Ae.isSelectOptGroup){var Te=Object(C.a)(ke.props.children).every(function(Z){return!O.isValidElement(Z)||!ke.type||Z.type.isSelectOption?!0:(Ie=Z.type,!1)});return!Te}return Ie=Ae,!0}),Ie&&Object(I.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(Ie.displayName||Ie.name||Ie,"`.")),Object(I.a)(se===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}var B=P,H=Object(A.a)({prefixCls:"rc-select",components:{optionList:i},convertChildrenToData:b,flattenOptions:S.d,getLabeledValue:S.e,filterOptions:S.b,isValueDisabled:S.g,findValueOption:S.c,warningProps:B,fillOptionsWithMissingValue:S.a}),F=function(K){Object(D.a)(ae,K);var G=Object(R.a)(ae);function ae(){var fe;return Object(j.a)(this,ae),fe=G.apply(this,arguments),fe.selectRef=O.createRef(),fe.focus=function(){fe.selectRef.current.focus()},fe.blur=function(){fe.selectRef.current.blur()},fe}return Object(k.a)(ae,[{key:"render",value:function(){return O.createElement(H,Object.assign({ref:this.selectRef},this.props))}}]),ae}(O.Component);F.Option=h,F.OptGroup=g;var W=F,U=le.c=W},Lmeb:function(Je,le,re){},Lo0S:function(Je,le,re){"use strict";Object.defineProperty(le,"__esModule",{value:!0}),le.initLogging=d,le.getLogging=E,le.Error=le.Warn=le.Info=le.Debug=void 0;var j="warn",k=function(){};le.Debug=k;var D=function(){};le.Info=D;var R=function(){};le.Warn=R;var O=function(){};le.Error=O;function d(y){if(typeof y=="undefined"?y=j:j=y,le.Debug=k=le.Info=D=le.Warn=R=le.Error=O=function(){},typeof window.console!="undefined")switch(y){case"debug":le.Debug=k=console.debug.bind(window.console);case"info":le.Info=D=console.info.bind(window.console);case"warn":le.Warn=R=console.warn.bind(window.console);case"error":le.Error=O=console.error.bind(window.console);case"none":break;default:throw new window.Error("invalid logging type '"+y+"'")}}function E(){return j}d()},M8RZ:function(Je,le,re){"use strict";re.d(le,"a",function(){return v});var j=re("fWQN"),k=re("mtLc"),D=re("yKVA"),R=re("879j"),O=re("cDcd"),d=re.n(O),E=re("faye"),y=re.n(E),v=function(u){Object(D.a)(c,u);var a=Object(R.a)(c);function c(s){var l;Object(j.a)(this,c),l=a.call(this,s);var r=window.document;return l.node=r.createElement("div"),r.body.appendChild(l.node),l}return Object(k.a)(c,[{key:"render",value:function(){var l=this.props.children;return Object(E.createPortal)(l,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),c}(d.a.Component)},MZdM:function(Je,le,re){"use strict";function j(s){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?j=function(r){return typeof r}:j=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},j(s)}Object.defineProperty(le,"__esModule",{value:!0}),le.default=void 0;var k=y(re("Lo0S")),D=d(re("N/zr")),R=re("GdRQ"),O=re("GQ8N");function d(s){return s&&s.__esModule?s:{default:s}}function E(){if(typeof WeakMap!="function")return null;var s=new WeakMap;return E=function(){return s},s}function y(s){if(s&&s.__esModule)return s;if(s===null||j(s)!=="object"&&typeof s!="function")return{default:s};var l=E();if(l&&l.has(s))return l.get(s);var r={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in s)if(Object.prototype.hasOwnProperty.call(s,o)){var i=n?Object.getOwnPropertyDescriptor(s,o):null;i&&(i.get||i.set)?Object.defineProperty(r,o,i):r[o]=s[o]}return r.default=s,l&&l.set(s,r),r}function v(s,l){if(!(s instanceof l))throw new TypeError("Cannot call a class as a function")}function u(s,l){for(var r=0;r<l.length;r++){var n=l[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(s,n.key,n)}}function a(s,l,r){return l&&u(s.prototype,l),r&&u(s,r),s}var c=function(){function s(l){if(v(this,s),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,k.Debug(">> Display.constructor"),this._target=l,!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},k.Debug("User Agent: "+navigator.userAgent),!("createImageData"in this._drawCtx))throw new Error("Canvas does not support createImageData");this._tile16x16=this._drawCtx.createImageData(16,16),k.Debug("<< Display.constructor"),this._scale=1,this._clipViewport=!1,this.onflush=function(){}}return a(s,[{key:"viewportChangePos",value:function(r,n){var o=this._viewportLoc;r=Math.floor(r),n=Math.floor(n),this._clipViewport||(r=-o.w,n=-o.h);var i=o.x+o.w-1,f=o.y+o.h-1;if(r<0&&o.x+r<0&&(r=-o.x),i+r>=this._fbWidth&&(r-=i+r-this._fbWidth+1),o.y+n<0&&(n=-o.y),f+n>=this._fbHeight&&(n-=f+n-this._fbHeight+1),r===0&&n===0)return;k.Debug("viewportChange deltaX: "+r+", deltaY: "+n),o.x+=r,o.y+=n,this._damage(o.x,o.y,o.w,o.h),this.flip()}},{key:"viewportChangeSize",value:function(r,n){(!this._clipViewport||typeof r=="undefined"||typeof n=="undefined")&&(k.Debug("Setting viewport to full display region"),r=this._fbWidth,n=this._fbHeight),r=Math.floor(r),n=Math.floor(n),r>this._fbWidth&&(r=this._fbWidth),n>this._fbHeight&&(n=this._fbHeight);var o=this._viewportLoc;if(o.w!==r||o.h!==n){o.w=r,o.h=n;var i=this._target;i.width=r,i.height=n,this.viewportChangePos(0,0),this._damage(o.x,o.y,o.w,o.h),this.flip(),this._rescale(this._scale)}}},{key:"absX",value:function(r){return this._scale===0?0:(0,O.toSigned32bit)(r/this._scale+this._viewportLoc.x)}},{key:"absY",value:function(r){return this._scale===0?0:(0,O.toSigned32bit)(r/this._scale+this._viewportLoc.y)}},{key:"resize",value:function(r,n){this._prevDrawStyle="",this._fbWidth=r,this._fbHeight=n;var o=this._backbuffer;if(o.width!==r||o.height!==n){var i=null;o.width>0&&o.height>0&&(i=this._drawCtx.getImageData(0,0,o.width,o.height)),o.width!==r&&(o.width=r),o.height!==n&&(o.height=n),i&&this._drawCtx.putImageData(i,0,0)}var f=this._viewportLoc;this.viewportChangeSize(f.w,f.h),this.viewportChangePos(0,0)}},{key:"_damage",value:function(r,n,o,i){r<this._damageBounds.left&&(this._damageBounds.left=r),n<this._damageBounds.top&&(this._damageBounds.top=n),r+o>this._damageBounds.right&&(this._damageBounds.right=r+o),n+i>this._damageBounds.bottom&&(this._damageBounds.bottom=n+i)}},{key:"flip",value:function(r){if(this._renderQ.length!==0&&!r)this._renderQPush({type:"flip"});else{var n=this._damageBounds.left,o=this._damageBounds.top,i=this._damageBounds.right-n,f=this._damageBounds.bottom-o,h=n-this._viewportLoc.x,T=o-this._viewportLoc.y;h<0&&(i+=h,n-=h,h=0),T<0&&(f+=T,o-=T,T=0),h+i>this._viewportLoc.w&&(i=this._viewportLoc.w-h),T+f>this._viewportLoc.h&&(f=this._viewportLoc.h-T),i>0&&f>0&&this._targetCtx.drawImage(this._backbuffer,n,o,i,f,h,T,i,f),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(r,n,o,i,f,h){this._renderQ.length!==0&&!h?this._renderQPush({type:"fill",x:r,y:n,width:o,height:i,color:f}):(this._setFillColor(f),this._drawCtx.fillRect(r,n,o,i),this._damage(r,n,o,i))}},{key:"copyImage",value:function(r,n,o,i,f,h,T){this._renderQ.length!==0&&!T?this._renderQPush({type:"copy",oldX:r,oldY:n,x:o,y:i,width:f,height:h}):(this._drawCtx.mozImageSmoothingEnabled=!1,this._drawCtx.webkitImageSmoothingEnabled=!1,this._drawCtx.msImageSmoothingEnabled=!1,this._drawCtx.imageSmoothingEnabled=!1,this._drawCtx.drawImage(this._backbuffer,r,n,f,h,o,i,f,h),this._damage(o,i,f,h))}},{key:"imageRect",value:function(r,n,o,i,f,h){if(o===0||i===0)return;var T=new Image;T.src="data: "+f+";base64,"+D.default.encode(h),this._renderQPush({type:"img",img:T,x:r,y:n,width:o,height:i})}},{key:"startTile",value:function(r,n,o,i,f){this._tileX=r,this._tileY=n,o===16&&i===16?this._tile=this._tile16x16:this._tile=this._drawCtx.createImageData(o,i);for(var h=f[2],T=f[1],g=f[0],w=this._tile.data,C=0;C<o*i*4;C+=4)w[C]=h,w[C+1]=T,w[C+2]=g,w[C+3]=255}},{key:"subTile",value:function(r,n,o,i,f){for(var h=f[2],T=f[1],g=f[0],w=r+o,C=n+i,x=this._tile.data,b=this._tile.width,S=n;S<C;S++)for(var A=r;A<w;A++){var p=(A+S*b)*4;x[p]=h,x[p+1]=T,x[p+2]=g,x[p+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(r,n,o,i,f,h,T){if(this._renderQ.length!==0&&!T){var g=new Uint8Array(o*i*4);g.set(new Uint8Array(f.buffer,0,g.length)),this._renderQPush({type:"blit",data:g,x:r,y:n,width:o,height:i})}else this._bgrxImageData(r,n,o,i,f,h)}},{key:"blitRgbImage",value:function(r,n,o,i,f,h,T){if(this._renderQ.length!==0&&!T){var g=new Uint8Array(o*i*3);g.set(new Uint8Array(f.buffer,0,g.length)),this._renderQPush({type:"blitRgb",data:g,x:r,y:n,width:o,height:i})}else this._rgbImageData(r,n,o,i,f,h)}},{key:"blitRgbxImage",value:function(r,n,o,i,f,h,T){if(this._renderQ.length!==0&&!T){var g=new Uint8Array(o*i*4);g.set(new Uint8Array(f.buffer,0,g.length)),this._renderQPush({type:"blitRgbx",data:g,x:r,y:n,width:o,height:i})}else this._rgbxImageData(r,n,o,i,f,h)}},{key:"drawImage",value:function(r,n,o){this._drawCtx.drawImage(r,n,o),this._damage(n,o,r.width,r.height)}},{key:"autoscale",value:function(r,n){var o;if(r===0||n===0)o=0;else{var i=this._viewportLoc,f=r/n,h=i.w/i.h;h>=f?o=r/i.w:o=n/i.h}this._rescale(o)}},{key:"_rescale",value:function(r){this._scale=r;var n=this._viewportLoc,o=r*n.w+"px",i=r*n.h+"px";(this._target.style.width!==o||this._target.style.height!==i)&&(this._target.style.width=o,this._target.style.height=i)}},{key:"_setFillColor",value:function(r){var n="rgb("+r[2]+","+r[1]+","+r[0]+")";n!==this._prevDrawStyle&&(this._drawCtx.fillStyle=n,this._prevDrawStyle=n)}},{key:"_rgbImageData",value:function(r,n,o,i,f,h){for(var T=this._drawCtx.createImageData(o,i),g=T.data,w=0,C=h;w<o*i*4;w+=4,C+=3)g[w]=f[C],g[w+1]=f[C+1],g[w+2]=f[C+2],g[w+3]=255;this._drawCtx.putImageData(T,r,n),this._damage(r,n,T.width,T.height)}},{key:"_bgrxImageData",value:function(r,n,o,i,f,h){for(var T=this._drawCtx.createImageData(o,i),g=T.data,w=0,C=h;w<o*i*4;w+=4,C+=4)g[w]=f[C+2],g[w+1]=f[C+1],g[w+2]=f[C],g[w+3]=255;this._drawCtx.putImageData(T,r,n),this._damage(r,n,T.width,T.height)}},{key:"_rgbxImageData",value:function(r,n,o,i,f,h){var T;R.supportsImageMetadata?T=new ImageData(new Uint8ClampedArray(f.buffer,f.byteOffset,o*i*4),o,i):(T=this._drawCtx.createImageData(o,i),T.data.set(new Uint8ClampedArray(f.buffer,f.byteOffset,o*i*4))),this._drawCtx.putImageData(T,r,n),this._damage(r,n,T.width,T.height)}},{key:"_renderQPush",value:function(r){this._renderQ.push(r),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 r=!0;r&&this._renderQ.length>0;){var n=this._renderQ[0];switch(n.type){case"flip":this.flip(!0);break;case"copy":this.copyImage(n.oldX,n.oldY,n.x,n.y,n.width,n.height,!0);break;case"fill":this.fillRect(n.x,n.y,n.width,n.height,n.color,!0);break;case"blit":this.blitImage(n.x,n.y,n.width,n.height,n.data,0,!0);break;case"blitRgb":this.blitRgbImage(n.x,n.y,n.width,n.height,n.data,0,!0);break;case"blitRgbx":this.blitRgbxImage(n.x,n.y,n.width,n.height,n.data,0,!0);break;case"img":if(n.img.complete&&n.img.width!==0&&n.img.height!==0){if(n.img.width!==n.width||n.img.height!==n.height){k.Error("Decoded image has incorrect dimensions. Got "+n.img.width+"x"+n.img.height+". Expected "+n.width+"x"+n.height+".");return}this.drawImage(n.img,n.x,n.y)}else n.img._noVNCDisplay=this,n.img.addEventListener("load",this._resumeRenderQ),r=!1;break}r&&this._renderQ.shift()}this._renderQ.length===0&&this._flushing&&(this._flushing=!1,this.onflush())}},{key:"scale",get:function(){return this._scale},set:function(r){this._rescale(r)}},{key:"clipViewport",get:function(){return this._clipViewport},set:function(r){this._clipViewport=r;var n=this._viewportLoc;this.viewportChangeSize(n.w,n.h),this.viewportChangePos(0,0)}},{key:"width",get:function(){return this._fbWidth}},{key:"height",get:function(){return this._fbHeight}}]),s}();le.default=c},Mmt2:function(Je,le,re){"use strict";function j(a){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?j=function(s){return typeof s}:j=function(s){return s&&typeof Symbol=="function"&&s.constructor===Symbol&&s!==Symbol.prototype?"symbol":typeof s},j(a)}Object.defineProperty(le,"__esModule",{value:!0}),le.default=void 0;var k=R(re("Lo0S"));function D(){if(typeof WeakMap!="function")return null;var a=new WeakMap;return D=function(){return a},a}function R(a){if(a&&a.__esModule)return a;if(a===null||j(a)!=="object"&&typeof a!="function")return{default:a};var c=D();if(c&&c.has(a))return c.get(a);var s={},l=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var r in a)if(Object.prototype.hasOwnProperty.call(a,r)){var n=l?Object.getOwnPropertyDescriptor(a,r):null;n&&(n.get||n.set)?Object.defineProperty(s,r,n):s[r]=a[r]}return s.default=a,c&&c.set(a,s),s}function O(a,c){if(!(a instanceof c))throw new TypeError("Cannot call a class as a function")}function d(a,c){for(var s=0;s<c.length;s++){var l=c[s];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(a,l.key,l)}}function E(a,c,s){return c&&d(a.prototype,c),s&&d(a,s),a}var y=!1,v=40*1024*1024,u=function(){function a(){O(this,a),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(a,[{key:"rQpeek8",value:function(){return this._rQ[this._rQi]}},{key:"rQskipBytes",value:function(s){this._rQi+=s}},{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(s){for(var l=0,r=s-1;r>=0;r--)l+=this._rQ[this._rQi++]<<r*8;return l}},{key:"rQshiftStr",value:function(s){typeof s=="undefined"&&(s=this.rQlen);for(var l="",r=0;r<s;r+=4096){var n=this.rQshiftBytes(Math.min(4096,s-r));l+=String.fromCharCode.apply(null,n)}return l}},{key:"rQshiftBytes",value:function(s){return typeof s=="undefined"&&(s=this.rQlen),this._rQi+=s,new Uint8Array(this._rQ.buffer,this._rQi-s,s)}},{key:"rQshiftTo",value:function(s,l){l===void 0&&(l=this.rQlen),s.set(new Uint8Array(this._rQ.buffer,this._rQi,l)),this._rQi+=l}},{key:"rQslice",value:function(s){var l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.rQlen;return new Uint8Array(this._rQ.buffer,this._rQi+s,l-s)}},{key:"rQwait",value:function(s,l,r){if(this.rQlen<l){if(r){if(this._rQi<r)throw new Error("rQwait cannot backup "+r+" bytes");this._rQi-=r}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(s){this._sQ.set(s,this._sQlen),this._sQlen+=s.length,this.flush()}},{key:"sendString",value:function(s){this.send(s.split("").map(function(l){return l.charCodeAt(0)}))}},{key:"off",value:function(s){this._eventHandlers[s]=function(){}}},{key:"on",value:function(s,l){this._eventHandlers[s]=l}},{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(s,l){var r=this;this.init(),this._websocket=new WebSocket(s,l),this._websocket.binaryType="arraybuffer",this._websocket.onmessage=this._recvMessage.bind(this),this._websocket.onopen=function(){k.Debug(">> WebSock.onopen"),r._websocket.protocol&&k.Info("Server choose sub-protocol: "+r._websocket.protocol),r._eventHandlers.open(),k.Debug("<< WebSock.onopen")},this._websocket.onclose=function(n){k.Debug(">> WebSock.onclose"),r._eventHandlers.close(n),k.Debug("<< WebSock.onclose")},this._websocket.onerror=function(n){k.Debug(">> WebSock.onerror: "+n),r._eventHandlers.error(n),k.Debug("<< WebSock.onerror: "+n)}}},{key:"close",value:function(){this._websocket&&((this._websocket.readyState===WebSocket.OPEN||this._websocket.readyState===WebSocket.CONNECTING)&&(k.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(s){var l=(this._rQlen-this._rQi+s)*8,r=this._rQbufferSize<l;if(r&&(this._rQbufferSize=Math.max(this._rQbufferSize*2,l)),this._rQbufferSize>v&&(this._rQbufferSize=v,this._rQbufferSize-this.rQlen<s))throw new Error("Receive Queue buffer exceeded "+v+" bytes, and the new message could not fit");if(r){var n=this._rQ.buffer;this._rQ=new Uint8Array(this._rQbufferSize),this._rQ.set(new Uint8Array(n,this._rQi,this._rQlen-this._rQi))}else y?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(s){var l=new Uint8Array(s);l.length>this._rQbufferSize-this._rQlen&&this._expandCompactRQ(l.length),this._rQ.set(l,this._rQlen),this._rQlen+=l.length}},{key:"_recvMessage",value:function(s){this._DecodeMessage(s.data),this.rQlen>0?(this._eventHandlers.message(),this._rQlen==this._rQi&&(this._rQlen=0,this._rQi=0)):k.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(s){this._rQi=s}},{key:"rQlen",get:function(){return this._rQlen-this._rQi}}]),a}();le.default=u},"N/zr":function(Je,le,re){"use strict";function j(d){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?j=function(y){return typeof y}:j=function(y){return y&&typeof Symbol=="function"&&y.constructor===Symbol&&y!==Symbol.prototype?"symbol":typeof y},j(d)}Object.defineProperty(le,"__esModule",{value:!0}),le.default=void 0;var k=R(re("Lo0S"));function D(){if(typeof WeakMap!="function")return null;var d=new WeakMap;return D=function(){return d},d}function R(d){if(d&&d.__esModule)return d;if(d===null||j(d)!=="object"&&typeof d!="function")return{default:d};var E=D();if(E&&E.has(d))return E.get(d);var y={},v=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in d)if(Object.prototype.hasOwnProperty.call(d,u)){var a=v?Object.getOwnPropertyDescriptor(d,u):null;a&&(a.get||a.set)?Object.defineProperty(y,u,a):y[u]=d[u]}return y.default=d,E&&E.set(d,y),y}var O={toBase64Table:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".split(""),base64Pad:"=",encode:function(E){"use strict";for(var y="",v=E.length,u=v%3,a=0;a<v-2;a+=3)y+=this.toBase64Table[E[a]>>2],y+=this.toBase64Table[((E[a]&3)<<4)+(E[a+1]>>4)],y+=this.toBase64Table[((E[a+1]&15)<<2)+(E[a+2]>>6)],y+=this.toBase64Table[E[a+2]&63];var c=v-u;return u===2?(y+=this.toBase64Table[E[c]>>2],y+=this.toBase64Table[((E[c]&3)<<4)+(E[c+1]>>4)],y+=this.toBase64Table[(E[c+1]&15)<<2],y+=this.toBase64Table[64]):u===1&&(y+=this.toBase64Table[E[c]>>2],y+=this.toBase64Table[(E[c]&3)<<4],y+=this.toBase64Table[64],y+=this.toBase64Table[64]),y},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 y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,v=E.indexOf("=")-y;v<0&&(v=E.length-y);for(var u=(v>>2)*3+Math.floor(v%4/1.5),a=new Array(u),c=0,s=0,l=0,r=y;r<E.length;r++){var n=this.toBinaryTable[E.charCodeAt(r)&127],o=E.charAt(r)===this.base64Pad;if(n===-1){k.Error("Illegal character code "+E.charCodeAt(r)+" at position "+r);continue}s=s<<6|n,c+=6,c>=8&&(c-=8,o||(a[l++]=s>>c&255),s&=(1<<c)-1)}if(c){var i=new Error("Corrupted base64 string");throw i.name="Base64-Error",i}return a}};le.default=O},NBmB:function(Je,le,re){"use strict";Object.defineProperty(le,"__esModule",{value:!0}),le.encodingName=k,le.encodings=void 0;var j={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};le.encodings=j;function k(D){switch(D){case j.encodingRaw:return"Raw";case j.encodingCopyRect:return"CopyRect";case j.encodingRRE:return"RRE";case j.encodingHextile:return"Hextile";case j.encodingTight:return"Tight";case j.encodingTightPNG:return"TightPNG";default:return"[unknown encoding "+D+"]"}}},OLES:function(Je,le,re){"use strict";var j=re("U8pU"),k=re("VTBJ"),D=re("Ff2n"),R=re("cDcd"),O=re("uciX"),d=re("7ixt"),E=function(s){var l=s.overlay,r=s.prefixCls,n=s.id,o=s.overlayInnerStyle;return R.createElement("div",{className:"".concat(r,"-inner"),id:n,role:"tooltip",style:o},typeof l=="function"?l():l)},y=E,v=function(s,l){var r=s.overlayClassName,n=s.trigger,o=n===void 0?["hover"]:n,i=s.mouseEnterDelay,f=i===void 0?0:i,h=s.mouseLeaveDelay,T=h===void 0?.1:h,g=s.overlayStyle,w=s.prefixCls,C=w===void 0?"rc-tooltip":w,x=s.children,b=s.onVisibleChange,S=s.afterVisibleChange,A=s.transitionName,p=s.animation,I=s.placement,M=I===void 0?"right":I,P=s.align,B=P===void 0?{}:P,H=s.destroyTooltipOnHide,F=H===void 0?!1:H,W=s.defaultVisible,U=s.getTooltipContainer,K=s.overlayInnerStyle,G=Object(D.a)(s,["overlayClassName","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle","prefixCls","children","onVisibleChange","afterVisibleChange","transitionName","animation","placement","align","destroyTooltipOnHide","defaultVisible","getTooltipContainer","overlayInnerStyle"]),ae=Object(R.useRef)(null);Object(R.useImperativeHandle)(l,function(){return ae.current});var fe=Object(k.a)({},G);"visible"in s&&(fe.popupVisible=s.visible);var Se=function(){var De=s.arrowContent,ve=De===void 0?null:De,Re=s.overlay,ee=s.id;return[R.createElement("div",{className:"".concat(C,"-arrow"),key:"arrow"},ve),R.createElement(y,{key:"content",prefixCls:C,id:ee,overlay:Re,overlayInnerStyle:K})]},Ue=!1,Ne=!1;if(typeof F=="boolean")Ue=F;else if(F&&Object(j.a)(F)==="object"){var xe=F.keepParent;Ue=xe===!0,Ne=xe===!1}return R.createElement(O.a,Object.assign({popupClassName:r,prefixCls:C,popup:Se,action:o,builtinPlacements:d.a,popupPlacement:M,ref:ae,popupAlign:B,getPopupContainer:U,onPopupVisibleChange:b,afterPopupVisibleChange:S,popupTransitionName:A,popupAnimation:p,defaultPopupVisible:W,destroyPopupOnHide:Ue,autoDestroy:Ne,mouseLeaveDelay:T,popupStyle:g,mouseEnterDelay:f},fe),x)},u=Object(R.forwardRef)(v),a=le.a=u},Ot1p:function(Je,le,re){"use strict";var j=re("2qtc"),k=re("kLXV"),D=re("rAM+"),R=re("miYZ"),O=re("tsqr"),d=re("9og8"),E=re("tJVT"),y=re("jrin"),v=re("WmNS"),u=re.n(v),a=re("cDcd"),c=re.n(a),s=re("VrN/"),l=re.n(s),r=re("bdgK"),n=re("p77/"),o=re("Bd2K"),i=re("ELLl"),f=re("19Vz"),h=re("lZu9"),T=re("+NIl"),g=re("kSUc"),w=re("9Bee"),C=function(_e){var X=_e.value,de=X===void 0?"":X,ye=_e.className,ie=_e.showTextOnly,pe=_e.showLines,Pe=_e.style,$e=Pe===void 0?{}:Pe,Ye=Object(a.useMemo)(function(){return""},[de]);return c.a.createElement(c.a.Fragment,null,c.a.createElement("div",{dangerouslySetInnerHTML:{__html:Ye}}))},x=re("0Owb"),b=re("dejd"),S=re("C+DQ"),A=re("1vsH"),p=re("m3rI"),I=[{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 M(_e){var X=_e.onActionCallback,de=_e.title,ye=_e.icon,ie=_e.actionName,pe=_e.className,Pe=pe===void 0?"":pe,$e=_e.children;function Ye(){X(ie)}return c.a.createElement("a",{title:de,className:Pe,onClick:Ye},c.a.createElement("i",{className:"md-iconfont ".concat(ye)}),$e)}var P=function(_e){var X=_e.watch,de=_e.showNullButton,ye=_e.onActionCallback,ie=_e.fullScreen,pe=_e.insertTemp,Pe=_e.hidetoolBar,$e=_e.uuid,Ye=_e.setOpenPhones;console.log("link:","".concat(location.origin,"/upload.html?_educoder_session_login=").concat(Object(A.G)("_educoder_session_login"),"&_educoder_session=").concat(Object(A.G)("_educoder_session"),"&key=").concat($e,"&api=").concat(encodeURIComponent(p.a.PROXY_SERVER)));var qe=[].concat(I,[{title:"".concat(X?"\u5173\u95ED\u5B9E\u65F6\u9884\u89C8":"\u5F00\u542F\u5B9E\u65F6\u9884\u89C8"),icon:"".concat(X?"icon-eye-slash":"icon-eye"),actionName:"trigger-watch"}]);return c.a.createElement("ul",{className:"markdown-toolbar-container"},!Pe&&qe.map(function(st,mt){return c.a.createElement("li",{key:mt},st.actionName?c.a.createElement(M,Object(x.a)({},st,{onActionCallback:ye})):c.a.createElement("span",{className:"v-line"}))}),de?c.a.createElement("li",null,c.a.createElement(M,{icon:"icon-edit",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-null-ch",onActionCallback:ye},c.a.createElement("span",{className:"fill-tip"},"\u70B9\u51FB\u63D2\u5165\b\u586B\u7A7A\u9879"))):null,pe&&c.a.createElement("li",null,c.a.createElement(M,{icon:"icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:"inster-template-".concat(pe),onActionCallback:ye},c.a.createElement("span",{className:"fill-tip"},"\u63D2\u5165\u6A21\u677F"))),c.a.createElement("li",{className:"btn-full-screen"},c.a.createElement(M,{icon:"".concat(ie?"icon-shrink":"icon-enlarge"),title:ie?"\u5173\u95ED\u5168\u5C4F":"\u5F00\u542F\u5168\u5C4F",actionName:"trigger-full-screen",onActionCallback:ye})))},B=re("M8RZ"),H=re("+L6B"),F=re("2/Rp"),W=re("y8nQ"),U=re("Vl3Y"),K=re("5NDa"),G=re("5rEg"),ae={labelCol:{span:4},wrapperCol:{span:20}},fe=function(_e){var X=_e.callback,de=_e.onCancel;function ye(ie){X(ie)}return c.a.createElement(U.a,Object(x.a)({},ae,{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:ye}),c.a.createElement(U.a.Item,{label:"\u94FE\u63A5\u5730\u5740",name:"link",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740"}]},c.a.createElement(G.a,null)),c.a.createElement(U.a.Item,{label:"\u94FE\u63A5\u6807\u9898",name:"title",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u6807\u9898"}]},c.a.createElement(G.a,null)),c.a.createElement("div",{className:"flex-container flex-end"},c.a.createElement(F.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),c.a.createElement(F.a,{type:"ghost",onClick:de},"\u53D6\u6D88")))},Se=re("7ahc"),Ue=re("HmJG"),Ne=re("BjJ7"),xe=U.a.useForm,Ce={width:280,marginRight:10},De={labelCol:{span:5},wrapperCol:{span:19}},ve=function(_e){var X=_e.callback,de=_e.onCancel,ye=xe(),ie=Object(E.a)(ye,1),pe=ie[0];function Pe(qe){X(qe)}function $e(qe,st){if(qe.status===-1){O.b.error(qe.message);return}pe.setFieldsValue({src:"/api/attachments/".concat(qe.id),type:st.type})}function Ye(qe){var st=qe.target.files[0];ee(st,$e)}return c.a.createElement(U.a,Object(x.a)({form:pe},De,{className:"upload-image-panel",onFinish:Pe}),c.a.createElement(U.a.Item,{label:"\u56FE\u7247\u5730\u5740",required:!0},c.a.createElement("div",{className:"flex-container"},c.a.createElement(U.a.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u56FE\u7247\u5730\u5740"}]},c.a.createElement(G.a,{style:Ce})),c.a.createElement(Re,{onFileChange:Ye}))),c.a.createElement(U.a.Item,{label:"\u56FE\u7247\u63CF\u8FF0",name:"alt"},c.a.createElement(G.a,{style:{width:264}})),c.a.createElement(U.a.Item,{style:{textAlign:"right"}},c.a.createElement(F.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),c.a.createElement(F.a,{type:"ghost",onClick:de},"\u53D6\u6D88")))};function Re(_e){var X=_e.onFileChange;return c.a.createElement("a",{className:"upload-button"},"\u672C\u5730\u4E0A\u4F20",c.a.createElement("input",{type:"file",onChange:X}))}function ee(_e,X){if(!_e)throw new String("\u6CA1\u6709\u6587\u4EF6");var de=new FormData;de.append("editormd-image-file",_e),de.append("file_param_name","editormd-image-file"),de.append("byxhr","true");var ye=new window.XMLHttpRequest;ye.withCredentials=!0,ye.addEventListener("load",function(ie){X(JSON.parse(ie.target.responseText),_e)},!1),ye.addEventListener("error",function(ie){console.error(ie)},!1),ye.open("POST","".concat(Ne.a,"/api/attachments.json")),ye.send(de)}var ge=re("giR+"),se=re("fyUT"),Fe=re("7Kak"),je=re("9yH6"),Ke=je.a.Group,ze={margin:"0 8px"},Ge=function(_e){var X=_e.callback,de=_e.onCancel;function ye(ie){X(ie)}return c.a.createElement(U.a,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:ye},c.a.createElement("div",{className:"flex-container",style:{alignItems:"baseline"}},c.a.createElement("span",{style:ze},"\u5355\u5143\u683C\u6570\uFF1A"),c.a.createElement("span",{style:ze},"\u884C\u6570"),c.a.createElement(U.a.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},c.a.createElement(se.a,null)),c.a.createElement("span",{style:ze},"\u5217\u6570"),c.a.createElement(U.a.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},c.a.createElement(se.a,null))),c.a.createElement("div",{className:"flex-container",style:{marginTop:12,alignItems:"baseline"}},c.a.createElement("span",{style:ze},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),c.a.createElement(U.a.Item,{name:"align"},c.a.createElement(Ke,null,c.a.createElement(je.a,{value:"default"},c.a.createElement("i",{className:"fa fa-align-justify"})),c.a.createElement(je.a,{value:"left"},c.a.createElement("i",{className:"fa fa-align-left"})),c.a.createElement(je.a,{value:"center"},c.a.createElement("i",{className:"fa fa-align-center"})),c.a.createElement(je.a,{value:"right"},c.a.createElement("i",{className:"fa fa-align-right"}))))),c.a.createElement("div",{className:"flex-container flex-end"},c.a.createElement(F.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),c.a.createElement(F.a,{type:"ghost",onClick:de},"\u53D6\u6D88")))},He=re("ErOA"),Ie=re("7Cbv"),ke="link",Ae="upload-image",Te="code-block",Z="add-table",ce="------------",J={default:ce,left:":".concat(ce),center:":".concat(ce,":"),right:"".concat(ce,":")},Le=re("9VGf"),We,Ve;function Me(){}var et=0,ne=1e4,Ee="\u2581",Oe=`
|
|
|
**\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 me(_e){return/^\d+$/.test(_e)?"".concat(_e,"px"):_e}var ue=navigator.platform.toUpperCase().indexOf("MAC")>=0,he=ue?"Cmd":"Ctrl",Y=["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"],$=(We={},Object(y.a)(We,he+"-B","bold"),Object(y.a)(We,he+"-I","italic"),We),z=(Ve={},Object(y.a)(Ve,ke,"\u6DFB\u52A0\u94FE\u63A5"),Object(y.a)(Ve,Te,"\u6DFB\u52A0\u4EE3\u7801\u5757"),Object(y.a)(Ve,Ae,"\u6DFB\u52A0\u6587\u4EF6"),Object(y.a)(Ve,Z,"\u6DFB\u52A0\u8868\u683C"),Ve),oe=le.a=function(_e){var X=_e.defaultValue,de=X===void 0?"":X,ye=_e.onChange,ie=_e.width,pe=ie===void 0?"100%":ie,Pe=_e.height,$e=Pe===void 0?400:Pe,Ye=_e.miniToolbar,qe=Ye===void 0?!1:Ye,st=_e.isFocus,mt=st===void 0?!1:st,ct=_e.watch,it=_e.insertTemp,yt=_e.mode,Et=yt===void 0?"markdown":yt,St=_e.id,Kt=St===void 0?"markdown-editor-id":St,Bt=_e.showResizeBar,Pt=Bt===void 0?!1:Bt,Ot=_e.noStorage,It=Ot===void 0?!1:Ot,or=_e.showNullButton,Lt=or===void 0?!1:or,dt=_e.hidetoolBar,Pr=dt===void 0?!1:dt,vn=_e.fullScreen,sr=vn===void 0?!1:vn,kt=_e.onBlur,Er=_e.onCMBeforeChange,Fr=_e.onFullScreen,_n=_e.className,tt=_n===void 0?"":_n,vt=_e.disablePaste,zn=vt===void 0?!1:vt,yn=_e.placeholder,bn=yn===void 0?"":yn,en=_e.values,xn=en===void 0?"":en,bt=Object(a.useState)(null),Ai=Object(E.a)(bt,2),rt=Ai[0],En=Ai[1],br=Object(a.useState)(de),Gn=Object(E.a)(br,2),tn=Gn[0],Sr=Gn[1],Vn=Object(a.useState)(ct),Yn=Object(E.a)(Vn,2),wr=Yn[0],Qn=Yn[1],Li=Object(a.useState)(sr),qn=Object(E.a)(Li,2),Tr=qn[0],ki=qn[1],aa=Object(a.useState)(""),Zn=Object(E.a)(aa,2),nr=Zn[0],Wr=Zn[1],oa=Object(a.useState)(0),rn=Object(E.a)(oa,2),Cr=rn[0],$n=rn[1],sa=Object(a.useState)($e),Ri=Object(E.a)(sa,2),Di=Ri[0],Sn=Ri[1],Oi=Object(a.useState)(!1),Mi=Object(E.a)(Oi,2),la=Mi[0],wn=Mi[1],nn=Object(a.useRef)(Object(Ie.a)()),an=Object(a.useRef)(!1),Tn=Object(a.useRef)(),Nr=Object(a.useRef)(),Ur=Object(a.useRef)(),Kr=Object(a.useRef)(),Cn=Object(a.useRef)(),Ii=function(){var ht=Object(d.a)(u.a.mark(function _t(){var pt,wt;return u.a.wrap(function(Ft){for(;;)switch(Ft.prev=Ft.next){case 0:return Ft.next=2,Object(He.a)("/api/attachments/distinct_hash_val.json",{method:"post",body:{hash_val:nn.current}});case 2:wt=Ft.sent,wt!=null&&(pt=wt.attachments)!==null&&pt!==void 0&&pt.length&&(console.log("cm:",rt,Nr),wt.attachments.map(function(Ct){Ct.content_type.indexOf("image")>-1?rt.replaceSelection(".concat(Ct.content_type,")")):Ct.content_type.indexOf("video")>-1?rt.replaceSelection('<video width="100%" controls src="'.concat(p.a.API_SERVER,"/api/attachments/").concat(data.id,'"></video>')):Ct.content_type.indexOf("pdf")>-1?rt.replaceSelection('<a href="'.concat(p.a.API_SERVER,"/api/attachments/").concat(Ct.id,"?type=").concat(Ct.content_type,'&disposition=inline" target="_blank">').concat(Ct.name,"</a>")):rt.replaceSelection("[".concat(Ct.name,"](").concat(p.a.API_SERVER,"/api/attachments/").concat(Ct.id,"?type=").concat(Ct.content_type,")"))}));case 4:case"end":return Ft.stop()}},_t)}));return function(){return ht.apply(this,arguments)}}();Object(a.useEffect)(function(){Sr(xn),rt==null||rt.setValue(xn)},[xn]),Object(a.useEffect)(function(){Fr==null||Fr(Tr)},[Tr]),Object(a.useEffect)(function(){if(Nr.current){var ht=l.a.fromTextArea(Nr.current,{mode:Et,lineNumbers:!qe,lineWrapping:!0,value:de,autoCloseTags:!0,autoCloseBrackets:!0});mt&&ht.focus();function _t(pt,wt){if(zn){wt.preventDefault();return}var At=wt.clipboardData;if(At){var Ft=At.types.toString(),Ct=At.items;if(Ft==="Files"||At.types.indexOf("Files")>-1){if(wt.preventDefault(),Et=="stex")return;try{var Gt,lr=Ct[1];((Gt=Ct[0])===null||Gt===void 0?void 0:Gt.kind)==="file"&&(lr=Ct[0]);var Tt=lr.getAsFile(),Br=Tt.name.split(".").pop();ee(Tt,function(Rt){if(Rt.id){var ur,er,xr;(Tt==null||((ur=Tt.type)===null||ur===void 0)?void 0:ur.indexOf("image"))>-1?ht.replaceSelection(".concat(Rt.content_type,")")):(Tt==null||((er=Tt.type)===null||er===void 0)?void 0:er.indexOf("video"))>-1?ht.replaceSelection('<video width="100%" controls src="'.concat(p.a.API_SERVER,"/api/attachments/").concat(Rt.id,'"></video>')):(Tt==null||((xr=Tt.type)===null||xr===void 0)?void 0:xr.indexOf("pdf"))>-1?ht.replaceSelection('<a href="'.concat(p.a.API_SERVER,"/api/attachments/").concat(Rt.id,"?type=").concat(Tt.type,'&disposition=inline" target="_blank">').concat(Tt.name,"</a>")):Y.includes(Br)?ht.replaceSelection('<a href="'.concat(p.a.API_SERVER,"/api/attachments/").concat(Rt.id,'?type=office&disposition=inline" target="_blank">').concat(Tt.name,"</a>")):ht.replaceSelection("[".concat(Tt.name,"](").concat(p.a.API_SERVER,"/api/attachments/").concat(Rt.id,"?type=").concat(Rt.content_type,")"))}else(Rt==null?void 0:Rt.status)===401&&(document.location.href="/user/login")})}catch(Rt){O.b.warn("\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668\u7C98\u8D34")}return!0}else return!0}return!0}return ht.on("paste",_t),ht.on("dragleave",function(pt,wt){Ur.current.classList.remove("mouse-hover-md")}),ht.on("dragover",function(pt,wt){Ur.current.classList.add("mouse-hover-md")}),ht.on("drop",function(pt,wt){Ur.current.classList.add("mouse-hover-md");var At;if(At=wt.dataTransfer.files,At.length>0){wt.preventDefault(),wt.stopPropagation();for(var Ft=function(lr){var Tt=At[lr],Br=Tt.name.split(".").pop();ee(Tt,function(Rt){if(Rt.id){var ur,er,xr;(Tt==null||((ur=Tt.type)===null||ur===void 0)?void 0:ur.indexOf("image"))>-1?ht.replaceSelection(".concat(Rt.content_type,")")):(Tt==null||((er=Tt.type)===null||er===void 0)?void 0:er.indexOf("video"))>-1?ht.replaceSelection('<video width="100%" controls src="'.concat(p.a.API_SERVER,"/api/attachments/").concat(Rt.id,'"></video>')):(Tt==null||((xr=Tt.type)===null||xr===void 0)?void 0:xr.indexOf("pdf"))>-1?ht.replaceSelection('<a href="'.concat(p.a.API_SERVER,"/api/attachments/").concat(Rt.id,"?type=").concat(Tt.type,'&disposition=inline" target="_blank">').concat(Tt.name,"</a>")):Y.includes(Br)?ht.replaceSelection('<a href="'.concat(p.a.API_SERVER,"/api/attachments/").concat(Rt.id,'?type=office&disposition=inline" target="_blank">').concat(Tt.name,"</a>")):ht.replaceSelection("[".concat(Tt.name,"](").concat(p.a.API_SERVER,"/api/attachments/").concat(Rt.id,"?type=").concat(Rt.content_type,")"))}else(Rt==null?void 0:Rt.status)===401&&(document.location.href="/user/login")})},Ct=0;Ct<At.length;Ct++)Ft(Ct)}}),En(ht),function(){ht.off("paste",_t)}}},[]);var vr=Object(a.useCallback)(function(){if(Ur.current)try{}catch(ht){console.log(ht,"---- to set md editor body height")}},[Di,Ur,Tr]);Object(a.useEffect)(function(){function ht(){var pt=new r.default(function(wt){var At=Object(D.a)(wt),Ft;try{for(At.s();!(Ft=At.n()).done;){var Ct=Ft.value;(Ct.target.offsetHeight>0||Ct.target.offsetWidth>0)&&(vr(),rt.setSize("100%","100%"),rt.refresh())}}catch(Gt){At.e(Gt)}finally{At.f()}});return pt.observe(Nr.current.parentElement),pt}if(rt){var _t=ht();return function(){_t.unobserve(Nr.current.parentElement)}}},[rt,vr]),Object(a.useEffect)(function(){if(rt){for(var ht=[],_t=function(){var Ct=wt[pt];At=Object(E.a)(Ct,2);var Gt=At[0],lr=At[1],Tt=Object(y.a)({},Gt,function(){Pi(lr)});ht.push(Tt),rt.addKeyMap(Tt)},pt=0,wt=Object.entries($);pt<wt.length;pt++){var At;_t()}return Tn.current=setInterval(function(){an.current&&Ii()},4e3),function(){clearInterval(Tn.current);var Ft=Object(D.a)(ht),Ct;try{for(Ft.s();!(Ct=Ft.n()).done;){var Gt=Ct.value;rt.removeKeyMap(Gt)}}catch(lr){Ft.e(lr)}finally{Ft.f()}}}},[rt]),Object(a.useEffect)(function(){sr!==Tr&&ki(sr)},[sr]),Object(Le.a)(function(){if(!It&&Cr>0){var ht=new Date().getTime(),_t=window.sessionStorage.getItem(Kt);ht>=Cr+ne&&(!_t||_t!==tn)&&(window.sessionStorage.setItem(Kt,tn),wn(!0))}},ne),Object(a.useEffect)(function(){Qn(ct)},[rt,ct]),Object(a.useEffect)(function(){rt&&(mt&&rt.focus())},[rt,mt]),Object(a.useEffect)(function(){if(wr&&rt){var ht=rt.getScrollerElement();function _t(pt){var wt=pt.target;if(Cn.current){var At=wt.scrollTop/wt.scrollHeight;Cn.current.scrollTop=Cn.current.scrollHeight*At}}return ht.addEventListener("scroll",_t),function(){ht.removeEventListener("scroll",_t)}}},[rt,wr]),Object(a.useEffect)(function(){if(rt&&Er){function ht(_t,pt){Er(_t,pt)}return rt.on("beforeChange",ht),function(){rt.off("beforeChange",ht)}}},[rt,Er]),Object(a.useEffect)(function(){if(rt&&kt){function ht(){kt(rt.getValue())}return rt.on("blur",ht),function(){rt.off("blur",ht)}}},[rt,kt]),Object(a.useEffect)(function(){if(rt){function ht(_t){var pt=_t.getValue();Sr(pt),$n(new Date().getTime()),_t.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),ye&&ye(pt)}return rt.on("change",ht),function(){rt.off("change",ht)}}},[rt,ye]),Object(a.useEffect)(function(){rt&&(de==null?(rt.setValue(""),Sr("")):de!==rt.getValue()&&(rt.setValue(de),Sr(de),rt.setCursor(rt.lineCount(),0)))},[rt,de]);var Pi=Object(a.useCallback)(function(ht){var _t=rt.getCursor(),pt=rt.getSelection(),wt=pt.split(`
|
|
|
`);switch(ht){case"bold":return rt.replaceSelection("**"+pt+"**"),pt===""&&rt.setCursor(_t.line,_t.ch+2),rt.focus();case"italic":return rt.replaceSelection("*"+pt+"*"),pt===""&&rt.setCursor(_t.line,_t.ch+1),rt.focus();case"code":return rt.replaceSelection("`"+pt+"`"),pt===""&&rt.setCursor(_t.line,_t.ch+1),rt.focus();case"inline-latex":return rt.replaceSelection("`$$"+pt+"$$`"),pt===""&&rt.setCursor(_t.line,_t.ch+3),rt.focus();case"latex":return rt.replaceSelection("```latex\n"+pt+"\n```"),rt.setCursor(_t.line+1,pt.length+1),rt.focus();case"line-break":return rt.replaceSelection(`<br/>
|
|
|
`),rt.focus();case"list-ul":return pt===""?rt.replaceSelection("- "+pt):rt.replaceSelection(wt.map(function(At){return At===""?"":"- ".concat(At)}).join(`
|
|
|
`)),rt.focus();case"list-ol":return pt===""?rt.replaceSelection("1. "+pt):rt.replaceSelection(wt.map(function(At,Ft){return At===""?"":"".concat(Ft+1,". ").concat(At)}).join(`
|
|
|
`)),rt.focus();case"add-null-ch":return pt===""&&rt.setCursor(_t.line,_t.ch+1),rt.replaceSelection(Ee),rt.focus();case"inster-template-1":return pt===""&&rt.setCursor(_t.line,_t.ch),rt.replaceSelection(Oe),rt.focus();case"eraser":return rt.setValue(""),rt.focus();case"trigger-watch":return Qn(!wr),rt.focus();case"trigger-full-screen":return ki(!Tr),rt.focus();case ke:Wr(ke);return;case Te:Wr(Te);return;case Ae:Wr(Ae);return;case Z:Wr(Z);return;default:throw new Error}},[rt,wr,Tr]),An=Object(a.useCallback)(function(ht){Wr("");switch(nr){case ke:var _t=ht.title,pt=ht.link;return rt.replaceSelection("[".concat(_t,"](").concat(pt,")")),rt.focus();case Te:var wt=ht.language,At=ht.content;return rt.replaceSelection(["```"+wt,At,"```"].join(`
|
|
|
`)),rt.focus();case Ae:var Ft=ht.src,Ct=ht.alt;return Ct?rt.replaceSelection(".concat(Ft,' "').concat(Ct,'" )')):rt.replaceSelection("")),rt.focus();case Z:for(var Gt=ht.row,lr=ht.col,Tt=ht.align,Br=`
|
|
|
`,Rt=0;Rt<Gt;Rt++){for(var ur=[],er=[],xr=0;xr<lr;xr++)Rt===1&&er.push(J[Tt]),ur.push(" ");Rt===1&&(Br+="| ".concat(er.join(" | "),` |
|
|
|
`)),Br+="| ".concat(ur.join(lr===1?"":" | "),` |
|
|
|
`)}return rt.replaceSelection(Br+`
|
|
|
`),rt.focus();default:throw new Error}},[rt,nr]),Jn=Object(a.useMemo)(function(){switch(nr){case ke:return c.a.createElement(fe,{callback:An,onCancel:zr});case Te:return c.a.createElement(Se.b,{callback:An,onCancel:zr});case Ae:return c.a.createElement(ve,{callback:An,onCancel:zr});case Z:return c.a.createElement(Ge,{callback:An,onCancel:zr});default:return null}},[nr]);function zr(){Wr("")}Object(a.useEffect)(function(){if(Kr.current){var ht=Kr.current,_t=!1,pt=0;function wt(Ct){_t=!0,pt=Ct.pageY}function At(){_t=!1}function Ft(Ct){if(_t){var Gt=Ct.pageY-pt;Gt<0&&(Gt=0),Gt>300&&(Gt=300);var lr=$e+Gt+"px";Sn(lr)}}return ht.addEventListener("mousedown",wt),document.addEventListener("mousemove",Ft),document.addEventListener("mouseup",At),function(){ht.removeEventListener("mousedown",wt),document.removeEventListener("mousemove",Ft),document.removeEventListener("mouseup",At)}}},[rt,Kr]),Object(a.useEffect)(function(){Sn($e)},[$e]);var Dr=me(pe),ei=me(Di),Ar={width:Dr,height:ei},ti=Object(a.useMemo)(function(){if(Cr){var ht=new Date(Cr),_t=ht.getHours(),pt=ht.getMinutes(),wt=ht.getSeconds();return _t=_t<10?"0"+_t:_t,pt=pt<10?"0"+pt:pt,wt=wt<10?"0"+wt:wt,"".concat(_t,":").concat(pt,":").concat(wt)}return 0},[Cr]);function Fi(){window.sessionStorage.removeItem(Kt),wn(!1),$n(0)}function on(){wn(!1),$n(0),rt.setValue(window.sessionStorage.getItem(Kt))}function ua(ht,_t){var pt=rt.getValue();pt=pt.replace(ht,_t),Sr(pt),rt==null||rt.setValue(pt)}return c.a.createElement(a.Fragment,null,c.a.createElement("div",{className:"markdown-editor-wrapper",ref:Ur},c.a.createElement("div",{className:"markdown-editor-container ".concat(tt," ").concat(wr?"on-preview":""," ").concat(qe?"mini":""," ").concat(Tr?"full-screen":""),style:Ar},c.a.createElement(P,{insertTemp:it,watch:wr,fullScreen:Tr,showNullButton:Lt,onActionCallback:Pi,hidetoolBar:Pr,uuid:nn.current,setOpenPhones:function(){an.current=!0}}),c.a.createElement("div",{className:"markdown-editor-body"},c.a.createElement("div",{className:"codemirror-container"},c.a.createElement("textarea",{ref:Nr,placeholder:bn})),wr?c.a.createElement("div",{ref:Cn,className:"preview-container"},Et==="stex"&&c.a.createElement(C,{value:tn}),Et!=="stex"&&c.a.createElement(w.a,{edit:!0,value:tn,replaces:ua})):null))),Pt?c.a.createElement("a",{ref:Kr,className:"editor-resize"}):null,c.a.createElement(B.a,null,z[nr]?c.a.createElement(k.a,{centered:!0,title:z[nr],visible:!0,onCancel:zr,footer:null,className:"markdown-popup-form"},Jn):null))}},P2ho:function(Je,le,re){"use strict";Object.defineProperty(le,"__esModule",{value:!0}),le.default=void 0;var j={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};le.default=j},QV2g:function(Je,le,re){"use strict";Object.defineProperty(le,"__esModule",{value:!0}),le.default=j;function j(){for(var R,O=[],d=0;d<256;d++){R=d;for(var E=0;E<8;E++)R=R&1?3988292384^R>>>1:R>>>1;O[d]=R}return O}var k=j();function D(R,O,d,E){var y=k,v=E+d;R^=-1;for(var u=E;u<v;u++)R=R>>>8^y[(R^O[u])&255];return R^-1}},SJMd:function(Je,le){/**
|
|
|
* @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 re,j,k,D=!1,R,O;window.PR_SHOULD_USE_CONTINUATION=!0;var d,E;(function(){var y=window,v=["break,continue,do,else,for,if,return,while"],u=[v,"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"],a=[u,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],c=[a,"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"],s=[a,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],l=[a,"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"],r="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",n=[a,"abstract,async,await,constructor,debugger,enum,eval,export,function,get,implements,instanceof,interface,let,null,set,undefined,var,with,yield,Infinity,NaN"],o="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",i=[v,"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"],f=[v,"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"],h=[v,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],T=[c,l,s,n,o,i,f,h],g=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,w="str",C="kwd",x="com",b="typ",S="lit",A="pun",p="pln",I="tag",M="dec",P="src",B="atn",H="atv",F="nocode",W="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<<?=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function U(Ke){for(var ze=0,Ge=!1,He=!1,Ie=0,ke=Ke.length;Ie<ke;++Ie){var Ae=Ke[Ie];if(Ae.ignoreCase)He=!0;else if(/[a-z]/i.test(Ae.source.replace(/\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi,""))){Ge=!0,He=!1;break}}var Te={b:8,t:9,n:10,v:11,f:12,r:13};function Z(Ve){var Me=Ve.charCodeAt(0);if(Me!==92)return Me;var et=Ve.charAt(1);return Me=Te[et],Me||("0"<=et&&et<="7"?parseInt(Ve.substring(1),8):et==="u"||et==="x"?parseInt(Ve.substring(2),16):Ve.charCodeAt(1))}function ce(Ve){if(Ve<32)return(Ve<16?"\\x0":"\\x")+Ve.toString(16);var Me=String.fromCharCode(Ve);return Me==="\\"||Me==="-"||Me==="]"||Me==="^"?"\\"+Me:Me}function J(Ve){var Me=Ve.substring(1,Ve.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")),et=[],ne=Me[0]==="^",Ee=["["];ne&&Ee.push("^");for(var Oe=ne?1:0,me=Me.length;Oe<me;++Oe){var ue=Me[Oe];if(/\\[bdsw]/i.test(ue))Ee.push(ue);else{var he=Z(ue),Y;Oe+2<me&&Me[Oe+1]==="-"?(Y=Z(Me[Oe+2]),Oe+=2):Y=he,et.push([he,Y]),Y<65||he>122||(Y<65||he>90||et.push([Math.max(65,he)|32,Math.min(Y,90)|32]),Y<97||he>122||et.push([Math.max(97,he)&~32,Math.min(Y,122)&~32]))}}et.sort(function(_e,X){return _e[0]-X[0]||X[1]-_e[1]});for(var $=[],z=[],Oe=0;Oe<et.length;++Oe){var oe=et[Oe];oe[0]<=z[1]+1?z[1]=Math.max(z[1],oe[1]):$.push(z=oe)}for(var Oe=0;Oe<$.length;++Oe){var oe=$[Oe];Ee.push(ce(oe[0])),oe[1]>oe[0]&&(oe[1]+1>oe[0]&&Ee.push("-"),Ee.push(ce(oe[1])))}return Ee.push("]"),Ee.join("")}function Le(Ve){for(var Me=Ve.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")),et=Me.length,ne=[],Ee=0,Oe=0;Ee<et;++Ee){var me=Me[Ee];if(me==="(")++Oe;else if(me.charAt(0)==="\\"){var ue=+me.substring(1);ue&&(ue<=Oe?ne[ue]=-1:Me[Ee]=ce(ue))}}for(var Ee=1;Ee<ne.length;++Ee)ne[Ee]===-1&&(ne[Ee]=++ze);for(var Ee=0,Oe=0;Ee<et;++Ee){var me=Me[Ee];if(me==="(")++Oe,ne[Oe]||(Me[Ee]="(?:");else if(me.charAt(0)==="\\"){var ue=+me.substring(1);ue&&ue<=Oe&&(Me[Ee]="\\"+ne[ue])}}for(var Ee=0;Ee<et;++Ee)Me[Ee]==="^"&&Me[Ee+1]!=="^"&&(Me[Ee]="");if(Ve.ignoreCase&&Ge)for(var Ee=0;Ee<et;++Ee){var me=Me[Ee],he=me.charAt(0);me.length>=2&&he==="["?Me[Ee]=J(me):he!=="\\"&&(Me[Ee]=me.replace(/[a-zA-Z]/g,function(z){var oe=z.charCodeAt(0);return"["+String.fromCharCode(oe&~32,oe|32)+"]"}))}return Me.join("")}for(var We=[],Ie=0,ke=Ke.length;Ie<ke;++Ie){var Ae=Ke[Ie];if(Ae.global||Ae.multiline)throw new Error(""+Ae);We.push("(?:"+Le(Ae)+")")}return new RegExp(We.join("|"),He?"gi":"g")}function K(Ke,ze){var Ge=/(?:^|\s)nocode(?:\s|$)/,He=[],Ie=0,ke=[],Ae=0;function Te(Z){var ce=Z.nodeType;if(ce==1){if(Ge.test(Z.className))return;for(var J=Z.firstChild;J;J=J.nextSibling)Te(J);var Le=Z.nodeName.toLowerCase();(Le==="br"||Le==="li")&&(He[Ae]=`
|
|
|
`,ke[Ae<<1]=Ie++,ke[Ae++<<1|1]=Z)}else if(ce==3||ce==4){var We=Z.nodeValue;We.length&&(ze?We=We.replace(/\r\n?/g,`
|
|
|
`):We=We.replace(/[ \t\r\n]+/g," "),He[Ae]=We,ke[Ae<<1]=Ie,Ie+=We.length,ke[Ae++<<1|1]=Z)}}return Te(Ke),{sourceCode:He.join("").replace(/\n$/,""),spans:ke}}function G(Ke,ze,Ge,He,Ie){if(!Ge)return;var ke={sourceNode:Ke,pre:1,langExtension:null,numberLines:null,sourceCode:Ge,spans:null,basePos:ze,decorations:null};He(ke),Ie.push.apply(Ie,ke.decorations)}var ae=/\S/;function fe(Ke){for(var ze=void 0,Ge=Ke.firstChild;Ge;Ge=Ge.nextSibling){var He=Ge.nodeType;ze=He===1?ze?Ke:Ge:He===3&&ae.test(Ge.nodeValue)?Ke:ze}return ze===Ke?void 0:ze}function Se(Ke,ze){var Ge={},He;(function(){for(var Ae=Ke.concat(ze),Te=[],Z={},ce=0,J=Ae.length;ce<J;++ce){var Le=Ae[ce],We=Le[3];if(We)for(var Ve=We.length;--Ve>=0;)Ge[We.charAt(Ve)]=Le;var Me=Le[1],et=""+Me;Z.hasOwnProperty(et)||(Te.push(Me),Z[et]=null)}Te.push(/[\0-\uffff]/),He=U(Te)})();var Ie=ze.length,ke=function(Ae){for(var Te=Ae.sourceCode,Z=Ae.basePos,ce=Ae.sourceNode,J=[Z,p],Le=0,We=Te.match(He)||[],Ve={},Me=0,et=We.length;Me<et;++Me){var ne=We[Me],Ee=Ve[ne],Oe=void 0,me;if(typeof Ee=="string")me=!1;else{var ue=Ge[ne.charAt(0)];if(ue)Oe=ne.match(ue[1]),Ee=ue[0];else{for(var he=0;he<Ie;++he)if(ue=ze[he],Oe=ne.match(ue[1]),Oe){Ee=ue[0];break}Oe||(Ee=p)}me=Ee.length>=5&&Ee.substring(0,5)==="lang-",me&&!(Oe&&typeof Oe[1]=="string")&&(me=!1,Ee=P),me||(Ve[ne]=Ee)}var Y=Le;if(Le+=ne.length,!me)J.push(Z+Y,Ee);else{var $=Oe[1],z=ne.indexOf($),oe=z+$.length;Oe[2]&&(oe=ne.length-Oe[2].length,z=oe-$.length);var _e=Ee.substring(5);G(ce,Z+Y,ne.substring(0,z),ke,J),G(ce,Z+Y+z,$,Re(_e,$),J),G(ce,Z+Y+oe,ne.substring(oe),ke,J)}}Ae.decorations=J};return ke}function Ue(Ke){var ze=[],Ge=[];Ke.tripleQuotedStrings?ze.push([w,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):Ke.multiLineStrings?ze.push([w,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):ze.push([w,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),Ke.verbatimStrings&&Ge.push([w,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var He=Ke.hashComments;He&&(Ke.cStyleComments?(He>1?ze.push([x,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):ze.push([x,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),Ge.push([w,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):ze.push([x,/^#[^\r\n]*/,null,"#"])),Ke.cStyleComments&&(Ge.push([x,/^\/\/[^\r\n]*/,null]),Ge.push([x,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var Ie=Ke.regexLiterals;if(Ie){var ke=Ie>1?"":`
|
|
|
\r`,Ae=ke?".":"[\\S\\s]",Te="/(?=[^/*"+ke+"])(?:[^/\\x5B\\x5C"+ke+"]|\\x5C"+Ae+"|\\x5B(?:[^\\x5C\\x5D"+ke+"]|\\x5C"+Ae+")*(?:\\x5D|$))+/";Ge.push(["lang-regex",RegExp("^"+W+"("+Te+")")])}var Z=Ke.types;Z&&Ge.push([b,Z]);var ce=(""+Ke.keywords).replace(/^ | $/g,"");ce.length&&Ge.push([C,new RegExp("^(?:"+ce.replace(/[\s,]+/g,"|")+")\\b"),null]),ze.push([p,/^\s+/,null,` \r
|
|
|
\xA0`]);var J="^.[^\\s\\w.$@'\"`/\\\\]*";return Ke.regexLiterals&&(J+="(?!s*/)"),Ge.push([S,/^@[a-z_$][a-z_$@0-9]*/i,null],[b,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[p,/^[a-z_$][a-z_$@0-9]*/i,null],[S,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[p,/^\\[\s\S]?/,null],[A,new RegExp(J),null]),Se(ze,Ge)}var Ne=Ue({keywords:T,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function xe(Ke,ze,Ge){for(var He=/(?:^|\s)nocode(?:\s|$)/,Ie=/\r\n?|\n/,ke=Ke.ownerDocument,Ae=ke.createElement("li");Ke.firstChild;)Ae.appendChild(Ke.firstChild);var Te=[Ae];function Z(Me){var et=Me.nodeType;if(et==1&&!He.test(Me.className))if(Me.nodeName==="br")ce(Me),Me.parentNode&&Me.parentNode.removeChild(Me);else for(var ne=Me.firstChild;ne;ne=ne.nextSibling)Z(ne);else if((et==3||et==4)&&Ge){var Ee=Me.nodeValue,Oe=Ee.match(Ie);if(Oe){var me=Ee.substring(0,Oe.index);Me.nodeValue=me;var ue=Ee.substring(Oe.index+Oe[0].length);if(ue){var he=Me.parentNode;he.insertBefore(ke.createTextNode(ue),Me.nextSibling)}ce(Me),me||Me.parentNode.removeChild(Me)}}}function ce(Me){for(;!Me.nextSibling;)if(Me=Me.parentNode,!Me)return;function et(Oe,me){var ue=me?Oe.cloneNode(!1):Oe,he=Oe.parentNode;if(he){var Y=et(he,1),$=Oe.nextSibling;Y.appendChild(ue);for(var z=$;z;z=$)$=z.nextSibling,Y.appendChild(z)}return ue}for(var ne=et(Me.nextSibling,0),Ee;(Ee=ne.parentNode)&&Ee.nodeType===1;)ne=Ee;Te.push(ne)}for(var J=0;J<Te.length;++J)Z(Te[J]);ze===(ze|0)&&Te[0].setAttribute("value",ze);var Le=ke.createElement("ol");Le.className="linenums";for(var We=Math.max(0,ze-1|0)||0,J=0,Ve=Te.length;J<Ve;++J)Ae=Te[J],Ae.className="L"+(J+We)%10,Ae.firstChild||Ae.appendChild(ke.createTextNode("\xA0")),Le.appendChild(Ae);Ke.appendChild(Le)}function Ce(Ke){var ze=/\bMSIE\s(\d+)/.exec(navigator.userAgent);ze=ze&&+ze[1]<=8;var Ge=/\n/g,He=Ke.sourceCode,Ie=He.length,ke=0,Ae=Ke.spans,Te=Ae.length,Z=0,ce=Ke.decorations,J=ce.length,Le=0;ce[J]=Ie;var We,Ve;for(Ve=We=0;Ve<J;)ce[Ve]!==ce[Ve+2]?(ce[We++]=ce[Ve++],ce[We++]=ce[Ve++]):Ve+=2;for(J=We,Ve=We=0;Ve<J;){for(var Me=ce[Ve],et=ce[Ve+1],ne=Ve+2;ne+2<=J&&ce[ne+1]===et;)ne+=2;ce[We++]=Me,ce[We++]=et,Ve=ne}J=ce.length=We;var Ee=Ke.sourceNode,Oe="";Ee&&(Oe=Ee.style.display,Ee.style.display="none");try{for(var me=null;Z<Te;){var ue=Ae[Z],he=Ae[Z+2]||Ie,Y=ce[Le+2]||Ie,ne=Math.min(he,Y),$=Ae[Z+1],z;if($.nodeType!==1&&(z=He.substring(ke,ne))){ze&&(z=z.replace(Ge,"\r")),$.nodeValue=z;var oe=$.ownerDocument,_e=oe.createElement("span");_e.className=ce[Le+1];var X=$.parentNode;X.replaceChild(_e,$),_e.appendChild($),ke<he&&(Ae[Z+1]=$=oe.createTextNode(He.substring(ne,he)),X.insertBefore($,_e.nextSibling))}ke=ne,ke>=he&&(Z+=2),ke>=Y&&(Le+=2)}}finally{Ee&&(Ee.style.display=Oe)}}var De={};function ve(Ke,ze){for(var Ge=ze.length;--Ge>=0;){var He=ze[Ge];De.hasOwnProperty(He)?y.console&&console.warn("cannot override language handler %s",He):De[He]=Ke}}function Re(Ke,ze){return Ke&&De.hasOwnProperty(Ke)||(Ke=/^\s*</.test(ze)?"default-markup":"default-code"),De[Ke]}ve(Ne,["default-code"]),ve(Se([],[[p,/^[^<?]+/],[M,/^<!\w[^>]*(?:>|$)/],[x,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[A,/^(?:<[%?]|[%?]>)/],["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"]),ve(Se([[p,/^[\s]+/,null,` \r
|
|
|
`],[H,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,`"'`]],[[I,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[B,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[A,/^[=<>\/]+/],["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"]),ve(Se([],[[H,/^[\s\S]+/]]),["uq.val"]),ve(Ue({keywords:c,hashComments:!0,cStyleComments:!0,types:g}),["c","cc","cpp","cxx","cyc","m"]),ve(Ue({keywords:"null,true,false"}),["json"]),ve(Ue({keywords:l,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:g}),["cs"]),ve(Ue({keywords:s,cStyleComments:!0}),["java"]),ve(Ue({keywords:h,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),ve(Ue({keywords:i,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),ve(Ue({keywords:o,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),ve(Ue({keywords:f,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),ve(Ue({keywords:n,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),ve(Ue({keywords:r,hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),ve(Se([],[[w,/^[\s\S]+/]]),["regex"]);function ee(Ke){var ze=Ke.langExtension;try{var Ge=K(Ke.sourceNode,Ke.pre),He=Ge.sourceCode;Ke.sourceCode=He,Ke.spans=Ge.spans,Ke.basePos=0,Re(ze,He)(Ke),Ce(Ke)}catch(Ie){y.console&&console.log(Ie&&Ie.stack||Ie)}}function ge(Ke,ze,Ge){var He=Ge||!1,Ie=ze||null,ke=document.createElement("div");ke.innerHTML="<pre>"+Ke+"</pre>",ke=ke.firstChild,He&&xe(ke,He,!0);var Ae={langExtension:Ie,numberLines:He,sourceNode:ke,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null};return ee(Ae),ke.innerHTML}function se(Ke,ze){var Ge=ze||document.body,He=Ge.ownerDocument||document;function Ie(ue){return Ge.getElementsByTagName(ue)}for(var ke=[Ie("pre"),Ie("code"),Ie("xmp")],Ae=[],Te=0;Te<ke.length;++Te)for(var Z=0,ce=ke[Te].length;Z<ce;++Z)Ae.push(ke[Te][Z]);ke=null;var J=Date;J.now||(J={now:function(){return+new Date}});var Le=0,We=/\blang(?:uage)?-([\w.]+)(?!\S)/,Ve=/\bprettyprint\b/,Me=/\bprettyprinted\b/,et=/pre|xmp/i,ne=/^code$/i,Ee=/^(?:pre|code|xmp)$/i,Oe={};function me(){for(var ue=y.PR_SHOULD_USE_CONTINUATION?J.now()+250:Infinity;Le<Ae.length&&J.now()<ue;Le++){for(var he=Ae[Le],Y=Oe,$=he;$=$.previousSibling;){var z=$.nodeType,oe=(z===7||z===8)&&$.nodeValue;if(oe?!/^\??prettify\b/.test(oe):z!==3||/\S/.test($.nodeValue))break;if(oe){Y={},oe.replace(/\b(\w+)=([\w:.%+-]+)/g,function(ct,it,yt){Y[it]=yt});break}}var _e=he.className;if((Y!==Oe||Ve.test(_e))&&!Me.test(_e)){for(var X=!1,de=he.parentNode;de;de=de.parentNode){var ye=de.tagName;if(Ee.test(ye)&&de.className&&Ve.test(de.className)){X=!0;break}}if(!X){he.className+=" prettyprinted";var ie=Y.lang;if(!ie){ie=_e.match(We);var pe;!ie&&(pe=fe(he))&&ne.test(pe.tagName)&&(ie=pe.className.match(We)),ie&&(ie=ie[1])}var Pe;if(et.test(he.tagName))Pe=1;else{var $e=he.currentStyle,Ye=He.defaultView,qe=$e?$e.whiteSpace:Ye&&Ye.getComputedStyle?Ye.getComputedStyle(he,null).getPropertyValue("white-space"):0;Pe=qe&&qe.substring(0,3)==="pre"}var st=Y.linenums;(st=st==="true"||+st)||(st=_e.match(/\blinenums\b(?::(\d+))?/),st=st?st[1]&&st[1].length?+st[1]:!0:!1),st&&xe(he,st,Pe);var mt={langExtension:ie,sourceNode:he,numberLines:st,pre:Pe,sourceCode:null,basePos:null,spans:null,decorations:null};ee(mt)}}}Le<Ae.length?y.setTimeout(me,250):typeof Ke=="function"&&Ke()}me()}var Fe=y.PR={createSimpleLexer:Se,registerLangHandler:ve,sourceDecorator:Ue,PR_ATTRIB_NAME:B,PR_ATTRIB_VALUE:H,PR_COMMENT:x,PR_DECLARATION:M,PR_KEYWORD:C,PR_LITERAL:S,PR_NOCODE:F,PR_PLAIN:p,PR_PUNCTUATION:A,PR_SOURCE:P,PR_STRING:w,PR_TAG:I,PR_TYPE:b,prettyPrintOne:D?y.prettyPrintOne=ge:d=ge,prettyPrint:E=D?y.prettyPrint=se:E=se},je=y.define;typeof je=="function"&&je.amd&&je("google-code-prettify",[],function(){return Fe})})()},SZEN:function(Je,le,re){"use strict";Object.defineProperty(le,"__esModule",{value:!0}),le.clientToElement=j;function j(k,D,R){var O=R.getBoundingClientRect(),d={x:0,y:0};return k<O.left?d.x=0:k>=O.right?d.x=O.width-1:d.x=k-O.left,D<O.top?d.y=0:D>=O.bottom?d.y=O.height-1:d.y=D-O.top,d}},SgaC:function(Je,le,re){"use strict";Object.defineProperty(le,"__esModule",{value:!0}),le.default=void 0;function j(O,d){if(!(O instanceof d))throw new TypeError("Cannot call a class as a function")}function k(O,d){for(var E=0;E<d.length;E++){var y=d[E];y.enumerable=y.enumerable||!1,y.configurable=!0,"value"in y&&(y.writable=!0),Object.defineProperty(O,y.key,y)}}function D(O,d,E){return d&&k(O.prototype,d),E&&k(O,E),O}var R=function(){function O(){j(this,O),this._subrects=0}return D(O,[{key:"decodeRect",value:function(E,y,v,u,a,c,s){if(this._subrects===0){if(a.rQwait("RRE",4+4))return!1;this._subrects=a.rQshift32();var l=a.rQshiftBytes(4);c.fillRect(E,y,v,u,l)}for(;this._subrects>0;){if(a.rQwait("RRE",4+8))return!1;var r=a.rQshiftBytes(4),n=a.rQshift16(),o=a.rQshift16(),i=a.rQshift16(),f=a.rQshift16();c.fillRect(E+n,y+o,i,f,r),this._subrects--}return!0}}]),O}();le.default=R},VSMT:function(Je,le,re){"use strict";Object.defineProperty(le,"__esModule",{value:!0}),le.decodeUTF8=j,le.encodeUTF8=k;function j(D){var R=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;try{return decodeURIComponent(escape(D))}catch(O){if(O instanceof URIError&&R)return D;throw O}}function k(D){return unescape(encodeURIComponent(D))}},"VaU+":function(Je,le,re){Je.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"}},"VrN/":function(Je,le,re){(function(j,k){Je.exports=k()})(this,function(){"use strict";var j=navigator.userAgent,k=navigator.platform,D=/gecko\/\d/i.test(j),R=/MSIE \d/.test(j),O=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(j),d=/Edge\/(\d+)/.exec(j),E=R||O||d,y=E&&(R?document.documentMode||6:+(d||O)[1]),v=!d&&/WebKit\//.test(j),u=v&&/Qt\/\d+\.\d+/.test(j),a=!d&&/Chrome\//.test(j),c=/Opera\//.test(j),s=/Apple Computer/.test(navigator.vendor),l=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(j),r=/PhantomJS/.test(j),n=!d&&/AppleWebKit/.test(j)&&/Mobile\/\w+/.test(j),o=/Android/.test(j),i=n||o||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(j),f=n||/Mac/.test(k),h=/\bCrOS\b/.test(j),T=/win/i.test(k),g=c&&j.match(/Version\/(\d*\.\d*)/);g&&(g=Number(g[1])),g&&g>=15&&(c=!1,v=!0);var w=f&&(u||c&&(g==null||g<12.11)),C=D||E&&y>=9;function x(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var b=function(e,t){var _=e.className,m=x(t).exec(_);if(m){var L=_.slice(m.index+m[0].length);e.className=_.slice(0,m.index)+(L?m[1]+L:"")}};function S(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function A(e,t){return S(e).appendChild(t)}function p(e,t,_,m){var L=document.createElement(e);if(_&&(L.className=_),m&&(L.style.cssText=m),typeof t=="string")L.appendChild(document.createTextNode(t));else if(t)for(var N=0;N<t.length;++N)L.appendChild(t[N]);return L}function I(e,t,_,m){var L=p(e,t,_,m);return L.setAttribute("role","presentation"),L}var M;document.createRange?M=function(e,t,_,m){var L=document.createRange();return L.setEnd(m||e,_),L.setStart(e,t),L}:M=function(e,t,_){var m=document.body.createTextRange();try{m.moveToElementText(e.parentNode)}catch(L){return m}return m.collapse(!0),m.moveEnd("character",_),m.moveStart("character",t),m};function P(e,t){if(t.nodeType==3&&(t=t.parentNode),e.contains)return e.contains(t);do if(t.nodeType==11&&(t=t.host),t==e)return!0;while(t=t.parentNode)}function B(){var e;try{e=document.activeElement}catch(t){e=document.body||null}for(;e&&e.shadowRoot&&e.shadowRoot.activeElement;)e=e.shadowRoot.activeElement;return e}function H(e,t){var _=e.className;x(t).test(_)||(e.className+=(_?" ":"")+t)}function F(e,t){for(var _=e.split(" "),m=0;m<_.length;m++)_[m]&&!x(_[m]).test(t)&&(t+=" "+_[m]);return t}var W=function(e){e.select()};n?W=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:E&&(W=function(e){try{e.select()}catch(t){}});function U(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function K(e,t,_){t||(t={});for(var m in e)e.hasOwnProperty(m)&&(_!==!1||!t.hasOwnProperty(m))&&(t[m]=e[m]);return t}function G(e,t,_,m,L){t==null&&(t=e.search(/[^\s\u00a0]/),t==-1&&(t=e.length));for(var N=m||0,V=L||0;;){var Q=e.indexOf(" ",N);if(Q<0||Q>=t)return V+(t-N);V+=Q-N,V+=_-V%_,N=Q+1}}var ae=function(){this.id=null,this.f=null,this.time=0,this.handler=U(this.onTimeout,this)};ae.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},ae.prototype.set=function(e,t){this.f=t;var _=+new Date+e;(!this.id||_<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,e),this.time=_)};function fe(e,t){for(var _=0;_<e.length;++_)if(e[_]==t)return _;return-1}var Se=50,Ue={toString:function(){return"CodeMirror.Pass"}},Ne={scroll:!1},xe={origin:"*mouse"},Ce={origin:"+move"};function De(e,t,_){for(var m=0,L=0;;){var N=e.indexOf(" ",m);N==-1&&(N=e.length);var V=N-m;if(N==e.length||L+V>=t)return m+Math.min(V,t-L);if(L+=N-m,L+=_-L%_,m=N+1,L>=t)return m}}var ve=[""];function Re(e){for(;ve.length<=e;)ve.push(ee(ve)+" ");return ve[e]}function ee(e){return e[e.length-1]}function ge(e,t){for(var _=[],m=0;m<e.length;m++)_[m]=t(e[m],m);return _}function se(e,t,_){for(var m=0,L=_(t);m<e.length&&_(e[m])<=L;)m++;e.splice(m,0,t)}function Fe(){}function je(e,t){var _;return Object.create?_=Object.create(e):(Fe.prototype=e,_=new Fe),t&&K(t,_),_}var Ke=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function ze(e){return/\w/.test(e)||e>"\x80"&&(e.toUpperCase()!=e.toLowerCase()||Ke.test(e))}function Ge(e,t){return t?t.source.indexOf("\\w")>-1&&ze(e)?!0:t.test(e):ze(e)}function He(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var Ie=/[\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 ke(e){return e.charCodeAt(0)>=768&&Ie.test(e)}function Ae(e,t,_){for(;(_<0?t>0:t<e.length)&&ke(e.charAt(t));)t+=_;return t}function Te(e,t,_){for(var m=t>_?-1:1;;){if(t==_)return t;var L=(t+_)/2,N=m<0?Math.ceil(L):Math.floor(L);if(N==t)return e(N)?t:_;e(N)?_=N:t=N+m}}function Z(e,t,_,m){if(!e)return m(t,_,"ltr",0);for(var L=!1,N=0;N<e.length;++N){var V=e[N];(V.from<_&&V.to>t||t==_&&V.to==t)&&(m(Math.max(V.from,t),Math.min(V.to,_),V.level==1?"rtl":"ltr",N),L=!0)}L||m(t,_,"ltr")}var ce=null;function J(e,t,_){var m;ce=null;for(var L=0;L<e.length;++L){var N=e[L];if(N.from<t&&N.to>t)return L;N.to==t&&(N.from!=N.to&&_=="before"?m=L:ce=L),N.from==t&&(N.from!=N.to&&_!="before"?m=L:ce=L)}return m!=null?m:ce}var Le=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function _(te){return te<=247?e.charAt(te):1424<=te&&te<=1524?"R":1536<=te&&te<=1785?t.charAt(te-1536):1774<=te&&te<=2220?"r":8192<=te&&te<=8203?"w":te==8204?"b":"L"}var m=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,L=/[stwN]/,N=/[LRr]/,V=/[Lb1n]/,Q=/[1n]/;function q(te,be,we){this.level=te,this.from=be,this.to=we}return function(te,be){var we=be=="ltr"?"L":"R";if(te.length==0||be=="ltr"&&!m.test(te))return!1;for(var Xe=te.length,Be=[],Qe=0;Qe<Xe;++Qe)Be.push(_(te.charCodeAt(Qe)));for(var Ze=0,nt=we;Ze<Xe;++Ze){var at=Be[Ze];at=="m"?Be[Ze]=nt:nt=at}for(var lt=0,ot=we;lt<Xe;++lt){var ut=Be[lt];ut=="1"&&ot=="r"?Be[lt]="n":N.test(ut)&&(ot=ut,ut=="r"&&(Be[lt]="R"))}for(var gt=1,ft=Be[0];gt<Xe-1;++gt){var xt=Be[gt];xt=="+"&&ft=="1"&&Be[gt+1]=="1"?Be[gt]="1":xt==","&&ft==Be[gt+1]&&(ft=="1"||ft=="n")&&(Be[gt]=ft),ft=xt}for(var Nt=0;Nt<Xe;++Nt){var qt=Be[Nt];if(qt==",")Be[Nt]="N";else if(qt=="%"){var Xt=void 0;for(Xt=Nt+1;Xt<Xe&&Be[Xt]=="%";++Xt);for(var gr=Nt&&Be[Nt-1]=="!"||Xt<Xe&&Be[Xt]=="1"?"1":"N",hr=Nt;hr<Xt;++hr)Be[hr]=gr;Nt=Xt-1}}for(var Wt=0,fr=we;Wt<Xe;++Wt){var Jt=Be[Wt];fr=="L"&&Jt=="1"?Be[Wt]="L":N.test(Jt)&&(fr=Jt)}for(var Vt=0;Vt<Xe;++Vt)if(L.test(Be[Vt])){var zt=void 0;for(zt=Vt+1;zt<Xe&&L.test(Be[zt]);++zt);for(var Ht=(Vt?Be[Vt-1]:we)=="L",pr=(zt<Xe?Be[zt]:we)=="L",jn=Ht==pr?Ht?"L":"R":we,Jr=Vt;Jr<zt;++Jr)Be[Jr]=jn;Vt=zt-1}for(var rr=[],Ir,Zt=0;Zt<Xe;)if(V.test(Be[Zt])){var Ga=Zt;for(++Zt;Zt<Xe&&V.test(Be[Zt]);++Zt);rr.push(new q(0,Ga,Zt))}else{var jr=Zt,mn=rr.length,gn=be=="rtl"?1:0;for(++Zt;Zt<Xe&&Be[Zt]!="L";++Zt);for(var ar=jr;ar<Zt;)if(Q.test(Be[ar])){jr<ar&&(rr.splice(mn,0,new q(1,jr,ar)),mn+=gn);var Wn=ar;for(++ar;ar<Zt&&Q.test(Be[ar]);++ar);rr.splice(mn,0,new q(2,Wn,ar)),mn+=gn,jr=ar}else++ar;jr<Zt&&rr.splice(mn,0,new q(1,jr,Zt))}return be=="ltr"&&(rr[0].level==1&&(Ir=te.match(/^\s+/))&&(rr[0].from=Ir[0].length,rr.unshift(new q(0,0,Ir[0].length))),ee(rr).level==1&&(Ir=te.match(/\s+$/))&&(ee(rr).to-=Ir[0].length,rr.push(new q(0,Xe-Ir[0].length,Xe)))),be=="rtl"?rr.reverse():rr}}();function We(e,t){var _=e.order;return _==null&&(_=e.order=Le(e.text,t)),_}var Ve=[],Me=function(e,t,_){if(e.addEventListener)e.addEventListener(t,_,!1);else if(e.attachEvent)e.attachEvent("on"+t,_);else{var m=e._handlers||(e._handlers={});m[t]=(m[t]||Ve).concat(_)}};function et(e,t){return e._handlers&&e._handlers[t]||Ve}function ne(e,t,_){if(e.removeEventListener)e.removeEventListener(t,_,!1);else if(e.detachEvent)e.detachEvent("on"+t,_);else{var m=e._handlers,L=m&&m[t];if(L){var N=fe(L,_);N>-1&&(m[t]=L.slice(0,N).concat(L.slice(N+1)))}}}function Ee(e,t){var _=et(e,t);if(!_.length)return;for(var m=Array.prototype.slice.call(arguments,2),L=0;L<_.length;++L)_[L].apply(null,m)}function Oe(e,t,_){return typeof t=="string"&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),Ee(e,_||t.type,e,t),z(t)||t.codemirrorIgnore}function me(e){var t=e._handlers&&e._handlers.cursorActivity;if(!t)return;for(var _=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),m=0;m<t.length;++m)fe(_,t[m])==-1&&_.push(t[m])}function ue(e,t){return et(e,t).length>0}function he(e){e.prototype.on=function(t,_){Me(this,t,_)},e.prototype.off=function(t,_){ne(this,t,_)}}function Y(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function $(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function z(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function oe(e){Y(e),$(e)}function _e(e){return e.target||e.srcElement}function X(e){var t=e.which;return t==null&&(e.button&1?t=1:e.button&2?t=3:e.button&4&&(t=2)),f&&e.ctrlKey&&t==1&&(t=3),t}var de=function(){if(E&&y<9)return!1;var e=p("div");return"draggable"in e||"dragDrop"in e}(),ye;function ie(e){if(ye==null){var t=p("span","\u200B");A(e,p("span",[t,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(ye=t.offsetWidth<=1&&t.offsetHeight>2&&!(E&&y<8))}var _=ye?p("span","\u200B"):p("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return _.setAttribute("cm-text",""),_}var pe;function Pe(e){if(pe!=null)return pe;var t=A(e,document.createTextNode("A\u062EA")),_=M(t,0,1).getBoundingClientRect(),m=M(t,1,2).getBoundingClientRect();return S(e),!_||_.left==_.right?!1:pe=m.right-_.right<3}var $e=`
|
|
|
|
|
|
b`.split(/\n/).length!=3?function(e){for(var t=0,_=[],m=e.length;t<=m;){var L=e.indexOf(`
|
|
|
`,t);L==-1&&(L=e.length);var N=e.slice(t,e.charAt(L-1)=="\r"?L-1:L),V=N.indexOf("\r");V!=-1?(_.push(N.slice(0,V)),t+=V+1):(_.push(N),t=L+1)}return _}:function(e){return e.split(/\r\n?|\n/)},Ye=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(t){return!1}}:function(e){var t;try{t=e.ownerDocument.selection.createRange()}catch(_){}return!t||t.parentElement()!=e?!1:t.compareEndPoints("StartToEnd",t)!=0},qe=function(){var e=p("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),st=null;function mt(e){if(st!=null)return st;var t=A(e,p("span","x")),_=t.getBoundingClientRect(),m=M(t,0,1).getBoundingClientRect();return st=Math.abs(_.left-m.left)>1}var ct={},it={};function yt(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),ct[e]=t}function Et(e,t){it[e]=t}function St(e){if(typeof e=="string"&&it.hasOwnProperty(e))e=it[e];else if(e&&typeof e.name=="string"&&it.hasOwnProperty(e.name)){var t=it[e.name];typeof t=="string"&&(t={name:t}),e=je(t,e),e.name=t.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return St("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return St("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function Kt(e,t){t=St(t);var _=ct[t.name];if(!_)return Kt(e,"text/plain");var m=_(e,t);if(Bt.hasOwnProperty(t.name)){var L=Bt[t.name];for(var N in L){if(!L.hasOwnProperty(N))continue;m.hasOwnProperty(N)&&(m["_"+N]=m[N]),m[N]=L[N]}}if(m.name=t.name,t.helperType&&(m.helperType=t.helperType),t.modeProps)for(var V in t.modeProps)m[V]=t.modeProps[V];return m}var Bt={};function Pt(e,t){var _=Bt.hasOwnProperty(e)?Bt[e]:Bt[e]={};K(t,_)}function Ot(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var _={};for(var m in t){var L=t[m];L instanceof Array&&(L=L.concat([])),_[m]=L}return _}function It(e,t){for(var _;e.innerMode&&!(_=e.innerMode(t),!_||_.mode==e);)t=_.state,e=_.mode;return _||{mode:e,state:t}}function or(e,t,_){return e.startState?e.startState(t,_):!0}var Lt=function(e,t,_){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=_};Lt.prototype.eol=function(){return this.pos>=this.string.length},Lt.prototype.sol=function(){return this.pos==this.lineStart},Lt.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Lt.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},Lt.prototype.eat=function(e){var t=this.string.charAt(this.pos),_;if(typeof e=="string"?_=t==e:_=t&&(e.test?e.test(t):e(t)),_)return++this.pos,t},Lt.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},Lt.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},Lt.prototype.skipToEnd=function(){this.pos=this.string.length},Lt.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},Lt.prototype.backUp=function(e){this.pos-=e},Lt.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=G(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?G(this.string,this.lineStart,this.tabSize):0)},Lt.prototype.indentation=function(){return G(this.string,null,this.tabSize)-(this.lineStart?G(this.string,this.lineStart,this.tabSize):0)},Lt.prototype.match=function(e,t,_){if(typeof e=="string"){var m=function(V){return _?V.toLowerCase():V},L=this.string.substr(this.pos,e.length);if(m(L)==m(e))return t!==!1&&(this.pos+=e.length),!0}else{var N=this.string.slice(this.pos).match(e);return N&&N.index>0?null:(N&&t!==!1&&(this.pos+=N[0].length),N)}},Lt.prototype.current=function(){return this.string.slice(this.start,this.pos)},Lt.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},Lt.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},Lt.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function dt(e,t){if(t-=e.first,t<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var _=e;!_.lines;)for(var m=0;;++m){var L=_.children[m],N=L.chunkSize();if(t<N){_=L;break}t-=N}return _.lines[t]}function Pr(e,t,_){var m=[],L=t.line;return e.iter(t.line,_.line+1,function(N){var V=N.text;L==_.line&&(V=V.slice(0,_.ch)),L==t.line&&(V=V.slice(t.ch)),m.push(V),++L}),m}function vn(e,t,_){var m=[];return e.iter(t,_,function(L){m.push(L.text)}),m}function sr(e,t){var _=t-e.height;if(_)for(var m=e;m;m=m.parent)m.height+=_}function kt(e){if(e.parent==null)return null;for(var t=e.parent,_=fe(t.lines,e),m=t.parent;m;t=m,m=m.parent)for(var L=0;!(m.children[L]==t);++L)_+=m.children[L].chunkSize();return _+t.first}function Er(e,t){var _=e.first;e:do{for(var m=0;m<e.children.length;++m){var L=e.children[m],N=L.height;if(t<N){e=L;continue e}t-=N,_+=L.chunkSize()}return _}while(!e.lines);for(var V=0;V<e.lines.length;++V){var Q=e.lines[V],q=Q.height;if(t<q)break;t-=q}return _+V}function Fr(e,t){return t>=e.first&&t<e.first+e.size}function _n(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function tt(e,t,_){if(_===void 0&&(_=null),!(this instanceof tt))return new tt(e,t,_);this.line=e,this.ch=t,this.sticky=_}function vt(e,t){return e.line-t.line||e.ch-t.ch}function zn(e,t){return e.sticky==t.sticky&&vt(e,t)==0}function yn(e){return tt(e.line,e.ch)}function bn(e,t){return vt(e,t)<0?t:e}function en(e,t){return vt(e,t)<0?e:t}function xn(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function bt(e,t){if(t.line<e.first)return tt(e.first,0);var _=e.first+e.size-1;return t.line>_?tt(_,dt(e,_).text.length):Ai(t,dt(e,t.line).text.length)}function Ai(e,t){var _=e.ch;return _==null||_>t?tt(e.line,t):_<0?tt(e.line,0):e}function rt(e,t){for(var _=[],m=0;m<t.length;m++)_[m]=bt(e,t[m]);return _}var En=function(e,t){this.state=e,this.lookAhead=t},br=function(e,t,_,m){this.state=t,this.doc=e,this.line=_,this.maxLookAhead=m||0,this.baseTokens=null,this.baseTokenPos=1};br.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return t!=null&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},br.prototype.baseToken=function(e){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=e;)this.baseTokenPos+=2;var t=this.baseTokens[this.baseTokenPos+1];return{type:t&&t.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-e}},br.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},br.fromSaved=function(e,t,_){return t instanceof En?new br(e,Ot(e.mode,t.state),_,t.lookAhead):new br(e,Ot(e.mode,t),_)},br.prototype.save=function(e){var t=e!==!1?Ot(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new En(t,this.maxLookAhead):t};function Gn(e,t,_,m){var L=[e.state.modeGen],N={};Tr(e,t.text,e.doc.mode,_,function(te,be){return L.push(te,be)},N,m);for(var V=_.state,Q=function(te){_.baseTokens=L;var be=e.state.overlays[te],we=1,Xe=0;_.state=!0,Tr(e,t.text,be.mode,_,function(Be,Qe){for(var Ze=we;Xe<Be;){var nt=L[we];nt>Be&&L.splice(we,1,Be,L[we+1],nt),we+=2,Xe=Math.min(Be,nt)}if(!Qe)return;if(be.opaque)L.splice(Ze,we-Ze,Be,"overlay "+Qe),we=Ze+2;else for(;Ze<we;Ze+=2){var at=L[Ze+1];L[Ze+1]=(at?at+" ":"")+"overlay "+Qe}},N),_.state=V,_.baseTokens=null,_.baseTokenPos=1},q=0;q<e.state.overlays.length;++q)Q(q);return{styles:L,classes:N.bgClass||N.textClass?N:null}}function tn(e,t,_){if(!t.styles||t.styles[0]!=e.state.modeGen){var m=Sr(e,kt(t)),L=t.text.length>e.options.maxHighlightLength&&Ot(e.doc.mode,m.state),N=Gn(e,t,m);L&&(m.state=L),t.stateAfter=m.save(!L),t.styles=N.styles,N.classes?t.styleClasses=N.classes:t.styleClasses&&(t.styleClasses=null),_===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function Sr(e,t,_){var m=e.doc,L=e.display;if(!m.mode.startState)return new br(m,!0,t);var N=ki(e,t,_),V=N>m.first&&dt(m,N-1).stateAfter,Q=V?br.fromSaved(m,V,N):new br(m,or(m.mode),N);return m.iter(N,t,function(q){Vn(e,q.text,Q);var te=Q.line;q.stateAfter=te==t-1||te%5==0||te>=L.viewFrom&&te<L.viewTo?Q.save():null,Q.nextLine()}),_&&(m.modeFrontier=Q.line),Q}function Vn(e,t,_,m){var L=e.doc.mode,N=new Lt(t,e.options.tabSize,_);for(N.start=N.pos=m||0,t==""&&Yn(L,_.state);!N.eol();)wr(L,N,_.state),N.start=N.pos}function Yn(e,t){if(e.blankLine)return e.blankLine(t);if(!e.innerMode)return;var _=It(e,t);if(_.mode.blankLine)return _.mode.blankLine(_.state)}function wr(e,t,_,m){for(var L=0;L<10;L++){m&&(m[0]=It(e,_).mode);var N=e.token(t,_);if(t.pos>t.start)return N}throw new Error("Mode "+e.name+" failed to advance stream.")}var Qn=function(e,t,_){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=_};function Li(e,t,_,m){var L=e.doc,N=L.mode,V;t=bt(L,t);var Q=dt(L,t.line),q=Sr(e,t.line,_),te=new Lt(Q.text,e.options.tabSize,q),be;for(m&&(be=[]);(m||te.pos<t.ch)&&!te.eol();)te.start=te.pos,V=wr(N,te,q.state),m&&be.push(new Qn(te,V,Ot(L.mode,q.state)));return m?be:new Qn(te,V,q.state)}function qn(e,t){if(e)for(;;){var _=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!_)break;e=e.slice(0,_.index)+e.slice(_.index+_[0].length);var m=_[1]?"bgClass":"textClass";t[m]==null?t[m]=_[2]:new RegExp("(?:^|\\s)"+_[2]+"(?:$|\\s)").test(t[m])||(t[m]+=" "+_[2])}return e}function Tr(e,t,_,m,L,N,V){var Q=_.flattenSpans;Q==null&&(Q=e.options.flattenSpans);var q=0,te=null,be=new Lt(t,e.options.tabSize,m),we,Xe=e.options.addModeClass&&[null];for(t==""&&qn(Yn(_,m.state),N);!be.eol();){if(be.pos>e.options.maxHighlightLength?(Q=!1,V&&Vn(e,t,m,be.pos),be.pos=t.length,we=null):we=qn(wr(_,be,m.state,Xe),N),Xe){var Be=Xe[0].name;Be&&(we="m-"+(we?Be+" "+we:Be))}if(!Q||te!=we){for(;q<be.start;)q=Math.min(be.start,q+5e3),L(q,te);te=we}be.start=be.pos}for(;q<be.pos;){var Qe=Math.min(be.pos,q+5e3);L(Qe,te),q=Qe}}function ki(e,t,_){for(var m,L,N=e.doc,V=_?-1:t-(e.doc.mode.innerMode?1e3:100),Q=t;Q>V;--Q){if(Q<=N.first)return N.first;var q=dt(N,Q-1),te=q.stateAfter;if(te&&(!_||Q+(te instanceof En?te.lookAhead:0)<=N.modeFrontier))return Q;var be=G(q.text,null,e.options.tabSize);(L==null||m>be)&&(L=Q-1,m=be)}return L}function aa(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),e.highlightFrontier<t-10)return;for(var _=e.first,m=t-1;m>_;m--){var L=dt(e,m).stateAfter;if(L&&(!(L instanceof En)||m+L.lookAhead<t)){_=m+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,_)}var Zn=!1,nr=!1;function Wr(){Zn=!0}function oa(){nr=!0}function rn(e,t,_){this.marker=e,this.from=t,this.to=_}function Cr(e,t){if(e)for(var _=0;_<e.length;++_){var m=e[_];if(m.marker==t)return m}}function $n(e,t){for(var _,m=0;m<e.length;++m)e[m]!=t&&(_||(_=[])).push(e[m]);return _}function sa(e,t){e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],t.marker.attachLine(e)}function Ri(e,t,_){var m;if(e)for(var L=0;L<e.length;++L){var N=e[L],V=N.marker,Q=N.from==null||(V.inclusiveLeft?N.from<=t:N.from<t);if(Q||N.from==t&&V.type=="bookmark"&&(!_||!N.marker.insertLeft)){var q=N.to==null||(V.inclusiveRight?N.to>=t:N.to>t);(m||(m=[])).push(new rn(V,N.from,q?null:N.to))}}return m}function Di(e,t,_){var m;if(e)for(var L=0;L<e.length;++L){var N=e[L],V=N.marker,Q=N.to==null||(V.inclusiveRight?N.to>=t:N.to>t);if(Q||N.from==t&&V.type=="bookmark"&&(!_||N.marker.insertLeft)){var q=N.from==null||(V.inclusiveLeft?N.from<=t:N.from<t);(m||(m=[])).push(new rn(V,q?null:N.from-t,N.to==null?null:N.to-t))}}return m}function Sn(e,t){if(t.full)return null;var _=Fr(e,t.from.line)&&dt(e,t.from.line).markedSpans,m=Fr(e,t.to.line)&&dt(e,t.to.line).markedSpans;if(!_&&!m)return null;var L=t.from.ch,N=t.to.ch,V=vt(t.from,t.to)==0,Q=Ri(_,L,V),q=Di(m,N,V),te=t.text.length==1,be=ee(t.text).length+(te?L:0);if(Q)for(var we=0;we<Q.length;++we){var Xe=Q[we];if(Xe.to==null){var Be=Cr(q,Xe.marker);Be?te&&(Xe.to=Be.to==null?null:Be.to+be):Xe.to=L}}if(q)for(var Qe=0;Qe<q.length;++Qe){var Ze=q[Qe];if(Ze.to!=null&&(Ze.to+=be),Ze.from==null){var nt=Cr(Q,Ze.marker);nt||(Ze.from=be,te&&(Q||(Q=[])).push(Ze))}else Ze.from+=be,te&&(Q||(Q=[])).push(Ze)}Q&&(Q=Oi(Q)),q&&q!=Q&&(q=Oi(q));var at=[Q];if(!te){var lt=t.text.length-2,ot;if(lt>0&&Q)for(var ut=0;ut<Q.length;++ut)Q[ut].to==null&&(ot||(ot=[])).push(new rn(Q[ut].marker,null,null));for(var gt=0;gt<lt;++gt)at.push(ot);at.push(q)}return at}function Oi(e){for(var t=0;t<e.length;++t){var _=e[t];_.from!=null&&_.from==_.to&&_.marker.clearWhenEmpty!==!1&&e.splice(t--,1)}return e.length?e:null}function Mi(e,t,_){var m=null;if(e.iter(t.line,_.line+1,function(Be){if(Be.markedSpans)for(var Qe=0;Qe<Be.markedSpans.length;++Qe){var Ze=Be.markedSpans[Qe].marker;Ze.readOnly&&(!m||fe(m,Ze)==-1)&&(m||(m=[])).push(Ze)}}),!m)return null;for(var L=[{from:t,to:_}],N=0;N<m.length;++N)for(var V=m[N],Q=V.find(0),q=0;q<L.length;++q){var te=L[q];if(vt(te.to,Q.from)<0||vt(te.from,Q.to)>0)continue;var be=[q,1],we=vt(te.from,Q.from),Xe=vt(te.to,Q.to);(we<0||!V.inclusiveLeft&&!we)&&be.push({from:te.from,to:Q.from}),(Xe>0||!V.inclusiveRight&&!Xe)&&be.push({from:Q.to,to:te.to}),L.splice.apply(L,be),q+=be.length-3}return L}function la(e){var t=e.markedSpans;if(!t)return;for(var _=0;_<t.length;++_)t[_].marker.detachLine(e);e.markedSpans=null}function wn(e,t){if(!t)return;for(var _=0;_<t.length;++_)t[_].marker.attachLine(e);e.markedSpans=t}function nn(e){return e.inclusiveLeft?-1:0}function an(e){return e.inclusiveRight?1:0}function Tn(e,t){var _=e.lines.length-t.lines.length;if(_!=0)return _;var m=e.find(),L=t.find(),N=vt(m.from,L.from)||nn(e)-nn(t);if(N)return-N;var V=vt(m.to,L.to)||an(e)-an(t);return V||t.id-e.id}function Nr(e,t){var _=nr&&e.markedSpans,m;if(_)for(var L=void 0,N=0;N<_.length;++N)L=_[N],L.marker.collapsed&&(t?L.from:L.to)==null&&(!m||Tn(m,L.marker)<0)&&(m=L.marker);return m}function Ur(e){return Nr(e,!0)}function Kr(e){return Nr(e,!1)}function Cn(e,t){var _=nr&&e.markedSpans,m;if(_)for(var L=0;L<_.length;++L){var N=_[L];N.marker.collapsed&&(N.from==null||N.from<t)&&(N.to==null||N.to>t)&&(!m||Tn(m,N.marker)<0)&&(m=N.marker)}return m}function Ii(e,t,_,m,L){var N=dt(e,t),V=nr&&N.markedSpans;if(V)for(var Q=0;Q<V.length;++Q){var q=V[Q];if(!q.marker.collapsed)continue;var te=q.marker.find(0),be=vt(te.from,_)||nn(q.marker)-nn(L),we=vt(te.to,m)||an(q.marker)-an(L);if(be>=0&&we<=0||be<=0&&we>=0)continue;if(be<=0&&(q.marker.inclusiveRight&&L.inclusiveLeft?vt(te.to,_)>=0:vt(te.to,_)>0)||be>=0&&(q.marker.inclusiveRight&&L.inclusiveLeft?vt(te.from,m)<=0:vt(te.from,m)<0))return!0}}function vr(e){for(var t;t=Ur(e);)e=t.find(-1,!0).line;return e}function Pi(e){for(var t;t=Kr(e);)e=t.find(1,!0).line;return e}function An(e){for(var t,_;t=Kr(e);)e=t.find(1,!0).line,(_||(_=[])).push(e);return _}function Jn(e,t){var _=dt(e,t),m=vr(_);return _==m?t:kt(m)}function zr(e,t){if(t>e.lastLine())return t;var _=dt(e,t),m;if(!Dr(e,_))return t;for(;m=Kr(_);)_=m.find(1,!0).line;return kt(_)+1}function Dr(e,t){var _=nr&&t.markedSpans;if(_)for(var m=void 0,L=0;L<_.length;++L){if(m=_[L],!m.marker.collapsed)continue;if(m.from==null)return!0;if(m.marker.widgetNode)continue;if(m.from==0&&m.marker.inclusiveLeft&&ei(e,t,m))return!0}}function ei(e,t,_){if(_.to==null){var m=_.marker.find(1,!0);return ei(e,m.line,Cr(m.line.markedSpans,_.marker))}if(_.marker.inclusiveRight&&_.to==t.text.length)return!0;for(var L=void 0,N=0;N<t.markedSpans.length;++N)if(L=t.markedSpans[N],L.marker.collapsed&&!L.marker.widgetNode&&L.from==_.to&&(L.to==null||L.to!=_.from)&&(L.marker.inclusiveLeft||_.marker.inclusiveRight)&&ei(e,t,L))return!0}function Ar(e){e=vr(e);for(var t=0,_=e.parent,m=0;m<_.lines.length;++m){var L=_.lines[m];if(L==e)break;t+=L.height}for(var N=_.parent;N;_=N,N=_.parent)for(var V=0;V<N.children.length;++V){var Q=N.children[V];if(Q==_)break;t+=Q.height}return t}function ti(e){if(e.height==0)return 0;for(var t=e.text.length,_,m=e;_=Ur(m);){var L=_.find(0,!0);m=L.from.line,t+=L.from.ch-L.to.ch}for(m=e;_=Kr(m);){var N=_.find(0,!0);t-=m.text.length-N.from.ch,m=N.to.line,t+=m.text.length-N.to.ch}return t}function Fi(e){var t=e.display,_=e.doc;t.maxLine=dt(_,_.first),t.maxLineLength=ti(t.maxLine),t.maxLineChanged=!0,_.iter(function(m){var L=ti(m);L>t.maxLineLength&&(t.maxLineLength=L,t.maxLine=m)})}var on=function(e,t,_){this.text=e,wn(this,t),this.height=_?_(this):1};on.prototype.lineNo=function(){return kt(this)},he(on);function ua(e,t,_,m){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),la(e),wn(e,_);var L=m?m(e):1;L!=e.height&&sr(e,L)}function ht(e){e.parent=null,la(e)}var _t={},pt={};function wt(e,t){if(!e||/^\s*$/.test(e))return null;var _=t.addModeClass?pt:_t;return _[e]||(_[e]=e.replace(/\S+/g,"cm-$&"))}function At(e,t){var _=I("span",null,null,v?"padding-right: .1px":null),m={pre:I("pre",[_],"CodeMirror-line"),content:_,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var L=0;L<=(t.rest?t.rest.length:0);L++){var N=L?t.rest[L-1]:t.line,V=void 0;m.pos=0,m.addToken=Ct,Pe(e.display.measure)&&(V=We(N,e.doc.direction))&&(m.addToken=lr(m.addToken,V)),m.map=[];var Q=t!=e.display.externalMeasured&&kt(N);Br(N,m,tn(e,N,Q)),N.styleClasses&&(N.styleClasses.bgClass&&(m.bgClass=F(N.styleClasses.bgClass,m.bgClass||"")),N.styleClasses.textClass&&(m.textClass=F(N.styleClasses.textClass,m.textClass||""))),m.map.length==0&&m.map.push(0,0,m.content.appendChild(ie(e.display.measure))),L==0?(t.measure.map=m.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(m.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(v){var q=m.content.lastChild;(/\bcm-tab\b/.test(q.className)||q.querySelector&&q.querySelector(".cm-tab"))&&(m.content.className="cm-tab-wrap-hack")}return Ee(e,"renderLine",e,t.line,m.pre),m.pre.className&&(m.textClass=F(m.pre.className,m.textClass||"")),m}function Ft(e){var t=p("span","\u2022","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function Ct(e,t,_,m,L,N,V){if(!t)return;var Q=e.splitSpaces?Gt(t,e.trailingSpace):t,q=e.cm.state.specialChars,te=!1,be;if(!q.test(t))e.col+=t.length,be=document.createTextNode(Q),e.map.push(e.pos,e.pos+t.length,be),E&&y<9&&(te=!0),e.pos+=t.length;else{be=document.createDocumentFragment();for(var we=0;;){q.lastIndex=we;var Xe=q.exec(t),Be=Xe?Xe.index-we:t.length-we;if(Be){var Qe=document.createTextNode(Q.slice(we,we+Be));E&&y<9?be.appendChild(p("span",[Qe])):be.appendChild(Qe),e.map.push(e.pos,e.pos+Be,Qe),e.col+=Be,e.pos+=Be}if(!Xe)break;we+=Be+1;var Ze=void 0;if(Xe[0]==" "){var nt=e.cm.options.tabSize,at=nt-e.col%nt;Ze=be.appendChild(p("span",Re(at),"cm-tab")),Ze.setAttribute("role","presentation"),Ze.setAttribute("cm-text"," "),e.col+=at}else Xe[0]=="\r"||Xe[0]==`
|
|
|
`?(Ze=be.appendChild(p("span",Xe[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),Ze.setAttribute("cm-text",Xe[0]),e.col+=1):(Ze=e.cm.options.specialCharPlaceholder(Xe[0]),Ze.setAttribute("cm-text",Xe[0]),E&&y<9?be.appendChild(p("span",[Ze])):be.appendChild(Ze),e.col+=1);e.map.push(e.pos,e.pos+1,Ze),e.pos++}}if(e.trailingSpace=Q.charCodeAt(t.length-1)==32,_||m||L||te||N||V){var lt=_||"";m&&(lt+=m),L&&(lt+=L);var ot=p("span",[be],lt,N);if(V)for(var ut in V)V.hasOwnProperty(ut)&&ut!="style"&&ut!="class"&&ot.setAttribute(ut,V[ut]);return e.content.appendChild(ot)}e.content.appendChild(be)}function Gt(e,t){if(e.length>1&&!/ /.test(e))return e;for(var _=t,m="",L=0;L<e.length;L++){var N=e.charAt(L);N==" "&&_&&(L==e.length-1||e.charCodeAt(L+1)==32)&&(N="\xA0"),m+=N,_=N==" "}return m}function lr(e,t){return function(_,m,L,N,V,Q,q){L=L?L+" cm-force-border":"cm-force-border";for(var te=_.pos,be=te+m.length;;){for(var we=void 0,Xe=0;Xe<t.length&&!(we=t[Xe],we.to>te&&we.from<=te);Xe++);if(we.to>=be)return e(_,m,L,N,V,Q,q);e(_,m.slice(0,we.to-te),L,N,null,Q,q),N=null,m=m.slice(we.to-te),te=we.to}}}function Tt(e,t,_,m){var L=!m&&_.widgetNode;L&&e.map.push(e.pos,e.pos+t,L),!m&&e.cm.display.input.needsContentAttribute&&(L||(L=e.content.appendChild(document.createElement("span"))),L.setAttribute("cm-marker",_.id)),L&&(e.cm.display.input.setUneditable(L),e.content.appendChild(L)),e.pos+=t,e.trailingSpace=!1}function Br(e,t,_){var m=e.markedSpans,L=e.text,N=0;if(!m){for(var V=1;V<_.length;V+=2)t.addToken(t,L.slice(N,N=_[V]),wt(_[V+1],t.cm.options));return}for(var Q=L.length,q=0,te=1,be="",we,Xe,Be=0,Qe,Ze,nt,at,lt;;){if(Be==q){Qe=Ze=nt=Xe="",lt=null,at=null,Be=Infinity;for(var ot=[],ut=void 0,gt=0;gt<m.length;++gt){var ft=m[gt],xt=ft.marker;if(xt.type=="bookmark"&&ft.from==q&&xt.widgetNode)ot.push(xt);else if(ft.from<=q&&(ft.to==null||ft.to>q||xt.collapsed&&ft.to==q&&ft.from==q)){if(ft.to!=null&&ft.to!=q&&Be>ft.to&&(Be=ft.to,Ze=""),xt.className&&(Qe+=" "+xt.className),xt.css&&(Xe=(Xe?Xe+";":"")+xt.css),xt.startStyle&&ft.from==q&&(nt+=" "+xt.startStyle),xt.endStyle&&ft.to==Be&&(ut||(ut=[])).push(xt.endStyle,ft.to),xt.title&&((lt||(lt={})).title=xt.title),xt.attributes)for(var Nt in xt.attributes)(lt||(lt={}))[Nt]=xt.attributes[Nt];xt.collapsed&&(!at||Tn(at.marker,xt)<0)&&(at=ft)}else ft.from>q&&Be>ft.from&&(Be=ft.from)}if(ut)for(var qt=0;qt<ut.length;qt+=2)ut[qt+1]==Be&&(Ze+=" "+ut[qt]);if(!at||at.from==q)for(var Xt=0;Xt<ot.length;++Xt)Tt(t,0,ot[Xt]);if(at&&(at.from||0)==q){if(Tt(t,(at.to==null?Q+1:at.to)-q,at.marker,at.from==null),at.to==null)return;at.to==q&&(at=!1)}}if(q>=Q)break;for(var gr=Math.min(Q,Be);;){if(be){var hr=q+be.length;if(!at){var Wt=hr>gr?be.slice(0,gr-q):be;t.addToken(t,Wt,we?we+Qe:Qe,nt,q+Wt.length==Be?Ze:"",Xe,lt)}if(hr>=gr){be=be.slice(gr-q),q=gr;break}q=hr,nt=""}be=L.slice(N,N=_[te++]),we=wt(_[te++],t.cm.options)}}}function Rt(e,t,_){this.line=t,this.rest=An(t),this.size=this.rest?kt(ee(this.rest))-_+1:1,this.node=this.text=null,this.hidden=Dr(e,t)}function ur(e,t,_){for(var m=[],L,N=t;N<_;N=L){var V=new Rt(e.doc,dt(e.doc,N),N);L=N+V.size,m.push(V)}return m}var er=null;function xr(e){er?er.ops.push(e):e.ownsGroup=er={ops:[e],delayedCallbacks:[]}}function Rs(e){var t=e.delayedCallbacks,_=0;do{for(;_<t.length;_++)t[_].call(null);for(var m=0;m<e.ops.length;m++){var L=e.ops[m];if(L.cursorActivityHandlers)for(;L.cursorActivityCalled<L.cursorActivityHandlers.length;)L.cursorActivityHandlers[L.cursorActivityCalled++].call(null,L.cm)}}while(_<t.length)}function Ds(e,t){var _=e.ownsGroup;if(!_)return;try{Rs(_)}finally{er=null,t(_)}}var ri=null;function $t(e,t){var _=et(e,t);if(!_.length)return;var m=Array.prototype.slice.call(arguments,2),L;er?L=er.delayedCallbacks:ri?L=ri:(L=ri=[],setTimeout(Os,0));for(var N=function(Q){L.push(function(){return _[Q].apply(null,m)})},V=0;V<_.length;++V)N(V)}function Os(){var e=ri;ri=null;for(var t=0;t<e.length;++t)e[t]()}function Ya(e,t,_,m){for(var L=0;L<t.changes.length;L++){var N=t.changes[L];N=="text"?Is(e,t):N=="gutter"?qa(e,t,_,m):N=="class"?ca(e,t):N=="widget"&&Ps(e,t,m)}t.changes=null}function ni(e){return e.node==e.text&&(e.node=p("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),E&&y<8&&(e.node.style.zIndex=2)),e.node}function Ms(e,t){var _=t.bgClass?t.bgClass+" "+(t.line.bgClass||""):t.line.bgClass;if(_&&(_+=" CodeMirror-linebackground"),t.background)_?t.background.className=_:(t.background.parentNode.removeChild(t.background),t.background=null);else if(_){var m=ni(t);t.background=m.insertBefore(p("div",null,_),m.firstChild),e.display.input.setUneditable(t.background)}}function Qa(e,t){var _=e.display.externalMeasured;return _&&_.line==t.line?(e.display.externalMeasured=null,t.measure=_.measure,_.built):At(e,t)}function Is(e,t){var _=t.text.className,m=Qa(e,t);t.text==t.node&&(t.node=m.pre),t.text.parentNode.replaceChild(m.pre,t.text),t.text=m.pre,m.bgClass!=t.bgClass||m.textClass!=t.textClass?(t.bgClass=m.bgClass,t.textClass=m.textClass,ca(e,t)):_&&(t.text.className=_)}function ca(e,t){Ms(e,t),t.line.wrapClass?ni(t).className=t.line.wrapClass:t.node!=t.text&&(t.node.className="");var _=t.textClass?t.textClass+" "+(t.line.textClass||""):t.line.textClass;t.text.className=_||""}function qa(e,t,_,m){if(t.gutter&&(t.node.removeChild(t.gutter),t.gutter=null),t.gutterBackground&&(t.node.removeChild(t.gutterBackground),t.gutterBackground=null),t.line.gutterClass){var L=ni(t);t.gutterBackground=p("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(e.options.fixedGutter?m.fixedPos:-m.gutterTotalWidth)+"px; width: "+m.gutterTotalWidth+"px"),e.display.input.setUneditable(t.gutterBackground),L.insertBefore(t.gutterBackground,t.text)}var N=t.line.gutterMarkers;if(e.options.lineNumbers||N){var V=ni(t),Q=t.gutter=p("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?m.fixedPos:-m.gutterTotalWidth)+"px");if(e.display.input.setUneditable(Q),V.insertBefore(Q,t.text),t.line.gutterClass&&(Q.className+=" "+t.line.gutterClass),e.options.lineNumbers&&(!N||!N["CodeMirror-linenumbers"])&&(t.lineNumber=Q.appendChild(p("div",_n(e.options,_),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+m.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),N)for(var q=0;q<e.display.gutterSpecs.length;++q){var te=e.display.gutterSpecs[q].className,be=N.hasOwnProperty(te)&&N[te];be&&Q.appendChild(p("div",[be],"CodeMirror-gutter-elt","left: "+m.gutterLeft[te]+"px; width: "+m.gutterWidth[te]+"px"))}}}function Ps(e,t,_){t.alignable&&(t.alignable=null);for(var m=x("CodeMirror-linewidget"),L=t.node.firstChild,N=void 0;L;L=N)N=L.nextSibling,m.test(L.className)&&t.node.removeChild(L);Za(e,t,_)}function Fs(e,t,_,m){var L=Qa(e,t);return t.text=t.node=L.pre,L.bgClass&&(t.bgClass=L.bgClass),L.textClass&&(t.textClass=L.textClass),ca(e,t),qa(e,t,_,m),Za(e,t,m),t.node}function Za(e,t,_){if($a(e,t.line,t,_,!0),t.rest)for(var m=0;m<t.rest.length;m++)$a(e,t.rest[m],t,_,!1)}function $a(e,t,_,m,L){if(!t.widgets)return;for(var N=ni(_),V=0,Q=t.widgets;V<Q.length;++V){var q=Q[V],te=p("div",[q.node],"CodeMirror-linewidget"+(q.className?" "+q.className:""));q.handleMouseEvents||te.setAttribute("cm-ignore-events","true"),Ns(q,te,_,m),e.display.input.setUneditable(te),L&&q.above?N.insertBefore(te,_.gutter||_.text):N.appendChild(te),$t(q,"redraw")}}function Ns(e,t,_,m){if(e.noHScroll){(_.alignable||(_.alignable=[])).push(t);var L=m.wrapperWidth;t.style.left=m.fixedPos+"px",e.coverGutter||(L-=m.gutterTotalWidth,t.style.paddingLeft=m.gutterTotalWidth+"px"),t.style.width=L+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-m.gutterTotalWidth+"px"))}function ii(e){if(e.height!=null)return e.height;var t=e.doc.cm;if(!t)return 0;if(!P(document.body,e.node)){var _="position: relative;";e.coverGutter&&(_+="margin-left: -"+t.display.gutters.offsetWidth+"px;"),e.noHScroll&&(_+="width: "+t.display.wrapper.clientWidth+"px;"),A(t.display.measure,p("div",[e.node],null,_))}return e.height=e.node.parentNode.offsetHeight}function Xr(e,t){for(var _=_e(t);_!=e.wrapper;_=_.parentNode)if(!_||_.nodeType==1&&_.getAttribute("cm-ignore-events")=="true"||_.parentNode==e.sizer&&_!=e.mover)return!0}function Ni(e){return e.lineSpace.offsetTop}function da(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function Ja(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=A(e.measure,p("pre","x","CodeMirror-line-like")),_=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,m={left:parseInt(_.paddingLeft),right:parseInt(_.paddingRight)};return!isNaN(m.left)&&!isNaN(m.right)&&(e.cachedPaddingH=m),m}function Or(e){return Se-e.display.nativeBarWidth}function sn(e){return e.display.scroller.clientWidth-Or(e)-e.display.barWidth}function ha(e){return e.display.scroller.clientHeight-Or(e)-e.display.barHeight}function Us(e,t,_){var m=e.options.lineWrapping,L=m&&sn(e);if(!t.measure.heights||m&&t.measure.width!=L){var N=t.measure.heights=[];if(m){t.measure.width=L;for(var V=t.text.firstChild.getClientRects(),Q=0;Q<V.length-1;Q++){var q=V[Q],te=V[Q+1];Math.abs(q.bottom-te.bottom)>2&&N.push((q.bottom+te.top)/2-_.top)}}N.push(_.bottom-_.top)}}function eo(e,t,_){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(var m=0;m<e.rest.length;m++)if(e.rest[m]==t)return{map:e.measure.maps[m],cache:e.measure.caches[m]};for(var L=0;L<e.rest.length;L++)if(kt(e.rest[L])>_)return{map:e.measure.maps[L],cache:e.measure.caches[L],before:!0}}function Ks(e,t){t=vr(t);var _=kt(t),m=e.display.externalMeasured=new Rt(e.doc,t,_);m.lineN=_;var L=m.built=At(e,m);return m.text=L.pre,A(e.display.lineMeasure,L.pre),m}function to(e,t,_,m){return Mr(e,Ln(e,t),_,m)}function fa(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[cn(e,t)];var _=e.display.externalMeasured;if(_&&t>=_.lineN&&t<_.lineN+_.size)return _}function Ln(e,t){var _=kt(t),m=fa(e,_);m&&!m.text?m=null:m&&m.changes&&(Ya(e,m,_,ya(e)),e.curOp.forceUpdate=!0),m||(m=Ks(e,t));var L=eo(m,t,_);return{line:t,view:m,rect:null,map:L.map,cache:L.cache,before:L.before,hasHeights:!1}}function Mr(e,t,_,m,L){t.before&&(_=-1);var N=_+(m||""),V;return t.cache.hasOwnProperty(N)?V=t.cache[N]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(Us(e,t.view,t.rect),t.hasHeights=!0),V=Xs(e,t,_,m),V.bogus||(t.cache[N]=V)),{left:V.left,right:V.right,top:L?V.rtop:V.top,bottom:L?V.rbottom:V.bottom}}var ro={left:0,right:0,top:0,bottom:0};function no(e,t,_){for(var m,L,N,V,Q,q,te=0;te<e.length;te+=3)if(Q=e[te],q=e[te+1],t<Q?(L=0,N=1,V="left"):t<q?(L=t-Q,N=L+1):(te==e.length-3||t==q&&e[te+3]>t)&&(N=q-Q,L=N-1,t>=q&&(V="right")),L!=null){if(m=e[te+2],Q==q&&_==(m.insertLeft?"left":"right")&&(V=_),_=="left"&&L==0)for(;te&&e[te-2]==e[te-3]&&e[te-1].insertLeft;)m=e[(te-=3)+2],V="left";if(_=="right"&&L==q-Q)for(;te<e.length-3&&e[te+3]==e[te+4]&&!e[te+5].insertLeft;)m=e[(te+=3)+2],V="right";break}return{node:m,start:L,end:N,collapse:V,coverStart:Q,coverEnd:q}}function Bs(e,t){var _=ro;if(t=="left")for(var m=0;m<e.length&&!((_=e[m]).left!=_.right);m++);else for(var L=e.length-1;L>=0&&!((_=e[L]).left!=_.right);L--);return _}function Xs(e,t,_,m){var L=no(t.map,_,m),N=L.node,V=L.start,Q=L.end,q=L.collapse,te;if(N.nodeType==3){for(var be=0;be<4;be++){for(;V&&ke(t.line.text.charAt(L.coverStart+V));)--V;for(;L.coverStart+Q<L.coverEnd&&ke(t.line.text.charAt(L.coverStart+Q));)++Q;if(E&&y<9&&V==0&&Q==L.coverEnd-L.coverStart?te=N.parentNode.getBoundingClientRect():te=Bs(M(N,V,Q).getClientRects(),m),te.left||te.right||V==0)break;Q=V,V=V-1,q="right"}E&&y<11&&(te=Hs(e.display.measure,te))}else{V>0&&(q=m="right");var we;e.options.lineWrapping&&(we=N.getClientRects()).length>1?te=we[m=="right"?we.length-1:0]:te=N.getBoundingClientRect()}if(E&&y<9&&!V&&(!te||!te.left&&!te.right)){var Xe=N.parentNode.getClientRects()[0];Xe?te={left:Xe.left,right:Xe.left+Rn(e.display),top:Xe.top,bottom:Xe.bottom}:te=ro}for(var Be=te.top-t.rect.top,Qe=te.bottom-t.rect.top,Ze=(Be+Qe)/2,nt=t.view.measure.heights,at=0;at<nt.length-1&&!(Ze<nt[at]);at++);var lt=at?nt[at-1]:0,ot=nt[at],ut={left:(q=="right"?te.right:te.left)-t.rect.left,right:(q=="left"?te.left:te.right)-t.rect.left,top:lt,bottom:ot};return!te.left&&!te.right&&(ut.bogus=!0),e.options.singleCursorHeightPerLine||(ut.rtop=Be,ut.rbottom=Qe),ut}function Hs(e,t){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!mt(e))return t;var _=screen.logicalXDPI/screen.deviceXDPI,m=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*_,right:t.right*_,top:t.top*m,bottom:t.bottom*m}}function io(e){if(e.measure&&(e.measure.cache={},e.measure.heights=null,e.rest))for(var t=0;t<e.rest.length;t++)e.measure.caches[t]={}}function ao(e){e.display.externalMeasure=null,S(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)io(e.display.view[t])}function ai(e){ao(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function oo(){return a&&o?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function so(){return a&&o?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function pa(e){var t=0;if(e.widgets)for(var _=0;_<e.widgets.length;++_)e.widgets[_].above&&(t+=ii(e.widgets[_]));return t}function Ui(e,t,_,m,L){if(!L){var N=pa(t);_.top+=N,_.bottom+=N}if(m=="line")return _;m||(m="local");var V=Ar(t);if(m=="local"?V+=Ni(e.display):V-=e.display.viewOffset,m=="page"||m=="window"){var Q=e.display.lineSpace.getBoundingClientRect();V+=Q.top+(m=="window"?0:so());var q=Q.left+(m=="window"?0:oo());_.left+=q,_.right+=q}return _.top+=V,_.bottom+=V,_}function lo(e,t,_){if(_=="div")return t;var m=t.left,L=t.top;if(_=="page")m-=oo(),L-=so();else if(_=="local"||!_){var N=e.display.sizer.getBoundingClientRect();m+=N.left,L+=N.top}var V=e.display.lineSpace.getBoundingClientRect();return{left:m-V.left,top:L-V.top}}function ma(e,t,_,m,L){return m||(m=dt(e.doc,t.line)),Ui(e,m,to(e,m,t.ch,L),_)}function Lr(e,t,_,m,L,N){m=m||dt(e.doc,t.line),L||(L=Ln(e,m));function V(Qe,Ze){var nt=Mr(e,L,Qe,Ze?"right":"left",N);return Ze?nt.left=nt.right:nt.right=nt.left,Ui(e,m,nt,_)}var Q=We(m,e.doc.direction),q=t.ch,te=t.sticky;if(q>=m.text.length?(q=m.text.length,te="before"):q<=0&&(q=0,te="after"),!Q)return V(te=="before"?q-1:q,te=="before");function be(Qe,Ze,nt){var at=Q[Ze],lt=at.level==1;return V(nt?Qe-1:Qe,lt!=nt)}var we=J(Q,q,te),Xe=ce,Be=be(q,we,te=="before");return Xe!=null&&(Be.other=be(q,Xe,te!="before")),Be}function uo(e,t){var _=0;t=bt(e.doc,t),e.options.lineWrapping||(_=Rn(e.display)*t.ch);var m=dt(e.doc,t.line),L=Ar(m)+Ni(e.display);return{left:_,right:_,top:L,bottom:L+m.height}}function ga(e,t,_,m,L){var N=tt(e,t,_);return N.xRel=L,m&&(N.outside=m),N}function va(e,t,_){var m=e.doc;if(_+=e.display.viewOffset,_<0)return ga(m.first,0,null,-1,-1);var L=Er(m,_),N=m.first+m.size-1;if(L>N)return ga(m.first+m.size-1,dt(m,N).text.length,null,1,1);t<0&&(t=0);for(var V=dt(m,L);;){var Q=js(e,V,L,t,_),q=Cn(V,Q.ch+(Q.xRel>0||Q.outside>0?1:0));if(!q)return Q;var te=q.find(1);if(te.line==L)return te;V=dt(m,L=te.line)}}function co(e,t,_,m){m-=pa(t);var L=t.text.length,N=Te(function(V){return Mr(e,_,V-1).bottom<=m},L,0);return L=Te(function(V){return Mr(e,_,V).top>m},N,L),{begin:N,end:L}}function ho(e,t,_,m){_||(_=Ln(e,t));var L=Ui(e,t,Mr(e,_,m),"line").top;return co(e,t,_,L)}function _a(e,t,_,m){return e.bottom<=_?!1:e.top>_?!0:(m?e.left:e.right)>t}function js(e,t,_,m,L){L-=Ar(t);var N=Ln(e,t),V=pa(t),Q=0,q=t.text.length,te=!0,be=We(t,e.doc.direction);if(be){var we=(e.options.lineWrapping?zs:Ws)(e,t,_,N,be,m,L);te=we.level!=1,Q=te?we.from:we.to-1,q=te?we.to:we.from-1}var Xe=null,Be=null,Qe=Te(function(gt){var ft=Mr(e,N,gt);return ft.top+=V,ft.bottom+=V,_a(ft,m,L,!1)?(ft.top<=L&&ft.left<=m&&(Xe=gt,Be=ft),!0):!1},Q,q),Ze,nt,at=!1;if(Be){var lt=m-Be.left<Be.right-m,ot=lt==te;Qe=Xe+(ot?0:1),nt=ot?"after":"before",Ze=lt?Be.left:Be.right}else{!te&&(Qe==q||Qe==Q)&&Qe++,nt=Qe==0?"after":Qe==t.text.length?"before":Mr(e,N,Qe-(te?1:0)).bottom+V<=L==te?"after":"before";var ut=Lr(e,tt(_,Qe,nt),"line",t,N);Ze=ut.left,at=L<ut.top?-1:L>=ut.bottom?1:0}return Qe=Ae(t.text,Qe,1),ga(_,Qe,nt,at,m-Ze)}function Ws(e,t,_,m,L,N,V){var Q=Te(function(we){var Xe=L[we],Be=Xe.level!=1;return _a(Lr(e,tt(_,Be?Xe.to:Xe.from,Be?"before":"after"),"line",t,m),N,V,!0)},0,L.length-1),q=L[Q];if(Q>0){var te=q.level!=1,be=Lr(e,tt(_,te?q.from:q.to,te?"after":"before"),"line",t,m);_a(be,N,V,!0)&&be.top>V&&(q=L[Q-1])}return q}function zs(e,t,_,m,L,N,V){var Q=co(e,t,m,V),q=Q.begin,te=Q.end;/\s/.test(t.text.charAt(te-1))&&te--;for(var be=null,we=null,Xe=0;Xe<L.length;Xe++){var Be=L[Xe];if(Be.from>=te||Be.to<=q)continue;var Qe=Be.level!=1,Ze=Mr(e,m,Qe?Math.min(te,Be.to)-1:Math.max(q,Be.from)).right,nt=Ze<N?N-Ze+1e9:Ze-N;(!be||we>nt)&&(be=Be,we=nt)}return be||(be=L[L.length-1]),be.from<q&&(be={from:q,to:be.to,level:be.level}),be.to>te&&(be={from:be.from,to:te,level:be.level}),be}var ln;function kn(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(ln==null){ln=p("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)ln.appendChild(document.createTextNode("x")),ln.appendChild(p("br"));ln.appendChild(document.createTextNode("x"))}A(e.measure,ln);var _=ln.offsetHeight/50;return _>3&&(e.cachedTextHeight=_),S(e.measure),_||1}function Rn(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var t=p("span","xxxxxxxxxx"),_=p("pre",[t],"CodeMirror-line-like");A(e.measure,_);var m=t.getBoundingClientRect(),L=(m.right-m.left)/10;return L>2&&(e.cachedCharWidth=L),L||10}function ya(e){for(var t=e.display,_={},m={},L=t.gutters.clientLeft,N=t.gutters.firstChild,V=0;N;N=N.nextSibling,++V){var Q=e.display.gutterSpecs[V].className;_[Q]=N.offsetLeft+N.clientLeft+L,m[Q]=N.clientWidth}return{fixedPos:ba(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:_,gutterWidth:m,wrapperWidth:t.wrapper.clientWidth}}function ba(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function fo(e){var t=kn(e.display),_=e.options.lineWrapping,m=_&&Math.max(5,e.display.scroller.clientWidth/Rn(e.display)-3);return function(L){if(Dr(e.doc,L))return 0;var N=0;if(L.widgets)for(var V=0;V<L.widgets.length;V++)L.widgets[V].height&&(N+=L.widgets[V].height);return _?N+(Math.ceil(L.text.length/m)||1)*t:N+t}}function xa(e){var t=e.doc,_=fo(e);t.iter(function(m){var L=_(m);L!=m.height&&sr(m,L)})}function un(e,t,_,m){var L=e.display;if(!_&&_e(t).getAttribute("cm-not-content")=="true")return null;var N,V,Q=L.lineSpace.getBoundingClientRect();try{N=t.clientX-Q.left,V=t.clientY-Q.top}catch(we){return null}var q=va(e,N,V),te;if(m&&q.xRel>0&&(te=dt(e.doc,q.line).text).length==q.ch){var be=G(te,te.length,e.options.tabSize)-te.length;q=tt(q.line,Math.max(0,Math.round((N-Ja(e.display).left)/Rn(e.display))-be))}return q}function cn(e,t){if(t>=e.display.viewTo)return null;if(t-=e.display.viewFrom,t<0)return null;for(var _=e.display.view,m=0;m<_.length;m++)if(t-=_[m].size,t<0)return m}function cr(e,t,_,m){t==null&&(t=e.doc.first),_==null&&(_=e.doc.first+e.doc.size),m||(m=0);var L=e.display;if(m&&_<L.viewTo&&(L.updateLineNumbers==null||L.updateLineNumbers>t)&&(L.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=L.viewTo)nr&&Jn(e.doc,t)<L.viewTo&&Vr(e);else if(_<=L.viewFrom)nr&&zr(e.doc,_+m)>L.viewFrom?Vr(e):(L.viewFrom+=m,L.viewTo+=m);else if(t<=L.viewFrom&&_>=L.viewTo)Vr(e);else if(t<=L.viewFrom){var N=Ki(e,_,_+m,1);N?(L.view=L.view.slice(N.index),L.viewFrom=N.lineN,L.viewTo+=m):Vr(e)}else if(_>=L.viewTo){var V=Ki(e,t,t,-1);V?(L.view=L.view.slice(0,V.index),L.viewTo=V.lineN):Vr(e)}else{var Q=Ki(e,t,t,-1),q=Ki(e,_,_+m,1);Q&&q?(L.view=L.view.slice(0,Q.index).concat(ur(e,Q.lineN,q.lineN)).concat(L.view.slice(q.index)),L.viewTo+=m):Vr(e)}var te=L.externalMeasured;te&&(_<te.lineN?te.lineN+=m:t<te.lineN+te.size&&(L.externalMeasured=null))}function Gr(e,t,_){e.curOp.viewChanged=!0;var m=e.display,L=e.display.externalMeasured;if(L&&t>=L.lineN&&t<L.lineN+L.size&&(m.externalMeasured=null),t<m.viewFrom||t>=m.viewTo)return;var N=m.view[cn(e,t)];if(N.node==null)return;var V=N.changes||(N.changes=[]);fe(V,_)==-1&&V.push(_)}function Vr(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function Ki(e,t,_,m){var L=cn(e,t),N,V=e.display.view;if(!nr||_==e.doc.first+e.doc.size)return{index:L,lineN:_};for(var Q=e.display.viewFrom,q=0;q<L;q++)Q+=V[q].size;if(Q!=t){if(m>0){if(L==V.length-1)return null;N=Q+V[L].size-t,L++}else N=Q-t;t+=N,_+=N}for(;Jn(e.doc,_)!=_;){if(L==(m<0?0:V.length-1))return null;_+=m*V[L-(m<0?1:0)].size,L+=m}return{index:L,lineN:_}}function Gs(e,t,_){var m=e.display,L=m.view;L.length==0||t>=m.viewTo||_<=m.viewFrom?(m.view=ur(e,t,_),m.viewFrom=t):(m.viewFrom>t?m.view=ur(e,t,m.viewFrom).concat(m.view):m.viewFrom<t&&(m.view=m.view.slice(cn(e,t))),m.viewFrom=t,m.viewTo<_?m.view=m.view.concat(ur(e,m.viewTo,_)):m.viewTo>_&&(m.view=m.view.slice(0,cn(e,_)))),m.viewTo=_}function po(e){for(var t=e.display.view,_=0,m=0;m<t.length;m++){var L=t[m];!L.hidden&&(!L.node||L.changes)&&++_}return _}function oi(e){e.display.input.showSelection(e.display.input.prepareSelection())}function mo(e,t){t===void 0&&(t=!0);for(var _=e.doc,m={},L=m.cursors=document.createDocumentFragment(),N=m.selection=document.createDocumentFragment(),V=0;V<_.sel.ranges.length;V++){if(!t&&V==_.sel.primIndex)continue;var Q=_.sel.ranges[V];if(Q.from().line>=e.display.viewTo||Q.to().line<e.display.viewFrom)continue;var q=Q.empty();(q||e.options.showCursorWhenSelecting)&&go(e,Q.head,L),q||Vs(e,Q,N)}return m}function go(e,t,_){var m=Lr(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),L=_.appendChild(p("div","\xA0","CodeMirror-cursor"));if(L.style.left=m.left+"px",L.style.top=m.top+"px",L.style.height=Math.max(0,m.bottom-m.top)*e.options.cursorHeight+"px",m.other){var N=_.appendChild(p("div","\xA0","CodeMirror-cursor CodeMirror-secondarycursor"));N.style.display="",N.style.left=m.other.left+"px",N.style.top=m.other.top+"px",N.style.height=(m.other.bottom-m.other.top)*.85+"px"}}function Bi(e,t){return e.top-t.top||e.left-t.left}function Vs(e,t,_){var m=e.display,L=e.doc,N=document.createDocumentFragment(),V=Ja(e.display),Q=V.left,q=Math.max(m.sizerWidth,sn(e)-m.sizer.offsetLeft)-V.right,te=L.direction=="ltr";function be(ot,ut,gt,ft){ut<0&&(ut=0),ut=Math.round(ut),ft=Math.round(ft),N.appendChild(p("div",null,"CodeMirror-selected","position: absolute; left: "+ot+`px;
|
|
|
top: `+ut+"px; width: "+(gt==null?q-ot:gt)+`px;
|
|
|
height: `+(ft-ut)+"px"))}function we(ot,ut,gt){var ft=dt(L,ot),xt=ft.text.length,Nt,qt;function Xt(Wt,fr){return ma(e,tt(ot,Wt),"div",ft,fr)}function gr(Wt,fr,Jt){var Vt=ho(e,ft,null,Wt),zt=fr=="ltr"==(Jt=="after")?"left":"right",Ht=Jt=="after"?Vt.begin:Vt.end-(/\s/.test(ft.text.charAt(Vt.end-1))?2:1);return Xt(Ht,zt)[zt]}var hr=We(ft,L.direction);return Z(hr,ut||0,gt==null?xt:gt,function(Wt,fr,Jt,Vt){var zt=Jt=="ltr",Ht=Xt(Wt,zt?"left":"right"),pr=Xt(fr-1,zt?"right":"left"),jn=ut==null&&Wt==0,Jr=gt==null&&fr==xt,rr=Vt==0,Ir=!hr||Vt==hr.length-1;if(pr.top-Ht.top<=3){var Zt=(te?jn:Jr)&&rr,Ga=(te?Jr:jn)&&Ir,jr=Zt?Q:(zt?Ht:pr).left,mn=Ga?q:(zt?pr:Ht).right;be(jr,Ht.top,mn-jr,Ht.bottom)}else{var gn,ar,Wn,Va;zt?(gn=te&&jn&&rr?Q:Ht.left,ar=te?q:gr(Wt,Jt,"before"),Wn=te?Q:gr(fr,Jt,"after"),Va=te&&Jr&&Ir?q:pr.right):(gn=te?gr(Wt,Jt,"before"):Q,ar=!te&&jn&&rr?q:Ht.right,Wn=!te&&Jr&&Ir?Q:pr.left,Va=te?gr(fr,Jt,"after"):q),be(gn,Ht.top,ar-gn,Ht.bottom),Ht.bottom<pr.top&&be(Q,Ht.bottom,null,pr.top),be(Wn,pr.top,Va-Wn,pr.bottom)}(!Nt||Bi(Ht,Nt)<0)&&(Nt=Ht),Bi(pr,Nt)<0&&(Nt=pr),(!qt||Bi(Ht,qt)<0)&&(qt=Ht),Bi(pr,qt)<0&&(qt=pr)}),{start:Nt,end:qt}}var Xe=t.from(),Be=t.to();if(Xe.line==Be.line)we(Xe.line,Xe.ch,Be.ch);else{var Qe=dt(L,Xe.line),Ze=dt(L,Be.line),nt=vr(Qe)==vr(Ze),at=we(Xe.line,Xe.ch,nt?Qe.text.length+1:null).end,lt=we(Be.line,nt?0:null,Be.ch).start;nt&&(at.top<lt.top-2?(be(at.right,at.top,null,at.bottom),be(Q,lt.top,lt.left,lt.bottom)):be(at.right,at.top,lt.left-at.right,at.bottom)),at.bottom<lt.top&&be(Q,at.bottom,null,lt.top)}_.appendChild(N)}function Ea(e){if(!e.state.focused)return;var t=e.display;clearInterval(t.blinker);var _=!0;t.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?t.blinker=setInterval(function(){e.hasFocus()||Dn(e),t.cursorDiv.style.visibility=(_=!_)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}function vo(e){e.state.focused||(e.display.input.focus(),Sa(e))}function _o(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,Dn(e))},100)}function Sa(e,t){if(e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),e.options.readOnly=="nocursor")return;e.state.focused||(Ee(e,"focus",e,t),e.state.focused=!0,H(e.display.wrapper,"CodeMirror-focused"),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(e.display.input.reset(),v&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),Ea(e)}function Dn(e,t){if(e.state.delayingBlurEvent)return;e.state.focused&&(Ee(e,"blur",e,t),e.state.focused=!1,b(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150)}function Xi(e){for(var t=e.display,_=t.lineDiv.offsetTop,m=0;m<t.view.length;m++){var L=t.view[m],N=e.options.lineWrapping,V=void 0,Q=0;if(L.hidden)continue;if(E&&y<8){var q=L.node.offsetTop+L.node.offsetHeight;V=q-_,_=q}else{var te=L.node.getBoundingClientRect();V=te.bottom-te.top,!N&&L.text.firstChild&&(Q=L.text.firstChild.getBoundingClientRect().right-te.left-1)}var be=L.line.height-V;if((be>.005||be<-.005)&&(sr(L.line,V),yo(L.line),L.rest))for(var we=0;we<L.rest.length;we++)yo(L.rest[we]);if(Q>e.display.sizerWidth){var Xe=Math.ceil(Q/Rn(e.display));Xe>e.display.maxLineLength&&(e.display.maxLineLength=Xe,e.display.maxLine=L.line,e.display.maxLineChanged=!0)}}}function yo(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t){var _=e.widgets[t],m=_.node.parentNode;m&&(_.height=m.offsetHeight)}}function Hi(e,t,_){var m=_&&_.top!=null?Math.max(0,_.top):e.scroller.scrollTop;m=Math.floor(m-Ni(e));var L=_&&_.bottom!=null?_.bottom:m+e.wrapper.clientHeight,N=Er(t,m),V=Er(t,L);if(_&&_.ensure){var Q=_.ensure.from.line,q=_.ensure.to.line;Q<N?(N=Q,V=Er(t,Ar(dt(t,Q))+e.wrapper.clientHeight)):Math.min(q,t.lastLine())>=V&&(N=Er(t,Ar(dt(t,q))-e.wrapper.clientHeight),V=q)}return{from:N,to:Math.max(V,N+1)}}function Ys(e,t){if(Oe(e,"scrollCursorIntoView"))return;var _=e.display,m=_.sizer.getBoundingClientRect(),L=null;if(t.top+m.top<0?L=!0:t.bottom+m.top>(window.innerHeight||document.documentElement.clientHeight)&&(L=!1),L!=null&&!r){var N=p("div","\u200B",null,`position: absolute;
|
|
|
top: `+(t.top-_.viewOffset-Ni(e.display))+`px;
|
|
|
height: `+(t.bottom-t.top+Or(e)+_.barHeight)+`px;
|
|
|
left: `+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(N),N.scrollIntoView(L),e.display.lineSpace.removeChild(N)}}function Qs(e,t,_,m){m==null&&(m=0);var L;!e.options.lineWrapping&&t==_&&(t=t.ch?tt(t.line,t.sticky=="before"?t.ch-1:t.ch,"after"):t,_=t.sticky=="before"?tt(t.line,t.ch+1,"before"):t);for(var N=0;N<5;N++){var V=!1,Q=Lr(e,t),q=!_||_==t?Q:Lr(e,_);L={left:Math.min(Q.left,q.left),top:Math.min(Q.top,q.top)-m,right:Math.max(Q.left,q.left),bottom:Math.max(Q.bottom,q.bottom)+m};var te=wa(e,L),be=e.doc.scrollTop,we=e.doc.scrollLeft;if(te.scrollTop!=null&&(li(e,te.scrollTop),Math.abs(e.doc.scrollTop-be)>1&&(V=!0)),te.scrollLeft!=null&&(dn(e,te.scrollLeft),Math.abs(e.doc.scrollLeft-we)>1&&(V=!0)),!V)break}return L}function qs(e,t){var _=wa(e,t);_.scrollTop!=null&&li(e,_.scrollTop),_.scrollLeft!=null&&dn(e,_.scrollLeft)}function wa(e,t){var _=e.display,m=kn(e.display);t.top<0&&(t.top=0);var L=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:_.scroller.scrollTop,N=ha(e),V={};t.bottom-t.top>N&&(t.bottom=t.top+N);var Q=e.doc.height+da(_),q=t.top<m,te=t.bottom>Q-m;if(t.top<L)V.scrollTop=q?0:t.top;else if(t.bottom>L+N){var be=Math.min(t.top,(te?Q:t.bottom)-N);be!=L&&(V.scrollTop=be)}var we=e.options.fixedGutter?0:_.gutters.offsetWidth,Xe=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:_.scroller.scrollLeft-we,Be=sn(e)-_.gutters.offsetWidth,Qe=t.right-t.left>Be;return Qe&&(t.right=t.left+Be),t.left<10?V.scrollLeft=0:t.left<Xe?V.scrollLeft=Math.max(0,t.left+we-(Qe?0:10)):t.right>Be+Xe-3&&(V.scrollLeft=t.right+(Qe?0:10)-Be),V}function Ta(e,t){if(t==null)return;ji(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+t}function On(e){ji(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function si(e,t,_){(t!=null||_!=null)&&ji(e),t!=null&&(e.curOp.scrollLeft=t),_!=null&&(e.curOp.scrollTop=_)}function Zs(e,t){ji(e),e.curOp.scrollToPos=t}function ji(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var _=uo(e,t.from),m=uo(e,t.to);bo(e,_,m,t.margin)}}function bo(e,t,_,m){var L=wa(e,{left:Math.min(t.left,_.left),top:Math.min(t.top,_.top)-m,right:Math.max(t.right,_.right),bottom:Math.max(t.bottom,_.bottom)+m});si(e,L.scrollLeft,L.scrollTop)}function li(e,t){if(Math.abs(e.doc.scrollTop-t)<2)return;D||Aa(e,{top:t}),xo(e,t,!0),D&&Aa(e),di(e,100)}function xo(e,t,_){if(t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),e.display.scroller.scrollTop==t&&!_)return;e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t)}function dn(e,t,_,m){if(t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),(_?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!m)return;e.doc.scrollLeft=t,Co(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t)}function ui(e){var t=e.display,_=t.gutters.offsetWidth,m=Math.round(e.doc.height+da(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?_:0,docHeight:m,scrollHeight:m+Or(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:_}}var hn=function(e,t,_){this.cm=_;var m=this.vert=p("div",[p("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),L=this.horiz=p("div",[p("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");m.tabIndex=L.tabIndex=-1,e(m),e(L),Me(m,"scroll",function(){m.clientHeight&&t(m.scrollTop,"vertical")}),Me(L,"scroll",function(){L.clientWidth&&t(L.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,E&&y<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};hn.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,_=e.scrollHeight>e.clientHeight+1,m=e.nativeBarWidth;if(_){this.vert.style.display="block",this.vert.style.bottom=t?m+"px":"0";var L=e.viewHeight-(t?m:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+L)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=_?m+"px":"0",this.horiz.style.left=e.barLeft+"px";var N=e.viewWidth-e.barLeft-(_?m:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+N)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(m==0&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:_?m:0,bottom:t?m:0}},hn.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},hn.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},hn.prototype.zeroWidthHack=function(){var e=f&&!l?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new ae,this.disableVert=new ae},hn.prototype.enableZeroWidthBar=function(e,t,_){e.style.pointerEvents="auto";function m(){var L=e.getBoundingClientRect(),N=_=="vert"?document.elementFromPoint(L.right-1,(L.top+L.bottom)/2):document.elementFromPoint((L.right+L.left)/2,L.bottom-1);N!=e?e.style.pointerEvents="none":t.set(1e3,m)}t.set(1e3,m)},hn.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var ci=function(){};ci.prototype.update=function(){return{bottom:0,right:0}},ci.prototype.setScrollLeft=function(){},ci.prototype.setScrollTop=function(){},ci.prototype.clear=function(){};function Mn(e,t){t||(t=ui(e));var _=e.display.barWidth,m=e.display.barHeight;Eo(e,t);for(var L=0;L<4&&_!=e.display.barWidth||m!=e.display.barHeight;L++)_!=e.display.barWidth&&e.options.lineWrapping&&Xi(e),Eo(e,ui(e)),_=e.display.barWidth,m=e.display.barHeight}function Eo(e,t){var _=e.display,m=_.scrollbars.update(t);_.sizer.style.paddingRight=(_.barWidth=m.right)+"px",_.sizer.style.paddingBottom=(_.barHeight=m.bottom)+"px",_.heightForcer.style.borderBottom=m.bottom+"px solid transparent",m.right&&m.bottom?(_.scrollbarFiller.style.display="block",_.scrollbarFiller.style.height=m.bottom+"px",_.scrollbarFiller.style.width=m.right+"px"):_.scrollbarFiller.style.display="",m.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(_.gutterFiller.style.display="block",_.gutterFiller.style.height=m.bottom+"px",_.gutterFiller.style.width=t.gutterWidth+"px"):_.gutterFiller.style.display=""}var So={native:hn,null:ci};function wo(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&b(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new So[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),Me(t,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),t.setAttribute("cm-not-content","true")},function(t,_){_=="horizontal"?dn(e,t):li(e,t)},e),e.display.scrollbars.addClass&&H(e.display.wrapper,e.display.scrollbars.addClass)}var $s=0;function fn(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:++$s},xr(e.curOp)}function pn(e){var t=e.curOp;t&&Ds(t,function(_){for(var m=0;m<_.ops.length;m++)_.ops[m].cm.curOp=null;Js(_)})}function Js(e){for(var t=e.ops,_=0;_<t.length;_++)el(t[_]);for(var m=0;m<t.length;m++)tl(t[m]);for(var L=0;L<t.length;L++)rl(t[L]);for(var N=0;N<t.length;N++)nl(t[N]);for(var V=0;V<t.length;V++)il(t[V])}function el(e){var t=e.cm,_=t.display;ol(t),e.updateMaxLine&&Fi(t),e.mustUpdate=e.viewChanged||e.forceUpdate||e.scrollTop!=null||e.scrollToPos&&(e.scrollToPos.from.line<_.viewFrom||e.scrollToPos.to.line>=_.viewTo)||_.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new Wi(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function tl(e){e.updatedDisplay=e.mustUpdate&&Ca(e.cm,e.update)}function rl(e){var t=e.cm,_=t.display;e.updatedDisplay&&Xi(t),e.barMeasure=ui(t),_.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=to(t,_.maxLine,_.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(_.scroller.clientWidth,_.sizer.offsetLeft+e.adjustWidthTo+Or(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,_.sizer.offsetLeft+e.adjustWidthTo-sn(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=_.input.prepareSelection())}function nl(e){var t=e.cm;e.adjustWidthTo!=null&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&dn(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var _=e.focus&&e.focus==B();e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,_),(e.updatedDisplay||e.startHeight!=t.doc.height)&&Mn(t,e.barMeasure),e.updatedDisplay&&ka(t,e.barMeasure),e.selectionChanged&&Ea(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),_&&vo(e.cm)}function il(e){var t=e.cm,_=t.display,m=t.doc;if(e.updatedDisplay&&To(t,e.update),_.wheelStartX!=null&&(e.scrollTop!=null||e.scrollLeft!=null||e.scrollToPos)&&(_.wheelStartX=_.wheelStartY=null),e.scrollTop!=null&&xo(t,e.scrollTop,e.forceScroll),e.scrollLeft!=null&&dn(t,e.scrollLeft,!0,!0),e.scrollToPos){var L=Qs(t,bt(m,e.scrollToPos.from),bt(m,e.scrollToPos.to),e.scrollToPos.margin);Ys(t,L)}var N=e.maybeHiddenMarkers,V=e.maybeUnhiddenMarkers;if(N)for(var Q=0;Q<N.length;++Q)N[Q].lines.length||Ee(N[Q],"hide");if(V)for(var q=0;q<V.length;++q)V[q].lines.length&&Ee(V[q],"unhide");_.wrapper.offsetHeight&&(m.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&Ee(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function mr(e,t){if(e.curOp)return t();fn(e);try{return t()}finally{pn(e)}}function Yt(e,t){return function(){if(e.curOp)return t.apply(e,arguments);fn(e);try{return t.apply(e,arguments)}finally{pn(e)}}}function ir(e){return function(){if(this.curOp)return e.apply(this,arguments);fn(this);try{return e.apply(this,arguments)}finally{pn(this)}}}function Qt(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);fn(t);try{return e.apply(this,arguments)}finally{pn(t)}}}function di(e,t){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(t,U(al,e))}function al(e){var t=e.doc;if(t.highlightFrontier>=e.display.viewTo)return;var _=+new Date+e.options.workTime,m=Sr(e,t.highlightFrontier),L=[];t.iter(m.line,Math.min(t.first+t.size,e.display.viewTo+500),function(N){if(m.line>=e.display.viewFrom){var V=N.styles,Q=N.text.length>e.options.maxHighlightLength?Ot(t.mode,m.state):null,q=Gn(e,N,m,!0);Q&&(m.state=Q),N.styles=q.styles;var te=N.styleClasses,be=q.classes;be?N.styleClasses=be:te&&(N.styleClasses=null);for(var we=!V||V.length!=N.styles.length||te!=be&&(!te||!be||te.bgClass!=be.bgClass||te.textClass!=be.textClass),Xe=0;!we&&Xe<V.length;++Xe)we=V[Xe]!=N.styles[Xe];we&&L.push(m.line),N.stateAfter=m.save(),m.nextLine()}else N.text.length<=e.options.maxHighlightLength&&Vn(e,N.text,m),N.stateAfter=m.line%5==0?m.save():null,m.nextLine();if(+new Date>_)return di(e,e.options.workDelay),!0}),t.highlightFrontier=m.line,t.modeFrontier=Math.max(t.modeFrontier,m.line),L.length&&mr(e,function(){for(var N=0;N<L.length;N++)Gr(e,L[N],"text")})}var Wi=function(e,t,_){var m=e.display;this.viewport=t,this.visible=Hi(m,e.doc,t),this.editorIsHidden=!m.wrapper.offsetWidth,this.wrapperHeight=m.wrapper.clientHeight,this.wrapperWidth=m.wrapper.clientWidth,this.oldDisplayWidth=sn(e),this.force=_,this.dims=ya(e),this.events=[]};Wi.prototype.signal=function(e,t){ue(e,t)&&this.events.push(arguments)},Wi.prototype.finish=function(){for(var e=0;e<this.events.length;e++)Ee.apply(null,this.events[e])};function ol(e){var t=e.display;!t.scrollbarsClipped&&t.scroller.offsetWidth&&(t.nativeBarWidth=t.scroller.offsetWidth-t.scroller.clientWidth,t.heightForcer.style.height=Or(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=Or(e)+"px",t.scrollbarsClipped=!0)}function sl(e){if(e.hasFocus())return null;var t=B();if(!t||!P(e.display.lineDiv,t))return null;var _={activeElt:t};if(window.getSelection){var m=window.getSelection();m.anchorNode&&m.extend&&P(e.display.lineDiv,m.anchorNode)&&(_.anchorNode=m.anchorNode,_.anchorOffset=m.anchorOffset,_.focusNode=m.focusNode,_.focusOffset=m.focusOffset)}return _}function ll(e){if(!e||!e.activeElt||e.activeElt==B())return;if(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&P(document.body,e.anchorNode)&&P(document.body,e.focusNode)){var t=window.getSelection(),_=document.createRange();_.setEnd(e.anchorNode,e.anchorOffset),_.collapse(!1),t.removeAllRanges(),t.addRange(_),t.extend(e.focusNode,e.focusOffset)}}function Ca(e,t){var _=e.display,m=e.doc;if(t.editorIsHidden)return Vr(e),!1;if(!t.force&&t.visible.from>=_.viewFrom&&t.visible.to<=_.viewTo&&(_.updateLineNumbers==null||_.updateLineNumbers>=_.viewTo)&&_.renderedView==_.view&&po(e)==0)return!1;Ao(e)&&(Vr(e),t.dims=ya(e));var L=m.first+m.size,N=Math.max(t.visible.from-e.options.viewportMargin,m.first),V=Math.min(L,t.visible.to+e.options.viewportMargin);_.viewFrom<N&&N-_.viewFrom<20&&(N=Math.max(m.first,_.viewFrom)),_.viewTo>V&&_.viewTo-V<20&&(V=Math.min(L,_.viewTo)),nr&&(N=Jn(e.doc,N),V=zr(e.doc,V));var Q=N!=_.viewFrom||V!=_.viewTo||_.lastWrapHeight!=t.wrapperHeight||_.lastWrapWidth!=t.wrapperWidth;Gs(e,N,V),_.viewOffset=Ar(dt(e.doc,_.viewFrom)),e.display.mover.style.top=_.viewOffset+"px";var q=po(e);if(!Q&&q==0&&!t.force&&_.renderedView==_.view&&(_.updateLineNumbers==null||_.updateLineNumbers>=_.viewTo))return!1;var te=sl(e);return q>4&&(_.lineDiv.style.display="none"),ul(e,_.updateLineNumbers,t.dims),q>4&&(_.lineDiv.style.display=""),_.renderedView=_.view,ll(te),S(_.cursorDiv),S(_.selectionDiv),_.gutters.style.height=_.sizer.style.minHeight=0,Q&&(_.lastWrapHeight=t.wrapperHeight,_.lastWrapWidth=t.wrapperWidth,di(e,400)),_.updateLineNumbers=null,!0}function To(e,t){for(var _=t.viewport,m=!0;;m=!1){if(!m||!e.options.lineWrapping||t.oldDisplayWidth==sn(e)){if(_&&_.top!=null&&(_={top:Math.min(e.doc.height+da(e.display)-ha(e),_.top)}),t.visible=Hi(e.display,e.doc,_),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break}else m&&(t.visible=Hi(e.display,e.doc,_));if(!Ca(e,t))break;Xi(e);var L=ui(e);oi(e),Mn(e,L),ka(e,L),t.force=!1}t.signal(e,"update",e),(e.display.viewFrom!=e.display.reportedViewFrom||e.display.viewTo!=e.display.reportedViewTo)&&(t.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function Aa(e,t){var _=new Wi(e,t);if(Ca(e,_)){Xi(e),To(e,_);var m=ui(e);oi(e),Mn(e,m),ka(e,m),_.finish()}}function ul(e,t,_){var m=e.display,L=e.options.lineNumbers,N=m.lineDiv,V=N.firstChild;function Q(Qe){var Ze=Qe.nextSibling;return v&&f&&e.display.currentWheelTarget==Qe?Qe.style.display="none":Qe.parentNode.removeChild(Qe),Ze}for(var q=m.view,te=m.viewFrom,be=0;be<q.length;be++){var we=q[be];if(!we.hidden)if(!we.node||we.node.parentNode!=N){var Xe=Fs(e,we,te,_);N.insertBefore(Xe,V)}else{for(;V!=we.node;)V=Q(V);var Be=L&&t!=null&&t<=te&&we.lineNumber;we.changes&&(fe(we.changes,"gutter")>-1&&(Be=!1),Ya(e,we,te,_)),Be&&(S(we.lineNumber),we.lineNumber.appendChild(document.createTextNode(_n(e.options,te)))),V=we.node.nextSibling}te+=we.size}for(;V;)V=Q(V)}function La(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px"}function ka(e,t){e.display.sizer.style.minHeight=t.docHeight+"px",e.display.heightForcer.style.top=t.docHeight+"px",e.display.gutters.style.height=t.docHeight+e.display.barHeight+Or(e)+"px"}function Co(e){var t=e.display,_=t.view;if(!t.alignWidgets&&(!t.gutters.firstChild||!e.options.fixedGutter))return;for(var m=ba(t)-t.scroller.scrollLeft+e.doc.scrollLeft,L=t.gutters.offsetWidth,N=m+"px",V=0;V<_.length;V++)if(!_[V].hidden){e.options.fixedGutter&&(_[V].gutter&&(_[V].gutter.style.left=N),_[V].gutterBackground&&(_[V].gutterBackground.style.left=N));var Q=_[V].alignable;if(Q)for(var q=0;q<Q.length;q++)Q[q].style.left=N}e.options.fixedGutter&&(t.gutters.style.left=m+L+"px")}function Ao(e){if(!e.options.lineNumbers)return!1;var t=e.doc,_=_n(e.options,t.first+t.size-1),m=e.display;if(_.length!=m.lineNumChars){var L=m.measure.appendChild(p("div",[p("div",_)],"CodeMirror-linenumber CodeMirror-gutter-elt")),N=L.firstChild.offsetWidth,V=L.offsetWidth-N;return m.lineGutter.style.width="",m.lineNumInnerWidth=Math.max(N,m.lineGutter.offsetWidth-V)+1,m.lineNumWidth=m.lineNumInnerWidth+V,m.lineNumChars=m.lineNumInnerWidth?_.length:-1,m.lineGutter.style.width=m.lineNumWidth+"px",La(e.display),!0}return!1}function Ra(e,t){for(var _=[],m=!1,L=0;L<e.length;L++){var N=e[L],V=null;if(typeof N!="string"&&(V=N.style,N=N.className),N=="CodeMirror-linenumbers")if(t)m=!0;else continue;_.push({className:N,style:V})}return t&&!m&&_.push({className:"CodeMirror-linenumbers",style:null}),_}function Lo(e){var t=e.gutters,_=e.gutterSpecs;S(t),e.lineGutter=null;for(var m=0;m<_.length;++m){var L=_[m],N=L.className,V=L.style,Q=t.appendChild(p("div",null,"CodeMirror-gutter "+N));V&&(Q.style.cssText=V),N=="CodeMirror-linenumbers"&&(e.lineGutter=Q,Q.style.width=(e.lineNumWidth||1)+"px")}t.style.display=_.length?"":"none",La(e)}function hi(e){Lo(e.display),cr(e),Co(e)}function cl(e,t,_,m){var L=this;this.input=_,L.scrollbarFiller=p("div",null,"CodeMirror-scrollbar-filler"),L.scrollbarFiller.setAttribute("cm-not-content","true"),L.gutterFiller=p("div",null,"CodeMirror-gutter-filler"),L.gutterFiller.setAttribute("cm-not-content","true"),L.lineDiv=I("div",null,"CodeMirror-code"),L.selectionDiv=p("div",null,null,"position: relative; z-index: 1"),L.cursorDiv=p("div",null,"CodeMirror-cursors"),L.measure=p("div",null,"CodeMirror-measure"),L.lineMeasure=p("div",null,"CodeMirror-measure"),L.lineSpace=I("div",[L.measure,L.lineMeasure,L.selectionDiv,L.cursorDiv,L.lineDiv],null,"position: relative; outline: none");var N=I("div",[L.lineSpace],"CodeMirror-lines");L.mover=p("div",[N],null,"position: relative"),L.sizer=p("div",[L.mover],"CodeMirror-sizer"),L.sizerWidth=null,L.heightForcer=p("div",null,null,"position: absolute; height: "+Se+"px; width: 1px;"),L.gutters=p("div",null,"CodeMirror-gutters"),L.lineGutter=null,L.scroller=p("div",[L.sizer,L.heightForcer,L.gutters],"CodeMirror-scroll"),L.scroller.setAttribute("tabIndex","-1"),L.wrapper=p("div",[L.scrollbarFiller,L.gutterFiller,L.scroller],"CodeMirror"),E&&y<8&&(L.gutters.style.zIndex=-1,L.scroller.style.paddingRight=0),!v&&!(D&&i)&&(L.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(L.wrapper):e(L.wrapper)),L.viewFrom=L.viewTo=t.first,L.reportedViewFrom=L.reportedViewTo=t.first,L.view=[],L.renderedView=null,L.externalMeasured=null,L.viewOffset=0,L.lastWrapHeight=L.lastWrapWidth=0,L.updateLineNumbers=null,L.nativeBarWidth=L.barHeight=L.barWidth=0,L.scrollbarsClipped=!1,L.lineNumWidth=L.lineNumInnerWidth=L.lineNumChars=null,L.alignWidgets=!1,L.cachedCharWidth=L.cachedTextHeight=L.cachedPaddingH=null,L.maxLine=null,L.maxLineLength=0,L.maxLineChanged=!1,L.wheelDX=L.wheelDY=L.wheelStartX=L.wheelStartY=null,L.shift=!1,L.selForContextMenu=null,L.activeTouch=null,L.gutterSpecs=Ra(m.gutters,m.lineNumbers),Lo(L),_.init(L)}var zi=0,_r=null;E?_r=-.53:D?_r=15:a?_r=-.7:s&&(_r=-1/3);function ko(e){var t=e.wheelDeltaX,_=e.wheelDeltaY;return t==null&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),_==null&&e.detail&&e.axis==e.VERTICAL_AXIS?_=e.detail:_==null&&(_=e.wheelDelta),{x:t,y:_}}function dl(e){var t=ko(e);return t.x*=_r,t.y*=_r,t}function Ro(e,t){var _=ko(t),m=_.x,L=_.y,N=e.display,V=N.scroller,Q=V.scrollWidth>V.clientWidth,q=V.scrollHeight>V.clientHeight;if(!(m&&Q||L&&q))return;if(L&&f&&v){e:for(var te=t.target,be=N.view;te!=V;te=te.parentNode)for(var we=0;we<be.length;we++)if(be[we].node==te){e.display.currentWheelTarget=te;break e}}if(m&&!D&&!c&&_r!=null){L&&q&&li(e,Math.max(0,V.scrollTop+L*_r)),dn(e,Math.max(0,V.scrollLeft+m*_r)),(!L||L&&q)&&Y(t),N.wheelStartX=null;return}if(L&&_r!=null){var Xe=L*_r,Be=e.doc.scrollTop,Qe=Be+N.wrapper.clientHeight;Xe<0?Be=Math.max(0,Be+Xe-50):Qe=Math.min(e.doc.height,Qe+Xe+50),Aa(e,{top:Be,bottom:Qe})}zi<20&&(N.wheelStartX==null?(N.wheelStartX=V.scrollLeft,N.wheelStartY=V.scrollTop,N.wheelDX=m,N.wheelDY=L,setTimeout(function(){if(N.wheelStartX==null)return;var Ze=V.scrollLeft-N.wheelStartX,nt=V.scrollTop-N.wheelStartY,at=nt&&N.wheelDY&&nt/N.wheelDY||Ze&&N.wheelDX&&Ze/N.wheelDX;if(N.wheelStartX=N.wheelStartY=null,!at)return;_r=(_r*zi+at)/(zi+1),++zi},200)):(N.wheelDX+=m,N.wheelDY+=L))}var yr=function(e,t){this.ranges=e,this.primIndex=t};yr.prototype.primary=function(){return this.ranges[this.primIndex]},yr.prototype.equals=function(e){if(e==this)return!0;if(e.primIndex!=this.primIndex||e.ranges.length!=this.ranges.length)return!1;for(var t=0;t<this.ranges.length;t++){var _=this.ranges[t],m=e.ranges[t];if(!zn(_.anchor,m.anchor)||!zn(_.head,m.head))return!1}return!0},yr.prototype.deepCopy=function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new Dt(yn(this.ranges[t].anchor),yn(this.ranges[t].head));return new yr(e,this.primIndex)},yr.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},yr.prototype.contains=function(e,t){t||(t=e);for(var _=0;_<this.ranges.length;_++){var m=this.ranges[_];if(vt(t,m.from())>=0&&vt(e,m.to())<=0)return _}return-1};var Dt=function(e,t){this.anchor=e,this.head=t};Dt.prototype.from=function(){return en(this.anchor,this.head)},Dt.prototype.to=function(){return bn(this.anchor,this.head)},Dt.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function kr(e,t,_){var m=e&&e.options.selectionsMayTouch,L=t[_];t.sort(function(Xe,Be){return vt(Xe.from(),Be.from())}),_=fe(t,L);for(var N=1;N<t.length;N++){var V=t[N],Q=t[N-1],q=vt(Q.to(),V.from());if(m&&!V.empty()?q>0:q>=0){var te=en(Q.from(),V.from()),be=bn(Q.to(),V.to()),we=Q.empty()?V.from()==V.head:Q.from()==Q.head;N<=_&&--_,t.splice(--N,2,new Dt(we?be:te,we?te:be))}}return new yr(t,_)}function Yr(e,t){return new yr([new Dt(e,t||e)],0)}function Qr(e){return e.text?tt(e.from.line+e.text.length-1,ee(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function Do(e,t){if(vt(e,t.from)<0)return e;if(vt(e,t.to)<=0)return Qr(t);var _=e.line+t.text.length-(t.to.line-t.from.line)-1,m=e.ch;return e.line==t.to.line&&(m+=Qr(t).ch-t.to.ch),tt(_,m)}function Da(e,t){for(var _=[],m=0;m<e.sel.ranges.length;m++){var L=e.sel.ranges[m];_.push(new Dt(Do(L.anchor,t),Do(L.head,t)))}return kr(e.cm,_,e.sel.primIndex)}function Oo(e,t,_){return e.line==t.line?tt(_.line,e.ch-t.ch+_.ch):tt(_.line+(e.line-t.line),e.ch)}function hl(e,t,_){for(var m=[],L=tt(e.first,0),N=L,V=0;V<t.length;V++){var Q=t[V],q=Oo(Q.from,L,N),te=Oo(Qr(Q),L,N);if(L=Q.to,N=te,_=="around"){var be=e.sel.ranges[V],we=vt(be.head,be.anchor)<0;m[V]=new Dt(we?te:q,we?q:te)}else m[V]=new Dt(q,q)}return new yr(m,e.sel.primIndex)}function Oa(e){e.doc.mode=Kt(e.options,e.doc.modeOption),fi(e)}function fi(e){e.doc.iter(function(t){t.stateAfter&&(t.stateAfter=null),t.styles&&(t.styles=null)}),e.doc.modeFrontier=e.doc.highlightFrontier=e.doc.first,di(e,100),e.state.modeGen++,e.curOp&&cr(e)}function Mo(e,t){return t.from.ch==0&&t.to.ch==0&&ee(t.text)==""&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function Ma(e,t,_,m){function L(lt){return _?_[lt]:null}function N(lt,ot,ut){ua(lt,ot,ut,m),$t(lt,"change",lt,t)}function V(lt,ot){for(var ut=[],gt=lt;gt<ot;++gt)ut.push(new on(te[gt],L(gt),m));return ut}var Q=t.from,q=t.to,te=t.text,be=dt(e,Q.line),we=dt(e,q.line),Xe=ee(te),Be=L(te.length-1),Qe=q.line-Q.line;if(t.full)e.insert(0,V(0,te.length)),e.remove(te.length,e.size-te.length);else if(Mo(e,t)){var Ze=V(0,te.length-1);N(we,we.text,Be),Qe&&e.remove(Q.line,Qe),Ze.length&&e.insert(Q.line,Ze)}else if(be==we)if(te.length==1)N(be,be.text.slice(0,Q.ch)+Xe+be.text.slice(q.ch),Be);else{var nt=V(1,te.length-1);nt.push(new on(Xe+be.text.slice(q.ch),Be,m)),N(be,be.text.slice(0,Q.ch)+te[0],L(0)),e.insert(Q.line+1,nt)}else if(te.length==1)N(be,be.text.slice(0,Q.ch)+te[0]+we.text.slice(q.ch),L(0)),e.remove(Q.line+1,Qe);else{N(be,be.text.slice(0,Q.ch)+te[0],L(0)),N(we,Xe+we.text.slice(q.ch),Be);var at=V(1,te.length-1);Qe>1&&e.remove(Q.line+1,Qe-1),e.insert(Q.line+1,at)}$t(e,"change",e,t)}function qr(e,t,_){function m(L,N,V){if(L.linked)for(var Q=0;Q<L.linked.length;++Q){var q=L.linked[Q];if(q.doc==N)continue;var te=V&&q.sharedHist;if(_&&!te)continue;t(q.doc,te),m(q.doc,L,te)}}m(e,null,!0)}function Io(e,t){if(t.cm)throw new Error("This document is already in use.");e.doc=t,t.cm=e,xa(e),Oa(e),Po(e),e.options.lineWrapping||Fi(e),e.options.mode=t.modeOption,cr(e)}function Po(e){(e.doc.direction=="rtl"?H:b)(e.display.lineDiv,"CodeMirror-rtl")}function fl(e){mr(e,function(){Po(e),cr(e)})}function Gi(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 Ia(e,t){var _={from:yn(t.from),to:Qr(t),text:Pr(e,t.from,t.to)};return Uo(e,_,t.from.line,t.to.line+1),qr(e,function(m){return Uo(m,_,t.from.line,t.to.line+1)},!0),_}function Fo(e){for(;e.length;){var t=ee(e);if(t.ranges)e.pop();else break}}function pl(e,t){if(t)return Fo(e.done),ee(e.done);if(e.done.length&&!ee(e.done).ranges)return ee(e.done);if(e.done.length>1&&!e.done[e.done.length-2].ranges)return e.done.pop(),ee(e.done)}function No(e,t,_,m){var L=e.history;L.undone.length=0;var N=+new Date,V,Q;if((L.lastOp==m||L.lastOrigin==t.origin&&t.origin&&(t.origin.charAt(0)=="+"&&L.lastModTime>N-(e.cm?e.cm.options.historyEventDelay:500)||t.origin.charAt(0)=="*"))&&(V=pl(L,L.lastOp==m)))Q=ee(V.changes),vt(t.from,t.to)==0&&vt(t.from,Q.to)==0?Q.to=Qr(t):V.changes.push(Ia(e,t));else{var q=ee(L.done);for((!q||!q.ranges)&&Vi(e.sel,L.done),V={changes:[Ia(e,t)],generation:L.generation},L.done.push(V);L.done.length>L.undoDepth;)L.done.shift(),L.done[0].ranges||L.done.shift()}L.done.push(_),L.generation=++L.maxGeneration,L.lastModTime=L.lastSelTime=N,L.lastOp=L.lastSelOp=m,L.lastOrigin=L.lastSelOrigin=t.origin,Q||Ee(e,"historyAdded")}function ml(e,t,_,m){var L=t.charAt(0);return L=="*"||L=="+"&&_.ranges.length==m.ranges.length&&_.somethingSelected()==m.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function gl(e,t,_,m){var L=e.history,N=m&&m.origin;_==L.lastSelOp||N&&L.lastSelOrigin==N&&(L.lastModTime==L.lastSelTime&&L.lastOrigin==N||ml(e,N,ee(L.done),t))?L.done[L.done.length-1]=t:Vi(t,L.done),L.lastSelTime=+new Date,L.lastSelOrigin=N,L.lastSelOp=_,m&&m.clearRedo!==!1&&Fo(L.undone)}function Vi(e,t){var _=ee(t);_&&_.ranges&&_.equals(e)||t.push(e)}function Uo(e,t,_,m){var L=t["spans_"+e.id],N=0;e.iter(Math.max(e.first,_),Math.min(e.first+e.size,m),function(V){V.markedSpans&&((L||(L=t["spans_"+e.id]={}))[N]=V.markedSpans),++N})}function vl(e){if(!e)return null;for(var t,_=0;_<e.length;++_)e[_].marker.explicitlyCleared?t||(t=e.slice(0,_)):t&&t.push(e[_]);return t?t.length?t:null:e}function _l(e,t){var _=t["spans_"+e.id];if(!_)return null;for(var m=[],L=0;L<t.text.length;++L)m.push(vl(_[L]));return m}function Ko(e,t){var _=_l(e,t),m=Sn(e,t);if(!_)return m;if(!m)return _;for(var L=0;L<_.length;++L){var N=_[L],V=m[L];if(N&&V){e:for(var Q=0;Q<V.length;++Q){for(var q=V[Q],te=0;te<N.length;++te)if(N[te].marker==q.marker)continue e;N.push(q)}}else V&&(_[L]=V)}return _}function In(e,t,_){for(var m=[],L=0;L<e.length;++L){var N=e[L];if(N.ranges){m.push(_?yr.prototype.deepCopy.call(N):N);continue}var V=N.changes,Q=[];m.push({changes:Q});for(var q=0;q<V.length;++q){var te=V[q],be=void 0;if(Q.push({from:te.from,to:te.to,text:te.text}),t)for(var we in te)(be=we.match(/^spans_(\d+)$/))&&(fe(t,Number(be[1]))>-1&&(ee(Q)[we]=te[we],delete te[we]))}}return m}function Pa(e,t,_,m){if(m){var L=e.anchor;if(_){var N=vt(t,L)<0;N!=vt(_,L)<0?(L=t,t=_):N!=vt(t,_)<0&&(t=_)}return new Dt(L,t)}else return new Dt(_||t,t)}function Yi(e,t,_,m,L){L==null&&(L=e.cm&&(e.cm.display.shift||e.extend)),tr(e,new yr([Pa(e.sel.primary(),t,_,L)],0),m)}function Bo(e,t,_){for(var m=[],L=e.cm&&(e.cm.display.shift||e.extend),N=0;N<e.sel.ranges.length;N++)m[N]=Pa(e.sel.ranges[N],t[N],null,L);var V=kr(e.cm,m,e.sel.primIndex);tr(e,V,_)}function Fa(e,t,_,m){var L=e.sel.ranges.slice(0);L[t]=_,tr(e,kr(e.cm,L,e.sel.primIndex),m)}function Xo(e,t,_,m){tr(e,Yr(t,_),m)}function yl(e,t,_){var m={ranges:t.ranges,update:function(L){this.ranges=[];for(var N=0;N<L.length;N++)this.ranges[N]=new Dt(bt(e,L[N].anchor),bt(e,L[N].head))},origin:_&&_.origin};return Ee(e,"beforeSelectionChange",e,m),e.cm&&Ee(e.cm,"beforeSelectionChange",e.cm,m),m.ranges!=t.ranges?kr(e.cm,m.ranges,m.ranges.length-1):t}function Ho(e,t,_){var m=e.history.done,L=ee(m);L&&L.ranges?(m[m.length-1]=t,Qi(e,t,_)):tr(e,t,_)}function tr(e,t,_){Qi(e,t,_),gl(e,e.sel,e.cm?e.cm.curOp.id:NaN,_)}function Qi(e,t,_){(ue(e,"beforeSelectionChange")||e.cm&&ue(e.cm,"beforeSelectionChange"))&&(t=yl(e,t,_));var m=_&&_.bias||(vt(t.primary().head,e.sel.primary().head)<0?-1:1);jo(e,zo(e,t,m,!0)),!(_&&_.scroll===!1)&&e.cm&&On(e.cm)}function jo(e,t){if(t.equals(e.sel))return;e.sel=t,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,me(e.cm)),$t(e,"cursorActivity",e)}function Wo(e){jo(e,zo(e,e.sel,null,!1))}function zo(e,t,_,m){for(var L,N=0;N<t.ranges.length;N++){var V=t.ranges[N],Q=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[N],q=qi(e,V.anchor,Q&&Q.anchor,_,m),te=qi(e,V.head,Q&&Q.head,_,m);(L||q!=V.anchor||te!=V.head)&&(L||(L=t.ranges.slice(0,N)),L[N]=new Dt(q,te))}return L?kr(e.cm,L,t.primIndex):t}function Pn(e,t,_,m,L){var N=dt(e,t.line);if(N.markedSpans)for(var V=0;V<N.markedSpans.length;++V){var Q=N.markedSpans[V],q=Q.marker,te="selectLeft"in q?!q.selectLeft:q.inclusiveLeft,be="selectRight"in q?!q.selectRight:q.inclusiveRight;if((Q.from==null||(te?Q.from<=t.ch:Q.from<t.ch))&&(Q.to==null||(be?Q.to>=t.ch:Q.to>t.ch))){if(L&&(Ee(q,"beforeCursorEnter"),q.explicitlyCleared))if(N.markedSpans){--V;continue}else break;if(!q.atomic)continue;if(_){var we=q.find(m<0?1:-1),Xe=void 0;if((m<0?be:te)&&(we=Go(e,we,-m,we&&we.line==t.line?N:null)),we&&we.line==t.line&&(Xe=vt(we,_))&&(m<0?Xe<0:Xe>0))return Pn(e,we,t,m,L)}var Be=q.find(m<0?-1:1);return(m<0?te:be)&&(Be=Go(e,Be,m,Be.line==t.line?N:null)),Be?Pn(e,Be,t,m,L):null}}return t}function qi(e,t,_,m,L){var N=m||1,V=Pn(e,t,_,N,L)||!L&&Pn(e,t,_,N,!0)||Pn(e,t,_,-N,L)||!L&&Pn(e,t,_,-N,!0);return V||(e.cantEdit=!0,tt(e.first,0))}function Go(e,t,_,m){return _<0&&t.ch==0?t.line>e.first?bt(e,tt(t.line-1)):null:_>0&&t.ch==(m||dt(e,t.line)).text.length?t.line<e.first+e.size-1?tt(t.line+1,0):null:new tt(t.line,t.ch+_)}function Vo(e){e.setSelection(tt(e.firstLine(),0),tt(e.lastLine()),Ne)}function Yo(e,t,_){var m={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){return m.canceled=!0}};return _&&(m.update=function(L,N,V,Q){L&&(m.from=bt(e,L)),N&&(m.to=bt(e,N)),V&&(m.text=V),Q!==void 0&&(m.origin=Q)}),Ee(e,"beforeChange",e,m),e.cm&&Ee(e.cm,"beforeChange",e.cm,m),m.canceled?(e.cm&&(e.cm.curOp.updateInput=2),null):{from:m.from,to:m.to,text:m.text,origin:m.origin}}function Fn(e,t,_){if(e.cm){if(!e.cm.curOp)return Yt(e.cm,Fn)(e,t,_);if(e.cm.state.suppressEdits)return}if((ue(e,"beforeChange")||e.cm&&ue(e.cm,"beforeChange"))&&(t=Yo(e,t,!0),!t))return;var m=Zn&&!_&&Mi(e,t.from,t.to);if(m)for(var L=m.length-1;L>=0;--L)Qo(e,{from:m[L].from,to:m[L].to,text:L?[""]:t.text,origin:t.origin});else Qo(e,t)}function Qo(e,t){if(t.text.length==1&&t.text[0]==""&&vt(t.from,t.to)==0)return;var _=Da(e,t);No(e,t,_,e.cm?e.cm.curOp.id:NaN),pi(e,t,_,Sn(e,t));var m=[];qr(e,function(L,N){!N&&fe(m,L.history)==-1&&(Jo(L.history,t),m.push(L.history)),pi(L,t,null,Sn(L,t))})}function Zi(e,t,_){var m=e.cm&&e.cm.state.suppressEdits;if(m&&!_)return;for(var L=e.history,N,V=e.sel,Q=t=="undo"?L.done:L.undone,q=t=="undo"?L.undone:L.done,te=0;te<Q.length&&!(N=Q[te],_?N.ranges&&!N.equals(e.sel):!N.ranges);te++);if(te==Q.length)return;for(L.lastOrigin=L.lastSelOrigin=null;;)if(N=Q.pop(),N.ranges){if(Vi(N,q),_&&!N.equals(e.sel)){tr(e,N,{clearRedo:!1});return}V=N}else if(m){Q.push(N);return}else break;var be=[];Vi(V,q),q.push({changes:be,generation:L.generation}),L.generation=N.generation||++L.maxGeneration;for(var we=ue(e,"beforeChange")||e.cm&&ue(e.cm,"beforeChange"),Xe=function(Ze){var nt=N.changes[Ze];if(nt.origin=t,we&&!Yo(e,nt,!1))return Q.length=0,{};be.push(Ia(e,nt));var at=Ze?Da(e,nt):ee(Q);pi(e,nt,at,Ko(e,nt)),!Ze&&e.cm&&e.cm.scrollIntoView({from:nt.from,to:Qr(nt)});var lt=[];qr(e,function(ot,ut){!ut&&fe(lt,ot.history)==-1&&(Jo(ot.history,nt),lt.push(ot.history)),pi(ot,nt,null,Ko(ot,nt))})},Be=N.changes.length-1;Be>=0;--Be){var Qe=Xe(Be);if(Qe)return Qe.v}}function qo(e,t){if(t==0)return;if(e.first+=t,e.sel=new yr(ge(e.sel.ranges,function(L){return new Dt(tt(L.anchor.line+t,L.anchor.ch),tt(L.head.line+t,L.head.ch))}),e.sel.primIndex),e.cm){cr(e.cm,e.first,e.first-t,t);for(var _=e.cm.display,m=_.viewFrom;m<_.viewTo;m++)Gr(e.cm,m,"gutter")}}function pi(e,t,_,m){if(e.cm&&!e.cm.curOp)return Yt(e.cm,pi)(e,t,_,m);if(t.to.line<e.first){qo(e,t.text.length-1-(t.to.line-t.from.line));return}if(t.from.line>e.lastLine())return;if(t.from.line<e.first){var L=t.text.length-1-(e.first-t.from.line);qo(e,L),t={from:tt(e.first,0),to:tt(t.to.line+L,t.to.ch),text:[ee(t.text)],origin:t.origin}}var N=e.lastLine();t.to.line>N&&(t={from:t.from,to:tt(N,dt(e,N).text.length),text:[t.text[0]],origin:t.origin}),t.removed=Pr(e,t.from,t.to),_||(_=Da(e,t)),e.cm?bl(e.cm,t,m):Ma(e,t,m),Qi(e,_,Ne),e.cantEdit&&qi(e,tt(e.firstLine(),0))&&(e.cantEdit=!1)}function bl(e,t,_){var m=e.doc,L=e.display,N=t.from,V=t.to,Q=!1,q=N.line;e.options.lineWrapping||(q=kt(vr(dt(m,N.line))),m.iter(q,V.line+1,function(Be){if(Be==L.maxLine)return Q=!0,!0})),m.sel.contains(t.from,t.to)>-1&&me(e),Ma(m,t,_,fo(e)),e.options.lineWrapping||(m.iter(q,N.line+t.text.length,function(Be){var Qe=ti(Be);Qe>L.maxLineLength&&(L.maxLine=Be,L.maxLineLength=Qe,L.maxLineChanged=!0,Q=!1)}),Q&&(e.curOp.updateMaxLine=!0)),aa(m,N.line),di(e,400);var te=t.text.length-(V.line-N.line)-1;t.full?cr(e):N.line==V.line&&t.text.length==1&&!Mo(e.doc,t)?Gr(e,N.line,"text"):cr(e,N.line,V.line+1,te);var be=ue(e,"changes"),we=ue(e,"change");if(we||be){var Xe={from:N,to:V,text:t.text,removed:t.removed,origin:t.origin};we&&$t(e,"change",e,Xe),be&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(Xe)}e.display.selForContextMenu=null}function Nn(e,t,_,m,L){var N;m||(m=_),vt(m,_)<0&&(N=[m,_],_=N[0],m=N[1]),typeof t=="string"&&(t=e.splitLines(t)),Fn(e,{from:_,to:m,text:t,origin:L})}function Zo(e,t,_,m){_<e.line?e.line+=m:t<e.line&&(e.line=t,e.ch=0)}function $o(e,t,_,m){for(var L=0;L<e.length;++L){var N=e[L],V=!0;if(N.ranges){N.copied||(N=e[L]=N.deepCopy(),N.copied=!0);for(var Q=0;Q<N.ranges.length;Q++)Zo(N.ranges[Q].anchor,t,_,m),Zo(N.ranges[Q].head,t,_,m);continue}for(var q=0;q<N.changes.length;++q){var te=N.changes[q];if(_<te.from.line)te.from=tt(te.from.line+m,te.from.ch),te.to=tt(te.to.line+m,te.to.ch);else if(t<=te.to.line){V=!1;break}}V||(e.splice(0,L+1),L=0)}}function Jo(e,t){var _=t.from.line,m=t.to.line,L=t.text.length-(m-_)-1;$o(e.done,_,m,L),$o(e.undone,_,m,L)}function mi(e,t,_,m){var L=t,N=t;return typeof t=="number"?N=dt(e,xn(e,t)):L=kt(t),L==null?null:(m(N,L)&&e.cm&&Gr(e.cm,L,_),N)}function gi(e){this.lines=e,this.parent=null;for(var t=0,_=0;_<e.length;++_)e[_].parent=this,t+=e[_].height;this.height=t}gi.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var _=e,m=e+t;_<m;++_){var L=this.lines[_];this.height-=L.height,ht(L),$t(L,"delete")}this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,_){this.height+=_,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var m=0;m<t.length;++m)t[m].parent=this},iterN:function(e,t,_){for(var m=e+t;e<m;++e)if(_(this.lines[e]))return!0}};function vi(e){this.children=e;for(var t=0,_=0,m=0;m<e.length;++m){var L=e[m];t+=L.chunkSize(),_+=L.height,L.parent=this}this.size=t,this.height=_,this.parent=null}vi.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){this.size-=t;for(var _=0;_<this.children.length;++_){var m=this.children[_],L=m.chunkSize();if(e<L){var N=Math.min(t,L-e),V=m.height;if(m.removeInner(e,N),this.height-=V-m.height,L==N&&(this.children.splice(_--,1),m.parent=null),(t-=N)==0)break;e=0}else e-=L}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof gi))){var Q=[];this.collapse(Q),this.children=[new gi(Q)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t<this.children.length;++t)this.children[t].collapse(e)},insertInner:function(e,t,_){this.size+=t.length,this.height+=_;for(var m=0;m<this.children.length;++m){var L=this.children[m],N=L.chunkSize();if(e<=N){if(L.insertInner(e,t,_),L.lines&&L.lines.length>50){for(var V=L.lines.length%25+25,Q=V;Q<L.lines.length;){var q=new gi(L.lines.slice(Q,Q+=25));L.height-=q.height,this.children.splice(++m,0,q),q.parent=this}L.lines=L.lines.slice(0,V),this.maybeSpill()}break}e-=N}},maybeSpill:function(){if(this.children.length<=10)return;var e=this;do{var t=e.children.splice(e.children.length-5,5),_=new vi(t);if(e.parent){e.size-=_.size,e.height-=_.height;var L=fe(e.parent.children,e);e.parent.children.splice(L+1,0,_)}else{var m=new vi(e.children);m.parent=e,e.children=[m,_],e=m}_.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()},iterN:function(e,t,_){for(var m=0;m<this.children.length;++m){var L=this.children[m],N=L.chunkSize();if(e<N){var V=Math.min(t,N-e);if(L.iterN(e,V,_))return!0;if((t-=V)==0)break;e=0}else e-=N}}};var _i=function(e,t,_){if(_)for(var m in _)_.hasOwnProperty(m)&&(this[m]=_[m]);this.doc=e,this.node=t};_i.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,_=this.line,m=kt(_);if(m==null||!t)return;for(var L=0;L<t.length;++L)t[L]==this&&t.splice(L--,1);t.length||(_.widgets=null);var N=ii(this);sr(_,Math.max(0,_.height-N)),e&&(mr(e,function(){es(e,_,-N),Gr(e,m,"widget")}),$t(e,"lineWidgetCleared",e,this,m))},_i.prototype.changed=function(){var e=this,t=this.height,_=this.doc.cm,m=this.line;this.height=null;var L=ii(this)-t;if(!L)return;Dr(this.doc,m)||sr(m,m.height+L),_&&mr(_,function(){_.curOp.forceUpdate=!0,es(_,m,L),$t(_,"lineWidgetChanged",_,e,kt(m))})},he(_i);function es(e,t,_){Ar(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&Ta(e,_)}function xl(e,t,_,m){var L=new _i(e,_,m),N=e.cm;return N&&L.noHScroll&&(N.display.alignWidgets=!0),mi(e,t,"widget",function(V){var Q=V.widgets||(V.widgets=[]);if(L.insertAt==null?Q.push(L):Q.splice(Math.min(Q.length-1,Math.max(0,L.insertAt)),0,L),L.line=V,N&&!Dr(e,V)){var q=Ar(V)<e.scrollTop;sr(V,V.height+ii(L)),q&&Ta(N,L.height),N.curOp.forceUpdate=!0}return!0}),N&&$t(N,"lineWidgetAdded",N,L,typeof t=="number"?t:kt(t)),L}var ts=0,Zr=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++ts};Zr.prototype.clear=function(){if(this.explicitlyCleared)return;var e=this.doc.cm,t=e&&!e.curOp;if(t&&fn(e),ue(this,"clear")){var _=this.find();_&&$t(this,"clear",_.from,_.to)}for(var m=null,L=null,N=0;N<this.lines.length;++N){var V=this.lines[N],Q=Cr(V.markedSpans,this);e&&!this.collapsed?Gr(e,kt(V),"text"):e&&(Q.to!=null&&(L=kt(V)),Q.from!=null&&(m=kt(V))),V.markedSpans=$n(V.markedSpans,Q),Q.from==null&&this.collapsed&&!Dr(this.doc,V)&&e&&sr(V,kn(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var q=0;q<this.lines.length;++q){var te=vr(this.lines[q]),be=ti(te);be>e.display.maxLineLength&&(e.display.maxLine=te,e.display.maxLineLength=be,e.display.maxLineChanged=!0)}m!=null&&e&&this.collapsed&&cr(e,m,L+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&Wo(e.doc)),e&&$t(e,"markerCleared",e,this,m,L),t&&pn(e),this.parent&&this.parent.clear()},Zr.prototype.find=function(e,t){e==null&&this.type=="bookmark"&&(e=1);for(var _,m,L=0;L<this.lines.length;++L){var N=this.lines[L],V=Cr(N.markedSpans,this);if(V.from!=null&&(_=tt(t?N:kt(N),V.from),e==-1))return _;if(V.to!=null&&(m=tt(t?N:kt(N),V.to),e==1))return m}return _&&{from:_,to:m}},Zr.prototype.changed=function(){var e=this,t=this.find(-1,!0),_=this,m=this.doc.cm;if(!t||!m)return;mr(m,function(){var L=t.line,N=kt(t.line),V=fa(m,N);if(V&&(io(V),m.curOp.selectionChanged=m.curOp.forceUpdate=!0),m.curOp.updateMaxLine=!0,!Dr(_.doc,L)&&_.height!=null){var Q=_.height;_.height=null;var q=ii(_)-Q;q&&sr(L,L.height+q)}$t(m,"markerChanged",m,e)})},Zr.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(!t.maybeHiddenMarkers||fe(t.maybeHiddenMarkers,this)==-1)&&(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},Zr.prototype.detachLine=function(e){if(this.lines.splice(fe(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},he(Zr);function Un(e,t,_,m,L){if(m&&m.shared)return El(e,t,_,m,L);if(e.cm&&!e.cm.curOp)return Yt(e.cm,Un)(e,t,_,m,L);var N=new Zr(e,L),V=vt(t,_);if(m&&K(m,N,!1),V>0||V==0&&N.clearWhenEmpty!==!1)return N;if(N.replacedWith&&(N.collapsed=!0,N.widgetNode=I("span",[N.replacedWith],"CodeMirror-widget"),m.handleMouseEvents||N.widgetNode.setAttribute("cm-ignore-events","true"),m.insertLeft&&(N.widgetNode.insertLeft=!0)),N.collapsed){if(Ii(e,t.line,t,_,N)||t.line!=_.line&&Ii(e,_.line,t,_,N))throw new Error("Inserting collapsed marker partially overlapping an existing one");oa()}N.addToHistory&&No(e,{from:t,to:_,origin:"markText"},e.sel,NaN);var Q=t.line,q=e.cm,te;if(e.iter(Q,_.line+1,function(we){q&&N.collapsed&&!q.options.lineWrapping&&vr(we)==q.display.maxLine&&(te=!0),N.collapsed&&Q!=t.line&&sr(we,0),sa(we,new rn(N,Q==t.line?t.ch:null,Q==_.line?_.ch:null)),++Q}),N.collapsed&&e.iter(t.line,_.line+1,function(we){Dr(e,we)&&sr(we,0)}),N.clearOnEnter&&Me(N,"beforeCursorEnter",function(){return N.clear()}),N.readOnly&&(Wr(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),N.collapsed&&(N.id=++ts,N.atomic=!0),q){if(te&&(q.curOp.updateMaxLine=!0),N.collapsed)cr(q,t.line,_.line+1);else if(N.className||N.startStyle||N.endStyle||N.css||N.attributes||N.title)for(var be=t.line;be<=_.line;be++)Gr(q,be,"text");N.atomic&&Wo(q.doc),$t(q,"markerAdded",q,N)}return N}var yi=function(e,t){this.markers=e,this.primary=t;for(var _=0;_<e.length;++_)e[_].parent=this};yi.prototype.clear=function(){if(this.explicitlyCleared)return;this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();$t(this,"clear")},yi.prototype.find=function(e,t){return this.primary.find(e,t)},he(yi);function El(e,t,_,m,L){m=K(m),m.shared=!1;var N=[Un(e,t,_,m,L)],V=N[0],Q=m.widgetNode;return qr(e,function(q){Q&&(m.widgetNode=Q.cloneNode(!0)),N.push(Un(q,bt(q,t),bt(q,_),m,L));for(var te=0;te<q.linked.length;++te)if(q.linked[te].isParent)return;V=ee(N)}),new yi(N,V)}function rs(e){return e.findMarks(tt(e.first,0),e.clipPos(tt(e.lastLine())),function(t){return t.parent})}function Sl(e,t){for(var _=0;_<t.length;_++){var m=t[_],L=m.find(),N=e.clipPos(L.from),V=e.clipPos(L.to);if(vt(N,V)){var Q=Un(e,N,V,m.primary,m.primary.type);m.markers.push(Q),Q.parent=m}}}function wl(e){for(var t=function(m){var L=e[m],N=[L.primary.doc];qr(L.primary.doc,function(q){return N.push(q)});for(var V=0;V<L.markers.length;V++){var Q=L.markers[V];fe(N,Q.doc)==-1&&(Q.parent=null,L.markers.splice(V--,1))}},_=0;_<e.length;_++)t(_)}var Tl=0,dr=function(e,t,_,m,L){if(!(this instanceof dr))return new dr(e,t,_,m,L);_==null&&(_=0),vi.call(this,[new gi([new on("",null)])]),this.first=_,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=_;var N=tt(_,0);this.sel=Yr(N),this.history=new Gi(null),this.id=++Tl,this.modeOption=t,this.lineSep=m,this.direction=L=="rtl"?"rtl":"ltr",this.extend=!1,typeof e=="string"&&(e=this.splitLines(e)),Ma(this,{from:N,to:N,text:e}),tr(this,Yr(N),Ne)};dr.prototype=je(vi.prototype,{constructor:dr,iter:function(e,t,_){_?this.iterN(e-this.first,t-e,_):this.iterN(this.first,this.first+this.size,e)},insert:function(e,t){for(var _=0,m=0;m<t.length;++m)_+=t[m].height;this.insertInner(e-this.first,t,_)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=vn(this,this.first,this.first+this.size);return e===!1?t:t.join(e||this.lineSeparator())},setValue:Qt(function(e){var t=tt(this.first,0),_=this.first+this.size-1;Fn(this,{from:t,to:tt(_,dt(this,_).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&si(this.cm,0,0),tr(this,Yr(t),Ne)}),replaceRange:function(e,t,_,m){t=bt(this,t),_=_?bt(this,_):t,Nn(this,e,t,_,m)},getRange:function(e,t,_){var m=Pr(this,bt(this,e),bt(this,t));return _===!1?m:m.join(_||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){if(Fr(this,e))return dt(this,e)},getLineNumber:function(e){return kt(e)},getLineHandleVisualStart:function(e){return typeof e=="number"&&(e=dt(this,e)),vr(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return bt(this,e)},getCursor:function(e){var t=this.sel.primary(),_;return e==null||e=="head"?_=t.head:e=="anchor"?_=t.anchor:e=="end"||e=="to"||e===!1?_=t.to():_=t.from(),_},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:Qt(function(e,t,_){Xo(this,bt(this,typeof e=="number"?tt(e,t||0):e),null,_)}),setSelection:Qt(function(e,t,_){Xo(this,bt(this,e),bt(this,t||e),_)}),extendSelection:Qt(function(e,t,_){Yi(this,bt(this,e),t&&bt(this,t),_)}),extendSelections:Qt(function(e,t){Bo(this,rt(this,e),t)}),extendSelectionsBy:Qt(function(e,t){var _=ge(this.sel.ranges,e);Bo(this,rt(this,_),t)}),setSelections:Qt(function(e,t,_){if(!e.length)return;for(var m=[],L=0;L<e.length;L++)m[L]=new Dt(bt(this,e[L].anchor),bt(this,e[L].head));t==null&&(t=Math.min(e.length-1,this.sel.primIndex)),tr(this,kr(this.cm,m,t),_)}),addSelection:Qt(function(e,t,_){var m=this.sel.ranges.slice(0);m.push(new Dt(bt(this,e),bt(this,t||e))),tr(this,kr(this.cm,m,m.length-1),_)}),getSelection:function(e){for(var t=this.sel.ranges,_,m=0;m<t.length;m++){var L=Pr(this,t[m].from(),t[m].to());_=_?_.concat(L):L}return e===!1?_:_.join(e||this.lineSeparator())},getSelections:function(e){for(var t=[],_=this.sel.ranges,m=0;m<_.length;m++){var L=Pr(this,_[m].from(),_[m].to());e!==!1&&(L=L.join(e||this.lineSeparator())),t[m]=L}return t},replaceSelection:function(e,t,_){for(var m=[],L=0;L<this.sel.ranges.length;L++)m[L]=e;this.replaceSelections(m,t,_||"+input")},replaceSelections:Qt(function(e,t,_){for(var m=[],L=this.sel,N=0;N<L.ranges.length;N++){var V=L.ranges[N];m[N]={from:V.from(),to:V.to(),text:this.splitLines(e[N]),origin:_}}for(var Q=t&&t!="end"&&hl(this,m,t),q=m.length-1;q>=0;q--)Fn(this,m[q]);Q?Ho(this,Q):this.cm&&On(this.cm)}),undo:Qt(function(){Zi(this,"undo")}),redo:Qt(function(){Zi(this,"redo")}),undoSelection:Qt(function(){Zi(this,"undo",!0)}),redoSelection:Qt(function(){Zi(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,_=0,m=0;m<e.done.length;m++)e.done[m].ranges||++t;for(var L=0;L<e.undone.length;L++)e.undone[L].ranges||++_;return{undo:t,redo:_}},clearHistory:function(){var e=this;this.history=new Gi(this.history.maxGeneration),qr(this,function(t){return t.history=e.history},!0)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(e){return e&&(this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null),this.history.generation},isClean:function(e){return this.history.generation==(e||this.cleanGeneration)},getHistory:function(){return{done:In(this.history.done),undone:In(this.history.undone)}},setHistory:function(e){var t=this.history=new Gi(this.history.maxGeneration);t.done=In(e.done.slice(0),null,!0),t.undone=In(e.undone.slice(0),null,!0)},setGutterMarker:Qt(function(e,t,_){return mi(this,e,"gutter",function(m){var L=m.gutterMarkers||(m.gutterMarkers={});return L[t]=_,!_&&He(L)&&(m.gutterMarkers=null),!0})}),clearGutter:Qt(function(e){var t=this;this.iter(function(_){_.gutterMarkers&&_.gutterMarkers[e]&&mi(t,_,"gutter",function(){return _.gutterMarkers[e]=null,He(_.gutterMarkers)&&(_.gutterMarkers=null),!0})})}),lineInfo:function(e){var t;if(typeof e=="number"){if(!Fr(this,e))return null;if(t=e,e=dt(this,e),!e)return null}else if(t=kt(e),t==null)return null;return{line:t,handle:e,text:e.text,gutterMarkers:e.gutterMarkers,textClass:e.textClass,bgClass:e.bgClass,wrapClass:e.wrapClass,widgets:e.widgets}},addLineClass:Qt(function(e,t,_){return mi(this,e,t=="gutter"?"gutter":"class",function(m){var L=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass";if(!m[L])m[L]=_;else{if(x(_).test(m[L]))return!1;m[L]+=" "+_}return!0})}),removeLineClass:Qt(function(e,t,_){return mi(this,e,t=="gutter"?"gutter":"class",function(m){var L=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass",N=m[L];if(N)if(_==null)m[L]=null;else{var V=N.match(x(_));if(!V)return!1;var Q=V.index+V[0].length;m[L]=N.slice(0,V.index)+(!V.index||Q==N.length?"":" ")+N.slice(Q)||null}else return!1;return!0})}),addLineWidget:Qt(function(e,t,_){return xl(this,e,t,_)}),removeLineWidget:function(e){e.clear()},markText:function(e,t,_){return Un(this,bt(this,e),bt(this,t),_,_&&_.type||"range")},setBookmark:function(e,t){var _={replacedWith:t&&(t.nodeType==null?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};return e=bt(this,e),Un(this,e,e,_,"bookmark")},findMarksAt:function(e){e=bt(this,e);var t=[],_=dt(this,e.line).markedSpans;if(_)for(var m=0;m<_.length;++m){var L=_[m];(L.from==null||L.from<=e.ch)&&(L.to==null||L.to>=e.ch)&&t.push(L.marker.parent||L.marker)}return t},findMarks:function(e,t,_){e=bt(this,e),t=bt(this,t);var m=[],L=e.line;return this.iter(e.line,t.line+1,function(N){var V=N.markedSpans;if(V)for(var Q=0;Q<V.length;Q++){var q=V[Q];!(q.to!=null&&L==e.line&&e.ch>=q.to||q.from==null&&L!=e.line||q.from!=null&&L==t.line&&q.from>=t.ch)&&(!_||_(q.marker))&&m.push(q.marker.parent||q.marker)}++L}),m},getAllMarks:function(){var e=[];return this.iter(function(t){var _=t.markedSpans;if(_)for(var m=0;m<_.length;++m)_[m].from!=null&&e.push(_[m].marker)}),e},posFromIndex:function(e){var t,_=this.first,m=this.lineSeparator().length;return this.iter(function(L){var N=L.text.length+m;if(N>e)return t=e,!0;e-=N,++_}),bt(this,tt(_,t))},indexFromPos:function(e){e=bt(this,e);var t=e.ch;if(e.line<this.first||e.ch<0)return 0;var _=this.lineSeparator().length;return this.iter(this.first,e.line,function(m){t+=m.text.length+_}),t},copy:function(e){var t=new dr(vn(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);return t.scrollTop=this.scrollTop,t.scrollLeft=this.scrollLeft,t.sel=this.sel,t.extend=!1,e&&(t.history.undoDepth=this.history.undoDepth,t.setHistory(this.getHistory())),t},linkedDoc:function(e){e||(e={});var t=this.first,_=this.first+this.size;e.from!=null&&e.from>t&&(t=e.from),e.to!=null&&e.to<_&&(_=e.to);var m=new dr(vn(this,t,_),e.mode||this.modeOption,t,this.lineSep,this.direction);return e.sharedHist&&(m.history=this.history),(this.linked||(this.linked=[])).push({doc:m,sharedHist:e.sharedHist}),m.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],Sl(m,rs(this)),m},unlinkDoc:function(e){if(e instanceof Ut&&(e=e.doc),this.linked)for(var t=0;t<this.linked.length;++t){var _=this.linked[t];if(_.doc!=e)continue;this.linked.splice(t,1),e.unlinkDoc(this),wl(rs(this));break}if(e.history==this.history){var m=[e.id];qr(e,function(L){return m.push(L.id)},!0),e.history=new Gi(null),e.history.done=In(this.history.done,m),e.history.undone=In(this.history.undone,m)}},iterLinkedDocs:function(e){qr(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):$e(e)},lineSeparator:function(){return this.lineSep||`
|
|
|
`},setDirection:Qt(function(e){if(e!="rtl"&&(e="ltr"),e==this.direction)return;this.direction=e,this.iter(function(t){return t.order=null}),this.cm&&fl(this.cm)})}),dr.prototype.eachLine=dr.prototype.iter;var ns=0;function Cl(e){var t=this;if(is(t),Oe(t,e)||Xr(t.display,e))return;Y(e),E&&(ns=+new Date);var _=un(t,e,!0),m=e.dataTransfer.files;if(!_||t.isReadOnly())return;if(m&&m.length&&window.FileReader&&window.File)for(var L=m.length,N=Array(L),V=0,Q=function(){++V==L&&Yt(t,function(){_=bt(t.doc,_);var Be={from:_,to:_,text:t.doc.splitLines(N.filter(function(Qe){return Qe!=null}).join(t.doc.lineSeparator())),origin:"paste"};Fn(t.doc,Be),Ho(t.doc,Yr(bt(t.doc,_),bt(t.doc,Qr(Be))))})()},q=function(Be,Qe){if(t.options.allowDropFileTypes&&fe(t.options.allowDropFileTypes,Be.type)==-1){Q();return}var Ze=new FileReader;Ze.onerror=function(){return Q()},Ze.onload=function(){var nt=Ze.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(nt)){Q();return}N[Qe]=nt,Q()},Ze.readAsText(Be)},te=0;te<m.length;te++)q(m[te],te);else{if(t.state.draggingText&&t.doc.sel.contains(_)>-1){t.state.draggingText(e),setTimeout(function(){return t.display.input.focus()},20);return}try{var be=e.dataTransfer.getData("Text");if(be){var we;if(t.state.draggingText&&!t.state.draggingText.copy&&(we=t.listSelections()),Qi(t.doc,Yr(_,_)),we)for(var Xe=0;Xe<we.length;++Xe)Nn(t.doc,"",we[Xe].anchor,we[Xe].head,"drag");t.replaceSelection(be,"around","paste"),t.display.input.focus()}}catch(Be){}}}function Al(e,t){if(E&&(!e.state.draggingText||+new Date-ns<100)){oe(t);return}if(Oe(e,t)||Xr(e.display,t))return;if(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!s){var _=p("img",null,null,"position: fixed; left: 0; top: 0;");_.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",c&&(_.width=_.height=1,e.display.wrapper.appendChild(_),_._top=_.offsetTop),t.dataTransfer.setDragImage(_,0,0),c&&_.parentNode.removeChild(_)}}function Ll(e,t){var _=un(e,t);if(!_)return;var m=document.createDocumentFragment();go(e,_,m),e.display.dragCursor||(e.display.dragCursor=p("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),A(e.display.dragCursor,m)}function is(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function as(e){if(!document.getElementsByClassName)return;for(var t=document.getElementsByClassName("CodeMirror"),_=[],m=0;m<t.length;m++){var L=t[m].CodeMirror;L&&_.push(L)}_.length&&_[0].operation(function(){for(var N=0;N<_.length;N++)e(_[N])})}var os=!1;function kl(){if(os)return;Rl(),os=!0}function Rl(){var e;Me(window,"resize",function(){e==null&&(e=setTimeout(function(){e=null,as(Dl)},100))}),Me(window,"blur",function(){return as(Dn)})}function Dl(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}for(var $r={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"},bi=0;bi<10;bi++)$r[bi+48]=$r[bi+96]=String(bi);for(var $i=65;$i<=90;$i++)$r[$i]=String.fromCharCode($i);for(var xi=1;xi<=12;xi++)$r[xi+111]=$r[xi+63235]="F"+xi;var Hr={};Hr.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"},Hr.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"},Hr.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"},Hr.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"]},Hr.default=f?Hr.macDefault:Hr.pcDefault;function Ol(e){var t=e.split(/-(?!$)/);e=t[t.length-1];for(var _,m,L,N,V=0;V<t.length-1;V++){var Q=t[V];if(/^(cmd|meta|m)$/i.test(Q))N=!0;else if(/^a(lt)?$/i.test(Q))_=!0;else if(/^(c|ctrl|control)$/i.test(Q))m=!0;else if(/^s(hift)?$/i.test(Q))L=!0;else throw new Error("Unrecognized modifier name: "+Q)}return _&&(e="Alt-"+e),m&&(e="Ctrl-"+e),N&&(e="Cmd-"+e),L&&(e="Shift-"+e),e}function Ml(e){var t={};for(var _ in e)if(e.hasOwnProperty(_)){var m=e[_];if(/^(name|fallthrough|(de|at)tach)$/.test(_))continue;if(m=="..."){delete e[_];continue}for(var L=ge(_.split(" "),Ol),N=0;N<L.length;N++){var V=void 0,Q=void 0;N==L.length-1?(Q=L.join(" "),V=m):(Q=L.slice(0,N+1).join(" "),V="...");var q=t[Q];if(!q)t[Q]=V;else if(q!=V)throw new Error("Inconsistent bindings for "+Q)}delete e[_]}for(var te in t)e[te]=t[te];return e}function Kn(e,t,_,m){t=Ji(t);var L=t.call?t.call(e,m):t[e];if(L===!1)return"nothing";if(L==="...")return"multi";if(L!=null&&_(L))return"handled";if(t.fallthrough){if(Object.prototype.toString.call(t.fallthrough)!="[object Array]")return Kn(e,t.fallthrough,_,m);for(var N=0;N<t.fallthrough.length;N++){var V=Kn(e,t.fallthrough[N],_,m);if(V)return V}}}function ss(e){var t=typeof e=="string"?e:$r[e.keyCode];return t=="Ctrl"||t=="Alt"||t=="Shift"||t=="Mod"}function ls(e,t,_){var m=e;return t.altKey&&m!="Alt"&&(e="Alt-"+e),(w?t.metaKey:t.ctrlKey)&&m!="Ctrl"&&(e="Ctrl-"+e),(w?t.ctrlKey:t.metaKey)&&m!="Mod"&&(e="Cmd-"+e),!_&&t.shiftKey&&m!="Shift"&&(e="Shift-"+e),e}function us(e,t){if(c&&e.keyCode==34&&e.char)return!1;var _=$r[e.keyCode];return _==null||e.altGraphKey?!1:(e.keyCode==3&&e.code&&(_=e.code),ls(_,e,t))}function Ji(e){return typeof e=="string"?Hr[e]:e}function Bn(e,t){for(var _=e.doc.sel.ranges,m=[],L=0;L<_.length;L++){for(var N=t(_[L]);m.length&&vt(N.from,ee(m).to)<=0;){var V=m.pop();if(vt(V.from,N.from)<0){N.from=V.from;break}}m.push(N)}mr(e,function(){for(var Q=m.length-1;Q>=0;Q--)Nn(e.doc,"",m[Q].from,m[Q].to,"+delete");On(e)})}function Na(e,t,_){var m=Ae(e.text,t+_,_);return m<0||m>e.text.length?null:m}function Ua(e,t,_){var m=Na(e,t.ch,_);return m==null?null:new tt(t.line,m,_<0?"after":"before")}function Ka(e,t,_,m,L){if(e){t.doc.direction=="rtl"&&(L=-L);var N=We(_,t.doc.direction);if(N){var V=L<0?ee(N):N[0],Q=L<0==(V.level==1),q=Q?"after":"before",te;if(V.level>0||t.doc.direction=="rtl"){var be=Ln(t,_);te=L<0?_.text.length-1:0;var we=Mr(t,be,te).top;te=Te(function(Xe){return Mr(t,be,Xe).top==we},L<0==(V.level==1)?V.from:V.to-1,te),q=="before"&&(te=Na(_,te,1))}else te=L<0?V.to:V.from;return new tt(m,te,q)}}return new tt(m,L<0?_.text.length:0,L<0?"before":"after")}function Il(e,t,_,m){var L=We(t,e.doc.direction);if(!L)return Ua(t,_,m);_.ch>=t.text.length?(_.ch=t.text.length,_.sticky="before"):_.ch<=0&&(_.ch=0,_.sticky="after");var N=J(L,_.ch,_.sticky),V=L[N];if(e.doc.direction=="ltr"&&V.level%2==0&&(m>0?V.to>_.ch:V.from<_.ch))return Ua(t,_,m);var Q=function(at,lt){return Na(t,at instanceof tt?at.ch:at,lt)},q,te=function(at){return e.options.lineWrapping?(q=q||Ln(e,t),ho(e,t,q,at)):{begin:0,end:t.text.length}},be=te(_.sticky=="before"?Q(_,-1):_.ch);if(e.doc.direction=="rtl"||V.level==1){var we=V.level==1==m<0,Xe=Q(_,we?1:-1);if(Xe!=null&&(we?Xe<=V.to&&Xe<=be.end:Xe>=V.from&&Xe>=be.begin)){var Be=we?"before":"after";return new tt(_.line,Xe,Be)}}var Qe=function(at,lt,ot){for(var ut=function(Nt,qt){return qt?new tt(_.line,Q(Nt,1),"before"):new tt(_.line,Nt,"after")};at>=0&&at<L.length;at+=lt){var gt=L[at],ft=lt>0==(gt.level!=1),xt=ft?ot.begin:Q(ot.end,-1);if(gt.from<=xt&&xt<gt.to)return ut(xt,ft);if(xt=ft?gt.from:Q(gt.to,-1),ot.begin<=xt&&xt<ot.end)return ut(xt,ft)}},Ze=Qe(N+m,m,be);if(Ze)return Ze;var nt=m>0?be.end:Q(be.begin,-1);return nt!=null&&!(m>0&&nt==t.text.length)&&(Ze=Qe(m>0?0:L.length-1,m,te(nt)),Ze)?Ze:null}var Ei={selectAll:Vo,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),Ne)},killLine:function(e){return Bn(e,function(t){if(t.empty()){var _=dt(e.doc,t.head.line).text.length;return t.head.ch==_&&t.head.line<e.lastLine()?{from:t.head,to:tt(t.head.line+1,0)}:{from:t.head,to:tt(t.head.line,_)}}else return{from:t.from(),to:t.to()}})},deleteLine:function(e){return Bn(e,function(t){return{from:tt(t.from().line,0),to:bt(e.doc,tt(t.to().line+1,0))}})},delLineLeft:function(e){return Bn(e,function(t){return{from:tt(t.from().line,0),to:t.from()}})},delWrappedLineLeft:function(e){return Bn(e,function(t){var _=e.charCoords(t.head,"div").top+5,m=e.coordsChar({left:0,top:_},"div");return{from:m,to:t.from()}})},delWrappedLineRight:function(e){return Bn(e,function(t){var _=e.charCoords(t.head,"div").top+5,m=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:_},"div");return{from:t.from(),to:m}})},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(tt(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(tt(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy(function(t){return cs(e,t.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy(function(t){return ds(e,t.head)},{origin:"+move",bias:1})},goLineEnd:function(e){return e.extendSelectionsBy(function(t){return Pl(e,t.head.line)},{origin:"+move",bias:-1})},goLineRight:function(e){return e.extendSelectionsBy(function(t){var _=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:_},"div")},Ce)},goLineLeft:function(e){return e.extendSelectionsBy(function(t){var _=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:0,top:_},"div")},Ce)},goLineLeftSmart:function(e){return e.extendSelectionsBy(function(t){var _=e.cursorCoords(t.head,"div").top+5,m=e.coordsChar({left:0,top:_},"div");return m.ch<e.getLine(m.line).search(/\S/)?ds(e,t.head):m},Ce)},goLineUp:function(e){return e.moveV(-1,"line")},goLineDown:function(e){return e.moveV(1,"line")},goPageUp:function(e){return e.moveV(-1,"page")},goPageDown:function(e){return e.moveV(1,"page")},goCharLeft:function(e){return e.moveH(-1,"char")},goCharRight:function(e){return e.moveH(1,"char")},goColumnLeft:function(e){return e.moveH(-1,"column")},goColumnRight:function(e){return e.moveH(1,"column")},goWordLeft:function(e){return e.moveH(-1,"word")},goGroupRight:function(e){return e.moveH(1,"group")},goGroupLeft:function(e){return e.moveH(-1,"group")},goWordRight:function(e){return e.moveH(1,"word")},delCharBefore:function(e){return e.deleteH(-1,"codepoint")},delCharAfter:function(e){return e.deleteH(1,"char")},delWordBefore:function(e){return e.deleteH(-1,"word")},delWordAfter:function(e){return e.deleteH(1,"word")},delGroupBefore:function(e){return e.deleteH(-1,"group")},delGroupAfter:function(e){return e.deleteH(1,"group")},indentAuto:function(e){return e.indentSelection("smart")},indentMore:function(e){return e.indentSelection("add")},indentLess:function(e){return e.indentSelection("subtract")},insertTab:function(e){return e.replaceSelection(" ")},insertSoftTab:function(e){for(var t=[],_=e.listSelections(),m=e.options.tabSize,L=0;L<_.length;L++){var N=_[L].from(),V=G(e.getLine(N.line),N.ch,m);t.push(Re(m-V%m))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return mr(e,function(){for(var t=e.listSelections(),_=[],m=0;m<t.length;m++){if(!t[m].empty())continue;var L=t[m].head,N=dt(e.doc,L.line).text;if(N){if(L.ch==N.length&&(L=new tt(L.line,L.ch-1)),L.ch>0)L=new tt(L.line,L.ch+1),e.replaceRange(N.charAt(L.ch-1)+N.charAt(L.ch-2),tt(L.line,L.ch-2),L,"+transpose");else if(L.line>e.doc.first){var V=dt(e.doc,L.line-1).text;V&&(L=new tt(L.line,1),e.replaceRange(N.charAt(0)+e.doc.lineSeparator()+V.charAt(V.length-1),tt(L.line-1,V.length-1),L,"+transpose"))}}_.push(new Dt(L,L))}e.setSelections(_)})},newlineAndIndent:function(e){return mr(e,function(){for(var t=e.listSelections(),_=t.length-1;_>=0;_--)e.replaceRange(e.doc.lineSeparator(),t[_].anchor,t[_].head,"+input");t=e.listSelections();for(var m=0;m<t.length;m++)e.indentLine(t[m].from().line,null,!0);On(e)})},openLine:function(e){return e.replaceSelection(`
|
|
|
`,"start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function cs(e,t){var _=dt(e.doc,t),m=vr(_);return m!=_&&(t=kt(m)),Ka(!0,e,m,t,1)}function Pl(e,t){var _=dt(e.doc,t),m=Pi(_);return m!=_&&(t=kt(m)),Ka(!0,e,_,t,-1)}function ds(e,t){var _=cs(e,t.line),m=dt(e.doc,_.line),L=We(m,e.doc.direction);if(!L||L[0].level==0){var N=Math.max(_.ch,m.text.search(/\S/)),V=t.line==_.line&&t.ch<=N&&t.ch;return tt(_.line,V?0:N,_.sticky)}return _}function ea(e,t,_){if(typeof t=="string"&&(t=Ei[t],!t))return!1;e.display.input.ensurePolled();var m=e.display.shift,L=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),_&&(e.display.shift=!1),L=t(e)!=Ue}finally{e.display.shift=m,e.state.suppressEdits=!1}return L}function Fl(e,t,_){for(var m=0;m<e.state.keyMaps.length;m++){var L=Kn(t,e.state.keyMaps[m],_,e);if(L)return L}return e.options.extraKeys&&Kn(t,e.options.extraKeys,_,e)||Kn(t,e.options.keyMap,_,e)}var Nl=new ae;function Si(e,t,_,m){var L=e.state.keySeq;if(L){if(ss(t))return"handled";if(/\'$/.test(t)?e.state.keySeq=null:Nl.set(50,function(){e.state.keySeq==L&&(e.state.keySeq=null,e.display.input.reset())}),hs(e,L+" "+t,_,m))return!0}return hs(e,t,_,m)}function hs(e,t,_,m){var L=Fl(e,t,m);return L=="multi"&&(e.state.keySeq=t),L=="handled"&&$t(e,"keyHandled",e,t,_),(L=="handled"||L=="multi")&&(Y(_),Ea(e)),!!L}function fs(e,t){var _=us(t,!0);return _?t.shiftKey&&!e.state.keySeq?Si(e,"Shift-"+_,t,function(m){return ea(e,m,!0)})||Si(e,_,t,function(m){if(typeof m=="string"?/^go[A-Z]/.test(m):m.motion)return ea(e,m)}):Si(e,_,t,function(m){return ea(e,m)}):!1}function Ul(e,t,_){return Si(e,"'"+_+"'",t,function(m){return ea(e,m,!0)})}var Ba=null;function ps(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(t.curOp.focus=B(),Oe(t,e))return;E&&y<11&&e.keyCode==27&&(e.returnValue=!1);var _=e.keyCode;t.display.shift=_==16||e.shiftKey;var m=fs(t,e);c&&(Ba=m?_:null,!m&&_==88&&!qe&&(f?e.metaKey:e.ctrlKey)&&t.replaceSelection("",null,"cut")),D&&!f&&!m&&_==46&&e.shiftKey&&!e.ctrlKey&&document.execCommand&&document.execCommand("cut"),_==18&&!/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)&&Kl(t)}function Kl(e){var t=e.display.lineDiv;H(t,"CodeMirror-crosshair");function _(m){(m.keyCode==18||!m.altKey)&&(b(t,"CodeMirror-crosshair"),ne(document,"keyup",_),ne(document,"mouseover",_))}Me(document,"keyup",_),Me(document,"mouseover",_)}function ms(e){e.keyCode==16&&(this.doc.sel.shift=!1),Oe(this,e)}function gs(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(Xr(t.display,e)||Oe(t,e)||e.ctrlKey&&!e.altKey||f&&e.metaKey)return;var _=e.keyCode,m=e.charCode;if(c&&_==Ba){Ba=null,Y(e);return}if(c&&(!e.which||e.which<10)&&fs(t,e))return;var L=String.fromCharCode(m==null?_:m);if(L=="\b")return;if(Ul(t,e,L))return;t.display.input.onKeyPress(e)}var Bl=400,Xa=function(e,t,_){this.time=e,this.pos=t,this.button=_};Xa.prototype.compare=function(e,t,_){return this.time+Bl>e&&vt(t,this.pos)==0&&_==this.button};var wi,Ti;function Xl(e,t){var _=+new Date;return Ti&&Ti.compare(_,e,t)?(wi=Ti=null,"triple"):wi&&wi.compare(_,e,t)?(Ti=new Xa(_,e,t),wi=null,"double"):(wi=new Xa(_,e,t),Ti=null,"single")}function vs(e){var t=this,_=t.display;if(Oe(t,e)||_.activeTouch&&_.input.supportsTouch())return;if(_.input.ensurePolled(),_.shift=e.shiftKey,Xr(_,e)){v||(_.scroller.draggable=!1,setTimeout(function(){return _.scroller.draggable=!0},100));return}if(Ha(t,e))return;var m=un(t,e),L=X(e),N=m?Xl(m,L):"single";if(window.focus(),L==1&&t.state.selectingText&&t.state.selectingText(e),m&&Hl(t,L,m,N,e))return;L==1?m?Wl(t,m,N,e):_e(e)==_.scroller&&Y(e):L==2?(m&&Yi(t.doc,m),setTimeout(function(){return _.input.focus()},20)):L==3&&(C?t.display.input.onContextMenu(e):_o(t))}function Hl(e,t,_,m,L){var N="Click";return m=="double"?N="Double"+N:m=="triple"&&(N="Triple"+N),N=(t==1?"Left":t==2?"Middle":"Right")+N,Si(e,ls(N,L),L,function(V){if(typeof V=="string"&&(V=Ei[V]),!V)return!1;var Q=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),Q=V(e,_)!=Ue}finally{e.state.suppressEdits=!1}return Q})}function jl(e,t,_){var m=e.getOption("configureMouse"),L=m?m(e,t,_):{};if(L.unit==null){var N=h?_.shiftKey&&_.metaKey:_.altKey;L.unit=N?"rectangle":t=="single"?"char":t=="double"?"word":"line"}return(L.extend==null||e.doc.extend)&&(L.extend=e.doc.extend||_.shiftKey),L.addNew==null&&(L.addNew=f?_.metaKey:_.ctrlKey),L.moveOnDrag==null&&(L.moveOnDrag=!(f?_.altKey:_.ctrlKey)),L}function Wl(e,t,_,m){E?setTimeout(U(vo,e),0):e.curOp.focus=B();var L=jl(e,_,m),N=e.doc.sel,V;e.options.dragDrop&&de&&!e.isReadOnly()&&_=="single"&&(V=N.contains(t))>-1&&(vt((V=N.ranges[V]).from(),t)<0||t.xRel>0)&&(vt(V.to(),t)>0||t.xRel<0)?zl(e,m,t,L):Gl(e,m,t,L)}function zl(e,t,_,m){var L=e.display,N=!1,V=Yt(e,function(te){v&&(L.scroller.draggable=!1),e.state.draggingText=!1,ne(L.wrapper.ownerDocument,"mouseup",V),ne(L.wrapper.ownerDocument,"mousemove",Q),ne(L.scroller,"dragstart",q),ne(L.scroller,"drop",V),N||(Y(te),m.addNew||Yi(e.doc,_,null,null,m.extend),v&&!s||E&&y==9?setTimeout(function(){L.wrapper.ownerDocument.body.focus({preventScroll:!0}),L.input.focus()},20):L.input.focus())}),Q=function(te){N=N||Math.abs(t.clientX-te.clientX)+Math.abs(t.clientY-te.clientY)>=10},q=function(){return N=!0};v&&(L.scroller.draggable=!0),e.state.draggingText=V,V.copy=!m.moveOnDrag,L.scroller.dragDrop&&L.scroller.dragDrop(),Me(L.wrapper.ownerDocument,"mouseup",V),Me(L.wrapper.ownerDocument,"mousemove",Q),Me(L.scroller,"dragstart",q),Me(L.scroller,"drop",V),_o(e),setTimeout(function(){return L.input.focus()},20)}function _s(e,t,_){if(_=="char")return new Dt(t,t);if(_=="word")return e.findWordAt(t);if(_=="line")return new Dt(tt(t.line,0),bt(e.doc,tt(t.line+1,0)));var m=_(e,t);return new Dt(m.from,m.to)}function Gl(e,t,_,m){var L=e.display,N=e.doc;Y(t);var V,Q,q=N.sel,te=q.ranges;if(m.addNew&&!m.extend?(Q=N.sel.contains(_),Q>-1?V=te[Q]:V=new Dt(_,_)):(V=N.sel.primary(),Q=N.sel.primIndex),m.unit=="rectangle")m.addNew||(V=new Dt(_,_)),_=un(e,t,!0,!0),Q=-1;else{var be=_s(e,_,m.unit);m.extend?V=Pa(V,be.anchor,be.head,m.extend):V=be}m.addNew?Q==-1?(Q=te.length,tr(N,kr(e,te.concat([V]),Q),{scroll:!1,origin:"*mouse"})):te.length>1&&te[Q].empty()&&m.unit=="char"&&!m.extend?(tr(N,kr(e,te.slice(0,Q).concat(te.slice(Q+1)),0),{scroll:!1,origin:"*mouse"}),q=N.sel):Fa(N,Q,V,xe):(Q=0,tr(N,new yr([V],0),xe),q=N.sel);var we=_;function Xe(ot){if(vt(we,ot)==0)return;if(we=ot,m.unit=="rectangle"){for(var ut=[],gt=e.options.tabSize,ft=G(dt(N,_.line).text,_.ch,gt),xt=G(dt(N,ot.line).text,ot.ch,gt),Nt=Math.min(ft,xt),qt=Math.max(ft,xt),Xt=Math.min(_.line,ot.line),gr=Math.min(e.lastLine(),Math.max(_.line,ot.line));Xt<=gr;Xt++){var hr=dt(N,Xt).text,Wt=De(hr,Nt,gt);Nt==qt?ut.push(new Dt(tt(Xt,Wt),tt(Xt,Wt))):hr.length>Wt&&ut.push(new Dt(tt(Xt,Wt),tt(Xt,De(hr,qt,gt))))}ut.length||ut.push(new Dt(_,_)),tr(N,kr(e,q.ranges.slice(0,Q).concat(ut),Q),{origin:"*mouse",scroll:!1}),e.scrollIntoView(ot)}else{var fr=V,Jt=_s(e,ot,m.unit),Vt=fr.anchor,zt;vt(Jt.anchor,Vt)>0?(zt=Jt.head,Vt=en(fr.from(),Jt.anchor)):(zt=Jt.anchor,Vt=bn(fr.to(),Jt.head));var Ht=q.ranges.slice(0);Ht[Q]=Vl(e,new Dt(bt(N,Vt),zt)),tr(N,kr(e,Ht,Q),xe)}}var Be=L.wrapper.getBoundingClientRect(),Qe=0;function Ze(ot){var ut=++Qe,gt=un(e,ot,!0,m.unit=="rectangle");if(!gt)return;if(vt(gt,we)!=0){e.curOp.focus=B(),Xe(gt);var ft=Hi(L,N);(gt.line>=ft.to||gt.line<ft.from)&&setTimeout(Yt(e,function(){Qe==ut&&Ze(ot)}),150)}else{var xt=ot.clientY<Be.top?-20:ot.clientY>Be.bottom?20:0;xt&&setTimeout(Yt(e,function(){if(Qe!=ut)return;L.scroller.scrollTop+=xt,Ze(ot)}),50)}}function nt(ot){e.state.selectingText=!1,Qe=Infinity,ot&&(Y(ot),L.input.focus()),ne(L.wrapper.ownerDocument,"mousemove",at),ne(L.wrapper.ownerDocument,"mouseup",lt),N.history.lastSelOrigin=null}var at=Yt(e,function(ot){ot.buttons===0||!X(ot)?nt(ot):Ze(ot)}),lt=Yt(e,nt);e.state.selectingText=lt,Me(L.wrapper.ownerDocument,"mousemove",at),Me(L.wrapper.ownerDocument,"mouseup",lt)}function Vl(e,t){var _=t.anchor,m=t.head,L=dt(e.doc,_.line);if(vt(_,m)==0&&_.sticky==m.sticky)return t;var N=We(L);if(!N)return t;var V=J(N,_.ch,_.sticky),Q=N[V];if(Q.from!=_.ch&&Q.to!=_.ch)return t;var q=V+(Q.from==_.ch==(Q.level!=1)?0:1);if(q==0||q==N.length)return t;var te;if(m.line!=_.line)te=(m.line-_.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var be=J(N,m.ch,m.sticky),we=be-V||(m.ch-_.ch)*(Q.level==1?-1:1);be==q-1||be==q?te=we<0:te=we>0}var Xe=N[q+(te?-1:0)],Be=te==(Xe.level==1),Qe=Be?Xe.from:Xe.to,Ze=Be?"after":"before";return _.ch==Qe&&_.sticky==Ze?t:new Dt(new tt(_.line,Qe,Ze),m)}function ys(e,t,_,m){var L,N;if(t.touches)L=t.touches[0].clientX,N=t.touches[0].clientY;else try{L=t.clientX,N=t.clientY}catch(Xe){return!1}if(L>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;m&&Y(t);var V=e.display,Q=V.lineDiv.getBoundingClientRect();if(N>Q.bottom||!ue(e,_))return z(t);N-=Q.top-V.viewOffset;for(var q=0;q<e.display.gutterSpecs.length;++q){var te=V.gutters.childNodes[q];if(te&&te.getBoundingClientRect().right>=L){var be=Er(e.doc,N),we=e.display.gutterSpecs[q];return Ee(e,_,e,be,we.className,t),z(t)}}}function Ha(e,t){return ys(e,t,"gutterClick",!0)}function bs(e,t){if(Xr(e.display,t)||Yl(e,t))return;if(Oe(e,t,"contextmenu"))return;C||e.display.input.onContextMenu(t)}function Yl(e,t){return ue(e,"gutterContextMenu")?ys(e,t,"gutterContextMenu",!1):!1}function xs(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),ai(e)}var Xn={toString:function(){return"CodeMirror.Init"}},Es={},ta={};function Ql(e){var t=e.optionHandlers;function _(m,L,N,V){e.defaults[m]=L,N&&(t[m]=V?function(Q,q,te){te!=Xn&&N(Q,q,te)}:N)}e.defineOption=_,e.Init=Xn,_("value","",function(m,L){return m.setValue(L)},!0),_("mode",null,function(m,L){m.doc.modeOption=L,Oa(m)},!0),_("indentUnit",2,Oa,!0),_("indentWithTabs",!1),_("smartIndent",!0),_("tabSize",4,function(m){fi(m),ai(m),cr(m)},!0),_("lineSeparator",null,function(m,L){if(m.doc.lineSep=L,!L)return;var N=[],V=m.doc.first;m.doc.iter(function(q){for(var te=0;;){var be=q.text.indexOf(L,te);if(be==-1)break;te=be+L.length,N.push(tt(V,be))}V++});for(var Q=N.length-1;Q>=0;Q--)Nn(m.doc,L,N[Q],tt(N[Q].line,N[Q].ch+L.length))}),_("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200c\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,function(m,L,N){m.state.specialChars=new RegExp(L.source+(L.test(" ")?"":"| "),"g"),N!=Xn&&m.refresh()}),_("specialCharPlaceholder",Ft,function(m){return m.refresh()},!0),_("electricChars",!0),_("inputStyle",i?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),_("spellcheck",!1,function(m,L){return m.getInputField().spellcheck=L},!0),_("autocorrect",!1,function(m,L){return m.getInputField().autocorrect=L},!0),_("autocapitalize",!1,function(m,L){return m.getInputField().autocapitalize=L},!0),_("rtlMoveVisually",!T),_("wholeLineUpdateBefore",!0),_("theme","default",function(m){xs(m),hi(m)},!0),_("keyMap","default",function(m,L,N){var V=Ji(L),Q=N!=Xn&&Ji(N);Q&&Q.detach&&Q.detach(m,V),V.attach&&V.attach(m,Q||null)}),_("extraKeys",null),_("configureMouse",null),_("lineWrapping",!1,Zl,!0),_("gutters",[],function(m,L){m.display.gutterSpecs=Ra(L,m.options.lineNumbers),hi(m)},!0),_("fixedGutter",!0,function(m,L){m.display.gutters.style.left=L?ba(m.display)+"px":"0",m.refresh()},!0),_("coverGutterNextToScrollbar",!1,function(m){return Mn(m)},!0),_("scrollbarStyle","native",function(m){wo(m),Mn(m),m.display.scrollbars.setScrollTop(m.doc.scrollTop),m.display.scrollbars.setScrollLeft(m.doc.scrollLeft)},!0),_("lineNumbers",!1,function(m,L){m.display.gutterSpecs=Ra(m.options.gutters,L),hi(m)},!0),_("firstLineNumber",1,hi,!0),_("lineNumberFormatter",function(m){return m},hi,!0),_("showCursorWhenSelecting",!1,oi,!0),_("resetSelectionOnContextMenu",!0),_("lineWiseCopyCut",!0),_("pasteLinesPerSelection",!0),_("selectionsMayTouch",!1),_("readOnly",!1,function(m,L){L=="nocursor"&&(Dn(m),m.display.input.blur()),m.display.input.readOnlyChanged(L)}),_("screenReaderLabel",null,function(m,L){L=L===""?null:L,m.display.input.screenReaderLabelChanged(L)}),_("disableInput",!1,function(m,L){L||m.display.input.reset()},!0),_("dragDrop",!0,ql),_("allowDropFileTypes",null),_("cursorBlinkRate",530),_("cursorScrollMargin",0),_("cursorHeight",1,oi,!0),_("singleCursorHeightPerLine",!0,oi,!0),_("workTime",100),_("workDelay",100),_("flattenSpans",!0,fi,!0),_("addModeClass",!1,fi,!0),_("pollInterval",100),_("undoDepth",200,function(m,L){return m.doc.history.undoDepth=L}),_("historyEventDelay",1250),_("viewportMargin",10,function(m){return m.refresh()},!0),_("maxHighlightLength",1e4,fi,!0),_("moveInputWithCursor",!0,function(m,L){L||m.display.input.resetPosition()}),_("tabindex",null,function(m,L){return m.display.input.getField().tabIndex=L||""}),_("autofocus",null),_("direction","ltr",function(m,L){return m.doc.setDirection(L)},!0),_("phrases",null)}function ql(e,t,_){var m=_&&_!=Xn;if(!t!=!m){var L=e.display.dragFunctions,N=t?Me:ne;N(e.display.scroller,"dragstart",L.start),N(e.display.scroller,"dragenter",L.enter),N(e.display.scroller,"dragover",L.over),N(e.display.scroller,"dragleave",L.leave),N(e.display.scroller,"drop",L.drop)}}function Zl(e){e.options.lineWrapping?(H(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(b(e.display.wrapper,"CodeMirror-wrap"),Fi(e)),xa(e),cr(e),ai(e),setTimeout(function(){return Mn(e)},100)}function Ut(e,t){var _=this;if(!(this instanceof Ut))return new Ut(e,t);this.options=t=t?K(t):{},K(Es,t,!1);var m=t.value;typeof m=="string"?m=new dr(m,t.mode,null,t.lineSeparator,t.direction):t.mode&&(m.modeOption=t.mode),this.doc=m;var L=new Ut.inputStyles[t.inputStyle](this),N=this.display=new cl(e,m,L,t);N.wrapper.CodeMirror=this,xs(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),wo(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 ae,keySeq:null,specialChars:null},t.autofocus&&!i&&N.input.focus(),E&&y<11&&setTimeout(function(){return _.display.input.reset(!0)},20),$l(this),kl(),fn(this),this.curOp.forceUpdate=!0,Io(this,m),t.autofocus&&!i||this.hasFocus()?setTimeout(function(){_.hasFocus()&&!_.state.focused&&Sa(_)},20):Dn(this);for(var V in ta)ta.hasOwnProperty(V)&&ta[V](this,t[V],Xn);Ao(this),t.finishInit&&t.finishInit(this);for(var Q=0;Q<ja.length;++Q)ja[Q](this);pn(this),v&&t.lineWrapping&&getComputedStyle(N.lineDiv).textRendering=="optimizelegibility"&&(N.lineDiv.style.textRendering="auto")}Ut.defaults=Es,Ut.optionHandlers=ta;function $l(e){var t=e.display;Me(t.scroller,"mousedown",Yt(e,vs)),E&&y<11?Me(t.scroller,"dblclick",Yt(e,function(q){if(Oe(e,q))return;var te=un(e,q);if(!te||Ha(e,q)||Xr(e.display,q))return;Y(q);var be=e.findWordAt(te);Yi(e.doc,be.anchor,be.head)})):Me(t.scroller,"dblclick",function(q){return Oe(e,q)||Y(q)}),Me(t.scroller,"contextmenu",function(q){return bs(e,q)}),Me(t.input.getField(),"contextmenu",function(q){t.scroller.contains(q.target)||bs(e,q)});var _,m={end:0};function L(){t.activeTouch&&(_=setTimeout(function(){return t.activeTouch=null},1e3),m=t.activeTouch,m.end=+new Date)}function N(q){if(q.touches.length!=1)return!1;var te=q.touches[0];return te.radiusX<=1&&te.radiusY<=1}function V(q,te){if(te.left==null)return!0;var be=te.left-q.left,we=te.top-q.top;return be*be+we*we>20*20}Me(t.scroller,"touchstart",function(q){if(!Oe(e,q)&&!N(q)&&!Ha(e,q)){t.input.ensurePolled(),clearTimeout(_);var te=+new Date;t.activeTouch={start:te,moved:!1,prev:te-m.end<=300?m:null},q.touches.length==1&&(t.activeTouch.left=q.touches[0].pageX,t.activeTouch.top=q.touches[0].pageY)}}),Me(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),Me(t.scroller,"touchend",function(q){var te=t.activeTouch;if(te&&!Xr(t,q)&&te.left!=null&&!te.moved&&new Date-te.start<300){var be=e.coordsChar(t.activeTouch,"page"),we;!te.prev||V(te,te.prev)?we=new Dt(be,be):!te.prev.prev||V(te,te.prev.prev)?we=e.findWordAt(be):we=new Dt(tt(be.line,0),bt(e.doc,tt(be.line+1,0))),e.setSelection(we.anchor,we.head),e.focus(),Y(q)}L()}),Me(t.scroller,"touchcancel",L),Me(t.scroller,"scroll",function(){t.scroller.clientHeight&&(li(e,t.scroller.scrollTop),dn(e,t.scroller.scrollLeft,!0),Ee(e,"scroll",e))}),Me(t.scroller,"mousewheel",function(q){return Ro(e,q)}),Me(t.scroller,"DOMMouseScroll",function(q){return Ro(e,q)}),Me(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(q){Oe(e,q)||oe(q)},over:function(q){Oe(e,q)||(Ll(e,q),oe(q))},start:function(q){return Al(e,q)},drop:Yt(e,Cl),leave:function(q){Oe(e,q)||is(e)}};var Q=t.input.getField();Me(Q,"keyup",function(q){return ms.call(e,q)}),Me(Q,"keydown",Yt(e,ps)),Me(Q,"keypress",Yt(e,gs)),Me(Q,"focus",function(q){return Sa(e,q)}),Me(Q,"blur",function(q){return Dn(e,q)})}var ja=[];Ut.defineInitHook=function(e){return ja.push(e)};function Ci(e,t,_,m){var L=e.doc,N;_==null&&(_="add"),_=="smart"&&(L.mode.indent?N=Sr(e,t).state:_="prev");var V=e.options.tabSize,Q=dt(L,t),q=G(Q.text,null,V);Q.stateAfter&&(Q.stateAfter=null);var te=Q.text.match(/^\s*/)[0],be;if(!m&&!/\S/.test(Q.text))be=0,_="not";else if(_=="smart"&&(be=L.mode.indent(N,Q.text.slice(te.length),Q.text),be==Ue||be>150)){if(!m)return;_="prev"}_=="prev"?t>L.first?be=G(dt(L,t-1).text,null,V):be=0:_=="add"?be=q+e.options.indentUnit:_=="subtract"?be=q-e.options.indentUnit:typeof _=="number"&&(be=q+_),be=Math.max(0,be);var we="",Xe=0;if(e.options.indentWithTabs)for(var Be=Math.floor(be/V);Be;--Be)Xe+=V,we+=" ";if(Xe<be&&(we+=Re(be-Xe)),we!=te)return Nn(L,we,tt(t,0),tt(t,te.length),"+input"),Q.stateAfter=null,!0;for(var Qe=0;Qe<L.sel.ranges.length;Qe++){var Ze=L.sel.ranges[Qe];if(Ze.head.line==t&&Ze.head.ch<te.length){var nt=tt(t,te.length);Fa(L,Qe,new Dt(nt,nt));break}}}var Rr=null;function ra(e){Rr=e}function Wa(e,t,_,m,L){var N=e.doc;e.display.shift=!1,m||(m=N.sel);var V=+new Date-200,Q=L=="paste"||e.state.pasteIncoming>V,q=$e(t),te=null;if(Q&&m.ranges.length>1)if(Rr&&Rr.text.join(`
|
|
|
`)==t){if(m.ranges.length%Rr.text.length==0){te=[];for(var be=0;be<Rr.text.length;be++)te.push(N.splitLines(Rr.text[be]))}}else q.length==m.ranges.length&&e.options.pasteLinesPerSelection&&(te=ge(q,function(at){return[at]}));for(var we=e.curOp.updateInput,Xe=m.ranges.length-1;Xe>=0;Xe--){var Be=m.ranges[Xe],Qe=Be.from(),Ze=Be.to();Be.empty()&&(_&&_>0?Qe=tt(Qe.line,Qe.ch-_):e.state.overwrite&&!Q?Ze=tt(Ze.line,Math.min(dt(N,Ze.line).text.length,Ze.ch+ee(q).length)):Q&&Rr&&Rr.lineWise&&Rr.text.join(`
|
|
|
`)==q.join(`
|
|
|
`)&&(Qe=Ze=tt(Qe.line,0)));var nt={from:Qe,to:Ze,text:te?te[Xe%te.length]:q,origin:L||(Q?"paste":e.state.cutIncoming>V?"cut":"+input")};Fn(e.doc,nt),$t(e,"inputRead",e,nt)}t&&!Q&&ws(e,t),On(e),e.curOp.updateInput<2&&(e.curOp.updateInput=we),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function Ss(e,t){var _=e.clipboardData&&e.clipboardData.getData("Text");if(_)return e.preventDefault(),!t.isReadOnly()&&!t.options.disableInput&&mr(t,function(){return Wa(t,_,0,null,"paste")}),!0}function ws(e,t){if(!e.options.electricChars||!e.options.smartIndent)return;for(var _=e.doc.sel,m=_.ranges.length-1;m>=0;m--){var L=_.ranges[m];if(L.head.ch>100||m&&_.ranges[m-1].head.line==L.head.line)continue;var N=e.getModeAt(L.head),V=!1;if(N.electricChars){for(var Q=0;Q<N.electricChars.length;Q++)if(t.indexOf(N.electricChars.charAt(Q))>-1){V=Ci(e,L.head.line,"smart");break}}else N.electricInput&&(N.electricInput.test(dt(e.doc,L.head.line).text.slice(0,L.head.ch))&&(V=Ci(e,L.head.line,"smart")));V&&$t(e,"electricInput",e,L.head.line)}}function Ts(e){for(var t=[],_=[],m=0;m<e.doc.sel.ranges.length;m++){var L=e.doc.sel.ranges[m].head.line,N={anchor:tt(L,0),head:tt(L+1,0)};_.push(N),t.push(e.getRange(N.anchor,N.head))}return{text:t,ranges:_}}function Cs(e,t,_,m){e.setAttribute("autocorrect",_?"":"off"),e.setAttribute("autocapitalize",m?"":"off"),e.setAttribute("spellcheck",!!t)}function As(){var e=p("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),t=p("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return v?e.style.width="1000px":e.setAttribute("wrap","off"),n&&(e.style.border="1px solid black"),Cs(e),t}function Jl(e){var t=e.optionHandlers,_=e.helpers={};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(m,L){var N=this.options,V=N[m];if(N[m]==L&&m!="mode")return;N[m]=L,t.hasOwnProperty(m)&&Yt(this,t[m])(this,L,V),Ee(this,"optionChange",this,m)},getOption:function(m){return this.options[m]},getDoc:function(){return this.doc},addKeyMap:function(m,L){this.state.keyMaps[L?"push":"unshift"](Ji(m))},removeKeyMap:function(m){for(var L=this.state.keyMaps,N=0;N<L.length;++N)if(L[N]==m||L[N].name==m)return L.splice(N,1),!0},addOverlay:ir(function(m,L){var N=m.token?m:e.getMode(this.options,m);if(N.startState)throw new Error("Overlays may not be stateful.");se(this.state.overlays,{mode:N,modeSpec:m,opaque:L&&L.opaque,priority:L&&L.priority||0},function(V){return V.priority}),this.state.modeGen++,cr(this)}),removeOverlay:ir(function(m){for(var L=this.state.overlays,N=0;N<L.length;++N){var V=L[N].modeSpec;if(V==m||typeof m=="string"&&V.name==m){L.splice(N,1),this.state.modeGen++,cr(this);return}}}),indentLine:ir(function(m,L,N){typeof L!="string"&&typeof L!="number"&&(L==null?L=this.options.smartIndent?"smart":"prev":L=L?"add":"subtract"),Fr(this.doc,m)&&Ci(this,m,L,N)}),indentSelection:ir(function(m){for(var L=this.doc.sel.ranges,N=-1,V=0;V<L.length;V++){var Q=L[V];if(Q.empty())Q.head.line>N&&(Ci(this,Q.head.line,m,!0),N=Q.head.line,V==this.doc.sel.primIndex&&On(this));else{var q=Q.from(),te=Q.to(),be=Math.max(N,q.line);N=Math.min(this.lastLine(),te.line-(te.ch?0:1))+1;for(var we=be;we<N;++we)Ci(this,we,m);var Xe=this.doc.sel.ranges;q.ch==0&&L.length==Xe.length&&Xe[V].from().ch>0&&Fa(this.doc,V,new Dt(q,Xe[V].to()),Ne)}}}),getTokenAt:function(m,L){return Li(this,m,L)},getLineTokens:function(m,L){return Li(this,tt(m),L,!0)},getTokenTypeAt:function(m){m=bt(this.doc,m);var L=tn(this,dt(this.doc,m.line)),N=0,V=(L.length-1)/2,Q=m.ch,q;if(Q==0)q=L[2];else for(;;){var te=N+V>>1;if((te?L[te*2-1]:0)>=Q)V=te;else if(L[te*2+1]<Q)N=te+1;else{q=L[te*2+2];break}}var be=q?q.indexOf("overlay "):-1;return be<0?q:be==0?null:q.slice(0,be-1)},getModeAt:function(m){var L=this.doc.mode;return L.innerMode?e.innerMode(L,this.getTokenAt(m).state).mode:L},getHelper:function(m,L){return this.getHelpers(m,L)[0]},getHelpers:function(m,L){var N=[];if(!_.hasOwnProperty(L))return N;var V=_[L],Q=this.getModeAt(m);if(typeof Q[L]=="string")V[Q[L]]&&N.push(V[Q[L]]);else if(Q[L])for(var q=0;q<Q[L].length;q++){var te=V[Q[L][q]];te&&N.push(te)}else Q.helperType&&V[Q.helperType]?N.push(V[Q.helperType]):V[Q.name]&&N.push(V[Q.name]);for(var be=0;be<V._global.length;be++){var we=V._global[be];we.pred(Q,this)&&fe(N,we.val)==-1&&N.push(we.val)}return N},getStateAfter:function(m,L){var N=this.doc;return m=xn(N,m==null?N.first+N.size-1:m),Sr(this,m+1,L).state},cursorCoords:function(m,L){var N,V=this.doc.sel.primary();return m==null?N=V.head:typeof m=="object"?N=bt(this.doc,m):N=m?V.from():V.to(),Lr(this,N,L||"page")},charCoords:function(m,L){return ma(this,bt(this.doc,m),L||"page")},coordsChar:function(m,L){return m=lo(this,m,L||"page"),va(this,m.left,m.top)},lineAtHeight:function(m,L){return m=lo(this,{top:m,left:0},L||"page").top,Er(this.doc,m+this.display.viewOffset)},heightAtLine:function(m,L,N){var V=!1,Q;if(typeof m=="number"){var q=this.doc.first+this.doc.size-1;m<this.doc.first?m=this.doc.first:m>q&&(m=q,V=!0),Q=dt(this.doc,m)}else Q=m;return Ui(this,Q,{top:0,left:0},L||"page",N||V).top+(V?this.doc.height-Ar(Q):0)},defaultTextHeight:function(){return kn(this.display)},defaultCharWidth:function(){return Rn(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(m,L,N,V,Q){var q=this.display;m=Lr(this,bt(this.doc,m));var te=m.bottom,be=m.left;if(L.style.position="absolute",L.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(L),q.sizer.appendChild(L),V=="over")te=m.top;else if(V=="above"||V=="near"){var we=Math.max(q.wrapper.clientHeight,this.doc.height),Xe=Math.max(q.sizer.clientWidth,q.lineSpace.clientWidth);(V=="above"||m.bottom+L.offsetHeight>we)&&m.top>L.offsetHeight?te=m.top-L.offsetHeight:m.bottom+L.offsetHeight<=we&&(te=m.bottom),be+L.offsetWidth>Xe&&(be=Xe-L.offsetWidth)}L.style.top=te+"px",L.style.left=L.style.right="",Q=="right"?(be=q.sizer.clientWidth-L.offsetWidth,L.style.right="0px"):(Q=="left"?be=0:Q=="middle"&&(be=(q.sizer.clientWidth-L.offsetWidth)/2),L.style.left=be+"px"),N&&qs(this,{left:be,top:te,right:be+L.offsetWidth,bottom:te+L.offsetHeight})},triggerOnKeyDown:ir(ps),triggerOnKeyPress:ir(gs),triggerOnKeyUp:ms,triggerOnMouseDown:ir(vs),execCommand:function(m){if(Ei.hasOwnProperty(m))return Ei[m].call(null,this)},triggerElectric:ir(function(m){ws(this,m)}),findPosH:function(m,L,N,V){var Q=1;L<0&&(Q=-1,L=-L);for(var q=bt(this.doc,m),te=0;te<L&&!(q=za(this.doc,q,Q,N,V),q.hitSide);++te);return q},moveH:ir(function(m,L){var N=this;this.extendSelectionsBy(function(V){return N.display.shift||N.doc.extend||V.empty()?za(N.doc,V.head,m,L,N.options.rtlMoveVisually):m<0?V.from():V.to()},Ce)}),deleteH:ir(function(m,L){var N=this.doc.sel,V=this.doc;N.somethingSelected()?V.replaceSelection("",null,"+delete"):Bn(this,function(Q){var q=za(V,Q.head,m,L,!1);return m<0?{from:q,to:Q.head}:{from:Q.head,to:q}})}),findPosV:function(m,L,N,V){var Q=1,q=V;L<0&&(Q=-1,L=-L);for(var te=bt(this.doc,m),be=0;be<L;++be){var we=Lr(this,te,"div");if(q==null?q=we.left:we.left=q,te=Ls(this,we,Q,N),te.hitSide)break}return te},moveV:ir(function(m,L){var N=this,V=this.doc,Q=[],q=!this.display.shift&&!V.extend&&V.sel.somethingSelected();if(V.extendSelectionsBy(function(be){if(q)return m<0?be.from():be.to();var we=Lr(N,be.head,"div");be.goalColumn!=null&&(we.left=be.goalColumn),Q.push(we.left);var Xe=Ls(N,we,m,L);return L=="page"&&be==V.sel.primary()&&Ta(N,ma(N,Xe,"div").top-we.top),Xe},Ce),Q.length)for(var te=0;te<V.sel.ranges.length;te++)V.sel.ranges[te].goalColumn=Q[te]}),findWordAt:function(m){var L=this.doc,N=dt(L,m.line).text,V=m.ch,Q=m.ch;if(N){var q=this.getHelper(m,"wordChars");(m.sticky=="before"||Q==N.length)&&V?--V:++Q;for(var te=N.charAt(V),be=Ge(te,q)?function(we){return Ge(we,q)}:/\s/.test(te)?function(we){return/\s/.test(we)}:function(we){return!/\s/.test(we)&&!Ge(we)};V>0&&be(N.charAt(V-1));)--V;for(;Q<N.length&&be(N.charAt(Q));)++Q}return new Dt(tt(m.line,V),tt(m.line,Q))},toggleOverwrite:function(m){if(m!=null&&m==this.state.overwrite)return;(this.state.overwrite=!this.state.overwrite)?H(this.display.cursorDiv,"CodeMirror-overwrite"):b(this.display.cursorDiv,"CodeMirror-overwrite"),Ee(this,"overwriteToggle",this,this.state.overwrite)},hasFocus:function(){return this.display.input.getField()==B()},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:ir(function(m,L){si(this,m,L)}),getScrollInfo:function(){var m=this.display.scroller;return{left:m.scrollLeft,top:m.scrollTop,height:m.scrollHeight-Or(this)-this.display.barHeight,width:m.scrollWidth-Or(this)-this.display.barWidth,clientHeight:ha(this),clientWidth:sn(this)}},scrollIntoView:ir(function(m,L){m==null?(m={from:this.doc.sel.primary().head,to:null},L==null&&(L=this.options.cursorScrollMargin)):typeof m=="number"?m={from:tt(m,0),to:null}:m.from==null&&(m={from:m,to:null}),m.to||(m.to=m.from),m.margin=L||0,m.from.line!=null?Zs(this,m):bo(this,m.from,m.to,m.margin)}),setSize:ir(function(m,L){var N=this,V=function(q){return typeof q=="number"||/^\d+$/.test(String(q))?q+"px":q};m!=null&&(this.display.wrapper.style.width=V(m)),L!=null&&(this.display.wrapper.style.height=V(L)),this.options.lineWrapping&&ao(this);var Q=this.display.viewFrom;this.doc.iter(Q,this.display.viewTo,function(q){if(q.widgets){for(var te=0;te<q.widgets.length;te++)if(q.widgets[te].noHScroll){Gr(N,Q,"widget");break}}++Q}),this.curOp.forceUpdate=!0,Ee(this,"refresh",this)}),operation:function(m){return mr(this,m)},startOperation:function(){return fn(this)},endOperation:function(){return pn(this)},refresh:ir(function(){var m=this.display.cachedTextHeight;cr(this),this.curOp.forceUpdate=!0,ai(this),si(this,this.doc.scrollLeft,this.doc.scrollTop),La(this.display),(m==null||Math.abs(m-kn(this.display))>.5||this.options.lineWrapping)&&xa(this),Ee(this,"refresh",this)}),swapDoc:ir(function(m){var L=this.doc;return L.cm=null,this.state.selectingText&&this.state.selectingText(),Io(this,m),ai(this),this.display.input.reset(),si(this,m.scrollLeft,m.scrollTop),this.curOp.forceScroll=!0,$t(this,"swapDoc",this,L),L}),phrase:function(m){var L=this.options.phrases;return L&&Object.prototype.hasOwnProperty.call(L,m)?L[m]:m},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}},he(e),e.registerHelper=function(m,L,N){_.hasOwnProperty(m)||(_[m]=e[m]={_global:[]}),_[m][L]=N},e.registerGlobalHelper=function(m,L,N,V){e.registerHelper(m,L,V),_[m]._global.push({pred:N,val:V})}}function za(e,t,_,m,L){var N=t,V=_,Q=dt(e,t.line),q=L&&e.direction=="rtl"?-_:_;function te(){var lt=t.line+q;return lt<e.first||lt>=e.first+e.size?!1:(t=new tt(lt,t.ch,t.sticky),Q=dt(e,lt))}function be(lt){var ot;if(m=="codepoint"){var ut=Q.text.charCodeAt(t.ch+(m>0?0:-1));isNaN(ut)?ot=null:ot=new tt(t.line,Math.max(0,Math.min(Q.text.length,t.ch+_*(ut>=55296&&ut<56320?2:1))),-_)}else L?ot=Il(e.cm,Q,t,_):ot=Ua(Q,t,_);if(ot==null)if(!lt&&te())t=Ka(L,e.cm,Q,t.line,q);else return!1;else t=ot;return!0}if(m=="char"||m=="codepoint")be();else if(m=="column")be(!0);else if(m=="word"||m=="group")for(var we=null,Xe=m=="group",Be=e.cm&&e.cm.getHelper(t,"wordChars"),Qe=!0;!(_<0&&!be(!Qe));Qe=!1){var Ze=Q.text.charAt(t.ch)||`
|
|
|
`,nt=Ge(Ze,Be)?"w":Xe&&Ze==`
|
|
|
`?"n":!Xe||/\s/.test(Ze)?null:"p";if(Xe&&!Qe&&!nt&&(nt="s"),we&&we!=nt){_<0&&(_=1,be(),t.sticky="after");break}if(nt&&(we=nt),_>0&&!be(!Qe))break}var at=qi(e,t,N,V,!0);return zn(N,at)&&(at.hitSide=!0),at}function Ls(e,t,_,m){var L=e.doc,N=t.left,V;if(m=="page"){var Q=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),q=Math.max(Q-.5*kn(e.display),3);V=(_>0?t.bottom:t.top)+_*q}else m=="line"&&(V=_>0?t.bottom+3:t.top-3);for(var te;!(te=va(e,N,V),!te.outside);){if(_<0?V<=0:V>=L.height){te.hitSide=!0;break}V+=_*5}return te}var Mt=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new ae,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};Mt.prototype.init=function(e){var t=this,_=this,m=_.cm,L=_.div=e.lineDiv;Cs(L,m.options.spellcheck,m.options.autocorrect,m.options.autocapitalize);function N(Q){for(var q=Q.target;q;q=q.parentNode){if(q==L)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(q.className))break}return!1}Me(L,"paste",function(Q){if(!N(Q)||Oe(m,Q)||Ss(Q,m))return;y<=11&&setTimeout(Yt(m,function(){return t.updateFromDOM()}),20)}),Me(L,"compositionstart",function(Q){t.composing={data:Q.data,done:!1}}),Me(L,"compositionupdate",function(Q){t.composing||(t.composing={data:Q.data,done:!1})}),Me(L,"compositionend",function(Q){t.composing&&(Q.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),Me(L,"touchstart",function(){return _.forceCompositionEnd()}),Me(L,"input",function(){t.composing||t.readFromDOMSoon()});function V(Q){if(!N(Q)||Oe(m,Q))return;if(m.somethingSelected())ra({lineWise:!1,text:m.getSelections()}),Q.type=="cut"&&m.replaceSelection("",null,"cut");else if(m.options.lineWiseCopyCut){var q=Ts(m);ra({lineWise:!0,text:q.text}),Q.type=="cut"&&m.operation(function(){m.setSelections(q.ranges,0,Ne),m.replaceSelection("",null,"cut")})}else return;if(Q.clipboardData){Q.clipboardData.clearData();var te=Rr.text.join(`
|
|
|
`);if(Q.clipboardData.setData("Text",te),Q.clipboardData.getData("Text")==te){Q.preventDefault();return}}var be=As(),we=be.firstChild;m.display.lineSpace.insertBefore(be,m.display.lineSpace.firstChild),we.value=Rr.text.join(`
|
|
|
`);var Xe=document.activeElement;W(we),setTimeout(function(){m.display.lineSpace.removeChild(be),Xe.focus(),Xe==L&&_.showPrimarySelection()},50)}Me(L,"copy",V),Me(L,"cut",V)},Mt.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},Mt.prototype.prepareSelection=function(){var e=mo(this.cm,!1);return e.focus=document.activeElement==this.div,e},Mt.prototype.showSelection=function(e,t){if(!e||!this.cm.display.view.length)return;(e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e)},Mt.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},Mt.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,_=t.doc.sel.primary(),m=_.from(),L=_.to();if(t.display.viewTo==t.display.viewFrom||m.line>=t.display.viewTo||L.line<t.display.viewFrom){e.removeAllRanges();return}var N=na(t,e.anchorNode,e.anchorOffset),V=na(t,e.focusNode,e.focusOffset);if(N&&!N.bad&&V&&!V.bad&&vt(en(N,V),m)==0&&vt(bn(N,V),L)==0)return;var Q=t.display.view,q=m.line>=t.display.viewFrom&&ks(t,m)||{node:Q[0].measure.map[2],offset:0},te=L.line<t.display.viewTo&&ks(t,L);if(!te){var be=Q[Q.length-1].measure,we=be.maps?be.maps[be.maps.length-1]:be.map;te={node:we[we.length-1],offset:we[we.length-2]-we[we.length-3]}}if(!q||!te){e.removeAllRanges();return}var Xe=e.rangeCount&&e.getRangeAt(0),Be;try{Be=M(q.node,q.offset,te.offset,te.node)}catch(Qe){}Be&&(!D&&t.state.focused?(e.collapse(q.node,q.offset),Be.collapsed||(e.removeAllRanges(),e.addRange(Be))):(e.removeAllRanges(),e.addRange(Be)),Xe&&e.anchorNode==null?e.addRange(Xe):D&&this.startGracePeriod()),this.rememberSelection()},Mt.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)},Mt.prototype.showMultipleSelections=function(e){A(this.cm.display.cursorDiv,e.cursors),A(this.cm.display.selectionDiv,e.selection)},Mt.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},Mt.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return P(this.div,t)},Mt.prototype.focus=function(){this.cm.options.readOnly!="nocursor"&&((!this.selectionInEditor()||document.activeElement!=this.div)&&this.showSelection(this.prepareSelection(),!0),this.div.focus())},Mt.prototype.blur=function(){this.div.blur()},Mt.prototype.getField=function(){return this.div},Mt.prototype.supportsTouch=function(){return!0},Mt.prototype.receivedFocus=function(){var e=this;this.selectionInEditor()?this.pollSelection():mr(this.cm,function(){return e.cm.curOp.selectionChanged=!0});function t(){e.cm.state.focused&&(e.pollSelection(),e.polling.set(e.cm.options.pollInterval,t))}this.polling.set(this.cm.options.pollInterval,t)},Mt.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},Mt.prototype.pollSelection=function(){if(this.readDOMTimeout!=null||this.gracePeriod||!this.selectionChanged())return;var e=this.getSelection(),t=this.cm;if(o&&a&&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 _=na(t,e.anchorNode,e.anchorOffset),m=na(t,e.focusNode,e.focusOffset);_&&m&&mr(t,function(){tr(t.doc,Yr(_,m),Ne),(_.bad||m.bad)&&(t.curOp.selectionChanged=!0)})},Mt.prototype.pollContent=function(){this.readDOMTimeout!=null&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e=this.cm,t=e.display,_=e.doc.sel.primary(),m=_.from(),L=_.to();if(m.ch==0&&m.line>e.firstLine()&&(m=tt(m.line-1,dt(e.doc,m.line-1).length)),L.ch==dt(e.doc,L.line).text.length&&L.line<e.lastLine()&&(L=tt(L.line+1,0)),m.line<t.viewFrom||L.line>t.viewTo-1)return!1;var N,V,Q;m.line==t.viewFrom||(N=cn(e,m.line))==0?(V=kt(t.view[0].line),Q=t.view[0].node):(V=kt(t.view[N].line),Q=t.view[N-1].node.nextSibling);var q=cn(e,L.line),te,be;if(q==t.view.length-1?(te=t.viewTo-1,be=t.lineDiv.lastChild):(te=kt(t.view[q+1].line)-1,be=t.view[q+1].node.previousSibling),!Q)return!1;for(var we=e.doc.splitLines(tu(e,Q,be,V,te)),Xe=Pr(e.doc,tt(V,0),tt(te,dt(e.doc,te).text.length));we.length>1&&Xe.length>1;)if(ee(we)==ee(Xe))we.pop(),Xe.pop(),te--;else if(we[0]==Xe[0])we.shift(),Xe.shift(),V++;else break;for(var Be=0,Qe=0,Ze=we[0],nt=Xe[0],at=Math.min(Ze.length,nt.length);Be<at&&Ze.charCodeAt(Be)==nt.charCodeAt(Be);)++Be;for(var lt=ee(we),ot=ee(Xe),ut=Math.min(lt.length-(we.length==1?Be:0),ot.length-(Xe.length==1?Be:0));Qe<ut&<.charCodeAt(lt.length-Qe-1)==ot.charCodeAt(ot.length-Qe-1);)++Qe;if(we.length==1&&Xe.length==1&&V==m.line)for(;Be&&Be>m.ch&<.charCodeAt(lt.length-Qe-1)==ot.charCodeAt(ot.length-Qe-1);)Be--,Qe++;we[we.length-1]=lt.slice(0,lt.length-Qe).replace(/^\u200b+/,""),we[0]=we[0].slice(Be).replace(/\u200b+$/,"");var gt=tt(V,Be),ft=tt(te,Xe.length?ee(Xe).length-Qe:0);if(we.length>1||we[0]||vt(gt,ft))return Nn(e.doc,we,gt,ft,"+input"),!0},Mt.prototype.ensurePolled=function(){this.forceCompositionEnd()},Mt.prototype.reset=function(){this.forceCompositionEnd()},Mt.prototype.forceCompositionEnd=function(){if(!this.composing)return;clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus()},Mt.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)},Mt.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&mr(this.cm,function(){return cr(e.cm)})},Mt.prototype.setUneditable=function(e){e.contentEditable="false"},Mt.prototype.onKeyPress=function(e){if(e.charCode==0||this.composing)return;e.preventDefault(),this.cm.isReadOnly()||Yt(this.cm,Wa)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0)},Mt.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!="nocursor")},Mt.prototype.onContextMenu=function(){},Mt.prototype.resetPosition=function(){},Mt.prototype.needsContentAttribute=!0;function ks(e,t){var _=fa(e,t.line);if(!_||_.hidden)return null;var m=dt(e.doc,t.line),L=eo(_,m,t.line),N=We(m,e.doc.direction),V="left";if(N){var Q=J(N,t.ch);V=Q%2?"right":"left"}var q=no(L.map,t.ch,V);return q.offset=q.collapse=="right"?q.end:q.start,q}function eu(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function Hn(e,t){return t&&(e.bad=!0),e}function tu(e,t,_,m,L){var N="",V=!1,Q=e.doc.lineSeparator(),q=!1;function te(Be){return function(Qe){return Qe.id==Be}}function be(){V&&(N+=Q,q&&(N+=Q),V=q=!1)}function we(Be){Be&&(be(),N+=Be)}function Xe(Be){if(Be.nodeType==1){var Qe=Be.getAttribute("cm-text");if(Qe){we(Qe);return}var Ze=Be.getAttribute("cm-marker"),nt;if(Ze){var at=e.findMarks(tt(m,0),tt(L+1,0),te(+Ze));at.length&&(nt=at[0].find(0))&&we(Pr(e.doc,nt.from,nt.to).join(Q));return}if(Be.getAttribute("contenteditable")=="false")return;var lt=/^(pre|div|p|li|table|br)$/i.test(Be.nodeName);if(!/^br$/i.test(Be.nodeName)&&Be.textContent.length==0)return;lt&&be();for(var ot=0;ot<Be.childNodes.length;ot++)Xe(Be.childNodes[ot]);/^(pre|p)$/i.test(Be.nodeName)&&(q=!0),lt&&(V=!0)}else Be.nodeType==3&&we(Be.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;!(Xe(t),t==_);)t=t.nextSibling,q=!1;return N}function na(e,t,_){var m;if(t==e.display.lineDiv){if(m=e.display.lineDiv.childNodes[_],!m)return Hn(e.clipPos(tt(e.display.viewTo-1)),!0);t=null,_=0}else for(m=t;;m=m.parentNode){if(!m||m==e.display.lineDiv)return null;if(m.parentNode&&m.parentNode==e.display.lineDiv)break}for(var L=0;L<e.display.view.length;L++){var N=e.display.view[L];if(N.node==m)return ru(N,t,_)}}function ru(e,t,_){var m=e.text.firstChild,L=!1;if(!t||!P(m,t))return Hn(tt(kt(e.line),0),!0);if(t==m&&(L=!0,t=m.childNodes[_],_=0,!t)){var N=e.rest?ee(e.rest):e.line;return Hn(tt(kt(N),N.text.length),L)}var V=t.nodeType==3?t:null,Q=t;for(!V&&t.childNodes.length==1&&t.firstChild.nodeType==3&&(V=t.firstChild,_&&(_=V.nodeValue.length));Q.parentNode!=m;)Q=Q.parentNode;var q=e.measure,te=q.maps;function be(nt,at,lt){for(var ot=-1;ot<(te?te.length:0);ot++)for(var ut=ot<0?q.map:te[ot],gt=0;gt<ut.length;gt+=3){var ft=ut[gt+2];if(ft==nt||ft==at){var xt=kt(ot<0?e.line:e.rest[ot]),Nt=ut[gt]+lt;return(lt<0||ft!=nt)&&(Nt=ut[gt+(lt?1:0)]),tt(xt,Nt)}}}var we=be(V,Q,_);if(we)return Hn(we,L);for(var Xe=Q.nextSibling,Be=V?V.nodeValue.length-_:0;Xe;Xe=Xe.nextSibling){if(we=be(Xe,Xe.firstChild,0),we)return Hn(tt(we.line,we.ch-Be),L);Be+=Xe.textContent.length}for(var Qe=Q.previousSibling,Ze=_;Qe;Qe=Qe.previousSibling){if(we=be(Qe,Qe.firstChild,-1),we)return Hn(tt(we.line,we.ch+Ze),L);Ze+=Qe.textContent.length}}var jt=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new ae,this.hasSelection=!1,this.composing=null};jt.prototype.init=function(e){var t=this,_=this,m=this.cm;this.createField(e);var L=this.textarea;e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),n&&(L.style.width="0px"),Me(L,"input",function(){E&&y>=9&&t.hasSelection&&(t.hasSelection=null),_.poll()}),Me(L,"paste",function(V){if(Oe(m,V)||Ss(V,m))return;m.state.pasteIncoming=+new Date,_.fastPoll()});function N(V){if(Oe(m,V))return;if(m.somethingSelected())ra({lineWise:!1,text:m.getSelections()});else if(m.options.lineWiseCopyCut){var Q=Ts(m);ra({lineWise:!0,text:Q.text}),V.type=="cut"?m.setSelections(Q.ranges,null,Ne):(_.prevInput="",L.value=Q.text.join(`
|
|
|
`),W(L))}else return;V.type=="cut"&&(m.state.cutIncoming=+new Date)}Me(L,"cut",N),Me(L,"copy",N),Me(e.scroller,"paste",function(V){if(Xr(e,V)||Oe(m,V))return;if(!L.dispatchEvent){m.state.pasteIncoming=+new Date,_.focus();return}var Q=new Event("paste");Q.clipboardData=V.clipboardData,L.dispatchEvent(Q)}),Me(e.lineSpace,"selectstart",function(V){Xr(e,V)||Y(V)}),Me(L,"compositionstart",function(){var V=m.getCursor("from");_.composing&&_.composing.range.clear(),_.composing={start:V,range:m.markText(V,m.getCursor("to"),{className:"CodeMirror-composing"})}}),Me(L,"compositionend",function(){_.composing&&(_.poll(),_.composing.range.clear(),_.composing=null)})},jt.prototype.createField=function(e){this.wrapper=As(),this.textarea=this.wrapper.firstChild},jt.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},jt.prototype.prepareSelection=function(){var e=this.cm,t=e.display,_=e.doc,m=mo(e);if(e.options.moveInputWithCursor){var L=Lr(e,_.sel.primary().head,"div"),N=t.wrapper.getBoundingClientRect(),V=t.lineDiv.getBoundingClientRect();m.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,L.top+V.top-N.top)),m.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,L.left+V.left-N.left))}return m},jt.prototype.showSelection=function(e){var t=this.cm,_=t.display;A(_.cursorDiv,e.cursors),A(_.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},jt.prototype.reset=function(e){if(this.contextMenuPending||this.composing)return;var t=this.cm;if(t.somethingSelected()){this.prevInput="";var _=t.getSelection();this.textarea.value=_,t.state.focused&&W(this.textarea),E&&y>=9&&(this.hasSelection=_)}else e||(this.prevInput=this.textarea.value="",E&&y>=9&&(this.hasSelection=null))},jt.prototype.getField=function(){return this.textarea},jt.prototype.supportsTouch=function(){return!1},jt.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!i||B()!=this.textarea))try{this.textarea.focus()}catch(e){}},jt.prototype.blur=function(){this.textarea.blur()},jt.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},jt.prototype.receivedFocus=function(){this.slowPoll()},jt.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()})},jt.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0;function _(){var m=t.poll();!m&&!e?(e=!0,t.polling.set(60,_)):(t.pollingFast=!1,t.slowPoll())}t.polling.set(20,_)},jt.prototype.poll=function(){var e=this,t=this.cm,_=this.textarea,m=this.prevInput;if(this.contextMenuPending||!t.state.focused||Ye(_)&&!m&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var L=_.value;if(L==m&&!t.somethingSelected())return!1;if(E&&y>=9&&this.hasSelection===L||f&&/[\uf700-\uf7ff]/.test(L))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var N=L.charCodeAt(0);if(N==8203&&!m&&(m="\u200B"),N==8666)return this.reset(),this.cm.execCommand("undo")}for(var V=0,Q=Math.min(m.length,L.length);V<Q&&m.charCodeAt(V)==L.charCodeAt(V);)++V;return mr(t,function(){Wa(t,L.slice(V),m.length-V,null,e.composing?"*compose":null),L.length>1e3||L.indexOf(`
|
|
|
`)>-1?_.value=e.prevInput="":e.prevInput=L,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},jt.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},jt.prototype.onKeyPress=function(){E&&y>=9&&(this.hasSelection=null),this.fastPoll()},jt.prototype.onContextMenu=function(e){var t=this,_=t.cm,m=_.display,L=t.textarea;t.contextMenuPending&&t.contextMenuPending();var N=un(_,e),V=m.scroller.scrollTop;if(!N||c)return;var Q=_.options.resetSelectionOnContextMenu;Q&&_.doc.sel.contains(N)==-1&&Yt(_,tr)(_.doc,Yr(N),Ne);var q=L.style.cssText,te=t.wrapper.style.cssText,be=t.wrapper.offsetParent.getBoundingClientRect();t.wrapper.style.cssText="position: static",L.style.cssText=`position: absolute; width: 30px; height: 30px;
|
|
|
top: `+(e.clientY-be.top-5)+"px; left: "+(e.clientX-be.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 we;v&&(we=window.scrollY),m.input.focus(),v&&window.scrollTo(null,we),m.input.reset(),_.somethingSelected()||(L.value=t.prevInput=" "),t.contextMenuPending=Be,m.selForContextMenu=_.doc.sel,clearTimeout(m.detectingSelectAll);function Xe(){if(L.selectionStart!=null){var Ze=_.somethingSelected(),nt="\u200B"+(Ze?L.value:"");L.value="\u21DA",L.value=nt,t.prevInput=Ze?"":"\u200B",L.selectionStart=1,L.selectionEnd=nt.length,m.selForContextMenu=_.doc.sel}}function Be(){if(t.contextMenuPending!=Be)return;if(t.contextMenuPending=!1,t.wrapper.style.cssText=te,L.style.cssText=q,E&&y<9&&m.scrollbars.setScrollTop(m.scroller.scrollTop=V),L.selectionStart!=null){(!E||E&&y<9)&&Xe();var Ze=0,nt=function(){m.selForContextMenu==_.doc.sel&&L.selectionStart==0&&L.selectionEnd>0&&t.prevInput=="\u200B"?Yt(_,Vo)(_):Ze++<10?m.detectingSelectAll=setTimeout(nt,500):(m.selForContextMenu=null,m.input.reset())};m.detectingSelectAll=setTimeout(nt,200)}}if(E&&y>=9&&Xe(),C){oe(e);var Qe=function(){ne(window,"mouseup",Qe),setTimeout(Be,20)};Me(window,"mouseup",Qe)}else setTimeout(Be,50)},jt.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},jt.prototype.setUneditable=function(){},jt.prototype.needsContentAttribute=!1;function nu(e,t){if(t=t?K(t):{},t.value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),t.autofocus==null){var _=B();t.autofocus=_==e||e.getAttribute("autofocus")!=null&&_==document.body}function m(){e.value=Q.getValue()}var L;if(e.form&&(Me(e.form,"submit",m),!t.leaveSubmitMethodAlone)){var N=e.form;L=N.submit;try{var V=N.submit=function(){m(),N.submit=L,N.submit(),N.submit=V}}catch(q){}}t.finishInit=function(q){q.save=m,q.getTextArea=function(){return e},q.toTextArea=function(){q.toTextArea=isNaN,m(),e.parentNode.removeChild(q.getWrapperElement()),e.style.display="",e.form&&(ne(e.form,"submit",m),!t.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=L))}},e.style.display="none";var Q=Ut(function(q){return e.parentNode.insertBefore(q,e.nextSibling)},t);return Q}function iu(e){e.off=ne,e.on=Me,e.wheelEventPixels=dl,e.Doc=dr,e.splitLines=$e,e.countColumn=G,e.findColumn=De,e.isWordChar=ze,e.Pass=Ue,e.signal=Ee,e.Line=on,e.changeEnd=Qr,e.scrollbarModel=So,e.Pos=tt,e.cmpPos=vt,e.modes=ct,e.mimeModes=it,e.resolveMode=St,e.getMode=Kt,e.modeExtensions=Bt,e.extendMode=Pt,e.copyState=Ot,e.startState=or,e.innerMode=It,e.commands=Ei,e.keyMap=Hr,e.keyName=us,e.isModifierKey=ss,e.lookupKey=Kn,e.normalizeKeyMap=Ml,e.StringStream=Lt,e.SharedTextMarker=yi,e.TextMarker=Zr,e.LineWidget=_i,e.e_preventDefault=Y,e.e_stopPropagation=$,e.e_stop=oe,e.addClass=H,e.contains=P,e.rmClass=b,e.keyNames=$r}Ql(Ut),Jl(Ut);var au="iter insert remove copy getEditor constructor".split(" ");for(var ia in dr.prototype)dr.prototype.hasOwnProperty(ia)&&fe(au,ia)<0&&(Ut.prototype[ia]=function(e){return function(){return e.apply(this.doc,arguments)}}(dr.prototype[ia]));return he(dr),Ut.inputStyles={textarea:jt,contenteditable:Mt},Ut.defineMode=function(e){!Ut.defaults.mode&&e!="null"&&(Ut.defaults.mode=e),yt.apply(this,arguments)},Ut.defineMIME=Et,Ut.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),Ut.defineMIME("text/plain","null"),Ut.defineExtension=function(e,t){Ut.prototype[e]=t},Ut.defineDocExtension=function(e,t){dr.prototype[e]=t},Ut.fromTextArea=nu,iu(Ut),Ut.version="5.58.2",Ut})},Y1PL:function(Je,le,re){"use strict";re.r(le),re.d(le,"ResizableTextArea",function(){return fe});var j=re("wx14"),k=re("1OyB"),D=re("vuIU"),R=re("Ji7U"),O=re("LK+K"),d=re("cDcd"),E=re("VTBJ"),y=re("rePB"),v=re("Zm9Q"),u=re("Kwbf"),a=re("c+Xe"),c=re("m+aA"),s=re("bdgK"),l=new Map;function r(Ne){Ne.forEach(function(xe){var Ce,De=xe.target;(Ce=l.get(De))===null||Ce===void 0||Ce.forEach(function(ve){return ve(De)})})}var n=new s.default(r),o=null,i=null;function f(Ne,xe){l.has(Ne)||(l.set(Ne,new Set),n.observe(Ne)),l.get(Ne).add(xe)}function h(Ne,xe){l.has(Ne)&&(l.get(Ne).delete(xe),l.get(Ne).size||(n.unobserve(Ne),l.delete(Ne)))}var T=function(Ne){Object(R.a)(Ce,Ne);var xe=Object(O.a)(Ce);function Ce(){return Object(k.a)(this,Ce),xe.apply(this,arguments)}return Object(D.a)(Ce,[{key:"render",value:function(){return this.props.children}}]),Ce}(d.Component),g=d.createContext(null);function w(Ne){var xe=Ne.children,Ce=Ne.onBatchResize,De=d.useRef(0),ve=d.useRef([]),Re=d.useContext(g),ee=d.useCallback(function(ge,se,Fe){De.current+=1;var je=De.current;ve.current.push({size:ge,element:se,data:Fe}),Promise.resolve().then(function(){je===De.current&&(Ce==null||Ce(ve.current),ve.current=[])}),Re==null||Re(ge,se,Fe)},[Ce,Re]);return d.createElement(g.Provider,{value:ee},xe)}function C(Ne){var xe=Ne.children,Ce=Ne.disabled,De=d.useRef(null),ve=d.useRef(null),Re=d.useContext(g),ee=d.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),ge=d.isValidElement(xe)&&Object(a.c)(xe),se=ge?xe.ref:null,Fe=d.useMemo(function(){return Object(a.a)(se,De)},[se,De]),je=d.useRef(Ne);je.current=Ne;var Ke=d.useCallback(function(ze){var Ge=je.current,He=Ge.onResize,Ie=Ge.data,ke=ze.getBoundingClientRect(),Ae=ke.width,Te=ke.height,Z=ze.offsetWidth,ce=ze.offsetHeight,J=Math.floor(Ae),Le=Math.floor(Te);if(ee.current.width!==J||ee.current.height!==Le||ee.current.offsetWidth!==Z||ee.current.offsetHeight!==ce){var We={width:J,height:Le,offsetWidth:Z,offsetHeight:ce};ee.current=We;var Ve=Z===Math.round(Ae)?Ae:Z,Me=ce===Math.round(Te)?Te:ce,et=Object(E.a)(Object(E.a)({},We),{},{offsetWidth:Ve,offsetHeight:Me});Re==null||Re(et,ze,Ie),He&&Promise.resolve().then(function(){He(et,ze)})}},[]);return d.useEffect(function(){var ze=Object(c.a)(De.current)||Object(c.a)(ve.current);return ze&&!Ce&&f(ze,Ke),function(){return h(ze,Ke)}},[De.current,Ce]),d.createElement(T,{ref:ve},ge?d.cloneElement(xe,{ref:Fe}):xe)}var x="rc-observer-key";function b(Ne){var xe=Ne.children,Ce=Object(v.a)(xe);return Ce.map(function(De,ve){var Re=(De==null?void 0:De.key)||"".concat(x,"-").concat(ve);return d.createElement(C,Object(j.a)({},Ne,{key:Re}),De)})}b.Collection=w;var S=b,A=re("bT9E"),p=re("TSYQ"),I=re.n(p),M=`
|
|
|
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
|
|
|
`,P=["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"],B={},H;function F(Ne){var xe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Ce=Ne.getAttribute("id")||Ne.getAttribute("data-reactid")||Ne.getAttribute("name");if(xe&&B[Ce])return B[Ce];var De=window.getComputedStyle(Ne),ve=De.getPropertyValue("box-sizing")||De.getPropertyValue("-moz-box-sizing")||De.getPropertyValue("-webkit-box-sizing"),Re=parseFloat(De.getPropertyValue("padding-bottom"))+parseFloat(De.getPropertyValue("padding-top")),ee=parseFloat(De.getPropertyValue("border-bottom-width"))+parseFloat(De.getPropertyValue("border-top-width")),ge=P.map(function(Fe){return"".concat(Fe,":").concat(De.getPropertyValue(Fe))}).join(";"),se={sizingStyle:ge,paddingSize:Re,borderSize:ee,boxSizing:ve};return xe&&Ce&&(B[Ce]=se),se}function W(Ne){var xe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Ce=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,De=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;H||(H=document.createElement("textarea"),H.setAttribute("tab-index","-1"),H.setAttribute("aria-hidden","true"),document.body.appendChild(H)),Ne.getAttribute("wrap")?H.setAttribute("wrap",Ne.getAttribute("wrap")):H.removeAttribute("wrap");var ve=F(Ne,xe),Re=ve.paddingSize,ee=ve.borderSize,ge=ve.boxSizing,se=ve.sizingStyle;H.setAttribute("style","".concat(se,";").concat(M)),H.value=Ne.value||Ne.placeholder||"";var Fe=Number.MIN_SAFE_INTEGER,je=Number.MAX_SAFE_INTEGER,Ke=H.scrollHeight,ze;if(ge==="border-box"?Ke+=ee:ge==="content-box"&&(Ke-=Re),Ce!==null||De!==null){H.value=" ";var Ge=H.scrollHeight-Re;Ce!==null&&(Fe=Ge*Ce,ge==="border-box"&&(Fe=Fe+Re+ee),Ke=Math.max(Fe,Ke)),De!==null&&(je=Ge*De,ge==="border-box"&&(je=je+Re+ee),ze=Ke>je?"":"hidden",Ke=Math.min(je,Ke))}return{height:Ke,minHeight:Fe,maxHeight:je,overflowY:ze,resize:"none"}}var U=re("Gytx"),K=re.n(U),G;(function(Ne){Ne[Ne.NONE=0]="NONE",Ne[Ne.RESIZING=1]="RESIZING",Ne[Ne.RESIZED=2]="RESIZED"})(G||(G={}));var ae=function(Ne){Object(R.a)(Ce,Ne);var xe=Object(O.a)(Ce);function Ce(De){var ve;return Object(k.a)(this,Ce),ve=xe.call(this,De),ve.nextFrameActionId=void 0,ve.resizeFrameId=void 0,ve.textArea=void 0,ve.saveTextArea=function(Re){ve.textArea=Re},ve.handleResize=function(Re){var ee=ve.state.resizeStatus,ge=ve.props,se=ge.autoSize,Fe=ge.onResize;if(ee!==G.NONE)return;typeof Fe=="function"&&Fe(Re),se&&ve.resizeOnNextFrame()},ve.resizeOnNextFrame=function(){cancelAnimationFrame(ve.nextFrameActionId),ve.nextFrameActionId=requestAnimationFrame(ve.resizeTextarea)},ve.resizeTextarea=function(){var Re=ve.props.autoSize;if(!Re||!ve.textArea)return;var ee=Re.minRows,ge=Re.maxRows,se=W(ve.textArea,!1,ee,ge);ve.setState({textareaStyles:se,resizeStatus:G.RESIZING},function(){cancelAnimationFrame(ve.resizeFrameId),ve.resizeFrameId=requestAnimationFrame(function(){ve.setState({resizeStatus:G.RESIZED},function(){ve.resizeFrameId=requestAnimationFrame(function(){ve.setState({resizeStatus:G.NONE}),ve.fixFirefoxAutoScroll()})})})})},ve.renderTextArea=function(){var Re=ve.props,ee=Re.prefixCls,ge=ee===void 0?"rc-textarea":ee,se=Re.autoSize,Fe=Re.onResize,je=Re.className,Ke=Re.disabled,ze=ve.state,Ge=ze.textareaStyles,He=ze.resizeStatus,Ie=Object(A.a)(ve.props,["prefixCls","onPressEnter","autoSize","defaultValue","onResize"]),ke=I()(ge,je,Object(y.a)({},"".concat(ge,"-disabled"),Ke));"value"in Ie&&(Ie.value=Ie.value||"");var Ae=Object(E.a)(Object(E.a)(Object(E.a)({},ve.props.style),Ge),He===G.RESIZING?{overflowX:"hidden",overflowY:"hidden"}:null);return d.createElement(S,{onResize:ve.handleResize,disabled:!(se||Fe)},d.createElement("textarea",Object(j.a)({},Ie,{className:ke,style:Ae,ref:ve.saveTextArea})))},ve.state={textareaStyles:{},resizeStatus:G.NONE},ve}return Object(D.a)(Ce,[{key:"componentDidUpdate",value:function(ve){(ve.value!==this.props.value||!K()(ve.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 ve=this.textArea.selectionStart,Re=this.textArea.selectionEnd;this.textArea.setSelectionRange(ve,Re)}}catch(ee){}}},{key:"render",value:function(){return this.renderTextArea()}}]),Ce}(d.Component),fe=ae,Se=function(Ne){Object(R.a)(Ce,Ne);var xe=Object(O.a)(Ce);function Ce(De){var ve;Object(k.a)(this,Ce),ve=xe.call(this,De),ve.resizableTextArea=void 0,ve.focus=function(){ve.resizableTextArea.textArea.focus()},ve.saveTextArea=function(ee){ve.resizableTextArea=ee},ve.handleChange=function(ee){var ge=ve.props.onChange;ve.setValue(ee.target.value,function(){ve.resizableTextArea.resizeTextarea()}),ge&&ge(ee)},ve.handleKeyDown=function(ee){var ge=ve.props,se=ge.onPressEnter,Fe=ge.onKeyDown;ee.keyCode===13&&se&&se(ee),Fe&&Fe(ee)};var Re=typeof De.value=="undefined"||De.value===null?De.defaultValue:De.value;return ve.state={value:Re},ve}return Object(D.a)(Ce,[{key:"setValue",value:function(ve,Re){"value"in this.props||this.setState({value:ve},Re)}},{key:"blur",value:function(){this.resizableTextArea.textArea.blur()}},{key:"render",value:function(){return d.createElement(fe,Object(j.a)({},this.props,{value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,ref:this.saveTextArea}))}}],[{key:"getDerivedStateFromProps",value:function(ve){return"value"in ve?{value:ve.value}:null}}]),Ce}(d.Component),Ue=le.default=Se},YJ9k:function(Je,le,re){"use strict";Object.defineProperty(le,"__esModule",{value:!0}),le.default=void 0;function j(O,d){if(!(O instanceof d))throw new TypeError("Cannot call a class as a function")}function k(O,d){for(var E=0;E<d.length;E++){var y=d[E];y.enumerable=y.enumerable||!1,y.configurable=!0,"value"in y&&(y.writable=!0),Object.defineProperty(O,y.key,y)}}function D(O,d,E){return d&&k(O.prototype,d),E&&k(O,E),O}var R=function(){function O(){j(this,O),this._listeners=new Map}return D(O,[{key:"addEventListener",value:function(E,y){this._listeners.has(E)||this._listeners.set(E,new Set),this._listeners.get(E).add(y)}},{key:"removeEventListener",value:function(E,y){this._listeners.has(E)&&this._listeners.get(E).delete(y)}},{key:"dispatchEvent",value:function(E){var y=this;return this._listeners.has(E.type)?(this._listeners.get(E.type).forEach(function(v){return v.call(y,E)}),!E.defaultPrevented):!0}}]),O}();le.default=R},ZW9T:function(Je,le,re){"use strict";re.d(le,"a",function(){return g});var j=re("k1fw"),k=re("miYZ"),D=re("tsqr"),R=re("rAM+"),O=re("tJVT"),d=re("PpiC"),E=re("cDcd"),y=re.n(E),v=re("bdgK");function u(w,C,x,b,S){var A=C.getWordUntilPosition(x),p={startLineNumber:x.lineNumber,endLineNumber:x.lineNumber,startColumn:A.startColumn,endColumn:A.endColumn},I=b.map(function(M){return{label:M,kind:w.languages.CompletionItemKind.Keyword,insertText:M,insertTextRules:w.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:p}});return S.map(function(M){I.push(Object(j.a)(Object(j.a)({},M),{},{range:p}))}),I}var a=function(w){var C={label:"ifelse",kind:w.languages.CompletionItemKind.Method,insertText:["if (${1:condition}) {"," $0","} else {"," ","}"].join(`
|
|
|
`),insertTextRules:w.languages.CompletionItemInsertTextRule.InsertAsSnippet},x=["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","inline","restrict","_Bool","_Complex","_Imaginary","_Alignas","_Alignof","_Atomic","_Static_assert","_Noreturn","_Thread_local","_Generic"];w.languages.registerCompletionItemProvider("cpp",{provideCompletionItems:function(p,I){var M=u(w,p,I,x,[C]);return{suggestions:M}}});var b=["False","None","True","and","as","assert","break","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","nonlocal","not","or","pass","raise","return","try","while","with","yield"];w.languages.registerCompletionItemProvider("python",{provideCompletionItems:function(p,I){var M=[{label:"print",kind:w.languages.CompletionItemKind.Snippet,insertText:["print($0)"].join(`
|
|
|
`),insertTextRules:w.languages.CompletionItemInsertTextRule.InsertAsSnippet}],P=u(w,p,I,b,M);return{suggestions:P}}});var S=["abstract","assert","boolean","break","byte","case","catch","char","class","const","continue","default","do","double","else","enum","extends","final","finally","float","for","goto","if","implements","import","instance of","int","interface","long","native","new","package","private","protected","public","return","strictfp","short","static","super","switch","synchronized","this","throw","throws","transient","try","void","volatile","while"];w.languages.registerCompletionItemProvider("java",{provideCompletionItems:function(p,I){var M=[C,{label:"main",kind:w.languages.CompletionItemKind.Snippet,insertText:["public static void main(String[] args) {"," $0","}"].join(`
|
|
|
`),insertTextRules:w.languages.CompletionItemInsertTextRule.InsertAsSnippet},{label:"System.out.print",kind:w.languages.CompletionItemKind.Snippet,insertText:["System.out.print($0)"].join(`
|
|
|
`),insertTextRules:w.languages.CompletionItemInsertTextRule.InsertAsSnippet}],P=u(w,p,I,S,M);return{suggestions:P}}})},c="\u8BE5\u4EFB\u52A1\u5173\u5361\u8BBE\u7F6E\u4E86\u7981\u6B62\u590D\u5236\u7C98\u8D34\uFF0C\u8BF7\u624B\u52A8\u8F93\u5165\u4EE3\u7801\u3002",s=re("LvDl"),l=re("+ua5");function r(w){return/^\d+$/.test(w)?"".concat(w,"px"):w}function n(){}var o=!1,i={"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 f(){var w=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],C=w;if(Array.isArray(w)){for(var x=0;x<w.length;x++){var b=i[w[x]];if(b)return b}return C[0]}return i[C]||C}var h=null,T=le.b=function(w){var C=w.width,x=C===void 0?"100%":C,b=w.height,S=b===void 0?"100%":b,A=w.value,p=w.language,I=p===void 0?"javascript":p,M=w.style,P=M===void 0?{}:M,B=w.options,H=B===void 0?{}:B,F=w.overrideServices,W=F===void 0?{}:F,U=w.theme,K=U===void 0?"vs-dark":U,G=w.onEditBlur,ae=w.onSave,fe=w.autoHeight,Se=fe===void 0?!1:fe,Ue=w.forbidCopy,Ne=Ue===void 0?!1:Ue,xe=w.onChange,Ce=xe===void 0?n:xe,De=w.editorDidMount,ve=De===void 0?n:De,Re=w.onFocus,ee=Re===void 0?n:Re,ge=w.filename,se=ge===void 0?"educoder.txt":ge,Fe=w.errorLine,je=w.errorContent,Ke=je===void 0?"":je,ze=Object(d.a)(w,["width","height","value","language","style","options","overrideServices","theme","onEditBlur","onSave","autoHeight","forbidCopy","onChange","editorDidMount","onFocus","filename","errorLine","errorContent"]),Ge=Object(E.useRef)(),He=Object(E.useRef)({}),Ie=Object(E.useRef)(),ke=Object(E.useRef)(!1),Ae=Object(E.useRef)(),Te=Object(E.useState)(!1),Z=Object(O.a)(Te,2),ce=Z[0],J=Z[1];function Le(){var de;return Ge.current&&(de=new v.default(function(ye){var ie=Object(R.a)(ye),pe;try{for(ie.s();!(pe=ie.n()).done;){var Pe=pe.value;(Pe.target.offsetHeight>0||Pe.target.offsetWidth>0)&&He.current.instance.layout()}}catch($e){ie.e($e)}finally{ie.f()}}),de.observe(Ge.current)),de}function We(){D.b.warn(decodeURIComponent(c))}var Ve=function(){var ye=He.current.instance;if(A!=null&&ye&&ce){var ie=ye.getModel();ie&&A!==ie.getValue()&&(o=!0,ie.setValue(A),ye.layout(),o=!1)}};Object(E.useEffect)(function(){Ie.current&&clearTimeout(Ie.current),Ie.current=setTimeout(function(){Ve()},500)},[A,ce,He.current]),Object(E.useEffect)(function(){if(Fe&&He.current&&He.current.instance){var de=He.current.instance;de.changeViewZones(function(ie){var pe=document.createElement("div");pe.style.padding="10px 20px",pe.style.width="calc(100% - 20px)",pe.className="my-error-line-wrp",pe.innerHTML=Ke,ie.addZone({afterLineNumber:Fe||11,heightInLines:3,domNode:pe})});var ye={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}};de.addOverlayWidget(ye),de.revealPositionInCenter({lineNumber:20,column:1})}},[Fe,He.current,ce]);function Me(){var de=He.current.instance;if(de){var ye=de.getSelection(),ie=He.current.pastePos||{},pe=new h.Range(ie.startLineNumber||ye.endLineNumber,ie.startColumn||ye.endColumn,ie.endLineNumber||ye.endLineNumber,ie.endColumn||ye.endColumn);setTimeout(function(){de.executeEdits("",[{range:pe,text:""}])},300)}}function et(de){(window.navigator.platform.match("Mac")?de.metaKey:de.ctrlKey)&&de.keyCode==83&&(de.preventDefault(),ae())}var ne=function(){if(Se&&He.current.instance){var ye=He.current.instance.getContentHeight();_e(ye<S?S:ye)}else _e(S)};function Ee(de){var ye=document.createEvent("MouseEvents");ye.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),de.dispatchEvent(ye)}function Oe(de,ye){var ie=window.URL||window.webkitURL||window,pe=new Blob([ye]),Pe=document.createElementNS("http://www.w3.org/1999/xhtml","a");Pe.href=ie.createObjectURL(pe),Pe.download=de,Ee(Pe)}Object(E.useEffect)(function(){ne()},[ne]),Object(E.useEffect)(function(){Ge.current&&!ce&&re.e(27).then(re.t.bind(null,"M/lh",7)).then(function(de){try{h=de,He.current.instance=h.editor.create(Ge.current,{value:A,language:f(I),theme:K,requireConfig:{"vs/nls":{availableLanguages:{"*":"zh-cn"}}},wordWrap:!0},W);var ye=He.current.instance;if(ve(ye,h),setTimeout(function(){ne(),He.current.instance.addAction({id:"d123123",label:"Download File",contextMenuGroupId:"9_cutcopypaste",run:function(){Oe(se||"educoder.txt",ye.getValue())}})},500),He.current.subscription=ye.onDidChangeModelContent(function(pe){ke.current?clearTimeout(Ae.current):(ne(),Ce(ye.getValue(),pe)),Ae.current=setTimeout(function(){ke.current=!1},500)}),window.Monaco||a(h),Ne&&(ye.addCommand(h.KeyMod.CtrlCmd|h.KeyMod.Shift|h.KeyCode.KEY_V,function(){return We(),null}),ye.addCommand(h.KeyMod.CtrlCmd|h.KeyCode.KEY_C,function(){return We(),null})),window.Monaco=h,G&&ye.onDidBlurEditorWidget(function(){G(ye.getValue())}),ee&&ye.onDidFocusEditorText(function(){ee(ye.getValue())}),Ne){ye.addCommand(h.KeyMod.CtrlCmd|h.KeyCode.KEY_V,function(){return We(),null}),ye.onDidPaste(function(pe){He.current.pastePos=pe});try{window.addEventListener("paste",Me)}catch(pe){}}var ie=Le();return J(!0),function(){var pe=He.current.instance;pe.dispose();var Pe=pe.getModel();Pe&&Pe.dispose(),He.current.subscription&&He.current.subscription.dispose(),Ne&&window.removeEventListener("paste",Me),ie.unobserve(Ge.current)}}catch(pe){}})},[]),Object(E.useEffect)(function(){var de=He.current.instance;if(de&&ce)return document.addEventListener("keydown",et,!1),function(){document.removeEventListener("keydown",et)}},[ae,ce]),Object(E.useEffect)(function(){var de=He.current.instance;if(de&&ce){var ye=f(I);h.editor.setModelLanguage(de.getModel(),ye),console.log("language:",I,de.getModel(),ye)}},[I,ce]),Object(E.useEffect)(function(){var de=He.current.instance;de&&ce&&h.editor.setTheme(K)},[K,ce]),Object(E.useEffect)(function(){var de=He.current.instance;de&&ce&&(de.updateOptions(Object(j.a)({},H)),setTimeout(function(){de.getModel().updateOptions(Object(j.a)({},H))},200))},[JSON.stringify(H),ce]),Object(E.useEffect)(function(){var de=He.current.instance;de&&ce&&de.layout()},[x,S,ce]);var me=Object(E.useState)(r(x)),ue=Object(O.a)(me,2),he=ue[0],Y=ue[1],$=Object(E.useState)(r(S)),z=Object(O.a)($,2),oe=z[0],_e=z[1],X=Object(j.a)(Object(j.a)({},P),{},{width:he,height:oe});return y.a.createElement("div",{className:"my-monaco-editor",ref:Ge,style:X})};function g(w){var C=w.width,x=C===void 0?"100%":C,b=w.height,S=b===void 0?"100%":b,A=w.original,p=w.modified,I=w.language,M=w.options,P=M===void 0?{}:M,B=Object(E.useRef)(),H=Object(E.useState)(null),F=Object(O.a)(H,2),W=F[0],U=F[1];function K(Se){var Ue;return B.current&&(Ue=new v.default(function(Ne){var xe=Object(R.a)(Ne),Ce;try{for(xe.s();!(Ce=xe.n()).done;){var De=Ce.value;(De.target.offsetHeight>0||De.target.offsetWidth>0)&&Se.layout()}}catch(ve){xe.e(ve)}finally{xe.f()}}),Ue.observe(B.current)),Ue}Object(E.useEffect)(function(){B.current&&re.e(27).then(re.t.bind(null,"M/lh",7)).then(function(Se){h=Se;var Ue=h.editor.createDiffEditor(B.current,Object(j.a)(Object(j.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},P),{},{wordWrap:!0}));U(Ue);var Ne=K(Ue);return function(){Ue.dispose();var xe=Ue.getModel();xe&&xe.dispose(),Ne.unobserve(B.current)}})},[]),Object(E.useEffect)(function(){W&&W.setModel({original:h.editor.createModel(A,I),modified:h.editor.createModel(p,I)})},[A,p,I,W]);var G=r(x),ae=r(S),fe={width:G,height:ae};return y.a.createElement("div",{className:"my-diff-editor",ref:B,style:fe})}},ZpRC:function(Je,le,re){"use strict";function j(a){return typeof a=="object"&&a!=null&&a.nodeType===1}function k(a,c){return(!c||a!=="hidden")&&a!=="visible"&&a!=="clip"}function D(a,c){if(a.clientHeight<a.scrollHeight||a.clientWidth<a.scrollWidth){var s=getComputedStyle(a,null);return k(s.overflowY,c)||k(s.overflowX,c)||function(l){var r=function(n){if(!n.ownerDocument||!n.ownerDocument.defaultView)return null;try{return n.ownerDocument.defaultView.frameElement}catch(o){return null}}(l);return!!r&&(r.clientHeight<l.scrollHeight||r.clientWidth<l.scrollWidth)}(a)}return!1}function R(a,c,s,l,r,n,o,i){return n<a&&o>c||n>a&&o<c?0:n<=a&&i<=s||o>=c&&i>=s?n-a-l:o>c&&i<s||n<a&&i>s?o-c+r:0}var O=function(a,c){var s=window,l=c.scrollMode,r=c.block,n=c.inline,o=c.boundary,i=c.skipOverflowHiddenElements,f=typeof o=="function"?o:function(Ge){return Ge!==o};if(!j(a))throw new TypeError("Invalid target");for(var h=document.scrollingElement||document.documentElement,T=[],g=a;j(g)&&f(g);){if((g=g.parentElement)===h){T.push(g);break}g!=null&&g===document.body&&D(g)&&!D(document.documentElement)||g!=null&&D(g,i)&&T.push(g)}for(var w=s.visualViewport?s.visualViewport.width:innerWidth,C=s.visualViewport?s.visualViewport.height:innerHeight,x=window.scrollX||pageXOffset,b=window.scrollY||pageYOffset,S=a.getBoundingClientRect(),A=S.height,p=S.width,I=S.top,M=S.right,P=S.bottom,B=S.left,H=r==="start"||r==="nearest"?I:r==="end"?P:I+A/2,F=n==="center"?B+p/2:n==="end"?M:B,W=[],U=0;U<T.length;U++){var K=T[U],G=K.getBoundingClientRect(),ae=G.height,fe=G.width,Se=G.top,Ue=G.right,Ne=G.bottom,xe=G.left;if(l==="if-needed"&&I>=0&&B>=0&&P<=C&&M<=w&&I>=Se&&P<=Ne&&B>=xe&&M<=Ue)return W;var Ce=getComputedStyle(K),De=parseInt(Ce.borderLeftWidth,10),ve=parseInt(Ce.borderTopWidth,10),Re=parseInt(Ce.borderRightWidth,10),ee=parseInt(Ce.borderBottomWidth,10),ge=0,se=0,Fe="offsetWidth"in K?K.offsetWidth-K.clientWidth-De-Re:0,je="offsetHeight"in K?K.offsetHeight-K.clientHeight-ve-ee:0;if(h===K)ge=r==="start"?H:r==="end"?H-C:r==="nearest"?R(b,b+C,C,ve,ee,b+H,b+H+A,A):H-C/2,se=n==="start"?F:n==="center"?F-w/2:n==="end"?F-w:R(x,x+w,w,De,Re,x+F,x+F+p,p),ge=Math.max(0,ge+b),se=Math.max(0,se+x);else{ge=r==="start"?H-Se-ve:r==="end"?H-Ne+ee+je:r==="nearest"?R(Se,Ne,ae,ve,ee+je,H,H+A,A):H-(Se+ae/2)+je/2,se=n==="start"?F-xe-De:n==="center"?F-(xe+fe/2)+Fe/2:n==="end"?F-Ue+Re+Fe:R(xe,Ue,fe,De,Re+Fe,F,F+p,p);var Ke=K.scrollLeft,ze=K.scrollTop;H+=ze-(ge=Math.max(0,Math.min(ze+ge,K.scrollHeight-ae+je))),F+=Ke-(se=Math.max(0,Math.min(Ke+se,K.scrollWidth-fe+Fe)))}W.push({el:K,top:ge,left:se})}return W};function d(a){return a===Object(a)&&Object.keys(a).length!==0}function E(a,c){c===void 0&&(c="auto");var s="scrollBehavior"in document.body.style;a.forEach(function(l){var r=l.el,n=l.top,o=l.left;r.scroll&&s?r.scroll({top:n,left:o,behavior:c}):(r.scrollTop=n,r.scrollLeft=o)})}function y(a){return a===!1?{block:"end",inline:"nearest"}:d(a)?a:{block:"start",inline:"nearest"}}function v(a,c){var s=!a.ownerDocument.documentElement.contains(a);if(d(c)&&typeof c.behavior=="function")return c.behavior(s?[]:O(a,c));if(s)return;var l=y(c);return E(O(a,l),l.behavior)}var u=le.a=v},Zss7:function(Je,le,re){var j;(function(k){var D=/^\s+/,R=/\s+$/,O=0,d=k.round,E=k.min,y=k.max,v=k.random;function u(ee,ge){if(ee=ee||"",ge=ge||{},ee instanceof u)return ee;if(!(this instanceof u))return new u(ee,ge);var se=a(ee);this._originalInput=ee,this._r=se.r,this._g=se.g,this._b=se.b,this._a=se.a,this._roundA=d(100*this._a)/100,this._format=ge.format||se.format,this._gradientType=ge.gradientType,this._r<1&&(this._r=d(this._r)),this._g<1&&(this._g=d(this._g)),this._b<1&&(this._b=d(this._b)),this._ok=se.ok,this._tc_id=O++}u.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 ee=this.toRgb();return(ee.r*299+ee.g*587+ee.b*114)/1e3},getLuminance:function(){var ee=this.toRgb(),ge,se,Fe,je,Ke,ze;return ge=ee.r/255,se=ee.g/255,Fe=ee.b/255,ge<=.03928?je=ge/12.92:je=k.pow((ge+.055)/1.055,2.4),se<=.03928?Ke=se/12.92:Ke=k.pow((se+.055)/1.055,2.4),Fe<=.03928?ze=Fe/12.92:ze=k.pow((Fe+.055)/1.055,2.4),.2126*je+.7152*Ke+.0722*ze},setAlpha:function(ee){return this._a=W(ee),this._roundA=d(100*this._a)/100,this},toHsv:function(){var ee=r(this._r,this._g,this._b);return{h:ee.h*360,s:ee.s,v:ee.v,a:this._a}},toHsvString:function(){var ee=r(this._r,this._g,this._b),ge=d(ee.h*360),se=d(ee.s*100),Fe=d(ee.v*100);return this._a==1?"hsv("+ge+", "+se+"%, "+Fe+"%)":"hsva("+ge+", "+se+"%, "+Fe+"%, "+this._roundA+")"},toHsl:function(){var ee=s(this._r,this._g,this._b);return{h:ee.h*360,s:ee.s,l:ee.l,a:this._a}},toHslString:function(){var ee=s(this._r,this._g,this._b),ge=d(ee.h*360),se=d(ee.s*100),Fe=d(ee.l*100);return this._a==1?"hsl("+ge+", "+se+"%, "+Fe+"%)":"hsla("+ge+", "+se+"%, "+Fe+"%, "+this._roundA+")"},toHex:function(ee){return o(this._r,this._g,this._b,ee)},toHexString:function(ee){return"#"+this.toHex(ee)},toHex8:function(ee){return i(this._r,this._g,this._b,this._a,ee)},toHex8String:function(ee){return"#"+this.toHex8(ee)},toRgb:function(){return{r:d(this._r),g:d(this._g),b:d(this._b),a:this._a}},toRgbString:function(){return this._a==1?"rgb("+d(this._r)+", "+d(this._g)+", "+d(this._b)+")":"rgba("+d(this._r)+", "+d(this._g)+", "+d(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:d(U(this._r,255)*100)+"%",g:d(U(this._g,255)*100)+"%",b:d(U(this._b,255)*100)+"%",a:this._a}},toPercentageRgbString:function(){return this._a==1?"rgb("+d(U(this._r,255)*100)+"%, "+d(U(this._g,255)*100)+"%, "+d(U(this._b,255)*100)+"%)":"rgba("+d(U(this._r,255)*100)+"%, "+d(U(this._g,255)*100)+"%, "+d(U(this._b,255)*100)+"%, "+this._roundA+")"},toName:function(){return this._a===0?"transparent":this._a<1?!1:H[o(this._r,this._g,this._b,!0)]||!1},toFilter:function(ee){var ge="#"+f(this._r,this._g,this._b,this._a),se=ge,Fe=this._gradientType?"GradientType = 1, ":"";if(ee){var je=u(ee);se="#"+f(je._r,je._g,je._b,je._a)}return"progid:DXImageTransform.Microsoft.gradient("+Fe+"startColorstr="+ge+",endColorstr="+se+")"},toString:function(ee){var ge=!!ee;ee=ee||this._format;var se=!1,Fe=this._a<1&&this._a>=0,je=!ge&&Fe&&(ee==="hex"||ee==="hex6"||ee==="hex3"||ee==="hex4"||ee==="hex8"||ee==="name");return je?ee==="name"&&this._a===0?this.toName():this.toRgbString():(ee==="rgb"&&(se=this.toRgbString()),ee==="prgb"&&(se=this.toPercentageRgbString()),(ee==="hex"||ee==="hex6")&&(se=this.toHexString()),ee==="hex3"&&(se=this.toHexString(!0)),ee==="hex4"&&(se=this.toHex8String(!0)),ee==="hex8"&&(se=this.toHex8String()),ee==="name"&&(se=this.toName()),ee==="hsl"&&(se=this.toHslString()),ee==="hsv"&&(se=this.toHsvString()),se||this.toHexString())},clone:function(){return u(this.toString())},_applyModification:function(ee,ge){var se=ee.apply(null,[this].concat([].slice.call(ge)));return this._r=se._r,this._g=se._g,this._b=se._b,this.setAlpha(se._a),this},lighten:function(){return this._applyModification(w,arguments)},brighten:function(){return this._applyModification(C,arguments)},darken:function(){return this._applyModification(x,arguments)},desaturate:function(){return this._applyModification(h,arguments)},saturate:function(){return this._applyModification(T,arguments)},greyscale:function(){return this._applyModification(g,arguments)},spin:function(){return this._applyModification(b,arguments)},_applyCombination:function(ee,ge){return ee.apply(null,[this].concat([].slice.call(ge)))},analogous:function(){return this._applyCombination(M,arguments)},complement:function(){return this._applyCombination(S,arguments)},monochromatic:function(){return this._applyCombination(P,arguments)},splitcomplement:function(){return this._applyCombination(I,arguments)},triad:function(){return this._applyCombination(A,arguments)},tetrad:function(){return this._applyCombination(p,arguments)}},u.fromRatio=function(ee,ge){if(typeof ee=="object"){var se={};for(var Fe in ee)ee.hasOwnProperty(Fe)&&(Fe==="a"?se[Fe]=ee[Fe]:se[Fe]=Ue(ee[Fe]));ee=se}return u(ee,ge)};function a(ee){var ge={r:0,g:0,b:0},se=1,Fe=null,je=null,Ke=null,ze=!1,Ge=!1;return typeof ee=="string"&&(ee=ve(ee)),typeof ee=="object"&&(De(ee.r)&&De(ee.g)&&De(ee.b)?(ge=c(ee.r,ee.g,ee.b),ze=!0,Ge=String(ee.r).substr(-1)==="%"?"prgb":"rgb"):De(ee.h)&&De(ee.s)&&De(ee.v)?(Fe=Ue(ee.s),je=Ue(ee.v),ge=n(ee.h,Fe,je),ze=!0,Ge="hsv"):De(ee.h)&&De(ee.s)&&De(ee.l)&&(Fe=Ue(ee.s),Ke=Ue(ee.l),ge=l(ee.h,Fe,Ke),ze=!0,Ge="hsl"),ee.hasOwnProperty("a")&&(se=ee.a)),se=W(se),{ok:ze,format:ee.format||Ge,r:E(255,y(ge.r,0)),g:E(255,y(ge.g,0)),b:E(255,y(ge.b,0)),a:se}}function c(ee,ge,se){return{r:U(ee,255)*255,g:U(ge,255)*255,b:U(se,255)*255}}function s(ee,ge,se){ee=U(ee,255),ge=U(ge,255),se=U(se,255);var Fe=y(ee,ge,se),je=E(ee,ge,se),Ke,ze,Ge=(Fe+je)/2;if(Fe==je)Ke=ze=0;else{var He=Fe-je;ze=Ge>.5?He/(2-Fe-je):He/(Fe+je);switch(Fe){case ee:Ke=(ge-se)/He+(ge<se?6:0);break;case ge:Ke=(se-ee)/He+2;break;case se:Ke=(ee-ge)/He+4;break}Ke/=6}return{h:Ke,s:ze,l:Ge}}function l(ee,ge,se){var Fe,je,Ke;ee=U(ee,360),ge=U(ge,100),se=U(se,100);function ze(Ie,ke,Ae){return Ae<0&&(Ae+=1),Ae>1&&(Ae-=1),Ae<1/6?Ie+(ke-Ie)*6*Ae:Ae<1/2?ke:Ae<2/3?Ie+(ke-Ie)*(2/3-Ae)*6:Ie}if(ge===0)Fe=je=Ke=se;else{var Ge=se<.5?se*(1+ge):se+ge-se*ge,He=2*se-Ge;Fe=ze(He,Ge,ee+1/3),je=ze(He,Ge,ee),Ke=ze(He,Ge,ee-1/3)}return{r:Fe*255,g:je*255,b:Ke*255}}function r(ee,ge,se){ee=U(ee,255),ge=U(ge,255),se=U(se,255);var Fe=y(ee,ge,se),je=E(ee,ge,se),Ke,ze,Ge=Fe,He=Fe-je;if(ze=Fe===0?0:He/Fe,Fe==je)Ke=0;else{switch(Fe){case ee:Ke=(ge-se)/He+(ge<se?6:0);break;case ge:Ke=(se-ee)/He+2;break;case se:Ke=(ee-ge)/He+4;break}Ke/=6}return{h:Ke,s:ze,v:Ge}}function n(ee,ge,se){ee=U(ee,360)*6,ge=U(ge,100),se=U(se,100);var Fe=k.floor(ee),je=ee-Fe,Ke=se*(1-ge),ze=se*(1-je*ge),Ge=se*(1-(1-je)*ge),He=Fe%6,Ie=[se,ze,Ke,Ke,Ge,se][He],ke=[Ge,se,se,ze,Ke,Ke][He],Ae=[Ke,Ke,Ge,se,se,ze][He];return{r:Ie*255,g:ke*255,b:Ae*255}}function o(ee,ge,se,Fe){var je=[Se(d(ee).toString(16)),Se(d(ge).toString(16)),Se(d(se).toString(16))];return Fe&&je[0].charAt(0)==je[0].charAt(1)&&je[1].charAt(0)==je[1].charAt(1)&&je[2].charAt(0)==je[2].charAt(1)?je[0].charAt(0)+je[1].charAt(0)+je[2].charAt(0):je.join("")}function i(ee,ge,se,Fe,je){var Ke=[Se(d(ee).toString(16)),Se(d(ge).toString(16)),Se(d(se).toString(16)),Se(Ne(Fe))];return je&&Ke[0].charAt(0)==Ke[0].charAt(1)&&Ke[1].charAt(0)==Ke[1].charAt(1)&&Ke[2].charAt(0)==Ke[2].charAt(1)&&Ke[3].charAt(0)==Ke[3].charAt(1)?Ke[0].charAt(0)+Ke[1].charAt(0)+Ke[2].charAt(0)+Ke[3].charAt(0):Ke.join("")}function f(ee,ge,se,Fe){var je=[Se(Ne(Fe)),Se(d(ee).toString(16)),Se(d(ge).toString(16)),Se(d(se).toString(16))];return je.join("")}u.equals=function(ee,ge){return!ee||!ge?!1:u(ee).toRgbString()==u(ge).toRgbString()},u.random=function(){return u.fromRatio({r:v(),g:v(),b:v()})};function h(ee,ge){ge=ge===0?0:ge||10;var se=u(ee).toHsl();return se.s-=ge/100,se.s=K(se.s),u(se)}function T(ee,ge){ge=ge===0?0:ge||10;var se=u(ee).toHsl();return se.s+=ge/100,se.s=K(se.s),u(se)}function g(ee){return u(ee).desaturate(100)}function w(ee,ge){ge=ge===0?0:ge||10;var se=u(ee).toHsl();return se.l+=ge/100,se.l=K(se.l),u(se)}function C(ee,ge){ge=ge===0?0:ge||10;var se=u(ee).toRgb();return se.r=y(0,E(255,se.r-d(255*-(ge/100)))),se.g=y(0,E(255,se.g-d(255*-(ge/100)))),se.b=y(0,E(255,se.b-d(255*-(ge/100)))),u(se)}function x(ee,ge){ge=ge===0?0:ge||10;var se=u(ee).toHsl();return se.l-=ge/100,se.l=K(se.l),u(se)}function b(ee,ge){var se=u(ee).toHsl(),Fe=(se.h+ge)%360;return se.h=Fe<0?360+Fe:Fe,u(se)}function S(ee){var ge=u(ee).toHsl();return ge.h=(ge.h+180)%360,u(ge)}function A(ee){var ge=u(ee).toHsl(),se=ge.h;return[u(ee),u({h:(se+120)%360,s:ge.s,l:ge.l}),u({h:(se+240)%360,s:ge.s,l:ge.l})]}function p(ee){var ge=u(ee).toHsl(),se=ge.h;return[u(ee),u({h:(se+90)%360,s:ge.s,l:ge.l}),u({h:(se+180)%360,s:ge.s,l:ge.l}),u({h:(se+270)%360,s:ge.s,l:ge.l})]}function I(ee){var ge=u(ee).toHsl(),se=ge.h;return[u(ee),u({h:(se+72)%360,s:ge.s,l:ge.l}),u({h:(se+216)%360,s:ge.s,l:ge.l})]}function M(ee,ge,se){ge=ge||6,se=se||30;var Fe=u(ee).toHsl(),je=360/se,Ke=[u(ee)];for(Fe.h=(Fe.h-(je*ge>>1)+720)%360;--ge;)Fe.h=(Fe.h+je)%360,Ke.push(u(Fe));return Ke}function P(ee,ge){ge=ge||6;for(var se=u(ee).toHsv(),Fe=se.h,je=se.s,Ke=se.v,ze=[],Ge=1/ge;ge--;)ze.push(u({h:Fe,s:je,v:Ke})),Ke=(Ke+Ge)%1;return ze}u.mix=function(ee,ge,se){se=se===0?0:se||50;var Fe=u(ee).toRgb(),je=u(ge).toRgb(),Ke=se/100,ze={r:(je.r-Fe.r)*Ke+Fe.r,g:(je.g-Fe.g)*Ke+Fe.g,b:(je.b-Fe.b)*Ke+Fe.b,a:(je.a-Fe.a)*Ke+Fe.a};return u(ze)},u.readability=function(ee,ge){var se=u(ee),Fe=u(ge);return(k.max(se.getLuminance(),Fe.getLuminance())+.05)/(k.min(se.getLuminance(),Fe.getLuminance())+.05)},u.isReadable=function(ee,ge,se){var Fe=u.readability(ee,ge),je,Ke;Ke=!1,je=Re(se);switch(je.level+je.size){case"AAsmall":case"AAAlarge":Ke=Fe>=4.5;break;case"AAlarge":Ke=Fe>=3;break;case"AAAsmall":Ke=Fe>=7;break}return Ke},u.mostReadable=function(ee,ge,se){var Fe=null,je=0,Ke,ze,Ge,He;se=se||{},ze=se.includeFallbackColors,Ge=se.level,He=se.size;for(var Ie=0;Ie<ge.length;Ie++)Ke=u.readability(ee,ge[Ie]),Ke>je&&(je=Ke,Fe=u(ge[Ie]));return u.isReadable(ee,Fe,{level:Ge,size:He})||!ze?Fe:(se.includeFallbackColors=!1,u.mostReadable(ee,["#fff","#000"],se))};var B=u.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"},H=u.hexNames=F(B);function F(ee){var ge={};for(var se in ee)ee.hasOwnProperty(se)&&(ge[ee[se]]=se);return ge}function W(ee){return ee=parseFloat(ee),(isNaN(ee)||ee<0||ee>1)&&(ee=1),ee}function U(ee,ge){ae(ee)&&(ee="100%");var se=fe(ee);return ee=E(ge,y(0,parseFloat(ee))),se&&(ee=parseInt(ee*ge,10)/100),k.abs(ee-ge)<1e-6?1:ee%ge/parseFloat(ge)}function K(ee){return E(1,y(0,ee))}function G(ee){return parseInt(ee,16)}function ae(ee){return typeof ee=="string"&&ee.indexOf(".")!=-1&&parseFloat(ee)===1}function fe(ee){return typeof ee=="string"&&ee.indexOf("%")!=-1}function Se(ee){return ee.length==1?"0"+ee:""+ee}function Ue(ee){return ee<=1&&(ee=ee*100+"%"),ee}function Ne(ee){return k.round(parseFloat(ee)*255).toString(16)}function xe(ee){return G(ee)/255}var Ce=function(){var ee="[-\\+]?\\d+%?",ge="[-\\+]?\\d*\\.\\d+%?",se="(?:"+ge+")|(?:"+ee+")",Fe="[\\s|\\(]+("+se+")[,|\\s]+("+se+")[,|\\s]+("+se+")\\s*\\)?",je="[\\s|\\(]+("+se+")[,|\\s]+("+se+")[,|\\s]+("+se+")[,|\\s]+("+se+")\\s*\\)?";return{CSS_UNIT:new RegExp(se),rgb:new RegExp("rgb"+Fe),rgba:new RegExp("rgba"+je),hsl:new RegExp("hsl"+Fe),hsla:new RegExp("hsla"+je),hsv:new RegExp("hsv"+Fe),hsva:new RegExp("hsva"+je),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 De(ee){return!!Ce.CSS_UNIT.exec(ee)}function ve(ee){ee=ee.replace(D,"").replace(R,"").toLowerCase();var ge=!1;if(B[ee])ee=B[ee],ge=!0;else if(ee=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var se;return(se=Ce.rgb.exec(ee))?{r:se[1],g:se[2],b:se[3]}:(se=Ce.rgba.exec(ee))?{r:se[1],g:se[2],b:se[3],a:se[4]}:(se=Ce.hsl.exec(ee))?{h:se[1],s:se[2],l:se[3]}:(se=Ce.hsla.exec(ee))?{h:se[1],s:se[2],l:se[3],a:se[4]}:(se=Ce.hsv.exec(ee))?{h:se[1],s:se[2],v:se[3]}:(se=Ce.hsva.exec(ee))?{h:se[1],s:se[2],v:se[3],a:se[4]}:(se=Ce.hex8.exec(ee))?{r:G(se[1]),g:G(se[2]),b:G(se[3]),a:xe(se[4]),format:ge?"name":"hex8"}:(se=Ce.hex6.exec(ee))?{r:G(se[1]),g:G(se[2]),b:G(se[3]),format:ge?"name":"hex"}:(se=Ce.hex4.exec(ee))?{r:G(se[1]+""+se[1]),g:G(se[2]+""+se[2]),b:G(se[3]+""+se[3]),a:xe(se[4]+""+se[4]),format:ge?"name":"hex8"}:(se=Ce.hex3.exec(ee))?{r:G(se[1]+""+se[1]),g:G(se[2]+""+se[2]),b:G(se[3]+""+se[3]),format:ge?"name":"hex"}:!1}function Re(ee){var ge,se;return ee=ee||{level:"AA",size:"small"},ge=(ee.level||"AA").toUpperCase(),se=(ee.size||"small").toLowerCase(),ge!=="AA"&&ge!=="AAA"&&(ge="AA"),se!=="small"&&se!=="large"&&(se="small"),{level:ge,size:se}}Je.exports?Je.exports=u:!(j=function(){return u}.call(le,re,le,Je),j!==void 0&&(Je.exports=j))})(Math)},bT9E:function(Je,le,re){"use strict";re.d(le,"a",function(){return k});var j=re("VTBJ");function k(D,R){var O=Object(j.a)({},D);return Array.isArray(R)&&R.forEach(function(d){delete O[d]}),O}},c5Ni:function(Je,le,re){},c5fP:function(Je,le,re){"use strict";function j(ne){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?j=function(Oe){return typeof Oe}:j=function(Oe){return Oe&&typeof Symbol=="function"&&Oe.constructor===Symbol&&Oe!==Symbol.prototype?"symbol":typeof Oe},j(ne)}Object.defineProperty(le,"__esModule",{value:!0}),le._tr_init=Le,le._tr_stored_block=We,le._tr_flush_block=Me,le._tr_tally=et,le._tr_align=Ve;var k=R(re("6BzB"));function D(){if(typeof WeakMap!="function")return null;var ne=new WeakMap;return D=function(){return ne},ne}function R(ne){if(ne&&ne.__esModule)return ne;if(ne===null||j(ne)!=="object"&&typeof ne!="function")return{default:ne};var Ee=D();if(Ee&&Ee.has(ne))return Ee.get(ne);var Oe={},me=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var ue in ne)if(Object.prototype.hasOwnProperty.call(ne,ue)){var he=me?Object.getOwnPropertyDescriptor(ne,ue):null;he&&(he.get||he.set)?Object.defineProperty(Oe,ue,he):Oe[ue]=ne[ue]}return Oe.default=ne,Ee&&Ee.set(ne,Oe),Oe}var O=4,d=0,E=1,y=2;function v(ne){for(var Ee=ne.length;--Ee>=0;)ne[Ee]=0}var u=0,a=1,c=2,s=3,l=258,r=29,n=256,o=n+1+r,i=30,f=19,h=2*o+1,T=15,g=16,w=7,C=256,x=16,b=17,S=18,A=[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],p=[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],I=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],M=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],P=512,B=new Array((o+2)*2);v(B);var H=new Array(i*2);v(H);var F=new Array(P);v(F);var W=new Array(l-s+1);v(W);var U=new Array(r);v(U);var K=new Array(i);v(K);function G(ne,Ee,Oe,me,ue){this.static_tree=ne,this.extra_bits=Ee,this.extra_base=Oe,this.elems=me,this.max_length=ue,this.has_stree=ne&&ne.length}var ae,fe,Se;function Ue(ne,Ee){this.dyn_tree=ne,this.max_code=0,this.stat_desc=Ee}function Ne(ne){return ne<256?F[ne]:F[256+(ne>>>7)]}function xe(ne,Ee){ne.pending_buf[ne.pending++]=Ee&255,ne.pending_buf[ne.pending++]=Ee>>>8&255}function Ce(ne,Ee,Oe){ne.bi_valid>g-Oe?(ne.bi_buf|=Ee<<ne.bi_valid&65535,xe(ne,ne.bi_buf),ne.bi_buf=Ee>>g-ne.bi_valid,ne.bi_valid+=Oe-g):(ne.bi_buf|=Ee<<ne.bi_valid&65535,ne.bi_valid+=Oe)}function De(ne,Ee,Oe){Ce(ne,Oe[Ee*2],Oe[Ee*2+1])}function ve(ne,Ee){var Oe=0;do Oe|=ne&1,ne>>>=1,Oe<<=1;while(--Ee>0);return Oe>>>1}function Re(ne){ne.bi_valid===16?(xe(ne,ne.bi_buf),ne.bi_buf=0,ne.bi_valid=0):ne.bi_valid>=8&&(ne.pending_buf[ne.pending++]=ne.bi_buf&255,ne.bi_buf>>=8,ne.bi_valid-=8)}function ee(ne,Ee){var Oe=Ee.dyn_tree,me=Ee.max_code,ue=Ee.stat_desc.static_tree,he=Ee.stat_desc.has_stree,Y=Ee.stat_desc.extra_bits,$=Ee.stat_desc.extra_base,z=Ee.stat_desc.max_length,oe,_e,X,de,ye,ie,pe=0;for(de=0;de<=T;de++)ne.bl_count[de]=0;for(Oe[ne.heap[ne.heap_max]*2+1]=0,oe=ne.heap_max+1;oe<h;oe++){if(_e=ne.heap[oe],de=Oe[Oe[_e*2+1]*2+1]+1,de>z&&(de=z,pe++),Oe[_e*2+1]=de,_e>me)continue;ne.bl_count[de]++,ye=0,_e>=$&&(ye=Y[_e-$]),ie=Oe[_e*2],ne.opt_len+=ie*(de+ye),he&&(ne.static_len+=ie*(ue[_e*2+1]+ye))}if(pe===0)return;do{for(de=z-1;ne.bl_count[de]===0;)de--;ne.bl_count[de]--,ne.bl_count[de+1]+=2,ne.bl_count[z]--,pe-=2}while(pe>0);for(de=z;de!==0;de--)for(_e=ne.bl_count[de];_e!==0;){if(X=ne.heap[--oe],X>me)continue;Oe[X*2+1]!==de&&(ne.opt_len+=(de-Oe[X*2+1])*Oe[X*2],Oe[X*2+1]=de),_e--}}function ge(ne,Ee,Oe){var me=new Array(T+1),ue=0,he,Y;for(he=1;he<=T;he++)me[he]=ue=ue+Oe[he-1]<<1;for(Y=0;Y<=Ee;Y++){var $=ne[Y*2+1];if($===0)continue;ne[Y*2]=ve(me[$]++,$)}}function se(){var ne,Ee,Oe,me,ue,he=new Array(T+1);for(Oe=0,me=0;me<r-1;me++)for(U[me]=Oe,ne=0;ne<1<<A[me];ne++)W[Oe++]=me;for(W[Oe-1]=me,ue=0,me=0;me<16;me++)for(K[me]=ue,ne=0;ne<1<<p[me];ne++)F[ue++]=me;for(ue>>=7;me<i;me++)for(K[me]=ue<<7,ne=0;ne<1<<p[me]-7;ne++)F[256+ue++]=me;for(Ee=0;Ee<=T;Ee++)he[Ee]=0;for(ne=0;ne<=143;)B[ne*2+1]=8,ne++,he[8]++;for(;ne<=255;)B[ne*2+1]=9,ne++,he[9]++;for(;ne<=279;)B[ne*2+1]=7,ne++,he[7]++;for(;ne<=287;)B[ne*2+1]=8,ne++,he[8]++;for(ge(B,o+1,he),ne=0;ne<i;ne++)H[ne*2+1]=5,H[ne*2]=ve(ne,5);ae=new G(B,A,n+1,o,T),fe=new G(H,p,0,i,T),Se=new G(new Array(0),I,0,f,w)}function Fe(ne){var Ee;for(Ee=0;Ee<o;Ee++)ne.dyn_ltree[Ee*2]=0;for(Ee=0;Ee<i;Ee++)ne.dyn_dtree[Ee*2]=0;for(Ee=0;Ee<f;Ee++)ne.bl_tree[Ee*2]=0;ne.dyn_ltree[C*2]=1,ne.opt_len=ne.static_len=0,ne.last_lit=ne.matches=0}function je(ne){ne.bi_valid>8?xe(ne,ne.bi_buf):ne.bi_valid>0&&(ne.pending_buf[ne.pending++]=ne.bi_buf),ne.bi_buf=0,ne.bi_valid=0}function Ke(ne,Ee,Oe,me){je(ne),me&&(xe(ne,Oe),xe(ne,~Oe)),k.arraySet(ne.pending_buf,ne.window,Ee,Oe,ne.pending),ne.pending+=Oe}function ze(ne,Ee,Oe,me){var ue=Ee*2,he=Oe*2;return ne[ue]<ne[he]||ne[ue]===ne[he]&&me[Ee]<=me[Oe]}function Ge(ne,Ee,Oe){for(var me=ne.heap[Oe],ue=Oe<<1;ue<=ne.heap_len&&!(ue<ne.heap_len&&ze(Ee,ne.heap[ue+1],ne.heap[ue],ne.depth)&&ue++,ze(Ee,me,ne.heap[ue],ne.depth));)ne.heap[Oe]=ne.heap[ue],Oe=ue,ue<<=1;ne.heap[Oe]=me}function He(ne,Ee,Oe){var me,ue,he=0,Y,$;if(ne.last_lit!==0)do me=ne.pending_buf[ne.d_buf+he*2]<<8|ne.pending_buf[ne.d_buf+he*2+1],ue=ne.pending_buf[ne.l_buf+he],he++,me===0?De(ne,ue,Ee):(Y=W[ue],De(ne,Y+n+1,Ee),$=A[Y],$!==0&&(ue-=U[Y],Ce(ne,ue,$)),me--,Y=Ne(me),De(ne,Y,Oe),$=p[Y],$!==0&&(me-=K[Y],Ce(ne,me,$)));while(he<ne.last_lit);De(ne,C,Ee)}function Ie(ne,Ee){var Oe=Ee.dyn_tree,me=Ee.stat_desc.static_tree,ue=Ee.stat_desc.has_stree,he=Ee.stat_desc.elems,Y,$,z=-1,oe;for(ne.heap_len=0,ne.heap_max=h,Y=0;Y<he;Y++)Oe[Y*2]!==0?(ne.heap[++ne.heap_len]=z=Y,ne.depth[Y]=0):Oe[Y*2+1]=0;for(;ne.heap_len<2;)oe=ne.heap[++ne.heap_len]=z<2?++z:0,Oe[oe*2]=1,ne.depth[oe]=0,ne.opt_len--,ue&&(ne.static_len-=me[oe*2+1]);for(Ee.max_code=z,Y=ne.heap_len>>1;Y>=1;Y--)Ge(ne,Oe,Y);oe=he;do Y=ne.heap[1],ne.heap[1]=ne.heap[ne.heap_len--],Ge(ne,Oe,1),$=ne.heap[1],ne.heap[--ne.heap_max]=Y,ne.heap[--ne.heap_max]=$,Oe[oe*2]=Oe[Y*2]+Oe[$*2],ne.depth[oe]=(ne.depth[Y]>=ne.depth[$]?ne.depth[Y]:ne.depth[$])+1,Oe[Y*2+1]=Oe[$*2+1]=oe,ne.heap[1]=oe++,Ge(ne,Oe,1);while(ne.heap_len>=2);ne.heap[--ne.heap_max]=ne.heap[1],ee(ne,Ee),ge(Oe,z,ne.bl_count)}function ke(ne,Ee,Oe){var me,ue=-1,he,Y=Ee[0*2+1],$=0,z=7,oe=4;for(Y===0&&(z=138,oe=3),Ee[(Oe+1)*2+1]=65535,me=0;me<=Oe;me++){if(he=Y,Y=Ee[(me+1)*2+1],++$<z&&he===Y)continue;$<oe?ne.bl_tree[he*2]+=$:he!==0?(he!==ue&&ne.bl_tree[he*2]++,ne.bl_tree[x*2]++):$<=10?ne.bl_tree[b*2]++:ne.bl_tree[S*2]++,$=0,ue=he,Y===0?(z=138,oe=3):he===Y?(z=6,oe=3):(z=7,oe=4)}}function Ae(ne,Ee,Oe){var me,ue=-1,he,Y=Ee[0*2+1],$=0,z=7,oe=4;for(Y===0&&(z=138,oe=3),me=0;me<=Oe;me++){if(he=Y,Y=Ee[(me+1)*2+1],++$<z&&he===Y)continue;if($<oe)do De(ne,he,ne.bl_tree);while(--$!==0);else he!==0?(he!==ue&&(De(ne,he,ne.bl_tree),$--),De(ne,x,ne.bl_tree),Ce(ne,$-3,2)):$<=10?(De(ne,b,ne.bl_tree),Ce(ne,$-3,3)):(De(ne,S,ne.bl_tree),Ce(ne,$-11,7));$=0,ue=he,Y===0?(z=138,oe=3):he===Y?(z=6,oe=3):(z=7,oe=4)}}function Te(ne){var Ee;for(ke(ne,ne.dyn_ltree,ne.l_desc.max_code),ke(ne,ne.dyn_dtree,ne.d_desc.max_code),Ie(ne,ne.bl_desc),Ee=f-1;Ee>=3&&!(ne.bl_tree[M[Ee]*2+1]!==0);Ee--);return ne.opt_len+=3*(Ee+1)+5+5+4,Ee}function Z(ne,Ee,Oe,me){var ue;for(Ce(ne,Ee-257,5),Ce(ne,Oe-1,5),Ce(ne,me-4,4),ue=0;ue<me;ue++)Ce(ne,ne.bl_tree[M[ue]*2+1],3);Ae(ne,ne.dyn_ltree,Ee-1),Ae(ne,ne.dyn_dtree,Oe-1)}function ce(ne){var Ee=4093624447,Oe;for(Oe=0;Oe<=31;Oe++,Ee>>>=1)if(Ee&1&&ne.dyn_ltree[Oe*2]!==0)return d;if(ne.dyn_ltree[9*2]!==0||ne.dyn_ltree[10*2]!==0||ne.dyn_ltree[13*2]!==0)return E;for(Oe=32;Oe<n;Oe++)if(ne.dyn_ltree[Oe*2]!==0)return E;return d}var J=!1;function Le(ne){J||(se(),J=!0),ne.l_desc=new Ue(ne.dyn_ltree,ae),ne.d_desc=new Ue(ne.dyn_dtree,fe),ne.bl_desc=new Ue(ne.bl_tree,Se),ne.bi_buf=0,ne.bi_valid=0,Fe(ne)}function We(ne,Ee,Oe,me){Ce(ne,(u<<1)+(me?1:0),3),Ke(ne,Ee,Oe,!0)}function Ve(ne){Ce(ne,a<<1,3),De(ne,C,B),Re(ne)}function Me(ne,Ee,Oe,me){var ue,he,Y=0;ne.level>0?(ne.strm.data_type===y&&(ne.strm.data_type=ce(ne)),Ie(ne,ne.l_desc),Ie(ne,ne.d_desc),Y=Te(ne),ue=ne.opt_len+3+7>>>3,he=ne.static_len+3+7>>>3,he<=ue&&(ue=he)):ue=he=Oe+5,Oe+4<=ue&&Ee!==-1?We(ne,Ee,Oe,me):ne.strategy===O||he===ue?(Ce(ne,(a<<1)+(me?1:0),3),He(ne,B,H)):(Ce(ne,(c<<1)+(me?1:0),3),Z(ne,ne.l_desc.max_code+1,ne.d_desc.max_code+1,Y+1),He(ne,ne.dyn_ltree,ne.dyn_dtree)),Fe(ne),me&&je(ne)}function et(ne,Ee,Oe){return ne.pending_buf[ne.d_buf+ne.last_lit*2]=Ee>>>8&255,ne.pending_buf[ne.d_buf+ne.last_lit*2+1]=Ee&255,ne.pending_buf[ne.l_buf+ne.last_lit]=Oe&255,ne.last_lit++,Ee===0?ne.dyn_ltree[Oe*2]++:(ne.matches++,Ee--,ne.dyn_ltree[(W[Oe]+n+1)*2]++,ne.dyn_dtree[Ne(Ee)*2]++),ne.last_lit===ne.lit_bufsize-1}},dejd:function(Je,le,re){},dmUQ:function(Je,le,re){"use strict";var j=re("Ff2n"),k=re("rePB"),D=re("1OyB"),R=re("vuIU"),O=re("Ji7U"),d=re("md7G"),E=re("foSv"),y=re("cDcd"),v=re.n(y),u=re("TSYQ"),a=re.n(u),c=re("4IlW");function s(A,p){var I=Object.keys(A);if(Object.getOwnPropertySymbols){var M=Object.getOwnPropertySymbols(A);p&&(M=M.filter(function(P){return Object.getOwnPropertyDescriptor(A,P).enumerable})),I.push.apply(I,M)}return I}function l(A){for(var p=1;p<arguments.length;p++){var I=arguments[p]!=null?arguments[p]:{};p%2?s(Object(I),!0).forEach(function(M){Object(k.a)(A,M,I[M])}):Object.getOwnPropertyDescriptors?Object.defineProperties(A,Object.getOwnPropertyDescriptors(I)):s(Object(I)).forEach(function(M){Object.defineProperty(A,M,Object.getOwnPropertyDescriptor(I,M))})}return A}function r(A){var p=n();return function(){var M=Object(E.a)(A),P;if(p){var B=Object(E.a)(this).constructor;P=Reflect.construct(M,arguments,B)}else P=M.apply(this,arguments);return Object(d.a)(this,P)}}function n(){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(A){return!1}}function o(){}function i(A){A.preventDefault()}var f=function(p){return p.replace(/[^\w.-]+/g,"")},h=200,T=600,g=Number.MAX_SAFE_INTEGER||Math.pow(2,53)-1,w=function(p){return p!=null},C=function(p,I){return I===p||typeof I=="number"&&typeof p=="number"&&isNaN(I)&&isNaN(p)},x=function(A){Object(O.a)(I,A);var p=r(I);function I(M){var P;Object(D.a)(this,I),P=p.call(this,M),P.onKeyDown=function(F){var W=P.props,U=W.onKeyDown,K=W.onPressEnter;if(F.keyCode===c.a.UP){var G=P.getRatio(F);P.up(F,G,null),P.stop()}else if(F.keyCode===c.a.DOWN){var ae=P.getRatio(F);P.down(F,ae,null),P.stop()}else F.keyCode===c.a.ENTER&&K&&K(F);if(P.recordCursorPosition(),P.lastKeyCode=F.keyCode,U){for(var fe=arguments.length,Se=new Array(fe>1?fe-1:0),Ue=1;Ue<fe;Ue++)Se[Ue-1]=arguments[Ue];U.apply(void 0,[F].concat(Se))}},P.onKeyUp=function(F){var W=P.props.onKeyUp;if(P.stop(),P.recordCursorPosition(),W){for(var U=arguments.length,K=new Array(U>1?U-1:0),G=1;G<U;G++)K[G-1]=arguments[G];W.apply(void 0,[F].concat(K))}},P.onChange=function(F){var W=P.props.onChange;P.state.focused&&(P.inputting=!0),P.rawInput=P.props.parser(P.getValueFromEvent(F)),P.setState({inputValue:P.rawInput}),W(P.toNumber(P.rawInput))},P.onMouseUp=function(){var F=P.props.onMouseUp;P.recordCursorPosition(),F&&F.apply(void 0,arguments)},P.onFocus=function(){var F;P.setState({focused:!0}),(F=P.props).onFocus.apply(F,arguments)},P.onBlur=function(){var F=P.props.onBlur;P.inputting=!1,P.setState({focused:!1});var W=P.getCurrentValidValue(P.state.inputValue),U=P.setValue(W,o);if(F){var K=P.input.value,G=P.getInputDisplayValue({focus:!1,value:U});P.input.value=G&&Number(G),F.apply(void 0,arguments),P.input.value=K}},P.getRatio=function(F){var W=1;return F.metaKey||F.ctrlKey?W=.1:F.shiftKey&&(W=10),W},P.getFullNum=function(F){return isNaN(F)?F:/e/i.test(String(F))?Number(F).toFixed(18).replace(/\.?0+$/,""):F},P.getPrecision=function(F){if(w(P.props.precision))return P.props.precision;var W=String(F);if(W.indexOf("e-")>=0)return parseInt(W.slice(W.indexOf("e-")+2),10);var U=0;return W.indexOf(".")>=0&&(U=W.length-W.indexOf(".")-1),U},P.getInputDisplayValue=function(F){var W=F||P.state,U=W.focused,K=W.inputValue,G=W.value,ae;U?ae=K:ae=P.toPrecisionAsStep(G),ae==null&&(ae="");var fe=P.formatWrapper(ae);return w(P.props.decimalSeparator)&&(fe=fe.toString().replace(".",P.props.decimalSeparator)),fe},P.recordCursorPosition=function(){try{P.cursorStart=P.input.selectionStart,P.cursorEnd=P.input.selectionEnd,P.currentValue=P.input.value,P.cursorBefore=P.input.value.substring(0,P.cursorStart),P.cursorAfter=P.input.value.substring(P.cursorEnd)}catch(F){}},P.restoreByAfter=function(F){if(F===void 0)return!1;var W=P.input.value,U=W.lastIndexOf(F);if(U===-1)return!1;var K=P.cursorBefore.length;return P.lastKeyCode===c.a.DELETE&&P.cursorBefore.charAt(K-1)===F[0]?(P.fixCaret(K,K),!0):U+F.length===W.length?(P.fixCaret(U,U),!0):!1},P.partRestoreByAfter=function(F){return F===void 0?!1:Array.prototype.some.call(F,function(W,U){var K=F.substring(U);return P.restoreByAfter(K)})},P.isNotCompleteNumber=function(F){return isNaN(F)||F===""||F===null||F&&F.toString().indexOf(".")===F.toString().length-1},P.stop=function(){P.autoStepTimer&&clearTimeout(P.autoStepTimer)},P.down=function(F,W,U){P.pressingUpOrDown=!0,P.step("down",F,W,U)},P.up=function(F,W,U){P.pressingUpOrDown=!0,P.step("up",F,W,U)},P.saveInput=function(F){P.input=F};var B=M.value;B===void 0&&(B=M.defaultValue),P.state={focused:M.autoFocus};var H=P.getValidValue(P.toNumber(B));return P.state=l(l({},P.state),{},{inputValue:P.toPrecisionAsStep(H),value:H}),P}return Object(R.a)(I,[{key:"componentDidMount",value:function(){this.componentDidUpdate(null)}},{key:"componentDidUpdate",value:function(P){var B=this.props,H=B.value,F=B.onChange,W=B.max,U=B.min,K=this.state.focused;if(P){if(!C(P.value,H)||!C(P.max,W)||!C(P.min,U)){var G=K?H:this.getValidValue(H),ae;this.pressingUpOrDown?ae=G:this.inputting?ae=this.rawInput:ae=this.toPrecisionAsStep(G),this.setState({value:G,inputValue:ae})}var fe="value"in this.props?H:this.state.value;"max"in this.props&&P.max!==W&&typeof fe=="number"&&fe>W&&F&&F(W),"min"in this.props&&P.min!==U&&typeof fe=="number"&&fe<U&&F&&F(U)}try{if(this.cursorStart!==void 0&&this.state.focused){if(!this.partRestoreByAfter(this.cursorAfter)&&this.state.value!==this.props.value){var Se=this.cursorStart+1;this.cursorAfter?this.lastKeyCode===c.a.BACKSPACE?Se=this.cursorStart-1:this.lastKeyCode===c.a.DELETE&&(Se=this.cursorStart):Se=this.input.value.length,this.fixCaret(Se,Se)}else if(this.currentValue===this.input.value)switch(this.lastKeyCode){case c.a.BACKSPACE:this.fixCaret(this.cursorStart-1,this.cursorStart-1);break;case c.a.DELETE:this.fixCaret(this.cursorStart+1,this.cursorStart+1);break;default:}}}catch(Ue){}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(P){var B=P;return B===""?B="":this.isNotCompleteNumber(parseFloat(B))?B=this.state.value:B=this.getValidValue(B),this.toNumber(B)}},{key:"getValueFromEvent",value:function(P){var B=P.target.value.trim().replace(/。/g,".");return w(this.props.decimalSeparator)&&(B=B.replace(this.props.decimalSeparator,".")),B}},{key:"getValidValue",value:function(P){var B=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.props.min,H=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.props.max,F=parseFloat(P);return isNaN(F)?P:(F<B&&(F=B),F>H&&(F=H),F)}},{key:"setValue",value:function(P,B){var H=this.props.precision,F=this.isNotCompleteNumber(parseFloat(P))?null:parseFloat(P),W=this.state.value,U=W===void 0?null:W,K=this.state.inputValue,G=K===void 0?null:K,ae=typeof F=="number"?F.toFixed(H):"".concat(F),fe=F!==U||ae!=="".concat(G);return"value"in this.props?(G=this.toPrecisionAsStep(this.state.value),this.setState({inputValue:G},B)):this.setState({value:F,inputValue:this.toPrecisionAsStep(P)},B),fe&&this.props.onChange(F),F}},{key:"getMaxPrecision",value:function(P){var B=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,H=this.props,F=H.precision,W=H.step;if(w(F))return F;var U=this.getPrecision(B),K=this.getPrecision(W),G=this.getPrecision(P);return P?Math.max(G,U+K):U+K}},{key:"getPrecisionFactor",value:function(P){var B=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,H=this.getMaxPrecision(P,B);return Math.pow(10,H)}},{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(P){return this.props.formatter?this.props.formatter(P):P}},{key:"toPrecisionAsStep",value:function(P){if(this.isNotCompleteNumber(P)||P==="")return P;var B=Math.abs(this.getMaxPrecision(P));return isNaN(B)?P.toString():Number(P).toFixed(B)}},{key:"toNumber",value:function(P){var B=this.props.precision,H=this.state.focused,F=P&&P.length>16&&H;return this.isNotCompleteNumber(P)||F?P:w(B)?Math.round(P*Math.pow(10,B))/Math.pow(10,B):Number(P)}},{key:"upStep",value:function(P,B){var H=this.props.step,F=this.getPrecisionFactor(P,B),W=Math.abs(this.getMaxPrecision(P,B)),U=((F*P+F*H*B)/F).toFixed(W);return this.toNumber(U)}},{key:"downStep",value:function(P,B){var H=this.props.step,F=this.getPrecisionFactor(P,B),W=Math.abs(this.getMaxPrecision(P,B)),U=((F*P-F*H*B)/F).toFixed(W);return this.toNumber(U)}},{key:"step",value:function(P,B){var H=this,F=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,W=arguments.length>3?arguments[3]:void 0;this.stop(),B&&(B.persist(),B.preventDefault());var U=this.props;if(U.disabled)return;var K=this.getCurrentValidValue(this.state.inputValue)||0;if(this.isNotCompleteNumber(K))return;var G=this["".concat(P,"Step")](K,F),ae=G>U.max||G<U.min;if(G>U.max?G=U.max:G<U.min&&(G=U.min),this.setValue(G,null),this.setState({focused:!0},function(){H.pressingUpOrDown=!1}),ae)return;this.autoStepTimer=setTimeout(function(){H[P](B,F,!0)},W?h:T)}},{key:"fixCaret",value:function(P,B){if(P===void 0||B===void 0||!this.input||!this.input.value)return;try{var H=this.input.selectionStart,F=this.input.selectionEnd;(P!==H||B!==F)&&this.input.setSelectionRange(P,B)}catch(W){}}},{key:"render",value:function(){var P,B=this.props,H=B.prefixCls,F=B.disabled,W=B.readOnly,U=B.useTouch,K=B.autoComplete,G=B.upHandler,ae=B.downHandler,fe=B.className,Se=B.max,Ue=B.min,Ne=B.style,xe=B.title,Ce=B.onMouseEnter,De=B.onMouseLeave,ve=B.onMouseOver,Re=B.onMouseOut,ee=B.required,ge=B.onClick,se=B.tabIndex,Fe=B.type,je=B.placeholder,Ke=B.id,ze=B.inputMode,Ge=B.pattern,He=B.step,Ie=B.maxLength,ke=B.autoFocus,Ae=B.name,Te=B.onPaste,Z=B.onInput,ce=Object(j.a)(B,["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"]),J=this.state,Le=J.value,We=J.focused,Ve=a()(H,(P={},Object(k.a)(P,fe,!!fe),Object(k.a)(P,"".concat(H,"-disabled"),F),Object(k.a)(P,"".concat(H,"-focused"),We),P)),Me={};Object.keys(ce).forEach(function(oe){(oe.substr(0,5)==="data-"||oe.substr(0,5)==="aria-"||oe==="role")&&(Me[oe]=ce[oe])});var et=!W&&!F,ne=this.getInputDisplayValue(null),Ee=(Le||Le===0)&&(isNaN(Le)||Number(Le)>=Se),Oe=(Le||Le===0)&&(isNaN(Le)||Number(Le)<=Ue),me=Ee||F||W,ue=Oe||F||W,he=a()("".concat(H,"-handler"),"".concat(H,"-handler-up"),Object(k.a)({},"".concat(H,"-handler-up-disabled"),me)),Y=a()("".concat(H,"-handler"),"".concat(H,"-handler-down"),Object(k.a)({},"".concat(H,"-handler-down-disabled"),ue)),$=U?{onTouchStart:me?o:this.up,onTouchEnd:this.stop}:{onMouseDown:me?o:this.up,onMouseUp:this.stop,onMouseLeave:this.stop},z=U?{onTouchStart:ue?o:this.down,onTouchEnd:this.stop}:{onMouseDown:ue?o:this.down,onMouseUp:this.stop,onMouseLeave:this.stop};return v.a.createElement("div",{className:Ve,style:Ne,title:xe,onMouseEnter:Ce,onMouseLeave:De,onMouseOver:ve,onMouseOut:Re,onFocus:function(){return null},onBlur:function(){return null}},v.a.createElement("div",{className:"".concat(H,"-handler-wrap")},v.a.createElement("span",Object.assign({unselectable:"on"},$,{role:"button","aria-label":"Increase Value","aria-disabled":me,className:he}),G||v.a.createElement("span",{unselectable:"on",className:"".concat(H,"-handler-up-inner"),onClick:i})),v.a.createElement("span",Object.assign({unselectable:"on"},z,{role:"button","aria-label":"Decrease Value","aria-disabled":ue,className:Y}),ae||v.a.createElement("span",{unselectable:"on",className:"".concat(H,"-handler-down-inner"),onClick:i}))),v.a.createElement("div",{className:"".concat(H,"-input-wrap")},v.a.createElement("input",Object.assign({role:"spinbutton","aria-valuemin":Ue,"aria-valuemax":Se,"aria-valuenow":Le,required:ee,type:Fe,placeholder:je,onPaste:Te,onClick:ge,onMouseUp:this.onMouseUp,className:"".concat(H,"-input"),tabIndex:se,autoComplete:K,onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:et?this.onKeyDown:o,onKeyUp:et?this.onKeyUp:o,autoFocus:ke,maxLength:Ie,readOnly:W,disabled:F,max:Se,min:Ue,step:He,name:Ae,title:xe,id:Ke,onChange:this.onChange,ref:this.saveInput,value:this.getFullNum(ne),pattern:Ge,inputMode:ze,onInput:Z},Me))))}}]),I}(v.a.Component);x.defaultProps={focusOnUpDown:!0,useTouch:!1,prefixCls:"rc-input-number",max:g,min:-g,step:1,style:{},onChange:o,onKeyDown:o,onPressEnter:o,onFocus:o,onBlur:o,parser:f,required:!1,autoComplete:"off"};var b=x,S=le.a=b},eP3c:function(Je,le,re){"use strict";function j(Y){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?j=function(z){return typeof z}:j=function(z){return z&&typeof Symbol=="function"&&z.constructor===Symbol&&z!==Symbol.prototype?"symbol":typeof z},j(Y)}Object.defineProperty(le,"__esModule",{value:!0}),le.inflateReset=Z,le.inflateReset2=ce,le.inflateResetKeep=Te,le.inflateInit=Le,le.inflateInit2=J,le.inflate=Ee,le.inflateEnd=Oe,le.inflateGetHeader=me,le.inflateSetDictionary=ue,le.inflateInfo=le.Z_DEFLATED=le.Z_BUF_ERROR=le.Z_MEM_ERROR=le.Z_DATA_ERROR=le.Z_STREAM_ERROR=le.Z_NEED_DICT=le.Z_STREAM_END=le.Z_OK=le.Z_TREES=le.Z_BLOCK=le.Z_FINISH=void 0;var k=v(re("6BzB")),D=E(re("xlC8")),R=E(re("QV2g")),O=E(re("sjKO")),d=E(re("JSwD"));function E(Y){return Y&&Y.__esModule?Y:{default:Y}}function y(){if(typeof WeakMap!="function")return null;var Y=new WeakMap;return y=function(){return Y},Y}function v(Y){if(Y&&Y.__esModule)return Y;if(Y===null||j(Y)!=="object"&&typeof Y!="function")return{default:Y};var $=y();if($&&$.has(Y))return $.get(Y);var z={},oe=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var _e in Y)if(Object.prototype.hasOwnProperty.call(Y,_e)){var X=oe?Object.getOwnPropertyDescriptor(Y,_e):null;X&&(X.get||X.set)?Object.defineProperty(z,_e,X):z[_e]=Y[_e]}return z.default=Y,$&&$.set(Y,z),z}var u=0,a=1,c=2,s=4;le.Z_FINISH=s;var l=5;le.Z_BLOCK=l;var r=6;le.Z_TREES=r;var n=0;le.Z_OK=n;var o=1;le.Z_STREAM_END=o;var i=2;le.Z_NEED_DICT=i;var f=-2;le.Z_STREAM_ERROR=f;var h=-3;le.Z_DATA_ERROR=h;var T=-4;le.Z_MEM_ERROR=T;var g=-5;le.Z_BUF_ERROR=g;var w=8;le.Z_DEFLATED=w;var C=1,x=2,b=3,S=4,A=5,p=6,I=7,M=8,P=9,B=10,H=11,F=12,W=13,U=14,K=15,G=16,ae=17,fe=18,Se=19,Ue=20,Ne=21,xe=22,Ce=23,De=24,ve=25,Re=26,ee=27,ge=28,se=29,Fe=30,je=31,Ke=32,ze=852,Ge=592,He=15,Ie=He;function ke(Y){return(Y>>>24&255)+(Y>>>8&65280)+((Y&65280)<<8)+((Y&255)<<24)}function Ae(){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 k.Buf16(320),this.work=new k.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function Te(Y){var $;return!Y||!Y.state?f:($=Y.state,Y.total_in=Y.total_out=$.total=0,Y.msg="",$.wrap&&(Y.adler=$.wrap&1),$.mode=C,$.last=0,$.havedict=0,$.dmax=32768,$.head=null,$.hold=0,$.bits=0,$.lencode=$.lendyn=new k.Buf32(ze),$.distcode=$.distdyn=new k.Buf32(Ge),$.sane=1,$.back=-1,n)}function Z(Y){var $;return!Y||!Y.state?f:($=Y.state,$.wsize=0,$.whave=0,$.wnext=0,Te(Y))}function ce(Y,$){var z,oe;return!Y||!Y.state?f:(oe=Y.state,$<0?(z=0,$=-$):(z=($>>4)+1,$<48&&($&=15)),$&&($<8||$>15)?f:(oe.window!==null&&oe.wbits!==$&&(oe.window=null),oe.wrap=z,oe.wbits=$,Z(Y)))}function J(Y,$){var z,oe;return Y?(oe=new Ae,Y.state=oe,oe.window=null,z=ce(Y,$),z!==n&&(Y.state=null),z):f}function Le(Y){return J(Y,Ie)}var We=!0,Ve,Me;function et(Y){if(We){var $;for(Ve=new k.Buf32(512),Me=new k.Buf32(32),$=0;$<144;)Y.lens[$++]=8;for(;$<256;)Y.lens[$++]=9;for(;$<280;)Y.lens[$++]=7;for(;$<288;)Y.lens[$++]=8;for((0,d.default)(a,Y.lens,0,288,Ve,0,Y.work,{bits:9}),$=0;$<32;)Y.lens[$++]=5;(0,d.default)(c,Y.lens,0,32,Me,0,Y.work,{bits:5}),We=!1}Y.lencode=Ve,Y.lenbits=9,Y.distcode=Me,Y.distbits=5}function ne(Y,$,z,oe){var _e,X=Y.state;return X.window===null&&(X.wsize=1<<X.wbits,X.wnext=0,X.whave=0,X.window=new k.Buf8(X.wsize)),oe>=X.wsize?(k.arraySet(X.window,$,z-X.wsize,X.wsize,0),X.wnext=0,X.whave=X.wsize):(_e=X.wsize-X.wnext,_e>oe&&(_e=oe),k.arraySet(X.window,$,z-oe,_e,X.wnext),oe-=_e,oe?(k.arraySet(X.window,$,z-oe,oe,0),X.wnext=oe,X.whave=X.wsize):(X.wnext+=_e,X.wnext===X.wsize&&(X.wnext=0),X.whave<X.wsize&&(X.whave+=_e))),0}function Ee(Y,$){var z,oe,_e,X,de,ye,ie,pe,Pe,$e,Ye,qe,st,mt,ct=0,it,yt,Et,St,Kt,Bt,Pt,Ot,It=new k.Buf8(4),or,Lt,dt=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!Y||!Y.state||!Y.output||!Y.input&&Y.avail_in!==0)return f;z=Y.state,z.mode===F&&(z.mode=W),de=Y.next_out,_e=Y.output,ie=Y.avail_out,X=Y.next_in,oe=Y.input,ye=Y.avail_in,pe=z.hold,Pe=z.bits,$e=ye,Ye=ie,Ot=n;e:for(;;)switch(z.mode){case C:if(z.wrap===0){z.mode=W;break}for(;Pe<16;){if(ye===0)break e;ye--,pe+=oe[X++]<<Pe,Pe+=8}if(z.wrap&2&&pe===35615){z.check=0,It[0]=pe&255,It[1]=pe>>>8&255,z.check=(0,R.default)(z.check,It,2,0),pe=0,Pe=0,z.mode=x;break}if(z.flags=0,z.head&&(z.head.done=!1),!(z.wrap&1)||(((pe&255)<<8)+(pe>>8))%31){Y.msg="incorrect header check",z.mode=Fe;break}if((pe&15)!==w){Y.msg="unknown compression method",z.mode=Fe;break}if(pe>>>=4,Pe-=4,Pt=(pe&15)+8,z.wbits===0)z.wbits=Pt;else if(Pt>z.wbits){Y.msg="invalid window size",z.mode=Fe;break}z.dmax=1<<Pt,Y.adler=z.check=1,z.mode=pe&512?B:F,pe=0,Pe=0;break;case x:for(;Pe<16;){if(ye===0)break e;ye--,pe+=oe[X++]<<Pe,Pe+=8}if(z.flags=pe,(z.flags&255)!==w){Y.msg="unknown compression method",z.mode=Fe;break}if(z.flags&57344){Y.msg="unknown header flags set",z.mode=Fe;break}z.head&&(z.head.text=pe>>8&1),z.flags&512&&(It[0]=pe&255,It[1]=pe>>>8&255,z.check=(0,R.default)(z.check,It,2,0)),pe=0,Pe=0,z.mode=b;case b:for(;Pe<32;){if(ye===0)break e;ye--,pe+=oe[X++]<<Pe,Pe+=8}z.head&&(z.head.time=pe),z.flags&512&&(It[0]=pe&255,It[1]=pe>>>8&255,It[2]=pe>>>16&255,It[3]=pe>>>24&255,z.check=(0,R.default)(z.check,It,4,0)),pe=0,Pe=0,z.mode=S;case S:for(;Pe<16;){if(ye===0)break e;ye--,pe+=oe[X++]<<Pe,Pe+=8}z.head&&(z.head.xflags=pe&255,z.head.os=pe>>8),z.flags&512&&(It[0]=pe&255,It[1]=pe>>>8&255,z.check=(0,R.default)(z.check,It,2,0)),pe=0,Pe=0,z.mode=A;case A:if(z.flags&1024){for(;Pe<16;){if(ye===0)break e;ye--,pe+=oe[X++]<<Pe,Pe+=8}z.length=pe,z.head&&(z.head.extra_len=pe),z.flags&512&&(It[0]=pe&255,It[1]=pe>>>8&255,z.check=(0,R.default)(z.check,It,2,0)),pe=0,Pe=0}else z.head&&(z.head.extra=null);z.mode=p;case p:if(z.flags&1024&&(qe=z.length,qe>ye&&(qe=ye),qe&&(z.head&&(Pt=z.head.extra_len-z.length,z.head.extra||(z.head.extra=new Array(z.head.extra_len)),k.arraySet(z.head.extra,oe,X,qe,Pt)),z.flags&512&&(z.check=(0,R.default)(z.check,oe,qe,X)),ye-=qe,X+=qe,z.length-=qe),z.length))break e;z.length=0,z.mode=I;case I:if(z.flags&2048){if(ye===0)break e;qe=0;do Pt=oe[X+qe++],z.head&&Pt&&z.length<65536&&(z.head.name+=String.fromCharCode(Pt));while(Pt&&qe<ye);if(z.flags&512&&(z.check=(0,R.default)(z.check,oe,qe,X)),ye-=qe,X+=qe,Pt)break e}else z.head&&(z.head.name=null);z.length=0,z.mode=M;case M:if(z.flags&4096){if(ye===0)break e;qe=0;do Pt=oe[X+qe++],z.head&&Pt&&z.length<65536&&(z.head.comment+=String.fromCharCode(Pt));while(Pt&&qe<ye);if(z.flags&512&&(z.check=(0,R.default)(z.check,oe,qe,X)),ye-=qe,X+=qe,Pt)break e}else z.head&&(z.head.comment=null);z.mode=P;case P:if(z.flags&512){for(;Pe<16;){if(ye===0)break e;ye--,pe+=oe[X++]<<Pe,Pe+=8}if(pe!==(z.check&65535)){Y.msg="header crc mismatch",z.mode=Fe;break}pe=0,Pe=0}z.head&&(z.head.hcrc=z.flags>>9&1,z.head.done=!0),Y.adler=z.check=0,z.mode=F;break;case B:for(;Pe<32;){if(ye===0)break e;ye--,pe+=oe[X++]<<Pe,Pe+=8}Y.adler=z.check=ke(pe),pe=0,Pe=0,z.mode=H;case H:if(z.havedict===0)return Y.next_out=de,Y.avail_out=ie,Y.next_in=X,Y.avail_in=ye,z.hold=pe,z.bits=Pe,i;Y.adler=z.check=1,z.mode=F;case F:if($===l||$===r)break e;case W:if(z.last){pe>>>=Pe&7,Pe-=Pe&7,z.mode=ee;break}for(;Pe<3;){if(ye===0)break e;ye--,pe+=oe[X++]<<Pe,Pe+=8}z.last=pe&1,pe>>>=1,Pe-=1;switch(pe&3){case 0:z.mode=U;break;case 1:if(et(z),z.mode=Ue,$===r){pe>>>=2,Pe-=2;break e}break;case 2:z.mode=ae;break;case 3:Y.msg="invalid block type",z.mode=Fe}pe>>>=2,Pe-=2;break;case U:for(pe>>>=Pe&7,Pe-=Pe&7;Pe<32;){if(ye===0)break e;ye--,pe+=oe[X++]<<Pe,Pe+=8}if((pe&65535)!==(pe>>>16^65535)){Y.msg="invalid stored block lengths",z.mode=Fe;break}if(z.length=pe&65535,pe=0,Pe=0,z.mode=K,$===r)break e;case K:z.mode=G;case G:if(qe=z.length,qe){if(qe>ye&&(qe=ye),qe>ie&&(qe=ie),qe===0)break e;k.arraySet(_e,oe,X,qe,de),ye-=qe,X+=qe,ie-=qe,de+=qe,z.length-=qe;break}z.mode=F;break;case ae:for(;Pe<14;){if(ye===0)break e;ye--,pe+=oe[X++]<<Pe,Pe+=8}if(z.nlen=(pe&31)+257,pe>>>=5,Pe-=5,z.ndist=(pe&31)+1,pe>>>=5,Pe-=5,z.ncode=(pe&15)+4,pe>>>=4,Pe-=4,z.nlen>286||z.ndist>30){Y.msg="too many length or distance symbols",z.mode=Fe;break}z.have=0,z.mode=fe;case fe:for(;z.have<z.ncode;){for(;Pe<3;){if(ye===0)break e;ye--,pe+=oe[X++]<<Pe,Pe+=8}z.lens[dt[z.have++]]=pe&7,pe>>>=3,Pe-=3}for(;z.have<19;)z.lens[dt[z.have++]]=0;if(z.lencode=z.lendyn,z.lenbits=7,or={bits:z.lenbits},Ot=(0,d.default)(u,z.lens,0,19,z.lencode,0,z.work,or),z.lenbits=or.bits,Ot){Y.msg="invalid code lengths set",z.mode=Fe;break}z.have=0,z.mode=Se;case Se:for(;z.have<z.nlen+z.ndist;){for(;!(ct=z.lencode[pe&(1<<z.lenbits)-1],it=ct>>>24,yt=ct>>>16&255,Et=ct&65535,it<=Pe);){if(ye===0)break e;ye--,pe+=oe[X++]<<Pe,Pe+=8}if(Et<16)pe>>>=it,Pe-=it,z.lens[z.have++]=Et;else{if(Et===16){for(Lt=it+2;Pe<Lt;){if(ye===0)break e;ye--,pe+=oe[X++]<<Pe,Pe+=8}if(pe>>>=it,Pe-=it,z.have===0){Y.msg="invalid bit length repeat",z.mode=Fe;break}Pt=z.lens[z.have-1],qe=3+(pe&3),pe>>>=2,Pe-=2}else if(Et===17){for(Lt=it+3;Pe<Lt;){if(ye===0)break e;ye--,pe+=oe[X++]<<Pe,Pe+=8}pe>>>=it,Pe-=it,Pt=0,qe=3+(pe&7),pe>>>=3,Pe-=3}else{for(Lt=it+7;Pe<Lt;){if(ye===0)break e;ye--,pe+=oe[X++]<<Pe,Pe+=8}pe>>>=it,Pe-=it,Pt=0,qe=11+(pe&127),pe>>>=7,Pe-=7}if(z.have+qe>z.nlen+z.ndist){Y.msg="invalid bit length repeat",z.mode=Fe;break}for(;qe--;)z.lens[z.have++]=Pt}}if(z.mode===Fe)break;if(z.lens[256]===0){Y.msg="invalid code -- missing end-of-block",z.mode=Fe;break}if(z.lenbits=9,or={bits:z.lenbits},Ot=(0,d.default)(a,z.lens,0,z.nlen,z.lencode,0,z.work,or),z.lenbits=or.bits,Ot){Y.msg="invalid literal/lengths set",z.mode=Fe;break}if(z.distbits=6,z.distcode=z.distdyn,or={bits:z.distbits},Ot=(0,d.default)(c,z.lens,z.nlen,z.ndist,z.distcode,0,z.work,or),z.distbits=or.bits,Ot){Y.msg="invalid distances set",z.mode=Fe;break}if(z.mode=Ue,$===r)break e;case Ue:z.mode=Ne;case Ne:if(ye>=6&&ie>=258){Y.next_out=de,Y.avail_out=ie,Y.next_in=X,Y.avail_in=ye,z.hold=pe,z.bits=Pe,(0,O.default)(Y,Ye),de=Y.next_out,_e=Y.output,ie=Y.avail_out,X=Y.next_in,oe=Y.input,ye=Y.avail_in,pe=z.hold,Pe=z.bits,z.mode===F&&(z.back=-1);break}for(z.back=0;!(ct=z.lencode[pe&(1<<z.lenbits)-1],it=ct>>>24,yt=ct>>>16&255,Et=ct&65535,it<=Pe);){if(ye===0)break e;ye--,pe+=oe[X++]<<Pe,Pe+=8}if(yt&&(yt&240)===0){for(St=it,Kt=yt,Bt=Et;!(ct=z.lencode[Bt+((pe&(1<<St+Kt)-1)>>St)],it=ct>>>24,yt=ct>>>16&255,Et=ct&65535,St+it<=Pe);){if(ye===0)break e;ye--,pe+=oe[X++]<<Pe,Pe+=8}pe>>>=St,Pe-=St,z.back+=St}if(pe>>>=it,Pe-=it,z.back+=it,z.length=Et,yt===0){z.mode=Re;break}if(yt&32){z.back=-1,z.mode=F;break}if(yt&64){Y.msg="invalid literal/length code",z.mode=Fe;break}z.extra=yt&15,z.mode=xe;case xe:if(z.extra){for(Lt=z.extra;Pe<Lt;){if(ye===0)break e;ye--,pe+=oe[X++]<<Pe,Pe+=8}z.length+=pe&(1<<z.extra)-1,pe>>>=z.extra,Pe-=z.extra,z.back+=z.extra}z.was=z.length,z.mode=Ce;case Ce:for(;!(ct=z.distcode[pe&(1<<z.distbits)-1],it=ct>>>24,yt=ct>>>16&255,Et=ct&65535,it<=Pe);){if(ye===0)break e;ye--,pe+=oe[X++]<<Pe,Pe+=8}if((yt&240)===0){for(St=it,Kt=yt,Bt=Et;!(ct=z.distcode[Bt+((pe&(1<<St+Kt)-1)>>St)],it=ct>>>24,yt=ct>>>16&255,Et=ct&65535,St+it<=Pe);){if(ye===0)break e;ye--,pe+=oe[X++]<<Pe,Pe+=8}pe>>>=St,Pe-=St,z.back+=St}if(pe>>>=it,Pe-=it,z.back+=it,yt&64){Y.msg="invalid distance code",z.mode=Fe;break}z.offset=Et,z.extra=yt&15,z.mode=De;case De:if(z.extra){for(Lt=z.extra;Pe<Lt;){if(ye===0)break e;ye--,pe+=oe[X++]<<Pe,Pe+=8}z.offset+=pe&(1<<z.extra)-1,pe>>>=z.extra,Pe-=z.extra,z.back+=z.extra}if(z.offset>z.dmax){Y.msg="invalid distance too far back",z.mode=Fe;break}z.mode=ve;case ve:if(ie===0)break e;if(qe=Ye-ie,z.offset>qe){if(qe=z.offset-qe,qe>z.whave&&z.sane){Y.msg="invalid distance too far back",z.mode=Fe;break}qe>z.wnext?(qe-=z.wnext,st=z.wsize-qe):st=z.wnext-qe,qe>z.length&&(qe=z.length),mt=z.window}else mt=_e,st=de-z.offset,qe=z.length;qe>ie&&(qe=ie),ie-=qe,z.length-=qe;do _e[de++]=mt[st++];while(--qe);z.length===0&&(z.mode=Ne);break;case Re:if(ie===0)break e;_e[de++]=z.length,ie--,z.mode=Ne;break;case ee:if(z.wrap){for(;Pe<32;){if(ye===0)break e;ye--,pe|=oe[X++]<<Pe,Pe+=8}if(Ye-=ie,Y.total_out+=Ye,z.total+=Ye,Ye&&(Y.adler=z.check=z.flags?(0,R.default)(z.check,_e,Ye,de-Ye):(0,D.default)(z.check,_e,Ye,de-Ye)),Ye=ie,(z.flags?pe:ke(pe))!==z.check){Y.msg="incorrect data check",z.mode=Fe;break}pe=0,Pe=0}z.mode=ge;case ge:if(z.wrap&&z.flags){for(;Pe<32;){if(ye===0)break e;ye--,pe+=oe[X++]<<Pe,Pe+=8}if(pe!==(z.total&4294967295)){Y.msg="incorrect length check",z.mode=Fe;break}pe=0,Pe=0}z.mode=se;case se:Ot=o;break e;case Fe:Ot=h;break e;case je:return T;case Ke:default:return f}return Y.next_out=de,Y.avail_out=ie,Y.next_in=X,Y.avail_in=ye,z.hold=pe,z.bits=Pe,(z.wsize||Ye!==Y.avail_out&&z.mode<Fe&&(z.mode<ee||$!==s))&&ne(Y,Y.output,Y.next_out,Ye-Y.avail_out)?(z.mode=je,T):($e-=Y.avail_in,Ye-=Y.avail_out,Y.total_in+=$e,Y.total_out+=Ye,z.total+=Ye,z.wrap&&Ye&&(Y.adler=z.check=z.flags?(0,R.default)(z.check,_e,Ye,Y.next_out-Ye):(0,D.default)(z.check,_e,Ye,Y.next_out-Ye)),Y.data_type=z.bits+(z.last?64:0)+(z.mode===F?128:0)+(z.mode===Ue||z.mode===K?256:0),($e===0&&Ye===0||$===s)&&Ot===n&&(Ot=g),Ot)}function Oe(Y){if(!Y||!Y.state)return f;var $=Y.state;return $.window&&($.window=null),Y.state=null,n}function me(Y,$){var z;return!Y||!Y.state?f:(z=Y.state,(z.wrap&2)===0?f:(z.head=$,$.done=!1,n))}function ue(Y,$){var z=$.length,oe,_e,X;return!Y||!Y.state?f:(oe=Y.state,oe.wrap!==0&&oe.mode!==H?f:oe.mode===H&&(_e=1,_e=(0,D.default)(_e,$,z,0),_e!==oe.check)?h:(X=ne(Y,$,z,z),X?(oe.mode=je,T):(oe.havedict=1,n)))}var he="pako inflate (from Nodeca project)";le.inflateInfo=he},gIYZ:function(Je,le,re){"use strict";Object.defineProperty(le,"__esModule",{value:!0}),le.default=void 0;var j={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"};le.default=j},h78n:function(Je,le,re){"use strict";re.d(le,"a",function(){return P});var j=re("cDcd"),k=re.n(j),D=re("TSYQ"),R=re.n(D),O={className:"",percent:0,prefixCls:"rc-progress",strokeColor:"#2db7f5",strokeLinecap:"round",strokeWidth:1,style:{},trailColor:"#D9D9D9",trailWidth:1},d=function(F){var W=F.map(function(){return Object(j.useRef)()}),U=Object(j.useRef)();return Object(j.useEffect)(function(){var K=Date.now(),G=!1;Object.keys(W).forEach(function(ae){var fe=W[ae].current;if(!fe)return;G=!0;var Se=fe.style;Se.transitionDuration=".3s, .3s, .3s, .06s",U.current&&K-U.current<100&&(Se.transitionDuration="0s, 0s")}),G&&(U.current=Date.now())}),[W]};function E(){return E=Object.assign||function(H){for(var F=1;F<arguments.length;F++){var W=arguments[F];for(var U in W)Object.prototype.hasOwnProperty.call(W,U)&&(H[U]=W[U])}return H},E.apply(this,arguments)}function y(H,F){return s(H)||c(H,F)||u(H,F)||v()}function v(){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 u(H,F){if(!H)return;if(typeof H=="string")return a(H,F);var W=Object.prototype.toString.call(H).slice(8,-1);if(W==="Object"&&H.constructor&&(W=H.constructor.name),W==="Map"||W==="Set")return Array.from(H);if(W==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(W))return a(H,F)}function a(H,F){(F==null||F>H.length)&&(F=H.length);for(var W=0,U=new Array(F);W<F;W++)U[W]=H[W];return U}function c(H,F){if(typeof Symbol=="undefined"||!(Symbol.iterator in Object(H)))return;var W=[],U=!0,K=!1,G=void 0;try{for(var ae=H[Symbol.iterator](),fe;!(U=(fe=ae.next()).done)&&!(W.push(fe.value),F&&W.length===F);U=!0);}catch(Se){K=!0,G=Se}finally{try{!U&&ae.return!=null&&ae.return()}finally{if(K)throw G}}return W}function s(H){if(Array.isArray(H))return H}function l(H,F){if(H==null)return{};var W=r(H,F),U,K;if(Object.getOwnPropertySymbols){var G=Object.getOwnPropertySymbols(H);for(K=0;K<G.length;K++){if(U=G[K],F.indexOf(U)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(H,U))continue;W[U]=H[U]}}return W}function r(H,F){if(H==null)return{};var W={},U=Object.keys(H),K,G;for(G=0;G<U.length;G++){if(K=U[G],F.indexOf(K)>=0)continue;W[K]=H[K]}return W}var n=function(F){var W=F.className,U=F.percent,K=F.prefixCls,G=F.strokeColor,ae=F.strokeLinecap,fe=F.strokeWidth,Se=F.style,Ue=F.trailColor,Ne=F.trailWidth,xe=F.transition,Ce=l(F,["className","percent","prefixCls","strokeColor","strokeLinecap","strokeWidth","style","trailColor","trailWidth","transition"]);delete Ce.gapPosition;var De=Array.isArray(U)?U:[U],ve=Array.isArray(G)?G:[G],Re=d(De),ee=y(Re,1),ge=ee[0],se=fe/2,Fe=100-fe/2,je="M ".concat(ae==="round"?se:0,",").concat(se,`
|
|
|
L `).concat(ae==="round"?Fe:100,",").concat(se),Ke="0 0 100 ".concat(fe),ze=0;return k.a.createElement("svg",E({className:R()("".concat(K,"-line"),W),viewBox:Ke,preserveAspectRatio:"none",style:Se},Ce),k.a.createElement("path",{className:"".concat(K,"-line-trail"),d:je,strokeLinecap:ae,stroke:Ue,strokeWidth:Ne||fe,fillOpacity:"0"}),De.map(function(Ge,He){var Ie={strokeDasharray:"".concat(Ge,"px, 100px"),strokeDashoffset:"-".concat(ze,"px"),transition:xe||"stroke-dashoffset 0.3s ease 0s, stroke-dasharray .3s ease 0s, stroke 0.3s linear"},ke=ve[He]||ve[ve.length-1];return ze+=Ge,k.a.createElement("path",{key:He,className:"".concat(K,"-line-path"),d:je,strokeLinecap:ae,stroke:ke,strokeWidth:fe,fillOpacity:"0",ref:ge[He],style:Ie})}))};n.defaultProps=O;var o=n;function i(){return i=Object.assign||function(H){for(var F=1;F<arguments.length;F++){var W=arguments[F];for(var U in W)Object.prototype.hasOwnProperty.call(W,U)&&(H[U]=W[U])}return H},i.apply(this,arguments)}function f(H,F){return C(H)||w(H,F)||T(H,F)||h()}function h(){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 T(H,F){if(!H)return;if(typeof H=="string")return g(H,F);var W=Object.prototype.toString.call(H).slice(8,-1);if(W==="Object"&&H.constructor&&(W=H.constructor.name),W==="Map"||W==="Set")return Array.from(H);if(W==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(W))return g(H,F)}function g(H,F){(F==null||F>H.length)&&(F=H.length);for(var W=0,U=new Array(F);W<F;W++)U[W]=H[W];return U}function w(H,F){if(typeof Symbol=="undefined"||!(Symbol.iterator in Object(H)))return;var W=[],U=!0,K=!1,G=void 0;try{for(var ae=H[Symbol.iterator](),fe;!(U=(fe=ae.next()).done)&&!(W.push(fe.value),F&&W.length===F);U=!0);}catch(Se){K=!0,G=Se}finally{try{!U&&ae.return!=null&&ae.return()}finally{if(K)throw G}}return W}function C(H){if(Array.isArray(H))return H}function x(H,F){if(H==null)return{};var W=b(H,F),U,K;if(Object.getOwnPropertySymbols){var G=Object.getOwnPropertySymbols(H);for(K=0;K<G.length;K++){if(U=G[K],F.indexOf(U)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(H,U))continue;W[U]=H[U]}}return W}function b(H,F){if(H==null)return{};var W={},U=Object.keys(H),K,G;for(G=0;G<U.length;G++){if(K=U[G],F.indexOf(K)>=0)continue;W[K]=H[K]}return W}var S=0;function A(H){return+H.replace("%","")}function p(H){return Array.isArray(H)?H:[H]}function I(H,F,W,U){var K=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0,G=arguments.length>5?arguments[5]:void 0,ae=50-U/2,fe=0,Se=-ae,Ue=0,Ne=-2*ae;switch(G){case"left":fe=-ae,Se=0,Ue=2*ae,Ne=0;break;case"right":fe=ae,Se=0,Ue=-2*ae,Ne=0;break;case"bottom":Se=ae,Ne=2*ae;break;default:}var xe="M 50,50 m ".concat(fe,",").concat(Se,`
|
|
|
a `).concat(ae,",").concat(ae," 0 1 1 ").concat(Ue,",").concat(-Ne,`
|
|
|
a `).concat(ae,",").concat(ae," 0 1 1 ").concat(-Ue,",").concat(Ne),Ce=Math.PI*2*ae,De={stroke:W,strokeDasharray:"".concat(F/100*(Ce-K),"px ").concat(Ce,"px"),strokeDashoffset:"-".concat(K/2+H/100*(Ce-K),"px"),transition:"stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s, stroke-width .06s ease .3s"};return{pathString:xe,pathStyle:De}}var M=function(F){var W=F.prefixCls,U=F.strokeWidth,K=F.trailWidth,G=F.gapDegree,ae=F.gapPosition,fe=F.trailColor,Se=F.strokeLinecap,Ue=F.style,Ne=F.className,xe=F.strokeColor,Ce=F.percent,De=x(F,["prefixCls","strokeWidth","trailWidth","gapDegree","gapPosition","trailColor","strokeLinecap","style","className","strokeColor","percent"]),ve=Object(j.useMemo)(function(){return S+=1,S},[]),Re=I(0,100,fe,U,G,ae),ee=Re.pathString,ge=Re.pathStyle,se=p(Ce),Fe=p(xe),je=Fe.find(function(Ie){return Object.prototype.toString.call(Ie)==="[object Object]"}),Ke=d(se),ze=f(Ke,1),Ge=ze[0],He=function(){var ke=0;return se.map(function(Ae,Te){var Z=Fe[Te]||Fe[Fe.length-1],ce=Object.prototype.toString.call(Z)==="[object Object]"?"url(#".concat(W,"-gradient-").concat(ve,")"):"",J=I(ke,Ae,Z,U,G,ae);return ke+=Ae,k.a.createElement("path",{key:Te,className:"".concat(W,"-circle-path"),d:J.pathString,stroke:ce,strokeLinecap:Se,strokeWidth:U,opacity:Ae===0?0:1,fillOpacity:"0",style:J.pathStyle,ref:Ge[Te]})})};return k.a.createElement("svg",i({className:R()("".concat(W,"-circle"),Ne),viewBox:"0 0 100 100",style:Ue},De),je&&k.a.createElement("defs",null,k.a.createElement("linearGradient",{id:"".concat(W,"-gradient-").concat(ve),x1:"100%",y1:"0%",x2:"0%",y2:"0%"},Object.keys(je).sort(function(Ie,ke){return A(Ie)-A(ke)}).map(function(Ie,ke){return k.a.createElement("stop",{key:ke,offset:Ie,stopColor:je[Ie]})}))),k.a.createElement("path",{className:"".concat(W,"-circle-trail"),d:ee,stroke:fe,strokeLinecap:Se,strokeWidth:K||U,fillOpacity:"0",style:ge}),He().reverse())};M.defaultProps=O;var P=M,B={Line:o,Circle:P}},hXwI:function(Je,le,re){"use strict";Object.defineProperty(le,"__esModule",{value:!0}),le.default=void 0;function j(O,d){if(!(O instanceof d))throw new TypeError("Cannot call a class as a function")}function k(O,d){for(var E=0;E<d.length;E++){var y=d[E];y.enumerable=y.enumerable||!1,y.configurable=!0,"value"in y&&(y.writable=!0),Object.defineProperty(O,y.key,y)}}function D(O,d,E){return d&&k(O.prototype,d),E&&k(O,E),O}var R=function(){function O(){j(this,O)}return D(O,[{key:"decodeRect",value:function(E,y,v,u,a,c,s){if(a.rQwait("COPYRECT",4))return!1;var l=a.rQshift16(),r=a.rQshift16();return c.copyImage(l,r,E,y,v,u),!0}}]),O}();le.default=R},iJb0:function(Je,le,re){"use strict";re.r(le);var j=re("+L6B"),k=re("2/Rp"),D=re("miYZ"),R=re("tsqr"),O=re("14J3"),d=re("BMrR"),E=re("jCWc"),y=re("kPKH"),v=re("k1fw"),u=re("9og8"),a=re("2qtc"),c=re("kLXV"),s=re("tJVT"),l=re("PpiC"),r=re("aHsQ"),n=re("sGsY"),o=re("WmNS"),i=re.n(o),f=re("cDcd"),h=re.n(f),T=re("9kvl"),g=re("Lmeb"),w=re("Ot1p"),C=re("Dqnf"),x=re("dhSg"),b=re("MXD1"),S=re("CFYs"),A=re("rAM+"),p=re("IxHN"),I=re("bdgK"),M=re("M8RZ"),P=re("Ty5D"),B=re("1dTM"),H=re.n(B),F=re("HBuW"),W=re("VaU+"),U=re.n(W),K=re("ye1Q"),G=h.a.createElement(K.a,{style:{fontSize:24},spin:!0});function ae(ee){return ee.replace(/\\u([\dA-Za-z]{4})/g,function(ge,se){return String.fromCharCode(parseInt("0x"+se))})}function fe(ee){ee||(ee=window.location.search);var ge=ee.substr(1),se={};return ge.split("&").forEach(function(Fe){var je=Fe.split("=");se[je[0]]=decodeURIComponent(je[1])}),se}var Se={loading:!0,isLarge:!1,showClipBoardBox:!1,transferContent:"",mes:"\u5B9E\u9A8C\u73AF\u5883\u51C6\u5907\u4E2D"},Ue;(function(ee){ee[ee.SET_LOADING=0]="SET_LOADING",ee[ee.SET_IS_LARGE=1]="SET_IS_LARGE",ee[ee.SET_MES=2]="SET_MES",ee[ee.SET_STATE=3]="SET_STATE",ee[ee.SHOW_CLIPBOARD_BOX=4]="SHOW_CLIPBOARD_BOX",ee[ee.SET_TRANSFER_CONTENT=5]="SET_TRANSFER_CONTENT"})(Ue||(Ue={}));function Ne(ee,ge){switch(ge.type){case Ue.SET_LOADING:return Object(v.a)(Object(v.a)({},ee),{},{loading:ge.payload});case Ue.SET_IS_LARGE:return Object(v.a)(Object(v.a)({},ee),{},{isLarge:ge.payload});case Ue.SET_MES:return Object(v.a)(Object(v.a)({},ee),{},{mes:ge.payload});case Ue.SET_STATE:return Object(v.a)(Object(v.a)({},ee),ge.payload);case Ue.SET_TRANSFER_CONTENT:return Object(v.a)(Object(v.a)({},ee),{},{transferContent:ge.payload});case Ue.SHOW_CLIPBOARD_BOX:return Object(v.a)(Object(v.a)({},ee),{},{showClipBoardBox:ge.payload});default:throw new Error}}var xe=function(ee){var ge=ee.vnc_url,se=ee.window_vnc_url,Fe=ee.taskId,je=Object(f.useRef)(),Ke=Object(f.useRef)(),ze=Object(f.useReducer)(Ne,Se),Ge=Object(s.a)(ze,2),He=Ge[0],Ie=Ge[1],ke=Object(f.useState)(0),Ae=Object(s.a)(ke,2),Te=Ae[0],Z=Ae[1],ce=He.mes,J=He.loading,Le=He.showClipBoardBox,We=He.isLarge,Ve=He.transferContent,Me=Object(f.useState)(0),et=Object(s.a)(Me,2),ne=et[0],Ee=et[1],Oe,me=Object(f.useRef)(),ue=Object(P.i)();function he(){Ie({type:Ue.SHOW_CLIPBOARD_BOX,payload:!1})}function Y(){Ie({type:Ue.SET_IS_LARGE,payload:!We})}function $(X){var de;return je.current&&(de=new I.default(function(ye){var ie=Object(A.a)(ye),pe;try{for(ie.s();!(pe=ie.n()).done;){var Pe=pe.value;(Pe.target.offsetHeight>0||Pe.target.offsetWidth>0)&&X._eventHandlers.windowResize()}}catch($e){ie.e($e)}finally{ie.f()}}),de.observe(je.current)),de}var z=function(){var X=Object(u.a)(i.a.mark(function de(){var ye;return i.a.wrap(function(pe){for(;;)switch(pe.prev=pe.next){case 0:return pe.next=2,Object(F.sb)(Object(v.a)({},ue));case 2:if(ye=pe.sent,!((ye==null?void 0:ye.status)===-3)){pe.next=5;break}return pe.abrupt("return",new Promise(function(){var Pe=Object(u.a)(i.a.mark(function $e(Ye,qe){return i.a.wrap(function(mt){for(;;)switch(mt.prev=mt.next){case 0:c.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 ct=Object(u.a)(i.a.mark(function yt(){return i.a.wrap(function(St){for(;;)switch(St.prev=St.next){case 0:return clearTimeout(Oe),Ee(0),z(),St.abrupt("return");case 4:case"end":return St.stop()}},yt)}));function it(){return ct.apply(this,arguments)}return it}()});case 1:case"end":return mt.stop()}},$e)}));return function($e,Ye){return Pe.apply(this,arguments)}}()));case 5:if(!((ye==null?void 0:ye.status)===-1)){pe.next=7;break}throw new String(ye==null?void 0:ye.message);case 7:return x.a.publish("update-windows-time",ye==null?void 0:ye.data),pe.abrupt("return",ye);case 9:case"end":return pe.stop()}},de)}));return function(){return X.apply(this,arguments)}}();Object(f.useEffect)(function(){return me.current=setTimeout(function(){c.a.confirm({title:h.a.createElement(h.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(){x.a.publish("delayed-time",1),Z(Te+1)}})},1e3*60*60),function(){clearTimeout(me.current)}},[]),Object(f.useEffect)(function(){var X,de;function ye(qe){se&&(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"),Ie({type:Ue.SET_LOADING,payload:!0}),Z(Te+1))}function ie(){clearTimeout(Oe),Ee(100),setTimeout(function(){Ie({type:Ue.SET_LOADING,payload:!1})},1300),x.a.subscribe("send-ctrl-alt-delete",function(){var qe;(qe=X)===null||qe===void 0||qe.sendCtrlAltDel()})}function pe(qe){var st=ae(qe.detail.text);Ie({type:Ue.SET_TRANSFER_CONTENT,payload:st})}if((se||ge)&&je.current){new Promise(Object(u.a)(i.a.mark(function qe(){var st,mt,ct,it,yt,Et,St,Kt,Bt,Pt;return i.a.wrap(function(It){for(;;)switch(It.prev=It.next){case 0:return st=fe(),mt="",It.next=4,z();case 4:it=It.sent,se?(ct="Edu123",mt=decodeURIComponent(it==null||((yt=it.data)===null||yt===void 0)?void 0:yt.vnc_url)):(St=new URL(it==null||((Et=it.data)===null||Et===void 0)?void 0:Et.vnc_url),Kt=St.protocol,Bt=St.searchParams,Pt=St.host,ct=Bt.get("password"),mt="".concat(Kt==="https:"?"wss":"ws","://").concat(Pt,"/").concat(st.path||"websockify")),X=new H.a(je.current,mt,{credentials:{password:ct},wsProtocols:["binary"]}),de=$(X),X.viewOnly=st.view_only||!1,se?X.scaleViewport=!0:X.scaleViewport=st.scale||!1,X.scaleViewport=st.scale||!0,X.resizeSession=!0,Ke.current=X,X.addEventListener("disconnect",ye),X.addEventListener("connect",ie),X.addEventListener("clipboard",pe);case 16:case"end":return It.stop()}},qe)})));var Pe=x.a.subscribe("vnc-reseting",function(){Ie({type:Ue.SET_STATE,payload:{loading:!0,mes:"\u5B9E\u9A8C\u73AF\u5883\u91CD\u7F6E\u4E2D"}})}),$e=x.a.subscribe("vnc-enlarge",function(){Ie({type:Ue.SET_IS_LARGE,payload:!0})}),Ye=x.a.subscribe("show-clipboard-box",function(){Ie({type:Ue.SHOW_CLIPBOARD_BOX,payload:!0})});return Ee(0),function(){var qe,st,mt,ct;(qe=X)===null||qe===void 0||qe.removeEventListener("disconnect",ye),(st=X)===null||st===void 0||st.removeEventListener("connect",ie),(mt=X)===null||mt===void 0||mt.removeEventListener("clipboard",pe),Pe(),$e(),Ye(),(ct=de)===null||ct===void 0||ct.unobserve(je.current)}}},[ge,se,Te]);function oe(X){var de;(de=Ke.current)===null||de===void 0||de.clipboardPasteFrom(X),Ie({type:Ue.SET_TRANSFER_CONTENT,payload:X}),R.b.success("\u4FDD\u5B58\u6210\u529F\uFF01\u4F60\u53EF\u4EE5\u5728\u5B9E\u9A8C\u73AF\u5883\u4E2D\u7C98\u8D34\u8BE5\u5185\u5BB9"),he()}Object(f.useEffect)(function(){ne==0&&_e()},[ne]);var _e=function X(){ne>99?ne=99:(ne=ne+1,Oe=setTimeout(function(){X()},1500)),ne<100&&Ee(ne)};return h.a.createElement(f.Fragment,null,h.a.createElement("div",{style:{backgroundColor:"#000"},className:"".concat(se?"vnc-panel-wrapper-windows":"vnc-panel-wrapper"," ").concat(We?"full-screen":"")},h.a.createElement("a",{className:"btn-vnc-resize",onClick:Y},h.a.createElement("i",{className:"iconfont ".concat(We?"icon-tuichuquanping1":"icon-quanping1")})),J?h.a.createElement(p.a,{className:U.a.spin,message:ce,style:{color:"#0152d9"}},h.a.createElement("div",{className:"tc",style:{width:500,margin:"0 auto",color:"#FFF"}},h.a.createElement(S.a,{percent:ne,format:function(de){return h.a.createElement("span",{className:"c-white"},de,"%")}}))):null,h.a.createElement("div",{ref:je,className:"vnc-panel ".concat(J?"hide":"animated fadeIn")})),h.a.createElement(M.a,null))},Ce=re("m3rI"),De=n.a.Countdown,ve=function(ge){var se,Fe,je=ge.shixunsDetail,Ke=ge.globalSetting,ze=ge.loading,Ge=ge.dispatch,He=ge.user,Ie=ge.history,ke=Object(l.a)(ge,["shixunsDetail","globalSetting","loading","dispatch","user","history"]),Ae=Object(f.useState)({}),Te=Object(s.a)(Ae,2),Z=Te[0],ce=Te[1],J=Object(f.useState)(400),Le=Object(s.a)(J,2),We=Le[0],Ve=Le[1],Me=Object(f.useState)(!1),et=Object(s.a)(Me,2),ne=et[0],Ee=et[1],Oe=Object(f.useState)(""),me=Object(s.a)(Oe,2),ue=me[0],he=me[1],Y=Object(f.useState)(Date.now()+1e3*60*60),$=Object(s.a)(Y,2),z=$[0],oe=$[1],_e=ke.match.params,X=ke.location.query,de=Object(f.useState)(!1),ye=Object(s.a)(de,2),ie=ye[0],pe=ye[1],Pe=je.mirrorApplies,$e=Object(f.useRef)();Object(f.useEffect)(function(){return Ge({type:"globalSetting/headerFooterToggle",payload:!1}),qe(),st(),window.addEventListener("resize",qe),x.a.subscribe("delayed-time",function(){oe(Date.now()+1e3*60*60)}),function(){window.removeEventListener("resize",qe),clearTimeout($e.current),Ge({type:"globalSetting/headerFooterToggle",payload:!0})}},[]),Object(f.useEffect)(function(){Z.host&&setTimeout(function(){x.a.publish("create-socket",1)},1500)},[Z]),Object(f.useEffect)(function(){Pe.webssh&&(Ye(),$e.current=setTimeout(function(){c.a.confirm({title:h.a.createElement(h.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(){x.a.publish("ssh-add-connect-time",{}),x.a.publish("delayed-time",1)}})},1e3*60*60)),Pe.id&&qe()},[Pe]);var Ye=function(){var mt=Object(u.a)(i.a.mark(function ct(){var it;return i.a.wrap(function(Et){for(;;)switch(Et.prev=Et.next){case 0:return Et.next=2,Object(F.tb)(Object(v.a)({},_e));case 2:it=Et.sent,ce(Object(v.a)({},it));case 4:case"end":return Et.stop()}},ct)}));return function(){return mt.apply(this,arguments)}}(),qe=function(){var ct=window.innerHeight;Ve(ct-(Pe.audit_remark?400:270))},st=function(){var mt=Object(u.a)(i.a.mark(function ct(){return i.a.wrap(function(yt){for(;;)switch(yt.prev=yt.next){case 0:Ge({type:"shixunsDetail/getMirrorApplies",payload:Object(v.a)({},_e)});case 1:case"end":return yt.stop()}},ct)}));return function(){return mt.apply(this,arguments)}}();return console.log(He==null?void 0:He.userInfo),h.a.createElement("section",{className:U.a.wrp},h.a.createElement("header",{className:U.a.header},h.a.createElement(d.a,{align:"middle"},h.a.createElement(y.a,{flex:"1"},h.a.createElement("img",{alt:"\u7528\u6237\u5934\u50CF",height:"40",src:"".concat(Ce.a.IMG_SERVER,"/images/").concat(He==null||((se=He.userInfo)===null||se===void 0)?void 0:se.image_url),width:"40",style:{borderRadius:"50%"}}),h.a.createElement("span",{className:"ml10"},He==null||((Fe=He.userInfo)===null||Fe===void 0)?void 0:Fe.real_name)),h.a.createElement(y.a,{flex:"1"},h.a.createElement("span",{className:"mr10 font18"},Pe.name)),h.a.createElement(y.a,null,h.a.createElement("span",null,"\u5269\u4F59\u65F6\u957F:",h.a.createElement(De,{className:U.a.cuttDown,value:z,format:"mm:ss",valueStyle:{color:"#FFF"}})),h.a.createElement("span",{className:"icon-kaiguan font20 current ml60",onClick:function(){c.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 it;Ie.push("/users/".concat((it=He.userInfo)===null||it===void 0?void 0:it.login,"/experiment-img"))}})}})))),h.a.createElement("aside",{className:U.a.container},h.a.createElement(d.a,null,h.a.createElement(y.a,{style:{position:"relative",width:ie?"0%":"40%"}},h.a.createElement("section",{className:"".concat(U.a.info," ml40 mr40"),style:{display:ie?"none":"flex"}},h.a.createElement("aside",null,h.a.createElement(d.a,{align:"middle",style:{height:68,borderBottom:"1px solid #f1f1f1"}},h.a.createElement(y.a,{className:"font18"},"\u5B9E\u9A8C\u73AF\u5883\u8BF4\u660E ",h.a.createElement("span",{className:"font16 ml20 c-grey-999"},"\u8BF7\u6309\u6A21\u677F\u586B\u5199\u5B9E\u9A8C\u73AF\u5883\u8BF4\u660E"))),h.a.createElement("aside",{className:"mt30 flex1"},h.a.createElement(w.a,{height:We,defaultValue:Pe.description||"",onChange:function(ct){return he(ct)}}),Pe.audit_remark&&h.a.createElement("aside",{className:"mt10 font16 c-grey-999 mb10"},"\u5BA1\u6838\u4E0D\u901A\u8FC7\u539F\u56E0\uFF1A",h.a.createElement("span",{className:"c-red"},Pe.audit_remark))),h.a.createElement("aside",{className:"mb20"},h.a.createElement(d.a,{justify:"center",gutter:[20,20],className:U.a.buttons},h.a.createElement(y.a,null,h.a.createElement(k.a,{type:"primary",size:"large",loading:ne,onClick:Object(u.a)(i.a.mark(function mt(){var ct;return i.a.wrap(function(yt){for(;;)switch(yt.prev=yt.next){case 0:return Ee(!0),c.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(){}}),yt.next=4,Object(F.vb)(Object(v.a)(Object(v.a)({},_e),{},{description:ue}));case 4:ct=yt.sent,(ct==null?void 0:ct.status)===0&&R.b.success("\u4FDD\u5B58\u6210\u529F"),Ee(!1);case 7:case"end":return yt.stop()}},mt)}))},"\u4FDD\u5B58")),h.a.createElement(y.a,null,h.a.createElement(k.a,{type:"primary",ghost:!0,size:"large",onClick:Object(u.a)(i.a.mark(function mt(){return i.a.wrap(function(it){for(;;)switch(it.prev=it.next){case 0:c.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 yt=Object(u.a)(i.a.mark(function St(){var Kt,Bt;return i.a.wrap(function(Ot){for(;;)switch(Ot.prev=Ot.next){case 0:return Ot.next=2,Object(F.ub)(Object(v.a)(Object(v.a)({},_e),{},{description:ue}));case 2:Kt=Ot.sent,(Kt==null?void 0:Kt.status)===0&&(Ie.push("/users/".concat((Bt=He.userInfo)===null||Bt===void 0?void 0:Bt.login,"/experiment-img")),R.b.success("\u7533\u8BF7\u53D1\u5E03\u6210\u529F"));case 4:case"end":return Ot.stop()}},St)}));function Et(){return yt.apply(this,arguments)}return Et}()});case 1:case"end":return it.stop()}},mt)}))},"\u7533\u8BF7\u53D1\u5E03")))))),h.a.createElement("div",{className:ie?U.a.elseShrink:U.a.shrink,onClick:function(){return pe(!ie)}},h.a.createElement("i",{className:"iconfont icon-cela"}))),h.a.createElement(y.a,{style:{background:"#000",width:ie?"100%":"60%"}},h.a.createElement("div",null,h.a.createElement("aside",{className:U.a.fullBtn},h.a.createElement("span",{className:"icon-quanping"})),Pe.webssh&&h.a.createElement(C.a,{sshConfigData:Z,sid:1}),((Pe==null?void 0:Pe.vnc)||(Pe==null?void 0:Pe.windows))&&h.a.createElement(xe,{taskId:Pe.type==="windows"?"pcf9t4w6vrnz":"ijby95c82nsh",vnc_url:Pe.vnc,window_vnc_url:Pe.windows}))))))},Re=le.default=Object(T.a)(function(ee){var ge=ee.shixunsDetail,se=ee.loading,Fe=ee.user,je=ee.globalSetting;return{shixunsDetail:ge,globalSetting:je,user:Fe,loading:se.models.shixunsDetail}})(ve)},iUHT:function(Je,le,re){"use strict";Object.defineProperty(le,"__esModule",{value:!0}),le.default=void 0;function j(g,w){if(!(g instanceof w))throw new TypeError("Cannot call a class as a function")}function k(g,w){for(var C=0;C<w.length;C++){var x=w[C];x.enumerable=x.enumerable||!1,x.configurable=!0,"value"in x&&(x.writable=!0),Object.defineProperty(g,x.key,x)}}function D(g,w,C){return w&&k(g.prototype,w),C&&k(g,C),g}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],O=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28],d=0,E,y,v,u,a,c;E=1<<16,y=1<<24,v=E|y,u=1<<2,a=1<<10,c=u|a;var s=[v|a,d|d,E|d,v|c,v|u,E|c,d|u,E|d,d|a,v|a,v|c,d|a,y|c,v|u,y|d,d|u,d|c,y|a,y|a,E|a,E|a,v|d,v|d,y|c,E|u,y|u,y|u,E|u,d|d,d|c,E|c,y|d,E|d,v|c,d|u,v|d,v|a,y|d,y|d,d|a,v|u,E|d,E|a,y|u,d|a,d|u,y|c,E|c,v|c,E|u,v|d,y|c,y|u,d|c,E|c,v|a,d|c,y|a,y|a,d|d,E|u,E|a,d|d,v|u];E=1<<20,y=1<<31,v=E|y,u=1<<5,a=1<<15,c=u|a;var l=[v|c,y|a,d|a,E|c,E|d,d|u,v|u,y|c,y|u,v|c,v|a,y|d,y|a,E|d,d|u,v|u,E|a,E|u,y|c,d|d,y|d,d|a,E|c,v|d,E|u,y|u,d|d,E|a,d|c,v|a,v|d,d|c,d|d,E|c,v|u,E|d,y|c,v|d,v|a,d|a,v|d,y|a,d|u,v|c,E|c,d|u,d|a,y|d,d|c,v|a,E|d,y|u,E|u,y|c,y|u,E|u,E|a,d|d,y|a,d|c,y|d,v|u,v|c,E|a];E=1<<17,y=1<<27,v=E|y,u=1<<3,a=1<<9,c=u|a;var r=[d|c,v|a,d|d,v|u,y|a,d|d,E|c,y|a,E|u,y|u,y|u,E|d,v|c,E|u,v|d,d|c,y|d,d|u,v|a,d|a,E|a,v|d,v|u,E|c,y|c,E|a,E|d,y|c,d|u,v|c,d|a,y|d,v|a,y|d,E|u,d|c,E|d,v|a,y|a,d|d,d|a,E|u,v|c,y|a,y|u,d|a,d|d,v|u,y|c,E|d,y|d,v|c,d|u,E|c,E|a,y|u,v|d,y|c,d|c,v|d,E|c,d|u,v|u,E|a];E=1<<13,y=1<<23,v=E|y,u=1<<0,a=1<<7,c=u|a;var n=[v|u,E|c,E|c,d|a,v|a,y|c,y|u,E|u,d|d,v|d,v|d,v|c,d|c,d|d,y|a,y|u,d|u,E|d,y|d,v|u,d|a,y|d,E|u,E|a,y|c,d|u,E|a,y|a,E|d,v|a,v|c,d|c,y|a,y|u,v|d,v|c,d|c,d|d,d|d,v|d,E|a,y|a,y|c,d|u,v|u,E|c,E|c,d|a,v|c,d|c,d|u,E|d,y|u,E|u,v|a,y|c,E|u,E|a,y|d,v|u,d|a,y|d,E|d,v|a];E=1<<25,y=1<<30,v=E|y,u=1<<8,a=1<<19,c=u|a;var o=[d|u,E|c,E|a,v|u,d|a,d|u,y|d,E|a,y|c,d|a,E|u,y|c,v|u,v|a,d|c,y|d,E|d,y|a,y|a,d|d,y|u,v|c,v|c,E|u,v|a,y|u,d|d,v|d,E|c,E|d,v|d,d|c,d|a,v|u,d|u,E|d,y|d,E|a,v|u,y|c,E|u,y|d,v|a,E|c,y|c,d|u,E|d,v|a,v|c,d|c,v|d,v|c,E|a,d|d,y|a,v|d,d|c,E|u,y|u,d|a,d|d,y|a,E|c,y|u];E=1<<22,y=1<<29,v=E|y,u=1<<4,a=1<<14,c=u|a;var i=[y|u,v|d,d|a,v|c,v|d,d|u,v|c,E|d,y|a,E|c,E|d,y|u,E|u,y|a,y|d,d|c,d|d,E|u,y|c,d|a,E|a,y|c,d|u,v|u,v|u,d|d,E|c,v|a,d|c,E|a,v|a,y|d,y|a,d|u,v|u,E|a,v|c,E|d,d|c,y|u,E|d,y|a,y|d,d|c,y|u,v|c,E|a,v|d,E|c,v|a,d|d,v|u,d|u,d|a,v|d,E|c,d|a,E|u,y|c,d|d,v|a,y|d,E|u,y|c];E=1<<21,y=1<<26,v=E|y,u=1<<1,a=1<<11,c=u|a;var f=[E|d,v|u,y|c,d|d,d|a,y|c,E|c,v|a,v|c,E|d,d|d,y|u,d|u,y|d,v|u,d|c,y|a,E|c,E|u,y|a,y|u,v|d,v|a,E|u,v|d,d|a,d|c,v|c,E|a,d|u,y|d,E|a,y|d,E|a,E|d,y|c,y|c,v|u,v|u,d|u,E|u,y|d,y|a,E|d,v|a,d|c,E|c,v|a,d|c,y|u,v|c,v|d,E|a,d|d,d|u,v|c,d|d,E|c,v|d,d|a,y|u,y|a,d|a,E|u];E=1<<18,y=1<<28,v=E|y,u=1<<6,a=1<<12,c=u|a;var h=[y|c,d|a,E|d,v|c,y|d,y|c,d|u,y|d,E|u,v|d,v|c,E|a,v|a,E|c,d|a,d|u,v|d,y|u,y|a,d|c,E|a,E|u,v|u,v|a,d|c,d|d,d|d,v|u,y|u,y|a,E|c,E|d,E|c,E|d,v|a,d|a,d|u,v|u,d|a,E|c,y|a,d|u,y|u,v|d,v|u,y|d,E|d,y|c,d|d,v|c,E|u,y|u,v|d,y|a,y|c,d|d,v|c,E|a,E|a,d|c,d|c,E|u,y|d,v|a],T=function(){function g(w){j(this,g),this.keys=[];for(var C=[],x=[],b=[],S=0,A=56;S<56;++S,A-=8){A+=A<-5?65:A<-3?31:A<-1?63:A===27?35:0;var p=A&7;C[S]=(w[A>>>3]&1<<p)!==0?1:0}for(var I=0;I<16;++I){var M=I<<1,P=M+1;b[M]=b[P]=0;for(var B=28;B<59;B+=28)for(var H=B-28;H<B;++H){var F=H+O[I];x[H]=F<B?C[F]:C[F-28]}for(var W=0;W<24;++W)x[R[W]]!==0&&(b[M]|=1<<23-W),x[R[W+24]]!==0&&(b[P]|=1<<23-W)}for(var U=0,K=0,G=0;U<16;++U){var ae=b[K++],fe=b[K++];this.keys[G]=(ae&16515072)<<6,this.keys[G]|=(ae&4032)<<10,this.keys[G]|=(fe&16515072)>>>10,this.keys[G]|=(fe&4032)>>>6,++G,this.keys[G]=(ae&258048)<<12,this.keys[G]|=(ae&63)<<16,this.keys[G]|=(fe&258048)>>>4,this.keys[G]|=fe&63,++G}}return D(g,[{key:"enc8",value:function(C){var x=C.slice(),b=0,S,A,p;S=x[b++]<<24|x[b++]<<16|x[b++]<<8|x[b++],A=x[b++]<<24|x[b++]<<16|x[b++]<<8|x[b++],p=(S>>>4^A)&252645135,A^=p,S^=p<<4,p=(S>>>16^A)&65535,A^=p,S^=p<<16,p=(A>>>2^S)&858993459,S^=p,A^=p<<2,p=(A>>>8^S)&16711935,S^=p,A^=p<<8,A=A<<1|A>>>31&1,p=(S^A)&2863311530,S^=p,A^=p,S=S<<1|S>>>31&1;for(var I=0,M=0;I<8;++I){p=A<<28|A>>>4,p^=this.keys[M++];var P=f[p&63];P|=o[p>>>8&63],P|=r[p>>>16&63],P|=s[p>>>24&63],p=A^this.keys[M++],P|=h[p&63],P|=i[p>>>8&63],P|=n[p>>>16&63],P|=l[p>>>24&63],S^=P,p=S<<28|S>>>4,p^=this.keys[M++],P=f[p&63],P|=o[p>>>8&63],P|=r[p>>>16&63],P|=s[p>>>24&63],p=S^this.keys[M++],P|=h[p&63],P|=i[p>>>8&63],P|=n[p>>>16&63],P|=l[p>>>24&63],A^=P}for(A=A<<31|A>>>1,p=(S^A)&2863311530,S^=p,A^=p,S=S<<31|S>>>1,p=(S>>>8^A)&16711935,A^=p,S^=p<<8,p=(S>>>2^A)&858993459,A^=p,S^=p<<2,p=(A>>>16^S)&65535,S^=p,A^=p<<16,p=(A>>>4^S)&252645135,S^=p,A^=p<<4,p=[A,S],b=0;b<8;b++)x[b]=(p[b>>>2]>>>8*(3-b%4))%256,x[b]<0&&(x[b]+=256);return x}},{key:"encrypt",value:function(C){return this.enc8(C.slice(0,8)).concat(this.enc8(C.slice(8,16)))}}]),g}();le.default=T},kSUc:function(Je,le,re){},lNSK:function(Je,le,re){"use strict";function j(X){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?j=function(ye){return typeof ye}:j=function(ye){return ye&&typeof Symbol=="function"&&ye.constructor===Symbol&&ye!==Symbol.prototype?"symbol":typeof ye},j(X)}Object.defineProperty(le,"__esModule",{value:!0}),le.deflateInit=Y,le.deflateInit2=he,le.deflateReset=me,le.deflateResetKeep=Oe,le.deflateSetHeader=ue,le.deflate=$,le.deflateEnd=z,le.deflateSetDictionary=oe,le.deflateInfo=le.Z_DEFLATED=le.Z_UNKNOWN=le.Z_DEFAULT_STRATEGY=le.Z_FIXED=le.Z_RLE=le.Z_HUFFMAN_ONLY=le.Z_FILTERED=le.Z_DEFAULT_COMPRESSION=le.Z_BUF_ERROR=le.Z_DATA_ERROR=le.Z_STREAM_ERROR=le.Z_STREAM_END=le.Z_OK=le.Z_BLOCK=le.Z_FINISH=le.Z_FULL_FLUSH=le.Z_PARTIAL_FLUSH=le.Z_NO_FLUSH=void 0;var k=v(re("6BzB")),D=v(re("c5fP")),R=E(re("xlC8")),O=E(re("QV2g")),d=E(re("xSIq"));function E(X){return X&&X.__esModule?X:{default:X}}function y(){if(typeof WeakMap!="function")return null;var X=new WeakMap;return y=function(){return X},X}function v(X){if(X&&X.__esModule)return X;if(X===null||j(X)!=="object"&&typeof X!="function")return{default:X};var de=y();if(de&&de.has(X))return de.get(X);var ye={},ie=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var pe in X)if(Object.prototype.hasOwnProperty.call(X,pe)){var Pe=ie?Object.getOwnPropertyDescriptor(X,pe):null;Pe&&(Pe.get||Pe.set)?Object.defineProperty(ye,pe,Pe):ye[pe]=X[pe]}return ye.default=X,de&&de.set(X,ye),ye}var u=0;le.Z_NO_FLUSH=u;var a=1;le.Z_PARTIAL_FLUSH=a;var c=3;le.Z_FULL_FLUSH=c;var s=4;le.Z_FINISH=s;var l=5;le.Z_BLOCK=l;var r=0;le.Z_OK=r;var n=1;le.Z_STREAM_END=n;var o=-2;le.Z_STREAM_ERROR=o;var i=-3;le.Z_DATA_ERROR=i;var f=-5;le.Z_BUF_ERROR=f;var h=-1;le.Z_DEFAULT_COMPRESSION=h;var T=1;le.Z_FILTERED=T;var g=2;le.Z_HUFFMAN_ONLY=g;var w=3;le.Z_RLE=w;var C=4;le.Z_FIXED=C;var x=0;le.Z_DEFAULT_STRATEGY=x;var b=2;le.Z_UNKNOWN=b;var S=8;le.Z_DEFLATED=S;var A=9,p=15,I=8,M=29,P=256,B=P+1+M,H=30,F=19,W=2*B+1,U=15,K=3,G=258,ae=G+K+1,fe=32,Se=42,Ue=69,Ne=73,xe=91,Ce=103,De=113,ve=666,Re=1,ee=2,ge=3,se=4,Fe=3;function je(X,de){return X.msg=d.default[de],de}function Ke(X){return(X<<1)-(X>4?9:0)}function ze(X){for(var de=X.length;--de>=0;)X[de]=0}function Ge(X){var de=X.state,ye=de.pending;if(ye>X.avail_out&&(ye=X.avail_out),ye===0)return;k.arraySet(X.output,de.pending_buf,de.pending_out,ye,X.next_out),X.next_out+=ye,de.pending_out+=ye,X.total_out+=ye,X.avail_out-=ye,de.pending-=ye,de.pending===0&&(de.pending_out=0)}function He(X,de){D._tr_flush_block(X,X.block_start>=0?X.block_start:-1,X.strstart-X.block_start,de),X.block_start=X.strstart,Ge(X.strm)}function Ie(X,de){X.pending_buf[X.pending++]=de}function ke(X,de){X.pending_buf[X.pending++]=de>>>8&255,X.pending_buf[X.pending++]=de&255}function Ae(X,de,ye,ie){var pe=X.avail_in;return pe>ie&&(pe=ie),pe===0?0:(X.avail_in-=pe,k.arraySet(de,X.input,X.next_in,pe,ye),X.state.wrap===1?X.adler=(0,R.default)(X.adler,de,pe,ye):X.state.wrap===2&&(X.adler=(0,O.default)(X.adler,de,pe,ye)),X.next_in+=pe,X.total_in+=pe,pe)}function Te(X,de){var ye=X.max_chain_length,ie=X.strstart,pe,Pe,$e=X.prev_length,Ye=X.nice_match,qe=X.strstart>X.w_size-ae?X.strstart-(X.w_size-ae):0,st=X.window,mt=X.w_mask,ct=X.prev,it=X.strstart+G,yt=st[ie+$e-1],Et=st[ie+$e];X.prev_length>=X.good_match&&(ye>>=2),Ye>X.lookahead&&(Ye=X.lookahead);do{if(pe=de,st[pe+$e]!==Et||st[pe+$e-1]!==yt||st[pe]!==st[ie]||st[++pe]!==st[ie+1])continue;ie+=2,pe++;do;while(st[++ie]===st[++pe]&&st[++ie]===st[++pe]&&st[++ie]===st[++pe]&&st[++ie]===st[++pe]&&st[++ie]===st[++pe]&&st[++ie]===st[++pe]&&st[++ie]===st[++pe]&&st[++ie]===st[++pe]&&ie<it);if(Pe=G-(it-ie),ie=it-G,Pe>$e){if(X.match_start=de,$e=Pe,Pe>=Ye)break;yt=st[ie+$e-1],Et=st[ie+$e]}}while((de=ct[de&mt])>qe&&--ye!==0);return $e<=X.lookahead?$e:X.lookahead}function Z(X){var de=X.w_size,ye,ie,pe,Pe,$e;do{if(Pe=X.window_size-X.lookahead-X.strstart,X.strstart>=de+(de-ae)){k.arraySet(X.window,X.window,de,de,0),X.match_start-=de,X.strstart-=de,X.block_start-=de,ie=X.hash_size,ye=ie;do pe=X.head[--ye],X.head[ye]=pe>=de?pe-de:0;while(--ie);ie=de,ye=ie;do pe=X.prev[--ye],X.prev[ye]=pe>=de?pe-de:0;while(--ie);Pe+=de}if(X.strm.avail_in===0)break;if(ie=Ae(X.strm,X.window,X.strstart+X.lookahead,Pe),X.lookahead+=ie,X.lookahead+X.insert>=K)for($e=X.strstart-X.insert,X.ins_h=X.window[$e],X.ins_h=(X.ins_h<<X.hash_shift^X.window[$e+1])&X.hash_mask;X.insert&&!(X.ins_h=(X.ins_h<<X.hash_shift^X.window[$e+K-1])&X.hash_mask,X.prev[$e&X.w_mask]=X.head[X.ins_h],X.head[X.ins_h]=$e,$e++,X.insert--,X.lookahead+X.insert<K););}while(X.lookahead<ae&&X.strm.avail_in!==0)}function ce(X,de){var ye=65535;for(ye>X.pending_buf_size-5&&(ye=X.pending_buf_size-5);;){if(X.lookahead<=1){if(Z(X),X.lookahead===0&&de===u)return Re;if(X.lookahead===0)break}X.strstart+=X.lookahead,X.lookahead=0;var ie=X.block_start+ye;if((X.strstart===0||X.strstart>=ie)&&(X.lookahead=X.strstart-ie,X.strstart=ie,He(X,!1),X.strm.avail_out===0))return Re;if(X.strstart-X.block_start>=X.w_size-ae&&(He(X,!1),X.strm.avail_out===0))return Re}return X.insert=0,de===s?(He(X,!0),X.strm.avail_out===0?ge:se):(X.strstart>X.block_start&&(He(X,!1),X.strm.avail_out===0),Re)}function J(X,de){for(var ye,ie;;){if(X.lookahead<ae){if(Z(X),X.lookahead<ae&&de===u)return Re;if(X.lookahead===0)break}if(ye=0,X.lookahead>=K&&(X.ins_h=(X.ins_h<<X.hash_shift^X.window[X.strstart+K-1])&X.hash_mask,ye=X.prev[X.strstart&X.w_mask]=X.head[X.ins_h],X.head[X.ins_h]=X.strstart),ye!==0&&X.strstart-ye<=X.w_size-ae&&(X.match_length=Te(X,ye)),X.match_length>=K)if(ie=D._tr_tally(X,X.strstart-X.match_start,X.match_length-K),X.lookahead-=X.match_length,X.match_length<=X.max_lazy_match&&X.lookahead>=K){X.match_length--;do X.strstart++,X.ins_h=(X.ins_h<<X.hash_shift^X.window[X.strstart+K-1])&X.hash_mask,ye=X.prev[X.strstart&X.w_mask]=X.head[X.ins_h],X.head[X.ins_h]=X.strstart;while(--X.match_length!==0);X.strstart++}else X.strstart+=X.match_length,X.match_length=0,X.ins_h=X.window[X.strstart],X.ins_h=(X.ins_h<<X.hash_shift^X.window[X.strstart+1])&X.hash_mask;else ie=D._tr_tally(X,0,X.window[X.strstart]),X.lookahead--,X.strstart++;if(ie&&(He(X,!1),X.strm.avail_out===0))return Re}return X.insert=X.strstart<K-1?X.strstart:K-1,de===s?(He(X,!0),X.strm.avail_out===0?ge:se):X.last_lit&&(He(X,!1),X.strm.avail_out===0)?Re:ee}function Le(X,de){for(var ye,ie,pe;;){if(X.lookahead<ae){if(Z(X),X.lookahead<ae&&de===u)return Re;if(X.lookahead===0)break}if(ye=0,X.lookahead>=K&&(X.ins_h=(X.ins_h<<X.hash_shift^X.window[X.strstart+K-1])&X.hash_mask,ye=X.prev[X.strstart&X.w_mask]=X.head[X.ins_h],X.head[X.ins_h]=X.strstart),X.prev_length=X.match_length,X.prev_match=X.match_start,X.match_length=K-1,ye!==0&&X.prev_length<X.max_lazy_match&&X.strstart-ye<=X.w_size-ae&&(X.match_length=Te(X,ye),X.match_length<=5&&(X.strategy===T||X.match_length===K&&X.strstart-X.match_start>4096)&&(X.match_length=K-1)),X.prev_length>=K&&X.match_length<=X.prev_length){pe=X.strstart+X.lookahead-K,ie=D._tr_tally(X,X.strstart-1-X.prev_match,X.prev_length-K),X.lookahead-=X.prev_length-1,X.prev_length-=2;do++X.strstart<=pe&&(X.ins_h=(X.ins_h<<X.hash_shift^X.window[X.strstart+K-1])&X.hash_mask,ye=X.prev[X.strstart&X.w_mask]=X.head[X.ins_h],X.head[X.ins_h]=X.strstart);while(--X.prev_length!==0);if(X.match_available=0,X.match_length=K-1,X.strstart++,ie&&(He(X,!1),X.strm.avail_out===0))return Re}else if(X.match_available){if(ie=D._tr_tally(X,0,X.window[X.strstart-1]),ie&&He(X,!1),X.strstart++,X.lookahead--,X.strm.avail_out===0)return Re}else X.match_available=1,X.strstart++,X.lookahead--}return X.match_available&&(ie=D._tr_tally(X,0,X.window[X.strstart-1]),X.match_available=0),X.insert=X.strstart<K-1?X.strstart:K-1,de===s?(He(X,!0),X.strm.avail_out===0?ge:se):X.last_lit&&(He(X,!1),X.strm.avail_out===0)?Re:ee}function We(X,de){for(var ye,ie,pe,Pe,$e=X.window;;){if(X.lookahead<=G){if(Z(X),X.lookahead<=G&&de===u)return Re;if(X.lookahead===0)break}if(X.match_length=0,X.lookahead>=K&&X.strstart>0&&(pe=X.strstart-1,ie=$e[pe],ie===$e[++pe]&&ie===$e[++pe]&&ie===$e[++pe])){Pe=X.strstart+G;do;while(ie===$e[++pe]&&ie===$e[++pe]&&ie===$e[++pe]&&ie===$e[++pe]&&ie===$e[++pe]&&ie===$e[++pe]&&ie===$e[++pe]&&ie===$e[++pe]&&pe<Pe);X.match_length=G-(Pe-pe),X.match_length>X.lookahead&&(X.match_length=X.lookahead)}if(X.match_length>=K?(ye=D._tr_tally(X,1,X.match_length-K),X.lookahead-=X.match_length,X.strstart+=X.match_length,X.match_length=0):(ye=D._tr_tally(X,0,X.window[X.strstart]),X.lookahead--,X.strstart++),ye&&(He(X,!1),X.strm.avail_out===0))return Re}return X.insert=0,de===s?(He(X,!0),X.strm.avail_out===0?ge:se):X.last_lit&&(He(X,!1),X.strm.avail_out===0)?Re:ee}function Ve(X,de){for(var ye;;){if(X.lookahead===0&&(Z(X),X.lookahead===0)){if(de===u)return Re;break}if(X.match_length=0,ye=D._tr_tally(X,0,X.window[X.strstart]),X.lookahead--,X.strstart++,ye&&(He(X,!1),X.strm.avail_out===0))return Re}return X.insert=0,de===s?(He(X,!0),X.strm.avail_out===0?ge:se):X.last_lit&&(He(X,!1),X.strm.avail_out===0)?Re:ee}function Me(X,de,ye,ie,pe){this.good_length=X,this.max_lazy=de,this.nice_length=ye,this.max_chain=ie,this.func=pe}var et;et=[new Me(0,0,0,0,ce),new Me(4,4,8,4,J),new Me(4,5,16,8,J),new Me(4,6,32,32,J),new Me(4,4,16,16,Le),new Me(8,16,32,32,Le),new Me(8,16,128,128,Le),new Me(8,32,128,256,Le),new Me(32,128,258,1024,Le),new Me(32,258,258,4096,Le)];function ne(X){X.window_size=2*X.w_size,ze(X.head),X.max_lazy_match=et[X.level].max_lazy,X.good_match=et[X.level].good_length,X.nice_match=et[X.level].nice_length,X.max_chain_length=et[X.level].max_chain,X.strstart=0,X.block_start=0,X.lookahead=0,X.insert=0,X.match_length=X.prev_length=K-1,X.match_available=0,X.ins_h=0}function Ee(){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=S,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 k.Buf16(W*2),this.dyn_dtree=new k.Buf16((2*H+1)*2),this.bl_tree=new k.Buf16((2*F+1)*2),ze(this.dyn_ltree),ze(this.dyn_dtree),ze(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new k.Buf16(U+1),this.heap=new k.Buf16(2*B+1),ze(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new k.Buf16(2*B+1),ze(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 Oe(X){var de;return!X||!X.state?je(X,o):(X.total_in=X.total_out=0,X.data_type=b,de=X.state,de.pending=0,de.pending_out=0,de.wrap<0&&(de.wrap=-de.wrap),de.status=de.wrap?Se:De,X.adler=de.wrap===2?0:1,de.last_flush=u,D._tr_init(de),r)}function me(X){var de=Oe(X);return de===r&&ne(X.state),de}function ue(X,de){return!X||!X.state||X.state.wrap!==2?o:(X.state.gzhead=de,r)}function he(X,de,ye,ie,pe,Pe){if(!X)return o;var $e=1;if(de===h&&(de=6),ie<0?($e=0,ie=-ie):ie>15&&($e=2,ie-=16),pe<1||pe>A||ye!==S||ie<8||ie>15||de<0||de>9||Pe<0||Pe>C)return je(X,o);ie===8&&(ie=9);var Ye=new Ee;return X.state=Ye,Ye.strm=X,Ye.wrap=$e,Ye.gzhead=null,Ye.w_bits=ie,Ye.w_size=1<<Ye.w_bits,Ye.w_mask=Ye.w_size-1,Ye.hash_bits=pe+7,Ye.hash_size=1<<Ye.hash_bits,Ye.hash_mask=Ye.hash_size-1,Ye.hash_shift=~~((Ye.hash_bits+K-1)/K),Ye.window=new k.Buf8(Ye.w_size*2),Ye.head=new k.Buf16(Ye.hash_size),Ye.prev=new k.Buf16(Ye.w_size),Ye.lit_bufsize=1<<pe+6,Ye.pending_buf_size=Ye.lit_bufsize*4,Ye.pending_buf=new k.Buf8(Ye.pending_buf_size),Ye.d_buf=1*Ye.lit_bufsize,Ye.l_buf=(1+2)*Ye.lit_bufsize,Ye.level=de,Ye.strategy=Pe,Ye.method=ye,me(X)}function Y(X,de){return he(X,de,S,p,I,x)}function $(X,de){var ye,ie,pe,Pe;if(!X||!X.state||de>l||de<0)return X?je(X,o):o;if(ie=X.state,!X.output||!X.input&&X.avail_in!==0||ie.status===ve&&de!==s)return je(X,X.avail_out===0?f:o);if(ie.strm=X,ye=ie.last_flush,ie.last_flush=de,ie.status===Se)if(ie.wrap===2)X.adler=0,Ie(ie,31),Ie(ie,139),Ie(ie,8),ie.gzhead?(Ie(ie,(ie.gzhead.text?1:0)+(ie.gzhead.hcrc?2:0)+(ie.gzhead.extra?4:0)+(ie.gzhead.name?8:0)+(ie.gzhead.comment?16:0)),Ie(ie,ie.gzhead.time&255),Ie(ie,ie.gzhead.time>>8&255),Ie(ie,ie.gzhead.time>>16&255),Ie(ie,ie.gzhead.time>>24&255),Ie(ie,ie.level===9?2:ie.strategy>=g||ie.level<2?4:0),Ie(ie,ie.gzhead.os&255),ie.gzhead.extra&&ie.gzhead.extra.length&&(Ie(ie,ie.gzhead.extra.length&255),Ie(ie,ie.gzhead.extra.length>>8&255)),ie.gzhead.hcrc&&(X.adler=(0,O.default)(X.adler,ie.pending_buf,ie.pending,0)),ie.gzindex=0,ie.status=Ue):(Ie(ie,0),Ie(ie,0),Ie(ie,0),Ie(ie,0),Ie(ie,0),Ie(ie,ie.level===9?2:ie.strategy>=g||ie.level<2?4:0),Ie(ie,Fe),ie.status=De);else{var $e=S+(ie.w_bits-8<<4)<<8,Ye=-1;ie.strategy>=g||ie.level<2?Ye=0:ie.level<6?Ye=1:ie.level===6?Ye=2:Ye=3,$e|=Ye<<6,ie.strstart!==0&&($e|=fe),$e+=31-$e%31,ie.status=De,ke(ie,$e),ie.strstart!==0&&(ke(ie,X.adler>>>16),ke(ie,X.adler&65535)),X.adler=1}if(ie.status===Ue)if(ie.gzhead.extra){for(pe=ie.pending;ie.gzindex<(ie.gzhead.extra.length&65535)&&!(ie.pending===ie.pending_buf_size&&(ie.gzhead.hcrc&&ie.pending>pe&&(X.adler=(0,O.default)(X.adler,ie.pending_buf,ie.pending-pe,pe)),Ge(X),pe=ie.pending,ie.pending===ie.pending_buf_size));)Ie(ie,ie.gzhead.extra[ie.gzindex]&255),ie.gzindex++;ie.gzhead.hcrc&&ie.pending>pe&&(X.adler=(0,O.default)(X.adler,ie.pending_buf,ie.pending-pe,pe)),ie.gzindex===ie.gzhead.extra.length&&(ie.gzindex=0,ie.status=Ne)}else ie.status=Ne;if(ie.status===Ne)if(ie.gzhead.name){pe=ie.pending;do{if(ie.pending===ie.pending_buf_size&&(ie.gzhead.hcrc&&ie.pending>pe&&(X.adler=(0,O.default)(X.adler,ie.pending_buf,ie.pending-pe,pe)),Ge(X),pe=ie.pending,ie.pending===ie.pending_buf_size)){Pe=1;break}ie.gzindex<ie.gzhead.name.length?Pe=ie.gzhead.name.charCodeAt(ie.gzindex++)&255:Pe=0,Ie(ie,Pe)}while(Pe!==0);ie.gzhead.hcrc&&ie.pending>pe&&(X.adler=(0,O.default)(X.adler,ie.pending_buf,ie.pending-pe,pe)),Pe===0&&(ie.gzindex=0,ie.status=xe)}else ie.status=xe;if(ie.status===xe)if(ie.gzhead.comment){pe=ie.pending;do{if(ie.pending===ie.pending_buf_size&&(ie.gzhead.hcrc&&ie.pending>pe&&(X.adler=(0,O.default)(X.adler,ie.pending_buf,ie.pending-pe,pe)),Ge(X),pe=ie.pending,ie.pending===ie.pending_buf_size)){Pe=1;break}ie.gzindex<ie.gzhead.comment.length?Pe=ie.gzhead.comment.charCodeAt(ie.gzindex++)&255:Pe=0,Ie(ie,Pe)}while(Pe!==0);ie.gzhead.hcrc&&ie.pending>pe&&(X.adler=(0,O.default)(X.adler,ie.pending_buf,ie.pending-pe,pe)),Pe===0&&(ie.status=Ce)}else ie.status=Ce;if(ie.status===Ce&&(ie.gzhead.hcrc?(ie.pending+2>ie.pending_buf_size&&Ge(X),ie.pending+2<=ie.pending_buf_size&&(Ie(ie,X.adler&255),Ie(ie,X.adler>>8&255),X.adler=0,ie.status=De)):ie.status=De),ie.pending!==0){if(Ge(X),X.avail_out===0)return ie.last_flush=-1,r}else if(X.avail_in===0&&Ke(de)<=Ke(ye)&&de!==s)return je(X,f);if(ie.status===ve&&X.avail_in!==0)return je(X,f);if(X.avail_in!==0||ie.lookahead!==0||de!==u&&ie.status!==ve){var qe=ie.strategy===g?Ve(ie,de):ie.strategy===w?We(ie,de):et[ie.level].func(ie,de);if((qe===ge||qe===se)&&(ie.status=ve),qe===Re||qe===ge)return X.avail_out===0&&(ie.last_flush=-1),r;if(qe===ee&&(de===a?D._tr_align(ie):de!==l&&(D._tr_stored_block(ie,0,0,!1),de===c&&(ze(ie.head),ie.lookahead===0&&(ie.strstart=0,ie.block_start=0,ie.insert=0))),Ge(X),X.avail_out===0))return ie.last_flush=-1,r}return de!==s?r:ie.wrap<=0?n:(ie.wrap===2?(Ie(ie,X.adler&255),Ie(ie,X.adler>>8&255),Ie(ie,X.adler>>16&255),Ie(ie,X.adler>>24&255),Ie(ie,X.total_in&255),Ie(ie,X.total_in>>8&255),Ie(ie,X.total_in>>16&255),Ie(ie,X.total_in>>24&255)):(ke(ie,X.adler>>>16),ke(ie,X.adler&65535)),Ge(X),ie.wrap>0&&(ie.wrap=-ie.wrap),ie.pending!==0?r:n)}function z(X){var de;return!X||!X.state?o:(de=X.state.status,de!==Se&&de!==Ue&&de!==Ne&&de!==xe&&de!==Ce&&de!==De&&de!==ve?je(X,o):(X.state=null,de===De?je(X,i):r))}function oe(X,de){var ye=de.length,ie,pe,Pe,$e,Ye,qe,st,mt;if(!X||!X.state)return o;if(ie=X.state,$e=ie.wrap,$e===2||$e===1&&ie.status!==Se||ie.lookahead)return o;for($e===1&&(X.adler=(0,R.default)(X.adler,de,ye,0)),ie.wrap=0,ye>=ie.w_size&&($e===0&&(ze(ie.head),ie.strstart=0,ie.block_start=0,ie.insert=0),mt=new k.Buf8(ie.w_size),k.arraySet(mt,de,ye-ie.w_size,ie.w_size,0),de=mt,ye=ie.w_size),Ye=X.avail_in,qe=X.next_in,st=X.input,X.avail_in=ye,X.next_in=0,X.input=de,Z(ie);ie.lookahead>=K;){pe=ie.strstart,Pe=ie.lookahead-(K-1);do ie.ins_h=(ie.ins_h<<ie.hash_shift^ie.window[pe+K-1])&ie.hash_mask,ie.prev[pe&ie.w_mask]=ie.head[ie.ins_h],ie.head[ie.ins_h]=pe,pe++;while(--Pe);ie.strstart=pe,ie.lookahead=K-1,Z(ie)}return ie.strstart+=ie.lookahead,ie.block_start=ie.strstart,ie.insert=ie.lookahead,ie.lookahead=0,ie.match_length=ie.prev_length=K-1,ie.match_available=0,X.next_in=qe,X.input=st,X.avail_in=Ye,ie.wrap=$e,r}var _e="pako deflate (from Nodeca project)";le.deflateInfo=_e},lZu9:function(Je,le,re){(function(j){j(re("VrN/"),re("1eCo"),re("8EBN"))})(function(j){"use strict";j.defineMode("markdown",function(k,D){var R=j.getMode(k,"text/html"),O=R.name=="null";function d(U){if(j.findModeByName){var K=j.findModeByName(U);K&&(U=K.mime||K.mimes[0])}var G=j.getMode(k,U);return G.name=="null"?null:G}D.highlightFormatting===void 0&&(D.highlightFormatting=!1),D.maxBlockquoteDepth===void 0&&(D.maxBlockquoteDepth=0),D.taskLists===void 0&&(D.taskLists=!1),D.strikethrough===void 0&&(D.strikethrough=!1),D.emoji===void 0&&(D.emoji=!1),D.fencedCodeBlockHighlighting===void 0&&(D.fencedCodeBlockHighlighting=!0),D.fencedCodeBlockDefaultMode===void 0&&(D.fencedCodeBlockDefaultMode="text/plain"),D.xml===void 0&&(D.xml=!0),D.tokenTypeOverrides===void 0&&(D.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 y in E)E.hasOwnProperty(y)&&D.tokenTypeOverrides[y]&&(E[y]=D.tokenTypeOverrides[y]);var v=/^([*\-_])(?:\s*\1){2,}\s*$/,u=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,a=/^\[(x| )\](?=\s)/i,c=D.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,s=/^ {0,3}(?:\={1,}|-{2,})\s*$/,l=/^[^#!\[\]*_\\<>` "'(~:]+/,r=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,n=/^\s*\[[^\]]+?\]:.*$/,o=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\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]/,i=" ";function f(U,K,G){return K.f=K.inline=G,G(U,K)}function h(U,K,G){return K.f=K.block=G,G(U,K)}function T(U){return!U||!/\S/.test(U.string)}function g(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=O;if(!K){var G=j.innerMode(R,U.htmlState);K=G.mode.name=="xml"&&G.state.tagStart===null&&!G.state.context&&G.state.tokenize.isInText}K&&(U.f=A,U.block=w,U.htmlState=null)}return U.trailingSpace=0,U.trailingSpaceNewLine=!1,U.prevLine=U.thisLine,U.thisLine={stream:null},null}function w(U,K){var G=U.column()===K.indentation,ae=T(K.prevLine.stream),fe=K.indentedCode,Se=K.prevLine.hr,Ue=K.list!==!1,Ne=(K.listStack[K.listStack.length-1]||0)+3;K.indentedCode=!1;var xe=K.indentation;if(K.indentationDiff===null&&(K.indentationDiff=K.indentation,Ue)){for(K.list=null;xe<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=xe-K.listStack[K.listStack.length-1])}var Ce=!ae&&!Se&&!K.prevLine.header&&(!Ue||!fe)&&!K.prevLine.fencedCodeEnd,De=(K.list===!1||Se||ae)&&K.indentation<=Ne&&U.match(v),ve=null;if(K.indentationDiff>=4&&(fe||K.prevLine.fencedCodeEnd||K.prevLine.header||ae))return U.skipToEnd(),K.indentedCode=!0,E.code;if(U.eatSpace())return null;if(G&&K.indentation<=Ne&&(ve=U.match(c))&&ve[1].length<=6)return K.quote=0,K.header=ve[1].length,K.thisLine.header=!0,D.highlightFormatting&&(K.formatting="header"),K.f=K.inline,b(K);if(K.indentation<=Ne&&U.eat(">"))return K.quote=G?1:K.quote+1,D.highlightFormatting&&(K.formatting="quote"),U.eatSpace(),b(K);if(!De&&!K.setext&&G&&K.indentation<=Ne&&(ve=U.match(u))){var Re=ve[1]?"ol":"ul";return K.indentation=xe+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,D.taskLists&&U.match(a,!1)&&(K.taskList=!0),K.f=K.inline,D.highlightFormatting&&(K.formatting=["list","list-"+Re]),b(K)}else{if(G&&K.indentation<=Ne&&(ve=U.match(r,!0)))return K.quote=0,K.fencedEndRE=new RegExp(ve[1]+"+ *$"),K.localMode=D.fencedCodeBlockHighlighting&&d(ve[2]||D.fencedCodeBlockDefaultMode),K.localMode&&(K.localState=j.startState(K.localMode)),K.f=K.block=x,D.highlightFormatting&&(K.formatting="code-block"),K.code=-1,b(K);if(K.setext||(!Ce||!Ue)&&!K.quote&&K.list===!1&&!K.code&&!De&&!n.test(U.string)&&(ve=U.lookAhead(1))&&(ve=ve.match(s)))return K.setext?(K.header=K.setext,K.setext=0,U.skipToEnd(),D.highlightFormatting&&(K.formatting="header")):(K.header=ve[0].charAt(0)=="="?1:2,K.setext=K.header),K.thisLine.header=!0,K.f=K.inline,b(K);if(De)return U.skipToEnd(),K.hr=!0,K.thisLine.hr=!0,E.hr;if(U.peek()==="[")return f(U,K,B)}return f(U,K,K.inline)}function C(U,K){var G=R.token(U,K.htmlState);if(!O){var ae=j.innerMode(R,K.htmlState);(ae.mode.name=="xml"&&ae.state.tagStart===null&&!ae.state.context&&ae.state.tokenize.isInText||K.md_inside&&U.current().indexOf(">")>-1)&&(K.f=A,K.block=w,K.htmlState=null)}return G}function x(U,K){var G=K.listStack[K.listStack.length-1]||0,ae=K.indentation<G,fe=G+3;if(K.fencedEndRE&&K.indentation<=fe&&(ae||U.match(K.fencedEndRE))){D.highlightFormatting&&(K.formatting="code-block");var Se;return ae||(Se=b(K)),K.localMode=K.localState=null,K.block=w,K.f=A,K.fencedEndRE=null,K.code=0,K.thisLine.fencedCodeEnd=!0,ae?h(U,K,K.block):Se}else return K.localMode?K.localMode.token(U,K.localState):(U.skipToEnd(),E.code)}function b(U){var K=[];if(U.formatting){K.push(E.formatting),typeof U.formatting=="string"&&(U.formatting=[U.formatting]);for(var G=0;G<U.formatting.length;G++)K.push(E.formatting+"-"+U.formatting[G]),U.formatting[G]==="header"&&K.push(E.formatting+"-"+U.formatting[G]+"-"+U.header),U.formatting[G]==="quote"&&(!D.maxBlockquoteDepth||D.maxBlockquoteDepth>=U.quote?K.push(E.formatting+"-"+U.formatting[G]+"-"+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),!D.maxBlockquoteDepth||D.maxBlockquoteDepth>=U.quote?K.push(E.quote+"-"+U.quote):K.push(E.quote+"-"+D.maxBlockquoteDepth)),U.list!==!1){var ae=(U.listStack.length-1)%3;ae?ae===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 S(U,K){return U.match(l,!0)?b(K):void 0}function A(U,K){var G=K.text(U,K);if(typeof G!="undefined")return G;if(K.list)return K.list=null,b(K);if(K.taskList){var ae=U.match(a,!0)[1]===" ";return ae?K.taskOpen=!0:K.taskClosed=!0,D.highlightFormatting&&(K.formatting="task"),K.taskList=!1,b(K)}if(K.taskOpen=!1,K.taskClosed=!1,K.header&&U.match(/^#+$/,!0))return D.highlightFormatting&&(K.formatting="header"),b(K);var fe=U.next();if(K.linkTitle){K.linkTitle=!1;var Se=fe;fe==="("&&(Se=")"),Se=(Se+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var Ue="^\\s*(?:[^"+Se+"\\\\]+|\\\\\\\\|\\\\.)"+Se;if(U.match(new RegExp(Ue),!0))return E.linkHref}if(fe==="`"){var Ne=K.formatting;D.highlightFormatting&&(K.formatting="code"),U.eatWhile("`");var xe=U.current().length;if(K.code==0&&(!K.quote||xe==1))return K.code=xe,b(K);if(xe==K.code){var Ce=b(K);return K.code=0,Ce}else return K.formatting=Ne,b(K)}else if(K.code)return b(K);if(fe==="\\"&&(U.next(),D.highlightFormatting)){var De=b(K),ve=E.formatting+"-escape";return De?De+" "+ve:ve}if(fe==="!"&&U.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return K.imageMarker=!0,K.image=!0,D.highlightFormatting&&(K.formatting="image"),b(K);if(fe==="["&&K.imageMarker&&U.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return K.imageMarker=!1,K.imageAltText=!0,D.highlightFormatting&&(K.formatting="image"),b(K);if(fe==="]"&&K.imageAltText){D.highlightFormatting&&(K.formatting="image");var De=b(K);return K.imageAltText=!1,K.image=!1,K.inline=K.f=I,De}if(fe==="["&&!K.image)return K.linkText&&U.match(/^.*?\]/)||(K.linkText=!0,D.highlightFormatting&&(K.formatting="link")),b(K);if(fe==="]"&&K.linkText){D.highlightFormatting&&(K.formatting="link");var De=b(K);return K.linkText=!1,K.inline=K.f=U.match(/\(.*?\)| ?\[.*?\]/,!1)?I:A,De}if(fe==="<"&&U.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){K.f=K.inline=p,D.highlightFormatting&&(K.formatting="link");var De=b(K);return De?De+=" ":De="",De+E.linkInline}if(fe==="<"&&U.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){K.f=K.inline=p,D.highlightFormatting&&(K.formatting="link");var De=b(K);return De?De+=" ":De="",De+E.linkEmail}if(D.xml&&fe==="<"&&U.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var Re=U.string.indexOf(">",U.pos);if(Re!=-1){var ee=U.string.substring(U.start,Re);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(ee)&&(K.md_inside=!0)}return U.backUp(1),K.htmlState=j.startState(R),h(U,K,C)}if(D.xml&&fe==="<"&&U.match(/^\/\w*?>/))return K.md_inside=!1,"tag";if(fe==="*"||fe==="_"){for(var ge=1,se=U.pos==1?" ":U.string.charAt(U.pos-2);ge<3&&U.eat(fe);)ge++;var Fe=U.peek()||" ",je=!/\s/.test(Fe)&&(!o.test(Fe)||/\s/.test(se)||o.test(se)),Ke=!/\s/.test(se)&&(!o.test(se)||/\s/.test(Fe)||o.test(Fe)),ze=null,Ge=null;if(ge%2&&(!K.em&&je&&(fe==="*"||!Ke||o.test(se))?ze=!0:K.em==fe&&Ke&&(fe==="*"||!je||o.test(Fe))&&(ze=!1)),ge>1&&(!K.strong&&je&&(fe==="*"||!Ke||o.test(se))?Ge=!0:K.strong==fe&&Ke&&(fe==="*"||!je||o.test(Fe))&&(Ge=!1)),Ge!=null||ze!=null){D.highlightFormatting&&(K.formatting=ze==null?"strong":Ge==null?"em":"strong em"),ze===!0&&(K.em=fe),Ge===!0&&(K.strong=fe);var Ce=b(K);return ze===!1&&(K.em=!1),Ge===!1&&(K.strong=!1),Ce}}else if(fe===" "&&(U.eat("*")||U.eat("_"))){if(U.peek()===" ")return b(K);U.backUp(1)}if(D.strikethrough){if(fe==="~"&&U.eatWhile(fe)){if(K.strikethrough){D.highlightFormatting&&(K.formatting="strikethrough");var Ce=b(K);return K.strikethrough=!1,Ce}else if(U.match(/^[^\s]/,!1))return K.strikethrough=!0,D.highlightFormatting&&(K.formatting="strikethrough"),b(K)}else if(fe===" "&&U.match(/^~~/,!0)){if(U.peek()===" ")return b(K);U.backUp(2)}}if(D.emoji&&fe===":"&&U.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){K.emoji=!0,D.highlightFormatting&&(K.formatting="emoji");var He=b(K);return K.emoji=!1,He}return fe===" "&&(U.match(/^ +$/,!1)?K.trailingSpace++:K.trailingSpace&&(K.trailingSpaceNewLine=!0)),b(K)}function p(U,K){var G=U.next();if(G===">"){K.f=K.inline=A,D.highlightFormatting&&(K.formatting="link");var ae=b(K);return ae?ae+=" ":ae="",ae+E.linkInline}return U.match(/^[^>]+/,!0),E.linkInline}function I(U,K){if(U.eatSpace())return null;var G=U.next();return G==="("||G==="["?(K.f=K.inline=P(G==="("?")":"]"),D.highlightFormatting&&(K.formatting="link-string"),K.linkHref=!0,b(K)):"error"}var M={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function P(U){return function(K,G){var ae=K.next();if(ae===U){G.f=G.inline=A,D.highlightFormatting&&(G.formatting="link-string");var fe=b(G);return G.linkHref=!1,fe}return K.match(M[U]),G.linkHref=!0,b(G)}}function B(U,K){return U.match(/^([^\]\\]|\\.)*\]:/,!1)?(K.f=H,U.next(),D.highlightFormatting&&(K.formatting="link"),K.linkText=!0,b(K)):f(U,K,A)}function H(U,K){if(U.match(/^\]:/,!0)){K.f=K.inline=F,D.highlightFormatting&&(K.formatting="link");var G=b(K);return K.linkText=!1,G}return U.match(/^([^\]\\]|\\.)+/,!0),E.linkText}function F(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=A,E.linkHref+" url")}var W={startState:function(){return{f:w,prevLine:{stream:null},thisLine:{stream:null},block:w,htmlState:null,indentation:0,inline:A,text:S,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&&j.copyState(R,U.htmlState),indentation:U.indentation,localMode:U.localMode,localState:U.localMode?j.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 g(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 G=U.match(/^\s*/,!0)[0].replace(/\t/g,i).length;if(K.indentation=G,K.indentationDiff=null,G>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:W}},indent:function(U,K,G){return U.block==C&&R.indent?R.indent(U.htmlState,K,G):U.localState&&U.localMode.indent?U.localMode.indent(U.localState,K,G):j.Pass},blankLine:g,getType:b,blockCommentStart:"<!--",blockCommentEnd:"-->",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return W},"xml"),j.defineMIME("text/markdown","markdown"),j.defineMIME("text/x-markdown","markdown")})},mHUz:function(Je,le,re){"use strict";Object.defineProperty(le,"__esModule",{value:!0}),le.default=void 0;var j={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};le.default=j},mTgk:function(Je,le,re){"use strict";Object.defineProperty(le,"__esModule",{value:!0}),le.default=void 0;var j=k(re("mHUz"));function k(y){return y&&y.__esModule?y:{default:y}}var D={};function R(y,v){if(v===void 0)throw new Error('Undefined keysym for key "'+y+'"');if(y in D)throw new Error('Duplicate entry for key "'+y+'"');D[y]=[v,v,v,v]}function O(y,v,u){if(v===void 0)throw new Error('Undefined keysym for key "'+y+'"');if(u===void 0)throw new Error('Undefined keysym for key "'+y+'"');if(y in D)throw new Error('Duplicate entry for key "'+y+'"');D[y]=[v,v,u,v]}function d(y,v,u){if(v===void 0)throw new Error('Undefined keysym for key "'+y+'"');if(u===void 0)throw new Error('Undefined keysym for key "'+y+'"');if(y in D)throw new Error('Duplicate entry for key "'+y+'"');D[y]=[v,v,v,u]}O("Alt",j.default.XK_Alt_L,j.default.XK_Alt_R),R("AltGraph",j.default.XK_ISO_Level3_Shift),R("CapsLock",j.default.XK_Caps_Lock),O("Control",j.default.XK_Control_L,j.default.XK_Control_R),O("Meta",j.default.XK_Super_L,j.default.XK_Super_R),R("NumLock",j.default.XK_Num_Lock),R("ScrollLock",j.default.XK_Scroll_Lock),O("Shift",j.default.XK_Shift_L,j.default.XK_Shift_R),d("Enter",j.default.XK_Return,j.default.XK_KP_Enter),R("Tab",j.default.XK_Tab),d(" ",j.default.XK_space,j.default.XK_KP_Space),d("ArrowDown",j.default.XK_Down,j.default.XK_KP_Down),d("ArrowUp",j.default.XK_Up,j.default.XK_KP_Up),d("ArrowLeft",j.default.XK_Left,j.default.XK_KP_Left),d("ArrowRight",j.default.XK_Right,j.default.XK_KP_Right),d("End",j.default.XK_End,j.default.XK_KP_End),d("Home",j.default.XK_Home,j.default.XK_KP_Home),d("PageDown",j.default.XK_Next,j.default.XK_KP_Next),d("PageUp",j.default.XK_Prior,j.default.XK_KP_Prior),R("Backspace",j.default.XK_BackSpace),d("Clear",j.default.XK_Clear,j.default.XK_KP_Begin),R("Copy",j.default.XF86XK_Copy),R("Cut",j.default.XF86XK_Cut),d("Delete",j.default.XK_Delete,j.default.XK_KP_Delete),d("Insert",j.default.XK_Insert,j.default.XK_KP_Insert),R("Paste",j.default.XF86XK_Paste),R("Redo",j.default.XK_Redo),R("Undo",j.default.XK_Undo),R("Cancel",j.default.XK_Cancel),R("ContextMenu",j.default.XK_Menu),R("Escape",j.default.XK_Escape),R("Execute",j.default.XK_Execute),R("Find",j.default.XK_Find),R("Help",j.default.XK_Help),R("Pause",j.default.XK_Pause),R("Select",j.default.XK_Select),R("ZoomIn",j.default.XF86XK_ZoomIn),R("ZoomOut",j.default.XF86XK_ZoomOut),R("BrightnessDown",j.default.XF86XK_MonBrightnessDown),R("BrightnessUp",j.default.XF86XK_MonBrightnessUp),R("Eject",j.default.XF86XK_Eject),R("LogOff",j.default.XF86XK_LogOff),R("Power",j.default.XF86XK_PowerOff),R("PowerOff",j.default.XF86XK_PowerDown),R("PrintScreen",j.default.XK_Print),R("Hibernate",j.default.XF86XK_Hibernate),R("Standby",j.default.XF86XK_Standby),R("WakeUp",j.default.XF86XK_WakeUp),R("AllCandidates",j.default.XK_MultipleCandidate),R("Alphanumeric",j.default.XK_Eisu_Shift),R("CodeInput",j.default.XK_Codeinput),R("Compose",j.default.XK_Multi_key),R("Convert",j.default.XK_Henkan),R("GroupFirst",j.default.XK_ISO_First_Group),R("GroupLast",j.default.XK_ISO_Last_Group),R("GroupNext",j.default.XK_ISO_Next_Group),R("GroupPrevious",j.default.XK_ISO_Prev_Group),R("NonConvert",j.default.XK_Muhenkan),R("PreviousCandidate",j.default.XK_PreviousCandidate),R("SingleCandidate",j.default.XK_SingleCandidate),R("HangulMode",j.default.XK_Hangul),R("HanjaMode",j.default.XK_Hangul_Hanja),R("JunjuaMode",j.default.XK_Hangul_Jeonja),R("Eisu",j.default.XK_Eisu_toggle),R("Hankaku",j.default.XK_Hankaku),R("Hiragana",j.default.XK_Hiragana),R("HiraganaKatakana",j.default.XK_Hiragana_Katakana),R("KanaMode",j.default.XK_Kana_Shift),R("KanjiMode",j.default.XK_Kanji),R("Katakana",j.default.XK_Katakana),R("Romaji",j.default.XK_Romaji),R("Zenkaku",j.default.XK_Zenkaku),R("ZenkakuHanaku",j.default.XK_Zenkaku_Hankaku),R("F1",j.default.XK_F1),R("F2",j.default.XK_F2),R("F3",j.default.XK_F3),R("F4",j.default.XK_F4),R("F5",j.default.XK_F5),R("F6",j.default.XK_F6),R("F7",j.default.XK_F7),R("F8",j.default.XK_F8),R("F9",j.default.XK_F9),R("F10",j.default.XK_F10),R("F11",j.default.XK_F11),R("F12",j.default.XK_F12),R("F13",j.default.XK_F13),R("F14",j.default.XK_F14),R("F15",j.default.XK_F15),R("F16",j.default.XK_F16),R("F17",j.default.XK_F17),R("F18",j.default.XK_F18),R("F19",j.default.XK_F19),R("F20",j.default.XK_F20),R("F21",j.default.XK_F21),R("F22",j.default.XK_F22),R("F23",j.default.XK_F23),R("F24",j.default.XK_F24),R("F25",j.default.XK_F25),R("F26",j.default.XK_F26),R("F27",j.default.XK_F27),R("F28",j.default.XK_F28),R("F29",j.default.XK_F29),R("F30",j.default.XK_F30),R("F31",j.default.XK_F31),R("F32",j.default.XK_F32),R("F33",j.default.XK_F33),R("F34",j.default.XK_F34),R("F35",j.default.XK_F35),R("Close",j.default.XF86XK_Close),R("MailForward",j.default.XF86XK_MailForward),R("MailReply",j.default.XF86XK_Reply),R("MailSend",j.default.XF86XK_Send),R("MediaFastForward",j.default.XF86XK_AudioForward),R("MediaPause",j.default.XF86XK_AudioPause),R("MediaPlay",j.default.XF86XK_AudioPlay),R("MediaRecord",j.default.XF86XK_AudioRecord),R("MediaRewind",j.default.XF86XK_AudioRewind),R("MediaStop",j.default.XF86XK_AudioStop),R("MediaTrackNext",j.default.XF86XK_AudioNext),R("MediaTrackPrevious",j.default.XF86XK_AudioPrev),R("New",j.default.XF86XK_New),R("Open",j.default.XF86XK_Open),R("Print",j.default.XK_Print),R("Save",j.default.XF86XK_Save),R("SpellCheck",j.default.XF86XK_Spell),R("AudioVolumeDown",j.default.XF86XK_AudioLowerVolume),R("AudioVolumeUp",j.default.XF86XK_AudioRaiseVolume),R("AudioVolumeMute",j.default.XF86XK_AudioMute),R("MicrophoneVolumeMute",j.default.XF86XK_AudioMicMute),R("LaunchApplication1",j.default.XF86XK_MyComputer),R("LaunchApplication2",j.default.XF86XK_Calculator),R("LaunchCalendar",j.default.XF86XK_Calendar),R("LaunchMail",j.default.XF86XK_Mail),R("LaunchMediaPlayer",j.default.XF86XK_AudioMedia),R("LaunchMusicPlayer",j.default.XF86XK_Music),R("LaunchPhone",j.default.XF86XK_Phone),R("LaunchScreenSaver",j.default.XF86XK_ScreenSaver),R("LaunchSpreadsheet",j.default.XF86XK_Excel),R("LaunchWebBrowser",j.default.XF86XK_WWW),R("LaunchWebCam",j.default.XF86XK_WebCam),R("LaunchWordProcessor",j.default.XF86XK_Word),R("BrowserBack",j.default.XF86XK_Back),R("BrowserFavorites",j.default.XF86XK_Favorites),R("BrowserForward",j.default.XF86XK_Forward),R("BrowserHome",j.default.XF86XK_HomePage),R("BrowserRefresh",j.default.XF86XK_Refresh),R("BrowserSearch",j.default.XF86XK_Search),R("BrowserStop",j.default.XF86XK_Stop),R("Dimmer",j.default.XF86XK_BrightnessAdjust),R("MediaAudioTrack",j.default.XF86XK_AudioCycleTrack),R("RandomToggle",j.default.XF86XK_AudioRandomPlay),R("SplitScreenToggle",j.default.XF86XK_SplitScreen),R("Subtitle",j.default.XF86XK_Subtitle),R("VideoModeNext",j.default.XF86XK_Next_VMode),d("=",j.default.XK_equal,j.default.XK_KP_Equal),d("+",j.default.XK_plus,j.default.XK_KP_Add),d("-",j.default.XK_minus,j.default.XK_KP_Subtract),d("*",j.default.XK_asterisk,j.default.XK_KP_Multiply),d("/",j.default.XK_slash,j.default.XK_KP_Divide),d(".",j.default.XK_period,j.default.XK_KP_Decimal),d(",",j.default.XK_comma,j.default.XK_KP_Separator),d("0",j.default.XK_0,j.default.XK_KP_0),d("1",j.default.XK_1,j.default.XK_KP_1),d("2",j.default.XK_2,j.default.XK_KP_2),d("3",j.default.XK_3,j.default.XK_KP_3),d("4",j.default.XK_4,j.default.XK_KP_4),d("5",j.default.XK_5,j.default.XK_KP_5),d("6",j.default.XK_6,j.default.XK_KP_6),d("7",j.default.XK_7,j.default.XK_KP_7),d("8",j.default.XK_8,j.default.XK_KP_8),d("9",j.default.XK_9,j.default.XK_KP_9);var E=D;le.default=E},mdZa:function(Je,le,re){"use strict";typeof Object.assign!="function"&&Object.defineProperty(Object,"assign",{value:function(k,D){"use strict";if(k==null)throw new TypeError("Cannot convert undefined or null to object");for(var R=Object(k),O=1;O<arguments.length;O++){var d=arguments[O];if(d!=null)for(var E in d)Object.prototype.hasOwnProperty.call(d,E)&&(R[E]=d[E])}return R},writable:!0,configurable:!0}),function(){function j(k,D){D=D||{bubbles:!1,cancelable:!1,detail:void 0};var R=document.createEvent("CustomEvent");return R.initCustomEvent(k,D.bubbles,D.cancelable,D.detail),R}j.prototype=window.Event.prototype,typeof window.CustomEvent!="function"&&(window.CustomEvent=j)}(),Number.isInteger=Number.isInteger||function(k){return typeof k=="number"&&isFinite(k)&&Math.floor(k)===k}},osHv:function(Je,le,re){(function(j){j(re("VrN/"))})(function(j){"use strict";var k=j.Pos;function D(o,i){return o.line-i.line||o.ch-i.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",O=R+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",d=new RegExp("<(/?)(["+R+"]["+O+"]*)","g");function E(o,i,f,h){this.line=i,this.ch=f,this.cm=o,this.text=o.getLine(i),this.min=h?Math.max(h.from,o.firstLine()):o.firstLine(),this.max=h?Math.min(h.to-1,o.lastLine()):o.lastLine()}function y(o,i){var f=o.cm.getTokenTypeAt(k(o.line,i));return f&&/\btag\b/.test(f)}function v(o){return o.line>=o.max?void 0:(o.ch=0,o.text=o.cm.getLine(++o.line),!0)}function u(o){return o.line<=o.min?void 0:(o.text=o.cm.getLine(--o.line),o.ch=o.text.length,!0)}function a(o){for(;;){var i=o.text.indexOf(">",o.ch);if(i==-1){if(v(o))continue;return}if(!y(o,i+1)){o.ch=i+1;continue}var f=o.text.lastIndexOf("/",i),h=f>-1&&!/\S/.test(o.text.slice(f+1,i));return o.ch=i+1,h?"selfClose":"regular"}}function c(o){for(;;){var i=o.ch?o.text.lastIndexOf("<",o.ch-1):-1;if(i==-1){if(u(o))continue;return}if(!y(o,i+1)){o.ch=i;continue}d.lastIndex=i,o.ch=i;var f=d.exec(o.text);if(f&&f.index==i)return f}}function s(o){for(;;){d.lastIndex=o.ch;var i=d.exec(o.text);if(!i){if(v(o))continue;return}if(!y(o,i.index+1)){o.ch=i.index+1;continue}return o.ch=i.index+i[0].length,i}}function l(o){for(;;){var i=o.ch?o.text.lastIndexOf(">",o.ch-1):-1;if(i==-1){if(u(o))continue;return}if(!y(o,i+1)){o.ch=i;continue}var f=o.text.lastIndexOf("/",i),h=f>-1&&!/\S/.test(o.text.slice(f+1,i));return o.ch=i+1,h?"selfClose":"regular"}}function r(o,i){for(var f=[];;){var h=s(o),T,g=o.line,w=o.ch-(h?h[0].length:0);if(!h||!(T=a(o)))return;if(T=="selfClose")continue;if(h[1]){for(var C=f.length-1;C>=0;--C)if(f[C]==h[2]){f.length=C;break}if(C<0&&(!i||i==h[2]))return{tag:h[2],from:k(g,w),to:k(o.line,o.ch)}}else f.push(h[2])}}function n(o,i){for(var f=[];;){var h=l(o);if(!h)return;if(h=="selfClose"){c(o);continue}var T=o.line,g=o.ch,w=c(o);if(!w)return;if(w[1])f.push(w[2]);else{for(var C=f.length-1;C>=0;--C)if(f[C]==w[2]){f.length=C;break}if(C<0&&(!i||i==w[2]))return{tag:w[2],from:k(o.line,o.ch),to:k(T,g)}}}}j.registerHelper("fold","xml",function(o,i){for(var f=new E(o,i.line,0);;){var h=s(f);if(!h||f.line!=i.line)return;var T=a(f);if(!T)return;if(!h[1]&&T!="selfClose"){var g=k(f.line,f.ch),w=r(f,h[2]);return w&&D(w.from,g)>0?{from:g,to:w.from}:null}}}),j.findMatchingTag=function(o,i,f){var h=new E(o,i.line,i.ch,f);if(h.text.indexOf(">")==-1&&h.text.indexOf("<")==-1)return;var T=a(h),g=T&&k(h.line,h.ch),w=T&&c(h);if(!T||!w||D(h,i)>0)return;var C={from:k(h.line,h.ch),to:g,tag:w[2]};return T=="selfClose"?{open:C,close:null,at:"open"}:w[1]?{open:n(h,w[2]),close:C,at:"close"}:(h=new E(o,g.line,g.ch,f),{open:C,close:r(h,w[2]),at:"open"})},j.findEnclosingTag=function(o,i,f,h){for(var T=new E(o,i.line,i.ch,f);;){var g=n(T,h);if(!g)break;var w=new E(o,i.line,i.ch,f),C=r(w,g.tag);if(C)return{open:g,close:C}}},j.scanForClosingTag=function(o,i,f,h){var T=new E(o,i.line,i.ch,h?{from:0,to:h}:null);return r(T,f)}})},p5ED:function(Je,le,re){"use strict";var j=re("+L6B"),k=re("2/Rp"),D=re("5Dmo"),R=re("3S7+"),O=re("k1fw"),d=re("tJVT"),E=re("cDcd"),y=re.n(E),v=re("vHTk"),u=re.n(v),a=re("yEEn"),c=re("ZW9T"),s=re("1vsH");le.a=function(l){var r=l.name,n=l.data,o=l.theme,i=l.type,f=l.filename,h=l.monacoEditor,T=l.className,g=l.style,w=l.close,C=l.onClose,x=l.hasMask,b=Object(E.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),S=Object(d.a)(b,2),A=S[0],p=S[1],I=Object(E.useState)(""),M=Object(d.a)(I,2),P=M[0],B=M[1],H,F=1024*1024,W=10*F,U=Object(E.useRef)();i==="office"&&(H=Object(s.V)(n).filesize,H>W&&(i="other")),f&&(h.filename=f),Object(E.useEffect)(function(){var ae,fe,Se=(ae=document.cookie)===null||ae===void 0||((fe=ae.replace(/\s/g,""))===null||fe===void 0)?void 0:fe.split(";");Se==null||Se.map(function(Ue){var Ne=Ue.split("=");Ne[0]==="_educoder_session"&&B(Ne[1])})},[]);var K=function(){if(n.startsWith("http")||n.startsWith("/")){G();return}Object(s.z)(f||"educoder",n,f)},G=function(){Object(s.x)(f||r,n)};return console.log("data:",n,"fileanme:",f," name:",r),y.a.createElement("div",{style:Object(O.a)({},g||{}),className:"".concat(x&&u.a.bgBlack," ").concat(i?u.a.wrp:"hide")},w&&y.a.createElement("div",{className:u.a.close,ref:U},y.a.createElement(R.a,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:function(){return U.current}},y.a.createElement("span",{onClick:G},y.a.createElement("i",{className:"icon-quxiaozhiding"}))),y.a.createElement(R.a,{title:"\u5173\u95ED",getPopupContainer:function(){return U.current}},y.a.createElement("span",{className:"",onClick:C},y.a.createElement("i",{className:"icon-guanbi1"})))),y.a.createElement("div",{className:"".concat(u.a[T]," ").concat(T," ").concat(u.a.monaco," ").concat(i==="txt"?"show":"hide")},i==="txt"&&y.a.createElement(c.b,h)),i==="audio"&&y.a.createElement("audio",{src:"".concat(n!=null&&n.startsWith("/")||(n==null?void 0:n.indexOf("https://"))>-1?n:"data:audio/mp3;base64,").concat(n),autoPlay:!0}),i==="video"&&y.a.createElement(y.a.Fragment,null,n!=null&&n.startsWith("/")?y.a.createElement("video",{controls:!0,src:"".concat(n),autoPlay:!0}):y.a.createElement("video",{controls:!0,src:"data:video/mp4;base64,".concat(n),autoPlay:!0})),i==="html"&&y.a.createElement("iframe",{src:n+"&disposition=inline"}),i==="pdf"&&y.a.createElement("embed",{className:u.a.embed,src:n}),i==="image"&&y.a.createElement(y.a.Fragment,null,y.a.createElement("img",{src:"".concat(n!=null&&n.startsWith("/")||(n==null?void 0:n.indexOf("https://"))>-1?"":"data:image/png;base64,").concat(n)})),i==="other"&&y.a.createElement("div",null,y.a.createElement(k.a,{type:"primary",size:"large",onClick:K},y.a.createElement(a.a,null),"\u70B9\u51FB\u4E0B\u8F7D")),(i==="download"||i==="office")&&y.a.createElement(k.a,{type:"primary",size:"large",onClick:K},y.a.createElement(a.a,null),"\u70B9\u51FB\u4E0B\u8F7D"))}},"p77/":function(Je,le,re){},q7KB:function(Je,le,re){},"rAM+":function(Je,le,re){"use strict";re.d(le,"a",function(){return k});var j=re("Qw5x");function k(D,R){var O;if(typeof Symbol=="undefined"||D[Symbol.iterator]==null){if(Array.isArray(D)||(O=Object(j.a)(D))||R&&D&&typeof D.length=="number"){O&&(D=O);var d=0,E=function(){};return{s:E,n:function(){return d>=D.length?{done:!0}:{done:!1,value:D[d++]}},e:function(c){throw c},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 y=!0,v=!1,u;return{s:function(){O=D[Symbol.iterator]()},n:function(){var c=O.next();return y=c.done,c},e:function(c){v=!0,u=c},f:function(){try{!y&&O.return!=null&&O.return()}finally{if(v)throw u}}}}},rUJ1:function(Je,le){const re=/[&<>"']/,j=/[&<>"']/g,k=/[<>"']|&(?!#?\w+;)/,D=/[<>"']|&(?!#?\w+;)/g,R={"&":"&","<":"<",">":">",'"':""","'":"'"},O=x=>R[x];function d(x,b){if(b){if(re.test(x))return x.replace(j,O)}else if(k.test(x))return x.replace(D,O);return x}const E=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function y(x){return x.replace(E,(b,S)=>(S=S.toLowerCase(),S==="colon"?":":S.charAt(0)==="#"?S.charAt(1)==="x"?String.fromCharCode(parseInt(S.substring(2),16)):String.fromCharCode(+S.substring(1)):""))}const v=/(^|[^\[])\^/g;function u(x,b){x=x.source||x,b=b||"";const S={replace:(A,p)=>(p=p.source||p,p=p.replace(v,"$1"),x=x.replace(A,p),S),getRegex:()=>new RegExp(x,b)};return S}const a=/[^\w:]/g,c=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function s(x,b,S){if(x){let A;try{A=decodeURIComponent(y(S)).replace(a,"").toLowerCase()}catch(p){return null}if(A.indexOf("javascript:")===0||A.indexOf("vbscript:")===0||A.indexOf("data:")===0)return null}b&&!c.test(S)&&(S=i(b,S));try{S=encodeURI(S).replace(/%25/g,"%")}catch(A){return null}return S}const l={},r=/^[^:]+:\/*[^/]*$/,n=/^([^:]+:)[\s\S]*$/,o=/^([^:]+:\/*[^/]*)[\s\S]*$/;function i(x,b){l[" "+x]||(r.test(x)?l[" "+x]=x+"/":l[" "+x]=g(x,"/",!0)),x=l[" "+x];const S=x.indexOf(":")===-1;return b.substring(0,2)==="//"?S?b:x.replace(n,"$1")+b:b.charAt(0)==="/"?S?b:x.replace(o,"$1")+b:x+b}const f={exec:function(){}};function h(x){let b=1,S,A;for(;b<arguments.length;b++){S=arguments[b];for(A in S)Object.prototype.hasOwnProperty.call(S,A)&&(x[A]=S[A])}return x}function T(x,b){const S=x.replace(/\|/g,(I,M,P)=>{let B=!1,H=M;for(;--H>=0&&P[H]==="\\";)B=!B;return B?"|":" |"}),A=S.split(/ \|/);let p=0;if(A.length>b)A.splice(b);else for(;A.length<b;)A.push("");for(;p<A.length;p++)A[p]=A[p].trim().replace(/\\\|/g,"|");return A}function g(x,b,S){const A=x.length;if(A===0)return"";let p=0;for(;p<A;){const I=x.charAt(A-p-1);if(I===b&&!S)p++;else if(I!==b&&S)p++;else break}return x.substr(0,A-p)}function w(x,b){if(x.indexOf(b[1])===-1)return-1;const S=x.length;let A=0,p=0;for(;p<S;p++)if(x[p]==="\\")p++;else if(x[p]===b[0])A++;else if(x[p]===b[1]&&(A--,A<0))return p;return-1}function C(x){x&&x.sanitize&&!x.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")}Je.exports={escape:d,unescape:y,edit:u,cleanUrl:s,resolveUrl:i,noopTest:f,merge:h,splitCells:T,rtrim:g,findClosingBracket:w,checkSanitizeDeprecation:C}},rwxt:function(Je,le,re){"use strict";Object.defineProperty(le,"__esModule",{value:!0}),le.default=void 0;var j=re("GdRQ");function k(E,y){if(!(E instanceof y))throw new TypeError("Cannot call a class as a function")}function D(E,y){for(var v=0;v<y.length;v++){var u=y[v];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(E,u.key,u)}}function R(E,y,v){return y&&D(E.prototype,y),v&&D(E,v),E}var O=!j.supportsCursorURIs||j.isTouchDevice,d=function(){function E(){k(this,E),this._target=null,this._canvas=document.createElement("canvas"),O&&(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(v){if(this._target&&this.detach(),this._target=v,O){document.body.appendChild(this._canvas);var u={capture:!0,passive:!0};this._target.addEventListener("mouseover",this._eventHandlers.mouseover,u),this._target.addEventListener("mouseleave",this._eventHandlers.mouseleave,u),this._target.addEventListener("mousemove",this._eventHandlers.mousemove,u),this._target.addEventListener("mouseup",this._eventHandlers.mouseup,u)}this.clear()}},{key:"detach",value:function(){if(!this._target)return;if(O){var v={capture:!0,passive:!0};this._target.removeEventListener("mouseover",this._eventHandlers.mouseover,v),this._target.removeEventListener("mouseleave",this._eventHandlers.mouseleave,v),this._target.removeEventListener("mousemove",this._eventHandlers.mousemove,v),this._target.removeEventListener("mouseup",this._eventHandlers.mouseup,v),document.body.removeChild(this._canvas)}this._target=null}},{key:"change",value:function(v,u,a,c,s){if(c===0||s===0){this.clear();return}this._position.x=this._position.x+this._hotSpot.x-u,this._position.y=this._position.y+this._hotSpot.y-a,this._hotSpot.x=u,this._hotSpot.y=a;var l=this._canvas.getContext("2d");this._canvas.width=c,this._canvas.height=s;var r;try{r=new ImageData(new Uint8ClampedArray(v),c,s)}catch(o){r=l.createImageData(c,s),r.data.set(new Uint8ClampedArray(v))}if(l.clearRect(0,0,c,s),l.putImageData(r,0,0),O)this._updatePosition();else{var n=this._canvas.toDataURL();this._target.style.cursor="url("+n+")"+u+" "+a+", 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(v,u){if(!O)return;window.visualViewport?(this._position.x=v+window.visualViewport.offsetLeft,this._position.y=u+window.visualViewport.offsetTop):(this._position.x=v,this._position.y=u),this._updatePosition();var a=document.elementFromPoint(v,u);this._updateVisibility(a)}},{key:"_handleMouseOver",value:function(v){this._handleMouseMove(v)}},{key:"_handleMouseLeave",value:function(v){this._updateVisibility(v.relatedTarget)}},{key:"_handleMouseMove",value:function(v){this._updateVisibility(v.target),this._position.x=v.clientX-this._hotSpot.x,this._position.y=v.clientY-this._hotSpot.y,this._updatePosition()}},{key:"_handleMouseUp",value:function(v){var u=this,a=document.elementFromPoint(v.clientX,v.clientY);this._updateVisibility(a),this._captureIsActive()&&window.setTimeout(function(){if(!u._target)return;a=document.elementFromPoint(v.clientX,v.clientY),u._updateVisibility(a)},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(v){return v?v===this._target?!0:this._target.contains(v)?!(window.getComputedStyle(v).cursor!=="none"):!1:!1}},{key:"_updateVisibility",value:function(v){this._captureIsActive()&&(v=document.captureElement),this._shouldShowCursor(v)?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}();le.default=d},sjKO:function(Je,le,re){"use strict";Object.defineProperty(le,"__esModule",{value:!0}),le.default=D;var j=30,k=12;function D(R,O){var d,E,y,v,u,a,c,s,l,r,n,o,i,f,h,T,g,w,C,x,b,S,A,p,I;d=R.state,E=R.next_in,p=R.input,y=E+(R.avail_in-5),v=R.next_out,I=R.output,u=v-(O-R.avail_out),a=v+(R.avail_out-257),c=d.dmax,s=d.wsize,l=d.whave,r=d.wnext,n=d.window,o=d.hold,i=d.bits,f=d.lencode,h=d.distcode,T=(1<<d.lenbits)-1,g=(1<<d.distbits)-1;e:do{i<15&&(o+=p[E++]<<i,i+=8,o+=p[E++]<<i,i+=8),w=f[o&T];t:for(;;){if(C=w>>>24,o>>>=C,i-=C,C=w>>>16&255,C===0)I[v++]=w&65535;else if(C&16){x=w&65535,C&=15,C&&(i<C&&(o+=p[E++]<<i,i+=8),x+=o&(1<<C)-1,o>>>=C,i-=C),i<15&&(o+=p[E++]<<i,i+=8,o+=p[E++]<<i,i+=8),w=h[o&g];r:for(;;){if(C=w>>>24,o>>>=C,i-=C,C=w>>>16&255,C&16){if(b=w&65535,C&=15,i<C&&(o+=p[E++]<<i,i+=8,i<C&&(o+=p[E++]<<i,i+=8)),b+=o&(1<<C)-1,b>c){R.msg="invalid distance too far back",d.mode=j;break e}if(o>>>=C,i-=C,C=v-u,b>C){if(C=b-C,C>l&&d.sane){R.msg="invalid distance too far back",d.mode=j;break e}if(S=0,A=n,r===0){if(S+=s-C,C<x){x-=C;do I[v++]=n[S++];while(--C);S=v-b,A=I}}else if(r<C){if(S+=s+r-C,C-=r,C<x){x-=C;do I[v++]=n[S++];while(--C);if(S=0,r<x){C=r,x-=C;do I[v++]=n[S++];while(--C);S=v-b,A=I}}}else if(S+=r-C,C<x){x-=C;do I[v++]=n[S++];while(--C);S=v-b,A=I}for(;x>2;)I[v++]=A[S++],I[v++]=A[S++],I[v++]=A[S++],x-=3;x&&(I[v++]=A[S++],x>1&&(I[v++]=A[S++]))}else{S=v-b;do I[v++]=I[S++],I[v++]=I[S++],I[v++]=I[S++],x-=3;while(x>2);x&&(I[v++]=I[S++],x>1&&(I[v++]=I[S++]))}}else if((C&64)===0){w=h[(w&65535)+(o&(1<<C)-1)];continue r}else{R.msg="invalid distance code",d.mode=j;break e}break}}else if((C&64)===0){w=f[(w&65535)+(o&(1<<C)-1)];continue t}else if(C&32){d.mode=k;break e}else{R.msg="invalid literal/length code",d.mode=j;break e}break}}while(E<y&&v<a);x=i>>3,E-=x,i-=x<<3,o&=(1<<i)-1,R.next_in=E,R.next_out=v,R.avail_in=E<y?5+(y-E):5-(E-y),R.avail_out=v<a?257+(a-v):257-(v-a),d.hold=o,d.bits=i;return}},ulZh:function(Je,le,re){typeof window!="undefined"&&function(k,D){Je.exports=D()}(this,function(){return function(j){var k={};function D(R){if(k[R])return k[R].exports;var O=k[R]={i:R,l:!1,exports:{}};return j[R].call(O.exports,O,O.exports,D),O.l=!0,O.exports}return D.m=j,D.c=k,D.d=function(R,O,d){D.o(R,O)||Object.defineProperty(R,O,{enumerable:!0,get:d})},D.r=function(R){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(R,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(R,"__esModule",{value:!0})},D.t=function(R,O){if(O&1&&(R=D(R)),O&8)return R;if(O&4&&typeof R=="object"&&R&&R.__esModule)return R;var d=Object.create(null);if(D.r(d),Object.defineProperty(d,"default",{enumerable:!0,value:R}),O&2&&typeof R!="string")for(var E in R)D.d(d,E,function(y){return R[y]}.bind(null,E));return d},D.n=function(R){var O=R&&R.__esModule?function(){return R.default}:function(){return R};return D.d(O,"a",O),O},D.o=function(R,O){return Object.prototype.hasOwnProperty.call(R,O)},D.p="/dist/",D(D.s="./src/hls.ts")}({"./node_modules/eventemitter3/index.js":function(j,k,D){"use strict";var R=Object.prototype.hasOwnProperty,O="~";function d(){}Object.create&&(d.prototype=Object.create(null),new d().__proto__||(O=!1));function E(a,c,s){this.fn=a,this.context=c,this.once=s||!1}function y(a,c,s,l,r){if(typeof s!="function")throw new TypeError("The listener must be a function");var n=new E(s,l||a,r),o=O?O+c:c;return a._events[o]?a._events[o].fn?a._events[o]=[a._events[o],n]:a._events[o].push(n):(a._events[o]=n,a._eventsCount++),a}function v(a,c){--a._eventsCount===0?a._events=new d:delete a._events[c]}function u(){this._events=new d,this._eventsCount=0}u.prototype.eventNames=function(){var c=[],s,l;if(this._eventsCount===0)return c;for(l in s=this._events)R.call(s,l)&&c.push(O?l.slice(1):l);return Object.getOwnPropertySymbols?c.concat(Object.getOwnPropertySymbols(s)):c},u.prototype.listeners=function(c){var s=O?O+c:c,l=this._events[s];if(!l)return[];if(l.fn)return[l.fn];for(var r=0,n=l.length,o=new Array(n);r<n;r++)o[r]=l[r].fn;return o},u.prototype.listenerCount=function(c){var s=O?O+c:c,l=this._events[s];return l?l.fn?1:l.length:0},u.prototype.emit=function(c,s,l,r,n,o){var i=O?O+c:c;if(!this._events[i])return!1;var f=this._events[i],h=arguments.length,T,g;if(f.fn){f.once&&this.removeListener(c,f.fn,void 0,!0);switch(h){case 1:return f.fn.call(f.context),!0;case 2:return f.fn.call(f.context,s),!0;case 3:return f.fn.call(f.context,s,l),!0;case 4:return f.fn.call(f.context,s,l,r),!0;case 5:return f.fn.call(f.context,s,l,r,n),!0;case 6:return f.fn.call(f.context,s,l,r,n,o),!0}for(g=1,T=new Array(h-1);g<h;g++)T[g-1]=arguments[g];f.fn.apply(f.context,T)}else{var w=f.length,C;for(g=0;g<w;g++){f[g].once&&this.removeListener(c,f[g].fn,void 0,!0);switch(h){case 1:f[g].fn.call(f[g].context);break;case 2:f[g].fn.call(f[g].context,s);break;case 3:f[g].fn.call(f[g].context,s,l);break;case 4:f[g].fn.call(f[g].context,s,l,r);break;default:if(!T)for(C=1,T=new Array(h-1);C<h;C++)T[C-1]=arguments[C];f[g].fn.apply(f[g].context,T)}}}return!0},u.prototype.on=function(c,s,l){return y(this,c,s,l,!1)},u.prototype.once=function(c,s,l){return y(this,c,s,l,!0)},u.prototype.removeListener=function(c,s,l,r){var n=O?O+c:c;if(!this._events[n])return this;if(!s)return v(this,n),this;var o=this._events[n];if(o.fn)o.fn===s&&(!r||o.once)&&(!l||o.context===l)&&v(this,n);else{for(var i=0,f=[],h=o.length;i<h;i++)(o[i].fn!==s||r&&!o[i].once||l&&o[i].context!==l)&&f.push(o[i]);f.length?this._events[n]=f.length===1?f[0]:f:v(this,n)}return this},u.prototype.removeAllListeners=function(c){var s;return c?(s=O?O+c:c,this._events[s]&&v(this,s)):(this._events=new d,this._eventsCount=0),this},u.prototype.off=u.prototype.removeListener,u.prototype.addListener=u.prototype.on,u.prefixed=O,u.EventEmitter=u,j.exports=u},"./node_modules/url-toolkit/src/url-toolkit.js":function(j,k,D){(function(R){var O=/^((?:[a-zA-Z0-9+\-.]+:)?)(\/\/[^\/?#]*)?((?:[^\/?#]*\/)*[^;?#]*)?(;[^?#]*)?(\?[^#]*)?(#[^]*)?$/,d=/^([^\/?#]*)([^]*)$/,E=/(?:\/|^)\.(?=\/)/g,y=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,v={buildAbsoluteURL:function(u,a,c){if(c=c||{},u=u.trim(),a=a.trim(),!a){if(!c.alwaysNormalize)return u;var s=v.parseURL(u);if(!s)throw new Error("Error trying to parse base URL.");return s.path=v.normalizePath(s.path),v.buildURLFromParts(s)}var l=v.parseURL(a);if(!l)throw new Error("Error trying to parse relative URL.");if(l.scheme)return c.alwaysNormalize?(l.path=v.normalizePath(l.path),v.buildURLFromParts(l)):a;var r=v.parseURL(u);if(!r)throw new Error("Error trying to parse base URL.");if(!r.netLoc&&r.path&&r.path[0]!=="/"){var n=d.exec(r.path);r.netLoc=n[1],r.path=n[2]}r.netLoc&&!r.path&&(r.path="/");var o={scheme:r.scheme,netLoc:l.netLoc,path:null,params:l.params,query:l.query,fragment:l.fragment};if(!l.netLoc&&(o.netLoc=r.netLoc,l.path[0]!=="/"))if(!l.path)o.path=r.path,l.params||(o.params=r.params,l.query||(o.query=r.query));else{var i=r.path,f=i.substring(0,i.lastIndexOf("/")+1)+l.path;o.path=v.normalizePath(f)}return o.path===null&&(o.path=c.alwaysNormalize?v.normalizePath(l.path):l.path),v.buildURLFromParts(o)},parseURL:function(u){var a=O.exec(u);return a?{scheme:a[1]||"",netLoc:a[2]||"",path:a[3]||"",params:a[4]||"",query:a[5]||"",fragment:a[6]||""}:null},normalizePath:function(u){for(u=u.split("").reverse().join("").replace(E,"");u.length!==(u=u.replace(y,"")).length;);return u.split("").reverse().join("")},buildURLFromParts:function(u){return u.scheme+u.netLoc+u.path+u.params+u.query+u.fragment}};j.exports=v})(this)},"./node_modules/webworkify-webpack/index.js":function(j,k,D){function R(c){var s={};function l(n){if(s[n])return s[n].exports;var o=s[n]={i:n,l:!1,exports:{}};return c[n].call(o.exports,o,o.exports,l),o.l=!0,o.exports}l.m=c,l.c=s,l.i=function(n){return n},l.d=function(n,o,i){l.o(n,o)||Object.defineProperty(n,o,{configurable:!1,enumerable:!0,get:i})},l.r=function(n){Object.defineProperty(n,"__esModule",{value:!0})},l.n=function(n){var o=n&&n.__esModule?function(){return n.default}:function(){return n};return l.d(o,"a",o),o},l.o=function(n,o){return Object.prototype.hasOwnProperty.call(n,o)},l.p="/",l.oe=function(n){throw console.error(n),n};var r=l(l.s=ENTRY_MODULE);return r.default||r}var O="[\\.|\\-|\\+|\\w|/|@]+",d="\\(\\s*(/\\*.*?\\*/)?\\s*.*?("+O+").*?\\)";function E(c){return(c+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function y(c){return!isNaN(1*c)}function v(c,s,l){var r={};r[l]=[];var n=s.toString(),o=n.match(/^function\s?\w*\(\w+,\s*\w+,\s*(\w+)\)/);if(!o)return r;for(var i=o[1],f=new RegExp("(\\\\n|\\W)"+E(i)+d,"g"),h;h=f.exec(n);){if(h[3]==="dll-reference")continue;r[l].push(h[3])}for(f=new RegExp("\\("+E(i)+'\\("(dll-reference\\s('+O+'))"\\)\\)'+d,"g");h=f.exec(n);)c[h[2]]||(r[l].push(h[1]),c[h[2]]=D(h[1]).m),r[h[2]]=r[h[2]]||[],r[h[2]].push(h[4]);for(var T=Object.keys(r),g=0;g<T.length;g++)for(var w=0;w<r[T[g]].length;w++)y(r[T[g]][w])&&(r[T[g]][w]=1*r[T[g]][w]);return r}function u(c){var s=Object.keys(c);return s.reduce(function(l,r){return l||c[r].length>0},!1)}function a(c,s){for(var l={main:[s]},r={main:[]},n={main:{}};u(l);)for(var o=Object.keys(l),i=0;i<o.length;i++){var f=o[i],h=l[f],T=h.pop();if(n[f]=n[f]||{},n[f][T]||!c[f][T])continue;n[f][T]=!0,r[f]=r[f]||[],r[f].push(T);for(var g=v(c,c[f][T],f),w=Object.keys(g),C=0;C<w.length;C++)l[w[C]]=l[w[C]]||[],l[w[C]]=l[w[C]].concat(g[w[C]])}return r}j.exports=function(c,s){s=s||{};var l={main:D.m},r=s.all?{main:Object.keys(l.main)}:a(l,c),n="";Object.keys(r).filter(function(T){return T!=="main"}).forEach(function(T){for(var g=0;r[T][g];)g++;r[T].push(g),l[T][g]="(function(module, exports, __webpack_require__) { module.exports = __webpack_require__; })",n=n+"var "+T+" = ("+R.toString().replace("ENTRY_MODULE",JSON.stringify(g))+")({"+r[T].map(function(w){return""+JSON.stringify(w)+": "+l[T][w].toString()}).join(",")+`});
|
|
|
`}),n=n+"new (("+R.toString().replace("ENTRY_MODULE",JSON.stringify(c))+")({"+r.main.map(function(T){return""+JSON.stringify(T)+": "+l.main[T].toString()}).join(",")+"}))(self);";var o=new window.Blob([n],{type:"text/javascript"});if(s.bare)return o;var i=window.URL||window.webkitURL||window.mozURL||window.msURL,f=i.createObjectURL(o),h=new window.Worker(f);return h.objectURL=f,h}},"./src/config.ts":function(j,k,D){"use strict";D.r(k),D.d(k,"hlsDefaultConfig",function(){return C}),D.d(k,"mergeConfig",function(){return b}),D.d(k,"enableStreamingMode",function(){return S});var R=D("./src/controller/abr-controller.ts"),O=D("./src/controller/audio-stream-controller.ts"),d=D("./src/controller/audio-track-controller.ts"),E=D("./src/controller/subtitle-stream-controller.ts"),y=D("./src/controller/subtitle-track-controller.ts"),v=D("./src/controller/buffer-controller.ts"),u=D("./src/controller/timeline-controller.ts"),a=D("./src/controller/cap-level-controller.ts"),c=D("./src/controller/fps-controller.ts"),s=D("./src/controller/eme-controller.ts"),l=D("./src/controller/cmcd-controller.ts"),r=D("./src/utils/xhr-loader.ts"),n=D("./src/utils/fetch-loader.ts"),o=D("./src/utils/cues.ts"),i=D("./src/utils/mediakeys-helper.ts"),f=D("./src/utils/logger.ts");function h(){return h=Object.assign||function(A){for(var p=1;p<arguments.length;p++){var I=arguments[p];for(var M in I)Object.prototype.hasOwnProperty.call(I,M)&&(A[M]=I[M])}return A},h.apply(this,arguments)}function T(A,p){var I=Object.keys(A);if(Object.getOwnPropertySymbols){var M=Object.getOwnPropertySymbols(A);p&&(M=M.filter(function(P){return Object.getOwnPropertyDescriptor(A,P).enumerable})),I.push.apply(I,M)}return I}function g(A){for(var p=1;p<arguments.length;p++){var I=arguments[p]!=null?arguments[p]:{};p%2?T(Object(I),!0).forEach(function(M){w(A,M,I[M])}):Object.getOwnPropertyDescriptors?Object.defineProperties(A,Object.getOwnPropertyDescriptors(I)):T(Object(I)).forEach(function(M){Object.defineProperty(A,M,Object.getOwnPropertyDescriptor(I,M))})}return A}function w(A,p,I){return p in A?Object.defineProperty(A,p,{value:I,enumerable:!0,configurable:!0,writable:!0}):A[p]=I,A}var C=g(g({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:r.default,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,licenseResponseCallback:void 0,abrController:R.default,bufferController:v.default,capLevelController:a.default,fpsController:c.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:i.requestMediaKeySystemAccess,testBandwidth:!0,progressive:!1,lowLatencyMode:!0,cmcd:void 0},x()),{},{subtitleStreamController:E.SubtitleStreamController,subtitleTrackController:y.default,timelineController:u.TimelineController,audioStreamController:O.default,audioTrackController:d.default,emeController:s.default,cmcdController:l.default});function x(){return{cueHandler:o.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 b(A,p){if((p.liveSyncDurationCount||p.liveMaxLatencyDurationCount)&&(p.liveSyncDuration||p.liveMaxLatencyDuration))throw new Error("Illegal hls.js config: don't mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration");if(p.liveMaxLatencyDurationCount!==void 0&&(p.liveSyncDurationCount===void 0||p.liveMaxLatencyDurationCount<=p.liveSyncDurationCount))throw new Error('Illegal hls.js config: "liveMaxLatencyDurationCount" must be greater than "liveSyncDurationCount"');if(p.liveMaxLatencyDuration!==void 0&&(p.liveSyncDuration===void 0||p.liveMaxLatencyDuration<=p.liveSyncDuration))throw new Error('Illegal hls.js config: "liveMaxLatencyDuration" must be greater than "liveSyncDuration"');return h({},A,p)}function S(A){var p=A.loader;if(p!==n.default&&p!==r.default)f.logger.log("[config]: Custom loader detected, cannot enable progressive streaming"),A.progressive=!1;else{var I=Object(n.fetchSupported)();I&&(A.loader=n.default,A.progressive=!0,A.enableSoftwareAES=!0,f.logger.log("[config]: Progressive streaming enabled, using FetchLoader"))}}},"./src/controller/abr-controller.ts":function(j,k,D){"use strict";D.r(k);var R=D("./src/polyfills/number.ts"),O=D("./src/utils/ewma-bandwidth-estimator.ts"),d=D("./src/events.ts"),E=D("./src/utils/buffer-helper.ts"),y=D("./src/errors.ts"),v=D("./src/types/loader.ts"),u=D("./src/utils/logger.ts");function a(l,r){for(var n=0;n<r.length;n++){var o=r[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(l,o.key,o)}}function c(l,r,n){return r&&a(l.prototype,r),n&&a(l,n),l}var s=function(){function l(n){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=n;var o=n.config;this.bwEstimator=new O.default(o.abrEwmaSlowVoD,o.abrEwmaFastVoD,o.abrEwmaDefaultEstimate),this.registerListeners()}var r=l.prototype;return r.registerListeners=function(){var o=this.hls;o.on(d.Events.FRAG_LOADING,this.onFragLoading,this),o.on(d.Events.FRAG_LOADED,this.onFragLoaded,this),o.on(d.Events.FRAG_BUFFERED,this.onFragBuffered,this),o.on(d.Events.LEVEL_LOADED,this.onLevelLoaded,this),o.on(d.Events.ERROR,this.onError,this)},r.unregisterListeners=function(){var o=this.hls;o.off(d.Events.FRAG_LOADING,this.onFragLoading,this),o.off(d.Events.FRAG_LOADED,this.onFragLoaded,this),o.off(d.Events.FRAG_BUFFERED,this.onFragBuffered,this),o.off(d.Events.LEVEL_LOADED,this.onLevelLoaded,this),o.off(d.Events.ERROR,this.onError,this)},r.destroy=function(){this.unregisterListeners(),this.clearTimer(),this.hls=this.onCheck=null,this.fragCurrent=this.partCurrent=null},r.onFragLoading=function(o,i){var f=i.frag;if(f.type===v.PlaylistLevelType.MAIN&&!this.timer){var h;this.fragCurrent=f,this.partCurrent=(h=i.part)!=null?h:null,this.timer=self.setInterval(this.onCheck,100)}},r.onLevelLoaded=function(o,i){var f=this.hls.config;i.details.live?this.bwEstimator.update(f.abrEwmaSlowLive,f.abrEwmaFastLive):this.bwEstimator.update(f.abrEwmaSlowVoD,f.abrEwmaFastVoD)},r._abandonRulesCheck=function(){var o=this.fragCurrent,i=this.partCurrent,f=this.hls,h=f.autoLevelEnabled,T=f.config,g=f.media;if(!o||!g)return;var w=i?i.stats:o.stats,C=i?i.duration:o.duration;if(w.aborted){u.logger.warn("frag loader destroy or aborted, disarm abandonRules"),this.clearTimer(),this._nextAutoLevel=-1;return}if(!h||g.paused||!g.playbackRate||!g.readyState)return;var x=performance.now()-w.loading.start,b=Math.abs(g.playbackRate);if(x<=500*C/b)return;var S=f.levels,A=f.minAutoLevel,p=S[o.level],I=w.total||Math.max(w.loaded,Math.round(C*p.maxBitrate/8)),M=Math.max(1,w.bwEstimate?w.bwEstimate/8:w.loaded*1e3/x),P=(I-w.loaded)/M,B=g.currentTime,H=(E.BufferHelper.bufferInfo(g,B,T.maxBufferHole).end-B)/b;if(H>=2*C/b||P<=H)return;var F=Number.POSITIVE_INFINITY,W;for(W=o.level-1;W>A;W--){var U=S[W].maxBitrate;if(F=C*U/(8*.8*M),F<H)break}if(F>=P)return;var K=this.bwEstimator.getEstimate();u.logger.warn("Fragment "+o.sn+(i?" part "+i.index:"")+" of level "+o.level+" is loading too slowly and will cause an underbuffer; aborting and switching to level "+W+`
|
|
|
Current BW estimate: `+(Object(R.isFiniteNumber)(K)?(K/1024).toFixed(3):"Unknown")+` Kb/s
|
|
|
Estimated load time for current fragment: `+P.toFixed(3)+` s
|
|
|
Estimated load time for the next fragment: `+F.toFixed(3)+` s
|
|
|
Time to underbuffer: `+H.toFixed(3)+" s"),f.nextLoadLevel=W,this.bwEstimator.sample(x,w.loaded),this.clearTimer(),o.loader&&(this.fragCurrent=this.partCurrent=null,o.loader.abort()),f.trigger(d.Events.FRAG_LOAD_EMERGENCY_ABORTED,{frag:o,part:i,stats:w})},r.onFragLoaded=function(o,i){var f=i.frag,h=i.part;if(f.type===v.PlaylistLevelType.MAIN&&Object(R.isFiniteNumber)(f.sn)){var T=h?h.stats:f.stats,g=h?h.duration:f.duration;if(this.clearTimer(),this.lastLoadedFragLevel=f.level,this._nextAutoLevel=-1,this.hls.config.abrMaxWithRealBitrate){var w=this.hls.levels[f.level],C=(w.loaded?w.loaded.bytes:0)+T.loaded,x=(w.loaded?w.loaded.duration:0)+g;w.loaded={bytes:C,duration:x},w.realBitrate=Math.round(8*C/x)}if(f.bitrateTest){var b={stats:T,frag:f,part:h,id:f.type};this.onFragBuffered(d.Events.FRAG_BUFFERED,b),f.bitrateTest=!1}}},r.onFragBuffered=function(o,i){var f=i.frag,h=i.part,T=h?h.stats:f.stats;if(T.aborted)return;if(f.type!==v.PlaylistLevelType.MAIN||f.sn==="initSegment")return;var g=T.parsing.end-T.loading.start;this.bwEstimator.sample(g,T.loaded),T.bwEstimate=this.bwEstimator.getEstimate(),f.bitrateTest?this.bitrateTestDelay=g/1e3:this.bitrateTestDelay=0},r.onError=function(o,i){switch(i.details){case y.ErrorDetails.FRAG_LOAD_ERROR:case y.ErrorDetails.FRAG_LOAD_TIMEOUT:this.clearTimer();break;default:break}},r.clearTimer=function(){self.clearInterval(this.timer),this.timer=void 0},r.getNextABRAutoLevel=function(){var o=this.fragCurrent,i=this.partCurrent,f=this.hls,h=f.maxAutoLevel,T=f.config,g=f.minAutoLevel,w=f.media,C=i?i.duration:o?o.duration:0,x=w?w.currentTime:0,b=w&&w.playbackRate!==0?Math.abs(w.playbackRate):1,S=this.bwEstimator?this.bwEstimator.getEstimate():T.abrEwmaDefaultEstimate,A=(E.BufferHelper.bufferInfo(w,x,T.maxBufferHole).end-x)/b,p=this.findBestLevel(S,g,h,A,T.abrBandWidthFactor,T.abrBandWidthUpFactor);if(p>=0)return p;u.logger.trace((A?"rebuffering expected":"buffer is empty")+", finding optimal quality level");var I=C?Math.min(C,T.maxStarvationDelay):T.maxStarvationDelay,M=T.abrBandWidthFactor,P=T.abrBandWidthUpFactor;if(!A){var B=this.bitrateTestDelay;if(B){var H=C?Math.min(C,T.maxLoadingDelay):T.maxLoadingDelay;I=H-B,u.logger.trace("bitrate test took "+Math.round(1e3*B)+"ms, set first fragment max fetchDuration to "+Math.round(1e3*I)+" ms"),M=P=1}}return p=this.findBestLevel(S,g,h,A+I,M,P),Math.max(p,0)},r.findBestLevel=function(o,i,f,h,T,g){for(var w,C=this.fragCurrent,x=this.partCurrent,b=this.lastLoadedFragLevel,S=this.hls.levels,A=S[b],p=!!(A!=null&&(w=A.details)!==null&&w!==void 0&&w.live),I=A==null?void 0:A.codecSet,M=x?x.duration:C?C.duration:0,P=f;P>=i;P--){var B=S[P];if(!B||I&&B.codecSet!==I)continue;var H=B.details,F=(x?H==null?void 0:H.partTarget:H==null?void 0:H.averagetargetduration)||M,W=void 0;P<=b?W=T*o:W=g*o;var U=S[P].maxBitrate,K=U*F/W;if(u.logger.trace("level/adjustedbw/bitrate/avgDuration/maxFetchDuration/fetchDuration: "+P+"/"+Math.round(W)+"/"+U+"/"+F+"/"+h+"/"+K),W>U&&(!K||p&&!this.bitrateTestDelay||K<h))return P}return-1},c(l,[{key:"nextAutoLevel",get:function(){var o=this._nextAutoLevel,i=this.bwEstimator;if(o!==-1&&(!i||!i.canEstimate()))return o;var f=this.getNextABRAutoLevel();return o!==-1&&(f=Math.min(o,f)),f},set:function(o){this._nextAutoLevel=o}}]),l}();k.default=s},"./src/controller/audio-stream-controller.ts":function(j,k,D){"use strict";D.r(k);var R=D("./src/polyfills/number.ts"),O=D("./src/controller/base-stream-controller.ts"),d=D("./src/events.ts"),E=D("./src/utils/buffer-helper.ts"),y=D("./src/controller/fragment-tracker.ts"),v=D("./src/types/level.ts"),u=D("./src/types/loader.ts"),a=D("./src/loader/fragment.ts"),c=D("./src/demux/chunk-cache.ts"),s=D("./src/demux/transmuxer-interface.ts"),l=D("./src/types/transmuxer.ts"),r=D("./src/controller/fragment-finders.ts"),n=D("./src/utils/discontinuities.ts"),o=D("./src/errors.ts"),i=D("./src/utils/logger.ts");function f(){return f=Object.assign||function(C){for(var x=1;x<arguments.length;x++){var b=arguments[x];for(var S in b)Object.prototype.hasOwnProperty.call(b,S)&&(C[S]=b[S])}return C},f.apply(this,arguments)}function h(C,x){C.prototype=Object.create(x.prototype),C.prototype.constructor=C,T(C,x)}function T(C,x){return T=Object.setPrototypeOf||function(S,A){return S.__proto__=A,S},T(C,x)}var g=100,w=function(C){h(x,C);function x(S,A){var p;return p=C.call(this,S,A,"[audio-stream-controller]")||this,p.videoBuffer=null,p.videoTrackCC=-1,p.waitingVideoCC=-1,p.audioSwitch=!1,p.trackId=-1,p.waitingData=null,p.mainDetails=null,p.bufferFlushed=!1,p._registerListeners(),p}var b=x.prototype;return b.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},b._registerListeners=function(){var A=this.hls;A.on(d.Events.MEDIA_ATTACHED,this.onMediaAttached,this),A.on(d.Events.MEDIA_DETACHING,this.onMediaDetaching,this),A.on(d.Events.MANIFEST_LOADING,this.onManifestLoading,this),A.on(d.Events.LEVEL_LOADED,this.onLevelLoaded,this),A.on(d.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),A.on(d.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),A.on(d.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),A.on(d.Events.ERROR,this.onError,this),A.on(d.Events.BUFFER_RESET,this.onBufferReset,this),A.on(d.Events.BUFFER_CREATED,this.onBufferCreated,this),A.on(d.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),A.on(d.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),A.on(d.Events.FRAG_BUFFERED,this.onFragBuffered,this)},b._unregisterListeners=function(){var A=this.hls;A.off(d.Events.MEDIA_ATTACHED,this.onMediaAttached,this),A.off(d.Events.MEDIA_DETACHING,this.onMediaDetaching,this),A.off(d.Events.MANIFEST_LOADING,this.onManifestLoading,this),A.off(d.Events.LEVEL_LOADED,this.onLevelLoaded,this),A.off(d.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),A.off(d.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),A.off(d.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),A.off(d.Events.ERROR,this.onError,this),A.off(d.Events.BUFFER_RESET,this.onBufferReset,this),A.off(d.Events.BUFFER_CREATED,this.onBufferCreated,this),A.off(d.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),A.off(d.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),A.off(d.Events.FRAG_BUFFERED,this.onFragBuffered,this)},b.onInitPtsFound=function(A,p){var I=p.frag,M=p.id,P=p.initPTS;if(M==="main"){var B=I.cc;this.initPTS[I.cc]=P,this.log("InitPTS for cc: "+B+" found from main: "+P),this.videoTrackCC=B,this.state===O.State.WAITING_INIT_PTS&&this.tick()}},b.startLoad=function(A){if(!this.levels){this.startPosition=A,this.state=O.State.STOPPED;return}var p=this.lastCurrentTime;this.stopLoad(),this.setInterval(g),this.fragLoadError=0,p>0&&A===-1?(this.log("Override startPosition with lastCurrentTime @"+p.toFixed(3)),this.state=O.State.IDLE):(this.loadedmetadata=!1,this.state=O.State.WAITING_TRACK),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=A,this.tick()},b.doTick=function(){switch(this.state){case O.State.IDLE:this.doTickIdle();break;case O.State.WAITING_TRACK:{var A,p=this.levels,I=this.trackId,M=p==null||((A=p[I])===null||A===void 0)?void 0:A.details;if(M){if(this.waitForCdnTuneIn(M))break;this.state=O.State.WAITING_INIT_PTS}break}case O.State.FRAG_LOADING_WAITING_RETRY:{var P,B=performance.now(),H=this.retryDate;(!H||B>=H||(P=this.media)!==null&&P!==void 0&&P.seeking)&&(this.log("RetryDate reached, switch back to IDLE state"),this.state=O.State.IDLE);break}case O.State.WAITING_INIT_PTS:{var F=this.waitingData;if(F){var W=F.frag,U=F.part,K=F.cache,G=F.complete;if(this.initPTS[W.cc]!==void 0){this.waitingData=null,this.waitingVideoCC=-1,this.state=O.State.FRAG_LOADING;var ae=K.flush(),fe={frag:W,part:U,payload:ae,networkDetails:null};this._handleFragmentLoadProgress(fe),G&&C.prototype._handleFragmentLoadComplete.call(this,fe)}else if(this.videoTrackCC!==this.waitingVideoCC)i.logger.log("Waiting fragment cc ("+W.cc+") cancelled because video is at cc "+this.videoTrackCC),this.clearWaitingFragment();else{var Se=this.getLoadPosition(),Ue=E.BufferHelper.bufferInfo(this.mediaBuffer,Se,this.config.maxBufferHole),Ne=Object(r.fragmentWithinToleranceTest)(Ue.end,this.config.maxFragLookUpTolerance,W);Ne<0&&(i.logger.log("Waiting fragment cc ("+W.cc+") @ "+W.start+" cancelled because another fragment at "+Ue.end+" is needed"),this.clearWaitingFragment())}}else this.state=O.State.IDLE}}this.onTickEnd()},b.clearWaitingFragment=function(){var A=this.waitingData;A&&(this.fragmentTracker.removeFragment(A.frag),this.waitingData=null,this.waitingVideoCC=-1,this.state=O.State.IDLE)},b.onTickEnd=function(){var A=this.media;if(!A||!A.readyState)return;var p=this.mediaBuffer?this.mediaBuffer:A,I=p.buffered;!this.loadedmetadata&&I.length&&(this.loadedmetadata=!0),this.lastCurrentTime=A.currentTime},b.doTickIdle=function(){var A,p,I=this.hls,M=this.levels,P=this.media,B=this.trackId,H=I.config;if(!M||!M[B])return;if(!P&&(this.startFragRequested||!H.startFragPrefetch))return;var F=M[B],W=F.details;if(!W||W.live&&this.levelLastLoaded!==B||this.waitForCdnTuneIn(W)){this.state=O.State.WAITING_TRACK;return}this.bufferFlushed&&(this.bufferFlushed=!1,this.afterBufferFlushed(this.mediaBuffer?this.mediaBuffer:this.media,a.ElementaryStreamTypes.AUDIO,u.PlaylistLevelType.AUDIO));var U=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:this.media,u.PlaylistLevelType.AUDIO);if(U===null)return;var K=U.len,G=this.getMaxBufferLength(),ae=this.audioSwitch;if(K>=G&&!ae)return;if(!ae&&this._streamEnded(U,W)){I.trigger(d.Events.BUFFER_EOS,{type:"audio"}),this.state=O.State.ENDED;return}var fe=W.fragments,Se=fe[0].start,Ue=U.end;if(ae){var Ne=this.getLoadPosition();Ue=Ne,W.PTSKnown&&Ne<Se&&((U.end>Se||U.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),P.currentTime=Se+.05))}var xe=this.getNextFragment(Ue,W);if(!xe){this.bufferFlushed=!0;return}((A=xe.decryptdata)===null||A===void 0?void 0:A.keyFormat)==="identity"&&!((p=xe.decryptdata)!==null&&p!==void 0&&p.key)?this.loadKey(xe,W):this.loadFragment(xe,W,Ue)},b.getMaxBufferLength=function(){var A=C.prototype.getMaxBufferLength.call(this),p=this.getFwdBufferInfo(this.videoBuffer?this.videoBuffer:this.media,u.PlaylistLevelType.MAIN);return p===null?A:Math.max(A,p.len)},b.onMediaDetaching=function(){this.videoBuffer=null,C.prototype.onMediaDetaching.call(this)},b.onAudioTracksUpdated=function(A,p){var I=p.audioTracks;this.resetTransmuxer(),this.levels=I.map(function(M){return new v.Level(M)})},b.onAudioTrackSwitching=function(A,p){var I=!!p.url;this.trackId=p.id;var M=this.fragCurrent;M!=null&&M.loader&&M.loader.abort(),this.fragCurrent=null,this.clearWaitingFragment(),I?this.setInterval(g):this.resetTransmuxer(),I?(this.audioSwitch=!0,this.state=O.State.IDLE):this.state=O.State.STOPPED,this.tick()},b.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments(),this.startPosition=this.lastCurrentTime=0,this.bufferFlushed=!1},b.onLevelLoaded=function(A,p){this.mainDetails=p.details},b.onAudioTrackLoaded=function(A,p){var I,M=this.levels,P=p.details,B=p.id;if(!M){this.warn("Audio tracks were reset while loading level "+B);return}this.log("Track "+B+" loaded ["+P.startSN+","+P.endSN+"],duration:"+P.totalduration);var H=M[B],F=0;if(P.live||(I=H.details)!==null&&I!==void 0&&I.live){var W=this.mainDetails;if(P.fragments[0]||(P.deltaUpdateFailed=!0),P.deltaUpdateFailed||!W)return;!H.details&&P.hasProgramDateTime&&W.hasProgramDateTime?(Object(n.alignMediaPlaylistByPDT)(P,W),F=P.fragments[0].start):F=this.alignPlaylists(P,H.details)}H.details=P,this.levelLastLoaded=B,!this.startFragRequested&&(this.mainDetails||!P.live)&&this.setStartPosition(H.details,F),this.state===O.State.WAITING_TRACK&&!this.waitForCdnTuneIn(P)&&(this.state=O.State.IDLE),this.tick()},b._handleFragmentLoadProgress=function(A){var p,I=A.frag,M=A.part,P=A.payload,B=this.config,H=this.trackId,F=this.levels;if(!F){this.warn("Audio tracks were reset while fragment load was in progress. Fragment "+I.sn+" of level "+I.level+" will not be buffered");return}var W=F[H];console.assert(W,"Audio track is defined on fragment load progress");var U=W.details;console.assert(U,"Audio track details are defined on fragment load progress");var K=B.defaultAudioCodec||W.audioCodec||"mp4a.40.2",G=this.transmuxer;G||(G=this.transmuxer=new s.default(this.hls,u.PlaylistLevelType.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));var ae=this.initPTS[I.cc],fe=(p=I.initSegment)===null||p===void 0?void 0:p.data;if(ae!==void 0){var Se=!1,Ue=M?M.index:-1,Ne=Ue!==-1,xe=new l.ChunkMetadata(I.level,I.sn,I.stats.chunkCount,P.byteLength,Ue,Ne);G.push(P,fe,K,"",I,M,U.totalduration,Se,xe,ae)}else{i.logger.log("Unknown video PTS for cc "+I.cc+", waiting for video PTS before demuxing audio frag "+I.sn+" of ["+U.startSN+" ,"+U.endSN+"],track "+H);var Ce=this.waitingData=this.waitingData||{frag:I,part:M,cache:new c.default,complete:!1},De=Ce.cache;De.push(new Uint8Array(P)),this.waitingVideoCC=this.videoTrackCC,this.state=O.State.WAITING_INIT_PTS}},b._handleFragmentLoadComplete=function(A){if(this.waitingData){this.waitingData.complete=!0;return}C.prototype._handleFragmentLoadComplete.call(this,A)},b.onBufferReset=function(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1},b.onBufferCreated=function(A,p){var I=p.tracks.audio;I&&(this.mediaBuffer=I.buffer),p.tracks.video&&(this.videoBuffer=p.tracks.video.buffer)},b.onFragBuffered=function(A,p){var I=p.frag,M=p.part;if(I.type!==u.PlaylistLevelType.AUDIO)return;if(this.fragContextChanged(I)){this.warn("Fragment "+I.sn+(M?" p: "+M.index:"")+" of level "+I.level+" finished buffering, but was aborted. state: "+this.state+", audioSwitch: "+this.audioSwitch);return}I.sn!=="initSegment"&&(this.fragPrevious=I,this.audioSwitch&&(this.audioSwitch=!1,this.hls.trigger(d.Events.AUDIO_TRACK_SWITCHED,{id:this.trackId}))),this.fragBufferedComplete(I,M)},b.onError=function(A,p){switch(p.details){case o.ErrorDetails.FRAG_LOAD_ERROR:case o.ErrorDetails.FRAG_LOAD_TIMEOUT:case o.ErrorDetails.KEY_LOAD_ERROR:case o.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(u.PlaylistLevelType.AUDIO,p);break;case o.ErrorDetails.AUDIO_TRACK_LOAD_ERROR:case o.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:this.state!==O.State.ERROR&&this.state!==O.State.STOPPED&&(this.state=p.fatal?O.State.ERROR:O.State.IDLE,this.warn(p.details+" while loading frag, switching to "+this.state+" state"));break;case o.ErrorDetails.BUFFER_FULL_ERROR:if(p.parent==="audio"&&(this.state===O.State.PARSING||this.state===O.State.PARSED)){var I=!0,M=this.getFwdBufferInfo(this.mediaBuffer,u.PlaylistLevelType.AUDIO);M&&M.len>.5&&(I=!this.reduceMaxBufferLength(M.len)),I&&(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}},b.onBufferFlushed=function(A,p){var I=p.type;I===a.ElementaryStreamTypes.AUDIO&&(this.bufferFlushed=!0)},b._handleTransmuxComplete=function(A){var p,I="audio",M=this.hls,P=A.remuxResult,B=A.chunkMeta,H=this.getCurrentContext(B);if(!H){this.warn("The loading context changed while buffering fragment "+B.sn+" of level "+B.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(B.level);return}var F=H.frag,W=H.part,U=P.audio,K=P.text,G=P.id3,ae=P.initSegment;if(this.fragContextChanged(F))return;if(this.state=O.State.PARSING,this.audioSwitch&&U&&this.completeAudioSwitch(),ae!=null&&ae.tracks&&(this._bufferInitSegment(ae.tracks,F,B),M.trigger(d.Events.FRAG_PARSING_INIT_SEGMENT,{frag:F,id:I,tracks:ae.tracks})),U){var fe=U.startPTS,Se=U.endPTS,Ue=U.startDTS,Ne=U.endDTS;W&&(W.elementaryStreams[a.ElementaryStreamTypes.AUDIO]={startPTS:fe,endPTS:Se,startDTS:Ue,endDTS:Ne}),F.setElementaryStreamInfo(a.ElementaryStreamTypes.AUDIO,fe,Se,Ue,Ne),this.bufferFragmentData(U,F,W,B)}if(G!=null&&(p=G.samples)!==null&&p!==void 0&&p.length){var xe=f({frag:F,id:I},G);M.trigger(d.Events.FRAG_PARSING_METADATA,xe)}if(K){var Ce=f({frag:F,id:I},K);M.trigger(d.Events.FRAG_PARSING_USERDATA,Ce)}},b._bufferInitSegment=function(A,p,I){if(this.state!==O.State.PARSING)return;A.video&&delete A.video;var M=A.audio;if(!M)return;M.levelCodec=M.codec,M.id="audio",this.log("Init audio buffer, container:"+M.container+", codecs[parsed]=["+M.codec+"]"),this.hls.trigger(d.Events.BUFFER_CODECS,A);var P=M.initSegment;if(P!=null&&P.byteLength){var B={type:"audio",frag:p,part:null,chunkMeta:I,parent:p.type,data:P};this.hls.trigger(d.Events.BUFFER_APPENDING,B)}this.tick()},b.loadFragment=function(A,p,I){var M=this.fragmentTracker.getState(A);this.fragCurrent=A,(this.audioSwitch||M===y.FragmentState.NOT_LOADED||M===y.FragmentState.PARTIAL)&&(A.sn==="initSegment"?this._loadInitSegment(A):p.live&&!Object(R.isFiniteNumber)(this.initPTS[A.cc])?(this.log("Waiting for video PTS in continuity counter "+A.cc+" of live stream before loading audio fragment "+A.sn+" of level "+this.trackId),this.state=O.State.WAITING_INIT_PTS):(this.startFragRequested=!0,C.prototype.loadFragment.call(this,A,p,I)))},b.completeAudioSwitch=function(){var A=this.hls,p=this.media,I=this.trackId;p&&(this.log("Switching audio track : flushing all audio"),C.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.audioSwitch=!1,A.trigger(d.Events.AUDIO_TRACK_SWITCHED,{id:I})},x}(O.default);k.default=w},"./src/controller/audio-track-controller.ts":function(j,k,D){"use strict";D.r(k);var R=D("./src/events.ts"),O=D("./src/errors.ts"),d=D("./src/controller/base-playlist-controller.ts"),E=D("./src/types/loader.ts");function y(s,l){for(var r=0;r<l.length;r++){var n=l[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(s,n.key,n)}}function v(s,l,r){return l&&y(s.prototype,l),r&&y(s,r),s}function u(s,l){s.prototype=Object.create(l.prototype),s.prototype.constructor=s,a(s,l)}function a(s,l){return a=Object.setPrototypeOf||function(n,o){return n.__proto__=o,n},a(s,l)}var c=function(s){u(l,s);function l(n){var o;return o=s.call(this,n,"[audio-track-controller]")||this,o.tracks=[],o.groupId=null,o.tracksInGroup=[],o.trackId=-1,o.trackName="",o.selectDefaultTrack=!0,o.registerListeners(),o}var r=l.prototype;return r.registerListeners=function(){var o=this.hls;o.on(R.Events.MANIFEST_LOADING,this.onManifestLoading,this),o.on(R.Events.MANIFEST_PARSED,this.onManifestParsed,this),o.on(R.Events.LEVEL_LOADING,this.onLevelLoading,this),o.on(R.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),o.on(R.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),o.on(R.Events.ERROR,this.onError,this)},r.unregisterListeners=function(){var o=this.hls;o.off(R.Events.MANIFEST_LOADING,this.onManifestLoading,this),o.off(R.Events.MANIFEST_PARSED,this.onManifestParsed,this),o.off(R.Events.LEVEL_LOADING,this.onLevelLoading,this),o.off(R.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),o.off(R.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),o.off(R.Events.ERROR,this.onError,this)},r.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,s.prototype.destroy.call(this)},r.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.trackName="",this.selectDefaultTrack=!0},r.onManifestParsed=function(o,i){this.tracks=i.audioTracks||[]},r.onAudioTrackLoaded=function(o,i){var f=i.id,h=i.details,T=this.tracksInGroup[f];if(!T){this.warn("Invalid audio track id "+f);return}var g=T.details;T.details=i.details,this.log("audioTrack "+f+" loaded ["+h.startSN+"-"+h.endSN+"]"),f===this.trackId&&(this.retryCount=0,this.playlistLoaded(f,i,g))},r.onLevelLoading=function(o,i){this.switchLevel(i.level)},r.onLevelSwitching=function(o,i){this.switchLevel(i.level)},r.switchLevel=function(o){var i=this.hls.levels[o];if(!(i!=null&&i.audioGroupIds))return;var f=i.audioGroupIds[i.urlId];if(this.groupId!==f){this.groupId=f;var h=this.tracks.filter(function(g){return!f||g.groupId===f});this.selectDefaultTrack&&!h.some(function(g){return g.default})&&(this.selectDefaultTrack=!1),this.tracksInGroup=h;var T={audioTracks:h};this.log("Updating audio tracks, "+h.length+' track(s) found in "'+f+'" group-id'),this.hls.trigger(R.Events.AUDIO_TRACKS_UPDATED,T),this.selectInitialTrack()}},r.onError=function(o,i){if(s.prototype.onError.call(this,o,i),i.fatal||!i.context)return;i.context.type===E.PlaylistContextType.AUDIO_TRACK&&i.context.id===this.trackId&&i.context.groupId===this.groupId&&this.retryLoadingOrFail(i)},r.setAudioTrack=function(o){var i=this.tracksInGroup;if(o<0||o>=i.length){this.warn("Invalid id passed to audio-track controller");return}this.clearTimer();var f=i[this.trackId];this.log("Now switching to audio-track index "+o);var h=i[o],T=h.id,g=h.groupId,w=g===void 0?"":g,C=h.name,x=h.type,b=h.url;if(this.trackId=o,this.trackName=C,this.selectDefaultTrack=!1,this.hls.trigger(R.Events.AUDIO_TRACK_SWITCHING,{id:T,groupId:w,name:C,type:x,url:b}),h.details&&!h.details.live)return;var S=this.switchParams(h.url,f==null?void 0:f.details);this.loadPlaylist(S)},r.selectInitialTrack=function(){var o=this.tracksInGroup;console.assert(o.length,"Initial audio track should be selected when tracks are known");var i=this.trackName,f=this.findTrackId(i)||this.findTrackId();f!==-1?this.setAudioTrack(f):(this.warn("No track found for running audio group-ID: "+this.groupId),this.hls.trigger(R.Events.ERROR,{type:O.ErrorTypes.MEDIA_ERROR,details:O.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,fatal:!0}))},r.findTrackId=function(o){for(var i=this.tracksInGroup,f=0;f<i.length;f++){var h=i[f];if((!this.selectDefaultTrack||h.default)&&(!o||o===h.name))return h.id}return-1},r.loadPlaylist=function(o){var i=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(i)){var f=i.id,h=i.groupId,T=i.url;if(o)try{T=o.addDirectives(T)}catch(g){this.warn("Could not construct new URL with HLS Delivery Directives: "+g)}this.log("loading audio-track playlist for id: "+f),this.clearTimer(),this.hls.trigger(R.Events.AUDIO_TRACK_LOADING,{url:T,id:f,groupId:h,deliveryDirectives:o||null})}},v(l,[{key:"audioTracks",get:function(){return this.tracksInGroup}},{key:"audioTrack",get:function(){return this.trackId},set:function(o){this.selectDefaultTrack=!1,this.setAudioTrack(o)}}]),l}(d.default);k.default=c},"./src/controller/base-playlist-controller.ts":function(j,k,D){"use strict";D.r(k),D.d(k,"default",function(){return v});var R=D("./src/polyfills/number.ts"),O=D("./src/types/level.ts"),d=D("./src/controller/level-helper.ts"),E=D("./src/utils/logger.ts"),y=D("./src/errors.ts"),v=function(){function u(c,s){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,s+":"),this.warn=E.logger.warn.bind(E.logger,s+":"),this.hls=c}var a=u.prototype;return a.destroy=function(){this.clearTimer(),this.hls=this.log=this.warn=null},a.onError=function(s,l){l.fatal&&l.type===y.ErrorTypes.NETWORK_ERROR&&this.clearTimer()},a.clearTimer=function(){clearTimeout(this.timer),this.timer=-1},a.startLoad=function(){this.canLoad=!0,this.retryCount=0,this.loadPlaylist()},a.stopLoad=function(){this.canLoad=!1,this.clearTimer()},a.switchParams=function(s,l){var r=l==null?void 0:l.renditionReports;if(r)for(var n=0;n<r.length;n++){var o=r[n],i=""+o.URI;if(i===s.substr(-i.length)){var f=parseInt(o["LAST-MSN"]),h=parseInt(o["LAST-PART"]);if(l&&this.hls.config.lowLatencyMode){var T=Math.min(l.age-l.partTarget,l.targetduration);h!==void 0&&T>l.partTarget&&(h+=1)}if(Object(R.isFiniteNumber)(f))return new O.HlsUrlParameters(f,Object(R.isFiniteNumber)(h)?h:void 0,O.HlsSkip.No)}}},a.loadPlaylist=function(s){},a.shouldLoadTrack=function(s){return this.canLoad&&s&&!!s.url&&(!s.details||s.details.live)},a.playlistLoaded=function(s,l,r){var n=this,o=l.details,i=l.stats,f=i.loading.end?Math.max(0,self.performance.now()-i.loading.end):0;if(o.advancedDateTime=Date.now()-f,o.live||r!=null&&r.live){if(o.reloaded(r),r&&this.log("live playlist "+s+" "+(o.advanced?"REFRESHED "+o.lastPartSn+"-"+o.lastPartIndex:"MISSED")),r&&o.fragments.length>0&&Object(d.mergeDetails)(r,o),!this.canLoad||!o.live)return;var h,T=void 0,g=void 0;if(o.canBlockReload&&o.endSN&&o.advanced){var w=this.hls.config.lowLatencyMode,C=o.lastPartSn,x=o.endSN,b=o.lastPartIndex,S=b!==-1,A=C===x,p=w?0:b;S?(T=A?x+1:C,g=A?p:b+1):T=x+1;var I=o.age,M=I+o.ageHeader,P=Math.min(M-o.partTarget,o.targetduration*1.5);if(P>0){if(r&&P>r.tuneInGoal)this.warn("CDN Tune-in goal increased from: "+r.tuneInGoal+" to: "+P+" with playlist age: "+o.age),P=0;else{var B=Math.floor(P/o.targetduration);if(T+=B,g!==void 0){var H=Math.round(P%o.targetduration/o.partTarget);g+=H}this.log("CDN Tune-in age: "+o.ageHeader+"s last advanced "+I.toFixed(2)+"s goal: "+P+" skip sn "+B+" to part "+g)}o.tuneInGoal=P}if(h=this.getDeliveryDirectives(o,l.deliveryDirectives,T,g),w||!A){this.loadPlaylist(h);return}}else h=this.getDeliveryDirectives(o,l.deliveryDirectives,T,g);var F=Object(d.computeReloadInterval)(o,i);T!==void 0&&o.canBlockReload&&(F-=o.partTarget||1),this.log("reload live playlist "+s+" in "+Math.round(F)+" ms"),this.timer=self.setTimeout(function(){return n.loadPlaylist(h)},F)}else this.clearTimer()},a.getDeliveryDirectives=function(s,l,r,n){var o=Object(O.getSkipValue)(s,r);return l!=null&&l.skip&&s.deltaUpdateFailed&&(r=l.msn,n=l.part,o=O.HlsSkip.No),new O.HlsUrlParameters(r,n,o)},a.retryLoadingOrFail=function(s){var l=this,r=this.hls.config,n=this.retryCount<r.levelLoadingMaxRetry;if(n){var o;if(this.retryCount++,s.details.indexOf("LoadTimeOut")>-1&&(o=s.context)!==null&&o!==void 0&&o.deliveryDirectives)this.warn("retry playlist loading #"+this.retryCount+' after "'+s.details+'"'),this.loadPlaylist();else{var i=Math.min(Math.pow(2,this.retryCount)*r.levelLoadingRetryDelay,r.levelLoadingMaxRetryTimeout);this.timer=self.setTimeout(function(){return l.loadPlaylist()},i),this.warn("retry playlist loading #"+this.retryCount+" in "+i+' ms after "'+s.details+'"')}}else this.warn('cannot recover from error "'+s.details+'"'),this.clearTimer(),s.fatal=!0;return n},u}()},"./src/controller/base-stream-controller.ts":function(j,k,D){"use strict";D.r(k),D.d(k,"State",function(){return x}),D.d(k,"default",function(){return b});var R=D("./src/polyfills/number.ts"),O=D("./src/task-loop.ts"),d=D("./src/controller/fragment-tracker.ts"),E=D("./src/utils/buffer-helper.ts"),y=D("./src/utils/logger.ts"),v=D("./src/events.ts"),u=D("./src/errors.ts"),a=D("./src/types/transmuxer.ts"),c=D("./src/utils/mp4-tools.ts"),s=D("./src/utils/discontinuities.ts"),l=D("./src/controller/fragment-finders.ts"),r=D("./src/controller/level-helper.ts"),n=D("./src/loader/fragment-loader.ts"),o=D("./src/crypt/decrypter.ts"),i=D("./src/utils/time-ranges.ts"),f=D("./src/types/loader.ts");function h(S,A){for(var p=0;p<A.length;p++){var I=A[p];I.enumerable=I.enumerable||!1,I.configurable=!0,"value"in I&&(I.writable=!0),Object.defineProperty(S,I.key,I)}}function T(S,A,p){return A&&h(S.prototype,A),p&&h(S,p),S}function g(S){if(S===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return S}function w(S,A){S.prototype=Object.create(A.prototype),S.prototype.constructor=S,C(S,A)}function C(S,A){return C=Object.setPrototypeOf||function(I,M){return I.__proto__=M,I},C(S,A)}var x={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"},b=function(S){w(A,S);function A(I,M,P){var B;return B=S.call(this)||this,B.hls=void 0,B.fragPrevious=null,B.fragCurrent=null,B.fragmentTracker=void 0,B.transmuxer=null,B._state=x.STOPPED,B.media=void 0,B.mediaBuffer=void 0,B.config=void 0,B.bitrateTest=!1,B.lastCurrentTime=0,B.nextLoadPosition=0,B.startPosition=0,B.loadedmetadata=!1,B.fragLoadError=0,B.retryDate=0,B.levels=null,B.fragmentLoader=void 0,B.levelLastLoaded=null,B.startFragRequested=!1,B.decrypter=void 0,B.initPTS=[],B.onvseeking=null,B.onvended=null,B.logPrefix="",B.log=void 0,B.warn=void 0,B.logPrefix=P,B.log=y.logger.log.bind(y.logger,P+":"),B.warn=y.logger.warn.bind(y.logger,P+":"),B.hls=I,B.fragmentLoader=new n.default(I.config),B.fragmentTracker=M,B.config=I.config,B.decrypter=new o.default(I,I.config),I.on(v.Events.KEY_LOADED,B.onKeyLoaded,g(B)),B}var p=A.prototype;return p.doTick=function(){this.onTickEnd()},p.onTickEnd=function(){},p.startLoad=function(M){},p.stopLoad=function(){this.fragmentLoader.abort();var M=this.fragCurrent;M&&this.fragmentTracker.removeFragment(M),this.resetTransmuxer(),this.fragCurrent=null,this.fragPrevious=null,this.clearInterval(),this.clearNextTick(),this.state=x.STOPPED},p._streamEnded=function(M,P){var B=this.fragCurrent,H=this.fragmentTracker;if(!P.live&&B&&B.sn===P.endSN&&!M.nextStart){var F=H.getState(B);return F===d.FragmentState.PARTIAL||F===d.FragmentState.OK}return!1},p.onMediaAttached=function(M,P){var B=this.media=this.mediaBuffer=P.media;this.onvseeking=this.onMediaSeeking.bind(this),this.onvended=this.onMediaEnded.bind(this),B.addEventListener("seeking",this.onvseeking),B.addEventListener("ended",this.onvended);var H=this.config;this.levels&&H.autoStartLoad&&this.state===x.STOPPED&&this.startLoad(H.startPosition)},p.onMediaDetaching=function(){var M=this.media;M!=null&&M.ended&&(this.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0),M&&(M.removeEventListener("seeking",this.onvseeking),M.removeEventListener("ended",this.onvended),this.onvseeking=this.onvended=null),this.media=this.mediaBuffer=null,this.loadedmetadata=!1,this.fragmentTracker.removeAllFragments(),this.stopLoad()},p.onMediaSeeking=function(){var M=this.config,P=this.fragCurrent,B=this.media,H=this.mediaBuffer,F=this.state,W=B?B.currentTime:0,U=E.BufferHelper.bufferInfo(H||B,W,M.maxBufferHole);if(this.log("media seeking to "+(Object(R.isFiniteNumber)(W)?W.toFixed(3):W)+", state: "+F),F===x.ENDED)this.resetLoadingState();else if(P&&!U.len){var K=M.maxFragLookUpTolerance,G=P.start-K,ae=P.start+P.duration+K,fe=W>ae;(W<G||fe)&&(fe&&P.loader&&(this.log("seeking outside of buffer while fragment load in progress, cancel fragment load"),P.loader.abort()),this.resetLoadingState())}B&&(this.lastCurrentTime=W),!this.loadedmetadata&&!U.len&&(this.nextLoadPosition=this.startPosition=W),this.tickImmediate()},p.onMediaEnded=function(){this.startPosition=this.lastCurrentTime=0},p.onKeyLoaded=function(M,P){if(this.state!==x.KEY_LOADING||P.frag!==this.fragCurrent||!this.levels)return;this.state=x.IDLE;var B=this.levels[P.frag.level].details;B&&this.loadFragment(P.frag,B,P.frag.start)},p.onHandlerDestroying=function(){this.stopLoad(),S.prototype.onHandlerDestroying.call(this)},p.onHandlerDestroyed=function(){this.state=x.STOPPED,this.hls.off(v.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,S.prototype.onHandlerDestroyed.call(this)},p.loadKey=function(M,P){this.log("Loading key for "+M.sn+" of ["+P.startSN+"-"+P.endSN+"], "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+M.level),this.state=x.KEY_LOADING,this.fragCurrent=M,this.hls.trigger(v.Events.KEY_LOADING,{frag:M})},p.loadFragment=function(M,P,B){this._loadFragForPlayback(M,P,B)},p._loadFragForPlayback=function(M,P,B){var H=this,F=function(U){if(H.fragContextChanged(M)){H.warn("Fragment "+M.sn+(U.part?" p: "+U.part.index:"")+" of level "+M.level+" was dropped during download."),H.fragmentTracker.removeFragment(M);return}M.stats.chunkCount++,H._handleFragmentLoadProgress(U)};this._doFragLoad(M,P,B,F).then(function(W){if(!W)return;H.fragLoadError=0;var U=H.state;if(H.fragContextChanged(M)){(U===x.FRAG_LOADING||U===x.BACKTRACKING||!H.fragCurrent&&U===x.PARSING)&&(H.fragmentTracker.removeFragment(M),H.state=x.IDLE);return}if("payload"in W&&(H.log("Loaded fragment "+M.sn+" of level "+M.level),H.hls.trigger(v.Events.FRAG_LOADED,W),H.state===x.BACKTRACKING)){H.fragmentTracker.backtrack(M,W),H.resetFragmentLoading(M);return}H._handleFragmentLoadComplete(W)}).catch(function(W){H.warn(W),H.resetFragmentLoading(M)})},p.flushMainBuffer=function(M,P,B){if(B===void 0&&(B=null),!(M-P))return;var H={startOffset:M,endOffset:P,type:B};this.fragLoadError=0,this.hls.trigger(v.Events.BUFFER_FLUSHING,H)},p._loadInitSegment=function(M){var P=this;this._doFragLoad(M).then(function(B){if(!B||P.fragContextChanged(M)||!P.levels)throw new Error("init load aborted");return B}).then(function(B){var H=P.hls,F=B.payload,W=M.decryptdata;if(F&&F.byteLength>0&&W&&W.key&&W.iv&&W.method==="AES-128"){var U=self.performance.now();return P.decrypter.webCryptoDecrypt(new Uint8Array(F),W.key.buffer,W.iv.buffer).then(function(K){var G=self.performance.now();return H.trigger(v.Events.FRAG_DECRYPTED,{frag:M,payload:K,stats:{tstart:U,tdecrypt:G}}),B.payload=K,B})}return B}).then(function(B){var H=P.fragCurrent,F=P.hls,W=P.levels;if(!W)throw new Error("init load aborted, missing levels");var U=W[M.level].details;console.assert(U,"Level details are defined when init segment is loaded");var K=M.stats;P.state=x.IDLE,P.fragLoadError=0,M.data=new Uint8Array(B.payload),K.parsing.start=K.buffering.start=self.performance.now(),K.parsing.end=K.buffering.end=self.performance.now(),B.frag===H&&F.trigger(v.Events.FRAG_BUFFERED,{stats:K,frag:H,part:null,id:M.type}),P.tick()}).catch(function(B){P.warn(B),P.resetFragmentLoading(M)})},p.fragContextChanged=function(M){var P=this.fragCurrent;return!M||!P||M.level!==P.level||M.sn!==P.sn||M.urlId!==P.urlId},p.fragBufferedComplete=function(M,P){var B=this.mediaBuffer?this.mediaBuffer:this.media;this.log("Buffered "+M.type+" sn: "+M.sn+(P?" part: "+P.index:"")+" of "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+M.level+" "+i.default.toString(E.BufferHelper.getBuffered(B))),this.state=x.IDLE,this.tick()},p._handleFragmentLoadComplete=function(M){var P=this.transmuxer;if(!P)return;var B=M.frag,H=M.part,F=M.partsLoaded,W=!F||F.length===0||F.some(function(K){return!K}),U=new a.ChunkMetadata(B.level,B.sn,B.stats.chunkCount+1,0,H?H.index:-1,!W);P.flush(U)},p._handleFragmentLoadProgress=function(M){},p._doFragLoad=function(M,P,B,H){var F=this;if(B===void 0&&(B=null),!this.levels)throw new Error("frag load aborted, missing levels");if(B=Math.max(M.start,B||0),this.config.lowLatencyMode&&P){var W=P.partList;if(W&&H){B>M.end&&P.fragmentHint&&(M=P.fragmentHint);var U=this.getNextPart(W,M,B);if(U>-1){var K=W[U];return this.log("Loading part sn: "+M.sn+" p: "+K.index+" cc: "+M.cc+" of playlist ["+P.startSN+"-"+P.endSN+"] parts [0-"+U+"-"+(W.length-1)+"] "+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+M.level+", target: "+parseFloat(B.toFixed(3))),this.nextLoadPosition=K.start+K.duration,this.state=x.FRAG_LOADING,this.hls.trigger(v.Events.FRAG_LOADING,{frag:M,part:W[U],targetBufferTime:B}),this.doFragPartsLoad(M,W,U,H).catch(function(G){return F.handleFragLoadError(G)})}else if(!M.url||this.loadedEndOfParts(W,B))return Promise.resolve(null)}}return this.log("Loading fragment "+M.sn+" cc: "+M.cc+" "+(P?"of ["+P.startSN+"-"+P.endSN+"] ":"")+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+M.level+", target: "+parseFloat(B.toFixed(3))),Object(R.isFiniteNumber)(M.sn)&&!this.bitrateTest&&(this.nextLoadPosition=M.start+M.duration),this.state=x.FRAG_LOADING,this.hls.trigger(v.Events.FRAG_LOADING,{frag:M,targetBufferTime:B}),this.fragmentLoader.load(M,H).catch(function(G){return F.handleFragLoadError(G)})},p.doFragPartsLoad=function(M,P,B,H){var F=this;return new Promise(function(W,U){var K=[],G=function ae(fe){var Se=P[fe];F.fragmentLoader.loadPart(M,Se,H).then(function(Ue){K[Se.index]=Ue;var Ne=Ue.part;F.hls.trigger(v.Events.FRAG_LOADED,Ue);var xe=P[fe+1];if(xe&&xe.fragment===M)ae(fe+1);else return W({frag:M,part:Ne,partsLoaded:K})}).catch(U)};G(B)})},p.handleFragLoadError=function(M){var P=M.data;return P&&P.details===u.ErrorDetails.INTERNAL_ABORTED?this.handleFragLoadAborted(P.frag,P.part):this.hls.trigger(v.Events.ERROR,P),null},p._handleTransmuxerFlush=function(M){var P=this.getCurrentContext(M);if(!P||this.state!==x.PARSING){this.fragCurrent||(this.state=x.IDLE);return}var B=P.frag,H=P.part,F=P.level,W=self.performance.now();B.stats.parsing.end=W,H&&(H.stats.parsing.end=W),this.updateLevelTiming(B,H,F,M.partial)},p.getCurrentContext=function(M){var P=this.levels,B=M.level,H=M.sn,F=M.part;if(!P||!P[B])return this.warn("Levels object was unset while buffering fragment "+H+" of level "+B+". The current chunk will not be buffered."),null;var W=P[B],U=F>-1?Object(r.getPartWith)(W,H,F):null,K=U?U.fragment:Object(r.getFragmentWithSN)(W,H,this.fragCurrent);return K?{frag:K,part:U,level:W}:null},p.bufferFragmentData=function(M,P,B,H){if(!M||this.state!==x.PARSING)return;var F=M.data1,W=M.data2,U=F;if(F&&W&&(U=Object(c.appendUint8Array)(F,W)),!U||!U.length)return;var K={type:M.type,frag:P,part:B,chunkMeta:H,parent:P.type,data:U};this.hls.trigger(v.Events.BUFFER_APPENDING,K),M.dropped&&M.independent&&!B&&this.flushBufferGap(P)},p.flushBufferGap=function(M){var P=this.media;if(!P)return;if(!E.BufferHelper.isBuffered(P,P.currentTime)){this.flushMainBuffer(0,M.start);return}var B=P.currentTime,H=E.BufferHelper.bufferInfo(P,B,0),F=M.duration,W=Math.min(this.config.maxFragLookUpTolerance*2,F*.25),U=Math.max(Math.min(M.start-W,H.end-W),B+W);M.start-U>W&&this.flushMainBuffer(U,M.start)},p.getFwdBufferInfo=function(M,P){var B=this.config,H=this.getLoadPosition();if(!Object(R.isFiniteNumber)(H))return null;var F=E.BufferHelper.bufferInfo(M,H,B.maxBufferHole);if(F.len===0&&F.nextStart!==void 0){var W=this.fragmentTracker.getBufferedFrag(H,P);if(W&&F.nextStart<W.end)return E.BufferHelper.bufferInfo(M,H,Math.max(F.nextStart,B.maxBufferHole))}return F},p.getMaxBufferLength=function(M){var P=this.config,B;return M?B=Math.max(8*P.maxBufferSize/M,P.maxBufferLength):B=P.maxBufferLength,Math.min(B,P.maxMaxBufferLength)},p.reduceMaxBufferLength=function(M){var P=this.config,B=M||P.maxBufferLength;return P.maxMaxBufferLength>=B?(P.maxMaxBufferLength/=2,this.warn("Reduce max buffer length to "+P.maxMaxBufferLength+"s"),!0):!1},p.getNextFragment=function(M,P){var B,H,F=P.fragments,W=F.length;if(!W)return null;var U=this.config,K=F[0].start,G;if(P.live){var ae=U.initialLiveManifestSize;if(W<ae)return this.warn("Not enough fragments to start playback (have: "+W+", need: "+ae+")"),null;!P.PTSKnown&&!this.startFragRequested&&this.startPosition===-1&&(G=this.getInitialLiveFragment(P,F),this.startPosition=G?this.hls.liveSyncPosition||G.start:M)}else M<=K&&(G=F[0]);if(!G){var fe=U.lowLatencyMode?P.partEnd:P.fragmentEnd;G=this.getFragmentAtPosition(M,fe,P)}return(B=G)!==null&&B!==void 0&&B.initSegment&&!((H=G)!==null&&H!==void 0&&H.initSegment.data)&&!this.bitrateTest&&(G=G.initSegment),G},p.getNextPart=function(M,P,B){for(var H=-1,F=!1,W=!0,U=0,K=M.length;U<K;U++){var G=M[U];if(W=W&&!G.independent,H>-1&&B<G.start)break;var ae=G.loaded;!ae&&(F||G.independent||W)&&G.fragment===P&&(H=U),F=ae}return H},p.loadedEndOfParts=function(M,P){var B=M[M.length-1];return B&&P>B.start&&B.loaded},p.getInitialLiveFragment=function(M,P){var B=this.fragPrevious,H=null;if(B){if(M.hasProgramDateTime&&(this.log("Live playlist, switching playlist, load frag with same PDT: "+B.programDateTime),H=Object(l.findFragmentByPDT)(P,B.endProgramDateTime,this.config.maxFragLookUpTolerance)),!H){var F=B.sn+1;if(F>=M.startSN&&F<=M.endSN){var W=P[F-M.startSN];B.cc===W.cc&&(H=W,this.log("Live playlist, switching playlist, load frag with next SN: "+H.sn))}H||(H=Object(l.findFragWithCC)(P,B.cc),H&&this.log("Live playlist, switching playlist, load frag with same CC: "+H.sn))}}else{var U=this.hls.liveSyncPosition;U!==null&&(H=this.getFragmentAtPosition(U,this.bitrateTest?M.fragmentEnd:M.edge,M))}return H},p.getFragmentAtPosition=function(M,P,B){var H=this.config,F=this.fragPrevious,W=B.fragments,U=B.endSN,K=B.fragmentHint,G=H.maxFragLookUpTolerance,ae=!!(H.lowLatencyMode&&B.partList&&K);ae&&K&&!this.bitrateTest&&(W=W.concat(K),U=K.sn);var fe;if(M<P){var Se=M>P-G?0:G;fe=Object(l.findFragmentByPTS)(F,W,M,Se)}else fe=W[W.length-1];if(fe){var Ue=fe.sn-B.startSN,Ne=F&&fe.level===F.level,xe=W[Ue+1],Ce=this.fragmentTracker.getState(fe);if(Ce===d.FragmentState.BACKTRACKED){fe=null;for(var De=Ue;W[De]&&this.fragmentTracker.getState(W[De])===d.FragmentState.BACKTRACKED;)F?fe=W[De--]:fe=W[--De];fe||(fe=xe)}else F&&fe.sn===F.sn&&!ae&&(Ne&&(fe.sn<U&&this.fragmentTracker.getState(xe)!==d.FragmentState.OK?(this.log("SN "+fe.sn+" just loaded, load next one: "+xe.sn),fe=xe):fe=null))}return fe},p.synchronizeToLiveEdge=function(M){var P=this.config,B=this.media;if(!B)return;var H=this.hls.liveSyncPosition,F=B.currentTime,W=M.fragments[0].start,U=M.edge,K=F>=W-P.maxFragLookUpTolerance&&F<=U;if(H!==null&&B.duration>H&&(F<H||!K)){var G=P.liveMaxLatencyDuration!==void 0?P.liveMaxLatencyDuration:P.liveMaxLatencyDurationCount*M.targetduration;(!K&&B.readyState<4||F<U-G)&&(this.loadedmetadata||(this.nextLoadPosition=H),B.readyState&&(this.warn("Playback: "+F.toFixed(3)+" is located too far from the end of live sliding playlist: "+U+", reset currentTime to : "+H.toFixed(3)),B.currentTime=H))}},p.alignPlaylists=function(M,P){var B=this.levels,H=this.levelLastLoaded,F=this.fragPrevious,W=H!==null?B[H]:null,U=M.fragments.length;if(!U)return this.warn("No fragments in live playlist"),0;var K=M.fragments[0].start,G=!P,ae=M.alignedSliding&&Object(R.isFiniteNumber)(K);if(G||!ae&&!K){Object(s.alignStream)(F,W,M);var fe=M.fragments[0].start;return this.log("Live playlist sliding: "+fe.toFixed(2)+" start-sn: "+(P?P.startSN:"na")+"->"+M.startSN+" prev-sn: "+(F?F.sn:"na")+" fragments: "+U),fe}return K},p.waitForCdnTuneIn=function(M){var P=3;return M.live&&M.canBlockReload&&M.tuneInGoal>Math.max(M.partHoldBack,M.partTarget*P)},p.setStartPosition=function(M,P){var B=this.startPosition;if(B<P&&(B=-1),B===-1||this.lastCurrentTime===-1){var H=M.startTimeOffset;Object(R.isFiniteNumber)(H)?(B=P+H,H<0&&(B+=M.totalduration),B=Math.min(Math.max(P,B),P+M.totalduration),this.log("Start time offset "+H+" found in playlist, adjust startPosition to "+B),this.startPosition=B):M.live?B=this.hls.liveSyncPosition||P:this.startPosition=B=0,this.lastCurrentTime=B}this.nextLoadPosition=B},p.getLoadPosition=function(){var M=this.media,P=0;return this.loadedmetadata&&M?P=M.currentTime:this.nextLoadPosition&&(P=this.nextLoadPosition),P},p.handleFragLoadAborted=function(M,P){this.transmuxer&&M.sn!=="initSegment"&&M.stats.aborted&&(this.warn("Fragment "+M.sn+(P?" part"+P.index:"")+" of level "+M.level+" was aborted"),this.resetFragmentLoading(M))},p.resetFragmentLoading=function(M){(!this.fragCurrent||!this.fragContextChanged(M))&&(this.state=x.IDLE)},p.onFragmentOrKeyLoadError=function(M,P){if(P.fatal)return;var B=P.frag;if(!B||B.type!==M)return;var H=this.fragCurrent;console.assert(H&&B.sn===H.sn&&B.level===H.level&&B.urlId===H.urlId,"Frag load error must match current frag to retry");var F=this.config;if(this.fragLoadError+1<=F.fragLoadingMaxRetry){if(this.resetLiveStartWhenNotLoaded(B.level))return;var W=Math.min(Math.pow(2,this.fragLoadError)*F.fragLoadingRetryDelay,F.fragLoadingMaxRetryTimeout);this.warn("Fragment "+B.sn+" of "+M+" "+B.level+" failed to load, retrying in "+W+"ms"),this.retryDate=self.performance.now()+W,this.fragLoadError++,this.state=x.FRAG_LOADING_WAITING_RETRY}else P.levelRetry?(M===f.PlaylistLevelType.AUDIO&&(this.fragCurrent=null),this.fragLoadError=0,this.state=x.IDLE):(y.logger.error(P.details+" reaches max retry, redispatch as fatal ..."),P.fatal=!0,this.hls.stopLoad(),this.state=x.ERROR)},p.afterBufferFlushed=function(M,P,B){if(!M)return;var H=E.BufferHelper.getBuffered(M);this.fragmentTracker.detectEvictedFragments(P,H,B),this.state===x.ENDED&&this.resetLoadingState()},p.resetLoadingState=function(){this.fragCurrent=null,this.fragPrevious=null,this.state=x.IDLE},p.resetLiveStartWhenNotLoaded=function(M){if(!this.loadedmetadata){this.startFragRequested=!1;var P=this.levels?this.levels[M].details:null;if(P!=null&&P.live)return this.startPosition=-1,this.setStartPosition(P,0),this.resetLoadingState(),!0;this.nextLoadPosition=this.startPosition}return!1},p.updateLevelTiming=function(M,P,B,H){var F=this,W=B.details;console.assert(!!W,"level.details must be defined");var U=Object.keys(M.elementaryStreams).reduce(function(K,G){var ae=M.elementaryStreams[G];if(ae){var fe=ae.endPTS-ae.startPTS;if(fe<=0)return F.warn("Could not parse fragment "+M.sn+" "+G+" duration reliably ("+fe+") resetting transmuxer to fallback to playlist timing"),F.resetTransmuxer(),K||!1;var Se=H?0:Object(r.updateFragPTSDTS)(W,M,ae.startPTS,ae.endPTS,ae.startDTS,ae.endDTS);return F.hls.trigger(v.Events.LEVEL_PTS_UPDATED,{details:W,level:B,drift:Se,type:G,frag:M,start:ae.startPTS,end:ae.endPTS}),!0}return K},!1);U?(this.state=x.PARSED,this.hls.trigger(v.Events.FRAG_PARSED,{frag:M,part:P})):this.resetLoadingState()},p.resetTransmuxer=function(){this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null)},T(A,[{key:"state",get:function(){return this._state},set:function(M){var P=this._state;P!==M&&(this._state=M,this.log(P+"->"+M))}}]),A}(O.default)},"./src/controller/buffer-controller.ts":function(j,k,D){"use strict";D.r(k),D.d(k,"default",function(){return l});var R=D("./src/polyfills/number.ts"),O=D("./src/events.ts"),d=D("./src/utils/logger.ts"),E=D("./src/errors.ts"),y=D("./src/utils/buffer-helper.ts"),v=D("./src/utils/mediasource-helper.ts"),u=D("./src/loader/fragment.ts"),a=D("./src/controller/buffer-operation-queue.ts"),c=Object(v.getMediaSource)(),s=/([ha]vc.)(?:\.[^.,]+)+/,l=function(){function r(o){var i=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 f=i.hls,h=i.media,T=i.mediaSource;d.logger.log("[buffer-controller]: Media source opened"),h&&(i.updateMediaElementDuration(),f.trigger(O.Events.MEDIA_ATTACHED,{media:h})),T&&T.removeEventListener("sourceopen",i._onMediaSourceOpen),i.checkPendingTracks()},this._onMediaSourceClose=function(){d.logger.log("[buffer-controller]: Media source closed")},this._onMediaSourceEnded=function(){d.logger.log("[buffer-controller]: Media source ended")},this.hls=o,this._initSourceBuffer(),this.registerListeners()}var n=r.prototype;return n.hasSourceTypes=function(){return this.getSourceBufferTypes().length>0||Object.keys(this.pendingTracks).length>0},n.destroy=function(){this.unregisterListeners(),this.details=null},n.registerListeners=function(){var i=this.hls;i.on(O.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),i.on(O.Events.MEDIA_DETACHING,this.onMediaDetaching,this),i.on(O.Events.MANIFEST_PARSED,this.onManifestParsed,this),i.on(O.Events.BUFFER_RESET,this.onBufferReset,this),i.on(O.Events.BUFFER_APPENDING,this.onBufferAppending,this),i.on(O.Events.BUFFER_CODECS,this.onBufferCodecs,this),i.on(O.Events.BUFFER_EOS,this.onBufferEos,this),i.on(O.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),i.on(O.Events.LEVEL_UPDATED,this.onLevelUpdated,this),i.on(O.Events.FRAG_PARSED,this.onFragParsed,this),i.on(O.Events.FRAG_CHANGED,this.onFragChanged,this)},n.unregisterListeners=function(){var i=this.hls;i.off(O.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),i.off(O.Events.MEDIA_DETACHING,this.onMediaDetaching,this),i.off(O.Events.MANIFEST_PARSED,this.onManifestParsed,this),i.off(O.Events.BUFFER_RESET,this.onBufferReset,this),i.off(O.Events.BUFFER_APPENDING,this.onBufferAppending,this),i.off(O.Events.BUFFER_CODECS,this.onBufferCodecs,this),i.off(O.Events.BUFFER_EOS,this.onBufferEos,this),i.off(O.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),i.off(O.Events.LEVEL_UPDATED,this.onLevelUpdated,this),i.off(O.Events.FRAG_PARSED,this.onFragParsed,this),i.off(O.Events.FRAG_CHANGED,this.onFragChanged,this)},n._initSourceBuffer=function(){this.sourceBuffer={},this.operationQueue=new a.default(this.sourceBuffer),this.listeners={audio:[],video:[],audiovideo:[]}},n.onManifestParsed=function(i,f){var h=2;(f.audio&&!f.video||!f.altAudio)&&(h=1),this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=h,this.details=null,d.logger.log(this.bufferCodecEventsExpected+" bufferCodec event(s) expected")},n.onMediaAttaching=function(i,f){var h=this.media=f.media;if(h&&c){var T=this.mediaSource=new c;T.addEventListener("sourceopen",this._onMediaSourceOpen),T.addEventListener("sourceended",this._onMediaSourceEnded),T.addEventListener("sourceclose",this._onMediaSourceClose),h.src=self.URL.createObjectURL(T),this._objectUrl=h.src}},n.onMediaDetaching=function(){var i=this.media,f=this.mediaSource,h=this._objectUrl;if(f){if(d.logger.log("[buffer-controller]: media source detaching"),f.readyState==="open")try{f.endOfStream()}catch(T){d.logger.warn("[buffer-controller]: onMediaDetaching: "+T.message+" while calling endOfStream")}this.onBufferReset(),f.removeEventListener("sourceopen",this._onMediaSourceOpen),f.removeEventListener("sourceended",this._onMediaSourceEnded),f.removeEventListener("sourceclose",this._onMediaSourceClose),i&&(h&&self.URL.revokeObjectURL(h),i.src===h?(i.removeAttribute("src"),i.load()):d.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(O.Events.MEDIA_DETACHED,void 0)},n.onBufferReset=function(){var i=this;this.getSourceBufferTypes().forEach(function(f){var h=i.sourceBuffer[f];try{h&&(i.removeBufferListeners(f),i.mediaSource&&i.mediaSource.removeSourceBuffer(h),i.sourceBuffer[f]=void 0)}catch(T){d.logger.warn("[buffer-controller]: Failed to reset the "+f+" buffer",T)}}),this._initSourceBuffer()},n.onBufferCodecs=function(i,f){var h=this,T=this.getSourceBufferTypes().length;if(Object.keys(f).forEach(function(g){if(T){var w=h.tracks[g];if(w&&typeof w.buffer.changeType=="function"){var C=f[g],x=C.codec,b=C.levelCodec,S=C.container,A=(w.levelCodec||w.codec).replace(s,"$1"),p=(b||x).replace(s,"$1");if(A!==p){var I=S+";codecs="+(b||x);h.appendChangeType(g,I)}}}else h.pendingTracks[g]=f[g]}),T)return;this.bufferCodecEventsExpected=Math.max(this.bufferCodecEventsExpected-1,0),this.mediaSource&&this.mediaSource.readyState==="open"&&this.checkPendingTracks()},n.appendChangeType=function(i,f){var h=this,T=this.operationQueue,g={execute:function(){var C=h.sourceBuffer[i];C&&(d.logger.log("[buffer-controller]: changing "+i+" sourceBuffer type to "+f),C.changeType(f)),T.shiftAndExecuteNext(i)},onStart:function(){},onComplete:function(){},onError:function(C){d.logger.warn("[buffer-controller]: Failed to change "+i+" SourceBuffer type",C)}};T.append(g,i)},n.onBufferAppending=function(i,f){var h=this,T=this.hls,g=this.operationQueue,w=this.tracks,C=f.data,x=f.type,b=f.frag,S=f.part,A=f.chunkMeta,p=A.buffering[x],I=self.performance.now();p.start=I;var M=b.stats.buffering,P=S?S.stats.buffering:null;M.start===0&&(M.start=I),P&&P.start===0&&(P.start=I);var B=w.audio,H=x==="audio"&&A.id===1&&(B==null?void 0:B.container)==="audio/mpeg",F={execute:function(){if(p.executeStart=self.performance.now(),H){var U=h.sourceBuffer[x];if(U){var K=b.start-U.timestampOffset;Math.abs(K)>=.1&&(d.logger.log("[buffer-controller]: Updating audio SourceBuffer timestampOffset to "+b.start+" (delta: "+K+") sn: "+b.sn+")"),U.timestampOffset=b.start)}}h.appendExecutor(C,x)},onStart:function(){},onComplete:function(){var U=self.performance.now();p.executeEnd=p.end=U,M.first===0&&(M.first=U),P&&P.first===0&&(P.first=U);var K=h.sourceBuffer,G={};for(var ae in K)G[ae]=y.BufferHelper.getBuffered(K[ae]);h.appendError=0,h.hls.trigger(O.Events.BUFFER_APPENDED,{type:x,frag:b,part:S,chunkMeta:A,parent:b.type,timeRanges:G})},onError:function(U){d.logger.error("[buffer-controller]: Error encountered while trying to append to the "+x+" SourceBuffer",U);var K={type:E.ErrorTypes.MEDIA_ERROR,parent:b.type,details:E.ErrorDetails.BUFFER_APPEND_ERROR,err:U,fatal:!1};U.code===DOMException.QUOTA_EXCEEDED_ERR?K.details=E.ErrorDetails.BUFFER_FULL_ERROR:(h.appendError++,K.details=E.ErrorDetails.BUFFER_APPEND_ERROR,h.appendError>T.config.appendErrorMaxRetry&&(d.logger.error("[buffer-controller]: Failed "+T.config.appendErrorMaxRetry+" times to append segment in sourceBuffer"),K.fatal=!0)),T.trigger(O.Events.ERROR,K)}};g.append(F,x)},n.onBufferFlushing=function(i,f){var h=this,T=this.operationQueue,g=function(C){return{execute:h.removeExecutor.bind(h,C,f.startOffset,f.endOffset),onStart:function(){},onComplete:function(){h.hls.trigger(O.Events.BUFFER_FLUSHED,{type:C})},onError:function(b){d.logger.warn("[buffer-controller]: Failed to remove from "+C+" SourceBuffer",b)}}};f.type?T.append(g(f.type),f.type):this.getSourceBufferTypes().forEach(function(w){T.append(g(w),w)})},n.onFragParsed=function(i,f){var h=this,T=f.frag,g=f.part,w=[],C=g?g.elementaryStreams:T.elementaryStreams;C[u.ElementaryStreamTypes.AUDIOVIDEO]?w.push("audiovideo"):(C[u.ElementaryStreamTypes.AUDIO]&&w.push("audio"),C[u.ElementaryStreamTypes.VIDEO]&&w.push("video"));var x=function(){var S=self.performance.now();T.stats.buffering.end=S,g&&(g.stats.buffering.end=S);var A=g?g.stats:T.stats;h.hls.trigger(O.Events.FRAG_BUFFERED,{frag:T,part:g,stats:A,id:T.type})};w.length===0&&d.logger.warn("Fragments must have at least one ElementaryStreamType set. type: "+T.type+" level: "+T.level+" sn: "+T.sn),this.blockBuffers(x,w)},n.onFragChanged=function(i,f){this.flushBackBuffer()},n.onBufferEos=function(i,f){var h=this,T=this.getSourceBufferTypes().reduce(function(g,w){var C=h.sourceBuffer[w];return(!f.type||f.type===w)&&(C&&!C.ended&&(C.ended=!0,d.logger.log("[buffer-controller]: "+w+" sourceBuffer now EOS"))),g&&!!(!C||C.ended)},!0);T&&this.blockBuffers(function(){var g=h.mediaSource;if(!g||g.readyState!=="open")return;g.endOfStream()})},n.onLevelUpdated=function(i,f){var h=f.details;if(!h.fragments.length)return;this.details=h,this.getSourceBufferTypes().length?this.blockBuffers(this.updateMediaElementDuration.bind(this)):this.updateMediaElementDuration()},n.flushBackBuffer=function(){var i=this.hls,f=this.details,h=this.media,T=this.sourceBuffer;if(!h||f===null)return;var g=this.getSourceBufferTypes();if(!g.length)return;var w=f.live&&i.config.liveBackBufferLength!==null?i.config.liveBackBufferLength:i.config.backBufferLength;if(!Object(R.isFiniteNumber)(w)||w<0)return;var C=h.currentTime,x=f.levelTargetDuration,b=Math.max(w,x),S=Math.floor(C/x)*x-b;g.forEach(function(A){var p=T[A];if(p){var I=y.BufferHelper.getBuffered(p);I.length>0&&S>I.start(0)&&(i.trigger(O.Events.BACK_BUFFER_REACHED,{bufferEnd:S}),f.live&&i.trigger(O.Events.LIVE_BACK_BUFFER_REACHED,{bufferEnd:S}),i.trigger(O.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:S,type:A}))}})},n.updateMediaElementDuration=function(){if(!this.details||!this.media||!this.mediaSource||this.mediaSource.readyState!=="open")return;var i=this.details,f=this.hls,h=this.media,T=this.mediaSource,g=i.fragments[0].start+i.totalduration,w=h.duration,C=Object(R.isFiniteNumber)(T.duration)?T.duration:0;i.live&&f.config.liveDurationInfinity?(d.logger.log("[buffer-controller]: Media Source duration is set to Infinity"),T.duration=Infinity,this.updateSeekableRange(i)):(g>C&&g>w||!Object(R.isFiniteNumber)(w))&&(d.logger.log("[buffer-controller]: Updating Media Source duration to "+g.toFixed(3)),T.duration=g)},n.updateSeekableRange=function(i){var f=this.mediaSource,h=i.fragments,T=h.length;if(T&&i.live&&f!==null&&f!==void 0&&f.setLiveSeekableRange){var g=Math.max(0,h[0].start),w=Math.max(g,g+i.totalduration);f.setLiveSeekableRange(g,w)}},n.checkPendingTracks=function(){var i=this.bufferCodecEventsExpected,f=this.operationQueue,h=this.pendingTracks,T=Object.keys(h).length;if(T&&!i||T===2){this.createSourceBuffers(h),this.pendingTracks={};var g=this.getSourceBufferTypes();if(g.length===0){this.hls.trigger(O.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}g.forEach(function(w){f.executeNext(w)})}},n.createSourceBuffers=function(i){var f=this.sourceBuffer,h=this.mediaSource;if(!h)throw Error("createSourceBuffers called when mediaSource was null");var T=0;for(var g in i)if(!f[g]){var w=i[g];if(!w)throw Error("source buffer exists for track "+g+", however track does not");var C=w.levelCodec||w.codec,x=w.container+";codecs="+C;d.logger.log("[buffer-controller]: creating sourceBuffer("+x+")");try{var b=f[g]=h.addSourceBuffer(x),S=g;this.addBufferListener(S,"updatestart",this._onSBUpdateStart),this.addBufferListener(S,"updateend",this._onSBUpdateEnd),this.addBufferListener(S,"error",this._onSBUpdateError),this.tracks[g]={buffer:b,codec:C,container:w.container,levelCodec:w.levelCodec,id:w.id},T++}catch(A){d.logger.error("[buffer-controller]: error while trying to add sourceBuffer: "+A.message),this.hls.trigger(O.Events.ERROR,{type:E.ErrorTypes.MEDIA_ERROR,details:E.ErrorDetails.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:A,mimeType:x})}}T&&this.hls.trigger(O.Events.BUFFER_CREATED,{tracks:this.tracks})},n._onSBUpdateStart=function(i){var f=this.operationQueue,h=f.current(i);h.onStart()},n._onSBUpdateEnd=function(i){var f=this.operationQueue,h=f.current(i);h.onComplete(),f.shiftAndExecuteNext(i)},n._onSBUpdateError=function(i,f){d.logger.error("[buffer-controller]: "+i+" SourceBuffer error",f),this.hls.trigger(O.Events.ERROR,{type:E.ErrorTypes.MEDIA_ERROR,details:E.ErrorDetails.BUFFER_APPENDING_ERROR,fatal:!1});var h=this.operationQueue.current(i);h&&h.onError(f)},n.removeExecutor=function(i,f,h){var T=this.media,g=this.mediaSource,w=this.operationQueue,C=this.sourceBuffer,x=C[i];if(!T||!g||!x){d.logger.warn("[buffer-controller]: Attempting to remove from the "+i+" SourceBuffer, but it does not exist"),w.shiftAndExecuteNext(i);return}var b=Object(R.isFiniteNumber)(T.duration)?T.duration:Infinity,S=Object(R.isFiniteNumber)(g.duration)?g.duration:Infinity,A=Math.max(0,f),p=Math.min(h,b,S);p>A?(d.logger.log("[buffer-controller]: Removing ["+A+","+p+"] from the "+i+" SourceBuffer"),console.assert(!x.updating,i+" sourceBuffer must not be updating"),x.remove(A,p)):w.shiftAndExecuteNext(i)},n.appendExecutor=function(i,f){var h=this.operationQueue,T=this.sourceBuffer,g=T[f];if(!g){d.logger.warn("[buffer-controller]: Attempting to append to the "+f+" SourceBuffer, but it does not exist"),h.shiftAndExecuteNext(f);return}g.ended=!1,console.assert(!g.updating,f+" sourceBuffer must not be updating"),g.appendBuffer(i)},n.blockBuffers=function(i,f){var h=this;if(f===void 0&&(f=this.getSourceBufferTypes()),!f.length){d.logger.log("[buffer-controller]: Blocking operation requested, but no SourceBuffers exist"),Promise.resolve(i);return}var T=this.operationQueue,g=f.map(function(w){return T.appendBlocker(w)});Promise.all(g).then(function(){i(),f.forEach(function(w){var C=h.sourceBuffer[w];(!C||!C.updating)&&T.shiftAndExecuteNext(w)})})},n.getSourceBufferTypes=function(){return Object.keys(this.sourceBuffer)},n.addBufferListener=function(i,f,h){var T=this.sourceBuffer[i];if(!T)return;var g=h.bind(this,i);this.listeners[i].push({event:f,listener:g}),T.addEventListener(f,g)},n.removeBufferListeners=function(i){var f=this.sourceBuffer[i];if(!f)return;this.listeners[i].forEach(function(h){f.removeEventListener(h.event,h.listener)})},r}()},"./src/controller/buffer-operation-queue.ts":function(j,k,D){"use strict";D.r(k),D.d(k,"default",function(){return O});var R=D("./src/utils/logger.ts"),O=function(){function d(y){this.buffers=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.buffers=y}var E=d.prototype;return E.append=function(v,u){var a=this.queues[u];a.push(v),a.length===1&&this.buffers[u]&&this.executeNext(u)},E.insertAbort=function(v,u){var a=this.queues[u];a.unshift(v),this.executeNext(u)},E.appendBlocker=function(v){var u,a=new Promise(function(s){u=s}),c={execute:u,onStart:function(){},onComplete:function(){},onError:function(){}};return this.append(c,v),a},E.executeNext=function(v){var u=this.buffers,a=this.queues,c=u[v],s=a[v];if(s.length){var l=s[0];try{l.execute()}catch(r){R.logger.warn("[buffer-operation-queue]: Unhandled exception executing the current operation"),l.onError(r),(!c||!c.updating)&&(s.shift(),this.executeNext(v))}}},E.shiftAndExecuteNext=function(v){this.queues[v].shift(),this.executeNext(v)},E.current=function(v){return this.queues[v][0]},d}()},"./src/controller/cap-level-controller.ts":function(j,k,D){"use strict";D.r(k);var R=D("./src/events.ts");function O(y,v){for(var u=0;u<v.length;u++){var a=v[u];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(y,a.key,a)}}function d(y,v,u){return v&&O(y.prototype,v),u&&O(y,u),y}var E=function(){function y(u){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=u,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.firstLevel=-1,this.media=null,this.restrictedLevels=[],this.timer=void 0,this.clientRect=null,this.registerListeners()}var v=y.prototype;return v.setStreamController=function(a){this.streamController=a},v.destroy=function(){this.unregisterListener(),this.hls.config.capLevelToPlayerSize&&this.stopCapping(),this.media=null,this.clientRect=null,this.hls=this.streamController=null},v.registerListeners=function(){var a=this.hls;a.on(R.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),a.on(R.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),a.on(R.Events.MANIFEST_PARSED,this.onManifestParsed,this),a.on(R.Events.BUFFER_CODECS,this.onBufferCodecs,this),a.on(R.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},v.unregisterListener=function(){var a=this.hls;a.off(R.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),a.off(R.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),a.off(R.Events.MANIFEST_PARSED,this.onManifestParsed,this),a.off(R.Events.BUFFER_CODECS,this.onBufferCodecs,this),a.off(R.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},v.onFpsDropLevelCapping=function(a,c){y.isLevelAllowed(c.droppedLevel,this.restrictedLevels)&&this.restrictedLevels.push(c.droppedLevel)},v.onMediaAttaching=function(a,c){this.media=c.media instanceof HTMLVideoElement?c.media:null},v.onManifestParsed=function(a,c){var s=this.hls;this.restrictedLevels=[],this.firstLevel=c.firstLevel,s.config.capLevelToPlayerSize&&c.video&&this.startCapping()},v.onBufferCodecs=function(a,c){var s=this.hls;s.config.capLevelToPlayerSize&&c.video&&this.startCapping()},v.onMediaDetaching=function(){this.stopCapping()},v.detectPlayerSize=function(){if(this.media&&this.mediaHeight>0&&this.mediaWidth>0){var a=this.hls.levels;if(a.length){var c=this.hls;c.autoLevelCapping=this.getMaxLevel(a.length-1),c.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=c.autoLevelCapping}}},v.getMaxLevel=function(a){var c=this,s=this.hls.levels;if(!s.length)return-1;var l=s.filter(function(r,n){return y.isLevelAllowed(n,c.restrictedLevels)&&n<=a});return this.clientRect=null,y.getMaxLevelByMediaSize(l,this.mediaWidth,this.mediaHeight)},v.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()},v.stopCapping=function(){this.restrictedLevels=[],this.firstLevel=-1,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.timer&&(self.clearInterval(this.timer),this.timer=void 0)},v.getDimensions=function(){if(this.clientRect)return this.clientRect;var a=this.media,c={width:0,height:0};if(a){var s=a.getBoundingClientRect();c.width=s.width,c.height=s.height,!c.width&&!c.height&&(c.width=s.right-s.left||a.width||0,c.height=s.bottom-s.top||a.height||0)}return this.clientRect=c,c},y.isLevelAllowed=function(a,c){return c===void 0&&(c=[]),c.indexOf(a)===-1},y.getMaxLevelByMediaSize=function(a,c,s){if(!a||!a.length)return-1;for(var l=function(f,h){return h?f.width!==h.width||f.height!==h.height:!0},r=a.length-1,n=0;n<a.length;n+=1){var o=a[n];if((o.width>=c||o.height>=s)&&l(o,a[n+1])){r=n;break}}return r},d(y,[{key:"mediaWidth",get:function(){return this.getDimensions().width*y.contentScaleFactor}},{key:"mediaHeight",get:function(){return this.getDimensions().height*y.contentScaleFactor}}],[{key:"contentScaleFactor",get:function(){var a=1;try{a=self.devicePixelRatio}catch(c){}return a}}]),y}();k.default=E},"./src/controller/cmcd-controller.ts":function(j,k,D){"use strict";D.r(k),D.d(k,"default",function(){return l});var R=D("./src/events.ts"),O=D("./src/types/cmcd.ts"),d=D("./src/utils/buffer-helper.ts"),E=D("./src/utils/logger.ts");function y(r,n){for(var o=0;o<n.length;o++){var i=n[o];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(r,i.key,i)}}function v(r,n,o){return n&&y(r.prototype,n),o&&y(r,o),r}function u(r,n){var o=typeof Symbol!="undefined"&&r[Symbol.iterator]||r["@@iterator"];if(o)return(o=o.call(r)).next.bind(o);if(Array.isArray(r)||(o=a(r))||n&&r&&typeof r.length=="number"){o&&(r=o);var i=0;return function(){return i>=r.length?{done:!0}:{done:!1,value:r[i++]}}}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 a(r,n){if(!r)return;if(typeof r=="string")return c(r,n);var o=Object.prototype.toString.call(r).slice(8,-1);if(o==="Object"&&r.constructor&&(o=r.constructor.name),o==="Map"||o==="Set")return Array.from(r);if(o==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return c(r,n)}function c(r,n){(n==null||n>r.length)&&(n=r.length);for(var o=0,i=new Array(n);o<n;o++)i[o]=r[o];return i}function s(){return s=Object.assign||function(r){for(var n=1;n<arguments.length;n++){var o=arguments[n];for(var i in o)Object.prototype.hasOwnProperty.call(o,i)&&(r[i]=o[i])}return r},s.apply(this,arguments)}var l=function(){function r(o){var i=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(){i.initialized&&(i.starved=!0),i.buffering=!0},this.onPlaying=function(){i.initialized||(i.initialized=!0),i.buffering=!1},this.applyPlaylistData=function(T){try{i.apply(T,{ot:O.CMCDObjectType.MANIFEST,su:!i.initialized})}catch(g){E.logger.warn("Could not generate manifest CMCD data.",g)}},this.applyFragmentData=function(T){try{var g=T.frag,w=i.hls.levels[g.level],C=i.getObjectType(g),x={d:g.duration*1e3,ot:C};(C===O.CMCDObjectType.VIDEO||C===O.CMCDObjectType.AUDIO||C==O.CMCDObjectType.MUXED)&&(x.br=w.bitrate/1e3,x.tb=i.getTopBandwidth(C),x.bl=i.getBufferLength(C)),i.apply(T,x)}catch(b){E.logger.warn("Could not generate segment CMCD data.",b)}},this.hls=o;var f=this.config=o.config,h=f.cmcd;h!=null&&(f.pLoader=this.createPlaylistLoader(),f.fLoader=this.createFragmentLoader(),this.sid=h.sessionId||r.uuid(),this.cid=h.contentId,this.useHeaders=h.useHeaders===!0,this.registerListeners())}var n=r.prototype;return n.registerListeners=function(){var i=this.hls;i.on(R.Events.MEDIA_ATTACHED,this.onMediaAttached,this),i.on(R.Events.MEDIA_DETACHED,this.onMediaDetached,this),i.on(R.Events.BUFFER_CREATED,this.onBufferCreated,this)},n.unregisterListeners=function(){var i=this.hls;i.off(R.Events.MEDIA_ATTACHED,this.onMediaAttached,this),i.off(R.Events.MEDIA_DETACHED,this.onMediaDetached,this),i.off(R.Events.BUFFER_CREATED,this.onBufferCreated,this),this.onMediaDetached()},n.destroy=function(){this.unregisterListeners(),this.hls=this.config=this.audioBuffer=this.videoBuffer=null},n.onMediaAttached=function(i,f){this.media=f.media,this.media.addEventListener("waiting",this.onWaiting),this.media.addEventListener("playing",this.onPlaying)},n.onMediaDetached=function(){if(!this.media)return;this.media.removeEventListener("waiting",this.onWaiting),this.media.removeEventListener("playing",this.onPlaying),this.media=null},n.onBufferCreated=function(i,f){var h,T;this.audioBuffer=(h=f.tracks.audio)===null||h===void 0?void 0:h.buffer,this.videoBuffer=(T=f.tracks.video)===null||T===void 0?void 0:T.buffer},n.createData=function(){var i;return{v:O.CMCDVersion,sf:O.CMCDStreamingFormat.HLS,sid:this.sid,cid:this.cid,pr:(i=this.media)===null||i===void 0?void 0:i.playbackRate,mtp:this.hls.bandwidthEstimate/1e3}},n.apply=function(i,f){f===void 0&&(f={}),s(f,this.createData());var h=f.ot===O.CMCDObjectType.INIT||f.ot===O.CMCDObjectType.VIDEO||f.ot===O.CMCDObjectType.MUXED;if(this.starved&&h&&(f.bs=!0,f.su=!0,this.starved=!1),f.su==null&&(f.su=this.buffering),this.useHeaders){var T=r.toHeaders(f);if(!Object.keys(T).length)return;i.headers||(i.headers={}),s(i.headers,T)}else{var g=r.toQuery(f);if(!g)return;i.url=r.appendQueryToUri(i.url,g)}},n.getObjectType=function(i){var f=i.type;return f==="subtitle"?O.CMCDObjectType.TIMED_TEXT:i.sn==="initSegment"?O.CMCDObjectType.INIT:f==="audio"?O.CMCDObjectType.AUDIO:f==="main"?this.hls.audioTracks.length?O.CMCDObjectType.VIDEO:O.CMCDObjectType.MUXED:void 0},n.getTopBandwidth=function(i){for(var f=0,h=i===O.CMCDObjectType.AUDIO?this.hls.audioTracks:this.hls.levels,T=u(h),g;!(g=T()).done;){var w=g.value;w.bitrate>f&&(f=w.bitrate)}return f>0?f:NaN},n.getBufferLength=function(i){var f=this.hls.media,h=i===O.CMCDObjectType.AUDIO?this.audioBuffer:this.videoBuffer;if(!h||!f)return NaN;var T=d.BufferHelper.bufferInfo(h,f.currentTime,this.config.maxBufferHole);return T.len*1e3},n.createPlaylistLoader=function(){var i=this.config.pLoader,f=this.applyPlaylistData,h=i||this.config.loader;return function(){function T(w){this.loader=void 0,this.loader=new h(w)}var g=T.prototype;return g.destroy=function(){this.loader.destroy()},g.abort=function(){this.loader.abort()},g.load=function(C,x,b){f(C),this.loader.load(C,x,b)},v(T,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),T}()},n.createFragmentLoader=function(){var i=this.config.fLoader,f=this.applyFragmentData,h=i||this.config.loader;return function(){function T(w){this.loader=void 0,this.loader=new h(w)}var g=T.prototype;return g.destroy=function(){this.loader.destroy()},g.abort=function(){this.loader.abort()},g.load=function(C,x,b){f(C),this.loader.load(C,x,b)},v(T,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),T}()},r.uuid=function(){var i=URL.createObjectURL(new Blob),f=i.toString();return URL.revokeObjectURL(i),f.substr(f.lastIndexOf("/")+1)},r.serialize=function(i){for(var f=[],h=function(H){return!Number.isNaN(H)&&H!=null&&H!==""&&H!==!1},T=function(H){return Math.round(H)},g=function(H){return T(H/100)*100},w=function(H){return encodeURIComponent(H)},C={br:T,d:T,bl:g,dl:g,mtp:g,nor:w,rtp:g,tb:T},x=Object.keys(i||{}).sort(),b=u(x),S;!(S=b()).done;){var A=S.value,p=i[A];if(!h(p))continue;if(A==="v"&&p===1)continue;if(A=="pr"&&p===1)continue;var I=C[A];I&&(p=I(p));var M=typeof p,P=void 0;A==="ot"||A==="sf"||A==="st"?P=A+"="+p:M==="boolean"?P=A:M==="number"?P=A+"="+p:P=A+"="+JSON.stringify(p),f.push(P)}return f.join(",")},r.toHeaders=function(i){for(var f=Object.keys(i),h={},T=["Object","Request","Session","Status"],g=[{},{},{},{}],w={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,x=f;C<x.length;C++){var b=x[C],S=w[b]!=null?w[b]:1;g[S][b]=i[b]}for(var A=0;A<g.length;A++){var p=r.serialize(g[A]);p&&(h["CMCD-"+T[A]]=p)}return h},r.toQuery=function(i){return"CMCD="+encodeURIComponent(r.serialize(i))},r.appendQueryToUri=function(i,f){if(!f)return i;var h=i.includes("?")?"&":"?";return""+i+h+f},r}()},"./src/controller/eme-controller.ts":function(j,k,D){"use strict";D.r(k);var R=D("./src/events.ts"),O=D("./src/errors.ts"),d=D("./src/utils/logger.ts"),E=D("./src/utils/mediakeys-helper.ts");function y(l,r){for(var n=0;n<r.length;n++){var o=r[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(l,o.key,o)}}function v(l,r,n){return r&&y(l.prototype,r),n&&y(l,n),l}var u=3,a=function(r,n,o){var i={audioCapabilities:[],videoCapabilities:[]};return r.forEach(function(f){i.audioCapabilities.push({contentType:'audio/mp4; codecs="'+f+'"',robustness:o.audioRobustness||""})}),n.forEach(function(f){i.videoCapabilities.push({contentType:'video/mp4; codecs="'+f+'"',robustness:o.videoRobustness||""})}),[i]},c=function(r,n,o,i){switch(r){case E.KeySystems.WIDEVINE:return a(n,o,i);default:throw new Error("Unknown key-system: "+r)}},s=function(){function l(n){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=n,this._config=n.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 r=l.prototype;return r.destroy=function(){this._unregisterListeners(),this.hls=this._onMediaEncrypted=null,this._requestMediaKeySystemAccess=null},r._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)},r._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)},r.getLicenseServerUrl=function(o){switch(o){case E.KeySystems.WIDEVINE:if(!this._widevineLicenseUrl)break;return this._widevineLicenseUrl}throw new Error('no license server URL configured for key-system "'+o+'"')},r._attemptKeySystemAccess=function(o,i,f){var h=this,T=c(o,i,f,this._drmSystemOptions);d.logger.log("Requesting encrypted media key-system access");var g=this.requestMediaKeySystemAccess(o,T);this.mediaKeysPromise=g.then(function(w){return h._onMediaKeySystemAccessObtained(o,w)}),g.catch(function(w){d.logger.error('Failed to obtain key-system "'+o+'" access:',w)})},r._onMediaKeySystemAccessObtained=function(o,i){var f=this;d.logger.log('Access for key-system "'+o+'" obtained');var h={mediaKeysSessionInitialized:!1,mediaKeySystemAccess:i,mediaKeySystemDomain:o};this._mediaKeysList.push(h);var T=Promise.resolve().then(function(){return i.createMediaKeys()}).then(function(g){return h.mediaKeys=g,d.logger.log('Media-keys created for key-system "'+o+'"'),f._onMediaKeysCreated(),g});return T.catch(function(g){d.logger.error("Failed to create media-keys:",g)}),T},r._onMediaKeysCreated=function(){var o=this;this._mediaKeysList.forEach(function(i){i.mediaKeysSession||(i.mediaKeysSession=i.mediaKeys.createSession(),o._onNewMediaKeySession(i.mediaKeysSession))})},r._onNewMediaKeySession=function(o){var i=this;d.logger.log("New key-system session "+o.sessionId),o.addEventListener("message",function(f){i._onKeySessionMessage(o,f.message)},!1)},r._onKeySessionMessage=function(o,i){d.logger.log("Got EME message event, creating license request"),this._requestLicense(i,function(f){d.logger.log("Received license data (length: "+(f&&f.byteLength)+"), updating key-session"),o.update(f)})},r.onMediaEncrypted=function(o){var i=this;if(d.logger.log('Media is encrypted using "'+o.initDataType+'" init data type'),!this.mediaKeysPromise){d.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been requested"),this.hls.trigger(R.Events.ERROR,{type:O.ErrorTypes.KEY_SYSTEM_ERROR,details:O.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}var f=function(T){if(!i._media)return;i._attemptSetMediaKeys(T),i._generateRequestWithPreferredKeySession(o.initDataType,o.initData)};this.mediaKeysPromise.then(f).catch(f)},r._attemptSetMediaKeys=function(o){if(!this._media)throw new Error("Attempted to set mediaKeys without first attaching a media element");if(!this._hasSetMediaKeys){var i=this._mediaKeysList[0];if(!i||!i.mediaKeys){d.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been obtained yet"),this.hls.trigger(R.Events.ERROR,{type:O.ErrorTypes.KEY_SYSTEM_ERROR,details:O.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}d.logger.log("Setting keys for encrypted media"),this._media.setMediaKeys(i.mediaKeys),this._hasSetMediaKeys=!0}},r._generateRequestWithPreferredKeySession=function(o,i){var f=this,h=this._mediaKeysList[0];if(!h){d.logger.error("Fatal: Media is encrypted but not any key-system access has been obtained yet"),this.hls.trigger(R.Events.ERROR,{type:O.ErrorTypes.KEY_SYSTEM_ERROR,details:O.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}if(h.mediaKeysSessionInitialized){d.logger.warn("Key-Session already initialized but requested again");return}var T=h.mediaKeysSession;if(!T){d.logger.error("Fatal: Media is encrypted but no key-session existing"),this.hls.trigger(R.Events.ERROR,{type:O.ErrorTypes.KEY_SYSTEM_ERROR,details:O.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!0});return}if(!i){d.logger.warn("Fatal: initData required for generating a key session is null"),this.hls.trigger(R.Events.ERROR,{type:O.ErrorTypes.KEY_SYSTEM_ERROR,details:O.ErrorDetails.KEY_SYSTEM_NO_INIT_DATA,fatal:!0});return}d.logger.log('Generating key-session request for "'+o+'" init data type'),h.mediaKeysSessionInitialized=!0,T.generateRequest(o,i).then(function(){d.logger.debug("Key-session generation succeeded")}).catch(function(g){d.logger.error("Error generating key-session request:",g),f.hls.trigger(R.Events.ERROR,{type:O.ErrorTypes.KEY_SYSTEM_ERROR,details:O.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!1})})},r._createLicenseXhr=function(o,i,f){var h=new XMLHttpRequest;h.responseType="arraybuffer",h.onreadystatechange=this._onLicenseRequestReadyStageChange.bind(this,h,o,i,f);var T=this._licenseXhrSetup;if(T)try{T.call(this.hls,h,o),T=void 0}catch(g){d.logger.error(g)}try{h.readyState||h.open("POST",o,!0),T&&T.call(this.hls,h,o)}catch(g){throw new Error("issue setting up KeySystem license XHR "+g)}return h},r._onLicenseRequestReadyStageChange=function(o,i,f,h){switch(o.readyState){case 4:if(o.status===200){this._requestLicenseFailureCount=0,d.logger.log("License request succeeded");var T=o.response,g=this._licenseResponseCallback;if(g)try{T=g.call(this.hls,o,i)}catch(C){d.logger.error(C)}h(T)}else{if(d.logger.error("License Request XHR failed ("+i+"). Status: "+o.status+" ("+o.statusText+")"),this._requestLicenseFailureCount++,this._requestLicenseFailureCount>u){this.hls.trigger(R.Events.ERROR,{type:O.ErrorTypes.KEY_SYSTEM_ERROR,details:O.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0});return}var w=u-this._requestLicenseFailureCount+1;d.logger.warn("Retrying license request, "+w+" attempts left"),this._requestLicense(f,h)}break}},r._generateLicenseRequestChallenge=function(o,i){switch(o.mediaKeySystemDomain){case E.KeySystems.WIDEVINE:return i}throw new Error("unsupported key-system: "+o.mediaKeySystemDomain)},r._requestLicense=function(o,i){d.logger.log("Requesting content license for key-system");var f=this._mediaKeysList[0];if(!f){d.logger.error("Fatal error: Media is encrypted but no key-system access has been obtained yet"),this.hls.trigger(R.Events.ERROR,{type:O.ErrorTypes.KEY_SYSTEM_ERROR,details:O.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}try{var h=this.getLicenseServerUrl(f.mediaKeySystemDomain),T=this._createLicenseXhr(h,o,i);d.logger.log("Sending license request to URL: "+h);var g=this._generateLicenseRequestChallenge(f,o);T.send(g)}catch(w){d.logger.error("Failure requesting DRM license: "+w),this.hls.trigger(R.Events.ERROR,{type:O.ErrorTypes.KEY_SYSTEM_ERROR,details:O.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0})}},r.onMediaAttached=function(o,i){if(!this._emeEnabled)return;var f=i.media;this._media=f,f.addEventListener("encrypted",this._onMediaEncrypted)},r.onMediaDetached=function(){var o=this._media,i=this._mediaKeysList;if(!o)return;o.removeEventListener("encrypted",this._onMediaEncrypted),this._media=null,this._mediaKeysList=[],Promise.all(i.map(function(f){if(f.mediaKeysSession)return f.mediaKeysSession.close().catch(function(){})})).then(function(){return o.setMediaKeys(null)}).catch(function(){})},r.onManifestParsed=function(o,i){if(!this._emeEnabled)return;var f=i.levels.map(function(T){return T.audioCodec}).filter(function(T){return!!T}),h=i.levels.map(function(T){return T.videoCodec}).filter(function(T){return!!T});this._attemptKeySystemAccess(E.KeySystems.WIDEVINE,f,h)},v(l,[{key:"requestMediaKeySystemAccess",get:function(){if(!this._requestMediaKeySystemAccess)throw new Error("No requestMediaKeySystemAccess function configured");return this._requestMediaKeySystemAccess}}]),l}();k.default=s},"./src/controller/fps-controller.ts":function(j,k,D){"use strict";D.r(k);var R=D("./src/events.ts"),O=D("./src/utils/logger.ts"),d=function(){function E(v){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=v,this.registerListeners()}var y=E.prototype;return y.setStreamController=function(u){this.streamController=u},y.registerListeners=function(){this.hls.on(R.Events.MEDIA_ATTACHING,this.onMediaAttaching,this)},y.unregisterListeners=function(){this.hls.off(R.Events.MEDIA_ATTACHING,this.onMediaAttaching)},y.destroy=function(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null},y.onMediaAttaching=function(u,a){var c=this.hls.config;if(c.capLevelOnFPSDrop){var s=a.media instanceof self.HTMLVideoElement?a.media:null;this.media=s,s&&typeof s.getVideoPlaybackQuality=="function"&&(this.isVideoPlaybackQualityAvailable=!0),self.clearInterval(this.timer),this.timer=self.setInterval(this.checkFPSInterval.bind(this),c.fpsDroppedMonitoringPeriod)}},y.checkFPS=function(u,a,c){var s=performance.now();if(a){if(this.lastTime){var l=s-this.lastTime,r=c-this.lastDroppedFrames,n=a-this.lastDecodedFrames,o=1e3*r/l,i=this.hls;if(i.trigger(R.Events.FPS_DROP,{currentDropped:r,currentDecoded:n,totalDroppedFrames:c}),o>0&&r>i.config.fpsDroppedMonitoringThreshold*n){var f=i.currentLevel;O.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+f),f>0&&(i.autoLevelCapping===-1||i.autoLevelCapping>=f)&&(f=f-1,i.trigger(R.Events.FPS_DROP_LEVEL_CAPPING,{level:f,droppedLevel:i.currentLevel}),i.autoLevelCapping=f,this.streamController.nextLevelSwitch())}}this.lastTime=s,this.lastDroppedFrames=c,this.lastDecodedFrames=a}},y.checkFPSInterval=function(){var u=this.media;if(u)if(this.isVideoPlaybackQualityAvailable){var a=u.getVideoPlaybackQuality();this.checkFPS(u,a.totalVideoFrames,a.droppedVideoFrames)}else this.checkFPS(u,u.webkitDecodedFrameCount,u.webkitDroppedFrameCount)},E}();k.default=d},"./src/controller/fragment-finders.ts":function(j,k,D){"use strict";D.r(k),D.d(k,"findFragmentByPDT",function(){return d}),D.d(k,"findFragmentByPTS",function(){return E}),D.d(k,"fragmentWithinToleranceTest",function(){return y}),D.d(k,"pdtWithinToleranceTest",function(){return v}),D.d(k,"findFragWithCC",function(){return u});var R=D("./src/polyfills/number.ts"),O=D("./src/utils/binary-search.ts");function d(a,c,s){if(c===null||!Array.isArray(a)||!a.length||!Object(R.isFiniteNumber)(c))return null;var l=a[0].programDateTime;if(c<(l||0))return null;var r=a[a.length-1].endProgramDateTime;if(c>=(r||0))return null;s=s||0;for(var n=0;n<a.length;++n){var o=a[n];if(v(c,s,o))return o}return null}function E(a,c,s,l){s===void 0&&(s=0),l===void 0&&(l=0);var r=null;if(a?r=c[a.sn-c[0].sn+1]||null:s===0&&c[0].start===0&&(r=c[0]),r&&y(s,l,r)===0)return r;var n=O.default.search(c,y.bind(null,s,l));return n||r}function y(a,c,s){a===void 0&&(a=0),c===void 0&&(c=0);var l=Math.min(c,s.duration+(s.deltaPTS?s.deltaPTS:0));return s.start+s.duration-l<=a?1:s.start-l>a&&s.start?-1:0}function v(a,c,s){var l=Math.min(c,s.duration+(s.deltaPTS?s.deltaPTS:0))*1e3,r=s.endProgramDateTime||0;return r-l>a}function u(a,c){return O.default.search(a,function(s){return s.cc<c?1:s.cc>c?-1:0})}},"./src/controller/fragment-tracker.ts":function(j,k,D){"use strict";D.r(k),D.d(k,"FragmentState",function(){return d}),D.d(k,"FragmentTracker",function(){return E});var R=D("./src/events.ts"),O=D("./src/types/loader.ts"),d;(function(u){u.NOT_LOADED="NOT_LOADED",u.BACKTRACKED="BACKTRACKED",u.APPENDING="APPENDING",u.PARTIAL="PARTIAL",u.OK="OK"})(d||(d={}));var E=function(){function u(c){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=c,this._registerListeners()}var a=u.prototype;return a._registerListeners=function(){var s=this.hls;s.on(R.Events.BUFFER_APPENDED,this.onBufferAppended,this),s.on(R.Events.FRAG_BUFFERED,this.onFragBuffered,this),s.on(R.Events.FRAG_LOADED,this.onFragLoaded,this)},a._unregisterListeners=function(){var s=this.hls;s.off(R.Events.BUFFER_APPENDED,this.onBufferAppended,this),s.off(R.Events.FRAG_BUFFERED,this.onFragBuffered,this),s.off(R.Events.FRAG_LOADED,this.onFragLoaded,this)},a.destroy=function(){this._unregisterListeners(),this.fragments=this.timeRanges=null},a.getAppendedFrag=function(s,l){if(l===O.PlaylistLevelType.MAIN){var r=this.activeFragment,n=this.activeParts;if(!r)return null;if(n)for(var o=n.length;o--;){var i=n[o],f=i?i.end:r.appendedPTS;if(i.start<=s&&f!==void 0&&s<=f)return o>9&&(this.activeParts=n.slice(o-9)),i}else if(r.start<=s&&r.appendedPTS!==void 0&&s<=r.appendedPTS)return r}return this.getBufferedFrag(s,l)},a.getBufferedFrag=function(s,l){for(var r=this.fragments,n=Object.keys(r),o=n.length;o--;){var i=r[n[o]];if((i==null?void 0:i.body.type)===l&&i.buffered){var f=i.body;if(f.start<=s&&s<=f.end)return f}}return null},a.detectEvictedFragments=function(s,l,r){var n=this;Object.keys(this.fragments).forEach(function(o){var i=n.fragments[o];if(!i)return;if(!i.buffered){i.body.type===r&&n.removeFragment(i.body);return}var f=i.range[s];if(!f)return;f.time.some(function(h){var T=!n.isTimeBuffered(h.startPTS,h.endPTS,l);return T&&n.removeFragment(i.body),T})})},a.detectPartialFragments=function(s){var l=this,r=this.timeRanges,n=s.frag,o=s.part;if(!r||n.sn==="initSegment")return;var i=v(n),f=this.fragments[i];if(!f)return;Object.keys(r).forEach(function(h){var T=n.elementaryStreams[h];if(!T)return;var g=r[h],w=o!==null||T.partial===!0;f.range[h]=l.getBufferedTimes(n,o,w,g)}),f.backtrack=f.loaded=null,Object.keys(f.range).length?f.buffered=!0:this.removeFragment(f.body)},a.fragBuffered=function(s){var l=v(s),r=this.fragments[l];r&&(r.backtrack=r.loaded=null,r.buffered=!0)},a.getBufferedTimes=function(s,l,r,n){for(var o={time:[],partial:r},i=l?l.start:s.start,f=l?l.end:s.end,h=s.minEndPTS||f,T=s.maxStartPTS||i,g=0;g<n.length;g++){var w=n.start(g)-this.bufferPadding,C=n.end(g)+this.bufferPadding;if(T>=w&&h<=C){o.time.push({startPTS:Math.max(i,n.start(g)),endPTS:Math.min(f,n.end(g))});break}else if(i<C&&f>w)o.partial=!0,o.time.push({startPTS:Math.max(i,n.start(g)),endPTS:Math.min(f,n.end(g))});else if(f<=w)break}return o},a.getPartialFragment=function(s){var l=null,r,n,o,i=0,f=this.bufferPadding,h=this.fragments;return Object.keys(h).forEach(function(T){var g=h[T];if(!g)return;y(g)&&(n=g.body.start-f,o=g.body.end+f,s>=n&&s<=o&&(r=Math.min(s-n,o-s),i<=r&&(l=g.body,i=r)))}),l},a.getState=function(s){var l=v(s),r=this.fragments[l];return r?r.buffered?y(r)?d.PARTIAL:d.OK:r.backtrack?d.BACKTRACKED:d.APPENDING:d.NOT_LOADED},a.backtrack=function(s,l){var r=v(s),n=this.fragments[r];if(!n||n.backtrack)return null;var o=n.backtrack=l||n.loaded;return n.loaded=null,o},a.getBacktrackData=function(s){var l=v(s),r=this.fragments[l];if(r){var n,o=r.backtrack;if(o!=null&&(n=o.payload)!==null&&n!==void 0&&n.byteLength)return o;this.removeFragment(s)}return null},a.isTimeBuffered=function(s,l,r){for(var n,o,i=0;i<r.length;i++){if(n=r.start(i)-this.bufferPadding,o=r.end(i)+this.bufferPadding,s>=n&&l<=o)return!0;if(l<=n)return!1}return!1},a.onFragLoaded=function(s,l){var r=l.frag,n=l.part;if(r.sn==="initSegment"||r.bitrateTest||n)return;var o=v(r);this.fragments[o]={body:r,loaded:l,backtrack:null,buffered:!1,range:Object.create(null)}},a.onBufferAppended=function(s,l){var r=this,n=l.frag,o=l.part,i=l.timeRanges;if(n.type===O.PlaylistLevelType.MAIN)if(this.activeFragment=n,o){var f=this.activeParts;f||(this.activeParts=f=[]),f.push(o)}else this.activeParts=null;this.timeRanges=i,Object.keys(i).forEach(function(h){var T=i[h];if(r.detectEvictedFragments(h,T),!o)for(var g=0;g<T.length;g++)n.appendedPTS=Math.max(T.end(g),n.appendedPTS||0)})},a.onFragBuffered=function(s,l){this.detectPartialFragments(l)},a.hasFragment=function(s){var l=v(s);return!!this.fragments[l]},a.removeFragmentsInRange=function(s,l,r){var n=this;Object.keys(this.fragments).forEach(function(o){var i=n.fragments[o];if(!i)return;if(i.buffered){var f=i.body;f.type===r&&f.start<l&&f.end>s&&n.removeFragment(f)}})},a.removeFragment=function(s){var l=v(s);s.stats.loaded=0,s.clearElementaryStreamInfo(),delete this.fragments[l]},a.removeAllFragments=function(){this.fragments=Object.create(null),this.activeFragment=null,this.activeParts=null},u}();function y(u){var a,c;return u.buffered&&(((a=u.range.video)===null||a===void 0?void 0:a.partial)||((c=u.range.audio)===null||c===void 0?void 0:c.partial))}function v(u){return u.type+"_"+u.level+"_"+u.urlId+"_"+u.sn}},"./src/controller/gap-controller.ts":function(j,k,D){"use strict";D.r(k),D.d(k,"STALL_MINIMUM_DURATION_MS",function(){return y}),D.d(k,"MAX_START_GAP_JUMP",function(){return v}),D.d(k,"SKIP_BUFFER_HOLE_STEP_SECONDS",function(){return u}),D.d(k,"SKIP_BUFFER_RANGE_START",function(){return a}),D.d(k,"default",function(){return c});var R=D("./src/utils/buffer-helper.ts"),O=D("./src/errors.ts"),d=D("./src/events.ts"),E=D("./src/utils/logger.ts"),y=250,v=2,u=.1,a=.05,c=function(){function s(r,n,o,i){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=r,this.media=n,this.fragmentTracker=o,this.hls=i}var l=s.prototype;return l.destroy=function(){this.hls=this.fragmentTracker=this.media=null},l.poll=function(n){var o=this.config,i=this.media,f=this.stalled,h=i.currentTime,T=i.seeking,g=this.seeking&&!T,w=!this.seeking&&T;if(this.seeking=T,h!==n){if(this.moved=!0,f!==null){if(this.stallReported){var C=self.performance.now()-f;E.logger.warn("playback not stuck anymore @"+h+", after "+Math.round(C)+"ms"),this.stallReported=!1}this.stalled=null,this.nudgeRetry=0}return}if((w||g)&&(this.stalled=null),i.paused||i.ended||i.playbackRate===0||!R.BufferHelper.getBuffered(i).length)return;var x=R.BufferHelper.bufferInfo(i,h,0),b=x.len>0,S=x.nextStart||0;if(!b&&!S)return;if(T){var A=x.len>v,p=!S||S-h>v&&!this.fragmentTracker.getPartialFragment(h);if(A||p)return;this.moved=!1}if(!this.moved&&this.stalled!==null){var I,M=Math.max(S,x.start||0)-h,P=this.hls.levels?this.hls.levels[this.hls.currentLevel]:null,B=P==null||((I=P.details)===null||I===void 0)?void 0:I.live,H=B?P.details.targetduration*2:v;if(M>0&&M<=H){this._trySkipBufferHole(null);return}}var F=self.performance.now();if(f===null){this.stalled=F;return}var W=F-f;!T&&W>=y&&this._reportStall(x.len);var U=R.BufferHelper.bufferInfo(i,h,o.maxBufferHole);this._tryFixBufferStall(U,W)},l._tryFixBufferStall=function(n,o){var i=this.config,f=this.fragmentTracker,h=this.media,T=h.currentTime,g=f.getPartialFragment(T);if(g){var w=this._trySkipBufferHole(g);if(w)return}n.len>i.maxBufferHole&&o>i.highBufferWatchdogPeriod*1e3&&(E.logger.warn("Trying to nudge playhead over buffer-hole"),this.stalled=null,this._tryNudgeBuffer())},l._reportStall=function(n){var o=this.hls,i=this.media,f=this.stallReported;f||(this.stallReported=!0,E.logger.warn("Playback stalling at @"+i.currentTime+" due to low buffer (buffer="+n+")"),o.trigger(d.Events.ERROR,{type:O.ErrorTypes.MEDIA_ERROR,details:O.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!1,buffer:n}))},l._trySkipBufferHole=function(n){for(var o=this.config,i=this.hls,f=this.media,h=f.currentTime,T=0,g=R.BufferHelper.getBuffered(f),w=0;w<g.length;w++){var C=g.start(w);if(h+o.maxBufferHole>=T&&h<C){var x=Math.max(C+a,f.currentTime+u);return E.logger.warn("skipping hole, adjusting currentTime from "+h+" to "+x),this.moved=!0,this.stalled=null,f.currentTime=x,n&&i.trigger(d.Events.ERROR,{type:O.ErrorTypes.MEDIA_ERROR,details:O.ErrorDetails.BUFFER_SEEK_OVER_HOLE,fatal:!1,reason:"fragment loaded with buffer holes, seeking from "+h+" to "+x,frag:n}),x}T=g.end(w)}return 0},l._tryNudgeBuffer=function(){var n=this.config,o=this.hls,i=this.media,f=i.currentTime,h=(this.nudgeRetry||0)+1;if(this.nudgeRetry=h,h<n.nudgeMaxRetry){var T=f+h*n.nudgeOffset;E.logger.warn("Nudging 'currentTime' from "+f+" to "+T),i.currentTime=T,o.trigger(d.Events.ERROR,{type:O.ErrorTypes.MEDIA_ERROR,details:O.ErrorDetails.BUFFER_NUDGE_ON_STALL,fatal:!1})}else E.logger.error("Playhead still not moving while enough data buffered @"+f+" after "+n.nudgeMaxRetry+" nudges"),o.trigger(d.Events.ERROR,{type:O.ErrorTypes.MEDIA_ERROR,details:O.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!0})},s}()},"./src/controller/id3-track-controller.ts":function(j,k,D){"use strict";D.r(k);var R=D("./src/events.ts"),O=D("./src/utils/texttrack-utils.ts"),d=D("./src/demux/id3.ts"),E=.25,y=function(){function v(a){this.hls=void 0,this.id3Track=null,this.media=null,this.hls=a,this._registerListeners()}var u=v.prototype;return u.destroy=function(){this._unregisterListeners()},u._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.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),c.on(R.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},u._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.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),c.off(R.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},u.onMediaAttached=function(c,s){this.media=s.media},u.onMediaDetaching=function(){if(!this.id3Track)return;Object(O.clearCurrentCues)(this.id3Track),this.id3Track=null,this.media=null},u.getID3Track=function(c){if(!this.media)return;for(var s=0;s<c.length;s++){var l=c[s];if(l.kind==="metadata"&&l.label==="id3")return Object(O.sendAddTrackEvent)(l,this.media),l}return this.media.addTextTrack("metadata","id3")},u.onFragParsingMetadata=function(c,s){if(!this.media)return;var l=s.frag,r=s.samples;this.id3Track||(this.id3Track=this.getID3Track(this.media.textTracks),this.id3Track.mode="hidden");for(var n=self.WebKitDataCue||self.VTTCue||self.TextTrackCue,o=0;o<r.length;o++){var i=d.getID3Frames(r[o].data);if(i){var f=r[o].pts,h=o<r.length-1?r[o+1].pts:l.end,T=h-f;T<=0&&(h=f+E);for(var g=0;g<i.length;g++){var w=i[g];if(!d.isTimeStampFrame(w)){var C=new n(f,h,"");C.value=w,this.id3Track.addCue(C)}}}}},u.onBufferFlushing=function(c,s){var l=s.startOffset,r=s.endOffset,n=s.type;if(!n||n==="audio"){var o=this.id3Track;o&&Object(O.removeCuesInRange)(o,l,r)}},v}();k.default=y},"./src/controller/latency-controller.ts":function(j,k,D){"use strict";D.r(k),D.d(k,"default",function(){return v});var R=D("./src/errors.ts"),O=D("./src/events.ts"),d=D("./src/utils/logger.ts");function E(u,a){for(var c=0;c<a.length;c++){var s=a[c];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(u,s.key,s)}}function y(u,a,c){return a&&E(u.prototype,a),c&&E(u,c),u}var v=function(){function u(c){var s=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 s.timeupdate()},this.hls=c,this.config=c.config,this.registerListeners()}var a=u.prototype;return a.destroy=function(){this.unregisterListeners(),this.onMediaDetaching(),this.levelDetails=null,this.hls=this.timeupdateHandler=null},a.registerListeners=function(){this.hls.on(O.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(O.Events.MEDIA_DETACHING,this.onMediaDetaching,this),this.hls.on(O.Events.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(O.Events.LEVEL_UPDATED,this.onLevelUpdated,this),this.hls.on(O.Events.ERROR,this.onError,this)},a.unregisterListeners=function(){this.hls.off(O.Events.MEDIA_ATTACHED,this.onMediaAttached),this.hls.off(O.Events.MEDIA_DETACHING,this.onMediaDetaching),this.hls.off(O.Events.MANIFEST_LOADING,this.onManifestLoading),this.hls.off(O.Events.LEVEL_UPDATED,this.onLevelUpdated),this.hls.off(O.Events.ERROR,this.onError)},a.onMediaAttached=function(s,l){this.media=l.media,this.media.addEventListener("timeupdate",this.timeupdateHandler)},a.onMediaDetaching=function(){this.media&&(this.media.removeEventListener("timeupdate",this.timeupdateHandler),this.media=null)},a.onManifestLoading=function(){this.levelDetails=null,this._latency=null,this.stallCount=0},a.onLevelUpdated=function(s,l){var r=l.details;this.levelDetails=r,r.advanced&&this.timeupdate(),!r.live&&this.media&&this.media.removeEventListener("timeupdate",this.timeupdateHandler)},a.onError=function(s,l){if(l.details!==R.ErrorDetails.BUFFER_STALLED_ERROR)return;this.stallCount++,d.logger.warn("[playback-rate-controller]: Stall detected, adjusting target latency")},a.timeupdate=function(){var s=this.media,l=this.levelDetails;if(!s||!l)return;this.currentTime=s.currentTime;var r=this.computeLatency();if(r===null)return;this._latency=r;var n=this.config,o=n.lowLatencyMode,i=n.maxLiveSyncPlaybackRate;if(!o||i===1)return;var f=this.targetLatency;if(f===null)return;var h=r-f,T=Math.min(this.maxLatency,f+l.targetduration),g=h<T;if(l.live&&g&&h>.05&&this.forwardBufferLength>1){var w=Math.min(2,Math.max(1,i)),C=Math.round(2/(1+Math.exp(-.75*h-this.edgeStalled))*20)/20;s.playbackRate=Math.min(w,Math.max(1,C))}else s.playbackRate!==1&&s.playbackRate!==0&&(s.playbackRate=1)},a.estimateLiveEdge=function(){var s=this.levelDetails;return s===null?null:s.edge+s.age},a.computeLatency=function(){var s=this.estimateLiveEdge();return s===null?null:s-this.currentTime},y(u,[{key:"latency",get:function(){return this._latency||0}},{key:"maxLatency",get:function(){var s=this.config,l=this.levelDetails;return s.liveMaxLatencyDuration!==void 0?s.liveMaxLatencyDuration:l?s.liveMaxLatencyDurationCount*l.targetduration:0}},{key:"targetLatency",get:function(){var s=this.levelDetails;if(s===null)return null;var l=s.holdBack,r=s.partHoldBack,n=s.targetduration,o=this.config,i=o.liveSyncDuration,f=o.liveSyncDurationCount,h=o.lowLatencyMode,T=this.hls.userConfig,g=h&&r||l;(T.liveSyncDuration||T.liveSyncDurationCount||g===0)&&(g=i!==void 0?i:f*n);var w=n,C=1;return g+Math.min(this.stallCount*C,w)}},{key:"liveSyncPosition",get:function(){var s=this.estimateLiveEdge(),l=this.targetLatency,r=this.levelDetails;if(s===null||l===null||r===null)return null;var n=r.edge,o=s-l-this.edgeStalled,i=n-r.totalduration,f=n-(this.config.lowLatencyMode&&r.partTarget||r.targetduration);return Math.min(Math.max(i,o),f)}},{key:"drift",get:function(){var s=this.levelDetails;return s===null?1:s.drift}},{key:"edgeStalled",get:function(){var s=this.levelDetails;if(s===null)return 0;var l=(this.config.lowLatencyMode&&s.partTarget||s.targetduration)*3;return Math.max(s.age-l,0)}},{key:"forwardBufferLength",get:function(){var s=this.media,l=this.levelDetails;if(!s||!l)return 0;var r=s.buffered.length;return r?s.buffered.end(r-1):l.edge-this.currentTime}}]),u}()},"./src/controller/level-controller.ts":function(j,k,D){"use strict";D.r(k),D.d(k,"default",function(){return o});var R=D("./src/types/level.ts"),O=D("./src/events.ts"),d=D("./src/errors.ts"),E=D("./src/utils/codecs.ts"),y=D("./src/controller/level-helper.ts"),v=D("./src/controller/base-playlist-controller.ts"),u=D("./src/types/loader.ts");function a(){return a=Object.assign||function(i){for(var f=1;f<arguments.length;f++){var h=arguments[f];for(var T in h)Object.prototype.hasOwnProperty.call(h,T)&&(i[T]=h[T])}return i},a.apply(this,arguments)}function c(i,f){for(var h=0;h<f.length;h++){var T=f[h];T.enumerable=T.enumerable||!1,T.configurable=!0,"value"in T&&(T.writable=!0),Object.defineProperty(i,T.key,T)}}function s(i,f,h){return f&&c(i.prototype,f),h&&c(i,h),i}function l(i,f){i.prototype=Object.create(f.prototype),i.prototype.constructor=i,r(i,f)}function r(i,f){return r=Object.setPrototypeOf||function(T,g){return T.__proto__=g,T},r(i,f)}var n=/chrome|firefox/.test(navigator.userAgent.toLowerCase()),o=function(i){l(f,i);function f(T){var g;return g=i.call(this,T,"[level-controller]")||this,g._levels=[],g._firstLevel=-1,g._startLevel=void 0,g.currentLevelIndex=-1,g.manualLevelIndex=-1,g.onParsedComplete=void 0,g._registerListeners(),g}var h=f.prototype;return h._registerListeners=function(){var g=this.hls;g.on(O.Events.MANIFEST_LOADED,this.onManifestLoaded,this),g.on(O.Events.LEVEL_LOADED,this.onLevelLoaded,this),g.on(O.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),g.on(O.Events.FRAG_LOADED,this.onFragLoaded,this),g.on(O.Events.ERROR,this.onError,this)},h._unregisterListeners=function(){var g=this.hls;g.off(O.Events.MANIFEST_LOADED,this.onManifestLoaded,this),g.off(O.Events.LEVEL_LOADED,this.onLevelLoaded,this),g.off(O.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),g.off(O.Events.FRAG_LOADED,this.onFragLoaded,this),g.off(O.Events.ERROR,this.onError,this)},h.destroy=function(){this._unregisterListeners(),this.manualLevelIndex=-1,this._levels.length=0,i.prototype.destroy.call(this)},h.startLoad=function(){var g=this._levels;g.forEach(function(w){w.loadError=0}),i.prototype.startLoad.call(this)},h.onManifestLoaded=function(g,w){var C=[],x=[],b=[],S,A={},p,I=!1,M=!1,P=!1;if(w.levels.forEach(function(W){var U=W.attrs;I=I||!!(W.width&&W.height),M=M||!!W.videoCodec,P=P||!!W.audioCodec,n&&W.audioCodec&&W.audioCodec.indexOf("mp4a.40.34")!==-1&&(W.audioCodec=void 0);var K=W.bitrate+"-"+W.attrs.RESOLUTION+"-"+W.attrs.CODECS;p=A[K],p?p.url.push(W.url):(p=new R.Level(W),A[K]=p,C.push(p)),U&&(U.AUDIO&&Object(y.addGroupId)(p,"audio",U.AUDIO),U.SUBTITLES&&Object(y.addGroupId)(p,"text",U.SUBTITLES))}),(I||M)&&P&&(C=C.filter(function(W){var U=W.videoCodec,K=W.width,G=W.height;return!!U||!!(K&&G)})),C=C.filter(function(W){var U=W.audioCodec,K=W.videoCodec;return(!U||Object(E.isCodecSupportedInMp4)(U,"audio"))&&(!K||Object(E.isCodecSupportedInMp4)(K,"video"))}),w.audioTracks&&(x=w.audioTracks.filter(function(W){return!W.audioCodec||Object(E.isCodecSupportedInMp4)(W.audioCodec,"audio")}),Object(y.assignTrackIdsByGroup)(x)),w.subtitles&&(b=w.subtitles,Object(y.assignTrackIdsByGroup)(b)),C.length>0){S=C[0].bitrate,C.sort(function(W,U){return W.bitrate-U.bitrate}),this._levels=C;for(var B=0;B<C.length;B++)if(C[B].bitrate===S){this._firstLevel=B,this.log("manifest loaded, "+C.length+" level(s) found, first bitrate: "+S);break}var H=P&&!M,F={levels:C,audioTracks:x,subtitleTracks:b,firstLevel:this._firstLevel,stats:w.stats,audio:P,video:M,altAudio:!H&&x.some(function(W){return!!W.url})};this.hls.trigger(O.Events.MANIFEST_PARSED,F),(this.hls.config.autoStartLoad||this.hls.forceStartLoad)&&this.hls.startLoad(this.hls.config.startPosition)}else this.hls.trigger(O.Events.ERROR,{type:d.ErrorTypes.MEDIA_ERROR,details:d.ErrorDetails.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:w.url,reason:"no level with compatible codecs found in manifest"})},h.onError=function(g,w){if(i.prototype.onError.call(this,g,w),w.fatal)return;var C=w.context,x=this._levels[this.currentLevelIndex];if(C&&(C.type===u.PlaylistContextType.AUDIO_TRACK&&x.audioGroupIds&&C.groupId===x.audioGroupIds[x.urlId]||C.type===u.PlaylistContextType.SUBTITLE_TRACK&&x.textGroupIds&&C.groupId===x.textGroupIds[x.urlId])){this.redundantFailover(this.currentLevelIndex);return}var b=!1,S=!0,A;switch(w.details){case d.ErrorDetails.FRAG_LOAD_ERROR:case d.ErrorDetails.FRAG_LOAD_TIMEOUT:case d.ErrorDetails.KEY_LOAD_ERROR:case d.ErrorDetails.KEY_LOAD_TIMEOUT:if(w.frag){var p=this._levels[w.frag.level];p?(p.fragmentError++,p.fragmentError>this.hls.config.fragLoadingMaxRetry&&(A=w.frag.level)):A=w.frag.level}break;case d.ErrorDetails.LEVEL_LOAD_ERROR:case d.ErrorDetails.LEVEL_LOAD_TIMEOUT:C&&(C.deliveryDirectives&&(S=!1),A=C.level),b=!0;break;case d.ErrorDetails.REMUX_ALLOC_ERROR:A=w.level,b=!0;break}A!==void 0&&this.recoverLevel(w,A,b,S)},h.recoverLevel=function(g,w,C,x){var b=g.details,S=this._levels[w];if(S.loadError++,C){var A=this.retryLoadingOrFail(g);if(A)g.levelRetry=!0;else{this.currentLevelIndex=-1;return}}if(x){var p=S.url.length;if(p>1&&S.loadError<p)g.levelRetry=!0,this.redundantFailover(w);else if(this.manualLevelIndex===-1){var I=w===0?this._levels.length-1:w-1;this.currentLevelIndex!==I&&this._levels[I].loadError===0&&(this.warn(b+": switch to "+I),g.levelRetry=!0,this.hls.nextAutoLevel=I)}}},h.redundantFailover=function(g){var w=this._levels[g],C=w.url.length;if(C>1){var x=(w.urlId+1)%C;this.warn("Switching to redundant URL-id "+x),this._levels.forEach(function(b){b.urlId=x}),this.level=g}},h.onFragLoaded=function(g,w){var C=w.frag;if(C!==void 0&&C.type===u.PlaylistLevelType.MAIN){var x=this._levels[C.level];x!==void 0&&(x.fragmentError=0,x.loadError=0)}},h.onLevelLoaded=function(g,w){var C,x=w.level,b=w.details,S=this._levels[x];if(!S){var A;this.warn("Invalid level index "+x),(A=w.deliveryDirectives)!==null&&A!==void 0&&A.skip&&(b.deltaUpdateFailed=!0);return}x===this.currentLevelIndex?(S.fragmentError===0&&(S.loadError=0,this.retryCount=0),this.playlistLoaded(x,w,S.details)):(C=w.deliveryDirectives)!==null&&C!==void 0&&C.skip&&(b.deltaUpdateFailed=!0)},h.onAudioTrackSwitched=function(g,w){var C=this.hls.levels[this.currentLevelIndex];if(!C)return;if(C.audioGroupIds){for(var x=-1,b=this.hls.audioTracks[w.id].groupId,S=0;S<C.audioGroupIds.length;S++)if(C.audioGroupIds[S]===b){x=S;break}x!==C.urlId&&(C.urlId=x,this.startLoad())}},h.loadPlaylist=function(g){var w=this.currentLevelIndex,C=this._levels[w];if(this.canLoad&&C&&C.url.length>0){var x=C.urlId,b=C.url[x];if(g)try{b=g.addDirectives(b)}catch(S){this.warn("Could not construct new URL with HLS Delivery Directives: "+S)}this.log("Attempt loading level index "+w+(g?" at sn "+g.msn+" part "+g.part:"")+" with URL-id "+x+" "+b),this.clearTimer(),this.hls.trigger(O.Events.LEVEL_LOADING,{url:b,level:w,id:x,deliveryDirectives:g||null})}},h.removeLevel=function(g,w){var C=function(S,A){return A!==w},x=this._levels.filter(function(b,S){return S!==g?!0:b.url.length>1&&w!==void 0?(b.url=b.url.filter(C),b.audioGroupIds&&(b.audioGroupIds=b.audioGroupIds.filter(C)),b.textGroupIds&&(b.textGroupIds=b.textGroupIds.filter(C)),b.urlId=0,!0):!1}).map(function(b,S){var A=b.details;return A!=null&&A.fragments&&A.fragments.forEach(function(p){p.level=S}),b});this._levels=x,this.hls.trigger(O.Events.LEVELS_UPDATED,{levels:x})},s(f,[{key:"levels",get:function(){return this._levels.length===0?null:this._levels}},{key:"level",get:function(){return this.currentLevelIndex},set:function(g){var w,C=this._levels;if(C.length===0)return;if(this.currentLevelIndex===g&&(w=C[g])!==null&&w!==void 0&&w.details)return;if(g<0||g>=C.length){var x=g<0;if(this.hls.trigger(O.Events.ERROR,{type:d.ErrorTypes.OTHER_ERROR,details:d.ErrorDetails.LEVEL_SWITCH_ERROR,level:g,fatal:x,reason:"invalid level idx"}),x)return;g=Math.min(g,C.length-1)}this.clearTimer();var b=this.currentLevelIndex,S=C[b],A=C[g];this.log("switching to level "+g+" from "+b),this.currentLevelIndex=g;var p=a({},A,{level:g,maxBitrate:A.maxBitrate,uri:A.uri,urlId:A.urlId});delete p._urlId,this.hls.trigger(O.Events.LEVEL_SWITCHING,p);var I=A.details;if(!I||I.live){var M=this.switchParams(A.uri,S==null?void 0:S.details);this.loadPlaylist(M)}}},{key:"manualLevel",get:function(){return this.manualLevelIndex},set:function(g){this.manualLevelIndex=g,this._startLevel===void 0&&(this._startLevel=g),g!==-1&&(this.level=g)}},{key:"firstLevel",get:function(){return this._firstLevel},set:function(g){this._firstLevel=g}},{key:"startLevel",get:function(){if(this._startLevel===void 0){var g=this.hls.config.startLevel;return g!==void 0?g:this._firstLevel}else return this._startLevel},set:function(g){this._startLevel=g}},{key:"nextLoadLevel",get:function(){return this.manualLevelIndex!==-1?this.manualLevelIndex:this.hls.nextAutoLevel},set:function(g){this.level=g,this.manualLevelIndex===-1&&(this.hls.nextAutoLevel=g)}}]),f}(v.default)},"./src/controller/level-helper.ts":function(j,k,D){"use strict";D.r(k),D.d(k,"addGroupId",function(){return d}),D.d(k,"assignTrackIdsByGroup",function(){return E}),D.d(k,"updatePTS",function(){return y}),D.d(k,"updateFragPTSDTS",function(){return u}),D.d(k,"mergeDetails",function(){return a}),D.d(k,"mapPartIntersection",function(){return c}),D.d(k,"mapFragmentIntersection",function(){return s}),D.d(k,"adjustSliding",function(){return l}),D.d(k,"addSliding",function(){return r}),D.d(k,"computeReloadInterval",function(){return n}),D.d(k,"getFragmentWithSN",function(){return o}),D.d(k,"getPartWith",function(){return i});var R=D("./src/polyfills/number.ts"),O=D("./src/utils/logger.ts");function d(f,h,T){switch(h){case"audio":f.audioGroupIds||(f.audioGroupIds=[]),f.audioGroupIds.push(T);break;case"text":f.textGroupIds||(f.textGroupIds=[]),f.textGroupIds.push(T);break}}function E(f){var h={};f.forEach(function(T){var g=T.groupId||"";T.id=h[g]=h[g]||0,h[g]++})}function y(f,h,T){var g=f[h],w=f[T];v(g,w)}function v(f,h){var T=h.startPTS;if(Object(R.isFiniteNumber)(T)){var g=0,w;h.sn>f.sn?(g=T-f.start,w=f):(g=f.start-T,w=h),w.duration!==g&&(w.duration=g)}else if(h.sn>f.sn){var C=f.cc===h.cc;C&&f.minEndPTS?h.start=f.start+(f.minEndPTS-f.start):h.start=f.start+f.duration}else h.start=Math.max(f.start-h.duration,0)}function u(f,h,T,g,w,C){var x=g-T;x<=0&&(O.logger.warn("Fragment should have a positive duration",h),g=T+h.duration,C=w+h.duration);var b=T,S=g,A=h.startPTS,p=h.endPTS;if(Object(R.isFiniteNumber)(A)){var I=Math.abs(A-T);Object(R.isFiniteNumber)(h.deltaPTS)?h.deltaPTS=Math.max(I,h.deltaPTS):h.deltaPTS=I,b=Math.max(T,A),T=Math.min(T,A),w=Math.min(w,h.startDTS),S=Math.min(g,p),g=Math.max(g,p),C=Math.max(C,h.endDTS)}h.duration=g-T;var M=T-h.start;h.appendedPTS=g,h.start=h.startPTS=T,h.maxStartPTS=b,h.startDTS=w,h.endPTS=g,h.minEndPTS=S,h.endDTS=C;var P=h.sn;if(!f||P<f.startSN||P>f.endSN)return 0;var B,H=P-f.startSN,F=f.fragments;for(F[H]=h,B=H;B>0;B--)v(F[B],F[B-1]);for(B=H;B<F.length-1;B++)v(F[B],F[B+1]);return f.fragmentHint&&v(F[F.length-1],f.fragmentHint),f.PTSKnown=f.alignedSliding=!0,M}function a(f,h){for(var T=null,g=f.fragments,w=g.length-1;w>=0;w--){var C=g[w].initSegment;if(C){T=C;break}}f.fragmentHint&&delete f.fragmentHint.endPTS;var x=0,b;if(s(f,h,function(B,H){B.relurl&&(x=B.cc-H.cc),Object(R.isFiniteNumber)(B.startPTS)&&Object(R.isFiniteNumber)(B.endPTS)&&(H.start=H.startPTS=B.startPTS,H.startDTS=B.startDTS,H.appendedPTS=B.appendedPTS,H.maxStartPTS=B.maxStartPTS,H.endPTS=B.endPTS,H.endDTS=B.endDTS,H.minEndPTS=B.minEndPTS,H.duration=B.endPTS-B.startPTS,H.duration&&(b=H),h.PTSKnown=h.alignedSliding=!0),H.elementaryStreams=B.elementaryStreams,H.loader=B.loader,H.stats=B.stats,H.urlId=B.urlId,B.initSegment&&(H.initSegment=B.initSegment,T=B.initSegment)}),T){var S=h.fragmentHint?h.fragments.concat(h.fragmentHint):h.fragments;S.forEach(function(B){var H;(!B.initSegment||B.initSegment.relurl===((H=T)===null||H===void 0?void 0:H.relurl))&&(B.initSegment=T)})}if(h.skippedSegments&&(h.deltaUpdateFailed=h.fragments.some(function(B){return!B}),h.deltaUpdateFailed)){O.logger.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(var A=h.skippedSegments;A--;)h.fragments.shift();h.startSN=h.fragments[0].sn,h.startCC=h.fragments[0].cc}var p=h.fragments;if(x){O.logger.warn("discontinuity sliding from playlist, take drift into account");for(var I=0;I<p.length;I++)p[I].cc+=x}h.skippedSegments&&(h.startCC=h.fragments[0].cc),c(f.partList,h.partList,function(B,H){H.elementaryStreams=B.elementaryStreams,H.stats=B.stats}),b?u(h,b,b.startPTS,b.endPTS,b.startDTS,b.endDTS):l(f,h),p.length&&(h.totalduration=h.edge-p[0].start),h.driftStartTime=f.driftStartTime,h.driftStart=f.driftStart;var M=h.advancedDateTime;if(h.advanced&&M){var P=h.edge;h.driftStart||(h.driftStartTime=M,h.driftStart=P),h.driftEndTime=M,h.driftEnd=P}else h.driftEndTime=f.driftEndTime,h.driftEnd=f.driftEnd,h.advancedDateTime=f.advancedDateTime}function c(f,h,T){if(f&&h)for(var g=0,w=0,C=f.length;w<=C;w++){var x=f[w],b=h[w+g];x&&b&&x.index===b.index&&x.fragment.sn===b.fragment.sn?T(x,b):g--}}function s(f,h,T){for(var g=h.skippedSegments,w=Math.max(f.startSN,h.startSN)-h.startSN,C=(f.fragmentHint?1:0)+(g?h.endSN:Math.min(f.endSN,h.endSN))-h.startSN,x=h.startSN-f.startSN,b=h.fragmentHint?h.fragments.concat(h.fragmentHint):h.fragments,S=f.fragmentHint?f.fragments.concat(f.fragmentHint):f.fragments,A=w;A<=C;A++){var p=S[x+A],I=b[A];g&&!I&&A<g&&(I=h.fragments[A]=p),p&&I&&T(p,I)}}function l(f,h){var T=h.startSN+h.skippedSegments-f.startSN,g=f.fragments;if(T<0||T>=g.length)return;r(h,g[T].start)}function r(f,h){if(h){for(var T=f.fragments,g=f.skippedSegments;g<T.length;g++)T[g].start+=h;f.fragmentHint&&(f.fragmentHint.start+=h)}}function n(f,h){var T=1e3*f.levelTargetDuration,g=T/2,w=f.age,C=w>0&&w<T*3,x=h.loading.end-h.loading.start,b,S=f.availabilityDelay;if(f.updated===!1)if(C){var A=333*f.misses;b=Math.max(Math.min(g,x*2),A),f.availabilityDelay=(f.availabilityDelay||0)+b}else b=g;else C?(S=Math.min(S||T/2,w),f.availabilityDelay=S,b=S+T-w):b=T-x;return Math.round(b)}function o(f,h,T){if(!f||!f.details)return null;var g=f.details,w=g.fragments[h-g.startSN];return w||(w=g.fragmentHint,w&&w.sn===h?w:h<g.startSN&&T&&T.sn===h?T:null)}function i(f,h,T){if(!f||!f.details)return null;var g=f.details.partList;if(g)for(var w=g.length;w--;){var C=g[w];if(C.index===T&&C.fragment.sn===h)return C}return null}},"./src/controller/stream-controller.ts":function(j,k,D){"use strict";D.r(k),D.d(k,"default",function(){return g});var R=D("./src/polyfills/number.ts"),O=D("./src/controller/base-stream-controller.ts"),d=D("./src/is-supported.ts"),E=D("./src/events.ts"),y=D("./src/utils/buffer-helper.ts"),v=D("./src/controller/fragment-tracker.ts"),u=D("./src/types/loader.ts"),a=D("./src/loader/fragment.ts"),c=D("./src/demux/transmuxer-interface.ts"),s=D("./src/types/transmuxer.ts"),l=D("./src/controller/gap-controller.ts"),r=D("./src/errors.ts"),n=D("./src/utils/logger.ts");function o(w,C){for(var x=0;x<C.length;x++){var b=C[x];b.enumerable=b.enumerable||!1,b.configurable=!0,"value"in b&&(b.writable=!0),Object.defineProperty(w,b.key,b)}}function i(w,C,x){return C&&o(w.prototype,C),x&&o(w,x),w}function f(w,C){w.prototype=Object.create(C.prototype),w.prototype.constructor=w,h(w,C)}function h(w,C){return h=Object.setPrototypeOf||function(b,S){return b.__proto__=S,b},h(w,C)}var T=100,g=function(w){f(C,w);function C(b,S){var A;return A=w.call(this,b,S,"[stream-controller]")||this,A.audioCodecSwap=!1,A.gapController=null,A.level=-1,A._forceStartLoad=!1,A.altAudio=!1,A.audioOnly=!1,A.fragPlaying=null,A.onvplaying=null,A.onvseeked=null,A.fragLastKbps=0,A.stalled=!1,A.couldBacktrack=!1,A.audioCodecSwitch=!1,A.videoBuffer=null,A._registerListeners(),A}var x=C.prototype;return x._registerListeners=function(){var S=this.hls;S.on(E.Events.MEDIA_ATTACHED,this.onMediaAttached,this),S.on(E.Events.MEDIA_DETACHING,this.onMediaDetaching,this),S.on(E.Events.MANIFEST_LOADING,this.onManifestLoading,this),S.on(E.Events.MANIFEST_PARSED,this.onManifestParsed,this),S.on(E.Events.LEVEL_LOADING,this.onLevelLoading,this),S.on(E.Events.LEVEL_LOADED,this.onLevelLoaded,this),S.on(E.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),S.on(E.Events.ERROR,this.onError,this),S.on(E.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),S.on(E.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),S.on(E.Events.BUFFER_CREATED,this.onBufferCreated,this),S.on(E.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),S.on(E.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),S.on(E.Events.FRAG_BUFFERED,this.onFragBuffered,this)},x._unregisterListeners=function(){var S=this.hls;S.off(E.Events.MEDIA_ATTACHED,this.onMediaAttached,this),S.off(E.Events.MEDIA_DETACHING,this.onMediaDetaching,this),S.off(E.Events.MANIFEST_LOADING,this.onManifestLoading,this),S.off(E.Events.MANIFEST_PARSED,this.onManifestParsed,this),S.off(E.Events.LEVEL_LOADED,this.onLevelLoaded,this),S.off(E.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),S.off(E.Events.ERROR,this.onError,this),S.off(E.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),S.off(E.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),S.off(E.Events.BUFFER_CREATED,this.onBufferCreated,this),S.off(E.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),S.off(E.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),S.off(E.Events.FRAG_BUFFERED,this.onFragBuffered,this)},x.onHandlerDestroying=function(){this._unregisterListeners(),this.onMediaDetaching()},x.startLoad=function(S){if(this.levels){var A=this.lastCurrentTime,p=this.hls;if(this.stopLoad(),this.setInterval(T),this.level=-1,this.fragLoadError=0,!this.startFragRequested){var I=p.startLevel;I===-1&&(p.config.testBandwidth?(I=0,this.bitrateTest=!0):I=p.nextAutoLevel),this.level=p.nextLoadLevel=I,this.loadedmetadata=!1}A>0&&S===-1&&(this.log("Override startPosition with lastCurrentTime @"+A.toFixed(3)),S=A),this.state=O.State.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=S,this.tick()}else this._forceStartLoad=!0,this.state=O.State.STOPPED},x.stopLoad=function(){this._forceStartLoad=!1,w.prototype.stopLoad.call(this)},x.doTick=function(){switch(this.state){case O.State.IDLE:this.doTickIdle();break;case O.State.WAITING_LEVEL:{var S,A=this.levels,p=this.level,I=A==null||((S=A[p])===null||S===void 0)?void 0:S.details;if(I&&(!I.live||this.levelLastLoaded===this.level)){if(this.waitForCdnTuneIn(I))break;this.state=O.State.IDLE;break}break}case O.State.FRAG_LOADING_WAITING_RETRY:{var M,P=self.performance.now(),B=this.retryDate;(!B||P>=B||(M=this.media)!==null&&M!==void 0&&M.seeking)&&(this.log("retryDate reached, switch back to IDLE state"),this.state=O.State.IDLE)}break;default:break}this.onTickEnd()},x.onTickEnd=function(){w.prototype.onTickEnd.call(this),this.checkBuffer(),this.checkFragmentChanged()},x.doTickIdle=function(){var S,A,p=this.hls,I=this.levelLastLoaded,M=this.levels,P=this.media,B=p.config,H=p.nextLoadLevel;if(I===null||!P&&(this.startFragRequested||!B.startFragPrefetch))return;if(this.altAudio&&this.audioOnly)return;if(!M||!M[H])return;var F=M[H];this.level=p.nextLoadLevel=H;var W=F.details;if(!W||this.state===O.State.WAITING_LEVEL||W.live&&this.levelLastLoaded!==H){this.state=O.State.WAITING_LEVEL;return}var U=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:P,u.PlaylistLevelType.MAIN);if(U===null)return;var K=U.len,G=this.getMaxBufferLength(F.maxBitrate);if(K>=G)return;if(this._streamEnded(U,W)){var ae={};this.altAudio&&(ae.type="video"),this.hls.trigger(E.Events.BUFFER_EOS,ae),this.state=O.State.ENDED;return}var fe=U.end,Se=this.getNextFragment(fe,W);if(this.couldBacktrack&&!this.fragPrevious&&Se&&Se.sn!=="initSegment"){var Ue=Se.sn-W.startSN;Ue>1&&(Se=W.fragments[Ue-1],this.fragmentTracker.removeFragment(Se))}if(Se&&this.fragmentTracker.getState(Se)===v.FragmentState.OK&&this.nextLoadPosition>fe){var Ne=this.audioOnly&&!this.altAudio?a.ElementaryStreamTypes.AUDIO:a.ElementaryStreamTypes.VIDEO;this.afterBufferFlushed(P,Ne,u.PlaylistLevelType.MAIN),Se=this.getNextFragment(this.nextLoadPosition,W)}if(!Se)return;Se.initSegment&&!Se.initSegment.data&&!this.bitrateTest&&(Se=Se.initSegment),((S=Se.decryptdata)===null||S===void 0?void 0:S.keyFormat)==="identity"&&!((A=Se.decryptdata)!==null&&A!==void 0&&A.key)?this.loadKey(Se,W):this.loadFragment(Se,W,fe)},x.loadFragment=function(S,A,p){var I,M=this.fragmentTracker.getState(S);if(this.fragCurrent=S,M===v.FragmentState.BACKTRACKED){var P=this.fragmentTracker.getBacktrackData(S);if(P){this._handleFragmentLoadProgress(P),this._handleFragmentLoadComplete(P);return}else M=v.FragmentState.NOT_LOADED}M===v.FragmentState.NOT_LOADED||M===v.FragmentState.PARTIAL?S.sn==="initSegment"?this._loadInitSegment(S):this.bitrateTest?(S.bitrateTest=!0,this.log("Fragment "+S.sn+" of level "+S.level+" is being downloaded to test bitrate and will not be buffered"),this._loadBitrateTestFrag(S)):(this.startFragRequested=!0,w.prototype.loadFragment.call(this,S,A,p)):M===v.FragmentState.APPENDING?this.reduceMaxBufferLength(S.duration)&&this.fragmentTracker.removeFragment(S):((I=this.media)===null||I===void 0?void 0:I.buffered.length)===0&&this.fragmentTracker.removeAllFragments()},x.getAppendedFrag=function(S){var A=this.fragmentTracker.getAppendedFrag(S,u.PlaylistLevelType.MAIN);return A&&"fragment"in A?A.fragment:A},x.getBufferedFrag=function(S){return this.fragmentTracker.getBufferedFrag(S,u.PlaylistLevelType.MAIN)},x.followingBufferedFrag=function(S){return S?this.getBufferedFrag(S.end+.5):null},x.immediateLevelSwitch=function(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)},x.nextLevelSwitch=function(){var S=this.levels,A=this.media;if(A!=null&&A.readyState){var p,I=this.getAppendedFrag(A.currentTime);if(I&&I.start>1&&this.flushMainBuffer(0,I.start-1),!A.paused&&S){var M=this.hls.nextLoadLevel,P=S[M],B=this.fragLastKbps;B&&this.fragCurrent?p=this.fragCurrent.duration*P.maxBitrate/(1e3*B)+1:p=0}else p=0;var H=this.getBufferedFrag(A.currentTime+p);if(H){var F=this.followingBufferedFrag(H);if(F){this.abortCurrentFrag();var W=F.maxStartPTS?F.maxStartPTS:F.start,U=F.duration,K=Math.max(H.end,W+Math.min(Math.max(U-this.config.maxFragLookUpTolerance,U*.5),U*.75));this.flushMainBuffer(K,Number.POSITIVE_INFINITY)}}}},x.abortCurrentFrag=function(){var S=this.fragCurrent;this.fragCurrent=null,S!=null&&S.loader&&S.loader.abort(),this.state===O.State.KEY_LOADING&&(this.state=O.State.IDLE),this.nextLoadPosition=this.getLoadPosition()},x.flushMainBuffer=function(S,A){w.prototype.flushMainBuffer.call(this,S,A,this.altAudio?"video":null)},x.onMediaAttached=function(S,A){w.prototype.onMediaAttached.call(this,S,A);var p=A.media;this.onvplaying=this.onMediaPlaying.bind(this),this.onvseeked=this.onMediaSeeked.bind(this),p.addEventListener("playing",this.onvplaying),p.addEventListener("seeked",this.onvseeked),this.gapController=new l.default(this.config,p,this.fragmentTracker,this.hls)},x.onMediaDetaching=function(){var S=this.media;S&&(S.removeEventListener("playing",this.onvplaying),S.removeEventListener("seeked",this.onvseeked),this.onvplaying=this.onvseeked=null,this.videoBuffer=null),this.fragPlaying=null,this.gapController&&(this.gapController.destroy(),this.gapController=null),w.prototype.onMediaDetaching.call(this)},x.onMediaPlaying=function(){this.tick()},x.onMediaSeeked=function(){var S=this.media,A=S?S.currentTime:null;Object(R.isFiniteNumber)(A)&&this.log("Media seeked to "+A.toFixed(3)),this.tick()},x.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},x.onManifestParsed=function(S,A){var p=!1,I=!1,M;A.levels.forEach(function(P){M=P.audioCodec,M&&(M.indexOf("mp4a.40.2")!==-1&&(p=!0),M.indexOf("mp4a.40.5")!==-1&&(I=!0))}),this.audioCodecSwitch=p&&I&&!Object(d.changeTypeSupported)(),this.audioCodecSwitch&&this.log("Both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=A.levels,this.startFragRequested=!1},x.onLevelLoading=function(S,A){var p=this.levels;if(!p||this.state!==O.State.IDLE)return;var I=p[A.level];(!I.details||I.details.live&&this.levelLastLoaded!==A.level||this.waitForCdnTuneIn(I.details))&&(this.state=O.State.WAITING_LEVEL)},x.onLevelLoaded=function(S,A){var p,I=this.levels,M=A.level,P=A.details,B=P.totalduration;if(!I){this.warn("Levels were reset while loading level "+M);return}this.log("Level "+M+" loaded ["+P.startSN+","+P.endSN+"], cc ["+P.startCC+", "+P.endCC+"] duration:"+B);var H=this.fragCurrent;H&&(this.state===O.State.FRAG_LOADING||this.state===O.State.FRAG_LOADING_WAITING_RETRY)&&(H.level!==A.level&&H.loader&&(this.state=O.State.IDLE,H.loader.abort()));var F=I[M],W=0;if(P.live||(p=F.details)!==null&&p!==void 0&&p.live){if(P.fragments[0]||(P.deltaUpdateFailed=!0),P.deltaUpdateFailed)return;W=this.alignPlaylists(P,F.details)}if(F.details=P,this.levelLastLoaded=M,this.hls.trigger(E.Events.LEVEL_UPDATED,{details:P,level:M}),this.state===O.State.WAITING_LEVEL){if(this.waitForCdnTuneIn(P))return;this.state=O.State.IDLE}this.startFragRequested?P.live&&this.synchronizeToLiveEdge(P):this.setStartPosition(P,W),this.tick()},x._handleFragmentLoadProgress=function(S){var A,p=S.frag,I=S.part,M=S.payload,P=this.levels;if(!P){this.warn("Levels were reset while fragment load was in progress. Fragment "+p.sn+" of level "+p.level+" will not be buffered");return}var B=P[p.level],H=B.details;if(!H){this.warn("Dropping fragment "+p.sn+" of level "+p.level+" after level details were reset");return}var F=B.videoCodec,W=H.PTSKnown||!H.live,U=(A=p.initSegment)===null||A===void 0?void 0:A.data,K=this._getAudioCodec(B),G=this.transmuxer=this.transmuxer||new c.default(this.hls,u.PlaylistLevelType.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),ae=I?I.index:-1,fe=ae!==-1,Se=new s.ChunkMetadata(p.level,p.sn,p.stats.chunkCount,M.byteLength,ae,fe),Ue=this.initPTS[p.cc];G.push(M,U,K,F,p,I,H.totalduration,W,Se,Ue)},x.onAudioTrackSwitching=function(S,A){var p=this.altAudio,I=!!A.url,M=A.id;if(!I){if(this.mediaBuffer!==this.media){this.log("Switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;var P=this.fragCurrent;P!=null&&P.loader&&(this.log("Switching to main audio track, cancel main fragment load"),P.loader.abort()),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();var B=this.hls;p&&B.trigger(E.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),B.trigger(E.Events.AUDIO_TRACK_SWITCHED,{id:M})}},x.onAudioTrackSwitched=function(S,A){var p=A.id,I=!!this.hls.audioTracks[p].url;if(I){var M=this.videoBuffer;M&&this.mediaBuffer!==M&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=M)}this.altAudio=I,this.tick()},x.onBufferCreated=function(S,A){var p=A.tracks,I,M,P=!1;for(var B in p){var H=p[B];if(H.id==="main"){if(M=B,I=H,B==="video"){var F=p[B];F&&(this.videoBuffer=F.buffer)}}else P=!0}P&&I?(this.log("Alternate track found, use "+M+".buffered to schedule main fragment loading"),this.mediaBuffer=I.buffer):this.mediaBuffer=this.media},x.onFragBuffered=function(S,A){var p=A.frag,I=A.part;if(p&&p.type!==u.PlaylistLevelType.MAIN)return;if(this.fragContextChanged(p)){this.warn("Fragment "+p.sn+(I?" p: "+I.index:"")+" of level "+p.level+" finished buffering, but was aborted. state: "+this.state),this.state===O.State.PARSED&&(this.state=O.State.IDLE);return}var M=I?I.stats:p.stats;this.fragLastKbps=Math.round(8*M.total/(M.buffering.end-M.loading.first)),p.sn!=="initSegment"&&(this.fragPrevious=p),this.fragBufferedComplete(p,I)},x.onError=function(S,A){switch(A.details){case r.ErrorDetails.FRAG_LOAD_ERROR:case r.ErrorDetails.FRAG_LOAD_TIMEOUT:case r.ErrorDetails.KEY_LOAD_ERROR:case r.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(u.PlaylistLevelType.MAIN,A);break;case r.ErrorDetails.LEVEL_LOAD_ERROR:case r.ErrorDetails.LEVEL_LOAD_TIMEOUT:this.state!==O.State.ERROR&&(A.fatal?(this.warn(""+A.details),this.state=O.State.ERROR):!A.levelRetry&&this.state===O.State.WAITING_LEVEL&&(this.state=O.State.IDLE));break;case r.ErrorDetails.BUFFER_FULL_ERROR:if(A.parent==="main"&&(this.state===O.State.PARSING||this.state===O.State.PARSED)){var p=!0,I=this.getFwdBufferInfo(this.media,u.PlaylistLevelType.MAIN);I&&I.len>.5&&(p=!this.reduceMaxBufferLength(I.len)),p&&(this.warn("buffer full error also media.currentTime is not buffered, flush main"),this.immediateLevelSwitch()),this.resetLoadingState()}break;default:break}},x.checkBuffer=function(){var S=this.media,A=this.gapController;if(!S||!A||!S.readyState)return;var p=y.BufferHelper.getBuffered(S);!this.loadedmetadata&&p.length?(this.loadedmetadata=!0,this.seekToStartPos()):A.poll(this.lastCurrentTime),this.lastCurrentTime=S.currentTime},x.onFragLoadEmergencyAborted=function(){this.state=O.State.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tickImmediate()},x.onBufferFlushed=function(S,A){var p=A.type;if(p!==a.ElementaryStreamTypes.AUDIO||this.audioOnly&&!this.altAudio){var I=(p===a.ElementaryStreamTypes.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;this.afterBufferFlushed(I,p,u.PlaylistLevelType.MAIN)}},x.onLevelsUpdated=function(S,A){this.levels=A.levels},x.swapAudioCodec=function(){this.audioCodecSwap=!this.audioCodecSwap},x.seekToStartPos=function(){var S=this.media,A=S.currentTime,p=this.startPosition;if(p>=0&&A<p){if(S.seeking){n.logger.log("could not seek to "+p+", already seeking at "+A);return}var I=y.BufferHelper.getBuffered(S),M=I.length?I.start(0):0,P=M-p;P>0&&(P<this.config.maxBufferHole||P<this.config.maxFragLookUpTolerance)&&(n.logger.log("adjusting start position by "+P+" to match buffer start"),p+=P,this.startPosition=p),this.log("seek to target start position "+p+" from current time "+A),S.currentTime=p}},x._getAudioCodec=function(S){var A=this.config.defaultAudioCodec||S.audioCodec;return this.audioCodecSwap&&A&&(this.log("Swapping audio codec"),A.indexOf("mp4a.40.5")!==-1?A="mp4a.40.2":A="mp4a.40.5"),A},x._loadBitrateTestFrag=function(S){var A=this;this._doFragLoad(S).then(function(p){var I=A.hls;if(!p||I.nextLoadLevel||A.fragContextChanged(S))return;A.fragLoadError=0,A.state=O.State.IDLE,A.startFragRequested=!1,A.bitrateTest=!1;var M=S.stats;M.parsing.start=M.parsing.end=M.buffering.start=M.buffering.end=self.performance.now(),I.trigger(E.Events.FRAG_LOADED,p)})},x._handleTransmuxComplete=function(S){var A,p="main",I=this.hls,M=S.remuxResult,P=S.chunkMeta,B=this.getCurrentContext(P);if(!B){this.warn("The loading context changed while buffering fragment "+P.sn+" of level "+P.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(P.level);return}var H=B.frag,F=B.part,W=B.level,U=M.video,K=M.text,G=M.id3,ae=M.initSegment,fe=this.altAudio?void 0:M.audio;if(this.fragContextChanged(H))return;if(this.state=O.State.PARSING,ae){ae.tracks&&(this._bufferInitSegment(W,ae.tracks,H,P),I.trigger(E.Events.FRAG_PARSING_INIT_SEGMENT,{frag:H,id:p,tracks:ae.tracks}));var Se=ae.initPTS,Ue=ae.timescale;Object(R.isFiniteNumber)(Se)&&(this.initPTS[H.cc]=Se,I.trigger(E.Events.INIT_PTS_FOUND,{frag:H,id:p,initPTS:Se,timescale:Ue}))}if(U&&M.independent!==!1){if(W.details){var Ne=U.startPTS,xe=U.endPTS,Ce=U.startDTS,De=U.endDTS;if(F)F.elementaryStreams[U.type]={startPTS:Ne,endPTS:xe,startDTS:Ce,endDTS:De};else if(U.firstKeyFrame&&U.independent&&(this.couldBacktrack=!0),U.dropped&&U.independent){var ve=this.getLoadPosition()+this.config.maxBufferHole;if(ve<Ne){this.backtrack(H);return}H.setElementaryStreamInfo(U.type,H.start,xe,H.start,De,!0)}H.setElementaryStreamInfo(U.type,Ne,xe,Ce,De),this.bufferFragmentData(U,H,F,P)}}else if(M.independent===!1){this.backtrack(H);return}if(fe){var Re=fe.startPTS,ee=fe.endPTS,ge=fe.startDTS,se=fe.endDTS;F&&(F.elementaryStreams[a.ElementaryStreamTypes.AUDIO]={startPTS:Re,endPTS:ee,startDTS:ge,endDTS:se}),H.setElementaryStreamInfo(a.ElementaryStreamTypes.AUDIO,Re,ee,ge,se),this.bufferFragmentData(fe,H,F,P)}if(G!=null&&(A=G.samples)!==null&&A!==void 0&&A.length){var Fe={frag:H,id:p,samples:G.samples};I.trigger(E.Events.FRAG_PARSING_METADATA,Fe)}if(K){var je={frag:H,id:p,samples:K.samples};I.trigger(E.Events.FRAG_PARSING_USERDATA,je)}},x._bufferInitSegment=function(S,A,p,I){var M=this;if(this.state!==O.State.PARSING)return;this.audioOnly=!!A.audio&&!A.video,this.altAudio&&!this.audioOnly&&delete A.audio;var P=A.audio,B=A.video,H=A.audiovideo;if(P){var F=S.audioCodec,W=navigator.userAgent.toLowerCase();this.audioCodecSwitch&&(F&&(F.indexOf("mp4a.40.5")!==-1?F="mp4a.40.2":F="mp4a.40.5"),P.metadata.channelCount!==1&&W.indexOf("firefox")===-1&&(F="mp4a.40.5")),W.indexOf("android")!==-1&&P.container!=="audio/mpeg"&&(F="mp4a.40.2",this.log("Android: force audio codec to "+F)),S.audioCodec&&S.audioCodec!==F&&this.log('Swapping manifest audio codec "'+S.audioCodec+'" for "'+F+'"'),P.levelCodec=F,P.id="main",this.log("Init audio buffer, container:"+P.container+", codecs[selected/level/parsed]=["+(F||"")+"/"+(S.audioCodec||"")+"/"+P.codec+"]")}B&&(B.levelCodec=S.videoCodec,B.id="main",this.log("Init video buffer, container:"+B.container+", codecs[level/parsed]=["+(S.videoCodec||"")+"/"+B.codec+"]")),H&&this.log("Init audiovideo buffer, container:"+H.container+", codecs[level/parsed]=["+(S.attrs.CODECS||"")+"/"+H.codec+"]"),this.hls.trigger(E.Events.BUFFER_CODECS,A),Object.keys(A).forEach(function(U){var K=A[U],G=K.initSegment;G!=null&&G.byteLength&&M.hls.trigger(E.Events.BUFFER_APPENDING,{type:U,data:G,frag:p,part:null,chunkMeta:I,parent:p.type})}),this.tick()},x.backtrack=function(S){this.couldBacktrack=!0,this.resetTransmuxer(),this.flushBufferGap(S);var A=this.fragmentTracker.backtrack(S);this.fragPrevious=null,this.nextLoadPosition=S.start,A?this.resetFragmentLoading(S):this.state=O.State.BACKTRACKING},x.checkFragmentChanged=function(){var S=this.media,A=null;if(S&&S.readyState>1&&S.seeking===!1){var p=S.currentTime;if(y.BufferHelper.isBuffered(S,p)?A=this.getAppendedFrag(p):y.BufferHelper.isBuffered(S,p+.1)&&(A=this.getAppendedFrag(p+.1)),A){var I=this.fragPlaying,M=A.level;(!I||A.sn!==I.sn||I.level!==M||A.urlId!==I.urlId)&&(this.hls.trigger(E.Events.FRAG_CHANGED,{frag:A}),(!I||I.level!==M)&&this.hls.trigger(E.Events.LEVEL_SWITCHED,{level:M}),this.fragPlaying=A)}}},i(C,[{key:"nextLevel",get:function(){var S=this.nextBufferedFrag;return S?S.level:-1}},{key:"currentLevel",get:function(){var S=this.media;if(S){var A=this.getAppendedFrag(S.currentTime);if(A)return A.level}return-1}},{key:"nextBufferedFrag",get:function(){var S=this.media;if(S){var A=this.getAppendedFrag(S.currentTime);return this.followingBufferedFrag(A)}else return null}},{key:"forceStartLoad",get:function(){return this._forceStartLoad}}]),C}(O.default)},"./src/controller/subtitle-stream-controller.ts":function(j,k,D){"use strict";D.r(k),D.d(k,"SubtitleStreamController",function(){return f});var R=D("./src/events.ts"),O=D("./src/utils/logger.ts"),d=D("./src/utils/buffer-helper.ts"),E=D("./src/controller/fragment-finders.ts"),y=D("./src/utils/discontinuities.ts"),v=D("./src/controller/level-helper.ts"),u=D("./src/controller/fragment-tracker.ts"),a=D("./src/controller/base-stream-controller.ts"),c=D("./src/types/loader.ts"),s=D("./src/types/level.ts");function l(h,T){for(var g=0;g<T.length;g++){var w=T[g];w.enumerable=w.enumerable||!1,w.configurable=!0,"value"in w&&(w.writable=!0),Object.defineProperty(h,w.key,w)}}function r(h,T,g){return T&&l(h.prototype,T),g&&l(h,g),h}function n(h,T){h.prototype=Object.create(T.prototype),h.prototype.constructor=h,o(h,T)}function o(h,T){return o=Object.setPrototypeOf||function(w,C){return w.__proto__=C,w},o(h,T)}var i=500,f=function(h){n(T,h);function T(w,C){var x;return x=h.call(this,w,C,"[subtitle-stream-controller]")||this,x.levels=[],x.currentTrackId=-1,x.tracksBuffered=[],x.mainDetails=null,x._registerListeners(),x}var g=T.prototype;return g.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},g._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)},g._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)},g.startLoad=function(){this.stopLoad(),this.state=a.State.IDLE,this.setInterval(i),this.tick()},g.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments()},g.onLevelLoaded=function(C,x){this.mainDetails=x.details},g.onSubtitleFragProcessed=function(C,x){var b=x.frag,S=x.success;if(this.fragPrevious=b,this.state=a.State.IDLE,!S)return;var A=this.tracksBuffered[this.currentTrackId];if(!A)return;for(var p,I=b.start,M=0;M<A.length;M++)if(I>=A[M].start&&I<=A[M].end){p=A[M];break}var P=b.start+b.duration;p?p.end=P:(p={start:I,end:P},A.push(p)),this.fragmentTracker.fragBuffered(b)},g.onBufferFlushing=function(C,x){var b=x.startOffset,S=x.endOffset;if(b===0&&S!==Number.POSITIVE_INFINITY){var A=this.currentTrackId,p=this.levels;if(!p.length||!p[A]||!p[A].details)return;var I=p[A].details,M=I.targetduration,P=S-M;if(P<=0)return;x.endOffsetSubtitles=Math.max(0,P),this.tracksBuffered.forEach(function(B){for(var H=0;H<B.length;){if(B[H].end<=P){B.shift();continue}else if(B[H].start<P)B[H].start=P;else break;H++}}),this.fragmentTracker.removeFragmentsInRange(b,P,c.PlaylistLevelType.SUBTITLE)}},g.onError=function(C,x){var b,S=x.frag;if(!S||S.type!==c.PlaylistLevelType.SUBTITLE)return;(b=this.fragCurrent)!==null&&b!==void 0&&b.loader&&this.fragCurrent.loader.abort(),this.state=a.State.IDLE},g.onSubtitleTracksUpdated=function(C,x){var b=this,S=x.subtitleTracks;this.tracksBuffered=[],this.levels=S.map(function(A){return new s.Level(A)}),this.fragmentTracker.removeAllFragments(),this.fragPrevious=null,this.levels.forEach(function(A){b.tracksBuffered[A.id]=[]}),this.mediaBuffer=null},g.onSubtitleTrackSwitch=function(C,x){if(this.currentTrackId=x.id,!this.levels.length||this.currentTrackId===-1){this.clearInterval();return}var b=this.levels[this.currentTrackId];b!=null&&b.details?this.mediaBuffer=this.mediaBufferTimeRanges:this.mediaBuffer=null,b&&this.setInterval(i)},g.onSubtitleTrackLoaded=function(C,x){var b,S=x.details,A=x.id,p=this.currentTrackId,I=this.levels;if(!I.length)return;var M=I[p];if(A>=I.length||A!==p||!M)return;if(this.mediaBuffer=this.mediaBufferTimeRanges,S.live||(b=M.details)!==null&&b!==void 0&&b.live){var P=this.mainDetails;if(S.deltaUpdateFailed||!P)return;var B=P.fragments[0];if(!M.details)S.hasProgramDateTime&&P.hasProgramDateTime?Object(y.alignMediaPlaylistByPDT)(S,P):B&&Object(v.addSliding)(S,B.start);else{var H=this.alignPlaylists(S,M.details);H===0&&B&&Object(v.addSliding)(S,B.start)}}if(M.details=S,this.levelLastLoaded=A,this.tick(),S.live&&!this.fragCurrent&&this.media&&this.state===a.State.IDLE){var F=Object(E.findFragmentByPTS)(null,S.fragments,this.media.currentTime,0);F||(this.warn("Subtitle playlist not aligned with playback"),M.details=void 0)}},g._handleFragmentLoadComplete=function(C){var x=C.frag,b=C.payload,S=x.decryptdata,A=this.hls;if(this.fragContextChanged(x))return;if(b&&b.byteLength>0&&S&&S.key&&S.iv&&S.method==="AES-128"){var p=performance.now();this.decrypter.webCryptoDecrypt(new Uint8Array(b),S.key.buffer,S.iv.buffer).then(function(I){var M=performance.now();A.trigger(R.Events.FRAG_DECRYPTED,{frag:x,payload:I,stats:{tstart:p,tdecrypt:M}})})}},g.doTick=function(){if(!this.media){this.state=a.State.IDLE;return}if(this.state===a.State.IDLE){var C,x=this.currentTrackId,b=this.levels;if(!b.length||!b[x]||!b[x].details)return;var S=b[x].details,A=S.targetduration,p=this.config,I=this.media,M=d.BufferHelper.bufferedInfo(this.mediaBufferTimeRanges,I.currentTime-A,p.maxBufferHole),P=M.end,B=M.len,H=this.getMaxBufferLength()+A;if(B>H)return;console.assert(S,"Subtitle track details are defined on idle subtitle stream controller tick");var F=S.fragments,W=F.length,U=S.edge,K,G=this.fragPrevious;if(P<U){var ae=p.maxFragLookUpTolerance;G&&S.hasProgramDateTime&&(K=Object(E.findFragmentByPDT)(F,G.endProgramDateTime,ae)),K||(K=Object(E.findFragmentByPTS)(G,F,P,ae),!K&&G&&G.start<F[0].start&&(K=F[0]))}else K=F[W-1];(C=K)!==null&&C!==void 0&&C.encrypted?(O.logger.log("Loading key for "+K.sn),this.state=a.State.KEY_LOADING,this.hls.trigger(R.Events.KEY_LOADING,{frag:K})):K&&this.fragmentTracker.getState(K)===u.FragmentState.NOT_LOADED&&this.loadFragment(K,S,P)}},g.loadFragment=function(C,x,b){this.fragCurrent=C,h.prototype.loadFragment.call(this,C,x,b)},r(T,[{key:"mediaBufferTimeRanges",get:function(){return this.tracksBuffered[this.currentTrackId]||[]}}]),T}(a.default)},"./src/controller/subtitle-track-controller.ts":function(j,k,D){"use strict";D.r(k);var R=D("./src/events.ts"),O=D("./src/utils/texttrack-utils.ts"),d=D("./src/controller/base-playlist-controller.ts"),E=D("./src/types/loader.ts");function y(l,r){for(var n=0;n<r.length;n++){var o=r[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(l,o.key,o)}}function v(l,r,n){return r&&y(l.prototype,r),n&&y(l,n),l}function u(l,r){l.prototype=Object.create(r.prototype),l.prototype.constructor=l,a(l,r)}function a(l,r){return a=Object.setPrototypeOf||function(o,i){return o.__proto__=i,o},a(l,r)}var c=function(l){u(r,l);function r(o){var i;return i=l.call(this,o,"[subtitle-track-controller]")||this,i.media=null,i.tracks=[],i.groupId=null,i.tracksInGroup=[],i.trackId=-1,i.selectDefaultTrack=!0,i.queuedDefaultTrack=-1,i.trackChangeListener=function(){return i.onTextTracksChanged()},i.asyncPollTrackChange=function(){return i.pollTrackChange(0)},i.useTextTrackPolling=!1,i.subtitlePollingInterval=-1,i.subtitleDisplay=!0,i.registerListeners(),i}var n=r.prototype;return n.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.trackChangeListener=this.asyncPollTrackChange=null,l.prototype.destroy.call(this)},n.registerListeners=function(){var i=this.hls;i.on(R.Events.MEDIA_ATTACHED,this.onMediaAttached,this),i.on(R.Events.MEDIA_DETACHING,this.onMediaDetaching,this),i.on(R.Events.MANIFEST_LOADING,this.onManifestLoading,this),i.on(R.Events.MANIFEST_PARSED,this.onManifestParsed,this),i.on(R.Events.LEVEL_LOADING,this.onLevelLoading,this),i.on(R.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),i.on(R.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),i.on(R.Events.ERROR,this.onError,this)},n.unregisterListeners=function(){var i=this.hls;i.off(R.Events.MEDIA_ATTACHED,this.onMediaAttached,this),i.off(R.Events.MEDIA_DETACHING,this.onMediaDetaching,this),i.off(R.Events.MANIFEST_LOADING,this.onManifestLoading,this),i.off(R.Events.MANIFEST_PARSED,this.onManifestParsed,this),i.off(R.Events.LEVEL_LOADING,this.onLevelLoading,this),i.off(R.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),i.off(R.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),i.off(R.Events.ERROR,this.onError,this)},n.onMediaAttached=function(i,f){if(this.media=f.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)},n.pollTrackChange=function(i){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.trackChangeListener,i)},n.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 i=s(this.media.textTracks);i.forEach(function(f){Object(O.clearCurrentCues)(f)}),this.subtitleTrack=-1,this.media=null},n.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.selectDefaultTrack=!0},n.onManifestParsed=function(i,f){this.tracks=f.subtitleTracks},n.onSubtitleTrackLoaded=function(i,f){var h=f.id,T=f.details,g=this.trackId,w=this.tracksInGroup[g];if(!w){this.warn("Invalid subtitle track id "+h);return}var C=w.details;w.details=f.details,this.log("subtitle track "+h+" loaded ["+T.startSN+"-"+T.endSN+"]"),h===this.trackId&&(this.retryCount=0,this.playlistLoaded(h,f,C))},n.onLevelLoading=function(i,f){this.switchLevel(f.level)},n.onLevelSwitching=function(i,f){this.switchLevel(f.level)},n.switchLevel=function(i){var f=this.hls.levels[i];if(!(f!=null&&f.textGroupIds))return;var h=f.textGroupIds[f.urlId];if(this.groupId!==h){var T=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0,g=this.tracks.filter(function(x){return!h||x.groupId===h});this.tracksInGroup=g;var w=this.findTrackId(T==null?void 0:T.name)||this.findTrackId();this.groupId=h;var C={subtitleTracks:g};this.log("Updating subtitle tracks, "+g.length+' track(s) found in "'+h+'" group-id'),this.hls.trigger(R.Events.SUBTITLE_TRACKS_UPDATED,C),w!==-1&&this.setSubtitleTrack(w,T)}},n.findTrackId=function(i){for(var f=this.tracksInGroup,h=0;h<f.length;h++){var T=f[h];if((!this.selectDefaultTrack||T.default)&&(!i||i===T.name))return T.id}return-1},n.onError=function(i,f){if(l.prototype.onError.call(this,i,f),f.fatal||!f.context)return;f.context.type===E.PlaylistContextType.SUBTITLE_TRACK&&f.context.id===this.trackId&&f.context.groupId===this.groupId&&this.retryLoadingOrFail(f)},n.loadPlaylist=function(i){var f=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(f)){var h=f.id,T=f.groupId,g=f.url;if(i)try{g=i.addDirectives(g)}catch(w){this.warn("Could not construct new URL with HLS Delivery Directives: "+w)}this.log("Loading subtitle playlist for id "+h),this.hls.trigger(R.Events.SUBTITLE_TRACK_LOADING,{url:g,id:h,groupId:T,deliveryDirectives:i||null})}},n.toggleTrackModes=function(i){var f=this,h=this.media,T=this.subtitleDisplay,g=this.trackId;if(!h)return;var w=s(h.textTracks),C=w.filter(function(S){return S.groupId===f.groupId});if(i===-1)[].slice.call(w).forEach(function(S){S.mode="disabled"});else{var x=C[g];x&&(x.mode="disabled")}var b=C[i];b&&(b.mode=T?"showing":"hidden")},n.setSubtitleTrack=function(i,f){var h,T=this.tracksInGroup;if(!this.media){this.queuedDefaultTrack=i;return}if(this.trackId!==i&&this.toggleTrackModes(i),this.trackId===i&&(i===-1||(h=T[i])!==null&&h!==void 0&&h.details)||i<-1||i>=T.length)return;this.clearTimer();var g=T[i];if(this.log("Switching to subtitle track "+i),this.trackId=i,g){var w=g.id,C=g.groupId,x=C===void 0?"":C,b=g.name,S=g.type,A=g.url;this.hls.trigger(R.Events.SUBTITLE_TRACK_SWITCH,{id:w,groupId:x,name:b,type:S,url:A});var p=this.switchParams(g.url,f==null?void 0:f.details);this.loadPlaylist(p)}else this.hls.trigger(R.Events.SUBTITLE_TRACK_SWITCH,{id:i})},n.onTextTracksChanged=function(){if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),!this.media||!this.hls.config.renderTextTracksNatively)return;for(var i=-1,f=s(this.media.textTracks),h=0;h<f.length;h++)if(f[h].mode==="hidden")i=h;else if(f[h].mode==="showing"){i=h;break}this.subtitleTrack!==i&&(this.subtitleTrack=i)},v(r,[{key:"subtitleTracks",get:function(){return this.tracksInGroup}},{key:"subtitleTrack",get:function(){return this.trackId},set:function(i){this.selectDefaultTrack=!1;var f=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0;this.setSubtitleTrack(i,f)}}]),r}(d.default);function s(l){for(var r=[],n=0;n<l.length;n++){var o=l[n];o.kind==="subtitles"&&o.label&&r.push(l[n])}return r}k.default=c},"./src/controller/timeline-controller.ts":function(j,k,D){"use strict";D.r(k),D.d(k,"TimelineController",function(){return s});var R=D("./src/polyfills/number.ts"),O=D("./src/events.ts"),d=D("./src/utils/cea-608-parser.ts"),E=D("./src/utils/output-filter.ts"),y=D("./src/utils/webvtt-parser.ts"),v=D("./src/utils/texttrack-utils.ts"),u=D("./src/utils/imsc1-ttml-parser.ts"),a=D("./src/types/loader.ts"),c=D("./src/utils/logger.ts"),s=function(){function o(f){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=n(),this.captionsProperties=void 0,this.hls=f,this.config=f.config,this.Cues=f.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 h=new E.default(this,"textTrack1"),T=new E.default(this,"textTrack2"),g=new E.default(this,"textTrack3"),w=new E.default(this,"textTrack4");this.cea608Parser1=new d.default(1,h,T),this.cea608Parser2=new d.default(3,g,w)}f.on(O.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),f.on(O.Events.MEDIA_DETACHING,this.onMediaDetaching,this),f.on(O.Events.MANIFEST_LOADING,this.onManifestLoading,this),f.on(O.Events.MANIFEST_LOADED,this.onManifestLoaded,this),f.on(O.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),f.on(O.Events.FRAG_LOADING,this.onFragLoading,this),f.on(O.Events.FRAG_LOADED,this.onFragLoaded,this),f.on(O.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),f.on(O.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),f.on(O.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),f.on(O.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),f.on(O.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)}var i=o.prototype;return i.destroy=function(){var h=this.hls;h.off(O.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),h.off(O.Events.MEDIA_DETACHING,this.onMediaDetaching,this),h.off(O.Events.MANIFEST_LOADING,this.onManifestLoading,this),h.off(O.Events.MANIFEST_LOADED,this.onManifestLoaded,this),h.off(O.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),h.off(O.Events.FRAG_LOADING,this.onFragLoading,this),h.off(O.Events.FRAG_LOADED,this.onFragLoaded,this),h.off(O.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),h.off(O.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),h.off(O.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),h.off(O.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),h.off(O.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),this.hls=this.config=this.cea608Parser1=this.cea608Parser2=null},i.addCues=function(h,T,g,w,C){for(var x=!1,b=C.length;b--;){var S=C[b],A=r(S[0],S[1],T,g);if(A>=0&&(S[0]=Math.min(S[0],T),S[1]=Math.max(S[1],g),x=!0,A/(g-T)>.5))return}if(x||C.push([T,g]),this.config.renderTextTracksNatively){var p=this.captionsTracks[h];this.Cues.newCue(p,T,g,w)}else{var I=this.Cues.newCue(null,T,g,w);this.hls.trigger(O.Events.CUES_PARSED,{type:"captions",cues:I,track:h})}},i.onInitPtsFound=function(h,T){var g=this,w=T.frag,C=T.id,x=T.initPTS,b=T.timescale,S=this.unparsedVttFrags;C==="main"&&(this.initPTS[w.cc]=x,this.timescale[w.cc]=b),S.length&&(this.unparsedVttFrags=[],S.forEach(function(A){g.onFragLoaded(O.Events.FRAG_LOADED,A)}))},i.getExistingTrack=function(h){var T=this.media;if(T)for(var g=0;g<T.textTracks.length;g++){var w=T.textTracks[g];if(w[h])return w}return null},i.createCaptionsTrack=function(h){this.config.renderTextTracksNatively?this.createNativeTrack(h):this.createNonNativeTrack(h)},i.createNativeTrack=function(h){if(this.captionsTracks[h])return;var T=this.captionsProperties,g=this.captionsTracks,w=this.media,C=T[h],x=C.label,b=C.languageCode,S=this.getExistingTrack(h);if(S)g[h]=S,Object(v.clearCurrentCues)(g[h]),Object(v.sendAddTrackEvent)(g[h],w);else{var A=this.createTextTrack("captions",x,b);A&&(A[h]=!0,g[h]=A)}},i.createNonNativeTrack=function(h){if(this.nonNativeCaptionsTracks[h])return;var T=this.captionsProperties[h];if(!T)return;var g=T.label,w={_id:h,label:g,kind:"captions",default:T.media?!!T.media.default:!1,closedCaptions:T.media};this.nonNativeCaptionsTracks[h]=w,this.hls.trigger(O.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:[w]})},i.createTextTrack=function(h,T,g){var w=this.media;return w?w.addTextTrack(h,T,g):void 0},i.onMediaAttaching=function(h,T){this.media=T.media,this._cleanTracks()},i.onMediaDetaching=function(){var h=this.captionsTracks;Object.keys(h).forEach(function(T){Object(v.clearCurrentCues)(h[T]),delete h[T]}),this.nonNativeCaptionsTracks={}},i.onManifestLoading=function(){this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=n(),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())},i._cleanTracks=function(){var h=this.media;if(!h)return;var T=h.textTracks;if(T)for(var g=0;g<T.length;g++)Object(v.clearCurrentCues)(T[g])},i.onSubtitleTracksUpdated=function(h,T){var g=this;this.textTracks=[];var w=T.subtitleTracks||[],C=w.some(function(A){return A.textCodec===u.IMSC1_CODEC});if(this.config.enableWebVTT||C&&this.config.enableIMSC1){var x=this.tracks&&w&&this.tracks.length===w.length;if(this.tracks=w||[],this.config.renderTextTracksNatively){var b=this.media?this.media.textTracks:[];this.tracks.forEach(function(A,p){var I;if(p<b.length){for(var M=null,P=0;P<b.length;P++)if(l(b[P],A)){M=b[P];break}M&&(I=M)}I?Object(v.clearCurrentCues)(I):(I=g.createTextTrack("subtitles",A.name,A.lang),I&&(I.mode="disabled")),I&&(I.groupId=A.groupId,g.textTracks.push(I))})}else if(!x&&this.tracks&&this.tracks.length){var S=this.tracks.map(function(A){return{label:A.name,kind:A.type.toLowerCase(),default:A.default,subtitleTrack:A}});this.hls.trigger(O.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:S})}}},i.onManifestLoaded=function(h,T){var g=this;this.config.enableCEA708Captions&&T.captions&&T.captions.forEach(function(w){var C=/(?:CC|SERVICE)([1-4])/.exec(w.instreamId);if(!C)return;var x="textTrack"+C[1],b=g.captionsProperties[x];if(!b)return;b.label=w.name,w.lang&&(b.languageCode=w.lang),b.media=w})},i.onFragLoading=function(h,T){var g=this.cea608Parser1,w=this.cea608Parser2,C=this.lastSn,x=this.lastPartIndex;if(!this.enabled||!(g&&w))return;if(T.frag.type===a.PlaylistLevelType.MAIN){var b,S,A=T.frag.sn,p=(b=T==null||((S=T.part)===null||S===void 0)?void 0:S.index)!=null?b:-1;A===C+1||A===C&&p===x+1||(g.reset(),w.reset()),this.lastSn=A,this.lastPartIndex=p}},i.onFragLoaded=function(h,T){var g=T.frag,w=T.payload,C=this.initPTS,x=this.unparsedVttFrags;if(g.type===a.PlaylistLevelType.SUBTITLE)if(w.byteLength){if(!Object(R.isFiniteNumber)(C[g.cc])){x.push(T),C.length&&this.hls.trigger(O.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:g,error:new Error("Missing initial subtitle PTS")});return}var b=g.decryptdata;if(b==null||b.key==null||b.method!=="AES-128"){var S=this.tracks[g.level],A=this.vttCCs;A[g.cc]||(A[g.cc]={start:g.start,prevCC:this.prevCC,new:!0},this.prevCC=g.cc),S&&S.textCodec===u.IMSC1_CODEC?this._parseIMSC1(g,w):this._parseVTTs(g,w,A)}}else this.hls.trigger(O.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:g,error:new Error("Empty subtitle payload")})},i._parseIMSC1=function(h,T){var g=this,w=this.hls;Object(u.parseIMSC1)(T,this.initPTS[h.cc],this.timescale[h.cc],function(C){g._appendCues(C,h.level),w.trigger(O.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:h})},function(C){c.logger.log("Failed to parse IMSC1: "+C),w.trigger(O.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:h,error:C})})},i._parseVTTs=function(h,T,g){var w=this,C=this.hls;Object(y.parseWebVTT)(T,this.initPTS[h.cc],this.timescale[h.cc],g,h.cc,h.start,function(x){w._appendCues(x,h.level),C.trigger(O.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:h})},function(x){w._fallbackToIMSC1(h,T),c.logger.log("Failed to parse VTT cue: "+x),C.trigger(O.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:h,error:x})})},i._fallbackToIMSC1=function(h,T){var g=this,w=this.tracks[h.level];w.textCodec||Object(u.parseIMSC1)(T,this.initPTS[h.cc],this.timescale[h.cc],function(){w.textCodec=u.IMSC1_CODEC,g._parseIMSC1(h,T)},function(){w.textCodec="wvtt"})},i._appendCues=function(h,T){var g=this.hls;if(this.config.renderTextTracksNatively){var w=this.textTracks[T];if(w.mode==="disabled")return;h.forEach(function(b){return Object(v.addCueToTrack)(w,b)})}else{var C=this.tracks[T],x=C.default?"default":"subtitles"+T;g.trigger(O.Events.CUES_PARSED,{type:"subtitles",cues:h,track:x})}},i.onFragDecrypted=function(h,T){var g=T.frag;if(g.type===a.PlaylistLevelType.SUBTITLE){if(!Object(R.isFiniteNumber)(this.initPTS[g.cc])){this.unparsedVttFrags.push(T);return}this.onFragLoaded(O.Events.FRAG_LOADED,T)}},i.onSubtitleTracksCleared=function(){this.tracks=[],this.captionsTracks={}},i.onFragParsingUserdata=function(h,T){var g=this.cea608Parser1,w=this.cea608Parser2;if(!this.enabled||!(g&&w))return;for(var C=0;C<T.samples.length;C++){var x=T.samples[C].bytes;if(x){var b=this.extractCea608Data(x);g.addData(T.samples[C].pts,b[0]),w.addData(T.samples[C].pts,b[1])}}},i.onBufferFlushing=function(h,T){var g=T.startOffset,w=T.endOffset,C=T.endOffsetSubtitles,x=T.type,b=this.media;if(!b||b.currentTime<w)return;if(!x||x==="video"){var S=this.captionsTracks;Object.keys(S).forEach(function(p){return Object(v.removeCuesInRange)(S[p],g,w)})}if(this.config.renderTextTracksNatively&&(g===0&&C!==void 0)){var A=this.textTracks;Object.keys(A).forEach(function(p){return Object(v.removeCuesInRange)(A[p],g,C)})}},i.extractCea608Data=function(h){for(var T=h[0]&31,g=2,w=[[],[]],C=0;C<T;C++){var x=h[g++],b=127&h[g++],S=127&h[g++],A=(4&x)!==0,p=3&x;if(b===0&&S===0)continue;A&&((p===0||p===1)&&(w[p].push(b),w[p].push(S)))}return w},o}();function l(o,i){return o&&o.label===i.name&&!(o.textTrack1||o.textTrack2)}function r(o,i,f,h){return Math.min(i,h)-Math.max(o,f)}function n(){return{ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!1}}}},"./src/crypt/aes-crypto.ts":function(j,k,D){"use strict";D.r(k),D.d(k,"default",function(){return R});var R=function(){function O(E,y){this.subtle=void 0,this.aesIV=void 0,this.subtle=E,this.aesIV=y}var d=O.prototype;return d.decrypt=function(y,v){return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},v,y)},O}()},"./src/crypt/aes-decryptor.ts":function(j,k,D){"use strict";D.r(k),D.d(k,"removePadding",function(){return O}),D.d(k,"default",function(){return d});var R=D("./src/utils/typed-array.ts");function O(E){var y=E.byteLength,v=y&&new DataView(E.buffer).getUint8(y-1);return v?Object(R.sliceUint8)(E,0,y-v):E}var d=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 y=E.prototype;return y.uint8ArrayToUint32Array_=function(u){for(var a=new DataView(u),c=new Uint32Array(4),s=0;s<4;s++)c[s]=a.getUint32(s*4);return c},y.initTable=function(){var u=this.sBox,a=this.invSBox,c=this.subMix,s=c[0],l=c[1],r=c[2],n=c[3],o=this.invSubMix,i=o[0],f=o[1],h=o[2],T=o[3],g=new Uint32Array(256),w=0,C=0,x=0;for(x=0;x<256;x++)x<128?g[x]=x<<1:g[x]=x<<1^283;for(x=0;x<256;x++){var b=C^C<<1^C<<2^C<<3^C<<4;b=b>>>8^b&255^99,u[w]=b,a[b]=w;var S=g[w],A=g[S],p=g[A],I=g[b]*257^b*16843008;s[w]=I<<24|I>>>8,l[w]=I<<16|I>>>16,r[w]=I<<8|I>>>24,n[w]=I,I=p*16843009^A*65537^S*257^w*16843008,i[b]=I<<24|I>>>8,f[b]=I<<16|I>>>16,h[b]=I<<8|I>>>24,T[b]=I,w?(w=S^g[g[g[p^S]]],C^=g[g[C]]):w=C=1}},y.expandKey=function(u){for(var a=this.uint8ArrayToUint32Array_(u),c=!0,s=0;s<a.length&&c;)c=a[s]===this.key[s],s++;if(c)return;this.key=a;var l=this.keySize=a.length;if(l!==4&&l!==6&&l!==8)throw new Error("Invalid aes key size="+l);var r=this.ksRows=(l+6+1)*4,n,o,i=this.keySchedule=new Uint32Array(r),f=this.invKeySchedule=new Uint32Array(r),h=this.sBox,T=this.rcon,g=this.invSubMix,w=g[0],C=g[1],x=g[2],b=g[3],S,A;for(n=0;n<r;n++){if(n<l){S=i[n]=a[n];continue}A=S,n%l===0?(A=A<<8|A>>>24,A=h[A>>>24]<<24|h[A>>>16&255]<<16|h[A>>>8&255]<<8|h[A&255],A^=T[n/l|0]<<24):l>6&&n%l===4&&(A=h[A>>>24]<<24|h[A>>>16&255]<<16|h[A>>>8&255]<<8|h[A&255]),i[n]=S=(i[n-l]^A)>>>0}for(o=0;o<r;o++)n=r-o,o&3?A=i[n]:A=i[n-4],o<4||n<=4?f[o]=A:f[o]=w[h[A>>>24]]^C[h[A>>>16&255]]^x[h[A>>>8&255]]^b[h[A&255]],f[o]=f[o]>>>0},y.networkToHostOrderSwap=function(u){return u<<24|(u&65280)<<8|(u&16711680)>>8|u>>>24},y.decrypt=function(u,a,c){for(var s=this.keySize+6,l=this.invKeySchedule,r=this.invSBox,n=this.invSubMix,o=n[0],i=n[1],f=n[2],h=n[3],T=this.uint8ArrayToUint32Array_(c),g=T[0],w=T[1],C=T[2],x=T[3],b=new Int32Array(u),S=new Int32Array(b.length),A,p,I,M,P,B,H,F,W,U,K,G,ae,fe,Se=this.networkToHostOrderSwap;a<b.length;){for(W=Se(b[a]),U=Se(b[a+1]),K=Se(b[a+2]),G=Se(b[a+3]),P=W^l[0],B=G^l[1],H=K^l[2],F=U^l[3],ae=4,fe=1;fe<s;fe++)A=o[P>>>24]^i[B>>16&255]^f[H>>8&255]^h[F&255]^l[ae],p=o[B>>>24]^i[H>>16&255]^f[F>>8&255]^h[P&255]^l[ae+1],I=o[H>>>24]^i[F>>16&255]^f[P>>8&255]^h[B&255]^l[ae+2],M=o[F>>>24]^i[P>>16&255]^f[B>>8&255]^h[H&255]^l[ae+3],P=A,B=p,H=I,F=M,ae=ae+4;A=r[P>>>24]<<24^r[B>>16&255]<<16^r[H>>8&255]<<8^r[F&255]^l[ae],p=r[B>>>24]<<24^r[H>>16&255]<<16^r[F>>8&255]<<8^r[P&255]^l[ae+1],I=r[H>>>24]<<24^r[F>>16&255]<<16^r[P>>8&255]<<8^r[B&255]^l[ae+2],M=r[F>>>24]<<24^r[P>>16&255]<<16^r[B>>8&255]<<8^r[H&255]^l[ae+3],S[a]=Se(A^g),S[a+1]=Se(M^w),S[a+2]=Se(I^C),S[a+3]=Se(p^x),g=W,w=U,C=K,x=G,a=a+4}return S.buffer},E}()},"./src/crypt/decrypter.ts":function(j,k,D){"use strict";D.r(k),D.d(k,"default",function(){return a});var R=D("./src/crypt/aes-crypto.ts"),O=D("./src/crypt/fast-aes-key.ts"),d=D("./src/crypt/aes-decryptor.ts"),E=D("./src/utils/logger.ts"),y=D("./src/utils/mp4-tools.ts"),v=D("./src/utils/typed-array.ts"),u=16,a=function(){function c(l,r,n){var o=n===void 0?{}:n,i=o.removePKCS7Padding,f=i===void 0?!0:i;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=l,this.config=r,this.removePKCS7Padding=f,f)try{var h=self.crypto;h&&(this.subtle=h.subtle||h.webkitSubtle)}catch(T){}this.subtle===null&&(this.config.enableSoftwareAES=!0)}var s=c.prototype;return s.destroy=function(){this.observer=null},s.isSync=function(){return this.config.enableSoftwareAES},s.flush=function(){var r=this.currentResult;if(!r){this.reset();return}var n=new Uint8Array(r);return this.reset(),this.removePKCS7Padding?Object(d.removePadding)(n):n},s.reset=function(){this.currentResult=null,this.currentIV=null,this.remainderData=null,this.softwareDecrypter&&(this.softwareDecrypter=null)},s.decrypt=function(r,n,o,i){if(this.config.enableSoftwareAES){this.softwareDecrypt(new Uint8Array(r),n,o);var f=this.flush();f&&i(f.buffer)}else this.webCryptoDecrypt(new Uint8Array(r),n,o).then(i)},s.softwareDecrypt=function(r,n,o){var i=this.currentIV,f=this.currentResult,h=this.remainderData;this.logOnce("JS AES decrypt"),h&&(r=Object(y.appendUint8Array)(h,r),this.remainderData=null);var T=this.getValidChunk(r);if(!T.length)return null;i&&(o=i);var g=this.softwareDecrypter;g||(g=this.softwareDecrypter=new d.default),g.expandKey(n);var w=f;return this.currentResult=g.decrypt(T.buffer,0,o),this.currentIV=Object(v.sliceUint8)(T,-16).buffer,w||null},s.webCryptoDecrypt=function(r,n,o){var i=this,f=this.subtle;return(this.key!==n||!this.fastAesKey)&&(this.key=n,this.fastAesKey=new O.default(f,n)),this.fastAesKey.expandKey().then(function(h){if(!f)return Promise.reject(new Error("web crypto not initialized"));var T=new R.default(f,o);return T.decrypt(r.buffer,h)}).catch(function(h){return i.onWebCryptoError(h,r,n,o)})},s.onWebCryptoError=function(r,n,o,i){return E.logger.warn("[decrypter.ts]: WebCrypto Error, disable WebCrypto API:",r),this.config.enableSoftwareAES=!0,this.logEnabled=!0,this.softwareDecrypt(n,o,i)},s.getValidChunk=function(r){var n=r,o=r.length-r.length%u;return o!==r.length&&(n=Object(v.sliceUint8)(r,0,o),this.remainderData=Object(v.sliceUint8)(r,o)),n},s.logOnce=function(r){if(!this.logEnabled)return;E.logger.log("[decrypter.ts]: "+r),this.logEnabled=!1},c}()},"./src/crypt/fast-aes-key.ts":function(j,k,D){"use strict";D.r(k),D.d(k,"default",function(){return R});var R=function(){function O(E,y){this.subtle=void 0,this.key=void 0,this.subtle=E,this.key=y}var d=O.prototype;return d.expandKey=function(){return this.subtle.importKey("raw",this.key,{name:"AES-CBC"},!1,["encrypt","decrypt"])},O}()},"./src/demux/aacdemuxer.ts":function(j,k,D){"use strict";D.r(k);var R=D("./src/demux/base-audio-demuxer.ts"),O=D("./src/demux/adts.ts"),d=D("./src/utils/logger.ts"),E=D("./src/demux/id3.ts");function y(a,c){a.prototype=Object.create(c.prototype),a.prototype.constructor=a,v(a,c)}function v(a,c){return v=Object.setPrototypeOf||function(l,r){return l.__proto__=r,l},v(a,c)}var u=function(a){y(c,a);function c(l,r){var n;return n=a.call(this)||this,n.observer=void 0,n.config=void 0,n.observer=l,n.config=r,n}var s=c.prototype;return s.resetInitSegment=function(r,n,o){a.prototype.resetInitSegment.call(this,r,n,o),this._audioTrack={container:"audio/adts",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!0,samples:[],manifestCodec:r,duration:o,inputTimeScale:9e4,dropped:0}},c.probe=function(r){if(!r)return!1;for(var n=E.getID3Data(r,0)||[],o=n.length,i=r.length;o<i;o++)if(O.probe(r,o))return d.logger.log("ADTS sync word found !"),!0;return!1},s.canParse=function(r,n){return O.canParse(r,n)},s.appendFrame=function(r,n,o){O.initTrackConfig(r,this.observer,n,o,r.manifestCodec);var i=O.appendFrame(r,n,o,this.initPTS,this.frameIndex);if(i&&i.missing===0)return i},c}(R.default);u.minProbeByteLength=9,k.default=u},"./src/demux/adts.ts":function(j,k,D){"use strict";D.r(k),D.d(k,"getAudioConfig",function(){return E}),D.d(k,"isHeaderPattern",function(){return y}),D.d(k,"getHeaderLength",function(){return v}),D.d(k,"getFullFrameLength",function(){return u}),D.d(k,"canGetFrameLength",function(){return a}),D.d(k,"isHeader",function(){return c}),D.d(k,"canParse",function(){return s}),D.d(k,"probe",function(){return l}),D.d(k,"initTrackConfig",function(){return r}),D.d(k,"getFrameDuration",function(){return n}),D.d(k,"parseFrameHeader",function(){return o}),D.d(k,"appendFrame",function(){return i});var R=D("./src/utils/logger.ts"),O=D("./src/errors.ts"),d=D("./src/events.ts");function E(f,h,T,g){var w,C,x,b,S=navigator.userAgent.toLowerCase(),A=g,p=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];w=((h[T+2]&192)>>>6)+1;var I=(h[T+2]&60)>>>2;if(I>p.length-1){f.trigger(d.Events.ERROR,{type:O.ErrorTypes.MEDIA_ERROR,details:O.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"invalid ADTS sampling index:"+I});return}return x=(h[T+2]&1)<<2,x|=(h[T+3]&192)>>>6,R.logger.log("manifest codec:"+g+", ADTS type:"+w+", samplingIndex:"+I),/firefox/i.test(S)?I>=6?(w=5,b=new Array(4),C=I-3):(w=2,b=new Array(2),C=I):S.indexOf("android")!==-1?(w=2,b=new Array(2),C=I):(w=5,b=new Array(4),g&&(g.indexOf("mp4a.40.29")!==-1||g.indexOf("mp4a.40.5")!==-1)||!g&&I>=6?C=I-3:((g&&g.indexOf("mp4a.40.2")!==-1&&(I>=6&&x===1||/vivaldi/i.test(S))||!g&&x===1)&&(w=2,b=new Array(2)),C=I)),b[0]=w<<3,b[0]|=(I&14)>>1,b[1]|=(I&1)<<7,b[1]|=x<<3,w===5&&(b[1]|=(C&14)>>1,b[2]=(C&1)<<7,b[2]|=2<<2,b[3]=0),{config:b,samplerate:p[I],channelCount:x,codec:"mp4a.40."+w,manifestCodec:A}}function y(f,h){return f[h]===255&&(f[h+1]&246)===240}function v(f,h){return f[h+1]&1?7:9}function u(f,h){return(f[h+3]&3)<<11|f[h+4]<<3|(f[h+5]&224)>>>5}function a(f,h){return h+5<f.length}function c(f,h){return h+1<f.length&&y(f,h)}function s(f,h){return a(f,h)&&y(f,h)&&u(f,h)<=f.length-h}function l(f,h){if(c(f,h)){var T=v(f,h);if(h+T>=f.length)return!1;var g=u(f,h);if(g<=T)return!1;var w=h+g;return w===f.length||c(f,w)}return!1}function r(f,h,T,g,w){if(!f.samplerate){var C=E(h,T,g,w);if(!C)return;f.config=C.config,f.samplerate=C.samplerate,f.channelCount=C.channelCount,f.codec=C.codec,f.manifestCodec=C.manifestCodec,R.logger.log("parsed codec:"+f.codec+", rate:"+C.samplerate+", channels:"+C.channelCount)}}function n(f){return 1024*9e4/f}function o(f,h,T,g,w){var C=v(f,h),x=u(f,h);if(x-=C,x>0){var b=T+g*w;return{headerLength:C,frameLength:x,stamp:b}}}function i(f,h,T,g,w){var C=n(f.samplerate),x=o(h,T,g,w,C);if(x){var b=x.frameLength,S=x.headerLength,A=x.stamp,p=S+b,I=Math.max(0,T+p-h.length),M;I?(M=new Uint8Array(p-S),M.set(h.subarray(T+S,h.length),0)):M=h.subarray(T+S,T+p);var P={unit:M,pts:A};return I||f.samples.push(P),{sample:P,length:p,missing:I}}}},"./src/demux/base-audio-demuxer.ts":function(j,k,D){"use strict";D.r(k),D.d(k,"initPTSFn",function(){return u});var R=D("./src/polyfills/number.ts"),O=D("./src/demux/id3.ts"),d=D("./src/demux/dummy-demuxed-track.ts"),E=D("./src/utils/mp4-tools.ts"),y=D("./src/utils/typed-array.ts"),v=function(){function a(){this._audioTrack=void 0,this._id3Track=void 0,this.frameIndex=0,this.cachedData=null,this.initPTS=null}var c=a.prototype;return c.resetInitSegment=function(l,r,n){this._id3Track={type:"id3",id:3,pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0}},c.resetTimeStamp=function(){},c.resetContiguity=function(){},c.canParse=function(l,r){return!1},c.appendFrame=function(l,r,n){},c.demux=function(l,r){this.cachedData&&(l=Object(E.appendUint8Array)(this.cachedData,l),this.cachedData=null);var n=O.getID3Data(l,0),o=n?n.length:0,i,f,h=this._audioTrack,T=this._id3Track,g=n?O.getTimeStamp(n):void 0,w=l.length;for((this.frameIndex===0||this.initPTS===null)&&(this.initPTS=u(g,r)),n&&n.length>0&&T.samples.push({pts:this.initPTS,dts:this.initPTS,data:n}),f=this.initPTS;o<w;){if(this.canParse(l,o)){var C=this.appendFrame(h,l,o);C?(this.frameIndex++,f=C.sample.pts,o+=C.length,i=o):o=w}else O.canParse(l,o)?(n=O.getID3Data(l,o),T.samples.push({pts:f,dts:f,data:n}),o+=n.length,i=o):o++;if(o===w&&i!==w){var x=Object(y.sliceUint8)(l,i);this.cachedData?this.cachedData=Object(E.appendUint8Array)(this.cachedData,x):this.cachedData=x}}return{audioTrack:h,avcTrack:Object(d.dummyTrack)(),id3Track:T,textTrack:Object(d.dummyTrack)()}},c.demuxSampleAes=function(l,r,n){return Promise.reject(new Error("["+this+"] This demuxer does not support Sample-AES decryption"))},c.flush=function(l){var r=this.cachedData;return r&&(this.cachedData=null,this.demux(r,0)),this.frameIndex=0,{audioTrack:this._audioTrack,avcTrack:Object(d.dummyTrack)(),id3Track:this._id3Track,textTrack:Object(d.dummyTrack)()}},c.destroy=function(){},a}(),u=function(c,s){return Object(R.isFiniteNumber)(c)?c*90:s*9e4};k.default=v},"./src/demux/chunk-cache.ts":function(j,k,D){"use strict";D.r(k),D.d(k,"default",function(){return R});var R=function(){function d(){this.chunks=[],this.dataLength=0}var E=d.prototype;return E.push=function(v){this.chunks.push(v),this.dataLength+=v.length},E.flush=function(){var v=this.chunks,u=this.dataLength,a;if(v.length)v.length===1?a=v[0]:a=O(v,u);else return new Uint8Array(0);return this.reset(),a},E.reset=function(){this.chunks.length=0,this.dataLength=0},d}();function O(d,E){for(var y=new Uint8Array(E),v=0,u=0;u<d.length;u++){var a=d[u];y.set(a,v),v+=a.length}return y}},"./src/demux/dummy-demuxed-track.ts":function(j,k,D){"use strict";D.r(k),D.d(k,"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(j,k,D){"use strict";D.r(k);var R=D("./src/utils/logger.ts"),O=function(){function d(y){this.data=void 0,this.bytesAvailable=void 0,this.word=void 0,this.bitsAvailable=void 0,this.data=y,this.bytesAvailable=y.byteLength,this.word=0,this.bitsAvailable=0}var E=d.prototype;return E.loadWord=function(){var v=this.data,u=this.bytesAvailable,a=v.byteLength-u,c=new Uint8Array(4),s=Math.min(4,u);if(s===0)throw new Error("no bytes available");c.set(v.subarray(a,a+s)),this.word=new DataView(c.buffer).getUint32(0),this.bitsAvailable=s*8,this.bytesAvailable-=s},E.skipBits=function(v){var u;this.bitsAvailable>v?(this.word<<=v,this.bitsAvailable-=v):(v-=this.bitsAvailable,u=v>>3,v-=u>>3,this.bytesAvailable-=u,this.loadWord(),this.word<<=v,this.bitsAvailable-=v)},E.readBits=function(v){var u=Math.min(this.bitsAvailable,v),a=this.word>>>32-u;return v>32&&R.logger.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=u,this.bitsAvailable>0?this.word<<=u:this.bytesAvailable>0&&this.loadWord(),u=v-u,u>0&&this.bitsAvailable?a<<u|this.readBits(u):a},E.skipLZ=function(){var v;for(v=0;v<this.bitsAvailable;++v)if((this.word&2147483648>>>v)!==0)return this.word<<=v,this.bitsAvailable-=v,v;return this.loadWord(),v+this.skipLZ()},E.skipUEG=function(){this.skipBits(1+this.skipLZ())},E.skipEG=function(){this.skipBits(1+this.skipLZ())},E.readUEG=function(){var v=this.skipLZ();return this.readBits(v+1)-1},E.readEG=function(){var v=this.readUEG();return 1&v?1+v>>>1:-1*(v>>>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(v){for(var u=8,a=8,c,s=0;s<v;s++)a!==0&&(c=this.readEG(),a=(u+c+256)%256),u=a===0?u:a},E.readSPS=function(){var v=0,u=0,a=0,c=0,s,l,r,n=this.readUByte.bind(this),o=this.readBits.bind(this),i=this.readUEG.bind(this),f=this.readBoolean.bind(this),h=this.skipBits.bind(this),T=this.skipEG.bind(this),g=this.skipUEG.bind(this),w=this.skipScalingList.bind(this);n();var C=n();if(o(5),h(3),n(),g(),C===100||C===110||C===122||C===244||C===44||C===83||C===86||C===118||C===128){var x=i();if(x===3&&h(1),g(),g(),h(1),f())for(l=x!==3?8:12,r=0;r<l;r++)f()&&(r<6?w(16):w(64))}g();var b=i();if(b===0)i();else if(b===1)for(h(1),T(),T(),s=i(),r=0;r<s;r++)T();g(),h(1);var S=i(),A=i(),p=o(1);p===0&&h(1),h(1),f()&&(v=i(),u=i(),a=i(),c=i());var I=[1,1];if(f()&&f()){var M=n();switch(M){case 1:I=[1,1];break;case 2:I=[12,11];break;case 3:I=[10,11];break;case 4:I=[16,11];break;case 5:I=[40,33];break;case 6:I=[24,11];break;case 7:I=[20,11];break;case 8:I=[32,11];break;case 9:I=[80,33];break;case 10:I=[18,11];break;case 11:I=[15,11];break;case 12:I=[64,33];break;case 13:I=[160,99];break;case 14:I=[4,3];break;case 15:I=[3,2];break;case 16:I=[2,1];break;case 255:{I=[n()<<8|n(),n()<<8|n()];break}}}return{width:Math.ceil((S+1)*16-v*2-u*2),height:(2-p)*(A+1)*16-(p?2:4)*(a+c),pixelRatio:I}},E.readSliceType=function(){return this.readUByte(),this.readUEG(),this.readUEG()},d}();k.default=O},"./src/demux/id3.ts":function(j,k,D){"use strict";D.r(k),D.d(k,"isHeader",function(){return R}),D.d(k,"isFooter",function(){return O}),D.d(k,"getID3Data",function(){return d}),D.d(k,"canParse",function(){return y}),D.d(k,"getTimeStamp",function(){return v}),D.d(k,"isTimeStampFrame",function(){return u}),D.d(k,"getID3Frames",function(){return c}),D.d(k,"decodeFrame",function(){return s}),D.d(k,"utf8ArrayToStr",function(){return i}),D.d(k,"testables",function(){return f});var R=function(w,C){return C+10<=w.length&&(w[C]===73&&w[C+1]===68&&w[C+2]===51&&(w[C+3]<255&&w[C+4]<255&&(w[C+6]<128&&w[C+7]<128&&w[C+8]<128&&w[C+9]<128)))},O=function(w,C){return C+10<=w.length&&(w[C]===51&&w[C+1]===68&&w[C+2]===73&&(w[C+3]<255&&w[C+4]<255&&(w[C+6]<128&&w[C+7]<128&&w[C+8]<128&&w[C+9]<128)))},d=function(w,C){for(var x=C,b=0;R(w,C);){b+=10;var S=E(w,C+6);b+=S,O(w,C+10)&&(b+=10),C+=b}return b>0?w.subarray(x,x+b):void 0},E=function(w,C){var x=0;return x=(w[C]&127)<<21,x|=(w[C+1]&127)<<14,x|=(w[C+2]&127)<<7,x|=w[C+3]&127,x},y=function(w,C){return R(w,C)&&E(w,C+6)+10<=w.length-C},v=function(w){for(var C=c(w),x=0;x<C.length;x++){var b=C[x];if(u(b))return o(b)}return},u=function(w){return w&&w.key==="PRIV"&&w.info==="com.apple.streaming.transportStreamTimestamp"},a=function(w){var C=String.fromCharCode(w[0],w[1],w[2],w[3]),x=E(w,4),b=10;return{type:C,size:x,data:w.subarray(b,b+x)}},c=function(w){for(var C=0,x=[];R(w,C);){var b=E(w,C+6);C+=10;for(var S=C+b;C+8<S;){var A=a(w.subarray(C)),p=s(A);p&&x.push(p),C+=A.size+10}O(w,C)&&(C+=10)}return x},s=function(w){return w.type==="PRIV"?l(w):w.type[0]==="W"?n(w):r(w)},l=function(w){if(w.size<2)return;var C=i(w.data,!0),x=new Uint8Array(w.data.subarray(C.length+1));return{key:w.type,info:C,data:x.buffer}},r=function(w){if(w.size<2)return;if(w.type==="TXXX"){var C=1,x=i(w.data.subarray(C),!0);C+=x.length+1;var b=i(w.data.subarray(C));return{key:w.type,info:x,data:b}}var S=i(w.data.subarray(1));return{key:w.type,data:S}},n=function(w){if(w.type==="WXXX"){if(w.size<2)return;var C=1,x=i(w.data.subarray(C),!0);C+=x.length+1;var b=i(w.data.subarray(C));return{key:w.type,info:x,data:b}}var S=i(w.data);return{key:w.type,data:S}},o=function(w){if(w.data.byteLength===8){var C=new Uint8Array(w.data),x=C[3]&1,b=(C[4]<<23)+(C[5]<<15)+(C[6]<<7)+C[7];return b/=45,x&&(b+=4772185884e-2),Math.round(b)}return},i=function(w,C){C===void 0&&(C=!1);var x=T();if(x){var b=x.decode(w);if(C){var S=b.indexOf("\0");return S!==-1?b.substring(0,S):b}return b.replace(/\0/g,"")}for(var A=w.length,p,I,M,P="",B=0;B<A;){if(p=w[B++],p===0&&C)return P;if(p===0||p===3)continue;switch(p>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:P+=String.fromCharCode(p);break;case 12:case 13:I=w[B++],P+=String.fromCharCode((p&31)<<6|I&63);break;case 14:I=w[B++],M=w[B++],P+=String.fromCharCode((p&15)<<12|(I&63)<<6|(M&63)<<0);break;default:}}return P},f={decodeTextFrame:r},h;function T(){return!h&&typeof self.TextDecoder!="undefined"&&(h=new self.TextDecoder("utf-8")),h}},"./src/demux/mp3demuxer.ts":function(j,k,D){"use strict";D.r(k);var R=D("./src/demux/base-audio-demuxer.ts"),O=D("./src/demux/id3.ts"),d=D("./src/utils/logger.ts"),E=D("./src/demux/mpegaudio.ts");function y(a,c){a.prototype=Object.create(c.prototype),a.prototype.constructor=a,v(a,c)}function v(a,c){return v=Object.setPrototypeOf||function(l,r){return l.__proto__=r,l},v(a,c)}var u=function(a){y(c,a);function c(){return a.apply(this,arguments)||this}var s=c.prototype;return s.resetInitSegment=function(r,n,o){a.prototype.resetInitSegment.call(this,r,n,o),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!1,samples:[],manifestCodec:r,duration:o,inputTimeScale:9e4,dropped:0}},c.probe=function(r){if(!r)return!1;for(var n=O.getID3Data(r,0)||[],o=n.length,i=r.length;o<i;o++)if(E.probe(r,o))return d.logger.log("MPEG Audio sync word found !"),!0;return!1},s.canParse=function(r,n){return E.canParse(r,n)},s.appendFrame=function(r,n,o){return this.initPTS===null?void 0:E.appendFrame(r,n,o,this.initPTS,this.frameIndex)},c}(R.default);u.minProbeByteLength=4,k.default=u},"./src/demux/mp4demuxer.ts":function(j,k,D){"use strict";D.r(k);var R=D("./src/utils/mp4-tools.ts"),O=D("./src/demux/dummy-demuxed-track.ts"),d=function(){function E(v,u){this.remainderData=null,this.config=void 0,this.config=u}var y=E.prototype;return y.resetTimeStamp=function(){},y.resetInitSegment=function(){},y.resetContiguity=function(){},E.probe=function(u){return Object(R.findBox)({data:u,start:0,end:Math.min(u.length,16384)},["moof"]).length>0},y.demux=function(u){var a=u,c=Object(O.dummyTrack)();if(this.config.progressive){this.remainderData&&(a=Object(R.appendUint8Array)(this.remainderData,u));var s=Object(R.segmentValidRange)(a);this.remainderData=s.remainder,c.samples=s.valid||new Uint8Array}else c.samples=a;return{audioTrack:Object(O.dummyTrack)(),avcTrack:c,id3Track:Object(O.dummyTrack)(),textTrack:Object(O.dummyTrack)()}},y.flush=function(){var u=Object(O.dummyTrack)();return u.samples=this.remainderData||new Uint8Array,this.remainderData=null,{audioTrack:Object(O.dummyTrack)(),avcTrack:u,id3Track:Object(O.dummyTrack)(),textTrack:Object(O.dummyTrack)()}},y.demuxSampleAes=function(u,a,c){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))},y.destroy=function(){},E}();d.minProbeByteLength=1024,k.default=d},"./src/demux/mpegaudio.ts":function(j,k,D){"use strict";D.r(k),D.d(k,"appendFrame",function(){return v}),D.d(k,"parseHeader",function(){return u}),D.d(k,"isHeaderPattern",function(){return a}),D.d(k,"isHeader",function(){return c}),D.d(k,"canParse",function(){return s}),D.d(k,"probe",function(){return l});var R=null,O=[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],d=[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]],y=[0,1,1,4];function v(r,n,o,i,f){if(o+24>n.length)return;var h=u(n,o);if(h&&o+h.frameLength<=n.length){var T=h.samplesPerFrame*9e4/h.sampleRate,g=i+f*T,w={unit:n.subarray(o,o+h.frameLength),pts:g,dts:g};return r.config=[],r.channelCount=h.channelCount,r.samplerate=h.sampleRate,r.samples.push(w),{sample:w,length:h.frameLength,missing:0}}}function u(r,n){var o=r[n+1]>>3&3,i=r[n+1]>>1&3,f=r[n+2]>>4&15,h=r[n+2]>>2&3;if(o!==1&&f!==0&&f!==15&&h!==3){var T=r[n+2]>>1&1,g=r[n+3]>>6,w=o===3?3-i:i===3?3:4,C=O[w*14+f-1]*1e3,x=o===3?0:o===2?1:2,b=d[x*3+h],S=g===3?1:2,A=E[o][i],p=y[i],I=A*8*p,M=Math.floor(A*C/b+T)*p;if(R===null){var P=navigator.userAgent||"",B=P.match(/Chrome\/(\d+)/i);R=B?parseInt(B[1]):0}var H=!!R&&R<=87;return H&&i===2&&C>=224e3&&g===0&&(r[n+3]=r[n+3]|128),{sampleRate:b,channelCount:S,frameLength:M,samplesPerFrame:I}}}function a(r,n){return r[n]===255&&(r[n+1]&224)===224&&(r[n+1]&6)!==0}function c(r,n){return n+1<r.length&&a(r,n)}function s(r,n){var o=4;return a(r,n)&&o<=r.length-n}function l(r,n){if(n+1<r.length&&a(r,n)){var o=4,i=u(r,n),f=o;i!=null&&i.frameLength&&(f=i.frameLength);var h=n+f;return h===r.length||c(r,h)}return!1}},"./src/demux/sample-aes.ts":function(j,k,D){"use strict";D.r(k);var R=D("./src/crypt/decrypter.ts"),O=D("./src/demux/tsdemuxer.ts"),d=function(){function E(v,u,a){this.keyData=void 0,this.decrypter=void 0,this.keyData=a,this.decrypter=new R.default(v,u,{removePKCS7Padding:!1})}var y=E.prototype;return y.decryptBuffer=function(u,a){this.decrypter.decrypt(u,this.keyData.key.buffer,this.keyData.iv.buffer,a)},y.decryptAacSample=function(u,a,c,s){var l=u[a].unit,r=l.subarray(16,l.length-l.length%16),n=r.buffer.slice(r.byteOffset,r.byteOffset+r.length),o=this;this.decryptBuffer(n,function(i){var f=new Uint8Array(i);l.set(f,16),s||o.decryptAacSamples(u,a+1,c)})},y.decryptAacSamples=function(u,a,c){for(;;a++){if(a>=u.length){c();return}if(u[a].unit.length<32)continue;var s=this.decrypter.isSync();if(this.decryptAacSample(u,a,c,s),!s)return}},y.getAvcEncryptedData=function(u){for(var a=Math.floor((u.length-48)/160)*16+16,c=new Int8Array(a),s=0,l=32;l<=u.length-16;l+=160,s+=16)c.set(u.subarray(l,l+16),s);return c},y.getAvcDecryptedUnit=function(u,a){for(var c=new Uint8Array(a),s=0,l=32;l<=u.length-16;l+=160,s+=16)u.set(c.subarray(s,s+16),l);return u},y.decryptAvcSample=function(u,a,c,s,l,r){var n=Object(O.discardEPB)(l.data),o=this.getAvcEncryptedData(n),i=this;this.decryptBuffer(o.buffer,function(f){l.data=i.getAvcDecryptedUnit(n,f),r||i.decryptAvcSamples(u,a,c+1,s)})},y.decryptAvcSamples=function(u,a,c,s){if(u instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;a++,c=0){if(a>=u.length){s();return}for(var l=u[a].units;!(c>=l.length);c++){var r=l[c];if(r.data.length<=48||r.type!==1&&r.type!==5)continue;var n=this.decrypter.isSync();if(this.decryptAvcSample(u,a,c,s,r,n),!n)return}}},E}();k.default=d},"./src/demux/transmuxer-interface.ts":function(j,k,D){"use strict";D.r(k),D.d(k,"default",function(){return l});var R=D("./node_modules/webworkify-webpack/index.js"),O=D.n(R),d=D("./src/events.ts"),E=D("./src/demux/transmuxer.ts"),y=D("./src/utils/logger.ts"),v=D("./src/errors.ts"),u=D("./src/utils/mediasource-helper.ts"),a=D("./node_modules/eventemitter3/index.js"),c=D.n(a),s=Object(u.getMediaSource)()||{isTypeSupported:function(){return!1}},l=function(){function r(o,i,f,h){var T=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=o,this.id=i,this.onTransmuxComplete=f,this.onFlush=h;var g=o.config,w=function(A,p){p=p||{},p.frag=T.frag,p.id=T.id,o.trigger(A,p)};this.observer=new a.EventEmitter,this.observer.on(d.Events.FRAG_DECRYPTED,w),this.observer.on(d.Events.ERROR,w);var C={mp4:s.isTypeSupported("video/mp4"),mpeg:s.isTypeSupported("audio/mpeg"),mp3:s.isTypeSupported('audio/mp4; codecs="mp3"')},x=navigator.vendor;if(g.enableWorker&&typeof Worker!="undefined"){y.logger.log("demuxing in webworker");var b;try{b=this.worker=R("./src/demux/transmuxer-worker.ts"),this.onwmsg=this.onWorkerMessage.bind(this),b.addEventListener("message",this.onwmsg),b.onerror=function(S){o.trigger(d.Events.ERROR,{type:v.ErrorTypes.OTHER_ERROR,details:v.ErrorDetails.INTERNAL_EXCEPTION,fatal:!0,event:"demuxerWorker",error:new Error(S.message+" ("+S.filename+":"+S.lineno+")")})},b.postMessage({cmd:"init",typeSupported:C,vendor:x,id:i,config:JSON.stringify(g)})}catch(S){y.logger.warn("Error in worker:",S),y.logger.error("Error while initializing DemuxerWorker, fallback to inline"),b&&self.URL.revokeObjectURL(b.objectURL),this.transmuxer=new E.default(this.observer,C,g,x,i),this.worker=null}}else this.transmuxer=new E.default(this.observer,C,g,x,i)}var n=r.prototype;return n.destroy=function(){var i=this.worker;if(i)i.removeEventListener("message",this.onwmsg),i.terminate(),this.worker=null;else{var f=this.transmuxer;f&&(f.destroy(),this.transmuxer=null)}var h=this.observer;h&&h.removeAllListeners(),this.observer=null},n.push=function(i,f,h,T,g,w,C,x,b,S){var A=this;b.transmuxing.start=self.performance.now();var p=this.transmuxer,I=this.worker,M=w?w.start:g.start,P=g.decryptdata,B=this.frag,H=!(B&&g.cc===B.cc),F=!(B&&b.level===B.level),W=B?b.sn-B.sn:-1,U=this.part?b.part-this.part.index:1,K=!F&&(W===1||W===0&&U===1),G=self.performance.now();(F||W||g.stats.parsing.start===0)&&(g.stats.parsing.start=G),w&&(U||!K)&&(w.stats.parsing.start=G);var ae=new E.TransmuxState(H,K,x,F,M);if(!K||H){y.logger.log("[transmuxer-interface, "+g.type+"]: Starting new transmux session for sn: "+b.sn+" p: "+b.part+" level: "+b.level+" id: "+b.id+`
|
|
|
discontinuity: `+H+`
|
|
|
trackSwitch: `+F+`
|
|
|
contiguous: `+K+`
|
|
|
accurateTimeOffset: `+x+`
|
|
|
timeOffset: `+M);var fe=new E.TransmuxConfig(h,T,f,C,S);this.configureTransmuxer(fe)}if(this.frag=g,this.part=w,I)I.postMessage({cmd:"demux",data:i,decryptdata:P,chunkMeta:b,state:ae},i instanceof ArrayBuffer?[i]:[]);else if(p){var Se=p.push(i,P,b,ae);Object(E.isPromise)(Se)?Se.then(function(Ue){A.handleTransmuxComplete(Ue)}):this.handleTransmuxComplete(Se)}},n.flush=function(i){var f=this;i.transmuxing.start=self.performance.now();var h=this.transmuxer,T=this.worker;if(T)T.postMessage({cmd:"flush",chunkMeta:i});else if(h){var g=h.flush(i);Object(E.isPromise)(g)?g.then(function(w){f.handleFlushResult(w,i)}):this.handleFlushResult(g,i)}},n.handleFlushResult=function(i,f){var h=this;i.forEach(function(T){h.handleTransmuxComplete(T)}),this.onFlush(f)},n.onWorkerMessage=function(i){var f=i.data,h=this.hls;switch(f.event){case"init":{self.URL.revokeObjectURL(this.worker.objectURL);break}case"transmuxComplete":{this.handleTransmuxComplete(f.data);break}case"flush":{this.onFlush(f.data);break}default:{f.data=f.data||{},f.data.frag=this.frag,f.data.id=this.id,h.trigger(f.event,f.data);break}}},n.configureTransmuxer=function(i){var f=this.worker,h=this.transmuxer;f?f.postMessage({cmd:"configure",config:i}):h&&h.configure(i)},n.handleTransmuxComplete=function(i){i.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(i)},r}()},"./src/demux/transmuxer-worker.ts":function(j,k,D){"use strict";D.r(k),D.d(k,"default",function(){return v});var R=D("./src/demux/transmuxer.ts"),O=D("./src/events.ts"),d=D("./src/utils/logger.ts"),E=D("./node_modules/eventemitter3/index.js"),y=D.n(E);function v(l){var r=new E.EventEmitter,n=function(i,f){l.postMessage({event:i,data:f})};r.on(O.Events.FRAG_DECRYPTED,n),r.on(O.Events.ERROR,n),l.addEventListener("message",function(o){var i=o.data;switch(i.cmd){case"init":{var f=JSON.parse(i.config);l.transmuxer=new R.default(r,i.typeSupported,f,i.vendor,i.id),Object(d.enableLogs)(f.debug),n("init",null);break}case"configure":{l.transmuxer.configure(i.config);break}case"demux":{var h=l.transmuxer.push(i.data,i.decryptdata,i.chunkMeta,i.state);Object(R.isPromise)(h)?h.then(function(w){u(l,w)}):u(l,h);break}case"flush":{var T=i.chunkMeta,g=l.transmuxer.flush(T);Object(R.isPromise)(g)?g.then(function(w){c(l,w,T)}):c(l,g,T);break}default:break}})}function u(l,r){if(s(r.remuxResult))return;var n=[],o=r.remuxResult,i=o.audio,f=o.video;i&&a(n,i),f&&a(n,f),l.postMessage({event:"transmuxComplete",data:r},n)}function a(l,r){r.data1&&l.push(r.data1.buffer),r.data2&&l.push(r.data2.buffer)}function c(l,r,n){r.forEach(function(o){u(l,o)}),l.postMessage({event:"flush",data:n})}function s(l){return!l.audio&&!l.video&&!l.text&&!l.id3&&!l.initSegment}},"./src/demux/transmuxer.ts":function(j,k,D){"use strict";D.r(k),D.d(k,"default",function(){return f}),D.d(k,"isPromise",function(){return g}),D.d(k,"TransmuxConfig",function(){return w}),D.d(k,"TransmuxState",function(){return C});var R=D("./src/events.ts"),O=D("./src/errors.ts"),d=D("./src/crypt/decrypter.ts"),E=D("./src/demux/aacdemuxer.ts"),y=D("./src/demux/mp4demuxer.ts"),v=D("./src/demux/tsdemuxer.ts"),u=D("./src/demux/mp3demuxer.ts"),a=D("./src/remux/mp4-remuxer.ts"),c=D("./src/remux/passthrough-remuxer.ts"),s=D("./src/demux/chunk-cache.ts"),l=D("./src/utils/mp4-tools.ts"),r=D("./src/utils/logger.ts"),n;try{n=self.performance.now.bind(self.performance)}catch(x){r.logger.debug("Unable to use Performance API on this environment"),n=self.Date.now}var o=[{demux:v.default,remux:a.default},{demux:y.default,remux:c.default},{demux:E.default,remux:a.default},{demux:u.default,remux:a.default}],i=1024;o.forEach(function(x){var b=x.demux;i=Math.max(i,b.minProbeByteLength)});var f=function(){function x(S,A,p,I,M){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 s.default,this.observer=S,this.typeSupported=A,this.config=p,this.vendor=I,this.id=M}var b=x.prototype;return b.configure=function(A){this.transmuxConfig=A,this.decrypter&&this.decrypter.reset()},b.push=function(A,p,I,M){var P=this,B=I.transmuxing;B.executeStart=n();var H=new Uint8Array(A),F=this.cache,W=this.config,U=this.currentTransmuxState,K=this.transmuxConfig;M&&(this.currentTransmuxState=M);var G=h(H,p);if(G&&G.method==="AES-128"){var ae=this.getDecrypter();if(W.enableSoftwareAES){var fe=ae.softwareDecrypt(H,G.key.buffer,G.iv.buffer);if(!fe)return B.executeEnd=n(),T(I);H=new Uint8Array(fe)}else return this.decryptionPromise=ae.webCryptoDecrypt(H,G.key.buffer,G.iv.buffer).then(function(ze){var Ge=P.push(ze,null,I);return P.decryptionPromise=null,Ge}),this.decryptionPromise}var Se=M||U,Ue=Se.contiguous,Ne=Se.discontinuity,xe=Se.trackSwitch,Ce=Se.accurateTimeOffset,De=Se.timeOffset,ve=K.audioCodec,Re=K.videoCodec,ee=K.defaultInitPts,ge=K.duration,se=K.initSegmentData;if((Ne||xe)&&this.resetInitSegment(se,ve,Re,ge),Ne&&this.resetInitialTimestamp(ee),Ue||this.resetContiguity(),this.needsProbing(H,Ne,xe)){if(F.dataLength){var Fe=F.flush();H=Object(l.appendUint8Array)(Fe,H)}this.configureTransmuxer(H,K)}var je=this.transmux(H,G,De,Ce,I),Ke=this.currentTransmuxState;return Ke.contiguous=!0,Ke.discontinuity=!1,Ke.trackSwitch=!1,B.executeEnd=n(),je},b.flush=function(A){var p=this,I=A.transmuxing;I.executeStart=n();var M=this.decrypter,P=this.cache,B=this.currentTransmuxState,H=this.decryptionPromise;if(H)return H.then(function(){return p.flush(A)});var F=[],W=B.timeOffset;if(M){var U=M.flush();U&&F.push(this.push(U,null,A))}var K=P.dataLength;P.reset();var G=this.demuxer,ae=this.remuxer;if(!G||!ae)return K>=i&&this.observer.emit(R.Events.ERROR,R.Events.ERROR,{type:O.ErrorTypes.MEDIA_ERROR,details:O.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"no demux matching with content found"}),I.executeEnd=n(),[T(A)];var fe=G.flush(W);return g(fe)?fe.then(function(Se){return p.flushRemux(F,Se,A),F}):(this.flushRemux(F,fe,A),F)},b.flushRemux=function(A,p,I){var M=p.audioTrack,P=p.avcTrack,B=p.id3Track,H=p.textTrack,F=this.currentTransmuxState,W=F.accurateTimeOffset,U=F.timeOffset;r.logger.log("[transmuxer.ts]: Flushed fragment "+I.sn+(I.part>-1?" p: "+I.part:"")+" of level "+I.level);var K=this.remuxer.remux(M,P,B,H,U,W,!0,this.id);A.push({remuxResult:K,chunkMeta:I}),I.transmuxing.executeEnd=n()},b.resetInitialTimestamp=function(A){var p=this.demuxer,I=this.remuxer;if(!p||!I)return;p.resetTimeStamp(A),I.resetTimeStamp(A)},b.resetContiguity=function(){var A=this.demuxer,p=this.remuxer;if(!A||!p)return;A.resetContiguity(),p.resetNextTimestamp()},b.resetInitSegment=function(A,p,I,M){var P=this.demuxer,B=this.remuxer;if(!P||!B)return;P.resetInitSegment(p,I,M),B.resetInitSegment(A,p,I)},b.destroy=function(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)},b.transmux=function(A,p,I,M,P){var B;return p&&p.method==="SAMPLE-AES"?B=this.transmuxSampleAes(A,p,I,M,P):B=this.transmuxUnencrypted(A,I,M,P),B},b.transmuxUnencrypted=function(A,p,I,M){var P=this.demuxer.demux(A,p,!1,!this.config.progressive),B=P.audioTrack,H=P.avcTrack,F=P.id3Track,W=P.textTrack,U=this.remuxer.remux(B,H,F,W,p,I,!1,this.id);return{remuxResult:U,chunkMeta:M}},b.transmuxSampleAes=function(A,p,I,M,P){var B=this;return this.demuxer.demuxSampleAes(A,p,I).then(function(H){var F=B.remuxer.remux(H.audioTrack,H.avcTrack,H.id3Track,H.textTrack,I,M,!1,B.id);return{remuxResult:F,chunkMeta:P}})},b.configureTransmuxer=function(A,p){for(var I=this.config,M=this.observer,P=this.typeSupported,B=this.vendor,H=p.audioCodec,F=p.defaultInitPts,W=p.duration,U=p.initSegmentData,K=p.videoCodec,G,ae=0,fe=o.length;ae<fe;ae++)if(o[ae].demux.probe(A)){G=o[ae];break}G||(r.logger.warn("Failed to find demuxer by probing frag, treating as mp4 passthrough"),G={demux:y.default,remux:c.default});var Se=this.demuxer,Ue=this.remuxer,Ne=G.remux,xe=G.demux;(!Ue||!(Ue instanceof Ne))&&(this.remuxer=new Ne(M,I,P,B)),(!Se||!(Se instanceof xe))&&(this.demuxer=new xe(M,I,P),this.probe=xe.probe),this.resetInitSegment(U,H,K,W),this.resetInitialTimestamp(F)},b.needsProbing=function(A,p,I){return!this.demuxer||!this.remuxer||p||I},b.getDecrypter=function(){var A=this.decrypter;return A||(A=this.decrypter=new d.default(this.observer,this.config)),A},x}();function h(x,b){var S=null;return x.byteLength>0&&b!=null&&b.key!=null&&b.iv!==null&&b.method!=null&&(S=b),S}var T=function(b){return{remuxResult:{},chunkMeta:b}};function g(x){return"then"in x&&x.then instanceof Function}var w=function(b,S,A,p,I){this.audioCodec=void 0,this.videoCodec=void 0,this.initSegmentData=void 0,this.duration=void 0,this.defaultInitPts=void 0,this.audioCodec=b,this.videoCodec=S,this.initSegmentData=A,this.duration=p,this.defaultInitPts=I},C=function(b,S,A,p,I){this.discontinuity=void 0,this.contiguous=void 0,this.accurateTimeOffset=void 0,this.trackSwitch=void 0,this.timeOffset=void 0,this.discontinuity=b,this.contiguous=S,this.accurateTimeOffset=A,this.trackSwitch=p,this.timeOffset=I}},"./src/demux/tsdemuxer.ts":function(j,k,D){"use strict";D.r(k),D.d(k,"discardEPB",function(){return T});var R=D("./src/demux/adts.ts"),O=D("./src/demux/mpegaudio.ts"),d=D("./src/demux/exp-golomb.ts"),E=D("./src/demux/id3.ts"),y=D("./src/demux/sample-aes.ts"),v=D("./src/events.ts"),u=D("./src/utils/mp4-tools.ts"),a=D("./src/utils/logger.ts"),c=D("./src/errors.ts"),s={video:1,audio:2,id3:3,text:4},l=function(){function g(C,x,b){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=x,this.typeSupported=b}g.probe=function(x){var b=g.syncOffset(x);return b<0?!1:(b&&a.logger.warn("MPEG2-TS detected but first sync word found @ offset "+b+", junk ahead ?"),!0)},g.syncOffset=function(x){for(var b=Math.min(1e3,x.length-3*188),S=0;S<b;){if(x[S]===71&&x[S+188]===71&&x[S+2*188]===71)return S;S++}return-1},g.createTrack=function(x,b){return{container:x==="video"||x==="audio"?"video/mp2t":void 0,type:x,id:s[x],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0,duration:x==="audio"?b:void 0}};var w=g.prototype;return w.resetInitSegment=function(x,b,S){this.pmtParsed=!1,this._pmtId=-1,this._avcTrack=g.createTrack("video",S),this._audioTrack=g.createTrack("audio",S),this._id3Track=g.createTrack("id3",S),this._txtTrack=g.createTrack("text",S),this._audioTrack.isAAC=!0,this.aacOverFlow=null,this.aacLastPTS=null,this.avcSample=null,this.audioCodec=x,this.videoCodec=b,this._duration=S},w.resetTimeStamp=function(){},w.resetContiguity=function(){var x=this._audioTrack,b=this._avcTrack,S=this._id3Track;x&&(x.pesData=null),b&&(b.pesData=null),S&&(S.pesData=null),this.aacOverFlow=null,this.aacLastPTS=null},w.demux=function(x,b,S,A){S===void 0&&(S=!1),A===void 0&&(A=!1),S||(this.sampleAes=null);var p,I=this._avcTrack,M=this._audioTrack,P=this._id3Track,B=I.pid,H=I.pesData,F=M.pid,W=P.pid,U=M.pesData,K=P.pesData,G=!1,ae=this.pmtParsed,fe=this._pmtId,Se=x.length;if(this.remainderData&&(x=Object(u.appendUint8Array)(this.remainderData,x),Se=x.length,this.remainderData=null),Se<188&&!A)return this.remainderData=x,{audioTrack:M,avcTrack:I,id3Track:P,textTrack:this._txtTrack};var Ue=Math.max(0,g.syncOffset(x));Se-=(Se+Ue)%188,Se<x.byteLength&&!A&&(this.remainderData=new Uint8Array(x.buffer,Se,x.buffer.byteLength-Se));for(var Ne=Ue;Ne<Se;Ne+=188)if(x[Ne]===71){var xe=!!(x[Ne+1]&64),Ce=((x[Ne+1]&31)<<8)+x[Ne+2],De=(x[Ne+3]&48)>>4,ve=void 0;if(De>1){if(ve=Ne+5+x[Ne+4],ve===Ne+188)continue}else ve=Ne+4;switch(Ce){case B:xe&&(H&&(p=i(H))&&this.parseAVCPES(p,!1),H={data:[],size:0}),H&&(H.data.push(x.subarray(ve,Ne+188)),H.size+=Ne+188-ve);break;case F:xe&&(U&&(p=i(U))&&(M.isAAC?this.parseAACPES(p):this.parseMPEGPES(p)),U={data:[],size:0}),U&&(U.data.push(x.subarray(ve,Ne+188)),U.size+=Ne+188-ve);break;case W:xe&&(K&&(p=i(K))&&this.parseID3PES(p),K={data:[],size:0}),K&&(K.data.push(x.subarray(ve,Ne+188)),K.size+=Ne+188-ve);break;case 0:xe&&(ve+=x[ve]+1),fe=this._pmtId=n(x,ve);break;case fe:{xe&&(ve+=x[ve]+1);var Re=o(x,ve,this.typeSupported.mpeg===!0||this.typeSupported.mp3===!0,S);B=Re.avc,B>0&&(I.pid=B),F=Re.audio,F>0&&(M.pid=F,M.isAAC=Re.isAAC),W=Re.id3,W>0&&(P.pid=W),G&&!ae&&(a.logger.log("reparse from beginning"),G=!1,Ne=Ue-188),ae=this.pmtParsed=!0;break}case 17:case 8191:break;default:G=!0;break}}else this.observer.emit(v.Events.ERROR,v.Events.ERROR,{type:c.ErrorTypes.MEDIA_ERROR,details:c.ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,reason:"TS packet did not start with 0x47"});I.pesData=H,M.pesData=U,P.pesData=K;var ee={audioTrack:M,avcTrack:I,id3Track:P,textTrack:this._txtTrack};return A&&this.extractRemainingSamples(ee),ee},w.flush=function(){var x=this.remainderData;this.remainderData=null;var b;return x?b=this.demux(x,-1,!1,!0):b={audioTrack:this._audioTrack,avcTrack:this._avcTrack,textTrack:this._txtTrack,id3Track:this._id3Track},this.extractRemainingSamples(b),this.sampleAes?this.decrypt(b,this.sampleAes):b},w.extractRemainingSamples=function(x){var b=x.audioTrack,S=x.avcTrack,A=x.id3Track,p=S.pesData,I=b.pesData,M=A.pesData,P;p&&(P=i(p))?(this.parseAVCPES(P,!0),S.pesData=null):S.pesData=p,I&&(P=i(I))?(b.isAAC?this.parseAACPES(P):this.parseMPEGPES(P),b.pesData=null):(I!=null&&I.size&&a.logger.log("last AAC PES packet truncated,might overlap between fragments"),b.pesData=I),M&&(P=i(M))?(this.parseID3PES(P),A.pesData=null):A.pesData=M},w.demuxSampleAes=function(x,b,S){var A=this.demux(x,S,!0,!this.config.progressive),p=this.sampleAes=new y.default(this.observer,this.config,b);return this.decrypt(A,p)},w.decrypt=function(x,b){return new Promise(function(S){var A=x.audioTrack,p=x.avcTrack;A.samples&&A.isAAC?b.decryptAacSamples(A.samples,0,function(){p.samples?b.decryptAvcSamples(p.samples,0,0,function(){S(x)}):S(x)}):p.samples&&b.decryptAvcSamples(p.samples,0,0,function(){S(x)})})},w.destroy=function(){this._initPTS=this._initDTS=null,this._duration=0},w.parseAVCPES=function(x,b){var S=this,A=this._avcTrack,p=this.parseAVCNALu(x.data),I=!1,M=this.avcSample,P,B=!1;x.data=null,M&&p.length&&!A.audFound&&(f(M,A),M=this.avcSample=r(!1,x.pts,x.dts,"")),p.forEach(function(H){switch(H.type){case 1:{P=!0,M||(M=S.avcSample=r(!0,x.pts,x.dts,"")),I&&(M.debug+="NDR "),M.frame=!0;var F=H.data;if(B&&F.length>4){var W=new d.default(F).readSliceType();(W===2||W===4||W===7||W===9)&&(M.key=!0)}break}case 5:P=!0,M||(M=S.avcSample=r(!0,x.pts,x.dts,"")),I&&(M.debug+="IDR "),M.key=!0,M.frame=!0;break;case 6:{P=!0,I&&M&&(M.debug+="SEI ");var U=new d.default(T(H.data));U.readUByte();for(var K=0,G=0,ae=!1,fe=0;!ae&&U.bytesAvailable>1;){K=0;do fe=U.readUByte(),K+=fe;while(fe===255);G=0;do fe=U.readUByte(),G+=fe;while(fe===255);if(K===4&&U.bytesAvailable!==0){ae=!0;var Se=U.readUByte();if(Se===181){var Ue=U.readUShort();if(Ue===49){var Ne=U.readUInt();if(Ne===1195456820){var xe=U.readUByte();if(xe===3){for(var Ce=U.readUByte(),De=U.readUByte(),ve=31&Ce,Re=[Ce,De],ee=0;ee<ve;ee++)Re.push(U.readUByte()),Re.push(U.readUByte()),Re.push(U.readUByte());h(S._txtTrack.samples,{type:3,pts:x.pts,bytes:Re})}}}}}else if(K===5&&U.bytesAvailable!==0){if(ae=!0,G>16){for(var ge=[],se=0;se<16;se++)ge.push(U.readUByte().toString(16)),(se===3||se===5||se===7||se===9)&&ge.push("-");for(var Fe=G-16,je=new Uint8Array(Fe),Ke=0;Ke<Fe;Ke++)je[Ke]=U.readUByte();h(S._txtTrack.samples,{pts:x.pts,payloadType:K,uuid:ge.join(""),userData:Object(E.utf8ArrayToStr)(je),userDataBytes:je})}}else if(G<U.bytesAvailable)for(var ze=0;ze<G;ze++)U.readUByte()}break}case 7:if(P=!0,B=!0,I&&M&&(M.debug+="SPS "),!A.sps){var Ge=new d.default(H.data),He=Ge.readSPS();A.width=He.width,A.height=He.height,A.pixelRatio=He.pixelRatio,A.sps=[H.data],A.duration=S._duration;for(var Ie=H.data.subarray(1,4),ke="avc1.",Ae=0;Ae<3;Ae++){var Te=Ie[Ae].toString(16);Te.length<2&&(Te="0"+Te),ke+=Te}A.codec=ke}break;case 8:P=!0,I&&M&&(M.debug+="PPS "),A.pps||(A.pps=[H.data]);break;case 9:P=!1,A.audFound=!0,M&&f(M,A),M=S.avcSample=r(!1,x.pts,x.dts,I?"AUD ":"");break;case 12:P=!1;break;default:P=!1,M&&(M.debug+="unknown NAL "+H.type+" ");break}if(M&&P){var Z=M.units;Z.push(H)}}),b&&M&&(f(M,A),this.avcSample=null)},w.getLastNalUnit=function(){var x,b=this.avcSample,S;if(!b||b.units.length===0){var A=this._avcTrack.samples;b=A[A.length-1]}if((x=b)!==null&&x!==void 0&&x.units){var p=b.units;S=p[p.length-1]}return S},w.parseAVCNALu=function(x){var b=x.byteLength,S=this._avcTrack,A=S.naluState||0,p=A,I=[],M=0,P,B,H,F=-1,W=0;for(A===-1&&(F=0,W=x[0]&31,A=0,M=1);M<b;){if(P=x[M++],!A){A=P?0:1;continue}if(A===1){A=P?0:2;continue}if(!P)A=3;else if(P===1){if(F>=0){var U={data:x.subarray(F,M-A-1),type:W};I.push(U)}else{var K=this.getLastNalUnit();if(K&&(p&&M<=4-p&&(K.state&&(K.data=K.data.subarray(0,K.data.byteLength-p))),B=M-A-1,B>0)){var G=new Uint8Array(K.data.byteLength+B);G.set(K.data,0),G.set(x.subarray(0,B),K.data.byteLength),K.data=G,K.state=0}}M<b?(H=x[M]&31,F=M,W=H,A=0):A=-1}else A=0}if(F>=0&&A>=0){var ae={data:x.subarray(F,b),type:W,state:A};I.push(ae)}if(I.length===0){var fe=this.getLastNalUnit();if(fe){var Se=new Uint8Array(fe.data.byteLength+x.byteLength);Se.set(fe.data,0),Se.set(x,fe.data.byteLength),fe.data=Se}}return S.naluState=A,I},w.parseAACPES=function(x){var b=0,S=this._audioTrack,A=this.aacOverFlow,p=x.data;if(A){this.aacOverFlow=null;var I=A.sample.unit.byteLength,M=Math.min(A.missing,I),P=I-M;A.sample.unit.set(p.subarray(0,M),P),S.samples.push(A.sample),b=A.missing}var B,H;for(B=b,H=p.length;B<H-1&&!R.isHeader(p,B);B++);if(B!==b){var F,W;if(B<H-1?(F="AAC PES did not start with ADTS header,offset:"+B,W=!1):(F="no ADTS header found in AAC PES",W=!0),a.logger.warn("parsing error:"+F),this.observer.emit(v.Events.ERROR,v.Events.ERROR,{type:c.ErrorTypes.MEDIA_ERROR,details:c.ErrorDetails.FRAG_PARSING_ERROR,fatal:W,reason:F}),W)return}R.initTrackConfig(S,this.observer,p,B,this.audioCodec);var U;if(x.pts!==void 0)U=x.pts;else if(A){var K=R.getFrameDuration(S.samplerate);U=A.sample.pts+K}else{a.logger.warn("[tsdemuxer]: AAC PES unknown PTS");return}for(var G=0;B<H;)if(R.isHeader(p,B)){if(B+5<H){var ae=R.appendFrame(S,p,B,U,G);if(ae)if(ae.missing)this.aacOverFlow=ae;else{B+=ae.length,G++;continue}}break}else B++},w.parseMPEGPES=function(x){var b=x.data,S=b.length,A=0,p=0,I=x.pts;if(I===void 0){a.logger.warn("[tsdemuxer]: MPEG PES unknown PTS");return}for(;p<S;)if(O.isHeader(b,p)){var M=O.appendFrame(this._audioTrack,b,p,I,A);if(M)p+=M.length,A++;else break}else p++},w.parseID3PES=function(x){if(x.pts===void 0){a.logger.warn("[tsdemuxer]: ID3 PES unknown PTS");return}this._id3Track.samples.push(x)},g}();l.minProbeByteLength=188;function r(g,w,C,x){return{key:g,frame:!1,pts:w,dts:C,units:[],debug:x,length:0}}function n(g,w){return(g[w+10]&31)<<8|g[w+11]}function o(g,w,C,x){var b={audio:-1,avc:-1,id3:-1,isAAC:!0},S=(g[w+1]&15)<<8|g[w+2],A=w+3+S-4,p=(g[w+10]&15)<<8|g[w+11];for(w+=12+p;w<A;){var I=(g[w+1]&31)<<8|g[w+2];switch(g[w]){case 207:if(!x){a.logger.log("ADTS AAC with AES-128-CBC frame encryption found in unencrypted stream");break}case 15:b.audio===-1&&(b.audio=I);break;case 21:b.id3===-1&&(b.id3=I);break;case 219:if(!x){a.logger.log("H.264 with AES-128-CBC slice encryption found in unencrypted stream");break}case 27:b.avc===-1&&(b.avc=I);break;case 3:case 4:C?b.audio===-1&&(b.audio=I,b.isAAC=!1):a.logger.log("MPEG audio found, not supported in this browser");break;case 36:a.logger.warn("Unsupported HEVC stream type found");break;default:break}w+=((g[w+3]&15)<<8|g[w+4])+5}return b}function i(g){var w=0,C,x,b,S,A,p=g.data;if(!g||g.size===0)return null;for(;p[0].length<19&&p.length>1;){var I=new Uint8Array(p[0].length+p[1].length);I.set(p[0]),I.set(p[1],p[0].length),p[0]=I,p.splice(1,1)}C=p[0];var M=(C[0]<<16)+(C[1]<<8)+C[2];if(M===1){if(x=(C[4]<<8)+C[5],x&&x>g.size-6)return null;var P=C[7];P&192&&(S=(C[9]&14)*536870912+(C[10]&255)*4194304+(C[11]&254)*16384+(C[12]&255)*128+(C[13]&254)/2,P&64?(A=(C[14]&14)*536870912+(C[15]&255)*4194304+(C[16]&254)*16384+(C[17]&255)*128+(C[18]&254)/2,S-A>60*9e4&&(a.logger.warn(Math.round((S-A)/9e4)+"s delta between PTS and DTS, align them"),S=A)):A=S),b=C[8];var B=b+9;if(g.size<=B)return null;g.size-=B;for(var H=new Uint8Array(g.size),F=0,W=p.length;F<W;F++){C=p[F];var U=C.byteLength;if(B)if(B>U){B-=U;continue}else C=C.subarray(B),U-=B,B=0;H.set(C,w),w+=U}return x&&(x-=b+3),{data:H,pts:S,dts:A,len:x}}return null}function f(g,w){if(g.units.length&&g.frame){if(g.pts===void 0){var C=w.samples,x=C.length;if(x){var b=C[x-1];g.pts=b.pts,g.dts=b.dts}else{w.dropped++;return}}w.samples.push(g)}g.debug.length&&a.logger.log(g.pts+"/"+g.dts+":"+g.debug)}function h(g,w){var C=g.length;if(C>0){if(w.pts>=g[C-1].pts)g.push(w);else for(var x=C-1;x>=0;x--)if(w.pts<g[x].pts){g.splice(x,0,w);break}}else g.push(w)}function T(g){for(var w=g.byteLength,C=[],x=1;x<w-2;)g[x]===0&&g[x+1]===0&&g[x+2]===3?(C.push(x+2),x+=2):x++;if(C.length===0)return g;var b=w-C.length,S=new Uint8Array(b),A=0;for(x=0;x<b;A++,x++)A===C[0]&&(A++,C.shift()),S[x]=g[A];return S}k.default=l},"./src/errors.ts":function(j,k,D){"use strict";D.r(k),D.d(k,"ErrorTypes",function(){return R}),D.d(k,"ErrorDetails",function(){return O});var R;(function(d){d.NETWORK_ERROR="networkError",d.MEDIA_ERROR="mediaError",d.KEY_SYSTEM_ERROR="keySystemError",d.MUX_ERROR="muxError",d.OTHER_ERROR="otherError"})(R||(R={}));var O;(function(d){d.KEY_SYSTEM_NO_KEYS="keySystemNoKeys",d.KEY_SYSTEM_NO_ACCESS="keySystemNoAccess",d.KEY_SYSTEM_NO_SESSION="keySystemNoSession",d.KEY_SYSTEM_LICENSE_REQUEST_FAILED="keySystemLicenseRequestFailed",d.KEY_SYSTEM_NO_INIT_DATA="keySystemNoInitData",d.MANIFEST_LOAD_ERROR="manifestLoadError",d.MANIFEST_LOAD_TIMEOUT="manifestLoadTimeOut",d.MANIFEST_PARSING_ERROR="manifestParsingError",d.MANIFEST_INCOMPATIBLE_CODECS_ERROR="manifestIncompatibleCodecsError",d.LEVEL_EMPTY_ERROR="levelEmptyError",d.LEVEL_LOAD_ERROR="levelLoadError",d.LEVEL_LOAD_TIMEOUT="levelLoadTimeOut",d.LEVEL_SWITCH_ERROR="levelSwitchError",d.AUDIO_TRACK_LOAD_ERROR="audioTrackLoadError",d.AUDIO_TRACK_LOAD_TIMEOUT="audioTrackLoadTimeOut",d.SUBTITLE_LOAD_ERROR="subtitleTrackLoadError",d.SUBTITLE_TRACK_LOAD_TIMEOUT="subtitleTrackLoadTimeOut",d.FRAG_LOAD_ERROR="fragLoadError",d.FRAG_LOAD_TIMEOUT="fragLoadTimeOut",d.FRAG_DECRYPT_ERROR="fragDecryptError",d.FRAG_PARSING_ERROR="fragParsingError",d.REMUX_ALLOC_ERROR="remuxAllocError",d.KEY_LOAD_ERROR="keyLoadError",d.KEY_LOAD_TIMEOUT="keyLoadTimeOut",d.BUFFER_ADD_CODEC_ERROR="bufferAddCodecError",d.BUFFER_INCOMPATIBLE_CODECS_ERROR="bufferIncompatibleCodecsError",d.BUFFER_APPEND_ERROR="bufferAppendError",d.BUFFER_APPENDING_ERROR="bufferAppendingError",d.BUFFER_STALLED_ERROR="bufferStalledError",d.BUFFER_FULL_ERROR="bufferFullError",d.BUFFER_SEEK_OVER_HOLE="bufferSeekOverHole",d.BUFFER_NUDGE_ON_STALL="bufferNudgeOnStall",d.INTERNAL_EXCEPTION="internalException",d.INTERNAL_ABORTED="aborted",d.UNKNOWN="unknown"})(O||(O={}))},"./src/events.ts":function(j,k,D){"use strict";D.r(k),D.d(k,"Events",function(){return R});var R;(function(O){O.MEDIA_ATTACHING="hlsMediaAttaching",O.MEDIA_ATTACHED="hlsMediaAttached",O.MEDIA_DETACHING="hlsMediaDetaching",O.MEDIA_DETACHED="hlsMediaDetached",O.BUFFER_RESET="hlsBufferReset",O.BUFFER_CODECS="hlsBufferCodecs",O.BUFFER_CREATED="hlsBufferCreated",O.BUFFER_APPENDING="hlsBufferAppending",O.BUFFER_APPENDED="hlsBufferAppended",O.BUFFER_EOS="hlsBufferEos",O.BUFFER_FLUSHING="hlsBufferFlushing",O.BUFFER_FLUSHED="hlsBufferFlushed",O.MANIFEST_LOADING="hlsManifestLoading",O.MANIFEST_LOADED="hlsManifestLoaded",O.MANIFEST_PARSED="hlsManifestParsed",O.LEVEL_SWITCHING="hlsLevelSwitching",O.LEVEL_SWITCHED="hlsLevelSwitched",O.LEVEL_LOADING="hlsLevelLoading",O.LEVEL_LOADED="hlsLevelLoaded",O.LEVEL_UPDATED="hlsLevelUpdated",O.LEVEL_PTS_UPDATED="hlsLevelPtsUpdated",O.LEVELS_UPDATED="hlsLevelsUpdated",O.AUDIO_TRACKS_UPDATED="hlsAudioTracksUpdated",O.AUDIO_TRACK_SWITCHING="hlsAudioTrackSwitching",O.AUDIO_TRACK_SWITCHED="hlsAudioTrackSwitched",O.AUDIO_TRACK_LOADING="hlsAudioTrackLoading",O.AUDIO_TRACK_LOADED="hlsAudioTrackLoaded",O.SUBTITLE_TRACKS_UPDATED="hlsSubtitleTracksUpdated",O.SUBTITLE_TRACKS_CLEARED="hlsSubtitleTracksCleared",O.SUBTITLE_TRACK_SWITCH="hlsSubtitleTrackSwitch",O.SUBTITLE_TRACK_LOADING="hlsSubtitleTrackLoading",O.SUBTITLE_TRACK_LOADED="hlsSubtitleTrackLoaded",O.SUBTITLE_FRAG_PROCESSED="hlsSubtitleFragProcessed",O.CUES_PARSED="hlsCuesParsed",O.NON_NATIVE_TEXT_TRACKS_FOUND="hlsNonNativeTextTracksFound",O.INIT_PTS_FOUND="hlsInitPtsFound",O.FRAG_LOADING="hlsFragLoading",O.FRAG_LOAD_EMERGENCY_ABORTED="hlsFragLoadEmergencyAborted",O.FRAG_LOADED="hlsFragLoaded",O.FRAG_DECRYPTED="hlsFragDecrypted",O.FRAG_PARSING_INIT_SEGMENT="hlsFragParsingInitSegment",O.FRAG_PARSING_USERDATA="hlsFragParsingUserdata",O.FRAG_PARSING_METADATA="hlsFragParsingMetadata",O.FRAG_PARSED="hlsFragParsed",O.FRAG_BUFFERED="hlsFragBuffered",O.FRAG_CHANGED="hlsFragChanged",O.FPS_DROP="hlsFpsDrop",O.FPS_DROP_LEVEL_CAPPING="hlsFpsDropLevelCapping",O.ERROR="hlsError",O.DESTROYING="hlsDestroying",O.KEY_LOADING="hlsKeyLoading",O.KEY_LOADED="hlsKeyLoaded",O.LIVE_BACK_BUFFER_REACHED="hlsLiveBackBufferReached",O.BACK_BUFFER_REACHED="hlsBackBufferReached"})(R||(R={}))},"./src/hls.ts":function(j,k,D){"use strict";D.r(k),D.d(k,"default",function(){return g});var R=D("./node_modules/url-toolkit/src/url-toolkit.js"),O=D.n(R),d=D("./src/loader/playlist-loader.ts"),E=D("./src/loader/key-loader.ts"),y=D("./src/controller/id3-track-controller.ts"),v=D("./src/controller/latency-controller.ts"),u=D("./src/controller/level-controller.ts"),a=D("./src/controller/fragment-tracker.ts"),c=D("./src/controller/stream-controller.ts"),s=D("./src/is-supported.ts"),l=D("./src/utils/logger.ts"),r=D("./src/config.ts"),n=D("./node_modules/eventemitter3/index.js"),o=D.n(n),i=D("./src/events.ts"),f=D("./src/errors.ts");function h(w,C){for(var x=0;x<C.length;x++){var b=C[x];b.enumerable=b.enumerable||!1,b.configurable=!0,"value"in b&&(b.writable=!0),Object.defineProperty(w,b.key,b)}}function T(w,C,x){return C&&h(w.prototype,C),x&&h(w,x),w}var g=function(){w.isSupported=function(){return Object(s.isSupported)()};function w(x){x===void 0&&(x={}),this.config=void 0,this.userConfig=void 0,this.coreComponents=void 0,this.networkControllers=void 0,this._emitter=new n.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 b=this.config=Object(r.mergeConfig)(w.DefaultConfig,x);this.userConfig=x,Object(l.enableLogs)(b.debug),this._autoLevelCapping=-1,b.progressive&&Object(r.enableStreamingMode)(b);var S=b.abrController,A=b.bufferController,p=b.capLevelController,I=b.fpsController,M=this.abrController=new S(this),P=this.bufferController=new A(this),B=this.capLevelController=new p(this),H=new I(this),F=new d.default(this),W=new E.default(this),U=new y.default(this),K=this.levelController=new u.default(this),G=new a.FragmentTracker(this),ae=this.streamController=new c.default(this,G);B.setStreamController(ae),H.setStreamController(ae);var fe=[K,ae];this.networkControllers=fe;var Se=[F,W,M,P,B,H,U,G];this.audioTrackController=this.createController(b.audioTrackController,null,fe),this.createController(b.audioStreamController,G,fe),this.subtitleTrackController=this.createController(b.subtitleTrackController,null,fe),this.createController(b.subtitleStreamController,G,fe),this.createController(b.timelineController,null,Se),this.emeController=this.createController(b.emeController,null,Se),this.cmcdController=this.createController(b.cmcdController,null,Se),this.latencyController=this.createController(v.default,null,Se),this.coreComponents=Se}var C=w.prototype;return C.createController=function(b,S,A){if(b){var p=S?new b(this,S):new b(this);return A&&A.push(p),p}return null},C.on=function(b,S,A){A===void 0&&(A=this),this._emitter.on(b,S,A)},C.once=function(b,S,A){A===void 0&&(A=this),this._emitter.once(b,S,A)},C.removeAllListeners=function(b){this._emitter.removeAllListeners(b)},C.off=function(b,S,A,p){A===void 0&&(A=this),this._emitter.off(b,S,A,p)},C.listeners=function(b){return this._emitter.listeners(b)},C.emit=function(b,S,A){return this._emitter.emit(b,S,A)},C.trigger=function(b,S){if(this.config.debug)return this.emit(b,b,S);try{return this.emit(b,b,S)}catch(A){l.logger.error("An internal error happened while handling event "+b+'. Error message: "'+A.message+'". Here is a stacktrace:',A),this.trigger(i.Events.ERROR,{type:f.ErrorTypes.OTHER_ERROR,details:f.ErrorDetails.INTERNAL_EXCEPTION,fatal:!1,event:b,error:A})}return!1},C.listenerCount=function(b){return this._emitter.listenerCount(b)},C.destroy=function(){l.logger.log("destroy"),this.trigger(i.Events.DESTROYING,void 0),this.detachMedia(),this.removeAllListeners(),this._autoLevelCapping=-1,this.url=null,this.networkControllers.forEach(function(b){return b.destroy()}),this.networkControllers.length=0,this.coreComponents.forEach(function(b){return b.destroy()}),this.coreComponents.length=0},C.attachMedia=function(b){l.logger.log("attachMedia"),this._media=b,this.trigger(i.Events.MEDIA_ATTACHING,{media:b})},C.detachMedia=function(){l.logger.log("detachMedia"),this.trigger(i.Events.MEDIA_DETACHING,void 0),this._media=null},C.loadSource=function(b){this.stopLoad();var S=this.media,A=this.url,p=this.url=R.buildAbsoluteURL(self.location.href,b,{alwaysNormalize:!0});l.logger.log("loadSource:"+p),S&&A&&A!==p&&this.bufferController.hasSourceTypes()&&(this.detachMedia(),this.attachMedia(S)),this.trigger(i.Events.MANIFEST_LOADING,{url:b})},C.startLoad=function(b){b===void 0&&(b=-1),l.logger.log("startLoad("+b+")"),this.networkControllers.forEach(function(S){S.startLoad(b)})},C.stopLoad=function(){l.logger.log("stopLoad"),this.networkControllers.forEach(function(b){b.stopLoad()})},C.swapAudioCodec=function(){l.logger.log("swapAudioCodec"),this.streamController.swapAudioCodec()},C.recoverMediaError=function(){l.logger.log("recoverMediaError");var b=this._media;this.detachMedia(),b&&this.attachMedia(b)},C.removeLevel=function(b,S){S===void 0&&(S=0),this.levelController.removeLevel(b,S)},T(w,[{key:"levels",get:function(){var b=this.levelController.levels;return b||[]}},{key:"currentLevel",get:function(){return this.streamController.currentLevel},set:function(b){l.logger.log("set currentLevel:"+b),this.loadLevel=b,this.abrController.clearTimer(),this.streamController.immediateLevelSwitch()}},{key:"nextLevel",get:function(){return this.streamController.nextLevel},set:function(b){l.logger.log("set nextLevel:"+b),this.levelController.manualLevel=b,this.streamController.nextLevelSwitch()}},{key:"loadLevel",get:function(){return this.levelController.level},set:function(b){l.logger.log("set loadLevel:"+b),this.levelController.manualLevel=b}},{key:"nextLoadLevel",get:function(){return this.levelController.nextLoadLevel},set:function(b){this.levelController.nextLoadLevel=b}},{key:"firstLevel",get:function(){return Math.max(this.levelController.firstLevel,this.minAutoLevel)},set:function(b){l.logger.log("set firstLevel:"+b),this.levelController.firstLevel=b}},{key:"startLevel",get:function(){return this.levelController.startLevel},set:function(b){l.logger.log("set startLevel:"+b),b!==-1&&(b=Math.max(b,this.minAutoLevel)),this.levelController.startLevel=b}},{key:"capLevelToPlayerSize",get:function(){return this.config.capLevelToPlayerSize},set:function(b){var S=!!b;S!==this.config.capLevelToPlayerSize&&(S?this.capLevelController.startCapping():(this.capLevelController.stopCapping(),this.autoLevelCapping=-1,this.streamController.nextLevelSwitch()),this.config.capLevelToPlayerSize=S)}},{key:"autoLevelCapping",get:function(){return this._autoLevelCapping},set:function(b){this._autoLevelCapping!==b&&(l.logger.log("set autoLevelCapping:"+b),this._autoLevelCapping=b)}},{key:"bandwidthEstimate",get:function(){var b=this.abrController.bwEstimator;return b?b.getEstimate():NaN}},{key:"autoLevelEnabled",get:function(){return this.levelController.manualLevel===-1}},{key:"manualLevel",get:function(){return this.levelController.manualLevel}},{key:"minAutoLevel",get:function(){var b=this.levels,S=this.config.minAutoBitrate;if(!b)return 0;for(var A=b.length,p=0;p<A;p++)if(b[p].maxBitrate>S)return p;return 0}},{key:"maxAutoLevel",get:function(){var b=this.levels,S=this.autoLevelCapping,A;return S===-1&&b&&b.length?A=b.length-1:A=S,A}},{key:"nextAutoLevel",get:function(){return Math.min(Math.max(this.abrController.nextAutoLevel,this.minAutoLevel),this.maxAutoLevel)},set:function(b){this.abrController.nextAutoLevel=Math.max(this.minAutoLevel,b)}},{key:"audioTracks",get:function(){var b=this.audioTrackController;return b?b.audioTracks:[]}},{key:"audioTrack",get:function(){var b=this.audioTrackController;return b?b.audioTrack:-1},set:function(b){var S=this.audioTrackController;S&&(S.audioTrack=b)}},{key:"subtitleTracks",get:function(){var b=this.subtitleTrackController;return b?b.subtitleTracks:[]}},{key:"subtitleTrack",get:function(){var b=this.subtitleTrackController;return b?b.subtitleTrack:-1},set:function(b){var S=this.subtitleTrackController;S&&(S.subtitleTrack=b)}},{key:"media",get:function(){return this._media}},{key:"subtitleDisplay",get:function(){var b=this.subtitleTrackController;return b?b.subtitleDisplay:!1},set:function(b){var S=this.subtitleTrackController;S&&(S.subtitleDisplay=b)}},{key:"lowLatencyMode",get:function(){return this.config.lowLatencyMode},set:function(b){this.config.lowLatencyMode=b}},{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 i.Events}},{key:"ErrorTypes",get:function(){return f.ErrorTypes}},{key:"ErrorDetails",get:function(){return f.ErrorDetails}},{key:"DefaultConfig",get:function(){return w.defaultConfig?w.defaultConfig:r.hlsDefaultConfig},set:function(b){w.defaultConfig=b}}]),w}();g.defaultConfig=void 0},"./src/is-supported.ts":function(j,k,D){"use strict";D.r(k),D.d(k,"isSupported",function(){return d}),D.d(k,"changeTypeSupported",function(){return E});var R=D("./src/utils/mediasource-helper.ts");function O(){return self.SourceBuffer||self.WebKitSourceBuffer}function d(){var y=Object(R.getMediaSource)();if(!y)return!1;var v=O(),u=y&&typeof y.isTypeSupported=="function"&&y.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"'),a=!v||v.prototype&&typeof v.prototype.appendBuffer=="function"&&typeof v.prototype.remove=="function";return!!u&&!!a}function E(){var y,v=O();return typeof(v==null||((y=v.prototype)===null||y===void 0)?void 0:y.changeType)=="function"}},"./src/loader/fragment-loader.ts":function(j,k,D){"use strict";D.r(k),D.d(k,"default",function(){return l}),D.d(k,"LoadError",function(){return n});var R=D("./src/polyfills/number.ts"),O=D("./src/errors.ts");function d(o,i){o.prototype=Object.create(i.prototype),o.prototype.constructor=o,a(o,i)}function E(o){var i=typeof Map=="function"?new Map:void 0;return E=function(h){if(h===null||!u(h))return h;if(typeof h!="function")throw new TypeError("Super expression must either be null or a function");if(typeof i!="undefined"){if(i.has(h))return i.get(h);i.set(h,T)}function T(){return y(h,arguments,c(this).constructor)}return T.prototype=Object.create(h.prototype,{constructor:{value:T,enumerable:!1,writable:!0,configurable:!0}}),a(T,h)},E(o)}function y(o,i,f){return v()?y=Reflect.construct:y=function(T,g,w){var C=[null];C.push.apply(C,g);var x=Function.bind.apply(T,C),b=new x;return w&&a(b,w.prototype),b},y.apply(null,arguments)}function v(){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(o){return!1}}function u(o){return Function.toString.call(o).indexOf("[native code]")!==-1}function a(o,i){return a=Object.setPrototypeOf||function(h,T){return h.__proto__=T,h},a(o,i)}function c(o){return c=Object.setPrototypeOf?Object.getPrototypeOf:function(f){return f.__proto__||Object.getPrototypeOf(f)},c(o)}var s=Math.pow(2,17),l=function(){function o(f){this.config=void 0,this.loader=null,this.partLoadTimeout=-1,this.config=f}var i=o.prototype;return i.destroy=function(){this.loader&&(this.loader.destroy(),this.loader=null)},i.abort=function(){this.loader&&this.loader.abort()},i.load=function(h,T){var g=this,w=h.url;if(!w)return Promise.reject(new n({type:O.ErrorTypes.NETWORK_ERROR,details:O.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:h,networkDetails:null},"Fragment does not have a "+(w?"part list":"url")));this.abort();var C=this.config,x=C.fLoader,b=C.loader;return new Promise(function(S,A){g.loader&&g.loader.destroy();var p=g.loader=h.loader=x?new x(C):new b(C),I=r(h),M={timeout:C.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:C.fragLoadingMaxRetryTimeout,highWaterMark:s};h.stats=p.stats,p.load(I,M,{onSuccess:function(B,H,F,W){g.resetLoader(h,p),S({frag:h,part:null,payload:B.data,networkDetails:W})},onError:function(B,H,F){g.resetLoader(h,p),A(new n({type:O.ErrorTypes.NETWORK_ERROR,details:O.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:h,response:B,networkDetails:F}))},onAbort:function(B,H,F){g.resetLoader(h,p),A(new n({type:O.ErrorTypes.NETWORK_ERROR,details:O.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:h,networkDetails:F}))},onTimeout:function(B,H,F){g.resetLoader(h,p),A(new n({type:O.ErrorTypes.NETWORK_ERROR,details:O.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:h,networkDetails:F}))},onProgress:function(B,H,F,W){T&&T({frag:h,part:null,payload:F,networkDetails:W})}})})},i.loadPart=function(h,T,g){var w=this;this.abort();var C=this.config,x=C.fLoader,b=C.loader;return new Promise(function(S,A){w.loader&&w.loader.destroy();var p=w.loader=h.loader=x?new x(C):new b(C),I=r(h,T),M={timeout:C.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:C.fragLoadingMaxRetryTimeout,highWaterMark:s};T.stats=p.stats,p.load(I,M,{onSuccess:function(B,H,F,W){w.resetLoader(h,p),w.updateStatsFromPart(h,T);var U={frag:h,part:T,payload:B.data,networkDetails:W};g(U),S(U)},onError:function(B,H,F){w.resetLoader(h,p),A(new n({type:O.ErrorTypes.NETWORK_ERROR,details:O.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:h,part:T,response:B,networkDetails:F}))},onAbort:function(B,H,F){h.stats.aborted=T.stats.aborted,w.resetLoader(h,p),A(new n({type:O.ErrorTypes.NETWORK_ERROR,details:O.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:h,part:T,networkDetails:F}))},onTimeout:function(B,H,F){w.resetLoader(h,p),A(new n({type:O.ErrorTypes.NETWORK_ERROR,details:O.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:h,part:T,networkDetails:F}))}})})},i.updateStatsFromPart=function(h,T){var g=h.stats,w=T.stats,C=w.total;if(g.loaded+=w.loaded,C){var x=Math.round(h.duration/T.duration),b=Math.min(Math.round(g.loaded/C),x),S=x-b,A=S*Math.round(g.loaded/b);g.total=g.loaded+A}else g.total=Math.max(g.loaded,g.total);var p=g.loading,I=w.loading;p.start?p.first+=I.first-I.start:(p.start=I.start,p.first=I.first),p.end=I.end},i.resetLoader=function(h,T){h.loader=null,this.loader===T&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),T.destroy()},o}();function r(o,i){i===void 0&&(i=null);var f=i||o,h={frag:o,part:i,responseType:"arraybuffer",url:f.url,headers:{},rangeStart:0,rangeEnd:0},T=f.byteRangeStartOffset,g=f.byteRangeEndOffset;return Object(R.isFiniteNumber)(T)&&Object(R.isFiniteNumber)(g)&&(h.rangeStart=T,h.rangeEnd=g),h}var n=function(o){d(i,o);function i(f){for(var h,T=arguments.length,g=new Array(T>1?T-1:0),w=1;w<T;w++)g[w-1]=arguments[w];return h=o.call.apply(o,[this].concat(g))||this,h.data=void 0,h.data=f,h}return i}(E(Error))},"./src/loader/fragment.ts":function(j,k,D){"use strict";D.r(k),D.d(k,"ElementaryStreamTypes",function(){return l}),D.d(k,"BaseSegment",function(){return r}),D.d(k,"Fragment",function(){return n}),D.d(k,"Part",function(){return o});var R=D("./src/polyfills/number.ts"),O=D("./node_modules/url-toolkit/src/url-toolkit.js"),d=D.n(O),E=D("./src/utils/logger.ts"),y=D("./src/loader/level-key.ts"),v=D("./src/loader/load-stats.ts");function u(i,f){i.prototype=Object.create(f.prototype),i.prototype.constructor=i,a(i,f)}function a(i,f){return a=Object.setPrototypeOf||function(T,g){return T.__proto__=g,T},a(i,f)}function c(i,f){for(var h=0;h<f.length;h++){var T=f[h];T.enumerable=T.enumerable||!1,T.configurable=!0,"value"in T&&(T.writable=!0),Object.defineProperty(i,T.key,T)}}function s(i,f,h){return f&&c(i.prototype,f),h&&c(i,h),i}var l;(function(i){i.AUDIO="audio",i.VIDEO="video",i.AUDIOVIDEO="audiovideo"})(l||(l={}));var r=function(){function i(h){var T;this._byteRange=null,this._url=null,this.baseurl=void 0,this.relurl=void 0,this.elementaryStreams=(T={},T[l.AUDIO]=null,T[l.VIDEO]=null,T[l.AUDIOVIDEO]=null,T),this.baseurl=h}var f=i.prototype;return f.setByteRange=function(T,g){var w=T.split("@",2),C=[];w.length===1?C[0]=g?g.byteRangeEndOffset:0:C[0]=parseInt(w[1]),C[1]=parseInt(w[0])+C[0],this._byteRange=C},s(i,[{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(O.buildAbsoluteURL)(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url||""},set:function(T){this._url=T}}]),i}(),n=function(i){u(f,i);function f(T,g){var w;return w=i.call(this,g)||this,w._decryptdata=null,w.rawProgramDateTime=null,w.programDateTime=null,w.tagList=[],w.duration=0,w.sn=0,w.levelkey=void 0,w.type=void 0,w.loader=null,w.level=-1,w.cc=0,w.startPTS=void 0,w.endPTS=void 0,w.appendedPTS=void 0,w.startDTS=void 0,w.endDTS=void 0,w.start=0,w.deltaPTS=void 0,w.maxStartPTS=void 0,w.minEndPTS=void 0,w.stats=new v.LoadStats,w.urlId=0,w.data=void 0,w.bitrateTest=!1,w.title=null,w.initSegment=null,w.type=T,w}var h=f.prototype;return h.createInitializationVector=function(g){for(var w=new Uint8Array(16),C=12;C<16;C++)w[C]=g>>8*(15-C)&255;return w},h.setDecryptDataFromLevelKey=function(g,w){var C=g;return(g==null?void 0:g.method)==="AES-128"&&g.uri&&!g.iv&&(C=y.LevelKey.fromURI(g.uri),C.method=g.method,C.iv=this.createInitializationVector(w),C.keyFormat="identity"),C},h.setElementaryStreamInfo=function(g,w,C,x,b,S){S===void 0&&(S=!1);var A=this.elementaryStreams,p=A[g];if(!p){A[g]={startPTS:w,endPTS:C,startDTS:x,endDTS:b,partial:S};return}p.startPTS=Math.min(p.startPTS,w),p.endPTS=Math.max(p.endPTS,C),p.startDTS=Math.min(p.startDTS,x),p.endDTS=Math.max(p.endDTS,b)},h.clearElementaryStreamInfo=function(){var g=this.elementaryStreams;g[l.AUDIO]=null,g[l.VIDEO]=null,g[l.AUDIOVIDEO]=null},s(f,[{key:"decryptdata",get:function(){if(!this.levelkey&&!this._decryptdata)return null;if(!this._decryptdata&&this.levelkey){var g=this.sn;typeof g!="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'),g=0),this._decryptdata=this.setDecryptDataFromLevelKey(this.levelkey,g)}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 g=Object(R.isFiniteNumber)(this.duration)?this.duration:0;return this.programDateTime+g*1e3}},{key:"encrypted",get:function(){var g;return!!((g=this.decryptdata)!==null&&g!==void 0&&g.keyFormat&&this.decryptdata.uri)}}]),f}(r),o=function(i){u(f,i);function f(h,T,g,w,C){var x;x=i.call(this,g)||this,x.fragOffset=0,x.duration=0,x.gap=!1,x.independent=!1,x.relurl=void 0,x.fragment=void 0,x.index=void 0,x.stats=new v.LoadStats,x.duration=h.decimalFloatingPoint("DURATION"),x.gap=h.bool("GAP"),x.independent=h.bool("INDEPENDENT"),x.relurl=h.enumeratedString("URI"),x.fragment=T,x.index=w;var b=h.enumeratedString("BYTERANGE");return b&&x.setByteRange(b,C),C&&(x.fragOffset=C.fragOffset+C.duration),x}return s(f,[{key:"start",get:function(){return this.fragment.start+this.fragOffset}},{key:"end",get:function(){return this.start+this.duration}},{key:"loaded",get:function(){var T=this.elementaryStreams;return!!(T.audio||T.video||T.audiovideo)}}]),f}(r)},"./src/loader/key-loader.ts":function(j,k,D){"use strict";D.r(k),D.d(k,"default",function(){return E});var R=D("./src/events.ts"),O=D("./src/errors.ts"),d=D("./src/utils/logger.ts"),E=function(){function y(u){this.hls=void 0,this.loaders={},this.decryptkey=null,this.decrypturl=null,this.hls=u,this._registerListeners()}var v=y.prototype;return v._registerListeners=function(){this.hls.on(R.Events.KEY_LOADING,this.onKeyLoading,this)},v._unregisterListeners=function(){this.hls.off(R.Events.KEY_LOADING,this.onKeyLoading)},v.destroy=function(){this._unregisterListeners();for(var a in this.loaders){var c=this.loaders[a];c&&c.destroy()}this.loaders={}},v.onKeyLoading=function(a,c){var s=c.frag,l=s.type,r=this.loaders[l];if(!s.decryptdata){d.logger.warn("Missing decryption data on fragment in onKeyLoading");return}var n=s.decryptdata.uri;if(n!==this.decrypturl||this.decryptkey===null){var o=this.hls.config;if(r&&(d.logger.warn("abort previous key loader for type:"+l),r.abort()),!n){d.logger.warn("key uri is falsy");return}var i=o.loader,f=s.loader=this.loaders[l]=new i(o);this.decrypturl=n,this.decryptkey=null;var h={url:n,frag:s,responseType:"arraybuffer"},T={timeout:o.fragLoadingTimeOut,maxRetry:0,retryDelay:o.fragLoadingRetryDelay,maxRetryDelay:o.fragLoadingMaxRetryTimeout,highWaterMark:0},g={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};f.load(h,T,g)}else this.decryptkey&&(s.decryptdata.key=this.decryptkey,this.hls.trigger(R.Events.KEY_LOADED,{frag:s}))},v.loadsuccess=function(a,c,s){var l=s.frag;if(!l.decryptdata){d.logger.error("after key load, decryptdata unset");return}this.decryptkey=l.decryptdata.key=new Uint8Array(a.data),l.loader=null,delete this.loaders[l.type],this.hls.trigger(R.Events.KEY_LOADED,{frag:l})},v.loaderror=function(a,c){var s=c.frag,l=s.loader;l&&l.abort(),delete this.loaders[s.type],this.hls.trigger(R.Events.ERROR,{type:O.ErrorTypes.NETWORK_ERROR,details:O.ErrorDetails.KEY_LOAD_ERROR,fatal:!1,frag:s,response:a})},v.loadtimeout=function(a,c){var s=c.frag,l=s.loader;l&&l.abort(),delete this.loaders[s.type],this.hls.trigger(R.Events.ERROR,{type:O.ErrorTypes.NETWORK_ERROR,details:O.ErrorDetails.KEY_LOAD_TIMEOUT,fatal:!1,frag:s})},y}()},"./src/loader/level-details.ts":function(j,k,D){"use strict";D.r(k),D.d(k,"LevelDetails",function(){return y});var R=D("./src/polyfills/number.ts");function O(v,u){for(var a=0;a<u.length;a++){var c=u[a];c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(v,c.key,c)}}function d(v,u,a){return u&&O(v.prototype,u),a&&O(v,a),v}var E=10,y=function(){function v(a){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=a}var u=v.prototype;return u.reloaded=function(c){if(!c){this.advanced=!0,this.updated=!0;return}var s=this.lastPartSn-c.lastPartSn,l=this.lastPartIndex-c.lastPartIndex;this.updated=this.endSN!==c.endSN||!!l||!!s,this.advanced=this.endSN>c.endSN||s>0||s===0&&l>0,this.updated||this.advanced?this.misses=Math.floor(c.misses*.6):this.misses=c.misses+1,this.availabilityDelay=c.availabilityDelay},d(v,[{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 c=this.driftEndTime-this.driftStartTime;if(c>0){var s=this.driftEnd-this.driftStart;return s*1e3/c}return 1}},{key:"edge",get:function(){return this.partEnd||this.fragmentEnd}},{key:"partEnd",get:function(){var c;return(c=this.partList)!==null&&c!==void 0&&c.length?this.partList[this.partList.length-1].end:this.fragmentEnd}},{key:"fragmentEnd",get:function(){var c;return(c=this.fragments)!==null&&c!==void 0&&c.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 c;return(c=this.partList)!==null&&c!==void 0&&c.length?this.partList[this.partList.length-1].index:-1}},{key:"lastPartSn",get:function(){var c;return(c=this.partList)!==null&&c!==void 0&&c.length?this.partList[this.partList.length-1].fragment.sn:this.endSN}}]),v}()},"./src/loader/level-key.ts":function(j,k,D){"use strict";D.r(k),D.d(k,"LevelKey",function(){return y});var R=D("./node_modules/url-toolkit/src/url-toolkit.js"),O=D.n(R);function d(v,u){for(var a=0;a<u.length;a++){var c=u[a];c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(v,c.key,c)}}function E(v,u,a){return u&&d(v.prototype,u),a&&d(v,a),v}var y=function(){v.fromURL=function(a,c){return new v(a,c)},v.fromURI=function(a){return new v(a)};function v(u,a){this._uri=null,this.method=null,this.keyFormat=null,this.keyFormatVersions=null,this.keyID=null,this.key=null,this.iv=null,a?this._uri=Object(R.buildAbsoluteURL)(u,a,{alwaysNormalize:!0}):this._uri=u}return E(v,[{key:"uri",get:function(){return this._uri}}]),v}()},"./src/loader/load-stats.ts":function(j,k,D){"use strict";D.r(k),D.d(k,"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(j,k,D){"use strict";D.r(k),D.d(k,"default",function(){return f});var R=D("./src/polyfills/number.ts"),O=D("./node_modules/url-toolkit/src/url-toolkit.js"),d=D.n(O),E=D("./src/loader/fragment.ts"),y=D("./src/loader/level-details.ts"),v=D("./src/loader/level-key.ts"),u=D("./src/utils/attr-list.ts"),a=D("./src/utils/logger.ts"),c=D("./src/utils/codecs.ts"),s=/#EXT-X-STREAM-INF:([^\r\n]*)(?:[\r\n](?:#[^\r\n]*)?)*([^\r\n]+)|#EXT-X-SESSION-DATA:([^\r\n]*)[\r\n]+/g,l=/#EXT-X-MEDIA:(.*)/g,r=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/(?!#) *(\S[\S ]*)/.source,/#EXT-X-BYTERANGE:*(.+)/.source,/#EXT-X-PROGRAM-DATE-TIME:(.+)/.source,/#.*/.source].join("|"),"g"),n=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("|")),o=/\.(mp4|m4s|m4v|m4a)$/i;function i(C){var x,b;return o.test((x=(b=O.parseURL(C))===null||b===void 0?void 0:b.path)!=null?x:"")}var f=function(){function C(){}return C.findGroup=function(b,S){for(var A=0;A<b.length;A++){var p=b[A];if(p.id===S)return p}},C.convertAVC1ToAVCOTI=function(b){var S=b.split(".");if(S.length>2){var A=S.shift()+".";return A+=parseInt(S.shift()).toString(16),A+=("000"+parseInt(S.shift()).toString(16)).substr(-4),A}return b},C.resolve=function(b,S){return O.buildAbsoluteURL(S,b,{alwaysNormalize:!0})},C.parseMasterPlaylist=function(b,S){var A=[],p={},I=!1;s.lastIndex=0;for(var M;(M=s.exec(b))!=null;)if(M[1]){var P=new u.AttrList(M[1]),B={attrs:P,bitrate:P.decimalInteger("AVERAGE-BANDWIDTH")||P.decimalInteger("BANDWIDTH"),name:P.NAME,url:C.resolve(M[2],S)},H=P.decimalResolution("RESOLUTION");H&&(B.width=H.width,B.height=H.height),h((P.CODECS||"").split(/[ ,]+/).filter(function(W){return W}),B),B.videoCodec&&B.videoCodec.indexOf("avc1")!==-1&&(B.videoCodec=C.convertAVC1ToAVCOTI(B.videoCodec)),A.push(B)}else if(M[3]){var F=new u.AttrList(M[3]);F["DATA-ID"]&&(I=!0,p[F["DATA-ID"]]=F)}return{levels:A,sessionData:I?p:null}},C.parseMasterPlaylistMedia=function(b,S,A,p){p===void 0&&(p=[]);var I,M=[],P=0;for(l.lastIndex=0;(I=l.exec(b))!==null;){var B=new u.AttrList(I[1]);if(B.TYPE===A){var H={attrs:B,bitrate:0,id:P++,groupId:B["GROUP-ID"],instreamId:B["INSTREAM-ID"],name:B.NAME||B.LANGUAGE||"",type:A,default:B.bool("DEFAULT"),autoselect:B.bool("AUTOSELECT"),forced:B.bool("FORCED"),lang:B.LANGUAGE,url:B.URI?C.resolve(B.URI,S):""};if(p.length){var F=C.findGroup(p,H.groupId)||p[0];T(H,F,"audioCodec"),T(H,F,"textCodec")}M.push(H)}}return M},C.parseLevelPlaylist=function(b,S,A,p,I){var M=new y.LevelDetails(S),P=M.fragments,B=null,H=0,F=0,W=0,U=0,K=null,G=new E.Fragment(p,S),ae,fe,Se,Ue=-1,Ne=!1;for(r.lastIndex=0,M.m3u8=b;(ae=r.exec(b))!==null;){Ne&&(Ne=!1,G=new E.Fragment(p,S),G.start=W,G.sn=H,G.cc=U,G.level=A,B&&(G.initSegment=B,G.rawProgramDateTime=B.rawProgramDateTime));var xe=ae[1];if(xe){G.duration=parseFloat(xe);var Ce=(" "+ae[2]).slice(1);G.title=Ce||null,G.tagList.push(Ce?["INF",xe,Ce]:["INF",xe])}else if(ae[3])Object(R.isFiniteNumber)(G.duration)&&(G.start=W,Se&&(G.levelkey=Se),G.sn=H,G.level=A,G.cc=U,G.urlId=I,P.push(G),G.relurl=(" "+ae[3]).slice(1),w(G,K),K=G,W+=G.duration,H++,F=0,Ne=!0);else if(ae[4]){var De=(" "+ae[4]).slice(1);K?G.setByteRange(De,K):G.setByteRange(De)}else if(ae[5])G.rawProgramDateTime=(" "+ae[5]).slice(1),G.tagList.push(["PROGRAM-DATE-TIME",G.rawProgramDateTime]),Ue===-1&&(Ue=P.length);else{if(ae=ae[0].match(n),!ae){a.logger.warn("No matches on slow regex match for level playlist!");continue}for(fe=1;fe<ae.length&&!(typeof ae[fe]!="undefined");fe++);var ve=(" "+ae[fe]).slice(1),Re=(" "+ae[fe+1]).slice(1),ee=ae[fe+2]?(" "+ae[fe+2]).slice(1):"";switch(ve){case"PLAYLIST-TYPE":M.type=Re.toUpperCase();break;case"MEDIA-SEQUENCE":H=M.startSN=parseInt(Re);break;case"SKIP":{var ge=new u.AttrList(Re),se=ge.decimalInteger("SKIPPED-SEGMENTS");if(Object(R.isFiniteNumber)(se)){M.skippedSegments=se;for(var Fe=se;Fe--;)P.unshift(null);H+=se}var je=ge.enumeratedString("RECENTLY-REMOVED-DATERANGES");je&&(M.recentlyRemovedDateranges=je.split(" "));break}case"TARGETDURATION":M.targetduration=parseFloat(Re);break;case"VERSION":M.version=parseInt(Re);break;case"EXTM3U":break;case"ENDLIST":M.live=!1;break;case"#":(Re||ee)&&G.tagList.push(ee?[Re,ee]:[Re]);break;case"DIS":U++;case"GAP":G.tagList.push([ve]);break;case"BITRATE":G.tagList.push([ve,Re]);break;case"DISCONTINUITY-SEQ":U=parseInt(Re);break;case"KEY":{var Ke,ze=new u.AttrList(Re),Ge=ze.enumeratedString("METHOD"),He=ze.URI,Ie=ze.hexadecimalInteger("IV"),ke=ze.enumeratedString("KEYFORMATVERSIONS"),Ae=ze.enumeratedString("KEYID"),Te=(Ke=ze.enumeratedString("KEYFORMAT"))!=null?Ke:"identity",Z=["com.apple.streamingkeydelivery","com.microsoft.playready","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed","com.widevine"];if(Z.indexOf(Te)>-1){a.logger.warn("Keyformat "+Te+" is not supported from the manifest");continue}else if(Te!=="identity")continue;Ge&&(Se=v.LevelKey.fromURL(S,He),He&&["AES-128","SAMPLE-AES","SAMPLE-AES-CENC"].indexOf(Ge)>=0&&(Se.method=Ge,Se.keyFormat=Te,Ae&&(Se.keyID=Ae),ke&&(Se.keyFormatVersions=ke),Se.iv=Ie));break}case"START":{var ce=new u.AttrList(Re),J=ce.decimalFloatingPoint("TIME-OFFSET");Object(R.isFiniteNumber)(J)&&(M.startTimeOffset=J);break}case"MAP":{var Le=new u.AttrList(Re);G.relurl=Le.URI,Le.BYTERANGE&&G.setByteRange(Le.BYTERANGE),G.level=A,G.sn="initSegment",Se&&(G.levelkey=Se),G.initSegment=null,B=G,Ne=!0;break}case"SERVER-CONTROL":{var We=new u.AttrList(Re);M.canBlockReload=We.bool("CAN-BLOCK-RELOAD"),M.canSkipUntil=We.optionalFloat("CAN-SKIP-UNTIL",0),M.canSkipDateRanges=M.canSkipUntil>0&&We.bool("CAN-SKIP-DATERANGES"),M.partHoldBack=We.optionalFloat("PART-HOLD-BACK",0),M.holdBack=We.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{var Ve=new u.AttrList(Re);M.partTarget=Ve.decimalFloatingPoint("PART-TARGET");break}case"PART":{var Me=M.partList;Me||(Me=M.partList=[]);var et=F>0?Me[Me.length-1]:void 0,ne=F++,Ee=new E.Part(new u.AttrList(Re),G,S,ne,et);Me.push(Ee),G.duration+=Ee.duration;break}case"PRELOAD-HINT":{var Oe=new u.AttrList(Re);M.preloadHint=Oe;break}case"RENDITION-REPORT":{var me=new u.AttrList(Re);M.renditionReports=M.renditionReports||[],M.renditionReports.push(me);break}default:a.logger.warn("line parsed but not handled: "+ae);break}}}K&&!K.relurl?(P.pop(),W-=K.duration,M.partList&&(M.fragmentHint=K)):M.partList&&(w(G,K),G.cc=U,M.fragmentHint=G);var ue=P.length,he=P[0],Y=P[ue-1];if(W+=M.skippedSegments*M.targetduration,W>0&&ue&&Y){M.averagetargetduration=W/ue;var $=Y.sn;M.endSN=$!=="initSegment"?$:0,he&&(M.startCC=he.cc,he.initSegment||M.fragments.every(function(z){return z.relurl&&i(z.relurl)})&&(a.logger.warn("MP4 fragments found but no init segment (probably no MAP, incomplete M3U8), trying to fetch SIDX"),G=new E.Fragment(p,S),G.relurl=Y.relurl,G.level=A,G.sn="initSegment",he.initSegment=G,M.needSidxRanges=!0))}else M.endSN=0,M.startCC=0;return M.fragmentHint&&(W+=M.fragmentHint.duration),M.totalduration=W,M.endCC=U,Ue>0&&g(P,Ue),M},C}();function h(C,x){["video","audio","text"].forEach(function(b){var S=C.filter(function(p){return Object(c.isCodecType)(p,b)});if(S.length){var A=S.filter(function(p){return p.lastIndexOf("avc1",0)===0||p.lastIndexOf("mp4a",0)===0});x[b+"Codec"]=A.length>0?A[0]:S[0],C=C.filter(function(p){return S.indexOf(p)===-1})}}),x.unknownCodecs=C}function T(C,x,b){var S=x[b];S&&(C[b]=S)}function g(C,x){for(var b=C[x],S=x;S--;){var A=C[S];if(!A)return;A.programDateTime=b.programDateTime-A.duration*1e3,b=A}}function w(C,x){C.rawProgramDateTime?C.programDateTime=Date.parse(C.rawProgramDateTime):x!=null&&x.programDateTime&&(C.programDateTime=x.endProgramDateTime),Object(R.isFiniteNumber)(C.programDateTime)||(C.programDateTime=null,C.rawProgramDateTime=null)}},"./src/loader/playlist-loader.ts":function(j,k,D){"use strict";D.r(k);var R=D("./src/polyfills/number.ts"),O=D("./src/events.ts"),d=D("./src/errors.ts"),E=D("./src/utils/logger.ts"),y=D("./src/utils/mp4-tools.ts"),v=D("./src/loader/m3u8-parser.ts"),u=D("./src/types/loader.ts"),a=D("./src/utils/attr-list.ts");function c(r){var n=r.type;switch(n){case u.PlaylistContextType.AUDIO_TRACK:return u.PlaylistLevelType.AUDIO;case u.PlaylistContextType.SUBTITLE_TRACK:return u.PlaylistLevelType.SUBTITLE;default:return u.PlaylistLevelType.MAIN}}function s(r,n){var o=r.url;return(o===void 0||o.indexOf("data:")===0)&&(o=n.url),o}var l=function(){function r(o){this.hls=void 0,this.loaders=Object.create(null),this.hls=o,this.registerListeners()}var n=r.prototype;return n.registerListeners=function(){var i=this.hls;i.on(O.Events.MANIFEST_LOADING,this.onManifestLoading,this),i.on(O.Events.LEVEL_LOADING,this.onLevelLoading,this),i.on(O.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),i.on(O.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},n.unregisterListeners=function(){var i=this.hls;i.off(O.Events.MANIFEST_LOADING,this.onManifestLoading,this),i.off(O.Events.LEVEL_LOADING,this.onLevelLoading,this),i.off(O.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),i.off(O.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},n.createInternalLoader=function(i){var f=this.hls.config,h=f.pLoader,T=f.loader,g=h||T,w=new g(f);return i.loader=w,this.loaders[i.type]=w,w},n.getInternalLoader=function(i){return this.loaders[i.type]},n.resetInternalLoader=function(i){this.loaders[i]&&delete this.loaders[i]},n.destroyInternalLoaders=function(){for(var i in this.loaders){var f=this.loaders[i];f&&f.destroy(),this.resetInternalLoader(i)}},n.destroy=function(){this.unregisterListeners(),this.destroyInternalLoaders()},n.onManifestLoading=function(i,f){var h=f.url;this.load({id:null,groupId:null,level:0,responseType:"text",type:u.PlaylistContextType.MANIFEST,url:h,deliveryDirectives:null})},n.onLevelLoading=function(i,f){var h=f.id,T=f.level,g=f.url,w=f.deliveryDirectives;this.load({id:h,groupId:null,level:T,responseType:"text",type:u.PlaylistContextType.LEVEL,url:g,deliveryDirectives:w})},n.onAudioTrackLoading=function(i,f){var h=f.id,T=f.groupId,g=f.url,w=f.deliveryDirectives;this.load({id:h,groupId:T,level:null,responseType:"text",type:u.PlaylistContextType.AUDIO_TRACK,url:g,deliveryDirectives:w})},n.onSubtitleTrackLoading=function(i,f){var h=f.id,T=f.groupId,g=f.url,w=f.deliveryDirectives;this.load({id:h,groupId:T,level:null,responseType:"text",type:u.PlaylistContextType.SUBTITLE_TRACK,url:g,deliveryDirectives:w})},n.load=function(i){var f,h=this.hls.config,T=this.getInternalLoader(i);if(T){var g=T.context;if(g&&g.url===i.url){E.logger.trace("[playlist-loader]: playlist request ongoing");return}E.logger.log("[playlist-loader]: aborting previous loader for type: "+i.type),T.abort()}var w,C,x,b;switch(i.type){case u.PlaylistContextType.MANIFEST:w=h.manifestLoadingMaxRetry,C=h.manifestLoadingTimeOut,x=h.manifestLoadingRetryDelay,b=h.manifestLoadingMaxRetryTimeout;break;case u.PlaylistContextType.LEVEL:case u.PlaylistContextType.AUDIO_TRACK:case u.PlaylistContextType.SUBTITLE_TRACK:w=0,C=h.levelLoadingTimeOut;break;default:w=h.levelLoadingMaxRetry,C=h.levelLoadingTimeOut,x=h.levelLoadingRetryDelay,b=h.levelLoadingMaxRetryTimeout;break}if(T=this.createInternalLoader(i),(f=i.deliveryDirectives)!==null&&f!==void 0&&f.part){var S;if(i.type===u.PlaylistContextType.LEVEL&&i.level!==null?S=this.hls.levels[i.level].details:i.type===u.PlaylistContextType.AUDIO_TRACK&&i.id!==null?S=this.hls.audioTracks[i.id].details:i.type===u.PlaylistContextType.SUBTITLE_TRACK&&i.id!==null&&(S=this.hls.subtitleTracks[i.id].details),S){var A=S.partTarget,p=S.targetduration;A&&p&&(C=Math.min(Math.max(A*3,p*.8)*1e3,C))}}var I={timeout:C,maxRetry:w,retryDelay:x,maxRetryDelay:b,highWaterMark:0},M={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};T.load(i,I,M)},n.loadsuccess=function(i,f,h,T){if(T===void 0&&(T=null),h.isSidxRequest){this.handleSidxRequest(i,h),this.handlePlaylistLoaded(i,f,h,T);return}this.resetInternalLoader(h.type);var g=i.data;if(g.indexOf("#EXTM3U")!==0){this.handleManifestParsingError(i,h,"no EXTM3U delimiter",T);return}f.parsing.start=performance.now(),g.indexOf("#EXTINF:")>0||g.indexOf("#EXT-X-TARGETDURATION:")>0?this.handleTrackOrLevelPlaylist(i,f,h,T):this.handleMasterPlaylist(i,f,h,T)},n.loaderror=function(i,f,h){h===void 0&&(h=null),this.handleNetworkError(f,h,!1,i)},n.loadtimeout=function(i,f,h){h===void 0&&(h=null),this.handleNetworkError(f,h,!0)},n.handleMasterPlaylist=function(i,f,h,T){var g=this.hls,w=i.data,C=s(i,h),x=v.default.parseMasterPlaylist(w,C),b=x.levels,S=x.sessionData;if(!b.length){this.handleManifestParsingError(i,h,"no level found in manifest",T);return}var A=b.map(function(H){return{id:H.attrs.AUDIO,audioCodec:H.audioCodec}}),p=b.map(function(H){return{id:H.attrs.SUBTITLES,textCodec:H.textCodec}}),I=v.default.parseMasterPlaylistMedia(w,C,"AUDIO",A),M=v.default.parseMasterPlaylistMedia(w,C,"SUBTITLES",p),P=v.default.parseMasterPlaylistMedia(w,C,"CLOSED-CAPTIONS");if(I.length){var B=I.some(function(H){return!H.url});!B&&b[0].audioCodec&&!b[0].attrs.AUDIO&&(E.logger.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),I.unshift({type:"main",name:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new a.AttrList({}),bitrate:0,url:""}))}g.trigger(O.Events.MANIFEST_LOADED,{levels:b,audioTracks:I,subtitles:M,captions:P,url:C,stats:f,networkDetails:T,sessionData:S})},n.handleTrackOrLevelPlaylist=function(i,f,h,T){var g=this.hls,w=h.id,C=h.level,x=h.type,b=s(i,h),S=Object(R.isFiniteNumber)(w)?w:0,A=Object(R.isFiniteNumber)(C)?C:S,p=c(h),I=v.default.parseLevelPlaylist(i.data,b,A,p,S);if(!I.fragments.length){g.trigger(O.Events.ERROR,{type:d.ErrorTypes.NETWORK_ERROR,details:d.ErrorDetails.LEVEL_EMPTY_ERROR,fatal:!1,url:b,reason:"no fragments found in level",level:typeof h.level=="number"?h.level:void 0});return}if(x===u.PlaylistContextType.MANIFEST){var M={attrs:new a.AttrList({}),bitrate:0,details:I,name:"",url:b};g.trigger(O.Events.MANIFEST_LOADED,{levels:[M],audioTracks:[],url:b,stats:f,networkDetails:T,sessionData:null})}if(f.parsing.end=performance.now(),I.needSidxRanges){var P,B=(P=I.fragments[0].initSegment)===null||P===void 0?void 0:P.url;this.load({url:B,isSidxRequest:!0,type:x,level:C,levelDetails:I,id:w,groupId:null,rangeStart:0,rangeEnd:2048,responseType:"arraybuffer",deliveryDirectives:null});return}h.levelDetails=I,this.handlePlaylistLoaded(i,f,h,T)},n.handleSidxRequest=function(i,f){var h=Object(y.parseSegmentIndex)(new Uint8Array(i.data));if(!h)return;var T=h.references,g=f.levelDetails;T.forEach(function(w,C){var x=w.info,b=g.fragments[C];b.byteRange.length===0&&b.setByteRange(String(1+x.end-x.start)+"@"+String(x.start)),b.initSegment&&b.initSegment.setByteRange(String(h.moovEndOffset)+"@0")})},n.handleManifestParsingError=function(i,f,h,T){this.hls.trigger(O.Events.ERROR,{type:d.ErrorTypes.NETWORK_ERROR,details:d.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:f.type===u.PlaylistContextType.MANIFEST,url:i.url,reason:h,response:i,context:f,networkDetails:T})},n.handleNetworkError=function(i,f,h,T){h===void 0&&(h=!1),E.logger.warn("[playlist-loader]: A network "+(h?"timeout":"error")+" occurred while loading "+i.type+" level: "+i.level+" id: "+i.id+' group-id: "'+i.groupId+'"');var g=d.ErrorDetails.UNKNOWN,w=!1,C=this.getInternalLoader(i);switch(i.type){case u.PlaylistContextType.MANIFEST:g=h?d.ErrorDetails.MANIFEST_LOAD_TIMEOUT:d.ErrorDetails.MANIFEST_LOAD_ERROR,w=!0;break;case u.PlaylistContextType.LEVEL:g=h?d.ErrorDetails.LEVEL_LOAD_TIMEOUT:d.ErrorDetails.LEVEL_LOAD_ERROR,w=!1;break;case u.PlaylistContextType.AUDIO_TRACK:g=h?d.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:d.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,w=!1;break;case u.PlaylistContextType.SUBTITLE_TRACK:g=h?d.ErrorDetails.SUBTITLE_TRACK_LOAD_TIMEOUT:d.ErrorDetails.SUBTITLE_LOAD_ERROR,w=!1;break}C&&this.resetInternalLoader(i.type);var x={type:d.ErrorTypes.NETWORK_ERROR,details:g,fatal:w,url:i.url,loader:C,context:i,networkDetails:f};T&&(x.response=T),this.hls.trigger(O.Events.ERROR,x)},n.handlePlaylistLoaded=function(i,f,h,T){var g=h.type,w=h.level,C=h.id,x=h.groupId,b=h.loader,S=h.levelDetails,A=h.deliveryDirectives;if(!(S!=null&&S.targetduration)){this.handleManifestParsingError(i,h,"invalid target duration",T);return}if(!b)return;S.live&&(b.getCacheAge&&(S.ageHeader=b.getCacheAge()||0),(!b.getCacheAge||isNaN(S.ageHeader))&&(S.ageHeader=0));switch(g){case u.PlaylistContextType.MANIFEST:case u.PlaylistContextType.LEVEL:this.hls.trigger(O.Events.LEVEL_LOADED,{details:S,level:w||0,id:C||0,stats:f,networkDetails:T,deliveryDirectives:A});break;case u.PlaylistContextType.AUDIO_TRACK:this.hls.trigger(O.Events.AUDIO_TRACK_LOADED,{details:S,id:C||0,groupId:x||"",stats:f,networkDetails:T,deliveryDirectives:A});break;case u.PlaylistContextType.SUBTITLE_TRACK:this.hls.trigger(O.Events.SUBTITLE_TRACK_LOADED,{details:S,id:C||0,groupId:x||"",stats:f,networkDetails:T,deliveryDirectives:A});break}},r}();k.default=l},"./src/polyfills/number.ts":function(j,k,D){"use strict";D.r(k),D.d(k,"isFiniteNumber",function(){return R}),D.d(k,"MAX_SAFE_INTEGER",function(){return O});var R=Number.isFinite||function(d){return typeof d=="number"&&isFinite(d)},O=Number.MAX_SAFE_INTEGER||9007199254740991},"./src/remux/aac-helper.ts":function(j,k,D){"use strict";D.r(k);var R=function(){function O(){}return O.getSilentFrame=function(E,y){switch(E){case"mp4a.40.2":if(y===1)return new Uint8Array([0,200,0,128,35,128]);if(y===2)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(y===3)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(y===4)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(y===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(y===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(y===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(y===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(y===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},O}();k.default=R},"./src/remux/mp4-generator.ts":function(j,k,D){"use strict";D.r(k);var R=Math.pow(2,32)-1,O=function(){function d(){}return d.init=function(){d.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 y;for(y in d.types)d.types.hasOwnProperty(y)&&(d.types[y]=[y.charCodeAt(0),y.charCodeAt(1),y.charCodeAt(2),y.charCodeAt(3)]);var v=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]),u=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]);d.HDLR_TYPES={video:v,audio:u};var a=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),c=new Uint8Array([0,0,0,0,0,0,0,0]);d.STTS=d.STSC=d.STCO=c,d.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),d.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),d.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),d.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);var s=new Uint8Array([105,115,111,109]),l=new Uint8Array([97,118,99,49]),r=new Uint8Array([0,0,0,1]);d.FTYP=d.box(d.types.ftyp,s,r,s,l),d.DINF=d.box(d.types.dinf,d.box(d.types.dref,a))},d.box=function(y){for(var v=8,u=arguments.length,a=new Array(u>1?u-1:0),c=1;c<u;c++)a[c-1]=arguments[c];for(var s=a.length,l=s;s--;)v+=a[s].byteLength;var r=new Uint8Array(v);for(r[0]=v>>24&255,r[1]=v>>16&255,r[2]=v>>8&255,r[3]=v&255,r.set(y,4),s=0,v=8;s<l;s++)r.set(a[s],v),v+=a[s].byteLength;return r},d.hdlr=function(y){return d.box(d.types.hdlr,d.HDLR_TYPES[y])},d.mdat=function(y){return d.box(d.types.mdat,y)},d.mdhd=function(y,v){v*=y;var u=Math.floor(v/(R+1)),a=Math.floor(v%(R+1));return d.box(d.types.mdhd,new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,y>>24&255,y>>16&255,y>>8&255,y&255,u>>24,u>>16&255,u>>8&255,u&255,a>>24,a>>16&255,a>>8&255,a&255,85,196,0,0]))},d.mdia=function(y){return d.box(d.types.mdia,d.mdhd(y.timescale,y.duration),d.hdlr(y.type),d.minf(y))},d.mfhd=function(y){return d.box(d.types.mfhd,new Uint8Array([0,0,0,0,y>>24,y>>16&255,y>>8&255,y&255]))},d.minf=function(y){return y.type==="audio"?d.box(d.types.minf,d.box(d.types.smhd,d.SMHD),d.DINF,d.stbl(y)):d.box(d.types.minf,d.box(d.types.vmhd,d.VMHD),d.DINF,d.stbl(y))},d.moof=function(y,v,u){return d.box(d.types.moof,d.mfhd(y),d.traf(u,v))},d.moov=function(y){for(var v=y.length,u=[];v--;)u[v]=d.trak(y[v]);return d.box.apply(null,[d.types.moov,d.mvhd(y[0].timescale,y[0].duration)].concat(u).concat(d.mvex(y)))},d.mvex=function(y){for(var v=y.length,u=[];v--;)u[v]=d.trex(y[v]);return d.box.apply(null,[d.types.mvex].concat(u))},d.mvhd=function(y,v){v*=y;var u=Math.floor(v/(R+1)),a=Math.floor(v%(R+1)),c=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,y>>24&255,y>>16&255,y>>8&255,y&255,u>>24,u>>16&255,u>>8&255,u&255,a>>24,a>>16&255,a>>8&255,a&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 d.box(d.types.mvhd,c)},d.sdtp=function(y){var v=y.samples||[],u=new Uint8Array(4+v.length),a,c;for(a=0;a<v.length;a++)c=v[a].flags,u[a+4]=c.dependsOn<<4|c.isDependedOn<<2|c.hasRedundancy;return d.box(d.types.sdtp,u)},d.stbl=function(y){return d.box(d.types.stbl,d.stsd(y),d.box(d.types.stts,d.STTS),d.box(d.types.stsc,d.STSC),d.box(d.types.stsz,d.STSZ),d.box(d.types.stco,d.STCO))},d.avc1=function(y){var v=[],u=[],a,c,s;for(a=0;a<y.sps.length;a++)c=y.sps[a],s=c.byteLength,v.push(s>>>8&255),v.push(s&255),v=v.concat(Array.prototype.slice.call(c));for(a=0;a<y.pps.length;a++)c=y.pps[a],s=c.byteLength,u.push(s>>>8&255),u.push(s&255),u=u.concat(Array.prototype.slice.call(c));var l=d.box(d.types.avcC,new Uint8Array([1,v[3],v[4],v[5],252|3,224|y.sps.length].concat(v).concat([y.pps.length]).concat(u))),r=y.width,n=y.height,o=y.pixelRatio[0],i=y.pixelRatio[1];return d.box(d.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,r>>8&255,r&255,n>>8&255,n&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]),l,d.box(d.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),d.box(d.types.pasp,new Uint8Array([o>>24,o>>16&255,o>>8&255,o&255,i>>24,i>>16&255,i>>8&255,i&255])))},d.esds=function(y){var v=y.config.length;return new Uint8Array([0,0,0,0,3,23+v,0,1,0,4,15+v,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([v]).concat(y.config).concat([6,1,2]))},d.mp4a=function(y){var v=y.samplerate;return d.box(d.types.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,y.channelCount,0,16,0,0,0,0,v>>8&255,v&255,0,0]),d.box(d.types.esds,d.esds(y)))},d.mp3=function(y){var v=y.samplerate;return d.box(d.types[".mp3"],new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,y.channelCount,0,16,0,0,0,0,v>>8&255,v&255,0,0]))},d.stsd=function(y){return y.type==="audio"?!y.isAAC&&y.codec==="mp3"?d.box(d.types.stsd,d.STSD,d.mp3(y)):d.box(d.types.stsd,d.STSD,d.mp4a(y)):d.box(d.types.stsd,d.STSD,d.avc1(y))},d.tkhd=function(y){var v=y.id,u=y.duration*y.timescale,a=y.width,c=y.height,s=Math.floor(u/(R+1)),l=Math.floor(u%(R+1));return d.box(d.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,v>>24&255,v>>16&255,v>>8&255,v&255,0,0,0,0,s>>24,s>>16&255,s>>8&255,s&255,l>>24,l>>16&255,l>>8&255,l&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,a>>8&255,a&255,0,0,c>>8&255,c&255,0,0]))},d.traf=function(y,v){var u=d.sdtp(y),a=y.id,c=Math.floor(v/(R+1)),s=Math.floor(v%(R+1));return d.box(d.types.traf,d.box(d.types.tfhd,new Uint8Array([0,0,0,0,a>>24,a>>16&255,a>>8&255,a&255])),d.box(d.types.tfdt,new Uint8Array([1,0,0,0,c>>24,c>>16&255,c>>8&255,c&255,s>>24,s>>16&255,s>>8&255,s&255])),d.trun(y,u.length+16+20+8+16+8+8),u)},d.trak=function(y){return y.duration=y.duration||4294967295,d.box(d.types.trak,d.tkhd(y),d.mdia(y))},d.trex=function(y){var v=y.id;return d.box(d.types.trex,new Uint8Array([0,0,0,0,v>>24,v>>16&255,v>>8&255,v&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))},d.trun=function(y,v){var u=y.samples||[],a=u.length,c=12+16*a,s=new Uint8Array(c),l,r,n,o,i,f;for(v+=8+c,s.set([0,0,15,1,a>>>24&255,a>>>16&255,a>>>8&255,a&255,v>>>24&255,v>>>16&255,v>>>8&255,v&255],0),l=0;l<a;l++)r=u[l],n=r.duration,o=r.size,i=r.flags,f=r.cts,s.set([n>>>24&255,n>>>16&255,n>>>8&255,n&255,o>>>24&255,o>>>16&255,o>>>8&255,o&255,i.isLeading<<2|i.dependsOn,i.isDependedOn<<6|i.hasRedundancy<<4|i.paddingValue<<1|i.isNonSync,i.degradPrio&240<<8,i.degradPrio&15,f>>>24&255,f>>>16&255,f>>>8&255,f&255],12+16*l);return d.box(d.types.trun,s)},d.initSegment=function(y){d.types||d.init();var v=d.moov(y),u=new Uint8Array(d.FTYP.byteLength+v.byteLength);return u.set(d.FTYP),u.set(v,d.FTYP.byteLength),u},d}();O.types=void 0,O.HDLR_TYPES=void 0,O.STTS=void 0,O.STSC=void 0,O.STCO=void 0,O.STSZ=void 0,O.VMHD=void 0,O.SMHD=void 0,O.STSD=void 0,O.FTYP=void 0,O.DINF=void 0,k.default=O},"./src/remux/mp4-remuxer.ts":function(j,k,D){"use strict";D.r(k),D.d(k,"default",function(){return f}),D.d(k,"normalizePts",function(){return h});var R=D("./src/polyfills/number.ts"),O=D("./src/remux/aac-helper.ts"),d=D("./src/remux/mp4-generator.ts"),E=D("./src/events.ts"),y=D("./src/errors.ts"),v=D("./src/utils/logger.ts"),u=D("./src/types/loader.ts"),a=D("./src/utils/timescale-conversion.ts");function c(){return c=Object.assign||function(C){for(var x=1;x<arguments.length;x++){var b=arguments[x];for(var S in b)Object.prototype.hasOwnProperty.call(b,S)&&(C[S]=b[S])}return C},c.apply(this,arguments)}var s=10*1e3,l=1024,r=1152,n=null,o=null,i=!1,f=function(){function C(b,S,A,p){if(p===void 0&&(p=""),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=b,this.config=S,this.typeSupported=A,this.ISGenerated=!1,n===null){var I=navigator.userAgent||"",M=I.match(/Chrome\/(\d+)/i);n=M?parseInt(M[1]):0}if(o===null){var P=navigator.userAgent.match(/Safari\/(\d+)/i);o=P?parseInt(P[1]):0}i=!!n&&n<75||!!o&&o<600}var x=C.prototype;return x.destroy=function(){},x.resetTimeStamp=function(S){v.logger.log("[mp4-remuxer]: initPTS & initDTS reset"),this._initPTS=this._initDTS=S},x.resetNextTimestamp=function(){v.logger.log("[mp4-remuxer]: reset next timestamp"),this.isVideoContiguous=!1,this.isAudioContiguous=!1},x.resetInitSegment=function(){v.logger.log("[mp4-remuxer]: ISGenerated flag reset"),this.ISGenerated=!1},x.getVideoStartPts=function(S){var A=!1,p=S.reduce(function(I,M){var P=M.pts-I;return P<-4294967296?(A=!0,h(I,M.pts)):P>0?I:M.pts},S[0].pts);return A&&v.logger.debug("PTS rollover detected"),p},x.remux=function(S,A,p,I,M,P,B,H){var F,W,U,K,G,ae,fe=M,Se=M,Ue=S.pid>-1,Ne=A.pid>-1,xe=A.samples.length,Ce=S.samples.length>0,De=xe>1,ve=(!Ue||Ce)&&(!Ne||De)||this.ISGenerated||B;if(ve){this.ISGenerated||(U=this.generateIS(S,A,M));var Re=this.isVideoContiguous,ee=-1;if(De&&(ee=T(A.samples),!Re&&this.config.forceKeyFrameOnDiscontinuity))if(ae=!0,ee>0){v.logger.warn("[mp4-remuxer]: Dropped "+ee+" out of "+xe+" video samples due to a missing keyframe");var ge=this.getVideoStartPts(A.samples);A.samples=A.samples.slice(ee),A.dropped+=ee,Se+=(A.samples[0].pts-ge)/(A.timescale||9e4)}else ee===-1&&(v.logger.warn("[mp4-remuxer]: No keyframe found out of "+xe+" video samples"),ae=!1);if(this.ISGenerated){if(Ce&&De){var se=this.getVideoStartPts(A.samples),Fe=h(S.samples[0].pts,se)-se,je=Fe/A.inputTimeScale;fe+=Math.max(0,je),Se+=Math.max(0,-je)}if(Ce){if(S.samplerate||(v.logger.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),U=this.generateIS(S,A,M)),W=this.remuxAudio(S,fe,this.isAudioContiguous,P,Ne||De||H===u.PlaylistLevelType.AUDIO?Se:void 0),De){var Ke=W?W.endPTS-W.startPTS:0;A.inputTimeScale||(v.logger.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),U=this.generateIS(S,A,M)),F=this.remuxVideo(A,Se,Re,Ke)}}else De&&(F=this.remuxVideo(A,Se,Re,0));F&&(F.firstKeyFrame=ee,F.independent=ee!==-1)}}return this.ISGenerated&&(p.samples.length&&(G=this.remuxID3(p,M)),I.samples.length&&(K=this.remuxText(I,M))),{audio:W,video:F,initSegment:U,independent:ae,text:K,id3:G}},x.generateIS=function(S,A,p){var I=S.samples,M=A.samples,P=this.typeSupported,B={},H=!Object(R.isFiniteNumber)(this._initPTS),F="audio/mp4",W,U,K;if(H&&(W=U=Infinity),S.config&&I.length&&(S.timescale=S.samplerate,S.isAAC||(P.mpeg?(F="audio/mpeg",S.codec=""):P.mp3&&(S.codec="mp3")),B.audio={id:"audio",container:F,codec:S.codec,initSegment:!S.isAAC&&P.mpeg?new Uint8Array(0):d.default.initSegment([S]),metadata:{channelCount:S.channelCount}},H&&(K=S.inputTimeScale,W=U=I[0].pts-Math.round(K*p))),A.sps&&A.pps&&M.length&&(A.timescale=A.inputTimeScale,B.video={id:"main",container:"video/mp4",codec:A.codec,initSegment:d.default.initSegment([A]),metadata:{width:A.width,height:A.height}},H)){K=A.inputTimeScale;var G=this.getVideoStartPts(M),ae=Math.round(K*p);U=Math.min(U,h(M[0].dts,G)-ae),W=Math.min(W,G-ae)}if(Object.keys(B).length)return this.ISGenerated=!0,H&&(this._initPTS=W,this._initDTS=U),{tracks:B,initPTS:W,timescale:K}},x.remuxVideo=function(S,A,p,I){var M=S.inputTimeScale,P=S.samples,B=[],H=P.length,F=this._initPTS,W=this.nextAvcDts,U=8,K,G,ae,fe=Number.POSITIVE_INFINITY,Se=Number.NEGATIVE_INFINITY,Ue=0,Ne=!1;if(!p||W===null){var xe=A*M,Ce=P[0].pts-h(P[0].dts,P[0].pts);W=xe-Ce}for(var De=0;De<H;De++){var ve=P[De];if(ve.pts=h(ve.pts-F,W),ve.dts=h(ve.dts-F,W),ve.dts>ve.pts){var Re=9e4*.2;Ue=Math.max(Math.min(Ue,ve.pts-ve.dts),-1*Re)}ve.dts<P[De>0?De-1:De].dts&&(Ne=!0)}Ne&&P.sort(function(Pe,$e){var Ye=Pe.dts-$e.dts,qe=Pe.pts-$e.pts;return Ye||qe}),G=P[0].dts,ae=P[P.length-1].dts;var ee=Math.round((ae-G)/(H-1));if(Ue<0){if(Ue<ee*-2){v.logger.warn("PTS < DTS detected in video samples, offsetting DTS from PTS by "+Object(a.toMsFromMpegTsClock)(-ee,!0)+" ms");for(var ge=Ue,se=0;se<H;se++)P[se].dts=ge=Math.max(ge,P[se].pts-ee),P[se].pts=Math.max(ge,P[se].pts)}else{v.logger.warn("PTS < DTS detected in video samples, shifting DTS by "+Object(a.toMsFromMpegTsClock)(Ue,!0)+" ms to overcome this issue");for(var Fe=0;Fe<H;Fe++)P[Fe].dts=P[Fe].dts+Ue}G=P[0].dts}if(p){var je=G-W,Ke=je>ee,ze=je<-1;if(Ke||ze){Ke?v.logger.warn("AVC: "+Object(a.toMsFromMpegTsClock)(je,!0)+" ms ("+je+"dts) hole between fragments detected, filling it"):v.logger.warn("AVC: "+Object(a.toMsFromMpegTsClock)(-je,!0)+" ms ("+je+"dts) overlapping between fragments detected"),G=W;var Ge=P[0].pts-je;P[0].dts=G,P[0].pts=Ge,v.logger.log("Video: First PTS/DTS adjusted: "+Object(a.toMsFromMpegTsClock)(Ge,!0)+"/"+Object(a.toMsFromMpegTsClock)(G,!0)+", delta: "+Object(a.toMsFromMpegTsClock)(je,!0)+" ms")}}i&&(G=Math.max(0,G));for(var He=0,Ie=0,ke=0;ke<H;ke++){for(var Ae=P[ke],Te=Ae.units,Z=Te.length,ce=0,J=0;J<Z;J++)ce+=Te[J].data.length;Ie+=ce,He+=Z,Ae.length=ce,Ae.dts=Math.max(Ae.dts,G),Ae.pts=Math.max(Ae.pts,Ae.dts,0),fe=Math.min(Ae.pts,fe),Se=Math.max(Ae.pts,Se)}ae=P[H-1].dts;var Le=Ie+4*He+8,We;try{We=new Uint8Array(Le)}catch(Pe){this.observer.emit(E.Events.ERROR,E.Events.ERROR,{type:y.ErrorTypes.MUX_ERROR,details:y.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:Le,reason:"fail allocating video mdat "+Le});return}var Ve=new DataView(We.buffer);Ve.setUint32(0,Le),We.set(d.default.types.mdat,4);for(var Me=0;Me<H;Me++){for(var et=P[Me],ne=et.units,Ee=0,Oe=0,me=ne.length;Oe<me;Oe++){var ue=ne[Oe],he=ue.data,Y=ue.data.byteLength;Ve.setUint32(U,Y),U+=4,We.set(he,U),U+=Y,Ee+=4+Y}if(Me<H-1)K=P[Me+1].dts-et.dts;else{var $=this.config,z=et.dts-P[Me>0?Me-1:Me].dts;if($.stretchShortVideoTrack&&this.nextAudioPts!==null){var oe=Math.floor($.maxBufferHole*M),_e=(I?fe+I*M:this.nextAudioPts)-et.pts;_e>oe?(K=_e-z,K<0&&(K=z),v.logger.log("[mp4-remuxer]: It is approximately "+_e/90+" ms to the next segment; using duration "+K/90+" ms for the last video frame.")):K=z}else K=z}var X=Math.round(et.pts-et.dts);B.push(new g(et.key,K,Ee,X))}if(B.length&&n&&n<70){var de=B[0].flags;de.dependsOn=2,de.isNonSync=0}console.assert(K!==void 0,"mp4SampleDuration must be computed"),this.nextAvcDts=W=ae+K,this.isVideoContiguous=!0;var ye=d.default.moof(S.sequenceNumber++,G,c({},S,{samples:B})),ie="video",pe={data1:ye,data2:We,startPTS:fe/M,endPTS:(Se+K)/M,startDTS:G/M,endDTS:W/M,type:ie,hasAudio:!1,hasVideo:!0,nb:B.length,dropped:S.dropped};return S.samples=[],S.dropped=0,console.assert(We.length,"MDAT length must not be zero"),pe},x.remuxAudio=function(S,A,p,I,M){var P=S.inputTimeScale,B=S.samplerate?S.samplerate:P,H=P/B,F=S.isAAC?l:r,W=F*H,U=this._initPTS,K=!S.isAAC&&this.typeSupported.mpeg,G=[],ae=S.samples,fe=K?0:8,Se=this.nextAudioPts||-1,Ue=A*P;if(this.isAudioContiguous=p=p||ae.length&&Se>0&&(I&&Math.abs(Ue-Se)<9e3||Math.abs(h(ae[0].pts-U,Ue)-Se)<20*W),ae.forEach(function(he){he.pts=h(he.pts-U,Ue)}),!p||Se<0){if(ae=ae.filter(function(he){return he.pts>=0}),!ae.length)return;M===0?Se=0:I?Se=Math.max(0,Ue):Se=ae[0].pts}if(S.isAAC)for(var Ne=M!==void 0,xe=this.config.maxAudioFramesDrift,Ce=0,De=Se;Ce<ae.length;Ce++){var ve=ae[Ce],Re=ve.pts,ee=Re-De,ge=Math.abs(1e3*ee/P);if(ee<=-xe*W&&Ne)Ce===0&&(v.logger.warn("Audio frame @ "+(Re/P).toFixed(3)+"s overlaps nextAudioPts by "+Math.round(1e3*ee/P)+" ms."),this.nextAudioPts=Se=De=Re);else if(ee>=xe*W&&ge<s&&Ne){var se=Math.round(ee/W);De=Re-se*W,De<0&&(se--,De+=W),Ce===0&&(this.nextAudioPts=Se=De),v.logger.warn("[mp4-remuxer]: Injecting "+se+" audio frame @ "+(De/P).toFixed(3)+"s due to "+Math.round(1e3*ee/P)+" ms gap.");for(var Fe=0;Fe<se;Fe++){var je=Math.max(De,0),Ke=O.default.getSilentFrame(S.manifestCodec||S.codec,S.channelCount);Ke||(v.logger.log("[mp4-remuxer]: Unable to get silent frame for given audio codec; duplicating last frame instead."),Ke=ve.unit.subarray()),ae.splice(Ce,0,{unit:Ke,pts:je}),De+=W,Ce++}}ve.pts=De,De+=W}for(var ze=null,Ge=null,He,Ie=0,ke=ae.length;ke--;)Ie+=ae[ke].unit.byteLength;for(var Ae=0,Te=ae.length;Ae<Te;Ae++){var Z=ae[Ae],ce=Z.unit,J=Z.pts;if(Ge!==null){var Le=G[Ae-1];Le.duration=Math.round((J-Ge)/H)}else if(p&&S.isAAC&&(J=Se),ze=J,Ie>0){Ie+=fe;try{He=new Uint8Array(Ie)}catch(he){this.observer.emit(E.Events.ERROR,E.Events.ERROR,{type:y.ErrorTypes.MUX_ERROR,details:y.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:Ie,reason:"fail allocating audio mdat "+Ie});return}if(!K){var We=new DataView(He.buffer);We.setUint32(0,Ie),He.set(d.default.types.mdat,4)}}else return;He.set(ce,fe);var Ve=ce.byteLength;fe+=Ve,G.push(new g(!0,F,Ve,0)),Ge=J}var Me=G.length;if(!Me)return;var et=G[G.length-1];this.nextAudioPts=Se=Ge+H*et.duration;var ne=K?new Uint8Array(0):d.default.moof(S.sequenceNumber++,ze/H,c({},S,{samples:G}));S.samples=[];var Ee=ze/P,Oe=Se/P,me="audio",ue={data1:ne,data2:He,startPTS:Ee,endPTS:Oe,startDTS:Ee,endDTS:Oe,type:me,hasAudio:!0,hasVideo:!1,nb:Me};return this.isAudioContiguous=!0,console.assert(He.length,"MDAT length must not be zero"),ue},x.remuxEmptyAudio=function(S,A,p,I){var M=S.inputTimeScale,P=S.samplerate?S.samplerate:M,B=M/P,H=this.nextAudioPts,F=(H!==null?H:I.startDTS*M)+this._initDTS,W=I.endDTS*M+this._initDTS,U=B*l,K=Math.ceil((W-F)/U),G=O.default.getSilentFrame(S.manifestCodec||S.codec,S.channelCount);if(v.logger.warn("[mp4-remuxer]: remux empty Audio"),!G){v.logger.trace("[mp4-remuxer]: Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec");return}for(var ae=[],fe=0;fe<K;fe++){var Se=F+fe*U;ae.push({unit:G,pts:Se,dts:Se})}return S.samples=ae,this.remuxAudio(S,A,p,!1)},x.remuxID3=function(S,A){var p=S.samples.length;if(!p)return;for(var I=S.inputTimeScale,M=this._initPTS,P=this._initDTS,B=0;B<p;B++){var H=S.samples[B];H.pts=h(H.pts-M,A*I)/I,H.dts=h(H.dts-P,A*I)/I}var F=S.samples;return S.samples=[],{samples:F}},x.remuxText=function(S,A){var p=S.samples.length;if(!p)return;for(var I=S.inputTimeScale,M=this._initPTS,P=0;P<p;P++){var B=S.samples[P];B.pts=h(B.pts-M,A*I)/I}S.samples.sort(function(F,W){return F.pts-W.pts});var H=S.samples;return S.samples=[],{samples:H}},C}();function h(C,x){var b;if(x===null)return C;for(x<C?b=-8589934592:b=8589934592;Math.abs(C-x)>4294967296;)C+=b;return C}function T(C){for(var x=0;x<C.length;x++)if(C[x].key)return x;return-1}var g=function(x,b,S,A){this.size=void 0,this.duration=void 0,this.cts=void 0,this.flags=void 0,this.duration=b,this.size=S,this.cts=A,this.flags=new w(x)},w=function(x){this.isLeading=0,this.isDependedOn=0,this.hasRedundancy=0,this.degradPrio=0,this.dependsOn=1,this.isNonSync=1,this.dependsOn=x?2:1,this.isNonSync=x?0:1}},"./src/remux/passthrough-remuxer.ts":function(j,k,D){"use strict";D.r(k);var R=D("./src/polyfills/number.ts"),O=D("./src/utils/mp4-tools.ts"),d=D("./src/loader/fragment.ts"),E=D("./src/utils/logger.ts"),y=function(){function a(){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 c=a.prototype;return c.destroy=function(){},c.resetTimeStamp=function(l){this.initPTS=l,this.lastEndDTS=null},c.resetNextTimestamp=function(){this.lastEndDTS=null},c.resetInitSegment=function(l,r,n){this.audioCodec=r,this.videoCodec=n,this.generateInitSegment(l),this.emitInitSegment=!0},c.generateInitSegment=function(l){var r=this.audioCodec,n=this.videoCodec;if(!l||!l.byteLength){this.initTracks=void 0,this.initData=void 0;return}var o=this.initData=Object(O.parseInitSegment)(l);r||(r=u(o.audio,d.ElementaryStreamTypes.AUDIO)),n||(n=u(o.video,d.ElementaryStreamTypes.VIDEO));var i={};o.audio&&o.video?i.audiovideo={container:"video/mp4",codec:r+","+n,initSegment:l,id:"main"}:o.audio?i.audio={container:"audio/mp4",codec:r,initSegment:l,id:"audio"}:o.video?i.video={container:"video/mp4",codec:n,initSegment:l,id:"main"}:E.logger.warn("[passthrough-remuxer.ts]: initSegment does not contain moov or trak boxes."),this.initTracks=i},c.remux=function(l,r,n,o,i){var f=this.initPTS,h=this.lastEndDTS,T={audio:void 0,video:void 0,text:o,id3:n,initSegment:void 0};Object(R.isFiniteNumber)(h)||(h=this.lastEndDTS=i||0);var g=r.samples;if(!g||!g.length)return T;var w={initPTS:void 0,timescale:1},C=this.initData;if((!C||!C.length)&&(this.generateInitSegment(g),C=this.initData),!C||!C.length)return E.logger.warn("[passthrough-remuxer.ts]: Failed to generate initSegment."),T;this.emitInitSegment&&(w.tracks=this.initTracks,this.emitInitSegment=!1),Object(R.isFiniteNumber)(f)||(this.initPTS=w.initPTS=f=v(C,g,h));var x=Object(O.getDuration)(g,C),b=h,S=x+b;Object(O.offsetStartDTS)(C,g,f),x>0?this.lastEndDTS=S:(E.logger.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());var A=!!C.audio,p=!!C.video,I="";A&&(I+="audio"),p&&(I+="video");var M={data1:g,startPTS:b,startDTS:b,endPTS:S,endDTS:S,type:I,hasAudio:A,hasVideo:p,nb:1,dropped:0};return T.audio=M.type==="audio"?M:void 0,T.video=M.type!=="audio"?M:void 0,T.text=o,T.id3=n,T.initSegment=w,T},a}(),v=function(c,s,l){return Object(O.getStartDTS)(c,s)-l};function u(a,c){var s=a==null?void 0:a.codec;return s&&s.length>4?s:s==="hvc1"?"hvc1.1.c.L120.90":s==="av01"?"av01.0.04M.08":s==="avc1"||c===d.ElementaryStreamTypes.VIDEO?"avc1.42e01e":"mp4a.40.5"}k.default=y},"./src/task-loop.ts":function(j,k,D){"use strict";D.r(k),D.d(k,"default",function(){return R});var R=function(){function O(){this._boundTick=void 0,this._tickTimer=null,this._tickInterval=null,this._tickCallCount=0,this._boundTick=this.tick.bind(this)}var d=O.prototype;return d.destroy=function(){this.onHandlerDestroying(),this.onHandlerDestroyed()},d.onHandlerDestroying=function(){this.clearNextTick(),this.clearInterval()},d.onHandlerDestroyed=function(){},d.hasInterval=function(){return!!this._tickInterval},d.hasNextTick=function(){return!!this._tickTimer},d.setInterval=function(y){return this._tickInterval?!1:(this._tickInterval=self.setInterval(this._boundTick,y),!0)},d.clearInterval=function(){return this._tickInterval?(self.clearInterval(this._tickInterval),this._tickInterval=null,!0):!1},d.clearNextTick=function(){return this._tickTimer?(self.clearTimeout(this._tickTimer),this._tickTimer=null,!0):!1},d.tick=function(){this._tickCallCount++,this._tickCallCount===1&&(this.doTick(),this._tickCallCount>1&&this.tickImmediate(),this._tickCallCount=0)},d.tickImmediate=function(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)},d.doTick=function(){},O}()},"./src/types/cmcd.ts":function(j,k,D){"use strict";D.r(k),D.d(k,"CMCDVersion",function(){return R}),D.d(k,"CMCDObjectType",function(){return O}),D.d(k,"CMCDStreamingFormat",function(){return d}),D.d(k,"CMCDStreamType",function(){return E});var R=1,O;(function(y){y.MANIFEST="m",y.AUDIO="a",y.VIDEO="v",y.MUXED="av",y.INIT="i",y.CAPTION="c",y.TIMED_TEXT="tt",y.KEY="k",y.OTHER="o"})(O||(O={}));var d;(function(y){y.DASH="d",y.HLS="h",y.SMOOTH="s",y.OTHER="o"})(d||(d={}));var E;(function(y){y.VOD="v",y.LIVE="l"})(E||(E={}))},"./src/types/level.ts":function(j,k,D){"use strict";D.r(k),D.d(k,"HlsSkip",function(){return d}),D.d(k,"getSkipValue",function(){return E}),D.d(k,"HlsUrlParameters",function(){return y}),D.d(k,"Level",function(){return v});function R(u,a){for(var c=0;c<a.length;c++){var s=a[c];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(u,s.key,s)}}function O(u,a,c){return a&&R(u.prototype,a),c&&R(u,c),u}var d;(function(u){u.No="",u.Yes="YES",u.v2="v2"})(d||(d={}));function E(u,a){var c=u.canSkipUntil,s=u.canSkipDateRanges,l=u.endSN,r=a!==void 0?a-l:0;return c&&r<c?s?d.v2:d.Yes:d.No}var y=function(){function u(c,s,l){this.msn=void 0,this.part=void 0,this.skip=void 0,this.msn=c,this.part=s,this.skip=l}var a=u.prototype;return a.addDirectives=function(s){var l=new self.URL(s);return this.msn!==void 0&&l.searchParams.set("_HLS_msn",this.msn.toString()),this.part!==void 0&&l.searchParams.set("_HLS_part",this.part.toString()),this.skip&&l.searchParams.set("_HLS_skip",this.skip),l.toString()},u}(),v=function(){function u(a){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=[a.url],this.attrs=a.attrs,this.bitrate=a.bitrate,a.details&&(this.details=a.details),this.id=a.id||0,this.name=a.name,this.width=a.width||0,this.height=a.height||0,this.audioCodec=a.audioCodec,this.videoCodec=a.videoCodec,this.unknownCodecs=a.unknownCodecs,this.codecSet=[a.videoCodec,a.audioCodec].filter(function(c){return c}).join(",").replace(/\.[^.,]+/g,"")}return O(u,[{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(c){var s=c%this.url.length;this._urlId!==s&&(this.details=void 0,this._urlId=s)}}]),u}()},"./src/types/loader.ts":function(j,k,D){"use strict";D.r(k),D.d(k,"PlaylistContextType",function(){return R}),D.d(k,"PlaylistLevelType",function(){return O});var R;(function(d){d.MANIFEST="manifest",d.LEVEL="level",d.AUDIO_TRACK="audioTrack",d.SUBTITLE_TRACK="subtitleTrack"})(R||(R={}));var O;(function(d){d.MAIN="main",d.AUDIO="audio",d.SUBTITLE="subtitle"})(O||(O={}))},"./src/types/transmuxer.ts":function(j,k,D){"use strict";D.r(k),D.d(k,"ChunkMetadata",function(){return R});var R=function(E,y,v,u,a,c){u===void 0&&(u=0),a===void 0&&(a=-1),c===void 0&&(c=!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=O(),this.buffering={audio:O(),video:O(),audiovideo:O()},this.level=E,this.sn=y,this.id=v,this.size=u,this.part=a,this.partial=c};function O(){return{start:0,executeStart:0,executeEnd:0,end:0}}},"./src/utils/attr-list.ts":function(j,k,D){"use strict";D.r(k),D.d(k,"AttrList",function(){return d});var R=/^(\d+)x(\d+)$/,O=/\s*(.+?)\s*=((?:\".*?\")|.*?)(?:,|$)/g,d=function(){function E(v){typeof v=="string"&&(v=E.parseAttrList(v));for(var u in v)v.hasOwnProperty(u)&&(this[u]=v[u])}var y=E.prototype;return y.decimalInteger=function(u){var a=parseInt(this[u],10);return a>Number.MAX_SAFE_INTEGER?Infinity:a},y.hexadecimalInteger=function(u){if(this[u]){var a=(this[u]||"0x").slice(2);a=(a.length&1?"0":"")+a;for(var c=new Uint8Array(a.length/2),s=0;s<a.length/2;s++)c[s]=parseInt(a.slice(s*2,s*2+2),16);return c}else return null},y.hexadecimalIntegerAsNumber=function(u){var a=parseInt(this[u],16);return a>Number.MAX_SAFE_INTEGER?Infinity:a},y.decimalFloatingPoint=function(u){return parseFloat(this[u])},y.optionalFloat=function(u,a){var c=this[u];return c?parseFloat(c):a},y.enumeratedString=function(u){return this[u]},y.bool=function(u){return this[u]==="YES"},y.decimalResolution=function(u){var a=R.exec(this[u]);return a===null?void 0:{width:parseInt(a[1],10),height:parseInt(a[2],10)}},E.parseAttrList=function(u){var a,c={},s='"';for(O.lastIndex=0;(a=O.exec(u))!==null;){var l=a[2];l.indexOf(s)===0&&l.lastIndexOf(s)===l.length-1&&(l=l.slice(1,-1)),c[a[1]]=l}return c},E}()},"./src/utils/binary-search.ts":function(j,k,D){"use strict";D.r(k);var R={search:function(d,E){for(var y=0,v=d.length-1,u=null,a=null;y<=v;){u=(y+v)/2|0,a=d[u];var c=E(a);if(c>0)y=u+1;else if(c<0)v=u-1;else return a}return null}};k.default=R},"./src/utils/buffer-helper.ts":function(j,k,D){"use strict";D.r(k),D.d(k,"BufferHelper",function(){return d});var R=D("./src/utils/logger.ts"),O={length:0,start:function(){return 0},end:function(){return 0}},d=function(){function E(){}return E.isBuffered=function(v,u){try{if(v){for(var a=E.getBuffered(v),c=0;c<a.length;c++)if(u>=a.start(c)&&u<=a.end(c))return!0}}catch(s){}return!1},E.bufferInfo=function(v,u,a){try{if(v){var c=E.getBuffered(v),s=[],l;for(l=0;l<c.length;l++)s.push({start:c.start(l),end:c.end(l)});return this.bufferedInfo(s,u,a)}}catch(r){}return{len:0,start:u,end:u,nextStart:void 0}},E.bufferedInfo=function(v,u,a){u=Math.max(0,u),v.sort(function(w,C){var x=w.start-C.start;return x||C.end-w.end});var c=[];if(a)for(var s=0;s<v.length;s++){var l=c.length;if(l){var r=c[l-1].end;v[s].start-r<a?v[s].end>r&&(c[l-1].end=v[s].end):c.push(v[s])}else c.push(v[s])}else c=v;for(var n=0,o,i=u,f=u,h=0;h<c.length;h++){var T=c[h].start,g=c[h].end;if(u+a>=T&&u<g)i=T,f=g,n=f-u;else if(u+a<T){o=T;break}}return{len:n,start:i||0,end:f||0,nextStart:o}},E.getBuffered=function(v){try{return v.buffered}catch(u){return R.logger.log("failed to get media.buffered",u),O}},E}()},"./src/utils/cea-608-parser.ts":function(j,k,D){"use strict";D.r(k),D.d(k,"Row",function(){return f}),D.d(k,"CaptionScreen",function(){return h});var R=D("./src/utils/logger.ts"),O={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},d=function(S){var A=S;return O.hasOwnProperty(S)&&(A=O[S]),String.fromCharCode(A)},E=15,y=100,v={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},u={17:2,18:4,21:6,22:8,23:10,19:13,20:15},a={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},c={25:2,26:4,29:6,30:8,31:10,27:13,28:15},s=["white","green","blue","cyan","red","yellow","magenta","black","transparent"],l;(function(b){b[b.ERROR=0]="ERROR",b[b.TEXT=1]="TEXT",b[b.WARNING=2]="WARNING",b[b.INFO=2]="INFO",b[b.DEBUG=3]="DEBUG",b[b.DATA=3]="DATA"})(l||(l={}));var r=function(){function b(){this.time=null,this.verboseLevel=l.ERROR}var S=b.prototype;return S.log=function(p,I){this.verboseLevel>=p&&R.logger.log(this.time+" ["+p+"] "+I)},b}(),n=function(S){for(var A=[],p=0;p<S.length;p++)A.push(S[p].toString(16));return A},o=function(){function b(A,p,I,M,P){this.foreground=void 0,this.underline=void 0,this.italics=void 0,this.background=void 0,this.flash=void 0,this.foreground=A||"white",this.underline=p||!1,this.italics=I||!1,this.background=M||"black",this.flash=P||!1}var S=b.prototype;return S.reset=function(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1},S.setStyles=function(p){for(var I=["foreground","underline","italics","background","flash"],M=0;M<I.length;M++){var P=I[M];p.hasOwnProperty(P)&&(this[P]=p[P])}},S.isDefault=function(){return this.foreground==="white"&&!this.underline&&!this.italics&&this.background==="black"&&!this.flash},S.equals=function(p){return this.foreground===p.foreground&&this.underline===p.underline&&this.italics===p.italics&&this.background===p.background&&this.flash===p.flash},S.copy=function(p){this.foreground=p.foreground,this.underline=p.underline,this.italics=p.italics,this.background=p.background,this.flash=p.flash},S.toString=function(){return"color="+this.foreground+", underline="+this.underline+", italics="+this.italics+", background="+this.background+", flash="+this.flash},b}(),i=function(){function b(A,p,I,M,P,B){this.uchar=void 0,this.penState=void 0,this.uchar=A||" ",this.penState=new o(p,I,M,P,B)}var S=b.prototype;return S.reset=function(){this.uchar=" ",this.penState.reset()},S.setChar=function(p,I){this.uchar=p,this.penState.copy(I)},S.setPenState=function(p){this.penState.copy(p)},S.equals=function(p){return this.uchar===p.uchar&&this.penState.equals(p.penState)},S.copy=function(p){this.uchar=p.uchar,this.penState.copy(p.penState)},S.isEmpty=function(){return this.uchar===" "&&this.penState.isDefault()},b}(),f=function(){function b(A){this.chars=void 0,this.pos=void 0,this.currPenState=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chars=[];for(var p=0;p<y;p++)this.chars.push(new i);this.logger=A,this.pos=0,this.currPenState=new o}var S=b.prototype;return S.equals=function(p){for(var I=!0,M=0;M<y;M++)if(!this.chars[M].equals(p.chars[M])){I=!1;break}return I},S.copy=function(p){for(var I=0;I<y;I++)this.chars[I].copy(p.chars[I])},S.isEmpty=function(){for(var p=!0,I=0;I<y;I++)if(!this.chars[I].isEmpty()){p=!1;break}return p},S.setCursor=function(p){this.pos!==p&&(this.pos=p),this.pos<0?(this.logger.log(l.DEBUG,"Negative cursor position "+this.pos),this.pos=0):this.pos>y&&(this.logger.log(l.DEBUG,"Too large cursor position "+this.pos),this.pos=y)},S.moveCursor=function(p){var I=this.pos+p;if(p>1)for(var M=this.pos+1;M<I+1;M++)this.chars[M].setPenState(this.currPenState);this.setCursor(I)},S.backSpace=function(){this.moveCursor(-1),this.chars[this.pos].setChar(" ",this.currPenState)},S.insertChar=function(p){p>=144&&this.backSpace();var I=d(p);if(this.pos>=y){this.logger.log(l.ERROR,"Cannot insert "+p.toString(16)+" ("+I+") at position "+this.pos+". Skipping it!");return}this.chars[this.pos].setChar(I,this.currPenState),this.moveCursor(1)},S.clearFromPos=function(p){var I;for(I=p;I<y;I++)this.chars[I].reset()},S.clear=function(){this.clearFromPos(0),this.pos=0,this.currPenState.reset()},S.clearToEndOfRow=function(){this.clearFromPos(this.pos)},S.getTextString=function(){for(var p=[],I=!0,M=0;M<y;M++){var P=this.chars[M].uchar;P!==" "&&(I=!1),p.push(P)}return I?"":p.join("")},S.setPenStyles=function(p){this.currPenState.setStyles(p);var I=this.chars[this.pos];I.setPenState(this.currPenState)},b}(),h=function(){function b(A){this.rows=void 0,this.currRow=void 0,this.nrRollUpRows=void 0,this.lastOutputScreen=void 0,this.logger=void 0,this.rows=[];for(var p=0;p<E;p++)this.rows.push(new f(A));this.logger=A,this.currRow=E-1,this.nrRollUpRows=null,this.lastOutputScreen=null,this.reset()}var S=b.prototype;return S.reset=function(){for(var p=0;p<E;p++)this.rows[p].clear();this.currRow=E-1},S.equals=function(p){for(var I=!0,M=0;M<E;M++)if(!this.rows[M].equals(p.rows[M])){I=!1;break}return I},S.copy=function(p){for(var I=0;I<E;I++)this.rows[I].copy(p.rows[I])},S.isEmpty=function(){for(var p=!0,I=0;I<E;I++)if(!this.rows[I].isEmpty()){p=!1;break}return p},S.backSpace=function(){var p=this.rows[this.currRow];p.backSpace()},S.clearToEndOfRow=function(){var p=this.rows[this.currRow];p.clearToEndOfRow()},S.insertChar=function(p){var I=this.rows[this.currRow];I.insertChar(p)},S.setPen=function(p){var I=this.rows[this.currRow];I.setPenStyles(p)},S.moveCursor=function(p){var I=this.rows[this.currRow];I.moveCursor(p)},S.setCursor=function(p){this.logger.log(l.INFO,"setCursor: "+p);var I=this.rows[this.currRow];I.setCursor(p)},S.setPAC=function(p){this.logger.log(l.INFO,"pacData = "+JSON.stringify(p));var I=p.row-1;if(this.nrRollUpRows&&I<this.nrRollUpRows-1&&(I=this.nrRollUpRows-1),this.nrRollUpRows&&this.currRow!==I){for(var M=0;M<E;M++)this.rows[M].clear();var P=this.currRow+1-this.nrRollUpRows,B=this.lastOutputScreen;if(B){var H=B.rows[P].cueStartTime,F=this.logger.time;if(H&&F!==null&&H<F)for(var W=0;W<this.nrRollUpRows;W++)this.rows[I-this.nrRollUpRows+W+1].copy(B.rows[P+W])}}this.currRow=I;var U=this.rows[this.currRow];if(p.indent!==null){var K=p.indent,G=Math.max(K-1,0);U.setCursor(p.indent),p.color=U.chars[G].penState.foreground}var ae={foreground:p.color,underline:p.underline,italics:p.italics,background:"black",flash:!1};this.setPen(ae)},S.setBkgData=function(p){this.logger.log(l.INFO,"bkgData = "+JSON.stringify(p)),this.backSpace(),this.setPen(p),this.insertChar(32)},S.setRollUpRows=function(p){this.nrRollUpRows=p},S.rollUp=function(){if(this.nrRollUpRows===null){this.logger.log(l.DEBUG,"roll_up but nrRollUpRows not set yet");return}this.logger.log(l.TEXT,this.getDisplayText());var p=this.currRow+1-this.nrRollUpRows,I=this.rows.splice(p,1)[0];I.clear(),this.rows.splice(this.currRow,0,I),this.logger.log(l.INFO,"Rolling up")},S.getDisplayText=function(p){p=p||!1;for(var I=[],M="",P=-1,B=0;B<E;B++){var H=this.rows[B].getTextString();H&&(P=B+1,p?I.push("Row "+P+": '"+H+"'"):I.push(H.trim()))}return I.length>0&&(p?M="["+I.join(" | ")+"]":M=I.join(`
|
|
|
`)),M},S.getTextAndFormat=function(){return this.rows},b}(),T=function(){function b(A,p,I){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=A,this.outputFilter=p,this.mode=null,this.verbose=0,this.displayedMemory=new h(I),this.nonDisplayedMemory=new h(I),this.lastOutputScreen=new h(I),this.currRollUpRow=this.displayedMemory.rows[E-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=I}var S=b.prototype;return S.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},S.getHandler=function(){return this.outputFilter},S.setHandler=function(p){this.outputFilter=p},S.setPAC=function(p){this.writeScreen.setPAC(p)},S.setBkgData=function(p){this.writeScreen.setBkgData(p)},S.setMode=function(p){if(p===this.mode)return;this.mode=p,this.logger.log(l.INFO,"MODE="+p),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=p},S.insertChars=function(p){for(var I=0;I<p.length;I++)this.writeScreen.insertChar(p[I]);var M=this.writeScreen===this.displayedMemory?"DISP":"NON_DISP";this.logger.log(l.INFO,M+": "+this.writeScreen.getDisplayText(!0)),(this.mode==="MODE_PAINT-ON"||this.mode==="MODE_ROLL-UP")&&(this.logger.log(l.TEXT,"DISPLAYED: "+this.displayedMemory.getDisplayText(!0)),this.outputDataUpdate())},S.ccRCL=function(){this.logger.log(l.INFO,"RCL - Resume Caption Loading"),this.setMode("MODE_POP-ON")},S.ccBS=function(){if(this.logger.log(l.INFO,"BS - BackSpace"),this.mode==="MODE_TEXT")return;this.writeScreen.backSpace(),this.writeScreen===this.displayedMemory&&this.outputDataUpdate()},S.ccAOF=function(){},S.ccAON=function(){},S.ccDER=function(){this.logger.log(l.INFO,"DER- Delete to End of Row"),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate()},S.ccRU=function(p){this.logger.log(l.INFO,"RU("+p+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(p)},S.ccFON=function(){this.logger.log(l.INFO,"FON - Flash On"),this.writeScreen.setPen({flash:!0})},S.ccRDC=function(){this.logger.log(l.INFO,"RDC - Resume Direct Captioning"),this.setMode("MODE_PAINT-ON")},S.ccTR=function(){this.logger.log(l.INFO,"TR"),this.setMode("MODE_TEXT")},S.ccRTD=function(){this.logger.log(l.INFO,"RTD"),this.setMode("MODE_TEXT")},S.ccEDM=function(){this.logger.log(l.INFO,"EDM - Erase Displayed Memory"),this.displayedMemory.reset(),this.outputDataUpdate(!0)},S.ccCR=function(){this.logger.log(l.INFO,"CR - Carriage Return"),this.writeScreen.rollUp(),this.outputDataUpdate(!0)},S.ccENM=function(){this.logger.log(l.INFO,"ENM - Erase Non-displayed Memory"),this.nonDisplayedMemory.reset()},S.ccEOC=function(){if(this.logger.log(l.INFO,"EOC - End Of Caption"),this.mode==="MODE_POP-ON"){var p=this.displayedMemory;this.displayedMemory=this.nonDisplayedMemory,this.nonDisplayedMemory=p,this.writeScreen=this.nonDisplayedMemory,this.logger.log(l.TEXT,"DISP: "+this.displayedMemory.getDisplayText())}this.outputDataUpdate(!0)},S.ccTO=function(p){this.logger.log(l.INFO,"TO("+p+") - Tab Offset"),this.writeScreen.moveCursor(p)},S.ccMIDROW=function(p){var I={flash:!1};if(I.underline=p%2===1,I.italics=p>=46,I.italics)I.foreground="white";else{var M=Math.floor(p/2)-16,P=["white","green","blue","cyan","red","yellow","magenta"];I.foreground=P[M]}this.logger.log(l.INFO,"MIDROW: "+JSON.stringify(I)),this.writeScreen.setPen(I)},S.outputDataUpdate=function(p){p===void 0&&(p=!1);var I=this.logger.time;if(I===null)return;this.outputFilter&&(this.cueStartTime===null&&!this.displayedMemory.isEmpty()?this.cueStartTime=I:this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime,I,this.lastOutputScreen),p&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:I),this.lastOutputScreen.copy(this.displayedMemory))},S.cueSplitAtTime=function(p){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,p,this.displayedMemory),this.cueStartTime=p))},b}(),g=function(){function b(A,p,I){this.channels=void 0,this.currentChannel=0,this.cmdHistory=void 0,this.logger=void 0;var M=new r;this.channels=[null,new T(A,p,M),new T(A+1,I,M)],this.cmdHistory=x(),this.logger=M}var S=b.prototype;return S.getHandler=function(p){return this.channels[p].getHandler()},S.setHandler=function(p,I){this.channels[p].setHandler(I)},S.addData=function(p,I){var M,P,B,H=!1;this.logger.time=p;for(var F=0;F<I.length;F+=2){if(P=I[F]&127,B=I[F+1]&127,P===0&&B===0)continue;if(this.logger.log(l.DATA,"["+n([I[F],I[F+1]])+"] -> ("+n([P,B])+")"),M=this.parseCmd(P,B),M||(M=this.parseMidrow(P,B)),M||(M=this.parsePAC(P,B)),M||(M=this.parseBackgroundAttributes(P,B)),!M&&(H=this.parseChars(P,B),H)){var W=this.currentChannel;if(W&&W>0){var U=this.channels[W];U.insertChars(H)}else this.logger.log(l.WARNING,"No channel found yet. TEXT-MODE?")}!M&&!H&&this.logger.log(l.WARNING,"Couldn't parse cleaned data "+n([P,B])+" orig: "+n([I[F],I[F+1]]))}},S.parseCmd=function(p,I){var M=this.cmdHistory,P=(p===20||p===28||p===21||p===29)&&I>=32&&I<=47,B=(p===23||p===31)&&I>=33&&I<=35;if(!(P||B))return!1;if(C(p,I,M))return w(null,null,M),this.logger.log(l.DEBUG,"Repeated command ("+n([p,I])+") is dropped"),!0;var H=p===20||p===21||p===23?1:2,F=this.channels[H];return p===20||p===21||p===28||p===29?I===32?F.ccRCL():I===33?F.ccBS():I===34?F.ccAOF():I===35?F.ccAON():I===36?F.ccDER():I===37?F.ccRU(2):I===38?F.ccRU(3):I===39?F.ccRU(4):I===40?F.ccFON():I===41?F.ccRDC():I===42?F.ccTR():I===43?F.ccRTD():I===44?F.ccEDM():I===45?F.ccCR():I===46?F.ccENM():I===47&&F.ccEOC():F.ccTO(I-32),w(p,I,M),this.currentChannel=H,!0},S.parseMidrow=function(p,I){var M=0;if((p===17||p===25)&&I>=32&&I<=47){if(p===17?M=1:M=2,M!==this.currentChannel)return this.logger.log(l.ERROR,"Mismatch channel in midrow parsing"),!1;var P=this.channels[M];return P?(P.ccMIDROW(I),this.logger.log(l.DEBUG,"MIDROW ("+n([p,I])+")"),!0):!1}return!1},S.parsePAC=function(p,I){var M,P=this.cmdHistory,B=(p>=17&&p<=23||p>=25&&p<=31)&&I>=64&&I<=127,H=(p===16||p===24)&&I>=64&&I<=95;if(!(B||H))return!1;if(C(p,I,P))return w(null,null,P),!0;var F=p<=23?1:2;I>=64&&I<=95?M=F===1?v[p]:a[p]:M=F===1?u[p]:c[p];var W=this.channels[F];return W?(W.setPAC(this.interpretPAC(M,I)),w(p,I,P),this.currentChannel=F,!0):!1},S.interpretPAC=function(p,I){var M,P={color:null,italics:!1,indent:null,underline:!1,row:p};return I>95?M=I-96:M=I-64,P.underline=(M&1)===1,M<=13?P.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(M/2)]:M<=15?(P.italics=!0,P.color="white"):P.indent=Math.floor((M-16)/2)*4,P},S.parseChars=function(p,I){var M,P=null,B=null;if(p>=25?(M=2,B=p-8):(M=1,B=p),B>=17&&B<=19){var H;B===17?H=I+80:B===18?H=I+112:H=I+144,this.logger.log(l.INFO,"Special char '"+d(H)+"' in channel "+M),P=[H]}else p>=32&&p<=127&&(P=I===0?[p]:[p,I]);if(P){var F=n(P);this.logger.log(l.DEBUG,"Char codes = "+F.join(",")),w(p,I,this.cmdHistory)}return P},S.parseBackgroundAttributes=function(p,I){var M=(p===16||p===24)&&I>=32&&I<=47,P=(p===23||p===31)&&I>=45&&I<=47;if(!(M||P))return!1;var B,H={};p===16||p===24?(B=Math.floor((I-32)/2),H.background=s[B],I%2===1&&(H.background=H.background+"_semi")):I===45?H.background="transparent":(H.foreground="black",I===47&&(H.underline=!0));var F=p<=23?1:2,W=this.channels[F];return W.setBkgData(H),w(p,I,this.cmdHistory),!0},S.reset=function(){for(var p=0;p<Object.keys(this.channels).length;p++){var I=this.channels[p];I&&I.reset()}this.cmdHistory=x()},S.cueSplitAtTime=function(p){for(var I=0;I<this.channels.length;I++){var M=this.channels[I];M&&M.cueSplitAtTime(p)}},b}();function w(b,S,A){A.a=b,A.b=S}function C(b,S,A){return A.a===b&&A.b===S}function x(){return{a:null,b:null}}k.default=g},"./src/utils/codecs.ts":function(j,k,D){"use strict";D.r(k),D.d(k,"isCodecType",function(){return O}),D.d(k,"isCodecSupportedInMp4",function(){return d});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 O(E,y){var v=R[y];return!!v&&v[E.slice(0,4)]===!0}function d(E,y){return MediaSource.isTypeSupported((y||"video")+'/mp4;codecs="'+E+'"')}},"./src/utils/cues.ts":function(j,k,D){"use strict";D.r(k);var R=D("./src/utils/vttparser.ts"),O=D("./src/utils/webvtt-parser.ts"),d=D("./src/utils/texttrack-utils.ts"),E=/\s/,y={newCue:function(u,a,c,s){for(var l=[],r,n,o,i,f,h=self.VTTCue||self.TextTrackCue,T=0;T<s.rows.length;T++)if(r=s.rows[T],o=!0,i=0,f="",!r.isEmpty()){for(var g=0;g<r.chars.length;g++)E.test(r.chars[g].uchar)&&o?i++:(f+=r.chars[g].uchar,o=!1);r.cueStartTime=a,a===c&&(c+=1e-4),i>=16?i--:i++;var w=Object(R.fixLineBreaks)(f.trim()),C=Object(O.generateCueId)(a,c,w);(!u||!u.cues||!u.cues.getCueById(C))&&(n=new h(a,c,w),n.id=C,n.line=T+1,n.align="left",n.position=10+Math.min(80,Math.floor(i*8/32)*10),l.push(n))}return u&&l.length&&(l.sort(function(x,b){return x.line==="auto"||b.line==="auto"?0:x.line>8&&b.line>8?b.line-x.line:x.line-b.line}),l.forEach(function(x){return Object(d.addCueToTrack)(u,x)})),l}};k.default=y},"./src/utils/discontinuities.ts":function(j,k,D){"use strict";D.r(k),D.d(k,"findFirstFragWithCC",function(){return E}),D.d(k,"shouldAlignOnDiscontinuities",function(){return y}),D.d(k,"findDiscontinuousReferenceFrag",function(){return v}),D.d(k,"adjustSlidingStart",function(){return a}),D.d(k,"alignStream",function(){return c}),D.d(k,"alignPDT",function(){return l}),D.d(k,"alignFragmentByPDTDelta",function(){return r}),D.d(k,"alignMediaPlaylistByPDT",function(){return n});var R=D("./src/polyfills/number.ts"),O=D("./src/utils/logger.ts"),d=D("./src/controller/level-helper.ts");function E(o,i){for(var f=null,h=0,T=o.length;h<T;h++){var g=o[h];if(g&&g.cc===i){f=g;break}}return f}function y(o,i,f){return!!(i.details&&(f.endCC>f.startCC||o&&o.cc<f.startCC))}function v(o,i){var f=o.fragments,h=i.fragments;if(!h.length||!f.length){O.logger.log("No fragments to align");return}var T=E(f,h[0].cc);if(!T||T&&!T.startPTS){O.logger.log("No frag in previous level to align on");return}return T}function u(o,i){if(o){var f=o.start+i;o.start=o.startPTS=f,o.endPTS=f+o.duration}}function a(o,i){for(var f=i.fragments,h=0,T=f.length;h<T;h++)u(f[h],o);i.fragmentHint&&u(i.fragmentHint,o),i.alignedSliding=!0}function c(o,i,f){if(!i)return;s(o,f,i),!f.alignedSliding&&i.details&&l(f,i.details),!f.alignedSliding&&i.details&&!f.skippedSegments&&Object(d.adjustSliding)(i.details,f)}function s(o,i,f){if(y(o,f,i)){var h=v(f.details,i);h&&Object(R.isFiniteNumber)(h.start)&&(O.logger.log("Adjusting PTS using last level due to CC increase within current level "+i.url),a(h.start,i))}}function l(o,i){if(!i.fragments.length||!o.hasProgramDateTime||!i.hasProgramDateTime)return;var f=i.fragments[0].programDateTime,h=o.fragments[0].programDateTime,T=(h-f)/1e3+i.fragments[0].start;T&&Object(R.isFiniteNumber)(T)&&(O.logger.log("Adjusting PTS using programDateTime delta "+(h-f)+"ms, sliding:"+T.toFixed(3)+" "+o.url+" "),a(T,o))}function r(o,i){var f=o.programDateTime;if(!f)return;var h=(f-i)/1e3;o.start=o.startPTS=h,o.endPTS=h+o.duration}function n(o,i){if(!i.fragments.length||!o.hasProgramDateTime||!i.hasProgramDateTime)return;var f=i.fragments[0].programDateTime,h=i.fragments[0].start,T=f-h*1e3;o.fragments.forEach(function(g){r(g,T)}),o.fragmentHint&&r(o.fragmentHint,T),o.alignedSliding=!0}},"./src/utils/ewma-bandwidth-estimator.ts":function(j,k,D){"use strict";D.r(k);var R=D("./src/utils/ewma.ts"),O=function(){function d(y,v,u){this.defaultEstimate_=void 0,this.minWeight_=void 0,this.minDelayMs_=void 0,this.slow_=void 0,this.fast_=void 0,this.defaultEstimate_=u,this.minWeight_=.001,this.minDelayMs_=50,this.slow_=new R.default(y),this.fast_=new R.default(v)}var E=d.prototype;return E.update=function(v,u){var a=this.slow_,c=this.fast_;this.slow_.halfLife!==v&&(this.slow_=new R.default(v,a.getEstimate(),a.getTotalWeight())),this.fast_.halfLife!==u&&(this.fast_=new R.default(u,c.getEstimate(),c.getTotalWeight()))},E.sample=function(v,u){v=Math.max(v,this.minDelayMs_);var a=8*u,c=v/1e3,s=a/c;this.fast_.sample(c,s),this.slow_.sample(c,s)},E.canEstimate=function(){var v=this.fast_;return v&&v.getTotalWeight()>=this.minWeight_},E.getEstimate=function(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_},E.destroy=function(){},d}();k.default=O},"./src/utils/ewma.ts":function(j,k,D){"use strict";D.r(k);var R=function(){function O(E,y,v){y===void 0&&(y=0),v===void 0&&(v=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_=y,this.totalWeight_=v}var d=O.prototype;return d.sample=function(y,v){var u=Math.pow(this.alpha_,y);this.estimate_=v*(1-u)+u*this.estimate_,this.totalWeight_+=y},d.getTotalWeight=function(){return this.totalWeight_},d.getEstimate=function(){if(this.alpha_){var y=1-Math.pow(this.alpha_,this.totalWeight_);if(y)return this.estimate_/y}return this.estimate_},O}();k.default=R},"./src/utils/fetch-loader.ts":function(j,k,D){"use strict";D.r(k),D.d(k,"fetchSupported",function(){return r});var R=D("./src/polyfills/number.ts"),O=D("./src/loader/load-stats.ts"),d=D("./src/demux/chunk-cache.ts");function E(h,T){h.prototype=Object.create(T.prototype),h.prototype.constructor=h,c(h,T)}function y(h){var T=typeof Map=="function"?new Map:void 0;return y=function(w){if(w===null||!a(w))return w;if(typeof w!="function")throw new TypeError("Super expression must either be null or a function");if(typeof T!="undefined"){if(T.has(w))return T.get(w);T.set(w,C)}function C(){return v(w,arguments,s(this).constructor)}return C.prototype=Object.create(w.prototype,{constructor:{value:C,enumerable:!1,writable:!0,configurable:!0}}),c(C,w)},y(h)}function v(h,T,g){return u()?v=Reflect.construct:v=function(C,x,b){var S=[null];S.push.apply(S,x);var A=Function.bind.apply(C,S),p=new A;return b&&c(p,b.prototype),p},v.apply(null,arguments)}function u(){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(h){return!1}}function a(h){return Function.toString.call(h).indexOf("[native code]")!==-1}function c(h,T){return c=Object.setPrototypeOf||function(w,C){return w.__proto__=C,w},c(h,T)}function s(h){return s=Object.setPrototypeOf?Object.getPrototypeOf:function(g){return g.__proto__||Object.getPrototypeOf(g)},s(h)}function l(){return l=Object.assign||function(h){for(var T=1;T<arguments.length;T++){var g=arguments[T];for(var w in g)Object.prototype.hasOwnProperty.call(g,w)&&(h[w]=g[w])}return h},l.apply(this,arguments)}function r(){if(self.fetch&&self.AbortController&&self.ReadableStream&&self.Request)try{return new self.ReadableStream({}),!0}catch(h){}return!1}var n=function(){function h(g){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=g.fetchSetup||i,this.controller=new self.AbortController,this.stats=new O.LoadStats}var T=h.prototype;return T.destroy=function(){this.loader=this.callbacks=null,this.abortInternal()},T.abortInternal=function(){var w=this.response;(!w||!w.ok)&&(this.stats.aborted=!0,this.controller.abort())},T.abort=function(){var w;this.abortInternal(),(w=this.callbacks)!==null&&w!==void 0&&w.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.response)},T.load=function(w,C,x){var b=this,S=this.stats;if(S.loading.start)throw new Error("Loader can only be used once.");S.loading.start=self.performance.now();var A=o(w,this.controller.signal),p=x.onProgress,I=w.responseType==="arraybuffer",M=I?"byteLength":"length";this.context=w,this.config=C,this.callbacks=x,this.request=this.fetchSetup(w,A),self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(function(){b.abortInternal(),x.onTimeout(S,w,b.response)},C.timeout),self.fetch(this.request).then(function(P){if(b.response=b.loader=P,!P.ok){var B=P.status,H=P.statusText;throw new f(H||"fetch, bad network response",B,P)}return S.loading.first=Math.max(self.performance.now(),S.loading.start),S.total=parseInt(P.headers.get("Content-Length")||"0"),p&&Object(R.isFiniteNumber)(C.highWaterMark)?b.loadProgressively(P,S,w,C.highWaterMark,p):I?P.arrayBuffer():P.text()}).then(function(P){var B=b.response;self.clearTimeout(b.requestTimeout),S.loading.end=Math.max(self.performance.now(),S.loading.first),S.loaded=S.total=P[M];var H={url:B.url,data:P};p&&!Object(R.isFiniteNumber)(C.highWaterMark)&&p(S,w,P,B),x.onSuccess(H,S,w,B)}).catch(function(P){if(self.clearTimeout(b.requestTimeout),S.aborted)return;var B=P.code||0;x.onError({code:B,text:P.message},w,P.details)})},T.getCacheAge=function(){var w=null;if(this.response){var C=this.response.headers.get("age");w=C?parseFloat(C):null}return w},T.loadProgressively=function(w,C,x,b,S){b===void 0&&(b=0);var A=new d.default,p=w.body.getReader(),I=function M(){return p.read().then(function(P){if(P.done)return A.dataLength&&S(C,x,A.flush(),w),Promise.resolve(new ArrayBuffer(0));var B=P.value,H=B.length;return C.loaded+=H,H<b||A.dataLength?(A.push(B),A.dataLength>=b&&S(C,x,A.flush(),w)):S(C,x,B,w),M()}).catch(function(){return Promise.reject()})};return I()},h}();function o(h,T){var g={method:"GET",mode:"cors",credentials:"same-origin",signal:T,headers:new self.Headers(l({},h.headers))};return h.rangeEnd&&g.headers.set("Range","bytes="+h.rangeStart+"-"+String(h.rangeEnd-1)),g}function i(h,T){return new self.Request(h.url,T)}var f=function(h){E(T,h);function T(g,w,C){var x;return x=h.call(this,g)||this,x.code=void 0,x.details=void 0,x.code=w,x.details=C,x}return T}(y(Error));k.default=n},"./src/utils/imsc1-ttml-parser.ts":function(j,k,D){"use strict";D.r(k),D.d(k,"IMSC1_CODEC",function(){return a}),D.d(k,"parseIMSC1",function(){return r});var R=D("./src/utils/mp4-tools.ts"),O=D("./src/utils/vttparser.ts"),d=D("./src/utils/vttcue.ts"),E=D("./src/demux/id3.ts"),y=D("./src/utils/timescale-conversion.ts"),v=D("./src/utils/webvtt-parser.ts");function u(){return u=Object.assign||function(b){for(var S=1;S<arguments.length;S++){var A=arguments[S];for(var p in A)Object.prototype.hasOwnProperty.call(A,p)&&(b[p]=A[p])}return b},u.apply(this,arguments)}var a="stpp.ttml.im1t",c=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,s=/^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/,l={left:"start",center:"center",right:"end",start:"start",end:"end"};function r(b,S,A,p,I){var M=Object(R.findBox)(new Uint8Array(b),["mdat"]);if(M.length===0){I(new Error("Could not parse IMSC1 mdat"));return}var P=M[0],B=Object(E.utf8ArrayToStr)(new Uint8Array(b,P.start,P.end-P.start)),H=Object(y.toTimescaleFromScale)(S,1,A);try{p(n(B,H))}catch(F){I(F)}}function n(b,S){var A=new DOMParser,p=A.parseFromString(b,"text/xml"),I=p.getElementsByTagName("tt")[0];if(!I)throw new Error("Invalid ttml");var M={frameRate:30,subFrameRate:1,frameRateMultiplier:0,tickRate:0},P=Object.keys(M).reduce(function(U,K){return U[K]=I.getAttribute("ttp:"+K)||M[K],U},{}),B=I.getAttribute("xml:space")!=="preserve",H=i(o(I,"styling","style")),F=i(o(I,"layout","region")),W=o(I,"body","[begin]");return[].map.call(W,function(U){var K=f(U,B);if(!K||!U.hasAttribute("begin"))return null;var G=w(U.getAttribute("begin"),P),ae=w(U.getAttribute("dur"),P),fe=w(U.getAttribute("end"),P);if(G===null)throw g(U);if(fe===null){if(ae===null)throw g(U);fe=G+ae}var Se=new d.default(G-S,fe-S,K);Se.id=Object(v.generateCueId)(Se.startTime,Se.endTime,Se.text);var Ue=F[U.getAttribute("region")],Ne=H[U.getAttribute("style")];Se.position=10,Se.size=80;var xe=h(Ue,Ne),Ce=xe.textAlign;if(Ce){var De=l[Ce];De&&(Se.lineAlign=De),Se.align=Ce}return u(Se,xe),Se}).filter(function(U){return U!==null})}function o(b,S,A){var p=b.getElementsByTagName(S)[0];return p?[].slice.call(p.querySelectorAll(A)):[]}function i(b){return b.reduce(function(S,A){var p=A.getAttribute("xml:id");return p&&(S[p]=A),S},{})}function f(b,S){return[].slice.call(b.childNodes).reduce(function(A,p,I){var M;return p.nodeName==="br"&&I?A+`
|
|
|
`:(M=p.childNodes)!==null&&M!==void 0&&M.length?f(p,S):S?A+p.textContent.trim().replace(/\s+/g," "):A+p.textContent},"")}function h(b,S){var A="http://www.w3.org/ns/ttml#styling",p=["displayAlign","textAlign","color","backgroundColor","fontSize","fontFamily"];return p.reduce(function(I,M){var P=T(S,A,M)||T(b,A,M);return P&&(I[M]=P),I},{})}function T(b,S,A){return b.hasAttributeNS(S,A)?b.getAttributeNS(S,A):null}function g(b){return new Error("Could not parse ttml timestamp "+b)}function w(b,S){if(!b)return null;var A=Object(O.parseTimeStamp)(b);return A===null&&(c.test(b)?A=C(b,S):s.test(b)&&(A=x(b,S))),A}function C(b,S){var A=c.exec(b),p=(A[4]|0)+(A[5]|0)/S.subFrameRate;return(A[1]|0)*3600+(A[2]|0)*60+(A[3]|0)+p/S.frameRate}function x(b,S){var A=s.exec(b),p=Number(A[1]),I=A[2];switch(I){case"h":return p*3600;case"m":return p*60;case"ms":return p*1e3;case"f":return p/S.frameRate;case"t":return p/S.tickRate}return p}},"./src/utils/logger.ts":function(j,k,D){"use strict";D.r(k),D.d(k,"enableLogs",function(){return v}),D.d(k,"logger",function(){return u});var R=function(){},O={trace:R,debug:R,log:R,warn:R,info:R,error:R},d=O;function E(a){var c=self.console[a];return c?c.bind(self.console,"["+a+"] >"):R}function y(a){for(var c=arguments.length,s=new Array(c>1?c-1:0),l=1;l<c;l++)s[l-1]=arguments[l];s.forEach(function(r){d[r]=a[r]?a[r].bind(a):E(r)})}function v(a){if(self.console&&a===!0||typeof a=="object"){y(a,"debug","log","info","warn","error");try{d.log()}catch(c){d=O}}else d=O}var u=d},"./src/utils/mediakeys-helper.ts":function(j,k,D){"use strict";D.r(k),D.d(k,"KeySystems",function(){return R}),D.d(k,"requestMediaKeySystemAccess",function(){return O});var R;(function(d){d.WIDEVINE="com.widevine.alpha",d.PLAYREADY="com.microsoft.playready"})(R||(R={}));var O=function(){return typeof self!="undefined"&&self.navigator&&self.navigator.requestMediaKeySystemAccess?self.navigator.requestMediaKeySystemAccess.bind(self.navigator):null}()},"./src/utils/mediasource-helper.ts":function(j,k,D){"use strict";D.r(k),D.d(k,"getMediaSource",function(){return R});function R(){return self.MediaSource||self.WebKitMediaSource}},"./src/utils/mp4-tools.ts":function(j,k,D){"use strict";D.r(k),D.d(k,"bin2str",function(){return y}),D.d(k,"readUint16",function(){return v}),D.d(k,"readUint32",function(){return u}),D.d(k,"writeUint32",function(){return a}),D.d(k,"findBox",function(){return c}),D.d(k,"parseSegmentIndex",function(){return s}),D.d(k,"parseInitSegment",function(){return l}),D.d(k,"getStartDTS",function(){return r}),D.d(k,"getDuration",function(){return n}),D.d(k,"computeRawDurationFromSamples",function(){return o}),D.d(k,"offsetStartDTS",function(){return i}),D.d(k,"segmentValidRange",function(){return f}),D.d(k,"appendUint8Array",function(){return h});var R=D("./src/utils/typed-array.ts"),O=D("./src/loader/fragment.ts"),d=Math.pow(2,32)-1,E=[].push;function y(T){return String.fromCharCode.apply(null,T)}function v(T,g){"data"in T&&(g+=T.start,T=T.data);var w=T[g]<<8|T[g+1];return w<0?65536+w:w}function u(T,g){"data"in T&&(g+=T.start,T=T.data);var w=T[g]<<24|T[g+1]<<16|T[g+2]<<8|T[g+3];return w<0?4294967296+w:w}function a(T,g,w){"data"in T&&(g+=T.start,T=T.data),T[g]=w>>24,T[g+1]=w>>16&255,T[g+2]=w>>8&255,T[g+3]=w&255}function c(T,g){var w=[];if(!g.length)return w;var C,x,b;"data"in T?(C=T.data,x=T.start,b=T.end):(C=T,x=0,b=C.byteLength);for(var S=x;S<b;){var A=u(C,S),p=y(C.subarray(S+4,S+8)),I=A>1?S+A:b;if(p===g[0])if(g.length===1)w.push({data:C,start:S+8,end:I});else{var M=c({data:C,start:S+8,end:I},g.slice(1));M.length&&E.apply(w,M)}S=I}return w}function s(T){var g=c(T,["moov"]),w=g[0],C=w?w.end:null,x=c(T,["sidx"]);if(!x||!x[0])return null;var b=[],S=x[0],A=S.data[0],p=A===0?8:16,I=u(S,p);p+=4;var M=0,P=0;A===0?p+=8:p+=16,p+=2;var B=S.end+P,H=v(S,p);p+=2;for(var F=0;F<H;F++){var W=p,U=u(S,W);W+=4;var K=U&2147483647,G=(U&2147483648)>>>31;if(G===1)return console.warn("SIDX has hierarchical references (not supported)"),null;var ae=u(S,W);W+=4,b.push({referenceSize:K,subsegmentDuration:ae,info:{duration:ae/I,start:B,end:B+K-1}}),B+=K,W+=4,p=W}return{earliestPresentationTime:M,timescale:I,version:A,referencesCount:H,references:b,moovEndOffset:C}}function l(T){for(var g=[],w=c(T,["moov","trak"]),C=0;C<w.length;C++){var x=w[C],b=c(x,["tkhd"])[0];if(b){var S=b.data[b.start],A=S===0?12:20,p=u(b,A),I=c(x,["mdia","mdhd"])[0];if(I){S=I.data[I.start],A=S===0?12:20;var M=u(I,A),P=c(x,["mdia","hdlr"])[0];if(P){var B=y(P.data.subarray(P.start+8,P.start+12)),H={soun:O.ElementaryStreamTypes.AUDIO,vide:O.ElementaryStreamTypes.VIDEO}[B];if(H){var F=c(x,["mdia","minf","stbl","stsd"])[0],W=void 0;F&&(W=y(F.data.subarray(F.start+12,F.start+16))),g[p]={timescale:M,type:H},g[H]={timescale:M,id:p,codec:W}}}}}}var U=c(T,["moov","mvex","trex"]);return U.forEach(function(K){var G=u(K,4),ae=g[G];ae&&(ae.default={duration:u(K,12),flags:u(K,20)})}),g}function r(T,g){return c(g,["moof","traf"]).reduce(function(w,C){var x=c(C,["tfdt"])[0],b=x.data[x.start],S=c(C,["tfhd"]).reduce(function(A,p){var I=u(p,4),M=T[I];if(M){var P=u(x,4);b===1&&(P*=Math.pow(2,32),P+=u(x,8));var B=M.timescale||9e4,H=P/B;if(isFinite(H)&&(A===null||H<A))return H}return A},null);return S!==null&&isFinite(S)&&(w===null||S<w)?S:w},null)||0}function n(T,g){for(var w=0,C=0,x=0,b=c(T,["moof","traf"]),S=0;S<b.length;S++){var A=b[S],p=c(A,["tfhd"])[0],I=u(p,4),M=g[I];if(!M)continue;var P=M.default,B=u(p,0)|(P==null?void 0:P.flags),H=P==null?void 0:P.duration;B&8&&(B&2?H=u(p,12):H=u(p,8));for(var F=M.timescale||9e4,W=c(A,["trun"]),U=0;U<W.length;U++){if(H){var K=u(W[U],4);w=H*K}else w=o(W[U]);M.type===O.ElementaryStreamTypes.VIDEO?C+=w/F:M.type===O.ElementaryStreamTypes.AUDIO&&(x+=w/F)}}if(C===0&&x===0){var G=s(T);if(G!=null&&G.references)return G.references.reduce(function(ae,fe){return ae+fe.info.duration||0},0)}return C||x}function o(T){var g=u(T,0),w=8;g&1&&(w+=4),g&4&&(w+=4);for(var C=0,x=u(T,4),b=0;b<x;b++){if(g&256){var S=u(T,w);C+=S,w+=4}g&512&&(w+=4),g&1024&&(w+=4),g&2048&&(w+=4)}return C}function i(T,g,w){c(g,["moof","traf"]).forEach(function(C){c(C,["tfhd"]).forEach(function(x){var b=u(x,4),S=T[b];if(!S)return;var A=S.timescale||9e4;c(C,["tfdt"]).forEach(function(p){var I=p.data[p.start],M=u(p,4);if(I===0)a(p,4,M-w*A);else{M*=Math.pow(2,32),M+=u(p,8),M-=w*A,M=Math.max(M,0);var P=Math.floor(M/(d+1)),B=Math.floor(M%(d+1));a(p,4,P),a(p,8,B)}})})})}function f(T){var g={valid:null,remainder:null},w=c(T,["moof"]);if(w){if(w.length<2)return g.remainder=T,g}else return g;var C=w[w.length-1];return g.valid=Object(R.sliceUint8)(T,0,C.start-8),g.remainder=Object(R.sliceUint8)(T,C.start-8),g}function h(T,g){var w=new Uint8Array(T.length+g.length);return w.set(T),w.set(g,T.length),w}},"./src/utils/output-filter.ts":function(j,k,D){"use strict";D.r(k),D.d(k,"default",function(){return R});var R=function(){function O(E,y){this.timelineController=void 0,this.cueRanges=[],this.trackName=void 0,this.startTime=null,this.endTime=null,this.screen=null,this.timelineController=E,this.trackName=y}var d=O.prototype;return d.dispatchCue=function(){if(this.startTime===null)return;this.timelineController.addCues(this.trackName,this.startTime,this.endTime,this.screen,this.cueRanges),this.startTime=null},d.newCue=function(y,v,u){(this.startTime===null||this.startTime>y)&&(this.startTime=y),this.endTime=v,this.screen=u,this.timelineController.createCaptionsTrack(this.trackName)},d.reset=function(){this.cueRanges=[]},O}()},"./src/utils/texttrack-utils.ts":function(j,k,D){"use strict";D.r(k),D.d(k,"sendAddTrackEvent",function(){return O}),D.d(k,"addCueToTrack",function(){return d}),D.d(k,"clearCurrentCues",function(){return E}),D.d(k,"removeCuesInRange",function(){return y}),D.d(k,"getCuesInRange",function(){return u});var R=D("./src/utils/logger.ts");function O(a,c){var s;try{s=new Event("addtrack")}catch(l){s=document.createEvent("Event"),s.initEvent("addtrack",!1,!1)}s.track=a,c.dispatchEvent(s)}function d(a,c){var s=a.mode;if(s==="disabled"&&(a.mode="hidden"),a.cues&&!a.cues.getCueById(c.id))try{if(a.addCue(c),!a.cues.getCueById(c.id))throw new Error("addCue is failed for: "+c)}catch(r){R.logger.debug("[texttrack-utils]: "+r);var l=new self.TextTrackCue(c.startTime,c.endTime,c.text);l.id=c.id,a.addCue(l)}s==="disabled"&&(a.mode=s)}function E(a){var c=a.mode;if(c==="disabled"&&(a.mode="hidden"),a.cues)for(var s=a.cues.length;s--;)a.removeCue(a.cues[s]);c==="disabled"&&(a.mode=c)}function y(a,c,s){var l=a.mode;if(l==="disabled"&&(a.mode="hidden"),a.cues&&a.cues.length>0)for(var r=u(a.cues,c,s),n=0;n<r.length;n++)a.removeCue(r[n]);l==="disabled"&&(a.mode=l)}function v(a,c){if(c<a[0].startTime)return 0;var s=a.length-1;if(c>a[s].endTime)return-1;for(var l=0,r=s;l<=r;){var n=Math.floor((r+l)/2);if(c<a[n].startTime)r=n-1;else if(c>a[n].startTime&&l<s)l=n+1;else return n}return a[l].startTime-c<c-a[r].startTime?l:r}function u(a,c,s){var l=[],r=v(a,c);if(r>-1)for(var n=r,o=a.length;n<o;n++){var i=a[n];if(i.startTime>=c&&i.endTime<=s)l.push(i);else if(i.startTime>s)return l}return l}},"./src/utils/time-ranges.ts":function(j,k,D){"use strict";D.r(k);var R={toString:function(d){for(var E="",y=d.length,v=0;v<y;v++)E+="["+d.start(v).toFixed(3)+","+d.end(v).toFixed(3)+"]";return E}};k.default=R},"./src/utils/timescale-conversion.ts":function(j,k,D){"use strict";D.r(k),D.d(k,"toTimescaleFromBase",function(){return O}),D.d(k,"toTimescaleFromScale",function(){return d}),D.d(k,"toMsFromMpegTsClock",function(){return E}),D.d(k,"toMpegTsClockFromTimescale",function(){return y});var R=9e4;function O(v,u,a,c){a===void 0&&(a=1),c===void 0&&(c=!1);var s=v*u*a;return c?Math.round(s):s}function d(v,u,a,c){return a===void 0&&(a=1),c===void 0&&(c=!1),O(v,u,1/a,c)}function E(v,u){return u===void 0&&(u=!1),O(v,1e3,1/R,u)}function y(v,u){return u===void 0&&(u=1),O(v,R,1/u)}},"./src/utils/typed-array.ts":function(j,k,D){"use strict";D.r(k),D.d(k,"sliceUint8",function(){return R});function R(O,d,E){return Uint8Array.prototype.slice?O.slice(d,E):new Uint8Array(Array.prototype.slice.call(O,d,E))}},"./src/utils/vttcue.ts":function(j,k,D){"use strict";D.r(k),k.default=function(){if(typeof self!="undefined"&&self.VTTCue)return self.VTTCue;var R=["","lr","rl"],O=["start","middle","end","left","right"];function d(a,c){if(typeof c!="string")return!1;if(!Array.isArray(a))return!1;var s=c.toLowerCase();return~a.indexOf(s)?s:!1}function E(a){return d(R,a)}function y(a){return d(O,a)}function v(a){for(var c=arguments.length,s=new Array(c>1?c-1:0),l=1;l<c;l++)s[l-1]=arguments[l];for(var r=1;r<arguments.length;r++){var n=arguments[r];for(var o in n)a[o]=n[o]}return a}function u(a,c,s){var l=this,r={enumerable:!0};l.hasBeenReset=!1;var n="",o=!1,i=a,f=c,h=s,T=null,g="",w=!0,C="auto",x="start",b=50,S="middle",A=50,p="middle";Object.defineProperty(l,"id",v({},r,{get:function(){return n},set:function(M){n=""+M}})),Object.defineProperty(l,"pauseOnExit",v({},r,{get:function(){return o},set:function(M){o=!!M}})),Object.defineProperty(l,"startTime",v({},r,{get:function(){return i},set:function(M){if(typeof M!="number")throw new TypeError("Start time must be set to a number.");i=M,this.hasBeenReset=!0}})),Object.defineProperty(l,"endTime",v({},r,{get:function(){return f},set:function(M){if(typeof M!="number")throw new TypeError("End time must be set to a number.");f=M,this.hasBeenReset=!0}})),Object.defineProperty(l,"text",v({},r,{get:function(){return h},set:function(M){h=""+M,this.hasBeenReset=!0}})),Object.defineProperty(l,"region",v({},r,{get:function(){return T},set:function(M){T=M,this.hasBeenReset=!0}})),Object.defineProperty(l,"vertical",v({},r,{get:function(){return g},set:function(M){var P=E(M);if(P===!1)throw new SyntaxError("An invalid or illegal string was specified.");g=P,this.hasBeenReset=!0}})),Object.defineProperty(l,"snapToLines",v({},r,{get:function(){return w},set:function(M){w=!!M,this.hasBeenReset=!0}})),Object.defineProperty(l,"line",v({},r,{get:function(){return C},set:function(M){if(typeof M!="number"&&M!=="auto")throw new SyntaxError("An invalid number or illegal string was specified.");C=M,this.hasBeenReset=!0}})),Object.defineProperty(l,"lineAlign",v({},r,{get:function(){return x},set:function(M){var P=y(M);if(!P)throw new SyntaxError("An invalid or illegal string was specified.");x=P,this.hasBeenReset=!0}})),Object.defineProperty(l,"position",v({},r,{get:function(){return b},set:function(M){if(M<0||M>100)throw new Error("Position must be between 0 and 100.");b=M,this.hasBeenReset=!0}})),Object.defineProperty(l,"positionAlign",v({},r,{get:function(){return S},set:function(M){var P=y(M);if(!P)throw new SyntaxError("An invalid or illegal string was specified.");S=P,this.hasBeenReset=!0}})),Object.defineProperty(l,"size",v({},r,{get:function(){return A},set:function(M){if(M<0||M>100)throw new Error("Size must be between 0 and 100.");A=M,this.hasBeenReset=!0}})),Object.defineProperty(l,"align",v({},r,{get:function(){return p},set:function(M){var P=y(M);if(!P)throw new SyntaxError("An invalid or illegal string was specified.");p=P,this.hasBeenReset=!0}})),l.displayState=void 0}return u.prototype.getCueAsHTML=function(){var a=self.WebVTT;return a.convertCueToDOMTree(self,this.text)},u}()},"./src/utils/vttparser.ts":function(j,k,D){"use strict";D.r(k),D.d(k,"parseTimeStamp",function(){return d}),D.d(k,"fixLineBreaks",function(){return c}),D.d(k,"VTTParser",function(){return s});var R=D("./src/utils/vttcue.ts"),O=function(){function l(){}var r=l.prototype;return r.decode=function(o,i){if(!o)return"";if(typeof o!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(o))},l}();function d(l){function r(o,i,f,h){return(o|0)*3600+(i|0)*60+(f|0)+parseFloat(h||0)}var n=l.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return n?parseFloat(n[2])>59?r(n[2],n[3],0,n[4]):r(n[1],n[2],n[3],n[4]):null}var E=function(){function l(){this.values=Object.create(null)}var r=l.prototype;return r.set=function(o,i){!this.get(o)&&i!==""&&(this.values[o]=i)},r.get=function(o,i,f){return f?this.has(o)?this.values[o]:i[f]:this.has(o)?this.values[o]:i},r.has=function(o){return o in this.values},r.alt=function(o,i,f){for(var h=0;h<f.length;++h)if(i===f[h]){this.set(o,i);break}},r.integer=function(o,i){/^-?\d+$/.test(i)&&this.set(o,parseInt(i,10))},r.percent=function(o,i){if(/^([\d]{1,3})(\.[\d]*)?%$/.test(i)){var f=parseFloat(i);if(f>=0&&f<=100)return this.set(o,f),!0}return!1},l}();function y(l,r,n,o){var i=o?l.split(o):[l];for(var f in i){if(typeof i[f]!="string")continue;var h=i[f].split(n);if(h.length!==2)continue;var T=h[0],g=h[1];r(T,g)}}var v=new R.default(0,0,""),u=v.align==="middle"?"middle":"center";function a(l,r,n){var o=l;function i(){var T=d(l);if(T===null)throw new Error("Malformed timestamp: "+o);return l=l.replace(/^[^\sa-zA-Z-]+/,""),T}function f(T,g){var w=new E;y(T,function(b,S){var A;switch(b){case"region":for(var p=n.length-1;p>=0;p--)if(n[p].id===S){w.set(b,n[p].region);break}break;case"vertical":w.alt(b,S,["rl","lr"]);break;case"line":A=S.split(","),w.integer(b,A[0]),w.percent(b,A[0])&&w.set("snapToLines",!1),w.alt(b,A[0],["auto"]),A.length===2&&w.alt("lineAlign",A[1],["start",u,"end"]);break;case"position":A=S.split(","),w.percent(b,A[0]),A.length===2&&w.alt("positionAlign",A[1],["start",u,"end","line-left","line-right","auto"]);break;case"size":w.percent(b,S);break;case"align":w.alt(b,S,["start",u,"end","left","right"]);break}},/:/,/\s/),g.region=w.get("region",null),g.vertical=w.get("vertical","");var C=w.get("line","auto");C==="auto"&&v.line===-1&&(C=-1),g.line=C,g.lineAlign=w.get("lineAlign","start"),g.snapToLines=w.get("snapToLines",!0),g.size=w.get("size",100),g.align=w.get("align",u);var x=w.get("position","auto");x==="auto"&&v.position===50&&(x=g.align==="start"||g.align==="left"?0:g.align==="end"||g.align==="right"?100:50),g.position=x}function h(){l=l.replace(/^\s+/,"")}if(h(),r.startTime=i(),h(),l.substr(0,3)!=="-->")throw new Error("Malformed time stamp (time stamps must be separated by '-->'): "+o);l=l.substr(3),h(),r.endTime=i(),h(),f(l,r)}function c(l){return l.replace(/<br(?: \/)?>/gi,`
|
|
|
`)}var s=function(){function l(){this.state="INITIAL",this.buffer="",this.decoder=new O,this.regionList=[],this.cue=null,this.oncue=void 0,this.onparsingerror=void 0,this.onflush=void 0}var r=l.prototype;return r.parse=function(o){var i=this;o&&(i.buffer+=i.decoder.decode(o,{stream:!0}));function f(){var x=i.buffer,b=0;for(x=c(x);b<x.length&&x[b]!=="\r"&&x[b]!==`
|
|
|
`;)++b;var S=x.substr(0,b);return x[b]==="\r"&&++b,x[b]===`
|
|
|
`&&++b,i.buffer=x.substr(b),S}function h(x){y(x,function(b,S){},/:/)}try{var T="";if(i.state==="INITIAL"){if(!/\r\n|\n/.test(i.buffer))return this;T=f();var g=T.match(/^()?WEBVTT([ \t].*)?$/);if(!g||!g[0])throw new Error("Malformed WebVTT signature.");i.state="HEADER"}for(var w=!1;i.buffer;){if(!/\r\n|\n/.test(i.buffer))return this;w?w=!1:T=f();switch(i.state){case"HEADER":/:/.test(T)?h(T):T||(i.state="ID");continue;case"NOTE":T||(i.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(T)){i.state="NOTE";break}if(!T)continue;if(i.cue=new R.default(0,0,""),i.state="CUE",T.indexOf("-->")===-1){i.cue.id=T;continue}case"CUE":if(!i.cue){i.state="BADCUE";continue}try{a(T,i.cue,i.regionList)}catch(x){i.cue=null,i.state="BADCUE";continue}i.state="CUETEXT";continue;case"CUETEXT":{var C=T.indexOf("-->")!==-1;if(!T||C&&(w=!0)){i.oncue&&i.cue&&i.oncue(i.cue),i.cue=null,i.state="ID";continue}if(i.cue===null)continue;i.cue.text&&(i.cue.text+=`
|
|
|
`),i.cue.text+=T}continue;case"BADCUE":T||(i.state="ID")}}}catch(x){i.state==="CUETEXT"&&i.cue&&i.oncue&&i.oncue(i.cue),i.cue=null,i.state=i.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this},r.flush=function(){var o=this;try{if((o.cue||o.state==="HEADER")&&(o.buffer+=`
|
|
|
|
|
|
`,o.parse()),o.state==="INITIAL"||o.state==="BADWEBVTT")throw new Error("Malformed WebVTT signature.")}catch(i){o.onparsingerror&&o.onparsingerror(i)}return o.onflush&&o.onflush(),this},l}()},"./src/utils/webvtt-parser.ts":function(j,k,D){"use strict";D.r(k),D.d(k,"generateCueId",function(){return s}),D.d(k,"parseWebVTT",function(){return r});var R=D("./src/polyfills/number.ts"),O=D("./src/utils/vttparser.ts"),d=D("./src/demux/id3.ts"),E=D("./src/utils/timescale-conversion.ts"),y=D("./src/remux/mp4-remuxer.ts"),v=/\r\n|\n\r|\n|\r/g,u=function(o,i,f){return f===void 0&&(f=0),o.substr(f,i.length)===i},a=function(o){var i=parseInt(o.substr(-3)),f=parseInt(o.substr(-6,2)),h=parseInt(o.substr(-9,2)),T=o.length>9?parseInt(o.substr(0,o.indexOf(":"))):0;if(!Object(R.isFiniteNumber)(i)||!Object(R.isFiniteNumber)(f)||!Object(R.isFiniteNumber)(h)||!Object(R.isFiniteNumber)(T))throw Error("Malformed X-TIMESTAMP-MAP: Local:"+o);return i+=1e3*f,i+=60*1e3*h,i+=60*60*1e3*T,i},c=function(o){for(var i=5381,f=o.length;f;)i=i*33^o.charCodeAt(--f);return(i>>>0).toString()};function s(n,o,i){return c(n.toString())+c(o.toString())+c(i)}var l=function(o,i,f){var h=o[i],T=o[h.prevCC];if(!T||!T.new&&h.new){o.ccOffset=o.presentationOffset=h.start,h.new=!1;return}for(;(g=T)!==null&&g!==void 0&&g.new;){var g;o.ccOffset+=h.start-T.start,h.new=!1,h=T,T=o[h.prevCC]}o.presentationOffset=f};function r(n,o,i,f,h,T,g,w){var C=new O.VTTParser,x=Object(d.utf8ArrayToStr)(new Uint8Array(n)).trim().replace(v,`
|
|
|
`).split(`
|
|
|
`),b=[],S=Object(E.toMpegTsClockFromTimescale)(o,i),A="00:00.000",p=0,I=0,M,P=!0,B=!1;C.oncue=function(H){var F=f[h],W=f.ccOffset,U=(p-S)/9e4;if(F!=null&&F.new&&(I!==void 0?W=f.ccOffset=F.start:l(f,h,U)),U&&(W=U-f.presentationOffset),B){var K=H.endTime-H.startTime,G=Object(y.normalizePts)((H.startTime+W-I)*9e4,T*9e4)/9e4;H.startTime=G,H.endTime=G+K}var ae=H.text.trim();H.text=decodeURIComponent(encodeURIComponent(ae)),H.id||(H.id=s(H.startTime,H.endTime,ae)),H.endTime>0&&b.push(H)},C.onparsingerror=function(H){M=H},C.onflush=function(){if(M){w(M);return}g(b)},x.forEach(function(H){if(P)if(u(H,"X-TIMESTAMP-MAP=")){P=!1,B=!0,H.substr(16).split(",").forEach(function(F){u(F,"LOCAL:")?A=F.substr(6):u(F,"MPEGTS:")&&(p=parseInt(F.substr(7)))});try{I=a(A)/1e3}catch(F){B=!1,M=F}return}else H===""&&(P=!1);C.parse(H+`
|
|
|
`)}),C.flush()}},"./src/utils/xhr-loader.ts":function(j,k,D){"use strict";D.r(k);var R=D("./src/utils/logger.ts"),O=D("./src/loader/load-stats.ts"),d=/^age:\s*[\d.]+\s*$/m,E=function(){function y(u){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=u?u.xhrSetup:null,this.stats=new O.LoadStats,this.retryDelay=0}var v=y.prototype;return v.destroy=function(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null},v.abortInternal=function(){var a=this.loader;self.clearTimeout(this.requestTimeout),self.clearTimeout(this.retryTimeout),a&&(a.onreadystatechange=null,a.onprogress=null,a.readyState!==4&&(this.stats.aborted=!0,a.abort()))},v.abort=function(){var a;this.abortInternal(),(a=this.callbacks)!==null&&a!==void 0&&a.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)},v.load=function(a,c,s){if(this.stats.loading.start)throw new Error("Loader can only be used once.");this.stats.loading.start=self.performance.now(),this.context=a,this.config=c,this.callbacks=s,this.retryDelay=c.retryDelay,this.loadInternal()},v.loadInternal=function(){var a=this.config,c=this.context;if(!a)return;var s=this.loader=new self.XMLHttpRequest,l=this.stats;l.loading.first=0,l.loaded=0;var r=this.xhrSetup;try{if(r)try{r(s,c.url)}catch(i){s.open("GET",c.url,!0),r(s,c.url)}s.readyState||s.open("GET",c.url,!0);var n=this.context.headers;if(n)for(var o in n)s.setRequestHeader(o,n[o])}catch(i){this.callbacks.onError({code:s.status,text:i.message},c,s);return}c.rangeEnd&&s.setRequestHeader("Range","bytes="+c.rangeStart+"-"+(c.rangeEnd-1)),s.onreadystatechange=this.readystatechange.bind(this),s.onprogress=this.loadprogress.bind(this),s.responseType=c.responseType,self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),a.timeout),s.send()},v.readystatechange=function(){var a=this.context,c=this.loader,s=this.stats;if(!a||!c)return;var l=c.readyState,r=this.config;if(s.aborted)return;if(l>=2)if(self.clearTimeout(this.requestTimeout),s.loading.first===0&&(s.loading.first=Math.max(self.performance.now(),s.loading.start)),l===4){c.onreadystatechange=null,c.onprogress=null;var n=c.status;if(n>=200&&n<300){s.loading.end=Math.max(self.performance.now(),s.loading.first);var o,i;if(a.responseType==="arraybuffer"?(o=c.response,i=o.byteLength):(o=c.responseText,i=o.length),s.loaded=s.total=i,!this.callbacks)return;var f=this.callbacks.onProgress;if(f&&f(s,a,o,c),!this.callbacks)return;var h={url:c.responseURL,data:o};this.callbacks.onSuccess(h,s,a,c)}else s.retry>=r.maxRetry||n>=400&&n<499?(R.logger.error(n+" while loading "+a.url),this.callbacks.onError({code:n,text:c.statusText},a,c)):(R.logger.warn(n+" while loading "+a.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,r.maxRetryDelay),s.retry++)}else self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),r.timeout)},v.loadtimeout=function(){R.logger.warn("timeout while loading "+this.context.url);var a=this.callbacks;a&&(this.abortInternal(),a.onTimeout(this.stats,this.context,this.loader))},v.loadprogress=function(a){var c=this.stats;c.loaded=a.loaded,a.lengthComputable&&(c.total=a.total)},v.getCacheAge=function(){var a=null;if(this.loader&&d.test(this.loader.getAllResponseHeaders())){var c=this.loader.getResponseHeader("age");a=c?parseFloat(c):null}return a},y}();k.default=E}}).default})},vHTk:function(Je,le,re){Je.exports={wrp:"wrp___z2l1F",bgBlack:"bgBlack___3ezfX",monaco:"monaco___1ypjT",darkBlue:"darkBlue___2ViJc",close:"close___3q-z4",embed:"embed___3dQqc"}},vewr:function(Je,le,re){"use strict";Object.defineProperty(le,"__esModule",{value:!0}),le.getPointerEvent=j,le.stopEvent=k,le.setCapture=y,le.releaseCapture=v;function j(u){return u.changedTouches?u.changedTouches[0]:u.touches?u.touches[0]:u}function k(u){u.stopPropagation(),u.preventDefault()}var D=!1,R=null;document.captureElement=null;function O(u){if(D)return;var a=new u.constructor(u.type,u);D=!0,document.captureElement?document.captureElement.dispatchEvent(a):R.dispatchEvent(a),D=!1,u.stopPropagation(),a.defaultPrevented&&u.preventDefault(),u.type==="mouseup"&&v()}function d(){var u=document.getElementById("noVNC_mouse_capture_elem");u.style.cursor=window.getComputedStyle(document.captureElement).cursor}var E=new MutationObserver(d);function y(u){if(u.setCapture)u.setCapture(),document.captureElement=u,u.addEventListener("mouseup",v);else{v();var a=document.getElementById("noVNC_mouse_capture_elem");a===null&&(a=document.createElement("div"),a.id="noVNC_mouse_capture_elem",a.style.position="fixed",a.style.top="0px",a.style.left="0px",a.style.width="100%",a.style.height="100%",a.style.zIndex=1e4,a.style.display="none",document.body.appendChild(a),a.addEventListener("contextmenu",O),a.addEventListener("mousemove",O),a.addEventListener("mouseup",O)),document.captureElement=u,E.observe(u,{attributes:!0}),d(),a.style.display="",window.addEventListener("mousemove",O),window.addEventListener("mouseup",O)}}function v(){if(document.releaseCapture)document.releaseCapture(),document.captureElement=null;else{if(!document.captureElement)return;R=document.captureElement,document.captureElement=null,E.disconnect();var u=document.getElementById("noVNC_mouse_capture_elem");u.style.display="none",window.removeEventListener("mousemove",O),window.removeEventListener("mouseup",O)}}},whVF:function(Je,le,re){"use strict";Object.defineProperty(le,"__esModule",{value:!0}),le.default=void 0;var j=re("lNSK"),k=D(re("1q3G"));function D(y){return y&&y.__esModule?y:{default:y}}function R(y,v){if(!(y instanceof v))throw new TypeError("Cannot call a class as a function")}function O(y,v){for(var u=0;u<v.length;u++){var a=v[u];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(y,a.key,a)}}function d(y,v,u){return v&&O(y.prototype,v),u&&O(y,u),y}var E=function(){function y(){R(this,y),this.strm=new k.default,this.chunkSize=1024*10*10,this.outputBuffer=new Uint8Array(this.chunkSize),this.windowBits=5,(0,j.deflateInit)(this.strm,this.windowBits)}return d(y,[{key:"deflate",value:function(u){this.strm.input=u,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 a=(0,j.deflate)(this.strm,j.Z_FULL_FLUSH),c=new Uint8Array(this.strm.output.buffer,0,this.strm.next_out);if(a<0)throw new Error("zlib deflate failed");if(this.strm.avail_in>0){var s=[c],l=c.length;do{if(this.strm.output=new Uint8Array(this.chunkSize),this.strm.next_out=0,this.strm.avail_out=this.chunkSize,a=(0,j.deflate)(this.strm,j.Z_FULL_FLUSH),a<0)throw new Error("zlib deflate failed");var r=new Uint8Array(this.strm.output.buffer,0,this.strm.next_out);l+=r.length,s.push(r)}while(this.strm.avail_in>0);for(var n=new Uint8Array(l),o=0,i=0;i<s.length;i++)n.set(s[i],o),o+=s[i].length;c=n}return this.strm.input=null,this.strm.avail_in=0,this.strm.next_in=0,c}}]),y}();le.default=E},xO64:function(Je,le,re){"use strict";Object.defineProperty(le,"__esModule",{value:!0}),le.default=void 0;var j=k(re("8K/p"));function k(r){return r&&r.__esModule?r:{default:r}}function D(r){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?D=function(o){return typeof o}:D=function(o){return o&&typeof Symbol=="function"&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},D(r)}function R(r,n){if(!(r instanceof n))throw new TypeError("Cannot call a class as a function")}function O(r,n){for(var o=0;o<n.length;o++){var i=n[o];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(r,i.key,i)}}function d(r,n,o){return n&&O(r.prototype,n),o&&O(r,o),r}function E(r,n){if(typeof n!="function"&&n!==null)throw new TypeError("Super expression must either be null or a function");r.prototype=Object.create(n&&n.prototype,{constructor:{value:r,writable:!0,configurable:!0}}),n&&y(r,n)}function y(r,n){return y=Object.setPrototypeOf||function(i,f){return i.__proto__=f,i},y(r,n)}function v(r){var n=c();return function(){var i=s(r),f;if(n){var h=s(this).constructor;f=Reflect.construct(i,arguments,h)}else f=i.apply(this,arguments);return u(this,f)}}function u(r,n){return n&&(D(n)==="object"||typeof n=="function")?n:a(r)}function a(r){if(r===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return r}function c(){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(r){return!1}}function s(r){return s=Object.setPrototypeOf?Object.getPrototypeOf:function(o){return o.__proto__||Object.getPrototypeOf(o)},s(r)}var l=function(r){E(o,r);var n=v(o);function o(){return R(this,o),n.apply(this,arguments)}return d(o,[{key:"_pngRect",value:function(f,h,T,g,w,C,x){var b=this._readData(w);return b===null?!1:(C.imageRect(f,h,T,g,"image/png",b),!0)}},{key:"_basicRect",value:function(f,h,T,g,w,C,x,b){throw new Error("BasicCompression received in TightPNG rect")}}]),o}(j.default);le.default=l},xSIq:function(Je,le,re){"use strict";Object.defineProperty(le,"__esModule",{value:!0}),le.default=void 0;var j={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"};le.default=j},xlC8:function(Je,le,re){"use strict";Object.defineProperty(le,"__esModule",{value:!0}),le.default=j;function j(k,D,R,O){for(var d=k&65535|0,E=k>>>16&65535|0,y=0;R!==0;){y=R>2e3?2e3:R,R-=y;do d=d+D[O++]|0,E=E+d|0;while(--y);d%=65521,E%=65521}return d|E<<16|0}}}]);
|