You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
NewEduCoderBuild/p__Forums__Detail__id.a4245...

440 lines
1.1 MiB

(window.webpackJsonp=window.webpackJsonp||[]).push([[174,5,7,9],{"+NIl":function(tt,Ee,J){(function(oe){oe(J("VrN/"))})(function(oe){"use strict";oe.defineMode("stex",function($,k){"use strict";function z(h,o){h.cmdState.push(o)}function U(h){return h.cmdState.length>0?h.cmdState[h.cmdState.length-1]:null}function L(h){var o=h.cmdState.pop();o&&o.closeBracket()}function W(h){for(var o=h.cmdState,p=o.length-1;p>=0;p--){var l=o[p];if(l.name=="DEFAULT")continue;return l}return{styleIdentifier:function(){return null}}}function H(h,o,p){return function(){this.name=h,this.bracketNo=0,this.style=o,this.styles=p,this.argument=null,this.styleIdentifier=function(){return this.styles[this.bracketNo-1]||null},this.openBracket=function(){return this.bracketNo++,"bracket"},this.closeBracket=function(){}}}var n={};n.importmodule=H("importmodule","tag",["string","builtin"]),n.documentclass=H("documentclass","tag",["","atom"]),n.usepackage=H("usepackage","tag",["atom"]),n.begin=H("begin","tag",["atom"]),n.end=H("end","tag",["atom"]),n.label=H("label","tag",["atom"]),n.ref=H("ref","tag",["atom"]),n.eqref=H("eqref","tag",["atom"]),n.cite=H("cite","tag",["atom"]),n.bibitem=H("bibitem","tag",["atom"]),n.Bibitem=H("Bibitem","tag",["atom"]),n.RBibitem=H("RBibitem","tag",["atom"]),n.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}};function I(h,o){h.f=o}function g(h,o){var p;if(h.match(/^\\[a-zA-Z@]+/)){var l=h.current().slice(1);return p=n.hasOwnProperty(l)?n[l]:n.DEFAULT,p=new p,z(o,p),I(o,m),p.style}if(h.match(/^\\[$&%#{}_]/))return"tag";if(h.match(/^\\[,;!\/\\]/))return"tag";if(h.match("\\["))return I(o,function(a,s){return f(a,s,"\\]")}),"keyword";if(h.match("\\("))return I(o,function(a,s){return f(a,s,"\\)")}),"keyword";if(h.match("$$"))return I(o,function(a,s){return f(a,s,"$$")}),"keyword";if(h.match("$"))return I(o,function(a,s){return f(a,s,"$")}),"keyword";var u=h.next();if(u=="%")return h.skipToEnd(),"comment";if(u=="}"||u=="]"){if(p=U(o),p)p.closeBracket(u),I(o,m);else return"error";return"bracket"}else return u=="{"||u=="["?(p=n.DEFAULT,p=new p,z(o,p),"bracket"):/\d/.test(u)?(h.eatWhile(/[\w.%]/),"atom"):(h.eatWhile(/[\w\-_]/),p=W(o),p.name=="begin"&&(p.argument=h.current()),p.styleIdentifier())}function f(h,o,p){if(h.eatSpace())return null;if(p&&h.match(p))return I(o,g),"keyword";if(h.match(/^\\[a-zA-Z@]+/))return"tag";if(h.match(/^[a-zA-Z]+/))return"variable-2";if(h.match(/^\\[$&%#{}_]/))return"tag";if(h.match(/^\\[,;!\/]/))return"tag";if(h.match(/^[\^_&]/))return"tag";if(h.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(h.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var l=h.next();return l=="{"||l=="}"||l=="["||l=="]"||l=="("||l==")"?"bracket":l=="%"?(h.skipToEnd(),"comment"):"error"}function m(h,o){var p=h.peek(),l;return p=="{"||p=="["?(l=U(o),l.openBracket(p),h.eat(p),I(o,g),"bracket"):/[ \t\r]/.test(p)?(h.eat(p),null):(I(o,g),L(o),g(h,o))}return{startState:function(){var h=k.inMathMode?function(o,p){return f(o,p)}:g;return{cmdState:[],f:h}},copyState:function(h){return{cmdState:h.cmdState.slice(),f:h.f}},token:function(h,o){return o.f(h,o)},blankLine:function(h){h.f=g,h.cmdState.length=0},lineComment:"%"}}),oe.defineMIME("text/x-stex","stex"),oe.defineMIME("text/x-latex","stex")})},"+ua5":function(tt,Ee,J){},"/cxE":function(tt,Ee,J){"use strict";J.d(Ee,"f",function(){return k}),J.d(Ee,"g",function(){return z}),J.d(Ee,"h",function(){return U}),J.d(Ee,"e",function(){return W}),J.d(Ee,"b",function(){return H}),J.d(Ee,"c",function(){return n}),J.d(Ee,"d",function(){return I}),J.d(Ee,"a",function(){return g});class oe{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(f){setTimeout(()=>{throw f.stack?new Error(f.message+`
`+f.stack):f},0)}}emit(f){this.listeners.forEach(m=>{m(f)})}onUnexpectedError(f){this.unexpectedErrorHandler(f),this.emit(f)}onUnexpectedExternalError(f){this.unexpectedErrorHandler(f)}}const $=new oe;function k(f){W(f)||$.onUnexpectedError(f);return}function z(f){W(f)||$.onUnexpectedExternalError(f);return}function U(f){if(f instanceof Error){let{name:m,message:h}=f;const o=f.stacktrace||f.stack;return{$isError:!0,name:m,message:h,stack:o}}return f}const L="Canceled";function W(f){return f instanceof Error&&f.name===L&&f.message===L}function H(){const f=new Error(L);return f.name=f.message,f}function n(f){return f?new Error(`Illegal argument: ${f}`):new Error("Illegal argument")}function I(f){return f?new Error(`Illegal state: ${f}`):new Error("Illegal state")}class g extends Error{constructor(f){super("NotSupported");f&&(this.message=f)}}},"19Vz":function(tt,Ee,J){(function(oe){oe(J("VrN/"))})(function(oe){oe.defineOption("placeholder","",function(H,n,I){var g=I&&I!=oe.Init;if(n&&!g)H.on("blur",U),H.on("change",L),H.on("swapDoc",L),oe.on(H.getInputField(),"compositionupdate",H.state.placeholderCompose=function(){z(H)}),L(H);else if(!n&&g){H.off("blur",U),H.off("change",L),H.off("swapDoc",L),oe.off(H.getInputField(),"compositionupdate",H.state.placeholderCompose),$(H);var f=H.getWrapperElement();f.className=f.className.replace(" CodeMirror-empty","")}n&&!H.hasFocus()&&U(H)});function $(H){H.state.placeholder&&(H.state.placeholder.parentNode.removeChild(H.state.placeholder),H.state.placeholder=null)}function k(H){$(H);var n=H.state.placeholder=document.createElement("pre");n.style.cssText="height: 0; overflow: visible",n.style.direction=H.getOption("direction"),n.className="CodeMirror-placeholder CodeMirror-line-like";var I=H.getOption("placeholder");typeof I=="string"&&(I=document.createTextNode(I)),n.appendChild(I),H.display.lineSpace.insertBefore(n,H.display.lineSpace.firstChild)}function z(H){setTimeout(function(){var n=!1,I=H.getInputField();I.nodeName=="TEXTAREA"?n=!I.value:H.lineCount()==1&&(n=!/[^\u200b]/.test(I.querySelector(".CodeMirror-line").textContent)),n?k(H):$(H)},20)}function U(H){W(H)&&k(H)}function L(H){var n=H.getWrapperElement(),I=W(H);n.className=n.className.replace(" CodeMirror-empty","")+(I?" CodeMirror-empty":""),I?k(H):$(H)}function W(H){return H.lineCount()===1&&H.getLine(0)===""}})},"1eCo":function(tt,Ee,J){(function(oe){oe(J("VrN/"))})(function(oe){"use strict";var $={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},k={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};oe.defineMode("xml",function(z,U){var L=z.indentUnit,W={},H=U.htmlMode?$:k;for(var n in H)W[n]=H[n];for(var n in U)W[n]=U[n];var I,g;function f(c,x){function v(B){return x.tokenize=B,B(c,x)}var y=c.next();if(y=="<")return c.eat("!")?c.eat("[")?c.match("CDATA[")?v(o("atom","]]>")):null:c.match("--")?v(o("comment","-->")):c.match("DOCTYPE",!0,!0)?(c.eatWhile(/[\w\._\-]/),v(p(1))):null:c.eat("?")?(c.eatWhile(/[\w\._\-]/),x.tokenize=o("meta","?>"),"meta"):(I=c.eat("/")?"closeTag":"openTag",x.tokenize=m,"tag bracket");if(y=="&"){var F;return c.eat("#")?c.eat("x")?F=c.eatWhile(/[a-fA-F\d]/)&&c.eat(";"):F=c.eatWhile(/[\d]/)&&c.eat(";"):F=c.eatWhile(/[\w\.\-:]/)&&c.eat(";"),F?"atom":"error"}else return c.eatWhile(/[^&<]/),null}f.isInText=!0;function m(c,x){var v=c.next();if(v==">"||v=="/"&&c.eat(">"))return x.tokenize=f,I=v==">"?"endTag":"selfcloseTag","tag bracket";if(v=="=")return I="equals",null;if(v=="<"){x.tokenize=f,x.state=s,x.tagName=x.tagStart=null;var y=x.tokenize(c,x);return y?y+" tag error":"tag error"}else return/[\'\"]/.test(v)?(x.tokenize=h(v),x.stringStartCol=c.column(),x.tokenize(c,x)):(c.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function h(c){var x=function(v,y){for(;!v.eol();)if(v.next()==c){y.tokenize=m;break}return"string"};return x.isInAttribute=!0,x}function o(c,x){return function(v,y){for(;!v.eol();){if(v.match(x)){y.tokenize=f;break}v.next()}return c}}function p(c){return function(x,v){for(var y;(y=x.next())!=null;){if(y=="<")return v.tokenize=p(c+1),v.tokenize(x,v);if(y==">")if(c==1){v.tokenize=f;break}else return v.tokenize=p(c-1),v.tokenize(x,v)}return"meta"}}function l(c,x,v){this.prev=c.context,this.tagName=x,this.indent=c.indented,this.startOfLine=v,(W.doNotIndent.hasOwnProperty(x)||c.context&&c.context.noIndent)&&(this.noIndent=!0)}function u(c){c.context&&(c.context=c.context.prev)}function a(c,x){for(var v;;){if(!c.context)return;if(v=c.context.tagName,!W.contextGrabbers.hasOwnProperty(v)||!W.contextGrabbers[v].hasOwnProperty(x))return;u(c)}}function s(c,x,v){return c=="openTag"?(v.tagStart=x.column(),C):c=="closeTag"?_:s}function C(c,x,v){return c=="word"?(v.tagName=x.current(),g="tag",R):W.allowMissingTagName&&c=="endTag"?(g="tag bracket",R(c,x,v)):(g="error",C)}function _(c,x,v){if(c=="word"){var y=x.current();return v.context&&v.context.tagName!=y&&W.implicitlyClosed.hasOwnProperty(v.context.tagName)&&u(v),v.context&&v.context.tagName==y||W.matchClosing===!1?(g="tag",w):(g="tag error",O)}else return W.allowMissingTagName&&c=="endTag"?(g="tag bracket",w(c,x,v)):(g="error",O)}function w(c,x,v){return c!="endTag"?(g="error",w):(u(v),s)}function O(c,x,v){return g="error",w(c,x,v)}function R(c,x,v){if(c=="word")return g="attribute",S;if(c=="endTag"||c=="selfcloseTag"){var y=v.tagName,F=v.tagStart;return v.tagName=v.tagStart=null,c=="selfcloseTag"||W.autoSelfClosers.hasOwnProperty(y)?a(v,y):(a(v,y),v.context=new l(v,y,F==v.indented)),s}return g="error",R}function S(c,x,v){return c=="equals"?T:(W.allowMissing||(g="error"),R(c,x,v))}function T(c,x,v){return c=="string"?E:c=="word"&&W.allowUnquoted?(g="string",R):(g="error",R(c,x,v))}function E(c,x,v){return c=="string"?E:R(c,x,v)}return{startState:function(c){var x={tokenize:f,state:s,indented:c||0,tagName:null,tagStart:null,context:null};return c!=null&&(x.baseIndent=c),x},token:function(c,x){if(!x.tagName&&c.sol()&&(x.indented=c.indentation()),c.eatSpace())return null;I=null;var v=x.tokenize(c,x);return(v||I)&&v!="comment"&&(g=null,x.state=x.state(I||v,c,x),g&&(v=g=="error"?v+" error":g)),v},indent:function(c,x,v){var y=c.context;if(c.tokenize.isInAttribute)return c.tagStart==c.indented?c.stringStartCol+1:c.indented+L;if(y&&y.noIndent)return oe.Pass;if(c.tokenize!=m&&c.tokenize!=f)return v?v.match(/^(\s*)/)[0].length:0;if(c.tagName)return W.multilineTagIndentPastTag!==!1?c.tagStart+c.tagName.length+2:c.tagStart+L*(W.multilineTagIndentFactor||1);if(W.alignCDATA&&/<!\[CDATA\[/.test(x))return 0;var F=x&&/^<(\/)?([\w_:\.-]*)/.exec(x);if(F&&F[1])for(;y;)if(y.tagName==F[2]){y=y.prev;break}else if(W.implicitlyClosed.hasOwnProperty(y.tagName))y=y.prev;else break;else if(F)for(;y;){var B=W.contextGrabbers[y.tagName];if(B&&B.hasOwnProperty(F[2]))y=y.prev;else break}for(;y&&y.prev&&!y.startOfLine;)y=y.prev;return y?y.indent+L:c.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:W.htmlMode?"html":"xml",helperType:W.htmlMode?"html":"xml",skipAttribute:function(c){c.state==T&&(c.state=R)},xmlCurrentTag:function(c){return c.tagName?{name:c.tagName,close:c.type=="closeTag"}:null},xmlCurrentContext:function(c){for(var x=[],v=c.context;v;v=v.prev)v.tagName&&x.push(v.tagName);return x.reverse()}}}),oe.defineMIME("text/xml","xml"),oe.defineMIME("application/xml","xml"),oe.mimeModes.hasOwnProperty("text/html")||oe.defineMIME("text/html",{name:"xml",htmlMode:!0})})},"24hK":function(tt,Ee,J){"use strict";J.d(Ee,"a",function(){return $});class oe{constructor(k){this.element=k,this.next=oe.Undefined,this.prev=oe.Undefined}}oe.Undefined=new oe(void 0);class ${constructor(){this._first=oe.Undefined,this._last=oe.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===oe.Undefined}clear(){let k=this._first;for(;k!==oe.Undefined;){const z=k.next;k.prev=oe.Undefined,k.next=oe.Undefined,k=z}this._first=oe.Undefined,this._last=oe.Undefined,this._size=0}unshift(k){return this._insert(k,!1)}push(k){return this._insert(k,!0)}_insert(k,z){const U=new oe(k);if(this._first===oe.Undefined)this._first=U,this._last=U;else if(z){const W=this._last;this._last=U,U.prev=W,W.next=U}else{const W=this._first;this._first=U,U.next=W,W.prev=U}this._size+=1;let L=!1;return()=>{L||(L=!0,this._remove(U))}}shift(){if(this._first===oe.Undefined)return;{const k=this._first.element;return this._remove(this._first),k}}pop(){if(this._last===oe.Undefined)return;{const k=this._last.element;return this._remove(this._last),k}}_remove(k){if(k.prev!==oe.Undefined&&k.next!==oe.Undefined){const z=k.prev;z.next=k.next,k.next.prev=z}else k.prev===oe.Undefined&&k.next===oe.Undefined?(this._first=oe.Undefined,this._last=oe.Undefined):k.next===oe.Undefined?(this._last=this._last.prev,this._last.next=oe.Undefined):k.prev===oe.Undefined&&(this._first=this._first.next,this._first.prev=oe.Undefined);this._size-=1}*[Symbol.iterator](){let k=this._first;for(;k!==oe.Undefined;)yield k.element,k=k.next}}},"3/fG":function(tt,Ee,J){"use strict";J.d(Ee,"a",function(){return $});function oe(k,z){let U;return z.length===0?U=k:U=k.replace(/\{(\d+)\}/g,function(L,W){const H=W[0];return typeof z[H]!="undefined"?z[H]:L}),U}function $(k,z,...U){return oe(z,U)}},"55Ip":function(tt,Ee,J){"use strict";J.d(Ee,"a",function(){return a});var oe=J("Ty5D"),$=J("dI71"),k=J("q1tI"),z=J.n(k),U=J("YS25"),L=J("17x9"),W=J.n(L),H=J("wx14"),n=J("zLVn"),I=J("9R94"),g=function(T){Object($.a)(E,T);function E(){for(var x,v=arguments.length,y=new Array(v),F=0;F<v;F++)y[F]=arguments[F];return x=T.call.apply(T,[this].concat(y))||this,x.history=Object(U.a)(x.props),x}var c=E.prototype;return c.render=function(){return z.a.createElement(oe.c,{history:this.history,children:this.props.children})},E}(z.a.Component),f=function(T){Object($.a)(E,T);function E(){for(var x,v=arguments.length,y=new Array(v),F=0;F<v;F++)y[F]=arguments[F];return x=T.call.apply(T,[this].concat(y))||this,x.history=Object(U.b)(x.props),x}var c=E.prototype;return c.render=function(){return z.a.createElement(oe.c,{history:this.history,children:this.props.children})},E}(z.a.Component),m=function(E,c){return typeof E=="function"?E(c):E},h=function(E,c){return typeof E=="string"?Object(U.c)(E,null,null,c):E},o=function(E){return E},p=z.a.forwardRef;typeof p=="undefined"&&(p=o);function l(T){return!!(T.metaKey||T.altKey||T.ctrlKey||T.shiftKey)}var u=p(function(T,E){var c=T.innerRef,x=T.navigate,v=T.onClick,y=Object(n.a)(T,["innerRef","navigate","onClick"]),F=y.target,B=Object(H.a)({},y,{onClick:function(j){try{v&&v(j)}catch(P){throw j.preventDefault(),P}!j.defaultPrevented&&j.button===0&&(!F||F==="_self")&&!l(j)&&(j.preventDefault(),x())}});return o!==p?B.ref=E||c:B.ref=c,z.a.createElement("a",B)}),a=p(function(T,E){var c=T.component,x=c===void 0?u:c,v=T.replace,y=T.to,F=T.innerRef,B=Object(n.a)(T,["component","replace","to","innerRef"]);return z.a.createElement(oe.e.Consumer,null,function(A){A||Object(I.a)(!1);var j=A.history,P=h(m(y,A.location),A.location),b=P?j.createHref(P):"",V=Object(H.a)({},B,{href:b,navigate:function(){var ce=m(y,A.location),me=v?j.replace:j.push;me(ce)}});return o!==p?V.ref=E||F:V.innerRef=F,z.a.createElement(x,V)})});if(!1)var s,C;var _=function(E){return E},w=z.a.forwardRef;typeof w=="undefined"&&(w=_);function O(){for(var T=arguments.length,E=new Array(T),c=0;c<T;c++)E[c]=arguments[c];return E.filter(function(x){return x}).join(" ")}var R=w(function(T,E){var c=T["aria-current"],x=c===void 0?"page":c,v=T.activeClassName,y=v===void 0?"active":v,F=T.activeStyle,B=T.className,A=T.exact,j=T.isActive,P=T.location,b=T.sensitive,V=T.strict,re=T.style,ce=T.to,me=T.innerRef,De=Object(n.a)(T,["aria-current","activeClassName","activeStyle","className","exact","isActive","location","sensitive","strict","style","to","innerRef"]);return z.a.createElement(oe.e.Consumer,null,function(we){we||Object(I.a)(!1);var Le=P||we.location,Re=h(m(ce,Le),Le),Ie=Re.pathname,ye=Ie&&Ie.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1"),X=ye?Object(oe.f)(Le.pathname,{path:ye,exact:A,sensitive:b,strict:V}):null,M=!!(j?j(X,Le):X),N=M?O(B,y):B,Y=M?Object(H.a)({},re,{},F):re,ie=Object(H.a)({"aria-current":M&&x||null,className:N,style:Y,to:Re},De);return _!==w?ie.ref=E||me:ie.innerRef=me,z.a.createElement(a,ie)})});if(!1)var S},"5VLF":function(tt,Ee,J){"use strict";var oe,$;function k(z,U,L){var W=function(H,n){return z.js_beautify(H,n)};return W.js=z.js_beautify,W.css=U.css_beautify,W.html=L.html_beautify,W.js_beautify=z.js_beautify,W.css_beautify=U.css_beautify,W.html_beautify=L.html_beautify,W}!(oe=[J("6UM0"),J("TXwP"),J("psGv")],$=function(z,U,L){return k(z,U,L)}.apply(Ee,oe),$!==void 0&&(tt.exports=$))},"5Y4S":function(tt,Ee,J){"use strict";J.d(Ee,"a",function(){return k});var oe=J("MNsG");const $=oe.b.performance&&typeof oe.b.performance.now=="function";class k{constructor(z){this._highResolution=$&&z,this._startTime=this._now(),this._stopTime=-1}static create(z=!0){return new k(z)}stop(){this._stopTime=this._now()}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}_now(){return this._highResolution?oe.b.performance.now():Date.now()}}},"6UM0":function(tt,Ee,J){var oe,$;(function(){var k;(function(){"use strict";var U=[function(n,I,g){var f=g(1).Beautifier,m=g(5).Options;function h(o,p){var l=new f(o,p);return l.beautify()}n.exports=h,n.exports.defaultOptions=function(){return new m}},function(n,I,g){var f=g(2).Output,m=g(3).Token,h=g(4),o=g(5).Options,p=g(7).Tokenizer,l=g(7).line_starters,u=g(7).positionable_operators,a=g(7).TOKEN;function s(b,V){return V.indexOf(b)!==-1}function C(b){return b.replace(/^\s+/g,"")}function _(b){for(var V={},re=0;re<b.length;re++)V[b[re].replace(/-/g,"_")]=b[re];return V}function w(b,V){return b&&b.type===a.RESERVED&&b.text===V}function O(b,V){return b&&b.type===a.RESERVED&&s(b.text,V)}var R=["case","return","do","if","throw","else","await","break","continue","async"],S=["before-newline","after-newline","preserve-newline"],T=_(S),E=[T.before_newline,T.preserve_newline],c={BlockStatement:"BlockStatement",Statement:"Statement",ObjectLiteral:"ObjectLiteral",ArrayLiteral:"ArrayLiteral",ForInitializer:"ForInitializer",Conditional:"Conditional",Expression:"Expression"};function x(b,V){if(V.multiline_frame||V.mode===c.ForInitializer||V.mode===c.Conditional)return;b.remove_indent(V.start_line_index)}function v(b){b=b.replace(h.allLineBreaks,`
`);for(var V=[],re=b.indexOf(`
`);re!==-1;)V.push(b.substring(0,re)),b=b.substring(re+1),re=b.indexOf(`
`);return b.length&&V.push(b),V}function y(b){return b===c.ArrayLiteral}function F(b){return s(b,[c.Expression,c.ForInitializer,c.Conditional])}function B(b,V){for(var re=0;re<b.length;re++){var ce=b[re].trim();if(ce.charAt(0)!==V)return!1}return!0}function A(b,V){for(var re=0,ce=b.length,me;re<ce;re++)if(me=b[re],me&&me.indexOf(V)!==0)return!1;return!0}function j(b,V){V=V||{},this._source_text=b||"",this._output=null,this._tokens=null,this._last_last_text=null,this._flags=null,this._previous_flags=null,this._flag_store=null,this._options=new o(V)}j.prototype.create_flags=function(b,V){var re=0;b&&(re=b.indentation_level,!this._output.just_added_newline()&&b.line_indent_level>re&&(re=b.line_indent_level));var ce={mode:V,parent:b,last_token:b?b.last_token:new m(a.START_BLOCK,""),last_word:b?b.last_word:"",declaration_statement:!1,declaration_assignment:!1,multiline_frame:!1,inline_frame:!1,if_block:!1,else_block:!1,class_start_block:!1,do_block:!1,do_while:!1,import_block:!1,in_case_statement:!1,in_case:!1,case_body:!1,case_block:!1,indentation_level:re,alignment:0,line_indent_level:b?b.line_indent_level:re,start_line_index:this._output.get_line_number(),ternary_depth:0};return ce},j.prototype._reset=function(b){var V=b.match(/^[\t ]*/)[0];this._last_last_text="",this._output=new f(this._options,V),this._output.raw=this._options.test_output_raw,this._flag_store=[],this.set_mode(c.BlockStatement);var re=new p(b,this._options);return this._tokens=re.tokenize(),b},j.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var b,V=this._reset(this._source_text),re=this._options.eol;this._options.eol==="auto"&&(re=`
`,V&&h.lineBreak.test(V||"")&&(re=V.match(h.lineBreak)[0]));for(var ce=this._tokens.next();ce;)this.handle_token(ce),this._last_last_text=this._flags.last_token.text,this._flags.last_token=ce,ce=this._tokens.next();return b=this._output.get_code(re),b},j.prototype.handle_token=function(b,V){b.type===a.START_EXPR?this.handle_start_expr(b):b.type===a.END_EXPR?this.handle_end_expr(b):b.type===a.START_BLOCK?this.handle_start_block(b):b.type===a.END_BLOCK?this.handle_end_block(b):b.type===a.WORD?this.handle_word(b):b.type===a.RESERVED?this.handle_word(b):b.type===a.SEMICOLON?this.handle_semicolon(b):b.type===a.STRING?this.handle_string(b):b.type===a.EQUALS?this.handle_equals(b):b.type===a.OPERATOR?this.handle_operator(b):b.type===a.COMMA?this.handle_comma(b):b.type===a.BLOCK_COMMENT?this.handle_block_comment(b,V):b.type===a.COMMENT?this.handle_comment(b,V):b.type===a.DOT?this.handle_dot(b):b.type===a.EOF?this.handle_eof(b):b.type===a.UNKNOWN?this.handle_unknown(b,V):this.handle_unknown(b,V)},j.prototype.handle_whitespace_and_comments=function(b,V){var re=b.newlines,ce=this._options.keep_array_indentation&&y(this._flags.mode);if(b.comments_before)for(var me=b.comments_before.next();me;)this.handle_whitespace_and_comments(me,V),this.handle_token(me,V),me=b.comments_before.next();if(ce)for(var De=0;De<re;De+=1)this.print_newline(De>0,V);else if(this._options.max_preserve_newlines&&re>this._options.max_preserve_newlines&&(re=this._options.max_preserve_newlines),this._options.preserve_newlines&&re>1){this.print_newline(!1,V);for(var we=1;we<re;we+=1)this.print_newline(!0,V)}};var P=["async","break","continue","return","throw","yield"];j.prototype.allow_wrap_or_preserved_newline=function(b,V){if(V=V===void 0?!1:V,this._output.just_added_newline())return;var re=this._options.preserve_newlines&&b.newlines||V,ce=s(this._flags.last_token.text,u)||s(b.text,u);if(ce){var me=s(this._flags.last_token.text,u)&&s(this._options.operator_position,E)||s(b.text,u);re=re&&me}if(re)this.print_newline(!1,!0);else if(this._options.wrap_line_length){if(O(this._flags.last_token,P))return;this._output.set_wrap_point()}},j.prototype.print_newline=function(b,V){if(!V&&(this._flags.last_token.text!==";"&&this._flags.last_token.text!==","&&this._flags.last_token.text!=="="&&(this._flags.last_token.type!==a.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++")))for(var re=this._tokens.peek();this._flags.mode===c.Statement&&!(this._flags.if_block&&w(re,"else"))&&!this._flags.do_block;)this.restore_mode();this._output.add_new_line(b)&&(this._flags.multiline_frame=!0)},j.prototype.print_token_line_indentation=function(b){this._output.just_added_newline()&&(this._options.keep_array_indentation&&b.newlines&&(b.text==="["||y(this._flags.mode))?(this._output.current_line.set_indent(-1),this._output.current_line.push(b.whitespace_before),this._output.space_before_token=!1):this._output.set_indent(this._flags.indentation_level,this._flags.alignment)&&(this._flags.line_indent_level=this._flags.indentation_level))},j.prototype.print_token=function(b){if(this._output.raw){this._output.add_raw_token(b);return}if(this._options.comma_first&&b.previous&&b.previous.type===a.COMMA&&this._output.just_added_newline()&&this._output.previous_line.last()===","){var V=this._output.previous_line.pop();this._output.previous_line.is_empty()&&(this._output.previous_line.push(V),this._output.trim(!0),this._output.current_line.pop(),this._output.trim()),this.print_token_line_indentation(b),this._output.add_token(","),this._output.space_before_token=!0}this.print_token_line_indentation(b),this._output.non_breaking_space=!0,this._output.add_token(b.text),this._output.previous_token_wrapped&&(this._flags.multiline_frame=!0)},j.prototype.indent=function(){this._flags.indentation_level+=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},j.prototype.deindent=function(){this._flags.indentation_level>0&&(!this._flags.parent||this._flags.indentation_level>this._flags.parent.indentation_level)&&(this._flags.indentation_level-=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},j.prototype.set_mode=function(b){this._flags?(this._flag_store.push(this._flags),this._previous_flags=this._flags):this._previous_flags=this.create_flags(null,b),this._flags=this.create_flags(this._previous_flags,b),this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},j.prototype.restore_mode=function(){this._flag_store.length>0&&(this._previous_flags=this._flags,this._flags=this._flag_store.pop(),this._previous_flags.mode===c.Statement&&x(this._output,this._previous_flags),this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},j.prototype.start_of_object_property=function(){return this._flags.parent.mode===c.ObjectLiteral&&this._flags.mode===c.Statement&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||O(this._flags.last_token,["get","set"]))},j.prototype.start_of_statement=function(b){var V=!1;return V=V||O(this._flags.last_token,["var","let","const"])&&b.type===a.WORD,V=V||w(this._flags.last_token,"do"),V=V||!(this._flags.parent.mode===c.ObjectLiteral&&this._flags.mode===c.Statement)&&O(this._flags.last_token,P)&&!b.newlines,V=V||w(this._flags.last_token,"else")&&!(w(b,"if")&&!b.comments_before),V=V||this._flags.last_token.type===a.END_EXPR&&(this._previous_flags.mode===c.ForInitializer||this._previous_flags.mode===c.Conditional),V=V||this._flags.last_token.type===a.WORD&&this._flags.mode===c.BlockStatement&&!this._flags.in_case&&!(b.text==="--"||b.text==="++")&&this._last_last_text!=="function"&&b.type!==a.WORD&&b.type!==a.RESERVED,V=V||this._flags.mode===c.ObjectLiteral&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||O(this._flags.last_token,["get","set"])),V?(this.set_mode(c.Statement),this.indent(),this.handle_whitespace_and_comments(b,!0),this.start_of_object_property()||this.allow_wrap_or_preserved_newline(b,O(b,["do","for","if","while"])),!0):!1},j.prototype.handle_start_expr=function(b){this.start_of_statement(b)||this.handle_whitespace_and_comments(b);var V=c.Expression;if(b.text==="["){if(this._flags.last_token.type===a.WORD||this._flags.last_token.text===")"){O(this._flags.last_token,l)&&(this._output.space_before_token=!0),this.print_token(b),this.set_mode(V),this.indent(),this._options.space_in_paren&&(this._output.space_before_token=!0);return}V=c.ArrayLiteral,y(this._flags.mode)&&((this._flags.last_token.text==="["||this._flags.last_token.text===","&&(this._last_last_text==="]"||this._last_last_text==="}"))&&(this._options.keep_array_indentation||this.print_newline())),s(this._flags.last_token.type,[a.START_EXPR,a.END_EXPR,a.WORD,a.OPERATOR,a.DOT])||(this._output.space_before_token=!0)}else{if(this._flags.last_token.type===a.RESERVED)this._flags.last_token.text==="for"?(this._output.space_before_token=this._options.space_before_conditional,V=c.ForInitializer):s(this._flags.last_token.text,["if","while","switch"])?(this._output.space_before_token=this._options.space_before_conditional,V=c.Conditional):s(this._flags.last_word,["await","async"])?this._output.space_before_token=!0:this._flags.last_token.text==="import"&&b.whitespace_before===""?this._output.space_before_token=!1:(s(this._flags.last_token.text,l)||this._flags.last_token.text==="catch")&&(this._output.space_before_token=!0);else if(this._flags.last_token.type===a.EQUALS||this._flags.last_token.type===a.OPERATOR)this.start_of_object_property()||this.allow_wrap_or_preserved_newline(b);else if(this._flags.last_token.type===a.WORD){this._output.space_before_token=!1;var re=this._tokens.peek(-3);if(this._options.space_after_named_function&&re){var ce=this._tokens.peek(-4);O(re,["async","function"])||re.text==="*"&&O(ce,["async","function"])?this._output.space_before_token=!0:this._flags.mode===c.ObjectLiteral?(re.text==="{"||re.text===","||re.text==="*"&&(ce.text==="{"||ce.text===","))&&(this._output.space_before_token=!0):this._flags.parent&&this._flags.parent.class_start_block&&(this._output.space_before_token=!0)}}else this.allow_wrap_or_preserved_newline(b);(this._flags.last_token.type===a.RESERVED&&(this._flags.last_word==="function"||this._flags.last_word==="typeof")||this._flags.last_token.text==="*"&&(s(this._last_last_text,["function","yield"])||this._flags.mode===c.ObjectLiteral&&s(this._last_last_text,["{",","])))&&(this._output.space_before_token=this._options.space_after_anon_function)}this._flags.last_token.text===";"||this._flags.last_token.type===a.START_BLOCK?this.print_newline():(this._flags.last_token.type===a.END_EXPR||this._flags.last_token.type===a.START_EXPR||this._flags.last_token.type===a.END_BLOCK||this._flags.last_token.text==="."||this._flags.last_token.type===a.COMMA)&&this.allow_wrap_or_preserved_newline(b,b.newlines),this.print_token(b),this.set_mode(V),this._options.space_in_paren&&(this._output.space_before_token=!0),this.indent()},j.prototype.handle_end_expr=function(b){for(;this._flags.mode===c.Statement;)this.restore_mode();this.handle_whitespace_and_comments(b),this._flags.multiline_frame&&this.allow_wrap_or_preserved_newline(b,b.text==="]"&&y(this._flags.mode)&&!this._options.keep_array_indentation),this._options.space_in_paren&&(this._flags.last_token.type===a.START_EXPR&&!this._options.space_in_empty_paren?(this._output.trim(),this._output.space_before_token=!1):this._output.space_before_token=!0),this.deindent(),this.print_token(b),this.restore_mode(),x(this._output,this._previous_flags),this._flags.do_while&&this._previous_flags.mode===c.Conditional&&(this._previous_flags.mode=c.Expression,this._flags.do_block=!1,this._flags.do_while=!1)},j.prototype.handle_start_block=function(b){this.handle_whitespace_and_comments(b);var V=this._tokens.peek(),re=this._tokens.peek(1);this._flags.last_word==="switch"&&this._flags.last_token.type===a.END_EXPR?(this.set_mode(c.BlockStatement),this._flags.in_case_statement=!0):this._flags.case_body?this.set_mode(c.BlockStatement):re&&(s(re.text,[":",","])&&s(V.type,[a.STRING,a.WORD,a.RESERVED])||s(V.text,["get","set","..."])&&s(re.type,[a.WORD,a.RESERVED]))?s(this._last_last_text,["class","interface"])&&!s(re.text,[":",","])?this.set_mode(c.BlockStatement):this.set_mode(c.ObjectLiteral):this._flags.last_token.type===a.OPERATOR&&this._flags.last_token.text==="=>"?this.set_mode(c.BlockStatement):s(this._flags.last_token.type,[a.EQUALS,a.START_EXPR,a.COMMA,a.OPERATOR])||O(this._flags.last_token,["return","throw","import","default"])?this.set_mode(c.ObjectLiteral):this.set_mode(c.BlockStatement),this._flags.last_token&&(O(this._flags.last_token.previous,["class","extends"])&&(this._flags.class_start_block=!0));var ce=!V.comments_before&&V.text==="}",me=ce&&this._flags.last_word==="function"&&this._flags.last_token.type===a.END_EXPR;if(this._options.brace_preserve_inline){var De=0,we=null;this._flags.inline_frame=!0;do if(De+=1,we=this._tokens.peek(De-1),we.newlines){this._flags.inline_frame=!1;break}while(we.type!==a.EOF&&!(we.type===a.END_BLOCK&&we.opened===b))}(this._options.brace_style==="expand"||this._options.brace_style==="none"&&b.newlines)&&!this._flags.inline_frame?this._flags.last_token.type!==a.OPERATOR&&(me||this._flags.last_token.type===a.EQUALS||O(this._flags.last_token,R)&&this._flags.last_token.text!=="else")?this._output.space_before_token=!0:this.print_newline(!1,!0):(y(this._previous_flags.mode)&&(this._flags.last_token.type===a.START_EXPR||this._flags.last_token.type===a.COMMA)&&((this._flags.last_token.type===a.COMMA||this._options.space_in_paren)&&(this._output.space_before_token=!0),(this._flags.last_token.type===a.COMMA||this._flags.last_token.type===a.START_EXPR&&this._flags.inline_frame)&&(this.allow_wrap_or_preserved_newline(b),this._previous_flags.multiline_frame=this._previous_flags.multiline_frame||this._flags.multiline_frame,this._flags.multiline_frame=!1)),this._flags.last_token.type!==a.OPERATOR&&this._flags.last_token.type!==a.START_EXPR&&(this._flags.last_token.type===a.START_BLOCK&&!this._flags.inline_frame?this.print_newline():this._output.space_before_token=!0)),this.print_token(b),this.indent(),!ce&&!(this._options.brace_preserve_inline&&this._flags.inline_frame)&&this.print_newline()},j.prototype.handle_end_block=function(b){for(this.handle_whitespace_and_comments(b);this._flags.mode===c.Statement;)this.restore_mode();var V=this._flags.last_token.type===a.START_BLOCK;this._flags.inline_frame&&!V?this._output.space_before_token=!0:this._options.brace_style==="expand"?V||this.print_newline():V||(y(this._flags.mode)&&this._options.keep_array_indentation?(this._options.keep_array_indentation=!1,this.print_newline(),this._options.keep_array_indentation=!0):this.print_newline()),this.restore_mode(),this.print_token(b)},j.prototype.handle_word=function(b){if(b.type===a.RESERVED){if(s(b.text,["set","get"])&&this._flags.mode!==c.ObjectLiteral)b.type=a.WORD;else if(b.text==="import"&&s(this._tokens.peek().text,["(","."]))b.type=a.WORD;else if(s(b.text,["as","from"])&&!this._flags.import_block)b.type=a.WORD;else if(this._flags.mode===c.ObjectLiteral){var V=this._tokens.peek();V.text===":"&&(b.type=a.WORD)}}if(this.start_of_statement(b)?O(this._flags.last_token,["var","let","const"])&&b.type===a.WORD&&(this._flags.declaration_statement=!0):b.newlines&&!F(this._flags.mode)&&(this._flags.last_token.type!==a.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++")&&this._flags.last_token.type!==a.EQUALS&&(this._options.preserve_newlines||!O(this._flags.last_token,["var","let","const","set","get"]))?(this.handle_whitespace_and_comments(b),this.print_newline()):this.handle_whitespace_and_comments(b),this._flags.do_block&&!this._flags.do_while)if(w(b,"while")){this._output.space_before_token=!0,this.print_token(b),this._output.space_before_token=!0,this._flags.do_while=!0;return}else this.print_newline(),this._flags.do_block=!1;if(this._flags.if_block)if(!this._flags.else_block&&w(b,"else"))this._flags.else_block=!0;else{for(;this._flags.mode===c.Statement;)this.restore_mode();this._flags.if_block=!1,this._flags.else_block=!1}if(this._flags.in_case_statement&&O(b,["case","default"])){this.print_newline(),!this._flags.case_block&&(this._flags.case_body||this._options.jslint_happy)&&this.deindent(),this._flags.case_body=!1,this.print_token(b),this._flags.in_case=!0;return}if((this._flags.last_token.type===a.COMMA||this._flags.last_token.type===a.START_EXPR||this._flags.last_token.type===a.EQUALS||this._flags.last_token.type===a.OPERATOR)&&(this.start_of_object_property()||this.allow_wrap_or_preserved_newline(b)),w(b,"function")){(s(this._flags.last_token.text,["}",";"])||this._output.just_added_newline()&&!(s(this._flags.last_token.text,["(","[","{",":","=",","])||this._flags.last_token.type===a.OPERATOR))&&(!this._output.just_added_blankline()&&!b.comments_before&&(this.print_newline(),this.print_newline(!0))),this._flags.last_token.type===a.RESERVED||this._flags.last_token.type===a.WORD?O(this._flags.last_token,["get","set","new","export"])||O(this._flags.last_token,P)?this._output.space_before_token=!0:w(this._flags.last_token,"default")&&this._last_last_text==="export"?this._output.space_before_token=!0:this._flags.last_token.text==="declare"?this._output.space_before_token=!0:this.print_newline():this._flags.last_token.type===a.OPERATOR||this._flags.last_token.text==="="?this._output.space_before_token=!0:!this._flags.multiline_frame&&(F(this._flags.mode)||y(this._flags.mode))||this.print_newline(),this.print_token(b),this._flags.last_word=b.text;return}var re="NONE";if(this._flags.last_token.type===a.END_BLOCK?this._previous_flags.inline_frame?re="SPACE":O(b,["else","catch","finally","from"])?this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&b.newlines?re="NEWLINE":(re="SPACE",this._output.space_before_token=!0):re="NEWLINE":this._flags.last_token.type===a.SEMICOLON&&this._flags.mode===c.BlockStatement?re="NEWLINE":this._flags.last_token.type===a.SEMICOLON&&F(this._flags.mode)?re="SPACE":this._flags.last_token.type===a.STRING?re="NEWLINE":this._flags.last_token.type===a.RESERVED||this._flags.last_token.type===a.WORD||this._flags.last_token.text==="*"&&(s(this._last_last_text,["function","yield"])||this._flags.mode===c.ObjectLiteral&&s(this._last_last_text,["{",","]))?re="SPACE":this._flags.last_token.type===a.START_BLOCK?this._flags.inline_frame?re="SPACE":re="NEWLINE":this._flags.last_token.type===a.END_EXPR&&(this._output.space_before_token=!0,re="NEWLINE"),O(b,l)&&this._flags.last_token.text!==")"&&(this._flags.inline_frame||this._flags.last_token.text==="else"||this._flags.last_token.text==="export"?re="SPACE":re="NEWLINE"),O(b,["else","catch","finally"]))if((!(this._flags.last_token.type===a.END_BLOCK&&this._previous_flags.mode===c.BlockStatement)||this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&b.newlines)&&!this._flags.inline_frame)this.print_newline();else{this._output.trim(!0);var ce=this._output.current_line;ce.last()!=="}"&&this.print_newline(),this._output.space_before_token=!0}else re==="NEWLINE"?O(this._flags.last_token,R)?this._output.space_before_token=!0:this._flags.last_token.text==="declare"&&O(b,["var","let","const"])?this._output.space_before_token=!0:this._flags.last_token.type!==a.END_EXPR?(this._flags.last_token.type!==a.START_EXPR||!O(b,["var","let","const"]))&&this._flags.last_token.text!==":"&&(w(b,"if")&&w(b.previous,"else")?this._output.space_before_token=!0:this.print_newline()):O(b,l)&&this._flags.last_token.text!==")"&&this.print_newline():this._flags.multiline_frame&&y(this._flags.mode)&&this._flags.last_token.text===","&&this._last_last_text==="}"?this.print_newline():re==="SPACE"&&(this._output.space_before_token=!0);b.previous&&(b.previous.type===a.WORD||b.previous.type===a.RESERVED)&&(this._output.space_before_token=!0),this.print_token(b),this._flags.last_word=b.text,b.type===a.RESERVED&&(b.text==="do"?this._flags.do_block=!0:b.text==="if"?this._flags.if_block=!0:b.text==="import"?this._flags.import_block=!0:this._flags.import_block&&w(b,"from")&&(this._flags.import_block=!1))},j.prototype.handle_semicolon=function(b){this.start_of_statement(b)?this._output.space_before_token=!1:this.handle_whitespace_and_comments(b);for(var V=this._tokens.peek();this._flags.mode===c.Statement&&!(this._flags.if_block&&w(V,"else"))&&!this._flags.do_block;)this.restore_mode();this._flags.import_block&&(this._flags.import_block=!1),this.print_token(b)},j.prototype.handle_string=function(b){b.text.startsWith("`")&&b.newlines===0&&b.whitespace_before===""&&(b.previous.text===")"||this._flags.last_token.type===a.WORD)||(this.start_of_statement(b)?this._output.space_before_token=!0:(this.handle_whitespace_and_comments(b),this._flags.last_token.type===a.RESERVED||this._flags.last_token.type===a.WORD||this._flags.inline_frame?this._output.space_before_token=!0:this._flags.last_token.type===a.COMMA||this._flags.last_token.type===a.START_EXPR||this._flags.last_token.type===a.EQUALS||this._flags.last_token.type===a.OPERATOR?this.start_of_object_property()||this.allow_wrap_or_preserved_newline(b):b.text.startsWith("`")&&this._flags.last_token.type===a.END_EXPR&&(b.previous.text==="]"||b.previous.text===")")&&b.newlines===0?this._output.space_before_token=!0:this.print_newline())),this.print_token(b)},j.prototype.handle_equals=function(b){this.start_of_statement(b)||this.handle_whitespace_and_comments(b),this._flags.declaration_statement&&(this._flags.declaration_assignment=!0),this._output.space_before_token=!0,this.print_token(b),this._output.space_before_token=!0},j.prototype.handle_comma=function(b){this.handle_whitespace_and_comments(b,!0),this.print_token(b),this._output.space_before_token=!0,this._flags.declaration_statement?(F(this._flags.parent.mode)&&(this._flags.declaration_assignment=!1),this._flags.declaration_assignment?(this._flags.declaration_assignment=!1,this.print_newline(!1,!0)):this._options.comma_first&&this.allow_wrap_or_preserved_newline(b)):this._flags.mode===c.ObjectLiteral||this._flags.mode===c.Statement&&this._flags.parent.mode===c.ObjectLiteral?(this._flags.mode===c.Statement&&this.restore_mode(),this._flags.inline_frame||this.print_newline()):this._options.comma_first&&this.allow_wrap_or_preserved_newline(b)},j.prototype.handle_operator=function(b){var V=b.text==="*"&&(O(this._flags.last_token,["function","yield"])||s(this._flags.last_token.type,[a.START_BLOCK,a.COMMA,a.END_BLOCK,a.SEMICOLON])),re=s(b.text,["-","+"])&&(s(this._flags.last_token.type,[a.START_BLOCK,a.START_EXPR,a.EQUALS,a.OPERATOR])||s(this._flags.last_token.text,l)||this._flags.last_token.text===",");if(!this.start_of_statement(b)){var ce=!V;this.handle_whitespace_and_comments(b,ce)}if(b.text==="*"&&this._flags.last_token.type===a.DOT){this.print_token(b);return}if(b.text==="::"){this.print_token(b);return}if(this._flags.last_token.type===a.OPERATOR&&s(this._options.operator_position,E)&&this.allow_wrap_or_preserved_newline(b),b.text===":"&&this._flags.in_case){this.print_token(b),this._flags.in_case=!1,this._flags.case_body=!0,this._tokens.peek().type!==a.START_BLOCK?(this.indent(),this.print_newline(),this._flags.case_block=!1):(this._flags.case_block=!0,this._output.space_before_token=!0);return}var me=!0,De=!0,we=!1;if(b.text===":"?this._flags.ternary_depth===0?me=!1:(this._flags.ternary_depth-=1,we=!0):b.text==="?"&&(this._flags.ternary_depth+=1),!re&&!V&&this._options.preserve_newlines&&s(b.text,u)){var Le=b.text===":",Re=Le&&we,Ie=Le&&!we;switch(this._options.operator_position){case T.before_newline:this._output.space_before_token=!Ie,this.print_token(b),(!Le||Re)&&this.allow_wrap_or_preserved_newline(b),this._output.space_before_token=!0;return;case T.after_newline:this._output.space_before_token=!0,!Le||Re?this._tokens.peek().newlines?this.print_newline(!1,!0):this.allow_wrap_or_preserved_newline(b):this._output.space_before_token=!1,this.print_token(b),this._output.space_before_token=!0;return;case T.preserve_newline:Ie||this.allow_wrap_or_preserved_newline(b),me=!(this._output.just_added_newline()||Ie),this._output.space_before_token=me,this.print_token(b),this._output.space_before_token=!0;return}}if(V){this.allow_wrap_or_preserved_newline(b),me=!1;var ye=this._tokens.peek();De=ye&&s(ye.type,[a.WORD,a.RESERVED])}else if(b.text==="...")this.allow_wrap_or_preserved_newline(b),me=this._flags.last_token.type===a.START_BLOCK,De=!1;else if(s(b.text,["--","++","!","~"])||re){if((this._flags.last_token.type===a.COMMA||this._flags.last_token.type===a.START_EXPR)&&this.allow_wrap_or_preserved_newline(b),me=!1,De=!1,b.newlines&&(b.text==="--"||b.text==="++"||b.text==="~")){var X=O(this._flags.last_token,R)&&b.newlines;X&&(this._previous_flags.if_block||this._previous_flags.else_block)&&this.restore_mode(),this.print_newline(X,!0)}this._flags.last_token.text===";"&&F(this._flags.mode)&&(me=!0),this._flags.last_token.type===a.RESERVED?me=!0:this._flags.last_token.type===a.END_EXPR?me=!(this._flags.last_token.text==="]"&&(b.text==="--"||b.text==="++")):this._flags.last_token.type===a.OPERATOR&&(me=s(b.text,["--","-","++","+"])&&s(this._flags.last_token.text,["--","-","++","+"]),s(b.text,["+","-"])&&s(this._flags.last_token.text,["--","++"])&&(De=!0)),(this._flags.mode===c.BlockStatement&&!this._flags.inline_frame||this._flags.mode===c.Statement)&&(this._flags.last_token.text==="{"||this._flags.last_token.text===";")&&this.print_newline()}this._output.space_before_token=this._output.space_before_token||me,this.print_token(b),this._output.space_before_token=De},j.prototype.handle_block_comment=function(b,V){if(this._output.raw){this._output.add_raw_token(b),b.directives&&b.directives.preserve==="end"&&(this._output.raw=this._options.test_output_raw);return}if(b.directives){this.print_newline(!1,V),this.print_token(b),b.directives.preserve==="start"&&(this._output.raw=!0),this.print_newline(!1,!0);return}if(!h.newline.test(b.text)&&!b.newlines){this._output.space_before_token=!0,this.print_token(b),this._output.space_before_token=!0;return}else this.print_block_commment(b,V)},j.prototype.print_block_commment=function(b,V){var re=v(b.text),ce,me=!1,De=!1,we=b.whitespace_before,Le=we.length;if(this.print_newline(!1,V),this.print_token_line_indentation(b),this._output.add_token(re[0]),this.print_newline(!1,V),re.length>1){for(re=re.slice(1),me=B(re,"*"),De=A(re,we),me&&(this._flags.alignment=1),ce=0;ce<re.length;ce++)me?(this.print_token_line_indentation(b),this._output.add_token(C(re[ce]))):De&&re[ce]?(this.print_token_line_indentation(b),this._output.add_token(re[ce].substring(Le))):(this._output.current_line.set_indent(-1),this._output.add_token(re[ce])),this.print_newline(!1,V);this._flags.alignment=0}},j.prototype.handle_comment=function(b,V){b.newlines?this.print_newline(!1,V):this._output.trim(!0),this._output.space_before_token=!0,this.print_token(b),this.print_newline(!1,V)},j.prototype.handle_dot=function(b){this.start_of_statement(b)||this.handle_whitespace_and_comments(b,!0),this._flags.last_token.text.match("^[0-9]+$")&&(this._output.space_before_token=!0),O(this._flags.last_token,R)?this._output.space_before_token=!1:this.allow_wrap_or_preserved_newline(b,this._flags.last_token.text===")"&&this._options.break_chained_methods),this._options.unindent_chained_methods&&this._output.just_added_newline()&&this.deindent(),this.print_token(b)},j.prototype.handle_unknown=function(b,V){this.print_token(b),b.text[b.text.length-1]===`
`&&this.print_newline(!1,V)},j.prototype.handle_eof=function(b){for(;this._flags.mode===c.Statement;)this.restore_mode();this.handle_whitespace_and_comments(b)},n.exports.Beautifier=j},function(n){function I(m){this.__parent=m,this.__character_count=0,this.__indent_count=-1,this.__alignment_count=0,this.__wrap_point_index=0,this.__wrap_point_character_count=0,this.__wrap_point_indent_count=-1,this.__wrap_point_alignment_count=0,this.__items=[]}I.prototype.clone_empty=function(){var m=new I(this.__parent);return m.set_indent(this.__indent_count,this.__alignment_count),m},I.prototype.item=function(m){return m<0?this.__items[this.__items.length+m]:this.__items[m]},I.prototype.has_match=function(m){for(var h=this.__items.length-1;h>=0;h--)if(this.__items[h].match(m))return!0;return!1},I.prototype.set_indent=function(m,h){this.is_empty()&&(this.__indent_count=m||0,this.__alignment_count=h||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},I.prototype._set_wrap_point=function(){this.__parent.wrap_line_length&&(this.__wrap_point_index=this.__items.length,this.__wrap_point_character_count=this.__character_count,this.__wrap_point_indent_count=this.__parent.next_line.__indent_count,this.__wrap_point_alignment_count=this.__parent.next_line.__alignment_count)},I.prototype._should_wrap=function(){return this.__wrap_point_index&&this.__character_count>this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count},I.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var m=this.__parent.current_line;return m.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),m.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),m.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,m.__items[0]===" "&&(m.__items.splice(0,1),m.__character_count-=1),!0}return!1},I.prototype.is_empty=function(){return this.__items.length===0},I.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},I.prototype.push=function(m){this.__items.push(m);var h=m.lastIndexOf(`
`);h!==-1?this.__character_count=m.length-h:this.__character_count+=m.length},I.prototype.pop=function(){var m=null;return this.is_empty()||(m=this.__items.pop(),this.__character_count-=m.length),m},I.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},I.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},I.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},I.prototype.toString=function(){var m="";return this.is_empty()?this.__parent.indent_empty_lines&&(m=this.__parent.get_indent_string(this.__indent_count)):(m=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),m+=this.__items.join("")),m};function g(m,h){this.__cache=[""],this.__indent_size=m.indent_size,this.__indent_string=m.indent_char,m.indent_with_tabs||(this.__indent_string=new Array(m.indent_size+1).join(m.indent_char)),h=h||"",m.indent_level>0&&(h=new Array(m.indent_level+1).join(this.__indent_string)),this.__base_string=h,this.__base_string_length=h.length}g.prototype.get_indent_size=function(m,h){var o=this.__base_string_length;return h=h||0,m<0&&(o=0),o+=m*this.__indent_size,o+=h,o},g.prototype.get_indent_string=function(m,h){var o=this.__base_string;return h=h||0,m<0&&(m=0,o=""),h+=m*this.__indent_size,this.__ensure_cache(h),o+=this.__cache[h],o},g.prototype.__ensure_cache=function(m){for(;m>=this.__cache.length;)this.__add_column()},g.prototype.__add_column=function(){var m=this.__cache.length,h=0,o="";this.__indent_size&&m>=this.__indent_size&&(h=Math.floor(m/this.__indent_size),m-=h*this.__indent_size,o=new Array(h+1).join(this.__indent_string)),m&&(o+=new Array(m+1).join(" ")),this.__cache.push(o)};function f(m,h){this.__indent_cache=new g(m,h),this.raw=!1,this._end_with_newline=m.end_with_newline,this.indent_size=m.indent_size,this.wrap_line_length=m.wrap_line_length,this.indent_empty_lines=m.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new I(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}f.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},f.prototype.get_line_number=function(){return this.__lines.length},f.prototype.get_indent_string=function(m,h){return this.__indent_cache.get_indent_string(m,h)},f.prototype.get_indent_size=function(m,h){return this.__indent_cache.get_indent_size(m,h)},f.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},f.prototype.add_new_line=function(m){return this.is_empty()||!m&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},f.prototype.get_code=function(m){this.trim(!0);var h=this.current_line.pop();h&&(h[h.length-1]===`
`&&(h=h.replace(/\n+$/g,"")),this.current_line.push(h)),this._end_with_newline&&this.__add_outputline();var o=this.__lines.join(`
`);return m!==`
`&&(o=o.replace(/[\n]/g,m)),o},f.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},f.prototype.set_indent=function(m,h){return m=m||0,h=h||0,this.next_line.set_indent(m,h),this.__lines.length>1?(this.current_line.set_indent(m,h),!0):(this.current_line.set_indent(),!1)},f.prototype.add_raw_token=function(m){for(var h=0;h<m.newlines;h++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(m.whitespace_before),this.current_line.push(m.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},f.prototype.add_token=function(m){this.__add_space_before_token(),this.current_line.push(m),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},f.prototype.__add_space_before_token=function(){this.space_before_token&&!this.just_added_newline()&&(this.non_breaking_space||this.set_wrap_point(),this.current_line.push(" "))},f.prototype.remove_indent=function(m){for(var h=this.__lines.length;m<h;)this.__lines[m]._remove_indent(),m++;this.current_line._remove_wrap_indent()},f.prototype.trim=function(m){for(m=m===void 0?!1:m,this.current_line.trim();m&&this.__lines.length>1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},f.prototype.just_added_newline=function(){return this.current_line.is_empty()},f.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},f.prototype.ensure_empty_line_above=function(m,h){for(var o=this.__lines.length-2;o>=0;){var p=this.__lines[o];if(p.is_empty())break;if(p.item(0).indexOf(m)!==0&&p.item(-1)!==h){this.__lines.splice(o+1,0,new I(this)),this.previous_line=this.__lines[this.__lines.length-2];break}o--}},n.exports.Output=f},function(n){function I(g,f,m,h){this.type=g,this.text=f,this.comments_before=null,this.newlines=m||0,this.whitespace_before=h||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}n.exports.Token=I},function(n,I){var g="\\x23\\x24\\x40\\x41-\\x5a\\x5f\\x61-\\x7a",f="\\x24\\x30-\\x39\\x41-\\x5a\\x5f\\x61-\\x7a",m="\\xaa\\xb5\\xba\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\u02c1\\u02c6-\\u02d1\\u02e0-\\u02e4\\u02ec\\u02ee\\u0370-\\u0374\\u0376\\u0377\\u037a-\\u037d\\u0386\\u0388-\\u038a\\u038c\\u038e-\\u03a1\\u03a3-\\u03f5\\u03f7-\\u0481\\u048a-\\u0527\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05d0-\\u05ea\\u05f0-\\u05f2\\u0620-\\u064a\\u066e\\u066f\\u0671-\\u06d3\\u06d5\\u06e5\\u06e6\\u06ee\\u06ef\\u06fa-\\u06fc\\u06ff\\u0710\\u0712-\\u072f\\u074d-\\u07a5\\u07b1\\u07ca-\\u07ea\\u07f4\\u07f5\\u07fa\\u0800-\\u0815\\u081a\\u0824\\u0828\\u0840-\\u0858\\u08a0\\u08a2-\\u08ac\\u0904-\\u0939\\u093d\\u0950\\u0958-\\u0961\\u0971-\\u0977\\u0979-\\u097f\\u0985-\\u098c\\u098f\\u0990\\u0993-\\u09a8\\u09aa-\\u09b0\\u09b2\\u09b6-\\u09b9\\u09bd\\u09ce\\u09dc\\u09dd\\u09df-\\u09e1\\u09f0\\u09f1\\u0a05-\\u0a0a\\u0a0f\\u0a10\\u0a13-\\u0a28\\u0a2a-\\u0a30\\u0a32\\u0a33\\u0a35\\u0a36\\u0a38\\u0a39\\u0a59-\\u0a5c\\u0a5e\\u0a72-\\u0a74\\u0a85-\\u0a8d\\u0a8f-\\u0a91\\u0a93-\\u0aa8\\u0aaa-\\u0ab0\\u0ab2\\u0ab3\\u0ab5-\\u0ab9\\u0abd\\u0ad0\\u0ae0\\u0ae1\\u0b05-\\u0b0c\\u0b0f\\u0b10\\u0b13-\\u0b28\\u0b2a-\\u0b30\\u0b32\\u0b33\\u0b35-\\u0b39\\u0b3d\\u0b5c\\u0b5d\\u0b5f-\\u0b61\\u0b71\\u0b83\\u0b85-\\u0b8a\\u0b8e-\\u0b90\\u0b92-\\u0b95\\u0b99\\u0b9a\\u0b9c\\u0b9e\\u0b9f\\u0ba3\\u0ba4\\u0ba8-\\u0baa\\u0bae-\\u0bb9\\u0bd0\\u0c05-\\u0c0c\\u0c0e-\\u0c10\\u0c12-\\u0c28\\u0c2a-\\u0c33\\u0c35-\\u0c39\\u0c3d\\u0c58\\u0c59\\u0c60\\u0c61\\u0c85-\\u0c8c\\u0c8e-\\u0c90\\u0c92-\\u0ca8\\u0caa-\\u0cb3\\u0cb5-\\u0cb9\\u0cbd\\u0cde\\u0ce0\\u0ce1\\u0cf1\\u0cf2\\u0d05-\\u0d0c\\u0d0e-\\u0d10\\u0d12-\\u0d3a\\u0d3d\\u0d4e\\u0d60\\u0d61\\u0d7a-\\u0d7f\\u0d85-\\u0d96\\u0d9a-\\u0db1\\u0db3-\\u0dbb\\u0dbd\\u0dc0-\\u0dc6\\u0e01-\\u0e30\\u0e32\\u0e33\\u0e40-\\u0e46\\u0e81\\u0e82\\u0e84\\u0e87\\u0e88\\u0e8a\\u0e8d\\u0e94-\\u0e97\\u0e99-\\u0e9f\\u0ea1-\\u0ea3\\u0ea5\\u0ea7\\u0eaa\\u0eab\\u0ead-\\u0eb0\\u0eb2\\u0eb3\\u0ebd\\u0ec0-\\u0ec4\\u0ec6\\u0edc-\\u0edf\\u0f00\\u0f40-\\u0f47\\u0f49-\\u0f6c\\u0f88-\\u0f8c\\u1000-\\u102a\\u103f\\u1050-\\u1055\\u105a-\\u105d\\u1061\\u1065\\u1066\\u106e-\\u1070\\u1075-\\u1081\\u108e\\u10a0-\\u10c5\\u10c7\\u10cd\\u10d0-\\u10fa\\u10fc-\\u1248\\u124a-\\u124d\\u1250-\\u1256\\u1258\\u125a-\\u125d\\u1260-\\u1288\\u128a-\\u128d\\u1290-\\u12b0\\u12b2-\\u12b5\\u12b8-\\u12be\\u12c0\\u12c2-\\u12c5\\u12c8-\\u12d6\\u12d8-\\u1310\\u1312-\\u1315\\u1318-\\u135a\\u1380-\\u138f\\u13a0-\\u13f4\\u1401-\\u166c\\u166f-\\u167f\\u1681-\\u169a\\u16a0-\\u16ea\\u16ee-\\u16f0\\u1700-\\u170c\\u170e-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176c\\u176e-\\u1770\\u1780-\\u17b3\\u17d7\\u17dc\\u1820-\\u1877\\u1880-\\u18a8\\u18aa\\u18b0-\\u18f5\\u1900-\\u191c\\u1950-\\u196d\\u1970-\\u1974\\u1980-\\u19ab\\u19c1-\\u19c7\\u1a00-\\u1a16\\u1a20-\\u1a54\\u1aa7\\u1b05-\\u1b33\\u1b45-\\u1b4b\\u1b83-\\u1ba0\\u1bae\\u1baf\\u1bba-\\u1be5\\u1c00-\\u1c23\\u1c4d-\\u1c4f\\u1c5a-\\u1c7d\\u1ce9-\\u1cec\\u1cee-\\u1cf1\\u1cf5\\u1cf6\\u1d00-\\u1dbf\\u1e00-\\u1f15\\u1f18-\\u1f1d\\u1f20-\\u1f45\\u1f48-\\u1f4d\\u1f50-\\u1f57\\u1f59\\u1f5b\\u1f5d\\u1f5f-\\u1f7d\\u1f80-\\u1fb4\\u1fb6-\\u1fbc\\u1fbe\\u1fc2-\\u1fc4\\u1fc6-\\u1fcc\\u1fd0-\\u1fd3\\u1fd6-\\u1fdb\\u1fe0-\\u1fec\\u1ff2-\\u1ff4\\u1ff6-\\u1ffc\\u2071\\u207f\\u2090-\\u209c\\u2102\\u2107\\u210a-\\u2113\\u2115\\u2119-\\u211d\\u2124\\u2126\\u2128\\u212a-\\u212d\\u212f-\\u2139\\u213c-\\u213f\\u2145-\\u2149\\u214e\\u2160-\\u2188\\u2c00-\\u2c2e\\u2c30-\\u2c5e\\u2c60-\\u2ce4\\u2ceb-\\u2cee\\u2cf2\\u2cf3\\u2d00-\\u2d25\\u2d27\\u2d2d\\u2d30-\\u2d67\\u2d6f\\u2d80-\\u2d96\\u2da0-\\u2da6\\u2da8-\\u2dae\\u2db0-\\u2db6\\u2db8-\\u2dbe\\u2dc0-\\u2dc6\\u2dc8-\\u2dce\\u2dd0-\\u2dd6\\u2dd8-\\u2dde\\u2e2f\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303c\\u3041-\\u3096\\u309d-\\u309f\\u30a1-\\u30fa\\u30fc-\\u30ff\\u3105-\\u312d\\u3131-\\u318e\\u31a0-\\u31ba\\u31f0-\\u31ff\\u3400-\\u4db5\\u4e00-\\u9fcc\\ua000-\\ua48c\\ua4d0-\\ua4fd\\ua500-\\ua60c\\ua610-\\ua61f\\ua62a\\ua62b\\ua640-\\ua66e\\ua67f-\\ua697\\ua6a0-\\ua6ef\\ua717-\\ua71f\\ua722-\\ua788\\ua78b-\\ua78e\\ua790-\\ua793\\ua7a0-\\ua7aa\\ua7f8-\\ua801\\ua803-\\ua805\\ua807-\\ua80a\\ua80c-\\ua822\\ua840-\\ua873\\ua882-\\ua8b3\\ua8f2-\\ua8f7\\ua8fb\\ua90a-\\ua925\\ua930-\\ua946\\ua960-\\ua97c\\ua984-\\ua9b2\\ua9cf\\uaa00-\\uaa28\\uaa40-\\uaa42\\uaa44-\\uaa4b\\uaa60-\\uaa76\\uaa7a\\uaa80-\\uaaaf\\uaab1\\uaab5\\uaab6\\uaab9-\\uaabd\\uaac0\\uaac2\\uaadb-\\uaadd\\uaae0-\\uaaea\\uaaf2-\\uaaf4\\uab01-\\uab06\\uab09-\\uab0e\\uab11-\\uab16\\uab20-\\uab26\\uab28-\\uab2e\\uabc0-\\uabe2\\uac00-\\ud7a3\\ud7b0-\\ud7c6\\ud7cb-\\ud7fb\\uf900-\\ufa6d\\ufa70-\\ufad9\\ufb00-\\ufb06\\ufb13-\\ufb17\\ufb1d\\ufb1f-\\ufb28\\ufb2a-\\ufb36\\ufb38-\\ufb3c\\ufb3e\\ufb40\\ufb41\\ufb43\\ufb44\\ufb46-\\ufbb1\\ufbd3-\\ufd3d\\ufd50-\\ufd8f\\ufd92-\\ufdc7\\ufdf0-\\ufdfb\\ufe70-\\ufe74\\ufe76-\\ufefc\\uff21-\\uff3a\\uff41-\\uff5a\\uff66-\\uffbe\\uffc2-\\uffc7\\uffca-\\uffcf\\uffd2-\\uffd7\\uffda-\\uffdc",h="\\u0300-\\u036f\\u0483-\\u0487\\u0591-\\u05bd\\u05bf\\u05c1\\u05c2\\u05c4\\u05c5\\u05c7\\u0610-\\u061a\\u0620-\\u0649\\u0672-\\u06d3\\u06e7-\\u06e8\\u06fb-\\u06fc\\u0730-\\u074a\\u0800-\\u0814\\u081b-\\u0823\\u0825-\\u0827\\u0829-\\u082d\\u0840-\\u0857\\u08e4-\\u08fe\\u0900-\\u0903\\u093a-\\u093c\\u093e-\\u094f\\u0951-\\u0957\\u0962-\\u0963\\u0966-\\u096f\\u0981-\\u0983\\u09bc\\u09be-\\u09c4\\u09c7\\u09c8\\u09d7\\u09df-\\u09e0\\u0a01-\\u0a03\\u0a3c\\u0a3e-\\u0a42\\u0a47\\u0a48\\u0a4b-\\u0a4d\\u0a51\\u0a66-\\u0a71\\u0a75\\u0a81-\\u0a83\\u0abc\\u0abe-\\u0ac5\\u0ac7-\\u0ac9\\u0acb-\\u0acd\\u0ae2-\\u0ae3\\u0ae6-\\u0aef\\u0b01-\\u0b03\\u0b3c\\u0b3e-\\u0b44\\u0b47\\u0b48\\u0b4b-\\u0b4d\\u0b56\\u0b57\\u0b5f-\\u0b60\\u0b66-\\u0b6f\\u0b82\\u0bbe-\\u0bc2\\u0bc6-\\u0bc8\\u0bca-\\u0bcd\\u0bd7\\u0be6-\\u0bef\\u0c01-\\u0c03\\u0c46-\\u0c48\\u0c4a-\\u0c4d\\u0c55\\u0c56\\u0c62-\\u0c63\\u0c66-\\u0c6f\\u0c82\\u0c83\\u0cbc\\u0cbe-\\u0cc4\\u0cc6-\\u0cc8\\u0cca-\\u0ccd\\u0cd5\\u0cd6\\u0ce2-\\u0ce3\\u0ce6-\\u0cef\\u0d02\\u0d03\\u0d46-\\u0d48\\u0d57\\u0d62-\\u0d63\\u0d66-\\u0d6f\\u0d82\\u0d83\\u0dca\\u0dcf-\\u0dd4\\u0dd6\\u0dd8-\\u0ddf\\u0df2\\u0df3\\u0e34-\\u0e3a\\u0e40-\\u0e45\\u0e50-\\u0e59\\u0eb4-\\u0eb9\\u0ec8-\\u0ecd\\u0ed0-\\u0ed9\\u0f18\\u0f19\\u0f20-\\u0f29\\u0f35\\u0f37\\u0f39\\u0f41-\\u0f47\\u0f71-\\u0f84\\u0f86-\\u0f87\\u0f8d-\\u0f97\\u0f99-\\u0fbc\\u0fc6\\u1000-\\u1029\\u1040-\\u1049\\u1067-\\u106d\\u1071-\\u1074\\u1082-\\u108d\\u108f-\\u109d\\u135d-\\u135f\\u170e-\\u1710\\u1720-\\u1730\\u1740-\\u1750\\u1772\\u1773\\u1780-\\u17b2\\u17dd\\u17e0-\\u17e9\\u180b-\\u180d\\u1810-\\u1819\\u1920-\\u192b\\u1930-\\u193b\\u1951-\\u196d\\u19b0-\\u19c0\\u19c8-\\u19c9\\u19d0-\\u19d9\\u1a00-\\u1a15\\u1a20-\\u1a53\\u1a60-\\u1a7c\\u1a7f-\\u1a89\\u1a90-\\u1a99\\u1b46-\\u1b4b\\u1b50-\\u1b59\\u1b6b-\\u1b73\\u1bb0-\\u1bb9\\u1be6-\\u1bf3\\u1c00-\\u1c22\\u1c40-\\u1c49\\u1c5b-\\u1c7d\\u1cd0-\\u1cd2\\u1d00-\\u1dbe\\u1e01-\\u1f15\\u200c\\u200d\\u203f\\u2040\\u2054\\u20d0-\\u20dc\\u20e1\\u20e5-\\u20f0\\u2d81-\\u2d96\\u2de0-\\u2dff\\u3021-\\u3028\\u3099\\u309a\\ua640-\\ua66d\\ua674-\\ua67d\\ua69f\\ua6f0-\\ua6f1\\ua7f8-\\ua800\\ua806\\ua80b\\ua823-\\ua827\\ua880-\\ua881\\ua8b4-\\ua8c4\\ua8d0-\\ua8d9\\ua8f3-\\ua8f7\\ua900-\\ua909\\ua926-\\ua92d\\ua930-\\ua945\\ua980-\\ua983\\ua9b3-\\ua9c0\\uaa00-\\uaa27\\uaa40-\\uaa41\\uaa4c-\\uaa4d\\uaa50-\\uaa59\\uaa7b\\uaae0-\\uaae9\\uaaf2-\\uaaf3\\uabc0-\\uabe1\\uabec\\uabed\\uabf0-\\uabf9\\ufb20-\\ufb28\\ufe00-\\ufe0f\\ufe20-\\ufe26\\ufe33\\ufe34\\ufe4d-\\ufe4f\\uff10-\\uff19\\uff3f",o="(?:\\\\u[0-9a-fA-F]{4}|["+g+m+"])",p="(?:\\\\u[0-9a-fA-F]{4}|["+f+m+h+"])*";I.identifier=new RegExp(o+p,"g"),I.identifierStart=new RegExp(o),I.identifierMatch=new RegExp("(?:\\\\u[0-9a-fA-F]{4}|["+f+m+h+"])+");var l=/[\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff]/;I.newline=/[\n\r\u2028\u2029]/,I.lineBreak=new RegExp(`\r
|`+I.newline.source),I.allLineBreaks=new RegExp(I.lineBreak.source,"g")},function(n,I,g){var f=g(6).Options,m=["before-newline","after-newline","preserve-newline"];function h(o){f.call(this,o,"js");var p=this.raw_options.brace_style||null;p==="expand-strict"?this.raw_options.brace_style="expand":p==="collapse-preserve-inline"?this.raw_options.brace_style="collapse,preserve-inline":this.raw_options.braces_on_own_line!==void 0&&(this.raw_options.brace_style=this.raw_options.braces_on_own_line?"expand":"collapse");var l=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_preserve_inline=!1,this.brace_style="collapse";for(var u=0;u<l.length;u++)l[u]==="preserve-inline"?this.brace_preserve_inline=!0:this.brace_style=l[u];this.unindent_chained_methods=this._get_boolean("unindent_chained_methods"),this.break_chained_methods=this._get_boolean("break_chained_methods"),this.space_in_paren=this._get_boolean("space_in_paren"),this.space_in_empty_paren=this._get_boolean("space_in_empty_paren"),this.jslint_happy=this._get_boolean("jslint_happy"),this.space_after_anon_function=this._get_boolean("space_after_anon_function"),this.space_after_named_function=this._get_boolean("space_after_named_function"),this.keep_array_indentation=this._get_boolean("keep_array_indentation"),this.space_before_conditional=this._get_boolean("space_before_conditional",!0),this.unescape_strings=this._get_boolean("unescape_strings"),this.e4x=this._get_boolean("e4x"),this.comma_first=this._get_boolean("comma_first"),this.operator_position=this._get_selection("operator_position",m),this.test_output_raw=this._get_boolean("test_output_raw"),this.jslint_happy&&(this.space_after_anon_function=!0)}h.prototype=new f,n.exports.Options=h},function(n){function I(m,h){this.raw_options=g(m,h),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs",this.indent_char===" "),this.indent_with_tabs&&(this.indent_char=" ",this.indent_size===1&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","django","erb","handlebars","php","smarty"],["auto"])}I.prototype._get_array=function(m,h){var o=this.raw_options[m],p=h||[];return typeof o=="object"?o!==null&&typeof o.concat=="function"&&(p=o.concat()):typeof o=="string"&&(p=o.split(/[^a-zA-Z0-9_\/\-]+/)),p},I.prototype._get_boolean=function(m,h){var o=this.raw_options[m],p=o===void 0?!!h:!!o;return p},I.prototype._get_characters=function(m,h){var o=this.raw_options[m],p=h||"";return typeof o=="string"&&(p=o.replace(/\\r/,"\r").replace(/\\n/,`
`).replace(/\\t/," ")),p},I.prototype._get_number=function(m,h){var o=this.raw_options[m];h=parseInt(h,10),isNaN(h)&&(h=0);var p=parseInt(o,10);return isNaN(p)&&(p=h),p},I.prototype._get_selection=function(m,h,o){var p=this._get_selection_list(m,h,o);if(p.length!==1)throw new Error("Invalid Option Value: The option '"+m+`' can only be one of the following values:
`+h+`
You passed in: '`+this.raw_options[m]+"'");return p[0]},I.prototype._get_selection_list=function(m,h,o){if(!h||h.length===0)throw new Error("Selection list cannot be empty.");if(o=o||[h[0]],!this._is_valid_selection(o,h))throw new Error("Invalid Default Value!");var p=this._get_array(m,o);if(!this._is_valid_selection(p,h))throw new Error("Invalid Option Value: The option '"+m+`' can contain only the following values:
`+h+`
You passed in: '`+this.raw_options[m]+"'");return p},I.prototype._is_valid_selection=function(m,h){return m.length&&h.length&&!m.some(function(o){return h.indexOf(o)===-1})};function g(m,h){var o={};m=f(m);var p;for(p in m)p!==h&&(o[p]=m[p]);if(h&&m[h])for(p in m[h])o[p]=m[h][p];return o}function f(m){var h={},o;for(o in m){var p=o.replace(/-/g,"_");h[p]=m[o]}return h}n.exports.Options=I,n.exports.normalizeOpts=f,n.exports.mergeOpts=g},function(n,I,g){var f=g(8).InputScanner,m=g(9).Tokenizer,h=g(9).TOKEN,o=g(13).Directives,p=g(4),l=g(12).Pattern,u=g(14).TemplatablePattern;function a(B,A){return A.indexOf(B)!==-1}var s={START_EXPR:"TK_START_EXPR",END_EXPR:"TK_END_EXPR",START_BLOCK:"TK_START_BLOCK",END_BLOCK:"TK_END_BLOCK",WORD:"TK_WORD",RESERVED:"TK_RESERVED",SEMICOLON:"TK_SEMICOLON",STRING:"TK_STRING",EQUALS:"TK_EQUALS",OPERATOR:"TK_OPERATOR",COMMA:"TK_COMMA",BLOCK_COMMENT:"TK_BLOCK_COMMENT",COMMENT:"TK_COMMENT",DOT:"TK_DOT",UNKNOWN:"TK_UNKNOWN",START:h.START,RAW:h.RAW,EOF:h.EOF},C=new o(/\/\*/,/\*\//),_=/0[xX][0123456789abcdefABCDEF_]*n?|0[oO][01234567_]*n?|0[bB][01_]*n?|\d[\d_]*n|(?:\.\d[\d_]*|\d[\d_]*\.?[\d_]*)(?:[eE][+-]?[\d_]+)?/,w=/[0-9]/,O=/[^\d\.]/,R=">>> === !== &&= ??= ||= << && >= ** != == <= >> || ?? |> < / - + > : & % ? ^ | *".split(" "),S=">>>= ... >>= <<= === >>> !== **= &&= ??= ||= => ^= :: /= << <= == && -= >= >> != -- += ** || ?? ++ %= &= *= |= |> = ! ? > < : / ^ - + * & % ~ |";S=S.replace(/[-[\]{}()*+?.,\\^$|#]/g,"\\$&"),S="\\?\\.(?!\\d) "+S,S=S.replace(/ /g,"|");var T=new RegExp(S),E="continue,try,throw,return,var,let,const,if,switch,case,default,for,while,break,function,import,export".split(","),c=E.concat(["do","in","of","else","get","set","new","catch","finally","typeof","yield","async","await","from","as","class","extends"]),x=new RegExp("^(?:"+c.join("|")+")$"),v,y=function(B,A){m.call(this,B,A),this._patterns.whitespace=this._patterns.whitespace.matching(/\u00A0\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff/.source,/\u2028\u2029/.source);var j=new l(this._input),P=new u(this._input).read_options(this._options);this.__patterns={template:P,identifier:P.starting_with(p.identifier).matching(p.identifierMatch),number:j.matching(_),punct:j.matching(T),comment:j.starting_with(/\/\//).until(/[\n\r\u2028\u2029]/),block_comment:j.starting_with(/\/\*/).until_after(/\*\//),html_comment_start:j.matching(/<!--/),html_comment_end:j.matching(/-->/),include:j.starting_with(/#include/).until_after(p.lineBreak),shebang:j.starting_with(/#!/).until_after(p.lineBreak),xml:j.matching(/[\s\S]*?<(\/?)([-a-zA-Z:0-9_.]+|{[^}]+?}|!\[CDATA\[[^\]]*?\]\]|)(\s*{[^}]+?}|\s+[-a-zA-Z:0-9_.]+|\s+[-a-zA-Z:0-9_.]+\s*=\s*('[^']*'|"[^"]*"|{([^{}]|{[^}]+?})+?}))*\s*(\/?)\s*>/),single_quote:P.until(/['\\\n\r\u2028\u2029]/),double_quote:P.until(/["\\\n\r\u2028\u2029]/),template_text:P.until(/[`\\$]/),template_expression:P.until(/[`}\\]/)}};y.prototype=new m,y.prototype._is_comment=function(B){return B.type===s.COMMENT||B.type===s.BLOCK_COMMENT||B.type===s.UNKNOWN},y.prototype._is_opening=function(B){return B.type===s.START_BLOCK||B.type===s.START_EXPR},y.prototype._is_closing=function(B,A){return(B.type===s.END_BLOCK||B.type===s.END_EXPR)&&A&&(B.text==="]"&&A.text==="["||B.text===")"&&A.text==="("||B.text==="}"&&A.text==="{")},y.prototype._reset=function(){v=!1},y.prototype._get_next_token=function(B,A){var j=null;this._readWhitespace();var P=this._input.peek();return P===null?this._create_token(s.EOF,""):(j=j||this._read_non_javascript(P),j=j||this._read_string(P),j=j||this._read_word(B),j=j||this._read_singles(P),j=j||this._read_comment(P),j=j||this._read_regexp(P,B),j=j||this._read_xml(P,B),j=j||this._read_punctuation(),j=j||this._create_token(s.UNKNOWN,this._input.next()),j)},y.prototype._read_word=function(B){var A;if(A=this.__patterns.identifier.read(),A!=="")return A=A.replace(p.allLineBreaks,`
`),!(B.type===s.DOT||B.type===s.RESERVED&&(B.text==="set"||B.text==="get"))&&x.test(A)?(A==="in"||A==="of")&&(B.type===s.WORD||B.type===s.STRING)?this._create_token(s.OPERATOR,A):this._create_token(s.RESERVED,A):this._create_token(s.WORD,A);if(A=this.__patterns.number.read(),A!=="")return this._create_token(s.WORD,A)},y.prototype._read_singles=function(B){var A=null;return B==="("||B==="["?A=this._create_token(s.START_EXPR,B):B===")"||B==="]"?A=this._create_token(s.END_EXPR,B):B==="{"?A=this._create_token(s.START_BLOCK,B):B==="}"?A=this._create_token(s.END_BLOCK,B):B===";"?A=this._create_token(s.SEMICOLON,B):B==="."&&O.test(this._input.peek(1))?A=this._create_token(s.DOT,B):B===","&&(A=this._create_token(s.COMMA,B)),A&&this._input.next(),A},y.prototype._read_punctuation=function(){var B=this.__patterns.punct.read();if(B!=="")return B==="="?this._create_token(s.EQUALS,B):B==="?."?this._create_token(s.DOT,B):this._create_token(s.OPERATOR,B)},y.prototype._read_non_javascript=function(B){var A="";if(B==="#"){if(this._is_first_token()&&(A=this.__patterns.shebang.read(),A))return this._create_token(s.UNKNOWN,A.trim()+`
`);if(A=this.__patterns.include.read(),A)return this._create_token(s.UNKNOWN,A.trim()+`
`);B=this._input.next();var j="#";if(this._input.hasNext()&&this._input.testChar(w)){do B=this._input.next(),j+=B;while(this._input.hasNext()&&B!=="#"&&B!=="=");return B==="#"||(this._input.peek()==="["&&this._input.peek(1)==="]"?(j+="[]",this._input.next(),this._input.next()):this._input.peek()==="{"&&this._input.peek(1)==="}"&&(j+="{}",this._input.next(),this._input.next())),this._create_token(s.WORD,j)}this._input.back()}else if(B==="<"&&this._is_first_token()){if(A=this.__patterns.html_comment_start.read(),A){for(;this._input.hasNext()&&!this._input.testChar(p.newline);)A+=this._input.next();return v=!0,this._create_token(s.COMMENT,A)}}else if(v&&B==="-"&&(A=this.__patterns.html_comment_end.read(),A))return v=!1,this._create_token(s.COMMENT,A);return null},y.prototype._read_comment=function(B){var A=null;if(B==="/"){var j="";if(this._input.peek(1)==="*"){j=this.__patterns.block_comment.read();var P=C.get_directives(j);P&&P.ignore==="start"&&(j+=C.readIgnored(this._input)),j=j.replace(p.allLineBreaks,`
`),A=this._create_token(s.BLOCK_COMMENT,j),A.directives=P}else this._input.peek(1)==="/"&&(j=this.__patterns.comment.read(),A=this._create_token(s.COMMENT,j))}return A},y.prototype._read_string=function(B){if(B==="`"||B==="'"||B==='"'){var A=this._input.next();return this.has_char_escapes=!1,B==="`"?A+=this._read_string_recursive("`",!0,"${"):A+=this._read_string_recursive(B),this.has_char_escapes&&this._options.unescape_strings&&(A=F(A)),this._input.peek()===B&&(A+=this._input.next()),A=A.replace(p.allLineBreaks,`
`),this._create_token(s.STRING,A)}return null},y.prototype._allow_regexp_or_xml=function(B){return B.type===s.RESERVED&&a(B.text,["return","case","throw","else","do","typeof","yield"])||B.type===s.END_EXPR&&B.text===")"&&B.opened.previous.type===s.RESERVED&&a(B.opened.previous.text,["if","while","for"])||a(B.type,[s.COMMENT,s.START_EXPR,s.START_BLOCK,s.START,s.END_BLOCK,s.OPERATOR,s.EQUALS,s.EOF,s.SEMICOLON,s.COMMA])},y.prototype._read_regexp=function(B,A){if(B==="/"&&this._allow_regexp_or_xml(A)){for(var j=this._input.next(),P=!1,b=!1;this._input.hasNext()&&(P||b||this._input.peek()!==B)&&!this._input.testChar(p.newline);)j+=this._input.peek(),P?P=!1:(P=this._input.peek()==="\\",this._input.peek()==="["?b=!0:this._input.peek()==="]"&&(b=!1)),this._input.next();return this._input.peek()===B&&(j+=this._input.next(),j+=this._input.read(p.identifier)),this._create_token(s.STRING,j)}return null},y.prototype._read_xml=function(B,A){if(this._options.e4x&&B==="<"&&this._allow_regexp_or_xml(A)){var j="",P=this.__patterns.xml.read_match();if(P){for(var b=P[2].replace(/^{\s+/,"{").replace(/\s+}$/,"}"),V=b.indexOf("{")===0,re=0;P;){var ce=!!P[1],me=P[2],De=!!P[P.length-1]||me.slice(0,8)==="![CDATA[";if(!De&&(me===b||V&&me.replace(/^{\s+/,"{").replace(/\s+}$/,"}"))&&(ce?--re:++re),j+=P[0],re<=0)break;P=this.__patterns.xml.read_match()}return P||(j+=this._input.match(/[\s\S]*/g)[0]),j=j.replace(p.allLineBreaks,`
`),this._create_token(s.STRING,j)}}return null};function F(B){for(var A="",j=0,P=new f(B),b=null;P.hasNext();)if(b=P.match(/([\s]|[^\\]|\\\\)+/g),b&&(A+=b[0]),P.peek()==="\\"){if(P.next(),P.peek()==="x")b=P.match(/x([0-9A-Fa-f]{2})/g);else if(P.peek()==="u")b=P.match(/u([0-9A-Fa-f]{4})/g);else{A+="\\",P.hasNext()&&(A+=P.next());continue}if(!b)return B;if(j=parseInt(b[1],16),j>126&&j<=255&&b[0].indexOf("x")===0)return B;if(j>=0&&j<32){A+="\\"+b[0];continue}else j===34||j===39||j===92?A+="\\"+String.fromCharCode(j):A+=String.fromCharCode(j)}return A}y.prototype._read_string_recursive=function(B,A,j){var P,b;B==="'"?b=this.__patterns.single_quote:B==='"'?b=this.__patterns.double_quote:B==="`"?b=this.__patterns.template_text:B==="}"&&(b=this.__patterns.template_expression);for(var V=b.read(),re="";this._input.hasNext();){if(re=this._input.next(),re===B||!A&&p.newline.test(re)){this._input.back();break}else re==="\\"&&this._input.hasNext()?(P=this._input.peek(),P==="x"||P==="u"?this.has_char_escapes=!0:P==="\r"&&this._input.peek(1)===`
`&&this._input.next(),re+=this._input.next()):j&&(j==="${"&&re==="$"&&this._input.peek()==="{"&&(re+=this._input.next()),j===re&&(B==="`"?re+=this._read_string_recursive("}",A,"`"):re+=this._read_string_recursive("`",A,"${"),this._input.hasNext()&&(re+=this._input.next())));re+=b.read(),V+=re}return V},n.exports.Tokenizer=y,n.exports.TOKEN=s,n.exports.positionable_operators=R.slice(),n.exports.line_starters=E.slice()},function(n){var I=RegExp.prototype.hasOwnProperty("sticky");function g(f){this.__input=f||"",this.__input_length=this.__input.length,this.__position=0}g.prototype.restart=function(){this.__position=0},g.prototype.back=function(){this.__position>0&&(this.__position-=1)},g.prototype.hasNext=function(){return this.__position<this.__input_length},g.prototype.next=function(){var f=null;return this.hasNext()&&(f=this.__input.charAt(this.__position),this.__position+=1),f},g.prototype.peek=function(f){var m=null;return f=f||0,f+=this.__position,f>=0&&f<this.__input_length&&(m=this.__input.charAt(f)),m},g.prototype.__match=function(f,m){f.lastIndex=m;var h=f.exec(this.__input);return h&&!(I&&f.sticky)&&(h.index!==m&&(h=null)),h},g.prototype.test=function(f,m){return m=m||0,m+=this.__position,m>=0&&m<this.__input_length?!!this.__match(f,m):!1},g.prototype.testChar=function(f,m){var h=this.peek(m);return f.lastIndex=0,h!==null&&f.test(h)},g.prototype.match=function(f){var m=this.__match(f,this.__position);return m?this.__position+=m[0].length:m=null,m},g.prototype.read=function(f,m,h){var o="",p;return f&&(p=this.match(f),p&&(o+=p[0])),m&&(p||!f)&&(o+=this.readUntil(m,h)),o},g.prototype.readUntil=function(f,m){var h="",o=this.__position;f.lastIndex=this.__position;var p=f.exec(this.__input);return p?(o=p.index,m&&(o+=p[0].length)):o=this.__input_length,h=this.__input.substring(this.__position,o),this.__position=o,h},g.prototype.readUntilAfter=function(f){return this.readUntil(f,!0)},g.prototype.get_regexp=function(f,m){var h=null,o="g";return m&&I&&(o="y"),typeof f=="string"&&f!==""?h=new RegExp(f,o):f&&(h=new RegExp(f.source,o)),h},g.prototype.get_literal_regexp=function(f){return RegExp(f.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},g.prototype.peekUntilAfter=function(f){var m=this.__position,h=this.readUntilAfter(f);return this.__position=m,h},g.prototype.lookBack=function(f){var m=this.__position-1;return m>=f.length&&this.__input.substring(m-f.length,m).toLowerCase()===f},n.exports.InputScanner=g},function(n,I,g){var f=g(8).InputScanner,m=g(3).Token,h=g(10).TokenStream,o=g(11).WhitespacePattern,p={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},l=function(u,a){this._input=new f(u),this._options=a||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new o(this._input)};l.prototype.tokenize=function(){this._input.restart(),this.__tokens=new h,this._reset();for(var u,a=new m(p.START,""),s=null,C=[],_=new h;a.type!==p.EOF;){for(u=this._get_next_token(a,s);this._is_comment(u);)_.add(u),u=this._get_next_token(a,s);_.isEmpty()||(u.comments_before=_,_=new h),u.parent=s,this._is_opening(u)?(C.push(s),s=u):s&&this._is_closing(u,s)&&(u.opened=s,s.closed=u,s=C.pop(),u.parent=s),u.previous=a,a.next=u,this.__tokens.add(u),a=u}return this.__tokens},l.prototype._is_first_token=function(){return this.__tokens.isEmpty()},l.prototype._reset=function(){},l.prototype._get_next_token=function(u,a){this._readWhitespace();var s=this._input.read(/.+/g);return s?this._create_token(p.RAW,s):this._create_token(p.EOF,"")},l.prototype._is_comment=function(u){return!1},l.prototype._is_opening=function(u){return!1},l.prototype._is_closing=function(u,a){return!1},l.prototype._create_token=function(u,a){var s=new m(u,a,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return s},l.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},n.exports.Tokenizer=l,n.exports.TOKEN=p},function(n){function I(g){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=g}I.prototype.restart=function(){this.__position=0},I.prototype.isEmpty=function(){return this.__tokens_length===0},I.prototype.hasNext=function(){return this.__position<this.__tokens_length},I.prototype.next=function(){var g=null;return this.hasNext()&&(g=this.__tokens[this.__position],this.__position+=1),g},I.prototype.peek=function(g){var f=null;return g=g||0,g+=this.__position,g>=0&&g<this.__tokens_length&&(f=this.__tokens[g]),f},I.prototype.add=function(g){this.__parent_token&&(g.parent=this.__parent_token),this.__tokens.push(g),this.__tokens_length+=1},n.exports.TokenStream=I},function(n,I,g){var f=g(12).Pattern;function m(h,o){f.call(this,h,o),o?this._line_regexp=this._input.get_regexp(o._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}m.prototype=new f,m.prototype.__set_whitespace_patterns=function(h,o){h+="\\t ",o+="\\n\\r",this._match_pattern=this._input.get_regexp("["+h+o+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+o+"]")},m.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var h=this._input.read(this._match_pattern);if(h===" ")this.whitespace_before_token=" ";else if(h){var o=this.__split(this._newline_regexp,h);this.newline_count=o.length-1,this.whitespace_before_token=o[this.newline_count]}return h},m.prototype.matching=function(h,o){var p=this._create();return p.__set_whitespace_patterns(h,o),p._update(),p},m.prototype._create=function(){return new m(this._input,this)},m.prototype.__split=function(h,o){h.lastIndex=0;for(var p=0,l=[],u=h.exec(o);u;)l.push(o.substring(p,u.index)),p=u.index+u[0].length,u=h.exec(o);return p<o.length?l.push(o.substring(p,o.length)):l.push(""),l},n.exports.WhitespacePattern=m},function(n){function I(g,f){this._input=g,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,f&&(this._starting_pattern=this._input.get_regexp(f._starting_pattern,!0),this._match_pattern=this._input.get_regexp(f._match_pattern,!0),this._until_pattern=this._input.get_regexp(f._until_pattern),this._until_after=f._until_after)}I.prototype.read=function(){var g=this._input.read(this._starting_pattern);return(!this._starting_pattern||g)&&(g+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),g},I.prototype.read_match=function(){return this._input.match(this._match_pattern)},I.prototype.until_after=function(g){var f=this._create();return f._until_after=!0,f._until_pattern=this._input.get_regexp(g),f._update(),f},I.prototype.until=function(g){var f=this._create();return f._until_after=!1,f._until_pattern=this._input.get_regexp(g),f._update(),f},I.prototype.starting_with=function(g){var f=this._create();return f._starting_pattern=this._input.get_regexp(g,!0),f._update(),f},I.prototype.matching=function(g){var f=this._create();return f._match_pattern=this._input.get_regexp(g,!0),f._update(),f},I.prototype._create=function(){return new I(this._input,this)},I.prototype._update=function(){},n.exports.Pattern=I},function(n){function I(g,f){g=typeof g=="string"?g:g.source,f=typeof f=="string"?f:f.source,this.__directives_block_pattern=new RegExp(g+/ beautify( \w+[:]\w+)+ /.source+f,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(g+/\sbeautify\signore:end\s/.source+f,"g")}I.prototype.get_directives=function(g){if(!g.match(this.__directives_block_pattern))return null;var f={};this.__directive_pattern.lastIndex=0;for(var m=this.__directive_pattern.exec(g);m;)f[m[1]]=m[2],m=this.__directive_pattern.exec(g);return f},I.prototype.readIgnored=function(g){return g.readUntilAfter(this.__directives_end_ignore_pattern)},n.exports.Directives=I},function(n,I,g){var f=g(12).Pattern,m={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1};function h(o,p){f.call(this,o,p),this.__template_pattern=null,this._disabled=Object.assign({},m),this._excluded=Object.assign({},m),p&&(this.__template_pattern=this._input.get_regexp(p.__template_pattern),this._excluded=Object.assign(this._excluded,p._excluded),this._disabled=Object.assign(this._disabled,p._disabled));var l=new f(o);this.__patterns={handlebars_comment:l.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:l.starting_with(/{{{/).until_after(/}}}/),handlebars:l.starting_with(/{{/).until_after(/}}/),php:l.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),erb:l.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:l.starting_with(/{%/).until_after(/%}/),django_value:l.starting_with(/{{/).until_after(/}}/),django_comment:l.starting_with(/{#/).until_after(/#}/),smarty:l.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:l.starting_with(/{\*/).until_after(/\*}/),smarty_literal:l.starting_with(/{literal}/).until_after(/{\/literal}/)}}h.prototype=new f,h.prototype._create=function(){return new h(this._input,this)},h.prototype._update=function(){this.__set_templated_pattern()},h.prototype.disable=function(o){var p=this._create();return p._disabled[o]=!0,p._update(),p},h.prototype.read_options=function(o){var p=this._create();for(var l in m)p._disabled[l]=o.templating.indexOf(l)===-1;return p._update(),p},h.prototype.exclude=function(o){var p=this._create();return p._excluded[o]=!0,p._update(),p},h.prototype.read=function(){var o="";this._match_pattern?o=this._input.read(this._starting_pattern):o=this._input.read(this._starting_pattern,this.__template_pattern);for(var p=this._read_template();p;)this._match_pattern?p+=this._input.read(this._match_pattern):p+=this._input.readUntil(this.__template_pattern),o+=p,p=this._read_template();return this._until_after&&(o+=this._input.readUntilAfter(this._until_pattern)),o},h.prototype.__set_templated_pattern=function(){var o=[];this._disabled.php||o.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||o.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||o.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(o.push(this.__patterns.django._starting_pattern.source),o.push(this.__patterns.django_value._starting_pattern.source),o.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||o.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&o.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+o.join("|")+")")},h.prototype._read_template=function(){var o="",p=this._input.peek();if(p==="<"){var l=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&l==="?"&&(o=o||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&l==="%"&&(o=o||this.__patterns.erb.read())}else p==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(o=o||this.__patterns.handlebars_comment.read(),o=o||this.__patterns.handlebars_unescaped.read(),o=o||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(o=o||this.__patterns.django_value.read()),this._excluded.django||(o=o||this.__patterns.django_comment.read(),o=o||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(o=o||this.__patterns.smarty_comment.read(),o=o||this.__patterns.smarty_literal.read(),o=o||this.__patterns.smarty.read()));return o},n.exports.TemplatablePattern=h}],L={};function W(n){var I=L[n];if(I!==void 0)return I.exports;var g=L[n]={exports:{}};return U[n](g,g.exports,W),g.exports}var H=W(0);k=H})();var z=k;!(oe=[],$=function(){return{js_beautify:z}}.apply(Ee,oe),$!==void 0&&(tt.exports=$))})()},"746U":function(tt,Ee,J){"use strict";J.d(Ee,"f",function(){return oe}),J.d(Ee,"l",function(){return $}),J.d(Ee,"k",function(){return k}),J.d(Ee,"j",function(){return z}),J.d(Ee,"g",function(){return U}),J.d(Ee,"m",function(){return L}),J.d(Ee,"h",function(){return W}),J.d(Ee,"n",function(){return H}),J.d(Ee,"c",function(){return n}),J.d(Ee,"a",function(){return I}),J.d(Ee,"i",function(){return g}),J.d(Ee,"o",function(){return f}),J.d(Ee,"e",function(){return o}),J.d(Ee,"d",function(){return p}),J.d(Ee,"p",function(){return l}),J.d(Ee,"b",function(){return u});function oe(a){return Array.isArray(a)}function $(a){return typeof a=="string"}function k(a){return typeof a=="object"&&a!==null&&!Array.isArray(a)&&!(a instanceof RegExp)&&!(a instanceof Date)}function z(a){return typeof a=="number"&&!isNaN(a)}function U(a){return a===!0||a===!1}function L(a){return typeof a=="undefined"}function W(a){return!H(a)}function H(a){return L(a)||a===null}function n(a,s){if(!a)throw new Error(s?`Unexpected type, expected '${s}'`:"Unexpected type")}function I(a){if(H(a))throw new Error("Assertion Failed: argument is undefined or null");return a}function g(a){return typeof a=="function"}function f(a,s){const C=Math.min(a.length,s.length);for(let _=0;_<C;_++)m(a[_],s[_])}function m(a,s){if($(s)){if(typeof a!==s)throw new Error(`argument does not match constraint: typeof ${s}`)}else if(g(s)){try{if(a instanceof s)return}catch(C){}if(!H(a)&&a.constructor===s)return;if(s.length===1&&s.call(void 0,a)===!0)return;throw new Error("argument does not match one of these constraints: arg instanceof constraint, arg.constructor === constraint, nor constraint(arg) === true")}}function h(a){let s=[],C=Object.getPrototypeOf(a);for(;Object.prototype!==C;)s=s.concat(Object.getOwnPropertyNames(C)),C=Object.getPrototypeOf(C);return s}function o(a){const s=[];for(const C of h(a))typeof a[C]=="function"&&s.push(C);return s}function p(a,s){const C=w=>function(){const O=Array.prototype.slice.call(arguments,0);return s(w,O)};let _={};for(const w of a)_[w]=C(w);return _}function l(a){return a===null?void 0:a}function u(a,s="Unreachable"){throw new Error(s)}},"7Cbv":function(tt,Ee,J){"use strict";var oe=typeof crypto!="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto!="undefined"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),$=new Uint8Array(16);function k(){if(!oe)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return oe($)}var z=/^(?:[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 U(m){return typeof m=="string"&&z.test(m)}for(var L=U,W=[],H=0;H<256;++H)W.push((H+256).toString(16).substr(1));function n(m){var h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,o=(W[m[h+0]]+W[m[h+1]]+W[m[h+2]]+W[m[h+3]]+"-"+W[m[h+4]]+W[m[h+5]]+"-"+W[m[h+6]]+W[m[h+7]]+"-"+W[m[h+8]]+W[m[h+9]]+"-"+W[m[h+10]]+W[m[h+11]]+W[m[h+12]]+W[m[h+13]]+W[m[h+14]]+W[m[h+15]]).toLowerCase();if(!L(o))throw TypeError("Stringified UUID is invalid");return o}var I=n;function g(m,h,o){m=m||{};var p=m.random||(m.rng||k)();if(p[6]=p[6]&15|64,p[8]=p[8]&63|128,h){o=o||0;for(var l=0;l<16;++l)h[o+l]=p[l];return h}return I(p)}var f=Ee.a=g},"7ahc":function(tt,Ee,J){"use strict";J.d(Ee,"a",function(){return C});var oe=J("k1fw"),$=J("0Owb"),k=J("+L6B"),z=J("2/Rp"),U=J("y8nQ"),L=J("Vl3Y"),W=J("tJVT"),H=J("OaEy"),n=J("2fM7"),I=J("q1tI"),g=J.n(I),f=J("VrN/"),m=J.n(f),h=J("p77/"),o=J.n(h),p=J("c5Ni"),l=J.n(p),u=n.a.Option,a={labelCol:{span:4},wrapperCol:{span:20}},s={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"]};Ee.b=function(_){var w=_.callback,O=_.onCancel,R=Object(I.useState)("python"),S=Object(W.a)(R,2),T=S[0],E=S[1];function c(v){E(s[v][1])}function x(v){w(v)}return g.a.createElement(L.a,Object($.a)({},a,{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:x}),g.a.createElement(L.a.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},g.a.createElement(n.a,{onChange:c},Object.keys(s).map(function(v){return g.a.createElement(u,{key:v,value:v},s[v][0])}))),g.a.createElement(L.a.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},g.a.createElement(C,{mode:T})),g.a.createElement("div",{className:"flex-container flex-end"},g.a.createElement(z.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),g.a.createElement(z.a,{type:"ghost",onClick:O},"\u53D6\u6D88")))};function C(_){var w=_.value,O=_.onChange,R=_.mode,S=_.options,T=S===void 0?{}:S,E=Object(I.useRef)(),c=Object(I.useState)(),x=Object(W.a)(c,2),v=x[0],y=x[1];return Object(I.useEffect)(function(){if(v){function F(B){var A=B.getValue();O&&O(A)}return v.on("change",F),function(){v.off("change",F)}}},[v,O]),Object(I.useEffect)(function(){v&&v.setOption("mode",R)},[v,R]),Object(I.useEffect)(function(){v&&((w!==v.getValue()||w==="")&&setTimeout(function(){v.setValue(w||" ")},300))},[v,w]),Object(I.useEffect)(function(){if(E.current&&!v){var F=m.a.fromTextArea(E.current,Object(oe.a)({mode:R,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},T));y(F)}},[E.current,v]),g.a.createElement("div",{className:"my-codemirror-container"},g.a.createElement("textarea",{ref:E}))}},"8EBN":function(tt,Ee,J){(function(oe){oe(J("VrN/"))})(function(oe){"use strict";oe.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 $=0;$<oe.modeInfo.length;$++){var k=oe.modeInfo[$];k.mimes&&(k.mime=k.mimes[0])}oe.findModeByMIME=function(z){z=z.toLowerCase();for(var U=0;U<oe.modeInfo.length;U++){var L=oe.modeInfo[U];if(L.mime==z)return L;if(L.mimes){for(var W=0;W<L.mimes.length;W++)if(L.mimes[W]==z)return L}}if(/\+xml$/.test(z))return oe.findModeByMIME("application/xml");if(/\+json$/.test(z))return oe.findModeByMIME("application/json")},oe.findModeByExtension=function(z){z=z.toLowerCase();for(var U=0;U<oe.modeInfo.length;U++){var L=oe.modeInfo[U];if(L.ext){for(var W=0;W<L.ext.length;W++)if(L.ext[W]==z)return L}}},oe.findModeByFileName=function(z){for(var U=0;U<oe.modeInfo.length;U++){var L=oe.modeInfo[U];if(L.file&&L.file.test(z))return L}var W=z.lastIndexOf("."),H=W>-1&&z.substring(W+1,z.length);if(H)return oe.findModeByExtension(H)},oe.findModeByName=function(z){z=z.toLowerCase();for(var U=0;U<oe.modeInfo.length;U++){var L=oe.modeInfo[U];if(L.name.toLowerCase()==z)return L;if(L.alias){for(var W=0;W<L.alias.length;W++)if(L.alias[W].toLowerCase()==z)return L}}}})},"8HAY":function(tt,Ee,J){"use strict";J.d(Ee,"a",function(){return U}),J.d(Ee,"b",function(){return L}),J.d(Ee,"d",function(){return W}),J.d(Ee,"e",function(){return H}),J.d(Ee,"c",function(){return n});var oe=J("MI8n"),$=J("pmY6"),k=J("3/fG"),z=function(I,g,f,m){function h(o){return o instanceof f?o:new f(function(p){p(o)})}return new(f||(f=Promise))(function(o,p){function l(s){try{a(m.next(s))}catch(C){p(C)}}function u(s){try{a(m.throw(s))}catch(C){p(C)}}function a(s){s.done?o(s.value):h(s.value).then(l,u)}a((m=m.apply(I,g||[])).next())})};class U extends $.a{constructor(I,g="",f="",m=!0,h){super();this._onDidChange=this._register(new oe.b),this.onDidChange=this._onDidChange.event,this._enabled=!0,this._id=I,this._label=g,this._cssClass=f,this._enabled=m,this._actionCallback=h}get id(){return this._id}get label(){return this._label}set label(I){this._setLabel(I)}_setLabel(I){this._label!==I&&(this._label=I,this._onDidChange.fire({label:I}))}get tooltip(){return this._tooltip||""}set tooltip(I){this._setTooltip(I)}_setTooltip(I){this._tooltip!==I&&(this._tooltip=I,this._onDidChange.fire({tooltip:I}))}get class(){return this._cssClass}set class(I){this._setClass(I)}_setClass(I){this._cssClass!==I&&(this._cssClass=I,this._onDidChange.fire({class:I}))}get enabled(){return this._enabled}set enabled(I){this._setEnabled(I)}_setEnabled(I){this._enabled!==I&&(this._enabled=I,this._onDidChange.fire({enabled:I}))}get checked(){return this._checked}set checked(I){this._setChecked(I)}_setChecked(I){this._checked!==I&&(this._checked=I,this._onDidChange.fire({checked:I}))}run(I,g){return z(this,void 0,void 0,function*(){this._actionCallback&&(yield this._actionCallback(I))})}}class L extends $.a{constructor(){super(...arguments);this._onBeforeRun=this._register(new oe.b),this.onBeforeRun=this._onBeforeRun.event,this._onDidRun=this._register(new oe.b),this.onDidRun=this._onDidRun.event}run(I,g){return z(this,void 0,void 0,function*(){if(!I.enabled)return;this._onBeforeRun.fire({action:I});let f;try{yield this.runAction(I,g)}catch(m){f=m}this._onDidRun.fire({action:I,error:f})})}runAction(I,g){return z(this,void 0,void 0,function*(){yield I.run(g)})}}class W extends U{constructor(I){super(W.ID,I,I?"separator text":"separator");this.checked=!1,this.enabled=!1}}W.ID="vs.actions.separator";class H{constructor(I,g,f,m){this.tooltip="",this.enabled=!0,this.checked=!1,this.id=I,this.label=g,this.class=m,this._actions=f}get actions(){return this._actions}dispose(){}run(){return z(this,void 0,void 0,function*(){})}}class n extends U{constructor(){super(n.ID,k.a("submenu.empty","(empty)"),void 0,!1)}}n.ID="vs.actions.empty"},"8JLL":function(tt,Ee,J){tt.exports={flex_box_center:"flex_box_center___15KPT",flex_space_between:"flex_space_between___1QiSE",flex_box_vertical_center:"flex_box_vertical_center___3bNXy",flex_box_center_end:"flex_box_center_end___1hLE4",flex_box_column:"flex_box_column___3CCm3",reply:"reply___eY1t0",replyList:"replyList___3g6Og",comment:"comment___LHpQl",content:"content___XWl90",commentItem:"commentItem___2Y_u_"}},"8hTe":function(tt,Ee,J){tt.exports={button:"button___1wy9m"}},"9Bee":function(tt,Ee,J){"use strict";var oe=J("DYRE"),$=J("zeV3"),k=J("+L6B"),z=J("2/Rp"),U=J("k1fw"),L=J("9og8"),W=J("tJVT"),H=J("WmNS"),n=J.n(H),I=J("q1tI"),g=J.n(I),f=J("vg9a"),m=J("DlQD"),h=J.n(m),o=J("rUJ1");function p(le,Z){var q=le.match(/^(\s+)(?:```)/);if(q===null)return Z;var ae=q[1];return Z.split(`
`).map(function(ue){var ne=ue.match(/^\s+/);if(ne===null)return ue;var te=Object(W.a)(ne,1),de=te[0];return de.length>=ae.length?ue.slice(ae.length):ue}).join(`
`)}var l=[],u=["<ul>"],a=new h.a.Renderer,s=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function C(){l.length=0,u=["<ul>"]}var _={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function w(le,Z,q,ae){if(Z>=le.length||le[Z].level<=q)return Z;var ue=le[Z];ae.push("<li><a href='#"+ue.anchor+"'>"+ue.text+"</a>"),Z++;var ne=[];return Z=w(le,Z,ue.level,ne),ne.length>0&&(ae.push("<ul>"),ne.forEach(function(te){ae.push(te)}),ae.push("</ul>")),ae.push("</li>"),Z=w(le,Z,q,ae),Z}function O(){return w(l,0,0,u),u.push("</ul>"),u.join("")}var R={heading:function(Z){var q=s.exec(Z);if(q)return{type:"heading",raw:q[0],depth:q[1].length,text:q[2]}},fences:function(Z){var q=this.rules.block.fences.exec(Z);if(q){var ae=q[0],ue=p(ae,q[3]||""),ne=q[2]?q[2].trim():q[2];if(["latex","katex","math"].indexOf(ne)>=0){var te=E(),de=ue;ue=te,c[te]={type:"block",expression:de}}return{type:"code",raw:ae,lang:ne,text:ue}}}},S=/(?:\${2})([^\n`]+?)(?:\${2})/gi,T=0,E=function(){return"__special_katext_id_".concat(T++,"__")},c={};function x(){return c}function v(){T=0,c={}}function y(le){return le=le.replace(S,function(Z,q){var ae=E();return c[ae]={type:"inline",expression:q},ae}),le}var F=a.listitem;a.listitem=function(le){return F(y(le))};var B=a.paragraph;a.paragraph=function(le){return B(y(le))};var A=a.tablecell;a.tablecell=function(le,Z){return A(y(le),Z)},a.code=function(le,Z,q){var ae=(Z||"").match(/\S*/)[0];return ae?["latex","katex","math"].indexOf(ae)>=0?"<p class='editormd-tex'>".concat(le,"</p>"):'<pre class="prettyprint linenums"><code class="language-'.concat(Z,'">').concat(q?le:Object(o.escape)(le,!0),`</code></pre>
`):'<pre class="prettyprint linenums"><code>'+(q?le:Object(o.escape)(le,!0))+"</code></pre>"},a.heading=function(le,Z,q){var ae=this.options.headerPrefix+q.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return l.push({anchor:ae,level:Z,text:le}),"<h"+Z+' id="'+ae+'">'+le+"</h"+Z+">"},h.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),h.a.use({tokenizer:R,renderer:a});var j=h.a,P=J("SJMd"),b=J("ulZh"),V=J.n(b),re=J("m3rI"),ce=J("Oy/b"),me=J("p5ED"),De=J("ErOA"),we=J("STEk");/* **********************************
cropro version 1.2.0
@license SEE LICENSE IN LICENSE
copyright Alan Mendelevich
see README and LICENSE for details
********************************** *//*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */var Le=function(le,Z){return(Le=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(q,ae){q.__proto__=ae}||function(q,ae){for(var ue in ae)Object.prototype.hasOwnProperty.call(ae,ue)&&(q[ue]=ae[ue])})(le,Z)};function Re(le,Z){if(typeof Z!="function"&&Z!==null)throw new TypeError("Class extends value "+String(Z)+" is not a constructor or null");function q(){this.constructor=le}Le(le,Z),le.prototype=Z===null?Object.create(Z):(q.prototype=Z.prototype,new q)}function Ie(le,Z,q,ae){return new(q||(q=Promise))(function(ue,ne){function te(be){try{fe(ae.next(be))}catch(Te){ne(Te)}}function de(be){try{fe(ae.throw(be))}catch(Te){ne(Te)}}function fe(be){var Te;be.done?ue(be.value):(Te=be.value,Te instanceof q?Te:new q(function(Me){Me(Te)})).then(te,de)}fe((ae=ae.apply(le,Z||[])).next())})}function ye(le,Z){var q,ae,ue,ne,te={label:0,sent:function(){if(1&ue[0])throw ue[1];return ue[1]},trys:[],ops:[]};return ne={next:de(0),throw:de(1),return:de(2)},typeof Symbol=="function"&&(ne[Symbol.iterator]=function(){return this}),ne;function de(fe){return function(be){return function(Te){if(q)throw new TypeError("Generator is already executing.");for(;te;)try{if(q=1,ae&&(ue=2&Te[0]?ae.return:Te[0]?ae.throw||((ue=ae.return)&&ue.call(ae),0):ae.next)&&!(ue=ue.call(ae,Te[1])).done)return ue;switch(ae=0,ue&&(Te=[2&Te[0],ue.value]),Te[0]){case 0:case 1:ue=Te;break;case 4:return te.label++,{value:Te[1],done:!1};case 5:te.label++,ae=Te[1],Te=[0];continue;case 7:Te=te.ops.pop(),te.trys.pop();continue;default:if(!(ue=te.trys,(ue=ue.length>0&&ue[ue.length-1])||Te[0]!==6&&Te[0]!==2)){te=0;continue}if(Te[0]===3&&(!ue||Te[1]>ue[0]&&Te[1]<ue[3])){te.label=Te[1];break}if(Te[0]===6&&te.label<ue[1]){te.label=ue[1],ue=Te;break}if(ue&&te.label<ue[2]){te.label=ue[2],te.ops.push(Te);break}ue[2]&&te.ops.pop(),te.trys.pop();continue}Te=Z.call(le,te)}catch(Me){Te=[6,Me],ae=0}finally{q=ue=0}if(5&Te[0])throw Te[1];return{value:Te[0]?Te[1]:void 0,done:!0}}([fe,be])}}}var X=function(){function le(){}return le.addKey=function(Z){le.key=Z},Object.defineProperty(le,"isLicensed",{get:function(){return!!le.key&&new RegExp(/^CRPR-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(le.key)},enumerable:!1,configurable:!0}),le}(),M=function(){function le(){}return le.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},le.setAttributes=function(Z,q){for(var ae=0,ue=q;ae<ue.length;ae++){var ne=ue[ae],te=ne[0],de=ne[1];Z.setAttribute(te,de)}},le.createRect=function(Z,q,ae){var ue=document.createElementNS("http://www.w3.org/2000/svg","rect");return ue.setAttribute("width",Z.toString()),ue.setAttribute("height",q.toString()),ae&&le.setAttributes(ue,ae),ue},le.createLine=function(Z,q,ae,ue,ne){var te=document.createElementNS("http://www.w3.org/2000/svg","line");return te.setAttribute("x1",Z.toString()),te.setAttribute("y1",q.toString()),te.setAttribute("x2",ae.toString()),te.setAttribute("y2",ue.toString()),ne&&le.setAttributes(te,ne),te},le.createPolygon=function(Z,q){var ae=document.createElementNS("http://www.w3.org/2000/svg","polygon");return ae.setAttribute("points",Z),q&&le.setAttributes(ae,q),ae},le.createCircle=function(Z,q){var ae=document.createElementNS("http://www.w3.org/2000/svg","circle");return ae.setAttribute("cx",(Z/2).toString()),ae.setAttribute("cy",(Z/2).toString()),ae.setAttribute("r",Z.toString()),q&&le.setAttributes(ae,q),ae},le.createEllipse=function(Z,q,ae){var ue=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return ue.setAttribute("cx",(Z/2).toString()),ue.setAttribute("cy",(q/2).toString()),ue.setAttribute("rx",(Z/2).toString()),ue.setAttribute("ry",(q/2).toString()),ae&&le.setAttributes(ue,ae),ue},le.createGroup=function(Z){var q=document.createElementNS("http://www.w3.org/2000/svg","g");return Z&&le.setAttributes(q,Z),q},le.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},le.createMarker=function(Z,q,ae,ue,ne,te,de){var fe=document.createElementNS("http://www.w3.org/2000/svg","marker");return le.setAttributes(fe,[["id",Z],["orient",q],["markerWidth",ae.toString()],["markerHeight",ue.toString()],["refX",ne.toString()],["refY",te.toString()]]),fe.appendChild(de),fe},le.createText=function(Z){var q=document.createElementNS("http://www.w3.org/2000/svg","text");return q.setAttribute("x","0"),q.setAttribute("y","0"),Z&&le.setAttributes(q,Z),q},le.createTSpan=function(Z,q){var ae=document.createElementNS("http://www.w3.org/2000/svg","tspan");return ae.textContent=Z,q&&le.setAttributes(ae,q),ae},le.createImage=function(Z){var q=document.createElementNS("http://www.w3.org/2000/svg","image");return Z&&le.setAttributes(q,Z),q},le.createPoint=function(Z,q){var ae=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return ae.x=Z,ae.y=q,ae},le.createPath=function(Z,q){var ae=document.createElementNS("http://www.w3.org/2000/svg","path");return ae.setAttribute("d",Z),q&&le.setAttributes(ae,q),ae},le.createElement=function(Z,q){var ae=document.createElementNS("http://www.w3.org/2000/svg",Z);return q&&le.setAttributes(ae,q),ae},le.getHollowRectanglePath=function(Z,q,ae,ue,ne,te,de,fe){return"M"+Z+","+q+"V"+(q+ue)+"H"+(Z+ae)+"V"+q+"H"+ne+"V"+te+"H"+(ne+de)+"V"+(te+fe)+"H"+ne+"V"+q+"Z"},le}(),N=function(){function le(Z){this._classNamePrefixBase="__cropro_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+Z+"_"}return Object.defineProperty(le.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(le.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(le.prototype,"defaultSettings",{get:function(){return{canvasBackgroundColor:"#333333",toolbarBackgroundColor:"#111111",toolbarBackgroundHoverColor:"#333333",toolbarBackgroundActiveColor:"#282828",toolbarColor:"#eeeeee",cropShadeColor:"#ffffff",cropFrameColor:"#ffffff",gripColor:"#333333",gripFillColor:"#cccccc",toolbarHeight:40}},enumerable:!1,configurable:!0}),Object.defineProperty(le.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(le.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_out"},enumerable:!1,configurable:!0}),le.prototype.addClass=function(Z){return this.styleSheet===void 0&&this.addStyleSheet(),Z.name=""+this.classNamePrefix+Z.localName,this.classes.push(Z),this.styleSheet.sheet.insertRule("."+Z.name+" {"+Z.style+"}",this.styleSheet.sheet.cssRules.length),Z},le.prototype.addRule=function(Z){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(Z),this.styleSheet.sheet.insertRule(Z.selector+" {"+Z.style+"}",this.styleSheet.sheet.cssRules.length)},le.prototype.addStyleSheet=function(){var Z;this.styleSheet=document.createElement("style"),((Z=this.styleSheetRoot)!==null&&Z!==void 0?Z:document.head).appendChild(this.styleSheet),this.addRule(new Y("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new Y("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
from {
opacity: 0;
}
to {
opacity: 1;
}
`)),this.addRule(new Y("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
from {
opacity: 1;
}
to {
opacity: 0;
}
`)),this.addClass(new ie("_fade_in",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
`)),this.addClass(new ie("_fade_out",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
`))},le.prototype.removeStyleSheet=function(){var Z;this.styleSheet&&(((Z=this.styleSheetRoot)!==null&&Z!==void 0?Z:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},le}(),Y=function(le,Z){this.selector=le,this.style=Z},ie=function(le,Z){this.localName=le,this.style=Z},K=function(){function le(){this.blocks=[],this.display=""}return le.prototype.addButtonBlock=function(Z){Z.className=this.blockClassName,Z.buttonClassName=this.buttonClassName,Z.buttonColorsClassName=this.buttonColorsClassName,Z.buttonActiveColorsClassName=this.buttonActiveColorsClassName,this.blocks.push(Z)},le.prototype.addElementBlock=function(Z){Z.className===void 0&&(Z.className=this.blockClassName),this.blocks.push(Z)},le.prototype.getUI=function(){var Z=document.createElement("div");return Z.className=this.className+" "+this.colorsClassName+" "+this.fadeInClassName,Z.style.display=this.display,this.blocks.forEach(function(q){return Z.appendChild(q.getUI())}),Z},le}(),pe=function(){function le(){}return le.prototype.getUI=function(){var Z=document.createElement("div");if(Z.className=this.className,this.minWidth!==void 0&&(Z.style.minWidth=this.minWidth),this.contentAlign!==void 0)switch(this.contentAlign){case"start":Z.style.justifyContent="flex-start";break;case"center":Z.style.justifyContent="center";break;case"end":Z.style.justifyContent="flex-end"}return Z.style.whiteSpace="nowrap",Z},le}(),Se=function(le){function Z(){var q=le!==null&&le.apply(this,arguments)||this;return q.buttons=[],q}return Re(Z,le),Z.prototype.addButton=function(q){q.className=this.buttonClassName,q.colorsClassName=this.buttonColorsClassName,q.activeColorsClassName=this.buttonActiveColorsClassName,this.buttons.push(q)},Z.prototype.getUI=function(){var q=le.prototype.getUI.call(this);return this.buttons.forEach(function(ae){return q.appendChild(ae.getUI())}),q},Z}(pe),Pe=function(){function le(Z,q){this._isActive=!1,this._isHidden=!1,this._icon=Z,this.title=q,this.uiContainer=document.createElement("div"),this.adjustClassName=this.adjustClassName.bind(this)}return Object.defineProperty(le.prototype,"icon",{get:function(){return this._icon},set:function(Z){this._icon=Z,this.buttonContainer.innerHTML=this._icon},enumerable:!1,configurable:!0}),Object.defineProperty(le.prototype,"isActive",{get:function(){return this._isActive},set:function(Z){this._isActive=Z,this.adjustClassName()},enumerable:!1,configurable:!0}),le.prototype.getUI=function(){var Z=this;return this.buttonContainer=document.createElement("div"),this.buttonContainer.title=this.title,this.buttonContainer.className=this.className+" "+this.colorsClassName,this.adjustClassName(),this.buttonContainer.innerHTML=this._icon,this.onClick&&this.buttonContainer.addEventListener("click",function(){return Z.onClick()}),this.uiContainer.appendChild(this.buttonContainer),this.uiContainer.style.display=this._isHidden?"none":"inline-block",this.uiContainer},le.prototype.adjustClassName=function(){this.activeColorsClassName&&(this._isActive&&this.buttonContainer.className.indexOf(this.activeColorsClassName)<0?this.buttonContainer.className+=" "+this.activeColorsClassName:this._isActive||(this.buttonContainer.className=this.buttonContainer.className.replace(this.activeColorsClassName,"")))},le.prototype.hide=function(){this._isHidden=!0},le}(),he=function(le){function Z(){var q=le!==null&&le.apply(this,arguments)||this;return q.elements=[],q}return Re(Z,le),Z.prototype.addElement=function(q){this.elements.push(q)},Z.prototype.getUI=function(){var q=le.prototype.getUI.call(this);return this.elements.forEach(function(ae){return q.appendChild(ae)}),q},Z}(pe),ve=function(){function le(Z,q){this.horizontal=Z,this.vertical=q}return Object.defineProperty(le.prototype,"ratio",{get:function(){return 1*this.horizontal/this.vertical},enumerable:!1,configurable:!0}),le.prototype.getVerticalLength=function(Z){return Z/this.ratio},le.prototype.getHorizontalLength=function(Z){return Z*this.ratio},le}(),xe=function(){function le(){}return le.getIcon=function(Z,q){if(Z>0&&q>0){var ae=new ve(Z,q),ue=ae.ratio>=1?20:ae.getHorizontalLength(20),ne=ae.ratio<1?20:ae.getVerticalLength(20),te=document.createElementNS("http://www.w3.org/2000/svg","svg");te.setAttribute("xmlns","http://www.w3.org/2000/svg"),te.setAttribute("viewBox","0 0 24 24"),document.body.appendChild(te);var de=M.createDefs();te.appendChild(de);var fe=M.createElement("clipPath",[["id","text-bg-clip"]]);de.appendChild(fe);var be=M.createPath(M.getHollowRectanglePath((24-ue)/2,(24-ne)/2,ue,ne,(24-ue)/2+2,(24-ne)/2+2,ue-4,ne-4));te.appendChild(be);var Te=M.createText([["x","0"],["y","0"],["font-size","7px"],["font-family","monospace"]]);Te.appendChild(M.createTSpan(Z+":"+q)),te.appendChild(Te);var Me=Te.getBBox();M.setAttributes(Te,[["x",((24-Me.width)/2).toString()],["y",((24-Me.height)/2-Me.y).toString()]]);var je=M.createPath(M.getHollowRectanglePath(0,0,24,24,(24-Math.ceil(Me.width))/2,(24-Math.ceil(Me.height))/2,Math.ceil(Me.width),Math.ceil(Me.height)));return fe.appendChild(je),M.setAttributes(be,[["clip-path","url(#text-bg-clip)"]]),document.body.removeChild(te),te.outerHTML}return'<svg viewBox="0 0 24 24"><path d="M19 12h-2v3h-3v2h5v-5M7 9h3V7H5v5h2V9m14-6H3a2 2 0 00-2 2v14a2 2 0 002 2h18a2 2 0 002-2V5a2 2 0 00-2-2m0 16H3V5h18v14z"/></svg>'},le}(),Ce=function(le){function Z(q,ae,ue){var ne=le.call(this,q,ae)||this;return ne.isDropdownOpen=!1,ne.onClick=ne.dropdownButtonClicked,ne.dropdownButtons=ue,ne}return Re(Z,le),Z.prototype.setupDropdown=function(){var q=this;this.dropdownBlock=document.createElement("div"),this.dropdownBlock.className=this.dropdownClassName+" "+this.dropdownColorsClassName,this.dropdownBlock.style.display="none",this.dropdownButtons.forEach(function(ae){ae.className=q.className,ae.colorsClassName=q.colorsClassName,q.dropdownBlock.appendChild(ae.getUI())}),this.uiContainer.appendChild(this.dropdownBlock)},Z.prototype.positionDropdown=function(){this.dropdownBlock.style.left=this.uiContainer.clientLeft+"px",this.dropdownBlock.style.top=this.uiContainer.clientTop+this.uiContainer.clientHeight+"px"},Z.prototype.dropdownButtonClicked=function(){this.dropdownBlock===void 0&&this.setupDropdown(),this.isDropdownOpen=!this.isDropdownOpen,this.toggleDropdown()},Z.prototype.toggleDropdown=function(){this.positionDropdown(),this.dropdownBlock.style.display=this.isDropdownOpen?"inline-block":"none"},Z.prototype.showDropdown=function(){this.isDropdownOpen=!0,this.toggleDropdown()},Z.prototype.hideDropdown=function(){this.isDropdownOpen=!1,this.toggleDropdown()},Z}(Pe),Be=function(){function le(Z,q){this.GRIP_SIZE=10,this.color=Z,this.fillColor=q,this.visual=M.createGroup(),this.visual.appendChild(M.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(M.createCircle(this.GRIP_SIZE,[["fill",this.fillColor],["fill-opacity","0.9"],["stroke",this.color],["stroke-width","2"],["stroke-opacity","0.7"]]))}return le.prototype.ownsTarget=function(Z){return Z===this.visual||Z===this.visual.childNodes[0]||Z===this.visual.childNodes[1]},le.prototype.setCenter=function(Z,q){this.visual.childNodes.forEach(function(ae){return M.setAttributes(ae,[["cx",Z.toString()],["cy",q.toString()]])})},le}(),Ne=function(){function le(Z,q,ae,ue){this.isMoving=!1,this._isGridVisible=!0,this.numberOfGridLines=2,this.horizontalGridLines=[],this.verticalGridLines=[],this._zoomFactor=1,this.cropRectChanged=!1,this.canvasWidth=Z,this.canvasHeight=q,this.margin=ae,this.container=ue,this.attachEvents=this.attachEvents.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.resize=this.resize.bind(this),this.adjustCropRect=this.adjustCropRect.bind(this),this.scaleCanvas=this.scaleCanvas.bind(this),this.getRescaledRect=this.getRescaledRect.bind(this)}return Object.defineProperty(le.prototype,"aspectRatio",{get:function(){return this._aspectRatio},set:function(Z){this._aspectRatio=Z,this.adjustCropRect(),this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),Object.defineProperty(le.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(Z){this._isGridVisible=Z,this.gridContainer&&M.setAttributes(this.gridContainer,[["display",this._isGridVisible?"":"none"]])},enumerable:!1,configurable:!0}),Object.defineProperty(le.prototype,"zoomFactor",{get:function(){return this._zoomFactor},set:function(Z){this._zoomFactor=Z,this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),le.prototype.open=function(){var Z=this;this.cropShadeElement=M.createPath("M0,0Z",[["fill",this.cropShadeColor],["fill-opacity","0.8"]]),this.container.appendChild(this.cropShadeElement),this.gridContainer=M.createGroup([["display",this.isGridVisible?"":"none"]]),this.container.appendChild(this.gridContainer);for(var q=0;q<this.numberOfGridLines;q++)this.horizontalGridLines.push(M.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]])),this.verticalGridLines.push(M.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]]));this.horizontalGridLines.forEach(function(ae){return Z.gridContainer.appendChild(ae)}),this.verticalGridLines.forEach(function(ae){return Z.gridContainer.appendChild(ae)}),this.cropRectElement=M.createRect(0,0,[["stroke",this.cropFrameColor],["stroke-width","3"],["fill","transparent"]]),this.container.appendChild(this.cropRectElement),this.topLeftGrip=new Be(this.gripColor,this.gripFillColor),this.container.appendChild(this.topLeftGrip.visual),this.topRightGrip=new Be(this.gripColor,this.gripFillColor),this.container.appendChild(this.topRightGrip.visual),this.bottomLeftGrip=new Be(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomLeftGrip.visual),this.bottomRightGrip=new Be(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomRightGrip.visual),this.attachEvents()},le.prototype.setCropRectangle=function(Z){this.cropRect=Z;var q=Object.assign({},this.cropRect);this.zoomFactor!==1&&(q.width=this.cropRect.width*this.zoomFactor,q.height=this.cropRect.height*this.zoomFactor,q.x=this.cropRect.height/this.cropRect.width<this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasWidth/2-q.width/2,q.y=this.cropRect.height/this.cropRect.width>this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasHeight/2-q.height/2),M.setAttributes(this.cropRectElement,[["x",q.x.toString()],["y",q.y.toString()],["width",q.width.toString()],["height",q.height.toString()]]);var ae=q.height/(this.numberOfGridLines+1);this.horizontalGridLines.forEach(function(ne,te){var de=q.y+ae*(te+1);M.setAttributes(ne,[["x1",""+q.x],["y1",""+de],["x2",""+(q.x+q.width)],["y2",""+de]])});var ue=q.width/(this.numberOfGridLines+1);this.verticalGridLines.forEach(function(ne,te){var de=q.x+ue*(te+1);M.setAttributes(ne,[["x1",""+de],["y1",""+q.y],["x2",""+de],["y2",""+(q.y+q.height)]])}),M.setAttributes(this.cropShadeElement,[["d",M.getHollowRectanglePath(0,0,this.canvasWidth+2*this.margin,this.canvasHeight+2*this.margin,q.x,q.y,q.width,q.height)]]),this.topLeftGrip.setCenter(q.x,q.y),this.topRightGrip.setCenter(q.x+q.width,q.y),this.bottomLeftGrip.setCenter(q.x,q.y+q.height),this.bottomRightGrip.setCenter(q.x+q.width,q.y+q.height),this.cropRectChanged&&this.onCropChange&&(this.cropRectChanged=!1,this.onCropChange(this.cropRect)),this.cropRectChanged=!1},le.prototype.attachEvents=function(){this.container.style.touchAction="none",this.container.addEventListener("pointerdown",this.onPointerDown),this.container.addEventListener("pointermove",this.onPointerMove),this.container.addEventListener("pointerup",this.onPointerUp)},le.prototype.clientToLocalCoordinates=function(Z,q){var ae=this.container.getBoundingClientRect();return{x:Z-ae.left+this.margin,y:q-ae.top+this.margin}},le.prototype.onPointerDown=function(Z){this.container.setPointerCapture(Z.pointerId),this.previousPoint=this.clientToLocalCoordinates(Z.clientX,Z.clientY),this.cropRectElement===Z.target?this.isMoving=!0:this.topLeftGrip.ownsTarget(Z.target)?this.activeGrip=this.topLeftGrip:this.bottomLeftGrip.ownsTarget(Z.target)?this.activeGrip=this.bottomLeftGrip:this.topRightGrip.ownsTarget(Z.target)?this.activeGrip=this.topRightGrip:this.bottomRightGrip.ownsTarget(Z.target)&&(this.activeGrip=this.bottomRightGrip)},le.prototype.onPointerMove=function(Z){if(this.isMoving)this.move(this.clientToLocalCoordinates(Z.clientX,Z.clientY));else if(this.activeGrip){var q=this.clientToLocalCoordinates(Z.clientX,Z.clientY);this.resize(q)}Z.preventDefault()},le.prototype.onPointerUp=function(Z){this.activeGrip=void 0,this.isMoving=!1,this.container.releasePointerCapture(Z.pointerId)},le.prototype.move=function(Z){var q=Z.x-this.previousPoint.x,ae=Z.y-this.previousPoint.y;this.zoomFactor!==1&&(q=-q/this.zoomFactor,ae=-ae/this.zoomFactor),this.cropRect.x=Math.min(Math.max(this.margin,this.cropRect.x+q),this.canvasWidth-this.cropRect.width+this.margin),this.cropRect.y=Math.min(Math.max(this.margin,this.cropRect.y+ae),this.canvasHeight-this.cropRect.height+this.margin),this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect),this.previousPoint=Z},le.prototype.resize=function(Z){var q=Object.assign({},this.cropRect),ae=Z.x-this.previousPoint.x,ue=Z.y-this.previousPoint.y;switch(this.activeGrip){case this.bottomLeftGrip:case this.topLeftGrip:q.x+ae<this.margin&&(ae=this.margin-q.x),q.x+=ae,q.width=this.cropRect.x+this.cropRect.width-q.x;break;case this.bottomRightGrip:case this.topRightGrip:q.width+ae>this.canvasWidth*this.zoomFactor&&(ae=this.canvasWidth*this.zoomFactor-q.width),q.width+=ae}switch(this.activeGrip){case this.topLeftGrip:case this.topRightGrip:this.aspectRatio?(q.y=this.cropRect.y-(this.activeGrip===this.topLeftGrip?-1:1)*this.aspectRatio.getVerticalLength(ae),q.height=this.aspectRatio.getVerticalLength(q.width)):(q.y+=ue,q.height=this.cropRect.y+this.cropRect.height-q.y);break;case this.bottomLeftGrip:case this.bottomRightGrip:this.aspectRatio?q.height=this.aspectRatio.getVerticalLength(q.width):q.height+=ue}q.width<10&&(q.x=this.cropRect.x,q.width=10),q.height<10&&(q.y=this.cropRect.y,q.height=10),this.previousPoint=Z,q.x>=this.margin&&q.y>=this.margin&&q.x-this.margin+q.width<=this.canvasWidth&&q.y-this.margin+q.height<=this.canvasHeight&&(this.cropRect=q,this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect))},le.prototype.adjustCropRect=function(){if(this.aspectRatio&&Math.round(this.cropRect.height)!==Math.round(this.aspectRatio.getVerticalLength(this.cropRect.width))){var Z=this.cropRect.x+this.cropRect.width/2,q=this.cropRect.y+this.cropRect.height/2,ae=this.aspectRatio.getHorizontalLength(this.cropRect.height),ue=this.aspectRatio.getVerticalLength(this.cropRect.width);ae/this.canvasWidth<ue/this.canvasHeight?this.cropRect.width=ae:this.cropRect.height=ue,this.cropRect.width>this.canvasWidth&&(this.cropRect.height/=this.cropRect.width/this.canvasWidth,this.cropRect.width=this.canvasWidth),this.cropRect.height>this.canvasHeight&&(this.cropRect.width/=this.cropRect.height/this.canvasHeight,this.cropRect.height=this.canvasHeight),this.cropRect.x=Z-this.cropRect.width/2,this.cropRect.y=q-this.cropRect.height/2,this.cropRect.x+this.cropRect.width>this.margin+this.canvasWidth&&(this.cropRect.x=this.margin+this.canvasWidth-this.cropRect.width),this.cropRect.y+this.cropRect.height>this.margin+this.canvasHeight&&(this.cropRect.y=this.margin+this.canvasHeight-this.cropRect.height),this.cropRect.x=Math.max(this.cropRect.x,this.margin),this.cropRect.y=Math.max(this.cropRect.y,this.margin)}},le.prototype.getRescaledRect=function(Z,q,ae,ue,ne,te){var de=ae/Z,fe=ue/q;return{x:(ne.x-te)*de+te,y:(ne.y-te)*fe+te,width:ne.width*de,height:ne.height*fe}},le.prototype.scaleCanvas=function(Z,q){var ae=this.getRescaledRect(this.canvasWidth,this.canvasHeight,Z,q,this.cropRect,this.margin);this.canvasWidth=Z,this.canvasHeight=q,this.onCropChange&&this.onCropChange(ae),this.setCropRectangle(ae)},le}(),Ue=function(){function le(Z){this._angle=0,this.isDragging=!1,this.width=401,this.height=24,this.title=Z,this.uiContainer=document.createElement("div"),this.getUI=this.getUI.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.setAngleLabel=this.setAngleLabel.bind(this),this.positionScaleShape=this.positionScaleShape.bind(this)}return Object.defineProperty(le.prototype,"angle",{get:function(){return this._angle},set:function(Z){this._angle=Z,this.setAngleLabel(),this.positionScaleShape()},enumerable:!1,configurable:!0}),le.prototype.getUI=function(){return this.controlContainer=document.createElement("div"),this.controlContainer.title=this.title,this.controlContainer.className=this.className+" "+this.colorsClassName,this.controlContainer.appendChild(this.getVisual()),this.controlContainer.addEventListener("pointerdown",this.onPointerDown),this.controlContainer.addEventListener("pointermove",this.onPointerMove),this.controlContainer.addEventListener("pointerup",this.onPointerUp),this.uiContainer.appendChild(this.controlContainer),this.uiContainer.style.display="inline-block",this.uiContainer.style.touchAction="none",this.setAngleLabel(),this.positionScaleShape(),this.uiContainer},le.prototype.onPointerDown=function(Z){this.controlContainer.setPointerCapture(Z.pointerId),this.isDragging=!0,this.previousPoint={x:Z.clientX,y:Z.clientY}},le.prototype.onPointerMove=function(Z){this.isDragging&&(this.onAngleChange&&this.onAngleChange((Z.clientX-this.previousPoint.x)/5),this.previousPoint.x=Z.clientX)},le.prototype.onPointerUp=function(Z){this.isDragging&&this.onAngleChange&&this.onAngleChange((Z.clientX-this.previousPoint.x)/5),this.isDragging=!1,this.controlContainer.releasePointerCapture(Z.pointerId)},le.prototype.setAngleLabel=function(){if(this.angleLabelText){this.angleLabelText.innerHTML=""+Math.round(this._angle);var Z=this.angleLabelText.getBBox();M.setAttributes(this.angleLabelElement,[["x",((this.width-Z.width)/2).toString()],["y",(this.height/2).toString()]])}},le.prototype.positionScaleShape=function(){if(this.scaleShape){var Z=this.scaleShape.transform.baseVal.getItem(0);Z.setTranslate(this._angle%5*5-25,0),this.scaleShape.transform.baseVal.replaceItem(Z,0)}},le.prototype.getVisual=function(){var Z=document.createElementNS("http://www.w3.org/2000/svg","svg");Z.setAttribute("xmlns","http://www.w3.org/2000/svg"),Z.setAttribute("width",this.width+"px"),Z.setAttribute("height",this.height+"px"),Z.setAttribute("viewBox","0 0 "+this.width+" "+this.height),Z.style.flexShrink="0",document.body.appendChild(Z);for(var q="M0,"+(this.height-1)+" v"+-this.height/3+"h1v"+this.height/3,ae=1;ae<=this.width/5+10;ae++){var ue=ae%5==0?this.height/3:this.height/6;q+="h4v"+-ue+"h1v"+ue}q+="v1H0Z",this.scaleShape=M.createPath(q);var ne=M.createTransform();this.scaleShape.transform.baseVal.appendItem(ne),Z.appendChild(this.scaleShape),this.angleLabelElement=M.createText([["x","0"],["y","0"],["font-size","10px"],["font-family","monospace"]]),this.angleLabelText=M.createTSpan(""),this.angleLabelElement.appendChild(this.angleLabelText);var te=M.createTSpan("");return te.innerHTML="&deg;",this.angleLabelElement.appendChild(te),Z.appendChild(this.angleLabelElement),document.body.removeChild(Z),Z},le}(),He=function(){function le(){this.naturalSize=!1,this.imageType="image/png"}return le.prototype.rasterize=function(Z,q,ae,ue,ne,te,de){var fe=this;return new Promise(function(be){var Te=document.createElement("canvas");Te.width=Z.width.baseVal.value-2*ue,Te.height=Z.height.baseVal.value-2*ue;var Me=1,je=1;fe.naturalSize===!0?(Me=q.naturalWidth/(Z.width.baseVal.value-2*ue)/te,je=q.naturalHeight/(Z.height.baseVal.value-2*ue)/de,Te.width=q.naturalWidth/te,Te.height=q.naturalHeight/de):fe.width!==void 0&&fe.height!==void 0&&(Me=fe.width/ae.width,je=fe.height/ae.height,Te.width*=Me,Te.height*=je);var nt=Te.getContext("2d");nt.translate(Te.width/2,Te.height/2),nt.rotate(ne*Math.PI/180),nt.scale(te,de),nt.translate(-Te.width/2,-Te.height/2),nt.drawImage(q,0,0,Te.width,Te.height);var it=document.createElement("canvas");it.width=ae.width*Me,it.height=ae.height*je,it.getContext("2d").putImageData(nt.getImageData((ae.x-ue)*Me,(ae.y-ue)*je,ae.width*Me,ae.height*je),0,0),be(it.toDataURL(fe.imageType,fe.imageQuality))})},le}(),ze=function(){function le(Z){this._zoomToCropEnabled=!0,this.zoomFactor=1,this.flippedHorizontally=!1,this.flippedVertically=!1,this._isGridVisible=!0,this._gridLines=2,this._rotationAngle=0,this.scaleFactor=1,this.renderEventListeners=[],this.closeEventListeners=[],this._isOpen=!1,this.CANVAS_MARGIN=20,this.renderAtNaturalSize=!1,this.renderImageType="image/png",this.displayMode="inline",this.popupMargin=30,this.toolbarHeight=40,this.aspectRatios=[{horizontal:0,vertical:0},{horizontal:4,vertical:3},{horizontal:3,vertical:2},{horizontal:16,vertical:9},{horizontal:1,vertical:1},{horizontal:3,vertical:4},{horizontal:2,vertical:3},{horizontal:9,vertical:16}],this._instanceNo=le.instanceCounter++,this.styles=new N(this.instanceNo),this.target=Z,this.targetRoot=document.body,this.open=this.open.bind(this),this.setTopLeft=this.setTopLeft.bind(this),this.overrideOverflow=this.overrideOverflow.bind(this),this.restoreOverflow=this.restoreOverflow.bind(this),this.close=this.close.bind(this),this.closeUI=this.closeUI.bind(this),this.addCloseEventListener=this.addCloseEventListener.bind(this),this.removeCloseEventListener=this.removeCloseEventListener.bind(this),this.addRenderEventListener=this.addRenderEventListener.bind(this),this.removeRenderEventListener=this.removeRenderEventListener.bind(this),this.clientToLocalCoordinates=this.clientToLocalCoordinates.bind(this),this.onWindowResize=this.onWindowResize.bind(this),this.setWindowHeight=this.setWindowHeight.bind(this),this.rotateBy=this.rotateBy.bind(this),this.applyRotation=this.applyRotation.bind(this),this.cropRectChanged=this.cropRectChanged.bind(this),this.zoomToCrop=this.zoomToCrop.bind(this),this.unzoomFromCrop=this.unzoomFromCrop.bind(this),this.rotateLeftButtonClicked=this.rotateLeftButtonClicked.bind(this),this.rotateRightButtonClicked=this.rotateRightButtonClicked.bind(this),this.flipHorizontallyButtonClicked=this.flipHorizontallyButtonClicked.bind(this),this.flipVerticallyButtonClicked=this.flipVerticallyButtonClicked.bind(this),this.applyFlip=this.applyFlip.bind(this),this.startRenderAndClose=this.startRenderAndClose.bind(this),this.render=this.render.bind(this),this.onPopupResize=this.onPopupResize.bind(this),this.applyAspectRatio=this.applyAspectRatio.bind(this)}return Object.defineProperty(le.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),Object.defineProperty(le.prototype,"zoomToCropEnabled",{get:function(){return this._zoomToCropEnabled},set:function(Z){this._zoomToCropEnabled=Z,Z?this.zoomToCrop():this.unzoomFromCrop()},enumerable:!1,configurable:!0}),Object.defineProperty(le.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(Z){this._isGridVisible=Z,this.cropLayer&&(this.cropLayer.isGridVisible=this._isGridVisible)},enumerable:!1,configurable:!0}),Object.defineProperty(le.prototype,"gridLines",{get:function(){return this._gridLines},set:function(Z){this._gridLines=Z,this.cropLayer&&(this.cropLayer.numberOfGridLines=this._gridLines)},enumerable:!1,configurable:!0}),Object.defineProperty(le.prototype,"rotationAngle",{get:function(){return this._rotationAngle},set:function(Z){this._rotationAngle=Z,this.straightener&&(this.straightener.angle=this._rotationAngle)},enumerable:!1,configurable:!0}),Object.defineProperty(le.prototype,"paddedImageWidth",{get:function(){return this.imageWidth+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(le.prototype,"paddedImageHeight",{get:function(){return this.imageHeight+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(le.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(le.prototype,"aspectRatio",{get:function(){var Z;return(Z=this._aspectRatio)!==null&&Z!==void 0?Z:this.aspectRatios[0]},set:function(Z){this._aspectRatio=Z},enumerable:!1,configurable:!0}),le.prototype.open=function(){this.imageWidth=Math.round(this.target.clientWidth),this.imageHeight=Math.round(this.target.clientHeight),this.setupResizeObserver(),this.initCropCanvas(),this.setEditingTarget(),this.setTopLeft(),this.initCropLayer(),this.attachEvents(),this.applyAspectRatio(),this.displayMode==="popup"&&this.onPopupResize(),this._isOpen=!0},le.prototype.show=function(){this.showUI(),this.open()},le.prototype.close=function(Z){Z===void 0&&(Z=!1),this.isOpen&&(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),Z||this.closeEventListeners.forEach(function(q){return q()}),this._isOpen=!1)},le.prototype.addRenderEventListener=function(Z){this.renderEventListeners.push(Z)},le.prototype.removeRenderEventListener=function(Z){this.renderEventListeners.indexOf(Z)>-1&&this.renderEventListeners.splice(this.renderEventListeners.indexOf(Z),1)},le.prototype.addCloseEventListener=function(Z){this.closeEventListeners.push(Z)},le.prototype.removeCloseEventListener=function(Z){this.closeEventListeners.indexOf(Z)>-1&&this.closeEventListeners.splice(this.closeEventListeners.indexOf(Z),1)},le.prototype.setupResizeObserver=function(){var Z=this;this.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){Z.resize(Z.target.clientWidth,Z.target.clientHeight)}),this.targetObserver.observe(this.target)):this.displayMode==="popup"&&(window.ResizeObserver&&(this.targetObserver=new ResizeObserver(this.onPopupResize),this.targetObserver.observe(this.contentDiv)),window.addEventListener("resize",this.setWindowHeight))},le.prototype.onPopupResize=function(){if(this.contentDiv.clientWidth>0&&this.contentDiv.clientHeight>0){var Z=1*this.target.clientWidth/this.target.clientHeight,q=this.contentDiv.clientWidth/Z>this.contentDiv.clientHeight?(this.contentDiv.clientHeight-2*this.CANVAS_MARGIN)*Z:this.contentDiv.clientWidth-2*this.CANVAS_MARGIN,ae=q+2*this.CANVAS_MARGIN<this.contentDiv.clientWidth?this.contentDiv.clientHeight-2*this.CANVAS_MARGIN:(this.contentDiv.clientWidth-2*this.CANVAS_MARGIN)/Z;this.resize(q,ae)}},le.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},le.prototype.setEditingTargetSize=function(){this.editorCanvas.style.width=this.imageWidth+2*this.CANVAS_MARGIN+"px",this.editorCanvas.style.height=this.imageHeight+2*this.CANVAS_MARGIN+"px",M.setAttributes(this.editingTarget,[["width",""+this.imageWidth],["height",""+this.imageHeight]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px"},le.prototype.resize=function(Z,q){this.imageWidth=Math.round(Z),this.imageHeight=Math.round(q),this.setEditingTargetSize(),this.cropImage.setAttribute("width",this.paddedImageWidth.toString()),this.cropImage.setAttribute("height",this.paddedImageHeight.toString()),this.cropImage.setAttribute("viewBox","0 0 "+this.paddedImageWidth.toString()+" "+this.paddedImageHeight.toString()),this.cropImageHolder.style.width=this.paddedImageWidth+"px",this.cropImageHolder.style.height=this.paddedImageHeight+"px",this.displayMode!=="popup"?this.coverDiv.style.width=this.paddedImageWidth+"px":(this.setTopLeft(),this.positionCropImage()),this.cropLayer.scaleCanvas(this.imageWidth,this.imageHeight),this.applyRotation()},le.prototype.setEditingTarget=function(){var Z=document.createElement("canvas");Z.width=this.target.naturalWidth,Z.height=this.target.naturalHeight,Z.getContext("2d").drawImage(this.target,0,0,this.target.naturalWidth,this.target.naturalHeight);var q=Z.toDataURL();M.setAttributes(this.editingTarget,[["href",q]]),this.setEditingTargetSize()},le.prototype.setTopLeft=function(){var Z=this.target.getBoundingClientRect(),q=this.editorCanvas.getBoundingClientRect();this.left=Z.left-q.left-this.CANVAS_MARGIN,this.top=Z.top-q.top-this.CANVAS_MARGIN},le.prototype.initCropCanvas=function(){this.cropImageHolder=document.createElement("div"),this.cropImageHolder.style.setProperty("touch-action","none"),this.cropImageHolder.style.setProperty("-ms-touch-action","none"),this.cropImage=document.createElementNS("http://www.w3.org/2000/svg","svg"),this.cropImage.setAttribute("xmlns","http://www.w3.org/2000/svg"),this.cropImage.setAttribute("width",this.paddedImageWidth.toString()),this.cropImage.setAttribute("height",this.paddedImageHeight.toString()),this.cropImage.setAttribute("viewBox","0 0 "+this.paddedImageWidth.toString()+" "+this.paddedImageHeight.toString()),this.cropImage.style.pointerEvents="auto",this.cropImageHolder.style.width=this.paddedImageWidth+"px",this.cropImageHolder.style.height=this.paddedImageHeight+"px",this.cropImageHolder.style.transformOrigin="top left",this.positionCropImage(),this.defs=M.createDefs(),this.cropImage.appendChild(this.defs),this.editingTarget=M.createImage([["href",""]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationContainer=M.createGroup(),this.editingTargetRotationScaleContainer=M.createGroup(),this.editingTargetRotationScaleContainer.appendChild(this.editingTarget),this.editingTargetRotationContainer.appendChild(this.editingTargetRotationScaleContainer);var Z=M.createTransform();this.editingTargetRotationContainer.transform.baseVal.appendItem(Z);var q=M.createTransform();this.editingTargetRotationScaleContainer.transform.baseVal.appendItem(q),this.editingTargetContainer=M.createGroup(),this.editingTargetContainer.style.transform="translate("+this.CANVAS_MARGIN+"px, "+this.CANVAS_MARGIN+"px)",this.editingTargetContainer.appendChild(this.editingTargetRotationContainer),this.cropImage.appendChild(this.editingTargetContainer),this.cropImageHolder.appendChild(this.cropImage),this.editorCanvas.appendChild(this.cropImageHolder)},le.prototype.positionCropImage=function(){this.cropImageHolder.style.top=this.top+"px",this.cropImageHolder.style.left=this.left+"px"},le.prototype.initCropLayer=function(){this.cropRect={x:this.CANVAS_MARGIN,y:this.CANVAS_MARGIN,width:this.imageWidth,height:this.imageHeight},this.cropLayerContainer=M.createGroup(),this.cropImage.appendChild(this.cropLayerContainer),this.cropLayer=new Ne(this.imageWidth,this.imageHeight,this.CANVAS_MARGIN,this.cropLayerContainer),this.cropLayer.onCropChange=this.cropRectChanged,this.cropLayer.numberOfGridLines=this.gridLines,this.cropLayer.isGridVisible=this.isGridVisible,this.cropLayer.cropShadeColor=this.styles.settings.cropShadeColor,this.cropLayer.cropFrameColor=this.styles.settings.cropFrameColor,this.cropLayer.gripColor=this.styles.settings.gripColor,this.cropLayer.gripFillColor=this.styles.settings.gripFillColor,this.cropLayer.open(),this.cropLayer.setCropRectangle(this.cropRect),this.zoomToCropEnabled&&this.zoomToCrop()},le.prototype.zoomToCrop=function(){if(this.cropRect){var Z=this.cropRect.x-this.CANVAS_MARGIN+this.cropRect.width/2,q=this.cropRect.y-this.CANVAS_MARGIN+this.cropRect.height/2;this.zoomFactor=Math.min(this.imageWidth/this.cropRect.width,this.imageHeight/this.cropRect.height),this.editingTargetContainer&&this.cropLayer&&(this.editingTargetContainer.style.transformOrigin=Z+"px "+q+"px",this.editingTargetContainer.style.transform="translate("+(this.imageWidth/2-Z+this.CANVAS_MARGIN)+"px,"+(this.imageHeight/2-q+this.CANVAS_MARGIN)+"px) scale("+this.zoomFactor+")",this.cropLayer.zoomFactor=this.zoomFactor)}},le.prototype.unzoomFromCrop=function(){this.zoomFactor=1,this.editingTargetContainer&&this.cropLayer&&(this.editingTargetContainer.style.transformOrigin="center",this.editingTargetContainer.style.transform="translate("+this.CANVAS_MARGIN+"px, "+this.CANVAS_MARGIN+"px) scale(1)",this.cropLayer.zoomFactor=this.zoomFactor)},le.prototype.cropRectChanged=function(Z){this.cropRect=Z,this.zoomToCropEnabled?this.zoomToCrop():this.cropLayer.zoomFactor=1},le.prototype.attachEvents=function(){window.addEventListener("resize",this.onWindowResize)},le.prototype.overrideOverflow=function(){this.scrollXState=window.scrollX,this.scrollYState=window.scrollY,this.bodyOverflowState=document.body.style.overflow,window.scroll({top:0,left:0}),document.body.style.overflow="hidden"},le.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},le.prototype.showUI=function(){switch(this.addStyles(),this.displayMode==="popup"&&this.overrideOverflow(),this.coverDiv=document.createElement("div"),this.coverDiv.className=this.styles.classNamePrefixBase+" "+this.styles.classNamePrefix,this.coverDiv.style.fontSize="16px",this.displayMode){case"inline":this.coverDiv.style.position="absolute";var Z=this.styles.settings.hideTopToolbar?0:this.toolbarHeight,q=this.target.offsetTop>Z+this.CANVAS_MARGIN?this.target.offsetTop-(Z+this.CANVAS_MARGIN):0;this.coverDiv.style.top=q+"px",this.coverDiv.style.left=(this.target.offsetLeft>this.CANVAS_MARGIN?this.target.offsetLeft-this.CANVAS_MARGIN:0)+"px",this.coverDiv.style.width=this.target.offsetWidth+this.CANVAS_MARGIN+"px",this.coverDiv.style.zIndex=this.styles.settings.zIndex!==void 0?this.styles.settings.zIndex:"5";break;case"popup":this.coverDiv.style.position="absolute",this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=window.innerHeight+"px",this.coverDiv.style.backgroundColor="rgba(0, 0, 0, 0.75)",this.coverDiv.style.zIndex=this.styles.settings.zIndex!==void 0?this.styles.settings.zIndex:"1000",this.coverDiv.style.display="flex"}this.targetRoot.appendChild(this.coverDiv),this.uiDiv=document.createElement("div"),this.uiDiv.style.display="flex",this.uiDiv.style.flexDirection="column",this.uiDiv.style.flexGrow="2",this.uiDiv.style.margin=this.displayMode==="popup"?this.popupMargin+"px":"0px",this.uiDiv.style.border="0px",this.coverDiv.appendChild(this.uiDiv),this.addToolbars(),this.uiDiv.appendChild(this.topToolbar.getUI()),this.contentDiv=document.createElement("div"),this.contentDiv.style.display="flex",this.contentDiv.style.alignItems="center",this.contentDiv.style.flexDirection="row",this.contentDiv.style.flexGrow="2",this.contentDiv.style.flexShrink="1",this.contentDiv.style.overflow="hidden",this.contentDiv.style.backgroundColor=this.styles.settings.canvasBackgroundColor,this.displayMode==="popup"&&(this.contentDiv.style.maxHeight="calc(100vh - "+(2*this.popupMargin+2*this.toolbarHeight)+"px)",this.contentDiv.style.maxWidth="calc(100vw - "+2*this.popupMargin+"px)"),this.uiDiv.appendChild(this.contentDiv),this.editorCanvas=document.createElement("div"),this.editorCanvas.style.flexGrow="2",this.editorCanvas.style.flexShrink="1",this.editorCanvas.style.position="relative",this.editorCanvas.style.overflow="hidden",this.editorCanvas.style.display="flex",this.displayMode==="popup"&&(this.editorCanvas.style.alignItems="center",this.editorCanvas.style.justifyContent="center"),this.editorCanvas.style.pointerEvents="none",this.contentDiv.appendChild(this.editorCanvas),this.uiDiv.appendChild(this.bottomToolbar.getUI()),this.straightener.angle=this.rotationAngle},le.prototype.addToolbars=function(){this.addTopToolbar(),this.addBottomToolbar()},le.prototype.addTopToolbar=function(){var Z=this;this.topToolbar=new K,this.topToolbar.display=this.styles.settings.hideTopToolbar?"none":"",this.topToolbar.className=this.toolbarStyleClass.name,this.topToolbar.colorsClassName=this.styles.settings.toolbarStyleColorsClassName?this.styles.settings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name,this.topToolbar.fadeInClassName=this.styles.fadeInAnimationClassName,this.topToolbar.blockClassName=this.toolbarBlockStyleClass.name,this.topToolbar.buttonClassName=this.toolbarButtonStyleClass.name,this.topToolbar.buttonColorsClassName=this.styles.settings.toolbarButtonStyleColorsClassName?this.styles.settings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,this.topToolbar.buttonActiveColorsClassName=this.styles.settings.toolbarActiveButtonStyleColorsClassName?this.styles.settings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name;var q=new Se;q.minWidth=3*this.toolbarHeight+"px",this.topToolbar.addButtonBlock(q);var ae=[];this.aspectRatios.forEach(function(je){var nt=new Pe(xe.getIcon(je.horizontal,je.vertical),je.horizontal===0&&je.vertical===0?"FREE":je.horizontal+":"+je.vertical);nt.onClick=function(){return Z.ratioButtonClicked(je)},ae.push(nt)}),this.aspectRatioButton=new Ce(xe.getIcon(0,0),"Aspect ratio",ae),this.aspectRatioButton.dropdownClassName=this.toolbarDropdownStyleClass.name,this.aspectRatioButton.dropdownColorsClassName=this.styles.settings.toolbarDropdownStyleColorsClassName?this.styles.settings.toolbarDropdownStyleColorsClassName:this.toolbarDropdownStyleColorsClass.name,q.addButton(this.aspectRatioButton),this.aspectRatios.length<2&&this.aspectRatioButton.hide();var ue=new Pe('<svg viewBox="0 0 24 24"><path d="M10 4v4h4V4h-4m6 0v4h4V4h-4m0 6v4h4v-4h-4m0 6v4h4v-4h-4m-2 4v-4h-4v4h4m-6 0v-4H4v4h4m0-6v-4H4v4h4m0-6V4H4v4h4m2 6h4v-4h-4v4M4 2h16a2 2 0 012 2v16a2 2 0 01-2 2H4c-1.08 0-2-.9-2-2V4a2 2 0 012-2z"/></svg>',"Toggle grid");ue.isActive=this.isGridVisible,ue.onClick=function(){Z.isGridVisible=!Z.isGridVisible,ue.isActive=Z.isGridVisible},q.addButton(ue);var ne=new Pe('<svg viewBox="0 0 24 24"><path d="M15.5 14l5 5-1.5 1.5-5-5v-.79l-.27-.28A6.471 6.471 0 019.5 16 6.5 6.5 0 013 9.5 6.5 6.5 0 019.5 3 6.5 6.5 0 0116 9.5c0 1.61-.59 3.09-1.57 4.23l.28.27h.79m-6 0C12 14 14 12 14 9.5S12 5 9.5 5 5 7 5 9.5 7 14 9.5 14m2.5-4h-2v2H9v-2H7V9h2V7h1v2h2v1z"/></svg>',"Zoom to selection");if(ne.isActive=this.zoomToCropEnabled,ne.onClick=function(){Z.zoomToCropEnabled=!Z.zoomToCropEnabled,ne.isActive=Z.zoomToCropEnabled},q.addButton(ne),!X.isLicensed){var te=new he;this.topToolbar.addElementBlock(te);var de=document.createElement("div");de.className=this.topToolbar.buttonClassName+" "+this.topToolbar.buttonColorsClassName;var fe=document.createElement("a");fe.style.color="currentColor",fe.href="https://markerjs.com/products/cropro",fe.target="_blank",fe.innerHTML='<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="2"><path d="M16.326 14.895c0 1.126-.558 1.688-1.673 1.688H9.931c-1.116 0-1.674-.562-1.674-1.688V3.733c0-1.126.558-1.688 1.674-1.688h4.722c1.115 0 1.673.562 1.673 1.688v2.899h-1.957V3.793h-4.124v11.042h4.124v-3.242h1.957v3.302z" fill="currentColor"/><path d="M15.94 7.364a.783.783 0 00-1.065-.304l-11.01 6.126a.783.783 0 00-.303 1.065l4.498 8.085a.783.783 0 001.065.304l11.01-6.126a.783.783 0 00.303-1.065L15.94 7.364zM5.311 14.173l3.737 6.718 9.641-5.364-3.737-6.718-9.641 5.364z" fill="#eef762"/></svg>',de.appendChild(fe),te.addElement(de)}var be=new Se;be.minWidth=3*this.toolbarHeight+"px",be.contentAlign="end",this.topToolbar.addButtonBlock(be);var Te=new Pe('<svg viewBox="0 0 24 24"><path d="M9 20.42l-6.21-6.21 2.83-2.83L9 14.77l9.88-9.89 2.83 2.83L9 20.42z"/></svg>',"OK");Te.onClick=this.startRenderAndClose,be.addButton(Te),this.styles.settings.toolbarOkButtonStyleColorsClassName&&(Te.colorsClassName=this.styles.settings.toolbarOkButtonStyleColorsClassName);var Me=new Pe('<svg viewBox="0 0 24 24"><path d="M20 6.91L17.09 4 12 9.09 6.91 4 4 6.91 9.09 12 4 17.09 6.91 20 12 14.91 17.09 20 20 17.09 14.91 12 20 6.91z"/></svg>',"Close");Me.onClick=this.close,be.addButton(Me),this.styles.settings.toolbarCloseButtonStyleColorsClassName&&(Me.colorsClassName=this.styles.settings.toolbarCloseButtonStyleColorsClassName)},le.prototype.addBottomToolbar=function(){var Z=this;this.bottomToolbar=new K,this.bottomToolbar.display=this.styles.settings.hideBottomToolbar?"none":"",this.bottomToolbar.className=this.toolbarStyleClass.name,this.bottomToolbar.colorsClassName=this.styles.settings.toolbarStyleColorsClassName?this.styles.settings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name,this.bottomToolbar.fadeInClassName=this.styles.fadeInAnimationClassName,this.bottomToolbar.blockClassName=this.toolbarBlockStyleClass.name,this.bottomToolbar.buttonClassName=this.toolbarButtonStyleClass.name,this.bottomToolbar.buttonColorsClassName=this.styles.settings.toolbarButtonStyleColorsClassName?this.styles.settings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,this.bottomToolbar.buttonActiveColorsClassName=this.styles.settings.toolbarActiveButtonStyleColorsClassName?this.styles.settings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name;var q=new Se;q.minWidth=2*this.toolbarHeight+"px",this.bottomToolbar.addButtonBlock(q);var ae=new Pe('<svg viewBox="0 0 24 24"><path d="M13 4.07V1L8.45 5.55 13 10V6.09c2.84.48 5 2.94 5 5.91s-2.16 5.43-5 5.91v2.02c3.95-.49 7-3.85 7-7.93s-3.05-7.44-7-7.93M7.1 18.32c1.16.9 2.51 1.44 3.9 1.61V17.9c-.87-.15-1.71-.49-2.46-1.03L7.1 18.32M6.09 13H4.07c.17 1.39.72 2.73 1.62 3.89l1.41-1.42c-.52-.75-.87-1.59-1.01-2.47m1.02-4.47L5.7 7.11C4.8 8.27 4.24 9.61 4.07 11h2.02c.14-.87.49-1.72 1.02-2.47z"/></svg>',"Rotate left");ae.onClick=this.rotateLeftButtonClicked,q.addButton(ae);var ue=new Pe('<svg viewBox="0 0 24 24"><path d="M16.89 15.5l1.42 1.39c.9-1.16 1.45-2.5 1.62-3.89h-2.02c-.14.87-.48 1.72-1.02 2.5M13 17.9v2.02c1.39-.17 2.74-.71 3.9-1.61l-1.44-1.44c-.75.54-1.59.89-2.46 1.03m6.93-6.9a7.906 7.906 0 00-1.62-3.89l-1.42 1.42c.54.75.88 1.6 1.02 2.47m-2.36-5.45L11 1v3.07C7.06 4.56 4 7.92 4 12s3.05 7.44 7 7.93v-2.02c-2.84-.48-5-2.94-5-5.91s2.16-5.43 5-5.91V10l4.55-4.45z"/></svg>',"Rotate right");ue.onClick=this.rotateRightButtonClicked,q.addButton(ue);var ne=new he;ne.className=this.toolbarStraightenerBlockStyleClass.name,this.bottomToolbar.addElementBlock(ne),this.straightener=new Ue("Straighten"),this.straightener.className=this.toolbarStraightenerStyleClass.name,this.straightener.colorsClassName=this.styles.settings.toolbarStraightenerColorsClassName?this.styles.settings.toolbarStraightenerColorsClassName:this.toolbarStraightenerStyleColorsClass.name,this.straightener.onAngleChange=function(be){Z.rotateBy(be),Z.straightener.angle=Z.rotationAngle},ne.addElement(this.straightener.getUI());var te=new Se;te.minWidth=2*this.toolbarHeight+"px",te.contentAlign="end",this.bottomToolbar.addButtonBlock(te);var de=new Pe('<svg viewBox="0 0 24 24"><path d="M15 21h2v-2h-2m4-10h2V7h-2M3 5v14c0 1.1.9 2 2 2h4v-2H5V5h4V3H5c-1.1 0-2 .9-2 2m16-2v2h2c0-1.1-.9-2-2-2m-8 20h2V1h-2m8 16h2v-2h-2M15 5h2V3h-2m4 10h2v-2h-2m0 10c1.1 0 2-.9 2-2h-2z"/></svg>',"Flip horizontal");de.onClick=this.flipHorizontallyButtonClicked,te.addButton(de);var fe=new Pe('<svg viewBox="0 0 24 24"><path d="M3 15v2h2v-2m10 4v2h2v-2m2-16H5c-1.1 0-2 .9-2 2v4h2V5h14v4h2V5c0-1.1-.9-2-2-2m2 16h-2v2c1.1 0 2-.9 2-2M1 11v2h22v-2M7 19v2h2v-2m10-4v2h2v-2m-10 4v2h2v-2M3 19c0 1.1.9 2 2 2v-2z"/></svg>',"Flip vertical");fe.onClick=this.flipVerticallyButtonClicked,te.addButton(fe)},le.prototype.ratioButtonClicked=function(Z){this.aspectRatio=Z,this.applyAspectRatio(),this.aspectRatioButton.hideDropdown()},le.prototype.applyAspectRatio=function(){this.setCropLayerAspectRatio(),this.aspectRatioButton.icon=xe.getIcon(this.aspectRatio.horizontal,this.aspectRatio.vertical)},le.prototype.setCropLayerAspectRatio=function(){this.cropLayer&&(this.aspectRatio&&this.aspectRatio.horizontal!==0&&this.aspectRatio.vertical!==0?this.cropLayer.aspectRatio=new ve(this.aspectRatio.horizontal,this.aspectRatio.vertical):this.cropLayer.aspectRatio=void 0)},le.prototype.closeUI=function(){this.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},le.prototype.getState=function(){return{width:this.imageWidth,height:this.imageHeight,rotationAngle:this.rotationAngle,flippedHorizontally:this.flippedHorizontally,flippedVertically:this.flippedVertically,cropRect:Object.assign({},this.cropRect)}},le.prototype.restoreState=function(Z){if(Z){var q=this.cropLayer.getRescaledRect(Z.width,Z.height,this.imageWidth,this.imageHeight,Z.cropRect,this.CANVAS_MARGIN);this.cropLayer.setCropRectangle(q),this.cropRectChanged(q),this.flippedHorizontally=Z.flippedHorizontally,this.flippedVertically=Z.flippedVertically,this.applyFlip(),this.rotationAngle=Z.rotationAngle,this.applyRotation()}},le.prototype.clientToLocalCoordinates=function(Z,q){var ae=this.cropImage.getBoundingClientRect();return{x:Z-ae.left,y:q-ae.top}},le.prototype.onWindowResize=function(){this.positionUI()},le.prototype.positionUI=function(){switch(this.setTopLeft(),this.displayMode){case"inline":var Z=this.target.offsetTop>this.toolbarHeight?this.target.offsetTop-this.toolbarHeight:0;this.coverDiv.style.top=Z+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px";break;case"popup":this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=this.windowHeight+"px",this.contentDiv.style.maxHeight="calc(100vh - "+(2*this.popupMargin+2*this.toolbarHeight)+"px)"}this.positionCropImage()},le.prototype.rotateLeftButtonClicked=function(){var Z=this.rotationAngle-90;this.rotationAngle%90!=0&&(Z+=this.rotationAngle>=0?90-this.rotationAngle%90:-this.rotationAngle%90),this.rotateTo(Z)},le.prototype.rotateRightButtonClicked=function(){var Z=this.rotationAngle+90;this.rotationAngle%90!=0&&(Z-=this.rotationAngle>=0?this.rotationAngle%90:90+this.rotationAngle%90),this.rotateTo(Z)},le.prototype.rotateTo=function(Z){Z=(Z=Z>180?Z-360:Z)<=-180?Z+360:Z,this.rotationAngle=Z,this.applyRotation()},le.prototype.rotateBy=function(Z){this.rotateTo((this.rotationAngle+Z)%360)},le.prototype.applyRotation=function(){var Z=this.zoomToCropEnabled;this.zoomToCropEnabled=!1,this.editingTargetRotationScaleContainer.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationScaleContainer.style.transform="scale(1)";var q=this.editingTargetRotationContainer.transform.baseVal.getItem(0);q.setRotate(this.rotationAngle,this.imageWidth/2,this.imageHeight/2),this.editingTargetRotationContainer.transform.baseVal.replaceItem(q,0);var ae=this.editingTarget.getBoundingClientRect();this.scaleFactor=Math.min(this.imageWidth/ae.width,this.imageHeight/ae.height),this.editingTargetRotationScaleContainer.style.transform="scale("+this.scaleFactor+")",this.zoomToCropEnabled=Z},le.prototype.flipHorizontallyButtonClicked=function(){this.flippedHorizontally=!this.flippedHorizontally,this.applyFlip()},le.prototype.flipVerticallyButtonClicked=function(){this.flippedVertically=!this.flippedVertically,this.applyFlip()},le.prototype.applyFlip=function(){this.editingTarget.style.transform="scale("+(this.flippedHorizontally?-1:1)+","+(this.flippedVertically?-1:1)+")"},le.prototype.startRenderAndClose=function(){return Ie(this,void 0,void 0,function(){var Z,q;return ye(this,function(ae){switch(ae.label){case 0:return[4,this.render()];case 1:return Z=ae.sent(),q=this.getState(),this.renderEventListeners.forEach(function(ue){return ue(Z,q)}),this.close(!0),[2]}})})},le.prototype.render=function(){return Ie(this,void 0,void 0,function(){var Z;return ye(this,function(q){switch(q.label){case 0:return(Z=new He).naturalSize=this.renderAtNaturalSize,Z.imageType=this.renderImageType,Z.imageQuality=this.renderImageQuality,Z.width=this.renderWidth,Z.height=this.renderHeight,this.unzoomFromCrop(),M.setAttributes(this.cropLayerContainer,[["display","none"]]),[4,Z.rasterize(this.cropImage,this.target,{x:this.cropRect.x,y:this.cropRect.y,width:this.cropRect.width,height:this.cropRect.height},this.CANVAS_MARGIN,this.rotationAngle,this.scaleFactor*(this.flippedHorizontally?-1:1),this.scaleFactor*(this.flippedVertically?-1:1))];case 1:return q.sent(),[4,Z.rasterize(this.cropImage,this.target,{x:this.cropRect.x,y:this.cropRect.y,width:this.cropRect.width,height:this.cropRect.height},this.CANVAS_MARGIN,this.rotationAngle,this.scaleFactor*(this.flippedHorizontally?-1:1),this.scaleFactor*(this.flippedVertically?-1:1))];case 2:return[2,q.sent()]}})})},le.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new ie("toolbar",`
width: `+(this.displayMode==="inline"?"100%":"calc(100vw - "+2*this.popupMargin+"px)")+`;
flex-shrink: 0;
display: flex;
flex-direction: row;
justify-content: space-between;
height: `+this.toolbarHeight+`px;
box-sizing: content-box;
overflow: hidden;
line-height: 0px;
`)),this.toolbarStyleColorsClass=this.styles.addClass(new ie("toolbar_colors",`
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
`)),this.toolbarBlockStyleClass=this.styles.addClass(new ie("toolbar-block",`
display: flex;
align-items: center;
box-sizing: content-box;
`));var Z=this.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new ie("toolbar_button",`
display: inline-block;
width: `+(this.toolbarHeight-2*Z)+`px;
height: `+(this.toolbarHeight-2*Z)+`px;
padding: `+Z+`px;
cursor: default;
user-select: none;
box-sizing: content-box;
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new ie("toolbar_button_colors",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new ie("toolbar_active_button",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
background-color: `+this.styles.settings.toolbarBackgroundActiveColor+`
`)),this.styles.addRule(new Y("."+this.toolbarButtonStyleClass.name+" svg",`
height: `+this.toolbarHeight/2+`px;
`)),this.styles.addRule(new Y("."+this.toolbarButtonStyleColorsClass.name+":hover",`
background-color: `+this.styles.settings.toolbarBackgroundHoverColor+`
`)),this.toolbarDropdownStyleClass=this.styles.addClass(new ie("toolbar_dropdown",`
position: absolute;
max-width: `+4*this.toolbarHeight+`px;
z-index: 20;
white-space: normal;
box-sizing: content-box;
box-shadow: 3px 3px rgba(33, 33, 33, 0.1);
margin: `+(this.displayMode==="inline"?"0":this.popupMargin)+`px;
line-height: 0px;
`)),this.toolbarDropdownStyleColorsClass=this.styles.addClass(new ie("toolbar_dropdown_colors",`
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
`)),this.toolbarStraightenerBlockStyleClass=this.styles.addClass(new ie("toolbar_straightener_block",`
display: flex;
overflow: hidden;
justify-content: center;
-webkit-mask-image: linear-gradient(90deg, rgba(0,0,0,0) 0%, rgba(0,0,0,1) 30%, rgba(0,0,0,1) 70%, rgba(0,0,0,0) 100%);
`)),this.toolbarStraightenerStyleClass=this.styles.addClass(new ie("toolbar_straightener",`
display: flex;
overflow: hidden;
justify-content: center;
height: `+(this.toolbarHeight-2*Z)+`px;
padding: `+Z+`px;
cursor: default;
user-select: none;
box-sizing: content-box;
`)),this.toolbarStraightenerStyleColorsClass=this.styles.addClass(new ie("toolbar_straightener_colors",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
`))},le.instanceCounter=0,le}(),Ge=J("8hTe"),Je=J.n(Ge),ke=/<pre[^>]*>/g;function Qe(le){var Z=document.createElement("div");return Z.innerHTML=le,Z.childNodes.length===0?"":Z.childNodes[0].nodeValue}var Ze=Ee.a=function(le){var Z=le.value,q=Z===void 0?"":Z,ae=le.edit,ue=ae===void 0?!1:ae,ne=le.className,te=le.showTextOnly,de=le.showLines,fe=le.replaces,be=le.zoomImg,Te=le.hasMask,Me=le.style,je=Me===void 0?{}:Me,nt=le.stylesPrev,it=nt===void 0?{}:nt,Tt=String(q),ot=Object(I.useRef)(),$e=Object(I.useRef)(),yt=Object(I.useState)(""),lt=Object(W.a)(yt,2),Rt=lt[0],Ct=lt[1],bt=Object(I.useState)("office"),Qt=Object(W.a)(bt,2),zt=Qt[0],Gt=Qt[1],jt=function(){var Et=new ze($e.current);Et.displayMode="popup",Et.addRenderEventListener(function(){var dt=Object(L.a)(n.a.mark(function rt(pt){var ft;return n.a.wrap(function(Ht){for(;;)switch(Ht.prev=Ht.next){case 0:return ot.current.style.display="none",Ht.next=3,Object(De.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:pt}});case 3:ft=Ht.sent,ft!=null&&ft.id&&fe($e.current.getAttribute("src").replace(re.a.API_SERVER,""),"/api/attachments/".concat(ft==null?void 0:ft.id,"?type=").concat(ft.content_type));case 5:case"end":return Ht.stop()}},rt)}));return function(rt){return dt.apply(this,arguments)}}()),Et.show()},gt=function(){var Et=new we.a($e.current);Et.settings.displayMode="popup",Et.addEventListener("render",function(){var dt=Object(L.a)(n.a.mark(function rt(pt){var ft;return n.a.wrap(function(Ht){for(;;)switch(Ht.prev=Ht.next){case 0:if(ot.current.style.display="none",!$e.current){Ht.next=6;break}return Ht.next=4,Object(De.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:pt.dataUrl}});case 4:ft=Ht.sent,ft!=null&&ft.id&&fe($e.current.getAttribute("src").replace(re.a.API_SERVER,""),"/api/attachments/".concat(ft==null?void 0:ft.id,"?type=").concat(ft.content_type));case 6:case"end":return Ht.stop()}},rt)}));return function(rt){return dt.apply(this,arguments)}}()),Et.show(),window.markerArea=Et},wt=Object(I.useMemo)(function(){ot.current&&(ot.current.style.zIndex=-1);try{var Ye=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,Et=/\"\/api\/attachments\/|\"\/attachments\/download\//g,dt=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;Tt=Tt.replace(Ye,"("+re.a.API_SERVER+"/api/attachments/").replace(Et,'"'+re.a.API_SERVER+"/api/attachments/").replace(dt,'"'+re.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(Vt){}var rt=j(Tt),pt=x();if(Tt.match(/\[TOC\]/)&&(rt=rt.replace("<p>[TOC]</p>",O()),C()),rt=rt.replace(/(__special_katext_id_\d+__)/g,function(Vt,Ht){var Ke=pt[Ht],_t=Ke.type,ii=Ke.expression;return Object(ce.renderToString)(Qe(ii)||"",{displayMode:_t==="block",throwOnError:!1,output:"html"})}),rt=rt.replace(/▁/g,"\u2581\u2581\u2581"),v(),te){var ft=document.createElement("div");return ft.innerHTML=rt,ft.innerText}return setTimeout(function(){return an()},500),rt},[Tt]),At=Object(I.useRef)();_.WebkitLineClamp=de,de&&(je=Object(U.a)(Object(U.a)({},je),_));function Bt(Ye){var Et=Ye.target;if(Et.tagName.toUpperCase()==="IMG"){if(be){var dt=Et.getAttribute("src");Ct(dt),Gt("image")}}else if(Et.tagName.toUpperCase()==="A"){var rt=Et.getAttribute("href");if(rt.indexOf("office")>-1)Ye.preventDefault(),Ct(rt),Gt("office");else if(rt.indexOf("application/pdf")>-1)Ye.preventDefault(),Ct(rt),Gt("pdf");else if(rt.indexOf("text/html")>-1)Ye.preventDefault(),Ct(rt),Gt("html");else if(rt.startsWith("#")){Ye.preventDefault();var pt=document.getElementById(rt.replace("#",""));pt&&pt.scrollIntoView(!0)}}}var an=function(){var Et,dt=(Et=At.current)===null||Et===void 0?void 0:Et.querySelectorAll("video");dt==null||dt.forEach(function(rt){if(rt.oncontextmenu=function(){return!1},rt.src.indexOf(".m3u8")>-1&&!rt.canPlayType("application/vnd.apple.mpegurl")){if(V.a.isSupported()){var pt=new V.a;pt.loadSource(rt.src),pt.attachMedia(rt)}}})};Object(I.useEffect)(function(){if(At.current&&wt&&(wt.match(ke)&&window.PR.prettyPrint()),At.current)return At.current.addEventListener("click",Bt),function(){At.current.removeEventListener("click",Bt),v(),C()}},[wt,At.current,Bt]);var ut=function(Et){if(!ue)return;Et.target.nodeName==="IMG"?(ot.current.style.zIndex=1,ot.current.style.display="flex",ot.current.style.width=Et.target.clientWidth+"px",ot.current.style.height=Et.target.clientHeight+"px",ot.current.style.top=Et.target.offsetTop+"px",ot.current.style.left=Et.target.offsetLeft+"px",$e.current.src=Et.target.getAttribute("src")):ot.current.style.display="none"};return g.a.createElement("div",{style:{position:"relative"}},g.a.createElement("div",{ref:At,style:Object(U.a)({},je),className:"".concat(ne||""," markdown-body ").concat(Je.a.mdBody),onMouseOver:ut,dangerouslySetInnerHTML:{__html:wt}}),g.a.createElement("div",{ref:ot,className:Je.a.button},g.a.createElement($.a,null,g.a.createElement(z.a,{onClick:function(){return jt()}},"\u88C1\u526A"),g.a.createElement(z.a,{onClick:function(){return gt()}},"\u7F16\u8F91"))),g.a.createElement("img",{ref:$e,src:"",alt:"sample",crossOrigin:"anonymous",style:{maxWidth:"90%",opacity:0,position:"absolute",zIndex:-1}}),g.a.createElement(me.a,{close:!0,data:Rt,type:Rt!=null&&Rt.length?zt:"",style:Object(U.a)({},it),onClose:function(){return Ct("")}}))}},"9VGf":function(tt,Ee,J){"use strict";J.d(Ee,"a",function(){return k});var oe=J("q1tI"),$=J.n(oe);function k(z,U){var L=Object(oe.useRef)();Object(oe.useEffect)(function(){L.current=z}),Object(oe.useEffect)(function(){function W(){L.current()}if(U!==null){var H=setInterval(W,U);return function(){return clearInterval(H)}}},[U])}},BU3w:function(tt,Ee,J){"use strict";J.d(Ee,"a",function(){return L});var oe=J("MNnm"),$="rc-util-key";function k(W){if(W.attachTo)return W.attachTo;var H=document.querySelector("head");return H||document.body}function z(W){var H,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!Object(oe.a)())return null;var I=document.createElement("style");if((H=n.csp)===null||H===void 0?void 0:H.nonce){var g;I.nonce=(g=n.csp)===null||g===void 0?void 0:g.nonce}I.innerHTML=W;var f=k(n),m=f.firstChild;return n.prepend&&f.prepend?f.prepend(I):n.prepend&&m?f.insertBefore(I,m):f.appendChild(I),I}var U=new Map;function L(W,H){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},I=k(n);if(!U.has(I)){var g=z("",n),f=g.parentNode;U.set(I,f),f.removeChild(g)}var m=Array.from(U.get(I).children).find(function(u){return u.tagName==="STYLE"&&u[$]===H});if(m){var h,o;if(((h=n.csp)===null||h===void 0?void 0:h.nonce)&&m.nonce!==((o=n.csp)===null||o===void 0?void 0:o.nonce)){var p;m.nonce=(p=n.csp)===null||p===void 0?void 0:p.nonce}return m.innerHTML!==W&&(m.innerHTML=W),m}var l=z(W,n);return l[$]=H,l}},Bd2K:function(tt,Ee,J){(function(oe){oe(J("VrN/"),J("osHv"))})(function(oe){oe.defineOption("autoCloseTags",!1,function(n,I,g){if(g!=oe.Init&&g&&n.removeKeyMap("autoCloseTags"),!I)return;var f={name:"autoCloseTags"};(typeof I!="object"||I.whenClosing!==!1)&&(f["'/'"]=function(m){return L(m)}),(typeof I!="object"||I.whenOpening!==!1)&&(f["'>'"]=function(m){return z(m)}),n.addKeyMap(f)});var $=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],k=["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 z(n){if(n.getOption("disableInput"))return oe.Pass;for(var I=n.listSelections(),g=[],f=n.getOption("autoCloseTags"),m=0;m<I.length;m++){if(!I[m].empty())return oe.Pass;var h=I[m].head,o=n.getTokenAt(h),p=oe.innerMode(n.getMode(),o.state),l=p.state,u=p.mode.xmlCurrentTag&&p.mode.xmlCurrentTag(l),a=u&&u.name;if(!a)return oe.Pass;var s=p.mode.configuration=="html",C=typeof f=="object"&&f.dontCloseTags||s&&$,_=typeof f=="object"&&f.indentTags||s&&k;o.end>h.ch&&(a=a.slice(0,a.length-o.end+h.ch));var w=a.toLowerCase();if(!a||o.type=="string"&&(o.end!=h.ch||!/[\"\']/.test(o.string.charAt(o.string.length-1))||o.string.length==1)||o.type=="tag"&&u.close||o.string.indexOf("/")==h.ch-o.start-1||C&&W(C,w)>-1||H(n,p.mode.xmlCurrentContext&&p.mode.xmlCurrentContext(l)||[],a,h,!0))return oe.Pass;var O=typeof f=="object"&&f.emptyTags;if(O&&W(O,a)>-1){g[m]={text:"/>",newPos:oe.Pos(h.line,h.ch+2)};continue}var R=_&&W(_,w)>-1;g[m]={indent:R,text:">"+(R?`
`:"")+"</"+a+">",newPos:R?oe.Pos(h.line+1,0):oe.Pos(h.line,h.ch+1)}}for(var S=typeof f=="object"&&f.dontIndentOnAutoClose,m=I.length-1;m>=0;m--){var T=g[m];n.replaceRange(T.text,I[m].head,I[m].anchor,"+insert");var E=n.listSelections().slice(0);E[m]={head:T.newPos,anchor:T.newPos},n.setSelections(E),!S&&T.indent&&(n.indentLine(T.newPos.line,null,!0),n.indentLine(T.newPos.line+1,null,!0))}}function U(n,I){for(var g=n.listSelections(),f=[],m=I?"/":"</",h=n.getOption("autoCloseTags"),o=typeof h=="object"&&h.dontIndentOnSlash,p=0;p<g.length;p++){if(!g[p].empty())return oe.Pass;var l=g[p].head,u=n.getTokenAt(l),a=oe.innerMode(n.getMode(),u.state),s=a.state;if(I&&(u.type=="string"||u.string.charAt(0)!="<"||u.start!=l.ch-1))return oe.Pass;var C,_=a.mode.name!="xml"&&n.getMode().name=="htmlmixed";if(_&&a.mode.name=="javascript")C=m+"script";else if(_&&a.mode.name=="css")C=m+"style";else{var w=a.mode.xmlCurrentContext&&a.mode.xmlCurrentContext(s);if(!w||w.length&&H(n,w,w[w.length-1],l))return oe.Pass;C=m+w[w.length-1]}n.getLine(l.line).charAt(u.end)!=">"&&(C+=">"),f[p]=C}if(n.replaceSelections(f),g=n.listSelections(),!o)for(var p=0;p<g.length;p++)(p==g.length-1||g[p].head.line<g[p+1].head.line)&&n.indentLine(g[p].head.line)}function L(n){return n.getOption("disableInput")?oe.Pass:U(n,!0)}oe.commands.closeTag=function(n){return U(n)};function W(n,I){if(n.indexOf)return n.indexOf(I);for(var g=0,f=n.length;g<f;++g)if(n[g]==I)return g;return-1}function H(n,I,g,f,m){if(!oe.scanForClosingTag)return!1;var h=Math.min(n.lastLine()+1,f.line+500),o=oe.scanForClosingTag(n,f,null,h);if(!o||o.tag!=g)return!1;for(var p=m?1:0,l=I.length-1;l>=0&&I[l]==g;l--)++p;f=o.to;for(var l=1;l<p;l++){var u=oe.scanForClosingTag(n,f,null,h);if(!u||u.tag!=g)return!1;f=u.to}return!0}})},BjJ7:function(tt,Ee,J){"use strict";J.d(Ee,"d",function(){return $}),J.d(Ee,"c",function(){return k}),J.d(Ee,"e",function(){return z}),J.d(Ee,"b",function(){return U}),J.d(Ee,"a",function(){return W});var oe=J("m3rI");function $(H){var n=!0;if(H.length>0){for(var I=0;I<H.length;I++)if(H[I].compile_success==0||!H[I].compile_success){n=!1;break}}else n=!1;return n}function k(H){for(var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",I=[],g=0;g<H.length;g++){var f=H[g],m=n?"".concat(n,"/").concat(f.name):"".concat(f.name);I.push({title:f.name,isLeaf:!(f.type==="tree"),key:m})}return I}function z(H,n,I){for(var g=0;g<H.length;g++){var f=H[g];if(f.key===n){f.children=I;break}f.children&&z(f.children,n,I)}return H}function U(H,n,I){var g;return function(){var f=this,m=arguments,h=function(){g=null,I||H.apply(f,m)},o=I&&!g;clearTimeout(g),g=setTimeout(h,n),o&&H.apply(f,m)}}var L=!0,W=oe.a.API_SERVER},"C+DQ":function(tt,Ee,J){},"C/vA":function(tt,Ee,J){"use strict";J.d(Ee,"a",function(){return oe});function oe($){const k=this;let z=!1,U;return function(){return z||(z=!0,U=$.apply(k,arguments)),U}}},"Cg/j":function(tt,Ee,J){"use strict";J.d(Ee,"b",function(){return oe}),J.d(Ee,"a",function(){return $}),J.d(Ee,"c",function(){return z}),J.d(Ee,"d",function(){return U});var oe;(function(L){L.serviceIds=new Map,L.DI_TARGET="$di$target",L.DI_DEPENDENCIES="$di$dependencies";function W(H){return H[L.DI_DEPENDENCIES]||[]}L.getServiceDependencies=W})(oe||(oe={}));const $=z("instantiationService");function k(L,W,H,n){W[oe.DI_TARGET]===W?W[oe.DI_DEPENDENCIES].push({id:L,index:H,optional:n}):(W[oe.DI_DEPENDENCIES]=[{id:L,index:H,optional:n}],W[oe.DI_TARGET]=W)}function z(L){if(oe.serviceIds.has(L))return oe.serviceIds.get(L);const W=function(H,n,I){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");k(W,H,I,!1)};return W.toString=()=>L,oe.serviceIds.set(L,W),W}function U(L){return function(W,H,n){if(arguments.length!==3)throw new Error("@optional-decorator can only be used to decorate a parameter");k(L,W,n,!0)}}},DlQD:function(tt,Ee,J){(function(oe,$){tt.exports=$()})(this,function(){"use strict";function oe(q,ae){for(var ue=0;ue<ae.length;ue++){var ne=ae[ue];ne.enumerable=ne.enumerable||!1,ne.configurable=!0,"value"in ne&&(ne.writable=!0),Object.defineProperty(q,ne.key,ne)}}function $(q,ae,ue){return ae&&oe(q.prototype,ae),ue&&oe(q,ue),q}function k(q,ae){if(!q)return;if(typeof q=="string")return z(q,ae);var ue=Object.prototype.toString.call(q).slice(8,-1);if(ue==="Object"&&q.constructor&&(ue=q.constructor.name),ue==="Map"||ue==="Set")return Array.from(q);if(ue==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(ue))return z(q,ae)}function z(q,ae){(ae==null||ae>q.length)&&(ae=q.length);for(var ue=0,ne=new Array(ae);ue<ae;ue++)ne[ue]=q[ue];return ne}function U(q,ae){var ue;if(typeof Symbol=="undefined"||q[Symbol.iterator]==null){if(Array.isArray(q)||(ue=k(q))||ae&&q&&typeof q.length=="number"){ue&&(q=ue);var ne=0;return function(){return ne>=q.length?{done:!0}:{done:!1,value:q[ne++]}}}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 ue=q[Symbol.iterator](),ue.next.bind(ue)}function L(q,ae){return ae={exports:{}},q(ae,ae.exports),ae.exports}var W=L(function(q){function ae(){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 ue(ne){q.exports.defaults=ne}q.exports={defaults:ae(),getDefaults:ae,changeDefaults:ue}}),H=W.defaults,n=W.getDefaults,I=W.changeDefaults,g=/[&<>"']/,f=/[&<>"']/g,m=/[<>"']|&(?!#?\w+;)/,h=/[<>"']|&(?!#?\w+;)/g,o={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},p=function(ae){return o[ae]};function l(q,ae){if(ae){if(g.test(q))return q.replace(f,p)}else if(m.test(q))return q.replace(h,p);return q}var u=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function a(q){return q.replace(u,function(ae,ue){return ue=ue.toLowerCase(),ue==="colon"?":":ue.charAt(0)==="#"?ue.charAt(1)==="x"?String.fromCharCode(parseInt(ue.substring(2),16)):String.fromCharCode(+ue.substring(1)):""})}var s=/(^|[^\[])\^/g;function C(q,ae){q=q.source||q,ae=ae||"";var ue={replace:function(te,de){return de=de.source||de,de=de.replace(s,"$1"),q=q.replace(te,de),ue},getRegex:function(){return new RegExp(q,ae)}};return ue}var _=/[^\w:]/g,w=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function O(q,ae,ue){if(q){var ne;try{ne=decodeURIComponent(a(ue)).replace(_,"").toLowerCase()}catch(te){return null}if(ne.indexOf("javascript:")===0||ne.indexOf("vbscript:")===0||ne.indexOf("data:")===0)return null}ae&&!w.test(ue)&&(ue=c(ae,ue));try{ue=encodeURI(ue).replace(/%25/g,"%")}catch(te){return null}return ue}var R={},S=/^[^:]+:\/*[^/]*$/,T=/^([^:]+:)[\s\S]*$/,E=/^([^:]+:\/*[^/]*)[\s\S]*$/;function c(q,ae){R[" "+q]||(S.test(q)?R[" "+q]=q+"/":R[" "+q]=F(q,"/",!0)),q=R[" "+q];var ue=q.indexOf(":")===-1;return ae.substring(0,2)==="//"?ue?ae:q.replace(T,"$1")+ae:ae.charAt(0)==="/"?ue?ae:q.replace(E,"$1")+ae:q+ae}var x={exec:function(){}};function v(q){for(var ae=1,ue,ne;ae<arguments.length;ae++){ue=arguments[ae];for(ne in ue)Object.prototype.hasOwnProperty.call(ue,ne)&&(q[ne]=ue[ne])}return q}function y(q,ae){var ue=q.replace(/\|/g,function(de,fe,be){for(var Te=!1,Me=fe;--Me>=0&&be[Me]==="\\";)Te=!Te;return Te?"|":" |"}),ne=ue.split(/ \|/),te=0;if(ne.length>ae)ne.splice(ae);else for(;ne.length<ae;)ne.push("");for(;te<ne.length;te++)ne[te]=ne[te].trim().replace(/\\\|/g,"|");return ne}function F(q,ae,ue){var ne=q.length;if(ne===0)return"";for(var te=0;te<ne;){var de=q.charAt(ne-te-1);if(de===ae&&!ue)te++;else if(de!==ae&&ue)te++;else break}return q.substr(0,ne-te)}function B(q,ae){if(q.indexOf(ae[1])===-1)return-1;for(var ue=q.length,ne=0,te=0;te<ue;te++)if(q[te]==="\\")te++;else if(q[te]===ae[0])ne++;else if(q[te]===ae[1]&&(ne--,ne<0))return te;return-1}function A(q){q&&q.sanitize&&!q.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 j={escape:l,unescape:a,edit:C,cleanUrl:O,resolveUrl:c,noopTest:x,merge:v,splitCells:y,rtrim:F,findClosingBracket:B,checkSanitizeDeprecation:A},P=W.defaults,b=j.rtrim,V=j.splitCells,re=j.escape,ce=j.findClosingBracket;function me(q,ae,ue){var ne=ae.href,te=ae.title?re(ae.title):null,de=q[1].replace(/\\([\[\]])/g,"$1");return q[0].charAt(0)!=="!"?{type:"link",raw:ue,href:ne,title:te,text:de}:{type:"image",raw:ue,href:ne,title:te,text:re(de)}}function De(q,ae){var ue=q.match(/^(\s+)(?:```)/);if(ue===null)return ae;var ne=ue[1];return ae.split(`
`).map(function(te){var de=te.match(/^\s+/);if(de===null)return te;var fe=de[0];return fe.length>=ne.length?te.slice(ne.length):te}).join(`
`)}var we=function(){function q(ue){this.options=ue||P}var ae=q.prototype;return ae.space=function(ne){var te=this.rules.block.newline.exec(ne);if(te)return te[0].length>1?{type:"space",raw:te[0]}:{raw:`
`}},ae.code=function(ne,te){var de=this.rules.block.code.exec(ne);if(de){var fe=te[te.length-1];if(fe&&fe.type==="paragraph")return{raw:de[0],text:de[0].trimRight()};var be=de[0].replace(/^ {4}/gm,"");return{type:"code",raw:de[0],codeBlockStyle:"indented",text:this.options.pedantic?be:b(be,`
`)}}},ae.fences=function(ne){var te=this.rules.block.fences.exec(ne);if(te){var de=te[0],fe=De(de,te[3]||"");return{type:"code",raw:de,lang:te[2]?te[2].trim():te[2],text:fe}}},ae.heading=function(ne){var te=this.rules.block.heading.exec(ne);if(te)return{type:"heading",raw:te[0],depth:te[1].length,text:te[2]}},ae.nptable=function(ne){var te=this.rules.block.nptable.exec(ne);if(te){var de={type:"table",header:V(te[1].replace(/^ *| *\| *$/g,"")),align:te[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:te[3]?te[3].replace(/\n$/,"").split(`
`):[],raw:te[0]};if(de.header.length===de.align.length){var fe=de.align.length,be;for(be=0;be<fe;be++)/^ *-+: *$/.test(de.align[be])?de.align[be]="right":/^ *:-+: *$/.test(de.align[be])?de.align[be]="center":/^ *:-+ *$/.test(de.align[be])?de.align[be]="left":de.align[be]=null;for(fe=de.cells.length,be=0;be<fe;be++)de.cells[be]=V(de.cells[be],de.header.length);return de}}},ae.hr=function(ne){var te=this.rules.block.hr.exec(ne);if(te)return{type:"hr",raw:te[0]}},ae.blockquote=function(ne){var te=this.rules.block.blockquote.exec(ne);if(te){var de=te[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:te[0],text:de}}},ae.list=function(ne){var te=this.rules.block.list.exec(ne);if(te){for(var de=te[0],fe=te[2],be=fe.length>1,Te=fe[fe.length-1]===")",Me={type:"list",raw:de,ordered:be,start:be?+fe.slice(0,-1):"",loose:!1,items:[]},je=te[0].match(this.rules.block.item),nt=!1,it,Tt,ot,$e,yt,lt,Rt,Ct=je.length,bt=0;bt<Ct;bt++)it=je[bt],de=it,Tt=it.length,it=it.replace(/^ *([*+-]|\d+[.)]) */,""),~it.indexOf(`
`)&&(Tt-=it.length,it=this.options.pedantic?it.replace(/^ {1,4}/gm,""):it.replace(new RegExp("^ {1,"+Tt+"}","gm"),"")),bt!==Ct-1&&(ot=this.rules.block.bullet.exec(je[bt+1])[0],(be?ot.length===1||!Te&&ot[ot.length-1]===")":ot.length>1||this.options.smartLists&&ot!==fe)&&($e=je.slice(bt+1).join(`
`),Me.raw=Me.raw.substring(0,Me.raw.length-$e.length),bt=Ct-1)),yt=nt||/\n\n(?!\s*$)/.test(it),bt!==Ct-1&&(nt=it.charAt(it.length-1)===`
`,yt||(yt=nt)),yt&&(Me.loose=!0),lt=/^\[[ xX]\] /.test(it),Rt=void 0,lt&&(Rt=it[1]!==" ",it=it.replace(/^\[[ xX]\] +/,"")),Me.items.push({type:"list_item",raw:de,task:lt,checked:Rt,loose:yt,text:it});return Me}},ae.html=function(ne){var te=this.rules.block.html.exec(ne);if(te)return{type:this.options.sanitize?"paragraph":"html",raw:te[0],pre:!this.options.sanitizer&&(te[1]==="pre"||te[1]==="script"||te[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(te[0]):re(te[0]):te[0]}},ae.def=function(ne){var te=this.rules.block.def.exec(ne);if(te){te[3]&&(te[3]=te[3].substring(1,te[3].length-1));var de=te[1].toLowerCase().replace(/\s+/g," ");return{tag:de,raw:te[0],href:te[2],title:te[3]}}},ae.table=function(ne){var te=this.rules.block.table.exec(ne);if(te){var de={type:"table",header:V(te[1].replace(/^ *| *\| *$/g,"")),align:te[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:te[3]?te[3].replace(/\n$/,"").split(`
`):[]};if(de.header.length===de.align.length){de.raw=te[0];var fe=de.align.length,be;for(be=0;be<fe;be++)/^ *-+: *$/.test(de.align[be])?de.align[be]="right":/^ *:-+: *$/.test(de.align[be])?de.align[be]="center":/^ *:-+ *$/.test(de.align[be])?de.align[be]="left":de.align[be]=null;for(fe=de.cells.length,be=0;be<fe;be++)de.cells[be]=V(de.cells[be].replace(/^ *\| *| *\| *$/g,""),de.header.length);return de}}},ae.lheading=function(ne){var te=this.rules.block.lheading.exec(ne);if(te)return{type:"heading",raw:te[0],depth:te[2].charAt(0)==="="?1:2,text:te[1]}},ae.paragraph=function(ne){var te=this.rules.block.paragraph.exec(ne);if(te)return{type:"paragraph",raw:te[0],text:te[1].charAt(te[1].length-1)===`
`?te[1].slice(0,-1):te[1]}},ae.text=function(ne,te){var de=this.rules.block.text.exec(ne);if(de){var fe=te[te.length-1];return fe&&fe.type==="text"?{raw:de[0],text:de[0]}:{type:"text",raw:de[0],text:de[0]}}},ae.escape=function(ne){var te=this.rules.inline.escape.exec(ne);if(te)return{type:"escape",raw:te[0],text:re(te[1])}},ae.tag=function(ne,te,de){var fe=this.rules.inline.tag.exec(ne);if(fe)return!te&&/^<a /i.test(fe[0])?te=!0:te&&/^<\/a>/i.test(fe[0])&&(te=!1),!de&&/^<(pre|code|kbd|script)(\s|>)/i.test(fe[0])?de=!0:de&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(fe[0])&&(de=!1),{type:this.options.sanitize?"text":"html",raw:fe[0],inLink:te,inRawBlock:de,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(fe[0]):re(fe[0]):fe[0]}},ae.link=function(ne){var te=this.rules.inline.link.exec(ne);if(te){var de=ce(te[2],"()");if(de>-1){var fe=te[0].indexOf("!")===0?5:4,be=fe+te[1].length+de;te[2]=te[2].substring(0,de),te[0]=te[0].substring(0,be).trim(),te[3]=""}var Te=te[2],Me="";if(this.options.pedantic){var je=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(Te);je?(Te=je[1],Me=je[3]):Me=""}else Me=te[3]?te[3].slice(1,-1):"";Te=Te.trim().replace(/^<([\s\S]*)>$/,"$1");var nt=me(te,{href:Te&&Te.replace(this.rules.inline._escapes,"$1"),title:Me&&Me.replace(this.rules.inline._escapes,"$1")},te[0]);return nt}},ae.reflink=function(ne,te){var de;if((de=this.rules.inline.reflink.exec(ne))||(de=this.rules.inline.nolink.exec(ne))){var fe=(de[2]||de[1]).replace(/\s+/g," ");if(fe=te[fe.toLowerCase()],!fe||!fe.href){var be=de[0].charAt(0);return{type:"text",raw:be,text:be}}var Te=me(de,fe,de[0]);return Te}},ae.strong=function(ne,te,de){de===void 0&&(de="");var fe=this.rules.inline.strong.start.exec(ne);if(fe&&(!fe[1]||fe[1]&&(de===""||this.rules.inline.punctuation.exec(de)))){te=te.slice(-1*ne.length);var be=fe[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;be.lastIndex=0;for(var Te;(fe=be.exec(te))!=null;)if(Te=this.rules.inline.strong.middle.exec(te.slice(0,fe.index+3)),Te)return{type:"strong",raw:ne.slice(0,Te[0].length),text:ne.slice(2,Te[0].length-2)}}},ae.em=function(ne,te,de){de===void 0&&(de="");var fe=this.rules.inline.em.start.exec(ne);if(fe&&(!fe[1]||fe[1]&&(de===""||this.rules.inline.punctuation.exec(de)))){te=te.slice(-1*ne.length);var be=fe[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;be.lastIndex=0;for(var Te;(fe=be.exec(te))!=null;)if(Te=this.rules.inline.em.middle.exec(te.slice(0,fe.index+2)),Te)return{type:"em",raw:ne.slice(0,Te[0].length),text:ne.slice(1,Te[0].length-1)}}},ae.codespan=function(ne){var te=this.rules.inline.code.exec(ne);if(te){var de=te[2].replace(/\n/g," "),fe=/[^ ]/.test(de),be=de.startsWith(" ")&&de.endsWith(" ");return fe&&be&&(de=de.substring(1,de.length-1)),de=re(de,!0),{type:"codespan",raw:te[0],text:de}}},ae.br=function(ne){var te=this.rules.inline.br.exec(ne);if(te)return{type:"br",raw:te[0]}},ae.del=function(ne){var te=this.rules.inline.del.exec(ne);if(te)return{type:"del",raw:te[0],text:te[1]}},ae.autolink=function(ne,te){var de=this.rules.inline.autolink.exec(ne);if(de){var fe,be;return de[2]==="@"?(fe=re(this.options.mangle?te(de[1]):de[1]),be="mailto:"+fe):(fe=re(de[1]),be=fe),{type:"link",raw:de[0],text:fe,href:be,tokens:[{type:"text",raw:fe,text:fe}]}}},ae.url=function(ne,te){var de;if(de=this.rules.inline.url.exec(ne)){var fe,be;if(de[2]==="@")fe=re(this.options.mangle?te(de[0]):de[0]),be="mailto:"+fe;else{var Te;do Te=de[0],de[0]=this.rules.inline._backpedal.exec(de[0])[0];while(Te!==de[0]);fe=re(de[0]),de[1]==="www."?be="http://"+fe:be=fe}return{type:"link",raw:de[0],text:fe,href:be,tokens:[{type:"text",raw:fe,text:fe}]}}},ae.inlineText=function(ne,te,de){var fe=this.rules.inline.text.exec(ne);if(fe){var be;return te?be=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(fe[0]):re(fe[0]):fe[0]:be=re(this.options.smartypants?de(fe[0]):fe[0]),{type:"text",raw:fe[0],text:be}}},q}(),Le=j.noopTest,Re=j.edit,Ie=j.merge,ye={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?:\n+|$)|$)/,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6}) +([^\n]*?)(?: +#+)? *(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3})(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:"^ {0,3}(?:<(script|pre|style)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?\\?>\\n*|<![A-Z][\\s\\S]*?>\\n*|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>\\n*|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:\\n{2,}|$)|<(?!script|pre|style)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$)|</(?!script|pre|style)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$))",def:/^ {0,3}\[(label)\]: *\n? *<?([^\s>]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,nptable:Le,table:Le,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/};ye._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,ye._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,ye.def=Re(ye.def).replace("label",ye._label).replace("title",ye._title).getRegex(),ye.bullet=/(?:[*+-]|\d{1,9}[.)])/,ye.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,ye.item=Re(ye.item,"gm").replace(/bull/g,ye.bullet).getRegex(),ye.list=Re(ye.list).replace(/bull/g,ye.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+ye.def.source+")").getRegex(),ye._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",ye._comment=/<!--(?!-?>)[\s\S]*?-->/,ye.html=Re(ye.html,"i").replace("comment",ye._comment).replace("tag",ye._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),ye.paragraph=Re(ye._paragraph).replace("hr",ye.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",ye._tag).getRegex(),ye.blockquote=Re(ye.blockquote).replace("paragraph",ye.paragraph).getRegex(),ye.normal=Ie({},ye),ye.gfm=Ie({},ye.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*|$)"}),ye.gfm.nptable=Re(ye.gfm.nptable).replace("hr",ye.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",ye._tag).getRegex(),ye.gfm.table=Re(ye.gfm.table).replace("hr",ye.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",ye._tag).getRegex(),ye.pedantic=Ie({},ye.normal,{html:Re(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",ye._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/,fences:Le,paragraph:Re(ye.normal._paragraph).replace("hr",ye.hr).replace("heading",` *#{1,6} *[^
]`).replace("lheading",ye.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var X={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:Le,tag:"^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/,nolink:/^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",strong:{start:/^(?:(\*\*(?=[*punctuation]))|\*\*)(?![\s])|__/,middle:/^\*\*(?:(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)|\*(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)*?\*)+?\*\*$|^__(?![\s])((?:(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)|_(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)*?_)+?)__$/,endAst:/[^punctuation\s]\*\*(?!\*)|[punctuation]\*\*(?!\*)(?:(?=[punctuation\s]|$))/,endUnd:/[^\s]__(?!_)(?:(?=[punctuation\s])|$)/},em:{start:/^(?:(\*(?=[punctuation]))|\*)(?![*\s])|_/,middle:/^\*(?:(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)|\*(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)*?\*)+?\*$|^_(?![_\s])(?:(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)|_(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)*?_)+?_$/,endAst:/[^punctuation\s]\*(?!\*)|[punctuation]\*(?!\*)(?:(?=[punctuation\s]|$))/,endUnd:/[^\s]_(?!_)(?:(?=[punctuation\s])|$)/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:Le,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*]|\b_|$)|[^ ](?= {2,}\n))|(?= {2,}\n))/,punctuation:/^([\s*punctuation])/};X._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",X.punctuation=Re(X.punctuation).replace(/punctuation/g,X._punctuation).getRegex(),X._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",X._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",X.em.start=Re(X.em.start).replace(/punctuation/g,X._punctuation).getRegex(),X.em.middle=Re(X.em.middle).replace(/punctuation/g,X._punctuation).replace(/overlapSkip/g,X._overlapSkip).getRegex(),X.em.endAst=Re(X.em.endAst,"g").replace(/punctuation/g,X._punctuation).getRegex(),X.em.endUnd=Re(X.em.endUnd,"g").replace(/punctuation/g,X._punctuation).getRegex(),X.strong.start=Re(X.strong.start).replace(/punctuation/g,X._punctuation).getRegex(),X.strong.middle=Re(X.strong.middle).replace(/punctuation/g,X._punctuation).replace(/blockSkip/g,X._blockSkip).getRegex(),X.strong.endAst=Re(X.strong.endAst,"g").replace(/punctuation/g,X._punctuation).getRegex(),X.strong.endUnd=Re(X.strong.endUnd,"g").replace(/punctuation/g,X._punctuation).getRegex(),X.blockSkip=Re(X._blockSkip,"g").getRegex(),X.overlapSkip=Re(X._overlapSkip,"g").getRegex(),X._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,X._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,X._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])?)+(?![-_])/,X.autolink=Re(X.autolink).replace("scheme",X._scheme).replace("email",X._email).getRegex(),X._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,X.tag=Re(X.tag).replace("comment",ye._comment).replace("attribute",X._attribute).getRegex(),X._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,X._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,X._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,X.link=Re(X.link).replace("label",X._label).replace("href",X._href).replace("title",X._title).getRegex(),X.reflink=Re(X.reflink).replace("label",X._label).getRegex(),X.reflinkSearch=Re(X.reflinkSearch,"g").replace("reflink",X.reflink).replace("nolink",X.nolink).getRegex(),X.normal=Ie({},X),X.pedantic=Ie({},X.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:Re(/^!?\[(label)\]\((.*?)\)/).replace("label",X._label).getRegex(),reflink:Re(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",X._label).getRegex()}),X.gfm=Ie({},X.normal,{escape:Re(X.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.!#$%&'*+\/=?_`{\|}~-]+@))/}),X.gfm.url=Re(X.gfm.url,"i").replace("email",X.gfm._extended_email).getRegex(),X.breaks=Ie({},X.gfm,{br:Re(X.br).replace("{2,}","*").getRegex(),text:Re(X.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});var M={block:ye,inline:X},N=W.defaults,Y=M.block,ie=M.inline;function K(q){return q.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 pe(q){var ae="",ue,ne,te=q.length;for(ue=0;ue<te;ue++)ne=q.charCodeAt(ue),Math.random()>.5&&(ne="x"+ne.toString(16)),ae+="&#"+ne+";";return ae}var Se=function(){function q(ue){this.tokens=[],this.tokens.links=Object.create(null),this.options=ue||N,this.options.tokenizer=this.options.tokenizer||new we,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var ne={block:Y.normal,inline:ie.normal};this.options.pedantic?(ne.block=Y.pedantic,ne.inline=ie.pedantic):this.options.gfm&&(ne.block=Y.gfm,this.options.breaks?ne.inline=ie.breaks:ne.inline=ie.gfm),this.tokenizer.rules=ne}q.lex=function(ne,te){var de=new q(te);return de.lex(ne)};var ae=q.prototype;return ae.lex=function(ne){return ne=ne.replace(/\r\n|\r/g,`
`).replace(/\t/g," "),this.blockTokens(ne,this.tokens,!0),this.inline(this.tokens),this.tokens},ae.blockTokens=function(ne,te,de){te===void 0&&(te=[]),de===void 0&&(de=!0),ne=ne.replace(/^ +$/gm,"");for(var fe,be,Te,Me;ne;){if(fe=this.tokenizer.space(ne)){ne=ne.substring(fe.raw.length),fe.type&&te.push(fe);continue}if(fe=this.tokenizer.code(ne,te)){ne=ne.substring(fe.raw.length),fe.type?te.push(fe):(Me=te[te.length-1],Me.raw+=`
`+fe.raw,Me.text+=`
`+fe.text);continue}if(fe=this.tokenizer.fences(ne)){ne=ne.substring(fe.raw.length),te.push(fe);continue}if(fe=this.tokenizer.heading(ne)){ne=ne.substring(fe.raw.length),te.push(fe);continue}if(fe=this.tokenizer.nptable(ne)){ne=ne.substring(fe.raw.length),te.push(fe);continue}if(fe=this.tokenizer.hr(ne)){ne=ne.substring(fe.raw.length),te.push(fe);continue}if(fe=this.tokenizer.blockquote(ne)){ne=ne.substring(fe.raw.length),fe.tokens=this.blockTokens(fe.text,[],de),te.push(fe);continue}if(fe=this.tokenizer.list(ne)){for(ne=ne.substring(fe.raw.length),Te=fe.items.length,be=0;be<Te;be++)fe.items[be].tokens=this.blockTokens(fe.items[be].text,[],!1);te.push(fe);continue}if(fe=this.tokenizer.html(ne)){ne=ne.substring(fe.raw.length),te.push(fe);continue}if(de&&(fe=this.tokenizer.def(ne))){ne=ne.substring(fe.raw.length),this.tokens.links[fe.tag]||(this.tokens.links[fe.tag]={href:fe.href,title:fe.title});continue}if(fe=this.tokenizer.table(ne)){ne=ne.substring(fe.raw.length),te.push(fe);continue}if(fe=this.tokenizer.lheading(ne)){ne=ne.substring(fe.raw.length),te.push(fe);continue}if(de&&(fe=this.tokenizer.paragraph(ne))){ne=ne.substring(fe.raw.length),te.push(fe);continue}if(fe=this.tokenizer.text(ne,te)){ne=ne.substring(fe.raw.length),fe.type?te.push(fe):(Me=te[te.length-1],Me.raw+=`
`+fe.raw,Me.text+=`
`+fe.text);continue}if(ne){var je="Infinite loop on byte: "+ne.charCodeAt(0);if(this.options.silent){console.error(je);break}else throw new Error(je)}}return te},ae.inline=function(ne){var te,de,fe,be,Te,Me,je=ne.length;for(te=0;te<je;te++){Me=ne[te];switch(Me.type){case"paragraph":case"text":case"heading":{Me.tokens=[],this.inlineTokens(Me.text,Me.tokens);break}case"table":{for(Me.tokens={header:[],cells:[]},be=Me.header.length,de=0;de<be;de++)Me.tokens.header[de]=[],this.inlineTokens(Me.header[de],Me.tokens.header[de]);for(be=Me.cells.length,de=0;de<be;de++)for(Te=Me.cells[de],Me.tokens.cells[de]=[],fe=0;fe<Te.length;fe++)Me.tokens.cells[de][fe]=[],this.inlineTokens(Te[fe],Me.tokens.cells[de][fe]);break}case"blockquote":{this.inline(Me.tokens);break}case"list":{for(be=Me.items.length,de=0;de<be;de++)this.inline(Me.items[de].tokens);break}}}return ne},ae.inlineTokens=function(ne,te,de,fe,be){te===void 0&&(te=[]),de===void 0&&(de=!1),fe===void 0&&(fe=!1),be===void 0&&(be="");var Te,Me=ne,je;if(this.tokens.links){var nt=Object.keys(this.tokens.links);if(nt.length>0)for(;(je=this.tokenizer.rules.inline.reflinkSearch.exec(Me))!=null;)nt.includes(je[0].slice(je[0].lastIndexOf("[")+1,-1))&&(Me=Me.slice(0,je.index)+"["+"a".repeat(je[0].length-2)+"]"+Me.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(je=this.tokenizer.rules.inline.blockSkip.exec(Me))!=null;)Me=Me.slice(0,je.index)+"["+"a".repeat(je[0].length-2)+"]"+Me.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;ne;){if(Te=this.tokenizer.escape(ne)){ne=ne.substring(Te.raw.length),te.push(Te);continue}if(Te=this.tokenizer.tag(ne,de,fe)){ne=ne.substring(Te.raw.length),de=Te.inLink,fe=Te.inRawBlock,te.push(Te);continue}if(Te=this.tokenizer.link(ne)){ne=ne.substring(Te.raw.length),Te.type==="link"&&(Te.tokens=this.inlineTokens(Te.text,[],!0,fe)),te.push(Te);continue}if(Te=this.tokenizer.reflink(ne,this.tokens.links)){ne=ne.substring(Te.raw.length),Te.type==="link"&&(Te.tokens=this.inlineTokens(Te.text,[],!0,fe)),te.push(Te);continue}if(Te=this.tokenizer.strong(ne,Me,be)){ne=ne.substring(Te.raw.length),Te.tokens=this.inlineTokens(Te.text,[],de,fe),te.push(Te);continue}if(Te=this.tokenizer.em(ne,Me,be)){ne=ne.substring(Te.raw.length),Te.tokens=this.inlineTokens(Te.text,[],de,fe),te.push(Te);continue}if(Te=this.tokenizer.codespan(ne)){ne=ne.substring(Te.raw.length),te.push(Te);continue}if(Te=this.tokenizer.br(ne)){ne=ne.substring(Te.raw.length),te.push(Te);continue}if(Te=this.tokenizer.del(ne)){ne=ne.substring(Te.raw.length),Te.tokens=this.inlineTokens(Te.text,[],de,fe),te.push(Te);continue}if(Te=this.tokenizer.autolink(ne,pe)){ne=ne.substring(Te.raw.length),te.push(Te);continue}if(!de&&(Te=this.tokenizer.url(ne,pe))){ne=ne.substring(Te.raw.length),te.push(Te);continue}if(Te=this.tokenizer.inlineText(ne,fe,K)){ne=ne.substring(Te.raw.length),be=Te.raw.slice(-1),te.push(Te);continue}if(ne){var it="Infinite loop on byte: "+ne.charCodeAt(0);if(this.options.silent){console.error(it);break}else throw new Error(it)}}return te},$(q,null,[{key:"rules",get:function(){return{block:Y,inline:ie}}}]),q}(),Pe=W.defaults,he=j.cleanUrl,ve=j.escape,xe=function(){function q(ue){this.options=ue||Pe}var ae=q.prototype;return ae.code=function(ne,te,de){var fe=(te||"").match(/\S*/)[0];if(this.options.highlight){var be=this.options.highlight(ne,fe);be!=null&&be!==ne&&(de=!0,ne=be)}return fe?'<pre><code class="'+this.options.langPrefix+ve(fe,!0)+'">'+(de?ne:ve(ne,!0))+`</code></pre>
`:"<pre><code>"+(de?ne:ve(ne,!0))+`</code></pre>
`},ae.blockquote=function(ne){return`<blockquote>
`+ne+`</blockquote>
`},ae.html=function(ne){return ne},ae.heading=function(ne,te,de,fe){return this.options.headerIds?"<h"+te+' id="'+this.options.headerPrefix+fe.slug(de)+'">'+ne+"</h"+te+`>
`:"<h"+te+">"+ne+"</h"+te+`>
`},ae.hr=function(){return this.options.xhtml?`<hr/>
`:`<hr>
`},ae.list=function(ne,te,de){var fe=te?"ol":"ul",be=te&&de!==1?' start="'+de+'"':"";return"<"+fe+be+`>
`+ne+"</"+fe+`>
`},ae.listitem=function(ne){return"<li>"+ne+`</li>
`},ae.checkbox=function(ne){return"<input "+(ne?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},ae.paragraph=function(ne){return"<p>"+ne+`</p>
`},ae.table=function(ne,te){return te&&(te="<tbody>"+te+"</tbody>"),`<table>
<thead>
`+ne+`</thead>
`+te+`</table>
`},ae.tablerow=function(ne){return`<tr>
`+ne+`</tr>
`},ae.tablecell=function(ne,te){var de=te.header?"th":"td",fe=te.align?"<"+de+' align="'+te.align+'">':"<"+de+">";return fe+ne+"</"+de+`>
`},ae.strong=function(ne){return"<strong>"+ne+"</strong>"},ae.em=function(ne){return"<em>"+ne+"</em>"},ae.codespan=function(ne){return"<code>"+ne+"</code>"},ae.br=function(){return this.options.xhtml?"<br/>":"<br>"},ae.del=function(ne){return"<del>"+ne+"</del>"},ae.link=function(ne,te,de){if(ne=he(this.options.sanitize,this.options.baseUrl,ne),ne===null)return de;var fe='<a href="'+ve(ne)+'"';return te&&(fe+=' title="'+te+'"'),fe+=">"+de+"</a>",fe},ae.image=function(ne,te,de){if(ne=he(this.options.sanitize,this.options.baseUrl,ne),ne===null)return de;var fe='<img src="'+ne+'" alt="'+de+'"';return te&&(fe+=' title="'+te+'"'),fe+=this.options.xhtml?"/>":">",fe},ae.text=function(ne){return ne},q}(),Ce=function(){function q(){}var ae=q.prototype;return ae.strong=function(ne){return ne},ae.em=function(ne){return ne},ae.codespan=function(ne){return ne},ae.del=function(ne){return ne},ae.html=function(ne){return ne},ae.text=function(ne){return ne},ae.link=function(ne,te,de){return""+de},ae.image=function(ne,te,de){return""+de},ae.br=function(){return""},q}(),Be=function(){function q(){this.seen={}}var ae=q.prototype;return ae.slug=function(ne){var te=ne.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(te)){var de=te;do this.seen[de]++,te=de+"-"+this.seen[de];while(this.seen.hasOwnProperty(te))}return this.seen[te]=0,te},q}(),Ne=W.defaults,Ue=j.unescape,He=function(){function q(ue){this.options=ue||Ne,this.options.renderer=this.options.renderer||new xe,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Ce,this.slugger=new Be}q.parse=function(ne,te){var de=new q(te);return de.parse(ne)};var ae=q.prototype;return ae.parse=function(ne,te){te===void 0&&(te=!0);var de="",fe,be,Te,Me,je,nt,it,Tt,ot,$e,yt,lt,Rt,Ct,bt,Qt,zt,Gt,jt=ne.length;for(fe=0;fe<jt;fe++){$e=ne[fe];switch($e.type){case"space":continue;case"hr":{de+=this.renderer.hr();continue}case"heading":{de+=this.renderer.heading(this.parseInline($e.tokens),$e.depth,Ue(this.parseInline($e.tokens,this.textRenderer)),this.slugger);continue}case"code":{de+=this.renderer.code($e.text,$e.lang,$e.escaped);continue}case"table":{for(Tt="",it="",Me=$e.header.length,be=0;be<Me;be++)it+=this.renderer.tablecell(this.parseInline($e.tokens.header[be]),{header:!0,align:$e.align[be]});for(Tt+=this.renderer.tablerow(it),ot="",Me=$e.cells.length,be=0;be<Me;be++){for(nt=$e.tokens.cells[be],it="",je=nt.length,Te=0;Te<je;Te++)it+=this.renderer.tablecell(this.parseInline(nt[Te]),{header:!1,align:$e.align[Te]});ot+=this.renderer.tablerow(it)}de+=this.renderer.table(Tt,ot);continue}case"blockquote":{ot=this.parse($e.tokens),de+=this.renderer.blockquote(ot);continue}case"list":{for(yt=$e.ordered,lt=$e.start,Rt=$e.loose,Me=$e.items.length,ot="",be=0;be<Me;be++)bt=$e.items[be],Qt=bt.checked,zt=bt.task,Ct="",bt.task&&(Gt=this.renderer.checkbox(Qt),Rt?bt.tokens.length>0&&bt.tokens[0].type==="text"?(bt.tokens[0].text=Gt+" "+bt.tokens[0].text,bt.tokens[0].tokens&&bt.tokens[0].tokens.length>0&&bt.tokens[0].tokens[0].type==="text"&&(bt.tokens[0].tokens[0].text=Gt+" "+bt.tokens[0].tokens[0].text)):bt.tokens.unshift({type:"text",text:Gt}):Ct+=Gt),Ct+=this.parse(bt.tokens,Rt),ot+=this.renderer.listitem(Ct,zt,Qt);de+=this.renderer.list(ot,yt,lt);continue}case"html":{de+=this.renderer.html($e.text);continue}case"paragraph":{de+=this.renderer.paragraph(this.parseInline($e.tokens));continue}case"text":{for(ot=$e.tokens?this.parseInline($e.tokens):$e.text;fe+1<jt&&ne[fe+1].type==="text";)$e=ne[++fe],ot+=`
`+($e.tokens?this.parseInline($e.tokens):$e.text);de+=te?this.renderer.paragraph(ot):ot;continue}default:{var gt='Token with "'+$e.type+'" type was not found.';if(this.options.silent){console.error(gt);return}else throw new Error(gt)}}}return de},ae.parseInline=function(ne,te){te=te||this.renderer;var de="",fe,be,Te=ne.length;for(fe=0;fe<Te;fe++){be=ne[fe];switch(be.type){case"escape":{de+=te.text(be.text);break}case"html":{de+=te.html(be.text);break}case"link":{de+=te.link(be.href,be.title,this.parseInline(be.tokens,te));break}case"image":{de+=te.image(be.href,be.title,be.text);break}case"strong":{de+=te.strong(this.parseInline(be.tokens,te));break}case"em":{de+=te.em(this.parseInline(be.tokens,te));break}case"codespan":{de+=te.codespan(be.text);break}case"br":{de+=te.br();break}case"del":{de+=te.del(this.parseInline(be.tokens,te));break}case"text":{de+=te.text(be.text);break}default:{var Me='Token with "'+be.type+'" type was not found.';if(this.options.silent){console.error(Me);return}else throw new Error(Me)}}}return de},q}(),ze=j.merge,Ge=j.checkSanitizeDeprecation,Je=j.escape,ke=W.getDefaults,Qe=W.changeDefaults,Ze=W.defaults;function le(q,ae,ue){if(typeof q=="undefined"||q===null)throw new Error("marked(): input parameter is undefined or null");if(typeof q!="string")throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(q)+", string expected");if(typeof ae=="function"&&(ue=ae,ae=null),ae=ze({},le.defaults,ae||{}),Ge(ae),ue){var ne=ae.highlight,te;try{te=Se.lex(q,ae)}catch(Te){return ue(Te)}var de=function(Me){var je;if(!Me)try{je=He.parse(te,ae)}catch(nt){Me=nt}return ae.highlight=ne,Me?ue(Me):ue(null,je)};if(!ne||ne.length<3)return de();if(delete ae.highlight,!te.length)return de();var fe=0;le.walkTokens(te,function(Te){Te.type==="code"&&(fe++,setTimeout(function(){ne(Te.text,Te.lang,function(Me,je){if(Me)return de(Me);je!=null&&je!==Te.text&&(Te.text=je,Te.escaped=!0),fe--,fe===0&&de()})},0))}),fe===0&&de();return}try{var be=Se.lex(q,ae);return ae.walkTokens&&le.walkTokens(be,ae.walkTokens),He.parse(be,ae)}catch(Te){if(Te.message+=`
Please report this to https://github.com/markedjs/marked.`,ae.silent)return"<p>An error occurred:</p><pre>"+Je(Te.message+"",!0)+"</pre>";throw Te}}le.options=le.setOptions=function(q){return ze(le.defaults,q),Qe(le.defaults),le},le.getDefaults=ke,le.defaults=Ze,le.use=function(q){var ae=ze({},q);if(q.renderer&&function(){var ne=le.defaults.renderer||new xe,te=function(be){var Te=ne[be];ne[be]=function(){for(var Me=arguments.length,je=new Array(Me),nt=0;nt<Me;nt++)je[nt]=arguments[nt];var it=q.renderer[be].apply(ne,je);return it===!1&&(it=Te.apply(ne,je)),it}};for(var de in q.renderer)te(de);ae.renderer=ne}(),q.tokenizer&&function(){var ne=le.defaults.tokenizer||new we,te=function(be){var Te=ne[be];ne[be]=function(){for(var Me=arguments.length,je=new Array(Me),nt=0;nt<Me;nt++)je[nt]=arguments[nt];var it=q.tokenizer[be].apply(ne,je);return it===!1&&(it=Te.apply(ne,je)),it}};for(var de in q.tokenizer)te(de);ae.tokenizer=ne}(),q.walkTokens){var ue=le.defaults.walkTokens;ae.walkTokens=function(ne){q.walkTokens(ne),ue&&ue(ne)}}le.setOptions(ae)},le.walkTokens=function(q,ae){for(var ue=U(q),ne;!(ne=ue()).done;){var te=ne.value;ae(te);switch(te.type){case"table":{for(var de=U(te.tokens.header),fe;!(fe=de()).done;){var be=fe.value;le.walkTokens(be,ae)}for(var Te=U(te.tokens.cells),Me;!(Me=Te()).done;)for(var je=Me.value,nt=U(je),it;!(it=nt()).done;){var Tt=it.value;le.walkTokens(Tt,ae)}break}case"list":{le.walkTokens(te.items,ae);break}default:te.tokens&&le.walkTokens(te.tokens,ae)}}},le.Parser=He,le.parser=He.parse,le.Renderer=xe,le.TextRenderer=Ce,le.Lexer=Se,le.lexer=Se.lex,le.Tokenizer=we,le.Slugger=Be,le.parse=le;var Z=le;return Z})},ELLl:function(tt,Ee,J){(function(oe){oe(J("VrN/"))})(function(oe){var $={pairs:`()[]{}''""`,closeBefore:`)]}'":;>`,triples:"",explode:"[]{}"},k=oe.Pos;oe.defineOption("autoCloseBrackets",!1,function(o,p,l){l&&l!=oe.Init&&(o.removeKeyMap(U),o.state.closeBrackets=null),p&&(L(z(p,"pairs")),o.state.closeBrackets=p,o.addKeyMap(U))});function z(o,p){return p=="pairs"&&typeof o=="string"?o:typeof o=="object"&&o[p]!=null?o[p]:$[p]}var U={Backspace:n,Enter:I};function L(o){for(var p=0;p<o.length;p++){var l=o.charAt(p),u="'"+l+"'";U[u]||(U[u]=W(l))}}L($.pairs+"`");function W(o){return function(p){return f(p,o)}}function H(o){var p=o.state.closeBrackets;if(!p||p.override)return p;var l=o.getModeAt(o.getCursor());return l.closeBrackets||p}function n(o){var p=H(o);if(!p||o.getOption("disableInput"))return oe.Pass;for(var l=z(p,"pairs"),u=o.listSelections(),a=0;a<u.length;a++){if(!u[a].empty())return oe.Pass;var s=m(o,u[a].head);if(!s||l.indexOf(s)%2!=0)return oe.Pass}for(var a=u.length-1;a>=0;a--){var C=u[a].head;o.replaceRange("",k(C.line,C.ch-1),k(C.line,C.ch+1),"+delete")}}function I(o){var p=H(o),l=p&&z(p,"explode");if(!l||o.getOption("disableInput"))return oe.Pass;for(var u=o.listSelections(),a=0;a<u.length;a++){if(!u[a].empty())return oe.Pass;var s=m(o,u[a].head);if(!s||l.indexOf(s)%2!=0)return oe.Pass}o.operation(function(){var C=o.lineSeparator()||`
`;o.replaceSelection(C+C,null),o.execCommand("goCharLeft"),u=o.listSelections();for(var _=0;_<u.length;_++){var w=u[_].head.line;o.indentLine(w,null,!0),o.indentLine(w+1,null,!0)}})}function g(o){var p=oe.cmpPos(o.anchor,o.head)>0;return{anchor:new k(o.anchor.line,o.anchor.ch+(p?-1:1)),head:new k(o.head.line,o.head.ch+(p?1:-1))}}function f(o,p){var l=H(o);if(!l||o.getOption("disableInput"))return oe.Pass;var u=z(l,"pairs"),a=u.indexOf(p);if(a==-1)return oe.Pass;for(var s=z(l,"closeBefore"),C=z(l,"triples"),_=u.charAt(a+1)==p,w=o.listSelections(),O=a%2==0,R,S=0;S<w.length;S++){var T=w[S],E=T.head,c,x=o.getRange(E,k(E.line,E.ch+1));if(O&&!T.empty())c="surround";else if((_||!O)&&x==p)_&&h(o,E)?c="both":C.indexOf(p)>=0&&o.getRange(E,k(E.line,E.ch+3))==p+p+p?c="skipThree":c="skip";else if(_&&E.ch>1&&C.indexOf(p)>=0&&o.getRange(k(E.line,E.ch-2),E)==p+p){if(E.ch>2&&/\bstring/.test(o.getTokenTypeAt(k(E.line,E.ch-2))))return oe.Pass;c="addFour"}else if(_){var v=E.ch==0?" ":o.getRange(k(E.line,E.ch-1),E);if(!oe.isWordChar(x)&&v!=p&&!oe.isWordChar(v))c="both";else return oe.Pass}else if(O&&(x.length===0||/\s/.test(x)||s.indexOf(x)>-1))c="both";else return oe.Pass;if(!R)R=c;else if(R!=c)return oe.Pass}var y=a%2?u.charAt(a-1):p,F=a%2?p:u.charAt(a+1);o.operation(function(){if(R=="skip")o.execCommand("goCharRight");else if(R=="skipThree")for(var B=0;B<3;B++)o.execCommand("goCharRight");else if(R=="surround"){for(var A=o.getSelections(),B=0;B<A.length;B++)A[B]=y+A[B]+F;o.replaceSelections(A,"around"),A=o.listSelections().slice();for(var B=0;B<A.length;B++)A[B]=g(A[B]);o.setSelections(A)}else R=="both"?(o.replaceSelection(y+F,null),o.triggerElectric(y+F),o.execCommand("goCharLeft")):R=="addFour"&&(o.replaceSelection(y+y+y+y,"before"),o.execCommand("goCharRight"))})}function m(o,p){var l=o.getRange(k(p.line,p.ch-1),k(p.line,p.ch+1));return l.length==2?l:null}function h(o,p){var l=o.getTokenAt(k(p.line,p.ch+1));return/\bstring/.test(l.type)&&l.start==p.ch&&(p.ch==0||!/\bstring/.test(o.getTokenTypeAt(p)))}})},FWmy:function(tt,Ee,J){"use strict";J.d(Ee,"a",function(){return oe});function oe($,k){if(!$)throw new Error(k?`Assertion failed (${k})`:"Assertion Failed")}},G8my:function(tt,Ee,J){tt.exports={flex:"flex___1FMOA"}},HmJG:function(tt,Ee,J){},JYp7:function(tt,Ee,J){"use strict";J.d(Ee,"a",function(){return oe});var oe;(function($){function k(s){return s&&typeof s=="object"&&typeof s[Symbol.iterator]=="function"}$.is=k;const z=Object.freeze([]);function U(){return z}$.empty=U;function*L(s){yield s}$.single=L;function W(s){return s||z}$.from=W;function H(s){return!s||s[Symbol.iterator]().next().done===!0}$.isEmpty=H;function n(s){return s[Symbol.iterator]().next().value}$.first=n;function I(s,C){for(const _ of s)if(C(_))return!0;return!1}$.some=I;function g(s,C){for(const _ of s)if(C(_))return _;return}$.find=g;function*f(s,C){for(const _ of s)C(_)&&(yield _)}$.filter=f;function*m(s,C){let _=0;for(const w of s)yield C(w,_++)}$.map=m;function*h(...s){for(const C of s)for(const _ of C)yield _}$.concat=h;function*o(s){for(const C of s)for(const _ of C)yield _}$.concatNested=o;function p(s,C,_){let w=_;for(const O of s)w=C(w,O);return w}$.reduce=p;function*l(s,C,_=s.length){for(C<0&&(C+=s.length),_<0?_+=s.length:_>s.length&&(_=s.length);C<_;C++)yield s[C]}$.slice=l;function u(s,C=Number.POSITIVE_INFINITY){const _=[];if(C===0)return[_,s];const w=s[Symbol.iterator]();for(let O=0;O<C;O++){const R=w.next();if(R.done)return[_,$.empty()];_.push(R.value)}return[_,{[Symbol.iterator](){return w}}]}$.consume=u;function a(s,C,_=(w,O)=>w===O){const w=s[Symbol.iterator](),O=C[Symbol.iterator]();for(;;){const R=w.next(),S=O.next();if(R.done!==S.done)return!1;if(R.done)return!0;if(!_(R.value,S.value))return!1}}$.equals=a})(oe||(oe={}))},JkjM:function(tt,Ee,J){"use strict";J.r(Ee);var oe=J("9og8"),$=J("PpiC"),k=J("WmNS"),z=J.n(k),U=J("q1tI"),L=J.n(U),W=J("Ty5D"),H=J("9kvl"),n=J("14J3"),I=J("BMrR"),g=J("jCWc"),f=J("kPKH"),m=J("+L6B"),h=J("2/Rp"),o=J("k1fw"),p=J("m3rI"),l=J("LO5M"),u=J.n(l),a=J("h+Ho"),s=function(Ue){var He,ze,Ge,Je,ke=Ue.user,Qe=Ue.forumsDetail,Ze=Ue.globalSetting,le=Ue.loading,Z=Ue.dispatch,q=Object($.a)(Ue,["user","forumsDetail","globalSetting","loading","dispatch"]),ae=Qe.forumsDetailData||{},ue=ae.author_info,ne=ae.memo,te=ae.recommend_shixuns,de=function(){var fe=Object(oe.a)(z.a.mark(function be(){var Te;return z.a.wrap(function(je){for(;;)switch(je.prev=je.next){case 0:if(!(ue!=null&&ue.watched)){je.next=6;break}return je.next=3,Object(a.a)({user_id:ue.user_id});case 3:je.t0=je.sent,je.next=9;break;case 6:return je.next=8,Object(a.o)({user_id:ue.user_id});case 8:je.t0=je.sent;case 9:Te=je.t0,Te&&Z({type:"forumsDetail/setForumsDetailData",payload:Object(o.a)(Object(o.a)({},Qe.forumsDetailData),{},{author_info:Object(o.a)(Object(o.a)({},ue),{},{watched:!(ue!=null&&ue.watched)})})});case 11:case"end":return je.stop()}},be)}));return function(){return fe.apply(this,arguments)}}();return L.a.createElement("section",{className:u.a.wrap},L.a.createElement("aside",{className:"ml20"},L.a.createElement("div",{className:"bg-white pt40 pb40 pl20 pr20 ".concat(u.a.head)},L.a.createElement("a",{href:"/users/".concat(ue==null?void 0:ue.login),target:"_blank"},(ue==null?void 0:ue.image_url)&&L.a.createElement("img",{src:"".concat(p.a.API_SERVER,"/images/").concat(ue==null?void 0:ue.image_url)})),L.a.createElement("div",{className:"tc font20"},ue==null?void 0:ue.username),L.a.createElement("div",{className:"tc c-grey-999"},ue==null?void 0:ue.identity),((He=ke.userInfo)===null||He===void 0?void 0:He.user_id)!==(ue==null?void 0:ue.user_id)&&L.a.createElement(I.a,{justify:"center",className:"mt30 ".concat(u.a.buttonWrap)},L.a.createElement(f.a,null,L.a.createElement(h.a,{type:"primary",className:"mr10",onClick:de},ue!=null&&ue.watched?"\u53D6\u6D88\u5173\u6CE8":"\u5173\u6CE8")),L.a.createElement(f.a,null,L.a.createElement(h.a,{ghost:!0,className:u.a.privateMessage,href:"/messages/".concat((ze=ke.userInfo)===null||ze===void 0?void 0:ze.login,"/message_detail?target_ids=").concat(ue==null?void 0:ue.user_id),target:"_blank"},"\u79C1\u4FE1")))),!!(ne!=null&&(Ge=ne.tag)!==null&&Ge!==void 0&&Ge.length)&&L.a.createElement("div",{className:"bg-white mt10 pt40 pb40 pl20 pr20"},L.a.createElement("div",{className:"font16"},"\u8BDD\u9898\u6807\u7B7E"),L.a.createElement("div",{className:"mt30 ".concat(u.a.tag)},ne==null||((Je=ne.tag)===null||Je===void 0)?void 0:Je.map(function(fe){return L.a.createElement("a",null,fe==null?void 0:fe.name)}))),L.a.createElement("div",{className:"pt10 pb10 pl10 pr10"},L.a.createElement("div",{className:"font16 mb20"},"\u63A8\u8350\u5B9E\u8BAD"),L.a.createElement("div",{className:u.a.recommend},te==null?void 0:te.map(function(fe){return L.a.createElement("div",{className:u.a.recommendItem},L.a.createElement("a",{href:"/shixuns/".concat(fe.identifier,"/challenges"),target:"_blank"},L.a.createElement("img",{alt:fe.id,src:"".concat(p.a.API_SERVER,"/").concat(fe.image_url)})),L.a.createElement("div",{className:"".concat(u.a.flex1," ml10")},L.a.createElement("a",{href:"/shixuns/".concat(fe.identifier,"/challenges"),target:"_blank",title:fe.name,className:"".concat(u.a.mWidth147," multi-llipsis1e c-grey-666 mb10")},fe.name),L.a.createElement("div",{className:"c-grey-999"},fe.myshixuns_count," \u4EBA\u5B66\u4E60")))})))))},C=Object(H.a)(function(Ne){var Ue=Ne.user,He=Ne.forumsDetail,ze=Ne.loading,Ge=Ne.globalSetting;return{user:Ue,forumsDetail:He,globalSetting:Ge,loading:ze.models.forumsDetail}})(s),_=J("qVdP"),w=J("jsC+"),O=J("5Dmo"),R=J("3S7+"),S=J("sPJy"),T=J("bE4q"),E=J("lUTK"),c=J("BvKs"),x=J("5NDa"),v=J("5rEg"),y=J("2qtc"),F=J("kLXV"),B=J("miYZ"),A=J("tsqr"),j=J("55Ip"),P=J("wd/R"),b=J.n(P),V=J("9Bee"),re=J("oBTY"),ce=J("tJVT"),me=J("Ot1p"),De=J("/MfK"),we=J("8JLL"),Le=J.n(we);b.a.lang("ZH-cn");function Re(Ne){var Ue=Ne.user,He=Ne.vlist,ze=He===void 0?[]:He,Ge=Ne.dispatch,Je=Ne.params,ke=Ne.id,Qe=Ne.memo_replies,Ze=Ne.forumsDetail;return L.a.createElement("aside",{className:Le.a.comment},ze.map(function(le,Z){var q,ae;return L.a.createElement(I.a,{key:Z,className:Le.a.commentItem},L.a.createElement(f.a,{span:24},L.a.createElement(I.a,null,L.a.createElement(f.a,{flex:"1"},L.a.createElement("a",{href:"/users/".concat(le.user_login),target:"_blank",className:"c-light-black"},le==null?void 0:le.username),L.a.createElement("span",{className:"c-light-black ml10"},le.time)),(le.can_delete||le.user_id===((q=Ue.userInfo)===null||q===void 0?void 0:q.user_id)||le.user_login===((ae=Ue.userInfo)===null||ae===void 0?void 0:ae.login))&&L.a.createElement(f.a,{className:"forums-comment-delete",style:{display:"none"}},L.a.createElement(R.a,{title:"\u5220\u9664"},L.a.createElement(De.a,{className:"current",onClick:function(){F.a.confirm({centered:!0,width:530,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u63D0\u793A",content:L.a.createElement("div",{className:"font16 tc"},"\u786E\u5B9A\u8981\u5220\u9664\u8BE5\u6761\u56DE\u590D\u5417\uFF1F"),onOk:function(){var ne=Object(oe.a)(z.a.mark(function de(){var fe,be;return z.a.wrap(function(Me){for(;;)switch(Me.prev=Me.next){case 0:return Me.next=2,Object(a.b)({id:le.id});case 2:fe=Me.sent,be=Qe.find(function(je){return je.id===ke}).children.filter(function(je){return je.id!==le.id}),Qe.find(function(je){return je.id===ke}).children=be,Ge({type:"forumsDetail/setForumsDetailData",payload:Object(o.a)(Object(o.a)({},Ze.forumsDetailData),{},{memo_replies:Object(re.a)(Qe)})});case 6:case"end":return Me.stop()}},de)}));function te(){return ne.apply(this,arguments)}return te}()})}}))))),L.a.createElement(f.a,null,L.a.createElement(V.a,{value:le.content})))}))}var Ie=Re,ye=J("1vsH");b.a.lang("ZH-cn");var X=function(Ue,He){var ze=Ue.user,Ge=Ue.forumsDetail,Je=Ue.globalSetting,ke=Ue.loading,Qe=Ue.dispatch,Ze=Ue.handleClick,le=Object($.a)(Ue,["user","forumsDetail","globalSetting","loading","dispatch","handleClick"]),Z=Ge.forumsDetailData||{},q=Z.memo,ae=Z.memo_replies,ue=Object(W.i)(),ne=Object(U.useState)(""),te=Object(ce.a)(ne,2),de=te[0],fe=te[1],be=Object(U.useState)(""),Te=Object(ce.a)(be,2),Me=Te[0],je=Te[1],nt=Object(U.useState)(-1),it=Object(ce.a)(nt,2),Tt=it[0],ot=it[1],$e=Object(U.useState)(!1),yt=Object(ce.a)($e,2),lt=yt[0],Rt=yt[1],Ct=Object(U.useState)(1),bt=Object(ce.a)(Ct,2),Qt=bt[0],zt=bt[1],Gt=Object(U.useState)(!1),jt=Object(ce.a)(Gt,2),gt=jt[0],wt=jt[1];Object(U.useImperativeHandle)(He,function(){return{onMdFouch:an}}),Object(U.useEffect)(function(){Rt((q==null?void 0:q.replies_count)>10)},[q==null?void 0:q.replies_count]);var At=function(){var ut=Object(oe.a)(z.a.mark(function Ye(){var Et,dt,rt;return z.a.wrap(function(ft){for(;;)switch(ft.prev=ft.next){case 0:return Et=Qt+1,zt(Et),ft.next=4,Object(a.h)({id:ue.memoId,page:Et});case 4:dt=ft.sent,dt!=null&&dt.memo_replies&&(Qe({type:"forumsDetail/setForumsDetailData",payload:Object(o.a)(Object(o.a)({},Ge.forumsDetailData),{},{memo_replies:[].concat(Object(re.a)(ae),Object(re.a)(dt.memo_replies))})}),Rt(((rt=dt.memo_replies)===null||rt===void 0?void 0:rt.length)===10));case 6:case"end":return ft.stop()}},Ye)}));return function(){return ut.apply(this,arguments)}}(),Bt=function(Ye){var Et,dt,rt,pt;return Object(o.a)(Object(o.a)({},Ye),{},{image_url:(Et=ze.userInfo)===null||Et===void 0?void 0:Et.image_url,children:[],user_id:(dt=ze.userInfo)===null||dt===void 0?void 0:dt.user_id,user_login:(rt=ze.userInfo)===null||rt===void 0?void 0:rt.login,username:(pt=ze.userInfo)===null||pt===void 0?void 0:pt.username,time:"".concat(Object(ye.cb)((new Date().getTime()-new Date(Ye.created_at).getTime())/1e3),"\u524D")})},an=function(){wt(!0)};return L.a.createElement("section",{className:Le.a.wrap},!!(ae!=null&&ae.length)&&L.a.createElement("aside",{className:Le.a.content},L.a.createElement("div",{style:{padding:"10px 15px 5px 15px",justifyContent:"space-between",display:"flex"}},L.a.createElement("span",null,"\u5168\u90E8\u56DE\u590D\uFF08",q.replies_count,"\uFF09")),L.a.createElement("aside",{className:Le.a.replyList},ae==null?void 0:ae.map(function(ut,Ye){var Et;return L.a.createElement(I.a,{gutter:[12,12],key:Ye},L.a.createElement(f.a,{flex:"40px"},L.a.createElement("a",{href:"/users/".concat(ut.user_login),target:"_blank"},L.a.createElement("img",{alt:"\u7528\u6237\u5934\u50CF",width:"50",height:"50",src:"".concat(p.a.IMG_SERVER,"/images/").concat(ut==null?void 0:ut.image_url)}))),L.a.createElement(f.a,{flex:"1"},L.a.createElement(I.a,{align:"middle"},L.a.createElement(f.a,{span:24},L.a.createElement("a",{href:"/users/".concat(ut.user_login),target:"_blank"},L.a.createElement("span",{className:"c-light-black"},ut==null?void 0:ut.username)),L.a.createElement("span",{className:"c-light-black ml10"},ut.time)),L.a.createElement(f.a,{span:24},L.a.createElement("div",{onClick:Ze},L.a.createElement(V.a,{value:ut.content}))),!!(ut!=null&&(Et=ut.children)!==null&&Et!==void 0&&Et.length)&&L.a.createElement(Ie,{user:ze,id:ut==null?void 0:ut.id,vlist:ut==null?void 0:ut.children,dispatch:Qe,params:ue,memo_replies:ae,forumsDetail:Ge}),L.a.createElement(f.a,{span:24,className:"mt5 c-light-black"},Tt===Ye?L.a.createElement("aside",null,L.a.createElement(me.a,{onChange:function(rt){je(rt)},height:150,isFocus:!0,placeholder:"\u6211\u8981\u56DE\u590D..."}),L.a.createElement(I.a,null,L.a.createElement(f.a,{span:24,className:"tr"},L.a.createElement(h.a,{type:"primary",size:"large",onClick:Object(oe.a)(z.a.mark(function dt(){var rt;return z.a.wrap(function(ft){for(;;)switch(ft.prev=ft.next){case 0:if(!(Me==="")){ft.next=4;break}A.b.error("\u8BF7\u8F93\u5165\u5185\u5BB9"),ft.next=9;break;case 4:return ft.next=6,Object(a.k)({parent_id:ut.id,content:Me});case 6:rt=ft.sent,je(null),rt&&(ot(-1),ae.find(function(Vt){return Vt.id===rt.parent_id}).children.push(Bt(rt)),Qe({type:"forumsDetail/setForumsDetailData",payload:Object(o.a)(Object(o.a)({},Ge.forumsDetailData),{},{memo:Object(o.a)(Object(o.a)({},q),{},{replies_count:q.replies_count+1}),memo_replies:Object(re.a)(ae)})}));case 9:case"end":return ft.stop()}},dt)}))},"\u53D1\u9001")))):L.a.createElement("div",{className:"tr"},L.a.createElement("span",{className:"iconfont icon-huifu1 mr15 ml30 current",onClick:function(){return ot(Ye)}}),L.a.createElement(R.a,{title:ut.user_praise?"\u53D6\u6D88\u70B9\u8D5E":"\u70B9\u8D5E"},L.a.createElement("span",{className:ut.user_praise?"c-orange":"c-gery-888"},L.a.createElement("i",{className:"iconfont icon-dianzan mr3 current",onClick:Object(oe.a)(z.a.mark(function dt(){var rt;return z.a.wrap(function(ft){for(;;)switch(ft.prev=ft.next){case 0:return ft.next=2,Object(a.i)({id:ut.id,container_type:"Memo",type:ut.user_praise?0:1});case 2:rt=ft.sent,(rt==null?void 0:rt.praise_count)>=0&&(ae.find(function(Vt){return Vt.id===ut.id}).user_praise=!ut.user_praise,ae.find(function(Vt){return Vt.id===ut.id}).praise_count=rt==null?void 0:rt.praise_count,Qe({type:"forumsDetail/setForumsDetailData",payload:Object(o.a)(Object(o.a)({},Ge.forumsDetailData),{},{memo_replies:Object(re.a)(ae)})}));case 4:case"end":return ft.stop()}},dt)}))}),ut.praise_count>0?ut.praise_count:"")))))))}))),lt&&L.a.createElement("aside",{className:"bg-white pb20",style:{display:"flex",justifyContent:"center"}},L.a.createElement(I.a,{justify:"space-between"},L.a.createElement(f.a,null),L.a.createElement(f.a,null,lt&&L.a.createElement("a",{className:"c-black",onClick:At},"\u67E5\u770B\u66F4\u591A\u8BC4\u8BBA")))),L.a.createElement("aside",{className:Le.a.reply},L.a.createElement(me.a,{onBlur:function(){return wt(!1)},isFocus:gt,defaultValue:de,id:"writeForumsReviewId",onChange:function(Ye){fe(Ye)},placeholder:"\u6211\u8981\u56DE\u590D...",height:240}),L.a.createElement(I.a,null,L.a.createElement(f.a,{flex:"1"}),L.a.createElement(f.a,null,L.a.createElement(h.a,{type:"primary",size:"large",onClick:Object(oe.a)(z.a.mark(function ut(){var Ye;return z.a.wrap(function(dt){for(;;)switch(dt.prev=dt.next){case 0:if(!(de==="")){dt.next=4;break}A.b.error("\u8BF7\u8F93\u5165\u5185\u5BB9"),dt.next=9;break;case 4:return dt.next=6,Object(a.k)({parent_id:q.id,content:de});case 6:Ye=dt.sent,fe(null),Ye&&Qe({type:"forumsDetail/setForumsDetailData",payload:Object(o.a)(Object(o.a)({},Ge.forumsDetailData),{},{memo:Object(o.a)(Object(o.a)({},q),{},{replies_count:q.replies_count+1}),memo_replies:[Bt(Ye)].concat(Object(re.a)(ae))})});case 9:case"end":return dt.stop()}},ut)}))},"\u53D1\u9001")))))},M=Object(H.a)(function(Ne){var Ue=Ne.user,He=Ne.forumsDetail,ze=Ne.loading,Ge=Ne.globalSetting;return{user:Ue,forumsDetail:He,globalSetting:Ge,loading:ze.models.forumsDetail}},null,null,{forwardRef:!0})(Object(U.forwardRef)(X)),N=J("smFo"),Y=J.n(N),ie=J("RCxd"),K=J("kaH+"),pe=J("dhSg"),Se={5:"\u6280\u672F\u5206\u4EAB",3:"\u64CD\u4F5C\u6307\u5357",16:"\u901A\u77E5\u516C\u544A"},Pe=function(Ue){var He,ze,Ge,Je,ke,Qe=Ue.user,Ze=Ue.forumsDetail,le=Ue.globalSetting,Z=Ue.loading,q=Ue.dispatch,ae=Object($.a)(Ue,["user","forumsDetail","globalSetting","loading","dispatch"]),ue=Ze.forumsDetailData||{},ne=ue.author_info,te=ue.memo,de=ue.attachments_list,fe=Object(U.useRef)(),be=Object(U.useRef)(),Te=function(){var $e=Object(oe.a)(z.a.mark(function yt(){var lt,Rt;return z.a.wrap(function(bt){for(;;)switch(bt.prev=bt.next){case 0:return lt={id:te.id,sticky:te.sticky?0:1},bt.next=3,Object(a.m)(lt);case 3:Rt=bt.sent,(Rt==null?void 0:Rt.status)===0&&q({type:"forumsDetail/setForumsDetailData",payload:Object(o.a)(Object(o.a)({},Ze.forumsDetailData),{},{memo:Object(o.a)(Object(o.a)({},te),{},{sticky:!(te!=null&&te.sticky)})})});case 5:case"end":return bt.stop()}},yt)}));return function(){return $e.apply(this,arguments)}}(),Me=function(){var $e=Object(oe.a)(z.a.mark(function yt(){var lt;return z.a.wrap(function(Ct){for(;;)switch(Ct.prev=Ct.next){case 0:return Ct.next=2,Object(a.b)({id:te==null?void 0:te.id});case 2:lt=Ct.sent,(lt==null?void 0:lt.status)===0&&(A.b.success("\u5220\u9664\u6210\u529F"),H.d.push("/forums")),(lt==null?void 0:lt.status)===-1&&H.d.push("/forums");case 5:case"end":return Ct.stop()}},yt)}));return function(){return $e.apply(this,arguments)}}(),je=function(){var $e=Object(oe.a)(z.a.mark(function yt(){return z.a.wrap(function(Rt){for(;;)switch(Rt.prev=Rt.next){case 0:F.a.confirm({centered:!0,width:530,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u5956\u52B1\u8BBE\u7F6E",content:L.a.createElement("div",{className:"font14 tc"},L.a.createElement(v.a,{defaultValue:fe.current,onChange:function(bt){return fe.current=bt.target.value}})),onOk:function(){var Ct=Object(oe.a)(z.a.mark(function Qt(){var zt;return z.a.wrap(function(jt){for(;;)switch(jt.prev=jt.next){case 0:return jt.next=2,Object(a.l)({id:te==null?void 0:te.id,container_type:"Memo",score:fe.current?Number(fe.current):0,user_id:ne==null?void 0:ne.user_id});case 2:if(zt=jt.sent,fe.current=null,!((zt==null?void 0:zt.code)>0)){jt.next=8;break}return q({type:"forumsDetail/setForumsDetailData",payload:Object(o.a)(Object(o.a)({},Ze.forumsDetailData),{},{memo:Object(o.a)(Object(o.a)({},te),{},{reward:zt==null?void 0:zt.code})})}),A.b.success("\u5956\u52B1\u6210\u529F"),jt.abrupt("return");case 8:A.b.success("\u5956\u52B1\u5931\u8D25\uFF0C\u8BF7\u8054\u7CFB\u7CFB\u7EDF\u7BA1\u7406\u5458\uFF01");case 9:case"end":return jt.stop()}},Qt)}));function bt(){return Ct.apply(this,arguments)}return bt}()});case 1:case"end":return Rt.stop()}},yt)}));return function(){return $e.apply(this,arguments)}}(),nt=function(){be.current.onMdFouch&&be.current.onMdFouch()},it=function(){var $e=Object(oe.a)(z.a.mark(function yt(){var lt;return z.a.wrap(function(Ct){for(;;)switch(Ct.prev=Ct.next){case 0:return Ct.next=2,Object(a.i)({id:te.id,container_type:"Memo",type:1});case 2:lt=Ct.sent,(lt==null?void 0:lt.praise_count)>=0&&q({type:"forumsDetail/setForumsDetailData",payload:Object(o.a)(Object(o.a)({},Ze.forumsDetailData),{},{memo:Object(o.a)(Object(o.a)({},te),{},{user_praise:!(te!=null&&te.user_praise),memo_praise_count:lt==null?void 0:lt.praise_count})})});case 4:case"end":return Ct.stop()}},yt)}));return function(){return $e.apply(this,arguments)}}(),Tt=L.a.createElement(c.a,{className:Y.a.menu},((He=Qe.userInfo)===null||He===void 0?void 0:He.admin)&&(te==null?void 0:te.sticky)&&L.a.createElement(c.a.Item,null,L.a.createElement("a",{onClick:function(){return Te()}},"\u53D6\u6D88\u7F6E\u9876")),((ze=Qe.userInfo)===null||ze===void 0?void 0:ze.admin)&&!(te!=null&&te.sticky)&&L.a.createElement(c.a.Item,null,L.a.createElement("a",{onClick:function(){return Te()}},"\u7F6E\xA0\xA0\u9876")),L.a.createElement(c.a.Item,null,L.a.createElement(j.a,{to:"/forums/".concat(te==null?void 0:te.id,"/edit")},"\u7F16\xA0\xA0\u8F91")),L.a.createElement(c.a.Item,null,L.a.createElement("a",{onClick:function(){F.a.confirm({title:"\u63D0\u793A",icon:L.a.createElement(ie.a,null),content:"\u5E16\u5B50\u5C06\u88AB\u5220\u9664\uFF0C\u65E0\u6CD5\u6062\u590D\u3002\u662F\u5426\u786E\u8BA4\u5220\u9664\uFF1F",okText:"\u786E\u8BA4",onOk:function(){Me()},cancelText:"\u53D6\u6D88"})}},"\u5220\xA0\xA0\u9664"))),ot=function(yt){var lt=yt.target,Rt=lt.nodeName,Ct=lt.src;Rt==="IMG"&&(pe.a.publish("preview-image",Ct),console.log("src:",Ct))};return Object(U.useEffect)(function(){},[]),L.a.createElement("section",{className:Y.a.wrap},L.a.createElement(T.a,{separator:"/",className:"mb5"},L.a.createElement(T.a.Item,null,L.a.createElement(j.a,{to:"/forums/categories/".concat(te==null?void 0:te.forum_id)},Se[te==null?void 0:te.forum_id])),L.a.createElement(T.a.Item,null,"\u8BE6\u60C5")),L.a.createElement("header",{className:"bg-white pt40 pb40 pl30 pr30 ".concat(Y.a.header)},L.a.createElement(I.a,{align:"middle"},L.a.createElement(f.a,{flex:1,className:"font24 mb5"},L.a.createElement("span",{className:Y.a.title},te==null?void 0:te.subject),(te==null?void 0:te.sticky)&&L.a.createElement("span",{className:Y.a.top},"\u7F6E\u9876"),!!(te!=null&&te.reward)&&L.a.createElement(R.a,{placement:"bottom",title:"\u83B7\u5F97\u5E73\u53F0\u5956\u52B1\u91D1\u5E01\uFF1A".concat(te==null?void 0:te.reward)},L.a.createElement("span",{className:"ml10 c-orange-ff7"},L.a.createElement("i",{className:"iconfont icon-gift font16 mr5"}),L.a.createElement("span",{className:"font14"},te==null?void 0:te.reward)))),L.a.createElement(f.a,null,(((Ge=Qe.userInfo)===null||Ge===void 0?void 0:Ge.admin)||((Je=Qe.userInfo)===null||Je===void 0?void 0:Je.user_id)===(ne==null?void 0:ne.user_id))&&L.a.createElement(w.a,{overlay:Tt},L.a.createElement("i",{className:"fa fa-bars font-16 current c-grey-bcb"})))),L.a.createElement(I.a,{align:"middle",className:"font14"},L.a.createElement(f.a,{flex:1,className:"c-grey-999"},L.a.createElement("span",null,b()(te==null?void 0:te.time).fromNow()," \u53D1\u5E03")),L.a.createElement(f.a,{className:"c-grey-999"},((ke=Qe.userInfo)===null||ke===void 0?void 0:ke.admin)&&L.a.createElement(R.a,{placement:"bottom",title:"\u5E16\u5B50\u5956\u52B1"},L.a.createElement("span",{className:"current pr10 ".concat(Y.a.line),onClick:je},L.a.createElement("i",{className:"iconfont icon-jiangli font18 mr5"}))),L.a.createElement("span",{className:"pr10 pl10 ".concat(te!=null&&te.replies_count?Y.a.line:"")},L.a.createElement("i",{className:"iconfont icon-liulanyan font18 mr5"}),te==null?void 0:te.viewed_count),!!(te!=null&&te.replies_count)&&L.a.createElement(R.a,{placement:"bottom",title:"\u5199\u8BC4\u8BBA"},L.a.createElement("span",{className:"current pl10",onClick:nt},L.a.createElement("i",{className:"iconfont icon-huifu1 font18 mr5"}),te==null?void 0:te.replies_count))))),L.a.createElement("main",{className:"bg-white pt40 pb40 pl40 pr40"},L.a.createElement("div",{onClick:ot},L.a.createElement(V.a,{value:te==null?void 0:te.content})),L.a.createElement("div",{className:"bg-white pl40 pr40 mt40"},L.a.createElement("div",{className:"mt10 mb20 ".concat(Y.a.flexCenter)},L.a.createElement("div",{className:"".concat(Y.a.like," ").concat(te!=null&&te.user_praise?"":Y.a.canLike),onClick:it},L.a.createElement("i",{className:"iconfont icon-dianzan font18"}),L.a.createElement("br",null),L.a.createElement("span",null,te==null?void 0:te.memo_praise_count)))),!!(de!=null&&de.length)&&L.a.createElement("div",{className:"mt40"},de==null?void 0:de.map(function($e){return L.a.createElement("div",{className:"c-grey-888 ".concat(Y.a.flexCenter)},L.a.createElement("i",{className:"iconfont icon-fujian mr10 font14 c-green-29b"}),L.a.createElement("a",{href:$e==null?void 0:$e.url,title:$e==null?void 0:$e.title,className:"".concat(Y.a.attachmentName," mr10")},$e==null?void 0:$e.title),L.a.createElement("span",{className:"font12 c-grey-666 mt3"},$e==null?void 0:$e.filesize))}))),L.a.createElement(M,{ref:be,handleClick:ot}),L.a.createElement(K.a,null))},he=Object(H.a)(function(Ne){var Ue=Ne.user,He=Ne.forumsDetail,ze=Ne.loading,Ge=Ne.globalSetting;return{user:Ue,forumsDetail:He,globalSetting:Ge,loading:ze.effects}})(Pe),ve=J("G8my"),xe=J.n(ve),Ce=function(Ue){var He=Ue.forumsDetail,ze=Ue.globalSetting,Ge=Ue.loading,Je=Ue.dispatch,ke=Object($.a)(Ue,["forumsDetail","globalSetting","loading","dispatch"]),Qe=Object(W.i)();Object(U.useEffect)(function(){Ze()},[Qe.memoId]);var Ze=function(){var le=Object(oe.a)(z.a.mark(function Z(){return z.a.wrap(function(ae){for(;;)switch(ae.prev=ae.next){case 0:Je({type:"forumsDetail/getForumsDetailData",payload:{id:Qe.memoId}});case 1:case"end":return ae.stop()}},Z)}));return function(){return le.apply(this,arguments)}}();return L.a.createElement("section",{className:"edu-container mb20 mt30 ".concat(xe.a.flex)},L.a.createElement(he,null),L.a.createElement(C,null))},Be=Ee.default=Object(H.a)(function(Ne){var Ue=Ne.forumsDetail,He=Ne.loading,ze=Ne.globalSetting;return{forumsDetail:Ue,globalSetting:ze,loading:He.models.forumsDetail}})(Ce)},LO5M:function(tt,Ee,J){tt.exports={wrap:"wrap___1d4rP",head:"head___1_Uzf",recommendItem:"recommendItem___IStR9",buttonWrap:"buttonWrap___3dpFm",privateMessage:"privateMessage___24GfS",flex1:"flex1___3wIqQ",mWidth147:"mWidth147___3ODny"}},LdHM:function(tt,Ee,J){"use strict";J.d(Ee,"b",function(){return s}),J.d(Ee,"a",function(){return _});var oe=J("1OyB"),$=J("vuIU"),k=J("Ji7U"),z=J("LK+K"),U=J("q1tI"),L=J("rePB"),W=J("Ff2n"),H=J("ODXe"),n=J("4IlW"),I=J("bX4T"),g=J("YrtM"),f=J("TSYQ"),m=J.n(f),h=J("+nKL"),o=J("8OUc"),p=function(V,re){var ce=V.prefixCls,me=V.id,De=V.flattenOptions,we=V.childrenAsData,Le=V.values,Re=V.searchValue,Ie=V.multiple,ye=V.defaultActiveFirstOption,X=V.height,M=V.itemHeight,N=V.notFoundContent,Y=V.open,ie=V.menuItemSelectedIcon,K=V.virtual,pe=V.onSelect,Se=V.onToggleOpen,Pe=V.onActiveValue,he=V.onScroll,ve=V.onMouseEnter,xe="".concat(ce,"-item"),Ce=Object(g.a)(function(){return De},[Y,De],function(Z,q){return q[0]&&Z[1]!==q[1]}),Be=U.useRef(null),Ne=function(q){q.preventDefault()},Ue=function(q){Be.current&&Be.current.scrollTo({index:q})},He=function(q){for(var ae=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,ue=Ce.length,ne=0;ne<ue;ne+=1){var te=(q+ne*ae+ue)%ue,de=Ce[te],fe=de.group,be=de.data;if(!fe&&!be.disabled)return te}return-1},ze=U.useState(function(){return He(0)}),Ge=Object(H.a)(ze,2),Je=Ge[0],ke=Ge[1],Qe=function(q){ke(q);var ae=Ce[q];if(!ae){Pe(null,-1);return}Pe(ae.data.value,q)};U.useEffect(function(){Qe(ye!==!1?He(0):-1)},[Ce.length,Re]),U.useEffect(function(){var Z=setTimeout(function(){if(!Ie&&Y&&Le.size===1){var q=Array.from(Le)[0],ae=Ce.findIndex(function(ue){var ne=ue.data;return ne.value===q});Qe(ae),Ue(ae)}});return function(){return clearTimeout(Z)}},[Y]);var Ze=function(q){q!==void 0&&pe(q,{selected:!Le.has(q)}),Ie||Se(!1)};if(U.useImperativeHandle(re,function(){return{onKeyDown:function(q){var ae=q.which;switch(ae){case n.a.UP:case n.a.DOWN:{var ue=0;if(ae===n.a.UP?ue=-1:ae===n.a.DOWN&&(ue=1),ue!==0){var ne=He(Je+ue,ue);Ue(ne),Qe(ne)}break}case n.a.ENTER:{var te=Ce[Je];te&&!te.data.disabled?Ze(te.data.value):Ze(void 0),Y&&q.preventDefault();break}case n.a.ESC:Se(!1)}},onKeyUp:function(){},scrollTo:function(q){Ue(q)}}}),Ce.length===0)return U.createElement("div",{role:"listbox",id:"".concat(me,"_list"),className:"".concat(xe,"-empty"),onMouseDown:Ne},N);function le(Z){var q=Ce[Z];if(!q)return null;var ae=q.data||{},ue=ae.value,ne=ae.label,te=ae.children,de=Object(I.a)(ae,!0),fe=we?te:ne;return q?U.createElement("div",Object.assign({"aria-label":typeof fe=="string"?fe:null},de,{key:Z,role:"option",id:"".concat(me,"_list_").concat(Z),"aria-selected":Le.has(ue)}),ue):null}return U.createElement(U.Fragment,null,U.createElement("div",{role:"listbox",id:"".concat(me,"_list"),style:{height:0,width:0,overflow:"hidden"}},le(Je-1),le(Je),le(Je+1)),U.createElement(h.a,{itemKey:"key",ref:Be,data:Ce,height:X,itemHeight:M,fullHeight:!1,onMouseDown:Ne,onScroll:he,virtual:K,onMouseEnter:ve},function(Z,q){var ae,ue=Z.group,ne=Z.groupOption,te=Z.data,de=te.label,fe=te.key;if(ue)return U.createElement("div",{className:m()(xe,"".concat(xe,"-group"))},de!==void 0?de:fe);var be=te.disabled,Te=te.value,Me=te.title,je=te.children,nt=te.style,it=te.className,Tt=Object(W.a)(te,["disabled","value","title","children","style","className"]),ot=Le.has(Te),$e="".concat(xe,"-option"),yt=m()(xe,$e,it,(ae={},Object(L.a)(ae,"".concat($e,"-grouped"),ne),Object(L.a)(ae,"".concat($e,"-active"),Je===q&&!be),Object(L.a)(ae,"".concat($e,"-disabled"),be),Object(L.a)(ae,"".concat($e,"-selected"),ot),ae)),lt=we?je:de,Rt=!ie||typeof ie=="function"||ot;return U.createElement("div",Object.assign({},Tt,{"aria-selected":ot,className:yt,title:Me,onMouseMove:function(){if(Je===q||be)return;Qe(q)},onClick:function(){be||Ze(Te)},style:nt}),U.createElement("div",{className:"".concat($e,"-content")},lt||Te),U.isValidElement(ie)||ot,Rt&&U.createElement(o.a,{className:"".concat(xe,"-option-state"),customizeIcon:ie,customizeIconProps:{isSelected:ot}},ot?"\u2713":null))}))},l=U.forwardRef(p);l.displayName="OptionList";var u=l,a=function(){return null};a.isSelectOption=!0;var s=a,C=function(){return null};C.isSelectOptGroup=!0;var _=C,w=J("VTBJ"),O=J("Zm9Q");function R(b){var V=b.key,re=b.props,ce=re.children,me=re.value,De=Object(W.a)(re,["children","value"]);return Object(w.a)({key:V,value:me!==void 0?me:V,children:ce},De)}function S(b){var V=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Object(O.a)(b).map(function(re,ce){if(!U.isValidElement(re)||!re.type)return null;var me=re.type.isSelectOptGroup,De=re.key,we=re.props,Le=we.children,Re=Object(W.a)(we,["children"]);return V||!me?R(re):Object(w.a)(Object(w.a)({key:"__RC_SELECT_GRP__".concat(De===null?ce:De,"__"),label:De},Re),{},{options:S(Le)})}).filter(function(re){return re})}var T=J("2Qr1"),E=J("qNPg"),c=J("U8pU"),x=J("Kwbf"),v=J("WKfj");function y(b){var V=b.mode,re=b.options,ce=b.children,me=b.backfill,De=b.allowClear,we=b.placeholder,Le=b.getInputElement,Re=b.showSearch,Ie=b.onSearch,ye=b.defaultOpen,X=b.autoFocus,M=b.labelInValue,N=b.value,Y=b.inputValue,ie=b.optionLabelProp,K=V==="multiple"||V==="tags",pe=Re!==void 0?Re:K||V==="combobox",Se=re||S(ce);if(Object(x.a)(V!=="tags"||Se.every(function(xe){return!xe.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),V==="tags"||V==="combobox"){var Pe=Se.some(function(xe){return xe.options?xe.options.some(function(Ce){return typeof("value"in Ce?Ce.value:Ce.key)=="number"}):typeof("value"in xe?xe.value:xe.key)=="number"});Object(x.a)(!Pe,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(x.a)(V!=="combobox"||!ie,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(x.a)(V==="combobox"||!me,"`backfill` only works with `combobox` mode."),Object(x.a)(V==="combobox"||!Le,"`getInputElement` only work with `combobox` mode."),Object(x.b)(V!=="combobox"||!Le||!De||!we,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),Ie&&!pe&&V!=="combobox"&&V!=="tags"&&Object(x.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(x.b)(!ye||X,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),N!=null){var he=Object(v.d)(N);Object(x.a)(!M||he.every(function(xe){return Object(c.a)(xe)==="object"&&("key"in xe||"value"in xe)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),Object(x.a)(!K||Array.isArray(N),"`value` should be array when `mode` is `multiple` or `tags`")}if(ce){var ve=null;Object(O.a)(ce).some(function(xe){if(!U.isValidElement(xe)||!xe.type)return!1;var Ce=xe.type;if(Ce.isSelectOption)return!1;if(Ce.isSelectOptGroup){var Be=Object(O.a)(xe.props.children).every(function(Ne){return!U.isValidElement(Ne)||!xe.type||Ne.type.isSelectOption?!0:(ve=Ne.type,!1)});return!Be}return ve=Ce,!0}),ve&&Object(x.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(ve.displayName||ve.name||ve,"`.")),Object(x.a)(Y===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}var F=y,B=Object(E.a)({prefixCls:"rc-select",components:{optionList:u},convertChildrenToData:S,flattenOptions:T.d,getLabeledValue:T.e,filterOptions:T.b,isValueDisabled:T.g,findValueOption:T.c,warningProps:F,fillOptionsWithMissingValue:T.a}),A=function(b){Object(k.a)(re,b);var V=Object(z.a)(re);function re(){var ce;return Object(oe.a)(this,re),ce=V.apply(this,arguments),ce.selectRef=U.createRef(),ce.focus=function(){ce.selectRef.current.focus()},ce.blur=function(){ce.selectRef.current.blur()},ce}return Object($.a)(re,[{key:"render",value:function(){return U.createElement(B,Object.assign({ref:this.selectRef},this.props))}}]),re}(U.Component);A.Option=s,A.OptGroup=_;var j=A,P=Ee.c=j},M8RZ:function(tt,Ee,J){"use strict";J.d(Ee,"a",function(){return n});var oe=J("fWQN"),$=J("mtLc"),k=J("yKVA"),z=J("879j"),U=J("q1tI"),L=J.n(U),W=J("i8i4"),H=J.n(W),n=function(I){Object(k.a)(f,I);var g=Object(z.a)(f);function f(m){var h;Object(oe.a)(this,f),h=g.call(this,m);var o=window.document;return h.node=o.createElement("div"),o.body.appendChild(h.node),h}return Object($.a)(f,[{key:"render",value:function(){var h=this.props.children;return Object(W.createPortal)(h,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),f}(L.a.Component)},MI8n:function(tt,Ee,J){"use strict";J.d(Ee,"c",function(){return U}),J.d(Ee,"b",function(){return n}),J.d(Ee,"e",function(){return I}),J.d(Ee,"a",function(){return g}),J.d(Ee,"d",function(){return f}),J.d(Ee,"f",function(){return m});var oe=J("/cxE"),$=J("pmY6"),k=J("24hK"),z=J("5Y4S"),U;(function(h){h.None=()=>$.a.None;function o(y){return(F,B=null,A)=>{let j=!1,P;return P=y(b=>j?void 0:(P?P.dispose():j=!0,F.call(B,b)),null,A),j&&P.dispose(),P}}h.once=o;function p(y,F){return _((B,A=null,j)=>y(P=>B.call(A,F(P)),null,j))}h.map=p;function l(y,F){return _((B,A=null,j)=>y(P=>{F(P),B.call(A,P)},null,j))}h.forEach=l;function u(y,F){return _((B,A=null,j)=>y(P=>F(P)&&B.call(A,P),null,j))}h.filter=u;function a(y){return y}h.signal=a;function s(...y){return(F,B=null,A)=>Object($.e)(...y.map(j=>j(P=>F.call(B,P),null,A)))}h.any=s;function C(y,F,B){let A=B;return p(y,j=>(A=F(A,j),A))}h.reduce=C;function _(y){let F;const B=new n({onFirstListenerAdd(){F=y(B.fire,B)},onLastListenerRemove(){F.dispose()}});return B.event}function w(y,F,B=100,A=!1,j){let P,b,V,re=0;const ce=new n({leakWarningThreshold:j,onFirstListenerAdd(){P=y(me=>{re++,b=F(b,me),A&&!V&&(ce.fire(b),b=void 0),clearTimeout(V),V=setTimeout(()=>{const De=b;b=void 0,V=void 0,(!A||re>1)&&ce.fire(De),re=0},B)})},onLastListenerRemove(){P.dispose()}});return ce.event}h.debounce=w;function O(y,F=(B,A)=>B===A){let B=!0,A;return u(y,j=>{const P=B||!F(j,A);return B=!1,A=j,P})}h.latch=O;function R(y,F){return[h.filter(y,F),h.filter(y,B=>!F(B))]}h.split=R;function S(y,F=!1,B=[]){let A=B.slice(),j=y(V=>{A?A.push(V):b.fire(V)});const P=()=>{A&&A.forEach(V=>b.fire(V)),A=null},b=new n({onFirstListenerAdd(){j||(j=y(V=>b.fire(V)))},onFirstListenerDidAdd(){A&&(F?setTimeout(P):P())},onLastListenerRemove(){j&&j.dispose(),j=null}});return b.event}h.buffer=S;class T{constructor(y){this.event=y}map(y){return new T(p(this.event,y))}forEach(y){return new T(l(this.event,y))}filter(y){return new T(u(this.event,y))}reduce(y,F){return new T(C(this.event,y,F))}latch(){return new T(O(this.event))}debounce(y,F=100,B=!1,A){return new T(w(this.event,y,F,B,A))}on(y,F,B){return this.event(y,F,B)}once(y,F,B){return o(this.event)(y,F,B)}}function E(y){return new T(y)}h.chain=E;function c(y,F,B=A=>A){const A=(...V)=>b.fire(B(...V)),j=()=>y.on(F,A),P=()=>y.removeListener(F,A),b=new n({onFirstListenerAdd:j,onLastListenerRemove:P});return b.event}h.fromNodeEventEmitter=c;function x(y,F,B=A=>A){const A=(...V)=>b.fire(B(...V)),j=()=>y.addEventListener(F,A),P=()=>y.removeEventListener(F,A),b=new n({onFirstListenerAdd:j,onLastListenerRemove:P});return b.event}h.fromDOMEventEmitter=x;function v(y){return new Promise(F=>o(y)(F))}h.toPromise=v})(U||(U={}));class L{constructor(h){this._listenerCount=0,this._invocationCount=0,this._elapsedOverall=0,this._name=`${h}_${L._idPool++}`}start(h){this._stopWatch=new z.a(!0),this._listenerCount=h}stop(){if(this._stopWatch){const h=this._stopWatch.elapsed();this._elapsedOverall+=h,this._invocationCount+=1,console.info(`did FIRE ${this._name}: elapsed_ms: ${h.toFixed(5)}, listener: ${this._listenerCount} (elapsed_overall: ${this._elapsedOverall.toFixed(2)}, invocations: ${this._invocationCount})`),this._stopWatch=void 0}}}L._idPool=0;let W=-1;class H{constructor(h,o=Math.random().toString(18).slice(2,5)){this.customThreshold=h,this.name=o,this._warnCountdown=0}dispose(){this._stacks&&this._stacks.clear()}check(h){let o=W;if(typeof this.customThreshold=="number"&&(o=this.customThreshold),o<=0||h<o)return;this._stacks||(this._stacks=new Map);const p=new Error().stack.split(`
`).slice(3).join(`
`),l=this._stacks.get(p)||0;if(this._stacks.set(p,l+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=o*.5;let u,a=0;for(const[s,C]of this._stacks)(!u||a<C)&&(u=s,a=C);console.warn(`[${this.name}] potential listener LEAK detected, having ${h} listeners already. MOST frequent listener (${a}):`),console.warn(u)}return()=>{const u=this._stacks.get(p)||0;this._stacks.set(p,u-1)}}}class n{constructor(h){var o;this._disposed=!1,this._options=h,this._leakageMon=W>0?new H(this._options&&this._options.leakWarningThreshold):void 0,this._perfMon=((o=this._options)===null||o===void 0?void 0:o._profName)?new L(this._options._profName):void 0}get event(){return this._event||(this._event=(h,o,p)=>{var l;this._listeners||(this._listeners=new k.a);const u=this._listeners.isEmpty();u&&this._options&&this._options.onFirstListenerAdd&&this._options.onFirstListenerAdd(this);const a=this._listeners.push(o?[h,o]:h);u&&this._options&&this._options.onFirstListenerDidAdd&&this._options.onFirstListenerDidAdd(this),this._options&&this._options.onListenerDidAdd&&this._options.onListenerDidAdd(this,h,o);const s=(l=this._leakageMon)===null||l===void 0?void 0:l.check(this._listeners.size),C=Object($.i)(()=>{if(s&&s(),!this._disposed&&(a(),this._options&&this._options.onLastListenerRemove)){const _=this._listeners&&!this._listeners.isEmpty();_||this._options.onLastListenerRemove(this)}});return p instanceof $.b?p.add(C):Array.isArray(p)&&p.push(C),C}),this._event}fire(h){var o,p;if(this._listeners){this._deliveryQueue||(this._deliveryQueue=new k.a);for(let l of this._listeners)this._deliveryQueue.push([l,h]);for((o=this._perfMon)===null||o===void 0||o.start(this._deliveryQueue.size);this._deliveryQueue.size>0;){const[l,u]=this._deliveryQueue.shift();try{typeof l=="function"?l.call(void 0,u):l[0].call(l[1],u)}catch(a){Object(oe.f)(a)}}(p=this._perfMon)===null||p===void 0||p.stop()}}dispose(){var h,o,p,l,u;this._disposed||(this._disposed=!0,(h=this._listeners)===null||h===void 0||h.clear(),(o=this._deliveryQueue)===null||o===void 0||o.clear(),(l=(p=this._options)===null||p===void 0?void 0:p.onLastListenerRemove)===null||l===void 0||l.call(p),(u=this._leakageMon)===null||u===void 0||u.dispose())}}class I extends n{constructor(h){super(h);this._isPaused=0,this._eventQueue=new k.a,this._mergeFn=h==null?void 0:h.merge}pause(){this._isPaused++}resume(){if(this._isPaused!==0&&--this._isPaused===0)if(this._mergeFn){const h=Array.from(this._eventQueue);this._eventQueue.clear(),super.fire(this._mergeFn(h))}else for(;!this._isPaused&&this._eventQueue.size!==0;)super.fire(this._eventQueue.shift())}fire(h){this._listeners&&(this._isPaused!==0?this._eventQueue.push(h):super.fire(h))}}class g extends I{constructor(h){var o;super(h);this._delay=(o=h.delay)!==null&&o!==void 0?o:100}fire(h){this._handle||(this.pause(),this._handle=setTimeout(()=>{this._handle=void 0,this.resume()},this._delay)),super.fire(h)}}class f{constructor(){this.buffers=[]}wrapEvent(h){return(o,p,l)=>h(u=>{const a=this.buffers[this.buffers.length-1];a?a.push(()=>o.call(p,u)):o.call(p,u)},void 0,l)}bufferEvents(h){const o=[];this.buffers.push(o);const p=h();return this.buffers.pop(),o.forEach(l=>l()),p}}class m{constructor(){this.listening=!1,this.inputEvent=U.None,this.inputEventListener=$.a.None,this.emitter=new n({onFirstListenerDidAdd:()=>{this.listening=!0,this.inputEventListener=this.inputEvent(this.emitter.fire,this.emitter)},onLastListenerRemove:()=>{this.listening=!1,this.inputEventListener.dispose()}}),this.event=this.emitter.event}set input(h){this.inputEvent=h,this.listening&&(this.inputEventListener.dispose(),this.inputEventListener=h(this.emitter.fire,this.emitter))}dispose(){this.inputEventListener.dispose(),this.emitter.dispose()}}},MNsG:function(tt,Ee,J){"use strict";(function(oe,$){J.d(Ee,"b",function(){return p}),J.d(Ee,"i",function(){return s}),J.d(Ee,"f",function(){return C}),J.d(Ee,"d",function(){return _}),J.d(Ee,"g",function(){return w}),J.d(Ee,"h",function(){return O}),J.d(Ee,"c",function(){return R}),J.d(Ee,"k",function(){return S}),J.d(Ee,"j",function(){return T}),J.d(Ee,"a",function(){return E}),J.d(Ee,"e",function(){return v});var k;const z="en";let U=!1,L=!1,W=!1,H=!1,n=!1,I=!1,g=!1,f,m=z,h,o;const p=typeof self=="object"?self:typeof oe=="object"?oe:{};let l;typeof p.vscode!="undefined"&&typeof p.vscode.process!="undefined"?l=p.vscode.process:typeof $!="undefined"&&(l=$);const u=typeof((k=l==null?void 0:l.versions)===null||k===void 0?void 0:k.electron)=="string"&&l.type==="renderer";if(typeof navigator=="object"&&!u)o=navigator.userAgent,U=o.indexOf("Windows")>=0,L=o.indexOf("Macintosh")>=0,g=(o.indexOf("Macintosh")>=0||o.indexOf("iPad")>=0||o.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,W=o.indexOf("Linux")>=0,I=!0,f=navigator.language,m=f;else if(typeof l=="object"){U=l.platform==="win32",L=l.platform==="darwin",W=l.platform==="linux",H=W&&!!l.env.SNAP&&!!l.env.SNAP_REVISION,f=z,m=z;const y=l.env.VSCODE_NLS_CONFIG;if(y)try{const F=JSON.parse(y),B=F.availableLanguages["*"];f=F.locale,m=B||z,h=F._translationsConfigFile}catch(F){}n=!0}else console.error("Unable to resolve platform.");let a=0;L?a=1:U?a=3:W&&(a=2);const s=U,C=L,_=W,w=n,O=I,R=g,S=o,T=function(){if(p.setImmediate)return p.setImmediate.bind(p);if(typeof p.postMessage=="function"&&!p.importScripts){let B=[];p.addEventListener("message",j=>{if(j.data&&j.data.vscodeSetImmediateId)for(let P=0,b=B.length;P<b;P++){const V=B[P];if(V.id===j.data.vscodeSetImmediateId){B.splice(P,1),V.callback();return}}});let A=0;return j=>{const P=++A;B.push({id:P,callback:j}),p.postMessage({vscodeSetImmediateId:P},"*")}}if(typeof(l==null?void 0:l.nextTick)=="function")return l.nextTick.bind(l);const F=Promise.resolve();return B=>F.then(B)}(),E=L||g?2:U?1:3;let c=!0,x=!1;function v(){if(!x){x=!0;const y=new Uint8Array(2);y[0]=1,y[1]=2;const F=new Uint16Array(y.buffer);c=F[0]===(2<<8)+1}return c}}).call(this,J("IyRk"),J("Q2Ig"))},N0LK:function(tt,Ee,J){"use strict";J.d(Ee,"C",function(){return oe}),J.d(Ee,"v",function(){return k}),J.d(Ee,"s",function(){return z}),J.d(Ee,"t",function(){return U}),J.d(Ee,"U",function(){return L}),J.d(Ee,"J",function(){return W}),J.d(Ee,"O",function(){return H}),J.d(Ee,"p",function(){return n}),J.d(Ee,"T",function(){return I}),J.d(Ee,"q",function(){return g}),J.d(Ee,"N",function(){return f}),J.d(Ee,"M",function(){return m}),J.d(Ee,"Q",function(){return h}),J.d(Ee,"u",function(){return o}),J.d(Ee,"x",function(){return p}),J.d(Ee,"I",function(){return l}),J.d(Ee,"f",function(){return u}),J.d(Ee,"h",function(){return a}),J.d(Ee,"g",function(){return s}),J.d(Ee,"i",function(){return C}),J.d(Ee,"G",function(){return _}),J.d(Ee,"H",function(){return w}),J.d(Ee,"r",function(){return O}),J.d(Ee,"R",function(){return R}),J.d(Ee,"d",function(){return S}),J.d(Ee,"e",function(){return T}),J.d(Ee,"E",function(){return E}),J.d(Ee,"F",function(){return c}),J.d(Ee,"j",function(){return x}),J.d(Ee,"z",function(){return v}),J.d(Ee,"K",function(){return F}),J.d(Ee,"L",function(){return B}),J.d(Ee,"m",function(){return j}),J.d(Ee,"k",function(){return b}),J.d(Ee,"A",function(){return re}),J.d(Ee,"a",function(){return ce}),J.d(Ee,"n",function(){return me}),J.d(Ee,"l",function(){return De}),J.d(Ee,"D",function(){return we}),J.d(Ee,"B",function(){return Le}),J.d(Ee,"b",function(){return Re}),J.d(Ee,"S",function(){return Ie}),J.d(Ee,"o",function(){return ye}),J.d(Ee,"P",function(){return X}),J.d(Ee,"w",function(){return M}),J.d(Ee,"c",function(){return N}),J.d(Ee,"y",function(){return K});function oe(he){return!he||typeof he!="string"?!0:he.trim().length===0}const $=/{(\d+)}/g;function k(he,...ve){return ve.length===0?he:he.replace($,function(xe,Ce){const Be=parseInt(Ce,10);return isNaN(Be)||Be<0||Be>=ve.length?xe:ve[Be]})}function z(he){return he.replace(/[<>&]/g,function(ve){switch(ve){case"<":return"&lt;";case">":return"&gt;";case"&":return"&amp;";default:return ve}})}function U(he){return he.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}function L(he,ve=" "){const xe=W(he,ve);return H(xe,ve)}function W(he,ve){if(!he||!ve)return he;const xe=ve.length;if(xe===0||he.length===0)return he;let Ce=0;for(;he.indexOf(ve,Ce)===Ce;)Ce=Ce+xe;return he.substring(Ce)}function H(he,ve){if(!he||!ve)return he;const xe=ve.length,Ce=he.length;if(xe===0||Ce===0)return he;let Be=Ce,Ne=-1;for(;!(Ne=he.lastIndexOf(ve,Be-1),Ne===-1||Ne+xe!==Be);){if(Ne===0)return"";Be=Ne}return he.substring(0,Be)}function n(he){return he.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*")}function I(he){return he.replace(/\*/g,"")}function g(he,ve,xe={}){if(!he)throw new Error("Cannot create regex from empty string");ve||(he=U(he)),xe.wholeWord&&(/\B/.test(he.charAt(0))||(he="\\b"+he),/\B/.test(he.charAt(he.length-1))||(he=he+"\\b"));let Ce="";return xe.global&&(Ce+="g"),xe.matchCase||(Ce+="i"),xe.multiline&&(Ce+="m"),xe.unicode&&(Ce+="u"),new RegExp(he,Ce)}function f(he){if(he.source==="^"||he.source==="^$"||he.source==="$"||he.source==="^\\s*$")return!1;const ve=he.exec("");return!!(ve&&he.lastIndex===0)}function m(he){return(he.global?"g":"")+(he.ignoreCase?"i":"")+(he.multiline?"m":"")+(he.unicode?"u":"")}function h(he){return he.split(/\r\n|\r|\n/)}function o(he){for(let ve=0,xe=he.length;ve<xe;ve++){const Ce=he.charCodeAt(ve);if(Ce!==32&&Ce!==9)return ve}return-1}function p(he,ve=0,xe=he.length){for(let Ce=ve;Ce<xe;Ce++){const Be=he.charCodeAt(Ce);if(Be!==32&&Be!==9)return he.substring(ve,Ce)}return he.substring(ve,xe)}function l(he,ve=he.length-1){for(let xe=ve;xe>=0;xe--){const Ce=he.charCodeAt(xe);if(Ce!==32&&Ce!==9)return xe}return-1}function u(he,ve){return he<ve?-1:he>ve?1:0}function a(he,ve,xe=0,Ce=he.length,Be=0,Ne=ve.length){for(;xe<Ce&&Be<Ne;xe++,Be++){let ze=he.charCodeAt(xe),Ge=ve.charCodeAt(Be);if(ze<Ge)return-1;if(ze>Ge)return 1}const Ue=Ce-xe,He=Ne-Be;return Ue<He?-1:Ue>He?1:0}function s(he,ve){return C(he,ve,0,he.length,0,ve.length)}function C(he,ve,xe=0,Ce=he.length,Be=0,Ne=ve.length){for(;xe<Ce&&Be<Ne;xe++,Be++){let ze=he.charCodeAt(xe),Ge=ve.charCodeAt(Be);if(ze===Ge)continue;if(ze>=128||Ge>=128)return a(he.toLowerCase(),ve.toLowerCase(),xe,Ce,Be,Ne);_(ze)&&(ze-=32),_(Ge)&&(Ge-=32);const Je=ze-Ge;if(Je===0)continue;return Je}const Ue=Ce-xe,He=Ne-Be;return Ue<He?-1:Ue>He?1:0}function _(he){return he>=97&&he<=122}function w(he){return he>=65&&he<=90}function O(he,ve){return he.length===ve.length&&C(he,ve)===0}function R(he,ve){const xe=ve.length;return ve.length>he.length?!1:C(he,ve,0,xe)===0}function S(he,ve){let xe,Ce=Math.min(he.length,ve.length);for(xe=0;xe<Ce;xe++)if(he.charCodeAt(xe)!==ve.charCodeAt(xe))return xe;return Ce}function T(he,ve){let xe,Ce=Math.min(he.length,ve.length);const Be=he.length-1,Ne=ve.length-1;for(xe=0;xe<Ce;xe++)if(he.charCodeAt(Be-xe)!==ve.charCodeAt(Ne-xe))return xe;return Ce}function E(he){return 55296<=he&&he<=56319}function c(he){return 56320<=he&&he<=57343}function x(he,ve){return(he-55296<<10)+(ve-56320)+65536}function v(he,ve,xe){const Ce=he.charCodeAt(xe);if(E(Ce)&&xe+1<ve){const Be=he.charCodeAt(xe+1);if(c(Be))return x(Ce,Be)}return Ce}function y(he,ve){const xe=he.charCodeAt(ve-1);if(c(xe)&&ve>1){const Ce=he.charCodeAt(ve-2);if(E(Ce))return x(Ce,xe)}return xe}function F(he,ve){const xe=Y.getInstance(),Ce=ve,Be=he.length,Ne=v(he,Be,ve);ve+=Ne>=65536?2:1;let Ue=xe.getGraphemeBreakType(Ne);for(;ve<Be;){const He=v(he,Be,ve),ze=xe.getGraphemeBreakType(He);if(N(Ue,ze))break;ve+=He>=65536?2:1,Ue=ze}return ve-Ce}function B(he,ve){const xe=Y.getInstance(),Ce=ve,Be=y(he,ve);ve-=Be>=65536?2:1;let Ne=xe.getGraphemeBreakType(Be);for(;ve>0;){const Ue=y(he,ve),He=xe.getGraphemeBreakType(Ue);if(N(He,Ne))break;ve-=Ue>=65536?2:1,Ne=He}return Ce-ve}const A=/(?:[\u05BE\u05C0\u05C3\u05C6\u05D0-\u05F4\u0608\u060B\u060D\u061B-\u064A\u066D-\u066F\u0671-\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u0710\u0712-\u072F\u074D-\u07A5\u07B1-\u07EA\u07F4\u07F5\u07FA-\u0815\u081A\u0824\u0828\u0830-\u0858\u085E-\u08BD\u200F\uFB1D\uFB1F-\uFB28\uFB2A-\uFD3D\uFD50-\uFDFC\uFE70-\uFEFC]|\uD802[\uDC00-\uDD1B\uDD20-\uDE00\uDE10-\uDE33\uDE40-\uDEE4\uDEEB-\uDF35\uDF40-\uDFFF]|\uD803[\uDC00-\uDCFF]|\uD83A[\uDC00-\uDCCF\uDD00-\uDD43\uDD50-\uDFFF]|\uD83B[\uDC00-\uDEBB])/;function j(he){return A.test(he)}const P=/(?:[\u231A\u231B\u23F0\u23F3\u2600-\u27BF\u2B50\u2B55]|\uD83C[\uDDE6-\uDDFF\uDF00-\uDFFF]|\uD83D[\uDC00-\uDE4F\uDE80-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD00-\uDDFF\uDE70-\uDED6])/;function b(he){return P.test(he)}const V=/^[\t\n\r\x20-\x7E]*$/;function re(he){return V.test(he)}const ce=/[\u2028\u2029]/;function me(he){return ce.test(he)}function De(he){for(let ve=0,xe=he.length;ve<xe;ve++)if(we(he.charCodeAt(ve)))return!0;return!1}function we(he){return he=+he,he>=11904&&he<=55215||he>=63744&&he<=64255||he>=65281&&he<=65374}function Le(he){return he>=127462&&he<=127487||he===8986||he===8987||he===9200||he===9203||he>=9728&&he<=10175||he===11088||he===11093||he>=127744&&he<=128591||he>=128640&&he<=128764||he>=128992&&he<=129003||he>=129280&&he<=129535||he>=129648&&he<=129750}const Re=String.fromCharCode(65279);function Ie(he){return!!(he&&he.length>0&&he.charCodeAt(0)===65279)}function ye(he,ve=!1){return he?(ve&&(he=he.replace(/\\./g,"")),he.toLowerCase()!==he):!1}function X(he){const ve=90-65+1;return he=he%(2*ve),he<ve?String.fromCharCode(97+he):String.fromCharCode(65+he-ve)}function M(he){const ve=Y.getInstance();return ve.getGraphemeBreakType(he)}function N(he,ve){return he===0?ve!==5&&ve!==7:he===2&&ve===3?!1:he===4||he===2||he===3||(ve===4||ve===2||ve===3)?!0:he===8&&(ve===8||ve===9||ve===11||ve===12)||((he===11||he===9)&&(ve===9||ve===10)||((he===12||he===10)&&ve===10||(ve===5||ve===13||(ve===7||(he===1||he===13&&ve===14)))))?!1:!(he===6&&ve===6)}class Y{constructor(){this._data=ie()}static getInstance(){return Y._INSTANCE||(Y._INSTANCE=new Y),Y._INSTANCE}getGraphemeBreakType(he){if(he<32)return he===10?3:he===13?2:4;if(he<127)return 0;const ve=this._data,xe=ve.length/3;let Ce=1;for(;Ce<=xe;)if(he<ve[3*Ce])Ce=2*Ce;else if(he>ve[3*Ce+1])Ce=2*Ce+1;else return ve[3*Ce+2];return 0}}Y._INSTANCE=null;function ie(){return JSON.parse("[0,0,0,51592,51592,11,44424,44424,11,72251,72254,5,7150,7150,7,48008,48008,11,55176,55176,11,128420,128420,14,3276,3277,5,9979,9980,14,46216,46216,11,49800,49800,11,53384,53384,11,70726,70726,5,122915,122916,5,129320,129327,14,2558,2558,5,5906,5908,5,9762,9763,14,43360,43388,8,45320,45320,11,47112,47112,11,48904,48904,11,50696,50696,11,52488,52488,11,54280,54280,11,70082,70083,1,71350,71350,7,73111,73111,5,127892,127893,14,128726,128727,14,129473,129474,14,2027,2035,5,2901,2902,5,3784,3789,5,6754,6754,5,8418,8420,5,9877,9877,14,11088,11088,14,44008,44008,5,44872,44872,11,45768,45768,11,46664,46664,11,47560,47560,11,48456,48456,11,49352,49352,11,50248,50248,11,51144,51144,11,52040,52040,11,52936,52936,11,53832,53832,11,54728,54728,11,69811,69814,5,70459,70460,5,71096,71099,7,71998,71998,5,72874,72880,5,119149,119149,7,127374,127374,14,128335,128335,14,128482,128482,14,128765,128767,14,129399,129400,14,129680,129685,14,1476,1477,5,2377,2380,7,2759,2760,5,3137,3140,7,3458,3459,7,4153,4154,5,6432,6434,5,6978,6978,5,7675,7679,5,9723,9726,14,9823,9823,14,9919,9923,14,10035,10036,14,42736,42737,5,43596,43596,5,44200,44200,11,44648,44648,11,45096,45096,11,45544,45544,11,45992,45992,11,46440,46440,11,46888,46888,11,47336,47336,11,47784,47784,11,48232,48232,11,48680,48680,11,49128,49128,11,49576,49576,11,50024,50024,11,50472,50472,11,50920,50920,11,51368,51368,11,51816,51816,11,52264,52264,11,52712,52712,11,53160,53160,11,53608,53608,11,54056,54056,11,54504,54504,11,54952,54952,11,68108,68111,5,69933,69940,5,70197,70197,7,70498,70499,7,70845,70845,5,71229,71229,5,71727,71735,5,72154,72155,5,72344,72345,5,73023,73029,5,94095,94098,5,121403,121452,5,126981,127182,14,127538,127546,14,127990,127990,14,128391,128391,14,128445,128449,14,128500,128505,14,128752,128752,14,129160,129167,14,129356,129356,14,129432,129442,14,129648,129651,14,129751,131069,14,173,173,4,1757,1757,1,2274,2274,1,2494,2494,5,2641,2641,5,2876,2876,5,3014,3016,7,3262,3262,7,3393,3396,5,3570,3571,7,3968,3972,5,4228,4228,7,6086,6086,5,6679,6680,5,6912,6915,5,7080,7081,5,7380,7392,5,8252,8252,14,9096,9096,14,9748,9749,14,9784,9786,14,9833,9850,14,9890,9894,14,9938,9938,14,9999,9999,14,10085,10087,14,12349,12349,14,43136,43137,7,43454,43456,7,43755,43755,7,44088,44088,11,44312,44312,11,44536,44536,11,44760,44760,11,44984,44984,11,45208,45208,11,45432,45432,11,45656,45656,11,45880,45880,11,46104,46104,11,46328,46328,11,46552,46552,11,46776,46776,11,47000,47000,11,47224,47224,11,47448,47448,11,47672,47672,11,47896,47896,11,48120,48120,11,48344,48344,11,48568,48568,11,48792,48792,11,49016,49016,11,49240,49240,11,49464,49464,11,49688,49688,11,49912,49912,11,50136,50136,11,50360,50360,11,50584,50584,11,50808,50808,11,51032,51032,11,51256,51256,11,51480,51480,11,51704,51704,11,51928,51928,11,52152,52152,11,52376,52376,11,52600,52600,11,52824,52824,11,53048,53048,11,53272,53272,11,53496,53496,11,53720,53720,11,53944,53944,11,54168,54168,11,54392,54392,11,54616,54616,11,54840,54840,11,55064,55064,11,65438,65439,5,69633,69633,5,69837,69837,1,70018,70018,7,70188,70190,7,70368,70370,7,70465,70468,7,70712,70719,5,70835,70840,5,70850,70851,5,71132,71133,5,71340,71340,7,71458,71461,5,71985,71989,7,72002,72002,7,72193,72202,5,72281,72283,5,72766,72766,7,72885,72886,5,73104,73105,5,92912,92916,5,113824,113827,4,119173,119179,5,121505,121519,5,125136,125142,5,127279,127279,14,127489,127490,14,127570,127743,14,127900,127901,14,128254,128254,14,128369,128370,14,128400,128400,14,128425,128432,14,128468,128475,14,128489,128494,14,128715,128720,14,128745,128745,14,128759,128760,14,129004,129023,14,129296,129304,14,129340,129342,14,129388,129392,14,129404,129407,14,129454,129455,14,129485,129487,14,129659,129663,14,129719,129727,14,917536,917631,5,13,13,2,1160,1161,5,1564,1564,4,1807,1807,1,2085,2087,5,2363,2363,7,2402,2403,5,2507,2508,7,2622,2624,7,2691,2691,7,2786,2787,5,2881,2884,5,3006,3006,5,3072,3072,5,3170,3171,5,3267,3268,7,3330,3331,7,3406,3406,1,3538,3540,5,3655,3662,5,3897,3897,5,4038,4038,5,4184,4185,5,4352,4447,8,6068,6069,5,6155,6157,5,6448,6449,7,6742,6742,5,6783,6783,5,6966,6970,5,7042,7042,7,7143,7143,7,7212,7219,5,7412,7412,5,8206,8207,4,8294,8303,4,8596,8601,14,9410,9410,14,9742,9742,14,9757,9757,14,9770,9770,14,9794,9794,14,9828,9828,14,9855,9855,14,9882,9882,14,9900,9903,14,9929,9933,14,9963,9967,14,9987,9988,14,10006,10006,14,10062,10062,14,10175,10175,14,11744,11775,5,42607,42607,5,43043,43044,7,43263,43263,5,43444,43445,7,43569,43570,5,43698,43700,5,43766,43766,5,44032,44032,11,44144,44144,11,44256,44256,11,44368,44368,11,44480,44480,11,44592,44592,11,44704,44704,11,44816,44816,11,44928,44928,11,45040,45040,11,45152,45152,11,45264,45264,11,45376,45376,11,45488,45488,11,45600,45600,11,45712,45712,11,45824,45824,11,45936,45936,11,46048,46048,11,46160,46160,11,46272,46272,11,46384,46384,11,46496,46496,11,46608,46608,11,46720,46720,11,46832,46832,11,46944,46944,11,47056,47056,11,47168,47168,11,47280,47280,11,47392,47392,11,47504,47504,11,47616,47616,11,47728,47728,11,47840,47840,11,47952,47952,11,48064,48064,11,48176,48176,11,48288,48288,11,48400,48400,11,48512,48512,11,48624,48624,11,48736,48736,11,48848,48848,11,48960,48960,11,49072,49072,11,49184,49184,11,49296,49296,11,49408,49408,11,49520,49520,11,49632,49632,11,49744,49744,11,49856,49856,11,49968,49968,11,50080,50080,11,50192,50192,11,50304,50304,11,50416,50416,11,50528,50528,11,50640,50640,11,50752,50752,11,50864,50864,11,50976,50976,11,51088,51088,11,51200,51200,11,51312,51312,11,51424,51424,11,51536,51536,11,51648,51648,11,51760,51760,11,51872,51872,11,51984,51984,11,52096,52096,11,52208,52208,11,52320,52320,11,52432,52432,11,52544,52544,11,52656,52656,11,52768,52768,11,52880,52880,11,52992,52992,11,53104,53104,11,53216,53216,11,53328,53328,11,53440,53440,11,53552,53552,11,53664,53664,11,53776,53776,11,53888,53888,11,54000,54000,11,54112,54112,11,54224,54224,11,54336,54336,11,54448,54448,11,54560,54560,11,54672,54672,11,54784,54784,11,54896,54896,11,55008,55008,11,55120,55120,11,64286,64286,5,66272,66272,5,68900,68903,5,69762,69762,7,69817,69818,5,69927,69931,5,70003,70003,5,70070,70078,5,70094,70094,7,70194,70195,7,70206,70206,5,70400,70401,5,70463,70463,7,70475,70477,7,70512,70516,5,70722,70724,5,70832,70832,5,70842,70842,5,70847,70848,5,71088,71089,7,71102,71102,7,71219,71226,5,71231,71232,5,71342,71343,7,71453,71455,5,71463,71467,5,71737,71738,5,71995,71996,5,72000,72000,7,72145,72147,7,72160,72160,5,72249,72249,7,72273,72278,5,72330,72342,5,72752,72758,5,72850,72871,5,72882,72883,5,73018,73018,5,73031,73031,5,73109,73109,5,73461,73462,7,94031,94031,5,94192,94193,7,119142,119142,7,119155,119162,4,119362,119364,5,121476,121476,5,122888,122904,5,123184,123190,5,126976,126979,14,127184,127231,14,127344,127345,14,127405,127461,14,127514,127514,14,127561,127567,14,127778,127779,14,127896,127896,14,127985,127986,14,127995,127999,5,128326,128328,14,128360,128366,14,128378,128378,14,128394,128397,14,128405,128406,14,128422,128423,14,128435,128443,14,128453,128464,14,128479,128480,14,128484,128487,14,128496,128498,14,128640,128709,14,128723,128724,14,128736,128741,14,128747,128748,14,128755,128755,14,128762,128762,14,128981,128991,14,129096,129103,14,129292,129292,14,129311,129311,14,129329,129330,14,129344,129349,14,129360,129374,14,129394,129394,14,129402,129402,14,129413,129425,14,129445,129450,14,129466,129471,14,129483,129483,14,129511,129535,14,129653,129655,14,129667,129670,14,129705,129711,14,129731,129743,14,917505,917505,4,917760,917999,5,10,10,3,127,159,4,768,879,5,1471,1471,5,1536,1541,1,1648,1648,5,1767,1768,5,1840,1866,5,2070,2073,5,2137,2139,5,2307,2307,7,2366,2368,7,2382,2383,7,2434,2435,7,2497,2500,5,2519,2519,5,2563,2563,7,2631,2632,5,2677,2677,5,2750,2752,7,2763,2764,7,2817,2817,5,2879,2879,5,2891,2892,7,2914,2915,5,3008,3008,5,3021,3021,5,3076,3076,5,3146,3149,5,3202,3203,7,3264,3265,7,3271,3272,7,3298,3299,5,3390,3390,5,3402,3404,7,3426,3427,5,3535,3535,5,3544,3550,7,3635,3635,7,3763,3763,7,3893,3893,5,3953,3966,5,3981,3991,5,4145,4145,7,4157,4158,5,4209,4212,5,4237,4237,5,4520,4607,10,5970,5971,5,6071,6077,5,6089,6099,5,6277,6278,5,6439,6440,5,6451,6456,7,6683,6683,5,6744,6750,5,6765,6770,7,6846,6846,5,6964,6964,5,6972,6972,5,7019,7027,5,7074,7077,5,7083,7085,5,7146,7148,7,7154,7155,7,7222,7223,5,7394,7400,5,7416,7417,5,8204,8204,5,8233,8233,4,8288,8292,4,8413,8416,5,8482,8482,14,8986,8987,14,9193,9203,14,9654,9654,14,9733,9733,14,9745,9745,14,9752,9752,14,9760,9760,14,9766,9766,14,9774,9775,14,9792,9792,14,9800,9811,14,9825,9826,14,9831,9831,14,9852,9853,14,9872,9873,14,9880,9880,14,9885,9887,14,9896,9897,14,9906,9916,14,9926,9927,14,9936,9936,14,9941,9960,14,9974,9974,14,9982,9985,14,9992,9997,14,10002,10002,14,10017,10017,14,10055,10055,14,10071,10071,14,10145,10145,14,11013,11015,14,11503,11505,5,12334,12335,5,12951,12951,14,42612,42621,5,43014,43014,5,43047,43047,7,43204,43205,5,43335,43345,5,43395,43395,7,43450,43451,7,43561,43566,5,43573,43574,5,43644,43644,5,43710,43711,5,43758,43759,7,44005,44005,5,44012,44012,7,44060,44060,11,44116,44116,11,44172,44172,11,44228,44228,11,44284,44284,11,44340,44340,11,44396,44396,11,44452,44452,11,44508,44508,11,44564,44564,11,44620,44620,11,44676,44676,11,44732,44732,11,44788,44788,11,44844,44844,11,44900,44900,11,44956,44956,11,45012,45012,11,45068,45068,11,45124,45124,11,45180,45180,11,45236,45236,11,45292,45292,11,45348,45348,11,45404,45404,11,45460,45460,11,45516,45516,11,45572,45572,11,45628,45628,11,45684,45684,11,45740,45740,11,45796,45796,11,45852,45852,11,45908,45908,11,45964,45964,11,46020,46020,11,46076,46076,11,46132,46132,11,46188,46188,11,46244,46244,11,46300,46300,11,46356,46356,11,46412,46412,11,46468,46468,11,46524,46524,11,46580,46580,11,46636,46636,11,46692,46692,11,46748,46748,11,46804,46804,11,46860,46860,11,46916,46916,11,46972,46972,11,47028,47028,11,47084,47084,11,47140,47140,11,47196,47196,11,47252,47252,11,47308,47308,11,47364,47364,11,47420,47420,11,47476,47476,11,47532,47532,11,47588,47588,11,47644,47644,11,47700,47700,11,47756,47756,11,47812,47812,11,47868,47868,11,47924,47924,11,47980,47980,11,48036,48036,11,48092,48092,11,48148,48148,11,48204,48204,11,48260,48260,11,48316,48316,11,48372,48372,11,48428,48428,11,48484,48484,11,48540,48540,11,48596,48596,11,48652,48652,11,48708,48708,11,48764,48764,11,48820,48820,11,48876,48876,11,48932,48932,11,48988,48988,11,49044,49044,11,49100,49100,11,49156,49156,11,49212,49212,11,49268,49268,11,49324,49324,11,49380,49380,11,49436,49436,11,49492,49492,11,49548,49548,11,49604,49604,11,49660,49660,11,49716,49716,11,49772,49772,11,49828,49828,11,49884,49884,11,49940,49940,11,49996,49996,11,50052,50052,11,50108,50108,11,50164,50164,11,50220,50220,11,50276,50276,11,50332,50332,11,50388,50388,11,50444,50444,11,50500,50500,11,50556,50556,11,50612,50612,11,50668,50668,11,50724,50724,11,50780,50780,11,50836,50836,11,50892,50892,11,50948,50948,11,51004,51004,11,51060,51060,11,51116,51116,11,51172,51172,11,51228,51228,11,51284,51284,11,51340,51340,11,51396,51396,11,51452,51452,11,51508,51508,11,51564,51564,11,51620,51620,11,51676,51676,11,51732,51732,11,51788,51788,11,51844,51844,11,51900,51900,11,51956,51956,11,52012,52012,11,52068,52068,11,52124,52124,11,52180,52180,11,52236,52236,11,52292,52292,11,52348,52348,11,52404,52404,11,52460,52460,11,52516,52516,11,52572,52572,11,52628,52628,11,52684,52684,11,52740,52740,11,52796,52796,11,52852,52852,11,52908,52908,11,52964,52964,11,53020,53020,11,53076,53076,11,53132,53132,11,53188,53188,11,53244,53244,11,53300,53300,11,53356,53356,11,53412,53412,11,53468,53468,11,53524,53524,11,53580,53580,11,53636,53636,11,53692,53692,11,53748,53748,11,53804,53804,11,53860,53860,11,53916,53916,11,53972,53972,11,54028,54028,11,54084,54084,11,54140,54140,11,54196,54196,11,54252,54252,11,54308,54308,11,54364,54364,11,54420,54420,11,54476,54476,11,54532,54532,11,54588,54588,11,54644,54644,11,54700,54700,11,54756,54756,11,54812,54812,11,54868,54868,11,54924,54924,11,54980,54980,11,55036,55036,11,55092,55092,11,55148,55148,11,55216,55238,9,65056,65071,5,65529,65531,4,68097,68099,5,68159,68159,5,69446,69456,5,69688,69702,5,69808,69810,7,69815,69816,7,69821,69821,1,69888,69890,5,69932,69932,7,69957,69958,7,70016,70017,5,70067,70069,7,70079,70080,7,70089,70092,5,70095,70095,5,70191,70193,5,70196,70196,5,70198,70199,5,70367,70367,5,70371,70378,5,70402,70403,7,70462,70462,5,70464,70464,5,70471,70472,7,70487,70487,5,70502,70508,5,70709,70711,7,70720,70721,7,70725,70725,7,70750,70750,5,70833,70834,7,70841,70841,7,70843,70844,7,70846,70846,7,70849,70849,7,71087,71087,5,71090,71093,5,71100,71101,5,71103,71104,5,71216,71218,7,71227,71228,7,71230,71230,7,71339,71339,5,71341,71341,5,71344,71349,5,71351,71351,5,71456,71457,7,71462,71462,7,71724,71726,7,71736,71736,7,71984,71984,5,71991,71992,7,71997,71997,7,71999,71999,1,72001,72001,1,72003,72003,5,72148,72151,5,72156,72159,7,72164,72164,7,72243,72248,5,72250,72250,1,72263,72263,5,72279,72280,7,72324,72329,1,72343,72343,7,72751,72751,7,72760,72765,5,72767,72767,5,72873,72873,7,72881,72881,7,72884,72884,7,73009,73014,5,73020,73021,5,73030,73030,1,73098,73102,7,73107,73108,7,73110,73110,7,73459,73460,5,78896,78904,4,92976,92982,5,94033,94087,7,94180,94180,5,113821,113822,5,119141,119141,5,119143,119145,5,119150,119154,5,119163,119170,5,119210,119213,5,121344,121398,5,121461,121461,5,121499,121503,5,122880,122886,5,122907,122913,5,122918,122922,5,123628,123631,5,125252,125258,5,126980,126980,14,127183,127183,14,127245,127247,14,127340,127343,14,127358,127359,14,127377,127386,14,127462,127487,6,127491,127503,14,127535,127535,14,127548,127551,14,127568,127569,14,127744,127777,14,127780,127891,14,127894,127895,14,127897,127899,14,127902,127984,14,127987,127989,14,127991,127994,14,128000,128253,14,128255,128317,14,128329,128334,14,128336,128359,14,128367,128368,14,128371,128377,14,128379,128390,14,128392,128393,14,128398,128399,14,128401,128404,14,128407,128419,14,128421,128421,14,128424,128424,14,128433,128434,14,128444,128444,14,128450,128452,14,128465,128467,14,128476,128478,14,128481,128481,14,128483,128483,14,128488,128488,14,128495,128495,14,128499,128499,14,128506,128591,14,128710,128714,14,128721,128722,14,128725,128725,14,128728,128735,14,128742,128744,14,128746,128746,14,128749,128751,14,128753,128754,14,128756,128758,14,128761,128761,14,128763,128764,14,128884,128895,14,128992,129003,14,129036,129039,14,129114,129119,14,129198,129279,14,129293,129295,14,129305,129310,14,129312,129319,14,129328,129328,14,129331,129338,14,129343,129343,14,129351,129355,14,129357,129359,14,129375,129387,14,129393,129393,14,129395,129398,14,129401,129401,14,129403,129403,14,129408,129412,14,129426,129431,14,129443,129444,14,129451,129453,14,129456,129465,14,129472,129472,14,129475,129482,14,129484,129484,14,129488,129510,14,129536,129647,14,129652,129652,14,129656,129658,14,129664,129666,14,129671,129679,14,129686,129704,14,129712,129718,14,129728,129730,14,129744,129750,14,917504,917504,4,917506,917535,4,917632,917759,4,918000,921599,4,0,9,4,11,12,4,14,31,4,169,169,14,174,174,14,1155,1159,5,1425,1469,5,1473,1474,5,1479,1479,5,1552,1562,5,1611,1631,5,1750,1756,5,1759,1764,5,1770,1773,5,1809,1809,5,1958,1968,5,2045,2045,5,2075,2083,5,2089,2093,5,2259,2273,5,2275,2306,5,2362,2362,5,2364,2364,5,2369,2376,5,2381,2381,5,2385,2391,5,2433,2433,5,2492,2492,5,2495,2496,7,2503,2504,7,2509,2509,5,2530,2531,5,2561,2562,5,2620,2620,5,2625,2626,5,2635,2637,5,2672,2673,5,2689,2690,5,2748,2748,5,2753,2757,5,2761,2761,7,2765,2765,5,2810,2815,5,2818,2819,7,2878,2878,5,2880,2880,7,2887,2888,7,2893,2893,5,2903,2903,5,2946,2946,5,3007,3007,7,3009,3010,7,3018,3020,7,3031,3031,5,3073,3075,7,3134,3136,5,3142,3144,5,3157,3158,5,3201,3201,5,3260,3260,5,3263,3263,5,3266,3266,5,3270,3270,5,3274,3275,7,3285,3286,5,3328,3329,5,3387,3388,5,3391,3392,7,3398,3400,7,3405,3405,5,3415,3415,5,3457,3457,5,3530,3530,5,3536,3537,7,3542,3542,5,3551,3551,5,3633,3633,5,3636,3642,5,3761,3761,5,3764,3772,5,3864,3865,5,3895,3895,5,3902,3903,7,3967,3967,7,3974,3975,5,3993,4028,5,4141,4144,5,4146,4151,5,4155,4156,7,4182,4183,7,4190,4192,5,4226,4226,5,4229,4230,5,4253,4253,5,4448,4519,9,4957,4959,5,5938,5940,5,6002,6003,5,6070,6070,7,6078,6085,7,6087,6088,7,6109,6109,5,6158,6158,4,6313,6313,5,6435,6438,7,6441,6443,7,6450,6450,5,6457,6459,5,6681,6682,7,6741,6741,7,6743,6743,7,6752,6752,5,6757,6764,5,6771,6780,5,6832,6845,5,6847,6848,5,6916,6916,7,6965,6965,5,6971,6971,7,6973,6977,7,6979,6980,7,7040,7041,5,7073,7073,7,7078,7079,7,7082,7082,7,7142,7142,5,7144,7145,5,7149,7149,5,7151,7153,5,7204,7211,7,7220,7221,7,7376,7378,5,7393,7393,7,7405,7405,5,7415,7415,7,7616,7673,5,8203,8203,4,8205,8205,13,8232,8232,4,8234,8238,4,8265,8265,14,8293,8293,4,8400,8412,5,8417,8417,5,8421,8432,5,8505,8505,14,8617,8618,14,9000,9000,14,9167,9167,14,9208,9210,14,9642,9643,14,9664,9664,14,9728,9732,14,9735,9741,14,9743,9744,14,9746,9746,14,9750,9751,14,9753,9756,14,9758,9759,14,9761,9761,14,9764,9765,14,9767,9769,14,9771,9773,14,9776,9783,14,9787,9791,14,9793,9793,14,9795,9799,14,9812,9822,14,9824,9824,14,9827,9827,14,9829,9830,14,9832,9832,14,9851,9851,14,9854,9854,14,9856,9861,14,9874,9876,14,9878,9879,14,9881,9881,14,9883,9884,14,9888,9889,14,9895,9895,14,9898,9899,14,9904,9905,14,9917,9918,14,9924,9925,14,9928,9928,14,9934,9935,14,9937,9937,14,9939,9940,14,9961,9962,14,9968,9973,14,9975,9978,14,9981,9981,14,9986,9986,14,9989,9989,14,9998,9998,14,10000,10001,14,10004,10004,14,10013,10013,14,10024,10024,14,10052,10052,14,10060,10060,14,10067,10069,14,10083,10084,14,10133,10135,14,10160,10160,14,10548,10549,14,11035,11036,14,11093,11093,14,11647,11647,5,12330,12333,5,12336,12336,14,12441,12442,5,12953,12953,14,42608,42610,5,42654,42655,5,43010,43010,5,43019,43019,5,43045,43046,5,43052,43052,5,43188,43203,7,43232,43249,5,43302,43309,5,43346,43347,7,43392,43394,5,43443,43443,5,43446,43449,5,43452,43453,5,43493,43493,5,43567,43568,7,43571,43572,7,43587,43587,5,43597,43597,7,43696,43696,5,43703,43704,5,43713,43713,5,43756,43757,5,43765,43765,7,44003,44004,7,44006,44007,7,44009,44010,7,44013,44013,5,44033,44059,12,44061,44087,12,44089,44115,12,44117,44143,12,44145,44171,12,44173,44199,12,44201,44227,12,44229,44255,12,44257,44283,12,44285,44311,12,44313,44339,12,44341,44367,12,44369,44395,12,44397,44423,12,44425,44451,12,44453,44479,12,44481,44507,12,44509,44535,12,44537,44563,12,44565,44591,12,44593,44619,12,44621,44647,12,44649,44675,12,44677,44703,12,44705,44731,12,44733,44759,12,44761,44787,12,44789,44815,12,44817,44843,12,44845,44871,12,44873,44899,12,44901,44927,12,44929,44955,12,44957,44983,12,44985,45011,12,45013,45039,12,45041,45067,12,45069,45095,12,45097,45123,12,45125,45151,12,45153,45179,12,45181,45207,12,45209,45235,12,45237,45263,12,45265,45291,12,45293,45319,12,45321,45347,12,45349,45375,12,45377,45403,12,45405,45431,12,45433,45459,12,45461,45487,12,45489,45515,12,45517,45543,12,45545,45571,12,45573,45599,12,45601,45627,12,45629,45655,12,45657,45683,12,45685,45711,12,45713,45739,12,45741,45767,12,45769,45795,12,45797,45823,12,45825,45851,12,45853,45879,12,45881,45907,12,45909,45935,12,45937,45963,12,45965,45991,12,45993,46019,12,46021,46047,12,46049,46075,12,46077,46103,12,46105,46131,12,46133,46159,12,46161,46187,12,46189,46215,12,46217,46243,12,46245,46271,12,46273,46299,12,46301,46327,12,46329,46355,12,46357,46383,12,46385,46411,12,46413,46439,12,46441,46467,12,46469,46495,12,46497,46523,12,46525,46551,12,46553,46579,12,46581,46607,12,46609,46635,12,46637,46663,12,46665,46691,12,46693,46719,12,46721,46747,12,46749,46775,12,46777,46803,12,46805,46831,12,46833,46859,12,46861,46887,12,46889,46915,12,46917,46943,12,46945,46971,12,46973,46999,12,47001,47027,12,47029,47055,12,47057,47083,12,47085,47111,12,47113,47139,12,47141,47167,12,47169,47195,12,47197,47223,12,47225,47251,12,47253,47279,12,47281,47307,12,47309,47335,12,47337,47363,12,47365,47391,12,47393,47419,12,47421,47447,12,47449,47475,12,47477,47503,12,47505,47531,12,47533,47559,12,47561,47587,12,47589,47615,12,47617,47643,12,47645,47671,12,47673,47699,12,47701,47727,12,47729,47755,12,47757,47783,12,47785,47811,12,47813,47839,12,47841,47867,12,47869,47895,12,47897,47923,12,47925,47951,12,47953,47979,12,47981,48007,12,48009,48035,12,48037,48063,12,48065,48091,12,48093,48119,12,48121,48147,12,48149,48175,12,48177,48203,12,48205,48231,12,48233,48259,12,48261,48287,12,48289,48315,12,48317,48343,12,48345,48371,12,48373,48399,12,48401,48427,12,48429,48455,12,48457,48483,12,48485,48511,12,48513,48539,12,48541,48567,12,48569,48595,12,48597,48623,12,48625,48651,12,48653,48679,12,48681,48707,12,48709,48735,12,48737,48763,12,48765,48791,12,48793,48819,12,48821,48847,12,48849,48875,12,48877,48903,12,48905,48931,12,48933,48959,12,48961,48987,12,48989,49015,12,49017,49043,12,49045,49071,12,49073,49099,12,49101,49127,12,49129,49155,12,49157,49183,12,49185,49211,12,49213,49239,12,49241,49267,12,49269,49295,12,49297,49323,12,49325,49351,12,49353,49379,12,49381,49407,12,49409,49435,12,49437,49463,12,49465,49491,12,49493,49519,12,49521,49547,12,49549,49575,12,49577,49603,12,49605,49631,12,49633,49659,12,49661,49687,12,49689,49715,12,49717,49743,12,49745,49771,12,49773,49799,12,49801,49827,12,49829,49855,12,49857,49883,12,49885,49911,12,49913,49939,12,49941,49967,12,49969,49995,12,49997,50023,12,50025,50051,12,50053,50079,12,50081,50107,12,50109,50135,12,50137,50163,12,50165,50191,12,50193,50219,12,50221,50247,12,50249,50275,12,50277,50303,12,50305,50331,12,50333,50359,12,50361,50387,12,50389,50415,12,50417,50443,12,50445,50471,12,50473,50499,12,50501,50527,12,50529,50555,12,50557,50583,12,50585,50611,12,50613,50639,12,50641,50667,12,50669,50695,12,50697,50723,12,50725,50751,12,50753,50779,12,50781,50807,12,50809,50835,12,50837,50863,12,50865,50891,12,50893,50919,12,50921,50947,12,50949,50975,12,50977,51003,12,51005,51031,12,51033,51059,12,51061,51087,12,51089,51115,12,51117,51143,12,51145,51171,12,51173,51199,12,51201,51227,12,51229,51255,12,51257,51283,12,51285,51311,12,51313,51339,12,51341,51367,12,51369,51395,12,51397,51423,12,51425,51451,12,51453,51479,12,51481,51507,12,51509,51535,12,51537,51563,12,51565,51591,12,51593,51619,12,51621,51647,12,51649,51675,12,51677,51703,12,51705,51731,12,51733,51759,12,51761,51787,12,51789,51815,12,51817,51843,12,51845,51871,12,51873,51899,12,51901,51927,12,51929,51955,12,51957,51983,12,51985,52011,12,52013,52039,12,52041,52067,12,52069,52095,12,52097,52123,12,52125,52151,12,52153,52179,12,52181,52207,12,52209,52235,12,52237,52263,12,52265,52291,12,52293,52319,12,52321,52347,12,52349,52375,12,52377,52403,12,52405,52431,12,52433,52459,12,52461,52487,12,52489,52515,12,52517,52543,12,52545,52571,12,52573,52599,12,52601,52627,12,52629,52655,12,52657,52683,12,52685,52711,12,52713,52739,12,52741,52767,12,52769,52795,12,52797,52823,12,52825,52851,12,52853,52879,12,52881,52907,12,52909,52935,12,52937,52963,12,52965,52991,12,52993,53019,12,53021,53047,12,53049,53075,12,53077,53103,12,53105,53131,12,53133,53159,12,53161,53187,12,53189,53215,12,53217,53243,12,53245,53271,12,53273,53299,12,53301,53327,12,53329,53355,12,53357,53383,12,53385,53411,12,53413,53439,12,53441,53467,12,53469,53495,12,53497,53523,12,53525,53551,12,53553,53579,12,53581,53607,12,53609,53635,12,53637,53663,12,53665,53691,12,53693,53719,12,53721,53747,12,53749,53775,12,53777,53803,12,53805,53831,12,53833,53859,12,53861,53887,12,53889,53915,12,53917,53943,12,53945,53971,12,53973,53999,12,54001,54027,12,54029,54055,12,54057,54083,12,54085,54111,12,54113,54139,12,54141,54167,12,54169,54195,12,54197,54223,12,54225,54251,12,54253,54279,12,54281,54307,12,54309,54335,12,54337,54363,12,54365,54391,12,54393,54419,12,54421,54447,12,54449,54475,12,54477,54503,12,54505,54531,12,54533,54559,12,54561,54587,12,54589,54615,12,54617,54643,12,54645,54671,12,54673,54699,12,54701,54727,12,54729,54755,12,54757,54783,12,54785,54811,12,54813,54839,12,54841,54867,12,54869,54895,12,54897,54923,12,54925,54951,12,54953,54979,12,54981,55007,12,55009,55035,12,55037,55063,12,55065,55091,12,55093,55119,12,55121,55147,12,55149,55175,12,55177,55203,12,55243,55291,10,65024,65039,5,65279,65279,4,65520,65528,4,66045,66045,5,66422,66426,5,68101,68102,5,68152,68154,5,68325,68326,5,69291,69292,5,69632,69632,7,69634,69634,7,69759,69761,5]")}function K(he,ve){if(he===0)return 0;const xe=pe(he,ve);if(xe!==void 0)return xe;const Ce=y(ve,he);return he-=Se(Ce),he}function pe(he,ve){let xe=y(ve,he);for(he-=Se(xe);Pe(xe)||xe===65039||xe===8419;){if(he===0)return;xe=y(ve,he),he-=Se(xe)}if(!Le(xe))return;if(he>=0){const Ce=y(ve,he);Ce===8205&&(he-=Se(Ce))}return he}function Se(he){return he>=65536?2:1}function Pe(he){return 127995<=he&&he<=127999}},Ot1p:function(tt,Ee,J){"use strict";var oe=J("2qtc"),$=J("kLXV"),k=J("rAM+"),z=J("miYZ"),U=J("tsqr"),L=J("9og8"),W=J("tJVT"),H=J("jrin"),n=J("WmNS"),I=J.n(n),g=J("q1tI"),f=J.n(g),m=J("VrN/"),h=J.n(m),o=J("bdgK"),p=J("p77/"),l=J("Bd2K"),u=J("ELLl"),a=J("19Vz"),s=J("lZu9"),C=J("+NIl"),_=J("kSUc"),w=J("9Bee"),O=function(be){var Te=be.value,Me=Te===void 0?"":Te,je=be.className,nt=be.showTextOnly,it=be.showLines,Tt=be.style,ot=Tt===void 0?{}:Tt,$e=Object(g.useMemo)(function(){return""},[Me]);return f.a.createElement(f.a.Fragment,null,f.a.createElement("div",{dangerouslySetInnerHTML:{__html:$e}}))},R=J("0Owb"),S=J("dejd"),T=J("C+DQ"),E=J("1vsH"),c=J("m3rI"),x=[{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 v(be){var Te=be.onActionCallback,Me=be.title,je=be.icon,nt=be.actionName,it=be.className,Tt=it===void 0?"":it,ot=be.children;function $e(){Te(nt)}return f.a.createElement("a",{title:Me,className:Tt,onClick:$e},f.a.createElement("i",{className:"md-iconfont ".concat(je)}),ot)}var y=function(be){var Te=be.watch,Me=be.showNullButton,je=be.onActionCallback,nt=be.fullScreen,it=be.insertTemp,Tt=be.hidetoolBar,ot=be.uuid,$e=be.setOpenPhones;console.log("link:","".concat(location.origin,"/upload.html?_educoder_session_login=").concat(Object(E.F)("_educoder_session_login"),"&_educoder_session=").concat(Object(E.F)("_educoder_session"),"&key=").concat(ot,"&api=").concat(encodeURIComponent(c.a.PROXY_SERVER)));var yt=[].concat(x,[{title:"".concat(Te?"\u5173\u95ED\u5B9E\u65F6\u9884\u89C8":"\u5F00\u542F\u5B9E\u65F6\u9884\u89C8"),icon:"".concat(Te?"icon-eye-slash":"icon-eye"),actionName:"trigger-watch"}]);return f.a.createElement("ul",{className:"markdown-toolbar-container"},!Tt&&yt.map(function(lt,Rt){return f.a.createElement("li",{key:Rt},lt.actionName?f.a.createElement(v,Object(R.a)({},lt,{onActionCallback:je})):f.a.createElement("span",{className:"v-line"}))}),Me?f.a.createElement("li",null,f.a.createElement(v,{icon:"icon-edit",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-null-ch",onActionCallback:je},f.a.createElement("span",{className:"fill-tip"},"\u70B9\u51FB\u63D2\u5165\b\u586B\u7A7A\u9879"))):null,it&&f.a.createElement("li",null,f.a.createElement(v,{icon:"icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:"inster-template-".concat(it),onActionCallback:je},f.a.createElement("span",{className:"fill-tip"},"\u63D2\u5165\u6A21\u677F"))),f.a.createElement("li",{className:"btn-full-screen"},f.a.createElement(v,{icon:"".concat(nt?"icon-shrink":"icon-enlarge"),title:nt?"\u5173\u95ED\u5168\u5C4F":"\u5F00\u542F\u5168\u5C4F",actionName:"trigger-full-screen",onActionCallback:je})))},F=J("M8RZ"),B=J("+L6B"),A=J("2/Rp"),j=J("y8nQ"),P=J("Vl3Y"),b=J("5NDa"),V=J("5rEg"),re={labelCol:{span:4},wrapperCol:{span:20}},ce=function(be){var Te=be.callback,Me=be.onCancel;function je(nt){Te(nt)}return f.a.createElement(P.a,Object(R.a)({},re,{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:je}),f.a.createElement(P.a.Item,{label:"\u94FE\u63A5\u5730\u5740",name:"link",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740"}]},f.a.createElement(V.a,null)),f.a.createElement(P.a.Item,{label:"\u94FE\u63A5\u6807\u9898",name:"title",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u6807\u9898"}]},f.a.createElement(V.a,null)),f.a.createElement("div",{className:"flex-container flex-end"},f.a.createElement(A.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),f.a.createElement(A.a,{type:"ghost",onClick:Me},"\u53D6\u6D88")))},me=J("7ahc"),De=J("HmJG"),we=J("BjJ7"),Le=P.a.useForm,Re={width:280,marginRight:10},Ie={labelCol:{span:5},wrapperCol:{span:19}},ye=function(be){var Te=be.callback,Me=be.onCancel,je=Le(),nt=Object(W.a)(je,1),it=nt[0];function Tt(yt){Te(yt)}function ot(yt,lt){if(yt.status===-1){U.b.error(yt.message);return}it.setFieldsValue({src:"/api/attachments/".concat(yt.id),type:lt.type})}function $e(yt){var lt=yt.target.files[0];M(lt,ot)}return f.a.createElement(P.a,Object(R.a)({form:it},Ie,{className:"upload-image-panel",onFinish:Tt}),f.a.createElement(P.a.Item,{label:"\u56FE\u7247\u5730\u5740",required:!0},f.a.createElement("div",{className:"flex-container"},f.a.createElement(P.a.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u56FE\u7247\u5730\u5740"}]},f.a.createElement(V.a,{style:Re})),f.a.createElement(X,{onFileChange:$e}))),f.a.createElement(P.a.Item,{label:"\u56FE\u7247\u63CF\u8FF0",name:"alt"},f.a.createElement(V.a,{style:{width:264}})),f.a.createElement(P.a.Item,{style:{textAlign:"right"}},f.a.createElement(A.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),f.a.createElement(A.a,{type:"ghost",onClick:Me},"\u53D6\u6D88")))};function X(be){var Te=be.onFileChange;return f.a.createElement("a",{className:"upload-button"},"\u672C\u5730\u4E0A\u4F20",f.a.createElement("input",{type:"file",onChange:Te}))}function M(be,Te){if(!be)throw new String("\u6CA1\u6709\u6587\u4EF6");var Me=new FormData;Me.append("editormd-image-file",be),Me.append("file_param_name","editormd-image-file"),Me.append("byxhr","true");var je=new window.XMLHttpRequest;je.withCredentials=!0,je.addEventListener("load",function(nt){Te(JSON.parse(nt.target.responseText),be)},!1),je.addEventListener("error",function(nt){console.error(nt)},!1),je.open("POST","".concat(we.a,"/api/attachments.json")),je.send(Me)}var N=J("giR+"),Y=J("fyUT"),ie=J("7Kak"),K=J("9yH6"),pe=K.a.Group,Se={margin:"0 8px"},Pe=function(be){var Te=be.callback,Me=be.onCancel;function je(nt){Te(nt)}return f.a.createElement(P.a,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:je},f.a.createElement("div",{className:"flex-container",style:{alignItems:"baseline"}},f.a.createElement("span",{style:Se},"\u5355\u5143\u683C\u6570\uFF1A"),f.a.createElement("span",{style:Se},"\u884C\u6570"),f.a.createElement(P.a.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},f.a.createElement(Y.a,null)),f.a.createElement("span",{style:Se},"\u5217\u6570"),f.a.createElement(P.a.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},f.a.createElement(Y.a,null))),f.a.createElement("div",{className:"flex-container",style:{marginTop:12,alignItems:"baseline"}},f.a.createElement("span",{style:Se},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),f.a.createElement(P.a.Item,{name:"align"},f.a.createElement(pe,null,f.a.createElement(K.a,{value:"default"},f.a.createElement("i",{className:"fa fa-align-justify"})),f.a.createElement(K.a,{value:"left"},f.a.createElement("i",{className:"fa fa-align-left"})),f.a.createElement(K.a,{value:"center"},f.a.createElement("i",{className:"fa fa-align-center"})),f.a.createElement(K.a,{value:"right"},f.a.createElement("i",{className:"fa fa-align-right"}))))),f.a.createElement("div",{className:"flex-container flex-end"},f.a.createElement(A.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),f.a.createElement(A.a,{type:"ghost",onClick:Me},"\u53D6\u6D88")))},he=J("ErOA"),ve=J("7Cbv"),xe="link",Ce="upload-image",Be="code-block",Ne="add-table",Ue="------------",He={default:Ue,left:":".concat(Ue),center:":".concat(Ue,":"),right:"".concat(Ue,":")},ze=J("9VGf"),Ge,Je;function ke(){}var Qe=0,Ze=1e4,le="\u2581",Z=`
**\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 q(be){return/^\d+$/.test(be)?"".concat(be,"px"):be}var ae=navigator.platform.toUpperCase().indexOf("MAC")>=0,ue=ae?"Cmd":"Ctrl",ne=["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"],te=(Ge={},Object(H.a)(Ge,ue+"-B","bold"),Object(H.a)(Ge,ue+"-I","italic"),Ge),de=(Je={},Object(H.a)(Je,xe,"\u6DFB\u52A0\u94FE\u63A5"),Object(H.a)(Je,Be,"\u6DFB\u52A0\u4EE3\u7801\u5757"),Object(H.a)(Je,Ce,"\u6DFB\u52A0\u6587\u4EF6"),Object(H.a)(Je,Ne,"\u6DFB\u52A0\u8868\u683C"),Je),fe=Ee.a=function(be){var Te=be.defaultValue,Me=Te===void 0?"":Te,je=be.onChange,nt=be.width,it=nt===void 0?"100%":nt,Tt=be.height,ot=Tt===void 0?400:Tt,$e=be.miniToolbar,yt=$e===void 0?!1:$e,lt=be.isFocus,Rt=lt===void 0?!1:lt,Ct=be.watch,bt=be.insertTemp,Qt=be.mode,zt=Qt===void 0?"markdown":Qt,Gt=be.id,jt=Gt===void 0?"markdown-editor-id":Gt,gt=be.showResizeBar,wt=gt===void 0?!1:gt,At=be.noStorage,Bt=At===void 0?!1:At,an=be.showNullButton,ut=an===void 0?!1:an,Ye=be.hidetoolBar,Et=Ye===void 0?!1:Ye,dt=be.fullScreen,rt=dt===void 0?!1:dt,pt=be.onBlur,ft=be.onCMBeforeChange,Vt=be.onFullScreen,Ht=be.className,Ke=Ht===void 0?"":Ht,_t=be.disablePaste,ii=_t===void 0?!1:_t,_i=be.placeholder,Ei=_i===void 0?"":_i,ri=be.values,xi=ri===void 0?"":ri,St=Object(g.useState)(null),Ar=Object(W.a)(St,2),Ve=Ar[0],Ti=Ar[1],Cn=Object(g.useState)(Me),Vi=Object(W.a)(Cn,2),ai=Vi[0],Rn=Vi[1],Xi=Object(g.useState)(Ct),Yi=Object(W.a)(Xi,2),On=Yi[0],$i=Yi[1],Rr=Object(g.useState)(rt),Ji=Object(W.a)(Rr,2),Ln=Ji[0],Or=Ji[1],aa=Object(g.useState)(""),Qi=Object(W.a)(aa,2),dn=Qi[0],Xn=Qi[1],sa=Object(g.useState)(0),si=Object(W.a)(sa,2),In=si[0],Zi=si[1],oa=Object(g.useState)(ot),Lr=Object(W.a)(oa,2),Ir=Lr[0],wi=Lr[1],Dr=Object(g.useState)(!1),kr=Object(W.a)(Dr,2),la=kr[0],Si=kr[1],oi=Object(g.useRef)(Object(ve.a)()),li=Object(g.useRef)(!1),Ci=Object(g.useRef)(),jn=Object(g.useRef)(),Hn=Object(g.useRef)(),Wn=Object(g.useRef)(),Ai=Object(g.useRef)(),Mr=function(){var ht=Object(L.a)(I.a.mark(function xt(){var mt,Lt;return I.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:oi.current}});case 2:Lt=Ft.sent,Lt!=null&&(mt=Lt.attachments)!==null&&mt!==void 0&&mt.length&&(console.log("cm:",Ve,jn),Lt.attachments.map(function(Dt){Dt.content_type.indexOf("image")>-1?Ve.replaceSelection("![,](/api/attachments/".concat(Dt.id,"?type=").concat(Dt.content_type,")")):Dt.content_type.indexOf("video")>-1?Ve.replaceSelection('<video width="100%" controls src="'.concat(c.a.API_SERVER,"/api/attachments/").concat(data.id,'"></video>')):Dt.content_type.indexOf("pdf")>-1?Ve.replaceSelection('<a href="'.concat(c.a.API_SERVER,"/api/attachments/").concat(Dt.id,"?type=").concat(Dt.content_type,'&disposition=inline" target="_blank">').concat(Dt.name,"</a>")):Ve.replaceSelection("[".concat(Dt.name,"](").concat(c.a.API_SERVER,"/api/attachments/").concat(Dt.id,"?type=").concat(Dt.content_type,")"))}));case 4:case"end":return Ft.stop()}},xt)}));return function(){return ht.apply(this,arguments)}}();Object(g.useEffect)(function(){Rn(xi),Ve==null||Ve.setValue(xi)},[xi]),Object(g.useEffect)(function(){Vt==null||Vt(Ln)},[Ln]),Object(g.useEffect)(function(){if(jn.current){var ht=h.a.fromTextArea(jn.current,{mode:zt,lineNumbers:!yt,lineWrapping:!0,value:Me,autoCloseTags:!0,autoCloseBrackets:!0});Rt&&ht.focus();function xt(mt,Lt){if(ii){Lt.preventDefault();return}var kt=Lt.clipboardData;if(kt){var Ft=kt.types.toString(),Dt=kt.items;if(Ft==="Files"||kt.types.indexOf("Files")>-1){if(Lt.preventDefault(),zt=="stex")return;try{var Zt,pn=Dt[1];((Zt=Dt[0])===null||Zt===void 0?void 0:Zt.kind)==="file"&&(pn=Dt[0]);var It=pn.getAsFile(),Gn=It.name.split(".").pop();M(It,function(Mt){if(Mt.id){var mn,ln,An;(It==null||((mn=It.type)===null||mn===void 0)?void 0:mn.indexOf("image"))>-1?ht.replaceSelection("![,](/api/attachments/".concat(Mt.id,"?type=").concat(Mt.content_type,")")):(It==null||((ln=It.type)===null||ln===void 0)?void 0:ln.indexOf("video"))>-1?ht.replaceSelection('<video width="100%" controls src="'.concat(c.a.API_SERVER,"/api/attachments/").concat(Mt.id,'"></video>')):(It==null||((An=It.type)===null||An===void 0)?void 0:An.indexOf("pdf"))>-1?ht.replaceSelection('<a href="'.concat(c.a.API_SERVER,"/api/attachments/").concat(Mt.id,"?type=").concat(It.type,'&disposition=inline" target="_blank">').concat(It.name,"</a>")):ne.includes(Gn)?ht.replaceSelection('<a href="'.concat(c.a.API_SERVER,"/api/attachments/").concat(Mt.id,'?type=office&disposition=inline" target="_blank">').concat(It.name,"</a>")):ht.replaceSelection("[".concat(It.name,"](").concat(c.a.API_SERVER,"/api/attachments/").concat(Mt.id,"?type=").concat(Mt.content_type,")"))}else(Mt==null?void 0:Mt.status)===401&&(document.location.href="/user/login")})}catch(Mt){U.b.warn("\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668\u7C98\u8D34")}return!0}else return!0}return!0}return ht.on("paste",xt),ht.on("dragleave",function(mt,Lt){Hn.current.classList.remove("mouse-hover-md")}),ht.on("dragover",function(mt,Lt){Hn.current.classList.add("mouse-hover-md")}),ht.on("drop",function(mt,Lt){Hn.current.classList.add("mouse-hover-md");var kt;if(kt=Lt.dataTransfer.files,kt.length>0){Lt.preventDefault(),Lt.stopPropagation();for(var Ft=function(pn){var It=kt[pn],Gn=It.name.split(".").pop();M(It,function(Mt){if(Mt.id){var mn,ln,An;(It==null||((mn=It.type)===null||mn===void 0)?void 0:mn.indexOf("image"))>-1?ht.replaceSelection("![,](/api/attachments/".concat(Mt.id,"?type=").concat(Mt.content_type,")")):(It==null||((ln=It.type)===null||ln===void 0)?void 0:ln.indexOf("video"))>-1?ht.replaceSelection('<video width="100%" controls src="'.concat(c.a.API_SERVER,"/api/attachments/").concat(Mt.id,'"></video>')):(It==null||((An=It.type)===null||An===void 0)?void 0:An.indexOf("pdf"))>-1?ht.replaceSelection('<a href="'.concat(c.a.API_SERVER,"/api/attachments/").concat(Mt.id,"?type=").concat(It.type,'&disposition=inline" target="_blank">').concat(It.name,"</a>")):ne.includes(Gn)?ht.replaceSelection('<a href="'.concat(c.a.API_SERVER,"/api/attachments/").concat(Mt.id,'?type=office&disposition=inline" target="_blank">').concat(It.name,"</a>")):ht.replaceSelection("[".concat(It.name,"](").concat(c.a.API_SERVER,"/api/attachments/").concat(Mt.id,"?type=").concat(Mt.content_type,")"))}else(Mt==null?void 0:Mt.status)===401&&(document.location.href="/user/login")})},Dt=0;Dt<kt.length;Dt++)Ft(Dt)}}),Ti(ht),function(){ht.off("paste",xt)}}},[]);var Tn=Object(g.useCallback)(function(){if(Hn.current)try{}catch(ht){console.log(ht,"---- to set md editor body height")}},[Ir,Hn,Ln]);Object(g.useEffect)(function(){function ht(){var mt=new o.default(function(Lt){var kt=Object(k.a)(Lt),Ft;try{for(kt.s();!(Ft=kt.n()).done;){var Dt=Ft.value;(Dt.target.offsetHeight>0||Dt.target.offsetWidth>0)&&(Tn(),Ve.setSize("100%","100%"),Ve.refresh())}}catch(Zt){kt.e(Zt)}finally{kt.f()}});return mt.observe(jn.current.parentElement),mt}if(Ve){var xt=ht();return function(){xt.unobserve(jn.current.parentElement)}}},[Ve,Tn]),Object(g.useEffect)(function(){if(Ve){for(var ht=[],xt=function(){var Dt=Lt[mt];kt=Object(W.a)(Dt,2);var Zt=kt[0],pn=kt[1],It=Object(H.a)({},Zt,function(){Pr(pn)});ht.push(It),Ve.addKeyMap(It)},mt=0,Lt=Object.entries(te);mt<Lt.length;mt++){var kt;xt()}return Ci.current=setInterval(function(){li.current&&Mr()},4e3),function(){clearInterval(Ci.current);var Ft=Object(k.a)(ht),Dt;try{for(Ft.s();!(Dt=Ft.n()).done;){var Zt=Dt.value;Ve.removeKeyMap(Zt)}}catch(pn){Ft.e(pn)}finally{Ft.f()}}}},[Ve]),Object(g.useEffect)(function(){rt!==Ln&&Or(rt)},[rt]),Object(ze.a)(function(){if(!Bt&&In>0){var ht=new Date().getTime(),xt=window.sessionStorage.getItem(jt);ht>=In+Ze&&(!xt||xt!==ai)&&(window.sessionStorage.setItem(jt,ai),Si(!0))}},Ze),Object(g.useEffect)(function(){$i(Ct)},[Ve,Ct]),Object(g.useEffect)(function(){Ve&&(Rt&&Ve.focus())},[Ve,Rt]),Object(g.useEffect)(function(){if(On&&Ve){var ht=Ve.getScrollerElement();function xt(mt){var Lt=mt.target;if(Ai.current){var kt=Lt.scrollTop/Lt.scrollHeight;Ai.current.scrollTop=Ai.current.scrollHeight*kt}}return ht.addEventListener("scroll",xt),function(){ht.removeEventListener("scroll",xt)}}},[Ve,On]),Object(g.useEffect)(function(){if(Ve&&ft){function ht(xt,mt){ft(xt,mt)}return Ve.on("beforeChange",ht),function(){Ve.off("beforeChange",ht)}}},[Ve,ft]),Object(g.useEffect)(function(){if(Ve&&pt){function ht(){pt(Ve.getValue())}return Ve.on("blur",ht),function(){Ve.off("blur",ht)}}},[Ve,pt]),Object(g.useEffect)(function(){if(Ve){function ht(xt){var mt=xt.getValue();Rn(mt),Zi(new Date().getTime()),xt.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),je&&je(mt)}return Ve.on("change",ht),function(){Ve.off("change",ht)}}},[Ve,je]),Object(g.useEffect)(function(){Ve&&(Me==null?(Ve.setValue(""),Rn("")):Me!==Ve.getValue()&&(Ve.setValue(Me),Rn(Me),Ve.setCursor(Ve.lineCount(),0)))},[Ve,Me]);var Pr=Object(g.useCallback)(function(ht){var xt=Ve.getCursor(),mt=Ve.getSelection(),Lt=mt.split(`
`);switch(ht){case"bold":return Ve.replaceSelection("**"+mt+"**"),mt===""&&Ve.setCursor(xt.line,xt.ch+2),Ve.focus();case"italic":return Ve.replaceSelection("*"+mt+"*"),mt===""&&Ve.setCursor(xt.line,xt.ch+1),Ve.focus();case"code":return Ve.replaceSelection("`"+mt+"`"),mt===""&&Ve.setCursor(xt.line,xt.ch+1),Ve.focus();case"inline-latex":return Ve.replaceSelection("`$$"+mt+"$$`"),mt===""&&Ve.setCursor(xt.line,xt.ch+3),Ve.focus();case"latex":return Ve.replaceSelection("```latex\n"+mt+"\n```"),Ve.setCursor(xt.line+1,mt.length+1),Ve.focus();case"line-break":return Ve.replaceSelection(`<br/>
`),Ve.focus();case"list-ul":return mt===""?Ve.replaceSelection("- "+mt):Ve.replaceSelection(Lt.map(function(kt){return kt===""?"":"- ".concat(kt)}).join(`
`)),Ve.focus();case"list-ol":return mt===""?Ve.replaceSelection("1. "+mt):Ve.replaceSelection(Lt.map(function(kt,Ft){return kt===""?"":"".concat(Ft+1,". ").concat(kt)}).join(`
`)),Ve.focus();case"add-null-ch":return mt===""&&Ve.setCursor(xt.line,xt.ch+1),Ve.replaceSelection(le),Ve.focus();case"inster-template-1":return mt===""&&Ve.setCursor(xt.line,xt.ch),Ve.replaceSelection(Z),Ve.focus();case"eraser":return Ve.setValue(""),Ve.focus();case"trigger-watch":return $i(!On),Ve.focus();case"trigger-full-screen":return Or(!Ln),Ve.focus();case xe:Xn(xe);return;case Be:Xn(Be);return;case Ce:Xn(Ce);return;case Ne:Xn(Ne);return;default:throw new Error}},[Ve,On,Ln]),Ri=Object(g.useCallback)(function(ht){Xn("");switch(dn){case xe:var xt=ht.title,mt=ht.link;return Ve.replaceSelection("[".concat(xt,"](").concat(mt,")")),Ve.focus();case Be:var Lt=ht.language,kt=ht.content;return Ve.replaceSelection(["```"+Lt,kt,"```"].join(`
`)),Ve.focus();case Ce:var Ft=ht.src,Dt=ht.alt;return Dt?Ve.replaceSelection("![ ".concat(Dt," ]( ").concat(Ft,' "').concat(Dt,'" )')):Ve.replaceSelection("![,](".concat(Ft,")")),Ve.focus();case Ne:for(var Zt=ht.row,pn=ht.col,It=ht.align,Gn=`
`,Mt=0;Mt<Zt;Mt++){for(var mn=[],ln=[],An=0;An<pn;An++)Mt===1&&ln.push(He[It]),mn.push(" ");Mt===1&&(Gn+="| ".concat(ln.join(" | "),` |
`)),Gn+="| ".concat(mn.join(pn===1?"":" | "),` |
`)}return Ve.replaceSelection(Gn+`
`),Ve.focus();default:throw new Error}},[Ve,dn]),qi=Object(g.useMemo)(function(){switch(dn){case xe:return f.a.createElement(ce,{callback:Ri,onCancel:Yn});case Be:return f.a.createElement(me.b,{callback:Ri,onCancel:Yn});case Ce:return f.a.createElement(ye,{callback:Ri,onCancel:Yn});case Ne:return f.a.createElement(Pe,{callback:Ri,onCancel:Yn});default:return null}},[dn]);function Yn(){Xn("")}Object(g.useEffect)(function(){if(Wn.current){var ht=Wn.current,xt=!1,mt=0;function Lt(Dt){xt=!0,mt=Dt.pageY}function kt(){xt=!1}function Ft(Dt){if(xt){var Zt=Dt.pageY-mt;Zt<0&&(Zt=0),Zt>300&&(Zt=300);var pn=ot+Zt+"px";wi(pn)}}return ht.addEventListener("mousedown",Lt),document.addEventListener("mousemove",Ft),document.addEventListener("mouseup",kt),function(){ht.removeEventListener("mousedown",Lt),document.removeEventListener("mousemove",Ft),document.removeEventListener("mouseup",kt)}}},[Ve,Wn]),Object(g.useEffect)(function(){wi(ot)},[ot]);var Nn=q(it),er=q(Ir),Dn={width:Nn,height:er},tr=Object(g.useMemo)(function(){if(In){var ht=new Date(In),xt=ht.getHours(),mt=ht.getMinutes(),Lt=ht.getSeconds();return xt=xt<10?"0"+xt:xt,mt=mt<10?"0"+mt:mt,Lt=Lt<10?"0"+Lt:Lt,"".concat(xt,":").concat(mt,":").concat(Lt)}return 0},[In]);function Nr(){window.sessionStorage.removeItem(jt),Si(!1),Zi(0)}function ui(){Si(!1),Zi(0),Ve.setValue(window.sessionStorage.getItem(jt))}function ua(ht,xt){var mt=Ve.getValue();mt=mt.replace(ht,xt),Rn(mt),Ve==null||Ve.setValue(mt)}return f.a.createElement(g.Fragment,null,f.a.createElement("div",{className:"markdown-editor-wrapper",ref:Hn},f.a.createElement("div",{className:"markdown-editor-container ".concat(Ke," ").concat(On?"on-preview":""," ").concat(yt?"mini":""," ").concat(Ln?"full-screen":""),style:Dn},f.a.createElement(y,{insertTemp:bt,watch:On,fullScreen:Ln,showNullButton:ut,onActionCallback:Pr,hidetoolBar:Et,uuid:oi.current,setOpenPhones:function(){li.current=!0}}),f.a.createElement("div",{className:"markdown-editor-body"},f.a.createElement("div",{className:"codemirror-container"},f.a.createElement("textarea",{ref:jn,placeholder:Ei})),On?f.a.createElement("div",{ref:Ai,className:"preview-container"},zt==="stex"&&f.a.createElement(O,{value:ai}),zt!=="stex"&&f.a.createElement(w.a,{edit:!0,value:ai,replaces:ua})):null))),wt?f.a.createElement("a",{ref:Wn,className:"editor-resize"}):null,f.a.createElement(F.a,null,de[dn]?f.a.createElement($.a,{centered:!0,title:de[dn],visible:!0,onCancel:Yn,footer:null,className:"markdown-popup-form"},qi):null))}},SJMd:function(tt,Ee){/**
* @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 J,oe,$,k=!1,z,U;window.PR_SHOULD_USE_CONTINUATION=!0;var L,W;(function(){var H=window,n=["break,continue,do,else,for,if,return,while"],I=[n,"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"],g=[I,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],f=[g,"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"],m=[g,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],h=[g,"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"],o="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",p=[g,"abstract,async,await,constructor,debugger,enum,eval,export,function,get,implements,instanceof,interface,let,null,set,undefined,var,with,yield,Infinity,NaN"],l="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",u=[n,"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"],a=[n,"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"],s=[n,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],C=[f,h,m,p,l,u,a,s],_=/^(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",O="kwd",R="com",S="typ",T="lit",E="pun",c="pln",x="tag",v="dec",y="src",F="atn",B="atv",A="nocode",j="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<<?=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function P(pe){for(var Se=0,Pe=!1,he=!1,ve=0,xe=pe.length;ve<xe;++ve){var Ce=pe[ve];if(Ce.ignoreCase)he=!0;else if(/[a-z]/i.test(Ce.source.replace(/\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi,""))){Pe=!0,he=!1;break}}var Be={b:8,t:9,n:10,v:11,f:12,r:13};function Ne(Je){var ke=Je.charCodeAt(0);if(ke!==92)return ke;var Qe=Je.charAt(1);return ke=Be[Qe],ke||("0"<=Qe&&Qe<="7"?parseInt(Je.substring(1),8):Qe==="u"||Qe==="x"?parseInt(Je.substring(2),16):Je.charCodeAt(1))}function Ue(Je){if(Je<32)return(Je<16?"\\x0":"\\x")+Je.toString(16);var ke=String.fromCharCode(Je);return ke==="\\"||ke==="-"||ke==="]"||ke==="^"?"\\"+ke:ke}function He(Je){var ke=Je.substring(1,Je.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")),Qe=[],Ze=ke[0]==="^",le=["["];Ze&&le.push("^");for(var Z=Ze?1:0,q=ke.length;Z<q;++Z){var ae=ke[Z];if(/\\[bdsw]/i.test(ae))le.push(ae);else{var ue=Ne(ae),ne;Z+2<q&&ke[Z+1]==="-"?(ne=Ne(ke[Z+2]),Z+=2):ne=ue,Qe.push([ue,ne]),ne<65||ue>122||(ne<65||ue>90||Qe.push([Math.max(65,ue)|32,Math.min(ne,90)|32]),ne<97||ue>122||Qe.push([Math.max(97,ue)&~32,Math.min(ne,122)&~32]))}}Qe.sort(function(be,Te){return be[0]-Te[0]||Te[1]-be[1]});for(var te=[],de=[],Z=0;Z<Qe.length;++Z){var fe=Qe[Z];fe[0]<=de[1]+1?de[1]=Math.max(de[1],fe[1]):te.push(de=fe)}for(var Z=0;Z<te.length;++Z){var fe=te[Z];le.push(Ue(fe[0])),fe[1]>fe[0]&&(fe[1]+1>fe[0]&&le.push("-"),le.push(Ue(fe[1])))}return le.push("]"),le.join("")}function ze(Je){for(var ke=Je.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")),Qe=ke.length,Ze=[],le=0,Z=0;le<Qe;++le){var q=ke[le];if(q==="(")++Z;else if(q.charAt(0)==="\\"){var ae=+q.substring(1);ae&&(ae<=Z?Ze[ae]=-1:ke[le]=Ue(ae))}}for(var le=1;le<Ze.length;++le)Ze[le]===-1&&(Ze[le]=++Se);for(var le=0,Z=0;le<Qe;++le){var q=ke[le];if(q==="(")++Z,Ze[Z]||(ke[le]="(?:");else if(q.charAt(0)==="\\"){var ae=+q.substring(1);ae&&ae<=Z&&(ke[le]="\\"+Ze[ae])}}for(var le=0;le<Qe;++le)ke[le]==="^"&&ke[le+1]!=="^"&&(ke[le]="");if(Je.ignoreCase&&Pe)for(var le=0;le<Qe;++le){var q=ke[le],ue=q.charAt(0);q.length>=2&&ue==="["?ke[le]=He(q):ue!=="\\"&&(ke[le]=q.replace(/[a-zA-Z]/g,function(de){var fe=de.charCodeAt(0);return"["+String.fromCharCode(fe&~32,fe|32)+"]"}))}return ke.join("")}for(var Ge=[],ve=0,xe=pe.length;ve<xe;++ve){var Ce=pe[ve];if(Ce.global||Ce.multiline)throw new Error(""+Ce);Ge.push("(?:"+ze(Ce)+")")}return new RegExp(Ge.join("|"),he?"gi":"g")}function b(pe,Se){var Pe=/(?:^|\s)nocode(?:\s|$)/,he=[],ve=0,xe=[],Ce=0;function Be(Ne){var Ue=Ne.nodeType;if(Ue==1){if(Pe.test(Ne.className))return;for(var He=Ne.firstChild;He;He=He.nextSibling)Be(He);var ze=Ne.nodeName.toLowerCase();(ze==="br"||ze==="li")&&(he[Ce]=`
`,xe[Ce<<1]=ve++,xe[Ce++<<1|1]=Ne)}else if(Ue==3||Ue==4){var Ge=Ne.nodeValue;Ge.length&&(Se?Ge=Ge.replace(/\r\n?/g,`
`):Ge=Ge.replace(/[ \t\r\n]+/g," "),he[Ce]=Ge,xe[Ce<<1]=ve,ve+=Ge.length,xe[Ce++<<1|1]=Ne)}}return Be(pe),{sourceCode:he.join("").replace(/\n$/,""),spans:xe}}function V(pe,Se,Pe,he,ve){if(!Pe)return;var xe={sourceNode:pe,pre:1,langExtension:null,numberLines:null,sourceCode:Pe,spans:null,basePos:Se,decorations:null};he(xe),ve.push.apply(ve,xe.decorations)}var re=/\S/;function ce(pe){for(var Se=void 0,Pe=pe.firstChild;Pe;Pe=Pe.nextSibling){var he=Pe.nodeType;Se=he===1?Se?pe:Pe:he===3&&re.test(Pe.nodeValue)?pe:Se}return Se===pe?void 0:Se}function me(pe,Se){var Pe={},he;(function(){for(var Ce=pe.concat(Se),Be=[],Ne={},Ue=0,He=Ce.length;Ue<He;++Ue){var ze=Ce[Ue],Ge=ze[3];if(Ge)for(var Je=Ge.length;--Je>=0;)Pe[Ge.charAt(Je)]=ze;var ke=ze[1],Qe=""+ke;Ne.hasOwnProperty(Qe)||(Be.push(ke),Ne[Qe]=null)}Be.push(/[\0-\uffff]/),he=P(Be)})();var ve=Se.length,xe=function(Ce){for(var Be=Ce.sourceCode,Ne=Ce.basePos,Ue=Ce.sourceNode,He=[Ne,c],ze=0,Ge=Be.match(he)||[],Je={},ke=0,Qe=Ge.length;ke<Qe;++ke){var Ze=Ge[ke],le=Je[Ze],Z=void 0,q;if(typeof le=="string")q=!1;else{var ae=Pe[Ze.charAt(0)];if(ae)Z=Ze.match(ae[1]),le=ae[0];else{for(var ue=0;ue<ve;++ue)if(ae=Se[ue],Z=Ze.match(ae[1]),Z){le=ae[0];break}Z||(le=c)}q=le.length>=5&&le.substring(0,5)==="lang-",q&&!(Z&&typeof Z[1]=="string")&&(q=!1,le=y),q||(Je[Ze]=le)}var ne=ze;if(ze+=Ze.length,!q)He.push(Ne+ne,le);else{var te=Z[1],de=Ze.indexOf(te),fe=de+te.length;Z[2]&&(fe=Ze.length-Z[2].length,de=fe-te.length);var be=le.substring(5);V(Ue,Ne+ne,Ze.substring(0,de),xe,He),V(Ue,Ne+ne+de,te,X(be,te),He),V(Ue,Ne+ne+fe,Ze.substring(fe),xe,He)}}Ce.decorations=He};return xe}function De(pe){var Se=[],Pe=[];pe.tripleQuotedStrings?Se.push([w,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):pe.multiLineStrings?Se.push([w,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):Se.push([w,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),pe.verbatimStrings&&Pe.push([w,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var he=pe.hashComments;he&&(pe.cStyleComments?(he>1?Se.push([R,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):Se.push([R,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),Pe.push([w,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):Se.push([R,/^#[^\r\n]*/,null,"#"])),pe.cStyleComments&&(Pe.push([R,/^\/\/[^\r\n]*/,null]),Pe.push([R,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var ve=pe.regexLiterals;if(ve){var xe=ve>1?"":`
\r`,Ce=xe?".":"[\\S\\s]",Be="/(?=[^/*"+xe+"])(?:[^/\\x5B\\x5C"+xe+"]|\\x5C"+Ce+"|\\x5B(?:[^\\x5C\\x5D"+xe+"]|\\x5C"+Ce+")*(?:\\x5D|$))+/";Pe.push(["lang-regex",RegExp("^"+j+"("+Be+")")])}var Ne=pe.types;Ne&&Pe.push([S,Ne]);var Ue=(""+pe.keywords).replace(/^ | $/g,"");Ue.length&&Pe.push([O,new RegExp("^(?:"+Ue.replace(/[\s,]+/g,"|")+")\\b"),null]),Se.push([c,/^\s+/,null,` \r
\xA0`]);var He="^.[^\\s\\w.$@'\"`/\\\\]*";return pe.regexLiterals&&(He+="(?!s*/)"),Pe.push([T,/^@[a-z_$][a-z_$@0-9]*/i,null],[S,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[c,/^[a-z_$][a-z_$@0-9]*/i,null],[T,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[c,/^\\[\s\S]?/,null],[E,new RegExp(He),null]),me(Se,Pe)}var we=De({keywords:C,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function Le(pe,Se,Pe){for(var he=/(?:^|\s)nocode(?:\s|$)/,ve=/\r\n?|\n/,xe=pe.ownerDocument,Ce=xe.createElement("li");pe.firstChild;)Ce.appendChild(pe.firstChild);var Be=[Ce];function Ne(ke){var Qe=ke.nodeType;if(Qe==1&&!he.test(ke.className))if(ke.nodeName==="br")Ue(ke),ke.parentNode&&ke.parentNode.removeChild(ke);else for(var Ze=ke.firstChild;Ze;Ze=Ze.nextSibling)Ne(Ze);else if((Qe==3||Qe==4)&&Pe){var le=ke.nodeValue,Z=le.match(ve);if(Z){var q=le.substring(0,Z.index);ke.nodeValue=q;var ae=le.substring(Z.index+Z[0].length);if(ae){var ue=ke.parentNode;ue.insertBefore(xe.createTextNode(ae),ke.nextSibling)}Ue(ke),q||ke.parentNode.removeChild(ke)}}}function Ue(ke){for(;!ke.nextSibling;)if(ke=ke.parentNode,!ke)return;function Qe(Z,q){var ae=q?Z.cloneNode(!1):Z,ue=Z.parentNode;if(ue){var ne=Qe(ue,1),te=Z.nextSibling;ne.appendChild(ae);for(var de=te;de;de=te)te=de.nextSibling,ne.appendChild(de)}return ae}for(var Ze=Qe(ke.nextSibling,0),le;(le=Ze.parentNode)&&le.nodeType===1;)Ze=le;Be.push(Ze)}for(var He=0;He<Be.length;++He)Ne(Be[He]);Se===(Se|0)&&Be[0].setAttribute("value",Se);var ze=xe.createElement("ol");ze.className="linenums";for(var Ge=Math.max(0,Se-1|0)||0,He=0,Je=Be.length;He<Je;++He)Ce=Be[He],Ce.className="L"+(He+Ge)%10,Ce.firstChild||Ce.appendChild(xe.createTextNode("\xA0")),ze.appendChild(Ce);pe.appendChild(ze)}function Re(pe){var Se=/\bMSIE\s(\d+)/.exec(navigator.userAgent);Se=Se&&+Se[1]<=8;var Pe=/\n/g,he=pe.sourceCode,ve=he.length,xe=0,Ce=pe.spans,Be=Ce.length,Ne=0,Ue=pe.decorations,He=Ue.length,ze=0;Ue[He]=ve;var Ge,Je;for(Je=Ge=0;Je<He;)Ue[Je]!==Ue[Je+2]?(Ue[Ge++]=Ue[Je++],Ue[Ge++]=Ue[Je++]):Je+=2;for(He=Ge,Je=Ge=0;Je<He;){for(var ke=Ue[Je],Qe=Ue[Je+1],Ze=Je+2;Ze+2<=He&&Ue[Ze+1]===Qe;)Ze+=2;Ue[Ge++]=ke,Ue[Ge++]=Qe,Je=Ze}He=Ue.length=Ge;var le=pe.sourceNode,Z="";le&&(Z=le.style.display,le.style.display="none");try{for(var q=null;Ne<Be;){var ae=Ce[Ne],ue=Ce[Ne+2]||ve,ne=Ue[ze+2]||ve,Ze=Math.min(ue,ne),te=Ce[Ne+1],de;if(te.nodeType!==1&&(de=he.substring(xe,Ze))){Se&&(de=de.replace(Pe,"\r")),te.nodeValue=de;var fe=te.ownerDocument,be=fe.createElement("span");be.className=Ue[ze+1];var Te=te.parentNode;Te.replaceChild(be,te),be.appendChild(te),xe<ue&&(Ce[Ne+1]=te=fe.createTextNode(he.substring(Ze,ue)),Te.insertBefore(te,be.nextSibling))}xe=Ze,xe>=ue&&(Ne+=2),xe>=ne&&(ze+=2)}}finally{le&&(le.style.display=Z)}}var Ie={};function ye(pe,Se){for(var Pe=Se.length;--Pe>=0;){var he=Se[Pe];Ie.hasOwnProperty(he)?H.console&&console.warn("cannot override language handler %s",he):Ie[he]=pe}}function X(pe,Se){return pe&&Ie.hasOwnProperty(pe)||(pe=/^\s*</.test(Se)?"default-markup":"default-code"),Ie[pe]}ye(we,["default-code"]),ye(me([],[[c,/^[^<?]+/],[v,/^<!\w[^>]*(?:>|$)/],[R,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[E,/^(?:<[%?]|[%?]>)/],["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"]),ye(me([[c,/^[\s]+/,null,` \r
`],[B,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,`"'`]],[[x,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[F,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[E,/^[=<>\/]+/],["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"]),ye(me([],[[B,/^[\s\S]+/]]),["uq.val"]),ye(De({keywords:f,hashComments:!0,cStyleComments:!0,types:_}),["c","cc","cpp","cxx","cyc","m"]),ye(De({keywords:"null,true,false"}),["json"]),ye(De({keywords:h,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:_}),["cs"]),ye(De({keywords:m,cStyleComments:!0}),["java"]),ye(De({keywords:s,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),ye(De({keywords:u,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),ye(De({keywords:l,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),ye(De({keywords:a,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),ye(De({keywords:p,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),ye(De({keywords:o,hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),ye(me([],[[w,/^[\s\S]+/]]),["regex"]);function M(pe){var Se=pe.langExtension;try{var Pe=b(pe.sourceNode,pe.pre),he=Pe.sourceCode;pe.sourceCode=he,pe.spans=Pe.spans,pe.basePos=0,X(Se,he)(pe),Re(pe)}catch(ve){H.console&&console.log(ve&&ve.stack||ve)}}function N(pe,Se,Pe){var he=Pe||!1,ve=Se||null,xe=document.createElement("div");xe.innerHTML="<pre>"+pe+"</pre>",xe=xe.firstChild,he&&Le(xe,he,!0);var Ce={langExtension:ve,numberLines:he,sourceNode:xe,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null};return M(Ce),xe.innerHTML}function Y(pe,Se){var Pe=Se||document.body,he=Pe.ownerDocument||document;function ve(ae){return Pe.getElementsByTagName(ae)}for(var xe=[ve("pre"),ve("code"),ve("xmp")],Ce=[],Be=0;Be<xe.length;++Be)for(var Ne=0,Ue=xe[Be].length;Ne<Ue;++Ne)Ce.push(xe[Be][Ne]);xe=null;var He=Date;He.now||(He={now:function(){return+new Date}});var ze=0,Ge=/\blang(?:uage)?-([\w.]+)(?!\S)/,Je=/\bprettyprint\b/,ke=/\bprettyprinted\b/,Qe=/pre|xmp/i,Ze=/^code$/i,le=/^(?:pre|code|xmp)$/i,Z={};function q(){for(var ae=H.PR_SHOULD_USE_CONTINUATION?He.now()+250:Infinity;ze<Ce.length&&He.now()<ae;ze++){for(var ue=Ce[ze],ne=Z,te=ue;te=te.previousSibling;){var de=te.nodeType,fe=(de===7||de===8)&&te.nodeValue;if(fe?!/^\??prettify\b/.test(fe):de!==3||/\S/.test(te.nodeValue))break;if(fe){ne={},fe.replace(/\b(\w+)=([\w:.%+-]+)/g,function(Ct,bt,Qt){ne[bt]=Qt});break}}var be=ue.className;if((ne!==Z||Je.test(be))&&!ke.test(be)){for(var Te=!1,Me=ue.parentNode;Me;Me=Me.parentNode){var je=Me.tagName;if(le.test(je)&&Me.className&&Je.test(Me.className)){Te=!0;break}}if(!Te){ue.className+=" prettyprinted";var nt=ne.lang;if(!nt){nt=be.match(Ge);var it;!nt&&(it=ce(ue))&&Ze.test(it.tagName)&&(nt=it.className.match(Ge)),nt&&(nt=nt[1])}var Tt;if(Qe.test(ue.tagName))Tt=1;else{var ot=ue.currentStyle,$e=he.defaultView,yt=ot?ot.whiteSpace:$e&&$e.getComputedStyle?$e.getComputedStyle(ue,null).getPropertyValue("white-space"):0;Tt=yt&&yt.substring(0,3)==="pre"}var lt=ne.linenums;(lt=lt==="true"||+lt)||(lt=be.match(/\blinenums\b(?::(\d+))?/),lt=lt?lt[1]&&lt[1].length?+lt[1]:!0:!1),lt&&Le(ue,lt,Tt);var Rt={langExtension:nt,sourceNode:ue,numberLines:lt,pre:Tt,sourceCode:null,basePos:null,spans:null,decorations:null};M(Rt)}}}ze<Ce.length?H.setTimeout(q,250):typeof pe=="function"&&pe()}q()}var ie=H.PR={createSimpleLexer:me,registerLangHandler:ye,sourceDecorator:De,PR_ATTRIB_NAME:F,PR_ATTRIB_VALUE:B,PR_COMMENT:R,PR_DECLARATION:v,PR_KEYWORD:O,PR_LITERAL:T,PR_NOCODE:A,PR_PLAIN:c,PR_PUNCTUATION:E,PR_SOURCE:y,PR_STRING:w,PR_TAG:x,PR_TYPE:S,prettyPrintOne:k?H.prettyPrintOne=N:L=N,prettyPrint:W=k?H.prettyPrint=Y:W=Y},K=H.define;typeof K=="function"&&K.amd&&K("google-code-prettify",[],function(){return ie})})()},STEk:function(tt,Ee,J){"use strict";J.d(Ee,"a",function(){return ye});/*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */var oe=function(X,M){return(oe=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(N,Y){N.__proto__=Y}||function(N,Y){for(var ie in Y)Object.prototype.hasOwnProperty.call(Y,ie)&&(N[ie]=Y[ie])})(X,M)};function $(X,M){function N(){this.constructor=X}oe(X,M),X.prototype=M===null?Object.create(M):(N.prototype=M.prototype,new N)}function k(X,M,N,Y){return new(N||(N=Promise))(function(ie,K){function pe(he){try{Pe(Y.next(he))}catch(ve){K(ve)}}function Se(he){try{Pe(Y.throw(he))}catch(ve){K(ve)}}function Pe(he){var ve;he.done?ie(he.value):(ve=he.value,ve instanceof N?ve:new N(function(xe){xe(ve)})).then(pe,Se)}Pe((Y=Y.apply(X,M||[])).next())})}function z(X,M){var N,Y,ie,K,pe={label:0,sent:function(){if(1&ie[0])throw ie[1];return ie[1]},trys:[],ops:[]};return K={next:Se(0),throw:Se(1),return:Se(2)},typeof Symbol=="function"&&(K[Symbol.iterator]=function(){return this}),K;function Se(Pe){return function(he){return function(ve){if(N)throw new TypeError("Generator is already executing.");for(;pe;)try{if(N=1,Y&&(ie=2&ve[0]?Y.return:ve[0]?Y.throw||((ie=Y.return)&&ie.call(Y),0):Y.next)&&!(ie=ie.call(Y,ve[1])).done)return ie;switch(Y=0,ie&&(ve=[2&ve[0],ie.value]),ve[0]){case 0:case 1:ie=ve;break;case 4:return pe.label++,{value:ve[1],done:!1};case 5:pe.label++,Y=ve[1],ve=[0];continue;case 7:ve=pe.ops.pop(),pe.trys.pop();continue;default:if(!(ie=pe.trys,(ie=ie.length>0&&ie[ie.length-1])||ve[0]!==6&&ve[0]!==2)){pe=0;continue}if(ve[0]===3&&(!ie||ve[1]>ie[0]&&ve[1]<ie[3])){pe.label=ve[1];break}if(ve[0]===6&&pe.label<ie[1]){pe.label=ie[1],ie=ve;break}if(ie&&pe.label<ie[2]){pe.label=ie[2],pe.ops.push(ve);break}ie[2]&&pe.ops.pop(),pe.trys.pop();continue}ve=M.call(X,pe)}catch(xe){ve=[6,xe],Y=0}finally{N=ie=0}if(5&ve[0])throw ve[1];return{value:ve[0]?ve[1]:void 0,done:!0}}([Pe,he])}}}function U(){for(var X=0,M=0,N=arguments.length;M<N;M++)X+=arguments[M].length;var Y=Array(X),ie=0;for(M=0;M<N;M++)for(var K=arguments[M],pe=0,Se=K.length;pe<Se;pe++,ie++)Y[ie]=K[pe];return Y}var L=function(){function X(){}return X.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},X.setAttributes=function(M,N){for(var Y=0,ie=N;Y<ie.length;Y++){var K=ie[Y],pe=K[0],Se=K[1];M.setAttribute(pe,Se)}},X.createRect=function(M,N,Y){var ie=document.createElementNS("http://www.w3.org/2000/svg","rect");return ie.setAttribute("width",M.toString()),ie.setAttribute("height",N.toString()),Y&&X.setAttributes(ie,Y),ie},X.createLine=function(M,N,Y,ie,K){var pe=document.createElementNS("http://www.w3.org/2000/svg","line");return pe.setAttribute("x1",M.toString()),pe.setAttribute("y1",N.toString()),pe.setAttribute("x2",Y.toString()),pe.setAttribute("y2",ie.toString()),K&&X.setAttributes(pe,K),pe},X.createPolygon=function(M,N){var Y=document.createElementNS("http://www.w3.org/2000/svg","polygon");return Y.setAttribute("points",M),N&&X.setAttributes(Y,N),Y},X.createCircle=function(M,N){var Y=document.createElementNS("http://www.w3.org/2000/svg","circle");return Y.setAttribute("cx",(M/2).toString()),Y.setAttribute("cy",(M/2).toString()),Y.setAttribute("r",M.toString()),N&&X.setAttributes(Y,N),Y},X.createEllipse=function(M,N,Y){var ie=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return ie.setAttribute("cx",(M/2).toString()),ie.setAttribute("cy",(N/2).toString()),ie.setAttribute("rx",(M/2).toString()),ie.setAttribute("ry",(N/2).toString()),Y&&X.setAttributes(ie,Y),ie},X.createGroup=function(M){var N=document.createElementNS("http://www.w3.org/2000/svg","g");return M&&X.setAttributes(N,M),N},X.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},X.createMarker=function(M,N,Y,ie,K,pe,Se){var Pe=document.createElementNS("http://www.w3.org/2000/svg","marker");return X.setAttributes(Pe,[["id",M],["orient",N],["markerWidth",Y.toString()],["markerHeight",ie.toString()],["refX",K.toString()],["refY",pe.toString()]]),Pe.appendChild(Se),Pe},X.createText=function(M){var N=document.createElementNS("http://www.w3.org/2000/svg","text");return N.setAttribute("x","0"),N.setAttribute("y","0"),M&&X.setAttributes(N,M),N},X.createTSpan=function(M,N){var Y=document.createElementNS("http://www.w3.org/2000/svg","tspan");return Y.textContent=M,N&&X.setAttributes(Y,N),Y},X.createImage=function(M){var N=document.createElementNS("http://www.w3.org/2000/svg","image");return M&&X.setAttributes(N,M),N},X.createPoint=function(M,N){var Y=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return Y.x=M,Y.y=N,Y},X.createPath=function(M,N){var Y=document.createElementNS("http://www.w3.org/2000/svg","path");return Y.setAttribute("d",M),N&&X.setAttributes(Y,N),Y},X}(),W=function(){function X(){}return X.addKey=function(M){X.key=M},Object.defineProperty(X,"isLicensed",{get:function(){return!!X.key&&new RegExp(/^MJS2-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(X.key)},enumerable:!1,configurable:!0}),X}(),H=function(){function X(){this.naturalSize=!1,this.imageType="image/png",this.markersOnly=!1}return X.prototype.rasterize=function(M,N,Y){var ie=this;return new Promise(function(K){var pe=Y!==void 0?Y:document.createElement("canvas");M===null&&(ie.markersOnly=!0,ie.naturalSize=!1);var Se=document.createElementNS("http://www.w3.org/2000/svg","svg");Se.setAttribute("xmlns","http://www.w3.org/2000/svg"),Se.setAttribute("width",N.width.baseVal.valueAsString),Se.setAttribute("height",N.height.baseVal.valueAsString),Se.setAttribute("viewBox","0 0 "+N.viewBox.baseVal.width.toString()+" "+N.viewBox.baseVal.height.toString()),Se.innerHTML=N.innerHTML,ie.naturalSize===!0?(Se.width.baseVal.value=M.naturalWidth,Se.height.baseVal.value=M.naturalHeight):ie.width!==void 0&&ie.height!==void 0&&(Se.width.baseVal.value=ie.width,Se.height.baseVal.value=ie.height),pe.width=Se.width.baseVal.value,pe.height=Se.height.baseVal.value;var Pe=Se.outerHTML,he=pe.getContext("2d");ie.markersOnly!==!0&&he.drawImage(M,0,0,pe.width,pe.height);var ve=window.URL,xe=new Image(pe.width,pe.height);xe.setAttribute("crossOrigin","anonymous");var Ce=new Blob([Pe],{type:"image/svg+xml"}),Be=ve.createObjectURL(Ce);xe.onload=function(){he.drawImage(xe,0,0),ve.revokeObjectURL(Be);var Ne=pe.toDataURL(ie.imageType,ie.imageQuality);K(Ne)},xe.src=Be})},X}(),n=function(){},I=function(){function X(M){this._classNamePrefixBase="__markerjs2_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+M+"_"}return Object.defineProperty(X.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"defaultSettings",{get:function(){return{canvasBackgroundColor:"#ffffff",toolbarBackgroundColor:"#111111",toolbarBackgroundHoverColor:"#333333",toolbarColor:"#eeeeee",toolbarHeight:40,toolboxColor:"#eeeeee",toolboxAccentColor:"#3080c3",undoButtonVisible:!0,redoButtonVisible:!1,zoomButtonVisible:!1,zoomOutButtonVisible:!1,clearButtonVisible:!1,resultButtonBlockVisible:!0,logoPosition:"left"}},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"fade_out"},enumerable:!1,configurable:!0}),X.prototype.addClass=function(M){return this.styleSheet===void 0&&this.addStyleSheet(),M.name=""+this.classNamePrefix+M.localName,this.classes.push(M),this.styleSheet.sheet.insertRule("."+M.name+" {"+M.style+"}",this.styleSheet.sheet.cssRules.length),M},X.prototype.addRule=function(M){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(M),this.styleSheet.sheet.insertRule(M.selector+" {"+M.style+"}",this.styleSheet.sheet.cssRules.length)},X.prototype.addStyleSheet=function(){var M;this.styleSheet=document.createElement("style"),((M=this.styleSheetRoot)!==null&&M!==void 0?M:document.head).appendChild(this.styleSheet),this.addRule(new g("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new g("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
from {
opacity: 0;
}
to {
opacity: 1;
}
`)),this.addRule(new g("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
from {
opacity: 1;
}
to {
opacity: 0;
}
`)),this.addClass(new f("fade_in",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
`)),this.addClass(new f("fade_out",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
`))},X.prototype.removeStyleSheet=function(){var M;this.styleSheet&&(((M=this.styleSheetRoot)!==null&&M!==void 0?M:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},X}(),g=function(X,M){this.selector=X,this.style=M},f=function(X,M){this.localName=X,this.style=M},m=function(){function X(M,N,Y,ie,K){this.buttons=[],this.markerButtons=[],this.buttonClickListeners=[],this.markerjsContainer=M,this.displayMode=N,this.markerItems=Y,this.uiStyleSettings=ie,this.styles=K,this.addStyles(),this.adjustLayout=this.adjustLayout.bind(this),this.overflowButtonClicked=this.overflowButtonClicked.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this)}return X.prototype.show=function(M){var N=this;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=M,this.uiContainer.className=this.toolbarStyleClass.name+" "+this.styles.fadeInAnimationClassName+" "+(this.uiStyleSettings.toolbarStyleColorsClassName?this.uiStyleSettings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name);var Y=document.createElement("div");Y.className=this.toolbarBlockStyleClass.name,Y.style.whiteSpace="nowrap",this.uiContainer.appendChild(Y),this.addActionButton(Y,'<svg viewBox="0 0 24 24"><path d="M10.07 14.27a.997.997 0 011.33.48l2.3 4.99 1.8-.85-2.31-4.98c-.24-.5-.02-1.1.48-1.33l.28-.08 2.3-.45L8 5.12V15.9l1.82-1.47.25-.16m3.57 7.7a.99.99 0 01-1.33-.47l-2.18-4.74-2.51 2.02c-.17.14-.38.22-.62.22a1 1 0 01-1-1V3a1 1 0 011-1c.24 0 .47.09.64.23l.01-.01 11.49 9.64a1.001 1.001 0 01-.44 1.75l-3.16.62 2.2 4.73c.26.5.02 1.09-.48 1.32l-3.62 1.69z"/></svg>',"select"),this.addActionButton(Y,'<svg viewBox="0 0 24 24"><path d="M9 3v1H4v2h1v13a2 2 0 002 2h10a2 2 0 002-2V6h1V4h-5V3H9M7 6h10v13H7V6m2 2v9h2V8H9m4 0v9h2V8h-2z"/></svg>',"delete"),this.uiStyleSettings.clearButtonVisible&&this.addActionButton(Y,'<svg viewBox="0 0 24 24"><path d="M19.36 2.72l1.42 1.42-5.72 5.71c1.07 1.54 1.22 3.39.32 4.59L9.06 8.12c1.2-.9 3.05-.75 4.59.32l5.71-5.72M5.93 17.57c-2.01-2.01-3.24-4.41-3.58-6.65l4.88-2.09 7.44 7.44-2.09 4.88c-2.24-.34-4.64-1.57-6.65-3.58z"/></svg>',"clear"),this.uiStyleSettings.undoButtonVisible&&this.addActionButton(Y,'<svg viewBox="0 0 24 24"><path d="M12.5 8c-2.65 0-5.05 1-6.9 2.6L2 7v9h9l-3.62-3.62c1.39-1.16 3.16-1.88 5.12-1.88 3.54 0 6.55 2.31 7.6 5.5l2.37-.78C21.08 11.03 17.15 8 12.5 8z"/></svg>',"undo"),this.uiStyleSettings.redoButtonVisible&&this.addActionButton(Y,'<svg viewBox="0 0 24 24"><path d="M18.4 10.6C16.55 9 14.15 8 11.5 8c-4.65 0-8.58 3.03-9.96 7.22L3.9 16a8.002 8.002 0 017.6-5.5c1.95 0 3.73.72 5.12 1.88L13 16h9V7l-3.6 3.6z"/></svg>',"redo"),this.uiStyleSettings.zoomButtonVisible&&this.addActionButton(Y,'<svg viewBox="0 0 24 24"><path d="M15.5 14l5 5-1.5 1.5-5-5v-.79l-.27-.28A6.471 6.471 0 019.5 16 6.5 6.5 0 013 9.5 6.5 6.5 0 019.5 3 6.5 6.5 0 0116 9.5c0 1.61-.59 3.09-1.57 4.23l.28.27h.79m-6 0C12 14 14 12 14 9.5S12 5 9.5 5 5 7 5 9.5 7 14 9.5 14m2.5-4h-2v2H9v-2H7V9h2V7h1v2h2v1z"/></svg>',"zoom"),this.uiStyleSettings.zoomButtonVisible&&this.uiStyleSettings.zoomOutButtonVisible&&this.addActionButton(Y,'<svg viewBox="0 0 24 24"><path d="M15.5 14h-.79l-.28-.27A6.471 6.471 0 0016 9.5 6.5 6.5 0 009.5 3 6.5 6.5 0 003 9.5 6.5 6.5 0 009.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 5 1.5-1.5-5-5m-6 0C7 14 5 12 5 9.5S7 5 9.5 5 14 7 14 9.5 12 14 9.5 14M7 9h5v1H7V9z"/></svg>',"zoom-out"),this.uiStyleSettings.notesButtonVisible&&this.addActionButton(Y,'<svg viewBox="0 0 24 24"><path d="M18.13 12l1.26-1.26c.44-.44 1-.68 1.61-.74V9l-6-6H5c-1.11 0-2 .89-2 2v14a2 2 0 002 2h6v-1.87l.13-.13H5V5h7v7h6.13M14 4.5l5.5 5.5H14V4.5m5.13 9.33l2.04 2.04L15.04 22H13v-2.04l6.13-6.13m3.72.36l-.98.98-2.04-2.04.98-.98c.19-.2.52-.2.72 0l1.32 1.32c.2.2.2.53 0 .72z"/></svg>',"notes"),this.markerButtonBlock=document.createElement("div"),this.markerButtonBlock.className=this.toolbarBlockStyleClass.name,this.markerButtonBlock.style.flexGrow="2",this.markerButtonBlock.style.textAlign="center",this.uiContainer.appendChild(this.markerButtonBlock),this.markerButtonOverflowBlock=document.createElement("div"),this.markerButtonOverflowBlock.className=this.toolbarOverflowBlockStyleClass.name+" "+(this.uiStyleSettings.toolbarOverflowBlockStyleColorsClassName?this.uiStyleSettings.toolbarOverflowBlockStyleColorsClassName:this.toolbarOverflowBlockStyleColorsClass.name),this.markerButtonOverflowBlock.style.display="none",this.uiContainer.appendChild(this.markerButtonOverflowBlock),this.markerItems&&(this.markerItems.forEach(function(K){var pe=document.createElement("div");pe.className=""+N.toolbarButtonStyleClass.name,pe.setAttribute("data-type-name",K.typeName),pe.innerHTML=K.icon,pe.addEventListener("click",function(){N.markerToolbarButtonClicked(pe,K)}),N.buttons.push(pe),N.markerButtons.push(pe)}),this.overflowButton=document.createElement("div"),this.overflowButton.className=this.toolbarButtonStyleClass.name+" "+(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name),this.overflowButton.innerHTML='<svg viewBox="0 0 24 24"><path d="M12 16a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2m0-6a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2m0-6a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2z"/></svg>',this.overflowButton.addEventListener("click",this.overflowButtonClicked),this.markerButtonBlock.appendChild(this.overflowButton));var ie=document.createElement("div");ie.className=this.toolbarBlockStyleClass.name,ie.style.whiteSpace="nowrap",ie.style.display=this.uiStyleSettings.resultButtonBlockVisible!==!1?"":"none",this.uiContainer.appendChild(ie),this.addActionButton(ie,'<svg viewBox="0 0 24 24"><path d="M9 20.42l-6.21-6.21 2.83-2.83L9 14.77l9.88-9.89 2.83 2.83L9 20.42z"/></svg>',"render"),this.addActionButton(ie,'<svg viewBox="0 0 24 24"><path d="M20 6.91L17.09 4 12 9.09 6.91 4 4 6.91 9.09 12 4 17.09 6.91 20 12 14.91 17.09 20 20 17.09 14.91 12 20 6.91z"/></svg>',"close"),this.markerjsContainer.appendChild(this.uiContainer),this.setSelectMode(),this.setCurrentMarker(),this.adjustLayout()},X.prototype.addButtonClickListener=function(M){this.buttonClickListeners.push(M)},X.prototype.removeButtonClickListener=function(M){this.buttonClickListeners.indexOf(M)>-1&&this.buttonClickListeners.splice(this.buttonClickListeners.indexOf(M),1)},X.prototype.setSelectMode=function(){this.resetButtonStyles(),this.setActiveButton(this.buttons[0])},X.prototype.adjustLayout=function(){if(this.markerButtons&&this.markerButtons.length>0){var M=Math.floor(this.markerButtonBlock.clientWidth/this.uiStyleSettings.toolbarHeight)-1;this.markerButtonBlock.innerHTML="",this.markerButtonOverflowBlock.innerHTML="";for(var N=0;N<this.markerButtons.length;N++)N<M||N===M&&this.markerButtons.length-1===M?this.markerButtonBlock.appendChild(this.markerButtons[N]):(N===M&&this.markerButtonBlock.appendChild(this.overflowButton),this.markerButtonOverflowBlock.appendChild(this.markerButtons[N]))}},X.prototype.overflowButtonClicked=function(){this.markerButtonOverflowBlock.style.display!=="none"?(this.markerButtonOverflowBlock.className=this.markerButtonOverflowBlock.className.replace(this.styles.fadeInAnimationClassName,""),this.markerButtonOverflowBlock.style.display="none"):(this.markerButtonOverflowBlock.className+=" "+this.styles.fadeInAnimationClassName,this.markerButtonOverflowBlock.style.top=this.uiContainer.offsetTop+this.overflowButton.offsetHeight+"px",this.markerButtonOverflowBlock.style.right=this.uiContainer.offsetWidth-this.overflowButton.offsetLeft-this.overflowButton.offsetWidth+2*this.uiContainer.offsetLeft+"px",this.markerButtonOverflowBlock.style.display="inline-block")},X.prototype.resetButtonStyles=function(){var M=this;this.buttons.forEach(function(N){N.className=N.className.replace(M.uiStyleSettings.toolbarButtonStyleColorsClassName?M.uiStyleSettings.toolbarButtonStyleColorsClassName:M.toolbarButtonStyleColorsClass.name,"").trim(),N.className=N.className.replace(M.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?M.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:M.toolbarActiveButtonStyleColorsClass.name,"").trim(),N.className+=" "+(M.uiStyleSettings.toolbarButtonStyleColorsClassName?M.uiStyleSettings.toolbarButtonStyleColorsClassName:M.toolbarButtonStyleColorsClass.name)})},X.prototype.addActionButton=function(M,N,Y){var ie=this,K=document.createElement("div");switch(K.className=""+this.toolbarButtonStyleClass.name,K.innerHTML=N,K.setAttribute("data-action",Y),K.addEventListener("click",function(){ie.actionToolbarButtonClicked(K,Y)}),Y){case"select":K.style.fill=this.uiStyleSettings.selectButtonColor;break;case"delete":case"clear":K.style.fill=this.uiStyleSettings.deleteButtonColor;break;case"undo":case"redo":K.style.fill=this.uiStyleSettings.selectButtonColor;break;case"render":K.style.fill=this.uiStyleSettings.okButtonColor;break;case"close":K.style.fill=this.uiStyleSettings.closeButtonColor}M.appendChild(K),this.buttons.push(K)},X.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new f("toolbar",`
width: 100%;
flex-shrink: 0;
display: flex;
flex-direction: row;
justify-content: space-between;
height: `+this.uiStyleSettings.toolbarHeight+`px;
box-sizing: content-box;
`+(this.displayMode==="inline"?"border-top-left-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
`+(this.displayMode==="inline"?"border-top-right-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
overflow: hidden;
`)),this.toolbarStyleColorsClass=this.styles.addClass(new f("toolbar_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
box-shadow: 0px 3px rgba(33, 33, 33, 0.1);
`)),this.toolbarBlockStyleClass=this.styles.addClass(new f("toolbar-block",`
display: inline-block;
box-sizing: content-box;
`)),this.toolbarOverflowBlockStyleClass=this.styles.addClass(new f("toolbar-overflow-block",`
position: absolute;
top: `+this.uiStyleSettings.toolbarHeight+`px;
max-width: `+2*this.uiStyleSettings.toolbarHeight+`px;
z-index: 10;
box-sizing: content-box;
`)),this.toolbarOverflowBlockStyleColorsClass=this.styles.addClass(new f("toolbar-overflow-block_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
`));var M=this.uiStyleSettings.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new f("toolbar_button",`
display: inline-block;
width: `+(this.uiStyleSettings.toolbarHeight-2*M)+`px;
height: `+(this.uiStyleSettings.toolbarHeight-2*M)+`px;
padding: `+M+`px;
box-sizing: content-box;
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new f("toolbar_button_colors",`
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new f("toolbar_active_button",`
fill: `+this.uiStyleSettings.toolbarColor+`;
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`)),this.styles.addRule(new g("."+this.toolbarButtonStyleClass.name+" svg",`
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
`)),this.styles.addRule(new g("."+this.toolbarButtonStyleColorsClass.name+":hover",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`))},X.prototype.markerToolbarButtonClicked=function(M,N){this.setActiveButton(M),this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(Y){return Y("marker",N)}),this.markerButtonOverflowBlock.style.display="none"},X.prototype.actionToolbarButtonClicked=function(M,N){this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(Y){return Y("action",N)}),this.markerButtonOverflowBlock.style.display="none",this.setActiveButton(this.buttons[0])},X.prototype.setActiveButton=function(M){this.resetButtonStyles(),M.className=M.className.replace(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,"").trim(),M.className+=" "+(this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name)},X.prototype.setActiveMarkerButton=function(M){var N=this.markerButtons.find(function(Y){return Y.getAttribute("data-type-name")===M});N&&this.setActiveButton(N)},X.prototype.setCurrentMarker=function(M){var N=this;this.currentMarker=M,this.buttons.filter(function(Y){return/delete|notes/.test(Y.getAttribute("data-action"))}).forEach(function(Y){N.currentMarker===void 0?(Y.style.fillOpacity="0.4",Y.style.pointerEvents="none"):(Y.style.fillOpacity="1",Y.style.pointerEvents="all")})},X}(),h=function(){function X(M,N,Y,ie){this.panels=[],this.panelButtons=[],this.markerjsContainer=M,this.displayMode=N,this.uiStyleSettings=Y,this.styles=ie,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return X.prototype.addStyles=function(){var M;this.toolboxStyleClass=this.styles.addClass(new f("toolbox",`
width: 100%;
flex-shrink: 0;
display: flex;
flex-direction: column;
font-family: sans-serif;
`+(this.displayMode==="popup"?"height:"+2.5*this.uiStyleSettings.toolbarHeight+"px;":"")+`
box-sizing: content-box;
`+(this.displayMode==="popup"?"background-color: "+this.uiStyleSettings.canvasBackgroundColor+";":"")+`
`+(this.displayMode==="inline"?"border-bottom-left-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
`+(this.displayMode==="inline"?"border-bottom-right-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
overflow: hidden;
`)),this.toolboxStyleColorsClass=this.styles.addClass(new f("toolbox_colors",`
color: `+this.uiStyleSettings.toolboxColor+`;
`));var N=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new f("toolbox-button-row",`
display: flex;
cursor: default;
box-sizing: content-box;
`)),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new f("toolbox-button-row_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
`)),this.toolboxPanelRowStyleClass=this.styles.addClass(new f("toolbox-panel-row",`
display: flex;
`+(this.displayMode==="inline"?"position: absolute;":"")+`
`+(this.displayMode==="inline"?"bottom: "+this.uiStyleSettings.toolbarHeight+"px;":"")+`
cursor: default;
height: `+1.5*this.uiStyleSettings.toolbarHeight+`px;
`+(this.displayMode==="inline"?"width: 100%;":"")+`
box-sizing: content-box;
`)),this.toolboxPanelRowStyleColorsClass=this.styles.addClass(new f("toolbox-panel-row_colors",`
background-color: `+((M=this.uiStyleSettings.toolboxBackgroundColor)!==null&&M!==void 0?M:this.uiStyleSettings.toolbarBackgroundHoverColor)+`;
`)),this.toolboxButtonStyleClass=this.styles.addClass(new f("toolbox_button",`
display: inline-block;
width: `+(this.uiStyleSettings.toolbarHeight-2*N)+`px;
height: `+(this.uiStyleSettings.toolbarHeight-2*N)+`px;
padding: `+N+`px;
box-sizing: content-box;
`)),this.toolboxButtonStyleColorsClass=this.styles.addClass(new f("toolbox-button_colors",`
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new f("toolbox-active-button_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`;
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.styles.addRule(new g("."+this.toolboxButtonStyleColorsClass.name+":hover",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`)),this.styles.addRule(new g("."+this.toolboxButtonStyleClass.name+" svg",`
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
`))},X.prototype.show=function(M){var N;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=M,this.uiContainer.className=this.toolboxStyleClass.name+" "+((N=this.uiStyleSettings.toolboxStyleColorsClassName)!==null&&N!==void 0?N:this.toolboxStyleColorsClass.name),this.markerjsContainer.appendChild(this.uiContainer)},X.prototype.setPanelButtons=function(M){var N,Y,ie=this;this.panels=M,this.uiContainer!==void 0&&(this.uiContainer.innerHTML="",this.panelRow=document.createElement("div"),this.panelRow.className=this.toolboxPanelRowStyleClass.name+" "+((N=this.uiStyleSettings.toolboxPanelRowStyleColorsClassName)!==null&&N!==void 0?N:this.toolboxPanelRowStyleColorsClass.name),this.uiContainer.appendChild(this.panelRow),this.buttonRow=document.createElement("div"),this.buttonRow.className=this.toolboxButtonRowStyleClass.name+" "+((Y=this.uiStyleSettings.toolboxButtonRowStyleColorsClassName)!==null&&Y!==void 0?Y:this.toolboxButtonRowStyleColorsClass.name)+" ",this.uiContainer.appendChild(this.buttonRow),this.panelButtons.splice(0),this.panels.forEach(function(K){var pe;K.uiStyleSettings=ie.uiStyleSettings;var Se=document.createElement("div");Se.className=ie.toolboxButtonStyleClass.name+" "+((pe=ie.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&pe!==void 0?pe:ie.toolboxButtonStyleColorsClass.name),Se.innerHTML=K.icon,Se.title=K.title,Se.addEventListener("click",function(){ie.panelButtonClick(K)}),ie.panelButtons.push(Se),ie.buttonRow.appendChild(Se)}),this.displayMode==="inline"?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},X.prototype.panelButtonClick=function(M){var N=this,Y=-1;if(M!==this.activePanel){Y=this.panels.indexOf(M),this.panelRow.innerHTML="";var ie=M.getUi();ie.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.panelRow.appendChild(ie),this.panelRow.style.display="flex",this.panelRow.style.visibility="visible",this.panelRow.className=this.panelRow.className.replace(this.styles.fadeOutAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeInAnimationClassName,this.activePanel=M}else this.activePanel=void 0,this.panelRow.className=this.panelRow.className.replace(this.styles.fadeInAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeOutAnimationClassName,setTimeout(function(){N.displayMode==="inline"?N.panelRow.style.display="none":N.panelRow.style.visibility="hidden"},200);this.panelButtons.forEach(function(K,pe){var Se,Pe;K.className=N.toolboxButtonStyleClass.name+" "+(pe===Y?""+((Se=N.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&Se!==void 0?Se:N.toolboxActiveButtonStyleColorsClass.name):""+((Pe=N.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&Pe!==void 0?Pe:N.toolboxButtonStyleColorsClass.name))})},X}(),o=function(X,M){this.title=X,this.icon=M},p=function(X){function M(N,Y,ie,K){var pe=X.call(this,N,K||'<svg viewBox="0 0 24 24"><path d="M17.5 12a1.5 1.5 0 01-1.5-1.5A1.5 1.5 0 0117.5 9a1.5 1.5 0 011.5 1.5 1.5 1.5 0 01-1.5 1.5m-3-4A1.5 1.5 0 0113 6.5 1.5 1.5 0 0114.5 5 1.5 1.5 0 0116 6.5 1.5 1.5 0 0114.5 8m-5 0A1.5 1.5 0 018 6.5 1.5 1.5 0 019.5 5 1.5 1.5 0 0111 6.5 1.5 1.5 0 019.5 8m-3 4A1.5 1.5 0 015 10.5 1.5 1.5 0 016.5 9 1.5 1.5 0 018 10.5 1.5 1.5 0 016.5 12M12 3a9 9 0 00-9 9 9 9 0 009 9 1.5 1.5 0 001.5-1.5c0-.39-.15-.74-.39-1-.23-.27-.38-.62-.38-1a1.5 1.5 0 011.5-1.5H16a5 5 0 005-5c0-4.42-4.03-8-9-8z"/></svg>')||this;return pe.colors=[],pe.addTransparent=!1,pe.colorBoxes=[],pe.colors=Y,pe.currentColor=ie,pe.setCurrentColor=pe.setCurrentColor.bind(pe),pe.getColorBox=pe.getColorBox.bind(pe),pe}return $(M,X),M.prototype.getUi=function(){var N=this,Y=document.createElement("div");return Y.style.overflow="hidden",Y.style.whiteSpace="nowrap",this.colors.forEach(function(ie){var K=N.getColorBox(ie);Y.appendChild(K),N.colorBoxes.push(K)}),Y},M.prototype.getColorBox=function(N){var Y=this,ie=this.uiStyleSettings.toolbarHeight/4,K=this.uiStyleSettings.toolbarHeight-ie,pe=document.createElement("div");pe.style.display="inline-block",pe.style.boxSizing="content-box",pe.style.width=K-2+"px",pe.style.height=K-2+"px",pe.style.padding="1px",pe.style.marginRight="2px",pe.style.marginBottom="2px",pe.style.borderWidth="2px",pe.style.borderStyle="solid",pe.style.borderRadius=(K+2)/2+"px",pe.style.borderColor=N===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",pe.addEventListener("click",function(){Y.setCurrentColor(N,pe)});var Se=document.createElement("div");return Se.style.display="inline-block",Se.style.width=K-2+"px",Se.style.height=K-2+"px",Se.style.backgroundColor=N,Se.style.borderRadius=K/2+"px",N==="transparent"&&(Se.style.fill=this.uiStyleSettings.toolboxAccentColor,Se.innerHTML=`<svg viewBox="0 0 24 24">
<path d="M2,5.27L3.28,4L20,20.72L18.73,22L15.65,18.92C14.5,19.3 13.28,19.5 12,19.5C7,19.5 2.73,16.39 1,12C1.69,10.24 2.79,8.69 4.19,7.46L2,5.27M12,9A3,3 0 0,1 15,12C15,12.35 14.94,12.69 14.83,13L11,9.17C11.31,9.06 11.65,9 12,9M12,4.5C17,4.5 21.27,7.61 23,12C22.18,14.08 20.79,15.88 19,17.19L17.58,15.76C18.94,14.82 20.06,13.54 20.82,12C19.17,8.64 15.76,6.5 12,6.5C10.91,6.5 9.84,6.68 8.84,7L7.3,5.47C8.74,4.85 10.33,4.5 12,4.5M3.18,12C4.83,15.36 8.24,17.5 12,17.5C12.69,17.5 13.37,17.43 14,17.29L11.72,15C10.29,14.85 9.15,13.71 9,12.28L5.6,8.87C4.61,9.72 3.78,10.78 3.18,12Z" />
</svg>`),pe.appendChild(Se),pe},M.prototype.setCurrentColor=function(N,Y){var ie=this;this.currentColor=N,this.colorBoxes.forEach(function(K){K.style.borderColor=K===Y?ie.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onColorChanged&&this.onColorChanged(N)},M}(o),l=function(){function X(M,N,Y){this._state="new",this._isSelected=!1,this._container=M,this._overlayContainer=N,this.globalSettings=Y,this.stateChanged=this.stateChanged.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this)}return Object.defineProperty(X.prototype,"typeName",{get:function(){return Object.getPrototypeOf(this).constructor.typeName},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"container",{get:function(){return this._container},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"overlayContainer",{get:function(){return this._overlayContainer},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"toolboxPanels",{get:function(){return[]},enumerable:!1,configurable:!0}),X.prototype.ownsTarget=function(M){return!1},Object.defineProperty(X.prototype,"isSelected",{get:function(){return this._isSelected},enumerable:!1,configurable:!0}),X.prototype.select=function(){this.container.style.cursor="move",this._isSelected=!0,this.manipulationStartState=this.getState()},X.prototype.deselect=function(){this.container.style.cursor="default",this._isSelected=!1,this.stateChanged()},X.prototype.pointerDown=function(M,N){},X.prototype.dblClick=function(M,N){},X.prototype.manipulate=function(M){},X.prototype.pointerUp=function(M){this.stateChanged()},X.prototype.dispose=function(){},X.prototype.addMarkerVisualToContainer=function(M){this.container.childNodes.length>0?this.container.insertBefore(M,this.container.childNodes[0]):this.container.appendChild(M)},X.prototype.getState=function(){return{typeName:X.typeName,state:this.state,notes:this.notes}},X.prototype.restoreState=function(M){this._state=M.state,this.notes=M.notes},X.prototype.scale=function(M,N){},X.prototype.colorChanged=function(M){this.onColorChanged&&this.onColorChanged(M),this.stateChanged()},X.prototype.fillColorChanged=function(M){this.onFillColorChanged&&this.onFillColorChanged(M),this.stateChanged()},X.prototype.stateChanged=function(){if(this.onStateChanged&&this.state!=="creating"&&this.state!=="new"){var M=this.getState();this.manipulationStartState!==void 0&&(this.manipulationStartState.state="select"),M.state="select",JSON.stringify(this.manipulationStartState)!=JSON.stringify(M)&&this.onStateChanged(this)}},X.typeName="MarkerBase",X}(),u=function(){function X(){this.findGripByVisual=this.findGripByVisual.bind(this)}return X.prototype.findGripByVisual=function(M){return this.topLeft.ownsTarget(M)?this.topLeft:this.topCenter.ownsTarget(M)?this.topCenter:this.topRight.ownsTarget(M)?this.topRight:this.centerLeft.ownsTarget(M)?this.centerLeft:this.centerRight.ownsTarget(M)?this.centerRight:this.bottomLeft.ownsTarget(M)?this.bottomLeft:this.bottomCenter.ownsTarget(M)?this.bottomCenter:this.bottomRight.ownsTarget(M)?this.bottomRight:void 0},X}(),a=function(){function X(){this.GRIP_SIZE=10,this.visual=L.createGroup(),this.visual.appendChild(L.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(L.createCircle(this.GRIP_SIZE,[["fill","#cccccc"],["fill-opacity","0.7"],["stroke","#333333"],["stroke-width","2"],["stroke-opacity","0.7"]]))}return X.prototype.ownsTarget=function(M){return M===this.visual||M===this.visual.childNodes[0]||M===this.visual.childNodes[1]},X}(),s=function(){function X(){}return X.toITransformMatrix=function(M){return{a:M.a,b:M.b,c:M.c,d:M.d,e:M.e,f:M.f}},X.toSVGMatrix=function(M,N){return M.a=N.a,M.b=N.b,M.c=N.c,M.d=N.d,M.e=N.e,M.f=N.f,M},X}(),C=function(X){function M(N,Y,ie){var K=X.call(this,N,Y,ie)||this;return K.left=0,K.top=0,K.width=0,K.height=0,K.defaultSize={x:50,y:20},K.offsetX=0,K.offsetY=0,K.rotationAngle=0,K.CB_DISTANCE=10,K._suppressMarkerCreateEvent=!1,K.container.transform.baseVal.appendItem(L.createTransform()),K.setupControlBox(),K}return $(M,X),Object.defineProperty(M.prototype,"centerX",{get:function(){return this.left+this.width/2},enumerable:!1,configurable:!0}),Object.defineProperty(M.prototype,"centerY",{get:function(){return this.top+this.height/2},enumerable:!1,configurable:!0}),Object.defineProperty(M.prototype,"visual",{get:function(){return this._visual},set:function(N){this._visual=N;var Y=L.createTransform();this._visual.transform.baseVal.appendItem(Y)},enumerable:!1,configurable:!0}),M.prototype.ownsTarget=function(N){return!!X.prototype.ownsTarget.call(this,N)||!!(this.controlGrips.findGripByVisual(N)!==void 0||this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(N))},M.prototype.pointerDown=function(N,Y){X.prototype.pointerDown.call(this,N,Y),this.state==="new"&&(this.left=N.x,this.top=N.y),this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.manipulationStartWidth=this.width,this.manipulationStartHeight=this.height;var ie=this.unrotatePoint(N);if(this.manipulationStartX=ie.x,this.manipulationStartY=ie.y,this.offsetX=ie.x-this.left,this.offsetY=ie.y-this.top,this.state!=="new")if(this.select(),this.activeGrip=this.controlGrips.findGripByVisual(Y),this.activeGrip!==void 0)this._state="resize";else if(this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(Y)){this.activeGrip=this.rotatorGrip;var K=this.rotatePoint({x:this.centerX,y:this.centerY});this.left=K.x-this.width/2,this.top=K.y-this.height/2,this.moveVisual({x:this.left,y:this.top});var pe=this.container.transform.baseVal.getItem(0);pe.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(pe,0),this.adjustControlBox(),this._state="rotate"}else this._state="move"},M.prototype.pointerUp=function(N){var Y=this.state;X.prototype.pointerUp.call(this,N),this.state==="creating"&&this.width<10&&this.height<10?(this.width=this.defaultSize.x,this.height=this.defaultSize.y):this.manipulate(N),this._state="select",Y==="creating"&&this.onMarkerCreated&&this._suppressMarkerCreateEvent===!1&&this.onMarkerCreated(this)},M.prototype.moveVisual=function(N){this.visual.style.transform="translate("+N.x+"px, "+N.y+"px)"},M.prototype.manipulate=function(N){var Y=this.unrotatePoint(N);this.state==="creating"?this.resize(N):this.state==="move"?(this.left=this.manipulationStartLeft+(Y.x-this.manipulationStartLeft)-this.offsetX,this.top=this.manipulationStartTop+(Y.y-this.manipulationStartTop)-this.offsetY,this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()):this.state==="resize"?this.resize(Y):this.state==="rotate"&&this.rotate(N)},M.prototype.resize=function(N){var Y=this.manipulationStartLeft,ie=this.manipulationStartWidth,K=this.manipulationStartTop,pe=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:Y=this.manipulationStartLeft+N.x-this.manipulationStartX,ie=this.manipulationStartWidth+this.manipulationStartLeft-Y;break;case this.controlGrips.bottomRight:case this.controlGrips.centerRight:case this.controlGrips.topRight:case void 0:ie=this.manipulationStartWidth+N.x-this.manipulationStartX}switch(this.activeGrip){case this.controlGrips.topCenter:case this.controlGrips.topLeft:case this.controlGrips.topRight:K=this.manipulationStartTop+N.y-this.manipulationStartY,pe=this.manipulationStartHeight+this.manipulationStartTop-K;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:pe=this.manipulationStartHeight+N.y-this.manipulationStartY}ie>=0?(this.left=Y,this.width=ie):(this.left=Y+ie,this.width=-ie),pe>=0?(this.top=K,this.height=pe):(this.top=K+pe,this.height=-pe),this.setSize()},M.prototype.setSize=function(){this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()},M.prototype.rotate=function(N){if(Math.abs(N.x-this.centerX)>.1){var Y=Math.sign(N.x-this.centerX);this.rotationAngle=180*Math.atan((N.y-this.centerY)/(N.x-this.centerX))/Math.PI+90*Y,this.applyRotation()}},M.prototype.applyRotation=function(){var N=this.container.transform.baseVal.getItem(0);N.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(N,0)},M.prototype.rotatePoint=function(N){if(this.rotationAngle===0)return N;var Y=this.container.getCTM(),ie=L.createPoint(N.x,N.y);return{x:(ie=ie.matrixTransform(Y)).x,y:ie.y}},M.prototype.unrotatePoint=function(N){if(this.rotationAngle===0)return N;var Y=this.container.getCTM();Y=Y.inverse();var ie=L.createPoint(N.x,N.y);return{x:(ie=ie.matrixTransform(Y)).x,y:ie.y}},M.prototype.select=function(){X.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},M.prototype.deselect=function(){X.prototype.deselect.call(this),this.controlBox.style.display="none"},M.prototype.setupControlBox=function(){this.controlBox=L.createGroup();var N=L.createTransform();N.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(N),this.container.appendChild(this.controlBox),this.controlRect=L.createRect(this.width+this.CB_DISTANCE,this.height+this.CB_DISTANCE,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"],["fill","transparent"],["pointer-events","none"]]),this.controlBox.appendChild(this.controlRect),this.globalSettings.disableRotation!==!0&&(this.rotatorGripLine=L.createLine((this.width+2*this.CB_DISTANCE)/2,this.top-this.CB_DISTANCE,(this.width+2*this.CB_DISTANCE)/2,this.top-3*this.CB_DISTANCE,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.controlBox.appendChild(this.rotatorGripLine)),this.controlGrips=new u,this.addControlGrips(),this.controlBox.style.display="none"},M.prototype.adjustControlBox=function(){var N=this.controlBox.transform.baseVal.getItem(0);N.setTranslate(this.left-this.CB_DISTANCE/2,this.top-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.replaceItem(N,0),this.controlRect.setAttribute("width",(this.width+this.CB_DISTANCE).toString()),this.controlRect.setAttribute("height",(this.height+this.CB_DISTANCE).toString()),this.rotatorGripLine!==void 0&&(this.rotatorGripLine.setAttribute("x1",((this.width+this.CB_DISTANCE)/2).toString()),this.rotatorGripLine.setAttribute("y1",(-this.CB_DISTANCE/2).toString()),this.rotatorGripLine.setAttribute("x2",((this.width+this.CB_DISTANCE)/2).toString()),this.rotatorGripLine.setAttribute("y2",(3*-this.CB_DISTANCE).toString())),this.positionGrips()},M.prototype.addControlGrips=function(){this.controlGrips.topLeft=this.createGrip(),this.controlGrips.topCenter=this.createGrip(),this.controlGrips.topRight=this.createGrip(),this.controlGrips.centerLeft=this.createGrip(),this.controlGrips.centerRight=this.createGrip(),this.controlGrips.bottomLeft=this.createGrip(),this.controlGrips.bottomCenter=this.createGrip(),this.controlGrips.bottomRight=this.createGrip(),this.globalSettings.disableRotation!==!0&&(this.rotatorGrip=this.createGrip()),this.positionGrips()},M.prototype.createGrip=function(){var N=new a;return N.visual.transform.baseVal.appendItem(L.createTransform()),this.controlBox.appendChild(N.visual),N},M.prototype.positionGrips=function(){var N=this.controlGrips.topLeft.GRIP_SIZE,Y=-N/2,ie=Y,K=(this.width+this.CB_DISTANCE)/2-N/2,pe=(this.height+this.CB_DISTANCE)/2-N/2,Se=this.height+this.CB_DISTANCE-N/2,Pe=this.width+this.CB_DISTANCE-N/2;this.positionGrip(this.controlGrips.topLeft.visual,Y,ie),this.positionGrip(this.controlGrips.topCenter.visual,K,ie),this.positionGrip(this.controlGrips.topRight.visual,Pe,ie),this.positionGrip(this.controlGrips.centerLeft.visual,Y,pe),this.positionGrip(this.controlGrips.centerRight.visual,Pe,pe),this.positionGrip(this.controlGrips.bottomLeft.visual,Y,Se),this.positionGrip(this.controlGrips.bottomCenter.visual,K,Se),this.positionGrip(this.controlGrips.bottomRight.visual,Pe,Se),this.rotatorGrip!==void 0&&this.positionGrip(this.rotatorGrip.visual,K,ie-3*this.CB_DISTANCE)},M.prototype.positionGrip=function(N,Y,ie){var K=N.transform.baseVal.getItem(0);K.setTranslate(Y,ie),N.transform.baseVal.replaceItem(K,0)},M.prototype.hideControlBox=function(){this.controlBox.style.display="none"},M.prototype.showControlBox=function(){this.controlBox.style.display=""},M.prototype.getState=function(){return Object.assign({left:this.left,top:this.top,width:this.width,height:this.height,rotationAngle:this.rotationAngle,visualTransformMatrix:s.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:s.toITransformMatrix(this.container.transform.baseVal.getItem(0).matrix)},X.prototype.getState.call(this))},M.prototype.restoreState=function(N){X.prototype.restoreState.call(this,N);var Y=N;this.left=Y.left,this.top=Y.top,this.width=Y.width,this.height=Y.height,this.rotationAngle=Y.rotationAngle,this.visual.transform.baseVal.getItem(0).setMatrix(s.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,Y.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(s.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,Y.containerTransformMatrix))},M.prototype.scale=function(N,Y){X.prototype.scale.call(this,N,Y);var ie=this.rotatePoint({x:this.left,y:this.top}),K=this.unrotatePoint({x:ie.x*N,y:ie.y*Y});this.left=K.x,this.top=K.y,this.width=this.width*N,this.height=this.height*Y,this.adjustControlBox()},M}(l),_=function(X){function M(N,Y,ie){var K=X.call(this,N,Y,ie)||this;return K.fillColor="transparent",K.strokeColor="transparent",K.strokeWidth=0,K.strokeDasharray="",K.opacity=1,K.setStrokeColor=K.setStrokeColor.bind(K),K.setFillColor=K.setFillColor.bind(K),K.setStrokeWidth=K.setStrokeWidth.bind(K),K.setStrokeDasharray=K.setStrokeDasharray.bind(K),K.createVisual=K.createVisual.bind(K),K}return $(M,X),M.prototype.ownsTarget=function(N){return!(!X.prototype.ownsTarget.call(this,N)&&N!==this.visual)},M.prototype.createVisual=function(){this.visual=L.createRect(1,1,[["fill",this.fillColor],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["stroke-dasharray",this.strokeDasharray],["opacity",this.opacity.toString()]]),this.addMarkerVisualToContainer(this.visual)},M.prototype.pointerDown=function(N,Y){X.prototype.pointerDown.call(this,N,Y),this.state==="new"&&(this.createVisual(),this.moveVisual(N),this._state="creating")},M.prototype.manipulate=function(N){X.prototype.manipulate.call(this,N)},M.prototype.resize=function(N){X.prototype.resize.call(this,N),this.setSize()},M.prototype.setSize=function(){X.prototype.setSize.call(this),L.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},M.prototype.pointerUp=function(N){X.prototype.pointerUp.call(this,N),this.setSize()},M.prototype.setStrokeColor=function(N){this.strokeColor=N,this.visual&&L.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(N),this.stateChanged()},M.prototype.setFillColor=function(N){this.fillColor=N,this.visual&&L.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},M.prototype.setStrokeWidth=function(N){this.strokeWidth=N,this.visual&&L.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},M.prototype.setStrokeDasharray=function(N){this.strokeDasharray=N,this.visual&&L.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},M.prototype.getState=function(){return Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},X.prototype.getState.call(this))},M.prototype.restoreState=function(N){var Y=N;this.fillColor=Y.fillColor,this.strokeColor=Y.strokeColor,this.strokeWidth=Y.strokeWidth,this.strokeDasharray=Y.strokeDasharray,this.opacity=Y.opacity,this.createVisual(),X.prototype.restoreState.call(this,N),this.setSize()},M.prototype.scale=function(N,Y){X.prototype.scale.call(this,N,Y),this.setSize()},M.title="Rectangle marker",M}(C),w=function(X){function M(N,Y,ie,K){var pe=X.call(this,N,K||'<svg viewBox="0 0 24 24"><path d="M3 17h18v-2H3v2m0 3h18v-1H3v1m0-7h18v-3H3v3m0-9v4h18V4H3z"/></svg>')||this;return pe.widths=[],pe.widthBoxes=[],pe.widths=Y,pe.currentWidth=ie,pe.setCurrentWidth=pe.setCurrentWidth.bind(pe),pe}return $(M,X),M.prototype.getUi=function(){var N=this,Y=document.createElement("div");return Y.style.display="flex",Y.style.overflow="hidden",Y.style.flexGrow="2",this.widths.forEach(function(ie){var K=document.createElement("div");K.style.display="flex",K.style.flexGrow="2",K.style.alignItems="center",K.style.justifyContent="space-between",K.style.padding="5px",K.style.borderWidth="2px",K.style.borderStyle="solid",K.style.borderColor=ie===N.currentWidth?N.uiStyleSettings.toolboxAccentColor:"transparent",K.addEventListener("click",function(){N.setCurrentWidth(ie,K)}),Y.appendChild(K);var pe=document.createElement("div");pe.innerText=ie.toString(),pe.style.marginRight="5px",K.appendChild(pe);var Se=document.createElement("div");Se.style.minHeight="20px",Se.style.flexGrow="2",Se.style.display="flex",Se.style.alignItems="center";var Pe=document.createElement("hr");Pe.style.minWidth="20px",Pe.style.border="0px",Pe.style.borderTop=ie+"px solid "+N.uiStyleSettings.toolboxColor,Pe.style.flexGrow="2",Se.appendChild(Pe),K.appendChild(Se),N.widthBoxes.push(K)}),Y},M.prototype.setCurrentWidth=function(N,Y){var ie=this;this.currentWidth=N,this.widthBoxes.forEach(function(K){K.style.borderColor=K===Y?ie.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},M}(o),O=function(X){function M(N,Y,ie,K){var pe=X.call(this,N,K||'<svg viewBox="0 0 24 24"><path d="M3 16h5v-2H3v2m6.5 0h5v-2h-5v2m6.5 0h5v-2h-5v2M3 20h2v-2H3v2m4 0h2v-2H7v2m4 0h2v-2h-2v2m4 0h2v-2h-2v2m4 0h2v-2h-2v2M3 12h8v-2H3v2m10 0h8v-2h-8v2M3 4v4h18V4H3z"/></svg>')||this;return pe.styles=[],pe.styleBoxes=[],pe.styles=Y,pe.currentStyle=ie,pe.setCurrentStyle=pe.setCurrentStyle.bind(pe),pe}return $(M,X),M.prototype.getUi=function(){var N=this,Y=document.createElement("div");return Y.style.display="flex",Y.style.overflow="hidden",Y.style.flexGrow="2",this.styles.forEach(function(ie){var K=document.createElement("div");K.style.display="flex",K.style.alignItems="center",K.style.justifyContent="space-between",K.style.padding="5px",K.style.borderWidth="2px",K.style.borderStyle="solid",K.style.overflow="hidden",K.style.maxWidth=100/N.styles.length-5+"%",K.style.borderColor=ie===N.currentStyle?N.uiStyleSettings.toolboxAccentColor:"transparent",K.addEventListener("click",function(){N.setCurrentStyle(ie,K)}),Y.appendChild(K);var pe=document.createElement("div");pe.style.minHeight="20px",pe.style.flexGrow="2",pe.style.overflow="hidden";var Se=`<svg width="100" height="20">
<line x1="0" y1="10" x2="100" y2="10" stroke="`+N.uiStyleSettings.toolboxColor+'" stroke-width="3" '+(ie!==""?'stroke-dasharray="'+ie+'"':"")+` />
</svg>`;pe.innerHTML=Se,K.appendChild(pe),N.styleBoxes.push(K)}),Y},M.prototype.setCurrentStyle=function(N,Y){var ie=this;this.currentStyle=N,this.styleBoxes.forEach(function(K){K.style.borderColor=K===Y?ie.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},M}(o),R=function(X){function M(N,Y,ie){var K=X.call(this,N,Y,ie)||this;return K.strokeColor=ie.defaultColor,K.strokeWidth=ie.defaultStrokeWidth,K.strokeDasharray=ie.defaultStrokeDasharray,K.strokePanel=new p("Line color",ie.defaultColorSet,ie.defaultColor),K.strokePanel.onColorChanged=K.setStrokeColor,K.strokeWidthPanel=new w("Line width",ie.defaultStrokeWidths,ie.defaultStrokeWidth),K.strokeWidthPanel.onWidthChanged=K.setStrokeWidth,K.strokeStylePanel=new O("Line style",ie.defaultStrokeDasharrays,ie.defaultStrokeDasharray),K.strokeStylePanel.onStyleChanged=K.setStrokeDasharray,K}return $(M,X),Object.defineProperty(M.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),M.prototype.getState=function(){var N=X.prototype.getState.call(this);return N.typeName=M.typeName,N},M.typeName="FrameMarker",M.title="Frame marker",M.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4m14 11H6V8h12v9z"/></svg>',M}(_),S=function(){this.defaultColorSet=["#EF4444","#10B981","#2563EB","#FFFF00","#7C3AED","#F472B6","#000000","#FFFFFF"],this.defaultColor=this.defaultColorSet[0],this.defaultFillColor=this.defaultColorSet[0],this.defaultStrokeColor=this.defaultColorSet[7],this.defaultHighlightColor=this.defaultColorSet[3],this.defaultStrokeWidth=3,this.defaultStrokeDasharray="",this.defaultHighlightOpacity=.5,this.defaultFontFamily="Helvetica, Arial, sans-serif",this.defaultStrokeWidths=[1,2,3,5,10],this.defaultStrokeDasharrays=["","3","12 3","9 6 3 6"],this.defaultOpacitySteps=[.1,.25,.5,.75,1],this.displayMode="inline",this.defaultFontFamilies=['Times, "Times New Roman", serif',"Helvetica, Arial, sans-serif",'Courier, "Courier New", monospace',"cursive","fantasy"],this.popupMargin=30,this.newFreehandMarkerOnPointerUp=!1,this.defaultColorsFollowCurrentColors=!1,this.freehandPixelRatio=1,this.disableRotation=!1},T=function(X){function M(N,Y,ie){var K=X.call(this,N,Y,ie)||this;return K.x1=0,K.y1=0,K.x2=0,K.y2=0,K.defaultLength=50,K.manipulationStartX=0,K.manipulationStartY=0,K.manipulationStartX1=0,K.manipulationStartY1=0,K.manipulationStartX2=0,K.manipulationStartY2=0,K.setupControlBox(),K}return $(M,X),M.prototype.ownsTarget=function(N){return!!X.prototype.ownsTarget.call(this,N)||!(!this.grip1.ownsTarget(N)&&!this.grip2.ownsTarget(N))},M.prototype.pointerDown=function(N,Y){X.prototype.pointerDown.call(this,N,Y),this.manipulationStartX=N.x,this.manipulationStartY=N.y,this.state==="new"&&(this.x1=N.x,this.y1=N.y,this.x2=N.x,this.y2=N.y),this.manipulationStartX1=this.x1,this.manipulationStartY1=this.y1,this.manipulationStartX2=this.x2,this.manipulationStartY2=this.y2,this.state!=="new"&&(this.select(),this.grip1.ownsTarget(Y)?this.activeGrip=this.grip1:this.grip2.ownsTarget(Y)?this.activeGrip=this.grip2:this.activeGrip=void 0,this.activeGrip?this._state="resize":this._state="move")},M.prototype.pointerUp=function(N){var Y=this.state;X.prototype.pointerUp.call(this,N),this.state==="creating"&&Math.abs(this.x1-this.x2)<10&&Math.abs(this.y1-this.y2)<10?(this.x2=this.x1+this.defaultLength,this.adjustVisual(),this.adjustControlBox()):this.manipulate(N),this._state="select",Y==="creating"&&this.onMarkerCreated&&this.onMarkerCreated(this)},M.prototype.adjustVisual=function(){},M.prototype.manipulate=function(N){this.state==="creating"?this.resize(N):this.state==="move"?(this.x1=this.manipulationStartX1+N.x-this.manipulationStartX,this.y1=this.manipulationStartY1+N.y-this.manipulationStartY,this.x2=this.manipulationStartX2+N.x-this.manipulationStartX,this.y2=this.manipulationStartY2+N.y-this.manipulationStartY,this.adjustVisual(),this.adjustControlBox()):this.state==="resize"&&this.resize(N)},M.prototype.resize=function(N){switch(this.activeGrip){case this.grip1:this.x1=N.x,this.y1=N.y;break;case this.grip2:case void 0:this.x2=N.x,this.y2=N.y}this.adjustVisual(),this.adjustControlBox()},M.prototype.select=function(){X.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},M.prototype.deselect=function(){X.prototype.deselect.call(this),this.controlBox.style.display="none"},M.prototype.setupControlBox=function(){this.controlBox=L.createGroup(),this.container.appendChild(this.controlBox),this.addControlGrips(),this.controlBox.style.display="none"},M.prototype.adjustControlBox=function(){this.positionGrips()},M.prototype.addControlGrips=function(){this.grip1=this.createGrip(),this.grip2=this.createGrip(),this.positionGrips()},M.prototype.createGrip=function(){var N=new a;return N.visual.transform.baseVal.appendItem(L.createTransform()),this.controlBox.appendChild(N.visual),N},M.prototype.positionGrips=function(){var N=this.grip1.GRIP_SIZE;this.positionGrip(this.grip1.visual,this.x1-N/2,this.y1-N/2),this.positionGrip(this.grip2.visual,this.x2-N/2,this.y2-N/2)},M.prototype.positionGrip=function(N,Y,ie){var K=N.transform.baseVal.getItem(0);K.setTranslate(Y,ie),N.transform.baseVal.replaceItem(K,0)},M.prototype.getState=function(){return Object.assign({x1:this.x1,y1:this.y1,x2:this.x2,y2:this.y2},X.prototype.getState.call(this))},M.prototype.restoreState=function(N){X.prototype.restoreState.call(this,N);var Y=N;this.x1=Y.x1,this.y1=Y.y1,this.x2=Y.x2,this.y2=Y.y2},M.prototype.scale=function(N,Y){X.prototype.scale.call(this,N,Y),this.x1=this.x1*N,this.y1=this.y1*Y,this.x2=this.x2*N,this.y2=this.y2*Y,this.adjustVisual(),this.adjustControlBox()},M}(l),E=function(X){function M(N,Y,ie){var K=X.call(this,N,Y,ie)||this;return K.strokeColor="transparent",K.strokeWidth=0,K.strokeDasharray="",K.setStrokeColor=K.setStrokeColor.bind(K),K.setStrokeWidth=K.setStrokeWidth.bind(K),K.setStrokeDasharray=K.setStrokeDasharray.bind(K),K.strokeColor=ie.defaultColor,K.strokeWidth=ie.defaultStrokeWidth,K.strokeDasharray=ie.defaultStrokeDasharray,K.strokePanel=new p("Line color",ie.defaultColorSet,ie.defaultColor),K.strokePanel.onColorChanged=K.setStrokeColor,K.strokeWidthPanel=new w("Line width",ie.defaultStrokeWidths,ie.defaultStrokeWidth),K.strokeWidthPanel.onWidthChanged=K.setStrokeWidth,K.strokeStylePanel=new O("Line style",ie.defaultStrokeDasharrays,ie.defaultStrokeDasharray),K.strokeStylePanel.onStyleChanged=K.setStrokeDasharray,K}return $(M,X),M.prototype.ownsTarget=function(N){return!(!X.prototype.ownsTarget.call(this,N)&&N!==this.visual&&N!==this.selectorLine&&N!==this.visibleLine)},M.prototype.createVisual=function(){this.visual=L.createGroup(),this.selectorLine=L.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=L.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.visual.appendChild(this.selectorLine),this.visual.appendChild(this.visibleLine),this.addMarkerVisualToContainer(this.visual)},M.prototype.pointerDown=function(N,Y){X.prototype.pointerDown.call(this,N,Y),this.state==="new"&&(this.createVisual(),this.adjustVisual(),this._state="creating")},M.prototype.adjustVisual=function(){this.selectorLine&&this.visibleLine&&(this.selectorLine.setAttribute("x1",this.x1.toString()),this.selectorLine.setAttribute("y1",this.y1.toString()),this.selectorLine.setAttribute("x2",this.x2.toString()),this.selectorLine.setAttribute("y2",this.y2.toString()),this.visibleLine.setAttribute("x1",this.x1.toString()),this.visibleLine.setAttribute("y1",this.y1.toString()),this.visibleLine.setAttribute("x2",this.x2.toString()),this.visibleLine.setAttribute("y2",this.y2.toString()),L.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),L.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),L.setAttributes(this.visibleLine,[["stroke-dasharray",this.strokeDasharray.toString()]]))},M.prototype.setStrokeColor=function(N){this.strokeColor=N,this.adjustVisual(),this.colorChanged(N)},M.prototype.setStrokeWidth=function(N){this.strokeWidth=N,this.adjustVisual()},M.prototype.setStrokeDasharray=function(N){this.strokeDasharray=N,this.adjustVisual(),this.stateChanged()},Object.defineProperty(M.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),M.prototype.getState=function(){var N=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray},X.prototype.getState.call(this));return N.typeName=M.typeName,N},M.prototype.restoreState=function(N){X.prototype.restoreState.call(this,N);var Y=N;this.strokeColor=Y.strokeColor,this.strokeWidth=Y.strokeWidth,this.strokeDasharray=Y.strokeDasharray,this.createVisual(),this.adjustVisual()},M.typeName="LineMarker",M.title="Line marker",M.icon='<svg viewBox="0 0 24 24"><path d="M19 13H5v-2h14v2z"/></svg>',M}(T),c=function(X){function M(N,Y,ie,K){var pe=X.call(this,N,K||'<svg viewBox="0 0 24 24"><path d="M17 8h3v12h1v1h-4v-1h1v-3h-4l-1.5 3H14v1h-4v-1h1l6-12m1 1l-3.5 7H18V9M5 3h5c1.11 0 2 .89 2 2v11H9v-5H6v5H3V5c0-1.11.89-2 2-2m1 2v4h3V5H6z"/></svg>')||this;return pe.fonts=[],pe.fontBoxes=[],pe.fonts=Y,pe.currentFont=ie,pe.setCurrentFont=pe.setCurrentFont.bind(pe),pe}return $(M,X),M.prototype.getUi=function(){var N=this,Y=document.createElement("div");return Y.style.overflow="hidden",Y.style.flexGrow="2",this.fonts.forEach(function(ie){var K=document.createElement("div");K.style.display="inline-block",K.style.alignItems="center",K.style.justifyContent="space-between",K.style.padding="5px",K.style.borderWidth="2px",K.style.borderStyle="solid",K.style.overflow="hidden",K.style.maxWidth=100/N.fonts.length-5+"%",K.style.borderColor=ie===N.currentFont?N.uiStyleSettings.toolboxAccentColor:"transparent",K.addEventListener("click",function(){N.setCurrentFont(ie,K)}),Y.appendChild(K);var pe=document.createElement("div");pe.style.display="flex",pe.style.minHeight="20px",pe.style.flexGrow="2",pe.style.fontFamily=ie,pe.style.overflow="hidden";var Se=document.createElement("div");Se.style.whiteSpace="nowrap",Se.style.overflow="hidden",Se.style.textOverflow="ellipsis",Se.innerHTML="The quick brown fox jumps over the lazy dog",pe.appendChild(Se),K.appendChild(pe),N.fontBoxes.push(K)}),Y},M.prototype.setCurrentFont=function(N,Y){var ie=this;this.currentFont=N,this.fontBoxes.forEach(function(K){K.style.borderColor=K===Y?ie.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onFontChanged&&this.onFontChanged(this.currentFont)},M}(o),x=function(X){function M(N,Y,ie){var K=X.call(this,N,Y,ie)||this;return K.color="transparent",K.padding=5,K.DEFAULT_TEXT="your text here",K.text=K.DEFAULT_TEXT,K.isMoved=!1,K.color=ie.defaultColor,K.fontFamily=ie.defaultFontFamily,K.defaultSize={x:100,y:30},K.setColor=K.setColor.bind(K),K.setFont=K.setFont.bind(K),K.renderText=K.renderText.bind(K),K.sizeText=K.sizeText.bind(K),K.textEditDivClicked=K.textEditDivClicked.bind(K),K.showTextEditor=K.showTextEditor.bind(K),K.setSize=K.setSize.bind(K),K.positionTextEditor=K.positionTextEditor.bind(K),K.colorPanel=new p("Color",ie.defaultColorSet,ie.defaultColor),K.colorPanel.onColorChanged=K.setColor,K.fontFamilyPanel=new c("Font",ie.defaultFontFamilies,ie.defaultFontFamily),K.fontFamilyPanel.onFontChanged=K.setFont,K}return $(M,X),M.prototype.ownsTarget=function(N){if(X.prototype.ownsTarget.call(this,N)||N===this.visual||N===this.textElement||N===this.bgRectangle)return!0;var Y=!1;return this.textElement.childNodes.forEach(function(ie){ie===N&&(Y=!0)}),Y},M.prototype.createVisual=function(){this.visual=L.createGroup(),this.bgRectangle=L.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=L.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(L.createTransform()),this.textElement.transform.baseVal.appendItem(L.createTransform()),this.visual.appendChild(this.textElement),this.addMarkerVisualToContainer(this.visual),this.renderText()},M.prototype.pointerDown=function(N,Y){X.prototype.pointerDown.call(this,N,Y),this.isMoved=!1,this.pointerDownPoint=N,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(N),this._state="creating")},M.prototype.renderText=function(){var N=this;if(this.textElement){for(;this.textElement.lastChild;)this.textElement.removeChild(this.textElement.lastChild);this.text.split(/\r\n|[\n\v\f\r\x85\u2028\u2029]/).forEach(function(Y){N.textElement.appendChild(L.createTSpan(Y.trim()===""?" ":Y.trim(),[["x","0"],["dy","1.2em"]]))}),setTimeout(this.sizeText,10)}},M.prototype.getTextScale=function(){var N=this.textElement.getBBox(),Y=1;if(N.width>0&&N.height>0){var ie=(1*this.width-this.width*this.padding*2/100)/N.width,K=(1*this.height-this.height*this.padding*2/100)/N.height;Y=Math.min(ie,K)}return Y},M.prototype.getTextPosition=function(N){var Y=this.textElement.getBBox(),ie=0,K=0;return Y.width>0&&Y.height>0&&(ie=(this.width-Y.width*N)/2,K=this.height/2-Y.height*N/2),{x:ie,y:K}},M.prototype.sizeText=function(){var N=this.textElement.getBBox(),Y=this.getTextScale(),ie=this.getTextPosition(Y);ie.y-=N.y*Y,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+ie.x+"px, "+ie.y+"px) scale("+Y+", "+Y+")":(this.textElement.transform.baseVal.getItem(0).setTranslate(ie.x,ie.y),this.textElement.transform.baseVal.getItem(1).setScale(Y,Y))},M.prototype.manipulate=function(N){X.prototype.manipulate.call(this,N),this.pointerDownPoint!==void 0&&(this.isMoved=Math.abs(N.x-this.pointerDownPoint.x)>5||Math.abs(N.y-this.pointerDownPoint.y)>5)},M.prototype.resize=function(N){X.prototype.resize.call(this,N),this.isMoved=!0,this.setSize(),this.sizeText()},M.prototype.setSize=function(){X.prototype.setSize.call(this),this.visual&&this.bgRectangle&&(L.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),L.setAttributes(this.bgRectangle,[["width",this.width.toString()],["height",this.height.toString()]]))},M.prototype.pointerUp=function(N){var Y=this.state;Y==="creating"&&(this._suppressMarkerCreateEvent=!0),X.prototype.pointerUp.call(this,N),this.setSize(),(Y==="creating"||!this.isMoved&&Date.now()-this.pointerDownTimestamp>500)&&this.showTextEditor(),this.pointerDownPoint=void 0},M.prototype.showTextEditor=function(){var N=this;this._state="edit",this.overlayContainer.innerHTML="",this.textEditDiv=document.createElement("div"),this.textEditDiv.style.flexGrow="2",this.textEditDiv.style.alignItems="center",this.textEditDiv.style.justifyContent="center",this.textEditDiv.style.pointerEvents="auto",this.textEditDiv.style.overflow="hidden",this.textEditor=document.createElement("div"),this.textEditor.style.position="absolute",this.textEditor.style.fontFamily=this.fontFamily,this.textEditor.style.lineHeight="1em",this.textEditor.innerText=this.text,this.textEditor.contentEditable="true",this.textEditor.style.color=this.color,this.textEditor.style.whiteSpace="pre",this.positionTextEditor(),this.textEditor.addEventListener("pointerup",function(Y){Y.stopPropagation()}),this.textEditor.addEventListener("input",function(){for(var Y=Number.parseFloat(N.textEditor.style.fontSize);N.textEditor.clientWidth>=Number.parseInt(N.textEditor.style.maxWidth)&&Y>.9;)Y-=.1,N.textEditor.style.fontSize=Math.max(Y,.9)+"em"}),this.textEditor.addEventListener("keyup",function(Y){Y.cancelBubble=!0}),this.textEditor.addEventListener("paste",function(Y){if(Y.clipboardData){var ie=Y.clipboardData.getData("text"),K=window.getSelection();if(!K.rangeCount)return!1;K.deleteFromDocument(),K.getRangeAt(0).insertNode(document.createTextNode(ie)),Y.preventDefault()}}),this.textEditDiv.addEventListener("pointerup",function(){N.textEditDivClicked(N.textEditor.innerText)}),this.textEditDiv.appendChild(this.textEditor),this.overlayContainer.appendChild(this.textEditDiv),this.hideVisual(),this.textEditor.focus(),document.execCommand("selectAll")},M.prototype.positionTextEditor=function(){if(this.state==="edit")if(this.textEditor===void 0)this.showTextEditor();else{this.textElement.style.display="";var N=this.getTextScale(),Y=this.rotatePoint({x:this.left+this.width/2,y:this.top+this.height/2}),ie=this.textElement.getBBox(),K={x:ie.width*N,y:ie.height*N};Y.x-=K.x/2,Y.y-=K.y/2,this.textEditor.style.top=Y.y+"px",this.textEditor.style.left=Y.x+"px",this.textEditor.style.maxWidth=this.overlayContainer.offsetWidth-Y.x+"px",this.textEditor.style.fontSize=Math.max(16*N,12)+"px",this.textElement.style.display="none"}},M.prototype.textEditDivClicked=function(N){this.text=N.trim(),this.overlayContainer.innerHTML="",this.renderText(),this.showVisual(),this._suppressMarkerCreateEvent&&(this._suppressMarkerCreateEvent=!1,this.onMarkerCreated&&this.onMarkerCreated(this)),this.stateChanged()},M.prototype.select=function(){X.prototype.select.call(this),this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText)},M.prototype.deselect=function(){this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText),X.prototype.deselect.call(this)},M.prototype.dblClick=function(N,Y){X.prototype.dblClick.call(this,N,Y),this.showTextEditor()},M.prototype.setColor=function(N){this.textElement&&L.setAttributes(this.textElement,[["fill",N]]),this.color=N,this.textEditor&&(this.textEditor.style.color=this.color),this.colorChanged(N)},M.prototype.setFont=function(N){this.textElement&&L.setAttributes(this.textElement,[["font-family",N]]),this.fontFamily=N,this.textEditor&&(this.textEditor.style.fontFamily=this.fontFamily),this.renderText(),this.stateChanged()},M.prototype.hideVisual=function(){this.textElement.style.display="none",this.hideControlBox()},M.prototype.showVisual=function(){this.state==="edit"&&(this._state="select"),this.textElement.style.display="",this.showControlBox()},Object.defineProperty(M.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),M.prototype.getState=function(){var N=Object.assign({color:this.color,fontFamily:this.fontFamily,padding:this.padding,text:this.text},X.prototype.getState.call(this));return N.typeName=M.typeName,N},M.prototype.restoreState=function(N){var Y=N;this.color=Y.color,this.fontFamily=Y.fontFamily,this.padding=Y.padding,this.text=Y.text,this.createVisual(),X.prototype.restoreState.call(this,N),this.setSize()},M.prototype.scale=function(N,Y){X.prototype.scale.call(this,N,Y),this.setSize(),this.sizeText(),this.positionTextEditor()},M.typeName="TextMarker",M.title="Text marker",M.icon='<svg viewBox="0 0 24 24"><path d="M9.6 14L12 7.7l2.4 6.3M11 5L5.5 19h2.2l1.1-3H15l1.1 3h2.2L13 5h-2z"/></svg>',M}(C),v=function(X){function M(N,Y,ie){var K=X.call(this,N,Y,ie)||this;return K.color="transparent",K.lineWidth=3,K.drawing=!1,K.pixelRatio=1,K.color=ie.defaultColor,K.lineWidth=ie.defaultStrokeWidth,K.pixelRatio=ie.freehandPixelRatio,K.setColor=K.setColor.bind(K),K.addCanvas=K.addCanvas.bind(K),K.finishCreation=K.finishCreation.bind(K),K.setLineWidth=K.setLineWidth.bind(K),K.colorPanel=new p("Color",ie.defaultColorSet,ie.defaultColor),K.colorPanel.onColorChanged=K.setColor,K.lineWidthPanel=new w("Line width",ie.defaultStrokeWidths,ie.defaultStrokeWidth),K.lineWidthPanel.onWidthChanged=K.setLineWidth,K}return $(M,X),M.prototype.ownsTarget=function(N){return!(!X.prototype.ownsTarget.call(this,N)&&N!==this.visual&&N!==this.drawingImage)},M.prototype.createVisual=function(){this.visual=L.createGroup(),this.drawingImage=L.createImage(),this.visual.appendChild(this.drawingImage);var N=L.createTransform();this.visual.transform.baseVal.appendItem(N),this.addMarkerVisualToContainer(this.visual)},M.prototype.pointerDown=function(N,Y){this.state==="new"&&(this.addCanvas(),this.createVisual(),this._state="creating"),this.state==="creating"?(this.canvasContext.strokeStyle=this.color,this.canvasContext.lineWidth=this.lineWidth,this.canvasContext.beginPath(),this.canvasContext.moveTo(N.x,N.y),this.drawing=!0):X.prototype.pointerDown.call(this,N,Y)},M.prototype.manipulate=function(N){this.state==="creating"?this.drawing&&(this.canvasContext.lineTo(N.x,N.y),this.canvasContext.stroke()):X.prototype.manipulate.call(this,N)},M.prototype.resize=function(N){X.prototype.resize.call(this,N),L.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),L.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]])},M.prototype.pointerUp=function(N){this._state==="creating"?this.drawing&&(this.canvasContext.closePath(),this.drawing=!1,this.globalSettings.newFreehandMarkerOnPointerUp&&this.finishCreation()):X.prototype.pointerUp.call(this,N)},M.prototype.addCanvas=function(){this.overlayContainer.innerHTML="",this.canvasElement=document.createElement("canvas"),this.canvasElement.width=this.overlayContainer.clientWidth*this.pixelRatio,this.canvasElement.height=this.overlayContainer.clientHeight*this.pixelRatio,this.canvasContext=this.canvasElement.getContext("2d"),this.canvasContext.scale(this.pixelRatio,this.pixelRatio),this.overlayContainer.appendChild(this.canvasElement)},M.prototype.select=function(){this.state==="creating"&&this.finishCreation(),X.prototype.select.call(this)},M.prototype.deselect=function(){this.state==="creating"&&this.finishCreation(),X.prototype.deselect.call(this)},M.prototype.finishCreation=function(){for(var N=this.canvasContext.getImageData(0,0,this.canvasElement.width,this.canvasElement.height),Y=[this.canvasElement.width+1,this.canvasElement.height+1,-1,-1],ie=Y[0],K=Y[1],pe=Y[2],Se=Y[3],Pe=!1,he=0;he<this.canvasElement.height;he++)for(var ve=0;ve<this.canvasElement.width;ve++)N.data[he*this.canvasElement.width*4+4*ve+3]>0&&(Pe=!0,he<K&&(K=he),ve<ie&&(ie=ve),he>Se&&(Se=he),ve>pe&&(pe=ve));if(Pe){this.left=ie/this.pixelRatio,this.top=K/this.pixelRatio,this.width=(pe-ie)/this.pixelRatio,this.height=(Se-K)/this.pixelRatio;var xe=document.createElement("canvas");xe.width=pe-ie,xe.height=Se-K,xe.getContext("2d").putImageData(this.canvasContext.getImageData(ie,K,pe-ie,Se-K),0,0),this.drawingImgUrl=xe.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},M.prototype.setDrawingImage=function(){L.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),L.setAttributes(this.drawingImage,[["href",this.drawingImgUrl]]),this.moveVisual({x:this.left,y:this.top})},M.prototype.setColor=function(N){this.color=N,this.colorChanged(N)},M.prototype.setLineWidth=function(N){this.lineWidth=N},Object.defineProperty(M.prototype,"toolboxPanels",{get:function(){return this.state==="new"||this.state==="creating"?[this.colorPanel,this.lineWidthPanel]:[]},enumerable:!1,configurable:!0}),M.prototype.getState=function(){var N=Object.assign({drawingImgUrl:this.drawingImgUrl},X.prototype.getState.call(this));return N.typeName=M.typeName,N},M.prototype.restoreState=function(N){this.createVisual(),X.prototype.restoreState.call(this,N),this.drawingImgUrl=N.drawingImgUrl,this.setDrawingImage()},M.prototype.scale=function(N,Y){X.prototype.scale.call(this,N,Y),this.setDrawingImage()},M.typeName="FreehandMarker",M.title="Freehand marker",M.icon='<svg viewBox="0 0 24 24"><path d="M9.75 20.85c1.78-.7 1.39-2.63.49-3.85-.89-1.25-2.12-2.11-3.36-2.94A9.817 9.817 0 014.54 12c-.28-.33-.85-.94-.27-1.06.59-.12 1.61.46 2.13.68.91.38 1.81.82 2.65 1.34l1.01-1.7C8.5 10.23 6.5 9.32 4.64 9.05c-1.06-.16-2.18.06-2.54 1.21-.32.99.19 1.99.77 2.77 1.37 1.83 3.5 2.71 5.09 4.29.34.33.75.72.95 1.18.21.44.16.47-.31.47-1.24 0-2.79-.97-3.8-1.61l-1.01 1.7c1.53.94 4.09 2.41 5.96 1.79m11.09-15.6c.22-.22.22-.58 0-.79l-1.3-1.3a.562.562 0 00-.78 0l-1.02 1.02 2.08 2.08M11 10.92V13h2.08l6.15-6.15-2.08-2.08L11 10.92z"/></svg>',M}(C),y=function(X){function M(N,Y,ie){var K=X.call(this,N,ie||'<svg viewBox="0 0 24 24"><path d="M8 14v4l-6-6 6-6v4h8V6l6 6-6 6v-4H8z"/></svg>')||this;return K.typeBoxes=[],K.currentType=Y,K.setCurrentType=K.setCurrentType.bind(K),K}return $(M,X),M.prototype.getUi=function(){var N=this,Y=document.createElement("div");Y.style.display="flex",Y.style.overflow="hidden",Y.style.flexGrow="2";for(var ie=function(Se){var Pe="both";switch(Se){case 0:Pe="both";break;case 1:Pe="start";break;case 2:Pe="end";break;case 3:Pe="none"}var he=document.createElement("div");if(he.style.display="flex",he.style.flexGrow="2",he.style.alignItems="center",he.style.justifyContent="space-between",he.style.padding="5px",he.style.borderWidth="2px",he.style.borderStyle="solid",he.style.borderColor=Pe===K.currentType?K.uiStyleSettings.toolboxAccentColor:"transparent",he.addEventListener("click",function(){N.setCurrentType(Pe,he)}),Y.appendChild(he),Pe==="both"||Pe==="start"){var ve=document.createElement("div");ve.style.display="flex",ve.style.alignItems="center",ve.style.minHeight="20px",ve.innerHTML=`<svg viewBox="0 0 10 10" width="10" height="10" xmlns="http://www.w3.org/2000/svg">
<polygon points="0,5 10,0 10,10" fill="`+(K.uiStyleSettings!==void 0?K.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
</svg>`,ve.style.marginLeft="5px",he.appendChild(ve)}var xe=document.createElement("div");xe.style.display="flex",xe.style.alignItems="center",xe.style.minHeight="20px",xe.style.flexGrow="2";var Ce=document.createElement("hr");if(Ce.style.minWidth="20px",Ce.style.border="0px",Ce.style.borderTop="3px solid "+(K.uiStyleSettings!==void 0?K.uiStyleSettings.toolboxColor:"#eeeeee"),Ce.style.flexGrow="2",xe.appendChild(Ce),he.appendChild(xe),Pe==="both"||Pe==="end"){var Be=document.createElement("div");Be.style.display="flex",Be.style.alignItems="center",Be.style.minHeight="20px",Be.innerHTML=`<svg viewBox="0 0 10 10" width="10" height="10" xmlns="http://www.w3.org/2000/svg">
<polygon points="0,0 10,5 0,10" fill="`+(K.uiStyleSettings!==void 0?K.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
</svg>`,Be.style.marginRight="5px",he.appendChild(Be)}K.typeBoxes.push(he)},K=this,pe=0;pe<4;pe++)ie(pe);return Y},M.prototype.setCurrentType=function(N,Y){var ie=this;this.currentType=N,this.typeBoxes.forEach(function(K){K.style.borderColor=K===Y?ie.uiStyleSettings!==void 0?ie.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"}),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},M}(o),F=function(X){function M(N,Y,ie){var K=X.call(this,N,Y,ie)||this;return K.arrowType="end",K.arrowBaseHeight=10,K.arrowBaseWidth=10,K.getArrowPoints=K.getArrowPoints.bind(K),K.setArrowType=K.setArrowType.bind(K),K.arrowTypePanel=new y("Arrow type","end"),K.arrowTypePanel.onArrowTypeChanged=K.setArrowType,K}return $(M,X),M.prototype.ownsTarget=function(N){return!(!X.prototype.ownsTarget.call(this,N)&&N!==this.arrow1&&N!==this.arrow2)},M.prototype.getArrowPoints=function(N,Y){var ie=this.arrowBaseWidth+2*this.strokeWidth,K=this.arrowBaseHeight+2*this.strokeWidth;return N-ie/2+","+(Y+K/2)+" "+N+","+(Y-K/2)+" "+(N+ie/2)+","+(Y+K/2)},M.prototype.createTips=function(){this.arrow1=L.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(L.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=L.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(L.createTransform()),this.visual.appendChild(this.arrow2)},M.prototype.pointerDown=function(N,Y){X.prototype.pointerDown.call(this,N,Y),this.state==="creating"&&this.createTips()},M.prototype.adjustVisual=function(){if(X.prototype.adjustVisual.call(this),this.arrow1&&this.arrow2&&(this.arrow1.style.display=this.arrowType==="both"||this.arrowType==="start"?"":"none",this.arrow2.style.display=this.arrowType==="both"||this.arrowType==="end"?"":"none",L.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),L.setAttributes(this.arrow2,[["points",this.getArrowPoints(this.x2,this.y2)],["fill",this.strokeColor]]),Math.abs(this.x1-this.x2)>.1)){var N=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),Y=this.arrow1.transform.baseVal.getItem(0);Y.setRotate(N,this.x1,this.y1),this.arrow1.transform.baseVal.replaceItem(Y,0);var ie=this.arrow2.transform.baseVal.getItem(0);ie.setRotate(N+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem(ie,0)}},M.prototype.setArrowType=function(N){this.arrowType=N,this.adjustVisual(),this.stateChanged()},Object.defineProperty(M.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel,this.arrowTypePanel]},enumerable:!1,configurable:!0}),M.prototype.getState=function(){var N=Object.assign({arrowType:this.arrowType},X.prototype.getState.call(this));return N.typeName=M.typeName,N},M.prototype.restoreState=function(N){X.prototype.restoreState.call(this,N);var Y=N;this.arrowType=Y.arrowType,this.createTips(),this.adjustVisual()},M.typeName="ArrowMarker",M.title="Arrow marker",M.icon='<svg viewBox="0 0 24 24"><path d="M19 6.41L17.59 5 7 15.59V9H5v10h10v-2H8.41L19 6.41z"/></svg>',M}(E),B=function(X){function M(N,Y,ie){var K=X.call(this,N,Y,ie)||this;return K.fillColor=ie.defaultFillColor,K.strokeWidth=0,K.fillPanel=new p("Color",ie.defaultColorSet,ie.defaultFillColor),K.fillPanel.onColorChanged=K.setFillColor,K}return $(M,X),Object.defineProperty(M.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),M.prototype.getState=function(){var N=X.prototype.getState.call(this);return N.typeName=M.typeName,N},M.typeName="CoverMarker",M.title="Cover marker",M.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4z"/></svg>',M}(_),A=function(X){function M(N,Y,ie,K){var pe=X.call(this,N,K||'<svg viewBox="0 0 24 24"><path d="M17.66 8L12 2.35 6.34 8A8.02 8.02 0 004 13.64c0 2 .78 4.11 2.34 5.67a7.99 7.99 0 0011.32 0c1.56-1.56 2.34-3.67 2.34-5.67S19.22 9.56 17.66 8M6 14c0-2 .62-3.27 1.76-4.4L12 5.27l4.24 4.38C17.38 10.77 18 12 18 14H6z"/></svg>')||this;return pe.opacities=[],pe.opacityBoxes=[],pe.opacities=Y,pe.currentOpacity=ie,pe.setCurrentOpacity=pe.setCurrentOpacity.bind(pe),pe}return $(M,X),M.prototype.getUi=function(){var N=this,Y=document.createElement("div");return Y.style.display="flex",Y.style.overflow="hidden",Y.style.flexGrow="2",Y.style.justifyContent="space-between",this.opacities.forEach(function(ie){var K=document.createElement("div");K.style.display="flex",K.style.alignItems="center",K.style.justifyContent="center",K.style.padding="5px",K.style.borderWidth="2px",K.style.borderStyle="solid",K.style.borderColor=ie===N.currentOpacity?N.uiStyleSettings.toolboxAccentColor:"transparent",K.addEventListener("click",function(){N.setCurrentOpacity(ie,K)}),Y.appendChild(K);var pe=document.createElement("div");pe.innerText=100*ie+"%",K.appendChild(pe),N.opacityBoxes.push(K)}),Y},M.prototype.setCurrentOpacity=function(N,Y){var ie=this;this.currentOpacity=N,this.opacityBoxes.forEach(function(K){K.style.borderColor=K===Y?ie.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},M}(o),j=function(X){function M(N,Y,ie){var K=X.call(this,N,Y,ie)||this;return K.setOpacity=K.setOpacity.bind(K),K.fillColor=ie.defaultHighlightColor,K.strokeWidth=0,K.opacity=ie.defaultHighlightOpacity,K.fillPanel=new p("Color",ie.defaultColorSet,K.fillColor),K.fillPanel.onColorChanged=K.setFillColor,K.opacityPanel=new A("Opacity",ie.defaultOpacitySteps,K.opacity),K.opacityPanel.onOpacityChanged=K.setOpacity,K}return $(M,X),M.prototype.setOpacity=function(N){this.opacity=N,this.visual&&L.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(M.prototype,"toolboxPanels",{get:function(){return[this.fillPanel,this.opacityPanel]},enumerable:!1,configurable:!0}),M.prototype.getState=function(){var N=X.prototype.getState.call(this);return N.typeName=M.typeName,N},M.typeName="HighlightMarker",M.title="Highlight marker",M.icon='<svg viewBox="0 0 24 24"><path d="M18.5 1.15c-.53 0-1.04.19-1.43.58l-5.81 5.82 5.65 5.65 5.82-5.81c.77-.78.77-2.04 0-2.83l-2.84-2.83c-.39-.39-.89-.58-1.39-.58M10.3 8.5l-5.96 5.96c-.78.78-.78 2.04.02 2.85C3.14 18.54 1.9 19.77.67 21h5.66l.86-.86c.78.76 2.03.75 2.81-.02l5.95-5.96"/></svg>',M}(B),P='<svg viewBox="0 0 24 24"><path d="M19 11.5s-2 2.17-2 3.5a2 2 0 002 2 2 2 0 002-2c0-1.33-2-3.5-2-3.5M5.21 10L10 5.21 14.79 10m1.77-1.06L7.62 0 6.21 1.41l2.38 2.38-5.15 5.15c-.59.56-.59 1.53 0 2.12l5.5 5.5c.29.29.68.44 1.06.44s.77-.15 1.06-.44l5.5-5.5c.59-.59.59-1.56 0-2.12z"/></svg>',b=function(X){function M(N,Y,ie){var K=X.call(this,N,Y,ie)||this;return K.bgColor="transparent",K.tipPosition={x:0,y:0},K.tipBase1Position={x:0,y:0},K.tipBase2Position={x:0,y:0},K.tipMoving=!1,K.color=ie.defaultStrokeColor,K.bgColor=ie.defaultFillColor,K.fontFamily=ie.defaultFontFamily,K.defaultSize={x:100,y:30},K.setBgColor=K.setBgColor.bind(K),K.getTipPoints=K.getTipPoints.bind(K),K.positionTip=K.positionTip.bind(K),K.setTipPoints=K.setTipPoints.bind(K),K.colorPanel=new p("Text color",ie.defaultColorSet,K.color,'<svg viewBox="0 0 24 24"><path d="M9.62 12L12 5.67 14.37 12M11 3L5.5 17h2.25l1.12-3h6.25l1.13 3h2.25L13 3h-2z"/></svg>'),K.colorPanel.onColorChanged=K.setColor,K.bgColorPanel=new p("Fill color",ie.defaultColorSet,K.bgColor,P),K.bgColorPanel.onColorChanged=K.setBgColor,K.fontFamilyPanel=new c("Font",ie.defaultFontFamilies,ie.defaultFontFamily),K.fontFamilyPanel.onFontChanged=K.setFont,K.tipGrip=new a,K.tipGrip.visual.transform.baseVal.appendItem(L.createTransform()),K.controlBox.appendChild(K.tipGrip.visual),K}return $(M,X),M.prototype.ownsTarget=function(N){return X.prototype.ownsTarget.call(this,N)||this.tipGrip.ownsTarget(N)||this.tip===N},M.prototype.createTip=function(){L.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=L.createPolygon(this.getTipPoints(),[["fill",this.bgColor]]),this.visual.appendChild(this.tip)},M.prototype.pointerDown=function(N,Y){this.state==="new"&&X.prototype.pointerDown.call(this,N,Y),this.state==="creating"?this.createTip():this.tipGrip.ownsTarget(Y)?(this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.tipMoving=!0):X.prototype.pointerDown.call(this,N,Y)},M.prototype.pointerUp=function(N){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,X.prototype.pointerUp.call(this,N);else{var Y=this.state==="creating";X.prototype.pointerUp.call(this,N),this.setTipPoints(Y),this.positionTip()}},M.prototype.manipulate=function(N){if(this.tipMoving){var Y=this.unrotatePoint(N);this.tipPosition={x:Y.x-this.manipulationStartLeft,y:Y.y-this.manipulationStartTop},this.positionTip()}else X.prototype.manipulate.call(this,N)},M.prototype.setBgColor=function(N){this.bgRectangle&&this.tip&&(L.setAttributes(this.bgRectangle,[["fill",N]]),L.setAttributes(this.tip,[["fill",N]])),this.bgColor=N,this.fillColorChanged(N)},M.prototype.getTipPoints=function(){return this.setTipPoints(this.state==="creating"),this.tipBase1Position.x+","+this.tipBase1Position.y+" "+this.tipBase2Position.x+","+this.tipBase2Position.y+" "+this.tipPosition.x+","+this.tipPosition.y},M.prototype.setTipPoints=function(N){N===void 0&&(N=!1);var Y=Math.min(this.height/2,15),ie=this.height/5;N&&(this.tipPosition={x:Y+ie/2,y:this.height+20});var K=Math.atan(this.height/2/(this.width/2));this.tipPosition.x<this.width/2&&this.tipPosition.y<this.height/2?K<Math.atan((this.height/2-this.tipPosition.y)/(this.width/2-this.tipPosition.x))?(ie=this.width/5,Y=Math.min(this.width/2,15),this.tipBase1Position={x:Y,y:0},this.tipBase2Position={x:Y+ie,y:0}):(this.tipBase1Position={x:0,y:Y},this.tipBase2Position={x:0,y:Y+ie}):this.tipPosition.x>=this.width/2&&this.tipPosition.y<this.height/2?K<Math.atan((this.height/2-this.tipPosition.y)/(this.tipPosition.x-this.width/2))?(ie=this.width/5,Y=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-Y-ie,y:0},this.tipBase2Position={x:this.width-Y,y:0}):(this.tipBase1Position={x:this.width,y:Y},this.tipBase2Position={x:this.width,y:Y+ie}):this.tipPosition.x>=this.width/2&&this.tipPosition.y>=this.height/2?K<Math.atan((this.tipPosition.y-this.height/2)/(this.tipPosition.x-this.width/2))?(ie=this.width/5,Y=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-Y-ie,y:this.height},this.tipBase2Position={x:this.width-Y,y:this.height}):(this.tipBase1Position={x:this.width,y:this.height-Y-ie},this.tipBase2Position={x:this.width,y:this.height-Y}):K<Math.atan((this.tipPosition.y-this.height/2)/(this.width/2-this.tipPosition.x))?(ie=this.width/5,Y=Math.min(this.width/2,15),this.tipBase1Position={x:Y,y:this.height},this.tipBase2Position={x:Y+ie,y:this.height}):(this.tipBase1Position={x:0,y:this.height-Y},this.tipBase2Position={x:0,y:this.height-Y-ie})},M.prototype.resize=function(N){X.prototype.resize.call(this,N),this.positionTip()},M.prototype.positionTip=function(){L.setAttributes(this.tip,[["points",this.getTipPoints()]]);var N=this.tipGrip.visual.transform.baseVal.getItem(0);N.setTranslate(this.tipPosition.x,this.tipPosition.y),this.tipGrip.visual.transform.baseVal.replaceItem(N,0)},Object.defineProperty(M.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.bgColorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),M.prototype.select=function(){this.positionTip(),X.prototype.select.call(this)},M.prototype.getState=function(){var N=Object.assign({bgColor:this.bgColor,tipPosition:this.tipPosition},X.prototype.getState.call(this));return N.typeName=M.typeName,N},M.prototype.restoreState=function(N){var Y=N;this.bgColor=Y.bgColor,this.tipPosition=Y.tipPosition,X.prototype.restoreState.call(this,N),this.createTip(),this.setTipPoints()},M.prototype.scale=function(N,Y){X.prototype.scale.call(this,N,Y),this.tipPosition={x:this.tipPosition.x*N,y:this.tipPosition.y*Y},this.positionTip()},M.typeName="CalloutMarker",M.title="Callout marker",M.icon='<svg viewBox="0 0 24 24"><path d="M4 2h16a2 2 0 012 2v12a2 2 0 01-2 2h-4l-4 4-4-4H4a2 2 0 01-2-2V4a2 2 0 012-2m0 2v12h4.83L12 19.17 15.17 16H20V4H4m2 3h12v2H6V7m0 4h10v2H6v-2z"/></svg>',M}(x),V=function(X){function M(N,Y,ie){var K=X.call(this,N,Y,ie)||this;return K.fillColor="transparent",K.strokeColor="transparent",K.strokeWidth=0,K.strokeDasharray="",K.opacity=1,K.strokeColor=ie.defaultColor,K.strokeWidth=ie.defaultStrokeWidth,K.strokeDasharray=ie.defaultStrokeDasharray,K.fillColor=ie.defaultFillColor,K.setStrokeColor=K.setStrokeColor.bind(K),K.setFillColor=K.setFillColor.bind(K),K.setStrokeWidth=K.setStrokeWidth.bind(K),K.setStrokeDasharray=K.setStrokeDasharray.bind(K),K.setOpacity=K.setOpacity.bind(K),K.createVisual=K.createVisual.bind(K),K.strokePanel=new p("Line color",U(ie.defaultColorSet,["transparent"]),ie.defaultColor),K.strokePanel.onColorChanged=K.setStrokeColor,K.fillPanel=new p("Fill color",U(ie.defaultColorSet,["transparent"]),K.fillColor,P),K.fillPanel.onColorChanged=K.setFillColor,K.strokeWidthPanel=new w("Line width",ie.defaultStrokeWidths,ie.defaultStrokeWidth),K.strokeWidthPanel.onWidthChanged=K.setStrokeWidth,K.strokeStylePanel=new O("Line style",ie.defaultStrokeDasharrays,ie.defaultStrokeDasharray),K.strokeStylePanel.onStyleChanged=K.setStrokeDasharray,K.opacityPanel=new A("Opacity",ie.defaultOpacitySteps,K.opacity),K.opacityPanel.onOpacityChanged=K.setOpacity,K}return $(M,X),M.prototype.ownsTarget=function(N){return!(!X.prototype.ownsTarget.call(this,N)&&N!==this.visual)},M.prototype.createVisual=function(){this.visual=L.createEllipse(this.width/2,this.height/2,[["fill",this.fillColor],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["stroke-dasharray",this.strokeDasharray],["opacity",this.opacity.toString()]]),this.addMarkerVisualToContainer(this.visual)},M.prototype.pointerDown=function(N,Y){X.prototype.pointerDown.call(this,N,Y),this.state==="new"&&(this.createVisual(),this.moveVisual(N),this._state="creating")},M.prototype.manipulate=function(N){X.prototype.manipulate.call(this,N)},M.prototype.resize=function(N){X.prototype.resize.call(this,N),this.setSize()},M.prototype.setSize=function(){X.prototype.setSize.call(this),L.setAttributes(this.visual,[["cx",(this.width/2).toString()],["cy",(this.height/2).toString()],["rx",(this.width/2).toString()],["ry",(this.height/2).toString()]])},M.prototype.pointerUp=function(N){X.prototype.pointerUp.call(this,N),this.setSize()},M.prototype.setStrokeColor=function(N){this.strokeColor=N,this.visual&&L.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(N),this.stateChanged()},M.prototype.setFillColor=function(N){this.fillColor=N,this.visual&&L.setAttributes(this.visual,[["fill",this.fillColor]]),this.fillColorChanged(N),this.stateChanged()},M.prototype.setStrokeWidth=function(N){this.strokeWidth=N,this.visual&&L.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},M.prototype.setStrokeDasharray=function(N){this.strokeDasharray=N,this.visual&&L.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},M.prototype.setOpacity=function(N){this.opacity=N,this.visual&&L.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(M.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.fillPanel,this.strokeWidthPanel,this.strokeStylePanel,this.opacityPanel]},enumerable:!1,configurable:!0}),M.prototype.getState=function(){var N=Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},X.prototype.getState.call(this));return N.typeName=M.typeName,N},M.prototype.restoreState=function(N){var Y=N;this.fillColor=Y.fillColor,this.strokeColor=Y.strokeColor,this.strokeWidth=Y.strokeWidth,this.strokeDasharray=Y.strokeDasharray,this.opacity=Y.opacity,this.createVisual(),X.prototype.restoreState.call(this,N),this.setSize()},M.prototype.scale=function(N,Y){X.prototype.scale.call(this,N,Y),this.setSize()},M.typeName="EllipseMarker",M.title="Ellipse marker",M.icon='<svg viewBox="0 0 24 24"><path d="M12 4C6.5 4 2 7.58 2 12s4.5 8 10 8 10-3.58 10-8-4.5-8-10-8z"/></svg>',M}(C),re=function(X){function M(N,Y,ie){return X.call(this,N,Y,ie)||this}return $(M,X),Object.defineProperty(M.prototype,"tipLength",{get:function(){return 10+3*this.strokeWidth},enumerable:!1,configurable:!0}),M.prototype.ownsTarget=function(N){return!(!X.prototype.ownsTarget.call(this,N)&&N!==this.tip1&&N!==this.tip2)},M.prototype.createTips=function(){this.tip1=L.createLine(this.x1-this.tipLength/2,this.y1,this.x1+this.tipLength/2,this.y1,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.tip1.transform.baseVal.appendItem(L.createTransform()),this.visual.appendChild(this.tip1),this.tip2=L.createLine(this.x2-this.tipLength/2,this.y2,this.x2+this.tipLength/2,this.y2,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.tip2.transform.baseVal.appendItem(L.createTransform()),this.visual.appendChild(this.tip2)},M.prototype.pointerDown=function(N,Y){X.prototype.pointerDown.call(this,N,Y),this.state==="creating"&&this.createTips()},M.prototype.adjustVisual=function(){if(X.prototype.adjustVisual.call(this),this.tip1&&this.tip2&&(L.setAttributes(this.tip1,[["x1",(this.x1-this.tipLength/2).toString()],["y1",this.y1.toString()],["x2",(this.x1+this.tipLength/2).toString()],["y2",this.y1.toString()],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),L.setAttributes(this.tip2,[["x1",(this.x2-this.tipLength/2).toString()],["y1",this.y2.toString()],["x2",(this.x2+this.tipLength/2).toString()],["y2",this.y2.toString()],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),Math.abs(this.x1-this.x2)>.1)){var N=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),Y=this.tip1.transform.baseVal.getItem(0);Y.setRotate(N,this.x1,this.y1),this.tip1.transform.baseVal.replaceItem(Y,0);var ie=this.tip2.transform.baseVal.getItem(0);ie.setRotate(N+180,this.x2,this.y2),this.tip2.transform.baseVal.replaceItem(ie,0)}},Object.defineProperty(M.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),M.prototype.getState=function(){var N=X.prototype.getState.call(this);return N.typeName=M.typeName,N},M.prototype.restoreState=function(N){X.prototype.restoreState.call(this,N),this.createTips(),this.adjustVisual()},M.typeName="MeasurementMarker",M.title="Measurement marker",M.icon='<svg viewBox="0 0 24 24"><path d="M1.39 18.36l1.77-1.76L4.58 18l1.06-1.05-1.42-1.41 1.42-1.42 2.47 2.48 1.06-1.06-2.47-2.48 1.41-1.41 1.42 1.41L10.59 12l-1.42-1.41 1.42-1.42 2.47 2.48 1.06-1.06-2.47-2.48 1.41-1.41 1.41 1.41 1.07-1.06-1.42-1.41 1.42-1.42L18 6.7l1.07-1.06-2.47-2.48 1.76-1.77 4.25 4.25L5.64 22.61l-4.25-4.25z"/></svg>',M}(E),ce=function(X){function M(N,Y,ie){var K=X.call(this,N,Y,ie)||this;return K.strokePanel.colors=ie.defaultColorSet,K.fillColor="transparent",K}return $(M,X),Object.defineProperty(M.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),M.prototype.getState=function(){var N=X.prototype.getState.call(this);return N.typeName=M.typeName,N},M.typeName="EllipseFrameMarker",M.title="Ellipse frame marker",M.icon='<svg viewBox="0 0 24 24"><path d="M12 6c4.41 0 8 2.69 8 6s-3.59 6-8 6-8-2.69-8-6 3.59-6 8-6m0-2C6.5 4 2 7.58 2 12s4.5 8 10 8 10-3.58 10-8-4.5-8-10-8z"/></svg>',M}(V),me=function(){function X(){this.undoStack=[],this.redoStack=[]}return Object.defineProperty(X.prototype,"isUndoPossible",{get:function(){return this.undoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"isRedoPossible",{get:function(){return this.redoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"undoStepCount",{get:function(){return this.undoStack.length},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"redoStepCount",{get:function(){return this.redoStack.length},enumerable:!1,configurable:!0}),X.prototype.addUndoStep=function(M){this.undoStack.length!==0&&JSON.stringify(this.undoStack[this.undoStack.length-1])===JSON.stringify(M)||(this.undoStack.push(M),JSON.stringify(this.lastRedoStep)!==JSON.stringify(M)&&this.redoStack.splice(0,this.redoStack.length))},X.prototype.replaceLastUndoStep=function(M){this.undoStack.length>0&&(this.undoStack[this.undoStack.length-1]=M)},X.prototype.getLastUndoStep=function(){return this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0},X.prototype.undo=function(){if(this.undoStack.length>1){var M=this.undoStack.pop();return M!==void 0&&this.redoStack.push(M),this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0}},X.prototype.redo=function(){return this.lastRedoStep=this.redoStack.pop(),this.lastRedoStep},X}(),De=function(X){function M(N,Y,ie){var K=X.call(this,N,Y,ie)||this;return K.strokeColor="transparent",K.strokeWidth=0,K.strokeDasharray="",K.curveX=0,K.curveY=0,K.manipulationStartCurveX=0,K.manipulationStartCurveY=0,K.setStrokeColor=K.setStrokeColor.bind(K),K.setStrokeWidth=K.setStrokeWidth.bind(K),K.setStrokeDasharray=K.setStrokeDasharray.bind(K),K.positionGrips=K.positionGrips.bind(K),K.addControlGrips=K.addControlGrips.bind(K),K.adjustVisual=K.adjustVisual.bind(K),K.setupControlBox=K.setupControlBox.bind(K),K.resize=K.resize.bind(K),K.strokeColor=ie.defaultColor,K.strokeWidth=ie.defaultStrokeWidth,K.strokeDasharray=ie.defaultStrokeDasharray,K.strokePanel=new p("Line color",ie.defaultColorSet,ie.defaultColor),K.strokePanel.onColorChanged=K.setStrokeColor,K.strokeWidthPanel=new w("Line width",ie.defaultStrokeWidths,ie.defaultStrokeWidth),K.strokeWidthPanel.onWidthChanged=K.setStrokeWidth,K.strokeStylePanel=new O("Line style",ie.defaultStrokeDasharrays,ie.defaultStrokeDasharray),K.strokeStylePanel.onStyleChanged=K.setStrokeDasharray,K}return $(M,X),M.prototype.ownsTarget=function(N){return!(!X.prototype.ownsTarget.call(this,N)&&N!==this.visual&&N!==this.selectorCurve&&N!==this.visibleCurve&&!this.curveGrip.ownsTarget(N))},M.prototype.getPathD=function(){return"M "+this.x1+" "+this.y1+" Q "+this.curveX+" "+this.curveY+", "+this.x2+" "+this.y2},M.prototype.createVisual=function(){this.visual=L.createGroup(),this.selectorCurve=L.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=L.createPath(this.getPathD(),[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["fill","transparent"]]),this.visual.appendChild(this.selectorCurve),this.visual.appendChild(this.visibleCurve),this.addMarkerVisualToContainer(this.visual)},M.prototype.pointerDown=function(N,Y){X.prototype.pointerDown.call(this,N,Y),this.manipulationStartCurveX=this.curveX,this.manipulationStartCurveY=this.curveY,this.state==="new"&&(this.curveX=N.x,this.curveY=N.y),this.state==="new"?(this.createVisual(),this.adjustVisual(),this._state="creating"):this.curveGrip.ownsTarget(Y)&&(this.activeGrip=this.curveGrip,this._state="resize")},M.prototype.adjustVisual=function(){this.selectorCurve&&this.visibleCurve&&(this.selectorCurve.setAttribute("d",this.getPathD()),this.visibleCurve.setAttribute("d",this.getPathD()),L.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),L.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),L.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},M.prototype.setupControlBox=function(){X.prototype.setupControlBox.call(this),this.curveControlLine1=L.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=L.createLine(this.x2,this.y2,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.controlBox.insertBefore(this.curveControlLine1,this.controlBox.firstChild),this.controlBox.insertBefore(this.curveControlLine2,this.controlBox.firstChild)},M.prototype.addControlGrips=function(){this.curveGrip=this.createGrip(),this.curveX=0,this.curveY=0,X.prototype.addControlGrips.call(this)},M.prototype.positionGrips=function(){X.prototype.positionGrips.call(this);var N=this.curveGrip.GRIP_SIZE;this.positionGrip(this.curveGrip.visual,this.curveX-N/2,this.curveY-N/2),this.curveControlLine1&&this.curveControlLine2&&(this.curveControlLine1.setAttribute("x1",this.x1.toString()),this.curveControlLine1.setAttribute("y1",this.y1.toString()),this.curveControlLine1.setAttribute("x2",this.curveX.toString()),this.curveControlLine1.setAttribute("y2",this.curveY.toString()),this.curveControlLine2.setAttribute("x1",this.x2.toString()),this.curveControlLine2.setAttribute("y1",this.y2.toString()),this.curveControlLine2.setAttribute("x2",this.curveX.toString()),this.curveControlLine2.setAttribute("y2",this.curveY.toString()))},M.prototype.manipulate=function(N){this.state==="move"&&(this.curveX=this.manipulationStartCurveX+N.x-this.manipulationStartX,this.curveY=this.manipulationStartCurveY+N.y-this.manipulationStartY),X.prototype.manipulate.call(this,N)},M.prototype.resize=function(N){this.activeGrip===this.curveGrip&&(this.curveX=N.x,this.curveY=N.y),X.prototype.resize.call(this,N),this.state==="creating"&&(this.curveX=this.x1+(this.x2-this.x1)/2,this.curveY=this.y1+(this.y2-this.y1)/2)},M.prototype.setStrokeColor=function(N){this.strokeColor=N,this.adjustVisual(),this.colorChanged(N)},M.prototype.setStrokeWidth=function(N){this.strokeWidth=N,this.adjustVisual()},M.prototype.setStrokeDasharray=function(N){this.strokeDasharray=N,this.adjustVisual()},M.prototype.scale=function(N,Y){this.curveX=this.curveX*N,this.curveY=this.curveY*Y,X.prototype.scale.call(this,N,Y)},Object.defineProperty(M.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),M.prototype.getState=function(){var N=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,curveX:this.curveX,curveY:this.curveY},X.prototype.getState.call(this));return N.typeName=M.typeName,N},M.prototype.restoreState=function(N){X.prototype.restoreState.call(this,N);var Y=N;this.strokeColor=Y.strokeColor,this.strokeWidth=Y.strokeWidth,this.strokeDasharray=Y.strokeDasharray,this.curveX=Y.curveX,this.curveY=Y.curveY,this.createVisual(),this.adjustVisual()},M.typeName="CurveMarker",M.title="Curve marker",M.icon='<svg viewBox="0 0 24 24"><path d="M18.5 2A1.5 1.5 0 0120 3.5 1.5 1.5 0 0118.5 5c-.23 0-.45-.05-.65-.15l-3.69 3.7.34.45c2.19-1.26 4.76-2 7.5-2l1 .03v2.01L22 9c-2.58 0-5 .75-7 2.04A3.96 3.96 0 0111.04 15C9.75 17 9 19.42 9 22l.04 1H7.03L7 22c0-2.74.74-5.31 2-7.5l-.45-.34-3.7 3.69c.1.2.15.42.15.65A1.5 1.5 0 013.5 20 1.5 1.5 0 012 18.5 1.5 1.5 0 013.5 17c.23 0 .45.05.65.15l3.69-3.7C7.31 12.78 7 11.92 7 11a4 4 0 014-4c.92 0 1.78.31 2.45.84l3.7-3.69c-.1-.2-.15-.42-.15-.65A1.5 1.5 0 0118.5 2M11 9a2 2 0 00-2 2 2 2 0 002 2 2 2 0 002-2 2 2 0 00-2-2z"/></svg>',M}(T),we=function(){function X(M,N){N===void 0&&(N=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=M,this.cancelable=N}return Object.defineProperty(X.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),X.prototype.preventDefault=function(){this._defaultPrevented=!0},X}(),Le=function(X){function M(N,Y,ie){var K=X.call(this,N,!1)||this;return K.dataUrl=Y,K.state=ie,K}return $(M,X),M}(we),Re=function(X){function M(N,Y,ie){ie===void 0&&(ie=!1);var K=X.call(this,N,ie)||this;return K.marker=Y,K}return $(M,X),M}(we),Ie=function(){function X(){this.render=[],this.beforeclose=[],this.close=[],this.show=[],this.restorestate=[],this.statechange=[],this.markerselect=[],this.markerdeselect=[],this.markercreating=[],this.markercreate=[],this.markerbeforedelete=[],this.markerdelete=[],this.markerchange=[],this.focus=[],this.blur=[]}return X.prototype.addEventListener=function(M,N){this[M].push(N)},X.prototype.removeEventListener=function(M,N){var Y=this[M].indexOf(N);Y>-1&&this[M].splice(Y,1)},X}(),ye=function(){function X(M){this.touchPoints=0,this._availableMarkerTypes=this.DEFAULT_MARKER_TYPES,this.mode="select",this.markers=[],this.isDragging=!1,this.renderEventListeners=[],this.closeEventListeners=[],this.settings=new S,this._isOpen=!1,this.undoRedoManager=new me,this.renderAtNaturalSize=!1,this.renderImageType="image/png",this.renderMarkersOnly=!1,this.zoomSteps=[1,1.5,2,4],this._zoomLevel=1,this._isResizing=!1,this.prevPanPoint={x:0,y:0},this.eventListeners=new Ie,this._silentRenderMode=!1,this._isFocused=!1,this._instanceNo=X.instanceCounter++,this.styles=new I(this.instanceNo),this.uiStyleSettings=this.styles.settings,this.target=M,this.targetRoot=document.body,this.width=M.clientWidth,this.height=M.clientHeight,this.styles.removeStyleSheet(),this.open=this.open.bind(this),this.setTopLeft=this.setTopLeft.bind(this),this.toolbarButtonClicked=this.toolbarButtonClicked.bind(this),this.createNewMarker=this.createNewMarker.bind(this),this.addNewMarker=this.addNewMarker.bind(this),this.markerCreated=this.markerCreated.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onDblClick=this.onDblClick.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.onPointerOut=this.onPointerOut.bind(this),this.onKeyUp=this.onKeyUp.bind(this),this.overrideOverflow=this.overrideOverflow.bind(this),this.restoreOverflow=this.restoreOverflow.bind(this),this.close=this.close.bind(this),this.closeUI=this.closeUI.bind(this),this.addCloseEventListener=this.addCloseEventListener.bind(this),this.removeCloseEventListener=this.removeCloseEventListener.bind(this),this.addRenderEventListener=this.addRenderEventListener.bind(this),this.removeRenderEventListener=this.removeRenderEventListener.bind(this),this.clientToLocalCoordinates=this.clientToLocalCoordinates.bind(this),this.onWindowResize=this.onWindowResize.bind(this),this.deleteSelectedMarker=this.deleteSelectedMarker.bind(this),this.setWindowHeight=this.setWindowHeight.bind(this),this.removeMarker=this.removeMarker.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this),this.onPopupTargetResize=this.onPopupTargetResize.bind(this),this.showNotesEditor=this.showNotesEditor.bind(this),this.hideNotesEditor=this.hideNotesEditor.bind(this),this.stepZoom=this.stepZoom.bind(this),this.focus=this.focus.bind(this),this.blur=this.blur.bind(this),this.markerStateChanged=this.markerStateChanged.bind(this),this.switchToSelectMode=this.switchToSelectMode.bind(this),this.addDefs=this.addDefs.bind(this),this.addDefsToImage=this.addDefsToImage.bind(this)}return Object.defineProperty(X.prototype,"ALL_MARKER_TYPES",{get:function(){return[R,v,F,x,ce,V,j,b,re,B,E,De]},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[R,v,F,x,V,j,b]},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"BASIC_MARKER_TYPES",{get:function(){return[R,v,F,x,j]},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"availableMarkerTypes",{get:function(){return this._availableMarkerTypes},set:function(M){var N=this;this._availableMarkerTypes.splice(0),M.forEach(function(Y){if(typeof Y=="string"){var ie=N.ALL_MARKER_TYPES.find(function(K){return K.typeName===Y});ie!==void 0&&N._availableMarkerTypes.push(ie)}else N._availableMarkerTypes.push(Y)})},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"currentMarker",{get:function(){return this._currentMarker},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"isUndoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isUndoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"isRedoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isRedoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"zoomLevel",{get:function(){return this._zoomLevel},set:function(M){this._zoomLevel=M,this.editorCanvas&&this.contentDiv&&(this.editorCanvas.style.transform="scale("+this._zoomLevel+")",this.contentDiv.scrollTo({left:(this.editorCanvas.clientWidth*this._zoomLevel-this.contentDiv.clientWidth)/2,top:(this.editorCanvas.clientHeight*this._zoomLevel-this.contentDiv.clientHeight)/2}))},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),X.prototype.open=function(){this.setupResizeObserver(),this.setEditingTarget(),this.setTopLeft(),this.initMarkerCanvas(),this.initOverlay(),this.attachEvents(),this.settings.displayMode==="popup"&&this.onPopupTargetResize(),W.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},X.prototype.show=function(){var M=this;this.styles.styleSheetRoot===void 0&&n.styleSheetRoot!==void 0&&(this.styles.styleSheetRoot=n.styleSheetRoot),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach(function(N){return N(new we(M))})},X.prototype.render=function(){return k(this,void 0,void 0,function(){var M;return z(this,function(N){switch(N.label){case 0:return this.setCurrentMarker(),(M=new H).naturalSize=this.renderAtNaturalSize,M.imageType=this.renderImageType,M.imageQuality=this.renderImageQuality,M.markersOnly=this.renderMarkersOnly,M.width=this.renderWidth,M.height=this.renderHeight,[4,M.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 1:return N.sent(),[4,M.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 2:return[2,N.sent()]}})})},X.prototype.close=function(M){var N=this;if(M===void 0&&(M=!1),this.isOpen){var Y=!1;M||this.eventListeners.beforeclose.forEach(function(ie){var K=new we(N,!0);ie(K),K.defaultPrevented&&(Y=!0)}),Y||(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.settings.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),this.eventListeners.close.forEach(function(ie){return ie(new we(N))}),this.detachEvents(),this._isOpen=!1)}},X.prototype.addMarkersToToolbar=function(){for(var M,N=[],Y=0;Y<arguments.length;Y++)N[Y]=arguments[Y];(M=this._availableMarkerTypes).push.apply(M,N)},X.prototype.addRenderEventListener=function(M){this.addEventListener("render",function(N){M(N.dataUrl,N.state)})},X.prototype.removeRenderEventListener=function(M){},X.prototype.addCloseEventListener=function(M){this.addEventListener("close",function(){M()})},X.prototype.removeCloseEventListener=function(M){},X.prototype.setupResizeObserver=function(){var M=this;this.settings.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){M.resize(M.target.clientWidth,M.target.clientHeight)}),this.targetObserver.observe(this.target)):this.settings.displayMode==="popup"&&(window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){return M.onPopupTargetResize()}),this.targetObserver.observe(this.editorCanvas)),window.addEventListener("resize",this.setWindowHeight))},X.prototype.onPopupTargetResize=function(){var M=1*this.target.clientWidth/this.target.clientHeight,N=this.editorCanvas.clientWidth/M>this.editorCanvas.clientHeight?this.editorCanvas.clientHeight*M:this.editorCanvas.clientWidth,Y=N<this.editorCanvas.clientWidth?this.editorCanvas.clientHeight:this.editorCanvas.clientWidth/M;this.resize(N,Y)},X.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},X.prototype.resize=function(M,N){this._isResizing=!0;var Y=M/this.imageWidth,ie=N/this.imageHeight;this.imageWidth=Math.round(M),this.imageHeight=Math.round(N),this.target instanceof HTMLImageElement&&this.editingTarget instanceof HTMLImageElement&&(this.editingTarget.src=this.target.src),this.editingTarget.width=this.imageWidth,this.editingTarget.height=this.imageHeight,this.editingTarget.style.width=this.imageWidth+"px",this.editingTarget.style.height=this.imageHeight+"px",this.markerImage.setAttribute("width",this.imageWidth.toString()),this.markerImage.setAttribute("height",this.imageHeight.toString()),this.markerImage.setAttribute("viewBox","0 0 "+this.imageWidth.toString()+" "+this.imageHeight.toString()),this.markerImageHolder.style.width=this.imageWidth+"px",this.markerImageHolder.style.height=this.imageHeight+"px",this.overlayContainer.style.width=this.imageWidth+"px",this.overlayContainer.style.height=this.imageHeight+"px",this.settings.displayMode!=="popup"?this.coverDiv.style.width=this.imageWidth.toString()+"px":(this.setTopLeft(),this.positionMarkerImage()),this.toolbar!==void 0&&this.toolbar.adjustLayout(),this.positionLogo(),this.scaleMarkers(Y,ie),this._isResizing=!1},X.prototype.scaleMarkers=function(M,N){var Y,ie=this;this._currentMarker&&this._currentMarker instanceof x?this._currentMarker.scale(M,N):(Y=this._currentMarker,this.setCurrentMarker()),this.markers.forEach(function(K){K!==ie._currentMarker&&K.scale(M,N)}),Y!==void 0&&this.setCurrentMarker(Y)},X.prototype.setEditingTarget=function(){this.imageWidth=Math.round(this.target.clientWidth),this.imageHeight=Math.round(this.target.clientHeight),this.target instanceof HTMLImageElement&&this.editingTarget instanceof HTMLImageElement&&(this.editingTarget.src=this.target.src),this.editingTarget.width=this.imageWidth,this.editingTarget.height=this.imageHeight,this.editingTarget.style.width=this.imageWidth+"px",this.editingTarget.style.height=this.imageHeight+"px"},X.prototype.setTopLeft=function(){var M=this.editingTarget.getBoundingClientRect(),N=this.editorCanvas.getBoundingClientRect();this.left=M.left-N.left,this.top=M.top-N.top},X.prototype.initMarkerCanvas=function(){this.markerImageHolder=document.createElement("div"),this.markerImageHolder.style.setProperty("touch-action","pinch-zoom"),this.markerImage=document.createElementNS("http://www.w3.org/2000/svg","svg"),this.markerImage.setAttribute("xmlns","http://www.w3.org/2000/svg"),this.markerImage.setAttribute("width",this.imageWidth.toString()),this.markerImage.setAttribute("height",this.imageHeight.toString()),this.markerImage.setAttribute("viewBox","0 0 "+this.imageWidth.toString()+" "+this.imageHeight.toString()),this.markerImage.style.pointerEvents="auto",this.markerImageHolder.style.position="absolute",this.markerImageHolder.style.width=this.imageWidth+"px",this.markerImageHolder.style.height=this.imageHeight+"px",this.markerImageHolder.style.transformOrigin="top left",this.positionMarkerImage(),this.markerImageHolder.appendChild(this.markerImage),this.editorCanvas.appendChild(this.markerImageHolder)},X.prototype.addDefs=function(){for(var M,N=[],Y=0;Y<arguments.length;Y++)N[Y]=arguments[Y];this.defs=L.createDefs(),this.addDefsToImage(),(M=this.defs).append.apply(M,N)},X.prototype.addDefsToImage=function(){this.defs&&this.markerImage.insertBefore(this.defs,this.markerImage.firstChild)},X.prototype.initOverlay=function(){this.overlayContainer=document.createElement("div"),this.overlayContainer.style.position="absolute",this.overlayContainer.style.left="0px",this.overlayContainer.style.top="0px",this.overlayContainer.style.width=this.imageWidth+"px",this.overlayContainer.style.height=this.imageHeight+"px",this.overlayContainer.style.display="flex",this.markerImageHolder.appendChild(this.overlayContainer)},X.prototype.positionMarkerImage=function(){this.markerImageHolder.style.top=this.top/this.zoomLevel+"px",this.markerImageHolder.style.left=this.left/this.zoomLevel+"px"},X.prototype.attachEvents=function(){this.markerImage.addEventListener("pointerdown",this.onPointerDown),this.markerImage.addEventListener("dblclick",this.onDblClick),this.attachWindowEvents()},X.prototype.attachWindowEvents=function(){window.addEventListener("pointermove",this.onPointerMove),window.addEventListener("pointerup",this.onPointerUp),window.addEventListener("pointercancel",this.onPointerOut),window.addEventListener("pointerout",this.onPointerOut),window.addEventListener("pointerleave",this.onPointerUp),window.addEventListener("resize",this.onWindowResize),window.addEventListener("keyup",this.onKeyUp)},X.prototype.detachEvents=function(){this.markerImage.removeEventListener("pointerdown",this.onPointerDown),this.markerImage.removeEventListener("dblclick",this.onDblClick),this.detachWindowEvents()},X.prototype.detachWindowEvents=function(){window.removeEventListener("pointermove",this.onPointerMove),window.removeEventListener("pointerup",this.onPointerUp),window.removeEventListener("pointercancel",this.onPointerOut),window.removeEventListener("pointerout",this.onPointerOut),window.removeEventListener("pointerleave",this.onPointerUp),window.removeEventListener("resize",this.onWindowResize),window.removeEventListener("keyup",this.onKeyUp)},X.prototype.addLogo=function(){this.logoUI=document.createElement("div"),this.logoUI.style.display="inline-block",this.logoUI.style.margin="0px",this.logoUI.style.padding="0px",this.logoUI.style.fill="#333333";var M=document.createElement("a");M.href="https://markerjs.com/",M.target="_blank",M.innerHTML='<svg viewBox="0 0 112 96" xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="1.414"><path fill="#e5f20d" fill-opacity=".647" d="M0 40.386h111.96V95.62H0z"/><path d="M93.61 61.452c0 .987-.328 1.831-.987 2.53-.657.7-1.52 1.048-2.591 1.048-1.481 0-2.222-.74-2.222-2.22 0-16.617-.533-29.347-1.604-38.192-1.068-8.842-2.92-13.265-5.552-13.265-4.443 0-10.94 15.509-19.497 46.52v.124c0 .987-.328 1.831-.987 2.53-.657.7-1.52 1.048-2.592 1.048-1.48 0-2.22-.74-2.22-2.22 0-3.29.165-8.392.493-15.302.33-7.732.494-13.82.494-18.262 0-6.17-.186-10.55-.556-13.142-.37-2.591-1.172-3.887-2.406-3.887-2.796 0-6.333 5.12-10.612 15.363C38.494 34.367 34.01 46.44 29.32 60.34l-1.11 3.209a5.714 5.714 0 01-1.42 2.097c-.617.578-1.295.864-2.036.864-.987 0-1.644-.081-1.974-.247-.328-.162-.533-.656-.617-1.48-.41-4.03-.74-9.418-.987-16.165-.163-1.728-.329-4.566-.494-8.515-.822-13.901-1.562-23.3-2.221-28.196-.657-4.893-.987-7.628-.987-8.205 0-.657.33-1.44.987-2.345.659-.903 1.276-1.357 1.85-1.357 1.319 0 2.387.947 3.21 2.838.411.906.863 4.526 1.357 10.859.493 6.335.905 14.19 1.233 23.568l.617 18.88c4.527-13.983 9.216-26.673 14.068-38.068C45.65 6.686 50.093.988 54.123.988c2.715 0 4.566 1.974 5.553 5.923.987 3.949 1.481 9.667 1.481 17.152 0 3.949-.081 9.625-.247 17.029l-.123 5.676c3.373-11.762 6.725-21.634 10.057-29.615 3.331-7.979 6.685-11.97 10.056-11.97 8.475 0 12.71 18.757 12.71 56.269z" fill-rule="nonzero"/></svg>',M.title="Powered by marker.js",M.style.display="grid",M.style.alignItems="center",M.style.justifyItems="center",M.style.padding="3px",M.style.width="20px",M.style.height="20px",this.logoUI.appendChild(M),this.editorCanvas.appendChild(this.logoUI),this.logoUI.style.position="absolute",this.logoUI.style.pointerEvents="all",this.positionLogo()},X.prototype.positionLogo=function(){this.logoUI&&(this.uiStyleSettings.logoPosition!=="right"?this.logoUI.style.left=this.markerImageHolder.offsetLeft+10+"px":this.logoUI.style.left=this.markerImageHolder.offsetLeft+this.markerImageHolder.offsetWidth-this.logoUI.clientWidth-10+"px",this.logoUI.style.top=this.markerImageHolder.offsetTop+this.markerImageHolder.offsetHeight-this.logoUI.clientHeight-10+"px")},X.prototype.overrideOverflow=function(){this.scrollXState=window.scrollX,this.scrollYState=window.scrollY,this.bodyOverflowState=document.body.style.overflow,window.scroll({top:0,left:0}),document.body.style.overflow="hidden"},X.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},X.prototype.showUI=function(){switch(this.settings.displayMode==="popup"&&this.overrideOverflow(),this.coverDiv=document.createElement("div"),this.coverDiv.style.visibility=this._silentRenderMode?"hidden":"visible",this.coverDiv.className=this.styles.classNamePrefixBase+" "+this.styles.classNamePrefix,this.coverDiv.style.fontSize="16px",this.coverDiv.style.userSelect="none",this.settings.displayMode){case"inline":this.coverDiv.style.position="absolute";var M=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=M+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px",this.coverDiv.style.width=this.target.offsetWidth.toString()+"px",this.coverDiv.style.zIndex=this.uiStyleSettings.zIndex!==void 0?this.uiStyleSettings.zIndex:"5";break;case"popup":this.coverDiv.style.position="absolute",this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=window.innerHeight+"px",this.coverDiv.style.backgroundColor="rgba(0, 0, 0, 0.75)",this.coverDiv.style.zIndex=this.uiStyleSettings.zIndex!==void 0?this.uiStyleSettings.zIndex:"1000",this.coverDiv.style.display="flex"}this.targetRoot.appendChild(this.coverDiv),this.uiDiv=document.createElement("div"),this.uiDiv.style.display="flex",this.uiDiv.style.flexDirection="column",this.uiDiv.style.flexGrow="2",this.uiDiv.style.margin=this.settings.displayMode==="popup"?this.settings.popupMargin+"px":"0px",this.uiDiv.style.border="0px",this.coverDiv.appendChild(this.uiDiv),this.toolbar=new m(this.uiDiv,this.settings.displayMode,this._availableMarkerTypes,this.uiStyleSettings,this.styles),this.toolbar.addButtonClickListener(this.toolbarButtonClicked),this.toolbar.show(this._silentRenderMode||this.uiStyleSettings.hideToolbar?"hidden":"visible"),this.contentDiv=document.createElement("div"),this.contentDiv.style.display="flex",this.contentDiv.style.flexDirection="row",this.contentDiv.style.flexGrow="2",this.contentDiv.style.flexShrink="1",this.settings.displayMode==="popup"&&(this.contentDiv.style.backgroundColor=this.uiStyleSettings.canvasBackgroundColor,this.contentDiv.style.maxHeight=this.windowHeight-2*this.settings.popupMargin-3.5*this.uiStyleSettings.toolbarHeight+"px",this.contentDiv.style.maxWidth="calc(100vw - "+2*this.settings.popupMargin+"px)"),this.contentDiv.style.overflow="auto",this.uiDiv.appendChild(this.contentDiv),this.editorCanvas=document.createElement("div"),this.editorCanvas.style.flexGrow="2",this.editorCanvas.style.flexShrink="1",this.editorCanvas.style.position="relative",this.editorCanvas.style.overflow="hidden",this.editorCanvas.style.display="flex",this.settings.displayMode==="popup"&&(this.editorCanvas.style.alignItems="center",this.editorCanvas.style.justifyContent="center"),this.editorCanvas.style.pointerEvents="none",this.editorCanvas.style.transformOrigin="left top",this.editorCanvas.style.transform="scale("+this.zoomLevel+")",this.contentDiv.appendChild(this.editorCanvas),this.editingTarget=this.target instanceof HTMLImageElement?document.createElement("img"):document.createElement("canvas"),this.target.getClientRects().item(0).y<this.styles.settings.toolbarHeight&&(this.editingTarget.style.marginTop=this.target.offsetTop-this.styles.settings.toolbarHeight+"px"),this.editorCanvas.appendChild(this.editingTarget),this.toolbox=new h(this.uiDiv,this.settings.displayMode,this.uiStyleSettings,this.styles),this.toolbox.show(this._silentRenderMode||this.uiStyleSettings.hideToolbox?"hidden":"visible")},X.prototype.closeUI=function(){this.settings.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},X.prototype.removeMarker=function(M){this.markerImage.removeChild(M.container),this.markers.indexOf(M)>-1&&this.markers.splice(this.markers.indexOf(M),1),M.dispose()},X.prototype.switchToSelectMode=function(){this.mode="select",this.hideNotesEditor(),this._currentMarker!==void 0&&(this._currentMarker.state!=="new"?this._currentMarker.select():(this.removeMarker(this._currentMarker),this.setCurrentMarker(),this.markerImage.style.cursor="default"),this.addUndoStep())},X.prototype.toolbarButtonClicked=function(M,N){if(M==="marker"&&N!==void 0)this.createNewMarker(N);else if(M==="action")switch(N){case"select":this.switchToSelectMode(),this.switchToSelectMode();break;case"delete":this.deleteSelectedMarker();break;case"clear":this.clear();break;case"undo":this.undo();break;case"redo":this.redo();break;case"zoom":this.stepZoom();break;case"zoom-out":this.zoomLevel=1;break;case"notes":this.notesArea===void 0?(this.switchToSelectMode(),this.zoomLevel=1,this.showNotesEditor()):this.switchToSelectMode();break;case"close":this.close();break;case"render":this.switchToSelectMode(),this.startRenderAndClose()}},X.prototype.deleteSelectedMarker=function(){var M=this;if(this._currentMarker!==void 0){var N=!1;if(this.eventListeners.markerbeforedelete.forEach(function(ie){var K=new Re(M,M._currentMarker,!0);ie(K),K.defaultPrevented&&(N=!0)}),!N){var Y=this._currentMarker;this._currentMarker.dispose(),this.markerImage.removeChild(this._currentMarker.container),this.markers.splice(this.markers.indexOf(this._currentMarker),1),this.setCurrentMarker(),this.addUndoStep(),this.eventListeners.markerdelete.forEach(function(ie){return ie(new Re(M,Y))})}}},X.prototype.clear=function(){var M=this,N=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach(function(pe){var Se=new Re(M,void 0,!0);pe(Se),Se.defaultPrevented&&(N=!0)}),!N)){this.setCurrentMarker();for(var Y=function(pe){var Se=ie.markers[pe];ie.setCurrentMarker(ie.markers[pe]),ie._currentMarker.dispose(),ie.markerImage.removeChild(ie._currentMarker.container),ie.markers.splice(ie.markers.indexOf(ie._currentMarker),1),ie.eventListeners.markerdelete.forEach(function(Pe){return Pe(new Re(M,Se))})},ie=this,K=this.markers.length-1;K>=0;K--)Y(K);this.addUndoStep()}},Object.defineProperty(X.prototype,"isNotesAreaOpen",{get:function(){return this.notesArea!==void 0},enumerable:!1,configurable:!0}),X.prototype.showNotesEditor=function(){var M;this._currentMarker!==void 0&&(this.overlayContainer.innerHTML="",this.notesArea=document.createElement("textarea"),this.notesArea.className=this.uiStyleSettings.notesAreaStyleClassName,this.notesArea.style.pointerEvents="auto",this.notesArea.style.alignSelf="stretch",this.notesArea.style.width="100%",this.notesArea.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.notesArea.value=(M=this._currentMarker.notes)!==null&&M!==void 0?M:"",this.overlayContainer.appendChild(this.notesArea))},X.prototype.hideNotesEditor=function(){this.isNotesAreaOpen&&(this._currentMarker!==void 0&&(this._currentMarker.notes=this.notesArea.value.trim()!==""?this.notesArea.value:void 0),this.overlayContainer.removeChild(this.notesArea),this.notesArea=void 0)},X.prototype.selectLastMarker=function(){this.markers.length>0?this.setCurrentMarker(this.markers[this.markers.length-1]):this.setCurrentMarker()},X.prototype.addUndoStep=function(){var M=this;if(this._currentMarker===void 0||this._currentMarker.state!=="edit"){var N=this.getState(),Y=this.undoRedoManager.getLastUndoStep();if(!Y||Y.width===N.width&&Y.height===N.height){var ie=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(N),ie<this.undoRedoManager.undoStepCount&&this.eventListeners.statechange.forEach(function(K){return K(new we(M))})}else this.undoRedoManager.replaceLastUndoStep(N),this.eventListeners.statechange.forEach(function(K){return K(new we(M))})}},X.prototype.undo=function(){this.switchToSelectMode(),this.addUndoStep(),this.undoStep()},X.prototype.undoStep=function(){var M=this,N=this.undoRedoManager.undo();N!==void 0&&(this.restoreState(N),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(Y){return Y(new we(M))}))},X.prototype.redo=function(){this.switchToSelectMode(),this.redoStep()},X.prototype.redoStep=function(){var M=this,N=this.undoRedoManager.redo();N!==void 0&&(this.restoreState(N),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(Y){return Y(new we(M))}))},X.prototype.stepZoom=function(){var M=this.zoomSteps.indexOf(this.zoomLevel);this.zoomLevel=M<this.zoomSteps.length-1?this.zoomSteps[M+1]:this.zoomSteps[0]},X.prototype.panTo=function(M){this.contentDiv.scrollBy({left:this.prevPanPoint.x-M.x,top:this.prevPanPoint.y-M.y}),this.prevPanPoint=M},X.prototype.startRenderAndClose=function(){return k(this,void 0,void 0,function(){var M,N,Y=this;return z(this,function(ie){switch(ie.label){case 0:return[4,this.render()];case 1:return M=ie.sent(),N=this.getState(),this.eventListeners.render.forEach(function(K){return K(new Le(Y,M,N))}),this.close(!0),[2]}})})},X.prototype.getState=function(M){M===!0&&this.setCurrentMarker();var N={width:this.imageWidth,height:this.imageHeight,markers:[]};return this.markers.forEach(function(Y){return N.markers.push(Y.getState())}),N},X.prototype.restoreState=function(M){var N=this;for(this.markers.splice(0);this.markerImage.lastChild;)this.markerImage.removeChild(this.markerImage.lastChild);M.markers.forEach(function(Y){var ie=N._availableMarkerTypes.find(function(pe){return pe.typeName===Y.typeName});if(ie!==void 0){var K=N.addNewMarker(ie);K.restoreState(Y),N.markers.push(K)}}),M.width&&M.height&&(M.width!==this.imageWidth||M.height!==this.imageHeight)&&this.scaleMarkers(this.imageWidth/M.width,this.imageHeight/M.height),this.eventListeners.restorestate.forEach(function(Y){return Y(new we(N))})},X.prototype.addNewMarker=function(M){var N=L.createGroup();return this.markerImage.appendChild(N),new M(N,this.overlayContainer,this.settings)},X.prototype.createNewMarker=function(M){var N,Y=this;(N=typeof M=="string"?this._availableMarkerTypes.find(function(ie){return ie.typeName===M}):M)&&(this.setCurrentMarker(),this.addUndoStep(),this._currentMarker=this.addNewMarker(N),this._currentMarker.onMarkerCreated=this.markerCreated,this._currentMarker.onColorChanged=this.colorChanged,this._currentMarker.onFillColorChanged=this.fillColorChanged,this._currentMarker.onStateChanged=this.markerStateChanged,this.markerImage.style.cursor="crosshair",this.toolbar.setActiveMarkerButton(N.typeName),this.toolbox.setPanelButtons(this._currentMarker.toolboxPanels),this.eventListeners.markercreating.forEach(function(ie){return ie(new Re(Y,Y._currentMarker))}))},X.prototype.markerCreated=function(M){var N=this;this.mode="select",this.markerImage.style.cursor="default",this.markers.push(M),this.setCurrentMarker(M),M instanceof v&&this.settings.newFreehandMarkerOnPointerUp?this.createNewMarker(v):this.toolbar.setSelectMode(),this.addUndoStep(),this.eventListeners.markercreate.forEach(function(Y){return Y(new Re(N,N._currentMarker))})},X.prototype.colorChanged=function(M){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultColor=M,this.settings.defaultStrokeColor=M)},X.prototype.fillColorChanged=function(M){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultFillColor=M)},X.prototype.markerStateChanged=function(M){var N=this;this.eventListeners.markerchange.forEach(function(Y){return Y(new Re(N,M))})},X.prototype.setCurrentMarker=function(M){var N=this;this._currentMarker!==M&&this._currentMarker!==void 0&&(this._currentMarker.deselect(),this.toolbar.setCurrentMarker(),this.toolbox.setPanelButtons([]),this._isResizing||this.eventListeners.markerdeselect.forEach(function(Y){return Y(new Re(N,N._currentMarker))})),this._currentMarker=M,this._currentMarker===void 0||this._currentMarker.isSelected||(this._currentMarker.state!=="new"&&this._currentMarker.select(),this.toolbar.setCurrentMarker(this._currentMarker),this.toolbox.setPanelButtons(this._currentMarker.toolboxPanels),this._isResizing||this.eventListeners.markerselect.forEach(function(Y){return Y(new Re(N,N._currentMarker))}))},X.prototype.onPointerDown=function(M){if(this._isFocused||this.focus(),this.touchPoints++,this.touchPoints===1||M.pointerType!=="touch")if(this._currentMarker===void 0||this._currentMarker.state!=="new"&&this._currentMarker.state!=="creating"){if(this.mode==="select"){var N=this.markers.find(function(Y){return Y.ownsTarget(M.target)});N!==void 0?(this.setCurrentMarker(N),this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(M.clientX,M.clientY),M.target)):(this.setCurrentMarker(),this.isDragging=!0,this.prevPanPoint={x:M.clientX,y:M.clientY})}}else this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(M.clientX,M.clientY))},X.prototype.onDblClick=function(M){if(this._isFocused||this.focus(),this.mode==="select"){var N=this.markers.find(function(Y){return Y.ownsTarget(M.target)});N!==void 0&&N!==this._currentMarker&&this.setCurrentMarker(N),this._currentMarker!==void 0?this._currentMarker.dblClick(this.clientToLocalCoordinates(M.clientX,M.clientY),M.target):this.setCurrentMarker()}},X.prototype.onPointerMove=function(M){this.touchPoints!==1&&M.pointerType==="touch"||(this._currentMarker!==void 0||this.isDragging)&&(this._currentMarker!==void 0&&this._currentMarker.state==="edit"||M.preventDefault(),this._currentMarker!==void 0?this._currentMarker.manipulate(this.clientToLocalCoordinates(M.clientX,M.clientY)):this.zoomLevel>1&&this.panTo({x:M.clientX,y:M.clientY}))},X.prototype.onPointerUp=function(M){this.touchPoints>0&&this.touchPoints--,this.touchPoints===0&&this.isDragging&&this._currentMarker!==void 0&&this._currentMarker.pointerUp(this.clientToLocalCoordinates(M.clientX,M.clientY)),this.isDragging=!1,this.addUndoStep()},X.prototype.onPointerOut=function(){this.touchPoints>0&&this.touchPoints--},X.prototype.onKeyUp=function(M){this._currentMarker===void 0||this.notesArea!==void 0||M.key!=="Delete"&&M.key!=="Backspace"||this.deleteSelectedMarker()},X.prototype.clientToLocalCoordinates=function(M,N){var Y=this.markerImage.getBoundingClientRect();return{x:(M-Y.left)/this.zoomLevel,y:(N-Y.top)/this.zoomLevel}},X.prototype.onWindowResize=function(){this.positionUI()},X.prototype.positionUI=function(){switch(this.setTopLeft(),this.settings.displayMode){case"inline":var M=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=M+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px";break;case"popup":this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=this.windowHeight+"px",this.contentDiv.style.maxHeight=this.windowHeight-2*this.settings.popupMargin-3.5*this.styles.settings.toolbarHeight+"px"}this.positionMarkerImage(),this.positionLogo()},X.prototype.addLicenseKey=function(M){W.addKey(M)},X.prototype.addEventListener=function(M,N){this.eventListeners.addEventListener(M,N)},X.prototype.removeEventListener=function(M,N){this.eventListeners.removeEventListener(M,N)},X.prototype.renderState=function(M){this._silentRenderMode=!0,this.settings.displayMode="inline",this.isOpen||this.show(),this.restoreState(M),this.startRenderAndClose(),this._silentRenderMode=!1},Object.defineProperty(X.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!1,configurable:!0}),X.prototype.focus=function(){var M=this;this._isFocused||(this.attachWindowEvents(),this._isFocused=!0,this._previousCurrentMarker!==void 0&&this.setCurrentMarker(this._previousCurrentMarker),this.eventListeners.focus.forEach(function(N){return N(new we(M))}))},X.prototype.blur=function(){var M=this;this._isFocused&&(this.detachWindowEvents(),this._isFocused=!1,this._previousCurrentMarker=this._currentMarker,this.setCurrentMarker(),this.eventListeners.blur.forEach(function(N){return N(new we(M))}))},X.instanceCounter=0,X}()},T8No:function(tt,Ee,J){"use strict";J.d(Ee,"a",function(){return W}),J.d(Ee,"e",function(){return H}),J.d(Ee,"c",function(){return E}),J.d(Ee,"b",function(){return c}),J.d(Ee,"d",function(){return x}),J.d(Ee,"f",function(){return F});var oe=J("MNsG"),$=J("N0LK"),k=J("Cg/j");let z=oe.k||"";const U=new Map;U.set("false",!1),U.set("true",!0),U.set("isMac",oe.f),U.set("isLinux",oe.d),U.set("isWindows",oe.i),U.set("isWeb",oe.h),U.set("isMacNative",oe.f&&!oe.h),U.set("isEdge",z.indexOf("Edg/")>=0),U.set("isFirefox",z.indexOf("Firefox")>=0),U.set("isChrome",z.indexOf("Chrome")>=0),U.set("isSafari",z.indexOf("Safari")>=0);const L=Object.prototype.hasOwnProperty;class W{static has(A){return f.create(A)}static equals(A,j){return m.create(A,j)}static regex(A,j){return w.create(A,j)}static not(A){return l.create(A)}static and(...A){return S.create(A,null)}static or(...A){return T.create(A,null,!0)}static deserialize(A,j=!1){return A?this._deserializeOrExpression(A,j):void 0}static _deserializeOrExpression(A,j){let P=A.split("||");return T.create(P.map(b=>this._deserializeAndExpression(b,j)),null,!0)}static _deserializeAndExpression(A,j){let P=A.split("&&");return S.create(P.map(b=>this._deserializeOne(b,j)),null)}static _deserializeOne(A,j){if(A=A.trim(),A.indexOf("!=")>=0){let P=A.split("!=");return p.create(P[0].trim(),this._deserializeValue(P[1],j))}if(A.indexOf("==")>=0){let P=A.split("==");return m.create(P[0].trim(),this._deserializeValue(P[1],j))}if(A.indexOf("=~")>=0){let P=A.split("=~");return w.create(P[0].trim(),this._deserializeRegexValue(P[1],j))}if(A.indexOf(" in ")>=0){let P=A.split(" in ");return h.create(P[0].trim(),P[1].trim())}if(/^[^<=>]+>=[^<=>]+$/.test(A)){const P=A.split(">=");return s.create(P[0].trim(),P[1].trim())}if(/^[^<=>]+>[^<=>]+$/.test(A)){const P=A.split(">");return a.create(P[0].trim(),P[1].trim())}if(/^[^<=>]+<=[^<=>]+$/.test(A)){const P=A.split("<=");return _.create(P[0].trim(),P[1].trim())}if(/^[^<=>]+<[^<=>]+$/.test(A)){const P=A.split("<");return C.create(P[0].trim(),P[1].trim())}return/^\!\s*/.test(A)?l.create(A.substr(1).trim()):f.create(A)}static _deserializeValue(A,j){if(A=A.trim(),A==="true")return!0;if(A==="false")return!1;let P=/^'([^']*)'$/.exec(A);return P?P[1].trim():A}static _deserializeRegexValue(A,j){if(Object($.C)(A)){if(j)throw new Error("missing regexp-value for =~-expression");return console.warn("missing regexp-value for =~-expression"),null}let P=A.indexOf("/"),b=A.lastIndexOf("/");if(P===b||P<0){if(j)throw new Error(`bad regexp-value '${A}', missing /-enclosure`);return console.warn(`bad regexp-value '${A}', missing /-enclosure`),null}let V=A.slice(P+1,b),re=A[b+1]==="i"?"i":"";try{return new RegExp(V,re)}catch(ce){if(j)throw new Error(`bad regexp-value '${A}', parse error: ${ce}`);return console.warn(`bad regexp-value '${A}', parse error: ${ce}`),null}}}function H(A,j){const P=A?A.substituteConstants():void 0,b=j?j.substituteConstants():void 0;return!P&&!b?!0:!P||!b?!1:P.equals(b)}function n(A,j){return A.cmp(j)}class I{constructor(){this.type=0}cmp(A){return this.type-A.type}equals(A){return A.type===this.type}substituteConstants(){return this}evaluate(A){return!1}serialize(){return"false"}keys(){return[]}negate(){return g.INSTANCE}}I.INSTANCE=new I;class g{constructor(){this.type=1}cmp(A){return this.type-A.type}equals(A){return A.type===this.type}substituteConstants(){return this}evaluate(A){return!0}serialize(){return"true"}keys(){return[]}negate(){return I.INSTANCE}}g.INSTANCE=new g;class f{constructor(A,j){this.key=A,this.negated=j,this.type=2}static create(A,j=null){const P=U.get(A);return typeof P=="boolean"?P?g.INSTANCE:I.INSTANCE:new f(A,j)}cmp(A){return A.type!==this.type?this.type-A.type:v(this.key,A.key)}equals(A){return A.type===this.type?this.key===A.key:!1}substituteConstants(){const A=U.get(this.key);return typeof A=="boolean"?A?g.INSTANCE:I.INSTANCE:this}evaluate(A){return!!A.getValue(this.key)}serialize(){return this.key}keys(){return[this.key]}negate(){return this.negated||(this.negated=l.create(this.key,this)),this.negated}}class m{constructor(A,j,P){this.key=A,this.value=j,this.negated=P,this.type=4}static create(A,j,P=null){if(typeof j=="boolean")return j?f.create(A,P):l.create(A,P);const b=U.get(A);if(typeof b=="boolean"){const V=b?"true":"false";return j===V?g.INSTANCE:I.INSTANCE}return new m(A,j,P)}cmp(A){return A.type!==this.type?this.type-A.type:y(this.key,this.value,A.key,A.value)}equals(A){return A.type===this.type?this.key===A.key&&this.value===A.value:!1}substituteConstants(){const A=U.get(this.key);if(typeof A=="boolean"){const j=A?"true":"false";return this.value===j?g.INSTANCE:I.INSTANCE}return this}evaluate(A){return A.getValue(this.key)==this.value}serialize(){return`${this.key} == '${this.value}'`}keys(){return[this.key]}negate(){return this.negated||(this.negated=p.create(this.key,this.value,this)),this.negated}}class h{constructor(A,j){this.key=A,this.valueKey=j,this.type=10,this.negated=null}static create(A,j){return new h(A,j)}cmp(A){return A.type!==this.type?this.type-A.type:y(this.key,this.valueKey,A.key,A.valueKey)}equals(A){return A.type===this.type?this.key===A.key&&this.valueKey===A.valueKey:!1}substituteConstants(){return this}evaluate(A){const j=A.getValue(this.valueKey),P=A.getValue(this.key);return Array.isArray(j)?j.indexOf(P)>=0:typeof P=="string"&&typeof j=="object"&&j!==null?L.call(j,P):!1}serialize(){return`${this.key} in '${this.valueKey}'`}keys(){return[this.key,this.valueKey]}negate(){return this.negated||(this.negated=o.create(this)),this.negated}}class o{constructor(A){this._actual=A,this.type=11}static create(A){return new o(A)}cmp(A){return A.type!==this.type?this.type-A.type:this._actual.cmp(A._actual)}equals(A){return A.type===this.type?this._actual.equals(A._actual):!1}substituteConstants(){return this}evaluate(A){return!this._actual.evaluate(A)}serialize(){throw new Error("Method not implemented.")}keys(){return this._actual.keys()}negate(){return this._actual}}class p{constructor(A,j,P){this.key=A,this.value=j,this.negated=P,this.type=5}static create(A,j,P=null){if(typeof j=="boolean")return j?l.create(A,P):f.create(A,P);const b=U.get(A);if(typeof b=="boolean"){const V=b?"true":"false";return j===V?I.INSTANCE:g.INSTANCE}return new p(A,j,P)}cmp(A){return A.type!==this.type?this.type-A.type:y(this.key,this.value,A.key,A.value)}equals(A){return A.type===this.type?this.key===A.key&&this.value===A.value:!1}substituteConstants(){const A=U.get(this.key);if(typeof A=="boolean"){const j=A?"true":"false";return this.value===j?I.INSTANCE:g.INSTANCE}return this}evaluate(A){return A.getValue(this.key)!=this.value}serialize(){return`${this.key} != '${this.value}'`}keys(){return[this.key]}negate(){return this.negated||(this.negated=m.create(this.key,this.value,this)),this.negated}}class l{constructor(A,j){this.key=A,this.negated=j,this.type=3}static create(A,j=null){const P=U.get(A);return typeof P=="boolean"?P?I.INSTANCE:g.INSTANCE:new l(A,j)}cmp(A){return A.type!==this.type?this.type-A.type:v(this.key,A.key)}equals(A){return A.type===this.type?this.key===A.key:!1}substituteConstants(){const A=U.get(this.key);return typeof A=="boolean"?A?I.INSTANCE:g.INSTANCE:this}evaluate(A){return!A.getValue(this.key)}serialize(){return`!${this.key}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=f.create(this.key,this)),this.negated}}function u(A,j){if(typeof A=="string"){const P=parseFloat(A);isNaN(P)||(A=P)}return typeof A=="string"||typeof A=="number"?j(A):I.INSTANCE}class a{constructor(A,j,P){this.key=A,this.value=j,this.negated=P,this.type=12}static create(A,j,P=null){return u(j,b=>new a(A,b,P))}cmp(A){return A.type!==this.type?this.type-A.type:y(this.key,this.value,A.key,A.value)}equals(A){return A.type===this.type?this.key===A.key&&this.value===A.value:!1}substituteConstants(){return this}evaluate(A){return typeof this.value=="string"?!1:parseFloat(A.getValue(this.key))>this.value}serialize(){return`${this.key} > ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=_.create(this.key,this.value,this)),this.negated}}class s{constructor(A,j,P){this.key=A,this.value=j,this.negated=P,this.type=13}static create(A,j,P=null){return u(j,b=>new s(A,b,P))}cmp(A){return A.type!==this.type?this.type-A.type:y(this.key,this.value,A.key,A.value)}equals(A){return A.type===this.type?this.key===A.key&&this.value===A.value:!1}substituteConstants(){return this}evaluate(A){return typeof this.value=="string"?!1:parseFloat(A.getValue(this.key))>=this.value}serialize(){return`${this.key} >= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=C.create(this.key,this.value,this)),this.negated}}class C{constructor(A,j,P){this.key=A,this.value=j,this.negated=P,this.type=14}static create(A,j,P=null){return u(j,b=>new C(A,b,P))}cmp(A){return A.type!==this.type?this.type-A.type:y(this.key,this.value,A.key,A.value)}equals(A){return A.type===this.type?this.key===A.key&&this.value===A.value:!1}substituteConstants(){return this}evaluate(A){return typeof this.value=="string"?!1:parseFloat(A.getValue(this.key))<this.value}serialize(){return`${this.key} < ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=s.create(this.key,this.value,this)),this.negated}}class _{constructor(A,j,P){this.key=A,this.value=j,this.negated=P,this.type=15}static create(A,j,P=null){return u(j,b=>new _(A,b,P))}cmp(A){return A.type!==this.type?this.type-A.type:y(this.key,this.value,A.key,A.value)}equals(A){return A.type===this.type?this.key===A.key&&this.value===A.value:!1}substituteConstants(){return this}evaluate(A){return typeof this.value=="string"?!1:parseFloat(A.getValue(this.key))<=this.value}serialize(){return`${this.key} <= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=a.create(this.key,this.value,this)),this.negated}}class w{constructor(A,j){this.key=A,this.regexp=j,this.type=7,this.negated=null}static create(A,j){return new w(A,j)}cmp(A){if(A.type!==this.type)return this.type-A.type;if(this.key<A.key)return-1;if(this.key>A.key)return 1;const j=this.regexp?this.regexp.source:"",P=A.regexp?A.regexp.source:"";return j<P?-1:j>P?1:0}equals(A){if(A.type===this.type){const j=this.regexp?this.regexp.source:"",P=A.regexp?A.regexp.source:"";return this.key===A.key&&j===P}return!1}substituteConstants(){return this}evaluate(A){let j=A.getValue(this.key);return this.regexp?this.regexp.test(j):!1}serialize(){const A=this.regexp?`/${this.regexp.source}/${this.regexp.ignoreCase?"i":""}`:"/invalid/";return`${this.key} =~ ${A}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=O.create(this)),this.negated}}class O{constructor(A){this._actual=A,this.type=8}static create(A){return new O(A)}cmp(A){return A.type!==this.type?this.type-A.type:this._actual.cmp(A._actual)}equals(A){return A.type===this.type?this._actual.equals(A._actual):!1}substituteConstants(){return this}evaluate(A){return!this._actual.evaluate(A)}serialize(){throw new Error("Method not implemented.")}keys(){return this._actual.keys()}negate(){return this._actual}}function R(A){let j=null;for(let P=0,b=A.length;P<b;P++){const V=A[P].substituteConstants();if(A[P]!==V&&j===null){j=[];for(let re=0;re<P;re++)j[re]=A[re]}j!==null&&(j[P]=V)}return j===null?A:j}class S{constructor(A,j){this.expr=A,this.negated=j,this.type=6}static create(A,j){return S._normalizeArr(A,j)}cmp(A){if(A.type!==this.type)return this.type-A.type;if(this.expr.length<A.expr.length)return-1;if(this.expr.length>A.expr.length)return 1;for(let j=0,P=this.expr.length;j<P;j++){const b=n(this.expr[j],A.expr[j]);if(b!==0)return b}return 0}equals(A){if(A.type===this.type){if(this.expr.length!==A.expr.length)return!1;for(let j=0,P=this.expr.length;j<P;j++)if(!this.expr[j].equals(A.expr[j]))return!1;return!0}return!1}substituteConstants(){const A=R(this.expr);return A===this.expr?this:S.create(A,this.negated)}evaluate(A){for(let j=0,P=this.expr.length;j<P;j++)if(!this.expr[j].evaluate(A))return!1;return!0}static _normalizeArr(A,j){const P=[];let b=!1;for(const V of A){if(!V)continue;if(V.type===1){b=!0;continue}if(V.type===0)return I.INSTANCE;if(V.type===6){P.push(...V.expr);continue}P.push(V)}if(P.length===0&&b)return g.INSTANCE;if(P.length===0)return;if(P.length===1)return P[0];P.sort(n);for(let V=1;V<P.length;V++)P[V-1].equals(P[V])&&(P.splice(V,1),V--);if(P.length===1)return P[0];for(;P.length>1;){const V=P[P.length-1];if(V.type!==9)break;P.pop();const re=P.pop(),ce=P.length===0,me=T.create(V.expr.map(De=>S.create([De,re],null)),null,ce);me&&(P.push(me),P.sort(n))}return P.length===1?P[0]:new S(P,j)}serialize(){return this.expr.map(A=>A.serialize()).join(" && ")}keys(){const A=[];for(let j of this.expr)A.push(...j.keys());return A}negate(){if(!this.negated){const A=[];for(let j of this.expr)A.push(j.negate());this.negated=T.create(A,this,!0)}return this.negated}}class T{constructor(A,j){this.expr=A,this.negated=j,this.type=9}static create(A,j,P){return T._normalizeArr(A,j,P)}cmp(A){if(A.type!==this.type)return this.type-A.type;if(this.expr.length<A.expr.length)return-1;if(this.expr.length>A.expr.length)return 1;for(let j=0,P=this.expr.length;j<P;j++){const b=n(this.expr[j],A.expr[j]);if(b!==0)return b}return 0}equals(A){if(A.type===this.type){if(this.expr.length!==A.expr.length)return!1;for(let j=0,P=this.expr.length;j<P;j++)if(!this.expr[j].equals(A.expr[j]))return!1;return!0}return!1}substituteConstants(){const A=R(this.expr);return A===this.expr?this:T.create(A,this.negated,!1)}evaluate(A){for(let j=0,P=this.expr.length;j<P;j++)if(this.expr[j].evaluate(A))return!0;return!1}static _normalizeArr(A,j,P){let b=[],V=!1;if(A){for(let re=0,ce=A.length;re<ce;re++){const me=A[re];if(!me)continue;if(me.type===0){V=!0;continue}if(me.type===1)return g.INSTANCE;if(me.type===9){b=b.concat(me.expr);continue}b.push(me)}if(b.length===0&&V)return I.INSTANCE;b.sort(n)}if(b.length===0)return;if(b.length===1)return b[0];for(let re=1;re<b.length;re++)b[re-1].equals(b[re])&&(b.splice(re,1),re--);if(b.length===1)return b[0];if(P){for(let re=0;re<b.length;re++)for(let ce=re+1;ce<b.length;ce++)F(b[re],b[ce])&&(b.splice(ce,1),ce--);if(b.length===1)return b[0]}return new T(b,j)}serialize(){return this.expr.map(A=>A.serialize()).join(" || ")}keys(){const A=[];for(let j of this.expr)A.push(...j.keys());return A}negate(){if(!this.negated){let A=[];for(let j of this.expr)A.push(j.negate());for(;A.length>1;){const j=A.shift(),P=A.shift(),b=[];for(const re of B(j))for(const ce of B(P))b.push(S.create([re,ce],null));const V=A.length===0;A.unshift(T.create(b,null,V))}this.negated=A[0]}return this.negated}}class E extends f{constructor(A,j,P){super(A,null);this._defaultValue=j,typeof P=="object"?E._info.push(Object.assign(Object.assign({},P),{key:A})):P!==!0&&E._info.push({key:A,description:P,type:j!=null?typeof j:void 0})}static all(){return E._info.values()}bindTo(A){return A.createKey(this.key,this._defaultValue)}getValue(A){return A.getContextKeyValue(this.key)}toNegated(){return this.negate()}isEqualTo(A){return m.create(this.key,A)}}E._info=[];const c=Object(k.c)("contextKeyService"),x="setContext";function v(A,j){return A<j?-1:A>j?1:0}function y(A,j,P,b){return A<P?-1:A>P?1:j<b?-1:j>b?1:0}function F(A,j){if(j.type===6&&A.type!==9&&A.type!==6){for(const V of j.expr)if(A.equals(V))return!0}const P=A.negate(),b=B(P).concat(B(j));b.sort(n);for(let V=0;V<b.length;V++){const re=b[V],ce=re.negate();for(let me=V+1;me<b.length;me++){const De=b[me];if(ce.equals(De))return!0}}return!1}function B(A){return A.type===9?A.expr:[A]}},TXwP:function(tt,Ee,J){var oe,$;(function(){var k;(function(){"use strict";var U=[,,function(n){function I(m){this.__parent=m,this.__character_count=0,this.__indent_count=-1,this.__alignment_count=0,this.__wrap_point_index=0,this.__wrap_point_character_count=0,this.__wrap_point_indent_count=-1,this.__wrap_point_alignment_count=0,this.__items=[]}I.prototype.clone_empty=function(){var m=new I(this.__parent);return m.set_indent(this.__indent_count,this.__alignment_count),m},I.prototype.item=function(m){return m<0?this.__items[this.__items.length+m]:this.__items[m]},I.prototype.has_match=function(m){for(var h=this.__items.length-1;h>=0;h--)if(this.__items[h].match(m))return!0;return!1},I.prototype.set_indent=function(m,h){this.is_empty()&&(this.__indent_count=m||0,this.__alignment_count=h||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},I.prototype._set_wrap_point=function(){this.__parent.wrap_line_length&&(this.__wrap_point_index=this.__items.length,this.__wrap_point_character_count=this.__character_count,this.__wrap_point_indent_count=this.__parent.next_line.__indent_count,this.__wrap_point_alignment_count=this.__parent.next_line.__alignment_count)},I.prototype._should_wrap=function(){return this.__wrap_point_index&&this.__character_count>this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count},I.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var m=this.__parent.current_line;return m.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),m.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),m.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,m.__items[0]===" "&&(m.__items.splice(0,1),m.__character_count-=1),!0}return!1},I.prototype.is_empty=function(){return this.__items.length===0},I.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},I.prototype.push=function(m){this.__items.push(m);var h=m.lastIndexOf(`
`);h!==-1?this.__character_count=m.length-h:this.__character_count+=m.length},I.prototype.pop=function(){var m=null;return this.is_empty()||(m=this.__items.pop(),this.__character_count-=m.length),m},I.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},I.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},I.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},I.prototype.toString=function(){var m="";return this.is_empty()?this.__parent.indent_empty_lines&&(m=this.__parent.get_indent_string(this.__indent_count)):(m=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),m+=this.__items.join("")),m};function g(m,h){this.__cache=[""],this.__indent_size=m.indent_size,this.__indent_string=m.indent_char,m.indent_with_tabs||(this.__indent_string=new Array(m.indent_size+1).join(m.indent_char)),h=h||"",m.indent_level>0&&(h=new Array(m.indent_level+1).join(this.__indent_string)),this.__base_string=h,this.__base_string_length=h.length}g.prototype.get_indent_size=function(m,h){var o=this.__base_string_length;return h=h||0,m<0&&(o=0),o+=m*this.__indent_size,o+=h,o},g.prototype.get_indent_string=function(m,h){var o=this.__base_string;return h=h||0,m<0&&(m=0,o=""),h+=m*this.__indent_size,this.__ensure_cache(h),o+=this.__cache[h],o},g.prototype.__ensure_cache=function(m){for(;m>=this.__cache.length;)this.__add_column()},g.prototype.__add_column=function(){var m=this.__cache.length,h=0,o="";this.__indent_size&&m>=this.__indent_size&&(h=Math.floor(m/this.__indent_size),m-=h*this.__indent_size,o=new Array(h+1).join(this.__indent_string)),m&&(o+=new Array(m+1).join(" ")),this.__cache.push(o)};function f(m,h){this.__indent_cache=new g(m,h),this.raw=!1,this._end_with_newline=m.end_with_newline,this.indent_size=m.indent_size,this.wrap_line_length=m.wrap_line_length,this.indent_empty_lines=m.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new I(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}f.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},f.prototype.get_line_number=function(){return this.__lines.length},f.prototype.get_indent_string=function(m,h){return this.__indent_cache.get_indent_string(m,h)},f.prototype.get_indent_size=function(m,h){return this.__indent_cache.get_indent_size(m,h)},f.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},f.prototype.add_new_line=function(m){return this.is_empty()||!m&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},f.prototype.get_code=function(m){this.trim(!0);var h=this.current_line.pop();h&&(h[h.length-1]===`
`&&(h=h.replace(/\n+$/g,"")),this.current_line.push(h)),this._end_with_newline&&this.__add_outputline();var o=this.__lines.join(`
`);return m!==`
`&&(o=o.replace(/[\n]/g,m)),o},f.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},f.prototype.set_indent=function(m,h){return m=m||0,h=h||0,this.next_line.set_indent(m,h),this.__lines.length>1?(this.current_line.set_indent(m,h),!0):(this.current_line.set_indent(),!1)},f.prototype.add_raw_token=function(m){for(var h=0;h<m.newlines;h++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(m.whitespace_before),this.current_line.push(m.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},f.prototype.add_token=function(m){this.__add_space_before_token(),this.current_line.push(m),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},f.prototype.__add_space_before_token=function(){this.space_before_token&&!this.just_added_newline()&&(this.non_breaking_space||this.set_wrap_point(),this.current_line.push(" "))},f.prototype.remove_indent=function(m){for(var h=this.__lines.length;m<h;)this.__lines[m]._remove_indent(),m++;this.current_line._remove_wrap_indent()},f.prototype.trim=function(m){for(m=m===void 0?!1:m,this.current_line.trim();m&&this.__lines.length>1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},f.prototype.just_added_newline=function(){return this.current_line.is_empty()},f.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},f.prototype.ensure_empty_line_above=function(m,h){for(var o=this.__lines.length-2;o>=0;){var p=this.__lines[o];if(p.is_empty())break;if(p.item(0).indexOf(m)!==0&&p.item(-1)!==h){this.__lines.splice(o+1,0,new I(this)),this.previous_line=this.__lines[this.__lines.length-2];break}o--}},n.exports.Output=f},,,,function(n){function I(m,h){this.raw_options=g(m,h),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs",this.indent_char===" "),this.indent_with_tabs&&(this.indent_char=" ",this.indent_size===1&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","django","erb","handlebars","php","smarty"],["auto"])}I.prototype._get_array=function(m,h){var o=this.raw_options[m],p=h||[];return typeof o=="object"?o!==null&&typeof o.concat=="function"&&(p=o.concat()):typeof o=="string"&&(p=o.split(/[^a-zA-Z0-9_\/\-]+/)),p},I.prototype._get_boolean=function(m,h){var o=this.raw_options[m],p=o===void 0?!!h:!!o;return p},I.prototype._get_characters=function(m,h){var o=this.raw_options[m],p=h||"";return typeof o=="string"&&(p=o.replace(/\\r/,"\r").replace(/\\n/,`
`).replace(/\\t/," ")),p},I.prototype._get_number=function(m,h){var o=this.raw_options[m];h=parseInt(h,10),isNaN(h)&&(h=0);var p=parseInt(o,10);return isNaN(p)&&(p=h),p},I.prototype._get_selection=function(m,h,o){var p=this._get_selection_list(m,h,o);if(p.length!==1)throw new Error("Invalid Option Value: The option '"+m+`' can only be one of the following values:
`+h+`
You passed in: '`+this.raw_options[m]+"'");return p[0]},I.prototype._get_selection_list=function(m,h,o){if(!h||h.length===0)throw new Error("Selection list cannot be empty.");if(o=o||[h[0]],!this._is_valid_selection(o,h))throw new Error("Invalid Default Value!");var p=this._get_array(m,o);if(!this._is_valid_selection(p,h))throw new Error("Invalid Option Value: The option '"+m+`' can contain only the following values:
`+h+`
You passed in: '`+this.raw_options[m]+"'");return p},I.prototype._is_valid_selection=function(m,h){return m.length&&h.length&&!m.some(function(o){return h.indexOf(o)===-1})};function g(m,h){var o={};m=f(m);var p;for(p in m)p!==h&&(o[p]=m[p]);if(h&&m[h])for(p in m[h])o[p]=m[h][p];return o}function f(m){var h={},o;for(o in m){var p=o.replace(/-/g,"_");h[p]=m[o]}return h}n.exports.Options=I,n.exports.normalizeOpts=f,n.exports.mergeOpts=g},,function(n){var I=RegExp.prototype.hasOwnProperty("sticky");function g(f){this.__input=f||"",this.__input_length=this.__input.length,this.__position=0}g.prototype.restart=function(){this.__position=0},g.prototype.back=function(){this.__position>0&&(this.__position-=1)},g.prototype.hasNext=function(){return this.__position<this.__input_length},g.prototype.next=function(){var f=null;return this.hasNext()&&(f=this.__input.charAt(this.__position),this.__position+=1),f},g.prototype.peek=function(f){var m=null;return f=f||0,f+=this.__position,f>=0&&f<this.__input_length&&(m=this.__input.charAt(f)),m},g.prototype.__match=function(f,m){f.lastIndex=m;var h=f.exec(this.__input);return h&&!(I&&f.sticky)&&(h.index!==m&&(h=null)),h},g.prototype.test=function(f,m){return m=m||0,m+=this.__position,m>=0&&m<this.__input_length?!!this.__match(f,m):!1},g.prototype.testChar=function(f,m){var h=this.peek(m);return f.lastIndex=0,h!==null&&f.test(h)},g.prototype.match=function(f){var m=this.__match(f,this.__position);return m?this.__position+=m[0].length:m=null,m},g.prototype.read=function(f,m,h){var o="",p;return f&&(p=this.match(f),p&&(o+=p[0])),m&&(p||!f)&&(o+=this.readUntil(m,h)),o},g.prototype.readUntil=function(f,m){var h="",o=this.__position;f.lastIndex=this.__position;var p=f.exec(this.__input);return p?(o=p.index,m&&(o+=p[0].length)):o=this.__input_length,h=this.__input.substring(this.__position,o),this.__position=o,h},g.prototype.readUntilAfter=function(f){return this.readUntil(f,!0)},g.prototype.get_regexp=function(f,m){var h=null,o="g";return m&&I&&(o="y"),typeof f=="string"&&f!==""?h=new RegExp(f,o):f&&(h=new RegExp(f.source,o)),h},g.prototype.get_literal_regexp=function(f){return RegExp(f.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},g.prototype.peekUntilAfter=function(f){var m=this.__position,h=this.readUntilAfter(f);return this.__position=m,h},g.prototype.lookBack=function(f){var m=this.__position-1;return m>=f.length&&this.__input.substring(m-f.length,m).toLowerCase()===f},n.exports.InputScanner=g},,,,,function(n){function I(g,f){g=typeof g=="string"?g:g.source,f=typeof f=="string"?f:f.source,this.__directives_block_pattern=new RegExp(g+/ beautify( \w+[:]\w+)+ /.source+f,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(g+/\sbeautify\signore:end\s/.source+f,"g")}I.prototype.get_directives=function(g){if(!g.match(this.__directives_block_pattern))return null;var f={};this.__directive_pattern.lastIndex=0;for(var m=this.__directive_pattern.exec(g);m;)f[m[1]]=m[2],m=this.__directive_pattern.exec(g);return f},I.prototype.readIgnored=function(g){return g.readUntilAfter(this.__directives_end_ignore_pattern)},n.exports.Directives=I},,function(n,I,g){var f=g(16).Beautifier,m=g(17).Options;function h(o,p){var l=new f(o,p);return l.beautify()}n.exports=h,n.exports.defaultOptions=function(){return new m}},function(n,I,g){var f=g(17).Options,m=g(2).Output,h=g(8).InputScanner,o=g(13).Directives,p=new o(/\/\*/,/\*\//),l=/\r\n|[\r\n]/,u=/\r\n|[\r\n]/g,a=/\s/,s=/(?:\s|\n)+/g,C=/\/\*(?:[\s\S]*?)((?:\*\/)|$)/g,_=/\/\/(?:[^\n\r\u2028\u2029]*)/g;function w(O,R){this._source_text=O||"",this._options=new f(R),this._ch=null,this._input=null,this.NESTED_AT_RULE={"@page":!0,"@font-face":!0,"@keyframes":!0,"@media":!0,"@supports":!0,"@document":!0},this.CONDITIONAL_GROUP_RULE={"@media":!0,"@supports":!0,"@document":!0},this.NON_SEMICOLON_NEWLINE_PROPERTY=["grid-template-areas","grid-template"]}w.prototype.eatString=function(O){var R="";for(this._ch=this._input.next();this._ch;){if(R+=this._ch,this._ch==="\\")R+=this._input.next();else if(O.indexOf(this._ch)!==-1||this._ch===`
`)break;this._ch=this._input.next()}return R},w.prototype.eatWhitespace=function(O){for(var R=a.test(this._input.peek()),S=0;a.test(this._input.peek());)this._ch=this._input.next(),O&&this._ch===`
`&&((S===0||S<this._options.max_preserve_newlines)&&(S++,this._output.add_new_line(!0)));return R},w.prototype.foundNestedPseudoClass=function(){for(var O=0,R=1,S=this._input.peek(R);S;){if(S==="{")return!0;if(S==="(")O+=1;else if(S===")"){if(O===0)return!1;O-=1}else if(S===";"||S==="}")return!1;R++,S=this._input.peek(R)}return!1},w.prototype.print_string=function(O){this._output.set_indent(this._indentLevel),this._output.non_breaking_space=!0,this._output.add_token(O)},w.prototype.preserveSingleSpace=function(O){O&&(this._output.space_before_token=!0)},w.prototype.indent=function(){this._indentLevel++},w.prototype.outdent=function(){this._indentLevel>0&&this._indentLevel--},w.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var O=this._source_text,R=this._options.eol;R==="auto"&&(R=`
`,O&&l.test(O||"")&&(R=O.match(l)[0])),O=O.replace(u,`
`);var S=O.match(/^[\t ]*/)[0];this._output=new m(this._options,S),this._input=new h(O),this._indentLevel=0,this._nestedLevel=0,this._ch=null;for(var T=0,E=!1,c=!1,x=!1,v=!1,y=!1,F=!1,B=this._ch,A=!1,j,P,b;j=this._input.read(s),P=j!=="",b=B,this._ch=this._input.next(),this._ch==="\\"&&this._input.hasNext()&&(this._ch+=this._input.next()),B=this._ch,this._ch;)if(this._ch==="/"&&this._input.peek()==="*"){this._output.add_new_line(),this._input.back();var V=this._input.read(C),re=p.get_directives(V);re&&re.ignore==="start"&&(V+=p.readIgnored(this._input)),this.print_string(V),this.eatWhitespace(!0),this._output.add_new_line()}else if(this._ch==="/"&&this._input.peek()==="/")this._output.space_before_token=!0,this._input.back(),this.print_string(this._input.read(_)),this.eatWhitespace(!0);else if(this._ch==="@"||this._ch==="$")if(this.preserveSingleSpace(P),this._input.peek()==="{")this.print_string(this._ch+this.eatString("}"));else{this.print_string(this._ch);var ce=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);ce.match(/[ :]$/)&&(ce=this.eatString(": ").replace(/\s$/,""),this.print_string(ce),this._output.space_before_token=!0),ce=ce.replace(/\s$/,""),ce==="extend"?v=!0:ce==="import"&&(y=!0),ce in this.NESTED_AT_RULE?(this._nestedLevel+=1,ce in this.CONDITIONAL_GROUP_RULE&&(x=!0)):!E&&T===0&&ce.indexOf(":")!==-1&&(c=!0,this.indent())}else if(this._ch==="#"&&this._input.peek()==="{")this.preserveSingleSpace(P),this.print_string(this._ch+this.eatString("}"));else if(this._ch==="{")c&&(c=!1,this.outdent()),x?(x=!1,E=this._indentLevel>=this._nestedLevel):E=this._indentLevel>=this._nestedLevel-1,this._options.newline_between_rules&&E&&(this._output.previous_line&&this._output.previous_line.item(-1)!=="{"&&this._output.ensure_empty_line_above("/",",")),this._output.space_before_token=!0,this._options.brace_style==="expand"?(this._output.add_new_line(),this.print_string(this._ch),this.indent(),this._output.set_indent(this._indentLevel)):(b==="("?this._output.space_before_token=!1:b!==","&&this.indent(),this.print_string(this._ch)),this.eatWhitespace(!0),this._output.add_new_line();else if(this._ch==="}")this.outdent(),this._output.add_new_line(),b==="{"&&this._output.trim(!0),y=!1,v=!1,c&&(this.outdent(),c=!1),this.print_string(this._ch),E=!1,this._nestedLevel&&this._nestedLevel--,this.eatWhitespace(!0),this._output.add_new_line(),this._options.newline_between_rules&&!this._output.just_added_blankline()&&(this._input.peek()!=="}"&&this._output.add_new_line(!0)),this._input.peek()===")"&&(this._output.trim(!0),this._options.brace_style==="expand"&&this._output.add_new_line(!0));else if(this._ch===":"){for(var me=0;me<this.NON_SEMICOLON_NEWLINE_PROPERTY.length;me++)if(this._input.lookBack(this.NON_SEMICOLON_NEWLINE_PROPERTY[me])){A=!0;break}(E||x)&&!(this._input.lookBack("&")||this.foundNestedPseudoClass())&&!this._input.lookBack("(")&&!v&&T===0?(this.print_string(":"),c||(c=!0,this._output.space_before_token=!0,this.eatWhitespace(!0),this.indent())):(this._input.lookBack(" ")&&(this._output.space_before_token=!0),this._input.peek()===":"?(this._ch=this._input.next(),this.print_string("::")):this.print_string(":"))}else if(this._ch==='"'||this._ch==="'"){var De=b==='"'||b==="'";this.preserveSingleSpace(De||P),this.print_string(this._ch+this.eatString(this._ch)),this.eatWhitespace(!0)}else if(this._ch===";")A=!1,T===0?(c&&(this.outdent(),c=!1),v=!1,y=!1,this.print_string(this._ch),this.eatWhitespace(!0),this._input.peek()!=="/"&&this._output.add_new_line()):(this.print_string(this._ch),this.eatWhitespace(!0),this._output.space_before_token=!0);else if(this._ch==="(")if(this._input.lookBack("url"))this.print_string(this._ch),this.eatWhitespace(),T++,this.indent(),this._ch=this._input.next(),this._ch===")"||this._ch==='"'||this._ch==="'"?this._input.back():this._ch&&(this.print_string(this._ch+this.eatString(")")),T&&(T--,this.outdent()));else{var we=!1;this._input.lookBack("with")&&(we=!0),this.preserveSingleSpace(P||we),this.print_string(this._ch),c&&b==="$"&&this._options.selector_separator_newline?(this._output.add_new_line(),F=!0):(this.eatWhitespace(),T++,this.indent())}else if(this._ch===")")T&&(T--,this.outdent()),F&&this._input.peek()===";"&&this._options.selector_separator_newline&&(F=!1,this.outdent(),this._output.add_new_line()),this.print_string(this._ch);else if(this._ch===",")this.print_string(this._ch),this.eatWhitespace(!0),this._options.selector_separator_newline&&(!c||F)&&T===0&&!y&&!v?this._output.add_new_line():this._output.space_before_token=!0;else if((this._ch===">"||this._ch==="+"||this._ch==="~")&&!c&&T===0)this._options.space_around_combinator?(this._output.space_before_token=!0,this.print_string(this._ch),this._output.space_before_token=!0):(this.print_string(this._ch),this.eatWhitespace(),this._ch&&a.test(this._ch)&&(this._ch=""));else if(this._ch==="]")this.print_string(this._ch);else if(this._ch==="[")this.preserveSingleSpace(P),this.print_string(this._ch);else if(this._ch==="=")this.eatWhitespace(),this.print_string("="),a.test(this._ch)&&(this._ch="");else if(this._ch==="!"&&!this._input.lookBack("\\"))this._output.space_before_token=!0,this.print_string(this._ch);else{var Le=b==='"'||b==="'";this.preserveSingleSpace(Le||P),this.print_string(this._ch),!this._output.just_added_newline()&&this._input.peek()===`
`&&A&&this._output.add_new_line()}var Re=this._output.get_code(R);return Re},n.exports.Beautifier=w},function(n,I,g){var f=g(6).Options;function m(h){f.call(this,h,"css"),this.selector_separator_newline=this._get_boolean("selector_separator_newline",!0),this.newline_between_rules=this._get_boolean("newline_between_rules",!0);var o=this._get_boolean("space_around_selector_separator");this.space_around_combinator=this._get_boolean("space_around_combinator")||o;var p=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_style="collapse";for(var l=0;l<p.length;l++)p[l]!=="expand"?this.brace_style="collapse":this.brace_style=p[l]}m.prototype=new f,n.exports.Options=m}],L={};function W(n){var I=L[n];if(I!==void 0)return I.exports;var g=L[n]={exports:{}};return U[n](g,g.exports,W),g.exports}var H=W(15);k=H})();var z=k;!(oe=[],$=function(){return{css_beautify:z}}.apply(Ee,oe),$!==void 0&&(tt.exports=$))})()},UZu5:function(tt,Ee,J){},Vhoy:function(tt,Ee,J){"use strict";J.d(Ee,"d",function(){return z}),J.d(Ee,"e",function(){return U}),J.d(Ee,"c",function(){return L}),J.d(Ee,"b",function(){return W}),J.d(Ee,"a",function(){return H});var oe=J("MI8n");class ${constructor(){this._icons=new Map,this._onDidRegister=new oe.b}add(n){const I=this._icons.get(n.id);I?n.description?I.description=n.description:console.error(`Duplicate registration of codicon ${n.id}`):(this._icons.set(n.id,n),this._onDidRegister.fire(n))}get(n){return this._icons.get(n)}get all(){return this._icons.values()}get onDidRegister(){return this._onDidRegister.event}}const k=new $,z=k;function U(n,I){return new W(n,I)}function L(n){return n?n.replace(/\$\((.*?)\)/g,(I,g)=>` ${g} `).trim():""}class W{constructor(n,I,g){this.id=n,this.definition=I,this.description=g,k.add(this)}get classNames(){return"codicon codicon-"+this.id}get classNamesArray(){return["codicon","codicon-"+this.id]}get cssSelector(){return".codicon.codicon-"+this.id}}var H;(function(n){n.iconNameSegment="[A-Za-z0-9]+",n.iconNameExpression="[A-Za-z0-9\\-]+",n.iconModifierExpression="~[A-Za-z]+";const I=new RegExp(`^(${n.iconNameExpression})(${n.iconModifierExpression})?$`);function g(h){if(h instanceof W)return["codicon","codicon-"+h.id];const o=I.exec(h.id);if(!o)return g(W.error);let[,p,l]=o;const u=["codicon","codicon-"+p];return l&&u.push("codicon-modifier-"+l.substr(1)),u}n.asClassNameArray=g;function f(h){return g(h).join(" ")}n.asClassName=f;function m(h){return"."+g(h).join(".")}n.asCSSSelector=m})(H||(H={})),function(n){n.add=new n("add",{fontCharacter:"\\ea60"}),n.plus=new n("plus",n.add.definition),n.gistNew=new n("gist-new",n.add.definition),n.repoCreate=new n("repo-create",n.add.definition),n.lightbulb=new n("lightbulb",{fontCharacter:"\\ea61"}),n.lightBulb=new n("light-bulb",{fontCharacter:"\\ea61"}),n.repo=new n("repo",{fontCharacter:"\\ea62"}),n.repoDelete=new n("repo-delete",{fontCharacter:"\\ea62"}),n.gistFork=new n("gist-fork",{fontCharacter:"\\ea63"}),n.repoForked=new n("repo-forked",{fontCharacter:"\\ea63"}),n.gitPullRequest=new n("git-pull-request",{fontCharacter:"\\ea64"}),n.gitPullRequestAbandoned=new n("git-pull-request-abandoned",{fontCharacter:"\\ea64"}),n.recordKeys=new n("record-keys",{fontCharacter:"\\ea65"}),n.keyboard=new n("keyboard",{fontCharacter:"\\ea65"}),n.tag=new n("tag",{fontCharacter:"\\ea66"}),n.tagAdd=new n("tag-add",{fontCharacter:"\\ea66"}),n.tagRemove=new n("tag-remove",{fontCharacter:"\\ea66"}),n.person=new n("person",{fontCharacter:"\\ea67"}),n.personFollow=new n("person-follow",{fontCharacter:"\\ea67"}),n.personOutline=new n("person-outline",{fontCharacter:"\\ea67"}),n.personFilled=new n("person-filled",{fontCharacter:"\\ea67"}),n.gitBranch=new n("git-branch",{fontCharacter:"\\ea68"}),n.gitBranchCreate=new n("git-branch-create",{fontCharacter:"\\ea68"}),n.gitBranchDelete=new n("git-branch-delete",{fontCharacter:"\\ea68"}),n.sourceControl=new n("source-control",{fontCharacter:"\\ea68"}),n.mirror=new n("mirror",{fontCharacter:"\\ea69"}),n.mirrorPublic=new n("mirror-public",{fontCharacter:"\\ea69"}),n.star=new n("star",{fontCharacter:"\\ea6a"}),n.starAdd=new n("star-add",{fontCharacter:"\\ea6a"}),n.starDelete=new n("star-delete",{fontCharacter:"\\ea6a"}),n.starEmpty=new n("star-empty",{fontCharacter:"\\ea6a"}),n.comment=new n("comment",{fontCharacter:"\\ea6b"}),n.commentAdd=new n("comment-add",{fontCharacter:"\\ea6b"}),n.alert=new n("alert",{fontCharacter:"\\ea6c"}),n.warning=new n("warning",{fontCharacter:"\\ea6c"}),n.search=new n("search",{fontCharacter:"\\ea6d"}),n.searchSave=new n("search-save",{fontCharacter:"\\ea6d"}),n.logOut=new n("log-out",{fontCharacter:"\\ea6e"}),n.signOut=new n("sign-out",{fontCharacter:"\\ea6e"}),n.logIn=new n("log-in",{fontCharacter:"\\ea6f"}),n.signIn=new n("sign-in",{fontCharacter:"\\ea6f"}),n.eye=new n("eye",{fontCharacter:"\\ea70"}),n.eyeUnwatch=new n("eye-unwatch",{fontCharacter:"\\ea70"}),n.eyeWatch=new n("eye-watch",{fontCharacter:"\\ea70"}),n.circleFilled=new n("circle-filled",{fontCharacter:"\\ea71"}),n.primitiveDot=new n("primitive-dot",{fontCharacter:"\\ea71"}),n.closeDirty=new n("close-dirty",{fontCharacter:"\\ea71"}),n.debugBreakpoint=new n("debug-breakpoint",{fontCharacter:"\\ea71"}),n.debugBreakpointDisabled=new n("debug-breakpoint-disabled",{fontCharacter:"\\ea71"}),n.debugHint=new n("debug-hint",{fontCharacter:"\\ea71"}),n.primitiveSquare=new n("primitive-square",{fontCharacter:"\\ea72"}),n.edit=new n("edit",{fontCharacter:"\\ea73"}),n.pencil=new n("pencil",{fontCharacter:"\\ea73"}),n.info=new n("info",{fontCharacter:"\\ea74"}),n.issueOpened=new n("issue-opened",{fontCharacter:"\\ea74"}),n.gistPrivate=new n("gist-private",{fontCharacter:"\\ea75"}),n.gitForkPrivate=new n("git-fork-private",{fontCharacter:"\\ea75"}),n.lock=new n("lock",{fontCharacter:"\\ea75"}),n.mirrorPrivate=new n("mirror-private",{fontCharacter:"\\ea75"}),n.close=new n("close",{fontCharacter:"\\ea76"}),n.removeClose=new n("remove-close",{fontCharacter:"\\ea76"}),n.x=new n("x",{fontCharacter:"\\ea76"}),n.repoSync=new n("repo-sync",{fontCharacter:"\\ea77"}),n.sync=new n("sync",{fontCharacter:"\\ea77"}),n.clone=new n("clone",{fontCharacter:"\\ea78"}),n.desktopDownload=new n("desktop-download",{fontCharacter:"\\ea78"}),n.beaker=new n("beaker",{fontCharacter:"\\ea79"}),n.microscope=new n("microscope",{fontCharacter:"\\ea79"}),n.vm=new n("vm",{fontCharacter:"\\ea7a"}),n.deviceDesktop=new n("device-desktop",{fontCharacter:"\\ea7a"}),n.file=new n("file",{fontCharacter:"\\ea7b"}),n.fileText=new n("file-text",{fontCharacter:"\\ea7b"}),n.more=new n("more",{fontCharacter:"\\ea7c"}),n.ellipsis=new n("ellipsis",{fontCharacter:"\\ea7c"}),n.kebabHorizontal=new n("kebab-horizontal",{fontCharacter:"\\ea7c"}),n.mailReply=new n("mail-reply",{fontCharacter:"\\ea7d"}),n.reply=new n("reply",{fontCharacter:"\\ea7d"}),n.organization=new n("organization",{fontCharacter:"\\ea7e"}),n.organizationFilled=new n("organization-filled",{fontCharacter:"\\ea7e"}),n.organizationOutline=new n("organization-outline",{fontCharacter:"\\ea7e"}),n.newFile=new n("new-file",{fontCharacter:"\\ea7f"}),n.fileAdd=new n("file-add",{fontCharacter:"\\ea7f"}),n.newFolder=new n("new-folder",{fontCharacter:"\\ea80"}),n.fileDirectoryCreate=new n("file-directory-create",{fontCharacter:"\\ea80"}),n.trash=new n("trash",{fontCharacter:"\\ea81"}),n.trashcan=new n("trashcan",{fontCharacter:"\\ea81"}),n.history=new n("history",{fontCharacter:"\\ea82"}),n.clock=new n("clock",{fontCharacter:"\\ea82"}),n.folder=new n("folder",{fontCharacter:"\\ea83"}),n.fileDirectory=new n("file-directory",{fontCharacter:"\\ea83"}),n.symbolFolder=new n("symbol-folder",{fontCharacter:"\\ea83"}),n.logoGithub=new n("logo-github",{fontCharacter:"\\ea84"}),n.markGithub=new n("mark-github",{fontCharacter:"\\ea84"}),n.github=new n("github",{fontCharacter:"\\ea84"}),n.terminal=new n("terminal",{fontCharacter:"\\ea85"}),n.console=new n("console",{fontCharacter:"\\ea85"}),n.repl=new n("repl",{fontCharacter:"\\ea85"}),n.zap=new n("zap",{fontCharacter:"\\ea86"}),n.symbolEvent=new n("symbol-event",{fontCharacter:"\\ea86"}),n.error=new n("error",{fontCharacter:"\\ea87"}),n.stop=new n("stop",{fontCharacter:"\\ea87"}),n.variable=new n("variable",{fontCharacter:"\\ea88"}),n.symbolVariable=new n("symbol-variable",{fontCharacter:"\\ea88"}),n.array=new n("array",{fontCharacter:"\\ea8a"}),n.symbolArray=new n("symbol-array",{fontCharacter:"\\ea8a"}),n.symbolModule=new n("symbol-module",{fontCharacter:"\\ea8b"}),n.symbolPackage=new n("symbol-package",{fontCharacter:"\\ea8b"}),n.symbolNamespace=new n("symbol-namespace",{fontCharacter:"\\ea8b"}),n.symbolObject=new n("symbol-object",{fontCharacter:"\\ea8b"}),n.symbolMethod=new n("symbol-method",{fontCharacter:"\\ea8c"}),n.symbolFunction=new n("symbol-function",{fontCharacter:"\\ea8c"}),n.symbolConstructor=new n("symbol-constructor",{fontCharacter:"\\ea8c"}),n.symbolBoolean=new n("symbol-boolean",{fontCharacter:"\\ea8f"}),n.symbolNull=new n("symbol-null",{fontCharacter:"\\ea8f"}),n.symbolNumeric=new n("symbol-numeric",{fontCharacter:"\\ea90"}),n.symbolNumber=new n("symbol-number",{fontCharacter:"\\ea90"}),n.symbolStructure=new n("symbol-structure",{fontCharacter:"\\ea91"}),n.symbolStruct=new n("symbol-struct",{fontCharacter:"\\ea91"}),n.symbolParameter=new n("symbol-parameter",{fontCharacter:"\\ea92"}),n.symbolTypeParameter=new n("symbol-type-parameter",{fontCharacter:"\\ea92"}),n.symbolKey=new n("symbol-key",{fontCharacter:"\\ea93"}),n.symbolText=new n("symbol-text",{fontCharacter:"\\ea93"}),n.symbolReference=new n("symbol-reference",{fontCharacter:"\\ea94"}),n.goToFile=new n("go-to-file",{fontCharacter:"\\ea94"}),n.symbolEnum=new n("symbol-enum",{fontCharacter:"\\ea95"}),n.symbolValue=new n("symbol-value",{fontCharacter:"\\ea95"}),n.symbolRuler=new n("symbol-ruler",{fontCharacter:"\\ea96"}),n.symbolUnit=new n("symbol-unit",{fontCharacter:"\\ea96"}),n.activateBreakpoints=new n("activate-breakpoints",{fontCharacter:"\\ea97"}),n.archive=new n("archive",{fontCharacter:"\\ea98"}),n.arrowBoth=new n("arrow-both",{fontCharacter:"\\ea99"}),n.arrowDown=new n("arrow-down",{fontCharacter:"\\ea9a"}),n.arrowLeft=new n("arrow-left",{fontCharacter:"\\ea9b"}),n.arrowRight=new n("arrow-right",{fontCharacter:"\\ea9c"}),n.arrowSmallDown=new n("arrow-small-down",{fontCharacter:"\\ea9d"}),n.arrowSmallLeft=new n("arrow-small-left",{fontCharacter:"\\ea9e"}),n.arrowSmallRight=new n("arrow-small-right",{fontCharacter:"\\ea9f"}),n.arrowSmallUp=new n("arrow-small-up",{fontCharacter:"\\eaa0"}),n.arrowUp=new n("arrow-up",{fontCharacter:"\\eaa1"}),n.bell=new n("bell",{fontCharacter:"\\eaa2"}),n.bold=new n("bold",{fontCharacter:"\\eaa3"}),n.book=new n("book",{fontCharacter:"\\eaa4"}),n.bookmark=new n("bookmark",{fontCharacter:"\\eaa5"}),n.debugBreakpointConditionalUnverified=new n("debug-breakpoint-conditional-unverified",{fontCharacter:"\\eaa6"}),n.debugBreakpointConditional=new n("debug-breakpoint-conditional",{fontCharacter:"\\eaa7"}),n.debugBreakpointConditionalDisabled=new n("debug-breakpoint-conditional-disabled",{fontCharacter:"\\eaa7"}),n.debugBreakpointDataUnverified=new n("debug-breakpoint-data-unverified",{fontCharacter:"\\eaa8"}),n.debugBreakpointData=new n("debug-breakpoint-data",{fontCharacter:"\\eaa9"}),n.debugBreakpointDataDisabled=new n("debug-breakpoint-data-disabled",{fontCharacter:"\\eaa9"}),n.debugBreakpointLogUnverified=new n("debug-breakpoint-log-unverified",{fontCharacter:"\\eaaa"}),n.debugBreakpointLog=new n("debug-breakpoint-log",{fontCharacter:"\\eaab"}),n.debugBreakpointLogDisabled=new n("debug-breakpoint-log-disabled",{fontCharacter:"\\eaab"}),n.briefcase=new n("briefcase",{fontCharacter:"\\eaac"}),n.broadcast=new n("broadcast",{fontCharacter:"\\eaad"}),n.browser=new n("browser",{fontCharacter:"\\eaae"}),n.bug=new n("bug",{fontCharacter:"\\eaaf"}),n.calendar=new n("calendar",{fontCharacter:"\\eab0"}),n.caseSensitive=new n("case-sensitive",{fontCharacter:"\\eab1"}),n.check=new n("check",{fontCharacter:"\\eab2"}),n.checklist=new n("checklist",{fontCharacter:"\\eab3"}),n.chevronDown=new n("chevron-down",{fontCharacter:"\\eab4"}),n.dropDownButton=new n("drop-down-button",n.chevronDown.definition),n.chevronLeft=new n("chevron-left",{fontCharacter:"\\eab5"}),n.chevronRight=new n("chevron-right",{fontCharacter:"\\eab6"}),n.chevronUp=new n("chevron-up",{fontCharacter:"\\eab7"}),n.chromeClose=new n("chrome-close",{fontCharacter:"\\eab8"}),n.chromeMaximize=new n("chrome-maximize",{fontCharacter:"\\eab9"}),n.chromeMinimize=new n("chrome-minimize",{fontCharacter:"\\eaba"}),n.chromeRestore=new n("chrome-restore",{fontCharacter:"\\eabb"}),n.circleOutline=new n("circle-outline",{fontCharacter:"\\eabc"}),n.debugBreakpointUnverified=new n("debug-breakpoint-unverified",{fontCharacter:"\\eabc"}),n.circleSlash=new n("circle-slash",{fontCharacter:"\\eabd"}),n.circuitBoard=new n("circuit-board",{fontCharacter:"\\eabe"}),n.clearAll=new n("clear-all",{fontCharacter:"\\eabf"}),n.clippy=new n("clippy",{fontCharacter:"\\eac0"}),n.closeAll=new n("close-all",{fontCharacter:"\\eac1"}),n.cloudDownload=new n("cloud-download",{fontCharacter:"\\eac2"}),n.cloudUpload=new n("cloud-upload",{fontCharacter:"\\eac3"}),n.code=new n("code",{fontCharacter:"\\eac4"}),n.collapseAll=new n("collapse-all",{fontCharacter:"\\eac5"}),n.colorMode=new n("color-mode",{fontCharacter:"\\eac6"}),n.commentDiscussion=new n("comment-discussion",{fontCharacter:"\\eac7"}),n.compareChanges=new n("compare-changes",{fontCharacter:"\\eafd"}),n.creditCard=new n("credit-card",{fontCharacter:"\\eac9"}),n.dash=new n("dash",{fontCharacter:"\\eacc"}),n.dashboard=new n("dashboard",{fontCharacter:"\\eacd"}),n.database=new n("database",{fontCharacter:"\\eace"}),n.debugContinue=new n("debug-continue",{fontCharacter:"\\eacf"}),n.debugDisconnect=new n("debug-disconnect",{fontCharacter:"\\ead0"}),n.debugPause=new n("debug-pause",{fontCharacter:"\\ead1"}),n.debugRestart=new n("debug-restart",{fontCharacter:"\\ead2"}),n.debugStart=new n("debug-start",{fontCharacter:"\\ead3"}),n.debugStepInto=new n("debug-step-into",{fontCharacter:"\\ead4"}),n.debugStepOut=new n("debug-step-out",{fontCharacter:"\\ead5"}),n.debugStepOver=new n("debug-step-over",{fontCharacter:"\\ead6"}),n.debugStop=new n("debug-stop",{fontCharacter:"\\ead7"}),n.debug=new n("debug",{fontCharacter:"\\ead8"}),n.deviceCameraVideo=new n("device-camera-video",{fontCharacter:"\\ead9"}),n.deviceCamera=new n("device-camera",{fontCharacter:"\\eada"}),n.deviceMobile=new n("device-mobile",{fontCharacter:"\\eadb"}),n.diffAdded=new n("diff-added",{fontCharacter:"\\eadc"}),n.diffIgnored=new n("diff-ignored",{fontCharacter:"\\eadd"}),n.diffModified=new n("diff-modified",{fontCharacter:"\\eade"}),n.diffRemoved=new n("diff-removed",{fontCharacter:"\\eadf"}),n.diffRenamed=new n("diff-renamed",{fontCharacter:"\\eae0"}),n.diff=new n("diff",{fontCharacter:"\\eae1"}),n.discard=new n("discard",{fontCharacter:"\\eae2"}),n.editorLayout=new n("editor-layout",{fontCharacter:"\\eae3"}),n.emptyWindow=new n("empty-window",{fontCharacter:"\\eae4"}),n.exclude=new n("exclude",{fontCharacter:"\\eae5"}),n.extensions=new n("extensions",{fontCharacter:"\\eae6"}),n.eyeClosed=new n("eye-closed",{fontCharacter:"\\eae7"}),n.fileBinary=new n("file-binary",{fontCharacter:"\\eae8"}),n.fileCode=new n("file-code",{fontCharacter:"\\eae9"}),n.fileMedia=new n("file-media",{fontCharacter:"\\eaea"}),n.filePdf=new n("file-pdf",{fontCharacter:"\\eaeb"}),n.fileSubmodule=new n("file-submodule",{fontCharacter:"\\eaec"}),n.fileSymlinkDirectory=new n("file-symlink-directory",{fontCharacter:"\\eaed"}),n.fileSymlinkFile=new n("file-symlink-file",{fontCharacter:"\\eaee"}),n.fileZip=new n("file-zip",{fontCharacter:"\\eaef"}),n.files=new n("files",{fontCharacter:"\\eaf0"}),n.filter=new n("filter",{fontCharacter:"\\eaf1"}),n.flame=new n("flame",{fontCharacter:"\\eaf2"}),n.foldDown=new n("fold-down",{fontCharacter:"\\eaf3"}),n.foldUp=new n("fold-up",{fontCharacter:"\\eaf4"}),n.fold=new n("fold",{fontCharacter:"\\eaf5"}),n.folderActive=new n("folder-active",{fontCharacter:"\\eaf6"}),n.folderOpened=new n("folder-opened",{fontCharacter:"\\eaf7"}),n.gear=new n("gear",{fontCharacter:"\\eaf8"}),n.gift=new n("gift",{fontCharacter:"\\eaf9"}),n.gistSecret=new n("gist-secret",{fontCharacter:"\\eafa"}),n.gist=new n("gist",{fontCharacter:"\\eafb"}),n.gitCommit=new n("git-commit",{fontCharacter:"\\eafc"}),n.gitCompare=new n("git-compare",{fontCharacter:"\\eafd"}),n.gitMerge=new n("git-merge",{fontCharacter:"\\eafe"}),n.githubAction=new n("github-action",{fontCharacter:"\\eaff"}),n.githubAlt=new n("github-alt",{fontCharacter:"\\eb00"}),n.globe=new n("globe",{fontCharacter:"\\eb01"}),n.grabber=new n("grabber",{fontCharacter:"\\eb02"}),n.graph=new n("graph",{fontCharacter:"\\eb03"}),n.gripper=new n("gripper",{fontCharacter:"\\eb04"}),n.heart=new n("heart",{fontCharacter:"\\eb05"}),n.home=new n("home",{fontCharacter:"\\eb06"}),n.horizontalRule=new n("horizontal-rule",{fontCharacter:"\\eb07"}),n.hubot=new n("hubot",{fontCharacter:"\\eb08"}),n.inbox=new n("inbox",{fontCharacter:"\\eb09"}),n.issueClosed=new n("issue-closed",{fontCharacter:"\\eba4"}),n.issueReopened=new n("issue-reopened",{fontCharacter:"\\eb0b"}),n.issues=new n("issues",{fontCharacter:"\\eb0c"}),n.italic=new n("italic",{fontCharacter:"\\eb0d"}),n.jersey=new n("jersey",{fontCharacter:"\\eb0e"}),n.json=new n("json",{fontCharacter:"\\eb0f"}),n.kebabVertical=new n("kebab-vertical",{fontCharacter:"\\eb10"}),n.key=new n("key",{fontCharacter:"\\eb11"}),n.law=new n("law",{fontCharacter:"\\eb12"}),n.lightbulbAutofix=new n("lightbulb-autofix",{fontCharacter:"\\eb13"}),n.linkExternal=new n("link-external",{fontCharacter:"\\eb14"}),n.link=new n("link",{fontCharacter:"\\eb15"}),n.listOrdered=new n("list-ordered",{fontCharacter:"\\eb16"}),n.listUnordered=new n("list-unordered",{fontCharacter:"\\eb17"}),n.liveShare=new n("live-share",{fontCharacter:"\\eb18"}),n.loading=new n("loading",{fontCharacter:"\\eb19"}),n.location=new n("location",{fontCharacter:"\\eb1a"}),n.mailRead=new n("mail-read",{fontCharacter:"\\eb1b"}),n.mail=new n("mail",{fontCharacter:"\\eb1c"}),n.markdown=new n("markdown",{fontCharacter:"\\eb1d"}),n.megaphone=new n("megaphone",{fontCharacter:"\\eb1e"}),n.mention=new n("mention",{fontCharacter:"\\eb1f"}),n.milestone=new n("milestone",{fontCharacter:"\\eb20"}),n.mortarBoard=new n("mortar-board",{fontCharacter:"\\eb21"}),n.move=new n("move",{fontCharacter:"\\eb22"}),n.multipleWindows=new n("multiple-windows",{fontCharacter:"\\eb23"}),n.mute=new n("mute",{fontCharacter:"\\eb24"}),n.noNewline=new n("no-newline",{fontCharacter:"\\eb25"}),n.note=new n("note",{fontCharacter:"\\eb26"}),n.octoface=new n("octoface",{fontCharacter:"\\eb27"}),n.openPreview=new n("open-preview",{fontCharacter:"\\eb28"}),n.package_=new n("package",{fontCharacter:"\\eb29"}),n.paintcan=new n("paintcan",{fontCharacter:"\\eb2a"}),n.pin=new n("pin",{fontCharacter:"\\eb2b"}),n.play=new n("play",{fontCharacter:"\\eb2c"}),n.run=new n("run",{fontCharacter:"\\eb2c"}),n.plug=new n("plug",{fontCharacter:"\\eb2d"}),n.preserveCase=new n("preserve-case",{fontCharacter:"\\eb2e"}),n.preview=new n("preview",{fontCharacter:"\\eb2f"}),n.project=new n("project",{fontCharacter:"\\eb30"}),n.pulse=new n("pulse",{fontCharacter:"\\eb31"}),n.question=new n("question",{fontCharacter:"\\eb32"}),n.quote=new n("quote",{fontCharacter:"\\eb33"}),n.radioTower=new n("radio-tower",{fontCharacter:"\\eb34"}),n.reactions=new n("reactions",{fontCharacter:"\\eb35"}),n.references=new n("references",{fontCharacter:"\\eb36"}),n.refresh=new n("refresh",{fontCharacter:"\\eb37"}),n.regex=new n("regex",{fontCharacter:"\\eb38"}),n.remoteExplorer=new n("remote-explorer",{fontCharacter:"\\eb39"}),n.remote=new n("remote",{fontCharacter:"\\eb3a"}),n.remove=new n("remove",{fontCharacter:"\\eb3b"}),n.replaceAll=new n("replace-all",{fontCharacter:"\\eb3c"}),n.replace=new n("replace",{fontCharacter:"\\eb3d"}),n.repoClone=new n("repo-clone",{fontCharacter:"\\eb3e"}),n.repoForcePush=new n("repo-force-push",{fontCharacter:"\\eb3f"}),n.repoPull=new n("repo-pull",{fontCharacter:"\\eb40"}),n.repoPush=new n("repo-push",{fontCharacter:"\\eb41"}),n.report=new n("report",{fontCharacter:"\\eb42"}),n.requestChanges=new n("request-changes",{fontCharacter:"\\eb43"}),n.rocket=new n("rocket",{fontCharacter:"\\eb44"}),n.rootFolderOpened=new n("root-folder-opened",{fontCharacter:"\\eb45"}),n.rootFolder=new n("root-folder",{fontCharacter:"\\eb46"}),n.rss=new n("rss",{fontCharacter:"\\eb47"}),n.ruby=new n("ruby",{fontCharacter:"\\eb48"}),n.saveAll=new n("save-all",{fontCharacter:"\\eb49"}),n.saveAs=new n("save-as",{fontCharacter:"\\eb4a"}),n.save=new n("save",{fontCharacter:"\\eb4b"}),n.screenFull=new n("screen-full",{fontCharacter:"\\eb4c"}),n.screenNormal=new n("screen-normal",{fontCharacter:"\\eb4d"}),n.searchStop=new n("search-stop",{fontCharacter:"\\eb4e"}),n.server=new n("server",{fontCharacter:"\\eb50"}),n.settingsGear=new n("settings-gear",{fontCharacter:"\\eb51"}),n.settings=new n("settings",{fontCharacter:"\\eb52"}),n.shield=new n("shield",{fontCharacter:"\\eb53"}),n.smiley=new n("smiley",{fontCharacter:"\\eb54"}),n.sortPrecedence=new n("sort-precedence",{fontCharacter:"\\eb55"}),n.splitHorizontal=new n("split-horizontal",{fontCharacter:"\\eb56"}),n.splitVertical=new n("split-vertical",{fontCharacter:"\\eb57"}),n.squirrel=new n("squirrel",{fontCharacter:"\\eb58"}),n.starFull=new n("star-full",{fontCharacter:"\\eb59"}),n.starHalf=new n("star-half",{fontCharacter:"\\eb5a"}),n.symbolClass=new n("symbol-class",{fontCharacter:"\\eb5b"}),n.symbolColor=new n("symbol-color",{fontCharacter:"\\eb5c"}),n.symbolConstant=new n("symbol-constant",{fontCharacter:"\\eb5d"}),n.symbolEnumMember=new n("symbol-enum-member",{fontCharacter:"\\eb5e"}),n.symbolField=new n("symbol-field",{fontCharacter:"\\eb5f"}),n.symbolFile=new n("symbol-file",{fontCharacter:"\\eb60"}),n.symbolInterface=new n("symbol-interface",{fontCharacter:"\\eb61"}),n.symbolKeyword=new n("symbol-keyword",{fontCharacter:"\\eb62"}),n.symbolMisc=new n("symbol-misc",{fontCharacter:"\\eb63"}),n.symbolOperator=new n("symbol-operator",{fontCharacter:"\\eb64"}),n.symbolProperty=new n("symbol-property",{fontCharacter:"\\eb65"}),n.wrench=new n("wrench",{fontCharacter:"\\eb65"}),n.wrenchSubaction=new n("wrench-subaction",{fontCharacter:"\\eb65"}),n.symbolSnippet=new n("symbol-snippet",{fontCharacter:"\\eb66"}),n.tasklist=new n("tasklist",{fontCharacter:"\\eb67"}),n.telescope=new n("telescope",{fontCharacter:"\\eb68"}),n.textSize=new n("text-size",{fontCharacter:"\\eb69"}),n.threeBars=new n("three-bars",{fontCharacter:"\\eb6a"}),n.thumbsdown=new n("thumbsdown",{fontCharacter:"\\eb6b"}),n.thumbsup=new n("thumbsup",{fontCharacter:"\\eb6c"}),n.tools=new n("tools",{fontCharacter:"\\eb6d"}),n.triangleDown=new n("triangle-down",{fontCharacter:"\\eb6e"}),n.triangleLeft=new n("triangle-left",{fontCharacter:"\\eb6f"}),n.triangleRight=new n("triangle-right",{fontCharacter:"\\eb70"}),n.triangleUp=new n("triangle-up",{fontCharacter:"\\eb71"}),n.twitter=new n("twitter",{fontCharacter:"\\eb72"}),n.unfold=new n("unfold",{fontCharacter:"\\eb73"}),n.unlock=new n("unlock",{fontCharacter:"\\eb74"}),n.unmute=new n("unmute",{fontCharacter:"\\eb75"}),n.unverified=new n("unverified",{fontCharacter:"\\eb76"}),n.verified=new n("verified",{fontCharacter:"\\eb77"}),n.versions=new n("versions",{fontCharacter:"\\eb78"}),n.vmActive=new n("vm-active",{fontCharacter:"\\eb79"}),n.vmOutline=new n("vm-outline",{fontCharacter:"\\eb7a"}),n.vmRunning=new n("vm-running",{fontCharacter:"\\eb7b"}),n.watch=new n("watch",{fontCharacter:"\\eb7c"}),n.whitespace=new n("whitespace",{fontCharacter:"\\eb7d"}),n.wholeWord=new n("whole-word",{fontCharacter:"\\eb7e"}),n.window=new n("window",{fontCharacter:"\\eb7f"}),n.wordWrap=new n("word-wrap",{fontCharacter:"\\eb80"}),n.zoomIn=new n("zoom-in",{fontCharacter:"\\eb81"}),n.zoomOut=new n("zoom-out",{fontCharacter:"\\eb82"}),n.listFilter=new n("list-filter",{fontCharacter:"\\eb83"}),n.listFlat=new n("list-flat",{fontCharacter:"\\eb84"}),n.listSelection=new n("list-selection",{fontCharacter:"\\eb85"}),n.selection=new n("selection",{fontCharacter:"\\eb85"}),n.listTree=new n("list-tree",{fontCharacter:"\\eb86"}),n.debugBreakpointFunctionUnverified=new n("debug-breakpoint-function-unverified",{fontCharacter:"\\eb87"}),n.debugBreakpointFunction=new n("debug-breakpoint-function",{fontCharacter:"\\eb88"}),n.debugBreakpointFunctionDisabled=new n("debug-breakpoint-function-disabled",{fontCharacter:"\\eb88"}),n.debugStackframeActive=new n("debug-stackframe-active",{fontCharacter:"\\eb89"}),n.debugStackframeDot=new n("debug-stackframe-dot",{fontCharacter:"\\eb8a"}),n.debugStackframe=new n("debug-stackframe",{fontCharacter:"\\eb8b"}),n.debugStackframeFocused=new n("debug-stackframe-focused",{fontCharacter:"\\eb8b"}),n.debugBreakpointUnsupported=new n("debug-breakpoint-unsupported",{fontCharacter:"\\eb8c"}),n.symbolString=new n("symbol-string",{fontCharacter:"\\eb8d"}),n.debugReverseContinue=new n("debug-reverse-continue",{fontCharacter:"\\eb8e"}),n.debugStepBack=new n("debug-step-back",{fontCharacter:"\\eb8f"}),n.debugRestartFrame=new n("debug-restart-frame",{fontCharacter:"\\eb90"}),n.callIncoming=new n("call-incoming",{fontCharacter:"\\eb92"}),n.callOutgoing=new n("call-outgoing",{fontCharacter:"\\eb93"}),n.menu=new n("menu",{fontCharacter:"\\eb94"}),n.expandAll=new n("expand-all",{fontCharacter:"\\eb95"}),n.feedback=new n("feedback",{fontCharacter:"\\eb96"}),n.groupByRefType=new n("group-by-ref-type",{fontCharacter:"\\eb97"}),n.ungroupByRefType=new n("ungroup-by-ref-type",{fontCharacter:"\\eb98"}),n.account=new n("account",{fontCharacter:"\\eb99"}),n.bellDot=new n("bell-dot",{fontCharacter:"\\eb9a"}),n.debugConsole=new n("debug-console",{fontCharacter:"\\eb9b"}),n.library=new n("library",{fontCharacter:"\\eb9c"}),n.output=new n("output",{fontCharacter:"\\eb9d"}),n.runAll=new n("run-all",{fontCharacter:"\\eb9e"}),n.syncIgnored=new n("sync-ignored",{fontCharacter:"\\eb9f"}),n.pinned=new n("pinned",{fontCharacter:"\\eba0"}),n.githubInverted=new n("github-inverted",{fontCharacter:"\\eba1"}),n.debugAlt=new n("debug-alt",{fontCharacter:"\\eb91"}),n.serverProcess=new n("server-process",{fontCharacter:"\\eba2"}),n.serverEnvironment=new n("server-environment",{fontCharacter:"\\eba3"}),n.pass=new n("pass",{fontCharacter:"\\eba4"}),n.stopCircle=new n("stop-circle",{fontCharacter:"\\eba5"}),n.playCircle=new n("play-circle",{fontCharacter:"\\eba6"}),n.record=new n("record",{fontCharacter:"\\eba7"}),n.debugAltSmall=new n("debug-alt-small",{fontCharacter:"\\eba8"}),n.vmConnect=new n("vm-connect",{fontCharacter:"\\eba9"}),n.cloud=new n("cloud",{fontCharacter:"\\ebaa"}),n.merge=new n("merge",{fontCharacter:"\\ebab"}),n.exportIcon=new n("export",{fontCharacter:"\\ebac"}),n.graphLeft=new n("graph-left",{fontCharacter:"\\ebad"}),n.magnet=new n("magnet",{fontCharacter:"\\ebae"}),n.notebook=new n("notebook",{fontCharacter:"\\ebaf"}),n.redo=new n("redo",{fontCharacter:"\\ebb0"}),n.checkAll=new n("check-all",{fontCharacter:"\\ebb1"}),n.pinnedDirty=new n("pinned-dirty",{fontCharacter:"\\ebb2"}),n.passFilled=new n("pass-filled",{fontCharacter:"\\ebb3"}),n.circleLargeFilled=new n("circle-large-filled",{fontCharacter:"\\ebb4"}),n.circleLargeOutline=new n("circle-large-outline",{fontCharacter:"\\ebb5"}),n.combine=new n("combine",{fontCharacter:"\\ebb6"}),n.gather=new n("gather",{fontCharacter:"\\ebb6"}),n.table=new n("table",{fontCharacter:"\\ebb7"}),n.variableGroup=new n("variable-group",{fontCharacter:"\\ebb8"}),n.typeHierarchy=new n("type-hierarchy",{fontCharacter:"\\ebb9"}),n.typeHierarchySub=new n("type-hierarchy-sub",{fontCharacter:"\\ebba"}),n.typeHierarchySuper=new n("type-hierarchy-super",{fontCharacter:"\\ebbb"}),n.gitPullRequestCreate=new n("git-pull-request-create",{fontCharacter:"\\ebbc"}),n.runAbove=new n("run-above",{fontCharacter:"\\ebbd"}),n.runBelow=new n("run-below",{fontCharacter:"\\ebbe"}),n.notebookTemplate=new n("notebook-template",{fontCharacter:"\\ebbf"}),n.debugRerun=new n("debug-rerun",{fontCharacter:"\\ebc0"}),n.workspaceTrusted=new n("workspace-trusted",{fontCharacter:"\\ebc1"}),n.workspaceUntrusted=new n("workspace-untrusted",{fontCharacter:"\\ebc2"}),n.workspaceUnspecified=new n("workspace-unspecified",{fontCharacter:"\\ebc3"}),n.terminalCmd=new n("terminal-cmd",{fontCharacter:"\\ebc4"}),n.terminalDebian=new n("terminal-debian",{fontCharacter:"\\ebc5"}),n.terminalLinux=new n("terminal-linux",{fontCharacter:"\\ebc6"}),n.terminalPowershell=new n("terminal-powershell",{fontCharacter:"\\ebc7"}),n.terminalTmux=new n("terminal-tmux",{fontCharacter:"\\ebc8"}),n.terminalUbuntu=new n("terminal-ubuntu",{fontCharacter:"\\ebc9"}),n.terminalBash=new n("terminal-bash",{fontCharacter:"\\ebca"}),n.arrowSwap=new n("arrow-swap",{fontCharacter:"\\ebcb"}),n.copy=new n("copy",{fontCharacter:"\\ebcc"}),n.personAdd=new n("person-add",{fontCharacter:"\\ebcd"}),n.filterFilled=new n("filter-filled",{fontCharacter:"\\ebce"}),n.wand=new n("wand",{fontCharacter:"\\ebcf"}),n.debugLineByLine=new n("debug-line-by-line",{fontCharacter:"\\ebd0"}),n.inspect=new n("inspect",{fontCharacter:"\\ebd1"}),n.layers=new n("layers",{fontCharacter:"\\ebd2"}),n.layersDot=new n("layers-dot",{fontCharacter:"\\ebd3"}),n.layersActive=new n("layers-active",{fontCharacter:"\\ebd4"}),n.compass=new n("compass",{fontCharacter:"\\ebd5"}),n.compassDot=new n("compass-dot",{fontCharacter:"\\ebd6"}),n.compassActive=new n("compass-active",{fontCharacter:"\\ebd7"}),n.azure=new n("azure",{fontCharacter:"\\ebd8"}),n.issueDraft=new n("issue-draft",{fontCharacter:"\\ebd9"}),n.gitPullRequestClosed=new n("git-pull-request-closed",{fontCharacter:"\\ebda"}),n.gitPullRequestDraft=new n("git-pull-request-draft",{fontCharacter:"\\ebdb"}),n.debugAll=new n("debug-all",{fontCharacter:"\\ebdc"}),n.debugCoverage=new n("debug-coverage",{fontCharacter:"\\ebdd"}),n.runErrors=new n("run-errors",{fontCharacter:"\\ebde"}),n.folderLibrary=new n("folder-library",{fontCharacter:"\\ebdf"}),n.debugContinueSmall=new n("debug-continue-small",{fontCharacter:"\\ebe0"}),n.beakerStop=new n("beaker-stop",{fontCharacter:"\\ebe1"}),n.graphLine=new n("graph-line",{fontCharacter:"\\ebe2"}),n.graphScatter=new n("graph-scatter",{fontCharacter:"\\ebe3"}),n.pieChart=new n("pie-chart",{fontCharacter:"\\ebe4"}),n.bracket=new n("bracket",n.json.definition),n.bracketDot=new n("bracket-dot",{fontCharacter:"\\ebe5"}),n.bracketError=new n("bracket-error",{fontCharacter:"\\ebe6"}),n.lockSmall=new n("lock-small",{fontCharacter:"\\ebe7"}),n.azureDevops=new n("azure-devops",{fontCharacter:"\\ebe8"}),n.verifiedFilled=new n("verified-filled",{fontCharacter:"\\ebe9"})}(W||(W={}))},"VrN/":function(tt,Ee,J){(function(oe,$){tt.exports=$()})(this,function(){"use strict";var oe=navigator.userAgent,$=navigator.platform,k=/gecko\/\d/i.test(oe),z=/MSIE \d/.test(oe),U=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(oe),L=/Edge\/(\d+)/.exec(oe),W=z||U||L,H=W&&(z?document.documentMode||6:+(L||U)[1]),n=!L&&/WebKit\//.test(oe),I=n&&/Qt\/\d+\.\d+/.test(oe),g=!L&&/Chrome\//.test(oe),f=/Opera\//.test(oe),m=/Apple Computer/.test(navigator.vendor),h=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(oe),o=/PhantomJS/.test(oe),p=!L&&/AppleWebKit/.test(oe)&&/Mobile\/\w+/.test(oe),l=/Android/.test(oe),u=p||l||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(oe),a=p||/Mac/.test($),s=/\bCrOS\b/.test(oe),C=/win/i.test($),_=f&&oe.match(/Version\/(\d*\.\d*)/);_&&(_=Number(_[1])),_&&_>=15&&(f=!1,n=!0);var w=a&&(I||f&&(_==null||_<12.11)),O=k||W&&H>=9;function R(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var S=function(e,t){var r=e.className,i=R(t).exec(r);if(i){var d=r.slice(i.index+i[0].length);e.className=r.slice(0,i.index)+(d?i[1]+d:"")}};function T(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function E(e,t){return T(e).appendChild(t)}function c(e,t,r,i){var d=document.createElement(e);if(r&&(d.className=r),i&&(d.style.cssText=i),typeof t=="string")d.appendChild(document.createTextNode(t));else if(t)for(var D=0;D<t.length;++D)d.appendChild(t[D]);return d}function x(e,t,r,i){var d=c(e,t,r,i);return d.setAttribute("role","presentation"),d}var v;document.createRange?v=function(e,t,r,i){var d=document.createRange();return d.setEnd(i||e,r),d.setStart(e,t),d}:v=function(e,t,r){var i=document.body.createTextRange();try{i.moveToElementText(e.parentNode)}catch(d){return i}return i.collapse(!0),i.moveEnd("character",r),i.moveStart("character",t),i};function y(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 F(){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 B(e,t){var r=e.className;R(t).test(r)||(e.className+=(r?" ":"")+t)}function A(e,t){for(var r=e.split(" "),i=0;i<r.length;i++)r[i]&&!R(r[i]).test(t)&&(t+=" "+r[i]);return t}var j=function(e){e.select()};p?j=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:W&&(j=function(e){try{e.select()}catch(t){}});function P(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function b(e,t,r){t||(t={});for(var i in e)e.hasOwnProperty(i)&&(r!==!1||!t.hasOwnProperty(i))&&(t[i]=e[i]);return t}function V(e,t,r,i,d){t==null&&(t=e.search(/[^\s\u00a0]/),t==-1&&(t=e.length));for(var D=i||0,G=d||0;;){var Q=e.indexOf(" ",D);if(Q<0||Q>=t)return G+(t-D);G+=Q-D,G+=r-G%r,D=Q+1}}var re=function(){this.id=null,this.f=null,this.time=0,this.handler=P(this.onTimeout,this)};re.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},re.prototype.set=function(e,t){this.f=t;var r=+new Date+e;(!this.id||r<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,e),this.time=r)};function ce(e,t){for(var r=0;r<e.length;++r)if(e[r]==t)return r;return-1}var me=50,De={toString:function(){return"CodeMirror.Pass"}},we={scroll:!1},Le={origin:"*mouse"},Re={origin:"+move"};function Ie(e,t,r){for(var i=0,d=0;;){var D=e.indexOf(" ",i);D==-1&&(D=e.length);var G=D-i;if(D==e.length||d+G>=t)return i+Math.min(G,t-d);if(d+=D-i,d+=r-d%r,i=D+1,d>=t)return i}}var ye=[""];function X(e){for(;ye.length<=e;)ye.push(M(ye)+" ");return ye[e]}function M(e){return e[e.length-1]}function N(e,t){for(var r=[],i=0;i<e.length;i++)r[i]=t(e[i],i);return r}function Y(e,t,r){for(var i=0,d=r(t);i<e.length&&r(e[i])<=d;)i++;e.splice(i,0,t)}function ie(){}function K(e,t){var r;return Object.create?r=Object.create(e):(ie.prototype=e,r=new ie),t&&b(t,r),r}var pe=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function Se(e){return/\w/.test(e)||e>"\x80"&&(e.toUpperCase()!=e.toLowerCase()||pe.test(e))}function Pe(e,t){return t?t.source.indexOf("\\w")>-1&&Se(e)?!0:t.test(e):Se(e)}function he(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var ve=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;function xe(e){return e.charCodeAt(0)>=768&&ve.test(e)}function Ce(e,t,r){for(;(r<0?t>0:t<e.length)&&xe(e.charAt(t));)t+=r;return t}function Be(e,t,r){for(var i=t>r?-1:1;;){if(t==r)return t;var d=(t+r)/2,D=i<0?Math.ceil(d):Math.floor(d);if(D==t)return e(D)?t:r;e(D)?r=D:t=D+i}}function Ne(e,t,r,i){if(!e)return i(t,r,"ltr",0);for(var d=!1,D=0;D<e.length;++D){var G=e[D];(G.from<r&&G.to>t||t==r&&G.to==t)&&(i(Math.max(G.from,t),Math.min(G.to,r),G.level==1?"rtl":"ltr",D),d=!0)}d||i(t,r,"ltr")}var Ue=null;function He(e,t,r){var i;Ue=null;for(var d=0;d<e.length;++d){var D=e[d];if(D.from<t&&D.to>t)return d;D.to==t&&(D.from!=D.to&&r=="before"?i=d:Ue=d),D.from==t&&(D.from!=D.to&&r!="before"?i=d:Ue=d)}return i!=null?i:Ue}var ze=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function r(se){return se<=247?e.charAt(se):1424<=se&&se<=1524?"R":1536<=se&&se<=1785?t.charAt(se-1536):1774<=se&&se<=2220?"r":8192<=se&&se<=8203?"w":se==8204?"b":"L"}var i=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,d=/[stwN]/,D=/[LRr]/,G=/[Lb1n]/,Q=/[1n]/;function ee(se,ge,_e){this.level=se,this.from=ge,this.to=_e}return function(se,ge){var _e=ge=="ltr"?"L":"R";if(se.length==0||ge=="ltr"&&!i.test(se))return!1;for(var Oe=se.length,Ae=[],Fe=0;Fe<Oe;++Fe)Ae.push(r(se.charCodeAt(Fe)));for(var We=0,Xe=_e;We<Oe;++We){var qe=Ae[We];qe=="m"?Ae[We]=Xe:Xe=qe}for(var at=0,et=_e;at<Oe;++at){var st=Ae[at];st=="1"&&et=="r"?Ae[at]="n":D.test(st)&&(et=st,st=="r"&&(Ae[at]="R"))}for(var vt=1,ct=Ae[0];vt<Oe-1;++vt){var Ot=Ae[vt];Ot=="+"&&ct=="1"&&Ae[vt+1]=="1"?Ae[vt]="1":Ot==","&&ct==Ae[vt+1]&&(ct=="1"||ct=="n")&&(Ae[vt]=ct),ct=Ot}for(var Ut=0;Ut<Oe;++Ut){var nn=Ae[Ut];if(nn==",")Ae[Ut]="N";else if(nn=="%"){var Kt=void 0;for(Kt=Ut+1;Kt<Oe&&Ae[Kt]=="%";++Kt);for(var xn=Ut&&Ae[Ut-1]=="!"||Kt<Oe&&Ae[Kt]=="1"?"1":"N",yn=Ut;yn<Kt;++yn)Ae[yn]=xn;Ut=Kt-1}}for(var $t=0,bn=_e;$t<Oe;++$t){var on=Ae[$t];bn=="L"&&on=="1"?Ae[$t]="L":D.test(on)&&(bn=on)}for(var qt=0;qt<Oe;++qt)if(d.test(Ae[qt])){var Jt=void 0;for(Jt=qt+1;Jt<Oe&&d.test(Ae[Jt]);++Jt);for(var Xt=(qt?Ae[qt-1]:_e)=="L",_n=(Jt<Oe?Ae[Jt]:_e)=="L",Ki=Xt==_n?Xt?"L":"R":_e,ni=qt;ni<Jt;++ni)Ae[ni]=Ki;qt=Jt-1}for(var hn=[],Bn,rn=0;rn<Oe;)if(G.test(Ae[rn])){var Va=rn;for(++rn;rn<Oe&&G.test(Ae[rn]);++rn);hn.push(new ee(0,Va,rn))}else{var Vn=rn,yi=hn.length,bi=ge=="rtl"?1:0;for(++rn;rn<Oe&&Ae[rn]!="L";++rn);for(var fn=Vn;fn<rn;)if(Q.test(Ae[fn])){Vn<fn&&(hn.splice(yi,0,new ee(1,Vn,fn)),yi+=bi);var zi=fn;for(++fn;fn<rn&&Q.test(Ae[fn]);++fn);hn.splice(yi,0,new ee(2,zi,fn)),yi+=bi,Vn=fn}else++fn;Vn<rn&&hn.splice(yi,0,new ee(1,Vn,rn))}return ge=="ltr"&&(hn[0].level==1&&(Bn=se.match(/^\s+/))&&(hn[0].from=Bn[0].length,hn.unshift(new ee(0,0,Bn[0].length))),M(hn).level==1&&(Bn=se.match(/\s+$/))&&(M(hn).to-=Bn[0].length,hn.push(new ee(0,Oe-Bn[0].length,Oe)))),ge=="rtl"?hn.reverse():hn}}();function Ge(e,t){var r=e.order;return r==null&&(r=e.order=ze(e.text,t)),r}var Je=[],ke=function(e,t,r){if(e.addEventListener)e.addEventListener(t,r,!1);else if(e.attachEvent)e.attachEvent("on"+t,r);else{var i=e._handlers||(e._handlers={});i[t]=(i[t]||Je).concat(r)}};function Qe(e,t){return e._handlers&&e._handlers[t]||Je}function Ze(e,t,r){if(e.removeEventListener)e.removeEventListener(t,r,!1);else if(e.detachEvent)e.detachEvent("on"+t,r);else{var i=e._handlers,d=i&&i[t];if(d){var D=ce(d,r);D>-1&&(i[t]=d.slice(0,D).concat(d.slice(D+1)))}}}function le(e,t){var r=Qe(e,t);if(!r.length)return;for(var i=Array.prototype.slice.call(arguments,2),d=0;d<r.length;++d)r[d].apply(null,i)}function Z(e,t,r){return typeof t=="string"&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),le(e,r||t.type,e,t),de(t)||t.codemirrorIgnore}function q(e){var t=e._handlers&&e._handlers.cursorActivity;if(!t)return;for(var r=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),i=0;i<t.length;++i)ce(r,t[i])==-1&&r.push(t[i])}function ae(e,t){return Qe(e,t).length>0}function ue(e){e.prototype.on=function(t,r){ke(this,t,r)},e.prototype.off=function(t,r){Ze(this,t,r)}}function ne(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function te(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function de(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function fe(e){ne(e),te(e)}function be(e){return e.target||e.srcElement}function Te(e){var t=e.which;return t==null&&(e.button&1?t=1:e.button&2?t=3:e.button&4&&(t=2)),a&&e.ctrlKey&&t==1&&(t=3),t}var Me=function(){if(W&&H<9)return!1;var e=c("div");return"draggable"in e||"dragDrop"in e}(),je;function nt(e){if(je==null){var t=c("span","\u200B");E(e,c("span",[t,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(je=t.offsetWidth<=1&&t.offsetHeight>2&&!(W&&H<8))}var r=je?c("span","\u200B"):c("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return r.setAttribute("cm-text",""),r}var it;function Tt(e){if(it!=null)return it;var t=E(e,document.createTextNode("A\u062EA")),r=v(t,0,1).getBoundingClientRect(),i=v(t,1,2).getBoundingClientRect();return T(e),!r||r.left==r.right?!1:it=i.right-r.right<3}var ot=`
b`.split(/\n/).length!=3?function(e){for(var t=0,r=[],i=e.length;t<=i;){var d=e.indexOf(`
`,t);d==-1&&(d=e.length);var D=e.slice(t,e.charAt(d-1)=="\r"?d-1:d),G=D.indexOf("\r");G!=-1?(r.push(D.slice(0,G)),t+=G+1):(r.push(D),t=d+1)}return r}:function(e){return e.split(/\r\n?|\n/)},$e=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(r){}return!t||t.parentElement()!=e?!1:t.compareEndPoints("StartToEnd",t)!=0},yt=function(){var e=c("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),lt=null;function Rt(e){if(lt!=null)return lt;var t=E(e,c("span","x")),r=t.getBoundingClientRect(),i=v(t,0,1).getBoundingClientRect();return lt=Math.abs(r.left-i.left)>1}var Ct={},bt={};function Qt(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),Ct[e]=t}function zt(e,t){bt[e]=t}function Gt(e){if(typeof e=="string"&&bt.hasOwnProperty(e))e=bt[e];else if(e&&typeof e.name=="string"&&bt.hasOwnProperty(e.name)){var t=bt[e.name];typeof t=="string"&&(t={name:t}),e=K(t,e),e.name=t.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return Gt("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return Gt("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function jt(e,t){t=Gt(t);var r=Ct[t.name];if(!r)return jt(e,"text/plain");var i=r(e,t);if(gt.hasOwnProperty(t.name)){var d=gt[t.name];for(var D in d){if(!d.hasOwnProperty(D))continue;i.hasOwnProperty(D)&&(i["_"+D]=i[D]),i[D]=d[D]}}if(i.name=t.name,t.helperType&&(i.helperType=t.helperType),t.modeProps)for(var G in t.modeProps)i[G]=t.modeProps[G];return i}var gt={};function wt(e,t){var r=gt.hasOwnProperty(e)?gt[e]:gt[e]={};b(t,r)}function At(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var r={};for(var i in t){var d=t[i];d instanceof Array&&(d=d.concat([])),r[i]=d}return r}function Bt(e,t){for(var r;e.innerMode&&!(r=e.innerMode(t),!r||r.mode==e);)t=r.state,e=r.mode;return r||{mode:e,state:t}}function an(e,t,r){return e.startState?e.startState(t,r):!0}var ut=function(e,t,r){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=r};ut.prototype.eol=function(){return this.pos>=this.string.length},ut.prototype.sol=function(){return this.pos==this.lineStart},ut.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},ut.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},ut.prototype.eat=function(e){var t=this.string.charAt(this.pos),r;if(typeof e=="string"?r=t==e:r=t&&(e.test?e.test(t):e(t)),r)return++this.pos,t},ut.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},ut.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},ut.prototype.skipToEnd=function(){this.pos=this.string.length},ut.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},ut.prototype.backUp=function(e){this.pos-=e},ut.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=V(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?V(this.string,this.lineStart,this.tabSize):0)},ut.prototype.indentation=function(){return V(this.string,null,this.tabSize)-(this.lineStart?V(this.string,this.lineStart,this.tabSize):0)},ut.prototype.match=function(e,t,r){if(typeof e=="string"){var i=function(G){return r?G.toLowerCase():G},d=this.string.substr(this.pos,e.length);if(i(d)==i(e))return t!==!1&&(this.pos+=e.length),!0}else{var D=this.string.slice(this.pos).match(e);return D&&D.index>0?null:(D&&t!==!1&&(this.pos+=D[0].length),D)}},ut.prototype.current=function(){return this.string.slice(this.start,this.pos)},ut.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},ut.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},ut.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function Ye(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 r=e;!r.lines;)for(var i=0;;++i){var d=r.children[i],D=d.chunkSize();if(t<D){r=d;break}t-=D}return r.lines[t]}function Et(e,t,r){var i=[],d=t.line;return e.iter(t.line,r.line+1,function(D){var G=D.text;d==r.line&&(G=G.slice(0,r.ch)),d==t.line&&(G=G.slice(t.ch)),i.push(G),++d}),i}function dt(e,t,r){var i=[];return e.iter(t,r,function(d){i.push(d.text)}),i}function rt(e,t){var r=t-e.height;if(r)for(var i=e;i;i=i.parent)i.height+=r}function pt(e){if(e.parent==null)return null;for(var t=e.parent,r=ce(t.lines,e),i=t.parent;i;t=i,i=i.parent)for(var d=0;!(i.children[d]==t);++d)r+=i.children[d].chunkSize();return r+t.first}function ft(e,t){var r=e.first;e:do{for(var i=0;i<e.children.length;++i){var d=e.children[i],D=d.height;if(t<D){e=d;continue e}t-=D,r+=d.chunkSize()}return r}while(!e.lines);for(var G=0;G<e.lines.length;++G){var Q=e.lines[G],ee=Q.height;if(t<ee)break;t-=ee}return r+G}function Vt(e,t){return t>=e.first&&t<e.first+e.size}function Ht(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function Ke(e,t,r){if(r===void 0&&(r=null),!(this instanceof Ke))return new Ke(e,t,r);this.line=e,this.ch=t,this.sticky=r}function _t(e,t){return e.line-t.line||e.ch-t.ch}function ii(e,t){return e.sticky==t.sticky&&_t(e,t)==0}function _i(e){return Ke(e.line,e.ch)}function Ei(e,t){return _t(e,t)<0?t:e}function ri(e,t){return _t(e,t)<0?e:t}function xi(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function St(e,t){if(t.line<e.first)return Ke(e.first,0);var r=e.first+e.size-1;return t.line>r?Ke(r,Ye(e,r).text.length):Ar(t,Ye(e,t.line).text.length)}function Ar(e,t){var r=e.ch;return r==null||r>t?Ke(e.line,t):r<0?Ke(e.line,0):e}function Ve(e,t){for(var r=[],i=0;i<t.length;i++)r[i]=St(e,t[i]);return r}var Ti=function(e,t){this.state=e,this.lookAhead=t},Cn=function(e,t,r,i){this.state=t,this.doc=e,this.line=r,this.maxLookAhead=i||0,this.baseTokens=null,this.baseTokenPos=1};Cn.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return t!=null&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},Cn.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}},Cn.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},Cn.fromSaved=function(e,t,r){return t instanceof Ti?new Cn(e,At(e.mode,t.state),r,t.lookAhead):new Cn(e,At(e.mode,t),r)},Cn.prototype.save=function(e){var t=e!==!1?At(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new Ti(t,this.maxLookAhead):t};function Vi(e,t,r,i){var d=[e.state.modeGen],D={};Ln(e,t.text,e.doc.mode,r,function(se,ge){return d.push(se,ge)},D,i);for(var G=r.state,Q=function(se){r.baseTokens=d;var ge=e.state.overlays[se],_e=1,Oe=0;r.state=!0,Ln(e,t.text,ge.mode,r,function(Ae,Fe){for(var We=_e;Oe<Ae;){var Xe=d[_e];Xe>Ae&&d.splice(_e,1,Ae,d[_e+1],Xe),_e+=2,Oe=Math.min(Ae,Xe)}if(!Fe)return;if(ge.opaque)d.splice(We,_e-We,Ae,"overlay "+Fe),_e=We+2;else for(;We<_e;We+=2){var qe=d[We+1];d[We+1]=(qe?qe+" ":"")+"overlay "+Fe}},D),r.state=G,r.baseTokens=null,r.baseTokenPos=1},ee=0;ee<e.state.overlays.length;++ee)Q(ee);return{styles:d,classes:D.bgClass||D.textClass?D:null}}function ai(e,t,r){if(!t.styles||t.styles[0]!=e.state.modeGen){var i=Rn(e,pt(t)),d=t.text.length>e.options.maxHighlightLength&&At(e.doc.mode,i.state),D=Vi(e,t,i);d&&(i.state=d),t.stateAfter=i.save(!d),t.styles=D.styles,D.classes?t.styleClasses=D.classes:t.styleClasses&&(t.styleClasses=null),r===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function Rn(e,t,r){var i=e.doc,d=e.display;if(!i.mode.startState)return new Cn(i,!0,t);var D=Or(e,t,r),G=D>i.first&&Ye(i,D-1).stateAfter,Q=G?Cn.fromSaved(i,G,D):new Cn(i,an(i.mode),D);return i.iter(D,t,function(ee){Xi(e,ee.text,Q);var se=Q.line;ee.stateAfter=se==t-1||se%5==0||se>=d.viewFrom&&se<d.viewTo?Q.save():null,Q.nextLine()}),r&&(i.modeFrontier=Q.line),Q}function Xi(e,t,r,i){var d=e.doc.mode,D=new ut(t,e.options.tabSize,r);for(D.start=D.pos=i||0,t==""&&Yi(d,r.state);!D.eol();)On(d,D,r.state),D.start=D.pos}function Yi(e,t){if(e.blankLine)return e.blankLine(t);if(!e.innerMode)return;var r=Bt(e,t);if(r.mode.blankLine)return r.mode.blankLine(r.state)}function On(e,t,r,i){for(var d=0;d<10;d++){i&&(i[0]=Bt(e,r).mode);var D=e.token(t,r);if(t.pos>t.start)return D}throw new Error("Mode "+e.name+" failed to advance stream.")}var $i=function(e,t,r){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=r};function Rr(e,t,r,i){var d=e.doc,D=d.mode,G;t=St(d,t);var Q=Ye(d,t.line),ee=Rn(e,t.line,r),se=new ut(Q.text,e.options.tabSize,ee),ge;for(i&&(ge=[]);(i||se.pos<t.ch)&&!se.eol();)se.start=se.pos,G=On(D,se,ee.state),i&&ge.push(new $i(se,G,At(d.mode,ee.state)));return i?ge:new $i(se,G,ee.state)}function Ji(e,t){if(e)for(;;){var r=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!r)break;e=e.slice(0,r.index)+e.slice(r.index+r[0].length);var i=r[1]?"bgClass":"textClass";t[i]==null?t[i]=r[2]:new RegExp("(?:^|\\s)"+r[2]+"(?:$|\\s)").test(t[i])||(t[i]+=" "+r[2])}return e}function Ln(e,t,r,i,d,D,G){var Q=r.flattenSpans;Q==null&&(Q=e.options.flattenSpans);var ee=0,se=null,ge=new ut(t,e.options.tabSize,i),_e,Oe=e.options.addModeClass&&[null];for(t==""&&Ji(Yi(r,i.state),D);!ge.eol();){if(ge.pos>e.options.maxHighlightLength?(Q=!1,G&&Xi(e,t,i,ge.pos),ge.pos=t.length,_e=null):_e=Ji(On(r,ge,i.state,Oe),D),Oe){var Ae=Oe[0].name;Ae&&(_e="m-"+(_e?Ae+" "+_e:Ae))}if(!Q||se!=_e){for(;ee<ge.start;)ee=Math.min(ge.start,ee+5e3),d(ee,se);se=_e}ge.start=ge.pos}for(;ee<ge.pos;){var Fe=Math.min(ge.pos,ee+5e3);d(Fe,se),ee=Fe}}function Or(e,t,r){for(var i,d,D=e.doc,G=r?-1:t-(e.doc.mode.innerMode?1e3:100),Q=t;Q>G;--Q){if(Q<=D.first)return D.first;var ee=Ye(D,Q-1),se=ee.stateAfter;if(se&&(!r||Q+(se instanceof Ti?se.lookAhead:0)<=D.modeFrontier))return Q;var ge=V(ee.text,null,e.options.tabSize);(d==null||i>ge)&&(d=Q-1,i=ge)}return d}function aa(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),e.highlightFrontier<t-10)return;for(var r=e.first,i=t-1;i>r;i--){var d=Ye(e,i).stateAfter;if(d&&(!(d instanceof Ti)||i+d.lookAhead<t)){r=i+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,r)}var Qi=!1,dn=!1;function Xn(){Qi=!0}function sa(){dn=!0}function si(e,t,r){this.marker=e,this.from=t,this.to=r}function In(e,t){if(e)for(var r=0;r<e.length;++r){var i=e[r];if(i.marker==t)return i}}function Zi(e,t){for(var r,i=0;i<e.length;++i)e[i]!=t&&(r||(r=[])).push(e[i]);return r}function oa(e,t){e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],t.marker.attachLine(e)}function Lr(e,t,r){var i;if(e)for(var d=0;d<e.length;++d){var D=e[d],G=D.marker,Q=D.from==null||(G.inclusiveLeft?D.from<=t:D.from<t);if(Q||D.from==t&&G.type=="bookmark"&&(!r||!D.marker.insertLeft)){var ee=D.to==null||(G.inclusiveRight?D.to>=t:D.to>t);(i||(i=[])).push(new si(G,D.from,ee?null:D.to))}}return i}function Ir(e,t,r){var i;if(e)for(var d=0;d<e.length;++d){var D=e[d],G=D.marker,Q=D.to==null||(G.inclusiveRight?D.to>=t:D.to>t);if(Q||D.from==t&&G.type=="bookmark"&&(!r||D.marker.insertLeft)){var ee=D.from==null||(G.inclusiveLeft?D.from<=t:D.from<t);(i||(i=[])).push(new si(G,ee?null:D.from-t,D.to==null?null:D.to-t))}}return i}function wi(e,t){if(t.full)return null;var r=Vt(e,t.from.line)&&Ye(e,t.from.line).markedSpans,i=Vt(e,t.to.line)&&Ye(e,t.to.line).markedSpans;if(!r&&!i)return null;var d=t.from.ch,D=t.to.ch,G=_t(t.from,t.to)==0,Q=Lr(r,d,G),ee=Ir(i,D,G),se=t.text.length==1,ge=M(t.text).length+(se?d:0);if(Q)for(var _e=0;_e<Q.length;++_e){var Oe=Q[_e];if(Oe.to==null){var Ae=In(ee,Oe.marker);Ae?se&&(Oe.to=Ae.to==null?null:Ae.to+ge):Oe.to=d}}if(ee)for(var Fe=0;Fe<ee.length;++Fe){var We=ee[Fe];if(We.to!=null&&(We.to+=ge),We.from==null){var Xe=In(Q,We.marker);Xe||(We.from=ge,se&&(Q||(Q=[])).push(We))}else We.from+=ge,se&&(Q||(Q=[])).push(We)}Q&&(Q=Dr(Q)),ee&&ee!=Q&&(ee=Dr(ee));var qe=[Q];if(!se){var at=t.text.length-2,et;if(at>0&&Q)for(var st=0;st<Q.length;++st)Q[st].to==null&&(et||(et=[])).push(new si(Q[st].marker,null,null));for(var vt=0;vt<at;++vt)qe.push(et);qe.push(ee)}return qe}function Dr(e){for(var t=0;t<e.length;++t){var r=e[t];r.from!=null&&r.from==r.to&&r.marker.clearWhenEmpty!==!1&&e.splice(t--,1)}return e.length?e:null}function kr(e,t,r){var i=null;if(e.iter(t.line,r.line+1,function(Ae){if(Ae.markedSpans)for(var Fe=0;Fe<Ae.markedSpans.length;++Fe){var We=Ae.markedSpans[Fe].marker;We.readOnly&&(!i||ce(i,We)==-1)&&(i||(i=[])).push(We)}}),!i)return null;for(var d=[{from:t,to:r}],D=0;D<i.length;++D)for(var G=i[D],Q=G.find(0),ee=0;ee<d.length;++ee){var se=d[ee];if(_t(se.to,Q.from)<0||_t(se.from,Q.to)>0)continue;var ge=[ee,1],_e=_t(se.from,Q.from),Oe=_t(se.to,Q.to);(_e<0||!G.inclusiveLeft&&!_e)&&ge.push({from:se.from,to:Q.from}),(Oe>0||!G.inclusiveRight&&!Oe)&&ge.push({from:Q.to,to:se.to}),d.splice.apply(d,ge),ee+=ge.length-3}return d}function la(e){var t=e.markedSpans;if(!t)return;for(var r=0;r<t.length;++r)t[r].marker.detachLine(e);e.markedSpans=null}function Si(e,t){if(!t)return;for(var r=0;r<t.length;++r)t[r].marker.attachLine(e);e.markedSpans=t}function oi(e){return e.inclusiveLeft?-1:0}function li(e){return e.inclusiveRight?1:0}function Ci(e,t){var r=e.lines.length-t.lines.length;if(r!=0)return r;var i=e.find(),d=t.find(),D=_t(i.from,d.from)||oi(e)-oi(t);if(D)return-D;var G=_t(i.to,d.to)||li(e)-li(t);return G||t.id-e.id}function jn(e,t){var r=dn&&e.markedSpans,i;if(r)for(var d=void 0,D=0;D<r.length;++D)d=r[D],d.marker.collapsed&&(t?d.from:d.to)==null&&(!i||Ci(i,d.marker)<0)&&(i=d.marker);return i}function Hn(e){return jn(e,!0)}function Wn(e){return jn(e,!1)}function Ai(e,t){var r=dn&&e.markedSpans,i;if(r)for(var d=0;d<r.length;++d){var D=r[d];D.marker.collapsed&&(D.from==null||D.from<t)&&(D.to==null||D.to>t)&&(!i||Ci(i,D.marker)<0)&&(i=D.marker)}return i}function Mr(e,t,r,i,d){var D=Ye(e,t),G=dn&&D.markedSpans;if(G)for(var Q=0;Q<G.length;++Q){var ee=G[Q];if(!ee.marker.collapsed)continue;var se=ee.marker.find(0),ge=_t(se.from,r)||oi(ee.marker)-oi(d),_e=_t(se.to,i)||li(ee.marker)-li(d);if(ge>=0&&_e<=0||ge<=0&&_e>=0)continue;if(ge<=0&&(ee.marker.inclusiveRight&&d.inclusiveLeft?_t(se.to,r)>=0:_t(se.to,r)>0)||ge>=0&&(ee.marker.inclusiveRight&&d.inclusiveLeft?_t(se.from,i)<=0:_t(se.from,i)<0))return!0}}function Tn(e){for(var t;t=Hn(e);)e=t.find(-1,!0).line;return e}function Pr(e){for(var t;t=Wn(e);)e=t.find(1,!0).line;return e}function Ri(e){for(var t,r;t=Wn(e);)e=t.find(1,!0).line,(r||(r=[])).push(e);return r}function qi(e,t){var r=Ye(e,t),i=Tn(r);return r==i?t:pt(i)}function Yn(e,t){if(t>e.lastLine())return t;var r=Ye(e,t),i;if(!Nn(e,r))return t;for(;i=Wn(r);)r=i.find(1,!0).line;return pt(r)+1}function Nn(e,t){var r=dn&&t.markedSpans;if(r)for(var i=void 0,d=0;d<r.length;++d){if(i=r[d],!i.marker.collapsed)continue;if(i.from==null)return!0;if(i.marker.widgetNode)continue;if(i.from==0&&i.marker.inclusiveLeft&&er(e,t,i))return!0}}function er(e,t,r){if(r.to==null){var i=r.marker.find(1,!0);return er(e,i.line,In(i.line.markedSpans,r.marker))}if(r.marker.inclusiveRight&&r.to==t.text.length)return!0;for(var d=void 0,D=0;D<t.markedSpans.length;++D)if(d=t.markedSpans[D],d.marker.collapsed&&!d.marker.widgetNode&&d.from==r.to&&(d.to==null||d.to!=r.from)&&(d.marker.inclusiveLeft||r.marker.inclusiveRight)&&er(e,t,d))return!0}function Dn(e){e=Tn(e);for(var t=0,r=e.parent,i=0;i<r.lines.length;++i){var d=r.lines[i];if(d==e)break;t+=d.height}for(var D=r.parent;D;r=D,D=r.parent)for(var G=0;G<D.children.length;++G){var Q=D.children[G];if(Q==r)break;t+=Q.height}return t}function tr(e){if(e.height==0)return 0;for(var t=e.text.length,r,i=e;r=Hn(i);){var d=r.find(0,!0);i=d.from.line,t+=d.from.ch-d.to.ch}for(i=e;r=Wn(i);){var D=r.find(0,!0);t-=i.text.length-D.from.ch,i=D.to.line,t+=i.text.length-D.to.ch}return t}function Nr(e){var t=e.display,r=e.doc;t.maxLine=Ye(r,r.first),t.maxLineLength=tr(t.maxLine),t.maxLineChanged=!0,r.iter(function(i){var d=tr(i);d>t.maxLineLength&&(t.maxLineLength=d,t.maxLine=i)})}var ui=function(e,t,r){this.text=e,Si(this,t),this.height=r?r(this):1};ui.prototype.lineNo=function(){return pt(this)},ue(ui);function ua(e,t,r,i){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),la(e),Si(e,r);var d=i?i(e):1;d!=e.height&&rt(e,d)}function ht(e){e.parent=null,la(e)}var xt={},mt={};function Lt(e,t){if(!e||/^\s*$/.test(e))return null;var r=t.addModeClass?mt:xt;return r[e]||(r[e]=e.replace(/\S+/g,"cm-$&"))}function kt(e,t){var r=x("span",null,null,n?"padding-right: .1px":null),i={pre:x("pre",[r],"CodeMirror-line"),content:r,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var d=0;d<=(t.rest?t.rest.length:0);d++){var D=d?t.rest[d-1]:t.line,G=void 0;i.pos=0,i.addToken=Dt,Tt(e.display.measure)&&(G=Ge(D,e.doc.direction))&&(i.addToken=pn(i.addToken,G)),i.map=[];var Q=t!=e.display.externalMeasured&&pt(D);Gn(D,i,ai(e,D,Q)),D.styleClasses&&(D.styleClasses.bgClass&&(i.bgClass=A(D.styleClasses.bgClass,i.bgClass||"")),D.styleClasses.textClass&&(i.textClass=A(D.styleClasses.textClass,i.textClass||""))),i.map.length==0&&i.map.push(0,0,i.content.appendChild(nt(e.display.measure))),d==0?(t.measure.map=i.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(i.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(n){var ee=i.content.lastChild;(/\bcm-tab\b/.test(ee.className)||ee.querySelector&&ee.querySelector(".cm-tab"))&&(i.content.className="cm-tab-wrap-hack")}return le(e,"renderLine",e,t.line,i.pre),i.pre.className&&(i.textClass=A(i.pre.className,i.textClass||"")),i}function Ft(e){var t=c("span","\u2022","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function Dt(e,t,r,i,d,D,G){if(!t)return;var Q=e.splitSpaces?Zt(t,e.trailingSpace):t,ee=e.cm.state.specialChars,se=!1,ge;if(!ee.test(t))e.col+=t.length,ge=document.createTextNode(Q),e.map.push(e.pos,e.pos+t.length,ge),W&&H<9&&(se=!0),e.pos+=t.length;else{ge=document.createDocumentFragment();for(var _e=0;;){ee.lastIndex=_e;var Oe=ee.exec(t),Ae=Oe?Oe.index-_e:t.length-_e;if(Ae){var Fe=document.createTextNode(Q.slice(_e,_e+Ae));W&&H<9?ge.appendChild(c("span",[Fe])):ge.appendChild(Fe),e.map.push(e.pos,e.pos+Ae,Fe),e.col+=Ae,e.pos+=Ae}if(!Oe)break;_e+=Ae+1;var We=void 0;if(Oe[0]==" "){var Xe=e.cm.options.tabSize,qe=Xe-e.col%Xe;We=ge.appendChild(c("span",X(qe),"cm-tab")),We.setAttribute("role","presentation"),We.setAttribute("cm-text"," "),e.col+=qe}else Oe[0]=="\r"||Oe[0]==`
`?(We=ge.appendChild(c("span",Oe[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),We.setAttribute("cm-text",Oe[0]),e.col+=1):(We=e.cm.options.specialCharPlaceholder(Oe[0]),We.setAttribute("cm-text",Oe[0]),W&&H<9?ge.appendChild(c("span",[We])):ge.appendChild(We),e.col+=1);e.map.push(e.pos,e.pos+1,We),e.pos++}}if(e.trailingSpace=Q.charCodeAt(t.length-1)==32,r||i||d||se||D||G){var at=r||"";i&&(at+=i),d&&(at+=d);var et=c("span",[ge],at,D);if(G)for(var st in G)G.hasOwnProperty(st)&&st!="style"&&st!="class"&&et.setAttribute(st,G[st]);return e.content.appendChild(et)}e.content.appendChild(ge)}function Zt(e,t){if(e.length>1&&!/ /.test(e))return e;for(var r=t,i="",d=0;d<e.length;d++){var D=e.charAt(d);D==" "&&r&&(d==e.length-1||e.charCodeAt(d+1)==32)&&(D="\xA0"),i+=D,r=D==" "}return i}function pn(e,t){return function(r,i,d,D,G,Q,ee){d=d?d+" cm-force-border":"cm-force-border";for(var se=r.pos,ge=se+i.length;;){for(var _e=void 0,Oe=0;Oe<t.length&&!(_e=t[Oe],_e.to>se&&_e.from<=se);Oe++);if(_e.to>=ge)return e(r,i,d,D,G,Q,ee);e(r,i.slice(0,_e.to-se),d,D,null,Q,ee),D=null,i=i.slice(_e.to-se),se=_e.to}}}function It(e,t,r,i){var d=!i&&r.widgetNode;d&&e.map.push(e.pos,e.pos+t,d),!i&&e.cm.display.input.needsContentAttribute&&(d||(d=e.content.appendChild(document.createElement("span"))),d.setAttribute("cm-marker",r.id)),d&&(e.cm.display.input.setUneditable(d),e.content.appendChild(d)),e.pos+=t,e.trailingSpace=!1}function Gn(e,t,r){var i=e.markedSpans,d=e.text,D=0;if(!i){for(var G=1;G<r.length;G+=2)t.addToken(t,d.slice(D,D=r[G]),Lt(r[G+1],t.cm.options));return}for(var Q=d.length,ee=0,se=1,ge="",_e,Oe,Ae=0,Fe,We,Xe,qe,at;;){if(Ae==ee){Fe=We=Xe=Oe="",at=null,qe=null,Ae=Infinity;for(var et=[],st=void 0,vt=0;vt<i.length;++vt){var ct=i[vt],Ot=ct.marker;if(Ot.type=="bookmark"&&ct.from==ee&&Ot.widgetNode)et.push(Ot);else if(ct.from<=ee&&(ct.to==null||ct.to>ee||Ot.collapsed&&ct.to==ee&&ct.from==ee)){if(ct.to!=null&&ct.to!=ee&&Ae>ct.to&&(Ae=ct.to,We=""),Ot.className&&(Fe+=" "+Ot.className),Ot.css&&(Oe=(Oe?Oe+";":"")+Ot.css),Ot.startStyle&&ct.from==ee&&(Xe+=" "+Ot.startStyle),Ot.endStyle&&ct.to==Ae&&(st||(st=[])).push(Ot.endStyle,ct.to),Ot.title&&((at||(at={})).title=Ot.title),Ot.attributes)for(var Ut in Ot.attributes)(at||(at={}))[Ut]=Ot.attributes[Ut];Ot.collapsed&&(!qe||Ci(qe.marker,Ot)<0)&&(qe=ct)}else ct.from>ee&&Ae>ct.from&&(Ae=ct.from)}if(st)for(var nn=0;nn<st.length;nn+=2)st[nn+1]==Ae&&(We+=" "+st[nn]);if(!qe||qe.from==ee)for(var Kt=0;Kt<et.length;++Kt)It(t,0,et[Kt]);if(qe&&(qe.from||0)==ee){if(It(t,(qe.to==null?Q+1:qe.to)-ee,qe.marker,qe.from==null),qe.to==null)return;qe.to==ee&&(qe=!1)}}if(ee>=Q)break;for(var xn=Math.min(Q,Ae);;){if(ge){var yn=ee+ge.length;if(!qe){var $t=yn>xn?ge.slice(0,xn-ee):ge;t.addToken(t,$t,_e?_e+Fe:Fe,Xe,ee+$t.length==Ae?We:"",Oe,at)}if(yn>=xn){ge=ge.slice(xn-ee),ee=xn;break}ee=yn,Xe=""}ge=d.slice(D,D=r[se++]),_e=Lt(r[se++],t.cm.options)}}}function Mt(e,t,r){this.line=t,this.rest=Ri(t),this.size=this.rest?pt(M(this.rest))-r+1:1,this.node=this.text=null,this.hidden=Nn(e,t)}function mn(e,t,r){for(var i=[],d,D=t;D<r;D=d){var G=new Mt(e.doc,Ye(e.doc,D),D);d=D+G.size,i.push(G)}return i}var ln=null;function An(e){ln?ln.ops.push(e):e.ownsGroup=ln={ops:[e],delayedCallbacks:[]}}function Lo(e){var t=e.delayedCallbacks,r=0;do{for(;r<t.length;r++)t[r].call(null);for(var i=0;i<e.ops.length;i++){var d=e.ops[i];if(d.cursorActivityHandlers)for(;d.cursorActivityCalled<d.cursorActivityHandlers.length;)d.cursorActivityHandlers[d.cursorActivityCalled++].call(null,d.cm)}}while(r<t.length)}function Io(e,t){var r=e.ownsGroup;if(!r)return;try{Lo(r)}finally{ln=null,t(r)}}var nr=null;function sn(e,t){var r=Qe(e,t);if(!r.length)return;var i=Array.prototype.slice.call(arguments,2),d;ln?d=ln.delayedCallbacks:nr?d=nr:(d=nr=[],setTimeout(Do,0));for(var D=function(Q){d.push(function(){return r[Q].apply(null,i)})},G=0;G<r.length;++G)D(G)}function Do(){var e=nr;nr=null;for(var t=0;t<e.length;++t)e[t]()}function Ya(e,t,r,i){for(var d=0;d<t.changes.length;d++){var D=t.changes[d];D=="text"?Mo(e,t):D=="gutter"?Ja(e,t,r,i):D=="class"?ha(e,t):D=="widget"&&Po(e,t,i)}t.changes=null}function ir(e){return e.node==e.text&&(e.node=c("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),W&&H<8&&(e.node.style.zIndex=2)),e.node}function ko(e,t){var r=t.bgClass?t.bgClass+" "+(t.line.bgClass||""):t.line.bgClass;if(r&&(r+=" CodeMirror-linebackground"),t.background)r?t.background.className=r:(t.background.parentNode.removeChild(t.background),t.background=null);else if(r){var i=ir(t);t.background=i.insertBefore(c("div",null,r),i.firstChild),e.display.input.setUneditable(t.background)}}function $a(e,t){var r=e.display.externalMeasured;return r&&r.line==t.line?(e.display.externalMeasured=null,t.measure=r.measure,r.built):kt(e,t)}function Mo(e,t){var r=t.text.className,i=$a(e,t);t.text==t.node&&(t.node=i.pre),t.text.parentNode.replaceChild(i.pre,t.text),t.text=i.pre,i.bgClass!=t.bgClass||i.textClass!=t.textClass?(t.bgClass=i.bgClass,t.textClass=i.textClass,ha(e,t)):r&&(t.text.className=r)}function ha(e,t){ko(e,t),t.line.wrapClass?ir(t).className=t.line.wrapClass:t.node!=t.text&&(t.node.className="");var r=t.textClass?t.textClass+" "+(t.line.textClass||""):t.line.textClass;t.text.className=r||""}function Ja(e,t,r,i){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 d=ir(t);t.gutterBackground=c("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(e.options.fixedGutter?i.fixedPos:-i.gutterTotalWidth)+"px; width: "+i.gutterTotalWidth+"px"),e.display.input.setUneditable(t.gutterBackground),d.insertBefore(t.gutterBackground,t.text)}var D=t.line.gutterMarkers;if(e.options.lineNumbers||D){var G=ir(t),Q=t.gutter=c("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?i.fixedPos:-i.gutterTotalWidth)+"px");if(e.display.input.setUneditable(Q),G.insertBefore(Q,t.text),t.line.gutterClass&&(Q.className+=" "+t.line.gutterClass),e.options.lineNumbers&&(!D||!D["CodeMirror-linenumbers"])&&(t.lineNumber=Q.appendChild(c("div",Ht(e.options,r),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+i.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),D)for(var ee=0;ee<e.display.gutterSpecs.length;++ee){var se=e.display.gutterSpecs[ee].className,ge=D.hasOwnProperty(se)&&D[se];ge&&Q.appendChild(c("div",[ge],"CodeMirror-gutter-elt","left: "+i.gutterLeft[se]+"px; width: "+i.gutterWidth[se]+"px"))}}}function Po(e,t,r){t.alignable&&(t.alignable=null);for(var i=R("CodeMirror-linewidget"),d=t.node.firstChild,D=void 0;d;d=D)D=d.nextSibling,i.test(d.className)&&t.node.removeChild(d);Qa(e,t,r)}function No(e,t,r,i){var d=$a(e,t);return t.text=t.node=d.pre,d.bgClass&&(t.bgClass=d.bgClass),d.textClass&&(t.textClass=d.textClass),ha(e,t),Ja(e,t,r,i),Qa(e,t,i),t.node}function Qa(e,t,r){if(Za(e,t.line,t,r,!0),t.rest)for(var i=0;i<t.rest.length;i++)Za(e,t.rest[i],t,r,!1)}function Za(e,t,r,i,d){if(!t.widgets)return;for(var D=ir(r),G=0,Q=t.widgets;G<Q.length;++G){var ee=Q[G],se=c("div",[ee.node],"CodeMirror-linewidget"+(ee.className?" "+ee.className:""));ee.handleMouseEvents||se.setAttribute("cm-ignore-events","true"),Fo(ee,se,r,i),e.display.input.setUneditable(se),d&&ee.above?D.insertBefore(se,r.gutter||r.text):D.appendChild(se),sn(ee,"redraw")}}function Fo(e,t,r,i){if(e.noHScroll){(r.alignable||(r.alignable=[])).push(t);var d=i.wrapperWidth;t.style.left=i.fixedPos+"px",e.coverGutter||(d-=i.gutterTotalWidth,t.style.paddingLeft=i.gutterTotalWidth+"px"),t.style.width=d+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-i.gutterTotalWidth+"px"))}function rr(e){if(e.height!=null)return e.height;var t=e.doc.cm;if(!t)return 0;if(!y(document.body,e.node)){var r="position: relative;";e.coverGutter&&(r+="margin-left: -"+t.display.gutters.offsetWidth+"px;"),e.noHScroll&&(r+="width: "+t.display.wrapper.clientWidth+"px;"),E(t.display.measure,c("div",[e.node],null,r))}return e.height=e.node.parentNode.offsetHeight}function Kn(e,t){for(var r=be(t);r!=e.wrapper;r=r.parentNode)if(!r||r.nodeType==1&&r.getAttribute("cm-ignore-events")=="true"||r.parentNode==e.sizer&&r!=e.mover)return!0}function Fr(e){return e.lineSpace.offsetTop}function da(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function qa(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=E(e.measure,c("pre","x","CodeMirror-line-like")),r=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,i={left:parseInt(r.paddingLeft),right:parseInt(r.paddingRight)};return!isNaN(i.left)&&!isNaN(i.right)&&(e.cachedPaddingH=i),i}function Fn(e){return me-e.display.nativeBarWidth}function hi(e){return e.display.scroller.clientWidth-Fn(e)-e.display.barWidth}function ca(e){return e.display.scroller.clientHeight-Fn(e)-e.display.barHeight}function Uo(e,t,r){var i=e.options.lineWrapping,d=i&&hi(e);if(!t.measure.heights||i&&t.measure.width!=d){var D=t.measure.heights=[];if(i){t.measure.width=d;for(var G=t.text.firstChild.getClientRects(),Q=0;Q<G.length-1;Q++){var ee=G[Q],se=G[Q+1];Math.abs(ee.bottom-se.bottom)>2&&D.push((ee.bottom+se.top)/2-r.top)}}D.push(r.bottom-r.top)}}function es(e,t,r){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(var i=0;i<e.rest.length;i++)if(e.rest[i]==t)return{map:e.measure.maps[i],cache:e.measure.caches[i]};for(var d=0;d<e.rest.length;d++)if(pt(e.rest[d])>r)return{map:e.measure.maps[d],cache:e.measure.caches[d],before:!0}}function Bo(e,t){t=Tn(t);var r=pt(t),i=e.display.externalMeasured=new Mt(e.doc,t,r);i.lineN=r;var d=i.built=kt(e,i);return i.text=d.pre,E(e.display.lineMeasure,d.pre),i}function ts(e,t,r,i){return Un(e,Oi(e,t),r,i)}function fa(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[fi(e,t)];var r=e.display.externalMeasured;if(r&&t>=r.lineN&&t<r.lineN+r.size)return r}function Oi(e,t){var r=pt(t),i=fa(e,r);i&&!i.text?i=null:i&&i.changes&&(Ya(e,i,r,ba(e)),e.curOp.forceUpdate=!0),i||(i=Bo(e,t));var d=es(i,t,r);return{line:t,view:i,rect:null,map:d.map,cache:d.cache,before:d.before,hasHeights:!1}}function Un(e,t,r,i,d){t.before&&(r=-1);var D=r+(i||""),G;return t.cache.hasOwnProperty(D)?G=t.cache[D]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(Uo(e,t.view,t.rect),t.hasHeights=!0),G=Ho(e,t,r,i),G.bogus||(t.cache[D]=G)),{left:G.left,right:G.right,top:d?G.rtop:G.top,bottom:d?G.rbottom:G.bottom}}var ns={left:0,right:0,top:0,bottom:0};function is(e,t,r){for(var i,d,D,G,Q,ee,se=0;se<e.length;se+=3)if(Q=e[se],ee=e[se+1],t<Q?(d=0,D=1,G="left"):t<ee?(d=t-Q,D=d+1):(se==e.length-3||t==ee&&e[se+3]>t)&&(D=ee-Q,d=D-1,t>=ee&&(G="right")),d!=null){if(i=e[se+2],Q==ee&&r==(i.insertLeft?"left":"right")&&(G=r),r=="left"&&d==0)for(;se&&e[se-2]==e[se-3]&&e[se-1].insertLeft;)i=e[(se-=3)+2],G="left";if(r=="right"&&d==ee-Q)for(;se<e.length-3&&e[se+3]==e[se+4]&&!e[se+5].insertLeft;)i=e[(se+=3)+2],G="right";break}return{node:i,start:d,end:D,collapse:G,coverStart:Q,coverEnd:ee}}function jo(e,t){var r=ns;if(t=="left")for(var i=0;i<e.length&&!((r=e[i]).left!=r.right);i++);else for(var d=e.length-1;d>=0&&!((r=e[d]).left!=r.right);d--);return r}function Ho(e,t,r,i){var d=is(t.map,r,i),D=d.node,G=d.start,Q=d.end,ee=d.collapse,se;if(D.nodeType==3){for(var ge=0;ge<4;ge++){for(;G&&xe(t.line.text.charAt(d.coverStart+G));)--G;for(;d.coverStart+Q<d.coverEnd&&xe(t.line.text.charAt(d.coverStart+Q));)++Q;if(W&&H<9&&G==0&&Q==d.coverEnd-d.coverStart?se=D.parentNode.getBoundingClientRect():se=jo(v(D,G,Q).getClientRects(),i),se.left||se.right||G==0)break;Q=G,G=G-1,ee="right"}W&&H<11&&(se=Wo(e.display.measure,se))}else{G>0&&(ee=i="right");var _e;e.options.lineWrapping&&(_e=D.getClientRects()).length>1?se=_e[i=="right"?_e.length-1:0]:se=D.getBoundingClientRect()}if(W&&H<9&&!G&&(!se||!se.left&&!se.right)){var Oe=D.parentNode.getClientRects()[0];Oe?se={left:Oe.left,right:Oe.left+Ii(e.display),top:Oe.top,bottom:Oe.bottom}:se=ns}for(var Ae=se.top-t.rect.top,Fe=se.bottom-t.rect.top,We=(Ae+Fe)/2,Xe=t.view.measure.heights,qe=0;qe<Xe.length-1&&!(We<Xe[qe]);qe++);var at=qe?Xe[qe-1]:0,et=Xe[qe],st={left:(ee=="right"?se.right:se.left)-t.rect.left,right:(ee=="left"?se.left:se.right)-t.rect.left,top:at,bottom:et};return!se.left&&!se.right&&(st.bogus=!0),e.options.singleCursorHeightPerLine||(st.rtop=Ae,st.rbottom=Fe),st}function Wo(e,t){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!Rt(e))return t;var r=screen.logicalXDPI/screen.deviceXDPI,i=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*r,right:t.right*r,top:t.top*i,bottom:t.bottom*i}}function rs(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 as(e){e.display.externalMeasure=null,T(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)rs(e.display.view[t])}function ar(e){as(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function ss(){return g&&l?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function os(){return g&&l?-(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 r=0;r<e.widgets.length;++r)e.widgets[r].above&&(t+=rr(e.widgets[r]));return t}function Ur(e,t,r,i,d){if(!d){var D=pa(t);r.top+=D,r.bottom+=D}if(i=="line")return r;i||(i="local");var G=Dn(t);if(i=="local"?G+=Fr(e.display):G-=e.display.viewOffset,i=="page"||i=="window"){var Q=e.display.lineSpace.getBoundingClientRect();G+=Q.top+(i=="window"?0:os());var ee=Q.left+(i=="window"?0:ss());r.left+=ee,r.right+=ee}return r.top+=G,r.bottom+=G,r}function ls(e,t,r){if(r=="div")return t;var i=t.left,d=t.top;if(r=="page")i-=ss(),d-=os();else if(r=="local"||!r){var D=e.display.sizer.getBoundingClientRect();i+=D.left,d+=D.top}var G=e.display.lineSpace.getBoundingClientRect();return{left:i-G.left,top:d-G.top}}function ma(e,t,r,i,d){return i||(i=Ye(e.doc,t.line)),Ur(e,i,ts(e,i,t.ch,d),r)}function kn(e,t,r,i,d,D){i=i||Ye(e.doc,t.line),d||(d=Oi(e,i));function G(Fe,We){var Xe=Un(e,d,Fe,We?"right":"left",D);return We?Xe.left=Xe.right:Xe.right=Xe.left,Ur(e,i,Xe,r)}var Q=Ge(i,e.doc.direction),ee=t.ch,se=t.sticky;if(ee>=i.text.length?(ee=i.text.length,se="before"):ee<=0&&(ee=0,se="after"),!Q)return G(se=="before"?ee-1:ee,se=="before");function ge(Fe,We,Xe){var qe=Q[We],at=qe.level==1;return G(Xe?Fe-1:Fe,at!=Xe)}var _e=He(Q,ee,se),Oe=Ue,Ae=ge(ee,_e,se=="before");return Oe!=null&&(Ae.other=ge(ee,Oe,se!="before")),Ae}function us(e,t){var r=0;t=St(e.doc,t),e.options.lineWrapping||(r=Ii(e.display)*t.ch);var i=Ye(e.doc,t.line),d=Dn(i)+Fr(e.display);return{left:r,right:r,top:d,bottom:d+i.height}}function ga(e,t,r,i,d){var D=Ke(e,t,r);return D.xRel=d,i&&(D.outside=i),D}function va(e,t,r){var i=e.doc;if(r+=e.display.viewOffset,r<0)return ga(i.first,0,null,-1,-1);var d=ft(i,r),D=i.first+i.size-1;if(d>D)return ga(i.first+i.size-1,Ye(i,D).text.length,null,1,1);t<0&&(t=0);for(var G=Ye(i,d);;){var Q=Go(e,G,d,t,r),ee=Ai(G,Q.ch+(Q.xRel>0||Q.outside>0?1:0));if(!ee)return Q;var se=ee.find(1);if(se.line==d)return se;G=Ye(i,d=se.line)}}function hs(e,t,r,i){i-=pa(t);var d=t.text.length,D=Be(function(G){return Un(e,r,G-1).bottom<=i},d,0);return d=Be(function(G){return Un(e,r,G).top>i},D,d),{begin:D,end:d}}function ds(e,t,r,i){r||(r=Oi(e,t));var d=Ur(e,t,Un(e,r,i),"line").top;return hs(e,t,r,d)}function ya(e,t,r,i){return e.bottom<=r?!1:e.top>r?!0:(i?e.left:e.right)>t}function Go(e,t,r,i,d){d-=Dn(t);var D=Oi(e,t),G=pa(t),Q=0,ee=t.text.length,se=!0,ge=Ge(t,e.doc.direction);if(ge){var _e=(e.options.lineWrapping?zo:Ko)(e,t,r,D,ge,i,d);se=_e.level!=1,Q=se?_e.from:_e.to-1,ee=se?_e.to:_e.from-1}var Oe=null,Ae=null,Fe=Be(function(vt){var ct=Un(e,D,vt);return ct.top+=G,ct.bottom+=G,ya(ct,i,d,!1)?(ct.top<=d&&ct.left<=i&&(Oe=vt,Ae=ct),!0):!1},Q,ee),We,Xe,qe=!1;if(Ae){var at=i-Ae.left<Ae.right-i,et=at==se;Fe=Oe+(et?0:1),Xe=et?"after":"before",We=at?Ae.left:Ae.right}else{!se&&(Fe==ee||Fe==Q)&&Fe++,Xe=Fe==0?"after":Fe==t.text.length?"before":Un(e,D,Fe-(se?1:0)).bottom+G<=d==se?"after":"before";var st=kn(e,Ke(r,Fe,Xe),"line",t,D);We=st.left,qe=d<st.top?-1:d>=st.bottom?1:0}return Fe=Ce(t.text,Fe,1),ga(r,Fe,Xe,qe,i-We)}function Ko(e,t,r,i,d,D,G){var Q=Be(function(_e){var Oe=d[_e],Ae=Oe.level!=1;return ya(kn(e,Ke(r,Ae?Oe.to:Oe.from,Ae?"before":"after"),"line",t,i),D,G,!0)},0,d.length-1),ee=d[Q];if(Q>0){var se=ee.level!=1,ge=kn(e,Ke(r,se?ee.from:ee.to,se?"after":"before"),"line",t,i);ya(ge,D,G,!0)&&ge.top>G&&(ee=d[Q-1])}return ee}function zo(e,t,r,i,d,D,G){var Q=hs(e,t,i,G),ee=Q.begin,se=Q.end;/\s/.test(t.text.charAt(se-1))&&se--;for(var ge=null,_e=null,Oe=0;Oe<d.length;Oe++){var Ae=d[Oe];if(Ae.from>=se||Ae.to<=ee)continue;var Fe=Ae.level!=1,We=Un(e,i,Fe?Math.min(se,Ae.to)-1:Math.max(ee,Ae.from)).right,Xe=We<D?D-We+1e9:We-D;(!ge||_e>Xe)&&(ge=Ae,_e=Xe)}return ge||(ge=d[d.length-1]),ge.from<ee&&(ge={from:ee,to:ge.to,level:ge.level}),ge.to>se&&(ge={from:ge.from,to:se,level:ge.level}),ge}var di;function Li(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(di==null){di=c("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)di.appendChild(document.createTextNode("x")),di.appendChild(c("br"));di.appendChild(document.createTextNode("x"))}E(e.measure,di);var r=di.offsetHeight/50;return r>3&&(e.cachedTextHeight=r),T(e.measure),r||1}function Ii(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var t=c("span","xxxxxxxxxx"),r=c("pre",[t],"CodeMirror-line-like");E(e.measure,r);var i=t.getBoundingClientRect(),d=(i.right-i.left)/10;return d>2&&(e.cachedCharWidth=d),d||10}function ba(e){for(var t=e.display,r={},i={},d=t.gutters.clientLeft,D=t.gutters.firstChild,G=0;D;D=D.nextSibling,++G){var Q=e.display.gutterSpecs[G].className;r[Q]=D.offsetLeft+D.clientLeft+d,i[Q]=D.clientWidth}return{fixedPos:_a(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:r,gutterWidth:i,wrapperWidth:t.wrapper.clientWidth}}function _a(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function cs(e){var t=Li(e.display),r=e.options.lineWrapping,i=r&&Math.max(5,e.display.scroller.clientWidth/Ii(e.display)-3);return function(d){if(Nn(e.doc,d))return 0;var D=0;if(d.widgets)for(var G=0;G<d.widgets.length;G++)d.widgets[G].height&&(D+=d.widgets[G].height);return r?D+(Math.ceil(d.text.length/i)||1)*t:D+t}}function Ea(e){var t=e.doc,r=cs(e);t.iter(function(i){var d=r(i);d!=i.height&&rt(i,d)})}function ci(e,t,r,i){var d=e.display;if(!r&&be(t).getAttribute("cm-not-content")=="true")return null;var D,G,Q=d.lineSpace.getBoundingClientRect();try{D=t.clientX-Q.left,G=t.clientY-Q.top}catch(_e){return null}var ee=va(e,D,G),se;if(i&&ee.xRel>0&&(se=Ye(e.doc,ee.line).text).length==ee.ch){var ge=V(se,se.length,e.options.tabSize)-se.length;ee=Ke(ee.line,Math.max(0,Math.round((D-qa(e.display).left)/Ii(e.display))-ge))}return ee}function fi(e,t){if(t>=e.display.viewTo)return null;if(t-=e.display.viewFrom,t<0)return null;for(var r=e.display.view,i=0;i<r.length;i++)if(t-=r[i].size,t<0)return i}function gn(e,t,r,i){t==null&&(t=e.doc.first),r==null&&(r=e.doc.first+e.doc.size),i||(i=0);var d=e.display;if(i&&r<d.viewTo&&(d.updateLineNumbers==null||d.updateLineNumbers>t)&&(d.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=d.viewTo)dn&&qi(e.doc,t)<d.viewTo&&Jn(e);else if(r<=d.viewFrom)dn&&Yn(e.doc,r+i)>d.viewFrom?Jn(e):(d.viewFrom+=i,d.viewTo+=i);else if(t<=d.viewFrom&&r>=d.viewTo)Jn(e);else if(t<=d.viewFrom){var D=Br(e,r,r+i,1);D?(d.view=d.view.slice(D.index),d.viewFrom=D.lineN,d.viewTo+=i):Jn(e)}else if(r>=d.viewTo){var G=Br(e,t,t,-1);G?(d.view=d.view.slice(0,G.index),d.viewTo=G.lineN):Jn(e)}else{var Q=Br(e,t,t,-1),ee=Br(e,r,r+i,1);Q&&ee?(d.view=d.view.slice(0,Q.index).concat(mn(e,Q.lineN,ee.lineN)).concat(d.view.slice(ee.index)),d.viewTo+=i):Jn(e)}var se=d.externalMeasured;se&&(r<se.lineN?se.lineN+=i:t<se.lineN+se.size&&(d.externalMeasured=null))}function $n(e,t,r){e.curOp.viewChanged=!0;var i=e.display,d=e.display.externalMeasured;if(d&&t>=d.lineN&&t<d.lineN+d.size&&(i.externalMeasured=null),t<i.viewFrom||t>=i.viewTo)return;var D=i.view[fi(e,t)];if(D.node==null)return;var G=D.changes||(D.changes=[]);ce(G,r)==-1&&G.push(r)}function Jn(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function Br(e,t,r,i){var d=fi(e,t),D,G=e.display.view;if(!dn||r==e.doc.first+e.doc.size)return{index:d,lineN:r};for(var Q=e.display.viewFrom,ee=0;ee<d;ee++)Q+=G[ee].size;if(Q!=t){if(i>0){if(d==G.length-1)return null;D=Q+G[d].size-t,d++}else D=Q-t;t+=D,r+=D}for(;qi(e.doc,r)!=r;){if(d==(i<0?0:G.length-1))return null;r+=i*G[d-(i<0?1:0)].size,d+=i}return{index:d,lineN:r}}function Vo(e,t,r){var i=e.display,d=i.view;d.length==0||t>=i.viewTo||r<=i.viewFrom?(i.view=mn(e,t,r),i.viewFrom=t):(i.viewFrom>t?i.view=mn(e,t,i.viewFrom).concat(i.view):i.viewFrom<t&&(i.view=i.view.slice(fi(e,t))),i.viewFrom=t,i.viewTo<r?i.view=i.view.concat(mn(e,i.viewTo,r)):i.viewTo>r&&(i.view=i.view.slice(0,fi(e,r)))),i.viewTo=r}function fs(e){for(var t=e.display.view,r=0,i=0;i<t.length;i++){var d=t[i];!d.hidden&&(!d.node||d.changes)&&++r}return r}function sr(e){e.display.input.showSelection(e.display.input.prepareSelection())}function ps(e,t){t===void 0&&(t=!0);for(var r=e.doc,i={},d=i.cursors=document.createDocumentFragment(),D=i.selection=document.createDocumentFragment(),G=0;G<r.sel.ranges.length;G++){if(!t&&G==r.sel.primIndex)continue;var Q=r.sel.ranges[G];if(Q.from().line>=e.display.viewTo||Q.to().line<e.display.viewFrom)continue;var ee=Q.empty();(ee||e.options.showCursorWhenSelecting)&&ms(e,Q.head,d),ee||Xo(e,Q,D)}return i}function ms(e,t,r){var i=kn(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),d=r.appendChild(c("div","\xA0","CodeMirror-cursor"));if(d.style.left=i.left+"px",d.style.top=i.top+"px",d.style.height=Math.max(0,i.bottom-i.top)*e.options.cursorHeight+"px",i.other){var D=r.appendChild(c("div","\xA0","CodeMirror-cursor CodeMirror-secondarycursor"));D.style.display="",D.style.left=i.other.left+"px",D.style.top=i.other.top+"px",D.style.height=(i.other.bottom-i.other.top)*.85+"px"}}function jr(e,t){return e.top-t.top||e.left-t.left}function Xo(e,t,r){var i=e.display,d=e.doc,D=document.createDocumentFragment(),G=qa(e.display),Q=G.left,ee=Math.max(i.sizerWidth,hi(e)-i.sizer.offsetLeft)-G.right,se=d.direction=="ltr";function ge(et,st,vt,ct){st<0&&(st=0),st=Math.round(st),ct=Math.round(ct),D.appendChild(c("div",null,"CodeMirror-selected","position: absolute; left: "+et+`px;
top: `+st+"px; width: "+(vt==null?ee-et:vt)+`px;
height: `+(ct-st)+"px"))}function _e(et,st,vt){var ct=Ye(d,et),Ot=ct.text.length,Ut,nn;function Kt($t,bn){return ma(e,Ke(et,$t),"div",ct,bn)}function xn($t,bn,on){var qt=ds(e,ct,null,$t),Jt=bn=="ltr"==(on=="after")?"left":"right",Xt=on=="after"?qt.begin:qt.end-(/\s/.test(ct.text.charAt(qt.end-1))?2:1);return Kt(Xt,Jt)[Jt]}var yn=Ge(ct,d.direction);return Ne(yn,st||0,vt==null?Ot:vt,function($t,bn,on,qt){var Jt=on=="ltr",Xt=Kt($t,Jt?"left":"right"),_n=Kt(bn-1,Jt?"right":"left"),Ki=st==null&&$t==0,ni=vt==null&&bn==Ot,hn=qt==0,Bn=!yn||qt==yn.length-1;if(_n.top-Xt.top<=3){var rn=(se?Ki:ni)&&hn,Va=(se?ni:Ki)&&Bn,Vn=rn?Q:(Jt?Xt:_n).left,yi=Va?ee:(Jt?_n:Xt).right;ge(Vn,Xt.top,yi-Vn,Xt.bottom)}else{var bi,fn,zi,Xa;Jt?(bi=se&&Ki&&hn?Q:Xt.left,fn=se?ee:xn($t,on,"before"),zi=se?Q:xn(bn,on,"after"),Xa=se&&ni&&Bn?ee:_n.right):(bi=se?xn($t,on,"before"):Q,fn=!se&&Ki&&hn?ee:Xt.right,zi=!se&&ni&&Bn?Q:_n.left,Xa=se?xn(bn,on,"after"):ee),ge(bi,Xt.top,fn-bi,Xt.bottom),Xt.bottom<_n.top&&ge(Q,Xt.bottom,null,_n.top),ge(zi,_n.top,Xa-zi,_n.bottom)}(!Ut||jr(Xt,Ut)<0)&&(Ut=Xt),jr(_n,Ut)<0&&(Ut=_n),(!nn||jr(Xt,nn)<0)&&(nn=Xt),jr(_n,nn)<0&&(nn=_n)}),{start:Ut,end:nn}}var Oe=t.from(),Ae=t.to();if(Oe.line==Ae.line)_e(Oe.line,Oe.ch,Ae.ch);else{var Fe=Ye(d,Oe.line),We=Ye(d,Ae.line),Xe=Tn(Fe)==Tn(We),qe=_e(Oe.line,Oe.ch,Xe?Fe.text.length+1:null).end,at=_e(Ae.line,Xe?0:null,Ae.ch).start;Xe&&(qe.top<at.top-2?(ge(qe.right,qe.top,null,qe.bottom),ge(Q,at.top,at.left,at.bottom)):ge(qe.right,qe.top,at.left-qe.right,qe.bottom)),qe.bottom<at.top&&ge(Q,qe.bottom,null,at.top)}r.appendChild(D)}function xa(e){if(!e.state.focused)return;var t=e.display;clearInterval(t.blinker);var r=!0;t.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?t.blinker=setInterval(function(){e.hasFocus()||Di(e),t.cursorDiv.style.visibility=(r=!r)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}function gs(e){e.state.focused||(e.display.input.focus(),Ta(e))}function vs(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,Di(e))},100)}function Ta(e,t){if(e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),e.options.readOnly=="nocursor")return;e.state.focused||(le(e,"focus",e,t),e.state.focused=!0,B(e.display.wrapper,"CodeMirror-focused"),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(e.display.input.reset(),n&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),xa(e)}function Di(e,t){if(e.state.delayingBlurEvent)return;e.state.focused&&(le(e,"blur",e,t),e.state.focused=!1,S(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150)}function Hr(e){for(var t=e.display,r=t.lineDiv.offsetTop,i=0;i<t.view.length;i++){var d=t.view[i],D=e.options.lineWrapping,G=void 0,Q=0;if(d.hidden)continue;if(W&&H<8){var ee=d.node.offsetTop+d.node.offsetHeight;G=ee-r,r=ee}else{var se=d.node.getBoundingClientRect();G=se.bottom-se.top,!D&&d.text.firstChild&&(Q=d.text.firstChild.getBoundingClientRect().right-se.left-1)}var ge=d.line.height-G;if((ge>.005||ge<-.005)&&(rt(d.line,G),ys(d.line),d.rest))for(var _e=0;_e<d.rest.length;_e++)ys(d.rest[_e]);if(Q>e.display.sizerWidth){var Oe=Math.ceil(Q/Ii(e.display));Oe>e.display.maxLineLength&&(e.display.maxLineLength=Oe,e.display.maxLine=d.line,e.display.maxLineChanged=!0)}}}function ys(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t){var r=e.widgets[t],i=r.node.parentNode;i&&(r.height=i.offsetHeight)}}function Wr(e,t,r){var i=r&&r.top!=null?Math.max(0,r.top):e.scroller.scrollTop;i=Math.floor(i-Fr(e));var d=r&&r.bottom!=null?r.bottom:i+e.wrapper.clientHeight,D=ft(t,i),G=ft(t,d);if(r&&r.ensure){var Q=r.ensure.from.line,ee=r.ensure.to.line;Q<D?(D=Q,G=ft(t,Dn(Ye(t,Q))+e.wrapper.clientHeight)):Math.min(ee,t.lastLine())>=G&&(D=ft(t,Dn(Ye(t,ee))-e.wrapper.clientHeight),G=ee)}return{from:D,to:Math.max(G,D+1)}}function Yo(e,t){if(Z(e,"scrollCursorIntoView"))return;var r=e.display,i=r.sizer.getBoundingClientRect(),d=null;if(t.top+i.top<0?d=!0:t.bottom+i.top>(window.innerHeight||document.documentElement.clientHeight)&&(d=!1),d!=null&&!o){var D=c("div","\u200B",null,`position: absolute;
top: `+(t.top-r.viewOffset-Fr(e.display))+`px;
height: `+(t.bottom-t.top+Fn(e)+r.barHeight)+`px;
left: `+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(D),D.scrollIntoView(d),e.display.lineSpace.removeChild(D)}}function $o(e,t,r,i){i==null&&(i=0);var d;!e.options.lineWrapping&&t==r&&(t=t.ch?Ke(t.line,t.sticky=="before"?t.ch-1:t.ch,"after"):t,r=t.sticky=="before"?Ke(t.line,t.ch+1,"before"):t);for(var D=0;D<5;D++){var G=!1,Q=kn(e,t),ee=!r||r==t?Q:kn(e,r);d={left:Math.min(Q.left,ee.left),top:Math.min(Q.top,ee.top)-i,right:Math.max(Q.left,ee.left),bottom:Math.max(Q.bottom,ee.bottom)+i};var se=wa(e,d),ge=e.doc.scrollTop,_e=e.doc.scrollLeft;if(se.scrollTop!=null&&(lr(e,se.scrollTop),Math.abs(e.doc.scrollTop-ge)>1&&(G=!0)),se.scrollLeft!=null&&(pi(e,se.scrollLeft),Math.abs(e.doc.scrollLeft-_e)>1&&(G=!0)),!G)break}return d}function Jo(e,t){var r=wa(e,t);r.scrollTop!=null&&lr(e,r.scrollTop),r.scrollLeft!=null&&pi(e,r.scrollLeft)}function wa(e,t){var r=e.display,i=Li(e.display);t.top<0&&(t.top=0);var d=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:r.scroller.scrollTop,D=ca(e),G={};t.bottom-t.top>D&&(t.bottom=t.top+D);var Q=e.doc.height+da(r),ee=t.top<i,se=t.bottom>Q-i;if(t.top<d)G.scrollTop=ee?0:t.top;else if(t.bottom>d+D){var ge=Math.min(t.top,(se?Q:t.bottom)-D);ge!=d&&(G.scrollTop=ge)}var _e=e.options.fixedGutter?0:r.gutters.offsetWidth,Oe=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:r.scroller.scrollLeft-_e,Ae=hi(e)-r.gutters.offsetWidth,Fe=t.right-t.left>Ae;return Fe&&(t.right=t.left+Ae),t.left<10?G.scrollLeft=0:t.left<Oe?G.scrollLeft=Math.max(0,t.left+_e-(Fe?0:10)):t.right>Ae+Oe-3&&(G.scrollLeft=t.right+(Fe?0:10)-Ae),G}function Sa(e,t){if(t==null)return;Gr(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+t}function ki(e){Gr(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function or(e,t,r){(t!=null||r!=null)&&Gr(e),t!=null&&(e.curOp.scrollLeft=t),r!=null&&(e.curOp.scrollTop=r)}function Qo(e,t){Gr(e),e.curOp.scrollToPos=t}function Gr(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var r=us(e,t.from),i=us(e,t.to);bs(e,r,i,t.margin)}}function bs(e,t,r,i){var d=wa(e,{left:Math.min(t.left,r.left),top:Math.min(t.top,r.top)-i,right:Math.max(t.right,r.right),bottom:Math.max(t.bottom,r.bottom)+i});or(e,d.scrollLeft,d.scrollTop)}function lr(e,t){if(Math.abs(e.doc.scrollTop-t)<2)return;k||Aa(e,{top:t}),_s(e,t,!0),k&&Aa(e),dr(e,100)}function _s(e,t,r){if(t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),e.display.scroller.scrollTop==t&&!r)return;e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t)}function pi(e,t,r,i){if(t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),(r?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!i)return;e.doc.scrollLeft=t,Ss(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t)}function ur(e){var t=e.display,r=t.gutters.offsetWidth,i=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?r:0,docHeight:i,scrollHeight:i+Fn(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:r}}var mi=function(e,t,r){this.cm=r;var i=this.vert=c("div",[c("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),d=this.horiz=c("div",[c("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");i.tabIndex=d.tabIndex=-1,e(i),e(d),ke(i,"scroll",function(){i.clientHeight&&t(i.scrollTop,"vertical")}),ke(d,"scroll",function(){d.clientWidth&&t(d.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,W&&H<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};mi.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,r=e.scrollHeight>e.clientHeight+1,i=e.nativeBarWidth;if(r){this.vert.style.display="block",this.vert.style.bottom=t?i+"px":"0";var d=e.viewHeight-(t?i:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+d)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=r?i+"px":"0",this.horiz.style.left=e.barLeft+"px";var D=e.viewWidth-e.barLeft-(r?i:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+D)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(i==0&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:r?i:0,bottom:t?i:0}},mi.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},mi.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},mi.prototype.zeroWidthHack=function(){var e=a&&!h?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new re,this.disableVert=new re},mi.prototype.enableZeroWidthBar=function(e,t,r){e.style.pointerEvents="auto";function i(){var d=e.getBoundingClientRect(),D=r=="vert"?document.elementFromPoint(d.right-1,(d.top+d.bottom)/2):document.elementFromPoint((d.right+d.left)/2,d.bottom-1);D!=e?e.style.pointerEvents="none":t.set(1e3,i)}t.set(1e3,i)},mi.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var hr=function(){};hr.prototype.update=function(){return{bottom:0,right:0}},hr.prototype.setScrollLeft=function(){},hr.prototype.setScrollTop=function(){},hr.prototype.clear=function(){};function Mi(e,t){t||(t=ur(e));var r=e.display.barWidth,i=e.display.barHeight;Es(e,t);for(var d=0;d<4&&r!=e.display.barWidth||i!=e.display.barHeight;d++)r!=e.display.barWidth&&e.options.lineWrapping&&Hr(e),Es(e,ur(e)),r=e.display.barWidth,i=e.display.barHeight}function Es(e,t){var r=e.display,i=r.scrollbars.update(t);r.sizer.style.paddingRight=(r.barWidth=i.right)+"px",r.sizer.style.paddingBottom=(r.barHeight=i.bottom)+"px",r.heightForcer.style.borderBottom=i.bottom+"px solid transparent",i.right&&i.bottom?(r.scrollbarFiller.style.display="block",r.scrollbarFiller.style.height=i.bottom+"px",r.scrollbarFiller.style.width=i.right+"px"):r.scrollbarFiller.style.display="",i.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(r.gutterFiller.style.display="block",r.gutterFiller.style.height=i.bottom+"px",r.gutterFiller.style.width=t.gutterWidth+"px"):r.gutterFiller.style.display=""}var xs={native:mi,null:hr};function Ts(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&S(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new xs[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),ke(t,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),t.setAttribute("cm-not-content","true")},function(t,r){r=="horizontal"?pi(e,t):lr(e,t)},e),e.display.scrollbars.addClass&&B(e.display.wrapper,e.display.scrollbars.addClass)}var Zo=0;function gi(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:++Zo},An(e.curOp)}function vi(e){var t=e.curOp;t&&Io(t,function(r){for(var i=0;i<r.ops.length;i++)r.ops[i].cm.curOp=null;qo(r)})}function qo(e){for(var t=e.ops,r=0;r<t.length;r++)el(t[r]);for(var i=0;i<t.length;i++)tl(t[i]);for(var d=0;d<t.length;d++)nl(t[d]);for(var D=0;D<t.length;D++)il(t[D]);for(var G=0;G<t.length;G++)rl(t[G])}function el(e){var t=e.cm,r=t.display;sl(t),e.updateMaxLine&&Nr(t),e.mustUpdate=e.viewChanged||e.forceUpdate||e.scrollTop!=null||e.scrollToPos&&(e.scrollToPos.from.line<r.viewFrom||e.scrollToPos.to.line>=r.viewTo)||r.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new Kr(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function tl(e){e.updatedDisplay=e.mustUpdate&&Ca(e.cm,e.update)}function nl(e){var t=e.cm,r=t.display;e.updatedDisplay&&Hr(t),e.barMeasure=ur(t),r.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=ts(t,r.maxLine,r.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(r.scroller.clientWidth,r.sizer.offsetLeft+e.adjustWidthTo+Fn(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,r.sizer.offsetLeft+e.adjustWidthTo-hi(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=r.input.prepareSelection())}function il(e){var t=e.cm;e.adjustWidthTo!=null&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&pi(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var r=e.focus&&e.focus==F();e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,r),(e.updatedDisplay||e.startHeight!=t.doc.height)&&Mi(t,e.barMeasure),e.updatedDisplay&&Oa(t,e.barMeasure),e.selectionChanged&&xa(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),r&&gs(e.cm)}function rl(e){var t=e.cm,r=t.display,i=t.doc;if(e.updatedDisplay&&ws(t,e.update),r.wheelStartX!=null&&(e.scrollTop!=null||e.scrollLeft!=null||e.scrollToPos)&&(r.wheelStartX=r.wheelStartY=null),e.scrollTop!=null&&_s(t,e.scrollTop,e.forceScroll),e.scrollLeft!=null&&pi(t,e.scrollLeft,!0,!0),e.scrollToPos){var d=$o(t,St(i,e.scrollToPos.from),St(i,e.scrollToPos.to),e.scrollToPos.margin);Yo(t,d)}var D=e.maybeHiddenMarkers,G=e.maybeUnhiddenMarkers;if(D)for(var Q=0;Q<D.length;++Q)D[Q].lines.length||le(D[Q],"hide");if(G)for(var ee=0;ee<G.length;++ee)G[ee].lines.length&&le(G[ee],"unhide");r.wrapper.offsetHeight&&(i.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&le(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function En(e,t){if(e.curOp)return t();gi(e);try{return t()}finally{vi(e)}}function en(e,t){return function(){if(e.curOp)return t.apply(e,arguments);gi(e);try{return t.apply(e,arguments)}finally{vi(e)}}}function cn(e){return function(){if(this.curOp)return e.apply(this,arguments);gi(this);try{return e.apply(this,arguments)}finally{vi(this)}}}function tn(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);gi(t);try{return e.apply(this,arguments)}finally{vi(t)}}}function dr(e,t){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(t,P(al,e))}function al(e){var t=e.doc;if(t.highlightFrontier>=e.display.viewTo)return;var r=+new Date+e.options.workTime,i=Rn(e,t.highlightFrontier),d=[];t.iter(i.line,Math.min(t.first+t.size,e.display.viewTo+500),function(D){if(i.line>=e.display.viewFrom){var G=D.styles,Q=D.text.length>e.options.maxHighlightLength?At(t.mode,i.state):null,ee=Vi(e,D,i,!0);Q&&(i.state=Q),D.styles=ee.styles;var se=D.styleClasses,ge=ee.classes;ge?D.styleClasses=ge:se&&(D.styleClasses=null);for(var _e=!G||G.length!=D.styles.length||se!=ge&&(!se||!ge||se.bgClass!=ge.bgClass||se.textClass!=ge.textClass),Oe=0;!_e&&Oe<G.length;++Oe)_e=G[Oe]!=D.styles[Oe];_e&&d.push(i.line),D.stateAfter=i.save(),i.nextLine()}else D.text.length<=e.options.maxHighlightLength&&Xi(e,D.text,i),D.stateAfter=i.line%5==0?i.save():null,i.nextLine();if(+new Date>r)return dr(e,e.options.workDelay),!0}),t.highlightFrontier=i.line,t.modeFrontier=Math.max(t.modeFrontier,i.line),d.length&&En(e,function(){for(var D=0;D<d.length;D++)$n(e,d[D],"text")})}var Kr=function(e,t,r){var i=e.display;this.viewport=t,this.visible=Wr(i,e.doc,t),this.editorIsHidden=!i.wrapper.offsetWidth,this.wrapperHeight=i.wrapper.clientHeight,this.wrapperWidth=i.wrapper.clientWidth,this.oldDisplayWidth=hi(e),this.force=r,this.dims=ba(e),this.events=[]};Kr.prototype.signal=function(e,t){ae(e,t)&&this.events.push(arguments)},Kr.prototype.finish=function(){for(var e=0;e<this.events.length;e++)le.apply(null,this.events[e])};function sl(e){var t=e.display;!t.scrollbarsClipped&&t.scroller.offsetWidth&&(t.nativeBarWidth=t.scroller.offsetWidth-t.scroller.clientWidth,t.heightForcer.style.height=Fn(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=Fn(e)+"px",t.scrollbarsClipped=!0)}function ol(e){if(e.hasFocus())return null;var t=F();if(!t||!y(e.display.lineDiv,t))return null;var r={activeElt:t};if(window.getSelection){var i=window.getSelection();i.anchorNode&&i.extend&&y(e.display.lineDiv,i.anchorNode)&&(r.anchorNode=i.anchorNode,r.anchorOffset=i.anchorOffset,r.focusNode=i.focusNode,r.focusOffset=i.focusOffset)}return r}function ll(e){if(!e||!e.activeElt||e.activeElt==F())return;if(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&y(document.body,e.anchorNode)&&y(document.body,e.focusNode)){var t=window.getSelection(),r=document.createRange();r.setEnd(e.anchorNode,e.anchorOffset),r.collapse(!1),t.removeAllRanges(),t.addRange(r),t.extend(e.focusNode,e.focusOffset)}}function Ca(e,t){var r=e.display,i=e.doc;if(t.editorIsHidden)return Jn(e),!1;if(!t.force&&t.visible.from>=r.viewFrom&&t.visible.to<=r.viewTo&&(r.updateLineNumbers==null||r.updateLineNumbers>=r.viewTo)&&r.renderedView==r.view&&fs(e)==0)return!1;Cs(e)&&(Jn(e),t.dims=ba(e));var d=i.first+i.size,D=Math.max(t.visible.from-e.options.viewportMargin,i.first),G=Math.min(d,t.visible.to+e.options.viewportMargin);r.viewFrom<D&&D-r.viewFrom<20&&(D=Math.max(i.first,r.viewFrom)),r.viewTo>G&&r.viewTo-G<20&&(G=Math.min(d,r.viewTo)),dn&&(D=qi(e.doc,D),G=Yn(e.doc,G));var Q=D!=r.viewFrom||G!=r.viewTo||r.lastWrapHeight!=t.wrapperHeight||r.lastWrapWidth!=t.wrapperWidth;Vo(e,D,G),r.viewOffset=Dn(Ye(e.doc,r.viewFrom)),e.display.mover.style.top=r.viewOffset+"px";var ee=fs(e);if(!Q&&ee==0&&!t.force&&r.renderedView==r.view&&(r.updateLineNumbers==null||r.updateLineNumbers>=r.viewTo))return!1;var se=ol(e);return ee>4&&(r.lineDiv.style.display="none"),ul(e,r.updateLineNumbers,t.dims),ee>4&&(r.lineDiv.style.display=""),r.renderedView=r.view,ll(se),T(r.cursorDiv),T(r.selectionDiv),r.gutters.style.height=r.sizer.style.minHeight=0,Q&&(r.lastWrapHeight=t.wrapperHeight,r.lastWrapWidth=t.wrapperWidth,dr(e,400)),r.updateLineNumbers=null,!0}function ws(e,t){for(var r=t.viewport,i=!0;;i=!1){if(!i||!e.options.lineWrapping||t.oldDisplayWidth==hi(e)){if(r&&r.top!=null&&(r={top:Math.min(e.doc.height+da(e.display)-ca(e),r.top)}),t.visible=Wr(e.display,e.doc,r),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break}else i&&(t.visible=Wr(e.display,e.doc,r));if(!Ca(e,t))break;Hr(e);var d=ur(e);sr(e),Mi(e,d),Oa(e,d),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 r=new Kr(e,t);if(Ca(e,r)){Hr(e),ws(e,r);var i=ur(e);sr(e),Mi(e,i),Oa(e,i),r.finish()}}function ul(e,t,r){var i=e.display,d=e.options.lineNumbers,D=i.lineDiv,G=D.firstChild;function Q(Fe){var We=Fe.nextSibling;return n&&a&&e.display.currentWheelTarget==Fe?Fe.style.display="none":Fe.parentNode.removeChild(Fe),We}for(var ee=i.view,se=i.viewFrom,ge=0;ge<ee.length;ge++){var _e=ee[ge];if(!_e.hidden)if(!_e.node||_e.node.parentNode!=D){var Oe=No(e,_e,se,r);D.insertBefore(Oe,G)}else{for(;G!=_e.node;)G=Q(G);var Ae=d&&t!=null&&t<=se&&_e.lineNumber;_e.changes&&(ce(_e.changes,"gutter")>-1&&(Ae=!1),Ya(e,_e,se,r)),Ae&&(T(_e.lineNumber),_e.lineNumber.appendChild(document.createTextNode(Ht(e.options,se)))),G=_e.node.nextSibling}se+=_e.size}for(;G;)G=Q(G)}function Ra(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px"}function Oa(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+Fn(e)+"px"}function Ss(e){var t=e.display,r=t.view;if(!t.alignWidgets&&(!t.gutters.firstChild||!e.options.fixedGutter))return;for(var i=_a(t)-t.scroller.scrollLeft+e.doc.scrollLeft,d=t.gutters.offsetWidth,D=i+"px",G=0;G<r.length;G++)if(!r[G].hidden){e.options.fixedGutter&&(r[G].gutter&&(r[G].gutter.style.left=D),r[G].gutterBackground&&(r[G].gutterBackground.style.left=D));var Q=r[G].alignable;if(Q)for(var ee=0;ee<Q.length;ee++)Q[ee].style.left=D}e.options.fixedGutter&&(t.gutters.style.left=i+d+"px")}function Cs(e){if(!e.options.lineNumbers)return!1;var t=e.doc,r=Ht(e.options,t.first+t.size-1),i=e.display;if(r.length!=i.lineNumChars){var d=i.measure.appendChild(c("div",[c("div",r)],"CodeMirror-linenumber CodeMirror-gutter-elt")),D=d.firstChild.offsetWidth,G=d.offsetWidth-D;return i.lineGutter.style.width="",i.lineNumInnerWidth=Math.max(D,i.lineGutter.offsetWidth-G)+1,i.lineNumWidth=i.lineNumInnerWidth+G,i.lineNumChars=i.lineNumInnerWidth?r.length:-1,i.lineGutter.style.width=i.lineNumWidth+"px",Ra(e.display),!0}return!1}function La(e,t){for(var r=[],i=!1,d=0;d<e.length;d++){var D=e[d],G=null;if(typeof D!="string"&&(G=D.style,D=D.className),D=="CodeMirror-linenumbers")if(t)i=!0;else continue;r.push({className:D,style:G})}return t&&!i&&r.push({className:"CodeMirror-linenumbers",style:null}),r}function As(e){var t=e.gutters,r=e.gutterSpecs;T(t),e.lineGutter=null;for(var i=0;i<r.length;++i){var d=r[i],D=d.className,G=d.style,Q=t.appendChild(c("div",null,"CodeMirror-gutter "+D));G&&(Q.style.cssText=G),D=="CodeMirror-linenumbers"&&(e.lineGutter=Q,Q.style.width=(e.lineNumWidth||1)+"px")}t.style.display=r.length?"":"none",Ra(e)}function cr(e){As(e.display),gn(e),Ss(e)}function hl(e,t,r,i){var d=this;this.input=r,d.scrollbarFiller=c("div",null,"CodeMirror-scrollbar-filler"),d.scrollbarFiller.setAttribute("cm-not-content","true"),d.gutterFiller=c("div",null,"CodeMirror-gutter-filler"),d.gutterFiller.setAttribute("cm-not-content","true"),d.lineDiv=x("div",null,"CodeMirror-code"),d.selectionDiv=c("div",null,null,"position: relative; z-index: 1"),d.cursorDiv=c("div",null,"CodeMirror-cursors"),d.measure=c("div",null,"CodeMirror-measure"),d.lineMeasure=c("div",null,"CodeMirror-measure"),d.lineSpace=x("div",[d.measure,d.lineMeasure,d.selectionDiv,d.cursorDiv,d.lineDiv],null,"position: relative; outline: none");var D=x("div",[d.lineSpace],"CodeMirror-lines");d.mover=c("div",[D],null,"position: relative"),d.sizer=c("div",[d.mover],"CodeMirror-sizer"),d.sizerWidth=null,d.heightForcer=c("div",null,null,"position: absolute; height: "+me+"px; width: 1px;"),d.gutters=c("div",null,"CodeMirror-gutters"),d.lineGutter=null,d.scroller=c("div",[d.sizer,d.heightForcer,d.gutters],"CodeMirror-scroll"),d.scroller.setAttribute("tabIndex","-1"),d.wrapper=c("div",[d.scrollbarFiller,d.gutterFiller,d.scroller],"CodeMirror"),W&&H<8&&(d.gutters.style.zIndex=-1,d.scroller.style.paddingRight=0),!n&&!(k&&u)&&(d.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(d.wrapper):e(d.wrapper)),d.viewFrom=d.viewTo=t.first,d.reportedViewFrom=d.reportedViewTo=t.first,d.view=[],d.renderedView=null,d.externalMeasured=null,d.viewOffset=0,d.lastWrapHeight=d.lastWrapWidth=0,d.updateLineNumbers=null,d.nativeBarWidth=d.barHeight=d.barWidth=0,d.scrollbarsClipped=!1,d.lineNumWidth=d.lineNumInnerWidth=d.lineNumChars=null,d.alignWidgets=!1,d.cachedCharWidth=d.cachedTextHeight=d.cachedPaddingH=null,d.maxLine=null,d.maxLineLength=0,d.maxLineChanged=!1,d.wheelDX=d.wheelDY=d.wheelStartX=d.wheelStartY=null,d.shift=!1,d.selForContextMenu=null,d.activeTouch=null,d.gutterSpecs=La(i.gutters,i.lineNumbers),As(d),r.init(d)}var zr=0,wn=null;W?wn=-.53:k?wn=15:g?wn=-.7:m&&(wn=-1/3);function Rs(e){var t=e.wheelDeltaX,r=e.wheelDeltaY;return t==null&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),r==null&&e.detail&&e.axis==e.VERTICAL_AXIS?r=e.detail:r==null&&(r=e.wheelDelta),{x:t,y:r}}function dl(e){var t=Rs(e);return t.x*=wn,t.y*=wn,t}function Os(e,t){var r=Rs(t),i=r.x,d=r.y,D=e.display,G=D.scroller,Q=G.scrollWidth>G.clientWidth,ee=G.scrollHeight>G.clientHeight;if(!(i&&Q||d&&ee))return;if(d&&a&&n){e:for(var se=t.target,ge=D.view;se!=G;se=se.parentNode)for(var _e=0;_e<ge.length;_e++)if(ge[_e].node==se){e.display.currentWheelTarget=se;break e}}if(i&&!k&&!f&&wn!=null){d&&ee&&lr(e,Math.max(0,G.scrollTop+d*wn)),pi(e,Math.max(0,G.scrollLeft+i*wn)),(!d||d&&ee)&&ne(t),D.wheelStartX=null;return}if(d&&wn!=null){var Oe=d*wn,Ae=e.doc.scrollTop,Fe=Ae+D.wrapper.clientHeight;Oe<0?Ae=Math.max(0,Ae+Oe-50):Fe=Math.min(e.doc.height,Fe+Oe+50),Aa(e,{top:Ae,bottom:Fe})}zr<20&&(D.wheelStartX==null?(D.wheelStartX=G.scrollLeft,D.wheelStartY=G.scrollTop,D.wheelDX=i,D.wheelDY=d,setTimeout(function(){if(D.wheelStartX==null)return;var We=G.scrollLeft-D.wheelStartX,Xe=G.scrollTop-D.wheelStartY,qe=Xe&&D.wheelDY&&Xe/D.wheelDY||We&&D.wheelDX&&We/D.wheelDX;if(D.wheelStartX=D.wheelStartY=null,!qe)return;wn=(wn*zr+qe)/(zr+1),++zr},200)):(D.wheelDX+=i,D.wheelDY+=d))}var Sn=function(e,t){this.ranges=e,this.primIndex=t};Sn.prototype.primary=function(){return this.ranges[this.primIndex]},Sn.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 r=this.ranges[t],i=e.ranges[t];if(!ii(r.anchor,i.anchor)||!ii(r.head,i.head))return!1}return!0},Sn.prototype.deepCopy=function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new Pt(_i(this.ranges[t].anchor),_i(this.ranges[t].head));return new Sn(e,this.primIndex)},Sn.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},Sn.prototype.contains=function(e,t){t||(t=e);for(var r=0;r<this.ranges.length;r++){var i=this.ranges[r];if(_t(t,i.from())>=0&&_t(e,i.to())<=0)return r}return-1};var Pt=function(e,t){this.anchor=e,this.head=t};Pt.prototype.from=function(){return ri(this.anchor,this.head)},Pt.prototype.to=function(){return Ei(this.anchor,this.head)},Pt.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function Mn(e,t,r){var i=e&&e.options.selectionsMayTouch,d=t[r];t.sort(function(Oe,Ae){return _t(Oe.from(),Ae.from())}),r=ce(t,d);for(var D=1;D<t.length;D++){var G=t[D],Q=t[D-1],ee=_t(Q.to(),G.from());if(i&&!G.empty()?ee>0:ee>=0){var se=ri(Q.from(),G.from()),ge=Ei(Q.to(),G.to()),_e=Q.empty()?G.from()==G.head:Q.from()==Q.head;D<=r&&--r,t.splice(--D,2,new Pt(_e?ge:se,_e?se:ge))}}return new Sn(t,r)}function Qn(e,t){return new Sn([new Pt(e,t||e)],0)}function Zn(e){return e.text?Ke(e.from.line+e.text.length-1,M(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function Ls(e,t){if(_t(e,t.from)<0)return e;if(_t(e,t.to)<=0)return Zn(t);var r=e.line+t.text.length-(t.to.line-t.from.line)-1,i=e.ch;return e.line==t.to.line&&(i+=Zn(t).ch-t.to.ch),Ke(r,i)}function Ia(e,t){for(var r=[],i=0;i<e.sel.ranges.length;i++){var d=e.sel.ranges[i];r.push(new Pt(Ls(d.anchor,t),Ls(d.head,t)))}return Mn(e.cm,r,e.sel.primIndex)}function Is(e,t,r){return e.line==t.line?Ke(r.line,e.ch-t.ch+r.ch):Ke(r.line+(e.line-t.line),e.ch)}function cl(e,t,r){for(var i=[],d=Ke(e.first,0),D=d,G=0;G<t.length;G++){var Q=t[G],ee=Is(Q.from,d,D),se=Is(Zn(Q),d,D);if(d=Q.to,D=se,r=="around"){var ge=e.sel.ranges[G],_e=_t(ge.head,ge.anchor)<0;i[G]=new Pt(_e?se:ee,_e?ee:se)}else i[G]=new Pt(ee,ee)}return new Sn(i,e.sel.primIndex)}function Da(e){e.doc.mode=jt(e.options,e.doc.modeOption),fr(e)}function fr(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,dr(e,100),e.state.modeGen++,e.curOp&&gn(e)}function Ds(e,t){return t.from.ch==0&&t.to.ch==0&&M(t.text)==""&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function ka(e,t,r,i){function d(at){return r?r[at]:null}function D(at,et,st){ua(at,et,st,i),sn(at,"change",at,t)}function G(at,et){for(var st=[],vt=at;vt<et;++vt)st.push(new ui(se[vt],d(vt),i));return st}var Q=t.from,ee=t.to,se=t.text,ge=Ye(e,Q.line),_e=Ye(e,ee.line),Oe=M(se),Ae=d(se.length-1),Fe=ee.line-Q.line;if(t.full)e.insert(0,G(0,se.length)),e.remove(se.length,e.size-se.length);else if(Ds(e,t)){var We=G(0,se.length-1);D(_e,_e.text,Ae),Fe&&e.remove(Q.line,Fe),We.length&&e.insert(Q.line,We)}else if(ge==_e)if(se.length==1)D(ge,ge.text.slice(0,Q.ch)+Oe+ge.text.slice(ee.ch),Ae);else{var Xe=G(1,se.length-1);Xe.push(new ui(Oe+ge.text.slice(ee.ch),Ae,i)),D(ge,ge.text.slice(0,Q.ch)+se[0],d(0)),e.insert(Q.line+1,Xe)}else if(se.length==1)D(ge,ge.text.slice(0,Q.ch)+se[0]+_e.text.slice(ee.ch),d(0)),e.remove(Q.line+1,Fe);else{D(ge,ge.text.slice(0,Q.ch)+se[0],d(0)),D(_e,Oe+_e.text.slice(ee.ch),Ae);var qe=G(1,se.length-1);Fe>1&&e.remove(Q.line+1,Fe-1),e.insert(Q.line+1,qe)}sn(e,"change",e,t)}function qn(e,t,r){function i(d,D,G){if(d.linked)for(var Q=0;Q<d.linked.length;++Q){var ee=d.linked[Q];if(ee.doc==D)continue;var se=G&&ee.sharedHist;if(r&&!se)continue;t(ee.doc,se),i(ee.doc,d,se)}}i(e,null,!0)}function ks(e,t){if(t.cm)throw new Error("This document is already in use.");e.doc=t,t.cm=e,Ea(e),Da(e),Ms(e),e.options.lineWrapping||Nr(e),e.options.mode=t.modeOption,gn(e)}function Ms(e){(e.doc.direction=="rtl"?B:S)(e.display.lineDiv,"CodeMirror-rtl")}function fl(e){En(e,function(){Ms(e),gn(e)})}function Vr(e){this.done=[],this.undone=[],this.undoDepth=Infinity,this.lastModTime=this.lastSelTime=0,this.lastOp=this.lastSelOp=null,this.lastOrigin=this.lastSelOrigin=null,this.generation=this.maxGeneration=e||1}function Ma(e,t){var r={from:_i(t.from),to:Zn(t),text:Et(e,t.from,t.to)};return Fs(e,r,t.from.line,t.to.line+1),qn(e,function(i){return Fs(i,r,t.from.line,t.to.line+1)},!0),r}function Ps(e){for(;e.length;){var t=M(e);if(t.ranges)e.pop();else break}}function pl(e,t){if(t)return Ps(e.done),M(e.done);if(e.done.length&&!M(e.done).ranges)return M(e.done);if(e.done.length>1&&!e.done[e.done.length-2].ranges)return e.done.pop(),M(e.done)}function Ns(e,t,r,i){var d=e.history;d.undone.length=0;var D=+new Date,G,Q;if((d.lastOp==i||d.lastOrigin==t.origin&&t.origin&&(t.origin.charAt(0)=="+"&&d.lastModTime>D-(e.cm?e.cm.options.historyEventDelay:500)||t.origin.charAt(0)=="*"))&&(G=pl(d,d.lastOp==i)))Q=M(G.changes),_t(t.from,t.to)==0&&_t(t.from,Q.to)==0?Q.to=Zn(t):G.changes.push(Ma(e,t));else{var ee=M(d.done);for((!ee||!ee.ranges)&&Xr(e.sel,d.done),G={changes:[Ma(e,t)],generation:d.generation},d.done.push(G);d.done.length>d.undoDepth;)d.done.shift(),d.done[0].ranges||d.done.shift()}d.done.push(r),d.generation=++d.maxGeneration,d.lastModTime=d.lastSelTime=D,d.lastOp=d.lastSelOp=i,d.lastOrigin=d.lastSelOrigin=t.origin,Q||le(e,"historyAdded")}function ml(e,t,r,i){var d=t.charAt(0);return d=="*"||d=="+"&&r.ranges.length==i.ranges.length&&r.somethingSelected()==i.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function gl(e,t,r,i){var d=e.history,D=i&&i.origin;r==d.lastSelOp||D&&d.lastSelOrigin==D&&(d.lastModTime==d.lastSelTime&&d.lastOrigin==D||ml(e,D,M(d.done),t))?d.done[d.done.length-1]=t:Xr(t,d.done),d.lastSelTime=+new Date,d.lastSelOrigin=D,d.lastSelOp=r,i&&i.clearRedo!==!1&&Ps(d.undone)}function Xr(e,t){var r=M(t);r&&r.ranges&&r.equals(e)||t.push(e)}function Fs(e,t,r,i){var d=t["spans_"+e.id],D=0;e.iter(Math.max(e.first,r),Math.min(e.first+e.size,i),function(G){G.markedSpans&&((d||(d=t["spans_"+e.id]={}))[D]=G.markedSpans),++D})}function vl(e){if(!e)return null;for(var t,r=0;r<e.length;++r)e[r].marker.explicitlyCleared?t||(t=e.slice(0,r)):t&&t.push(e[r]);return t?t.length?t:null:e}function yl(e,t){var r=t["spans_"+e.id];if(!r)return null;for(var i=[],d=0;d<t.text.length;++d)i.push(vl(r[d]));return i}function Us(e,t){var r=yl(e,t),i=wi(e,t);if(!r)return i;if(!i)return r;for(var d=0;d<r.length;++d){var D=r[d],G=i[d];if(D&&G){e:for(var Q=0;Q<G.length;++Q){for(var ee=G[Q],se=0;se<D.length;++se)if(D[se].marker==ee.marker)continue e;D.push(ee)}}else G&&(r[d]=G)}return r}function Pi(e,t,r){for(var i=[],d=0;d<e.length;++d){var D=e[d];if(D.ranges){i.push(r?Sn.prototype.deepCopy.call(D):D);continue}var G=D.changes,Q=[];i.push({changes:Q});for(var ee=0;ee<G.length;++ee){var se=G[ee],ge=void 0;if(Q.push({from:se.from,to:se.to,text:se.text}),t)for(var _e in se)(ge=_e.match(/^spans_(\d+)$/))&&(ce(t,Number(ge[1]))>-1&&(M(Q)[_e]=se[_e],delete se[_e]))}}return i}function Pa(e,t,r,i){if(i){var d=e.anchor;if(r){var D=_t(t,d)<0;D!=_t(r,d)<0?(d=t,t=r):D!=_t(t,r)<0&&(t=r)}return new Pt(d,t)}else return new Pt(r||t,t)}function Yr(e,t,r,i,d){d==null&&(d=e.cm&&(e.cm.display.shift||e.extend)),un(e,new Sn([Pa(e.sel.primary(),t,r,d)],0),i)}function Bs(e,t,r){for(var i=[],d=e.cm&&(e.cm.display.shift||e.extend),D=0;D<e.sel.ranges.length;D++)i[D]=Pa(e.sel.ranges[D],t[D],null,d);var G=Mn(e.cm,i,e.sel.primIndex);un(e,G,r)}function Na(e,t,r,i){var d=e.sel.ranges.slice(0);d[t]=r,un(e,Mn(e.cm,d,e.sel.primIndex),i)}function js(e,t,r,i){un(e,Qn(t,r),i)}function bl(e,t,r){var i={ranges:t.ranges,update:function(d){this.ranges=[];for(var D=0;D<d.length;D++)this.ranges[D]=new Pt(St(e,d[D].anchor),St(e,d[D].head))},origin:r&&r.origin};return le(e,"beforeSelectionChange",e,i),e.cm&&le(e.cm,"beforeSelectionChange",e.cm,i),i.ranges!=t.ranges?Mn(e.cm,i.ranges,i.ranges.length-1):t}function Hs(e,t,r){var i=e.history.done,d=M(i);d&&d.ranges?(i[i.length-1]=t,$r(e,t,r)):un(e,t,r)}function un(e,t,r){$r(e,t,r),gl(e,e.sel,e.cm?e.cm.curOp.id:NaN,r)}function $r(e,t,r){(ae(e,"beforeSelectionChange")||e.cm&&ae(e.cm,"beforeSelectionChange"))&&(t=bl(e,t,r));var i=r&&r.bias||(_t(t.primary().head,e.sel.primary().head)<0?-1:1);Ws(e,Ks(e,t,i,!0)),!(r&&r.scroll===!1)&&e.cm&&ki(e.cm)}function Ws(e,t){if(t.equals(e.sel))return;e.sel=t,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,q(e.cm)),sn(e,"cursorActivity",e)}function Gs(e){Ws(e,Ks(e,e.sel,null,!1))}function Ks(e,t,r,i){for(var d,D=0;D<t.ranges.length;D++){var G=t.ranges[D],Q=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[D],ee=Jr(e,G.anchor,Q&&Q.anchor,r,i),se=Jr(e,G.head,Q&&Q.head,r,i);(d||ee!=G.anchor||se!=G.head)&&(d||(d=t.ranges.slice(0,D)),d[D]=new Pt(ee,se))}return d?Mn(e.cm,d,t.primIndex):t}function Ni(e,t,r,i,d){var D=Ye(e,t.line);if(D.markedSpans)for(var G=0;G<D.markedSpans.length;++G){var Q=D.markedSpans[G],ee=Q.marker,se="selectLeft"in ee?!ee.selectLeft:ee.inclusiveLeft,ge="selectRight"in ee?!ee.selectRight:ee.inclusiveRight;if((Q.from==null||(se?Q.from<=t.ch:Q.from<t.ch))&&(Q.to==null||(ge?Q.to>=t.ch:Q.to>t.ch))){if(d&&(le(ee,"beforeCursorEnter"),ee.explicitlyCleared))if(D.markedSpans){--G;continue}else break;if(!ee.atomic)continue;if(r){var _e=ee.find(i<0?1:-1),Oe=void 0;if((i<0?ge:se)&&(_e=zs(e,_e,-i,_e&&_e.line==t.line?D:null)),_e&&_e.line==t.line&&(Oe=_t(_e,r))&&(i<0?Oe<0:Oe>0))return Ni(e,_e,t,i,d)}var Ae=ee.find(i<0?-1:1);return(i<0?se:ge)&&(Ae=zs(e,Ae,i,Ae.line==t.line?D:null)),Ae?Ni(e,Ae,t,i,d):null}}return t}function Jr(e,t,r,i,d){var D=i||1,G=Ni(e,t,r,D,d)||!d&&Ni(e,t,r,D,!0)||Ni(e,t,r,-D,d)||!d&&Ni(e,t,r,-D,!0);return G||(e.cantEdit=!0,Ke(e.first,0))}function zs(e,t,r,i){return r<0&&t.ch==0?t.line>e.first?St(e,Ke(t.line-1)):null:r>0&&t.ch==(i||Ye(e,t.line)).text.length?t.line<e.first+e.size-1?Ke(t.line+1,0):null:new Ke(t.line,t.ch+r)}function Vs(e){e.setSelection(Ke(e.firstLine(),0),Ke(e.lastLine()),we)}function Xs(e,t,r){var i={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){return i.canceled=!0}};return r&&(i.update=function(d,D,G,Q){d&&(i.from=St(e,d)),D&&(i.to=St(e,D)),G&&(i.text=G),Q!==void 0&&(i.origin=Q)}),le(e,"beforeChange",e,i),e.cm&&le(e.cm,"beforeChange",e.cm,i),i.canceled?(e.cm&&(e.cm.curOp.updateInput=2),null):{from:i.from,to:i.to,text:i.text,origin:i.origin}}function Fi(e,t,r){if(e.cm){if(!e.cm.curOp)return en(e.cm,Fi)(e,t,r);if(e.cm.state.suppressEdits)return}if((ae(e,"beforeChange")||e.cm&&ae(e.cm,"beforeChange"))&&(t=Xs(e,t,!0),!t))return;var i=Qi&&!r&&kr(e,t.from,t.to);if(i)for(var d=i.length-1;d>=0;--d)Ys(e,{from:i[d].from,to:i[d].to,text:d?[""]:t.text,origin:t.origin});else Ys(e,t)}function Ys(e,t){if(t.text.length==1&&t.text[0]==""&&_t(t.from,t.to)==0)return;var r=Ia(e,t);Ns(e,t,r,e.cm?e.cm.curOp.id:NaN),pr(e,t,r,wi(e,t));var i=[];qn(e,function(d,D){!D&&ce(i,d.history)==-1&&(Zs(d.history,t),i.push(d.history)),pr(d,t,null,wi(d,t))})}function Qr(e,t,r){var i=e.cm&&e.cm.state.suppressEdits;if(i&&!r)return;for(var d=e.history,D,G=e.sel,Q=t=="undo"?d.done:d.undone,ee=t=="undo"?d.undone:d.done,se=0;se<Q.length&&!(D=Q[se],r?D.ranges&&!D.equals(e.sel):!D.ranges);se++);if(se==Q.length)return;for(d.lastOrigin=d.lastSelOrigin=null;;)if(D=Q.pop(),D.ranges){if(Xr(D,ee),r&&!D.equals(e.sel)){un(e,D,{clearRedo:!1});return}G=D}else if(i){Q.push(D);return}else break;var ge=[];Xr(G,ee),ee.push({changes:ge,generation:d.generation}),d.generation=D.generation||++d.maxGeneration;for(var _e=ae(e,"beforeChange")||e.cm&&ae(e.cm,"beforeChange"),Oe=function(We){var Xe=D.changes[We];if(Xe.origin=t,_e&&!Xs(e,Xe,!1))return Q.length=0,{};ge.push(Ma(e,Xe));var qe=We?Ia(e,Xe):M(Q);pr(e,Xe,qe,Us(e,Xe)),!We&&e.cm&&e.cm.scrollIntoView({from:Xe.from,to:Zn(Xe)});var at=[];qn(e,function(et,st){!st&&ce(at,et.history)==-1&&(Zs(et.history,Xe),at.push(et.history)),pr(et,Xe,null,Us(et,Xe))})},Ae=D.changes.length-1;Ae>=0;--Ae){var Fe=Oe(Ae);if(Fe)return Fe.v}}function $s(e,t){if(t==0)return;if(e.first+=t,e.sel=new Sn(N(e.sel.ranges,function(d){return new Pt(Ke(d.anchor.line+t,d.anchor.ch),Ke(d.head.line+t,d.head.ch))}),e.sel.primIndex),e.cm){gn(e.cm,e.first,e.first-t,t);for(var r=e.cm.display,i=r.viewFrom;i<r.viewTo;i++)$n(e.cm,i,"gutter")}}function pr(e,t,r,i){if(e.cm&&!e.cm.curOp)return en(e.cm,pr)(e,t,r,i);if(t.to.line<e.first){$s(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 d=t.text.length-1-(e.first-t.from.line);$s(e,d),t={from:Ke(e.first,0),to:Ke(t.to.line+d,t.to.ch),text:[M(t.text)],origin:t.origin}}var D=e.lastLine();t.to.line>D&&(t={from:t.from,to:Ke(D,Ye(e,D).text.length),text:[t.text[0]],origin:t.origin}),t.removed=Et(e,t.from,t.to),r||(r=Ia(e,t)),e.cm?_l(e.cm,t,i):ka(e,t,i),$r(e,r,we),e.cantEdit&&Jr(e,Ke(e.firstLine(),0))&&(e.cantEdit=!1)}function _l(e,t,r){var i=e.doc,d=e.display,D=t.from,G=t.to,Q=!1,ee=D.line;e.options.lineWrapping||(ee=pt(Tn(Ye(i,D.line))),i.iter(ee,G.line+1,function(Ae){if(Ae==d.maxLine)return Q=!0,!0})),i.sel.contains(t.from,t.to)>-1&&q(e),ka(i,t,r,cs(e)),e.options.lineWrapping||(i.iter(ee,D.line+t.text.length,function(Ae){var Fe=tr(Ae);Fe>d.maxLineLength&&(d.maxLine=Ae,d.maxLineLength=Fe,d.maxLineChanged=!0,Q=!1)}),Q&&(e.curOp.updateMaxLine=!0)),aa(i,D.line),dr(e,400);var se=t.text.length-(G.line-D.line)-1;t.full?gn(e):D.line==G.line&&t.text.length==1&&!Ds(e.doc,t)?$n(e,D.line,"text"):gn(e,D.line,G.line+1,se);var ge=ae(e,"changes"),_e=ae(e,"change");if(_e||ge){var Oe={from:D,to:G,text:t.text,removed:t.removed,origin:t.origin};_e&&sn(e,"change",e,Oe),ge&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(Oe)}e.display.selForContextMenu=null}function Ui(e,t,r,i,d){var D;i||(i=r),_t(i,r)<0&&(D=[i,r],r=D[0],i=D[1]),typeof t=="string"&&(t=e.splitLines(t)),Fi(e,{from:r,to:i,text:t,origin:d})}function Js(e,t,r,i){r<e.line?e.line+=i:t<e.line&&(e.line=t,e.ch=0)}function Qs(e,t,r,i){for(var d=0;d<e.length;++d){var D=e[d],G=!0;if(D.ranges){D.copied||(D=e[d]=D.deepCopy(),D.copied=!0);for(var Q=0;Q<D.ranges.length;Q++)Js(D.ranges[Q].anchor,t,r,i),Js(D.ranges[Q].head,t,r,i);continue}for(var ee=0;ee<D.changes.length;++ee){var se=D.changes[ee];if(r<se.from.line)se.from=Ke(se.from.line+i,se.from.ch),se.to=Ke(se.to.line+i,se.to.ch);else if(t<=se.to.line){G=!1;break}}G||(e.splice(0,d+1),d=0)}}function Zs(e,t){var r=t.from.line,i=t.to.line,d=t.text.length-(i-r)-1;Qs(e.done,r,i,d),Qs(e.undone,r,i,d)}function mr(e,t,r,i){var d=t,D=t;return typeof t=="number"?D=Ye(e,xi(e,t)):d=pt(t),d==null?null:(i(D,d)&&e.cm&&$n(e.cm,d,r),D)}function gr(e){this.lines=e,this.parent=null;for(var t=0,r=0;r<e.length;++r)e[r].parent=this,t+=e[r].height;this.height=t}gr.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var r=e,i=e+t;r<i;++r){var d=this.lines[r];this.height-=d.height,ht(d),sn(d,"delete")}this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,r){this.height+=r,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var i=0;i<t.length;++i)t[i].parent=this},iterN:function(e,t,r){for(var i=e+t;e<i;++e)if(r(this.lines[e]))return!0}};function vr(e){this.children=e;for(var t=0,r=0,i=0;i<e.length;++i){var d=e[i];t+=d.chunkSize(),r+=d.height,d.parent=this}this.size=t,this.height=r,this.parent=null}vr.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){this.size-=t;for(var r=0;r<this.children.length;++r){var i=this.children[r],d=i.chunkSize();if(e<d){var D=Math.min(t,d-e),G=i.height;if(i.removeInner(e,D),this.height-=G-i.height,d==D&&(this.children.splice(r--,1),i.parent=null),(t-=D)==0)break;e=0}else e-=d}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof gr))){var Q=[];this.collapse(Q),this.children=[new gr(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,r){this.size+=t.length,this.height+=r;for(var i=0;i<this.children.length;++i){var d=this.children[i],D=d.chunkSize();if(e<=D){if(d.insertInner(e,t,r),d.lines&&d.lines.length>50){for(var G=d.lines.length%25+25,Q=G;Q<d.lines.length;){var ee=new gr(d.lines.slice(Q,Q+=25));d.height-=ee.height,this.children.splice(++i,0,ee),ee.parent=this}d.lines=d.lines.slice(0,G),this.maybeSpill()}break}e-=D}},maybeSpill:function(){if(this.children.length<=10)return;var e=this;do{var t=e.children.splice(e.children.length-5,5),r=new vr(t);if(e.parent){e.size-=r.size,e.height-=r.height;var d=ce(e.parent.children,e);e.parent.children.splice(d+1,0,r)}else{var i=new vr(e.children);i.parent=e,e.children=[i,r],e=i}r.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()},iterN:function(e,t,r){for(var i=0;i<this.children.length;++i){var d=this.children[i],D=d.chunkSize();if(e<D){var G=Math.min(t,D-e);if(d.iterN(e,G,r))return!0;if((t-=G)==0)break;e=0}else e-=D}}};var yr=function(e,t,r){if(r)for(var i in r)r.hasOwnProperty(i)&&(this[i]=r[i]);this.doc=e,this.node=t};yr.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,r=this.line,i=pt(r);if(i==null||!t)return;for(var d=0;d<t.length;++d)t[d]==this&&t.splice(d--,1);t.length||(r.widgets=null);var D=rr(this);rt(r,Math.max(0,r.height-D)),e&&(En(e,function(){qs(e,r,-D),$n(e,i,"widget")}),sn(e,"lineWidgetCleared",e,this,i))},yr.prototype.changed=function(){var e=this,t=this.height,r=this.doc.cm,i=this.line;this.height=null;var d=rr(this)-t;if(!d)return;Nn(this.doc,i)||rt(i,i.height+d),r&&En(r,function(){r.curOp.forceUpdate=!0,qs(r,i,d),sn(r,"lineWidgetChanged",r,e,pt(i))})},ue(yr);function qs(e,t,r){Dn(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&Sa(e,r)}function El(e,t,r,i){var d=new yr(e,r,i),D=e.cm;return D&&d.noHScroll&&(D.display.alignWidgets=!0),mr(e,t,"widget",function(G){var Q=G.widgets||(G.widgets=[]);if(d.insertAt==null?Q.push(d):Q.splice(Math.min(Q.length-1,Math.max(0,d.insertAt)),0,d),d.line=G,D&&!Nn(e,G)){var ee=Dn(G)<e.scrollTop;rt(G,G.height+rr(d)),ee&&Sa(D,d.height),D.curOp.forceUpdate=!0}return!0}),D&&sn(D,"lineWidgetAdded",D,d,typeof t=="number"?t:pt(t)),d}var eo=0,ei=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++eo};ei.prototype.clear=function(){if(this.explicitlyCleared)return;var e=this.doc.cm,t=e&&!e.curOp;if(t&&gi(e),ae(this,"clear")){var r=this.find();r&&sn(this,"clear",r.from,r.to)}for(var i=null,d=null,D=0;D<this.lines.length;++D){var G=this.lines[D],Q=In(G.markedSpans,this);e&&!this.collapsed?$n(e,pt(G),"text"):e&&(Q.to!=null&&(d=pt(G)),Q.from!=null&&(i=pt(G))),G.markedSpans=Zi(G.markedSpans,Q),Q.from==null&&this.collapsed&&!Nn(this.doc,G)&&e&&rt(G,Li(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var ee=0;ee<this.lines.length;++ee){var se=Tn(this.lines[ee]),ge=tr(se);ge>e.display.maxLineLength&&(e.display.maxLine=se,e.display.maxLineLength=ge,e.display.maxLineChanged=!0)}i!=null&&e&&this.collapsed&&gn(e,i,d+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&Gs(e.doc)),e&&sn(e,"markerCleared",e,this,i,d),t&&vi(e),this.parent&&this.parent.clear()},ei.prototype.find=function(e,t){e==null&&this.type=="bookmark"&&(e=1);for(var r,i,d=0;d<this.lines.length;++d){var D=this.lines[d],G=In(D.markedSpans,this);if(G.from!=null&&(r=Ke(t?D:pt(D),G.from),e==-1))return r;if(G.to!=null&&(i=Ke(t?D:pt(D),G.to),e==1))return i}return r&&{from:r,to:i}},ei.prototype.changed=function(){var e=this,t=this.find(-1,!0),r=this,i=this.doc.cm;if(!t||!i)return;En(i,function(){var d=t.line,D=pt(t.line),G=fa(i,D);if(G&&(rs(G),i.curOp.selectionChanged=i.curOp.forceUpdate=!0),i.curOp.updateMaxLine=!0,!Nn(r.doc,d)&&r.height!=null){var Q=r.height;r.height=null;var ee=rr(r)-Q;ee&&rt(d,d.height+ee)}sn(i,"markerChanged",i,e)})},ei.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(!t.maybeHiddenMarkers||ce(t.maybeHiddenMarkers,this)==-1)&&(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},ei.prototype.detachLine=function(e){if(this.lines.splice(ce(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},ue(ei);function Bi(e,t,r,i,d){if(i&&i.shared)return xl(e,t,r,i,d);if(e.cm&&!e.cm.curOp)return en(e.cm,Bi)(e,t,r,i,d);var D=new ei(e,d),G=_t(t,r);if(i&&b(i,D,!1),G>0||G==0&&D.clearWhenEmpty!==!1)return D;if(D.replacedWith&&(D.collapsed=!0,D.widgetNode=x("span",[D.replacedWith],"CodeMirror-widget"),i.handleMouseEvents||D.widgetNode.setAttribute("cm-ignore-events","true"),i.insertLeft&&(D.widgetNode.insertLeft=!0)),D.collapsed){if(Mr(e,t.line,t,r,D)||t.line!=r.line&&Mr(e,r.line,t,r,D))throw new Error("Inserting collapsed marker partially overlapping an existing one");sa()}D.addToHistory&&Ns(e,{from:t,to:r,origin:"markText"},e.sel,NaN);var Q=t.line,ee=e.cm,se;if(e.iter(Q,r.line+1,function(_e){ee&&D.collapsed&&!ee.options.lineWrapping&&Tn(_e)==ee.display.maxLine&&(se=!0),D.collapsed&&Q!=t.line&&rt(_e,0),oa(_e,new si(D,Q==t.line?t.ch:null,Q==r.line?r.ch:null)),++Q}),D.collapsed&&e.iter(t.line,r.line+1,function(_e){Nn(e,_e)&&rt(_e,0)}),D.clearOnEnter&&ke(D,"beforeCursorEnter",function(){return D.clear()}),D.readOnly&&(Xn(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),D.collapsed&&(D.id=++eo,D.atomic=!0),ee){if(se&&(ee.curOp.updateMaxLine=!0),D.collapsed)gn(ee,t.line,r.line+1);else if(D.className||D.startStyle||D.endStyle||D.css||D.attributes||D.title)for(var ge=t.line;ge<=r.line;ge++)$n(ee,ge,"text");D.atomic&&Gs(ee.doc),sn(ee,"markerAdded",ee,D)}return D}var br=function(e,t){this.markers=e,this.primary=t;for(var r=0;r<e.length;++r)e[r].parent=this};br.prototype.clear=function(){if(this.explicitlyCleared)return;this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();sn(this,"clear")},br.prototype.find=function(e,t){return this.primary.find(e,t)},ue(br);function xl(e,t,r,i,d){i=b(i),i.shared=!1;var D=[Bi(e,t,r,i,d)],G=D[0],Q=i.widgetNode;return qn(e,function(ee){Q&&(i.widgetNode=Q.cloneNode(!0)),D.push(Bi(ee,St(ee,t),St(ee,r),i,d));for(var se=0;se<ee.linked.length;++se)if(ee.linked[se].isParent)return;G=M(D)}),new br(D,G)}function to(e){return e.findMarks(Ke(e.first,0),e.clipPos(Ke(e.lastLine())),function(t){return t.parent})}function Tl(e,t){for(var r=0;r<t.length;r++){var i=t[r],d=i.find(),D=e.clipPos(d.from),G=e.clipPos(d.to);if(_t(D,G)){var Q=Bi(e,D,G,i.primary,i.primary.type);i.markers.push(Q),Q.parent=i}}}function wl(e){for(var t=function(i){var d=e[i],D=[d.primary.doc];qn(d.primary.doc,function(ee){return D.push(ee)});for(var G=0;G<d.markers.length;G++){var Q=d.markers[G];ce(D,Q.doc)==-1&&(Q.parent=null,d.markers.splice(G--,1))}},r=0;r<e.length;r++)t(r)}var Sl=0,vn=function(e,t,r,i,d){if(!(this instanceof vn))return new vn(e,t,r,i,d);r==null&&(r=0),vr.call(this,[new gr([new ui("",null)])]),this.first=r,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=r;var D=Ke(r,0);this.sel=Qn(D),this.history=new Vr(null),this.id=++Sl,this.modeOption=t,this.lineSep=i,this.direction=d=="rtl"?"rtl":"ltr",this.extend=!1,typeof e=="string"&&(e=this.splitLines(e)),ka(this,{from:D,to:D,text:e}),un(this,Qn(D),we)};vn.prototype=K(vr.prototype,{constructor:vn,iter:function(e,t,r){r?this.iterN(e-this.first,t-e,r):this.iterN(this.first,this.first+this.size,e)},insert:function(e,t){for(var r=0,i=0;i<t.length;++i)r+=t[i].height;this.insertInner(e-this.first,t,r)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=dt(this,this.first,this.first+this.size);return e===!1?t:t.join(e||this.lineSeparator())},setValue:tn(function(e){var t=Ke(this.first,0),r=this.first+this.size-1;Fi(this,{from:t,to:Ke(r,Ye(this,r).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&or(this.cm,0,0),un(this,Qn(t),we)}),replaceRange:function(e,t,r,i){t=St(this,t),r=r?St(this,r):t,Ui(this,e,t,r,i)},getRange:function(e,t,r){var i=Et(this,St(this,e),St(this,t));return r===!1?i:i.join(r||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){if(Vt(this,e))return Ye(this,e)},getLineNumber:function(e){return pt(e)},getLineHandleVisualStart:function(e){return typeof e=="number"&&(e=Ye(this,e)),Tn(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return St(this,e)},getCursor:function(e){var t=this.sel.primary(),r;return e==null||e=="head"?r=t.head:e=="anchor"?r=t.anchor:e=="end"||e=="to"||e===!1?r=t.to():r=t.from(),r},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:tn(function(e,t,r){js(this,St(this,typeof e=="number"?Ke(e,t||0):e),null,r)}),setSelection:tn(function(e,t,r){js(this,St(this,e),St(this,t||e),r)}),extendSelection:tn(function(e,t,r){Yr(this,St(this,e),t&&St(this,t),r)}),extendSelections:tn(function(e,t){Bs(this,Ve(this,e),t)}),extendSelectionsBy:tn(function(e,t){var r=N(this.sel.ranges,e);Bs(this,Ve(this,r),t)}),setSelections:tn(function(e,t,r){if(!e.length)return;for(var i=[],d=0;d<e.length;d++)i[d]=new Pt(St(this,e[d].anchor),St(this,e[d].head));t==null&&(t=Math.min(e.length-1,this.sel.primIndex)),un(this,Mn(this.cm,i,t),r)}),addSelection:tn(function(e,t,r){var i=this.sel.ranges.slice(0);i.push(new Pt(St(this,e),St(this,t||e))),un(this,Mn(this.cm,i,i.length-1),r)}),getSelection:function(e){for(var t=this.sel.ranges,r,i=0;i<t.length;i++){var d=Et(this,t[i].from(),t[i].to());r=r?r.concat(d):d}return e===!1?r:r.join(e||this.lineSeparator())},getSelections:function(e){for(var t=[],r=this.sel.ranges,i=0;i<r.length;i++){var d=Et(this,r[i].from(),r[i].to());e!==!1&&(d=d.join(e||this.lineSeparator())),t[i]=d}return t},replaceSelection:function(e,t,r){for(var i=[],d=0;d<this.sel.ranges.length;d++)i[d]=e;this.replaceSelections(i,t,r||"+input")},replaceSelections:tn(function(e,t,r){for(var i=[],d=this.sel,D=0;D<d.ranges.length;D++){var G=d.ranges[D];i[D]={from:G.from(),to:G.to(),text:this.splitLines(e[D]),origin:r}}for(var Q=t&&t!="end"&&cl(this,i,t),ee=i.length-1;ee>=0;ee--)Fi(this,i[ee]);Q?Hs(this,Q):this.cm&&ki(this.cm)}),undo:tn(function(){Qr(this,"undo")}),redo:tn(function(){Qr(this,"redo")}),undoSelection:tn(function(){Qr(this,"undo",!0)}),redoSelection:tn(function(){Qr(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,r=0,i=0;i<e.done.length;i++)e.done[i].ranges||++t;for(var d=0;d<e.undone.length;d++)e.undone[d].ranges||++r;return{undo:t,redo:r}},clearHistory:function(){var e=this;this.history=new Vr(this.history.maxGeneration),qn(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:Pi(this.history.done),undone:Pi(this.history.undone)}},setHistory:function(e){var t=this.history=new Vr(this.history.maxGeneration);t.done=Pi(e.done.slice(0),null,!0),t.undone=Pi(e.undone.slice(0),null,!0)},setGutterMarker:tn(function(e,t,r){return mr(this,e,"gutter",function(i){var d=i.gutterMarkers||(i.gutterMarkers={});return d[t]=r,!r&&he(d)&&(i.gutterMarkers=null),!0})}),clearGutter:tn(function(e){var t=this;this.iter(function(r){r.gutterMarkers&&r.gutterMarkers[e]&&mr(t,r,"gutter",function(){return r.gutterMarkers[e]=null,he(r.gutterMarkers)&&(r.gutterMarkers=null),!0})})}),lineInfo:function(e){var t;if(typeof e=="number"){if(!Vt(this,e))return null;if(t=e,e=Ye(this,e),!e)return null}else if(t=pt(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:tn(function(e,t,r){return mr(this,e,t=="gutter"?"gutter":"class",function(i){var d=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass";if(!i[d])i[d]=r;else{if(R(r).test(i[d]))return!1;i[d]+=" "+r}return!0})}),removeLineClass:tn(function(e,t,r){return mr(this,e,t=="gutter"?"gutter":"class",function(i){var d=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass",D=i[d];if(D)if(r==null)i[d]=null;else{var G=D.match(R(r));if(!G)return!1;var Q=G.index+G[0].length;i[d]=D.slice(0,G.index)+(!G.index||Q==D.length?"":" ")+D.slice(Q)||null}else return!1;return!0})}),addLineWidget:tn(function(e,t,r){return El(this,e,t,r)}),removeLineWidget:function(e){e.clear()},markText:function(e,t,r){return Bi(this,St(this,e),St(this,t),r,r&&r.type||"range")},setBookmark:function(e,t){var r={replacedWith:t&&(t.nodeType==null?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};return e=St(this,e),Bi(this,e,e,r,"bookmark")},findMarksAt:function(e){e=St(this,e);var t=[],r=Ye(this,e.line).markedSpans;if(r)for(var i=0;i<r.length;++i){var d=r[i];(d.from==null||d.from<=e.ch)&&(d.to==null||d.to>=e.ch)&&t.push(d.marker.parent||d.marker)}return t},findMarks:function(e,t,r){e=St(this,e),t=St(this,t);var i=[],d=e.line;return this.iter(e.line,t.line+1,function(D){var G=D.markedSpans;if(G)for(var Q=0;Q<G.length;Q++){var ee=G[Q];!(ee.to!=null&&d==e.line&&e.ch>=ee.to||ee.from==null&&d!=e.line||ee.from!=null&&d==t.line&&ee.from>=t.ch)&&(!r||r(ee.marker))&&i.push(ee.marker.parent||ee.marker)}++d}),i},getAllMarks:function(){var e=[];return this.iter(function(t){var r=t.markedSpans;if(r)for(var i=0;i<r.length;++i)r[i].from!=null&&e.push(r[i].marker)}),e},posFromIndex:function(e){var t,r=this.first,i=this.lineSeparator().length;return this.iter(function(d){var D=d.text.length+i;if(D>e)return t=e,!0;e-=D,++r}),St(this,Ke(r,t))},indexFromPos:function(e){e=St(this,e);var t=e.ch;if(e.line<this.first||e.ch<0)return 0;var r=this.lineSeparator().length;return this.iter(this.first,e.line,function(i){t+=i.text.length+r}),t},copy:function(e){var t=new vn(dt(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,r=this.first+this.size;e.from!=null&&e.from>t&&(t=e.from),e.to!=null&&e.to<r&&(r=e.to);var i=new vn(dt(this,t,r),e.mode||this.modeOption,t,this.lineSep,this.direction);return e.sharedHist&&(i.history=this.history),(this.linked||(this.linked=[])).push({doc:i,sharedHist:e.sharedHist}),i.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],Tl(i,to(this)),i},unlinkDoc:function(e){if(e instanceof Wt&&(e=e.doc),this.linked)for(var t=0;t<this.linked.length;++t){var r=this.linked[t];if(r.doc!=e)continue;this.linked.splice(t,1),e.unlinkDoc(this),wl(to(this));break}if(e.history==this.history){var i=[e.id];qn(e,function(d){return i.push(d.id)},!0),e.history=new Vr(null),e.history.done=Pi(this.history.done,i),e.history.undone=Pi(this.history.undone,i)}},iterLinkedDocs:function(e){qn(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):ot(e)},lineSeparator:function(){return this.lineSep||`
`},setDirection:tn(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)})}),vn.prototype.eachLine=vn.prototype.iter;var no=0;function Cl(e){var t=this;if(io(t),Z(t,e)||Kn(t.display,e))return;ne(e),W&&(no=+new Date);var r=ci(t,e,!0),i=e.dataTransfer.files;if(!r||t.isReadOnly())return;if(i&&i.length&&window.FileReader&&window.File)for(var d=i.length,D=Array(d),G=0,Q=function(){++G==d&&en(t,function(){r=St(t.doc,r);var Ae={from:r,to:r,text:t.doc.splitLines(D.filter(function(Fe){return Fe!=null}).join(t.doc.lineSeparator())),origin:"paste"};Fi(t.doc,Ae),Hs(t.doc,Qn(St(t.doc,r),St(t.doc,Zn(Ae))))})()},ee=function(Ae,Fe){if(t.options.allowDropFileTypes&&ce(t.options.allowDropFileTypes,Ae.type)==-1){Q();return}var We=new FileReader;We.onerror=function(){return Q()},We.onload=function(){var Xe=We.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(Xe)){Q();return}D[Fe]=Xe,Q()},We.readAsText(Ae)},se=0;se<i.length;se++)ee(i[se],se);else{if(t.state.draggingText&&t.doc.sel.contains(r)>-1){t.state.draggingText(e),setTimeout(function(){return t.display.input.focus()},20);return}try{var ge=e.dataTransfer.getData("Text");if(ge){var _e;if(t.state.draggingText&&!t.state.draggingText.copy&&(_e=t.listSelections()),$r(t.doc,Qn(r,r)),_e)for(var Oe=0;Oe<_e.length;++Oe)Ui(t.doc,"",_e[Oe].anchor,_e[Oe].head,"drag");t.replaceSelection(ge,"around","paste"),t.display.input.focus()}}catch(Ae){}}}function Al(e,t){if(W&&(!e.state.draggingText||+new Date-no<100)){fe(t);return}if(Z(e,t)||Kn(e.display,t))return;if(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!m){var r=c("img",null,null,"position: fixed; left: 0; top: 0;");r.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",f&&(r.width=r.height=1,e.display.wrapper.appendChild(r),r._top=r.offsetTop),t.dataTransfer.setDragImage(r,0,0),f&&r.parentNode.removeChild(r)}}function Rl(e,t){var r=ci(e,t);if(!r)return;var i=document.createDocumentFragment();ms(e,r,i),e.display.dragCursor||(e.display.dragCursor=c("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),E(e.display.dragCursor,i)}function io(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function ro(e){if(!document.getElementsByClassName)return;for(var t=document.getElementsByClassName("CodeMirror"),r=[],i=0;i<t.length;i++){var d=t[i].CodeMirror;d&&r.push(d)}r.length&&r[0].operation(function(){for(var D=0;D<r.length;D++)e(r[D])})}var ao=!1;function Ol(){if(ao)return;Ll(),ao=!0}function Ll(){var e;ke(window,"resize",function(){e==null&&(e=setTimeout(function(){e=null,ro(Il)},100))}),ke(window,"blur",function(){return ro(Di)})}function Il(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}for(var ti={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"},_r=0;_r<10;_r++)ti[_r+48]=ti[_r+96]=String(_r);for(var Zr=65;Zr<=90;Zr++)ti[Zr]=String.fromCharCode(Zr);for(var Er=1;Er<=12;Er++)ti[Er+111]=ti[Er+63235]="F"+Er;var zn={};zn.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"},zn.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"},zn.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"},zn.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"]},zn.default=a?zn.macDefault:zn.pcDefault;function Dl(e){var t=e.split(/-(?!$)/);e=t[t.length-1];for(var r,i,d,D,G=0;G<t.length-1;G++){var Q=t[G];if(/^(cmd|meta|m)$/i.test(Q))D=!0;else if(/^a(lt)?$/i.test(Q))r=!0;else if(/^(c|ctrl|control)$/i.test(Q))i=!0;else if(/^s(hift)?$/i.test(Q))d=!0;else throw new Error("Unrecognized modifier name: "+Q)}return r&&(e="Alt-"+e),i&&(e="Ctrl-"+e),D&&(e="Cmd-"+e),d&&(e="Shift-"+e),e}function kl(e){var t={};for(var r in e)if(e.hasOwnProperty(r)){var i=e[r];if(/^(name|fallthrough|(de|at)tach)$/.test(r))continue;if(i=="..."){delete e[r];continue}for(var d=N(r.split(" "),Dl),D=0;D<d.length;D++){var G=void 0,Q=void 0;D==d.length-1?(Q=d.join(" "),G=i):(Q=d.slice(0,D+1).join(" "),G="...");var ee=t[Q];if(!ee)t[Q]=G;else if(ee!=G)throw new Error("Inconsistent bindings for "+Q)}delete e[r]}for(var se in t)e[se]=t[se];return e}function ji(e,t,r,i){t=qr(t);var d=t.call?t.call(e,i):t[e];if(d===!1)return"nothing";if(d==="...")return"multi";if(d!=null&&r(d))return"handled";if(t.fallthrough){if(Object.prototype.toString.call(t.fallthrough)!="[object Array]")return ji(e,t.fallthrough,r,i);for(var D=0;D<t.fallthrough.length;D++){var G=ji(e,t.fallthrough[D],r,i);if(G)return G}}}function so(e){var t=typeof e=="string"?e:ti[e.keyCode];return t=="Ctrl"||t=="Alt"||t=="Shift"||t=="Mod"}function oo(e,t,r){var i=e;return t.altKey&&i!="Alt"&&(e="Alt-"+e),(w?t.metaKey:t.ctrlKey)&&i!="Ctrl"&&(e="Ctrl-"+e),(w?t.ctrlKey:t.metaKey)&&i!="Mod"&&(e="Cmd-"+e),!r&&t.shiftKey&&i!="Shift"&&(e="Shift-"+e),e}function lo(e,t){if(f&&e.keyCode==34&&e.char)return!1;var r=ti[e.keyCode];return r==null||e.altGraphKey?!1:(e.keyCode==3&&e.code&&(r=e.code),oo(r,e,t))}function qr(e){return typeof e=="string"?zn[e]:e}function Hi(e,t){for(var r=e.doc.sel.ranges,i=[],d=0;d<r.length;d++){for(var D=t(r[d]);i.length&&_t(D.from,M(i).to)<=0;){var G=i.pop();if(_t(G.from,D.from)<0){D.from=G.from;break}}i.push(D)}En(e,function(){for(var Q=i.length-1;Q>=0;Q--)Ui(e.doc,"",i[Q].from,i[Q].to,"+delete");ki(e)})}function Fa(e,t,r){var i=Ce(e.text,t+r,r);return i<0||i>e.text.length?null:i}function Ua(e,t,r){var i=Fa(e,t.ch,r);return i==null?null:new Ke(t.line,i,r<0?"after":"before")}function Ba(e,t,r,i,d){if(e){t.doc.direction=="rtl"&&(d=-d);var D=Ge(r,t.doc.direction);if(D){var G=d<0?M(D):D[0],Q=d<0==(G.level==1),ee=Q?"after":"before",se;if(G.level>0||t.doc.direction=="rtl"){var ge=Oi(t,r);se=d<0?r.text.length-1:0;var _e=Un(t,ge,se).top;se=Be(function(Oe){return Un(t,ge,Oe).top==_e},d<0==(G.level==1)?G.from:G.to-1,se),ee=="before"&&(se=Fa(r,se,1))}else se=d<0?G.to:G.from;return new Ke(i,se,ee)}}return new Ke(i,d<0?r.text.length:0,d<0?"before":"after")}function Ml(e,t,r,i){var d=Ge(t,e.doc.direction);if(!d)return Ua(t,r,i);r.ch>=t.text.length?(r.ch=t.text.length,r.sticky="before"):r.ch<=0&&(r.ch=0,r.sticky="after");var D=He(d,r.ch,r.sticky),G=d[D];if(e.doc.direction=="ltr"&&G.level%2==0&&(i>0?G.to>r.ch:G.from<r.ch))return Ua(t,r,i);var Q=function(qe,at){return Fa(t,qe instanceof Ke?qe.ch:qe,at)},ee,se=function(qe){return e.options.lineWrapping?(ee=ee||Oi(e,t),ds(e,t,ee,qe)):{begin:0,end:t.text.length}},ge=se(r.sticky=="before"?Q(r,-1):r.ch);if(e.doc.direction=="rtl"||G.level==1){var _e=G.level==1==i<0,Oe=Q(r,_e?1:-1);if(Oe!=null&&(_e?Oe<=G.to&&Oe<=ge.end:Oe>=G.from&&Oe>=ge.begin)){var Ae=_e?"before":"after";return new Ke(r.line,Oe,Ae)}}var Fe=function(qe,at,et){for(var st=function(Ut,nn){return nn?new Ke(r.line,Q(Ut,1),"before"):new Ke(r.line,Ut,"after")};qe>=0&&qe<d.length;qe+=at){var vt=d[qe],ct=at>0==(vt.level!=1),Ot=ct?et.begin:Q(et.end,-1);if(vt.from<=Ot&&Ot<vt.to)return st(Ot,ct);if(Ot=ct?vt.from:Q(vt.to,-1),et.begin<=Ot&&Ot<et.end)return st(Ot,ct)}},We=Fe(D+i,i,ge);if(We)return We;var Xe=i>0?ge.end:Q(ge.begin,-1);return Xe!=null&&!(i>0&&Xe==t.text.length)&&(We=Fe(i>0?0:d.length-1,i,se(Xe)),We)?We:null}var xr={selectAll:Vs,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),we)},killLine:function(e){return Hi(e,function(t){if(t.empty()){var r=Ye(e.doc,t.head.line).text.length;return t.head.ch==r&&t.head.line<e.lastLine()?{from:t.head,to:Ke(t.head.line+1,0)}:{from:t.head,to:Ke(t.head.line,r)}}else return{from:t.from(),to:t.to()}})},deleteLine:function(e){return Hi(e,function(t){return{from:Ke(t.from().line,0),to:St(e.doc,Ke(t.to().line+1,0))}})},delLineLeft:function(e){return Hi(e,function(t){return{from:Ke(t.from().line,0),to:t.from()}})},delWrappedLineLeft:function(e){return Hi(e,function(t){var r=e.charCoords(t.head,"div").top+5,i=e.coordsChar({left:0,top:r},"div");return{from:i,to:t.from()}})},delWrappedLineRight:function(e){return Hi(e,function(t){var r=e.charCoords(t.head,"div").top+5,i=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:r},"div");return{from:t.from(),to:i}})},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(Ke(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(Ke(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy(function(t){return uo(e,t.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy(function(t){return ho(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 r=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:r},"div")},Re)},goLineLeft:function(e){return e.extendSelectionsBy(function(t){var r=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:0,top:r},"div")},Re)},goLineLeftSmart:function(e){return e.extendSelectionsBy(function(t){var r=e.cursorCoords(t.head,"div").top+5,i=e.coordsChar({left:0,top:r},"div");return i.ch<e.getLine(i.line).search(/\S/)?ho(e,t.head):i},Re)},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=[],r=e.listSelections(),i=e.options.tabSize,d=0;d<r.length;d++){var D=r[d].from(),G=V(e.getLine(D.line),D.ch,i);t.push(X(i-G%i))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return En(e,function(){for(var t=e.listSelections(),r=[],i=0;i<t.length;i++){if(!t[i].empty())continue;var d=t[i].head,D=Ye(e.doc,d.line).text;if(D){if(d.ch==D.length&&(d=new Ke(d.line,d.ch-1)),d.ch>0)d=new Ke(d.line,d.ch+1),e.replaceRange(D.charAt(d.ch-1)+D.charAt(d.ch-2),Ke(d.line,d.ch-2),d,"+transpose");else if(d.line>e.doc.first){var G=Ye(e.doc,d.line-1).text;G&&(d=new Ke(d.line,1),e.replaceRange(D.charAt(0)+e.doc.lineSeparator()+G.charAt(G.length-1),Ke(d.line-1,G.length-1),d,"+transpose"))}}r.push(new Pt(d,d))}e.setSelections(r)})},newlineAndIndent:function(e){return En(e,function(){for(var t=e.listSelections(),r=t.length-1;r>=0;r--)e.replaceRange(e.doc.lineSeparator(),t[r].anchor,t[r].head,"+input");t=e.listSelections();for(var i=0;i<t.length;i++)e.indentLine(t[i].from().line,null,!0);ki(e)})},openLine:function(e){return e.replaceSelection(`
`,"start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function uo(e,t){var r=Ye(e.doc,t),i=Tn(r);return i!=r&&(t=pt(i)),Ba(!0,e,i,t,1)}function Pl(e,t){var r=Ye(e.doc,t),i=Pr(r);return i!=r&&(t=pt(i)),Ba(!0,e,r,t,-1)}function ho(e,t){var r=uo(e,t.line),i=Ye(e.doc,r.line),d=Ge(i,e.doc.direction);if(!d||d[0].level==0){var D=Math.max(r.ch,i.text.search(/\S/)),G=t.line==r.line&&t.ch<=D&&t.ch;return Ke(r.line,G?0:D,r.sticky)}return r}function ea(e,t,r){if(typeof t=="string"&&(t=xr[t],!t))return!1;e.display.input.ensurePolled();var i=e.display.shift,d=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),r&&(e.display.shift=!1),d=t(e)!=De}finally{e.display.shift=i,e.state.suppressEdits=!1}return d}function Nl(e,t,r){for(var i=0;i<e.state.keyMaps.length;i++){var d=ji(t,e.state.keyMaps[i],r,e);if(d)return d}return e.options.extraKeys&&ji(t,e.options.extraKeys,r,e)||ji(t,e.options.keyMap,r,e)}var Fl=new re;function Tr(e,t,r,i){var d=e.state.keySeq;if(d){if(so(t))return"handled";if(/\'$/.test(t)?e.state.keySeq=null:Fl.set(50,function(){e.state.keySeq==d&&(e.state.keySeq=null,e.display.input.reset())}),co(e,d+" "+t,r,i))return!0}return co(e,t,r,i)}function co(e,t,r,i){var d=Nl(e,t,i);return d=="multi"&&(e.state.keySeq=t),d=="handled"&&sn(e,"keyHandled",e,t,r),(d=="handled"||d=="multi")&&(ne(r),xa(e)),!!d}function fo(e,t){var r=lo(t,!0);return r?t.shiftKey&&!e.state.keySeq?Tr(e,"Shift-"+r,t,function(i){return ea(e,i,!0)})||Tr(e,r,t,function(i){if(typeof i=="string"?/^go[A-Z]/.test(i):i.motion)return ea(e,i)}):Tr(e,r,t,function(i){return ea(e,i)}):!1}function Ul(e,t,r){return Tr(e,"'"+r+"'",t,function(i){return ea(e,i,!0)})}var ja=null;function po(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(t.curOp.focus=F(),Z(t,e))return;W&&H<11&&e.keyCode==27&&(e.returnValue=!1);var r=e.keyCode;t.display.shift=r==16||e.shiftKey;var i=fo(t,e);f&&(ja=i?r:null,!i&&r==88&&!yt&&(a?e.metaKey:e.ctrlKey)&&t.replaceSelection("",null,"cut")),k&&!a&&!i&&r==46&&e.shiftKey&&!e.ctrlKey&&document.execCommand&&document.execCommand("cut"),r==18&&!/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)&&Bl(t)}function Bl(e){var t=e.display.lineDiv;B(t,"CodeMirror-crosshair");function r(i){(i.keyCode==18||!i.altKey)&&(S(t,"CodeMirror-crosshair"),Ze(document,"keyup",r),Ze(document,"mouseover",r))}ke(document,"keyup",r),ke(document,"mouseover",r)}function mo(e){e.keyCode==16&&(this.doc.sel.shift=!1),Z(this,e)}function go(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(Kn(t.display,e)||Z(t,e)||e.ctrlKey&&!e.altKey||a&&e.metaKey)return;var r=e.keyCode,i=e.charCode;if(f&&r==ja){ja=null,ne(e);return}if(f&&(!e.which||e.which<10)&&fo(t,e))return;var d=String.fromCharCode(i==null?r:i);if(d=="\b")return;if(Ul(t,e,d))return;t.display.input.onKeyPress(e)}var jl=400,Ha=function(e,t,r){this.time=e,this.pos=t,this.button=r};Ha.prototype.compare=function(e,t,r){return this.time+jl>e&&_t(t,this.pos)==0&&r==this.button};var wr,Sr;function Hl(e,t){var r=+new Date;return Sr&&Sr.compare(r,e,t)?(wr=Sr=null,"triple"):wr&&wr.compare(r,e,t)?(Sr=new Ha(r,e,t),wr=null,"double"):(wr=new Ha(r,e,t),Sr=null,"single")}function vo(e){var t=this,r=t.display;if(Z(t,e)||r.activeTouch&&r.input.supportsTouch())return;if(r.input.ensurePolled(),r.shift=e.shiftKey,Kn(r,e)){n||(r.scroller.draggable=!1,setTimeout(function(){return r.scroller.draggable=!0},100));return}if(Wa(t,e))return;var i=ci(t,e),d=Te(e),D=i?Hl(i,d):"single";if(window.focus(),d==1&&t.state.selectingText&&t.state.selectingText(e),i&&Wl(t,d,i,D,e))return;d==1?i?Kl(t,i,D,e):be(e)==r.scroller&&ne(e):d==2?(i&&Yr(t.doc,i),setTimeout(function(){return r.input.focus()},20)):d==3&&(O?t.display.input.onContextMenu(e):vs(t))}function Wl(e,t,r,i,d){var D="Click";return i=="double"?D="Double"+D:i=="triple"&&(D="Triple"+D),D=(t==1?"Left":t==2?"Middle":"Right")+D,Tr(e,oo(D,d),d,function(G){if(typeof G=="string"&&(G=xr[G]),!G)return!1;var Q=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),Q=G(e,r)!=De}finally{e.state.suppressEdits=!1}return Q})}function Gl(e,t,r){var i=e.getOption("configureMouse"),d=i?i(e,t,r):{};if(d.unit==null){var D=s?r.shiftKey&&r.metaKey:r.altKey;d.unit=D?"rectangle":t=="single"?"char":t=="double"?"word":"line"}return(d.extend==null||e.doc.extend)&&(d.extend=e.doc.extend||r.shiftKey),d.addNew==null&&(d.addNew=a?r.metaKey:r.ctrlKey),d.moveOnDrag==null&&(d.moveOnDrag=!(a?r.altKey:r.ctrlKey)),d}function Kl(e,t,r,i){W?setTimeout(P(gs,e),0):e.curOp.focus=F();var d=Gl(e,r,i),D=e.doc.sel,G;e.options.dragDrop&&Me&&!e.isReadOnly()&&r=="single"&&(G=D.contains(t))>-1&&(_t((G=D.ranges[G]).from(),t)<0||t.xRel>0)&&(_t(G.to(),t)>0||t.xRel<0)?zl(e,i,t,d):Vl(e,i,t,d)}function zl(e,t,r,i){var d=e.display,D=!1,G=en(e,function(se){n&&(d.scroller.draggable=!1),e.state.draggingText=!1,Ze(d.wrapper.ownerDocument,"mouseup",G),Ze(d.wrapper.ownerDocument,"mousemove",Q),Ze(d.scroller,"dragstart",ee),Ze(d.scroller,"drop",G),D||(ne(se),i.addNew||Yr(e.doc,r,null,null,i.extend),n&&!m||W&&H==9?setTimeout(function(){d.wrapper.ownerDocument.body.focus({preventScroll:!0}),d.input.focus()},20):d.input.focus())}),Q=function(se){D=D||Math.abs(t.clientX-se.clientX)+Math.abs(t.clientY-se.clientY)>=10},ee=function(){return D=!0};n&&(d.scroller.draggable=!0),e.state.draggingText=G,G.copy=!i.moveOnDrag,d.scroller.dragDrop&&d.scroller.dragDrop(),ke(d.wrapper.ownerDocument,"mouseup",G),ke(d.wrapper.ownerDocument,"mousemove",Q),ke(d.scroller,"dragstart",ee),ke(d.scroller,"drop",G),vs(e),setTimeout(function(){return d.input.focus()},20)}function yo(e,t,r){if(r=="char")return new Pt(t,t);if(r=="word")return e.findWordAt(t);if(r=="line")return new Pt(Ke(t.line,0),St(e.doc,Ke(t.line+1,0)));var i=r(e,t);return new Pt(i.from,i.to)}function Vl(e,t,r,i){var d=e.display,D=e.doc;ne(t);var G,Q,ee=D.sel,se=ee.ranges;if(i.addNew&&!i.extend?(Q=D.sel.contains(r),Q>-1?G=se[Q]:G=new Pt(r,r)):(G=D.sel.primary(),Q=D.sel.primIndex),i.unit=="rectangle")i.addNew||(G=new Pt(r,r)),r=ci(e,t,!0,!0),Q=-1;else{var ge=yo(e,r,i.unit);i.extend?G=Pa(G,ge.anchor,ge.head,i.extend):G=ge}i.addNew?Q==-1?(Q=se.length,un(D,Mn(e,se.concat([G]),Q),{scroll:!1,origin:"*mouse"})):se.length>1&&se[Q].empty()&&i.unit=="char"&&!i.extend?(un(D,Mn(e,se.slice(0,Q).concat(se.slice(Q+1)),0),{scroll:!1,origin:"*mouse"}),ee=D.sel):Na(D,Q,G,Le):(Q=0,un(D,new Sn([G],0),Le),ee=D.sel);var _e=r;function Oe(et){if(_t(_e,et)==0)return;if(_e=et,i.unit=="rectangle"){for(var st=[],vt=e.options.tabSize,ct=V(Ye(D,r.line).text,r.ch,vt),Ot=V(Ye(D,et.line).text,et.ch,vt),Ut=Math.min(ct,Ot),nn=Math.max(ct,Ot),Kt=Math.min(r.line,et.line),xn=Math.min(e.lastLine(),Math.max(r.line,et.line));Kt<=xn;Kt++){var yn=Ye(D,Kt).text,$t=Ie(yn,Ut,vt);Ut==nn?st.push(new Pt(Ke(Kt,$t),Ke(Kt,$t))):yn.length>$t&&st.push(new Pt(Ke(Kt,$t),Ke(Kt,Ie(yn,nn,vt))))}st.length||st.push(new Pt(r,r)),un(D,Mn(e,ee.ranges.slice(0,Q).concat(st),Q),{origin:"*mouse",scroll:!1}),e.scrollIntoView(et)}else{var bn=G,on=yo(e,et,i.unit),qt=bn.anchor,Jt;_t(on.anchor,qt)>0?(Jt=on.head,qt=ri(bn.from(),on.anchor)):(Jt=on.anchor,qt=Ei(bn.to(),on.head));var Xt=ee.ranges.slice(0);Xt[Q]=Xl(e,new Pt(St(D,qt),Jt)),un(D,Mn(e,Xt,Q),Le)}}var Ae=d.wrapper.getBoundingClientRect(),Fe=0;function We(et){var st=++Fe,vt=ci(e,et,!0,i.unit=="rectangle");if(!vt)return;if(_t(vt,_e)!=0){e.curOp.focus=F(),Oe(vt);var ct=Wr(d,D);(vt.line>=ct.to||vt.line<ct.from)&&setTimeout(en(e,function(){Fe==st&&We(et)}),150)}else{var Ot=et.clientY<Ae.top?-20:et.clientY>Ae.bottom?20:0;Ot&&setTimeout(en(e,function(){if(Fe!=st)return;d.scroller.scrollTop+=Ot,We(et)}),50)}}function Xe(et){e.state.selectingText=!1,Fe=Infinity,et&&(ne(et),d.input.focus()),Ze(d.wrapper.ownerDocument,"mousemove",qe),Ze(d.wrapper.ownerDocument,"mouseup",at),D.history.lastSelOrigin=null}var qe=en(e,function(et){et.buttons===0||!Te(et)?Xe(et):We(et)}),at=en(e,Xe);e.state.selectingText=at,ke(d.wrapper.ownerDocument,"mousemove",qe),ke(d.wrapper.ownerDocument,"mouseup",at)}function Xl(e,t){var r=t.anchor,i=t.head,d=Ye(e.doc,r.line);if(_t(r,i)==0&&r.sticky==i.sticky)return t;var D=Ge(d);if(!D)return t;var G=He(D,r.ch,r.sticky),Q=D[G];if(Q.from!=r.ch&&Q.to!=r.ch)return t;var ee=G+(Q.from==r.ch==(Q.level!=1)?0:1);if(ee==0||ee==D.length)return t;var se;if(i.line!=r.line)se=(i.line-r.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var ge=He(D,i.ch,i.sticky),_e=ge-G||(i.ch-r.ch)*(Q.level==1?-1:1);ge==ee-1||ge==ee?se=_e<0:se=_e>0}var Oe=D[ee+(se?-1:0)],Ae=se==(Oe.level==1),Fe=Ae?Oe.from:Oe.to,We=Ae?"after":"before";return r.ch==Fe&&r.sticky==We?t:new Pt(new Ke(r.line,Fe,We),i)}function bo(e,t,r,i){var d,D;if(t.touches)d=t.touches[0].clientX,D=t.touches[0].clientY;else try{d=t.clientX,D=t.clientY}catch(Oe){return!1}if(d>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;i&&ne(t);var G=e.display,Q=G.lineDiv.getBoundingClientRect();if(D>Q.bottom||!ae(e,r))return de(t);D-=Q.top-G.viewOffset;for(var ee=0;ee<e.display.gutterSpecs.length;++ee){var se=G.gutters.childNodes[ee];if(se&&se.getBoundingClientRect().right>=d){var ge=ft(e.doc,D),_e=e.display.gutterSpecs[ee];return le(e,r,e,ge,_e.className,t),de(t)}}}function Wa(e,t){return bo(e,t,"gutterClick",!0)}function _o(e,t){if(Kn(e.display,t)||Yl(e,t))return;if(Z(e,t,"contextmenu"))return;O||e.display.input.onContextMenu(t)}function Yl(e,t){return ae(e,"gutterContextMenu")?bo(e,t,"gutterContextMenu",!1):!1}function Eo(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),ar(e)}var Wi={toString:function(){return"CodeMirror.Init"}},xo={},ta={};function $l(e){var t=e.optionHandlers;function r(i,d,D,G){e.defaults[i]=d,D&&(t[i]=G?function(Q,ee,se){se!=Wi&&D(Q,ee,se)}:D)}e.defineOption=r,e.Init=Wi,r("value","",function(i,d){return i.setValue(d)},!0),r("mode",null,function(i,d){i.doc.modeOption=d,Da(i)},!0),r("indentUnit",2,Da,!0),r("indentWithTabs",!1),r("smartIndent",!0),r("tabSize",4,function(i){fr(i),ar(i),gn(i)},!0),r("lineSeparator",null,function(i,d){if(i.doc.lineSep=d,!d)return;var D=[],G=i.doc.first;i.doc.iter(function(ee){for(var se=0;;){var ge=ee.text.indexOf(d,se);if(ge==-1)break;se=ge+d.length,D.push(Ke(G,ge))}G++});for(var Q=D.length-1;Q>=0;Q--)Ui(i.doc,d,D[Q],Ke(D[Q].line,D[Q].ch+d.length))}),r("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200c\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,function(i,d,D){i.state.specialChars=new RegExp(d.source+(d.test(" ")?"":"| "),"g"),D!=Wi&&i.refresh()}),r("specialCharPlaceholder",Ft,function(i){return i.refresh()},!0),r("electricChars",!0),r("inputStyle",u?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),r("spellcheck",!1,function(i,d){return i.getInputField().spellcheck=d},!0),r("autocorrect",!1,function(i,d){return i.getInputField().autocorrect=d},!0),r("autocapitalize",!1,function(i,d){return i.getInputField().autocapitalize=d},!0),r("rtlMoveVisually",!C),r("wholeLineUpdateBefore",!0),r("theme","default",function(i){Eo(i),cr(i)},!0),r("keyMap","default",function(i,d,D){var G=qr(d),Q=D!=Wi&&qr(D);Q&&Q.detach&&Q.detach(i,G),G.attach&&G.attach(i,Q||null)}),r("extraKeys",null),r("configureMouse",null),r("lineWrapping",!1,Ql,!0),r("gutters",[],function(i,d){i.display.gutterSpecs=La(d,i.options.lineNumbers),cr(i)},!0),r("fixedGutter",!0,function(i,d){i.display.gutters.style.left=d?_a(i.display)+"px":"0",i.refresh()},!0),r("coverGutterNextToScrollbar",!1,function(i){return Mi(i)},!0),r("scrollbarStyle","native",function(i){Ts(i),Mi(i),i.display.scrollbars.setScrollTop(i.doc.scrollTop),i.display.scrollbars.setScrollLeft(i.doc.scrollLeft)},!0),r("lineNumbers",!1,function(i,d){i.display.gutterSpecs=La(i.options.gutters,d),cr(i)},!0),r("firstLineNumber",1,cr,!0),r("lineNumberFormatter",function(i){return i},cr,!0),r("showCursorWhenSelecting",!1,sr,!0),r("resetSelectionOnContextMenu",!0),r("lineWiseCopyCut",!0),r("pasteLinesPerSelection",!0),r("selectionsMayTouch",!1),r("readOnly",!1,function(i,d){d=="nocursor"&&(Di(i),i.display.input.blur()),i.display.input.readOnlyChanged(d)}),r("screenReaderLabel",null,function(i,d){d=d===""?null:d,i.display.input.screenReaderLabelChanged(d)}),r("disableInput",!1,function(i,d){d||i.display.input.reset()},!0),r("dragDrop",!0,Jl),r("allowDropFileTypes",null),r("cursorBlinkRate",530),r("cursorScrollMargin",0),r("cursorHeight",1,sr,!0),r("singleCursorHeightPerLine",!0,sr,!0),r("workTime",100),r("workDelay",100),r("flattenSpans",!0,fr,!0),r("addModeClass",!1,fr,!0),r("pollInterval",100),r("undoDepth",200,function(i,d){return i.doc.history.undoDepth=d}),r("historyEventDelay",1250),r("viewportMargin",10,function(i){return i.refresh()},!0),r("maxHighlightLength",1e4,fr,!0),r("moveInputWithCursor",!0,function(i,d){d||i.display.input.resetPosition()}),r("tabindex",null,function(i,d){return i.display.input.getField().tabIndex=d||""}),r("autofocus",null),r("direction","ltr",function(i,d){return i.doc.setDirection(d)},!0),r("phrases",null)}function Jl(e,t,r){var i=r&&r!=Wi;if(!t!=!i){var d=e.display.dragFunctions,D=t?ke:Ze;D(e.display.scroller,"dragstart",d.start),D(e.display.scroller,"dragenter",d.enter),D(e.display.scroller,"dragover",d.over),D(e.display.scroller,"dragleave",d.leave),D(e.display.scroller,"drop",d.drop)}}function Ql(e){e.options.lineWrapping?(B(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(S(e.display.wrapper,"CodeMirror-wrap"),Nr(e)),Ea(e),gn(e),ar(e),setTimeout(function(){return Mi(e)},100)}function Wt(e,t){var r=this;if(!(this instanceof Wt))return new Wt(e,t);this.options=t=t?b(t):{},b(xo,t,!1);var i=t.value;typeof i=="string"?i=new vn(i,t.mode,null,t.lineSeparator,t.direction):t.mode&&(i.modeOption=t.mode),this.doc=i;var d=new Wt.inputStyles[t.inputStyle](this),D=this.display=new hl(e,i,d,t);D.wrapper.CodeMirror=this,Eo(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),Ts(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:-1,cutIncoming:-1,selectingText:!1,draggingText:!1,highlight:new re,keySeq:null,specialChars:null},t.autofocus&&!u&&D.input.focus(),W&&H<11&&setTimeout(function(){return r.display.input.reset(!0)},20),Zl(this),Ol(),gi(this),this.curOp.forceUpdate=!0,ks(this,i),t.autofocus&&!u||this.hasFocus()?setTimeout(function(){r.hasFocus()&&!r.state.focused&&Ta(r)},20):Di(this);for(var G in ta)ta.hasOwnProperty(G)&&ta[G](this,t[G],Wi);Cs(this),t.finishInit&&t.finishInit(this);for(var Q=0;Q<Ga.length;++Q)Ga[Q](this);vi(this),n&&t.lineWrapping&&getComputedStyle(D.lineDiv).textRendering=="optimizelegibility"&&(D.lineDiv.style.textRendering="auto")}Wt.defaults=xo,Wt.optionHandlers=ta;function Zl(e){var t=e.display;ke(t.scroller,"mousedown",en(e,vo)),W&&H<11?ke(t.scroller,"dblclick",en(e,function(ee){if(Z(e,ee))return;var se=ci(e,ee);if(!se||Wa(e,ee)||Kn(e.display,ee))return;ne(ee);var ge=e.findWordAt(se);Yr(e.doc,ge.anchor,ge.head)})):ke(t.scroller,"dblclick",function(ee){return Z(e,ee)||ne(ee)}),ke(t.scroller,"contextmenu",function(ee){return _o(e,ee)}),ke(t.input.getField(),"contextmenu",function(ee){t.scroller.contains(ee.target)||_o(e,ee)});var r,i={end:0};function d(){t.activeTouch&&(r=setTimeout(function(){return t.activeTouch=null},1e3),i=t.activeTouch,i.end=+new Date)}function D(ee){if(ee.touches.length!=1)return!1;var se=ee.touches[0];return se.radiusX<=1&&se.radiusY<=1}function G(ee,se){if(se.left==null)return!0;var ge=se.left-ee.left,_e=se.top-ee.top;return ge*ge+_e*_e>20*20}ke(t.scroller,"touchstart",function(ee){if(!Z(e,ee)&&!D(ee)&&!Wa(e,ee)){t.input.ensurePolled(),clearTimeout(r);var se=+new Date;t.activeTouch={start:se,moved:!1,prev:se-i.end<=300?i:null},ee.touches.length==1&&(t.activeTouch.left=ee.touches[0].pageX,t.activeTouch.top=ee.touches[0].pageY)}}),ke(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),ke(t.scroller,"touchend",function(ee){var se=t.activeTouch;if(se&&!Kn(t,ee)&&se.left!=null&&!se.moved&&new Date-se.start<300){var ge=e.coordsChar(t.activeTouch,"page"),_e;!se.prev||G(se,se.prev)?_e=new Pt(ge,ge):!se.prev.prev||G(se,se.prev.prev)?_e=e.findWordAt(ge):_e=new Pt(Ke(ge.line,0),St(e.doc,Ke(ge.line+1,0))),e.setSelection(_e.anchor,_e.head),e.focus(),ne(ee)}d()}),ke(t.scroller,"touchcancel",d),ke(t.scroller,"scroll",function(){t.scroller.clientHeight&&(lr(e,t.scroller.scrollTop),pi(e,t.scroller.scrollLeft,!0),le(e,"scroll",e))}),ke(t.scroller,"mousewheel",function(ee){return Os(e,ee)}),ke(t.scroller,"DOMMouseScroll",function(ee){return Os(e,ee)}),ke(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(ee){Z(e,ee)||fe(ee)},over:function(ee){Z(e,ee)||(Rl(e,ee),fe(ee))},start:function(ee){return Al(e,ee)},drop:en(e,Cl),leave:function(ee){Z(e,ee)||io(e)}};var Q=t.input.getField();ke(Q,"keyup",function(ee){return mo.call(e,ee)}),ke(Q,"keydown",en(e,po)),ke(Q,"keypress",en(e,go)),ke(Q,"focus",function(ee){return Ta(e,ee)}),ke(Q,"blur",function(ee){return Di(e,ee)})}var Ga=[];Wt.defineInitHook=function(e){return Ga.push(e)};function Cr(e,t,r,i){var d=e.doc,D;r==null&&(r="add"),r=="smart"&&(d.mode.indent?D=Rn(e,t).state:r="prev");var G=e.options.tabSize,Q=Ye(d,t),ee=V(Q.text,null,G);Q.stateAfter&&(Q.stateAfter=null);var se=Q.text.match(/^\s*/)[0],ge;if(!i&&!/\S/.test(Q.text))ge=0,r="not";else if(r=="smart"&&(ge=d.mode.indent(D,Q.text.slice(se.length),Q.text),ge==De||ge>150)){if(!i)return;r="prev"}r=="prev"?t>d.first?ge=V(Ye(d,t-1).text,null,G):ge=0:r=="add"?ge=ee+e.options.indentUnit:r=="subtract"?ge=ee-e.options.indentUnit:typeof r=="number"&&(ge=ee+r),ge=Math.max(0,ge);var _e="",Oe=0;if(e.options.indentWithTabs)for(var Ae=Math.floor(ge/G);Ae;--Ae)Oe+=G,_e+=" ";if(Oe<ge&&(_e+=X(ge-Oe)),_e!=se)return Ui(d,_e,Ke(t,0),Ke(t,se.length),"+input"),Q.stateAfter=null,!0;for(var Fe=0;Fe<d.sel.ranges.length;Fe++){var We=d.sel.ranges[Fe];if(We.head.line==t&&We.head.ch<se.length){var Xe=Ke(t,se.length);Na(d,Fe,new Pt(Xe,Xe));break}}}var Pn=null;function na(e){Pn=e}function Ka(e,t,r,i,d){var D=e.doc;e.display.shift=!1,i||(i=D.sel);var G=+new Date-200,Q=d=="paste"||e.state.pasteIncoming>G,ee=ot(t),se=null;if(Q&&i.ranges.length>1)if(Pn&&Pn.text.join(`
`)==t){if(i.ranges.length%Pn.text.length==0){se=[];for(var ge=0;ge<Pn.text.length;ge++)se.push(D.splitLines(Pn.text[ge]))}}else ee.length==i.ranges.length&&e.options.pasteLinesPerSelection&&(se=N(ee,function(qe){return[qe]}));for(var _e=e.curOp.updateInput,Oe=i.ranges.length-1;Oe>=0;Oe--){var Ae=i.ranges[Oe],Fe=Ae.from(),We=Ae.to();Ae.empty()&&(r&&r>0?Fe=Ke(Fe.line,Fe.ch-r):e.state.overwrite&&!Q?We=Ke(We.line,Math.min(Ye(D,We.line).text.length,We.ch+M(ee).length)):Q&&Pn&&Pn.lineWise&&Pn.text.join(`
`)==ee.join(`
`)&&(Fe=We=Ke(Fe.line,0)));var Xe={from:Fe,to:We,text:se?se[Oe%se.length]:ee,origin:d||(Q?"paste":e.state.cutIncoming>G?"cut":"+input")};Fi(e.doc,Xe),sn(e,"inputRead",e,Xe)}t&&!Q&&wo(e,t),ki(e),e.curOp.updateInput<2&&(e.curOp.updateInput=_e),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function To(e,t){var r=e.clipboardData&&e.clipboardData.getData("Text");if(r)return e.preventDefault(),!t.isReadOnly()&&!t.options.disableInput&&En(t,function(){return Ka(t,r,0,null,"paste")}),!0}function wo(e,t){if(!e.options.electricChars||!e.options.smartIndent)return;for(var r=e.doc.sel,i=r.ranges.length-1;i>=0;i--){var d=r.ranges[i];if(d.head.ch>100||i&&r.ranges[i-1].head.line==d.head.line)continue;var D=e.getModeAt(d.head),G=!1;if(D.electricChars){for(var Q=0;Q<D.electricChars.length;Q++)if(t.indexOf(D.electricChars.charAt(Q))>-1){G=Cr(e,d.head.line,"smart");break}}else D.electricInput&&(D.electricInput.test(Ye(e.doc,d.head.line).text.slice(0,d.head.ch))&&(G=Cr(e,d.head.line,"smart")));G&&sn(e,"electricInput",e,d.head.line)}}function So(e){for(var t=[],r=[],i=0;i<e.doc.sel.ranges.length;i++){var d=e.doc.sel.ranges[i].head.line,D={anchor:Ke(d,0),head:Ke(d+1,0)};r.push(D),t.push(e.getRange(D.anchor,D.head))}return{text:t,ranges:r}}function Co(e,t,r,i){e.setAttribute("autocorrect",r?"":"off"),e.setAttribute("autocapitalize",i?"":"off"),e.setAttribute("spellcheck",!!t)}function Ao(){var e=c("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),t=c("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return n?e.style.width="1000px":e.setAttribute("wrap","off"),p&&(e.style.border="1px solid black"),Co(e),t}function ql(e){var t=e.optionHandlers,r=e.helpers={};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(i,d){var D=this.options,G=D[i];if(D[i]==d&&i!="mode")return;D[i]=d,t.hasOwnProperty(i)&&en(this,t[i])(this,d,G),le(this,"optionChange",this,i)},getOption:function(i){return this.options[i]},getDoc:function(){return this.doc},addKeyMap:function(i,d){this.state.keyMaps[d?"push":"unshift"](qr(i))},removeKeyMap:function(i){for(var d=this.state.keyMaps,D=0;D<d.length;++D)if(d[D]==i||d[D].name==i)return d.splice(D,1),!0},addOverlay:cn(function(i,d){var D=i.token?i:e.getMode(this.options,i);if(D.startState)throw new Error("Overlays may not be stateful.");Y(this.state.overlays,{mode:D,modeSpec:i,opaque:d&&d.opaque,priority:d&&d.priority||0},function(G){return G.priority}),this.state.modeGen++,gn(this)}),removeOverlay:cn(function(i){for(var d=this.state.overlays,D=0;D<d.length;++D){var G=d[D].modeSpec;if(G==i||typeof i=="string"&&G.name==i){d.splice(D,1),this.state.modeGen++,gn(this);return}}}),indentLine:cn(function(i,d,D){typeof d!="string"&&typeof d!="number"&&(d==null?d=this.options.smartIndent?"smart":"prev":d=d?"add":"subtract"),Vt(this.doc,i)&&Cr(this,i,d,D)}),indentSelection:cn(function(i){for(var d=this.doc.sel.ranges,D=-1,G=0;G<d.length;G++){var Q=d[G];if(Q.empty())Q.head.line>D&&(Cr(this,Q.head.line,i,!0),D=Q.head.line,G==this.doc.sel.primIndex&&ki(this));else{var ee=Q.from(),se=Q.to(),ge=Math.max(D,ee.line);D=Math.min(this.lastLine(),se.line-(se.ch?0:1))+1;for(var _e=ge;_e<D;++_e)Cr(this,_e,i);var Oe=this.doc.sel.ranges;ee.ch==0&&d.length==Oe.length&&Oe[G].from().ch>0&&Na(this.doc,G,new Pt(ee,Oe[G].to()),we)}}}),getTokenAt:function(i,d){return Rr(this,i,d)},getLineTokens:function(i,d){return Rr(this,Ke(i),d,!0)},getTokenTypeAt:function(i){i=St(this.doc,i);var d=ai(this,Ye(this.doc,i.line)),D=0,G=(d.length-1)/2,Q=i.ch,ee;if(Q==0)ee=d[2];else for(;;){var se=D+G>>1;if((se?d[se*2-1]:0)>=Q)G=se;else if(d[se*2+1]<Q)D=se+1;else{ee=d[se*2+2];break}}var ge=ee?ee.indexOf("overlay "):-1;return ge<0?ee:ge==0?null:ee.slice(0,ge-1)},getModeAt:function(i){var d=this.doc.mode;return d.innerMode?e.innerMode(d,this.getTokenAt(i).state).mode:d},getHelper:function(i,d){return this.getHelpers(i,d)[0]},getHelpers:function(i,d){var D=[];if(!r.hasOwnProperty(d))return D;var G=r[d],Q=this.getModeAt(i);if(typeof Q[d]=="string")G[Q[d]]&&D.push(G[Q[d]]);else if(Q[d])for(var ee=0;ee<Q[d].length;ee++){var se=G[Q[d][ee]];se&&D.push(se)}else Q.helperType&&G[Q.helperType]?D.push(G[Q.helperType]):G[Q.name]&&D.push(G[Q.name]);for(var ge=0;ge<G._global.length;ge++){var _e=G._global[ge];_e.pred(Q,this)&&ce(D,_e.val)==-1&&D.push(_e.val)}return D},getStateAfter:function(i,d){var D=this.doc;return i=xi(D,i==null?D.first+D.size-1:i),Rn(this,i+1,d).state},cursorCoords:function(i,d){var D,G=this.doc.sel.primary();return i==null?D=G.head:typeof i=="object"?D=St(this.doc,i):D=i?G.from():G.to(),kn(this,D,d||"page")},charCoords:function(i,d){return ma(this,St(this.doc,i),d||"page")},coordsChar:function(i,d){return i=ls(this,i,d||"page"),va(this,i.left,i.top)},lineAtHeight:function(i,d){return i=ls(this,{top:i,left:0},d||"page").top,ft(this.doc,i+this.display.viewOffset)},heightAtLine:function(i,d,D){var G=!1,Q;if(typeof i=="number"){var ee=this.doc.first+this.doc.size-1;i<this.doc.first?i=this.doc.first:i>ee&&(i=ee,G=!0),Q=Ye(this.doc,i)}else Q=i;return Ur(this,Q,{top:0,left:0},d||"page",D||G).top+(G?this.doc.height-Dn(Q):0)},defaultTextHeight:function(){return Li(this.display)},defaultCharWidth:function(){return Ii(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(i,d,D,G,Q){var ee=this.display;i=kn(this,St(this.doc,i));var se=i.bottom,ge=i.left;if(d.style.position="absolute",d.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(d),ee.sizer.appendChild(d),G=="over")se=i.top;else if(G=="above"||G=="near"){var _e=Math.max(ee.wrapper.clientHeight,this.doc.height),Oe=Math.max(ee.sizer.clientWidth,ee.lineSpace.clientWidth);(G=="above"||i.bottom+d.offsetHeight>_e)&&i.top>d.offsetHeight?se=i.top-d.offsetHeight:i.bottom+d.offsetHeight<=_e&&(se=i.bottom),ge+d.offsetWidth>Oe&&(ge=Oe-d.offsetWidth)}d.style.top=se+"px",d.style.left=d.style.right="",Q=="right"?(ge=ee.sizer.clientWidth-d.offsetWidth,d.style.right="0px"):(Q=="left"?ge=0:Q=="middle"&&(ge=(ee.sizer.clientWidth-d.offsetWidth)/2),d.style.left=ge+"px"),D&&Jo(this,{left:ge,top:se,right:ge+d.offsetWidth,bottom:se+d.offsetHeight})},triggerOnKeyDown:cn(po),triggerOnKeyPress:cn(go),triggerOnKeyUp:mo,triggerOnMouseDown:cn(vo),execCommand:function(i){if(xr.hasOwnProperty(i))return xr[i].call(null,this)},triggerElectric:cn(function(i){wo(this,i)}),findPosH:function(i,d,D,G){var Q=1;d<0&&(Q=-1,d=-d);for(var ee=St(this.doc,i),se=0;se<d&&!(ee=za(this.doc,ee,Q,D,G),ee.hitSide);++se);return ee},moveH:cn(function(i,d){var D=this;this.extendSelectionsBy(function(G){return D.display.shift||D.doc.extend||G.empty()?za(D.doc,G.head,i,d,D.options.rtlMoveVisually):i<0?G.from():G.to()},Re)}),deleteH:cn(function(i,d){var D=this.doc.sel,G=this.doc;D.somethingSelected()?G.replaceSelection("",null,"+delete"):Hi(this,function(Q){var ee=za(G,Q.head,i,d,!1);return i<0?{from:ee,to:Q.head}:{from:Q.head,to:ee}})}),findPosV:function(i,d,D,G){var Q=1,ee=G;d<0&&(Q=-1,d=-d);for(var se=St(this.doc,i),ge=0;ge<d;++ge){var _e=kn(this,se,"div");if(ee==null?ee=_e.left:_e.left=ee,se=Ro(this,_e,Q,D),se.hitSide)break}return se},moveV:cn(function(i,d){var D=this,G=this.doc,Q=[],ee=!this.display.shift&&!G.extend&&G.sel.somethingSelected();if(G.extendSelectionsBy(function(ge){if(ee)return i<0?ge.from():ge.to();var _e=kn(D,ge.head,"div");ge.goalColumn!=null&&(_e.left=ge.goalColumn),Q.push(_e.left);var Oe=Ro(D,_e,i,d);return d=="page"&&ge==G.sel.primary()&&Sa(D,ma(D,Oe,"div").top-_e.top),Oe},Re),Q.length)for(var se=0;se<G.sel.ranges.length;se++)G.sel.ranges[se].goalColumn=Q[se]}),findWordAt:function(i){var d=this.doc,D=Ye(d,i.line).text,G=i.ch,Q=i.ch;if(D){var ee=this.getHelper(i,"wordChars");(i.sticky=="before"||Q==D.length)&&G?--G:++Q;for(var se=D.charAt(G),ge=Pe(se,ee)?function(_e){return Pe(_e,ee)}:/\s/.test(se)?function(_e){return/\s/.test(_e)}:function(_e){return!/\s/.test(_e)&&!Pe(_e)};G>0&&ge(D.charAt(G-1));)--G;for(;Q<D.length&&ge(D.charAt(Q));)++Q}return new Pt(Ke(i.line,G),Ke(i.line,Q))},toggleOverwrite:function(i){if(i!=null&&i==this.state.overwrite)return;(this.state.overwrite=!this.state.overwrite)?B(this.display.cursorDiv,"CodeMirror-overwrite"):S(this.display.cursorDiv,"CodeMirror-overwrite"),le(this,"overwriteToggle",this,this.state.overwrite)},hasFocus:function(){return this.display.input.getField()==F()},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:cn(function(i,d){or(this,i,d)}),getScrollInfo:function(){var i=this.display.scroller;return{left:i.scrollLeft,top:i.scrollTop,height:i.scrollHeight-Fn(this)-this.display.barHeight,width:i.scrollWidth-Fn(this)-this.display.barWidth,clientHeight:ca(this),clientWidth:hi(this)}},scrollIntoView:cn(function(i,d){i==null?(i={from:this.doc.sel.primary().head,to:null},d==null&&(d=this.options.cursorScrollMargin)):typeof i=="number"?i={from:Ke(i,0),to:null}:i.from==null&&(i={from:i,to:null}),i.to||(i.to=i.from),i.margin=d||0,i.from.line!=null?Qo(this,i):bs(this,i.from,i.to,i.margin)}),setSize:cn(function(i,d){var D=this,G=function(ee){return typeof ee=="number"||/^\d+$/.test(String(ee))?ee+"px":ee};i!=null&&(this.display.wrapper.style.width=G(i)),d!=null&&(this.display.wrapper.style.height=G(d)),this.options.lineWrapping&&as(this);var Q=this.display.viewFrom;this.doc.iter(Q,this.display.viewTo,function(ee){if(ee.widgets){for(var se=0;se<ee.widgets.length;se++)if(ee.widgets[se].noHScroll){$n(D,Q,"widget");break}}++Q}),this.curOp.forceUpdate=!0,le(this,"refresh",this)}),operation:function(i){return En(this,i)},startOperation:function(){return gi(this)},endOperation:function(){return vi(this)},refresh:cn(function(){var i=this.display.cachedTextHeight;gn(this),this.curOp.forceUpdate=!0,ar(this),or(this,this.doc.scrollLeft,this.doc.scrollTop),Ra(this.display),(i==null||Math.abs(i-Li(this.display))>.5||this.options.lineWrapping)&&Ea(this),le(this,"refresh",this)}),swapDoc:cn(function(i){var d=this.doc;return d.cm=null,this.state.selectingText&&this.state.selectingText(),ks(this,i),ar(this),this.display.input.reset(),or(this,i.scrollLeft,i.scrollTop),this.curOp.forceScroll=!0,sn(this,"swapDoc",this,d),d}),phrase:function(i){var d=this.options.phrases;return d&&Object.prototype.hasOwnProperty.call(d,i)?d[i]:i},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}},ue(e),e.registerHelper=function(i,d,D){r.hasOwnProperty(i)||(r[i]=e[i]={_global:[]}),r[i][d]=D},e.registerGlobalHelper=function(i,d,D,G){e.registerHelper(i,d,G),r[i]._global.push({pred:D,val:G})}}function za(e,t,r,i,d){var D=t,G=r,Q=Ye(e,t.line),ee=d&&e.direction=="rtl"?-r:r;function se(){var at=t.line+ee;return at<e.first||at>=e.first+e.size?!1:(t=new Ke(at,t.ch,t.sticky),Q=Ye(e,at))}function ge(at){var et;if(i=="codepoint"){var st=Q.text.charCodeAt(t.ch+(i>0?0:-1));isNaN(st)?et=null:et=new Ke(t.line,Math.max(0,Math.min(Q.text.length,t.ch+r*(st>=55296&&st<56320?2:1))),-r)}else d?et=Ml(e.cm,Q,t,r):et=Ua(Q,t,r);if(et==null)if(!at&&se())t=Ba(d,e.cm,Q,t.line,ee);else return!1;else t=et;return!0}if(i=="char"||i=="codepoint")ge();else if(i=="column")ge(!0);else if(i=="word"||i=="group")for(var _e=null,Oe=i=="group",Ae=e.cm&&e.cm.getHelper(t,"wordChars"),Fe=!0;!(r<0&&!ge(!Fe));Fe=!1){var We=Q.text.charAt(t.ch)||`
`,Xe=Pe(We,Ae)?"w":Oe&&We==`
`?"n":!Oe||/\s/.test(We)?null:"p";if(Oe&&!Fe&&!Xe&&(Xe="s"),_e&&_e!=Xe){r<0&&(r=1,ge(),t.sticky="after");break}if(Xe&&(_e=Xe),r>0&&!ge(!Fe))break}var qe=Jr(e,t,D,G,!0);return ii(D,qe)&&(qe.hitSide=!0),qe}function Ro(e,t,r,i){var d=e.doc,D=t.left,G;if(i=="page"){var Q=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),ee=Math.max(Q-.5*Li(e.display),3);G=(r>0?t.bottom:t.top)+r*ee}else i=="line"&&(G=r>0?t.bottom+3:t.top-3);for(var se;!(se=va(e,D,G),!se.outside);){if(r<0?G<=0:G>=d.height){se.hitSide=!0;break}G+=r*5}return se}var Nt=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new re,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};Nt.prototype.init=function(e){var t=this,r=this,i=r.cm,d=r.div=e.lineDiv;Co(d,i.options.spellcheck,i.options.autocorrect,i.options.autocapitalize);function D(Q){for(var ee=Q.target;ee;ee=ee.parentNode){if(ee==d)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(ee.className))break}return!1}ke(d,"paste",function(Q){if(!D(Q)||Z(i,Q)||To(Q,i))return;H<=11&&setTimeout(en(i,function(){return t.updateFromDOM()}),20)}),ke(d,"compositionstart",function(Q){t.composing={data:Q.data,done:!1}}),ke(d,"compositionupdate",function(Q){t.composing||(t.composing={data:Q.data,done:!1})}),ke(d,"compositionend",function(Q){t.composing&&(Q.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),ke(d,"touchstart",function(){return r.forceCompositionEnd()}),ke(d,"input",function(){t.composing||t.readFromDOMSoon()});function G(Q){if(!D(Q)||Z(i,Q))return;if(i.somethingSelected())na({lineWise:!1,text:i.getSelections()}),Q.type=="cut"&&i.replaceSelection("",null,"cut");else if(i.options.lineWiseCopyCut){var ee=So(i);na({lineWise:!0,text:ee.text}),Q.type=="cut"&&i.operation(function(){i.setSelections(ee.ranges,0,we),i.replaceSelection("",null,"cut")})}else return;if(Q.clipboardData){Q.clipboardData.clearData();var se=Pn.text.join(`
`);if(Q.clipboardData.setData("Text",se),Q.clipboardData.getData("Text")==se){Q.preventDefault();return}}var ge=Ao(),_e=ge.firstChild;i.display.lineSpace.insertBefore(ge,i.display.lineSpace.firstChild),_e.value=Pn.text.join(`
`);var Oe=document.activeElement;j(_e),setTimeout(function(){i.display.lineSpace.removeChild(ge),Oe.focus(),Oe==d&&r.showPrimarySelection()},50)}ke(d,"copy",G),ke(d,"cut",G)},Nt.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},Nt.prototype.prepareSelection=function(){var e=ps(this.cm,!1);return e.focus=document.activeElement==this.div,e},Nt.prototype.showSelection=function(e,t){if(!e||!this.cm.display.view.length)return;(e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e)},Nt.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},Nt.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,r=t.doc.sel.primary(),i=r.from(),d=r.to();if(t.display.viewTo==t.display.viewFrom||i.line>=t.display.viewTo||d.line<t.display.viewFrom){e.removeAllRanges();return}var D=ia(t,e.anchorNode,e.anchorOffset),G=ia(t,e.focusNode,e.focusOffset);if(D&&!D.bad&&G&&!G.bad&&_t(ri(D,G),i)==0&&_t(Ei(D,G),d)==0)return;var Q=t.display.view,ee=i.line>=t.display.viewFrom&&Oo(t,i)||{node:Q[0].measure.map[2],offset:0},se=d.line<t.display.viewTo&&Oo(t,d);if(!se){var ge=Q[Q.length-1].measure,_e=ge.maps?ge.maps[ge.maps.length-1]:ge.map;se={node:_e[_e.length-1],offset:_e[_e.length-2]-_e[_e.length-3]}}if(!ee||!se){e.removeAllRanges();return}var Oe=e.rangeCount&&e.getRangeAt(0),Ae;try{Ae=v(ee.node,ee.offset,se.offset,se.node)}catch(Fe){}Ae&&(!k&&t.state.focused?(e.collapse(ee.node,ee.offset),Ae.collapsed||(e.removeAllRanges(),e.addRange(Ae))):(e.removeAllRanges(),e.addRange(Ae)),Oe&&e.anchorNode==null?e.addRange(Oe):k&&this.startGracePeriod()),this.rememberSelection()},Nt.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)},Nt.prototype.showMultipleSelections=function(e){E(this.cm.display.cursorDiv,e.cursors),E(this.cm.display.selectionDiv,e.selection)},Nt.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},Nt.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return y(this.div,t)},Nt.prototype.focus=function(){this.cm.options.readOnly!="nocursor"&&((!this.selectionInEditor()||document.activeElement!=this.div)&&this.showSelection(this.prepareSelection(),!0),this.div.focus())},Nt.prototype.blur=function(){this.div.blur()},Nt.prototype.getField=function(){return this.div},Nt.prototype.supportsTouch=function(){return!0},Nt.prototype.receivedFocus=function(){var e=this;this.selectionInEditor()?this.pollSelection():En(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)},Nt.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},Nt.prototype.pollSelection=function(){if(this.readDOMTimeout!=null||this.gracePeriod||!this.selectionChanged())return;var e=this.getSelection(),t=this.cm;if(l&&g&&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 r=ia(t,e.anchorNode,e.anchorOffset),i=ia(t,e.focusNode,e.focusOffset);r&&i&&En(t,function(){un(t.doc,Qn(r,i),we),(r.bad||i.bad)&&(t.curOp.selectionChanged=!0)})},Nt.prototype.pollContent=function(){this.readDOMTimeout!=null&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e=this.cm,t=e.display,r=e.doc.sel.primary(),i=r.from(),d=r.to();if(i.ch==0&&i.line>e.firstLine()&&(i=Ke(i.line-1,Ye(e.doc,i.line-1).length)),d.ch==Ye(e.doc,d.line).text.length&&d.line<e.lastLine()&&(d=Ke(d.line+1,0)),i.line<t.viewFrom||d.line>t.viewTo-1)return!1;var D,G,Q;i.line==t.viewFrom||(D=fi(e,i.line))==0?(G=pt(t.view[0].line),Q=t.view[0].node):(G=pt(t.view[D].line),Q=t.view[D-1].node.nextSibling);var ee=fi(e,d.line),se,ge;if(ee==t.view.length-1?(se=t.viewTo-1,ge=t.lineDiv.lastChild):(se=pt(t.view[ee+1].line)-1,ge=t.view[ee+1].node.previousSibling),!Q)return!1;for(var _e=e.doc.splitLines(tu(e,Q,ge,G,se)),Oe=Et(e.doc,Ke(G,0),Ke(se,Ye(e.doc,se).text.length));_e.length>1&&Oe.length>1;)if(M(_e)==M(Oe))_e.pop(),Oe.pop(),se--;else if(_e[0]==Oe[0])_e.shift(),Oe.shift(),G++;else break;for(var Ae=0,Fe=0,We=_e[0],Xe=Oe[0],qe=Math.min(We.length,Xe.length);Ae<qe&&We.charCodeAt(Ae)==Xe.charCodeAt(Ae);)++Ae;for(var at=M(_e),et=M(Oe),st=Math.min(at.length-(_e.length==1?Ae:0),et.length-(Oe.length==1?Ae:0));Fe<st&&at.charCodeAt(at.length-Fe-1)==et.charCodeAt(et.length-Fe-1);)++Fe;if(_e.length==1&&Oe.length==1&&G==i.line)for(;Ae&&Ae>i.ch&&at.charCodeAt(at.length-Fe-1)==et.charCodeAt(et.length-Fe-1);)Ae--,Fe++;_e[_e.length-1]=at.slice(0,at.length-Fe).replace(/^\u200b+/,""),_e[0]=_e[0].slice(Ae).replace(/\u200b+$/,"");var vt=Ke(G,Ae),ct=Ke(se,Oe.length?M(Oe).length-Fe:0);if(_e.length>1||_e[0]||_t(vt,ct))return Ui(e.doc,_e,vt,ct,"+input"),!0},Nt.prototype.ensurePolled=function(){this.forceCompositionEnd()},Nt.prototype.reset=function(){this.forceCompositionEnd()},Nt.prototype.forceCompositionEnd=function(){if(!this.composing)return;clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus()},Nt.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)},Nt.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&En(this.cm,function(){return gn(e.cm)})},Nt.prototype.setUneditable=function(e){e.contentEditable="false"},Nt.prototype.onKeyPress=function(e){if(e.charCode==0||this.composing)return;e.preventDefault(),this.cm.isReadOnly()||en(this.cm,Ka)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0)},Nt.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!="nocursor")},Nt.prototype.onContextMenu=function(){},Nt.prototype.resetPosition=function(){},Nt.prototype.needsContentAttribute=!0;function Oo(e,t){var r=fa(e,t.line);if(!r||r.hidden)return null;var i=Ye(e.doc,t.line),d=es(r,i,t.line),D=Ge(i,e.doc.direction),G="left";if(D){var Q=He(D,t.ch);G=Q%2?"right":"left"}var ee=is(d.map,t.ch,G);return ee.offset=ee.collapse=="right"?ee.end:ee.start,ee}function eu(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function Gi(e,t){return t&&(e.bad=!0),e}function tu(e,t,r,i,d){var D="",G=!1,Q=e.doc.lineSeparator(),ee=!1;function se(Ae){return function(Fe){return Fe.id==Ae}}function ge(){G&&(D+=Q,ee&&(D+=Q),G=ee=!1)}function _e(Ae){Ae&&(ge(),D+=Ae)}function Oe(Ae){if(Ae.nodeType==1){var Fe=Ae.getAttribute("cm-text");if(Fe){_e(Fe);return}var We=Ae.getAttribute("cm-marker"),Xe;if(We){var qe=e.findMarks(Ke(i,0),Ke(d+1,0),se(+We));qe.length&&(Xe=qe[0].find(0))&&_e(Et(e.doc,Xe.from,Xe.to).join(Q));return}if(Ae.getAttribute("contenteditable")=="false")return;var at=/^(pre|div|p|li|table|br)$/i.test(Ae.nodeName);if(!/^br$/i.test(Ae.nodeName)&&Ae.textContent.length==0)return;at&&ge();for(var et=0;et<Ae.childNodes.length;et++)Oe(Ae.childNodes[et]);/^(pre|p)$/i.test(Ae.nodeName)&&(ee=!0),at&&(G=!0)}else Ae.nodeType==3&&_e(Ae.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;!(Oe(t),t==r);)t=t.nextSibling,ee=!1;return D}function ia(e,t,r){var i;if(t==e.display.lineDiv){if(i=e.display.lineDiv.childNodes[r],!i)return Gi(e.clipPos(Ke(e.display.viewTo-1)),!0);t=null,r=0}else for(i=t;;i=i.parentNode){if(!i||i==e.display.lineDiv)return null;if(i.parentNode&&i.parentNode==e.display.lineDiv)break}for(var d=0;d<e.display.view.length;d++){var D=e.display.view[d];if(D.node==i)return nu(D,t,r)}}function nu(e,t,r){var i=e.text.firstChild,d=!1;if(!t||!y(i,t))return Gi(Ke(pt(e.line),0),!0);if(t==i&&(d=!0,t=i.childNodes[r],r=0,!t)){var D=e.rest?M(e.rest):e.line;return Gi(Ke(pt(D),D.text.length),d)}var G=t.nodeType==3?t:null,Q=t;for(!G&&t.childNodes.length==1&&t.firstChild.nodeType==3&&(G=t.firstChild,r&&(r=G.nodeValue.length));Q.parentNode!=i;)Q=Q.parentNode;var ee=e.measure,se=ee.maps;function ge(Xe,qe,at){for(var et=-1;et<(se?se.length:0);et++)for(var st=et<0?ee.map:se[et],vt=0;vt<st.length;vt+=3){var ct=st[vt+2];if(ct==Xe||ct==qe){var Ot=pt(et<0?e.line:e.rest[et]),Ut=st[vt]+at;return(at<0||ct!=Xe)&&(Ut=st[vt+(at?1:0)]),Ke(Ot,Ut)}}}var _e=ge(G,Q,r);if(_e)return Gi(_e,d);for(var Oe=Q.nextSibling,Ae=G?G.nodeValue.length-r:0;Oe;Oe=Oe.nextSibling){if(_e=ge(Oe,Oe.firstChild,0),_e)return Gi(Ke(_e.line,_e.ch-Ae),d);Ae+=Oe.textContent.length}for(var Fe=Q.previousSibling,We=r;Fe;Fe=Fe.previousSibling){if(_e=ge(Fe,Fe.firstChild,-1),_e)return Gi(Ke(_e.line,_e.ch+We),d);We+=Fe.textContent.length}}var Yt=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new re,this.hasSelection=!1,this.composing=null};Yt.prototype.init=function(e){var t=this,r=this,i=this.cm;this.createField(e);var d=this.textarea;e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),p&&(d.style.width="0px"),ke(d,"input",function(){W&&H>=9&&t.hasSelection&&(t.hasSelection=null),r.poll()}),ke(d,"paste",function(G){if(Z(i,G)||To(G,i))return;i.state.pasteIncoming=+new Date,r.fastPoll()});function D(G){if(Z(i,G))return;if(i.somethingSelected())na({lineWise:!1,text:i.getSelections()});else if(i.options.lineWiseCopyCut){var Q=So(i);na({lineWise:!0,text:Q.text}),G.type=="cut"?i.setSelections(Q.ranges,null,we):(r.prevInput="",d.value=Q.text.join(`
`),j(d))}else return;G.type=="cut"&&(i.state.cutIncoming=+new Date)}ke(d,"cut",D),ke(d,"copy",D),ke(e.scroller,"paste",function(G){if(Kn(e,G)||Z(i,G))return;if(!d.dispatchEvent){i.state.pasteIncoming=+new Date,r.focus();return}var Q=new Event("paste");Q.clipboardData=G.clipboardData,d.dispatchEvent(Q)}),ke(e.lineSpace,"selectstart",function(G){Kn(e,G)||ne(G)}),ke(d,"compositionstart",function(){var G=i.getCursor("from");r.composing&&r.composing.range.clear(),r.composing={start:G,range:i.markText(G,i.getCursor("to"),{className:"CodeMirror-composing"})}}),ke(d,"compositionend",function(){r.composing&&(r.poll(),r.composing.range.clear(),r.composing=null)})},Yt.prototype.createField=function(e){this.wrapper=Ao(),this.textarea=this.wrapper.firstChild},Yt.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},Yt.prototype.prepareSelection=function(){var e=this.cm,t=e.display,r=e.doc,i=ps(e);if(e.options.moveInputWithCursor){var d=kn(e,r.sel.primary().head,"div"),D=t.wrapper.getBoundingClientRect(),G=t.lineDiv.getBoundingClientRect();i.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,d.top+G.top-D.top)),i.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,d.left+G.left-D.left))}return i},Yt.prototype.showSelection=function(e){var t=this.cm,r=t.display;E(r.cursorDiv,e.cursors),E(r.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},Yt.prototype.reset=function(e){if(this.contextMenuPending||this.composing)return;var t=this.cm;if(t.somethingSelected()){this.prevInput="";var r=t.getSelection();this.textarea.value=r,t.state.focused&&j(this.textarea),W&&H>=9&&(this.hasSelection=r)}else e||(this.prevInput=this.textarea.value="",W&&H>=9&&(this.hasSelection=null))},Yt.prototype.getField=function(){return this.textarea},Yt.prototype.supportsTouch=function(){return!1},Yt.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!u||F()!=this.textarea))try{this.textarea.focus()}catch(e){}},Yt.prototype.blur=function(){this.textarea.blur()},Yt.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},Yt.prototype.receivedFocus=function(){this.slowPoll()},Yt.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()})},Yt.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0;function r(){var i=t.poll();!i&&!e?(e=!0,t.polling.set(60,r)):(t.pollingFast=!1,t.slowPoll())}t.polling.set(20,r)},Yt.prototype.poll=function(){var e=this,t=this.cm,r=this.textarea,i=this.prevInput;if(this.contextMenuPending||!t.state.focused||$e(r)&&!i&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var d=r.value;if(d==i&&!t.somethingSelected())return!1;if(W&&H>=9&&this.hasSelection===d||a&&/[\uf700-\uf7ff]/.test(d))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var D=d.charCodeAt(0);if(D==8203&&!i&&(i="\u200B"),D==8666)return this.reset(),this.cm.execCommand("undo")}for(var G=0,Q=Math.min(i.length,d.length);G<Q&&i.charCodeAt(G)==d.charCodeAt(G);)++G;return En(t,function(){Ka(t,d.slice(G),i.length-G,null,e.composing?"*compose":null),d.length>1e3||d.indexOf(`
`)>-1?r.value=e.prevInput="":e.prevInput=d,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},Yt.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},Yt.prototype.onKeyPress=function(){W&&H>=9&&(this.hasSelection=null),this.fastPoll()},Yt.prototype.onContextMenu=function(e){var t=this,r=t.cm,i=r.display,d=t.textarea;t.contextMenuPending&&t.contextMenuPending();var D=ci(r,e),G=i.scroller.scrollTop;if(!D||f)return;var Q=r.options.resetSelectionOnContextMenu;Q&&r.doc.sel.contains(D)==-1&&en(r,un)(r.doc,Qn(D),we);var ee=d.style.cssText,se=t.wrapper.style.cssText,ge=t.wrapper.offsetParent.getBoundingClientRect();t.wrapper.style.cssText="position: static",d.style.cssText=`position: absolute; width: 30px; height: 30px;
top: `+(e.clientY-ge.top-5)+"px; left: "+(e.clientX-ge.left-5)+`px;
z-index: 1000; background: `+(W?"rgba(255, 255, 255, .05)":"transparent")+`;
outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var _e;n&&(_e=window.scrollY),i.input.focus(),n&&window.scrollTo(null,_e),i.input.reset(),r.somethingSelected()||(d.value=t.prevInput=" "),t.contextMenuPending=Ae,i.selForContextMenu=r.doc.sel,clearTimeout(i.detectingSelectAll);function Oe(){if(d.selectionStart!=null){var We=r.somethingSelected(),Xe="\u200B"+(We?d.value:"");d.value="\u21DA",d.value=Xe,t.prevInput=We?"":"\u200B",d.selectionStart=1,d.selectionEnd=Xe.length,i.selForContextMenu=r.doc.sel}}function Ae(){if(t.contextMenuPending!=Ae)return;if(t.contextMenuPending=!1,t.wrapper.style.cssText=se,d.style.cssText=ee,W&&H<9&&i.scrollbars.setScrollTop(i.scroller.scrollTop=G),d.selectionStart!=null){(!W||W&&H<9)&&Oe();var We=0,Xe=function(){i.selForContextMenu==r.doc.sel&&d.selectionStart==0&&d.selectionEnd>0&&t.prevInput=="\u200B"?en(r,Vs)(r):We++<10?i.detectingSelectAll=setTimeout(Xe,500):(i.selForContextMenu=null,i.input.reset())};i.detectingSelectAll=setTimeout(Xe,200)}}if(W&&H>=9&&Oe(),O){fe(e);var Fe=function(){Ze(window,"mouseup",Fe),setTimeout(Ae,20)};ke(window,"mouseup",Fe)}else setTimeout(Ae,50)},Yt.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},Yt.prototype.setUneditable=function(){},Yt.prototype.needsContentAttribute=!1;function iu(e,t){if(t=t?b(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 r=F();t.autofocus=r==e||e.getAttribute("autofocus")!=null&&r==document.body}function i(){e.value=Q.getValue()}var d;if(e.form&&(ke(e.form,"submit",i),!t.leaveSubmitMethodAlone)){var D=e.form;d=D.submit;try{var G=D.submit=function(){i(),D.submit=d,D.submit(),D.submit=G}}catch(ee){}}t.finishInit=function(ee){ee.save=i,ee.getTextArea=function(){return e},ee.toTextArea=function(){ee.toTextArea=isNaN,i(),e.parentNode.removeChild(ee.getWrapperElement()),e.style.display="",e.form&&(Ze(e.form,"submit",i),!t.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=d))}},e.style.display="none";var Q=Wt(function(ee){return e.parentNode.insertBefore(ee,e.nextSibling)},t);return Q}function ru(e){e.off=Ze,e.on=ke,e.wheelEventPixels=dl,e.Doc=vn,e.splitLines=ot,e.countColumn=V,e.findColumn=Ie,e.isWordChar=Se,e.Pass=De,e.signal=le,e.Line=ui,e.changeEnd=Zn,e.scrollbarModel=xs,e.Pos=Ke,e.cmpPos=_t,e.modes=Ct,e.mimeModes=bt,e.resolveMode=Gt,e.getMode=jt,e.modeExtensions=gt,e.extendMode=wt,e.copyState=At,e.startState=an,e.innerMode=Bt,e.commands=xr,e.keyMap=zn,e.keyName=lo,e.isModifierKey=so,e.lookupKey=ji,e.normalizeKeyMap=kl,e.StringStream=ut,e.SharedTextMarker=br,e.TextMarker=ei,e.LineWidget=yr,e.e_preventDefault=ne,e.e_stopPropagation=te,e.e_stop=fe,e.addClass=B,e.contains=y,e.rmClass=S,e.keyNames=ti}$l(Wt),ql(Wt);var au="iter insert remove copy getEditor constructor".split(" ");for(var ra in vn.prototype)vn.prototype.hasOwnProperty(ra)&&ce(au,ra)<0&&(Wt.prototype[ra]=function(e){return function(){return e.apply(this.doc,arguments)}}(vn.prototype[ra]));return ue(vn),Wt.inputStyles={textarea:Yt,contenteditable:Nt},Wt.defineMode=function(e){!Wt.defaults.mode&&e!="null"&&(Wt.defaults.mode=e),Qt.apply(this,arguments)},Wt.defineMIME=zt,Wt.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),Wt.defineMIME("text/plain","null"),Wt.defineExtension=function(e,t){Wt.prototype[e]=t},Wt.defineDocExtension=function(e,t){vn.prototype[e]=t},Wt.fromTextArea=iu,ru(Wt),Wt.version="5.58.2",Wt})},Y1PL:function(tt,Ee,J){"use strict";J.r(Ee),J.d(Ee,"ResizableTextArea",function(){return ce});var oe=J("wx14"),$=J("1OyB"),k=J("vuIU"),z=J("Ji7U"),U=J("LK+K"),L=J("q1tI"),W=J("VTBJ"),H=J("rePB"),n=J("Zm9Q"),I=J("Kwbf"),g=J("c+Xe"),f=J("m+aA"),m=J("bdgK"),h=new Map;function o(we){we.forEach(function(Le){var Re,Ie=Le.target;(Re=h.get(Ie))===null||Re===void 0||Re.forEach(function(ye){return ye(Ie)})})}var p=new m.default(o),l=null,u=null;function a(we,Le){h.has(we)||(h.set(we,new Set),p.observe(we)),h.get(we).add(Le)}function s(we,Le){h.has(we)&&(h.get(we).delete(Le),h.get(we).size||(p.unobserve(we),h.delete(we)))}var C=function(we){Object(z.a)(Re,we);var Le=Object(U.a)(Re);function Re(){return Object($.a)(this,Re),Le.apply(this,arguments)}return Object(k.a)(Re,[{key:"render",value:function(){return this.props.children}}]),Re}(L.Component),_=L.createContext(null);function w(we){var Le=we.children,Re=we.onBatchResize,Ie=L.useRef(0),ye=L.useRef([]),X=L.useContext(_),M=L.useCallback(function(N,Y,ie){Ie.current+=1;var K=Ie.current;ye.current.push({size:N,element:Y,data:ie}),Promise.resolve().then(function(){K===Ie.current&&(Re==null||Re(ye.current),ye.current=[])}),X==null||X(N,Y,ie)},[Re,X]);return L.createElement(_.Provider,{value:M},Le)}function O(we){var Le=we.children,Re=we.disabled,Ie=L.useRef(null),ye=L.useRef(null),X=L.useContext(_),M=L.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),N=L.isValidElement(Le)&&Object(g.c)(Le),Y=N?Le.ref:null,ie=L.useMemo(function(){return Object(g.a)(Y,Ie)},[Y,Ie]),K=L.useRef(we);K.current=we;var pe=L.useCallback(function(Se){var Pe=K.current,he=Pe.onResize,ve=Pe.data,xe=Se.getBoundingClientRect(),Ce=xe.width,Be=xe.height,Ne=Se.offsetWidth,Ue=Se.offsetHeight,He=Math.floor(Ce),ze=Math.floor(Be);if(M.current.width!==He||M.current.height!==ze||M.current.offsetWidth!==Ne||M.current.offsetHeight!==Ue){var Ge={width:He,height:ze,offsetWidth:Ne,offsetHeight:Ue};M.current=Ge;var Je=Ne===Math.round(Ce)?Ce:Ne,ke=Ue===Math.round(Be)?Be:Ue,Qe=Object(W.a)(Object(W.a)({},Ge),{},{offsetWidth:Je,offsetHeight:ke});X==null||X(Qe,Se,ve),he&&Promise.resolve().then(function(){he(Qe,Se)})}},[]);return L.useEffect(function(){var Se=Object(f.a)(Ie.current)||Object(f.a)(ye.current);return Se&&!Re&&a(Se,pe),function(){return s(Se,pe)}},[Ie.current,Re]),L.createElement(C,{ref:ye},N?L.cloneElement(Le,{ref:ie}):Le)}var R="rc-observer-key";function S(we){var Le=we.children,Re=Object(n.a)(Le);return Re.map(function(Ie,ye){var X=(Ie==null?void 0:Ie.key)||"".concat(R,"-").concat(ye);return L.createElement(O,Object(oe.a)({},we,{key:X}),Ie)})}S.Collection=w;var T=S,E=J("bT9E"),c=J("TSYQ"),x=J.n(c),v=`
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
`,y=["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"],F={},B;function A(we){var Le=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Re=we.getAttribute("id")||we.getAttribute("data-reactid")||we.getAttribute("name");if(Le&&F[Re])return F[Re];var Ie=window.getComputedStyle(we),ye=Ie.getPropertyValue("box-sizing")||Ie.getPropertyValue("-moz-box-sizing")||Ie.getPropertyValue("-webkit-box-sizing"),X=parseFloat(Ie.getPropertyValue("padding-bottom"))+parseFloat(Ie.getPropertyValue("padding-top")),M=parseFloat(Ie.getPropertyValue("border-bottom-width"))+parseFloat(Ie.getPropertyValue("border-top-width")),N=y.map(function(ie){return"".concat(ie,":").concat(Ie.getPropertyValue(ie))}).join(";"),Y={sizingStyle:N,paddingSize:X,borderSize:M,boxSizing:ye};return Le&&Re&&(F[Re]=Y),Y}function j(we){var Le=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Re=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,Ie=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;B||(B=document.createElement("textarea"),B.setAttribute("tab-index","-1"),B.setAttribute("aria-hidden","true"),document.body.appendChild(B)),we.getAttribute("wrap")?B.setAttribute("wrap",we.getAttribute("wrap")):B.removeAttribute("wrap");var ye=A(we,Le),X=ye.paddingSize,M=ye.borderSize,N=ye.boxSizing,Y=ye.sizingStyle;B.setAttribute("style","".concat(Y,";").concat(v)),B.value=we.value||we.placeholder||"";var ie=Number.MIN_SAFE_INTEGER,K=Number.MAX_SAFE_INTEGER,pe=B.scrollHeight,Se;if(N==="border-box"?pe+=M:N==="content-box"&&(pe-=X),Re!==null||Ie!==null){B.value=" ";var Pe=B.scrollHeight-X;Re!==null&&(ie=Pe*Re,N==="border-box"&&(ie=ie+X+M),pe=Math.max(ie,pe)),Ie!==null&&(K=Pe*Ie,N==="border-box"&&(K=K+X+M),Se=pe>K?"":"hidden",pe=Math.min(K,pe))}return{height:pe,minHeight:ie,maxHeight:K,overflowY:Se,resize:"none"}}var P=J("Gytx"),b=J.n(P),V;(function(we){we[we.NONE=0]="NONE",we[we.RESIZING=1]="RESIZING",we[we.RESIZED=2]="RESIZED"})(V||(V={}));var re=function(we){Object(z.a)(Re,we);var Le=Object(U.a)(Re);function Re(Ie){var ye;return Object($.a)(this,Re),ye=Le.call(this,Ie),ye.nextFrameActionId=void 0,ye.resizeFrameId=void 0,ye.textArea=void 0,ye.saveTextArea=function(X){ye.textArea=X},ye.handleResize=function(X){var M=ye.state.resizeStatus,N=ye.props,Y=N.autoSize,ie=N.onResize;if(M!==V.NONE)return;typeof ie=="function"&&ie(X),Y&&ye.resizeOnNextFrame()},ye.resizeOnNextFrame=function(){cancelAnimationFrame(ye.nextFrameActionId),ye.nextFrameActionId=requestAnimationFrame(ye.resizeTextarea)},ye.resizeTextarea=function(){var X=ye.props.autoSize;if(!X||!ye.textArea)return;var M=X.minRows,N=X.maxRows,Y=j(ye.textArea,!1,M,N);ye.setState({textareaStyles:Y,resizeStatus:V.RESIZING},function(){cancelAnimationFrame(ye.resizeFrameId),ye.resizeFrameId=requestAnimationFrame(function(){ye.setState({resizeStatus:V.RESIZED},function(){ye.resizeFrameId=requestAnimationFrame(function(){ye.setState({resizeStatus:V.NONE}),ye.fixFirefoxAutoScroll()})})})})},ye.renderTextArea=function(){var X=ye.props,M=X.prefixCls,N=M===void 0?"rc-textarea":M,Y=X.autoSize,ie=X.onResize,K=X.className,pe=X.disabled,Se=ye.state,Pe=Se.textareaStyles,he=Se.resizeStatus,ve=Object(E.a)(ye.props,["prefixCls","onPressEnter","autoSize","defaultValue","onResize"]),xe=x()(N,K,Object(H.a)({},"".concat(N,"-disabled"),pe));"value"in ve&&(ve.value=ve.value||"");var Ce=Object(W.a)(Object(W.a)(Object(W.a)({},ye.props.style),Pe),he===V.RESIZING?{overflowX:"hidden",overflowY:"hidden"}:null);return L.createElement(T,{onResize:ye.handleResize,disabled:!(Y||ie)},L.createElement("textarea",Object(oe.a)({},ve,{className:xe,style:Ce,ref:ye.saveTextArea})))},ye.state={textareaStyles:{},resizeStatus:V.NONE},ye}return Object(k.a)(Re,[{key:"componentDidUpdate",value:function(ye){(ye.value!==this.props.value||!b()(ye.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 ye=this.textArea.selectionStart,X=this.textArea.selectionEnd;this.textArea.setSelectionRange(ye,X)}}catch(M){}}},{key:"render",value:function(){return this.renderTextArea()}}]),Re}(L.Component),ce=re,me=function(we){Object(z.a)(Re,we);var Le=Object(U.a)(Re);function Re(Ie){var ye;Object($.a)(this,Re),ye=Le.call(this,Ie),ye.resizableTextArea=void 0,ye.focus=function(){ye.resizableTextArea.textArea.focus()},ye.saveTextArea=function(M){ye.resizableTextArea=M},ye.handleChange=function(M){var N=ye.props.onChange;ye.setValue(M.target.value,function(){ye.resizableTextArea.resizeTextarea()}),N&&N(M)},ye.handleKeyDown=function(M){var N=ye.props,Y=N.onPressEnter,ie=N.onKeyDown;M.keyCode===13&&Y&&Y(M),ie&&ie(M)};var X=typeof Ie.value=="undefined"||Ie.value===null?Ie.defaultValue:Ie.value;return ye.state={value:X},ye}return Object(k.a)(Re,[{key:"setValue",value:function(ye,X){"value"in this.props||this.setState({value:ye},X)}},{key:"blur",value:function(){this.resizableTextArea.textArea.blur()}},{key:"render",value:function(){return L.createElement(ce,Object(oe.a)({},this.props,{value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,ref:this.saveTextArea}))}}],[{key:"getDerivedStateFromProps",value:function(ye){return"value"in ye?{value:ye.value}:null}}]),Re}(L.Component),De=Ee.default=me},ZW9T:function(tt,Ee,J){"use strict";J.d(Ee,"a",function(){return P});var oe=J("k1fw"),$=J("oBTY"),k=J("miYZ"),z=J("tsqr"),U=J("rAM+"),L=J("tJVT"),W=J("PpiC"),H=J("q1tI"),n=J.n(H),I=J("bdgK"),g=J("9og8"),f=J("WmNS"),m=J.n(f),h={keywords:["print","auto","break","case","char","const","continue","default","do","double","else","enum","extern","float","for","goto","if","int","long","register","return","short","signed","sizeof","static","struct","switch","typedef","union","unsigned","void","volatile","while"]},o={quickKey:[{label:"main",content:["public static void main(String[] args) {"," $0","}"].join(`
`)},{label:"System.out.println",content:["System.out.println($0)"].join(`
`)},{label:"System.out.print",content:["System.out.print($0)"].join(`
`)}],keywords:["abstract","continue","for","new","switch","assert","default","goto","package","synchronized","boolean","do","if","private","this","break","double","implements","protected","throw","byte","else","import","public","throws","case","enum","instanceof","return","transient","catch","extends","int","short","try","char","final","interface","static","void","class","finally","long","strictfp","volatile","const","float","native","super","while","true","false"]},p={keywords:["abstract","amp","array","auto","bool","break","case","catch","char","class","const","constexpr","const_cast","continue","cpu","decltype","default","delegate","delete","do","double","dynamic_cast","each","else","enum","event","explicit","export","extern","false","final","finally","float","friend","gcnew","generic","goto","in","initonly","inline","int","interface","interior_ptr","internal","literal","long","mutable","namespace","new","noexcept","nullptr","__nullptr","operator","override","partial","pascal","pin_ptr","private","property","protected","public","ref","register","reinterpret_cast","restrict","return","safe_cast","sealed","short","signed","sizeof","static","static_assert","static_cast","struct","switch","template","this","thread_local","throw","tile_static","true","try","typedef","typeid","typename","union","unsigned","using","virtual","void","volatile","wchar_t","where","while","_asm","_based","_cdecl","_declspec","_fastcall","_if_exists","_if_not_exists","_inline","_multiple_inheritance","_pascal","_single_inheritance","_stdcall","_virtual_inheritance","_w64","__abstract","__alignof","__asm","__assume","__based","__box","__builtin_alignof","__cdecl","__clrcall","__declspec","__delegate","__event","__except","__fastcall","__finally","__forceinline","__gc","__hook","__identifier","__if_exists","__if_not_exists","__inline","__int128","__int16","__int32","__int64","__int8","__interface","__leave","__m128","__m128d","__m128i","__m256","__m256d","__m256i","__m64","__multiple_inheritance","__newslot","__nogc","__noop","__nounwind","__novtordisp","__pascal","__pin","__pragma","__property","__ptr32","__ptr64","__raise","__restrict","__resume","__sealed","__single_inheritance","__stdcall","__super","__thiscall","__try","__try_cast","__typeof","__unaligned","__unhook","__uuidof","__value","__virtual_inheritance","__w64","__wchar_t"],operators:["=",">","<","!","~","?",":","==","<=",">=","!=","&&","||","++","--","+","-","*","/","&","|","^","%","<<",">>",">>>","+=","-=","*=","/=","&=","|=","^=","%=","<<=",">>=",">>>="],quickKey:[{label:"ifelse",content:["if (${1:condition}) {"," $0","} else {"," ","}"].join(`
`)},{label:"include",content:"include<$0>"},{label:"printf",content:"printf($0)"},{label:"system",content:'system("$0")'},{label:"main",content:["int main () {"," $0","}"].join(`
`)},{label:"if",content:["if () {"," $0","}"].join(`
`)},{label:"for",content:["for(int j=0 ; j<10; j++){"," $0","}"].join(`
`)},{label:"trycatch",content:["try{"," $0","}catch(ExceptionName e){","}"].join(`
`)},{label:"using namespace std;",content:["using namespace std;"].join(`
`)},{label:"include <iostream>",content:["#include <iostream>"].join(`
`)},{label:"include <vector>",content:["#include <vector>"].join(`
`)},{label:"include <cstdio>",content:["#include <cstdio>"].join(`
`)},{label:"include <cstring>",content:["#include <cstring>"].join(`
`)},{label:"include <sstream>",content:["#include <sstream>"].join(`
`)},{label:"include <fstream>",content:["#include <fstream>"].join(`
`)},{label:"include <map>",content:["#include <map>"].join(`
`)},{label:"include <string>",content:["#include <string>"].join(`
`)},{label:"include <cmath>",content:["#include <cmath>"].join(`
`)}]},l={keywords:["and","as","assert","break","class","continue","def","del","elif","else","except","exec","finally","for","from","global","if","import","in","is","lambda","None","not","or","pass","raise","return","self","try","while","with","yield","int","float","long","complex","hex","abs","all","any","apply","basestring","bin","bool","buffer","bytearray","callable","chr","classmethod","cmp","coerce","compile","complex","delattr","dict","dir","divmod","enumerate","eval","execfile","file","filter","format","frozenset","getattr","globals","hasattr","hash","help","id","input","intern","isinstance","issubclass","iter","len","locals","list","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","reversed","range","raw_input","reduce","reload","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","unichr","unicode","vars","xrange","zip","True","False","__dict__","__methods__","__members__","__class__","__bases__","__name__","__mro__","__subclasses__","__init__","__import__"],quickKey:[{label:"print",content:["print($0)"].join(`
`)}]},u=J("5VLF"),a=J.n(u),s={languages:["c","abap","apex","azcli","bat","cameligo","clojure","coffee","cpp","csharp","csp","css","dockerfile","fsharp","go","graphql","handlebars","html","ini","java","javascript","json","kotlin","less","lua","markdown","mips","msdax","mysql","objective-c","pascal","pascaligo","perl","pgsql","php","postiats","powerquery","powershell","pug","python","r","razor","redis","redshift","restructuredtext","ruby","rust","sb","scheme","scss","shell","solidity","sophia","sql","st","swift","tcl","twig","vb","xml","yaml'"],tables:{users:["name","id","email","phone","password"],roles:["id","name","order","created_at","updated_at","deleted_at"]}},C=function(V,re){return re.map(function(ce){return{label:ce,kind:V.languages.CompletionItemKind.Keyword,insertText:ce}})},_=function(V){return Object.keys(s.tables).map(function(re){return{label:re,kind:V.languages.CompletionItemKind.Variable,insertText:re}})},w=function(V,re){var ce=s.tables[V];return ce?ce.map(function(me){return{label:me,kind:re.languages.CompletionItemKind.Field,insertText:me}}):[]};function O(b,V,re,ce,me){var De=V.getWordUntilPosition(re),we={startLineNumber:re.lineNumber,endLineNumber:re.lineNumber,startColumn:De.startColumn,endColumn:De.endColumn},Le=ce.map(function(Re){return{label:Re,kind:b.languages.CompletionItemKind.Keyword,insertText:Re,insertTextRules:b.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:we}});return me.map(function(Re){Le.push(Object(oe.a)(Object(oe.a)({},Re),{},{range:we}))}),Le}var R=function(b){s.languages.map(function(me){return b.languages.registerDocumentFormattingEditProvider(me,{provideDocumentFormattingEdits:function(we,Le,Re){return Object(g.a)(m.a.mark(function Ie(){var ye;return m.a.wrap(function(M){for(;;)switch(M.prev=M.next){case 0:return ye=a()(we.getValue(),{indent_size:"2",indent_char:" ",max_preserve_newlines:"2",preserve_newlines:!0,keep_array_indentation:!0,break_chained_methods:!1,indent_scripts:"normal",brace_style:"collapse",space_before_conditional:!0,unescape_strings:!1,jslint_happy:!1,end_with_newline:!0,wrap_line_length:"0",indent_inner_html:!1,comma_first:!1,e4x:!1,indent_empty_lines:!1}),M.abrupt("return",[{range:we.getFullModelRange(),text:ye}]);case 2:case"end":return M.stop()}},Ie)}))()}}),me});var V=p.quickKey.map(function(me){return{label:me.label,kind:b.languages.CompletionItemKind.Method,insertText:me.content,insertTextRules:b.languages.CompletionItemInsertTextRule.InsertAsSnippet}}),re=l.quickKey.map(function(me){return{label:me.label,kind:b.languages.CompletionItemKind.Method,insertText:me.content,insertTextRules:b.languages.CompletionItemInsertTextRule.InsertAsSnippet}}),ce=o.quickKey.map(function(me){return{label:me.label,kind:b.languages.CompletionItemKind.Method,insertText:me.content,insertTextRules:b.languages.CompletionItemInsertTextRule.InsertAsSnippet}});b.languages.registerCompletionItemProvider("cpp",{provideCompletionItems:function(De,we){var Le=De.getWordUntilPosition(we),Re={startLineNumber:we.lineNumber,endLineNumber:we.lineNumber,startColumn:Le.startColumn,endColumn:Le.endColumn},Ie=De.getLineContent(we.lineNumber).substring(Le.startColumn-2,Le.endColumn);return{suggestions:[].concat(Object($.a)(p.keywords.map(function(ye){return{label:ye,kind:b.languages.CompletionItemKind.Function,documentation:ye,insertText:ye,insertTextRules:b.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Re}})),Object($.a)(p.quickKey.map(function(ye){return{label:ye.label,kind:b.languages.CompletionItemKind.Function,documentation:ye.content,insertText:Ie.startsWith("#")?ye.content.replace(/#/,""):ye.content,insertTextRules:b.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Re}})))}}}),b.languages.registerCompletionItemProvider("c",{provideCompletionItems:function(De,we){var Le=De.getWordUntilPosition(we),Re={startLineNumber:we.lineNumber,endLineNumber:we.lineNumber,startColumn:Le.startColumn,endColumn:Le.endColumn};return{suggestions:Object($.a)(h.keywords.map(function(Ie){return{label:Ie,kind:b.languages.CompletionItemKind.Function,documentation:Ie,insertText:Ie,insertTextRules:b.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Re}}))}}}),b.languages.registerCompletionItemProvider("java",{provideCompletionItems:function(De,we){var Le=De.getWordUntilPosition(we),Re={startLineNumber:we.lineNumber,endLineNumber:we.lineNumber,startColumn:Le.startColumn,endColumn:Le.endColumn},Ie=De.getLineContent(we.lineNumber).substring(Le.startColumn-2,Le.endColumn);return{suggestions:[].concat(Object($.a)(o.keywords.map(function(ye){return{label:ye,kind:b.languages.CompletionItemKind.Function,documentation:ye,insertText:ye,insertTextRules:b.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Re}})),Object($.a)(o.quickKey.map(function(ye){return{label:ye.label,kind:b.languages.CompletionItemKind.Function,documentation:ye.content,insertText:Ie.startsWith("#")?ye.content.replace(/#/,""):ye.content,insertTextRules:b.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Re}})))}}}),b.languages.registerCompletionItemProvider("python",{provideCompletionItems:function(De,we){var Le=De.getWordUntilPosition(we),Re={startLineNumber:we.lineNumber,endLineNumber:we.lineNumber,startColumn:Le.startColumn,endColumn:Le.endColumn},Ie=De.getLineContent(we.lineNumber).substring(Le.startColumn-2,Le.endColumn);return{suggestions:[].concat(Object($.a)(l.keywords.map(function(ye){return{label:ye,kind:b.languages.CompletionItemKind.Function,documentation:ye,insertText:ye,insertTextRules:b.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Re}})),Object($.a)(l.quickKey.map(function(ye){return{label:ye.label,kind:b.languages.CompletionItemKind.Function,documentation:ye.content,insertText:Ie.startsWith("#")?ye.content.replace(/#/,""):ye.content,insertTextRules:b.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Re}})))}}})},S="\u8BE5\u4EFB\u52A1\u5173\u5361\u8BBE\u7F6E\u4E86\u7981\u6B62\u590D\u5236\u7C98\u8D34\uFF0C\u8BF7\u624B\u52A8\u8F93\u5165\u4EE3\u7801\u3002",T=J("fjLI"),E=J("LvDl"),c=J("+ua5");function x(b){return/^\d+$/.test(b)?"".concat(b,"px"):b}function v(){}var y=!1,F={"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 B(){var b=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],V=b;if(Array.isArray(b)){for(var re=0;re<b.length;re++){var ce=F[b[re]];if(ce)return ce}return V[0]}return F[V]||V}var A=null,j=Ee.b=function(b){var V=b.width,re=V===void 0?"100%":V,ce=b.height,me=ce===void 0?"100%":ce,De=b.value,we=b.language,Le=we===void 0?"javascript":we,Re=b.style,Ie=Re===void 0?{}:Re,ye=b.options,X=ye===void 0?{}:ye,M=b.overrideServices,N=M===void 0?{}:M,Y=b.theme,ie=Y===void 0?"vs-dark":Y,K=b.onEditBlur,pe=b.onSave,Se=b.autoHeight,Pe=Se===void 0?!1:Se,he=b.forbidCopy,ve=he===void 0?!1:he,xe=b.onChange,Ce=xe===void 0?v:xe,Be=b.editorDidMount,Ne=Be===void 0?v:Be,Ue=b.onFocus,He=Ue===void 0?v:Ue,ze=b.filename,Ge=ze===void 0?"educoder.txt":ze,Je=b.errorLine,ke=b.errorContent,Qe=ke===void 0?"":ke,Ze=Object(W.a)(b,["width","height","value","language","style","options","overrideServices","theme","onEditBlur","onSave","autoHeight","forbidCopy","onChange","editorDidMount","onFocus","filename","errorLine","errorContent"]),le=Object(H.useRef)(),Z=Object(H.useRef)({}),q=Object(H.useRef)(),ae=Object(H.useRef)(),ue=Object(H.useRef)(!1),ne=Object(H.useRef)(),te=Object(H.useState)(!1),de=Object(L.a)(te,2),fe=de[0],be=de[1];function Te(){var gt;return le.current&&(gt=new I.default(function(wt){var At=Object(U.a)(wt),Bt;try{for(At.s();!(Bt=At.n()).done;){var an=Bt.value;(an.target.offsetHeight>0||an.target.offsetWidth>0)&&Z.current.instance.layout()}}catch(ut){At.e(ut)}finally{At.f()}}),gt.observe(le.current)),gt}function Me(){z.b.warn(decodeURIComponent(S))}var je=function(){var wt=Z.current.instance;if(De!=null&&wt&&fe){var At=wt.getModel();At&&De!==At.getValue()&&(y=!0,At.setValue(De),wt.layout(),y=!1)}};Object(H.useEffect)(function(){ae.current&&clearTimeout(ae.current),ae.current=setTimeout(function(){je()},500)},[De,fe,Z.current]),Object(H.useEffect)(function(){if(Je&&Z.current&&Z.current.instance){var gt=Z.current.instance;gt.changeViewZones(function(At){var Bt=document.createElement("div");Bt.style.padding="10px 20px",Bt.style.width="calc(100% - 20px)",Bt.className="my-error-line-wrp",Bt.innerHTML=Qe,At.addZone({afterLineNumber:Je||11,heightInLines:3,domNode:Bt})});var wt={domNode:null,getId:function(){return"my.overlay.widget"},getDomNode:function(){return this.domNode||(this.domNode=document.createElement("div"),this.domNode.innerHTML="",this.domNode.style.width="100%",this.domNode.style.padding="20px 100px",this.domNode.style.right="0px",this.domNode.style.top="50px",this.domNode.style.position="relative",this.domNode.style.color="#333"),this.domNode},getPosition:function(){return null}};gt.addOverlayWidget(wt),gt.revealPositionInCenter({lineNumber:20,column:1})}},[Je,Z.current,fe]);function nt(){var gt=Z.current.instance;if(gt){var wt=gt.getSelection(),At=Z.current.pastePos||{},Bt=new A.Range(At.startLineNumber||wt.endLineNumber,At.startColumn||wt.endColumn,At.endLineNumber||wt.endLineNumber,At.endColumn||wt.endColumn);setTimeout(function(){gt.executeEdits("",[{range:Bt,text:""}])},300)}}function it(gt){(window.navigator.platform.match("Mac")?gt.metaKey:gt.ctrlKey)&&gt.keyCode==83&&(gt.preventDefault(),pe())}var Tt=function(){if(Pe&&Z.current.instance){var wt=Z.current.instance.getContentHeight();Gt(wt<me?me:wt)}else Gt(me)};function ot(gt){var wt=document.createEvent("MouseEvents");wt.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),gt.dispatchEvent(wt)}function $e(gt,wt){var At=window.URL||window.webkitURL||window,Bt=new Blob([wt]),an=document.createElementNS("http://www.w3.org/1999/xhtml","a");an.href=At.createObjectURL(Bt),an.download=gt,ot(an)}Object(H.useEffect)(function(){Tt()},[Tt]),Object(H.useEffect)(function(){le.current&&!fe&&Promise.all([J.e(18),J.e(29)]).then(J.t.bind(null,"M/lh",7)).then(function(gt){try{A=gt,Z.current.instance=A.editor.create(le.current,{value:De,language:B(Le),theme:ie,requireConfig:{"vs/nls":{availableLanguages:{"*":"zh-cn"}}},wordWrap:!0,autoIndent:!0,contextmenu:!0,formatOnType:!0},N);var wt=Z.current.instance,At=T.d._menuItems,Bt=Object($.a)(At).find(function(dt){return dt[0]._debugName=="EditorContext"}),an=Bt[1],ut=["editor.action.clipboardCopyWithSyntaxHighlightingAction","editor.action.quickCommand","editor.action.clipboardCopyAction","editor.action.clipboardPasteAction","editor.action.clipboardCutAction"],Ye=function(rt,pt){var ft=rt._first;do{var Vt,Ht,Ke=pt.includes((Vt=ft.element)===null||Vt===void 0||((Ht=Vt.command)===null||Ht===void 0)?void 0:Ht.id);Ke&&rt._remove(ft)}while(ft=ft.next)};if(Ne(wt,A),setTimeout(function(){Tt(),Z.current.instance.addAction({id:"d123123",label:"Download File",contextMenuGroupId:"9_cutcopypaste",run:function(){$e(Ge||"educoder.txt",wt.getValue())}}),wt.getDomNode().addEventListener("input",function(){q.current.autoFormat&&wt.getAction("editor.action.formatDocument").run()})},500),Z.current.subscription=wt.onDidChangeModelContent(function(dt){ue.current?clearTimeout(ne.current):(Tt(),Ce(wt.getValue(),dt)),ne.current=setTimeout(function(){ue.current=!1},500)}),window.Monaco||R(A,B(Le)),ve&&(Ye(an,ut),le.current.classList.add("noCopyPaste"),wt.onKeyDown(function(dt){var rt=dt.keyCode,pt=dt.ctrlKey,ft=dt.metaKey;(rt===33||rt===52)&&(ft||pt)&&(Me(),dt.preventDefault())})),window.Monaco=A,K&&wt.onDidBlurEditorWidget(function(){K(wt.getValue())}),He&&wt.onDidFocusEditorText(function(){He(wt.getValue())}),ve){wt.addCommand(A.KeyMod.CtrlCmd|A.KeyCode.KEY_V,function(){return Me(),null}),wt.onDidPaste(function(dt){Z.current.pastePos=dt});try{window.addEventListener("paste",nt)}catch(dt){}}var Et=Te();return be(!0),function(){var dt=Z.current.instance;dt.dispose();var rt=dt.getModel();rt&&rt.dispose(),Z.current.subscription&&Z.current.subscription.dispose(),ve&&window.removeEventListener("paste",nt),Et.unobserve(le.current)}}catch(dt){}})},[]),Object(H.useEffect)(function(){var gt=Z.current.instance;if(gt&&fe)return document.addEventListener("keydown",it,!1),function(){document.removeEventListener("keydown",it)}},[pe,fe]),Object(H.useEffect)(function(){var gt=Z.current.instance;if(gt&&fe){var wt=B(Le);A.editor.setModelLanguage(gt.getModel(),wt),console.log("language:",Le,gt.getModel(),wt)}},[Le,fe]),Object(H.useEffect)(function(){var gt=Z.current.instance;gt&&fe&&A.editor.setTheme(ie)},[ie,fe]),Object(H.useEffect)(function(){var gt=Z.current.instance;q.current=X,gt&&fe&&(gt.updateOptions(Object(oe.a)({},X)),setTimeout(function(){gt.getModel().updateOptions(Object(oe.a)({},X))},200))},[JSON.stringify(X),fe]),Object(H.useEffect)(function(){var gt=Z.current.instance;gt&&fe&&gt.layout()},[re,me,fe]);var yt=Object(H.useState)(x(re)),lt=Object(L.a)(yt,2),Rt=lt[0],Ct=lt[1],bt=Object(H.useState)(x(me)),Qt=Object(L.a)(bt,2),zt=Qt[0],Gt=Qt[1],jt=Object(oe.a)(Object(oe.a)({},Ie),{},{width:Rt,height:zt});return n.a.createElement("div",{className:"my-monaco-editor",ref:le,style:jt})};function P(b){var V=b.width,re=V===void 0?"100%":V,ce=b.height,me=ce===void 0?"100%":ce,De=b.original,we=b.modified,Le=b.language,Re=b.options,Ie=Re===void 0?{}:Re,ye=Object(H.useRef)(),X=Object(H.useState)(null),M=Object(L.a)(X,2),N=M[0],Y=M[1];function ie(Pe){var he;return ye.current&&(he=new I.default(function(ve){var xe=Object(U.a)(ve),Ce;try{for(xe.s();!(Ce=xe.n()).done;){var Be=Ce.value;(Be.target.offsetHeight>0||Be.target.offsetWidth>0)&&Pe.layout()}}catch(Ne){xe.e(Ne)}finally{xe.f()}}),he.observe(ye.current)),he}Object(H.useEffect)(function(){ye.current&&Promise.all([J.e(18),J.e(29)]).then(J.t.bind(null,"M/lh",7)).then(function(Pe){A=Pe;var he=A.editor.createDiffEditor(ye.current,Object(oe.a)(Object(oe.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},Ie),{},{wordWrap:!0}));Y(he);var ve=ie(he);return function(){he.dispose();var xe=he.getModel();xe&&xe.dispose(),ve.unobserve(ye.current)}})},[]),Object(H.useEffect)(function(){N&&N.setModel({original:A.editor.createModel(De,Le),modified:A.editor.createModel(we,Le)})},[De,we,Le,N]);var K=x(re),pe=x(me),Se={width:K,height:pe};return n.a.createElement("div",{className:"my-diff-editor",ref:ye,style:Se})}},bT9E:function(tt,Ee,J){"use strict";J.d(Ee,"a",function(){return $});var oe=J("VTBJ");function $(k,z){var U=Object(oe.a)({},k);return Array.isArray(z)&&z.forEach(function(L){delete U[L]}),U}},c5Ni:function(tt,Ee,J){},dejd:function(tt,Ee,J){},dmUQ:function(tt,Ee,J){"use strict";var oe=J("Ff2n"),$=J("rePB"),k=J("1OyB"),z=J("vuIU"),U=J("Ji7U"),L=J("md7G"),W=J("foSv"),H=J("q1tI"),n=J.n(H),I=J("TSYQ"),g=J.n(I),f=J("4IlW");function m(E,c){var x=Object.keys(E);if(Object.getOwnPropertySymbols){var v=Object.getOwnPropertySymbols(E);c&&(v=v.filter(function(y){return Object.getOwnPropertyDescriptor(E,y).enumerable})),x.push.apply(x,v)}return x}function h(E){for(var c=1;c<arguments.length;c++){var x=arguments[c]!=null?arguments[c]:{};c%2?m(Object(x),!0).forEach(function(v){Object($.a)(E,v,x[v])}):Object.getOwnPropertyDescriptors?Object.defineProperties(E,Object.getOwnPropertyDescriptors(x)):m(Object(x)).forEach(function(v){Object.defineProperty(E,v,Object.getOwnPropertyDescriptor(x,v))})}return E}function o(E){var c=p();return function(){var v=Object(W.a)(E),y;if(c){var F=Object(W.a)(this).constructor;y=Reflect.construct(v,arguments,F)}else y=v.apply(this,arguments);return Object(L.a)(this,y)}}function p(){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(E){return!1}}function l(){}function u(E){E.preventDefault()}var a=function(c){return c.replace(/[^\w.-]+/g,"")},s=200,C=600,_=Number.MAX_SAFE_INTEGER||Math.pow(2,53)-1,w=function(c){return c!=null},O=function(c,x){return x===c||typeof x=="number"&&typeof c=="number"&&isNaN(x)&&isNaN(c)},R=function(E){Object(U.a)(x,E);var c=o(x);function x(v){var y;Object(k.a)(this,x),y=c.call(this,v),y.onKeyDown=function(A){var j=y.props,P=j.onKeyDown,b=j.onPressEnter;if(A.keyCode===f.a.UP){var V=y.getRatio(A);y.up(A,V,null),y.stop()}else if(A.keyCode===f.a.DOWN){var re=y.getRatio(A);y.down(A,re,null),y.stop()}else A.keyCode===f.a.ENTER&&b&&b(A);if(y.recordCursorPosition(),y.lastKeyCode=A.keyCode,P){for(var ce=arguments.length,me=new Array(ce>1?ce-1:0),De=1;De<ce;De++)me[De-1]=arguments[De];P.apply(void 0,[A].concat(me))}},y.onKeyUp=function(A){var j=y.props.onKeyUp;if(y.stop(),y.recordCursorPosition(),j){for(var P=arguments.length,b=new Array(P>1?P-1:0),V=1;V<P;V++)b[V-1]=arguments[V];j.apply(void 0,[A].concat(b))}},y.onChange=function(A){var j=y.props.onChange;y.state.focused&&(y.inputting=!0),y.rawInput=y.props.parser(y.getValueFromEvent(A)),y.setState({inputValue:y.rawInput}),j(y.toNumber(y.rawInput))},y.onMouseUp=function(){var A=y.props.onMouseUp;y.recordCursorPosition(),A&&A.apply(void 0,arguments)},y.onFocus=function(){var A;y.setState({focused:!0}),(A=y.props).onFocus.apply(A,arguments)},y.onBlur=function(){var A=y.props.onBlur;y.inputting=!1,y.setState({focused:!1});var j=y.getCurrentValidValue(y.state.inputValue),P=y.setValue(j,l);if(A){var b=y.input.value,V=y.getInputDisplayValue({focus:!1,value:P});y.input.value=V&&Number(V),A.apply(void 0,arguments),y.input.value=b}},y.getRatio=function(A){var j=1;return A.metaKey||A.ctrlKey?j=.1:A.shiftKey&&(j=10),j},y.getFullNum=function(A){return isNaN(A)?A:/e/i.test(String(A))?Number(A).toFixed(18).replace(/\.?0+$/,""):A},y.getPrecision=function(A){if(w(y.props.precision))return y.props.precision;var j=String(A);if(j.indexOf("e-")>=0)return parseInt(j.slice(j.indexOf("e-")+2),10);var P=0;return j.indexOf(".")>=0&&(P=j.length-j.indexOf(".")-1),P},y.getInputDisplayValue=function(A){var j=A||y.state,P=j.focused,b=j.inputValue,V=j.value,re;P?re=b:re=y.toPrecisionAsStep(V),re==null&&(re="");var ce=y.formatWrapper(re);return w(y.props.decimalSeparator)&&(ce=ce.toString().replace(".",y.props.decimalSeparator)),ce},y.recordCursorPosition=function(){try{y.cursorStart=y.input.selectionStart,y.cursorEnd=y.input.selectionEnd,y.currentValue=y.input.value,y.cursorBefore=y.input.value.substring(0,y.cursorStart),y.cursorAfter=y.input.value.substring(y.cursorEnd)}catch(A){}},y.restoreByAfter=function(A){if(A===void 0)return!1;var j=y.input.value,P=j.lastIndexOf(A);if(P===-1)return!1;var b=y.cursorBefore.length;return y.lastKeyCode===f.a.DELETE&&y.cursorBefore.charAt(b-1)===A[0]?(y.fixCaret(b,b),!0):P+A.length===j.length?(y.fixCaret(P,P),!0):!1},y.partRestoreByAfter=function(A){return A===void 0?!1:Array.prototype.some.call(A,function(j,P){var b=A.substring(P);return y.restoreByAfter(b)})},y.isNotCompleteNumber=function(A){return isNaN(A)||A===""||A===null||A&&A.toString().indexOf(".")===A.toString().length-1},y.stop=function(){y.autoStepTimer&&clearTimeout(y.autoStepTimer)},y.down=function(A,j,P){y.pressingUpOrDown=!0,y.step("down",A,j,P)},y.up=function(A,j,P){y.pressingUpOrDown=!0,y.step("up",A,j,P)},y.saveInput=function(A){y.input=A};var F=v.value;F===void 0&&(F=v.defaultValue),y.state={focused:v.autoFocus};var B=y.getValidValue(y.toNumber(F));return y.state=h(h({},y.state),{},{inputValue:y.toPrecisionAsStep(B),value:B}),y}return Object(z.a)(x,[{key:"componentDidMount",value:function(){this.componentDidUpdate(null)}},{key:"componentDidUpdate",value:function(y){var F=this.props,B=F.value,A=F.onChange,j=F.max,P=F.min,b=this.state.focused;if(y){if(!O(y.value,B)||!O(y.max,j)||!O(y.min,P)){var V=b?B:this.getValidValue(B),re;this.pressingUpOrDown?re=V:this.inputting?re=this.rawInput:re=this.toPrecisionAsStep(V),this.setState({value:V,inputValue:re})}var ce="value"in this.props?B:this.state.value;"max"in this.props&&y.max!==j&&typeof ce=="number"&&ce>j&&A&&A(j),"min"in this.props&&y.min!==P&&typeof ce=="number"&&ce<P&&A&&A(P)}try{if(this.cursorStart!==void 0&&this.state.focused){if(!this.partRestoreByAfter(this.cursorAfter)&&this.state.value!==this.props.value){var me=this.cursorStart+1;this.cursorAfter?this.lastKeyCode===f.a.BACKSPACE?me=this.cursorStart-1:this.lastKeyCode===f.a.DELETE&&(me=this.cursorStart):me=this.input.value.length,this.fixCaret(me,me)}else if(this.currentValue===this.input.value)switch(this.lastKeyCode){case f.a.BACKSPACE:this.fixCaret(this.cursorStart-1,this.cursorStart-1);break;case f.a.DELETE:this.fixCaret(this.cursorStart+1,this.cursorStart+1);break;default:}}}catch(De){}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(y){var F=y;return F===""?F="":this.isNotCompleteNumber(parseFloat(F))?F=this.state.value:F=this.getValidValue(F),this.toNumber(F)}},{key:"getValueFromEvent",value:function(y){var F=y.target.value.trim().replace(/。/g,".");return w(this.props.decimalSeparator)&&(F=F.replace(this.props.decimalSeparator,".")),F}},{key:"getValidValue",value:function(y){var F=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.props.min,B=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.props.max,A=parseFloat(y);return isNaN(A)?y:(A<F&&(A=F),A>B&&(A=B),A)}},{key:"setValue",value:function(y,F){var B=this.props.precision,A=this.isNotCompleteNumber(parseFloat(y))?null:parseFloat(y),j=this.state.value,P=j===void 0?null:j,b=this.state.inputValue,V=b===void 0?null:b,re=typeof A=="number"?A.toFixed(B):"".concat(A),ce=A!==P||re!=="".concat(V);return"value"in this.props?(V=this.toPrecisionAsStep(this.state.value),this.setState({inputValue:V},F)):this.setState({value:A,inputValue:this.toPrecisionAsStep(y)},F),ce&&this.props.onChange(A),A}},{key:"getMaxPrecision",value:function(y){var F=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,B=this.props,A=B.precision,j=B.step;if(w(A))return A;var P=this.getPrecision(F),b=this.getPrecision(j),V=this.getPrecision(y);return y?Math.max(V,P+b):P+b}},{key:"getPrecisionFactor",value:function(y){var F=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,B=this.getMaxPrecision(y,F);return Math.pow(10,B)}},{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(y){return this.props.formatter?this.props.formatter(y):y}},{key:"toPrecisionAsStep",value:function(y){if(this.isNotCompleteNumber(y)||y==="")return y;var F=Math.abs(this.getMaxPrecision(y));return isNaN(F)?y.toString():Number(y).toFixed(F)}},{key:"toNumber",value:function(y){var F=this.props.precision,B=this.state.focused,A=y&&y.length>16&&B;return this.isNotCompleteNumber(y)||A?y:w(F)?Math.round(y*Math.pow(10,F))/Math.pow(10,F):Number(y)}},{key:"upStep",value:function(y,F){var B=this.props.step,A=this.getPrecisionFactor(y,F),j=Math.abs(this.getMaxPrecision(y,F)),P=((A*y+A*B*F)/A).toFixed(j);return this.toNumber(P)}},{key:"downStep",value:function(y,F){var B=this.props.step,A=this.getPrecisionFactor(y,F),j=Math.abs(this.getMaxPrecision(y,F)),P=((A*y-A*B*F)/A).toFixed(j);return this.toNumber(P)}},{key:"step",value:function(y,F){var B=this,A=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,j=arguments.length>3?arguments[3]:void 0;this.stop(),F&&(F.persist(),F.preventDefault());var P=this.props;if(P.disabled)return;var b=this.getCurrentValidValue(this.state.inputValue)||0;if(this.isNotCompleteNumber(b))return;var V=this["".concat(y,"Step")](b,A),re=V>P.max||V<P.min;if(V>P.max?V=P.max:V<P.min&&(V=P.min),this.setValue(V,null),this.setState({focused:!0},function(){B.pressingUpOrDown=!1}),re)return;this.autoStepTimer=setTimeout(function(){B[y](F,A,!0)},j?s:C)}},{key:"fixCaret",value:function(y,F){if(y===void 0||F===void 0||!this.input||!this.input.value)return;try{var B=this.input.selectionStart,A=this.input.selectionEnd;(y!==B||F!==A)&&this.input.setSelectionRange(y,F)}catch(j){}}},{key:"render",value:function(){var y,F=this.props,B=F.prefixCls,A=F.disabled,j=F.readOnly,P=F.useTouch,b=F.autoComplete,V=F.upHandler,re=F.downHandler,ce=F.className,me=F.max,De=F.min,we=F.style,Le=F.title,Re=F.onMouseEnter,Ie=F.onMouseLeave,ye=F.onMouseOver,X=F.onMouseOut,M=F.required,N=F.onClick,Y=F.tabIndex,ie=F.type,K=F.placeholder,pe=F.id,Se=F.inputMode,Pe=F.pattern,he=F.step,ve=F.maxLength,xe=F.autoFocus,Ce=F.name,Be=F.onPaste,Ne=F.onInput,Ue=Object(oe.a)(F,["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"]),He=this.state,ze=He.value,Ge=He.focused,Je=g()(B,(y={},Object($.a)(y,ce,!!ce),Object($.a)(y,"".concat(B,"-disabled"),A),Object($.a)(y,"".concat(B,"-focused"),Ge),y)),ke={};Object.keys(Ue).forEach(function(fe){(fe.substr(0,5)==="data-"||fe.substr(0,5)==="aria-"||fe==="role")&&(ke[fe]=Ue[fe])});var Qe=!j&&!A,Ze=this.getInputDisplayValue(null),le=(ze||ze===0)&&(isNaN(ze)||Number(ze)>=me),Z=(ze||ze===0)&&(isNaN(ze)||Number(ze)<=De),q=le||A||j,ae=Z||A||j,ue=g()("".concat(B,"-handler"),"".concat(B,"-handler-up"),Object($.a)({},"".concat(B,"-handler-up-disabled"),q)),ne=g()("".concat(B,"-handler"),"".concat(B,"-handler-down"),Object($.a)({},"".concat(B,"-handler-down-disabled"),ae)),te=P?{onTouchStart:q?l:this.up,onTouchEnd:this.stop}:{onMouseDown:q?l:this.up,onMouseUp:this.stop,onMouseLeave:this.stop},de=P?{onTouchStart:ae?l:this.down,onTouchEnd:this.stop}:{onMouseDown:ae?l:this.down,onMouseUp:this.stop,onMouseLeave:this.stop};return n.a.createElement("div",{className:Je,style:we,title:Le,onMouseEnter:Re,onMouseLeave:Ie,onMouseOver:ye,onMouseOut:X,onFocus:function(){return null},onBlur:function(){return null}},n.a.createElement("div",{className:"".concat(B,"-handler-wrap")},n.a.createElement("span",Object.assign({unselectable:"on"},te,{role:"button","aria-label":"Increase Value","aria-disabled":q,className:ue}),V||n.a.createElement("span",{unselectable:"on",className:"".concat(B,"-handler-up-inner"),onClick:u})),n.a.createElement("span",Object.assign({unselectable:"on"},de,{role:"button","aria-label":"Decrease Value","aria-disabled":ae,className:ne}),re||n.a.createElement("span",{unselectable:"on",className:"".concat(B,"-handler-down-inner"),onClick:u}))),n.a.createElement("div",{className:"".concat(B,"-input-wrap")},n.a.createElement("input",Object.assign({role:"spinbutton","aria-valuemin":De,"aria-valuemax":me,"aria-valuenow":ze,required:M,type:ie,placeholder:K,onPaste:Be,onClick:N,onMouseUp:this.onMouseUp,className:"".concat(B,"-input"),tabIndex:Y,autoComplete:b,onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:Qe?this.onKeyDown:l,onKeyUp:Qe?this.onKeyUp:l,autoFocus:xe,maxLength:ve,readOnly:j,disabled:A,max:me,min:De,step:he,name:Ce,title:Le,id:pe,onChange:this.onChange,ref:this.saveInput,value:this.getFullNum(Ze),pattern:Pe,inputMode:Se,onInput:Ne},ke))))}}]),x}(n.a.Component);R.defaultProps={focusOnUpDown:!0,useTouch:!1,prefixCls:"rc-input-number",max:_,min:-_,step:1,style:{},onChange:l,onKeyDown:l,onPressEnter:l,onFocus:l,onBlur:l,parser:a,required:!1,autoComplete:"off"};var S=R,T=Ee.a=S},fjLI:function(tt,Ee,J){"use strict";J.d(Ee,"f",function(){return m}),J.d(Ee,"b",function(){return h}),J.d(Ee,"a",function(){return o}),J.d(Ee,"d",function(){return p}),J.d(Ee,"e",function(){return l}),J.d(Ee,"c",function(){return u});var oe=J("8HAY"),$=J("Vhoy"),k=J("MI8n"),z=J("JYp7"),U=J("pmY6"),L=J("24hK"),W=J("nnTU"),H=J("T8No"),n=J("Cg/j"),I=J("t9D7"),g=function(a,s,C,_){var w=arguments.length,O=w<3?s:_===null?_=Object.getOwnPropertyDescriptor(s,C):_,R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")O=Reflect.decorate(a,s,C,_);else for(var S=a.length-1;S>=0;S--)(R=a[S])&&(O=(w<3?R(O):w>3?R(s,C,O):R(s,C))||O);return w>3&&O&&Object.defineProperty(s,C,O),O},f=function(a,s){return function(C,_){s(C,_,a)}};function m(a){return a.command!==void 0}class h{constructor(a){this.id=h._idPool++,this._debugName=a}}h._idPool=0,h.CommandPalette=new h("CommandPalette"),h.EditorContext=new h("EditorContext"),h.SimpleEditorContext=new h("SimpleEditorContext"),h.EditorContextCopy=new h("EditorContextCopy"),h.EditorContextPeek=new h("EditorContextPeek"),h.MenubarEditMenu=new h("MenubarEditMenu"),h.MenubarCopy=new h("MenubarCopy"),h.MenubarGoMenu=new h("MenubarGoMenu"),h.MenubarSelectionMenu=new h("MenubarSelectionMenu"),h.InlineCompletionsActions=new h("InlineCompletionsActions");const o=Object(n.c)("menuService"),p=new class{constructor(){this._commands=new Map,this._menuItems=new Map,this._onDidChangeMenu=new k.b,this.onDidChangeMenu=this._onDidChangeMenu.event,this._commandPaletteChangeEvent={has:a=>a===h.CommandPalette}}addCommand(a){return this.addCommands(z.a.single(a))}addCommands(a){for(const s of a)this._commands.set(s.id,s);return this._onDidChangeMenu.fire(this._commandPaletteChangeEvent),Object(U.i)(()=>{let s=!1;for(const C of a)s=this._commands.delete(C.id)||s;s&&this._onDidChangeMenu.fire(this._commandPaletteChangeEvent)})}getCommand(a){return this._commands.get(a)}getCommands(){const a=new Map;return this._commands.forEach((s,C)=>a.set(C,s)),a}appendMenuItem(a,s){return this.appendMenuItems(z.a.single({id:a,item:s}))}appendMenuItems(a){const s=new Set,C=new L.a;for(const{id:_,item:w}of a){let O=this._menuItems.get(_);O||(O=new L.a,this._menuItems.set(_,O)),C.push(O.push(w)),s.add(_)}return this._onDidChangeMenu.fire(s),Object(U.i)(()=>{if(C.size>0){for(let _ of C)_();this._onDidChangeMenu.fire(s),C.clear()}})}getMenuItems(a){let s;return this._menuItems.has(a)?s=[...this._menuItems.get(a)]:s=[],a===h.CommandPalette&&this._appendImplicitItems(s),s}_appendImplicitItems(a){const s=new Set;for(const C of a)m(C)&&(s.add(C.command.id),C.alt&&s.add(C.alt.id));this._commands.forEach((C,_)=>{s.has(_)||a.push({command:C})})}};class l extends oe.e{constructor(a,s,C,_){super(`submenuitem.${a.submenu.id}`,typeof a.title=="string"?a.title:a.title.value,[],"submenu");this.item=a,this._menuService=s,this._contextKeyService=C,this._options=_}get actions(){const a=[],s=this._menuService.createMenu(this.item.submenu,this._contextKeyService),C=s.getActions(this._options);s.dispose();for(const[,_]of C)_.length>0&&(a.push(..._),a.push(new oe.d));return a.length&&a.pop(),a}}let u=class a{constructor(s,C,_,w,O){var R,S;if(this._commandService=O,this.id=s.id,this.label=(_==null?void 0:_.renderShortTitle)&&s.shortTitle?typeof s.shortTitle=="string"?s.shortTitle:s.shortTitle.value:typeof s.title=="string"?s.title:s.title.value,this.tooltip=(S=typeof s.tooltip=="string"?s.tooltip:(R=s.tooltip)===null||R===void 0?void 0:R.value)!==null&&S!==void 0?S:"",this.enabled=!s.precondition||w.contextMatchesRules(s.precondition),this.checked=void 0,s.toggled){const T=s.toggled.condition?s.toggled:{condition:s.toggled};this.checked=w.contextMatchesRules(T.condition),this.checked&&T.tooltip&&(this.tooltip=typeof T.tooltip=="string"?T.tooltip:T.tooltip.value),T.title&&(this.label=typeof T.title=="string"?T.title:T.title.value)}this.item=s,this.alt=C?new a(C,void 0,_,w,O):void 0,this._options=_,I.d.isThemeIcon(s.icon)&&(this.class=$.a.asClassName(s.icon))}dispose(){}run(...s){var C,_;let w=[];return((C=this._options)===null||C===void 0?void 0:C.arg)&&(w=[...w,this._options.arg]),((_=this._options)===null||_===void 0?void 0:_.shouldForwardArgs)&&(w=[...w,...s]),this._commandService.executeCommand(this.id,...w)}};u=g([f(3,H.b),f(4,W.b)],u)},ic2d:function(tt,Ee,J){"use strict";J.d(Ee,"a",function(){return z});var oe=J("FWmy"),$=J("746U");class k{constructor(){this.data=new Map}add(U,L){oe.a($.l(U)),oe.a($.k(L)),oe.a(!this.data.has(U),"There is already an extension with this id"),this.data.set(U,L)}as(U){return this.data.get(U)||null}}const z=new k},kSUc:function(tt,Ee,J){},"kaH+":function(tt,Ee,J){"use strict";var oe=J("+L6B"),$=J("2/Rp"),k=J("tJVT"),z=J("q1tI"),U=J.n(z),L=J("UZu5"),W=J.n(L),H=J("dhSg"),n=J("rLCj"),I=J("dF/Y"),g=J("4i/N");Ee.a=function(){var f=Object(z.useState)(""),m=Object(k.a)(f,2),h=m[0],o=m[1],p=Object(z.useState)(0),l=Object(k.a)(p,2),u=l[0],a=l[1],s=Object(z.useRef)("");Object(z.useEffect)(function(){var T=H.a.subscribe("preview-image",function(E){o(E),document.body.style.overflow="hidden"});return T},[]),Object(z.useEffect)(function(){return document.addEventListener("keydown",C),function(){document.removeEventListener("keydown",C)}},[]),Object(z.useEffect)(function(){s.current=h},[h]);function C(T){T.keyCode==27&&s.current&&_()}function _(){document.body.style.overflow="auto",o("")}function w(){a(u+90)}var O=Object(z.useRef)(),R=Object(z.useRef)(),S=function(E){(E.nativeEvent.target===O.current||E.nativeEvent.target===R.current)&&_()};return U.a.createElement(z.Fragment,null,h?U.a.createElement("div",{className:"image-preview-container",ref:O,onClick:S},U.a.createElement("div",{className:"button-group"},U.a.createElement($.a,{onClick:w},"\u65CB\u8F6C",U.a.createElement(n.a,null)),U.a.createElement($.a,{href:h},"\u4E0B\u8F7D",U.a.createElement(I.a,null)),U.a.createElement($.a,{onClick:_},"\u5173\u95ED",U.a.createElement(g.a,null))),U.a.createElement("div",{className:"preview-wrp-group",ref:R},U.a.createElement("img",{className:"image-preview",src:h,alt:"\u9884\u89C8\u5927\u56FE",style:{transform:"rotate(".concat(u,"deg)")}}))):null)}},lZu9:function(tt,Ee,J){(function(oe){oe(J("VrN/"),J("1eCo"),J("8EBN"))})(function(oe){"use strict";oe.defineMode("markdown",function($,k){var z=oe.getMode($,"text/html"),U=z.name=="null";function L(P){if(oe.findModeByName){var b=oe.findModeByName(P);b&&(P=b.mime||b.mimes[0])}var V=oe.getMode($,P);return V.name=="null"?null:V}k.highlightFormatting===void 0&&(k.highlightFormatting=!1),k.maxBlockquoteDepth===void 0&&(k.maxBlockquoteDepth=0),k.taskLists===void 0&&(k.taskLists=!1),k.strikethrough===void 0&&(k.strikethrough=!1),k.emoji===void 0&&(k.emoji=!1),k.fencedCodeBlockHighlighting===void 0&&(k.fencedCodeBlockHighlighting=!0),k.fencedCodeBlockDefaultMode===void 0&&(k.fencedCodeBlockDefaultMode="text/plain"),k.xml===void 0&&(k.xml=!0),k.tokenTypeOverrides===void 0&&(k.tokenTypeOverrides={});var W={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 H in W)W.hasOwnProperty(H)&&k.tokenTypeOverrides[H]&&(W[H]=k.tokenTypeOverrides[H]);var n=/^([*\-_])(?:\s*\1){2,}\s*$/,I=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,g=/^\[(x| )\](?=\s)/i,f=k.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,m=/^ {0,3}(?:\={1,}|-{2,})\s*$/,h=/^[^#!\[\]*_\\<>` "'(~:]+/,o=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,p=/^\s*\[[^\]]+?\]:.*$/,l=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u0AF0\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E42\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC9\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDF3C-\uDF3E]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]/,u=" ";function a(P,b,V){return b.f=b.inline=V,V(P,b)}function s(P,b,V){return b.f=b.block=V,V(P,b)}function C(P){return!P||!/\S/.test(P.string)}function _(P){if(P.linkTitle=!1,P.linkHref=!1,P.linkText=!1,P.em=!1,P.strong=!1,P.strikethrough=!1,P.quote=0,P.indentedCode=!1,P.f==O){var b=U;if(!b){var V=oe.innerMode(z,P.htmlState);b=V.mode.name=="xml"&&V.state.tagStart===null&&!V.state.context&&V.state.tokenize.isInText}b&&(P.f=E,P.block=w,P.htmlState=null)}return P.trailingSpace=0,P.trailingSpaceNewLine=!1,P.prevLine=P.thisLine,P.thisLine={stream:null},null}function w(P,b){var V=P.column()===b.indentation,re=C(b.prevLine.stream),ce=b.indentedCode,me=b.prevLine.hr,De=b.list!==!1,we=(b.listStack[b.listStack.length-1]||0)+3;b.indentedCode=!1;var Le=b.indentation;if(b.indentationDiff===null&&(b.indentationDiff=b.indentation,De)){for(b.list=null;Le<b.listStack[b.listStack.length-1];)b.listStack.pop(),b.listStack.length?b.indentation=b.listStack[b.listStack.length-1]:b.list=!1;b.list!==!1&&(b.indentationDiff=Le-b.listStack[b.listStack.length-1])}var Re=!re&&!me&&!b.prevLine.header&&(!De||!ce)&&!b.prevLine.fencedCodeEnd,Ie=(b.list===!1||me||re)&&b.indentation<=we&&P.match(n),ye=null;if(b.indentationDiff>=4&&(ce||b.prevLine.fencedCodeEnd||b.prevLine.header||re))return P.skipToEnd(),b.indentedCode=!0,W.code;if(P.eatSpace())return null;if(V&&b.indentation<=we&&(ye=P.match(f))&&ye[1].length<=6)return b.quote=0,b.header=ye[1].length,b.thisLine.header=!0,k.highlightFormatting&&(b.formatting="header"),b.f=b.inline,S(b);if(b.indentation<=we&&P.eat(">"))return b.quote=V?1:b.quote+1,k.highlightFormatting&&(b.formatting="quote"),P.eatSpace(),S(b);if(!Ie&&!b.setext&&V&&b.indentation<=we&&(ye=P.match(I))){var X=ye[1]?"ol":"ul";return b.indentation=Le+P.current().length,b.list=!0,b.quote=0,b.listStack.push(b.indentation),b.em=!1,b.strong=!1,b.code=!1,b.strikethrough=!1,k.taskLists&&P.match(g,!1)&&(b.taskList=!0),b.f=b.inline,k.highlightFormatting&&(b.formatting=["list","list-"+X]),S(b)}else{if(V&&b.indentation<=we&&(ye=P.match(o,!0)))return b.quote=0,b.fencedEndRE=new RegExp(ye[1]+"+ *$"),b.localMode=k.fencedCodeBlockHighlighting&&L(ye[2]||k.fencedCodeBlockDefaultMode),b.localMode&&(b.localState=oe.startState(b.localMode)),b.f=b.block=R,k.highlightFormatting&&(b.formatting="code-block"),b.code=-1,S(b);if(b.setext||(!Re||!De)&&!b.quote&&b.list===!1&&!b.code&&!Ie&&!p.test(P.string)&&(ye=P.lookAhead(1))&&(ye=ye.match(m)))return b.setext?(b.header=b.setext,b.setext=0,P.skipToEnd(),k.highlightFormatting&&(b.formatting="header")):(b.header=ye[0].charAt(0)=="="?1:2,b.setext=b.header),b.thisLine.header=!0,b.f=b.inline,S(b);if(Ie)return P.skipToEnd(),b.hr=!0,b.thisLine.hr=!0,W.hr;if(P.peek()==="[")return a(P,b,F)}return a(P,b,b.inline)}function O(P,b){var V=z.token(P,b.htmlState);if(!U){var re=oe.innerMode(z,b.htmlState);(re.mode.name=="xml"&&re.state.tagStart===null&&!re.state.context&&re.state.tokenize.isInText||b.md_inside&&P.current().indexOf(">")>-1)&&(b.f=E,b.block=w,b.htmlState=null)}return V}function R(P,b){var V=b.listStack[b.listStack.length-1]||0,re=b.indentation<V,ce=V+3;if(b.fencedEndRE&&b.indentation<=ce&&(re||P.match(b.fencedEndRE))){k.highlightFormatting&&(b.formatting="code-block");var me;return re||(me=S(b)),b.localMode=b.localState=null,b.block=w,b.f=E,b.fencedEndRE=null,b.code=0,b.thisLine.fencedCodeEnd=!0,re?s(P,b,b.block):me}else return b.localMode?b.localMode.token(P,b.localState):(P.skipToEnd(),W.code)}function S(P){var b=[];if(P.formatting){b.push(W.formatting),typeof P.formatting=="string"&&(P.formatting=[P.formatting]);for(var V=0;V<P.formatting.length;V++)b.push(W.formatting+"-"+P.formatting[V]),P.formatting[V]==="header"&&b.push(W.formatting+"-"+P.formatting[V]+"-"+P.header),P.formatting[V]==="quote"&&(!k.maxBlockquoteDepth||k.maxBlockquoteDepth>=P.quote?b.push(W.formatting+"-"+P.formatting[V]+"-"+P.quote):b.push("error"))}if(P.taskOpen)return b.push("meta"),b.length?b.join(" "):null;if(P.taskClosed)return b.push("property"),b.length?b.join(" "):null;if(P.linkHref?b.push(W.linkHref,"url"):(P.strong&&b.push(W.strong),P.em&&b.push(W.em),P.strikethrough&&b.push(W.strikethrough),P.emoji&&b.push(W.emoji),P.linkText&&b.push(W.linkText),P.code&&b.push(W.code),P.image&&b.push(W.image),P.imageAltText&&b.push(W.imageAltText,"link"),P.imageMarker&&b.push(W.imageMarker)),P.header&&b.push(W.header,W.header+"-"+P.header),P.quote&&(b.push(W.quote),!k.maxBlockquoteDepth||k.maxBlockquoteDepth>=P.quote?b.push(W.quote+"-"+P.quote):b.push(W.quote+"-"+k.maxBlockquoteDepth)),P.list!==!1){var re=(P.listStack.length-1)%3;re?re===1?b.push(W.list2):b.push(W.list3):b.push(W.list1)}return P.trailingSpaceNewLine?b.push("trailing-space-new-line"):P.trailingSpace&&b.push("trailing-space-"+(P.trailingSpace%2?"a":"b")),b.length?b.join(" "):null}function T(P,b){return P.match(h,!0)?S(b):void 0}function E(P,b){var V=b.text(P,b);if(typeof V!="undefined")return V;if(b.list)return b.list=null,S(b);if(b.taskList){var re=P.match(g,!0)[1]===" ";return re?b.taskOpen=!0:b.taskClosed=!0,k.highlightFormatting&&(b.formatting="task"),b.taskList=!1,S(b)}if(b.taskOpen=!1,b.taskClosed=!1,b.header&&P.match(/^#+$/,!0))return k.highlightFormatting&&(b.formatting="header"),S(b);var ce=P.next();if(b.linkTitle){b.linkTitle=!1;var me=ce;ce==="("&&(me=")"),me=(me+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var De="^\\s*(?:[^"+me+"\\\\]+|\\\\\\\\|\\\\.)"+me;if(P.match(new RegExp(De),!0))return W.linkHref}if(ce==="`"){var we=b.formatting;k.highlightFormatting&&(b.formatting="code"),P.eatWhile("`");var Le=P.current().length;if(b.code==0&&(!b.quote||Le==1))return b.code=Le,S(b);if(Le==b.code){var Re=S(b);return b.code=0,Re}else return b.formatting=we,S(b)}else if(b.code)return S(b);if(ce==="\\"&&(P.next(),k.highlightFormatting)){var Ie=S(b),ye=W.formatting+"-escape";return Ie?Ie+" "+ye:ye}if(ce==="!"&&P.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return b.imageMarker=!0,b.image=!0,k.highlightFormatting&&(b.formatting="image"),S(b);if(ce==="["&&b.imageMarker&&P.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return b.imageMarker=!1,b.imageAltText=!0,k.highlightFormatting&&(b.formatting="image"),S(b);if(ce==="]"&&b.imageAltText){k.highlightFormatting&&(b.formatting="image");var Ie=S(b);return b.imageAltText=!1,b.image=!1,b.inline=b.f=x,Ie}if(ce==="["&&!b.image)return b.linkText&&P.match(/^.*?\]/)||(b.linkText=!0,k.highlightFormatting&&(b.formatting="link")),S(b);if(ce==="]"&&b.linkText){k.highlightFormatting&&(b.formatting="link");var Ie=S(b);return b.linkText=!1,b.inline=b.f=P.match(/\(.*?\)| ?\[.*?\]/,!1)?x:E,Ie}if(ce==="<"&&P.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){b.f=b.inline=c,k.highlightFormatting&&(b.formatting="link");var Ie=S(b);return Ie?Ie+=" ":Ie="",Ie+W.linkInline}if(ce==="<"&&P.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){b.f=b.inline=c,k.highlightFormatting&&(b.formatting="link");var Ie=S(b);return Ie?Ie+=" ":Ie="",Ie+W.linkEmail}if(k.xml&&ce==="<"&&P.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var X=P.string.indexOf(">",P.pos);if(X!=-1){var M=P.string.substring(P.start,X);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(M)&&(b.md_inside=!0)}return P.backUp(1),b.htmlState=oe.startState(z),s(P,b,O)}if(k.xml&&ce==="<"&&P.match(/^\/\w*?>/))return b.md_inside=!1,"tag";if(ce==="*"||ce==="_"){for(var N=1,Y=P.pos==1?" ":P.string.charAt(P.pos-2);N<3&&P.eat(ce);)N++;var ie=P.peek()||" ",K=!/\s/.test(ie)&&(!l.test(ie)||/\s/.test(Y)||l.test(Y)),pe=!/\s/.test(Y)&&(!l.test(Y)||/\s/.test(ie)||l.test(ie)),Se=null,Pe=null;if(N%2&&(!b.em&&K&&(ce==="*"||!pe||l.test(Y))?Se=!0:b.em==ce&&pe&&(ce==="*"||!K||l.test(ie))&&(Se=!1)),N>1&&(!b.strong&&K&&(ce==="*"||!pe||l.test(Y))?Pe=!0:b.strong==ce&&pe&&(ce==="*"||!K||l.test(ie))&&(Pe=!1)),Pe!=null||Se!=null){k.highlightFormatting&&(b.formatting=Se==null?"strong":Pe==null?"em":"strong em"),Se===!0&&(b.em=ce),Pe===!0&&(b.strong=ce);var Re=S(b);return Se===!1&&(b.em=!1),Pe===!1&&(b.strong=!1),Re}}else if(ce===" "&&(P.eat("*")||P.eat("_"))){if(P.peek()===" ")return S(b);P.backUp(1)}if(k.strikethrough){if(ce==="~"&&P.eatWhile(ce)){if(b.strikethrough){k.highlightFormatting&&(b.formatting="strikethrough");var Re=S(b);return b.strikethrough=!1,Re}else if(P.match(/^[^\s]/,!1))return b.strikethrough=!0,k.highlightFormatting&&(b.formatting="strikethrough"),S(b)}else if(ce===" "&&P.match(/^~~/,!0)){if(P.peek()===" ")return S(b);P.backUp(2)}}if(k.emoji&&ce===":"&&P.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){b.emoji=!0,k.highlightFormatting&&(b.formatting="emoji");var he=S(b);return b.emoji=!1,he}return ce===" "&&(P.match(/^ +$/,!1)?b.trailingSpace++:b.trailingSpace&&(b.trailingSpaceNewLine=!0)),S(b)}function c(P,b){var V=P.next();if(V===">"){b.f=b.inline=E,k.highlightFormatting&&(b.formatting="link");var re=S(b);return re?re+=" ":re="",re+W.linkInline}return P.match(/^[^>]+/,!0),W.linkInline}function x(P,b){if(P.eatSpace())return null;var V=P.next();return V==="("||V==="["?(b.f=b.inline=y(V==="("?")":"]"),k.highlightFormatting&&(b.formatting="link-string"),b.linkHref=!0,S(b)):"error"}var v={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function y(P){return function(b,V){var re=b.next();if(re===P){V.f=V.inline=E,k.highlightFormatting&&(V.formatting="link-string");var ce=S(V);return V.linkHref=!1,ce}return b.match(v[P]),V.linkHref=!0,S(V)}}function F(P,b){return P.match(/^([^\]\\]|\\.)*\]:/,!1)?(b.f=B,P.next(),k.highlightFormatting&&(b.formatting="link"),b.linkText=!0,S(b)):a(P,b,E)}function B(P,b){if(P.match(/^\]:/,!0)){b.f=b.inline=A,k.highlightFormatting&&(b.formatting="link");var V=S(b);return b.linkText=!1,V}return P.match(/^([^\]\\]|\\.)+/,!0),W.linkText}function A(P,b){return P.eatSpace()?null:(P.match(/^[^\s]+/,!0),P.peek()===void 0?b.linkTitle=!0:P.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),b.f=b.inline=E,W.linkHref+" url")}var j={startState:function(){return{f:w,prevLine:{stream:null},thisLine:{stream:null},block:w,htmlState:null,indentation:0,inline:E,text:T,formatting:!1,linkText:!1,linkHref:!1,linkTitle:!1,code:0,em:!1,strong:!1,header:0,setext:0,hr:!1,taskList:!1,list:!1,listStack:[],quote:0,trailingSpace:0,trailingSpaceNewLine:!1,strikethrough:!1,emoji:!1,fencedEndRE:null}},copyState:function(P){return{f:P.f,prevLine:P.prevLine,thisLine:P.thisLine,block:P.block,htmlState:P.htmlState&&oe.copyState(z,P.htmlState),indentation:P.indentation,localMode:P.localMode,localState:P.localMode?oe.copyState(P.localMode,P.localState):null,inline:P.inline,text:P.text,formatting:!1,linkText:P.linkText,linkTitle:P.linkTitle,linkHref:P.linkHref,code:P.code,em:P.em,strong:P.strong,strikethrough:P.strikethrough,emoji:P.emoji,header:P.header,setext:P.setext,hr:P.hr,taskList:P.taskList,list:P.list,listStack:P.listStack.slice(0),quote:P.quote,indentedCode:P.indentedCode,trailingSpace:P.trailingSpace,trailingSpaceNewLine:P.trailingSpaceNewLine,md_inside:P.md_inside,fencedEndRE:P.fencedEndRE}},token:function(P,b){if(b.formatting=!1,P!=b.thisLine.stream){if(b.header=0,b.hr=!1,P.match(/^\s*$/,!0))return _(b),null;if(b.prevLine=b.thisLine,b.thisLine={stream:P},b.taskList=!1,b.trailingSpace=0,b.trailingSpaceNewLine=!1,!b.localState&&(b.f=b.block,b.f!=O)){var V=P.match(/^\s*/,!0)[0].replace(/\t/g,u).length;if(b.indentation=V,b.indentationDiff=null,V>0)return null}}return b.f(P,b)},innerMode:function(P){return P.block==O?{state:P.htmlState,mode:z}:P.localState?{state:P.localState,mode:P.localMode}:{state:P,mode:j}},indent:function(P,b,V){return P.block==O&&z.indent?z.indent(P.htmlState,b,V):P.localState&&P.localMode.indent?P.localMode.indent(P.localState,b,V):oe.Pass},blankLine:_,getType:S,blockCommentStart:"<!--",blockCommentEnd:"-->",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return j},"xml"),oe.defineMIME("text/markdown","markdown"),oe.defineMIME("text/x-markdown","markdown")})},nEHx:function(tt,Ee,J){"use strict";J.d(Ee,"a",function(){return oe});var oe;(function($){$.DARK="dark",$.LIGHT="light",$.HIGH_CONTRAST="hc"})(oe||(oe={}))},nnTU:function(tt,Ee,J){"use strict";J.d(Ee,"b",function(){return W}),J.d(Ee,"a",function(){return H});var oe=J("MI8n"),$=J("JYp7"),k=J("pmY6"),z=J("24hK"),U=J("746U"),L=J("Cg/j");const W=Object(L.c)("commandService"),H=new class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new oe.b,this.onDidRegisterCommand=this._onDidRegisterCommand.event}registerCommand(n,I){if(!n)throw new Error("invalid command");if(typeof n=="string"){if(!I)throw new Error("invalid command");return this.registerCommand({id:n,handler:I})}if(n.description){const o=[];for(let l of n.description.args)o.push(l.constraint);const p=n.handler;n.handler=function(l,...u){return Object(U.o)(u,o),p(l,...u)}}const{id:g}=n;let f=this._commands.get(g);f||(f=new z.a,this._commands.set(g,f));let m=f.unshift(n),h=Object(k.i)(()=>{m();const o=this._commands.get(g);(o==null?void 0:o.isEmpty())&&this._commands.delete(g)});return this._onDidRegisterCommand.fire(g),h}registerCommandAlias(n,I){return H.registerCommand(n,(g,...f)=>g.get(W).executeCommand(I,...f))}getCommand(n){const I=this._commands.get(n);return!I||I.isEmpty()?void 0:$.a.first(I)}getCommands(){const n=new Map;for(const I of this._commands.keys()){const g=this.getCommand(I);g&&n.set(I,g)}return n}};H.registerCommand("noop",()=>{})},osHv:function(tt,Ee,J){(function(oe){oe(J("VrN/"))})(function(oe){"use strict";var $=oe.Pos;function k(l,u){return l.line-u.line||l.ch-u.ch}var z="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",U=z+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",L=new RegExp("<(/?)(["+z+"]["+U+"]*)","g");function W(l,u,a,s){this.line=u,this.ch=a,this.cm=l,this.text=l.getLine(u),this.min=s?Math.max(s.from,l.firstLine()):l.firstLine(),this.max=s?Math.min(s.to-1,l.lastLine()):l.lastLine()}function H(l,u){var a=l.cm.getTokenTypeAt($(l.line,u));return a&&/\btag\b/.test(a)}function n(l){return l.line>=l.max?void 0:(l.ch=0,l.text=l.cm.getLine(++l.line),!0)}function I(l){return l.line<=l.min?void 0:(l.text=l.cm.getLine(--l.line),l.ch=l.text.length,!0)}function g(l){for(;;){var u=l.text.indexOf(">",l.ch);if(u==-1){if(n(l))continue;return}if(!H(l,u+1)){l.ch=u+1;continue}var a=l.text.lastIndexOf("/",u),s=a>-1&&!/\S/.test(l.text.slice(a+1,u));return l.ch=u+1,s?"selfClose":"regular"}}function f(l){for(;;){var u=l.ch?l.text.lastIndexOf("<",l.ch-1):-1;if(u==-1){if(I(l))continue;return}if(!H(l,u+1)){l.ch=u;continue}L.lastIndex=u,l.ch=u;var a=L.exec(l.text);if(a&&a.index==u)return a}}function m(l){for(;;){L.lastIndex=l.ch;var u=L.exec(l.text);if(!u){if(n(l))continue;return}if(!H(l,u.index+1)){l.ch=u.index+1;continue}return l.ch=u.index+u[0].length,u}}function h(l){for(;;){var u=l.ch?l.text.lastIndexOf(">",l.ch-1):-1;if(u==-1){if(I(l))continue;return}if(!H(l,u+1)){l.ch=u;continue}var a=l.text.lastIndexOf("/",u),s=a>-1&&!/\S/.test(l.text.slice(a+1,u));return l.ch=u+1,s?"selfClose":"regular"}}function o(l,u){for(var a=[];;){var s=m(l),C,_=l.line,w=l.ch-(s?s[0].length:0);if(!s||!(C=g(l)))return;if(C=="selfClose")continue;if(s[1]){for(var O=a.length-1;O>=0;--O)if(a[O]==s[2]){a.length=O;break}if(O<0&&(!u||u==s[2]))return{tag:s[2],from:$(_,w),to:$(l.line,l.ch)}}else a.push(s[2])}}function p(l,u){for(var a=[];;){var s=h(l);if(!s)return;if(s=="selfClose"){f(l);continue}var C=l.line,_=l.ch,w=f(l);if(!w)return;if(w[1])a.push(w[2]);else{for(var O=a.length-1;O>=0;--O)if(a[O]==w[2]){a.length=O;break}if(O<0&&(!u||u==w[2]))return{tag:w[2],from:$(l.line,l.ch),to:$(C,_)}}}}oe.registerHelper("fold","xml",function(l,u){for(var a=new W(l,u.line,0);;){var s=m(a);if(!s||a.line!=u.line)return;var C=g(a);if(!C)return;if(!s[1]&&C!="selfClose"){var _=$(a.line,a.ch),w=o(a,s[2]);return w&&k(w.from,_)>0?{from:_,to:w.from}:null}}}),oe.findMatchingTag=function(l,u,a){var s=new W(l,u.line,u.ch,a);if(s.text.indexOf(">")==-1&&s.text.indexOf("<")==-1)return;var C=g(s),_=C&&$(s.line,s.ch),w=C&&f(s);if(!C||!w||k(s,u)>0)return;var O={from:$(s.line,s.ch),to:_,tag:w[2]};return C=="selfClose"?{open:O,close:null,at:"open"}:w[1]?{open:p(s,w[2]),close:O,at:"close"}:(s=new W(l,_.line,_.ch,a),{open:O,close:o(s,w[2]),at:"open"})},oe.findEnclosingTag=function(l,u,a,s){for(var C=new W(l,u.line,u.ch,a);;){var _=p(C,s);if(!_)break;var w=new W(l,u.line,u.ch,a),O=o(w,_.tag);if(O)return{open:_,close:O}}},oe.scanForClosingTag=function(l,u,a,s){var C=new W(l,u.line,u.ch,s?{from:0,to:s}:null);return o(C,a)}})},p5ED:function(tt,Ee,J){"use strict";var oe=J("+L6B"),$=J("2/Rp"),k=J("5Dmo"),z=J("3S7+"),U=J("k1fw"),L=J("9og8"),W=J("tJVT"),H=J("WmNS"),n=J.n(H),I=J("q1tI"),g=J.n(I),f=J("vHTk"),m=J.n(f),h=J("yEEn"),o=J("ZW9T"),p=J("1vsH"),l=J("V0Rq"),u=J("m3rI");Ee.a=function(a){var s,C,_,w,O,R,S,T=a.editOffice,E=T===void 0?"view":T,c=a.data,x=a.theme,v=a.type,y=a.filename,F=a.monacoEditor,B=a.className,A=a.style,j=a.close,P=a.onClose,b=a.hasMask,V=a.disabledDownload,re=Object(I.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),ce=Object(W.a)(re,2),me=ce[0],De=ce[1],we=Object(I.useState)(""),Le=Object(W.a)(we,2),Re=Le[0],Ie=Le[1],ye=Object(I.useState)(),X=Object(W.a)(ye,2),M=X[0],N=X[1],Y=window.ENV==="build"?"/react/build":"",ie=u.a.PROXY_SERVER||location.origin,K,pe=1024*1024,Se=10*pe,Pe=Object(I.useRef)();(s=c)!==null&&s!==void 0&&s.startsWith("/api")&&v!=="txt"&&(c=(u.a.API_SERVER||location.origin)+c),v==="office"&&(K=Object(p.T)(c).filesize,K>Se&&(v="other")),y&&F&&(F.filename=y),Object(I.useEffect)(function(){var Ce,Be,Ne=(Ce=document.cookie)===null||Ce===void 0||((Be=Ce.replace(/\s/g,""))===null||Be===void 0)?void 0:Be.split(";");Ne==null||Ne.map(function(Ue){var He=Ue.split("=");He[0]==="_educoder_session"&&Ie(He[1])})},[]),Object(I.useEffect)(function(){v==="office"&&he()},[v,c]);var he=function(){var Ce=Object(L.a)(n.a.mark(function Be(){var Ne,Ue,He;return n.a.wrap(function(Ge){for(;;)switch(Ge.prev=Ge.next){case 0:return console.log("data:",c),Ne=c,c.startsWith("http")||(Ne=location.origin+Ne),Ue=new URL(Ne).pathname.split("/").pop(),Ge.next=6,Object(l.V)({attachment_id:Ue});case 6:He=Ge.sent,N(He);case 8:case"end":return Ge.stop()}},Be)}));return function(){return Ce.apply(this,arguments)}}(),ve=function(){if(c.startsWith("http")||c.startsWith("blob:")){xe();return}Object(p.z)(y||"educoder",c,y)},xe=function(){Object(p.x)(y||"educoder",decodeURIComponent(c))};return g.a.createElement("div",{style:Object(U.a)({},A||{}),className:"".concat(b&&m.a.bgBlack," ").concat(v?m.a.wrp:"hide")},j&&g.a.createElement("div",{className:m.a.close,ref:Pe},!V&&g.a.createElement(z.a,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:function(){return Pe.current}},g.a.createElement("span",{onClick:xe},g.a.createElement("i",{className:"icon-quxiaozhiding"}))),g.a.createElement(z.a,{title:"\u5173\u95ED",getPopupContainer:function(){return Pe.current}},g.a.createElement("span",{className:"",onClick:P},g.a.createElement("i",{className:"icon-guanbi1"})))),g.a.createElement("div",{className:"".concat(m.a[B]," ").concat(B," ").concat(m.a.monaco," ").concat(v==="txt"?"show":"hide")},v==="txt"&&g.a.createElement(o.b,F)),v==="audio"&&g.a.createElement("audio",{src:"".concat(((C=c)===null||C===void 0?void 0:C.indexOf("http://"))>-1||((_=c)===null||_===void 0?void 0:_.indexOf("https://"))>-1?"":"data:audio/mp3;base64,").concat(c),autoPlay:!0}),v==="video"&&g.a.createElement(g.a.Fragment,null,((w=c)===null||w===void 0?void 0:w.indexOf("http"))>-1?g.a.createElement("video",{controls:!0,src:"".concat(c),autoPlay:!0}):g.a.createElement("video",{controls:!0,src:"data:video/mp4;base64,".concat(c),autoPlay:!0})),v==="office"&&M&&g.a.createElement("iframe",{src:"".concat(Y,"/office.html?key=").concat(M.key,"&url=").concat(ie+M.url,"&callbackUrl=").concat(ie+M.callbackUrl,"&fileType=").concat(M.fileType,"&title=").concat(M.title,"&model=").concat(E,"&officeServer=").concat(u.a.OFFICE_SERVER,"&disabledDownload=").concat(!!V)}),v==="html"&&g.a.createElement("iframe",{src:c+"&disposition=inline"}),v==="pdf"&&g.a.createElement("iframe",{src:"".concat(Y,"/js/pdfview/index.html?url=").concat(c,"&disabledDownload=").concat(!!V)}),v==="image"&&g.a.createElement("img",{src:"".concat(((O=c)===null||O===void 0?void 0:O.indexOf("http://"))>-1||((R=c)===null||R===void 0?void 0:R.indexOf("https://"))>-1||(S=c)!==null&&S!==void 0&&S.startsWith("/api")?"":"data:image/png;base64,").concat(c)}),v==="other"&&g.a.createElement("div",null,g.a.createElement($.a,{type:"primary",size:"large",onClick:ve},g.a.createElement(h.a,null),"\u70B9\u51FB\u4E0B\u8F7D")),v==="download"&&g.a.createElement($.a,{type:"primary",size:"large",onClick:ve},g.a.createElement(h.a,null),"\u70B9\u51FB\u4E0B\u8F7D"))}},"p77/":function(tt,Ee,J){},pmY6:function(tt,Ee,J){"use strict";J.d(Ee,"h",function(){return I}),J.d(Ee,"g",function(){return f}),J.d(Ee,"f",function(){return m}),J.d(Ee,"e",function(){return h}),J.d(Ee,"i",function(){return o}),J.d(Ee,"b",function(){return p}),J.d(Ee,"a",function(){return l}),J.d(Ee,"d",function(){return u}),J.d(Ee,"c",function(){return a});var oe=J("C/vA"),$=J("JYp7");const k=!1;let z=null;function U(s){z=s}if(k){const s="__is_disposable_tracked__";U(new class{trackDisposable(C){const _=new Error("Potentially leaked disposable").stack;setTimeout(()=>{C[s]||console.log(_)},3e3)}setParent(C,_){if(C&&C!==l.None)try{C[s]=!0}catch(w){}}markAsDisposed(C){if(C&&C!==l.None)try{C[s]=!0}catch(_){}}markAsSingleton(C){}})}function L(s){return z==null||z.trackDisposable(s),s}function W(s){z==null||z.markAsDisposed(s)}function H(s,C){z==null||z.setParent(s,C)}function n(s,C){if(!z)return;for(const _ of s)z.setParent(_,C)}function I(s){return z==null||z.markAsSingleton(s),s}class g extends Error{constructor(s){super(`Encountered errors while disposing of store. Errors: [${s.join(", ")}]`);this.errors=s}}function f(s){return typeof s.dispose=="function"&&s.dispose.length===0}function m(s){if($.a.is(s)){let C=[];for(const _ of s)if(_)try{_.dispose()}catch(w){C.push(w)}if(C.length===1)throw C[0];if(C.length>1)throw new g(C);return Array.isArray(s)?[]:s}else if(s)return s.dispose(),s}function h(...s){const C=o(()=>m(s));return n(s,C),C}function o(s){const C=L({dispose:Object(oe.a)(()=>{W(C),s()})});return C}class p{constructor(){this._toDispose=new Set,this._isDisposed=!1,L(this)}dispose(){if(this._isDisposed)return;W(this),this._isDisposed=!0,this.clear()}clear(){try{m(this._toDispose.values())}finally{this._toDispose.clear()}}add(s){if(!s)return s;if(s===this)throw new Error("Cannot register a disposable on itself!");return H(s,this),this._isDisposed?p.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(s),s}}p.DISABLE_DISPOSED_WARNING=!1;class l{constructor(){this._store=new p,L(this),H(this._store,this)}dispose(){W(this),this._store.dispose()}_register(s){if(s===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(s)}}l.None=Object.freeze({dispose(){}});class u{constructor(){this._isDisposed=!1,L(this)}get value(){return this._isDisposed?void 0:this._value}set value(s){var C;if(this._isDisposed||s===this._value)return;(C=this._value)===null||C===void 0||C.dispose(),s&&H(s,this),this._value=s}clear(){this.value=void 0}dispose(){var s;this._isDisposed=!0,W(this),(s=this._value)===null||s===void 0||s.dispose(),this._value=void 0}clearAndLeak(){const s=this._value;return this._value=void 0,s&&H(s,null),s}}class a{constructor(s){this.object=s}dispose(){}}},psGv:function(tt,Ee,J){var oe,$;(function(){var k;(function(){"use strict";var W=[,,function(g){function f(o){this.__parent=o,this.__character_count=0,this.__indent_count=-1,this.__alignment_count=0,this.__wrap_point_index=0,this.__wrap_point_character_count=0,this.__wrap_point_indent_count=-1,this.__wrap_point_alignment_count=0,this.__items=[]}f.prototype.clone_empty=function(){var o=new f(this.__parent);return o.set_indent(this.__indent_count,this.__alignment_count),o},f.prototype.item=function(o){return o<0?this.__items[this.__items.length+o]:this.__items[o]},f.prototype.has_match=function(o){for(var p=this.__items.length-1;p>=0;p--)if(this.__items[p].match(o))return!0;return!1},f.prototype.set_indent=function(o,p){this.is_empty()&&(this.__indent_count=o||0,this.__alignment_count=p||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},f.prototype._set_wrap_point=function(){this.__parent.wrap_line_length&&(this.__wrap_point_index=this.__items.length,this.__wrap_point_character_count=this.__character_count,this.__wrap_point_indent_count=this.__parent.next_line.__indent_count,this.__wrap_point_alignment_count=this.__parent.next_line.__alignment_count)},f.prototype._should_wrap=function(){return this.__wrap_point_index&&this.__character_count>this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count},f.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var o=this.__parent.current_line;return o.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),o.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),o.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,o.__items[0]===" "&&(o.__items.splice(0,1),o.__character_count-=1),!0}return!1},f.prototype.is_empty=function(){return this.__items.length===0},f.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},f.prototype.push=function(o){this.__items.push(o);var p=o.lastIndexOf(`
`);p!==-1?this.__character_count=o.length-p:this.__character_count+=o.length},f.prototype.pop=function(){var o=null;return this.is_empty()||(o=this.__items.pop(),this.__character_count-=o.length),o},f.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},f.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},f.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},f.prototype.toString=function(){var o="";return this.is_empty()?this.__parent.indent_empty_lines&&(o=this.__parent.get_indent_string(this.__indent_count)):(o=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),o+=this.__items.join("")),o};function m(o,p){this.__cache=[""],this.__indent_size=o.indent_size,this.__indent_string=o.indent_char,o.indent_with_tabs||(this.__indent_string=new Array(o.indent_size+1).join(o.indent_char)),p=p||"",o.indent_level>0&&(p=new Array(o.indent_level+1).join(this.__indent_string)),this.__base_string=p,this.__base_string_length=p.length}m.prototype.get_indent_size=function(o,p){var l=this.__base_string_length;return p=p||0,o<0&&(l=0),l+=o*this.__indent_size,l+=p,l},m.prototype.get_indent_string=function(o,p){var l=this.__base_string;return p=p||0,o<0&&(o=0,l=""),p+=o*this.__indent_size,this.__ensure_cache(p),l+=this.__cache[p],l},m.prototype.__ensure_cache=function(o){for(;o>=this.__cache.length;)this.__add_column()},m.prototype.__add_column=function(){var o=this.__cache.length,p=0,l="";this.__indent_size&&o>=this.__indent_size&&(p=Math.floor(o/this.__indent_size),o-=p*this.__indent_size,l=new Array(p+1).join(this.__indent_string)),o&&(l+=new Array(o+1).join(" ")),this.__cache.push(l)};function h(o,p){this.__indent_cache=new m(o,p),this.raw=!1,this._end_with_newline=o.end_with_newline,this.indent_size=o.indent_size,this.wrap_line_length=o.wrap_line_length,this.indent_empty_lines=o.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new f(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}h.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},h.prototype.get_line_number=function(){return this.__lines.length},h.prototype.get_indent_string=function(o,p){return this.__indent_cache.get_indent_string(o,p)},h.prototype.get_indent_size=function(o,p){return this.__indent_cache.get_indent_size(o,p)},h.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},h.prototype.add_new_line=function(o){return this.is_empty()||!o&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},h.prototype.get_code=function(o){this.trim(!0);var p=this.current_line.pop();p&&(p[p.length-1]===`
`&&(p=p.replace(/\n+$/g,"")),this.current_line.push(p)),this._end_with_newline&&this.__add_outputline();var l=this.__lines.join(`
`);return o!==`
`&&(l=l.replace(/[\n]/g,o)),l},h.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},h.prototype.set_indent=function(o,p){return o=o||0,p=p||0,this.next_line.set_indent(o,p),this.__lines.length>1?(this.current_line.set_indent(o,p),!0):(this.current_line.set_indent(),!1)},h.prototype.add_raw_token=function(o){for(var p=0;p<o.newlines;p++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(o.whitespace_before),this.current_line.push(o.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},h.prototype.add_token=function(o){this.__add_space_before_token(),this.current_line.push(o),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},h.prototype.__add_space_before_token=function(){this.space_before_token&&!this.just_added_newline()&&(this.non_breaking_space||this.set_wrap_point(),this.current_line.push(" "))},h.prototype.remove_indent=function(o){for(var p=this.__lines.length;o<p;)this.__lines[o]._remove_indent(),o++;this.current_line._remove_wrap_indent()},h.prototype.trim=function(o){for(o=o===void 0?!1:o,this.current_line.trim();o&&this.__lines.length>1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},h.prototype.just_added_newline=function(){return this.current_line.is_empty()},h.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},h.prototype.ensure_empty_line_above=function(o,p){for(var l=this.__lines.length-2;l>=0;){var u=this.__lines[l];if(u.is_empty())break;if(u.item(0).indexOf(o)!==0&&u.item(-1)!==p){this.__lines.splice(l+1,0,new f(this)),this.previous_line=this.__lines[this.__lines.length-2];break}l--}},g.exports.Output=h},function(g){function f(m,h,o,p){this.type=m,this.text=h,this.comments_before=null,this.newlines=o||0,this.whitespace_before=p||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}g.exports.Token=f},,,function(g){function f(o,p){this.raw_options=m(o,p),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs",this.indent_char===" "),this.indent_with_tabs&&(this.indent_char=" ",this.indent_size===1&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","django","erb","handlebars","php","smarty"],["auto"])}f.prototype._get_array=function(o,p){var l=this.raw_options[o],u=p||[];return typeof l=="object"?l!==null&&typeof l.concat=="function"&&(u=l.concat()):typeof l=="string"&&(u=l.split(/[^a-zA-Z0-9_\/\-]+/)),u},f.prototype._get_boolean=function(o,p){var l=this.raw_options[o],u=l===void 0?!!p:!!l;return u},f.prototype._get_characters=function(o,p){var l=this.raw_options[o],u=p||"";return typeof l=="string"&&(u=l.replace(/\\r/,"\r").replace(/\\n/,`
`).replace(/\\t/," ")),u},f.prototype._get_number=function(o,p){var l=this.raw_options[o];p=parseInt(p,10),isNaN(p)&&(p=0);var u=parseInt(l,10);return isNaN(u)&&(u=p),u},f.prototype._get_selection=function(o,p,l){var u=this._get_selection_list(o,p,l);if(u.length!==1)throw new Error("Invalid Option Value: The option '"+o+`' can only be one of the following values:
`+p+`
You passed in: '`+this.raw_options[o]+"'");return u[0]},f.prototype._get_selection_list=function(o,p,l){if(!p||p.length===0)throw new Error("Selection list cannot be empty.");if(l=l||[p[0]],!this._is_valid_selection(l,p))throw new Error("Invalid Default Value!");var u=this._get_array(o,l);if(!this._is_valid_selection(u,p))throw new Error("Invalid Option Value: The option '"+o+`' can contain only the following values:
`+p+`
You passed in: '`+this.raw_options[o]+"'");return u},f.prototype._is_valid_selection=function(o,p){return o.length&&p.length&&!o.some(function(l){return p.indexOf(l)===-1})};function m(o,p){var l={};o=h(o);var u;for(u in o)u!==p&&(l[u]=o[u]);if(p&&o[p])for(u in o[p])l[u]=o[p][u];return l}function h(o){var p={},l;for(l in o){var u=l.replace(/-/g,"_");p[u]=o[l]}return p}g.exports.Options=f,g.exports.normalizeOpts=h,g.exports.mergeOpts=m},,function(g){var f=RegExp.prototype.hasOwnProperty("sticky");function m(h){this.__input=h||"",this.__input_length=this.__input.length,this.__position=0}m.prototype.restart=function(){this.__position=0},m.prototype.back=function(){this.__position>0&&(this.__position-=1)},m.prototype.hasNext=function(){return this.__position<this.__input_length},m.prototype.next=function(){var h=null;return this.hasNext()&&(h=this.__input.charAt(this.__position),this.__position+=1),h},m.prototype.peek=function(h){var o=null;return h=h||0,h+=this.__position,h>=0&&h<this.__input_length&&(o=this.__input.charAt(h)),o},m.prototype.__match=function(h,o){h.lastIndex=o;var p=h.exec(this.__input);return p&&!(f&&h.sticky)&&(p.index!==o&&(p=null)),p},m.prototype.test=function(h,o){return o=o||0,o+=this.__position,o>=0&&o<this.__input_length?!!this.__match(h,o):!1},m.prototype.testChar=function(h,o){var p=this.peek(o);return h.lastIndex=0,p!==null&&h.test(p)},m.prototype.match=function(h){var o=this.__match(h,this.__position);return o?this.__position+=o[0].length:o=null,o},m.prototype.read=function(h,o,p){var l="",u;return h&&(u=this.match(h),u&&(l+=u[0])),o&&(u||!h)&&(l+=this.readUntil(o,p)),l},m.prototype.readUntil=function(h,o){var p="",l=this.__position;h.lastIndex=this.__position;var u=h.exec(this.__input);return u?(l=u.index,o&&(l+=u[0].length)):l=this.__input_length,p=this.__input.substring(this.__position,l),this.__position=l,p},m.prototype.readUntilAfter=function(h){return this.readUntil(h,!0)},m.prototype.get_regexp=function(h,o){var p=null,l="g";return o&&f&&(l="y"),typeof h=="string"&&h!==""?p=new RegExp(h,l):h&&(p=new RegExp(h.source,l)),p},m.prototype.get_literal_regexp=function(h){return RegExp(h.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},m.prototype.peekUntilAfter=function(h){var o=this.__position,p=this.readUntilAfter(h);return this.__position=o,p},m.prototype.lookBack=function(h){var o=this.__position-1;return o>=h.length&&this.__input.substring(o-h.length,o).toLowerCase()===h},g.exports.InputScanner=m},function(g,f,m){var h=m(8).InputScanner,o=m(3).Token,p=m(10).TokenStream,l=m(11).WhitespacePattern,u={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},a=function(s,C){this._input=new h(s),this._options=C||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new l(this._input)};a.prototype.tokenize=function(){this._input.restart(),this.__tokens=new p,this._reset();for(var s,C=new o(u.START,""),_=null,w=[],O=new p;C.type!==u.EOF;){for(s=this._get_next_token(C,_);this._is_comment(s);)O.add(s),s=this._get_next_token(C,_);O.isEmpty()||(s.comments_before=O,O=new p),s.parent=_,this._is_opening(s)?(w.push(_),_=s):_&&this._is_closing(s,_)&&(s.opened=_,_.closed=s,_=w.pop(),s.parent=_),s.previous=C,C.next=s,this.__tokens.add(s),C=s}return this.__tokens},a.prototype._is_first_token=function(){return this.__tokens.isEmpty()},a.prototype._reset=function(){},a.prototype._get_next_token=function(s,C){this._readWhitespace();var _=this._input.read(/.+/g);return _?this._create_token(u.RAW,_):this._create_token(u.EOF,"")},a.prototype._is_comment=function(s){return!1},a.prototype._is_opening=function(s){return!1},a.prototype._is_closing=function(s,C){return!1},a.prototype._create_token=function(s,C){var _=new o(s,C,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return _},a.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},g.exports.Tokenizer=a,g.exports.TOKEN=u},function(g){function f(m){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=m}f.prototype.restart=function(){this.__position=0},f.prototype.isEmpty=function(){return this.__tokens_length===0},f.prototype.hasNext=function(){return this.__position<this.__tokens_length},f.prototype.next=function(){var m=null;return this.hasNext()&&(m=this.__tokens[this.__position],this.__position+=1),m},f.prototype.peek=function(m){var h=null;return m=m||0,m+=this.__position,m>=0&&m<this.__tokens_length&&(h=this.__tokens[m]),h},f.prototype.add=function(m){this.__parent_token&&(m.parent=this.__parent_token),this.__tokens.push(m),this.__tokens_length+=1},g.exports.TokenStream=f},function(g,f,m){var h=m(12).Pattern;function o(p,l){h.call(this,p,l),l?this._line_regexp=this._input.get_regexp(l._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}o.prototype=new h,o.prototype.__set_whitespace_patterns=function(p,l){p+="\\t ",l+="\\n\\r",this._match_pattern=this._input.get_regexp("["+p+l+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+l+"]")},o.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var p=this._input.read(this._match_pattern);if(p===" ")this.whitespace_before_token=" ";else if(p){var l=this.__split(this._newline_regexp,p);this.newline_count=l.length-1,this.whitespace_before_token=l[this.newline_count]}return p},o.prototype.matching=function(p,l){var u=this._create();return u.__set_whitespace_patterns(p,l),u._update(),u},o.prototype._create=function(){return new o(this._input,this)},o.prototype.__split=function(p,l){p.lastIndex=0;for(var u=0,a=[],s=p.exec(l);s;)a.push(l.substring(u,s.index)),u=s.index+s[0].length,s=p.exec(l);return u<l.length?a.push(l.substring(u,l.length)):a.push(""),a},g.exports.WhitespacePattern=o},function(g){function f(m,h){this._input=m,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,h&&(this._starting_pattern=this._input.get_regexp(h._starting_pattern,!0),this._match_pattern=this._input.get_regexp(h._match_pattern,!0),this._until_pattern=this._input.get_regexp(h._until_pattern),this._until_after=h._until_after)}f.prototype.read=function(){var m=this._input.read(this._starting_pattern);return(!this._starting_pattern||m)&&(m+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),m},f.prototype.read_match=function(){return this._input.match(this._match_pattern)},f.prototype.until_after=function(m){var h=this._create();return h._until_after=!0,h._until_pattern=this._input.get_regexp(m),h._update(),h},f.prototype.until=function(m){var h=this._create();return h._until_after=!1,h._until_pattern=this._input.get_regexp(m),h._update(),h},f.prototype.starting_with=function(m){var h=this._create();return h._starting_pattern=this._input.get_regexp(m,!0),h._update(),h},f.prototype.matching=function(m){var h=this._create();return h._match_pattern=this._input.get_regexp(m,!0),h._update(),h},f.prototype._create=function(){return new f(this._input,this)},f.prototype._update=function(){},g.exports.Pattern=f},function(g){function f(m,h){m=typeof m=="string"?m:m.source,h=typeof h=="string"?h:h.source,this.__directives_block_pattern=new RegExp(m+/ beautify( \w+[:]\w+)+ /.source+h,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(m+/\sbeautify\signore:end\s/.source+h,"g")}f.prototype.get_directives=function(m){if(!m.match(this.__directives_block_pattern))return null;var h={};this.__directive_pattern.lastIndex=0;for(var o=this.__directive_pattern.exec(m);o;)h[o[1]]=o[2],o=this.__directive_pattern.exec(m);return h},f.prototype.readIgnored=function(m){return m.readUntilAfter(this.__directives_end_ignore_pattern)},g.exports.Directives=f},function(g,f,m){var h=m(12).Pattern,o={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1};function p(l,u){h.call(this,l,u),this.__template_pattern=null,this._disabled=Object.assign({},o),this._excluded=Object.assign({},o),u&&(this.__template_pattern=this._input.get_regexp(u.__template_pattern),this._excluded=Object.assign(this._excluded,u._excluded),this._disabled=Object.assign(this._disabled,u._disabled));var a=new h(l);this.__patterns={handlebars_comment:a.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:a.starting_with(/{{{/).until_after(/}}}/),handlebars:a.starting_with(/{{/).until_after(/}}/),php:a.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),erb:a.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:a.starting_with(/{%/).until_after(/%}/),django_value:a.starting_with(/{{/).until_after(/}}/),django_comment:a.starting_with(/{#/).until_after(/#}/),smarty:a.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:a.starting_with(/{\*/).until_after(/\*}/),smarty_literal:a.starting_with(/{literal}/).until_after(/{\/literal}/)}}p.prototype=new h,p.prototype._create=function(){return new p(this._input,this)},p.prototype._update=function(){this.__set_templated_pattern()},p.prototype.disable=function(l){var u=this._create();return u._disabled[l]=!0,u._update(),u},p.prototype.read_options=function(l){var u=this._create();for(var a in o)u._disabled[a]=l.templating.indexOf(a)===-1;return u._update(),u},p.prototype.exclude=function(l){var u=this._create();return u._excluded[l]=!0,u._update(),u},p.prototype.read=function(){var l="";this._match_pattern?l=this._input.read(this._starting_pattern):l=this._input.read(this._starting_pattern,this.__template_pattern);for(var u=this._read_template();u;)this._match_pattern?u+=this._input.read(this._match_pattern):u+=this._input.readUntil(this.__template_pattern),l+=u,u=this._read_template();return this._until_after&&(l+=this._input.readUntilAfter(this._until_pattern)),l},p.prototype.__set_templated_pattern=function(){var l=[];this._disabled.php||l.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||l.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||l.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(l.push(this.__patterns.django._starting_pattern.source),l.push(this.__patterns.django_value._starting_pattern.source),l.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||l.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&l.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+l.join("|")+")")},p.prototype._read_template=function(){var l="",u=this._input.peek();if(u==="<"){var a=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&a==="?"&&(l=l||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&a==="%"&&(l=l||this.__patterns.erb.read())}else u==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(l=l||this.__patterns.handlebars_comment.read(),l=l||this.__patterns.handlebars_unescaped.read(),l=l||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(l=l||this.__patterns.django_value.read()),this._excluded.django||(l=l||this.__patterns.django_comment.read(),l=l||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(l=l||this.__patterns.smarty_comment.read(),l=l||this.__patterns.smarty_literal.read(),l=l||this.__patterns.smarty.read()));return l},g.exports.TemplatablePattern=p},,,,function(g,f,m){var h=m(19).Beautifier,o=m(20).Options;function p(l,u,a,s){var C=new h(l,u,a,s);return C.beautify()}g.exports=p,g.exports.defaultOptions=function(){return new o}},function(g,f,m){var h=m(20).Options,o=m(2).Output,p=m(21).Tokenizer,l=m(21).TOKEN,u=/\r\n|[\r\n]/,a=/\r\n|[\r\n]/g,s=function(x,v){this.indent_level=0,this.alignment_size=0,this.max_preserve_newlines=x.max_preserve_newlines,this.preserve_newlines=x.preserve_newlines,this._output=new o(x,v)};s.prototype.current_line_has_match=function(x){return this._output.current_line.has_match(x)},s.prototype.set_space_before_token=function(x,v){this._output.space_before_token=x,this._output.non_breaking_space=v},s.prototype.set_wrap_point=function(){this._output.set_indent(this.indent_level,this.alignment_size),this._output.set_wrap_point()},s.prototype.add_raw_token=function(x){this._output.add_raw_token(x)},s.prototype.print_preserved_newlines=function(x){var v=0;x.type!==l.TEXT&&x.previous.type!==l.TEXT&&(v=x.newlines?1:0),this.preserve_newlines&&(v=x.newlines<this.max_preserve_newlines+1?x.newlines:this.max_preserve_newlines+1);for(var y=0;y<v;y++)this.print_newline(y>0);return v!==0},s.prototype.traverse_whitespace=function(x){return x.whitespace_before||x.newlines?(this.print_preserved_newlines(x)||(this._output.space_before_token=!0),!0):!1},s.prototype.previous_token_wrapped=function(){return this._output.previous_token_wrapped},s.prototype.print_newline=function(x){this._output.add_new_line(x)},s.prototype.print_token=function(x){x.text&&(this._output.set_indent(this.indent_level,this.alignment_size),this._output.add_token(x.text))},s.prototype.indent=function(){this.indent_level++},s.prototype.get_full_indent=function(x){return x=this.indent_level+(x||0),x<1?"":this._output.get_indent_string(x)};var C=function(x){for(var v=null,y=x.next;y.type!==l.EOF&&x.closed!==y;){if(y.type===l.ATTRIBUTE&&y.text==="type"){y.next&&y.next.type===l.EQUALS&&y.next.next&&y.next.next.type===l.VALUE&&(v=y.next.next.text);break}y=y.next}return v},_=function(x,v){var y=null,F=null;return v.closed?(x==="script"?y="text/javascript":x==="style"&&(y="text/css"),y=C(v)||y,y.search("text/css")>-1?F="css":y.search(/module|((text|application|dojo)\/(x-)?(javascript|ecmascript|jscript|livescript|(ld\+)?json|method|aspect))/)>-1?F="javascript":y.search(/(text|application|dojo)\/(x-)?(html)/)>-1?F="html":y.search(/test\/null/)>-1&&(F="null"),F):null};function w(x,v){return v.indexOf(x)!==-1}function O(x,v,y){this.parent=x||null,this.tag=v?v.tag_name:"",this.indent_level=y||0,this.parser_token=v||null}function R(x){this._printer=x,this._current_frame=null}R.prototype.get_parser_token=function(){return this._current_frame?this._current_frame.parser_token:null},R.prototype.record_tag=function(x){var v=new O(this._current_frame,x,this._printer.indent_level);this._current_frame=v},R.prototype._try_pop_frame=function(x){var v=null;return x&&(v=x.parser_token,this._printer.indent_level=x.indent_level,this._current_frame=x.parent),v},R.prototype._get_frame=function(x,v){for(var y=this._current_frame;y&&!(x.indexOf(y.tag)!==-1);){if(v&&v.indexOf(y.tag)!==-1){y=null;break}y=y.parent}return y},R.prototype.try_pop=function(x,v){var y=this._get_frame([x],v);return this._try_pop_frame(y)},R.prototype.indent_to_tag=function(x){var v=this._get_frame(x);v&&(this._printer.indent_level=v.indent_level)};function S(x,v,y,F){this._source_text=x||"",v=v||{},this._js_beautify=y,this._css_beautify=F,this._tag_stack=null;var B=new h(v,"html");this._options=B,this._is_wrap_attributes_force=this._options.wrap_attributes.substr(0,"force".length)==="force",this._is_wrap_attributes_force_expand_multiline=this._options.wrap_attributes==="force-expand-multiline",this._is_wrap_attributes_force_aligned=this._options.wrap_attributes==="force-aligned",this._is_wrap_attributes_aligned_multiple=this._options.wrap_attributes==="aligned-multiple",this._is_wrap_attributes_preserve=this._options.wrap_attributes.substr(0,"preserve".length)==="preserve",this._is_wrap_attributes_preserve_aligned=this._options.wrap_attributes==="preserve-aligned"}S.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var x=this._source_text,v=this._options.eol;this._options.eol==="auto"&&(v=`
`,x&&u.test(x)&&(v=x.match(u)[0])),x=x.replace(a,`
`);var y=x.match(/^[\t ]*/)[0],F={text:"",type:""},B=new T,A=new s(this._options,y),j=new p(x,this._options).tokenize();this._tag_stack=new R(A);for(var P=null,b=j.next();b.type!==l.EOF;)b.type===l.TAG_OPEN||b.type===l.COMMENT?(P=this._handle_tag_open(A,b,B,F),B=P):b.type===l.ATTRIBUTE||b.type===l.EQUALS||b.type===l.VALUE||b.type===l.TEXT&&!B.tag_complete?P=this._handle_inside_tag(A,b,B,j):b.type===l.TAG_CLOSE?P=this._handle_tag_close(A,b,B):b.type===l.TEXT?P=this._handle_text(A,b,B):A.add_raw_token(b),F=P,b=j.next();var V=A._output.get_code(v);return V},S.prototype._handle_tag_close=function(x,v,y){var F={text:v.text,type:v.type};return x.alignment_size=0,y.tag_complete=!0,x.set_space_before_token(v.newlines||v.whitespace_before!=="",!0),y.is_unformatted?x.add_raw_token(v):(y.tag_start_char==="<"&&(x.set_space_before_token(v.text[0]==="/",!0),this._is_wrap_attributes_force_expand_multiline&&y.has_wrapped_attrs&&x.print_newline(!1)),x.print_token(v)),y.indent_content&&!(y.is_unformatted||y.is_content_unformatted)&&(x.indent(),y.indent_content=!1),!y.is_inline_element&&!(y.is_unformatted||y.is_content_unformatted)&&x.set_wrap_point(),F},S.prototype._handle_inside_tag=function(x,v,y,F){var B=y.has_wrapped_attrs,A={text:v.text,type:v.type};if(x.set_space_before_token(v.newlines||v.whitespace_before!=="",!0),y.is_unformatted)x.add_raw_token(v);else if(y.tag_start_char==="{"&&v.type===l.TEXT)x.print_preserved_newlines(v)?(v.newlines=0,x.add_raw_token(v)):x.print_token(v);else{if(v.type===l.ATTRIBUTE?(x.set_space_before_token(!0),y.attr_count+=1):(v.type===l.EQUALS||v.type===l.VALUE&&v.previous.type===l.EQUALS)&&x.set_space_before_token(!1),v.type===l.ATTRIBUTE&&y.tag_start_char==="<"&&((this._is_wrap_attributes_preserve||this._is_wrap_attributes_preserve_aligned)&&(x.traverse_whitespace(v),B=B||v.newlines!==0),this._is_wrap_attributes_force)){var j=y.attr_count>1;if(this._is_wrap_attributes_force_expand_multiline&&y.attr_count===1){var P=!0,b=0,V;do{if(V=F.peek(b),V.type===l.ATTRIBUTE){P=!1;break}b+=1}while(b<4&&V.type!==l.EOF&&V.type!==l.TAG_CLOSE);j=!P}j&&(x.print_newline(!1),B=!0)}x.print_token(v),B=B||x.previous_token_wrapped(),y.has_wrapped_attrs=B}return A},S.prototype._handle_text=function(x,v,y){var F={text:v.text,type:"TK_CONTENT"};return y.custom_beautifier_name?this._print_custom_beatifier_text(x,v,y):y.is_unformatted||y.is_content_unformatted?x.add_raw_token(v):(x.traverse_whitespace(v),x.print_token(v)),F},S.prototype._print_custom_beatifier_text=function(x,v,y){var F=this;if(v.text!==""){var B=v.text,A,j=1,P="",b="";y.custom_beautifier_name==="javascript"&&typeof this._js_beautify=="function"?A=this._js_beautify:y.custom_beautifier_name==="css"&&typeof this._css_beautify=="function"?A=this._css_beautify:y.custom_beautifier_name==="html"&&(A=function(we,Le){var Re=new S(we,Le,F._js_beautify,F._css_beautify);return Re.beautify()}),this._options.indent_scripts==="keep"?j=0:this._options.indent_scripts==="separate"&&(j=-x.indent_level);var V=x.get_full_indent(j);if(B=B.replace(/\n[ \t]*$/,""),y.custom_beautifier_name!=="html"&&B[0]==="<"&&B.match(/^(<!--|<!\[CDATA\[)/)){var re=/^(<!--[^\n]*|<!\[CDATA\[)(\n?)([ \t\n]*)([\s\S]*)(-->|]]>)$/.exec(B);if(!re){x.add_raw_token(v);return}P=V+re[1]+`
`,B=re[4],re[5]&&(b=V+re[5]),B=B.replace(/\n[ \t]*$/,""),(re[2]||re[3].indexOf(`
`)!==-1)&&(re=re[3].match(/[ \t]+$/),re&&(v.whitespace_before=re[0]))}if(B)if(A){var ce=function(){this.eol=`
`};ce.prototype=this._options.raw_options;var me=new ce;B=A(V+B,me)}else{var De=v.whitespace_before;De&&(B=B.replace(new RegExp(`
(`+De+")?","g"),`
`)),B=V+B.replace(/\n/g,`
`+V)}P&&(B?B=P+B+`
`+b:B=P+b),x.print_newline(!1),B&&(v.text=B,v.whitespace_before="",v.newlines=0,x.add_raw_token(v),x.print_newline(!0))}},S.prototype._handle_tag_open=function(x,v,y,F){var B=this._get_tag_open_token(v);return(y.is_unformatted||y.is_content_unformatted)&&!y.is_empty_element&&v.type===l.TAG_OPEN&&v.text.indexOf("</")===0?(x.add_raw_token(v),B.start_tag_token=this._tag_stack.try_pop(B.tag_name)):(x.traverse_whitespace(v),this._set_tag_position(x,v,B,y,F),B.is_inline_element||x.set_wrap_point(),x.print_token(v)),(this._is_wrap_attributes_force_aligned||this._is_wrap_attributes_aligned_multiple||this._is_wrap_attributes_preserve_aligned)&&(B.alignment_size=v.text.length+1),!B.tag_complete&&!B.is_unformatted&&(x.alignment_size=B.alignment_size),B};var T=function(x,v){if(this.parent=x||null,this.text="",this.type="TK_TAG_OPEN",this.tag_name="",this.is_inline_element=!1,this.is_unformatted=!1,this.is_content_unformatted=!1,this.is_empty_element=!1,this.is_start_tag=!1,this.is_end_tag=!1,this.indent_content=!1,this.multiline_content=!1,this.custom_beautifier_name=null,this.start_tag_token=null,this.attr_count=0,this.has_wrapped_attrs=!1,this.alignment_size=0,this.tag_complete=!1,this.tag_start_char="",this.tag_check="",!v)this.tag_complete=!0;else{var y;this.tag_start_char=v.text[0],this.text=v.text,this.tag_start_char==="<"?(y=v.text.match(/^<([^\s>]*)/),this.tag_check=y?y[1]:""):(y=v.text.match(/^{{~?(?:[\^]|#\*?)?([^\s}]+)/),this.tag_check=y?y[1]:"",(v.text.startsWith("{{#>")||v.text.startsWith("{{~#>"))&&this.tag_check[0]===">"&&(this.tag_check===">"&&v.next!==null?this.tag_check=v.next.text.split(" ")[0]:this.tag_check=v.text.split(">")[1])),this.tag_check=this.tag_check.toLowerCase(),v.type===l.COMMENT&&(this.tag_complete=!0),this.is_start_tag=this.tag_check.charAt(0)!=="/",this.tag_name=this.is_start_tag?this.tag_check:this.tag_check.substr(1),this.is_end_tag=!this.is_start_tag||v.closed&&v.closed.text==="/>";var F=2;this.tag_start_char==="{"&&this.text.length>=3&&(this.text.charAt(2)==="~"&&(F=3)),this.is_end_tag=this.is_end_tag||this.tag_start_char==="{"&&(this.text.length<3||/[^#\^]/.test(this.text.charAt(F)))}};S.prototype._get_tag_open_token=function(x){var v=new T(this._tag_stack.get_parser_token(),x);return v.alignment_size=this._options.wrap_attributes_indent_size,v.is_end_tag=v.is_end_tag||w(v.tag_check,this._options.void_elements),v.is_empty_element=v.tag_complete||v.is_start_tag&&v.is_end_tag,v.is_unformatted=!v.tag_complete&&w(v.tag_check,this._options.unformatted),v.is_content_unformatted=!v.is_empty_element&&w(v.tag_check,this._options.content_unformatted),v.is_inline_element=w(v.tag_name,this._options.inline)||v.tag_name.includes("-")||v.tag_start_char==="{",v},S.prototype._set_tag_position=function(x,v,y,F,B){if(y.is_empty_element||(y.is_end_tag?y.start_tag_token=this._tag_stack.try_pop(y.tag_name):(this._do_optional_end_element(y)&&(y.is_inline_element||x.print_newline(!1)),this._tag_stack.record_tag(y),(y.tag_name==="script"||y.tag_name==="style")&&!(y.is_unformatted||y.is_content_unformatted)&&(y.custom_beautifier_name=_(y.tag_check,v)))),w(y.tag_check,this._options.extra_liners)&&(x.print_newline(!1),x._output.just_added_blankline()||x.print_newline(!0)),y.is_empty_element){if(y.tag_start_char==="{"&&y.tag_check==="else"){this._tag_stack.indent_to_tag(["if","unless","each"]),y.indent_content=!0;var A=x.current_line_has_match(/{{#if/);A||x.print_newline(!1)}y.tag_name==="!--"&&B.type===l.TAG_CLOSE&&F.is_end_tag&&y.text.indexOf(`
`)===-1||(y.is_inline_element||y.is_unformatted||x.print_newline(!1),this._calcluate_parent_multiline(x,y))}else if(y.is_end_tag){var j=!1;j=y.start_tag_token&&y.start_tag_token.multiline_content,j=j||!y.is_inline_element&&!(F.is_inline_element||F.is_unformatted)&&!(B.type===l.TAG_CLOSE&&y.start_tag_token===F)&&B.type!=="TK_CONTENT",(y.is_content_unformatted||y.is_unformatted)&&(j=!1),j&&x.print_newline(!1)}else y.indent_content=!y.custom_beautifier_name,y.tag_start_char==="<"&&(y.tag_name==="html"?y.indent_content=this._options.indent_inner_html:y.tag_name==="head"?y.indent_content=this._options.indent_head_inner_html:y.tag_name==="body"&&(y.indent_content=this._options.indent_body_inner_html)),!(y.is_inline_element||y.is_unformatted)&&(B.type!=="TK_CONTENT"||y.is_content_unformatted)&&x.print_newline(!1),this._calcluate_parent_multiline(x,y)},S.prototype._calcluate_parent_multiline=function(x,v){v.parent&&x._output.just_added_newline()&&!((v.is_inline_element||v.is_unformatted)&&v.parent.is_inline_element)&&(v.parent.multiline_content=!0)};var E=["address","article","aside","blockquote","details","div","dl","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hr","main","nav","ol","p","pre","section","table","ul"],c=["a","audio","del","ins","map","noscript","video"];S.prototype._do_optional_end_element=function(x){var v=null;if(x.is_empty_element||!x.is_start_tag||!x.parent)return;if(x.tag_name==="body")v=v||this._tag_stack.try_pop("head");else if(x.tag_name==="li")v=v||this._tag_stack.try_pop("li",["ol","ul"]);else if(x.tag_name==="dd"||x.tag_name==="dt")v=v||this._tag_stack.try_pop("dt",["dl"]),v=v||this._tag_stack.try_pop("dd",["dl"]);else if(x.parent.tag_name==="p"&&E.indexOf(x.tag_name)!==-1){var y=x.parent.parent;(!y||c.indexOf(y.tag_name)===-1)&&(v=v||this._tag_stack.try_pop("p"))}else x.tag_name==="rp"||x.tag_name==="rt"?(v=v||this._tag_stack.try_pop("rt",["ruby","rtc"]),v=v||this._tag_stack.try_pop("rp",["ruby","rtc"])):x.tag_name==="optgroup"?v=v||this._tag_stack.try_pop("optgroup",["select"]):x.tag_name==="option"?v=v||this._tag_stack.try_pop("option",["select","datalist","optgroup"]):x.tag_name==="colgroup"?v=v||this._tag_stack.try_pop("caption",["table"]):x.tag_name==="thead"?(v=v||this._tag_stack.try_pop("caption",["table"]),v=v||this._tag_stack.try_pop("colgroup",["table"])):x.tag_name==="tbody"||x.tag_name==="tfoot"?(v=v||this._tag_stack.try_pop("caption",["table"]),v=v||this._tag_stack.try_pop("colgroup",["table"]),v=v||this._tag_stack.try_pop("thead",["table"]),v=v||this._tag_stack.try_pop("tbody",["table"])):x.tag_name==="tr"?(v=v||this._tag_stack.try_pop("caption",["table"]),v=v||this._tag_stack.try_pop("colgroup",["table"]),v=v||this._tag_stack.try_pop("tr",["table","thead","tbody","tfoot"])):(x.tag_name==="th"||x.tag_name==="td")&&(v=v||this._tag_stack.try_pop("td",["table","thead","tbody","tfoot","tr"]),v=v||this._tag_stack.try_pop("th",["table","thead","tbody","tfoot","tr"]));return x.parent=this._tag_stack.get_parser_token(),v},g.exports.Beautifier=S},function(g,f,m){var h=m(6).Options;function o(p){h.call(this,p,"html"),this.templating.length===1&&this.templating[0]==="auto"&&(this.templating=["django","erb","handlebars","php"]),this.indent_inner_html=this._get_boolean("indent_inner_html"),this.indent_body_inner_html=this._get_boolean("indent_body_inner_html",!0),this.indent_head_inner_html=this._get_boolean("indent_head_inner_html",!0),this.indent_handlebars=this._get_boolean("indent_handlebars",!0),this.wrap_attributes=this._get_selection("wrap_attributes",["auto","force","force-aligned","force-expand-multiline","aligned-multiple","preserve","preserve-aligned"]),this.wrap_attributes_indent_size=this._get_number("wrap_attributes_indent_size",this.indent_size),this.extra_liners=this._get_array("extra_liners",["head","body","/html"]),this.inline=this._get_array("inline",["a","abbr","area","audio","b","bdi","bdo","br","button","canvas","cite","code","data","datalist","del","dfn","em","embed","i","iframe","img","input","ins","kbd","keygen","label","map","mark","math","meter","noscript","object","output","progress","q","ruby","s","samp","select","small","span","strong","sub","sup","svg","template","textarea","time","u","var","video","wbr","text","acronym","big","strike","tt"]),this.void_elements=this._get_array("void_elements",["area","base","br","col","embed","hr","img","input","keygen","link","menuitem","meta","param","source","track","wbr","!doctype","?xml","basefont","isindex"]),this.unformatted=this._get_array("unformatted",[]),this.content_unformatted=this._get_array("content_unformatted",["pre","textarea"]),this.unformatted_content_delimiter=this._get_characters("unformatted_content_delimiter"),this.indent_scripts=this._get_selection("indent_scripts",["normal","keep","separate"])}o.prototype=new h,g.exports.Options=o},function(g,f,m){var h=m(9).Tokenizer,o=m(9).TOKEN,p=m(13).Directives,l=m(14).TemplatablePattern,u=m(12).Pattern,a={TAG_OPEN:"TK_TAG_OPEN",TAG_CLOSE:"TK_TAG_CLOSE",ATTRIBUTE:"TK_ATTRIBUTE",EQUALS:"TK_EQUALS",VALUE:"TK_VALUE",COMMENT:"TK_COMMENT",TEXT:"TK_TEXT",UNKNOWN:"TK_UNKNOWN",START:o.START,RAW:o.RAW,EOF:o.EOF},s=new p(/<\!--/,/-->/),C=function(_,w){h.call(this,_,w),this._current_tag_name="";var O=new l(this._input).read_options(this._options),R=new u(this._input);if(this.__patterns={word:O.until(/[\n\r\t <]/),single_quote:O.until_after(/'/),double_quote:O.until_after(/"/),attribute:O.until(/[\n\r\t =>]|\/>/),element_name:O.until(/[\n\r\t >\/]/),handlebars_comment:R.starting_with(/{{!--/).until_after(/--}}/),handlebars:R.starting_with(/{{/).until_after(/}}/),handlebars_open:R.until(/[\n\r\t }]/),handlebars_raw_close:R.until(/}}/),comment:R.starting_with(/<!--/).until_after(/-->/),cdata:R.starting_with(/<!\[CDATA\[/).until_after(/]]>/),conditional_comment:R.starting_with(/<!\[/).until_after(/]>/),processing:R.starting_with(/<\?/).until_after(/\?>/)},this._options.indent_handlebars&&(this.__patterns.word=this.__patterns.word.exclude("handlebars")),this._unformatted_content_delimiter=null,this._options.unformatted_content_delimiter){var S=this._input.get_literal_regexp(this._options.unformatted_content_delimiter);this.__patterns.unformatted_content_delimiter=R.matching(S).until_after(S)}};C.prototype=new h,C.prototype._is_comment=function(_){return!1},C.prototype._is_opening=function(_){return _.type===a.TAG_OPEN},C.prototype._is_closing=function(_,w){return _.type===a.TAG_CLOSE&&w&&((_.text===">"||_.text==="/>")&&w.text[0]==="<"||_.text==="}}"&&w.text[0]==="{"&&w.text[1]==="{")},C.prototype._reset=function(){this._current_tag_name=""},C.prototype._get_next_token=function(_,w){var O=null;this._readWhitespace();var R=this._input.peek();return R===null?this._create_token(a.EOF,""):(O=O||this._read_open_handlebars(R,w),O=O||this._read_attribute(R,_,w),O=O||this._read_close(R,w),O=O||this._read_raw_content(R,_,w),O=O||this._read_content_word(R),O=O||this._read_comment_or_cdata(R),O=O||this._read_processing(R),O=O||this._read_open(R,w),O=O||this._create_token(a.UNKNOWN,this._input.next()),O)},C.prototype._read_comment_or_cdata=function(_){var w=null,O=null,R=null;if(_==="<"){var S=this._input.peek(1);S==="!"&&(O=this.__patterns.comment.read(),O?(R=s.get_directives(O),R&&R.ignore==="start"&&(O+=s.readIgnored(this._input))):O=this.__patterns.cdata.read()),O&&(w=this._create_token(a.COMMENT,O),w.directives=R)}return w},C.prototype._read_processing=function(_){var w=null,O=null,R=null;if(_==="<"){var S=this._input.peek(1);(S==="!"||S==="?")&&(O=this.__patterns.conditional_comment.read(),O=O||this.__patterns.processing.read()),O&&(w=this._create_token(a.COMMENT,O),w.directives=R)}return w},C.prototype._read_open=function(_,w){var O=null,R=null;return w||_==="<"&&(O=this._input.next(),this._input.peek()==="/"&&(O+=this._input.next()),O+=this.__patterns.element_name.read(),R=this._create_token(a.TAG_OPEN,O)),R},C.prototype._read_open_handlebars=function(_,w){var O=null,R=null;return w||this._options.indent_handlebars&&_==="{"&&this._input.peek(1)==="{"&&(this._input.peek(2)==="!"?(O=this.__patterns.handlebars_comment.read(),O=O||this.__patterns.handlebars.read(),R=this._create_token(a.COMMENT,O)):(O=this.__patterns.handlebars_open.read(),R=this._create_token(a.TAG_OPEN,O))),R},C.prototype._read_close=function(_,w){var O=null,R=null;return w&&(w.text[0]==="<"&&(_===">"||_==="/"&&this._input.peek(1)===">")?(O=this._input.next(),_==="/"&&(O+=this._input.next()),R=this._create_token(a.TAG_CLOSE,O)):w.text[0]==="{"&&_==="}"&&this._input.peek(1)==="}"&&(this._input.next(),this._input.next(),R=this._create_token(a.TAG_CLOSE,"}}"))),R},C.prototype._read_attribute=function(_,w,O){var R=null,S="";if(O&&O.text[0]==="<")if(_==="=")R=this._create_token(a.EQUALS,this._input.next());else if(_==='"'||_==="'"){var T=this._input.next();_==='"'?T+=this.__patterns.double_quote.read():T+=this.__patterns.single_quote.read(),R=this._create_token(a.VALUE,T)}else S=this.__patterns.attribute.read(),S&&(w.type===a.EQUALS?R=this._create_token(a.VALUE,S):R=this._create_token(a.ATTRIBUTE,S));return R},C.prototype._is_content_unformatted=function(_){return this._options.void_elements.indexOf(_)===-1&&(this._options.content_unformatted.indexOf(_)!==-1||this._options.unformatted.indexOf(_)!==-1)},C.prototype._read_raw_content=function(_,w,O){var R="";if(O&&O.text[0]==="{")R=this.__patterns.handlebars_raw_close.read();else if(w.type===a.TAG_CLOSE&&w.opened.text[0]==="<"&&w.text[0]!=="/"){var S=w.opened.text.substr(1).toLowerCase();if(S==="script"||S==="style"){var T=this._read_comment_or_cdata(_);if(T)return T.type=a.TEXT,T;R=this._input.readUntil(new RegExp("</"+S+"[\\n\\r\\t ]*?>","ig"))}else this._is_content_unformatted(S)&&(R=this._input.readUntil(new RegExp("</"+S+"[\\n\\r\\t ]*?>","ig")))}return R?this._create_token(a.TEXT,R):null},C.prototype._read_content_word=function(_){var w="";if(this._options.unformatted_content_delimiter&&(_===this._options.unformatted_content_delimiter[0]&&(w=this.__patterns.unformatted_content_delimiter.read())),w||(w=this.__patterns.word.read()),w)return this._create_token(a.TEXT,w)},g.exports.Tokenizer=C,g.exports.TOKEN=a}],H={};function n(g){var f=H[g];if(f!==void 0)return f.exports;var m=H[g]={exports:{}};return W[g](m,m.exports,n),m.exports}var I=n(18);k=I})();var z=k;if(!0)!(oe=[J,J("6UM0"),J("TXwP")],$=function(W){var H=J("6UM0"),n=J("TXwP");return{html_beautify:function(I,g){return z(I,g,H.js_beautify,n.css_beautify)}}}.apply(Ee,oe),$!==void 0&&(tt.exports=$));else var U,L})()},"rAM+":function(tt,Ee,J){"use strict";J.d(Ee,"a",function(){return $});var oe=J("Qw5x");function $(k,z){var U;if(typeof Symbol=="undefined"||k[Symbol.iterator]==null){if(Array.isArray(k)||(U=Object(oe.a)(k))||z&&k&&typeof k.length=="number"){U&&(k=U);var L=0,W=function(){};return{s:W,n:function(){return L>=k.length?{done:!0}:{done:!1,value:k[L++]}},e:function(f){throw f},f:W}}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 H=!0,n=!1,I;return{s:function(){U=k[Symbol.iterator]()},n:function(){var f=U.next();return H=f.done,f},e:function(f){n=!0,I=f},f:function(){try{!H&&U.return!=null&&U.return()}finally{if(n)throw I}}}}},rUJ1:function(tt,Ee){const J=/[&<>"']/,oe=/[&<>"']/g,$=/[<>"']|&(?!#?\w+;)/,k=/[<>"']|&(?!#?\w+;)/g,z={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},U=R=>z[R];function L(R,S){if(S){if(J.test(R))return R.replace(oe,U)}else if($.test(R))return R.replace(k,U);return R}const W=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function H(R){return R.replace(W,(S,T)=>(T=T.toLowerCase(),T==="colon"?":":T.charAt(0)==="#"?T.charAt(1)==="x"?String.fromCharCode(parseInt(T.substring(2),16)):String.fromCharCode(+T.substring(1)):""))}const n=/(^|[^\[])\^/g;function I(R,S){R=R.source||R,S=S||"";const T={replace:(E,c)=>(c=c.source||c,c=c.replace(n,"$1"),R=R.replace(E,c),T),getRegex:()=>new RegExp(R,S)};return T}const g=/[^\w:]/g,f=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function m(R,S,T){if(R){let E;try{E=decodeURIComponent(H(T)).replace(g,"").toLowerCase()}catch(c){return null}if(E.indexOf("javascript:")===0||E.indexOf("vbscript:")===0||E.indexOf("data:")===0)return null}S&&!f.test(T)&&(T=u(S,T));try{T=encodeURI(T).replace(/%25/g,"%")}catch(E){return null}return T}const h={},o=/^[^:]+:\/*[^/]*$/,p=/^([^:]+:)[\s\S]*$/,l=/^([^:]+:\/*[^/]*)[\s\S]*$/;function u(R,S){h[" "+R]||(o.test(R)?h[" "+R]=R+"/":h[" "+R]=_(R,"/",!0)),R=h[" "+R];const T=R.indexOf(":")===-1;return S.substring(0,2)==="//"?T?S:R.replace(p,"$1")+S:S.charAt(0)==="/"?T?S:R.replace(l,"$1")+S:R+S}const a={exec:function(){}};function s(R){let S=1,T,E;for(;S<arguments.length;S++){T=arguments[S];for(E in T)Object.prototype.hasOwnProperty.call(T,E)&&(R[E]=T[E])}return R}function C(R,S){const T=R.replace(/\|/g,(x,v,y)=>{let F=!1,B=v;for(;--B>=0&&y[B]==="\\";)F=!F;return F?"|":" |"}),E=T.split(/ \|/);let c=0;if(E.length>S)E.splice(S);else for(;E.length<S;)E.push("");for(;c<E.length;c++)E[c]=E[c].trim().replace(/\\\|/g,"|");return E}function _(R,S,T){const E=R.length;if(E===0)return"";let c=0;for(;c<E;){const x=R.charAt(E-c-1);if(x===S&&!T)c++;else if(x!==S&&T)c++;else break}return R.substr(0,E-c)}function w(R,S){if(R.indexOf(S[1])===-1)return-1;const T=R.length;let E=0,c=0;for(;c<T;c++)if(R[c]==="\\")c++;else if(R[c]===S[0])E++;else if(R[c]===S[1]&&(E--,E<0))return c;return-1}function O(R){R&&R.sanitize&&!R.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")}tt.exports={escape:L,unescape:H,edit:I,cleanUrl:m,resolveUrl:u,noopTest:a,merge:s,splitCells:C,rtrim:_,findClosingBracket:w,checkSanitizeDeprecation:O}},smFo:function(tt,Ee,J){tt.exports={wrap:"wrap___1xSvp",header:"header___1niV1",title:"title____shwY",menu:"menu___2Y-rd",top:"top___1_d5Y",line:"line___1kciD",flexCenter:"flexCenter___3bP7s",like:"like___3lXjz",canLike:"canLike___AuDmL",attachmentName:"attachmentName___2SteY"}},t9D7:function(tt,Ee,J){"use strict";J.d(Ee,"b",function(){return W}),J.d(Ee,"g",function(){return n}),J.d(Ee,"d",function(){return I}),J.d(Ee,"e",function(){return g}),J.d(Ee,"a",function(){return f}),J.d(Ee,"f",function(){return o}),J.d(Ee,"c",function(){return p});var oe=J("Vhoy"),$=J("MI8n"),k=J("pmY6"),z=J("Cg/j"),U=J("ic2d"),L=J("nEHx");const W=Object(z.c)("themeService");var H;(function(l){function u(a){return a&&typeof a=="object"&&typeof a.id=="string"}l.isThemeColor=u})(H||(H={}));function n(l){return{id:l}}var I;(function(l){function u(O){return O&&typeof O=="object"&&typeof O.id=="string"&&(typeof O.color=="undefined"||H.isThemeColor(O.color))}l.isThemeIcon=u;const a=new RegExp(`^\\$\\((${oe.a.iconNameExpression}(?:${oe.a.iconModifierExpression})?)\\)$`);function s(O){const R=a.exec(O);if(!R)return;let[,S]=R;return{id:S}}l.fromString=s;function C(O,R){let S=O.id;const T=S.lastIndexOf("~");return T!==-1&&(S=S.substring(0,T)),R&&(S=`${S}~${R}`),{id:S}}l.modify=C;function _(O,R){var S,T;return O.id===R.id&&((S=O.color)===null||S===void 0?void 0:S.id)===((T=R.color)===null||T===void 0?void 0:T.id)}l.isEqual=_;function w(O,R){return{id:O.id,color:R?n(R):void 0}}l.asThemeIcon=w,l.asClassNameArray=oe.a.asClassNameArray,l.asClassName=oe.a.asClassName,l.asCSSSelector=oe.a.asCSSSelector})(I||(I={}));function g(l){switch(l){case L.a.DARK:return"vs-dark";case L.a.HIGH_CONTRAST:return"hc-black";default:return"vs"}}const f={ThemingContribution:"base.contributions.theming"};class m{constructor(){this.themingParticipants=[],this.themingParticipants=[],this.onThemingParticipantAddedEmitter=new $.b}onColorThemeChange(l){return this.themingParticipants.push(l),this.onThemingParticipantAddedEmitter.fire(l),Object(k.i)(()=>{const u=this.themingParticipants.indexOf(l);this.themingParticipants.splice(u,1)})}getThemingParticipants(){return this.themingParticipants}}let h=new m;U.a.add(f.ThemingContribution,h);function o(l){return h.onColorThemeChange(l)}class p extends k.a{constructor(l){super();this.themeService=l,this.theme=l.getColorTheme(),this._register(this.themeService.onDidColorThemeChange(u=>this.onThemeChange(u)))}onThemeChange(l){this.theme=l,this.updateStyles()}updateStyles(){}}},ulZh:function(tt,Ee,J){typeof window!="undefined"&&function($,k){tt.exports=k()}(this,function(){return function(oe){var $={};function k(z){if($[z])return $[z].exports;var U=$[z]={i:z,l:!1,exports:{}};return oe[z].call(U.exports,U,U.exports,k),U.l=!0,U.exports}return k.m=oe,k.c=$,k.d=function(z,U,L){k.o(z,U)||Object.defineProperty(z,U,{enumerable:!0,get:L})},k.r=function(z){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(z,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(z,"__esModule",{value:!0})},k.t=function(z,U){if(U&1&&(z=k(z)),U&8)return z;if(U&4&&typeof z=="object"&&z&&z.__esModule)return z;var L=Object.create(null);if(k.r(L),Object.defineProperty(L,"default",{enumerable:!0,value:z}),U&2&&typeof z!="string")for(var W in z)k.d(L,W,function(H){return z[H]}.bind(null,W));return L},k.n=function(z){var U=z&&z.__esModule?function(){return z.default}:function(){return z};return k.d(U,"a",U),U},k.o=function(z,U){return Object.prototype.hasOwnProperty.call(z,U)},k.p="/dist/",k(k.s="./src/hls.ts")}({"./node_modules/eventemitter3/index.js":function(oe,$,k){"use strict";var z=Object.prototype.hasOwnProperty,U="~";function L(){}Object.create&&(L.prototype=Object.create(null),new L().__proto__||(U=!1));function W(g,f,m){this.fn=g,this.context=f,this.once=m||!1}function H(g,f,m,h,o){if(typeof m!="function")throw new TypeError("The listener must be a function");var p=new W(m,h||g,o),l=U?U+f:f;return g._events[l]?g._events[l].fn?g._events[l]=[g._events[l],p]:g._events[l].push(p):(g._events[l]=p,g._eventsCount++),g}function n(g,f){--g._eventsCount===0?g._events=new L:delete g._events[f]}function I(){this._events=new L,this._eventsCount=0}I.prototype.eventNames=function(){var f=[],m,h;if(this._eventsCount===0)return f;for(h in m=this._events)z.call(m,h)&&f.push(U?h.slice(1):h);return Object.getOwnPropertySymbols?f.concat(Object.getOwnPropertySymbols(m)):f},I.prototype.listeners=function(f){var m=U?U+f:f,h=this._events[m];if(!h)return[];if(h.fn)return[h.fn];for(var o=0,p=h.length,l=new Array(p);o<p;o++)l[o]=h[o].fn;return l},I.prototype.listenerCount=function(f){var m=U?U+f:f,h=this._events[m];return h?h.fn?1:h.length:0},I.prototype.emit=function(f,m,h,o,p,l){var u=U?U+f:f;if(!this._events[u])return!1;var a=this._events[u],s=arguments.length,C,_;if(a.fn){a.once&&this.removeListener(f,a.fn,void 0,!0);switch(s){case 1:return a.fn.call(a.context),!0;case 2:return a.fn.call(a.context,m),!0;case 3:return a.fn.call(a.context,m,h),!0;case 4:return a.fn.call(a.context,m,h,o),!0;case 5:return a.fn.call(a.context,m,h,o,p),!0;case 6:return a.fn.call(a.context,m,h,o,p,l),!0}for(_=1,C=new Array(s-1);_<s;_++)C[_-1]=arguments[_];a.fn.apply(a.context,C)}else{var w=a.length,O;for(_=0;_<w;_++){a[_].once&&this.removeListener(f,a[_].fn,void 0,!0);switch(s){case 1:a[_].fn.call(a[_].context);break;case 2:a[_].fn.call(a[_].context,m);break;case 3:a[_].fn.call(a[_].context,m,h);break;case 4:a[_].fn.call(a[_].context,m,h,o);break;default:if(!C)for(O=1,C=new Array(s-1);O<s;O++)C[O-1]=arguments[O];a[_].fn.apply(a[_].context,C)}}}return!0},I.prototype.on=function(f,m,h){return H(this,f,m,h,!1)},I.prototype.once=function(f,m,h){return H(this,f,m,h,!0)},I.prototype.removeListener=function(f,m,h,o){var p=U?U+f:f;if(!this._events[p])return this;if(!m)return n(this,p),this;var l=this._events[p];if(l.fn)l.fn===m&&(!o||l.once)&&(!h||l.context===h)&&n(this,p);else{for(var u=0,a=[],s=l.length;u<s;u++)(l[u].fn!==m||o&&!l[u].once||h&&l[u].context!==h)&&a.push(l[u]);a.length?this._events[p]=a.length===1?a[0]:a:n(this,p)}return this},I.prototype.removeAllListeners=function(f){var m;return f?(m=U?U+f:f,this._events[m]&&n(this,m)):(this._events=new L,this._eventsCount=0),this},I.prototype.off=I.prototype.removeListener,I.prototype.addListener=I.prototype.on,I.prefixed=U,I.EventEmitter=I,oe.exports=I},"./node_modules/url-toolkit/src/url-toolkit.js":function(oe,$,k){(function(z){var U=/^((?:[a-zA-Z0-9+\-.]+:)?)(\/\/[^\/?#]*)?((?:[^\/?#]*\/)*[^;?#]*)?(;[^?#]*)?(\?[^#]*)?(#[^]*)?$/,L=/^([^\/?#]*)([^]*)$/,W=/(?:\/|^)\.(?=\/)/g,H=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,n={buildAbsoluteURL:function(I,g,f){if(f=f||{},I=I.trim(),g=g.trim(),!g){if(!f.alwaysNormalize)return I;var m=n.parseURL(I);if(!m)throw new Error("Error trying to parse base URL.");return m.path=n.normalizePath(m.path),n.buildURLFromParts(m)}var h=n.parseURL(g);if(!h)throw new Error("Error trying to parse relative URL.");if(h.scheme)return f.alwaysNormalize?(h.path=n.normalizePath(h.path),n.buildURLFromParts(h)):g;var o=n.parseURL(I);if(!o)throw new Error("Error trying to parse base URL.");if(!o.netLoc&&o.path&&o.path[0]!=="/"){var p=L.exec(o.path);o.netLoc=p[1],o.path=p[2]}o.netLoc&&!o.path&&(o.path="/");var l={scheme:o.scheme,netLoc:h.netLoc,path:null,params:h.params,query:h.query,fragment:h.fragment};if(!h.netLoc&&(l.netLoc=o.netLoc,h.path[0]!=="/"))if(!h.path)l.path=o.path,h.params||(l.params=o.params,h.query||(l.query=o.query));else{var u=o.path,a=u.substring(0,u.lastIndexOf("/")+1)+h.path;l.path=n.normalizePath(a)}return l.path===null&&(l.path=f.alwaysNormalize?n.normalizePath(h.path):h.path),n.buildURLFromParts(l)},parseURL:function(I){var g=U.exec(I);return g?{scheme:g[1]||"",netLoc:g[2]||"",path:g[3]||"",params:g[4]||"",query:g[5]||"",fragment:g[6]||""}:null},normalizePath:function(I){for(I=I.split("").reverse().join("").replace(W,"");I.length!==(I=I.replace(H,"")).length;);return I.split("").reverse().join("")},buildURLFromParts:function(I){return I.scheme+I.netLoc+I.path+I.params+I.query+I.fragment}};oe.exports=n})(this)},"./node_modules/webworkify-webpack/index.js":function(oe,$,k){function z(f){var m={};function h(p){if(m[p])return m[p].exports;var l=m[p]={i:p,l:!1,exports:{}};return f[p].call(l.exports,l,l.exports,h),l.l=!0,l.exports}h.m=f,h.c=m,h.i=function(p){return p},h.d=function(p,l,u){h.o(p,l)||Object.defineProperty(p,l,{configurable:!1,enumerable:!0,get:u})},h.r=function(p){Object.defineProperty(p,"__esModule",{value:!0})},h.n=function(p){var l=p&&p.__esModule?function(){return p.default}:function(){return p};return h.d(l,"a",l),l},h.o=function(p,l){return Object.prototype.hasOwnProperty.call(p,l)},h.p="/",h.oe=function(p){throw console.error(p),p};var o=h(h.s=ENTRY_MODULE);return o.default||o}var U="[\\.|\\-|\\+|\\w|/|@]+",L="\\(\\s*(/\\*.*?\\*/)?\\s*.*?("+U+").*?\\)";function W(f){return(f+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function H(f){return!isNaN(1*f)}function n(f,m,h){var o={};o[h]=[];var p=m.toString(),l=p.match(/^function\s?\w*\(\w+,\s*\w+,\s*(\w+)\)/);if(!l)return o;for(var u=l[1],a=new RegExp("(\\\\n|\\W)"+W(u)+L,"g"),s;s=a.exec(p);){if(s[3]==="dll-reference")continue;o[h].push(s[3])}for(a=new RegExp("\\("+W(u)+'\\("(dll-reference\\s('+U+'))"\\)\\)'+L,"g");s=a.exec(p);)f[s[2]]||(o[h].push(s[1]),f[s[2]]=k(s[1]).m),o[s[2]]=o[s[2]]||[],o[s[2]].push(s[4]);for(var C=Object.keys(o),_=0;_<C.length;_++)for(var w=0;w<o[C[_]].length;w++)H(o[C[_]][w])&&(o[C[_]][w]=1*o[C[_]][w]);return o}function I(f){var m=Object.keys(f);return m.reduce(function(h,o){return h||f[o].length>0},!1)}function g(f,m){for(var h={main:[m]},o={main:[]},p={main:{}};I(h);)for(var l=Object.keys(h),u=0;u<l.length;u++){var a=l[u],s=h[a],C=s.pop();if(p[a]=p[a]||{},p[a][C]||!f[a][C])continue;p[a][C]=!0,o[a]=o[a]||[],o[a].push(C);for(var _=n(f,f[a][C],a),w=Object.keys(_),O=0;O<w.length;O++)h[w[O]]=h[w[O]]||[],h[w[O]]=h[w[O]].concat(_[w[O]])}return o}oe.exports=function(f,m){m=m||{};var h={main:k.m},o=m.all?{main:Object.keys(h.main)}:g(h,f),p="";Object.keys(o).filter(function(C){return C!=="main"}).forEach(function(C){for(var _=0;o[C][_];)_++;o[C].push(_),h[C][_]="(function(module, exports, __webpack_require__) { module.exports = __webpack_require__; })",p=p+"var "+C+" = ("+z.toString().replace("ENTRY_MODULE",JSON.stringify(_))+")({"+o[C].map(function(w){return""+JSON.stringify(w)+": "+h[C][w].toString()}).join(",")+`});
`}),p=p+"new (("+z.toString().replace("ENTRY_MODULE",JSON.stringify(f))+")({"+o.main.map(function(C){return""+JSON.stringify(C)+": "+h.main[C].toString()}).join(",")+"}))(self);";var l=new window.Blob([p],{type:"text/javascript"});if(m.bare)return l;var u=window.URL||window.webkitURL||window.mozURL||window.msURL,a=u.createObjectURL(l),s=new window.Worker(a);return s.objectURL=a,s}},"./src/config.ts":function(oe,$,k){"use strict";k.r($),k.d($,"hlsDefaultConfig",function(){return O}),k.d($,"mergeConfig",function(){return S}),k.d($,"enableStreamingMode",function(){return T});var z=k("./src/controller/abr-controller.ts"),U=k("./src/controller/audio-stream-controller.ts"),L=k("./src/controller/audio-track-controller.ts"),W=k("./src/controller/subtitle-stream-controller.ts"),H=k("./src/controller/subtitle-track-controller.ts"),n=k("./src/controller/buffer-controller.ts"),I=k("./src/controller/timeline-controller.ts"),g=k("./src/controller/cap-level-controller.ts"),f=k("./src/controller/fps-controller.ts"),m=k("./src/controller/eme-controller.ts"),h=k("./src/controller/cmcd-controller.ts"),o=k("./src/utils/xhr-loader.ts"),p=k("./src/utils/fetch-loader.ts"),l=k("./src/utils/cues.ts"),u=k("./src/utils/mediakeys-helper.ts"),a=k("./src/utils/logger.ts");function s(){return s=Object.assign||function(E){for(var c=1;c<arguments.length;c++){var x=arguments[c];for(var v in x)Object.prototype.hasOwnProperty.call(x,v)&&(E[v]=x[v])}return E},s.apply(this,arguments)}function C(E,c){var x=Object.keys(E);if(Object.getOwnPropertySymbols){var v=Object.getOwnPropertySymbols(E);c&&(v=v.filter(function(y){return Object.getOwnPropertyDescriptor(E,y).enumerable})),x.push.apply(x,v)}return x}function _(E){for(var c=1;c<arguments.length;c++){var x=arguments[c]!=null?arguments[c]:{};c%2?C(Object(x),!0).forEach(function(v){w(E,v,x[v])}):Object.getOwnPropertyDescriptors?Object.defineProperties(E,Object.getOwnPropertyDescriptors(x)):C(Object(x)).forEach(function(v){Object.defineProperty(E,v,Object.getOwnPropertyDescriptor(x,v))})}return E}function w(E,c,x){return c in E?Object.defineProperty(E,c,{value:x,enumerable:!0,configurable:!0,writable:!0}):E[c]=x,E}var O=_(_({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:o.default,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,licenseResponseCallback:void 0,abrController:z.default,bufferController:n.default,capLevelController:g.default,fpsController:f.default,stretchShortVideoTrack:!1,maxAudioFramesDrift:1,forceKeyFrameOnDiscontinuity:!0,abrEwmaFastLive:3,abrEwmaSlowLive:9,abrEwmaFastVoD:3,abrEwmaSlowVoD:9,abrEwmaDefaultEstimate:5e5,abrBandWidthFactor:.95,abrBandWidthUpFactor:.7,abrMaxWithRealBitrate:!1,maxStarvationDelay:4,maxLoadingDelay:4,minAutoBitrate:0,emeEnabled:!1,widevineLicenseUrl:void 0,drmSystemOptions:{},requestMediaKeySystemAccessFunc:u.requestMediaKeySystemAccess,testBandwidth:!0,progressive:!1,lowLatencyMode:!0,cmcd:void 0},R()),{},{subtitleStreamController:W.SubtitleStreamController,subtitleTrackController:H.default,timelineController:I.TimelineController,audioStreamController:U.default,audioTrackController:L.default,emeController:m.default,cmcdController:h.default});function R(){return{cueHandler:l.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 S(E,c){if((c.liveSyncDurationCount||c.liveMaxLatencyDurationCount)&&(c.liveSyncDuration||c.liveMaxLatencyDuration))throw new Error("Illegal hls.js config: don't mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration");if(c.liveMaxLatencyDurationCount!==void 0&&(c.liveSyncDurationCount===void 0||c.liveMaxLatencyDurationCount<=c.liveSyncDurationCount))throw new Error('Illegal hls.js config: "liveMaxLatencyDurationCount" must be greater than "liveSyncDurationCount"');if(c.liveMaxLatencyDuration!==void 0&&(c.liveSyncDuration===void 0||c.liveMaxLatencyDuration<=c.liveSyncDuration))throw new Error('Illegal hls.js config: "liveMaxLatencyDuration" must be greater than "liveSyncDuration"');return s({},E,c)}function T(E){var c=E.loader;if(c!==p.default&&c!==o.default)a.logger.log("[config]: Custom loader detected, cannot enable progressive streaming"),E.progressive=!1;else{var x=Object(p.fetchSupported)();x&&(E.loader=p.default,E.progressive=!0,E.enableSoftwareAES=!0,a.logger.log("[config]: Progressive streaming enabled, using FetchLoader"))}}},"./src/controller/abr-controller.ts":function(oe,$,k){"use strict";k.r($);var z=k("./src/polyfills/number.ts"),U=k("./src/utils/ewma-bandwidth-estimator.ts"),L=k("./src/events.ts"),W=k("./src/utils/buffer-helper.ts"),H=k("./src/errors.ts"),n=k("./src/types/loader.ts"),I=k("./src/utils/logger.ts");function g(h,o){for(var p=0;p<o.length;p++){var l=o[p];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(h,l.key,l)}}function f(h,o,p){return o&&g(h.prototype,o),p&&g(h,p),h}var m=function(){function h(p){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=p;var l=p.config;this.bwEstimator=new U.default(l.abrEwmaSlowVoD,l.abrEwmaFastVoD,l.abrEwmaDefaultEstimate),this.registerListeners()}var o=h.prototype;return o.registerListeners=function(){var l=this.hls;l.on(L.Events.FRAG_LOADING,this.onFragLoading,this),l.on(L.Events.FRAG_LOADED,this.onFragLoaded,this),l.on(L.Events.FRAG_BUFFERED,this.onFragBuffered,this),l.on(L.Events.LEVEL_LOADED,this.onLevelLoaded,this),l.on(L.Events.ERROR,this.onError,this)},o.unregisterListeners=function(){var l=this.hls;l.off(L.Events.FRAG_LOADING,this.onFragLoading,this),l.off(L.Events.FRAG_LOADED,this.onFragLoaded,this),l.off(L.Events.FRAG_BUFFERED,this.onFragBuffered,this),l.off(L.Events.LEVEL_LOADED,this.onLevelLoaded,this),l.off(L.Events.ERROR,this.onError,this)},o.destroy=function(){this.unregisterListeners(),this.clearTimer(),this.hls=this.onCheck=null,this.fragCurrent=this.partCurrent=null},o.onFragLoading=function(l,u){var a=u.frag;if(a.type===n.PlaylistLevelType.MAIN&&!this.timer){var s;this.fragCurrent=a,this.partCurrent=(s=u.part)!=null?s:null,this.timer=self.setInterval(this.onCheck,100)}},o.onLevelLoaded=function(l,u){var a=this.hls.config;u.details.live?this.bwEstimator.update(a.abrEwmaSlowLive,a.abrEwmaFastLive):this.bwEstimator.update(a.abrEwmaSlowVoD,a.abrEwmaFastVoD)},o._abandonRulesCheck=function(){var l=this.fragCurrent,u=this.partCurrent,a=this.hls,s=a.autoLevelEnabled,C=a.config,_=a.media;if(!l||!_)return;var w=u?u.stats:l.stats,O=u?u.duration:l.duration;if(w.aborted){I.logger.warn("frag loader destroy or aborted, disarm abandonRules"),this.clearTimer(),this._nextAutoLevel=-1;return}if(!s||_.paused||!_.playbackRate||!_.readyState)return;var R=performance.now()-w.loading.start,S=Math.abs(_.playbackRate);if(R<=500*O/S)return;var T=a.levels,E=a.minAutoLevel,c=T[l.level],x=w.total||Math.max(w.loaded,Math.round(O*c.maxBitrate/8)),v=Math.max(1,w.bwEstimate?w.bwEstimate/8:w.loaded*1e3/R),y=(x-w.loaded)/v,F=_.currentTime,B=(W.BufferHelper.bufferInfo(_,F,C.maxBufferHole).end-F)/S;if(B>=2*O/S||y<=B)return;var A=Number.POSITIVE_INFINITY,j;for(j=l.level-1;j>E;j--){var P=T[j].maxBitrate;if(A=O*P/(8*.8*v),A<B)break}if(A>=y)return;var b=this.bwEstimator.getEstimate();I.logger.warn("Fragment "+l.sn+(u?" part "+u.index:"")+" of level "+l.level+" is loading too slowly and will cause an underbuffer; aborting and switching to level "+j+`
Current BW estimate: `+(Object(z.isFiniteNumber)(b)?(b/1024).toFixed(3):"Unknown")+` Kb/s
Estimated load time for current fragment: `+y.toFixed(3)+` s
Estimated load time for the next fragment: `+A.toFixed(3)+` s
Time to underbuffer: `+B.toFixed(3)+" s"),a.nextLoadLevel=j,this.bwEstimator.sample(R,w.loaded),this.clearTimer(),l.loader&&(this.fragCurrent=this.partCurrent=null,l.loader.abort()),a.trigger(L.Events.FRAG_LOAD_EMERGENCY_ABORTED,{frag:l,part:u,stats:w})},o.onFragLoaded=function(l,u){var a=u.frag,s=u.part;if(a.type===n.PlaylistLevelType.MAIN&&Object(z.isFiniteNumber)(a.sn)){var C=s?s.stats:a.stats,_=s?s.duration:a.duration;if(this.clearTimer(),this.lastLoadedFragLevel=a.level,this._nextAutoLevel=-1,this.hls.config.abrMaxWithRealBitrate){var w=this.hls.levels[a.level],O=(w.loaded?w.loaded.bytes:0)+C.loaded,R=(w.loaded?w.loaded.duration:0)+_;w.loaded={bytes:O,duration:R},w.realBitrate=Math.round(8*O/R)}if(a.bitrateTest){var S={stats:C,frag:a,part:s,id:a.type};this.onFragBuffered(L.Events.FRAG_BUFFERED,S),a.bitrateTest=!1}}},o.onFragBuffered=function(l,u){var a=u.frag,s=u.part,C=s?s.stats:a.stats;if(C.aborted)return;if(a.type!==n.PlaylistLevelType.MAIN||a.sn==="initSegment")return;var _=C.parsing.end-C.loading.start;this.bwEstimator.sample(_,C.loaded),C.bwEstimate=this.bwEstimator.getEstimate(),a.bitrateTest?this.bitrateTestDelay=_/1e3:this.bitrateTestDelay=0},o.onError=function(l,u){switch(u.details){case H.ErrorDetails.FRAG_LOAD_ERROR:case H.ErrorDetails.FRAG_LOAD_TIMEOUT:this.clearTimer();break;default:break}},o.clearTimer=function(){self.clearInterval(this.timer),this.timer=void 0},o.getNextABRAutoLevel=function(){var l=this.fragCurrent,u=this.partCurrent,a=this.hls,s=a.maxAutoLevel,C=a.config,_=a.minAutoLevel,w=a.media,O=u?u.duration:l?l.duration:0,R=w?w.currentTime:0,S=w&&w.playbackRate!==0?Math.abs(w.playbackRate):1,T=this.bwEstimator?this.bwEstimator.getEstimate():C.abrEwmaDefaultEstimate,E=(W.BufferHelper.bufferInfo(w,R,C.maxBufferHole).end-R)/S,c=this.findBestLevel(T,_,s,E,C.abrBandWidthFactor,C.abrBandWidthUpFactor);if(c>=0)return c;I.logger.trace((E?"rebuffering expected":"buffer is empty")+", finding optimal quality level");var x=O?Math.min(O,C.maxStarvationDelay):C.maxStarvationDelay,v=C.abrBandWidthFactor,y=C.abrBandWidthUpFactor;if(!E){var F=this.bitrateTestDelay;if(F){var B=O?Math.min(O,C.maxLoadingDelay):C.maxLoadingDelay;x=B-F,I.logger.trace("bitrate test took "+Math.round(1e3*F)+"ms, set first fragment max fetchDuration to "+Math.round(1e3*x)+" ms"),v=y=1}}return c=this.findBestLevel(T,_,s,E+x,v,y),Math.max(c,0)},o.findBestLevel=function(l,u,a,s,C,_){for(var w,O=this.fragCurrent,R=this.partCurrent,S=this.lastLoadedFragLevel,T=this.hls.levels,E=T[S],c=!!(E!=null&&(w=E.details)!==null&&w!==void 0&&w.live),x=E==null?void 0:E.codecSet,v=R?R.duration:O?O.duration:0,y=a;y>=u;y--){var F=T[y];if(!F||x&&F.codecSet!==x)continue;var B=F.details,A=(R?B==null?void 0:B.partTarget:B==null?void 0:B.averagetargetduration)||v,j=void 0;y<=S?j=C*l:j=_*l;var P=T[y].maxBitrate,b=P*A/j;if(I.logger.trace("level/adjustedbw/bitrate/avgDuration/maxFetchDuration/fetchDuration: "+y+"/"+Math.round(j)+"/"+P+"/"+A+"/"+s+"/"+b),j>P&&(!b||c&&!this.bitrateTestDelay||b<s))return y}return-1},f(h,[{key:"nextAutoLevel",get:function(){var l=this._nextAutoLevel,u=this.bwEstimator;if(l!==-1&&(!u||!u.canEstimate()))return l;var a=this.getNextABRAutoLevel();return l!==-1&&(a=Math.min(l,a)),a},set:function(l){this._nextAutoLevel=l}}]),h}();$.default=m},"./src/controller/audio-stream-controller.ts":function(oe,$,k){"use strict";k.r($);var z=k("./src/polyfills/number.ts"),U=k("./src/controller/base-stream-controller.ts"),L=k("./src/events.ts"),W=k("./src/utils/buffer-helper.ts"),H=k("./src/controller/fragment-tracker.ts"),n=k("./src/types/level.ts"),I=k("./src/types/loader.ts"),g=k("./src/loader/fragment.ts"),f=k("./src/demux/chunk-cache.ts"),m=k("./src/demux/transmuxer-interface.ts"),h=k("./src/types/transmuxer.ts"),o=k("./src/controller/fragment-finders.ts"),p=k("./src/utils/discontinuities.ts"),l=k("./src/errors.ts"),u=k("./src/utils/logger.ts");function a(){return a=Object.assign||function(O){for(var R=1;R<arguments.length;R++){var S=arguments[R];for(var T in S)Object.prototype.hasOwnProperty.call(S,T)&&(O[T]=S[T])}return O},a.apply(this,arguments)}function s(O,R){O.prototype=Object.create(R.prototype),O.prototype.constructor=O,C(O,R)}function C(O,R){return C=Object.setPrototypeOf||function(T,E){return T.__proto__=E,T},C(O,R)}var _=100,w=function(O){s(R,O);function R(T,E){var c;return c=O.call(this,T,E,"[audio-stream-controller]")||this,c.videoBuffer=null,c.videoTrackCC=-1,c.waitingVideoCC=-1,c.audioSwitch=!1,c.trackId=-1,c.waitingData=null,c.mainDetails=null,c.bufferFlushed=!1,c._registerListeners(),c}var S=R.prototype;return S.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},S._registerListeners=function(){var E=this.hls;E.on(L.Events.MEDIA_ATTACHED,this.onMediaAttached,this),E.on(L.Events.MEDIA_DETACHING,this.onMediaDetaching,this),E.on(L.Events.MANIFEST_LOADING,this.onManifestLoading,this),E.on(L.Events.LEVEL_LOADED,this.onLevelLoaded,this),E.on(L.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),E.on(L.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),E.on(L.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),E.on(L.Events.ERROR,this.onError,this),E.on(L.Events.BUFFER_RESET,this.onBufferReset,this),E.on(L.Events.BUFFER_CREATED,this.onBufferCreated,this),E.on(L.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),E.on(L.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),E.on(L.Events.FRAG_BUFFERED,this.onFragBuffered,this)},S._unregisterListeners=function(){var E=this.hls;E.off(L.Events.MEDIA_ATTACHED,this.onMediaAttached,this),E.off(L.Events.MEDIA_DETACHING,this.onMediaDetaching,this),E.off(L.Events.MANIFEST_LOADING,this.onManifestLoading,this),E.off(L.Events.LEVEL_LOADED,this.onLevelLoaded,this),E.off(L.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),E.off(L.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),E.off(L.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),E.off(L.Events.ERROR,this.onError,this),E.off(L.Events.BUFFER_RESET,this.onBufferReset,this),E.off(L.Events.BUFFER_CREATED,this.onBufferCreated,this),E.off(L.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),E.off(L.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),E.off(L.Events.FRAG_BUFFERED,this.onFragBuffered,this)},S.onInitPtsFound=function(E,c){var x=c.frag,v=c.id,y=c.initPTS;if(v==="main"){var F=x.cc;this.initPTS[x.cc]=y,this.log("InitPTS for cc: "+F+" found from main: "+y),this.videoTrackCC=F,this.state===U.State.WAITING_INIT_PTS&&this.tick()}},S.startLoad=function(E){if(!this.levels){this.startPosition=E,this.state=U.State.STOPPED;return}var c=this.lastCurrentTime;this.stopLoad(),this.setInterval(_),this.fragLoadError=0,c>0&&E===-1?(this.log("Override startPosition with lastCurrentTime @"+c.toFixed(3)),this.state=U.State.IDLE):(this.loadedmetadata=!1,this.state=U.State.WAITING_TRACK),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=E,this.tick()},S.doTick=function(){switch(this.state){case U.State.IDLE:this.doTickIdle();break;case U.State.WAITING_TRACK:{var E,c=this.levels,x=this.trackId,v=c==null||((E=c[x])===null||E===void 0)?void 0:E.details;if(v){if(this.waitForCdnTuneIn(v))break;this.state=U.State.WAITING_INIT_PTS}break}case U.State.FRAG_LOADING_WAITING_RETRY:{var y,F=performance.now(),B=this.retryDate;(!B||F>=B||(y=this.media)!==null&&y!==void 0&&y.seeking)&&(this.log("RetryDate reached, switch back to IDLE state"),this.state=U.State.IDLE);break}case U.State.WAITING_INIT_PTS:{var A=this.waitingData;if(A){var j=A.frag,P=A.part,b=A.cache,V=A.complete;if(this.initPTS[j.cc]!==void 0){this.waitingData=null,this.waitingVideoCC=-1,this.state=U.State.FRAG_LOADING;var re=b.flush(),ce={frag:j,part:P,payload:re,networkDetails:null};this._handleFragmentLoadProgress(ce),V&&O.prototype._handleFragmentLoadComplete.call(this,ce)}else if(this.videoTrackCC!==this.waitingVideoCC)u.logger.log("Waiting fragment cc ("+j.cc+") cancelled because video is at cc "+this.videoTrackCC),this.clearWaitingFragment();else{var me=this.getLoadPosition(),De=W.BufferHelper.bufferInfo(this.mediaBuffer,me,this.config.maxBufferHole),we=Object(o.fragmentWithinToleranceTest)(De.end,this.config.maxFragLookUpTolerance,j);we<0&&(u.logger.log("Waiting fragment cc ("+j.cc+") @ "+j.start+" cancelled because another fragment at "+De.end+" is needed"),this.clearWaitingFragment())}}else this.state=U.State.IDLE}}this.onTickEnd()},S.clearWaitingFragment=function(){var E=this.waitingData;E&&(this.fragmentTracker.removeFragment(E.frag),this.waitingData=null,this.waitingVideoCC=-1,this.state=U.State.IDLE)},S.onTickEnd=function(){var E=this.media;if(!E||!E.readyState)return;var c=this.mediaBuffer?this.mediaBuffer:E,x=c.buffered;!this.loadedmetadata&&x.length&&(this.loadedmetadata=!0),this.lastCurrentTime=E.currentTime},S.doTickIdle=function(){var E,c,x=this.hls,v=this.levels,y=this.media,F=this.trackId,B=x.config;if(!v||!v[F])return;if(!y&&(this.startFragRequested||!B.startFragPrefetch))return;var A=v[F],j=A.details;if(!j||j.live&&this.levelLastLoaded!==F||this.waitForCdnTuneIn(j)){this.state=U.State.WAITING_TRACK;return}this.bufferFlushed&&(this.bufferFlushed=!1,this.afterBufferFlushed(this.mediaBuffer?this.mediaBuffer:this.media,g.ElementaryStreamTypes.AUDIO,I.PlaylistLevelType.AUDIO));var P=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:this.media,I.PlaylistLevelType.AUDIO);if(P===null)return;var b=P.len,V=this.getMaxBufferLength(),re=this.audioSwitch;if(b>=V&&!re)return;if(!re&&this._streamEnded(P,j)){x.trigger(L.Events.BUFFER_EOS,{type:"audio"}),this.state=U.State.ENDED;return}var ce=j.fragments,me=ce[0].start,De=P.end;if(re){var we=this.getLoadPosition();De=we,j.PTSKnown&&we<me&&((P.end>me||P.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),y.currentTime=me+.05))}var Le=this.getNextFragment(De,j);if(!Le){this.bufferFlushed=!0;return}((E=Le.decryptdata)===null||E===void 0?void 0:E.keyFormat)==="identity"&&!((c=Le.decryptdata)!==null&&c!==void 0&&c.key)?this.loadKey(Le,j):this.loadFragment(Le,j,De)},S.getMaxBufferLength=function(){var E=O.prototype.getMaxBufferLength.call(this),c=this.getFwdBufferInfo(this.videoBuffer?this.videoBuffer:this.media,I.PlaylistLevelType.MAIN);return c===null?E:Math.max(E,c.len)},S.onMediaDetaching=function(){this.videoBuffer=null,O.prototype.onMediaDetaching.call(this)},S.onAudioTracksUpdated=function(E,c){var x=c.audioTracks;this.resetTransmuxer(),this.levels=x.map(function(v){return new n.Level(v)})},S.onAudioTrackSwitching=function(E,c){var x=!!c.url;this.trackId=c.id;var v=this.fragCurrent;v!=null&&v.loader&&v.loader.abort(),this.fragCurrent=null,this.clearWaitingFragment(),x?this.setInterval(_):this.resetTransmuxer(),x?(this.audioSwitch=!0,this.state=U.State.IDLE):this.state=U.State.STOPPED,this.tick()},S.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments(),this.startPosition=this.lastCurrentTime=0,this.bufferFlushed=!1},S.onLevelLoaded=function(E,c){this.mainDetails=c.details},S.onAudioTrackLoaded=function(E,c){var x,v=this.levels,y=c.details,F=c.id;if(!v){this.warn("Audio tracks were reset while loading level "+F);return}this.log("Track "+F+" loaded ["+y.startSN+","+y.endSN+"],duration:"+y.totalduration);var B=v[F],A=0;if(y.live||(x=B.details)!==null&&x!==void 0&&x.live){var j=this.mainDetails;if(y.fragments[0]||(y.deltaUpdateFailed=!0),y.deltaUpdateFailed||!j)return;!B.details&&y.hasProgramDateTime&&j.hasProgramDateTime?(Object(p.alignMediaPlaylistByPDT)(y,j),A=y.fragments[0].start):A=this.alignPlaylists(y,B.details)}B.details=y,this.levelLastLoaded=F,!this.startFragRequested&&(this.mainDetails||!y.live)&&this.setStartPosition(B.details,A),this.state===U.State.WAITING_TRACK&&!this.waitForCdnTuneIn(y)&&(this.state=U.State.IDLE),this.tick()},S._handleFragmentLoadProgress=function(E){var c,x=E.frag,v=E.part,y=E.payload,F=this.config,B=this.trackId,A=this.levels;if(!A){this.warn("Audio tracks were reset while fragment load was in progress. Fragment "+x.sn+" of level "+x.level+" will not be buffered");return}var j=A[B];console.assert(j,"Audio track is defined on fragment load progress");var P=j.details;console.assert(P,"Audio track details are defined on fragment load progress");var b=F.defaultAudioCodec||j.audioCodec||"mp4a.40.2",V=this.transmuxer;V||(V=this.transmuxer=new m.default(this.hls,I.PlaylistLevelType.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));var re=this.initPTS[x.cc],ce=(c=x.initSegment)===null||c===void 0?void 0:c.data;if(re!==void 0){var me=!1,De=v?v.index:-1,we=De!==-1,Le=new h.ChunkMetadata(x.level,x.sn,x.stats.chunkCount,y.byteLength,De,we);V.push(y,ce,b,"",x,v,P.totalduration,me,Le,re)}else{u.logger.log("Unknown video PTS for cc "+x.cc+", waiting for video PTS before demuxing audio frag "+x.sn+" of ["+P.startSN+" ,"+P.endSN+"],track "+B);var Re=this.waitingData=this.waitingData||{frag:x,part:v,cache:new f.default,complete:!1},Ie=Re.cache;Ie.push(new Uint8Array(y)),this.waitingVideoCC=this.videoTrackCC,this.state=U.State.WAITING_INIT_PTS}},S._handleFragmentLoadComplete=function(E){if(this.waitingData){this.waitingData.complete=!0;return}O.prototype._handleFragmentLoadComplete.call(this,E)},S.onBufferReset=function(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1},S.onBufferCreated=function(E,c){var x=c.tracks.audio;x&&(this.mediaBuffer=x.buffer),c.tracks.video&&(this.videoBuffer=c.tracks.video.buffer)},S.onFragBuffered=function(E,c){var x=c.frag,v=c.part;if(x.type!==I.PlaylistLevelType.AUDIO)return;if(this.fragContextChanged(x)){this.warn("Fragment "+x.sn+(v?" p: "+v.index:"")+" of level "+x.level+" finished buffering, but was aborted. state: "+this.state+", audioSwitch: "+this.audioSwitch);return}x.sn!=="initSegment"&&(this.fragPrevious=x,this.audioSwitch&&(this.audioSwitch=!1,this.hls.trigger(L.Events.AUDIO_TRACK_SWITCHED,{id:this.trackId}))),this.fragBufferedComplete(x,v)},S.onError=function(E,c){switch(c.details){case l.ErrorDetails.FRAG_LOAD_ERROR:case l.ErrorDetails.FRAG_LOAD_TIMEOUT:case l.ErrorDetails.KEY_LOAD_ERROR:case l.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(I.PlaylistLevelType.AUDIO,c);break;case l.ErrorDetails.AUDIO_TRACK_LOAD_ERROR:case l.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:this.state!==U.State.ERROR&&this.state!==U.State.STOPPED&&(this.state=c.fatal?U.State.ERROR:U.State.IDLE,this.warn(c.details+" while loading frag, switching to "+this.state+" state"));break;case l.ErrorDetails.BUFFER_FULL_ERROR:if(c.parent==="audio"&&(this.state===U.State.PARSING||this.state===U.State.PARSED)){var x=!0,v=this.getFwdBufferInfo(this.mediaBuffer,I.PlaylistLevelType.AUDIO);v&&v.len>.5&&(x=!this.reduceMaxBufferLength(v.len)),x&&(this.warn("Buffer full error also media.currentTime is not buffered, flush audio buffer"),this.fragCurrent=null,O.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.resetLoadingState()}break;default:break}},S.onBufferFlushed=function(E,c){var x=c.type;x===g.ElementaryStreamTypes.AUDIO&&(this.bufferFlushed=!0)},S._handleTransmuxComplete=function(E){var c,x="audio",v=this.hls,y=E.remuxResult,F=E.chunkMeta,B=this.getCurrentContext(F);if(!B){this.warn("The loading context changed while buffering fragment "+F.sn+" of level "+F.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(F.level);return}var A=B.frag,j=B.part,P=y.audio,b=y.text,V=y.id3,re=y.initSegment;if(this.fragContextChanged(A))return;if(this.state=U.State.PARSING,this.audioSwitch&&P&&this.completeAudioSwitch(),re!=null&&re.tracks&&(this._bufferInitSegment(re.tracks,A,F),v.trigger(L.Events.FRAG_PARSING_INIT_SEGMENT,{frag:A,id:x,tracks:re.tracks})),P){var ce=P.startPTS,me=P.endPTS,De=P.startDTS,we=P.endDTS;j&&(j.elementaryStreams[g.ElementaryStreamTypes.AUDIO]={startPTS:ce,endPTS:me,startDTS:De,endDTS:we}),A.setElementaryStreamInfo(g.ElementaryStreamTypes.AUDIO,ce,me,De,we),this.bufferFragmentData(P,A,j,F)}if(V!=null&&(c=V.samples)!==null&&c!==void 0&&c.length){var Le=a({frag:A,id:x},V);v.trigger(L.Events.FRAG_PARSING_METADATA,Le)}if(b){var Re=a({frag:A,id:x},b);v.trigger(L.Events.FRAG_PARSING_USERDATA,Re)}},S._bufferInitSegment=function(E,c,x){if(this.state!==U.State.PARSING)return;E.video&&delete E.video;var v=E.audio;if(!v)return;v.levelCodec=v.codec,v.id="audio",this.log("Init audio buffer, container:"+v.container+", codecs[parsed]=["+v.codec+"]"),this.hls.trigger(L.Events.BUFFER_CODECS,E);var y=v.initSegment;if(y!=null&&y.byteLength){var F={type:"audio",frag:c,part:null,chunkMeta:x,parent:c.type,data:y};this.hls.trigger(L.Events.BUFFER_APPENDING,F)}this.tick()},S.loadFragment=function(E,c,x){var v=this.fragmentTracker.getState(E);this.fragCurrent=E,(this.audioSwitch||v===H.FragmentState.NOT_LOADED||v===H.FragmentState.PARTIAL)&&(E.sn==="initSegment"?this._loadInitSegment(E):c.live&&!Object(z.isFiniteNumber)(this.initPTS[E.cc])?(this.log("Waiting for video PTS in continuity counter "+E.cc+" of live stream before loading audio fragment "+E.sn+" of level "+this.trackId),this.state=U.State.WAITING_INIT_PTS):(this.startFragRequested=!0,O.prototype.loadFragment.call(this,E,c,x)))},S.completeAudioSwitch=function(){var E=this.hls,c=this.media,x=this.trackId;c&&(this.log("Switching audio track : flushing all audio"),O.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.audioSwitch=!1,E.trigger(L.Events.AUDIO_TRACK_SWITCHED,{id:x})},R}(U.default);$.default=w},"./src/controller/audio-track-controller.ts":function(oe,$,k){"use strict";k.r($);var z=k("./src/events.ts"),U=k("./src/errors.ts"),L=k("./src/controller/base-playlist-controller.ts"),W=k("./src/types/loader.ts");function H(m,h){for(var o=0;o<h.length;o++){var p=h[o];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(m,p.key,p)}}function n(m,h,o){return h&&H(m.prototype,h),o&&H(m,o),m}function I(m,h){m.prototype=Object.create(h.prototype),m.prototype.constructor=m,g(m,h)}function g(m,h){return g=Object.setPrototypeOf||function(p,l){return p.__proto__=l,p},g(m,h)}var f=function(m){I(h,m);function h(p){var l;return l=m.call(this,p,"[audio-track-controller]")||this,l.tracks=[],l.groupId=null,l.tracksInGroup=[],l.trackId=-1,l.trackName="",l.selectDefaultTrack=!0,l.registerListeners(),l}var o=h.prototype;return o.registerListeners=function(){var l=this.hls;l.on(z.Events.MANIFEST_LOADING,this.onManifestLoading,this),l.on(z.Events.MANIFEST_PARSED,this.onManifestParsed,this),l.on(z.Events.LEVEL_LOADING,this.onLevelLoading,this),l.on(z.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),l.on(z.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),l.on(z.Events.ERROR,this.onError,this)},o.unregisterListeners=function(){var l=this.hls;l.off(z.Events.MANIFEST_LOADING,this.onManifestLoading,this),l.off(z.Events.MANIFEST_PARSED,this.onManifestParsed,this),l.off(z.Events.LEVEL_LOADING,this.onLevelLoading,this),l.off(z.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),l.off(z.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),l.off(z.Events.ERROR,this.onError,this)},o.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,m.prototype.destroy.call(this)},o.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.trackName="",this.selectDefaultTrack=!0},o.onManifestParsed=function(l,u){this.tracks=u.audioTracks||[]},o.onAudioTrackLoaded=function(l,u){var a=u.id,s=u.details,C=this.tracksInGroup[a];if(!C){this.warn("Invalid audio track id "+a);return}var _=C.details;C.details=u.details,this.log("audioTrack "+a+" loaded ["+s.startSN+"-"+s.endSN+"]"),a===this.trackId&&(this.retryCount=0,this.playlistLoaded(a,u,_))},o.onLevelLoading=function(l,u){this.switchLevel(u.level)},o.onLevelSwitching=function(l,u){this.switchLevel(u.level)},o.switchLevel=function(l){var u=this.hls.levels[l];if(!(u!=null&&u.audioGroupIds))return;var a=u.audioGroupIds[u.urlId];if(this.groupId!==a){this.groupId=a;var s=this.tracks.filter(function(_){return!a||_.groupId===a});this.selectDefaultTrack&&!s.some(function(_){return _.default})&&(this.selectDefaultTrack=!1),this.tracksInGroup=s;var C={audioTracks:s};this.log("Updating audio tracks, "+s.length+' track(s) found in "'+a+'" group-id'),this.hls.trigger(z.Events.AUDIO_TRACKS_UPDATED,C),this.selectInitialTrack()}},o.onError=function(l,u){if(m.prototype.onError.call(this,l,u),u.fatal||!u.context)return;u.context.type===W.PlaylistContextType.AUDIO_TRACK&&u.context.id===this.trackId&&u.context.groupId===this.groupId&&this.retryLoadingOrFail(u)},o.setAudioTrack=function(l){var u=this.tracksInGroup;if(l<0||l>=u.length){this.warn("Invalid id passed to audio-track controller");return}this.clearTimer();var a=u[this.trackId];this.log("Now switching to audio-track index "+l);var s=u[l],C=s.id,_=s.groupId,w=_===void 0?"":_,O=s.name,R=s.type,S=s.url;if(this.trackId=l,this.trackName=O,this.selectDefaultTrack=!1,this.hls.trigger(z.Events.AUDIO_TRACK_SWITCHING,{id:C,groupId:w,name:O,type:R,url:S}),s.details&&!s.details.live)return;var T=this.switchParams(s.url,a==null?void 0:a.details);this.loadPlaylist(T)},o.selectInitialTrack=function(){var l=this.tracksInGroup;console.assert(l.length,"Initial audio track should be selected when tracks are known");var u=this.trackName,a=this.findTrackId(u)||this.findTrackId();a!==-1?this.setAudioTrack(a):(this.warn("No track found for running audio group-ID: "+this.groupId),this.hls.trigger(z.Events.ERROR,{type:U.ErrorTypes.MEDIA_ERROR,details:U.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,fatal:!0}))},o.findTrackId=function(l){for(var u=this.tracksInGroup,a=0;a<u.length;a++){var s=u[a];if((!this.selectDefaultTrack||s.default)&&(!l||l===s.name))return s.id}return-1},o.loadPlaylist=function(l){var u=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(u)){var a=u.id,s=u.groupId,C=u.url;if(l)try{C=l.addDirectives(C)}catch(_){this.warn("Could not construct new URL with HLS Delivery Directives: "+_)}this.log("loading audio-track playlist for id: "+a),this.clearTimer(),this.hls.trigger(z.Events.AUDIO_TRACK_LOADING,{url:C,id:a,groupId:s,deliveryDirectives:l||null})}},n(h,[{key:"audioTracks",get:function(){return this.tracksInGroup}},{key:"audioTrack",get:function(){return this.trackId},set:function(l){this.selectDefaultTrack=!1,this.setAudioTrack(l)}}]),h}(L.default);$.default=f},"./src/controller/base-playlist-controller.ts":function(oe,$,k){"use strict";k.r($),k.d($,"default",function(){return n});var z=k("./src/polyfills/number.ts"),U=k("./src/types/level.ts"),L=k("./src/controller/level-helper.ts"),W=k("./src/utils/logger.ts"),H=k("./src/errors.ts"),n=function(){function I(f,m){this.hls=void 0,this.timer=-1,this.canLoad=!1,this.retryCount=0,this.log=void 0,this.warn=void 0,this.log=W.logger.log.bind(W.logger,m+":"),this.warn=W.logger.warn.bind(W.logger,m+":"),this.hls=f}var g=I.prototype;return g.destroy=function(){this.clearTimer(),this.hls=this.log=this.warn=null},g.onError=function(m,h){h.fatal&&h.type===H.ErrorTypes.NETWORK_ERROR&&this.clearTimer()},g.clearTimer=function(){clearTimeout(this.timer),this.timer=-1},g.startLoad=function(){this.canLoad=!0,this.retryCount=0,this.loadPlaylist()},g.stopLoad=function(){this.canLoad=!1,this.clearTimer()},g.switchParams=function(m,h){var o=h==null?void 0:h.renditionReports;if(o)for(var p=0;p<o.length;p++){var l=o[p],u=""+l.URI;if(u===m.substr(-u.length)){var a=parseInt(l["LAST-MSN"]),s=parseInt(l["LAST-PART"]);if(h&&this.hls.config.lowLatencyMode){var C=Math.min(h.age-h.partTarget,h.targetduration);s!==void 0&&C>h.partTarget&&(s+=1)}if(Object(z.isFiniteNumber)(a))return new U.HlsUrlParameters(a,Object(z.isFiniteNumber)(s)?s:void 0,U.HlsSkip.No)}}},g.loadPlaylist=function(m){},g.shouldLoadTrack=function(m){return this.canLoad&&m&&!!m.url&&(!m.details||m.details.live)},g.playlistLoaded=function(m,h,o){var p=this,l=h.details,u=h.stats,a=u.loading.end?Math.max(0,self.performance.now()-u.loading.end):0;if(l.advancedDateTime=Date.now()-a,l.live||o!=null&&o.live){if(l.reloaded(o),o&&this.log("live playlist "+m+" "+(l.advanced?"REFRESHED "+l.lastPartSn+"-"+l.lastPartIndex:"MISSED")),o&&l.fragments.length>0&&Object(L.mergeDetails)(o,l),!this.canLoad||!l.live)return;var s,C=void 0,_=void 0;if(l.canBlockReload&&l.endSN&&l.advanced){var w=this.hls.config.lowLatencyMode,O=l.lastPartSn,R=l.endSN,S=l.lastPartIndex,T=S!==-1,E=O===R,c=w?0:S;T?(C=E?R+1:O,_=E?c:S+1):C=R+1;var x=l.age,v=x+l.ageHeader,y=Math.min(v-l.partTarget,l.targetduration*1.5);if(y>0){if(o&&y>o.tuneInGoal)this.warn("CDN Tune-in goal increased from: "+o.tuneInGoal+" to: "+y+" with playlist age: "+l.age),y=0;else{var F=Math.floor(y/l.targetduration);if(C+=F,_!==void 0){var B=Math.round(y%l.targetduration/l.partTarget);_+=B}this.log("CDN Tune-in age: "+l.ageHeader+"s last advanced "+x.toFixed(2)+"s goal: "+y+" skip sn "+F+" to part "+_)}l.tuneInGoal=y}if(s=this.getDeliveryDirectives(l,h.deliveryDirectives,C,_),w||!E){this.loadPlaylist(s);return}}else s=this.getDeliveryDirectives(l,h.deliveryDirectives,C,_);var A=Object(L.computeReloadInterval)(l,u);C!==void 0&&l.canBlockReload&&(A-=l.partTarget||1),this.log("reload live playlist "+m+" in "+Math.round(A)+" ms"),this.timer=self.setTimeout(function(){return p.loadPlaylist(s)},A)}else this.clearTimer()},g.getDeliveryDirectives=function(m,h,o,p){var l=Object(U.getSkipValue)(m,o);return h!=null&&h.skip&&m.deltaUpdateFailed&&(o=h.msn,p=h.part,l=U.HlsSkip.No),new U.HlsUrlParameters(o,p,l)},g.retryLoadingOrFail=function(m){var h=this,o=this.hls.config,p=this.retryCount<o.levelLoadingMaxRetry;if(p){var l;if(this.retryCount++,m.details.indexOf("LoadTimeOut")>-1&&(l=m.context)!==null&&l!==void 0&&l.deliveryDirectives)this.warn("retry playlist loading #"+this.retryCount+' after "'+m.details+'"'),this.loadPlaylist();else{var u=Math.min(Math.pow(2,this.retryCount)*o.levelLoadingRetryDelay,o.levelLoadingMaxRetryTimeout);this.timer=self.setTimeout(function(){return h.loadPlaylist()},u),this.warn("retry playlist loading #"+this.retryCount+" in "+u+' ms after "'+m.details+'"')}}else this.warn('cannot recover from error "'+m.details+'"'),this.clearTimer(),m.fatal=!0;return p},I}()},"./src/controller/base-stream-controller.ts":function(oe,$,k){"use strict";k.r($),k.d($,"State",function(){return R}),k.d($,"default",function(){return S});var z=k("./src/polyfills/number.ts"),U=k("./src/task-loop.ts"),L=k("./src/controller/fragment-tracker.ts"),W=k("./src/utils/buffer-helper.ts"),H=k("./src/utils/logger.ts"),n=k("./src/events.ts"),I=k("./src/errors.ts"),g=k("./src/types/transmuxer.ts"),f=k("./src/utils/mp4-tools.ts"),m=k("./src/utils/discontinuities.ts"),h=k("./src/controller/fragment-finders.ts"),o=k("./src/controller/level-helper.ts"),p=k("./src/loader/fragment-loader.ts"),l=k("./src/crypt/decrypter.ts"),u=k("./src/utils/time-ranges.ts"),a=k("./src/types/loader.ts");function s(T,E){for(var c=0;c<E.length;c++){var x=E[c];x.enumerable=x.enumerable||!1,x.configurable=!0,"value"in x&&(x.writable=!0),Object.defineProperty(T,x.key,x)}}function C(T,E,c){return E&&s(T.prototype,E),c&&s(T,c),T}function _(T){if(T===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return T}function w(T,E){T.prototype=Object.create(E.prototype),T.prototype.constructor=T,O(T,E)}function O(T,E){return O=Object.setPrototypeOf||function(x,v){return x.__proto__=v,x},O(T,E)}var R={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"},S=function(T){w(E,T);function E(x,v,y){var F;return F=T.call(this)||this,F.hls=void 0,F.fragPrevious=null,F.fragCurrent=null,F.fragmentTracker=void 0,F.transmuxer=null,F._state=R.STOPPED,F.media=void 0,F.mediaBuffer=void 0,F.config=void 0,F.bitrateTest=!1,F.lastCurrentTime=0,F.nextLoadPosition=0,F.startPosition=0,F.loadedmetadata=!1,F.fragLoadError=0,F.retryDate=0,F.levels=null,F.fragmentLoader=void 0,F.levelLastLoaded=null,F.startFragRequested=!1,F.decrypter=void 0,F.initPTS=[],F.onvseeking=null,F.onvended=null,F.logPrefix="",F.log=void 0,F.warn=void 0,F.logPrefix=y,F.log=H.logger.log.bind(H.logger,y+":"),F.warn=H.logger.warn.bind(H.logger,y+":"),F.hls=x,F.fragmentLoader=new p.default(x.config),F.fragmentTracker=v,F.config=x.config,F.decrypter=new l.default(x,x.config),x.on(n.Events.KEY_LOADED,F.onKeyLoaded,_(F)),F}var c=E.prototype;return c.doTick=function(){this.onTickEnd()},c.onTickEnd=function(){},c.startLoad=function(v){},c.stopLoad=function(){this.fragmentLoader.abort();var v=this.fragCurrent;v&&this.fragmentTracker.removeFragment(v),this.resetTransmuxer(),this.fragCurrent=null,this.fragPrevious=null,this.clearInterval(),this.clearNextTick(),this.state=R.STOPPED},c._streamEnded=function(v,y){var F=this.fragCurrent,B=this.fragmentTracker;if(!y.live&&F&&F.sn===y.endSN&&!v.nextStart){var A=B.getState(F);return A===L.FragmentState.PARTIAL||A===L.FragmentState.OK}return!1},c.onMediaAttached=function(v,y){var F=this.media=this.mediaBuffer=y.media;this.onvseeking=this.onMediaSeeking.bind(this),this.onvended=this.onMediaEnded.bind(this),F.addEventListener("seeking",this.onvseeking),F.addEventListener("ended",this.onvended);var B=this.config;this.levels&&B.autoStartLoad&&this.state===R.STOPPED&&this.startLoad(B.startPosition)},c.onMediaDetaching=function(){var v=this.media;v!=null&&v.ended&&(this.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0),v&&(v.removeEventListener("seeking",this.onvseeking),v.removeEventListener("ended",this.onvended),this.onvseeking=this.onvended=null),this.media=this.mediaBuffer=null,this.loadedmetadata=!1,this.fragmentTracker.removeAllFragments(),this.stopLoad()},c.onMediaSeeking=function(){var v=this.config,y=this.fragCurrent,F=this.media,B=this.mediaBuffer,A=this.state,j=F?F.currentTime:0,P=W.BufferHelper.bufferInfo(B||F,j,v.maxBufferHole);if(this.log("media seeking to "+(Object(z.isFiniteNumber)(j)?j.toFixed(3):j)+", state: "+A),A===R.ENDED)this.resetLoadingState();else if(y&&!P.len){var b=v.maxFragLookUpTolerance,V=y.start-b,re=y.start+y.duration+b,ce=j>re;(j<V||ce)&&(ce&&y.loader&&(this.log("seeking outside of buffer while fragment load in progress, cancel fragment load"),y.loader.abort()),this.resetLoadingState())}F&&(this.lastCurrentTime=j),!this.loadedmetadata&&!P.len&&(this.nextLoadPosition=this.startPosition=j),this.tickImmediate()},c.onMediaEnded=function(){this.startPosition=this.lastCurrentTime=0},c.onKeyLoaded=function(v,y){if(this.state!==R.KEY_LOADING||y.frag!==this.fragCurrent||!this.levels)return;this.state=R.IDLE;var F=this.levels[y.frag.level].details;F&&this.loadFragment(y.frag,F,y.frag.start)},c.onHandlerDestroying=function(){this.stopLoad(),T.prototype.onHandlerDestroying.call(this)},c.onHandlerDestroyed=function(){this.state=R.STOPPED,this.hls.off(n.Events.KEY_LOADED,this.onKeyLoaded,this),this.fragmentLoader&&this.fragmentLoader.destroy(),this.decrypter&&this.decrypter.destroy(),this.hls=this.log=this.warn=this.decrypter=this.fragmentLoader=this.fragmentTracker=null,T.prototype.onHandlerDestroyed.call(this)},c.loadKey=function(v,y){this.log("Loading key for "+v.sn+" of ["+y.startSN+"-"+y.endSN+"], "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+v.level),this.state=R.KEY_LOADING,this.fragCurrent=v,this.hls.trigger(n.Events.KEY_LOADING,{frag:v})},c.loadFragment=function(v,y,F){this._loadFragForPlayback(v,y,F)},c._loadFragForPlayback=function(v,y,F){var B=this,A=function(P){if(B.fragContextChanged(v)){B.warn("Fragment "+v.sn+(P.part?" p: "+P.part.index:"")+" of level "+v.level+" was dropped during download."),B.fragmentTracker.removeFragment(v);return}v.stats.chunkCount++,B._handleFragmentLoadProgress(P)};this._doFragLoad(v,y,F,A).then(function(j){if(!j)return;B.fragLoadError=0;var P=B.state;if(B.fragContextChanged(v)){(P===R.FRAG_LOADING||P===R.BACKTRACKING||!B.fragCurrent&&P===R.PARSING)&&(B.fragmentTracker.removeFragment(v),B.state=R.IDLE);return}if("payload"in j&&(B.log("Loaded fragment "+v.sn+" of level "+v.level),B.hls.trigger(n.Events.FRAG_LOADED,j),B.state===R.BACKTRACKING)){B.fragmentTracker.backtrack(v,j),B.resetFragmentLoading(v);return}B._handleFragmentLoadComplete(j)}).catch(function(j){B.warn(j),B.resetFragmentLoading(v)})},c.flushMainBuffer=function(v,y,F){if(F===void 0&&(F=null),!(v-y))return;var B={startOffset:v,endOffset:y,type:F};this.fragLoadError=0,this.hls.trigger(n.Events.BUFFER_FLUSHING,B)},c._loadInitSegment=function(v){var y=this;this._doFragLoad(v).then(function(F){if(!F||y.fragContextChanged(v)||!y.levels)throw new Error("init load aborted");return F}).then(function(F){var B=y.hls,A=F.payload,j=v.decryptdata;if(A&&A.byteLength>0&&j&&j.key&&j.iv&&j.method==="AES-128"){var P=self.performance.now();return y.decrypter.webCryptoDecrypt(new Uint8Array(A),j.key.buffer,j.iv.buffer).then(function(b){var V=self.performance.now();return B.trigger(n.Events.FRAG_DECRYPTED,{frag:v,payload:b,stats:{tstart:P,tdecrypt:V}}),F.payload=b,F})}return F}).then(function(F){var B=y.fragCurrent,A=y.hls,j=y.levels;if(!j)throw new Error("init load aborted, missing levels");var P=j[v.level].details;console.assert(P,"Level details are defined when init segment is loaded");var b=v.stats;y.state=R.IDLE,y.fragLoadError=0,v.data=new Uint8Array(F.payload),b.parsing.start=b.buffering.start=self.performance.now(),b.parsing.end=b.buffering.end=self.performance.now(),F.frag===B&&A.trigger(n.Events.FRAG_BUFFERED,{stats:b,frag:B,part:null,id:v.type}),y.tick()}).catch(function(F){y.warn(F),y.resetFragmentLoading(v)})},c.fragContextChanged=function(v){var y=this.fragCurrent;return!v||!y||v.level!==y.level||v.sn!==y.sn||v.urlId!==y.urlId},c.fragBufferedComplete=function(v,y){var F=this.mediaBuffer?this.mediaBuffer:this.media;this.log("Buffered "+v.type+" sn: "+v.sn+(y?" part: "+y.index:"")+" of "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+v.level+" "+u.default.toString(W.BufferHelper.getBuffered(F))),this.state=R.IDLE,this.tick()},c._handleFragmentLoadComplete=function(v){var y=this.transmuxer;if(!y)return;var F=v.frag,B=v.part,A=v.partsLoaded,j=!A||A.length===0||A.some(function(b){return!b}),P=new g.ChunkMetadata(F.level,F.sn,F.stats.chunkCount+1,0,B?B.index:-1,!j);y.flush(P)},c._handleFragmentLoadProgress=function(v){},c._doFragLoad=function(v,y,F,B){var A=this;if(F===void 0&&(F=null),!this.levels)throw new Error("frag load aborted, missing levels");if(F=Math.max(v.start,F||0),this.config.lowLatencyMode&&y){var j=y.partList;if(j&&B){F>v.end&&y.fragmentHint&&(v=y.fragmentHint);var P=this.getNextPart(j,v,F);if(P>-1){var b=j[P];return this.log("Loading part sn: "+v.sn+" p: "+b.index+" cc: "+v.cc+" of playlist ["+y.startSN+"-"+y.endSN+"] parts [0-"+P+"-"+(j.length-1)+"] "+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+v.level+", target: "+parseFloat(F.toFixed(3))),this.nextLoadPosition=b.start+b.duration,this.state=R.FRAG_LOADING,this.hls.trigger(n.Events.FRAG_LOADING,{frag:v,part:j[P],targetBufferTime:F}),this.doFragPartsLoad(v,j,P,B).catch(function(V){return A.handleFragLoadError(V)})}else if(!v.url||this.loadedEndOfParts(j,F))return Promise.resolve(null)}}return this.log("Loading fragment "+v.sn+" cc: "+v.cc+" "+(y?"of ["+y.startSN+"-"+y.endSN+"] ":"")+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+v.level+", target: "+parseFloat(F.toFixed(3))),Object(z.isFiniteNumber)(v.sn)&&!this.bitrateTest&&(this.nextLoadPosition=v.start+v.duration),this.state=R.FRAG_LOADING,this.hls.trigger(n.Events.FRAG_LOADING,{frag:v,targetBufferTime:F}),this.fragmentLoader.load(v,B).catch(function(V){return A.handleFragLoadError(V)})},c.doFragPartsLoad=function(v,y,F,B){var A=this;return new Promise(function(j,P){var b=[],V=function re(ce){var me=y[ce];A.fragmentLoader.loadPart(v,me,B).then(function(De){b[me.index]=De;var we=De.part;A.hls.trigger(n.Events.FRAG_LOADED,De);var Le=y[ce+1];if(Le&&Le.fragment===v)re(ce+1);else return j({frag:v,part:we,partsLoaded:b})}).catch(P)};V(F)})},c.handleFragLoadError=function(v){var y=v.data;return y&&y.details===I.ErrorDetails.INTERNAL_ABORTED?this.handleFragLoadAborted(y.frag,y.part):this.hls.trigger(n.Events.ERROR,y),null},c._handleTransmuxerFlush=function(v){var y=this.getCurrentContext(v);if(!y||this.state!==R.PARSING){this.fragCurrent||(this.state=R.IDLE);return}var F=y.frag,B=y.part,A=y.level,j=self.performance.now();F.stats.parsing.end=j,B&&(B.stats.parsing.end=j),this.updateLevelTiming(F,B,A,v.partial)},c.getCurrentContext=function(v){var y=this.levels,F=v.level,B=v.sn,A=v.part;if(!y||!y[F])return this.warn("Levels object was unset while buffering fragment "+B+" of level "+F+". The current chunk will not be buffered."),null;var j=y[F],P=A>-1?Object(o.getPartWith)(j,B,A):null,b=P?P.fragment:Object(o.getFragmentWithSN)(j,B,this.fragCurrent);return b?{frag:b,part:P,level:j}:null},c.bufferFragmentData=function(v,y,F,B){if(!v||this.state!==R.PARSING)return;var A=v.data1,j=v.data2,P=A;if(A&&j&&(P=Object(f.appendUint8Array)(A,j)),!P||!P.length)return;var b={type:v.type,frag:y,part:F,chunkMeta:B,parent:y.type,data:P};this.hls.trigger(n.Events.BUFFER_APPENDING,b),v.dropped&&v.independent&&!F&&this.flushBufferGap(y)},c.flushBufferGap=function(v){var y=this.media;if(!y)return;if(!W.BufferHelper.isBuffered(y,y.currentTime)){this.flushMainBuffer(0,v.start);return}var F=y.currentTime,B=W.BufferHelper.bufferInfo(y,F,0),A=v.duration,j=Math.min(this.config.maxFragLookUpTolerance*2,A*.25),P=Math.max(Math.min(v.start-j,B.end-j),F+j);v.start-P>j&&this.flushMainBuffer(P,v.start)},c.getFwdBufferInfo=function(v,y){var F=this.config,B=this.getLoadPosition();if(!Object(z.isFiniteNumber)(B))return null;var A=W.BufferHelper.bufferInfo(v,B,F.maxBufferHole);if(A.len===0&&A.nextStart!==void 0){var j=this.fragmentTracker.getBufferedFrag(B,y);if(j&&A.nextStart<j.end)return W.BufferHelper.bufferInfo(v,B,Math.max(A.nextStart,F.maxBufferHole))}return A},c.getMaxBufferLength=function(v){var y=this.config,F;return v?F=Math.max(8*y.maxBufferSize/v,y.maxBufferLength):F=y.maxBufferLength,Math.min(F,y.maxMaxBufferLength)},c.reduceMaxBufferLength=function(v){var y=this.config,F=v||y.maxBufferLength;return y.maxMaxBufferLength>=F?(y.maxMaxBufferLength/=2,this.warn("Reduce max buffer length to "+y.maxMaxBufferLength+"s"),!0):!1},c.getNextFragment=function(v,y){var F,B,A=y.fragments,j=A.length;if(!j)return null;var P=this.config,b=A[0].start,V;if(y.live){var re=P.initialLiveManifestSize;if(j<re)return this.warn("Not enough fragments to start playback (have: "+j+", need: "+re+")"),null;!y.PTSKnown&&!this.startFragRequested&&this.startPosition===-1&&(V=this.getInitialLiveFragment(y,A),this.startPosition=V?this.hls.liveSyncPosition||V.start:v)}else v<=b&&(V=A[0]);if(!V){var ce=P.lowLatencyMode?y.partEnd:y.fragmentEnd;V=this.getFragmentAtPosition(v,ce,y)}return(F=V)!==null&&F!==void 0&&F.initSegment&&!((B=V)!==null&&B!==void 0&&B.initSegment.data)&&!this.bitrateTest&&(V=V.initSegment),V},c.getNextPart=function(v,y,F){for(var B=-1,A=!1,j=!0,P=0,b=v.length;P<b;P++){var V=v[P];if(j=j&&!V.independent,B>-1&&F<V.start)break;var re=V.loaded;!re&&(A||V.independent||j)&&V.fragment===y&&(B=P),A=re}return B},c.loadedEndOfParts=function(v,y){var F=v[v.length-1];return F&&y>F.start&&F.loaded},c.getInitialLiveFragment=function(v,y){var F=this.fragPrevious,B=null;if(F){if(v.hasProgramDateTime&&(this.log("Live playlist, switching playlist, load frag with same PDT: "+F.programDateTime),B=Object(h.findFragmentByPDT)(y,F.endProgramDateTime,this.config.maxFragLookUpTolerance)),!B){var A=F.sn+1;if(A>=v.startSN&&A<=v.endSN){var j=y[A-v.startSN];F.cc===j.cc&&(B=j,this.log("Live playlist, switching playlist, load frag with next SN: "+B.sn))}B||(B=Object(h.findFragWithCC)(y,F.cc),B&&this.log("Live playlist, switching playlist, load frag with same CC: "+B.sn))}}else{var P=this.hls.liveSyncPosition;P!==null&&(B=this.getFragmentAtPosition(P,this.bitrateTest?v.fragmentEnd:v.edge,v))}return B},c.getFragmentAtPosition=function(v,y,F){var B=this.config,A=this.fragPrevious,j=F.fragments,P=F.endSN,b=F.fragmentHint,V=B.maxFragLookUpTolerance,re=!!(B.lowLatencyMode&&F.partList&&b);re&&b&&!this.bitrateTest&&(j=j.concat(b),P=b.sn);var ce;if(v<y){var me=v>y-V?0:V;ce=Object(h.findFragmentByPTS)(A,j,v,me)}else ce=j[j.length-1];if(ce){var De=ce.sn-F.startSN,we=A&&ce.level===A.level,Le=j[De+1],Re=this.fragmentTracker.getState(ce);if(Re===L.FragmentState.BACKTRACKED){ce=null;for(var Ie=De;j[Ie]&&this.fragmentTracker.getState(j[Ie])===L.FragmentState.BACKTRACKED;)A?ce=j[Ie--]:ce=j[--Ie];ce||(ce=Le)}else A&&ce.sn===A.sn&&!re&&(we&&(ce.sn<P&&this.fragmentTracker.getState(Le)!==L.FragmentState.OK?(this.log("SN "+ce.sn+" just loaded, load next one: "+Le.sn),ce=Le):ce=null))}return ce},c.synchronizeToLiveEdge=function(v){var y=this.config,F=this.media;if(!F)return;var B=this.hls.liveSyncPosition,A=F.currentTime,j=v.fragments[0].start,P=v.edge,b=A>=j-y.maxFragLookUpTolerance&&A<=P;if(B!==null&&F.duration>B&&(A<B||!b)){var V=y.liveMaxLatencyDuration!==void 0?y.liveMaxLatencyDuration:y.liveMaxLatencyDurationCount*v.targetduration;(!b&&F.readyState<4||A<P-V)&&(this.loadedmetadata||(this.nextLoadPosition=B),F.readyState&&(this.warn("Playback: "+A.toFixed(3)+" is located too far from the end of live sliding playlist: "+P+", reset currentTime to : "+B.toFixed(3)),F.currentTime=B))}},c.alignPlaylists=function(v,y){var F=this.levels,B=this.levelLastLoaded,A=this.fragPrevious,j=B!==null?F[B]:null,P=v.fragments.length;if(!P)return this.warn("No fragments in live playlist"),0;var b=v.fragments[0].start,V=!y,re=v.alignedSliding&&Object(z.isFiniteNumber)(b);if(V||!re&&!b){Object(m.alignStream)(A,j,v);var ce=v.fragments[0].start;return this.log("Live playlist sliding: "+ce.toFixed(2)+" start-sn: "+(y?y.startSN:"na")+"->"+v.startSN+" prev-sn: "+(A?A.sn:"na")+" fragments: "+P),ce}return b},c.waitForCdnTuneIn=function(v){var y=3;return v.live&&v.canBlockReload&&v.tuneInGoal>Math.max(v.partHoldBack,v.partTarget*y)},c.setStartPosition=function(v,y){var F=this.startPosition;if(F<y&&(F=-1),F===-1||this.lastCurrentTime===-1){var B=v.startTimeOffset;Object(z.isFiniteNumber)(B)?(F=y+B,B<0&&(F+=v.totalduration),F=Math.min(Math.max(y,F),y+v.totalduration),this.log("Start time offset "+B+" found in playlist, adjust startPosition to "+F),this.startPosition=F):v.live?F=this.hls.liveSyncPosition||y:this.startPosition=F=0,this.lastCurrentTime=F}this.nextLoadPosition=F},c.getLoadPosition=function(){var v=this.media,y=0;return this.loadedmetadata&&v?y=v.currentTime:this.nextLoadPosition&&(y=this.nextLoadPosition),y},c.handleFragLoadAborted=function(v,y){this.transmuxer&&v.sn!=="initSegment"&&v.stats.aborted&&(this.warn("Fragment "+v.sn+(y?" part"+y.index:"")+" of level "+v.level+" was aborted"),this.resetFragmentLoading(v))},c.resetFragmentLoading=function(v){(!this.fragCurrent||!this.fragContextChanged(v))&&(this.state=R.IDLE)},c.onFragmentOrKeyLoadError=function(v,y){if(y.fatal)return;var F=y.frag;if(!F||F.type!==v)return;var B=this.fragCurrent;console.assert(B&&F.sn===B.sn&&F.level===B.level&&F.urlId===B.urlId,"Frag load error must match current frag to retry");var A=this.config;if(this.fragLoadError+1<=A.fragLoadingMaxRetry){if(this.resetLiveStartWhenNotLoaded(F.level))return;var j=Math.min(Math.pow(2,this.fragLoadError)*A.fragLoadingRetryDelay,A.fragLoadingMaxRetryTimeout);this.warn("Fragment "+F.sn+" of "+v+" "+F.level+" failed to load, retrying in "+j+"ms"),this.retryDate=self.performance.now()+j,this.fragLoadError++,this.state=R.FRAG_LOADING_WAITING_RETRY}else y.levelRetry?(v===a.PlaylistLevelType.AUDIO&&(this.fragCurrent=null),this.fragLoadError=0,this.state=R.IDLE):(H.logger.error(y.details+" reaches max retry, redispatch as fatal ..."),y.fatal=!0,this.hls.stopLoad(),this.state=R.ERROR)},c.afterBufferFlushed=function(v,y,F){if(!v)return;var B=W.BufferHelper.getBuffered(v);this.fragmentTracker.detectEvictedFragments(y,B,F),this.state===R.ENDED&&this.resetLoadingState()},c.resetLoadingState=function(){this.fragCurrent=null,this.fragPrevious=null,this.state=R.IDLE},c.resetLiveStartWhenNotLoaded=function(v){if(!this.loadedmetadata){this.startFragRequested=!1;var y=this.levels?this.levels[v].details:null;if(y!=null&&y.live)return this.startPosition=-1,this.setStartPosition(y,0),this.resetLoadingState(),!0;this.nextLoadPosition=this.startPosition}return!1},c.updateLevelTiming=function(v,y,F,B){var A=this,j=F.details;console.assert(!!j,"level.details must be defined");var P=Object.keys(v.elementaryStreams).reduce(function(b,V){var re=v.elementaryStreams[V];if(re){var ce=re.endPTS-re.startPTS;if(ce<=0)return A.warn("Could not parse fragment "+v.sn+" "+V+" duration reliably ("+ce+") resetting transmuxer to fallback to playlist timing"),A.resetTransmuxer(),b||!1;var me=B?0:Object(o.updateFragPTSDTS)(j,v,re.startPTS,re.endPTS,re.startDTS,re.endDTS);return A.hls.trigger(n.Events.LEVEL_PTS_UPDATED,{details:j,level:F,drift:me,type:V,frag:v,start:re.startPTS,end:re.endPTS}),!0}return b},!1);P?(this.state=R.PARSED,this.hls.trigger(n.Events.FRAG_PARSED,{frag:v,part:y})):this.resetLoadingState()},c.resetTransmuxer=function(){this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null)},C(E,[{key:"state",get:function(){return this._state},set:function(v){var y=this._state;y!==v&&(this._state=v,this.log(y+"->"+v))}}]),E}(U.default)},"./src/controller/buffer-controller.ts":function(oe,$,k){"use strict";k.r($),k.d($,"default",function(){return h});var z=k("./src/polyfills/number.ts"),U=k("./src/events.ts"),L=k("./src/utils/logger.ts"),W=k("./src/errors.ts"),H=k("./src/utils/buffer-helper.ts"),n=k("./src/utils/mediasource-helper.ts"),I=k("./src/loader/fragment.ts"),g=k("./src/controller/buffer-operation-queue.ts"),f=Object(n.getMediaSource)(),m=/([ha]vc.)(?:\.[^.,]+)+/,h=function(){function o(l){var u=this;this.details=null,this._objectUrl=null,this.operationQueue=void 0,this.listeners=void 0,this.hls=void 0,this.bufferCodecEventsExpected=0,this._bufferCodecEventsTotal=0,this.media=null,this.mediaSource=null,this.appendError=0,this.tracks={},this.pendingTracks={},this.sourceBuffer=void 0,this._onMediaSourceOpen=function(){var a=u.hls,s=u.media,C=u.mediaSource;L.logger.log("[buffer-controller]: Media source opened"),s&&(u.updateMediaElementDuration(),a.trigger(U.Events.MEDIA_ATTACHED,{media:s})),C&&C.removeEventListener("sourceopen",u._onMediaSourceOpen),u.checkPendingTracks()},this._onMediaSourceClose=function(){L.logger.log("[buffer-controller]: Media source closed")},this._onMediaSourceEnded=function(){L.logger.log("[buffer-controller]: Media source ended")},this.hls=l,this._initSourceBuffer(),this.registerListeners()}var p=o.prototype;return p.hasSourceTypes=function(){return this.getSourceBufferTypes().length>0||Object.keys(this.pendingTracks).length>0},p.destroy=function(){this.unregisterListeners(),this.details=null},p.registerListeners=function(){var u=this.hls;u.on(U.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),u.on(U.Events.MEDIA_DETACHING,this.onMediaDetaching,this),u.on(U.Events.MANIFEST_PARSED,this.onManifestParsed,this),u.on(U.Events.BUFFER_RESET,this.onBufferReset,this),u.on(U.Events.BUFFER_APPENDING,this.onBufferAppending,this),u.on(U.Events.BUFFER_CODECS,this.onBufferCodecs,this),u.on(U.Events.BUFFER_EOS,this.onBufferEos,this),u.on(U.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),u.on(U.Events.LEVEL_UPDATED,this.onLevelUpdated,this),u.on(U.Events.FRAG_PARSED,this.onFragParsed,this),u.on(U.Events.FRAG_CHANGED,this.onFragChanged,this)},p.unregisterListeners=function(){var u=this.hls;u.off(U.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),u.off(U.Events.MEDIA_DETACHING,this.onMediaDetaching,this),u.off(U.Events.MANIFEST_PARSED,this.onManifestParsed,this),u.off(U.Events.BUFFER_RESET,this.onBufferReset,this),u.off(U.Events.BUFFER_APPENDING,this.onBufferAppending,this),u.off(U.Events.BUFFER_CODECS,this.onBufferCodecs,this),u.off(U.Events.BUFFER_EOS,this.onBufferEos,this),u.off(U.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),u.off(U.Events.LEVEL_UPDATED,this.onLevelUpdated,this),u.off(U.Events.FRAG_PARSED,this.onFragParsed,this),u.off(U.Events.FRAG_CHANGED,this.onFragChanged,this)},p._initSourceBuffer=function(){this.sourceBuffer={},this.operationQueue=new g.default(this.sourceBuffer),this.listeners={audio:[],video:[],audiovideo:[]}},p.onManifestParsed=function(u,a){var s=2;(a.audio&&!a.video||!a.altAudio)&&(s=1),this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=s,this.details=null,L.logger.log(this.bufferCodecEventsExpected+" bufferCodec event(s) expected")},p.onMediaAttaching=function(u,a){var s=this.media=a.media;if(s&&f){var C=this.mediaSource=new f;C.addEventListener("sourceopen",this._onMediaSourceOpen),C.addEventListener("sourceended",this._onMediaSourceEnded),C.addEventListener("sourceclose",this._onMediaSourceClose),s.src=self.URL.createObjectURL(C),this._objectUrl=s.src}},p.onMediaDetaching=function(){var u=this.media,a=this.mediaSource,s=this._objectUrl;if(a){if(L.logger.log("[buffer-controller]: media source detaching"),a.readyState==="open")try{a.endOfStream()}catch(C){L.logger.warn("[buffer-controller]: onMediaDetaching: "+C.message+" while calling endOfStream")}this.onBufferReset(),a.removeEventListener("sourceopen",this._onMediaSourceOpen),a.removeEventListener("sourceended",this._onMediaSourceEnded),a.removeEventListener("sourceclose",this._onMediaSourceClose),u&&(s&&self.URL.revokeObjectURL(s),u.src===s?(u.removeAttribute("src"),u.load()):L.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(U.Events.MEDIA_DETACHED,void 0)},p.onBufferReset=function(){var u=this;this.getSourceBufferTypes().forEach(function(a){var s=u.sourceBuffer[a];try{s&&(u.removeBufferListeners(a),u.mediaSource&&u.mediaSource.removeSourceBuffer(s),u.sourceBuffer[a]=void 0)}catch(C){L.logger.warn("[buffer-controller]: Failed to reset the "+a+" buffer",C)}}),this._initSourceBuffer()},p.onBufferCodecs=function(u,a){var s=this,C=this.getSourceBufferTypes().length;if(Object.keys(a).forEach(function(_){if(C){var w=s.tracks[_];if(w&&typeof w.buffer.changeType=="function"){var O=a[_],R=O.codec,S=O.levelCodec,T=O.container,E=(w.levelCodec||w.codec).replace(m,"$1"),c=(S||R).replace(m,"$1");if(E!==c){var x=T+";codecs="+(S||R);s.appendChangeType(_,x)}}}else s.pendingTracks[_]=a[_]}),C)return;this.bufferCodecEventsExpected=Math.max(this.bufferCodecEventsExpected-1,0),this.mediaSource&&this.mediaSource.readyState==="open"&&this.checkPendingTracks()},p.appendChangeType=function(u,a){var s=this,C=this.operationQueue,_={execute:function(){var O=s.sourceBuffer[u];O&&(L.logger.log("[buffer-controller]: changing "+u+" sourceBuffer type to "+a),O.changeType(a)),C.shiftAndExecuteNext(u)},onStart:function(){},onComplete:function(){},onError:function(O){L.logger.warn("[buffer-controller]: Failed to change "+u+" SourceBuffer type",O)}};C.append(_,u)},p.onBufferAppending=function(u,a){var s=this,C=this.hls,_=this.operationQueue,w=this.tracks,O=a.data,R=a.type,S=a.frag,T=a.part,E=a.chunkMeta,c=E.buffering[R],x=self.performance.now();c.start=x;var v=S.stats.buffering,y=T?T.stats.buffering:null;v.start===0&&(v.start=x),y&&y.start===0&&(y.start=x);var F=w.audio,B=R==="audio"&&E.id===1&&(F==null?void 0:F.container)==="audio/mpeg",A={execute:function(){if(c.executeStart=self.performance.now(),B){var P=s.sourceBuffer[R];if(P){var b=S.start-P.timestampOffset;Math.abs(b)>=.1&&(L.logger.log("[buffer-controller]: Updating audio SourceBuffer timestampOffset to "+S.start+" (delta: "+b+") sn: "+S.sn+")"),P.timestampOffset=S.start)}}s.appendExecutor(O,R)},onStart:function(){},onComplete:function(){var P=self.performance.now();c.executeEnd=c.end=P,v.first===0&&(v.first=P),y&&y.first===0&&(y.first=P);var b=s.sourceBuffer,V={};for(var re in b)V[re]=H.BufferHelper.getBuffered(b[re]);s.appendError=0,s.hls.trigger(U.Events.BUFFER_APPENDED,{type:R,frag:S,part:T,chunkMeta:E,parent:S.type,timeRanges:V})},onError:function(P){L.logger.error("[buffer-controller]: Error encountered while trying to append to the "+R+" SourceBuffer",P);var b={type:W.ErrorTypes.MEDIA_ERROR,parent:S.type,details:W.ErrorDetails.BUFFER_APPEND_ERROR,err:P,fatal:!1};P.code===DOMException.QUOTA_EXCEEDED_ERR?b.details=W.ErrorDetails.BUFFER_FULL_ERROR:(s.appendError++,b.details=W.ErrorDetails.BUFFER_APPEND_ERROR,s.appendError>C.config.appendErrorMaxRetry&&(L.logger.error("[buffer-controller]: Failed "+C.config.appendErrorMaxRetry+" times to append segment in sourceBuffer"),b.fatal=!0)),C.trigger(U.Events.ERROR,b)}};_.append(A,R)},p.onBufferFlushing=function(u,a){var s=this,C=this.operationQueue,_=function(O){return{execute:s.removeExecutor.bind(s,O,a.startOffset,a.endOffset),onStart:function(){},onComplete:function(){s.hls.trigger(U.Events.BUFFER_FLUSHED,{type:O})},onError:function(S){L.logger.warn("[buffer-controller]: Failed to remove from "+O+" SourceBuffer",S)}}};a.type?C.append(_(a.type),a.type):this.getSourceBufferTypes().forEach(function(w){C.append(_(w),w)})},p.onFragParsed=function(u,a){var s=this,C=a.frag,_=a.part,w=[],O=_?_.elementaryStreams:C.elementaryStreams;O[I.ElementaryStreamTypes.AUDIOVIDEO]?w.push("audiovideo"):(O[I.ElementaryStreamTypes.AUDIO]&&w.push("audio"),O[I.ElementaryStreamTypes.VIDEO]&&w.push("video"));var R=function(){var T=self.performance.now();C.stats.buffering.end=T,_&&(_.stats.buffering.end=T);var E=_?_.stats:C.stats;s.hls.trigger(U.Events.FRAG_BUFFERED,{frag:C,part:_,stats:E,id:C.type})};w.length===0&&L.logger.warn("Fragments must have at least one ElementaryStreamType set. type: "+C.type+" level: "+C.level+" sn: "+C.sn),this.blockBuffers(R,w)},p.onFragChanged=function(u,a){this.flushBackBuffer()},p.onBufferEos=function(u,a){var s=this,C=this.getSourceBufferTypes().reduce(function(_,w){var O=s.sourceBuffer[w];return(!a.type||a.type===w)&&(O&&!O.ended&&(O.ended=!0,L.logger.log("[buffer-controller]: "+w+" sourceBuffer now EOS"))),_&&!!(!O||O.ended)},!0);C&&this.blockBuffers(function(){var _=s.mediaSource;if(!_||_.readyState!=="open")return;_.endOfStream()})},p.onLevelUpdated=function(u,a){var s=a.details;if(!s.fragments.length)return;this.details=s,this.getSourceBufferTypes().length?this.blockBuffers(this.updateMediaElementDuration.bind(this)):this.updateMediaElementDuration()},p.flushBackBuffer=function(){var u=this.hls,a=this.details,s=this.media,C=this.sourceBuffer;if(!s||a===null)return;var _=this.getSourceBufferTypes();if(!_.length)return;var w=a.live&&u.config.liveBackBufferLength!==null?u.config.liveBackBufferLength:u.config.backBufferLength;if(!Object(z.isFiniteNumber)(w)||w<0)return;var O=s.currentTime,R=a.levelTargetDuration,S=Math.max(w,R),T=Math.floor(O/R)*R-S;_.forEach(function(E){var c=C[E];if(c){var x=H.BufferHelper.getBuffered(c);x.length>0&&T>x.start(0)&&(u.trigger(U.Events.BACK_BUFFER_REACHED,{bufferEnd:T}),a.live&&u.trigger(U.Events.LIVE_BACK_BUFFER_REACHED,{bufferEnd:T}),u.trigger(U.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:T,type:E}))}})},p.updateMediaElementDuration=function(){if(!this.details||!this.media||!this.mediaSource||this.mediaSource.readyState!=="open")return;var u=this.details,a=this.hls,s=this.media,C=this.mediaSource,_=u.fragments[0].start+u.totalduration,w=s.duration,O=Object(z.isFiniteNumber)(C.duration)?C.duration:0;u.live&&a.config.liveDurationInfinity?(L.logger.log("[buffer-controller]: Media Source duration is set to Infinity"),C.duration=Infinity,this.updateSeekableRange(u)):(_>O&&_>w||!Object(z.isFiniteNumber)(w))&&(L.logger.log("[buffer-controller]: Updating Media Source duration to "+_.toFixed(3)),C.duration=_)},p.updateSeekableRange=function(u){var a=this.mediaSource,s=u.fragments,C=s.length;if(C&&u.live&&a!==null&&a!==void 0&&a.setLiveSeekableRange){var _=Math.max(0,s[0].start),w=Math.max(_,_+u.totalduration);a.setLiveSeekableRange(_,w)}},p.checkPendingTracks=function(){var u=this.bufferCodecEventsExpected,a=this.operationQueue,s=this.pendingTracks,C=Object.keys(s).length;if(C&&!u||C===2){this.createSourceBuffers(s),this.pendingTracks={};var _=this.getSourceBufferTypes();if(_.length===0){this.hls.trigger(U.Events.ERROR,{type:W.ErrorTypes.MEDIA_ERROR,details:W.ErrorDetails.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,reason:"could not create source buffer for media codec(s)"});return}_.forEach(function(w){a.executeNext(w)})}},p.createSourceBuffers=function(u){var a=this.sourceBuffer,s=this.mediaSource;if(!s)throw Error("createSourceBuffers called when mediaSource was null");var C=0;for(var _ in u)if(!a[_]){var w=u[_];if(!w)throw Error("source buffer exists for track "+_+", however track does not");var O=w.levelCodec||w.codec,R=w.container+";codecs="+O;L.logger.log("[buffer-controller]: creating sourceBuffer("+R+")");try{var S=a[_]=s.addSourceBuffer(R),T=_;this.addBufferListener(T,"updatestart",this._onSBUpdateStart),this.addBufferListener(T,"updateend",this._onSBUpdateEnd),this.addBufferListener(T,"error",this._onSBUpdateError),this.tracks[_]={buffer:S,codec:O,container:w.container,levelCodec:w.levelCodec,id:w.id},C++}catch(E){L.logger.error("[buffer-controller]: error while trying to add sourceBuffer: "+E.message),this.hls.trigger(U.Events.ERROR,{type:W.ErrorTypes.MEDIA_ERROR,details:W.ErrorDetails.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:E,mimeType:R})}}C&&this.hls.trigger(U.Events.BUFFER_CREATED,{tracks:this.tracks})},p._onSBUpdateStart=function(u){var a=this.operationQueue,s=a.current(u);s.onStart()},p._onSBUpdateEnd=function(u){var a=this.operationQueue,s=a.current(u);s.onComplete(),a.shiftAndExecuteNext(u)},p._onSBUpdateError=function(u,a){L.logger.error("[buffer-controller]: "+u+" SourceBuffer error",a),this.hls.trigger(U.Events.ERROR,{type:W.ErrorTypes.MEDIA_ERROR,details:W.ErrorDetails.BUFFER_APPENDING_ERROR,fatal:!1});var s=this.operationQueue.current(u);s&&s.onError(a)},p.removeExecutor=function(u,a,s){var C=this.media,_=this.mediaSource,w=this.operationQueue,O=this.sourceBuffer,R=O[u];if(!C||!_||!R){L.logger.warn("[buffer-controller]: Attempting to remove from the "+u+" SourceBuffer, but it does not exist"),w.shiftAndExecuteNext(u);return}var S=Object(z.isFiniteNumber)(C.duration)?C.duration:Infinity,T=Object(z.isFiniteNumber)(_.duration)?_.duration:Infinity,E=Math.max(0,a),c=Math.min(s,S,T);c>E?(L.logger.log("[buffer-controller]: Removing ["+E+","+c+"] from the "+u+" SourceBuffer"),console.assert(!R.updating,u+" sourceBuffer must not be updating"),R.remove(E,c)):w.shiftAndExecuteNext(u)},p.appendExecutor=function(u,a){var s=this.operationQueue,C=this.sourceBuffer,_=C[a];if(!_){L.logger.warn("[buffer-controller]: Attempting to append to the "+a+" SourceBuffer, but it does not exist"),s.shiftAndExecuteNext(a);return}_.ended=!1,console.assert(!_.updating,a+" sourceBuffer must not be updating"),_.appendBuffer(u)},p.blockBuffers=function(u,a){var s=this;if(a===void 0&&(a=this.getSourceBufferTypes()),!a.length){L.logger.log("[buffer-controller]: Blocking operation requested, but no SourceBuffers exist"),Promise.resolve(u);return}var C=this.operationQueue,_=a.map(function(w){return C.appendBlocker(w)});Promise.all(_).then(function(){u(),a.forEach(function(w){var O=s.sourceBuffer[w];(!O||!O.updating)&&C.shiftAndExecuteNext(w)})})},p.getSourceBufferTypes=function(){return Object.keys(this.sourceBuffer)},p.addBufferListener=function(u,a,s){var C=this.sourceBuffer[u];if(!C)return;var _=s.bind(this,u);this.listeners[u].push({event:a,listener:_}),C.addEventListener(a,_)},p.removeBufferListeners=function(u){var a=this.sourceBuffer[u];if(!a)return;this.listeners[u].forEach(function(s){a.removeEventListener(s.event,s.listener)})},o}()},"./src/controller/buffer-operation-queue.ts":function(oe,$,k){"use strict";k.r($),k.d($,"default",function(){return U});var z=k("./src/utils/logger.ts"),U=function(){function L(H){this.buffers=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.buffers=H}var W=L.prototype;return W.append=function(n,I){var g=this.queues[I];g.push(n),g.length===1&&this.buffers[I]&&this.executeNext(I)},W.insertAbort=function(n,I){var g=this.queues[I];g.unshift(n),this.executeNext(I)},W.appendBlocker=function(n){var I,g=new Promise(function(m){I=m}),f={execute:I,onStart:function(){},onComplete:function(){},onError:function(){}};return this.append(f,n),g},W.executeNext=function(n){var I=this.buffers,g=this.queues,f=I[n],m=g[n];if(m.length){var h=m[0];try{h.execute()}catch(o){z.logger.warn("[buffer-operation-queue]: Unhandled exception executing the current operation"),h.onError(o),(!f||!f.updating)&&(m.shift(),this.executeNext(n))}}},W.shiftAndExecuteNext=function(n){this.queues[n].shift(),this.executeNext(n)},W.current=function(n){return this.queues[n][0]},L}()},"./src/controller/cap-level-controller.ts":function(oe,$,k){"use strict";k.r($);var z=k("./src/events.ts");function U(H,n){for(var I=0;I<n.length;I++){var g=n[I];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(H,g.key,g)}}function L(H,n,I){return n&&U(H.prototype,n),I&&U(H,I),H}var W=function(){function H(I){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=I,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.firstLevel=-1,this.media=null,this.restrictedLevels=[],this.timer=void 0,this.clientRect=null,this.registerListeners()}var n=H.prototype;return n.setStreamController=function(g){this.streamController=g},n.destroy=function(){this.unregisterListener(),this.hls.config.capLevelToPlayerSize&&this.stopCapping(),this.media=null,this.clientRect=null,this.hls=this.streamController=null},n.registerListeners=function(){var g=this.hls;g.on(z.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),g.on(z.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),g.on(z.Events.MANIFEST_PARSED,this.onManifestParsed,this),g.on(z.Events.BUFFER_CODECS,this.onBufferCodecs,this),g.on(z.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},n.unregisterListener=function(){var g=this.hls;g.off(z.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),g.off(z.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),g.off(z.Events.MANIFEST_PARSED,this.onManifestParsed,this),g.off(z.Events.BUFFER_CODECS,this.onBufferCodecs,this),g.off(z.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},n.onFpsDropLevelCapping=function(g,f){H.isLevelAllowed(f.droppedLevel,this.restrictedLevels)&&this.restrictedLevels.push(f.droppedLevel)},n.onMediaAttaching=function(g,f){this.media=f.media instanceof HTMLVideoElement?f.media:null},n.onManifestParsed=function(g,f){var m=this.hls;this.restrictedLevels=[],this.firstLevel=f.firstLevel,m.config.capLevelToPlayerSize&&f.video&&this.startCapping()},n.onBufferCodecs=function(g,f){var m=this.hls;m.config.capLevelToPlayerSize&&f.video&&this.startCapping()},n.onMediaDetaching=function(){this.stopCapping()},n.detectPlayerSize=function(){if(this.media&&this.mediaHeight>0&&this.mediaWidth>0){var g=this.hls.levels;if(g.length){var f=this.hls;f.autoLevelCapping=this.getMaxLevel(g.length-1),f.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=f.autoLevelCapping}}},n.getMaxLevel=function(g){var f=this,m=this.hls.levels;if(!m.length)return-1;var h=m.filter(function(o,p){return H.isLevelAllowed(p,f.restrictedLevels)&&p<=g});return this.clientRect=null,H.getMaxLevelByMediaSize(h,this.mediaWidth,this.mediaHeight)},n.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()},n.stopCapping=function(){this.restrictedLevels=[],this.firstLevel=-1,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.timer&&(self.clearInterval(this.timer),this.timer=void 0)},n.getDimensions=function(){if(this.clientRect)return this.clientRect;var g=this.media,f={width:0,height:0};if(g){var m=g.getBoundingClientRect();f.width=m.width,f.height=m.height,!f.width&&!f.height&&(f.width=m.right-m.left||g.width||0,f.height=m.bottom-m.top||g.height||0)}return this.clientRect=f,f},H.isLevelAllowed=function(g,f){return f===void 0&&(f=[]),f.indexOf(g)===-1},H.getMaxLevelByMediaSize=function(g,f,m){if(!g||!g.length)return-1;for(var h=function(a,s){return s?a.width!==s.width||a.height!==s.height:!0},o=g.length-1,p=0;p<g.length;p+=1){var l=g[p];if((l.width>=f||l.height>=m)&&h(l,g[p+1])){o=p;break}}return o},L(H,[{key:"mediaWidth",get:function(){return this.getDimensions().width*H.contentScaleFactor}},{key:"mediaHeight",get:function(){return this.getDimensions().height*H.contentScaleFactor}}],[{key:"contentScaleFactor",get:function(){var g=1;try{g=self.devicePixelRatio}catch(f){}return g}}]),H}();$.default=W},"./src/controller/cmcd-controller.ts":function(oe,$,k){"use strict";k.r($),k.d($,"default",function(){return h});var z=k("./src/events.ts"),U=k("./src/types/cmcd.ts"),L=k("./src/utils/buffer-helper.ts"),W=k("./src/utils/logger.ts");function H(o,p){for(var l=0;l<p.length;l++){var u=p[l];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(o,u.key,u)}}function n(o,p,l){return p&&H(o.prototype,p),l&&H(o,l),o}function I(o,p){var l=typeof Symbol!="undefined"&&o[Symbol.iterator]||o["@@iterator"];if(l)return(l=l.call(o)).next.bind(l);if(Array.isArray(o)||(l=g(o))||p&&o&&typeof o.length=="number"){l&&(o=l);var u=0;return function(){return u>=o.length?{done:!0}:{done:!1,value:o[u++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function g(o,p){if(!o)return;if(typeof o=="string")return f(o,p);var l=Object.prototype.toString.call(o).slice(8,-1);if(l==="Object"&&o.constructor&&(l=o.constructor.name),l==="Map"||l==="Set")return Array.from(o);if(l==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(l))return f(o,p)}function f(o,p){(p==null||p>o.length)&&(p=o.length);for(var l=0,u=new Array(p);l<p;l++)u[l]=o[l];return u}function m(){return m=Object.assign||function(o){for(var p=1;p<arguments.length;p++){var l=arguments[p];for(var u in l)Object.prototype.hasOwnProperty.call(l,u)&&(o[u]=l[u])}return o},m.apply(this,arguments)}var h=function(){function o(l){var u=this;this.hls=void 0,this.config=void 0,this.media=void 0,this.sid=void 0,this.cid=void 0,this.useHeaders=!1,this.initialized=!1,this.starved=!1,this.buffering=!0,this.audioBuffer=void 0,this.videoBuffer=void 0,this.onWaiting=function(){u.initialized&&(u.starved=!0),u.buffering=!0},this.onPlaying=function(){u.initialized||(u.initialized=!0),u.buffering=!1},this.applyPlaylistData=function(C){try{u.apply(C,{ot:U.CMCDObjectType.MANIFEST,su:!u.initialized})}catch(_){W.logger.warn("Could not generate manifest CMCD data.",_)}},this.applyFragmentData=function(C){try{var _=C.frag,w=u.hls.levels[_.level],O=u.getObjectType(_),R={d:_.duration*1e3,ot:O};(O===U.CMCDObjectType.VIDEO||O===U.CMCDObjectType.AUDIO||O==U.CMCDObjectType.MUXED)&&(R.br=w.bitrate/1e3,R.tb=u.getTopBandwidth(O),R.bl=u.getBufferLength(O)),u.apply(C,R)}catch(S){W.logger.warn("Could not generate segment CMCD data.",S)}},this.hls=l;var a=this.config=l.config,s=a.cmcd;s!=null&&(a.pLoader=this.createPlaylistLoader(),a.fLoader=this.createFragmentLoader(),this.sid=s.sessionId||o.uuid(),this.cid=s.contentId,this.useHeaders=s.useHeaders===!0,this.registerListeners())}var p=o.prototype;return p.registerListeners=function(){var u=this.hls;u.on(z.Events.MEDIA_ATTACHED,this.onMediaAttached,this),u.on(z.Events.MEDIA_DETACHED,this.onMediaDetached,this),u.on(z.Events.BUFFER_CREATED,this.onBufferCreated,this)},p.unregisterListeners=function(){var u=this.hls;u.off(z.Events.MEDIA_ATTACHED,this.onMediaAttached,this),u.off(z.Events.MEDIA_DETACHED,this.onMediaDetached,this),u.off(z.Events.BUFFER_CREATED,this.onBufferCreated,this),this.onMediaDetached()},p.destroy=function(){this.unregisterListeners(),this.hls=this.config=this.audioBuffer=this.videoBuffer=null},p.onMediaAttached=function(u,a){this.media=a.media,this.media.addEventListener("waiting",this.onWaiting),this.media.addEventListener("playing",this.onPlaying)},p.onMediaDetached=function(){if(!this.media)return;this.media.removeEventListener("waiting",this.onWaiting),this.media.removeEventListener("playing",this.onPlaying),this.media=null},p.onBufferCreated=function(u,a){var s,C;this.audioBuffer=(s=a.tracks.audio)===null||s===void 0?void 0:s.buffer,this.videoBuffer=(C=a.tracks.video)===null||C===void 0?void 0:C.buffer},p.createData=function(){var u;return{v:U.CMCDVersion,sf:U.CMCDStreamingFormat.HLS,sid:this.sid,cid:this.cid,pr:(u=this.media)===null||u===void 0?void 0:u.playbackRate,mtp:this.hls.bandwidthEstimate/1e3}},p.apply=function(u,a){a===void 0&&(a={}),m(a,this.createData());var s=a.ot===U.CMCDObjectType.INIT||a.ot===U.CMCDObjectType.VIDEO||a.ot===U.CMCDObjectType.MUXED;if(this.starved&&s&&(a.bs=!0,a.su=!0,this.starved=!1),a.su==null&&(a.su=this.buffering),this.useHeaders){var C=o.toHeaders(a);if(!Object.keys(C).length)return;u.headers||(u.headers={}),m(u.headers,C)}else{var _=o.toQuery(a);if(!_)return;u.url=o.appendQueryToUri(u.url,_)}},p.getObjectType=function(u){var a=u.type;return a==="subtitle"?U.CMCDObjectType.TIMED_TEXT:u.sn==="initSegment"?U.CMCDObjectType.INIT:a==="audio"?U.CMCDObjectType.AUDIO:a==="main"?this.hls.audioTracks.length?U.CMCDObjectType.VIDEO:U.CMCDObjectType.MUXED:void 0},p.getTopBandwidth=function(u){for(var a=0,s=u===U.CMCDObjectType.AUDIO?this.hls.audioTracks:this.hls.levels,C=I(s),_;!(_=C()).done;){var w=_.value;w.bitrate>a&&(a=w.bitrate)}return a>0?a:NaN},p.getBufferLength=function(u){var a=this.hls.media,s=u===U.CMCDObjectType.AUDIO?this.audioBuffer:this.videoBuffer;if(!s||!a)return NaN;var C=L.BufferHelper.bufferInfo(s,a.currentTime,this.config.maxBufferHole);return C.len*1e3},p.createPlaylistLoader=function(){var u=this.config.pLoader,a=this.applyPlaylistData,s=u||this.config.loader;return function(){function C(w){this.loader=void 0,this.loader=new s(w)}var _=C.prototype;return _.destroy=function(){this.loader.destroy()},_.abort=function(){this.loader.abort()},_.load=function(O,R,S){a(O),this.loader.load(O,R,S)},n(C,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),C}()},p.createFragmentLoader=function(){var u=this.config.fLoader,a=this.applyFragmentData,s=u||this.config.loader;return function(){function C(w){this.loader=void 0,this.loader=new s(w)}var _=C.prototype;return _.destroy=function(){this.loader.destroy()},_.abort=function(){this.loader.abort()},_.load=function(O,R,S){a(O),this.loader.load(O,R,S)},n(C,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),C}()},o.uuid=function(){var u=URL.createObjectURL(new Blob),a=u.toString();return URL.revokeObjectURL(u),a.substr(a.lastIndexOf("/")+1)},o.serialize=function(u){for(var a=[],s=function(B){return!Number.isNaN(B)&&B!=null&&B!==""&&B!==!1},C=function(B){return Math.round(B)},_=function(B){return C(B/100)*100},w=function(B){return encodeURIComponent(B)},O={br:C,d:C,bl:_,dl:_,mtp:_,nor:w,rtp:_,tb:C},R=Object.keys(u||{}).sort(),S=I(R),T;!(T=S()).done;){var E=T.value,c=u[E];if(!s(c))continue;if(E==="v"&&c===1)continue;if(E=="pr"&&c===1)continue;var x=O[E];x&&(c=x(c));var v=typeof c,y=void 0;E==="ot"||E==="sf"||E==="st"?y=E+"="+c:v==="boolean"?y=E:v==="number"?y=E+"="+c:y=E+"="+JSON.stringify(c),a.push(y)}return a.join(",")},o.toHeaders=function(u){for(var a=Object.keys(u),s={},C=["Object","Request","Session","Status"],_=[{},{},{},{}],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},O=0,R=a;O<R.length;O++){var S=R[O],T=w[S]!=null?w[S]:1;_[T][S]=u[S]}for(var E=0;E<_.length;E++){var c=o.serialize(_[E]);c&&(s["CMCD-"+C[E]]=c)}return s},o.toQuery=function(u){return"CMCD="+encodeURIComponent(o.serialize(u))},o.appendQueryToUri=function(u,a){if(!a)return u;var s=u.includes("?")?"&":"?";return""+u+s+a},o}()},"./src/controller/eme-controller.ts":function(oe,$,k){"use strict";k.r($);var z=k("./src/events.ts"),U=k("./src/errors.ts"),L=k("./src/utils/logger.ts"),W=k("./src/utils/mediakeys-helper.ts");function H(h,o){for(var p=0;p<o.length;p++){var l=o[p];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(h,l.key,l)}}function n(h,o,p){return o&&H(h.prototype,o),p&&H(h,p),h}var I=3,g=function(o,p,l){var u={audioCapabilities:[],videoCapabilities:[]};return o.forEach(function(a){u.audioCapabilities.push({contentType:'audio/mp4; codecs="'+a+'"',robustness:l.audioRobustness||""})}),p.forEach(function(a){u.videoCapabilities.push({contentType:'video/mp4; codecs="'+a+'"',robustness:l.videoRobustness||""})}),[u]},f=function(o,p,l,u){switch(o){case W.KeySystems.WIDEVINE:return g(p,l,u);default:throw new Error("Unknown key-system: "+o)}},m=function(){function h(p){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=p,this._config=p.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 o=h.prototype;return o.destroy=function(){this._unregisterListeners(),this.hls=this._onMediaEncrypted=null,this._requestMediaKeySystemAccess=null},o._registerListeners=function(){this.hls.on(z.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(z.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.on(z.Events.MANIFEST_PARSED,this.onManifestParsed,this)},o._unregisterListeners=function(){this.hls.off(z.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(z.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.off(z.Events.MANIFEST_PARSED,this.onManifestParsed,this)},o.getLicenseServerUrl=function(l){switch(l){case W.KeySystems.WIDEVINE:if(!this._widevineLicenseUrl)break;return this._widevineLicenseUrl}throw new Error('no license server URL configured for key-system "'+l+'"')},o._attemptKeySystemAccess=function(l,u,a){var s=this,C=f(l,u,a,this._drmSystemOptions);L.logger.log("Requesting encrypted media key-system access");var _=this.requestMediaKeySystemAccess(l,C);this.mediaKeysPromise=_.then(function(w){return s._onMediaKeySystemAccessObtained(l,w)}),_.catch(function(w){L.logger.error('Failed to obtain key-system "'+l+'" access:',w)})},o._onMediaKeySystemAccessObtained=function(l,u){var a=this;L.logger.log('Access for key-system "'+l+'" obtained');var s={mediaKeysSessionInitialized:!1,mediaKeySystemAccess:u,mediaKeySystemDomain:l};this._mediaKeysList.push(s);var C=Promise.resolve().then(function(){return u.createMediaKeys()}).then(function(_){return s.mediaKeys=_,L.logger.log('Media-keys created for key-system "'+l+'"'),a._onMediaKeysCreated(),_});return C.catch(function(_){L.logger.error("Failed to create media-keys:",_)}),C},o._onMediaKeysCreated=function(){var l=this;this._mediaKeysList.forEach(function(u){u.mediaKeysSession||(u.mediaKeysSession=u.mediaKeys.createSession(),l._onNewMediaKeySession(u.mediaKeysSession))})},o._onNewMediaKeySession=function(l){var u=this;L.logger.log("New key-system session "+l.sessionId),l.addEventListener("message",function(a){u._onKeySessionMessage(l,a.message)},!1)},o._onKeySessionMessage=function(l,u){L.logger.log("Got EME message event, creating license request"),this._requestLicense(u,function(a){L.logger.log("Received license data (length: "+(a&&a.byteLength)+"), updating key-session"),l.update(a)})},o.onMediaEncrypted=function(l){var u=this;if(L.logger.log('Media is encrypted using "'+l.initDataType+'" init data type'),!this.mediaKeysPromise){L.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been requested"),this.hls.trigger(z.Events.ERROR,{type:U.ErrorTypes.KEY_SYSTEM_ERROR,details:U.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}var a=function(C){if(!u._media)return;u._attemptSetMediaKeys(C),u._generateRequestWithPreferredKeySession(l.initDataType,l.initData)};this.mediaKeysPromise.then(a).catch(a)},o._attemptSetMediaKeys=function(l){if(!this._media)throw new Error("Attempted to set mediaKeys without first attaching a media element");if(!this._hasSetMediaKeys){var u=this._mediaKeysList[0];if(!u||!u.mediaKeys){L.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been obtained yet"),this.hls.trigger(z.Events.ERROR,{type:U.ErrorTypes.KEY_SYSTEM_ERROR,details:U.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}L.logger.log("Setting keys for encrypted media"),this._media.setMediaKeys(u.mediaKeys),this._hasSetMediaKeys=!0}},o._generateRequestWithPreferredKeySession=function(l,u){var a=this,s=this._mediaKeysList[0];if(!s){L.logger.error("Fatal: Media is encrypted but not any key-system access has been obtained yet"),this.hls.trigger(z.Events.ERROR,{type:U.ErrorTypes.KEY_SYSTEM_ERROR,details:U.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}if(s.mediaKeysSessionInitialized){L.logger.warn("Key-Session already initialized but requested again");return}var C=s.mediaKeysSession;if(!C){L.logger.error("Fatal: Media is encrypted but no key-session existing"),this.hls.trigger(z.Events.ERROR,{type:U.ErrorTypes.KEY_SYSTEM_ERROR,details:U.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!0});return}if(!u){L.logger.warn("Fatal: initData required for generating a key session is null"),this.hls.trigger(z.Events.ERROR,{type:U.ErrorTypes.KEY_SYSTEM_ERROR,details:U.ErrorDetails.KEY_SYSTEM_NO_INIT_DATA,fatal:!0});return}L.logger.log('Generating key-session request for "'+l+'" init data type'),s.mediaKeysSessionInitialized=!0,C.generateRequest(l,u).then(function(){L.logger.debug("Key-session generation succeeded")}).catch(function(_){L.logger.error("Error generating key-session request:",_),a.hls.trigger(z.Events.ERROR,{type:U.ErrorTypes.KEY_SYSTEM_ERROR,details:U.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!1})})},o._createLicenseXhr=function(l,u,a){var s=new XMLHttpRequest;s.responseType="arraybuffer",s.onreadystatechange=this._onLicenseRequestReadyStageChange.bind(this,s,l,u,a);var C=this._licenseXhrSetup;if(C)try{C.call(this.hls,s,l),C=void 0}catch(_){L.logger.error(_)}try{s.readyState||s.open("POST",l,!0),C&&C.call(this.hls,s,l)}catch(_){throw new Error("issue setting up KeySystem license XHR "+_)}return s},o._onLicenseRequestReadyStageChange=function(l,u,a,s){switch(l.readyState){case 4:if(l.status===200){this._requestLicenseFailureCount=0,L.logger.log("License request succeeded");var C=l.response,_=this._licenseResponseCallback;if(_)try{C=_.call(this.hls,l,u)}catch(O){L.logger.error(O)}s(C)}else{if(L.logger.error("License Request XHR failed ("+u+"). Status: "+l.status+" ("+l.statusText+")"),this._requestLicenseFailureCount++,this._requestLicenseFailureCount>I){this.hls.trigger(z.Events.ERROR,{type:U.ErrorTypes.KEY_SYSTEM_ERROR,details:U.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0});return}var w=I-this._requestLicenseFailureCount+1;L.logger.warn("Retrying license request, "+w+" attempts left"),this._requestLicense(a,s)}break}},o._generateLicenseRequestChallenge=function(l,u){switch(l.mediaKeySystemDomain){case W.KeySystems.WIDEVINE:return u}throw new Error("unsupported key-system: "+l.mediaKeySystemDomain)},o._requestLicense=function(l,u){L.logger.log("Requesting content license for key-system");var a=this._mediaKeysList[0];if(!a){L.logger.error("Fatal error: Media is encrypted but no key-system access has been obtained yet"),this.hls.trigger(z.Events.ERROR,{type:U.ErrorTypes.KEY_SYSTEM_ERROR,details:U.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}try{var s=this.getLicenseServerUrl(a.mediaKeySystemDomain),C=this._createLicenseXhr(s,l,u);L.logger.log("Sending license request to URL: "+s);var _=this._generateLicenseRequestChallenge(a,l);C.send(_)}catch(w){L.logger.error("Failure requesting DRM license: "+w),this.hls.trigger(z.Events.ERROR,{type:U.ErrorTypes.KEY_SYSTEM_ERROR,details:U.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0})}},o.onMediaAttached=function(l,u){if(!this._emeEnabled)return;var a=u.media;this._media=a,a.addEventListener("encrypted",this._onMediaEncrypted)},o.onMediaDetached=function(){var l=this._media,u=this._mediaKeysList;if(!l)return;l.removeEventListener("encrypted",this._onMediaEncrypted),this._media=null,this._mediaKeysList=[],Promise.all(u.map(function(a){if(a.mediaKeysSession)return a.mediaKeysSession.close().catch(function(){})})).then(function(){return l.setMediaKeys(null)}).catch(function(){})},o.onManifestParsed=function(l,u){if(!this._emeEnabled)return;var a=u.levels.map(function(C){return C.audioCodec}).filter(function(C){return!!C}),s=u.levels.map(function(C){return C.videoCodec}).filter(function(C){return!!C});this._attemptKeySystemAccess(W.KeySystems.WIDEVINE,a,s)},n(h,[{key:"requestMediaKeySystemAccess",get:function(){if(!this._requestMediaKeySystemAccess)throw new Error("No requestMediaKeySystemAccess function configured");return this._requestMediaKeySystemAccess}}]),h}();$.default=m},"./src/controller/fps-controller.ts":function(oe,$,k){"use strict";k.r($);var z=k("./src/events.ts"),U=k("./src/utils/logger.ts"),L=function(){function W(n){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=n,this.registerListeners()}var H=W.prototype;return H.setStreamController=function(I){this.streamController=I},H.registerListeners=function(){this.hls.on(z.Events.MEDIA_ATTACHING,this.onMediaAttaching,this)},H.unregisterListeners=function(){this.hls.off(z.Events.MEDIA_ATTACHING,this.onMediaAttaching)},H.destroy=function(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null},H.onMediaAttaching=function(I,g){var f=this.hls.config;if(f.capLevelOnFPSDrop){var m=g.media instanceof self.HTMLVideoElement?g.media:null;this.media=m,m&&typeof m.getVideoPlaybackQuality=="function"&&(this.isVideoPlaybackQualityAvailable=!0),self.clearInterval(this.timer),this.timer=self.setInterval(this.checkFPSInterval.bind(this),f.fpsDroppedMonitoringPeriod)}},H.checkFPS=function(I,g,f){var m=performance.now();if(g){if(this.lastTime){var h=m-this.lastTime,o=f-this.lastDroppedFrames,p=g-this.lastDecodedFrames,l=1e3*o/h,u=this.hls;if(u.trigger(z.Events.FPS_DROP,{currentDropped:o,currentDecoded:p,totalDroppedFrames:f}),l>0&&o>u.config.fpsDroppedMonitoringThreshold*p){var a=u.currentLevel;U.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+a),a>0&&(u.autoLevelCapping===-1||u.autoLevelCapping>=a)&&(a=a-1,u.trigger(z.Events.FPS_DROP_LEVEL_CAPPING,{level:a,droppedLevel:u.currentLevel}),u.autoLevelCapping=a,this.streamController.nextLevelSwitch())}}this.lastTime=m,this.lastDroppedFrames=f,this.lastDecodedFrames=g}},H.checkFPSInterval=function(){var I=this.media;if(I)if(this.isVideoPlaybackQualityAvailable){var g=I.getVideoPlaybackQuality();this.checkFPS(I,g.totalVideoFrames,g.droppedVideoFrames)}else this.checkFPS(I,I.webkitDecodedFrameCount,I.webkitDroppedFrameCount)},W}();$.default=L},"./src/controller/fragment-finders.ts":function(oe,$,k){"use strict";k.r($),k.d($,"findFragmentByPDT",function(){return L}),k.d($,"findFragmentByPTS",function(){return W}),k.d($,"fragmentWithinToleranceTest",function(){return H}),k.d($,"pdtWithinToleranceTest",function(){return n}),k.d($,"findFragWithCC",function(){return I});var z=k("./src/polyfills/number.ts"),U=k("./src/utils/binary-search.ts");function L(g,f,m){if(f===null||!Array.isArray(g)||!g.length||!Object(z.isFiniteNumber)(f))return null;var h=g[0].programDateTime;if(f<(h||0))return null;var o=g[g.length-1].endProgramDateTime;if(f>=(o||0))return null;m=m||0;for(var p=0;p<g.length;++p){var l=g[p];if(n(f,m,l))return l}return null}function W(g,f,m,h){m===void 0&&(m=0),h===void 0&&(h=0);var o=null;if(g?o=f[g.sn-f[0].sn+1]||null:m===0&&f[0].start===0&&(o=f[0]),o&&H(m,h,o)===0)return o;var p=U.default.search(f,H.bind(null,m,h));return p||o}function H(g,f,m){g===void 0&&(g=0),f===void 0&&(f=0);var h=Math.min(f,m.duration+(m.deltaPTS?m.deltaPTS:0));return m.start+m.duration-h<=g?1:m.start-h>g&&m.start?-1:0}function n(g,f,m){var h=Math.min(f,m.duration+(m.deltaPTS?m.deltaPTS:0))*1e3,o=m.endProgramDateTime||0;return o-h>g}function I(g,f){return U.default.search(g,function(m){return m.cc<f?1:m.cc>f?-1:0})}},"./src/controller/fragment-tracker.ts":function(oe,$,k){"use strict";k.r($),k.d($,"FragmentState",function(){return L}),k.d($,"FragmentTracker",function(){return W});var z=k("./src/events.ts"),U=k("./src/types/loader.ts"),L;(function(I){I.NOT_LOADED="NOT_LOADED",I.BACKTRACKED="BACKTRACKED",I.APPENDING="APPENDING",I.PARTIAL="PARTIAL",I.OK="OK"})(L||(L={}));var W=function(){function I(f){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=f,this._registerListeners()}var g=I.prototype;return g._registerListeners=function(){var m=this.hls;m.on(z.Events.BUFFER_APPENDED,this.onBufferAppended,this),m.on(z.Events.FRAG_BUFFERED,this.onFragBuffered,this),m.on(z.Events.FRAG_LOADED,this.onFragLoaded,this)},g._unregisterListeners=function(){var m=this.hls;m.off(z.Events.BUFFER_APPENDED,this.onBufferAppended,this),m.off(z.Events.FRAG_BUFFERED,this.onFragBuffered,this),m.off(z.Events.FRAG_LOADED,this.onFragLoaded,this)},g.destroy=function(){this._unregisterListeners(),this.fragments=this.timeRanges=null},g.getAppendedFrag=function(m,h){if(h===U.PlaylistLevelType.MAIN){var o=this.activeFragment,p=this.activeParts;if(!o)return null;if(p)for(var l=p.length;l--;){var u=p[l],a=u?u.end:o.appendedPTS;if(u.start<=m&&a!==void 0&&m<=a)return l>9&&(this.activeParts=p.slice(l-9)),u}else if(o.start<=m&&o.appendedPTS!==void 0&&m<=o.appendedPTS)return o}return this.getBufferedFrag(m,h)},g.getBufferedFrag=function(m,h){for(var o=this.fragments,p=Object.keys(o),l=p.length;l--;){var u=o[p[l]];if((u==null?void 0:u.body.type)===h&&u.buffered){var a=u.body;if(a.start<=m&&m<=a.end)return a}}return null},g.detectEvictedFragments=function(m,h,o){var p=this;Object.keys(this.fragments).forEach(function(l){var u=p.fragments[l];if(!u)return;if(!u.buffered){u.body.type===o&&p.removeFragment(u.body);return}var a=u.range[m];if(!a)return;a.time.some(function(s){var C=!p.isTimeBuffered(s.startPTS,s.endPTS,h);return C&&p.removeFragment(u.body),C})})},g.detectPartialFragments=function(m){var h=this,o=this.timeRanges,p=m.frag,l=m.part;if(!o||p.sn==="initSegment")return;var u=n(p),a=this.fragments[u];if(!a)return;Object.keys(o).forEach(function(s){var C=p.elementaryStreams[s];if(!C)return;var _=o[s],w=l!==null||C.partial===!0;a.range[s]=h.getBufferedTimes(p,l,w,_)}),a.backtrack=a.loaded=null,Object.keys(a.range).length?a.buffered=!0:this.removeFragment(a.body)},g.fragBuffered=function(m){var h=n(m),o=this.fragments[h];o&&(o.backtrack=o.loaded=null,o.buffered=!0)},g.getBufferedTimes=function(m,h,o,p){for(var l={time:[],partial:o},u=h?h.start:m.start,a=h?h.end:m.end,s=m.minEndPTS||a,C=m.maxStartPTS||u,_=0;_<p.length;_++){var w=p.start(_)-this.bufferPadding,O=p.end(_)+this.bufferPadding;if(C>=w&&s<=O){l.time.push({startPTS:Math.max(u,p.start(_)),endPTS:Math.min(a,p.end(_))});break}else if(u<O&&a>w)l.partial=!0,l.time.push({startPTS:Math.max(u,p.start(_)),endPTS:Math.min(a,p.end(_))});else if(a<=w)break}return l},g.getPartialFragment=function(m){var h=null,o,p,l,u=0,a=this.bufferPadding,s=this.fragments;return Object.keys(s).forEach(function(C){var _=s[C];if(!_)return;H(_)&&(p=_.body.start-a,l=_.body.end+a,m>=p&&m<=l&&(o=Math.min(m-p,l-m),u<=o&&(h=_.body,u=o)))}),h},g.getState=function(m){var h=n(m),o=this.fragments[h];return o?o.buffered?H(o)?L.PARTIAL:L.OK:o.backtrack?L.BACKTRACKED:L.APPENDING:L.NOT_LOADED},g.backtrack=function(m,h){var o=n(m),p=this.fragments[o];if(!p||p.backtrack)return null;var l=p.backtrack=h||p.loaded;return p.loaded=null,l},g.getBacktrackData=function(m){var h=n(m),o=this.fragments[h];if(o){var p,l=o.backtrack;if(l!=null&&(p=l.payload)!==null&&p!==void 0&&p.byteLength)return l;this.removeFragment(m)}return null},g.isTimeBuffered=function(m,h,o){for(var p,l,u=0;u<o.length;u++){if(p=o.start(u)-this.bufferPadding,l=o.end(u)+this.bufferPadding,m>=p&&h<=l)return!0;if(h<=p)return!1}return!1},g.onFragLoaded=function(m,h){var o=h.frag,p=h.part;if(o.sn==="initSegment"||o.bitrateTest||p)return;var l=n(o);this.fragments[l]={body:o,loaded:h,backtrack:null,buffered:!1,range:Object.create(null)}},g.onBufferAppended=function(m,h){var o=this,p=h.frag,l=h.part,u=h.timeRanges;if(p.type===U.PlaylistLevelType.MAIN)if(this.activeFragment=p,l){var a=this.activeParts;a||(this.activeParts=a=[]),a.push(l)}else this.activeParts=null;this.timeRanges=u,Object.keys(u).forEach(function(s){var C=u[s];if(o.detectEvictedFragments(s,C),!l)for(var _=0;_<C.length;_++)p.appendedPTS=Math.max(C.end(_),p.appendedPTS||0)})},g.onFragBuffered=function(m,h){this.detectPartialFragments(h)},g.hasFragment=function(m){var h=n(m);return!!this.fragments[h]},g.removeFragmentsInRange=function(m,h,o){var p=this;Object.keys(this.fragments).forEach(function(l){var u=p.fragments[l];if(!u)return;if(u.buffered){var a=u.body;a.type===o&&a.start<h&&a.end>m&&p.removeFragment(a)}})},g.removeFragment=function(m){var h=n(m);m.stats.loaded=0,m.clearElementaryStreamInfo(),delete this.fragments[h]},g.removeAllFragments=function(){this.fragments=Object.create(null),this.activeFragment=null,this.activeParts=null},I}();function H(I){var g,f;return I.buffered&&(((g=I.range.video)===null||g===void 0?void 0:g.partial)||((f=I.range.audio)===null||f===void 0?void 0:f.partial))}function n(I){return I.type+"_"+I.level+"_"+I.urlId+"_"+I.sn}},"./src/controller/gap-controller.ts":function(oe,$,k){"use strict";k.r($),k.d($,"STALL_MINIMUM_DURATION_MS",function(){return H}),k.d($,"MAX_START_GAP_JUMP",function(){return n}),k.d($,"SKIP_BUFFER_HOLE_STEP_SECONDS",function(){return I}),k.d($,"SKIP_BUFFER_RANGE_START",function(){return g}),k.d($,"default",function(){return f});var z=k("./src/utils/buffer-helper.ts"),U=k("./src/errors.ts"),L=k("./src/events.ts"),W=k("./src/utils/logger.ts"),H=250,n=2,I=.1,g=.05,f=function(){function m(o,p,l,u){this.config=void 0,this.media=void 0,this.fragmentTracker=void 0,this.hls=void 0,this.nudgeRetry=0,this.stallReported=!1,this.stalled=null,this.moved=!1,this.seeking=!1,this.config=o,this.media=p,this.fragmentTracker=l,this.hls=u}var h=m.prototype;return h.destroy=function(){this.hls=this.fragmentTracker=this.media=null},h.poll=function(p){var l=this.config,u=this.media,a=this.stalled,s=u.currentTime,C=u.seeking,_=this.seeking&&!C,w=!this.seeking&&C;if(this.seeking=C,s!==p){if(this.moved=!0,a!==null){if(this.stallReported){var O=self.performance.now()-a;W.logger.warn("playback not stuck anymore @"+s+", after "+Math.round(O)+"ms"),this.stallReported=!1}this.stalled=null,this.nudgeRetry=0}return}if((w||_)&&(this.stalled=null),u.paused||u.ended||u.playbackRate===0||!z.BufferHelper.getBuffered(u).length)return;var R=z.BufferHelper.bufferInfo(u,s,0),S=R.len>0,T=R.nextStart||0;if(!S&&!T)return;if(C){var E=R.len>n,c=!T||T-s>n&&!this.fragmentTracker.getPartialFragment(s);if(E||c)return;this.moved=!1}if(!this.moved&&this.stalled!==null){var x,v=Math.max(T,R.start||0)-s,y=this.hls.levels?this.hls.levels[this.hls.currentLevel]:null,F=y==null||((x=y.details)===null||x===void 0)?void 0:x.live,B=F?y.details.targetduration*2:n;if(v>0&&v<=B){this._trySkipBufferHole(null);return}}var A=self.performance.now();if(a===null){this.stalled=A;return}var j=A-a;!C&&j>=H&&this._reportStall(R.len);var P=z.BufferHelper.bufferInfo(u,s,l.maxBufferHole);this._tryFixBufferStall(P,j)},h._tryFixBufferStall=function(p,l){var u=this.config,a=this.fragmentTracker,s=this.media,C=s.currentTime,_=a.getPartialFragment(C);if(_){var w=this._trySkipBufferHole(_);if(w)return}p.len>u.maxBufferHole&&l>u.highBufferWatchdogPeriod*1e3&&(W.logger.warn("Trying to nudge playhead over buffer-hole"),this.stalled=null,this._tryNudgeBuffer())},h._reportStall=function(p){var l=this.hls,u=this.media,a=this.stallReported;a||(this.stallReported=!0,W.logger.warn("Playback stalling at @"+u.currentTime+" due to low buffer (buffer="+p+")"),l.trigger(L.Events.ERROR,{type:U.ErrorTypes.MEDIA_ERROR,details:U.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!1,buffer:p}))},h._trySkipBufferHole=function(p){for(var l=this.config,u=this.hls,a=this.media,s=a.currentTime,C=0,_=z.BufferHelper.getBuffered(a),w=0;w<_.length;w++){var O=_.start(w);if(s+l.maxBufferHole>=C&&s<O){var R=Math.max(O+g,a.currentTime+I);return W.logger.warn("skipping hole, adjusting currentTime from "+s+" to "+R),this.moved=!0,this.stalled=null,a.currentTime=R,p&&u.trigger(L.Events.ERROR,{type:U.ErrorTypes.MEDIA_ERROR,details:U.ErrorDetails.BUFFER_SEEK_OVER_HOLE,fatal:!1,reason:"fragment loaded with buffer holes, seeking from "+s+" to "+R,frag:p}),R}C=_.end(w)}return 0},h._tryNudgeBuffer=function(){var p=this.config,l=this.hls,u=this.media,a=u.currentTime,s=(this.nudgeRetry||0)+1;if(this.nudgeRetry=s,s<p.nudgeMaxRetry){var C=a+s*p.nudgeOffset;W.logger.warn("Nudging 'currentTime' from "+a+" to "+C),u.currentTime=C,l.trigger(L.Events.ERROR,{type:U.ErrorTypes.MEDIA_ERROR,details:U.ErrorDetails.BUFFER_NUDGE_ON_STALL,fatal:!1})}else W.logger.error("Playhead still not moving while enough data buffered @"+a+" after "+p.nudgeMaxRetry+" nudges"),l.trigger(L.Events.ERROR,{type:U.ErrorTypes.MEDIA_ERROR,details:U.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!0})},m}()},"./src/controller/id3-track-controller.ts":function(oe,$,k){"use strict";k.r($);var z=k("./src/events.ts"),U=k("./src/utils/texttrack-utils.ts"),L=k("./src/demux/id3.ts"),W=.25,H=function(){function n(g){this.hls=void 0,this.id3Track=null,this.media=null,this.hls=g,this._registerListeners()}var I=n.prototype;return I.destroy=function(){this._unregisterListeners()},I._registerListeners=function(){var f=this.hls;f.on(z.Events.MEDIA_ATTACHED,this.onMediaAttached,this),f.on(z.Events.MEDIA_DETACHING,this.onMediaDetaching,this),f.on(z.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),f.on(z.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},I._unregisterListeners=function(){var f=this.hls;f.off(z.Events.MEDIA_ATTACHED,this.onMediaAttached,this),f.off(z.Events.MEDIA_DETACHING,this.onMediaDetaching,this),f.off(z.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),f.off(z.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},I.onMediaAttached=function(f,m){this.media=m.media},I.onMediaDetaching=function(){if(!this.id3Track)return;Object(U.clearCurrentCues)(this.id3Track),this.id3Track=null,this.media=null},I.getID3Track=function(f){if(!this.media)return;for(var m=0;m<f.length;m++){var h=f[m];if(h.kind==="metadata"&&h.label==="id3")return Object(U.sendAddTrackEvent)(h,this.media),h}return this.media.addTextTrack("metadata","id3")},I.onFragParsingMetadata=function(f,m){if(!this.media)return;var h=m.frag,o=m.samples;this.id3Track||(this.id3Track=this.getID3Track(this.media.textTracks),this.id3Track.mode="hidden");for(var p=self.WebKitDataCue||self.VTTCue||self.TextTrackCue,l=0;l<o.length;l++){var u=L.getID3Frames(o[l].data);if(u){var a=o[l].pts,s=l<o.length-1?o[l+1].pts:h.end,C=s-a;C<=0&&(s=a+W);for(var _=0;_<u.length;_++){var w=u[_];if(!L.isTimeStampFrame(w)){var O=new p(a,s,"");O.value=w,this.id3Track.addCue(O)}}}}},I.onBufferFlushing=function(f,m){var h=m.startOffset,o=m.endOffset,p=m.type;if(!p||p==="audio"){var l=this.id3Track;l&&Object(U.removeCuesInRange)(l,h,o)}},n}();$.default=H},"./src/controller/latency-controller.ts":function(oe,$,k){"use strict";k.r($),k.d($,"default",function(){return n});var z=k("./src/errors.ts"),U=k("./src/events.ts"),L=k("./src/utils/logger.ts");function W(I,g){for(var f=0;f<g.length;f++){var m=g[f];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(I,m.key,m)}}function H(I,g,f){return g&&W(I.prototype,g),f&&W(I,f),I}var n=function(){function I(f){var m=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 m.timeupdate()},this.hls=f,this.config=f.config,this.registerListeners()}var g=I.prototype;return g.destroy=function(){this.unregisterListeners(),this.onMediaDetaching(),this.levelDetails=null,this.hls=this.timeupdateHandler=null},g.registerListeners=function(){this.hls.on(U.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(U.Events.MEDIA_DETACHING,this.onMediaDetaching,this),this.hls.on(U.Events.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(U.Events.LEVEL_UPDATED,this.onLevelUpdated,this),this.hls.on(U.Events.ERROR,this.onError,this)},g.unregisterListeners=function(){this.hls.off(U.Events.MEDIA_ATTACHED,this.onMediaAttached),this.hls.off(U.Events.MEDIA_DETACHING,this.onMediaDetaching),this.hls.off(U.Events.MANIFEST_LOADING,this.onManifestLoading),this.hls.off(U.Events.LEVEL_UPDATED,this.onLevelUpdated),this.hls.off(U.Events.ERROR,this.onError)},g.onMediaAttached=function(m,h){this.media=h.media,this.media.addEventListener("timeupdate",this.timeupdateHandler)},g.onMediaDetaching=function(){this.media&&(this.media.removeEventListener("timeupdate",this.timeupdateHandler),this.media=null)},g.onManifestLoading=function(){this.levelDetails=null,this._latency=null,this.stallCount=0},g.onLevelUpdated=function(m,h){var o=h.details;this.levelDetails=o,o.advanced&&this.timeupdate(),!o.live&&this.media&&this.media.removeEventListener("timeupdate",this.timeupdateHandler)},g.onError=function(m,h){if(h.details!==z.ErrorDetails.BUFFER_STALLED_ERROR)return;this.stallCount++,L.logger.warn("[playback-rate-controller]: Stall detected, adjusting target latency")},g.timeupdate=function(){var m=this.media,h=this.levelDetails;if(!m||!h)return;this.currentTime=m.currentTime;var o=this.computeLatency();if(o===null)return;this._latency=o;var p=this.config,l=p.lowLatencyMode,u=p.maxLiveSyncPlaybackRate;if(!l||u===1)return;var a=this.targetLatency;if(a===null)return;var s=o-a,C=Math.min(this.maxLatency,a+h.targetduration),_=s<C;if(h.live&&_&&s>.05&&this.forwardBufferLength>1){var w=Math.min(2,Math.max(1,u)),O=Math.round(2/(1+Math.exp(-.75*s-this.edgeStalled))*20)/20;m.playbackRate=Math.min(w,Math.max(1,O))}else m.playbackRate!==1&&m.playbackRate!==0&&(m.playbackRate=1)},g.estimateLiveEdge=function(){var m=this.levelDetails;return m===null?null:m.edge+m.age},g.computeLatency=function(){var m=this.estimateLiveEdge();return m===null?null:m-this.currentTime},H(I,[{key:"latency",get:function(){return this._latency||0}},{key:"maxLatency",get:function(){var m=this.config,h=this.levelDetails;return m.liveMaxLatencyDuration!==void 0?m.liveMaxLatencyDuration:h?m.liveMaxLatencyDurationCount*h.targetduration:0}},{key:"targetLatency",get:function(){var m=this.levelDetails;if(m===null)return null;var h=m.holdBack,o=m.partHoldBack,p=m.targetduration,l=this.config,u=l.liveSyncDuration,a=l.liveSyncDurationCount,s=l.lowLatencyMode,C=this.hls.userConfig,_=s&&o||h;(C.liveSyncDuration||C.liveSyncDurationCount||_===0)&&(_=u!==void 0?u:a*p);var w=p,O=1;return _+Math.min(this.stallCount*O,w)}},{key:"liveSyncPosition",get:function(){var m=this.estimateLiveEdge(),h=this.targetLatency,o=this.levelDetails;if(m===null||h===null||o===null)return null;var p=o.edge,l=m-h-this.edgeStalled,u=p-o.totalduration,a=p-(this.config.lowLatencyMode&&o.partTarget||o.targetduration);return Math.min(Math.max(u,l),a)}},{key:"drift",get:function(){var m=this.levelDetails;return m===null?1:m.drift}},{key:"edgeStalled",get:function(){var m=this.levelDetails;if(m===null)return 0;var h=(this.config.lowLatencyMode&&m.partTarget||m.targetduration)*3;return Math.max(m.age-h,0)}},{key:"forwardBufferLength",get:function(){var m=this.media,h=this.levelDetails;if(!m||!h)return 0;var o=m.buffered.length;return o?m.buffered.end(o-1):h.edge-this.currentTime}}]),I}()},"./src/controller/level-controller.ts":function(oe,$,k){"use strict";k.r($),k.d($,"default",function(){return l});var z=k("./src/types/level.ts"),U=k("./src/events.ts"),L=k("./src/errors.ts"),W=k("./src/utils/codecs.ts"),H=k("./src/controller/level-helper.ts"),n=k("./src/controller/base-playlist-controller.ts"),I=k("./src/types/loader.ts");function g(){return g=Object.assign||function(u){for(var a=1;a<arguments.length;a++){var s=arguments[a];for(var C in s)Object.prototype.hasOwnProperty.call(s,C)&&(u[C]=s[C])}return u},g.apply(this,arguments)}function f(u,a){for(var s=0;s<a.length;s++){var C=a[s];C.enumerable=C.enumerable||!1,C.configurable=!0,"value"in C&&(C.writable=!0),Object.defineProperty(u,C.key,C)}}function m(u,a,s){return a&&f(u.prototype,a),s&&f(u,s),u}function h(u,a){u.prototype=Object.create(a.prototype),u.prototype.constructor=u,o(u,a)}function o(u,a){return o=Object.setPrototypeOf||function(C,_){return C.__proto__=_,C},o(u,a)}var p=/chrome|firefox/.test(navigator.userAgent.toLowerCase()),l=function(u){h(a,u);function a(C){var _;return _=u.call(this,C,"[level-controller]")||this,_._levels=[],_._firstLevel=-1,_._startLevel=void 0,_.currentLevelIndex=-1,_.manualLevelIndex=-1,_.onParsedComplete=void 0,_._registerListeners(),_}var s=a.prototype;return s._registerListeners=function(){var _=this.hls;_.on(U.Events.MANIFEST_LOADED,this.onManifestLoaded,this),_.on(U.Events.LEVEL_LOADED,this.onLevelLoaded,this),_.on(U.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),_.on(U.Events.FRAG_LOADED,this.onFragLoaded,this),_.on(U.Events.ERROR,this.onError,this)},s._unregisterListeners=function(){var _=this.hls;_.off(U.Events.MANIFEST_LOADED,this.onManifestLoaded,this),_.off(U.Events.LEVEL_LOADED,this.onLevelLoaded,this),_.off(U.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),_.off(U.Events.FRAG_LOADED,this.onFragLoaded,this),_.off(U.Events.ERROR,this.onError,this)},s.destroy=function(){this._unregisterListeners(),this.manualLevelIndex=-1,this._levels.length=0,u.prototype.destroy.call(this)},s.startLoad=function(){var _=this._levels;_.forEach(function(w){w.loadError=0}),u.prototype.startLoad.call(this)},s.onManifestLoaded=function(_,w){var O=[],R=[],S=[],T,E={},c,x=!1,v=!1,y=!1;if(w.levels.forEach(function(j){var P=j.attrs;x=x||!!(j.width&&j.height),v=v||!!j.videoCodec,y=y||!!j.audioCodec,p&&j.audioCodec&&j.audioCodec.indexOf("mp4a.40.34")!==-1&&(j.audioCodec=void 0);var b=j.bitrate+"-"+j.attrs.RESOLUTION+"-"+j.attrs.CODECS;c=E[b],c?c.url.push(j.url):(c=new z.Level(j),E[b]=c,O.push(c)),P&&(P.AUDIO&&Object(H.addGroupId)(c,"audio",P.AUDIO),P.SUBTITLES&&Object(H.addGroupId)(c,"text",P.SUBTITLES))}),(x||v)&&y&&(O=O.filter(function(j){var P=j.videoCodec,b=j.width,V=j.height;return!!P||!!(b&&V)})),O=O.filter(function(j){var P=j.audioCodec,b=j.videoCodec;return(!P||Object(W.isCodecSupportedInMp4)(P,"audio"))&&(!b||Object(W.isCodecSupportedInMp4)(b,"video"))}),w.audioTracks&&(R=w.audioTracks.filter(function(j){return!j.audioCodec||Object(W.isCodecSupportedInMp4)(j.audioCodec,"audio")}),Object(H.assignTrackIdsByGroup)(R)),w.subtitles&&(S=w.subtitles,Object(H.assignTrackIdsByGroup)(S)),O.length>0){T=O[0].bitrate,O.sort(function(j,P){return j.bitrate-P.bitrate}),this._levels=O;for(var F=0;F<O.length;F++)if(O[F].bitrate===T){this._firstLevel=F,this.log("manifest loaded, "+O.length+" level(s) found, first bitrate: "+T);break}var B=y&&!v,A={levels:O,audioTracks:R,subtitleTracks:S,firstLevel:this._firstLevel,stats:w.stats,audio:y,video:v,altAudio:!B&&R.some(function(j){return!!j.url})};this.hls.trigger(U.Events.MANIFEST_PARSED,A),(this.hls.config.autoStartLoad||this.hls.forceStartLoad)&&this.hls.startLoad(this.hls.config.startPosition)}else this.hls.trigger(U.Events.ERROR,{type:L.ErrorTypes.MEDIA_ERROR,details:L.ErrorDetails.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:w.url,reason:"no level with compatible codecs found in manifest"})},s.onError=function(_,w){if(u.prototype.onError.call(this,_,w),w.fatal)return;var O=w.context,R=this._levels[this.currentLevelIndex];if(O&&(O.type===I.PlaylistContextType.AUDIO_TRACK&&R.audioGroupIds&&O.groupId===R.audioGroupIds[R.urlId]||O.type===I.PlaylistContextType.SUBTITLE_TRACK&&R.textGroupIds&&O.groupId===R.textGroupIds[R.urlId])){this.redundantFailover(this.currentLevelIndex);return}var S=!1,T=!0,E;switch(w.details){case L.ErrorDetails.FRAG_LOAD_ERROR:case L.ErrorDetails.FRAG_LOAD_TIMEOUT:case L.ErrorDetails.KEY_LOAD_ERROR:case L.ErrorDetails.KEY_LOAD_TIMEOUT:if(w.frag){var c=this._levels[w.frag.level];c?(c.fragmentError++,c.fragmentError>this.hls.config.fragLoadingMaxRetry&&(E=w.frag.level)):E=w.frag.level}break;case L.ErrorDetails.LEVEL_LOAD_ERROR:case L.ErrorDetails.LEVEL_LOAD_TIMEOUT:O&&(O.deliveryDirectives&&(T=!1),E=O.level),S=!0;break;case L.ErrorDetails.REMUX_ALLOC_ERROR:E=w.level,S=!0;break}E!==void 0&&this.recoverLevel(w,E,S,T)},s.recoverLevel=function(_,w,O,R){var S=_.details,T=this._levels[w];if(T.loadError++,O){var E=this.retryLoadingOrFail(_);if(E)_.levelRetry=!0;else{this.currentLevelIndex=-1;return}}if(R){var c=T.url.length;if(c>1&&T.loadError<c)_.levelRetry=!0,this.redundantFailover(w);else if(this.manualLevelIndex===-1){var x=w===0?this._levels.length-1:w-1;this.currentLevelIndex!==x&&this._levels[x].loadError===0&&(this.warn(S+": switch to "+x),_.levelRetry=!0,this.hls.nextAutoLevel=x)}}},s.redundantFailover=function(_){var w=this._levels[_],O=w.url.length;if(O>1){var R=(w.urlId+1)%O;this.warn("Switching to redundant URL-id "+R),this._levels.forEach(function(S){S.urlId=R}),this.level=_}},s.onFragLoaded=function(_,w){var O=w.frag;if(O!==void 0&&O.type===I.PlaylistLevelType.MAIN){var R=this._levels[O.level];R!==void 0&&(R.fragmentError=0,R.loadError=0)}},s.onLevelLoaded=function(_,w){var O,R=w.level,S=w.details,T=this._levels[R];if(!T){var E;this.warn("Invalid level index "+R),(E=w.deliveryDirectives)!==null&&E!==void 0&&E.skip&&(S.deltaUpdateFailed=!0);return}R===this.currentLevelIndex?(T.fragmentError===0&&(T.loadError=0,this.retryCount=0),this.playlistLoaded(R,w,T.details)):(O=w.deliveryDirectives)!==null&&O!==void 0&&O.skip&&(S.deltaUpdateFailed=!0)},s.onAudioTrackSwitched=function(_,w){var O=this.hls.levels[this.currentLevelIndex];if(!O)return;if(O.audioGroupIds){for(var R=-1,S=this.hls.audioTracks[w.id].groupId,T=0;T<O.audioGroupIds.length;T++)if(O.audioGroupIds[T]===S){R=T;break}R!==O.urlId&&(O.urlId=R,this.startLoad())}},s.loadPlaylist=function(_){var w=this.currentLevelIndex,O=this._levels[w];if(this.canLoad&&O&&O.url.length>0){var R=O.urlId,S=O.url[R];if(_)try{S=_.addDirectives(S)}catch(T){this.warn("Could not construct new URL with HLS Delivery Directives: "+T)}this.log("Attempt loading level index "+w+(_?" at sn "+_.msn+" part "+_.part:"")+" with URL-id "+R+" "+S),this.clearTimer(),this.hls.trigger(U.Events.LEVEL_LOADING,{url:S,level:w,id:R,deliveryDirectives:_||null})}},s.removeLevel=function(_,w){var O=function(T,E){return E!==w},R=this._levels.filter(function(S,T){return T!==_?!0:S.url.length>1&&w!==void 0?(S.url=S.url.filter(O),S.audioGroupIds&&(S.audioGroupIds=S.audioGroupIds.filter(O)),S.textGroupIds&&(S.textGroupIds=S.textGroupIds.filter(O)),S.urlId=0,!0):!1}).map(function(S,T){var E=S.details;return E!=null&&E.fragments&&E.fragments.forEach(function(c){c.level=T}),S});this._levels=R,this.hls.trigger(U.Events.LEVELS_UPDATED,{levels:R})},m(a,[{key:"levels",get:function(){return this._levels.length===0?null:this._levels}},{key:"level",get:function(){return this.currentLevelIndex},set:function(_){var w,O=this._levels;if(O.length===0)return;if(this.currentLevelIndex===_&&(w=O[_])!==null&&w!==void 0&&w.details)return;if(_<0||_>=O.length){var R=_<0;if(this.hls.trigger(U.Events.ERROR,{type:L.ErrorTypes.OTHER_ERROR,details:L.ErrorDetails.LEVEL_SWITCH_ERROR,level:_,fatal:R,reason:"invalid level idx"}),R)return;_=Math.min(_,O.length-1)}this.clearTimer();var S=this.currentLevelIndex,T=O[S],E=O[_];this.log("switching to level "+_+" from "+S),this.currentLevelIndex=_;var c=g({},E,{level:_,maxBitrate:E.maxBitrate,uri:E.uri,urlId:E.urlId});delete c._urlId,this.hls.trigger(U.Events.LEVEL_SWITCHING,c);var x=E.details;if(!x||x.live){var v=this.switchParams(E.uri,T==null?void 0:T.details);this.loadPlaylist(v)}}},{key:"manualLevel",get:function(){return this.manualLevelIndex},set:function(_){this.manualLevelIndex=_,this._startLevel===void 0&&(this._startLevel=_),_!==-1&&(this.level=_)}},{key:"firstLevel",get:function(){return this._firstLevel},set:function(_){this._firstLevel=_}},{key:"startLevel",get:function(){if(this._startLevel===void 0){var _=this.hls.config.startLevel;return _!==void 0?_:this._firstLevel}else return this._startLevel},set:function(_){this._startLevel=_}},{key:"nextLoadLevel",get:function(){return this.manualLevelIndex!==-1?this.manualLevelIndex:this.hls.nextAutoLevel},set:function(_){this.level=_,this.manualLevelIndex===-1&&(this.hls.nextAutoLevel=_)}}]),a}(n.default)},"./src/controller/level-helper.ts":function(oe,$,k){"use strict";k.r($),k.d($,"addGroupId",function(){return L}),k.d($,"assignTrackIdsByGroup",function(){return W}),k.d($,"updatePTS",function(){return H}),k.d($,"updateFragPTSDTS",function(){return I}),k.d($,"mergeDetails",function(){return g}),k.d($,"mapPartIntersection",function(){return f}),k.d($,"mapFragmentIntersection",function(){return m}),k.d($,"adjustSliding",function(){return h}),k.d($,"addSliding",function(){return o}),k.d($,"computeReloadInterval",function(){return p}),k.d($,"getFragmentWithSN",function(){return l}),k.d($,"getPartWith",function(){return u});var z=k("./src/polyfills/number.ts"),U=k("./src/utils/logger.ts");function L(a,s,C){switch(s){case"audio":a.audioGroupIds||(a.audioGroupIds=[]),a.audioGroupIds.push(C);break;case"text":a.textGroupIds||(a.textGroupIds=[]),a.textGroupIds.push(C);break}}function W(a){var s={};a.forEach(function(C){var _=C.groupId||"";C.id=s[_]=s[_]||0,s[_]++})}function H(a,s,C){var _=a[s],w=a[C];n(_,w)}function n(a,s){var C=s.startPTS;if(Object(z.isFiniteNumber)(C)){var _=0,w;s.sn>a.sn?(_=C-a.start,w=a):(_=a.start-C,w=s),w.duration!==_&&(w.duration=_)}else if(s.sn>a.sn){var O=a.cc===s.cc;O&&a.minEndPTS?s.start=a.start+(a.minEndPTS-a.start):s.start=a.start+a.duration}else s.start=Math.max(a.start-s.duration,0)}function I(a,s,C,_,w,O){var R=_-C;R<=0&&(U.logger.warn("Fragment should have a positive duration",s),_=C+s.duration,O=w+s.duration);var S=C,T=_,E=s.startPTS,c=s.endPTS;if(Object(z.isFiniteNumber)(E)){var x=Math.abs(E-C);Object(z.isFiniteNumber)(s.deltaPTS)?s.deltaPTS=Math.max(x,s.deltaPTS):s.deltaPTS=x,S=Math.max(C,E),C=Math.min(C,E),w=Math.min(w,s.startDTS),T=Math.min(_,c),_=Math.max(_,c),O=Math.max(O,s.endDTS)}s.duration=_-C;var v=C-s.start;s.appendedPTS=_,s.start=s.startPTS=C,s.maxStartPTS=S,s.startDTS=w,s.endPTS=_,s.minEndPTS=T,s.endDTS=O;var y=s.sn;if(!a||y<a.startSN||y>a.endSN)return 0;var F,B=y-a.startSN,A=a.fragments;for(A[B]=s,F=B;F>0;F--)n(A[F],A[F-1]);for(F=B;F<A.length-1;F++)n(A[F],A[F+1]);return a.fragmentHint&&n(A[A.length-1],a.fragmentHint),a.PTSKnown=a.alignedSliding=!0,v}function g(a,s){for(var C=null,_=a.fragments,w=_.length-1;w>=0;w--){var O=_[w].initSegment;if(O){C=O;break}}a.fragmentHint&&delete a.fragmentHint.endPTS;var R=0,S;if(m(a,s,function(F,B){F.relurl&&(R=F.cc-B.cc),Object(z.isFiniteNumber)(F.startPTS)&&Object(z.isFiniteNumber)(F.endPTS)&&(B.start=B.startPTS=F.startPTS,B.startDTS=F.startDTS,B.appendedPTS=F.appendedPTS,B.maxStartPTS=F.maxStartPTS,B.endPTS=F.endPTS,B.endDTS=F.endDTS,B.minEndPTS=F.minEndPTS,B.duration=F.endPTS-F.startPTS,B.duration&&(S=B),s.PTSKnown=s.alignedSliding=!0),B.elementaryStreams=F.elementaryStreams,B.loader=F.loader,B.stats=F.stats,B.urlId=F.urlId,F.initSegment&&(B.initSegment=F.initSegment,C=F.initSegment)}),C){var T=s.fragmentHint?s.fragments.concat(s.fragmentHint):s.fragments;T.forEach(function(F){var B;(!F.initSegment||F.initSegment.relurl===((B=C)===null||B===void 0?void 0:B.relurl))&&(F.initSegment=C)})}if(s.skippedSegments&&(s.deltaUpdateFailed=s.fragments.some(function(F){return!F}),s.deltaUpdateFailed)){U.logger.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(var E=s.skippedSegments;E--;)s.fragments.shift();s.startSN=s.fragments[0].sn,s.startCC=s.fragments[0].cc}var c=s.fragments;if(R){U.logger.warn("discontinuity sliding from playlist, take drift into account");for(var x=0;x<c.length;x++)c[x].cc+=R}s.skippedSegments&&(s.startCC=s.fragments[0].cc),f(a.partList,s.partList,function(F,B){B.elementaryStreams=F.elementaryStreams,B.stats=F.stats}),S?I(s,S,S.startPTS,S.endPTS,S.startDTS,S.endDTS):h(a,s),c.length&&(s.totalduration=s.edge-c[0].start),s.driftStartTime=a.driftStartTime,s.driftStart=a.driftStart;var v=s.advancedDateTime;if(s.advanced&&v){var y=s.edge;s.driftStart||(s.driftStartTime=v,s.driftStart=y),s.driftEndTime=v,s.driftEnd=y}else s.driftEndTime=a.driftEndTime,s.driftEnd=a.driftEnd,s.advancedDateTime=a.advancedDateTime}function f(a,s,C){if(a&&s)for(var _=0,w=0,O=a.length;w<=O;w++){var R=a[w],S=s[w+_];R&&S&&R.index===S.index&&R.fragment.sn===S.fragment.sn?C(R,S):_--}}function m(a,s,C){for(var _=s.skippedSegments,w=Math.max(a.startSN,s.startSN)-s.startSN,O=(a.fragmentHint?1:0)+(_?s.endSN:Math.min(a.endSN,s.endSN))-s.startSN,R=s.startSN-a.startSN,S=s.fragmentHint?s.fragments.concat(s.fragmentHint):s.fragments,T=a.fragmentHint?a.fragments.concat(a.fragmentHint):a.fragments,E=w;E<=O;E++){var c=T[R+E],x=S[E];_&&!x&&E<_&&(x=s.fragments[E]=c),c&&x&&C(c,x)}}function h(a,s){var C=s.startSN+s.skippedSegments-a.startSN,_=a.fragments;if(C<0||C>=_.length)return;o(s,_[C].start)}function o(a,s){if(s){for(var C=a.fragments,_=a.skippedSegments;_<C.length;_++)C[_].start+=s;a.fragmentHint&&(a.fragmentHint.start+=s)}}function p(a,s){var C=1e3*a.levelTargetDuration,_=C/2,w=a.age,O=w>0&&w<C*3,R=s.loading.end-s.loading.start,S,T=a.availabilityDelay;if(a.updated===!1)if(O){var E=333*a.misses;S=Math.max(Math.min(_,R*2),E),a.availabilityDelay=(a.availabilityDelay||0)+S}else S=_;else O?(T=Math.min(T||C/2,w),a.availabilityDelay=T,S=T+C-w):S=C-R;return Math.round(S)}function l(a,s,C){if(!a||!a.details)return null;var _=a.details,w=_.fragments[s-_.startSN];return w||(w=_.fragmentHint,w&&w.sn===s?w:s<_.startSN&&C&&C.sn===s?C:null)}function u(a,s,C){if(!a||!a.details)return null;var _=a.details.partList;if(_)for(var w=_.length;w--;){var O=_[w];if(O.index===C&&O.fragment.sn===s)return O}return null}},"./src/controller/stream-controller.ts":function(oe,$,k){"use strict";k.r($),k.d($,"default",function(){return _});var z=k("./src/polyfills/number.ts"),U=k("./src/controller/base-stream-controller.ts"),L=k("./src/is-supported.ts"),W=k("./src/events.ts"),H=k("./src/utils/buffer-helper.ts"),n=k("./src/controller/fragment-tracker.ts"),I=k("./src/types/loader.ts"),g=k("./src/loader/fragment.ts"),f=k("./src/demux/transmuxer-interface.ts"),m=k("./src/types/transmuxer.ts"),h=k("./src/controller/gap-controller.ts"),o=k("./src/errors.ts"),p=k("./src/utils/logger.ts");function l(w,O){for(var R=0;R<O.length;R++){var S=O[R];S.enumerable=S.enumerable||!1,S.configurable=!0,"value"in S&&(S.writable=!0),Object.defineProperty(w,S.key,S)}}function u(w,O,R){return O&&l(w.prototype,O),R&&l(w,R),w}function a(w,O){w.prototype=Object.create(O.prototype),w.prototype.constructor=w,s(w,O)}function s(w,O){return s=Object.setPrototypeOf||function(S,T){return S.__proto__=T,S},s(w,O)}var C=100,_=function(w){a(O,w);function O(S,T){var E;return E=w.call(this,S,T,"[stream-controller]")||this,E.audioCodecSwap=!1,E.gapController=null,E.level=-1,E._forceStartLoad=!1,E.altAudio=!1,E.audioOnly=!1,E.fragPlaying=null,E.onvplaying=null,E.onvseeked=null,E.fragLastKbps=0,E.stalled=!1,E.couldBacktrack=!1,E.audioCodecSwitch=!1,E.videoBuffer=null,E._registerListeners(),E}var R=O.prototype;return R._registerListeners=function(){var T=this.hls;T.on(W.Events.MEDIA_ATTACHED,this.onMediaAttached,this),T.on(W.Events.MEDIA_DETACHING,this.onMediaDetaching,this),T.on(W.Events.MANIFEST_LOADING,this.onManifestLoading,this),T.on(W.Events.MANIFEST_PARSED,this.onManifestParsed,this),T.on(W.Events.LEVEL_LOADING,this.onLevelLoading,this),T.on(W.Events.LEVEL_LOADED,this.onLevelLoaded,this),T.on(W.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),T.on(W.Events.ERROR,this.onError,this),T.on(W.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),T.on(W.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),T.on(W.Events.BUFFER_CREATED,this.onBufferCreated,this),T.on(W.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),T.on(W.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),T.on(W.Events.FRAG_BUFFERED,this.onFragBuffered,this)},R._unregisterListeners=function(){var T=this.hls;T.off(W.Events.MEDIA_ATTACHED,this.onMediaAttached,this),T.off(W.Events.MEDIA_DETACHING,this.onMediaDetaching,this),T.off(W.Events.MANIFEST_LOADING,this.onManifestLoading,this),T.off(W.Events.MANIFEST_PARSED,this.onManifestParsed,this),T.off(W.Events.LEVEL_LOADED,this.onLevelLoaded,this),T.off(W.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),T.off(W.Events.ERROR,this.onError,this),T.off(W.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),T.off(W.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),T.off(W.Events.BUFFER_CREATED,this.onBufferCreated,this),T.off(W.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),T.off(W.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),T.off(W.Events.FRAG_BUFFERED,this.onFragBuffered,this)},R.onHandlerDestroying=function(){this._unregisterListeners(),this.onMediaDetaching()},R.startLoad=function(T){if(this.levels){var E=this.lastCurrentTime,c=this.hls;if(this.stopLoad(),this.setInterval(C),this.level=-1,this.fragLoadError=0,!this.startFragRequested){var x=c.startLevel;x===-1&&(c.config.testBandwidth?(x=0,this.bitrateTest=!0):x=c.nextAutoLevel),this.level=c.nextLoadLevel=x,this.loadedmetadata=!1}E>0&&T===-1&&(this.log("Override startPosition with lastCurrentTime @"+E.toFixed(3)),T=E),this.state=U.State.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=T,this.tick()}else this._forceStartLoad=!0,this.state=U.State.STOPPED},R.stopLoad=function(){this._forceStartLoad=!1,w.prototype.stopLoad.call(this)},R.doTick=function(){switch(this.state){case U.State.IDLE:this.doTickIdle();break;case U.State.WAITING_LEVEL:{var T,E=this.levels,c=this.level,x=E==null||((T=E[c])===null||T===void 0)?void 0:T.details;if(x&&(!x.live||this.levelLastLoaded===this.level)){if(this.waitForCdnTuneIn(x))break;this.state=U.State.IDLE;break}break}case U.State.FRAG_LOADING_WAITING_RETRY:{var v,y=self.performance.now(),F=this.retryDate;(!F||y>=F||(v=this.media)!==null&&v!==void 0&&v.seeking)&&(this.log("retryDate reached, switch back to IDLE state"),this.state=U.State.IDLE)}break;default:break}this.onTickEnd()},R.onTickEnd=function(){w.prototype.onTickEnd.call(this),this.checkBuffer(),this.checkFragmentChanged()},R.doTickIdle=function(){var T,E,c=this.hls,x=this.levelLastLoaded,v=this.levels,y=this.media,F=c.config,B=c.nextLoadLevel;if(x===null||!y&&(this.startFragRequested||!F.startFragPrefetch))return;if(this.altAudio&&this.audioOnly)return;if(!v||!v[B])return;var A=v[B];this.level=c.nextLoadLevel=B;var j=A.details;if(!j||this.state===U.State.WAITING_LEVEL||j.live&&this.levelLastLoaded!==B){this.state=U.State.WAITING_LEVEL;return}var P=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:y,I.PlaylistLevelType.MAIN);if(P===null)return;var b=P.len,V=this.getMaxBufferLength(A.maxBitrate);if(b>=V)return;if(this._streamEnded(P,j)){var re={};this.altAudio&&(re.type="video"),this.hls.trigger(W.Events.BUFFER_EOS,re),this.state=U.State.ENDED;return}var ce=P.end,me=this.getNextFragment(ce,j);if(this.couldBacktrack&&!this.fragPrevious&&me&&me.sn!=="initSegment"){var De=me.sn-j.startSN;De>1&&(me=j.fragments[De-1],this.fragmentTracker.removeFragment(me))}if(me&&this.fragmentTracker.getState(me)===n.FragmentState.OK&&this.nextLoadPosition>ce){var we=this.audioOnly&&!this.altAudio?g.ElementaryStreamTypes.AUDIO:g.ElementaryStreamTypes.VIDEO;this.afterBufferFlushed(y,we,I.PlaylistLevelType.MAIN),me=this.getNextFragment(this.nextLoadPosition,j)}if(!me)return;me.initSegment&&!me.initSegment.data&&!this.bitrateTest&&(me=me.initSegment),((T=me.decryptdata)===null||T===void 0?void 0:T.keyFormat)==="identity"&&!((E=me.decryptdata)!==null&&E!==void 0&&E.key)?this.loadKey(me,j):this.loadFragment(me,j,ce)},R.loadFragment=function(T,E,c){var x,v=this.fragmentTracker.getState(T);if(this.fragCurrent=T,v===n.FragmentState.BACKTRACKED){var y=this.fragmentTracker.getBacktrackData(T);if(y){this._handleFragmentLoadProgress(y),this._handleFragmentLoadComplete(y);return}else v=n.FragmentState.NOT_LOADED}v===n.FragmentState.NOT_LOADED||v===n.FragmentState.PARTIAL?T.sn==="initSegment"?this._loadInitSegment(T):this.bitrateTest?(T.bitrateTest=!0,this.log("Fragment "+T.sn+" of level "+T.level+" is being downloaded to test bitrate and will not be buffered"),this._loadBitrateTestFrag(T)):(this.startFragRequested=!0,w.prototype.loadFragment.call(this,T,E,c)):v===n.FragmentState.APPENDING?this.reduceMaxBufferLength(T.duration)&&this.fragmentTracker.removeFragment(T):((x=this.media)===null||x===void 0?void 0:x.buffered.length)===0&&this.fragmentTracker.removeAllFragments()},R.getAppendedFrag=function(T){var E=this.fragmentTracker.getAppendedFrag(T,I.PlaylistLevelType.MAIN);return E&&"fragment"in E?E.fragment:E},R.getBufferedFrag=function(T){return this.fragmentTracker.getBufferedFrag(T,I.PlaylistLevelType.MAIN)},R.followingBufferedFrag=function(T){return T?this.getBufferedFrag(T.end+.5):null},R.immediateLevelSwitch=function(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)},R.nextLevelSwitch=function(){var T=this.levels,E=this.media;if(E!=null&&E.readyState){var c,x=this.getAppendedFrag(E.currentTime);if(x&&x.start>1&&this.flushMainBuffer(0,x.start-1),!E.paused&&T){var v=this.hls.nextLoadLevel,y=T[v],F=this.fragLastKbps;F&&this.fragCurrent?c=this.fragCurrent.duration*y.maxBitrate/(1e3*F)+1:c=0}else c=0;var B=this.getBufferedFrag(E.currentTime+c);if(B){var A=this.followingBufferedFrag(B);if(A){this.abortCurrentFrag();var j=A.maxStartPTS?A.maxStartPTS:A.start,P=A.duration,b=Math.max(B.end,j+Math.min(Math.max(P-this.config.maxFragLookUpTolerance,P*.5),P*.75));this.flushMainBuffer(b,Number.POSITIVE_INFINITY)}}}},R.abortCurrentFrag=function(){var T=this.fragCurrent;this.fragCurrent=null,T!=null&&T.loader&&T.loader.abort(),this.state===U.State.KEY_LOADING&&(this.state=U.State.IDLE),this.nextLoadPosition=this.getLoadPosition()},R.flushMainBuffer=function(T,E){w.prototype.flushMainBuffer.call(this,T,E,this.altAudio?"video":null)},R.onMediaAttached=function(T,E){w.prototype.onMediaAttached.call(this,T,E);var c=E.media;this.onvplaying=this.onMediaPlaying.bind(this),this.onvseeked=this.onMediaSeeked.bind(this),c.addEventListener("playing",this.onvplaying),c.addEventListener("seeked",this.onvseeked),this.gapController=new h.default(this.config,c,this.fragmentTracker,this.hls)},R.onMediaDetaching=function(){var T=this.media;T&&(T.removeEventListener("playing",this.onvplaying),T.removeEventListener("seeked",this.onvseeked),this.onvplaying=this.onvseeked=null,this.videoBuffer=null),this.fragPlaying=null,this.gapController&&(this.gapController.destroy(),this.gapController=null),w.prototype.onMediaDetaching.call(this)},R.onMediaPlaying=function(){this.tick()},R.onMediaSeeked=function(){var T=this.media,E=T?T.currentTime:null;Object(z.isFiniteNumber)(E)&&this.log("Media seeked to "+E.toFixed(3)),this.tick()},R.onManifestLoading=function(){this.log("Trigger BUFFER_RESET"),this.hls.trigger(W.Events.BUFFER_RESET,void 0),this.fragmentTracker.removeAllFragments(),this.couldBacktrack=this.stalled=!1,this.startPosition=this.lastCurrentTime=0,this.fragPlaying=null},R.onManifestParsed=function(T,E){var c=!1,x=!1,v;E.levels.forEach(function(y){v=y.audioCodec,v&&(v.indexOf("mp4a.40.2")!==-1&&(c=!0),v.indexOf("mp4a.40.5")!==-1&&(x=!0))}),this.audioCodecSwitch=c&&x&&!Object(L.changeTypeSupported)(),this.audioCodecSwitch&&this.log("Both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=E.levels,this.startFragRequested=!1},R.onLevelLoading=function(T,E){var c=this.levels;if(!c||this.state!==U.State.IDLE)return;var x=c[E.level];(!x.details||x.details.live&&this.levelLastLoaded!==E.level||this.waitForCdnTuneIn(x.details))&&(this.state=U.State.WAITING_LEVEL)},R.onLevelLoaded=function(T,E){var c,x=this.levels,v=E.level,y=E.details,F=y.totalduration;if(!x){this.warn("Levels were reset while loading level "+v);return}this.log("Level "+v+" loaded ["+y.startSN+","+y.endSN+"], cc ["+y.startCC+", "+y.endCC+"] duration:"+F);var B=this.fragCurrent;B&&(this.state===U.State.FRAG_LOADING||this.state===U.State.FRAG_LOADING_WAITING_RETRY)&&(B.level!==E.level&&B.loader&&(this.state=U.State.IDLE,B.loader.abort()));var A=x[v],j=0;if(y.live||(c=A.details)!==null&&c!==void 0&&c.live){if(y.fragments[0]||(y.deltaUpdateFailed=!0),y.deltaUpdateFailed)return;j=this.alignPlaylists(y,A.details)}if(A.details=y,this.levelLastLoaded=v,this.hls.trigger(W.Events.LEVEL_UPDATED,{details:y,level:v}),this.state===U.State.WAITING_LEVEL){if(this.waitForCdnTuneIn(y))return;this.state=U.State.IDLE}this.startFragRequested?y.live&&this.synchronizeToLiveEdge(y):this.setStartPosition(y,j),this.tick()},R._handleFragmentLoadProgress=function(T){var E,c=T.frag,x=T.part,v=T.payload,y=this.levels;if(!y){this.warn("Levels were reset while fragment load was in progress. Fragment "+c.sn+" of level "+c.level+" will not be buffered");return}var F=y[c.level],B=F.details;if(!B){this.warn("Dropping fragment "+c.sn+" of level "+c.level+" after level details were reset");return}var A=F.videoCodec,j=B.PTSKnown||!B.live,P=(E=c.initSegment)===null||E===void 0?void 0:E.data,b=this._getAudioCodec(F),V=this.transmuxer=this.transmuxer||new f.default(this.hls,I.PlaylistLevelType.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),re=x?x.index:-1,ce=re!==-1,me=new m.ChunkMetadata(c.level,c.sn,c.stats.chunkCount,v.byteLength,re,ce),De=this.initPTS[c.cc];V.push(v,P,b,A,c,x,B.totalduration,j,me,De)},R.onAudioTrackSwitching=function(T,E){var c=this.altAudio,x=!!E.url,v=E.id;if(!x){if(this.mediaBuffer!==this.media){this.log("Switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;var y=this.fragCurrent;y!=null&&y.loader&&(this.log("Switching to main audio track, cancel main fragment load"),y.loader.abort()),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();var F=this.hls;c&&F.trigger(W.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),F.trigger(W.Events.AUDIO_TRACK_SWITCHED,{id:v})}},R.onAudioTrackSwitched=function(T,E){var c=E.id,x=!!this.hls.audioTracks[c].url;if(x){var v=this.videoBuffer;v&&this.mediaBuffer!==v&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=v)}this.altAudio=x,this.tick()},R.onBufferCreated=function(T,E){var c=E.tracks,x,v,y=!1;for(var F in c){var B=c[F];if(B.id==="main"){if(v=F,x=B,F==="video"){var A=c[F];A&&(this.videoBuffer=A.buffer)}}else y=!0}y&&x?(this.log("Alternate track found, use "+v+".buffered to schedule main fragment loading"),this.mediaBuffer=x.buffer):this.mediaBuffer=this.media},R.onFragBuffered=function(T,E){var c=E.frag,x=E.part;if(c&&c.type!==I.PlaylistLevelType.MAIN)return;if(this.fragContextChanged(c)){this.warn("Fragment "+c.sn+(x?" p: "+x.index:"")+" of level "+c.level+" finished buffering, but was aborted. state: "+this.state),this.state===U.State.PARSED&&(this.state=U.State.IDLE);return}var v=x?x.stats:c.stats;this.fragLastKbps=Math.round(8*v.total/(v.buffering.end-v.loading.first)),c.sn!=="initSegment"&&(this.fragPrevious=c),this.fragBufferedComplete(c,x)},R.onError=function(T,E){switch(E.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(I.PlaylistLevelType.MAIN,E);break;case o.ErrorDetails.LEVEL_LOAD_ERROR:case o.ErrorDetails.LEVEL_LOAD_TIMEOUT:this.state!==U.State.ERROR&&(E.fatal?(this.warn(""+E.details),this.state=U.State.ERROR):!E.levelRetry&&this.state===U.State.WAITING_LEVEL&&(this.state=U.State.IDLE));break;case o.ErrorDetails.BUFFER_FULL_ERROR:if(E.parent==="main"&&(this.state===U.State.PARSING||this.state===U.State.PARSED)){var c=!0,x=this.getFwdBufferInfo(this.media,I.PlaylistLevelType.MAIN);x&&x.len>.5&&(c=!this.reduceMaxBufferLength(x.len)),c&&(this.warn("buffer full error also media.currentTime is not buffered, flush main"),this.immediateLevelSwitch()),this.resetLoadingState()}break;default:break}},R.checkBuffer=function(){var T=this.media,E=this.gapController;if(!T||!E||!T.readyState)return;var c=H.BufferHelper.getBuffered(T);!this.loadedmetadata&&c.length?(this.loadedmetadata=!0,this.seekToStartPos()):E.poll(this.lastCurrentTime),this.lastCurrentTime=T.currentTime},R.onFragLoadEmergencyAborted=function(){this.state=U.State.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tickImmediate()},R.onBufferFlushed=function(T,E){var c=E.type;if(c!==g.ElementaryStreamTypes.AUDIO||this.audioOnly&&!this.altAudio){var x=(c===g.ElementaryStreamTypes.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;this.afterBufferFlushed(x,c,I.PlaylistLevelType.MAIN)}},R.onLevelsUpdated=function(T,E){this.levels=E.levels},R.swapAudioCodec=function(){this.audioCodecSwap=!this.audioCodecSwap},R.seekToStartPos=function(){var T=this.media,E=T.currentTime,c=this.startPosition;if(c>=0&&E<c){if(T.seeking){p.logger.log("could not seek to "+c+", already seeking at "+E);return}var x=H.BufferHelper.getBuffered(T),v=x.length?x.start(0):0,y=v-c;y>0&&(y<this.config.maxBufferHole||y<this.config.maxFragLookUpTolerance)&&(p.logger.log("adjusting start position by "+y+" to match buffer start"),c+=y,this.startPosition=c),this.log("seek to target start position "+c+" from current time "+E),T.currentTime=c}},R._getAudioCodec=function(T){var E=this.config.defaultAudioCodec||T.audioCodec;return this.audioCodecSwap&&E&&(this.log("Swapping audio codec"),E.indexOf("mp4a.40.5")!==-1?E="mp4a.40.2":E="mp4a.40.5"),E},R._loadBitrateTestFrag=function(T){var E=this;this._doFragLoad(T).then(function(c){var x=E.hls;if(!c||x.nextLoadLevel||E.fragContextChanged(T))return;E.fragLoadError=0,E.state=U.State.IDLE,E.startFragRequested=!1,E.bitrateTest=!1;var v=T.stats;v.parsing.start=v.parsing.end=v.buffering.start=v.buffering.end=self.performance.now(),x.trigger(W.Events.FRAG_LOADED,c)})},R._handleTransmuxComplete=function(T){var E,c="main",x=this.hls,v=T.remuxResult,y=T.chunkMeta,F=this.getCurrentContext(y);if(!F){this.warn("The loading context changed while buffering fragment "+y.sn+" of level "+y.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(y.level);return}var B=F.frag,A=F.part,j=F.level,P=v.video,b=v.text,V=v.id3,re=v.initSegment,ce=this.altAudio?void 0:v.audio;if(this.fragContextChanged(B))return;if(this.state=U.State.PARSING,re){re.tracks&&(this._bufferInitSegment(j,re.tracks,B,y),x.trigger(W.Events.FRAG_PARSING_INIT_SEGMENT,{frag:B,id:c,tracks:re.tracks}));var me=re.initPTS,De=re.timescale;Object(z.isFiniteNumber)(me)&&(this.initPTS[B.cc]=me,x.trigger(W.Events.INIT_PTS_FOUND,{frag:B,id:c,initPTS:me,timescale:De}))}if(P&&v.independent!==!1){if(j.details){var we=P.startPTS,Le=P.endPTS,Re=P.startDTS,Ie=P.endDTS;if(A)A.elementaryStreams[P.type]={startPTS:we,endPTS:Le,startDTS:Re,endDTS:Ie};else if(P.firstKeyFrame&&P.independent&&(this.couldBacktrack=!0),P.dropped&&P.independent){var ye=this.getLoadPosition()+this.config.maxBufferHole;if(ye<we){this.backtrack(B);return}B.setElementaryStreamInfo(P.type,B.start,Le,B.start,Ie,!0)}B.setElementaryStreamInfo(P.type,we,Le,Re,Ie),this.bufferFragmentData(P,B,A,y)}}else if(v.independent===!1){this.backtrack(B);return}if(ce){var X=ce.startPTS,M=ce.endPTS,N=ce.startDTS,Y=ce.endDTS;A&&(A.elementaryStreams[g.ElementaryStreamTypes.AUDIO]={startPTS:X,endPTS:M,startDTS:N,endDTS:Y}),B.setElementaryStreamInfo(g.ElementaryStreamTypes.AUDIO,X,M,N,Y),this.bufferFragmentData(ce,B,A,y)}if(V!=null&&(E=V.samples)!==null&&E!==void 0&&E.length){var ie={frag:B,id:c,samples:V.samples};x.trigger(W.Events.FRAG_PARSING_METADATA,ie)}if(b){var K={frag:B,id:c,samples:b.samples};x.trigger(W.Events.FRAG_PARSING_USERDATA,K)}},R._bufferInitSegment=function(T,E,c,x){var v=this;if(this.state!==U.State.PARSING)return;this.audioOnly=!!E.audio&&!E.video,this.altAudio&&!this.audioOnly&&delete E.audio;var y=E.audio,F=E.video,B=E.audiovideo;if(y){var A=T.audioCodec,j=navigator.userAgent.toLowerCase();this.audioCodecSwitch&&(A&&(A.indexOf("mp4a.40.5")!==-1?A="mp4a.40.2":A="mp4a.40.5"),y.metadata.channelCount!==1&&j.indexOf("firefox")===-1&&(A="mp4a.40.5")),j.indexOf("android")!==-1&&y.container!=="audio/mpeg"&&(A="mp4a.40.2",this.log("Android: force audio codec to "+A)),T.audioCodec&&T.audioCodec!==A&&this.log('Swapping manifest audio codec "'+T.audioCodec+'" for "'+A+'"'),y.levelCodec=A,y.id="main",this.log("Init audio buffer, container:"+y.container+", codecs[selected/level/parsed]=["+(A||"")+"/"+(T.audioCodec||"")+"/"+y.codec+"]")}F&&(F.levelCodec=T.videoCodec,F.id="main",this.log("Init video buffer, container:"+F.container+", codecs[level/parsed]=["+(T.videoCodec||"")+"/"+F.codec+"]")),B&&this.log("Init audiovideo buffer, container:"+B.container+", codecs[level/parsed]=["+(T.attrs.CODECS||"")+"/"+B.codec+"]"),this.hls.trigger(W.Events.BUFFER_CODECS,E),Object.keys(E).forEach(function(P){var b=E[P],V=b.initSegment;V!=null&&V.byteLength&&v.hls.trigger(W.Events.BUFFER_APPENDING,{type:P,data:V,frag:c,part:null,chunkMeta:x,parent:c.type})}),this.tick()},R.backtrack=function(T){this.couldBacktrack=!0,this.resetTransmuxer(),this.flushBufferGap(T);var E=this.fragmentTracker.backtrack(T);this.fragPrevious=null,this.nextLoadPosition=T.start,E?this.resetFragmentLoading(T):this.state=U.State.BACKTRACKING},R.checkFragmentChanged=function(){var T=this.media,E=null;if(T&&T.readyState>1&&T.seeking===!1){var c=T.currentTime;if(H.BufferHelper.isBuffered(T,c)?E=this.getAppendedFrag(c):H.BufferHelper.isBuffered(T,c+.1)&&(E=this.getAppendedFrag(c+.1)),E){var x=this.fragPlaying,v=E.level;(!x||E.sn!==x.sn||x.level!==v||E.urlId!==x.urlId)&&(this.hls.trigger(W.Events.FRAG_CHANGED,{frag:E}),(!x||x.level!==v)&&this.hls.trigger(W.Events.LEVEL_SWITCHED,{level:v}),this.fragPlaying=E)}}},u(O,[{key:"nextLevel",get:function(){var T=this.nextBufferedFrag;return T?T.level:-1}},{key:"currentLevel",get:function(){var T=this.media;if(T){var E=this.getAppendedFrag(T.currentTime);if(E)return E.level}return-1}},{key:"nextBufferedFrag",get:function(){var T=this.media;if(T){var E=this.getAppendedFrag(T.currentTime);return this.followingBufferedFrag(E)}else return null}},{key:"forceStartLoad",get:function(){return this._forceStartLoad}}]),O}(U.default)},"./src/controller/subtitle-stream-controller.ts":function(oe,$,k){"use strict";k.r($),k.d($,"SubtitleStreamController",function(){return a});var z=k("./src/events.ts"),U=k("./src/utils/logger.ts"),L=k("./src/utils/buffer-helper.ts"),W=k("./src/controller/fragment-finders.ts"),H=k("./src/utils/discontinuities.ts"),n=k("./src/controller/level-helper.ts"),I=k("./src/controller/fragment-tracker.ts"),g=k("./src/controller/base-stream-controller.ts"),f=k("./src/types/loader.ts"),m=k("./src/types/level.ts");function h(s,C){for(var _=0;_<C.length;_++){var w=C[_];w.enumerable=w.enumerable||!1,w.configurable=!0,"value"in w&&(w.writable=!0),Object.defineProperty(s,w.key,w)}}function o(s,C,_){return C&&h(s.prototype,C),_&&h(s,_),s}function p(s,C){s.prototype=Object.create(C.prototype),s.prototype.constructor=s,l(s,C)}function l(s,C){return l=Object.setPrototypeOf||function(w,O){return w.__proto__=O,w},l(s,C)}var u=500,a=function(s){p(C,s);function C(w,O){var R;return R=s.call(this,w,O,"[subtitle-stream-controller]")||this,R.levels=[],R.currentTrackId=-1,R.tracksBuffered=[],R.mainDetails=null,R._registerListeners(),R}var _=C.prototype;return _.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},_._registerListeners=function(){var O=this.hls;O.on(z.Events.MEDIA_ATTACHED,this.onMediaAttached,this),O.on(z.Events.MEDIA_DETACHING,this.onMediaDetaching,this),O.on(z.Events.MANIFEST_LOADING,this.onManifestLoading,this),O.on(z.Events.LEVEL_LOADED,this.onLevelLoaded,this),O.on(z.Events.ERROR,this.onError,this),O.on(z.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),O.on(z.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),O.on(z.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),O.on(z.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),O.on(z.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},_._unregisterListeners=function(){var O=this.hls;O.off(z.Events.MEDIA_ATTACHED,this.onMediaAttached,this),O.off(z.Events.MEDIA_DETACHING,this.onMediaDetaching,this),O.off(z.Events.MANIFEST_LOADING,this.onManifestLoading,this),O.off(z.Events.LEVEL_LOADED,this.onLevelLoaded,this),O.off(z.Events.ERROR,this.onError,this),O.off(z.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),O.off(z.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),O.off(z.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),O.off(z.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),O.off(z.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},_.startLoad=function(){this.stopLoad(),this.state=g.State.IDLE,this.setInterval(u),this.tick()},_.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments()},_.onLevelLoaded=function(O,R){this.mainDetails=R.details},_.onSubtitleFragProcessed=function(O,R){var S=R.frag,T=R.success;if(this.fragPrevious=S,this.state=g.State.IDLE,!T)return;var E=this.tracksBuffered[this.currentTrackId];if(!E)return;for(var c,x=S.start,v=0;v<E.length;v++)if(x>=E[v].start&&x<=E[v].end){c=E[v];break}var y=S.start+S.duration;c?c.end=y:(c={start:x,end:y},E.push(c)),this.fragmentTracker.fragBuffered(S)},_.onBufferFlushing=function(O,R){var S=R.startOffset,T=R.endOffset;if(S===0&&T!==Number.POSITIVE_INFINITY){var E=this.currentTrackId,c=this.levels;if(!c.length||!c[E]||!c[E].details)return;var x=c[E].details,v=x.targetduration,y=T-v;if(y<=0)return;R.endOffsetSubtitles=Math.max(0,y),this.tracksBuffered.forEach(function(F){for(var B=0;B<F.length;){if(F[B].end<=y){F.shift();continue}else if(F[B].start<y)F[B].start=y;else break;B++}}),this.fragmentTracker.removeFragmentsInRange(S,y,f.PlaylistLevelType.SUBTITLE)}},_.onError=function(O,R){var S,T=R.frag;if(!T||T.type!==f.PlaylistLevelType.SUBTITLE)return;(S=this.fragCurrent)!==null&&S!==void 0&&S.loader&&this.fragCurrent.loader.abort(),this.state=g.State.IDLE},_.onSubtitleTracksUpdated=function(O,R){var S=this,T=R.subtitleTracks;this.tracksBuffered=[],this.levels=T.map(function(E){return new m.Level(E)}),this.fragmentTracker.removeAllFragments(),this.fragPrevious=null,this.levels.forEach(function(E){S.tracksBuffered[E.id]=[]}),this.mediaBuffer=null},_.onSubtitleTrackSwitch=function(O,R){if(this.currentTrackId=R.id,!this.levels.length||this.currentTrackId===-1){this.clearInterval();return}var S=this.levels[this.currentTrackId];S!=null&&S.details?this.mediaBuffer=this.mediaBufferTimeRanges:this.mediaBuffer=null,S&&this.setInterval(u)},_.onSubtitleTrackLoaded=function(O,R){var S,T=R.details,E=R.id,c=this.currentTrackId,x=this.levels;if(!x.length)return;var v=x[c];if(E>=x.length||E!==c||!v)return;if(this.mediaBuffer=this.mediaBufferTimeRanges,T.live||(S=v.details)!==null&&S!==void 0&&S.live){var y=this.mainDetails;if(T.deltaUpdateFailed||!y)return;var F=y.fragments[0];if(!v.details)T.hasProgramDateTime&&y.hasProgramDateTime?Object(H.alignMediaPlaylistByPDT)(T,y):F&&Object(n.addSliding)(T,F.start);else{var B=this.alignPlaylists(T,v.details);B===0&&F&&Object(n.addSliding)(T,F.start)}}if(v.details=T,this.levelLastLoaded=E,this.tick(),T.live&&!this.fragCurrent&&this.media&&this.state===g.State.IDLE){var A=Object(W.findFragmentByPTS)(null,T.fragments,this.media.currentTime,0);A||(this.warn("Subtitle playlist not aligned with playback"),v.details=void 0)}},_._handleFragmentLoadComplete=function(O){var R=O.frag,S=O.payload,T=R.decryptdata,E=this.hls;if(this.fragContextChanged(R))return;if(S&&S.byteLength>0&&T&&T.key&&T.iv&&T.method==="AES-128"){var c=performance.now();this.decrypter.webCryptoDecrypt(new Uint8Array(S),T.key.buffer,T.iv.buffer).then(function(x){var v=performance.now();E.trigger(z.Events.FRAG_DECRYPTED,{frag:R,payload:x,stats:{tstart:c,tdecrypt:v}})})}},_.doTick=function(){if(!this.media){this.state=g.State.IDLE;return}if(this.state===g.State.IDLE){var O,R=this.currentTrackId,S=this.levels;if(!S.length||!S[R]||!S[R].details)return;var T=S[R].details,E=T.targetduration,c=this.config,x=this.media,v=L.BufferHelper.bufferedInfo(this.mediaBufferTimeRanges,x.currentTime-E,c.maxBufferHole),y=v.end,F=v.len,B=this.getMaxBufferLength()+E;if(F>B)return;console.assert(T,"Subtitle track details are defined on idle subtitle stream controller tick");var A=T.fragments,j=A.length,P=T.edge,b,V=this.fragPrevious;if(y<P){var re=c.maxFragLookUpTolerance;V&&T.hasProgramDateTime&&(b=Object(W.findFragmentByPDT)(A,V.endProgramDateTime,re)),b||(b=Object(W.findFragmentByPTS)(V,A,y,re),!b&&V&&V.start<A[0].start&&(b=A[0]))}else b=A[j-1];(O=b)!==null&&O!==void 0&&O.encrypted?(U.logger.log("Loading key for "+b.sn),this.state=g.State.KEY_LOADING,this.hls.trigger(z.Events.KEY_LOADING,{frag:b})):b&&this.fragmentTracker.getState(b)===I.FragmentState.NOT_LOADED&&this.loadFragment(b,T,y)}},_.loadFragment=function(O,R,S){this.fragCurrent=O,s.prototype.loadFragment.call(this,O,R,S)},o(C,[{key:"mediaBufferTimeRanges",get:function(){return this.tracksBuffered[this.currentTrackId]||[]}}]),C}(g.default)},"./src/controller/subtitle-track-controller.ts":function(oe,$,k){"use strict";k.r($);var z=k("./src/events.ts"),U=k("./src/utils/texttrack-utils.ts"),L=k("./src/controller/base-playlist-controller.ts"),W=k("./src/types/loader.ts");function H(h,o){for(var p=0;p<o.length;p++){var l=o[p];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(h,l.key,l)}}function n(h,o,p){return o&&H(h.prototype,o),p&&H(h,p),h}function I(h,o){h.prototype=Object.create(o.prototype),h.prototype.constructor=h,g(h,o)}function g(h,o){return g=Object.setPrototypeOf||function(l,u){return l.__proto__=u,l},g(h,o)}var f=function(h){I(o,h);function o(l){var u;return u=h.call(this,l,"[subtitle-track-controller]")||this,u.media=null,u.tracks=[],u.groupId=null,u.tracksInGroup=[],u.trackId=-1,u.selectDefaultTrack=!0,u.queuedDefaultTrack=-1,u.trackChangeListener=function(){return u.onTextTracksChanged()},u.asyncPollTrackChange=function(){return u.pollTrackChange(0)},u.useTextTrackPolling=!1,u.subtitlePollingInterval=-1,u.subtitleDisplay=!0,u.registerListeners(),u}var p=o.prototype;return p.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.trackChangeListener=this.asyncPollTrackChange=null,h.prototype.destroy.call(this)},p.registerListeners=function(){var u=this.hls;u.on(z.Events.MEDIA_ATTACHED,this.onMediaAttached,this),u.on(z.Events.MEDIA_DETACHING,this.onMediaDetaching,this),u.on(z.Events.MANIFEST_LOADING,this.onManifestLoading,this),u.on(z.Events.MANIFEST_PARSED,this.onManifestParsed,this),u.on(z.Events.LEVEL_LOADING,this.onLevelLoading,this),u.on(z.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),u.on(z.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),u.on(z.Events.ERROR,this.onError,this)},p.unregisterListeners=function(){var u=this.hls;u.off(z.Events.MEDIA_ATTACHED,this.onMediaAttached,this),u.off(z.Events.MEDIA_DETACHING,this.onMediaDetaching,this),u.off(z.Events.MANIFEST_LOADING,this.onManifestLoading,this),u.off(z.Events.MANIFEST_PARSED,this.onManifestParsed,this),u.off(z.Events.LEVEL_LOADING,this.onLevelLoading,this),u.off(z.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),u.off(z.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),u.off(z.Events.ERROR,this.onError,this)},p.onMediaAttached=function(u,a){if(this.media=a.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)},p.pollTrackChange=function(u){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.trackChangeListener,u)},p.onMediaDetaching=function(){if(!this.media)return;self.clearInterval(this.subtitlePollingInterval),this.useTextTrackPolling||this.media.textTracks.removeEventListener("change",this.asyncPollTrackChange),this.trackId>-1&&(this.queuedDefaultTrack=this.trackId);var u=m(this.media.textTracks);u.forEach(function(a){Object(U.clearCurrentCues)(a)}),this.subtitleTrack=-1,this.media=null},p.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.selectDefaultTrack=!0},p.onManifestParsed=function(u,a){this.tracks=a.subtitleTracks},p.onSubtitleTrackLoaded=function(u,a){var s=a.id,C=a.details,_=this.trackId,w=this.tracksInGroup[_];if(!w){this.warn("Invalid subtitle track id "+s);return}var O=w.details;w.details=a.details,this.log("subtitle track "+s+" loaded ["+C.startSN+"-"+C.endSN+"]"),s===this.trackId&&(this.retryCount=0,this.playlistLoaded(s,a,O))},p.onLevelLoading=function(u,a){this.switchLevel(a.level)},p.onLevelSwitching=function(u,a){this.switchLevel(a.level)},p.switchLevel=function(u){var a=this.hls.levels[u];if(!(a!=null&&a.textGroupIds))return;var s=a.textGroupIds[a.urlId];if(this.groupId!==s){var C=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0,_=this.tracks.filter(function(R){return!s||R.groupId===s});this.tracksInGroup=_;var w=this.findTrackId(C==null?void 0:C.name)||this.findTrackId();this.groupId=s;var O={subtitleTracks:_};this.log("Updating subtitle tracks, "+_.length+' track(s) found in "'+s+'" group-id'),this.hls.trigger(z.Events.SUBTITLE_TRACKS_UPDATED,O),w!==-1&&this.setSubtitleTrack(w,C)}},p.findTrackId=function(u){for(var a=this.tracksInGroup,s=0;s<a.length;s++){var C=a[s];if((!this.selectDefaultTrack||C.default)&&(!u||u===C.name))return C.id}return-1},p.onError=function(u,a){if(h.prototype.onError.call(this,u,a),a.fatal||!a.context)return;a.context.type===W.PlaylistContextType.SUBTITLE_TRACK&&a.context.id===this.trackId&&a.context.groupId===this.groupId&&this.retryLoadingOrFail(a)},p.loadPlaylist=function(u){var a=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(a)){var s=a.id,C=a.groupId,_=a.url;if(u)try{_=u.addDirectives(_)}catch(w){this.warn("Could not construct new URL with HLS Delivery Directives: "+w)}this.log("Loading subtitle playlist for id "+s),this.hls.trigger(z.Events.SUBTITLE_TRACK_LOADING,{url:_,id:s,groupId:C,deliveryDirectives:u||null})}},p.toggleTrackModes=function(u){var a=this,s=this.media,C=this.subtitleDisplay,_=this.trackId;if(!s)return;var w=m(s.textTracks),O=w.filter(function(T){return T.groupId===a.groupId});if(u===-1)[].slice.call(w).forEach(function(T){T.mode="disabled"});else{var R=O[_];R&&(R.mode="disabled")}var S=O[u];S&&(S.mode=C?"showing":"hidden")},p.setSubtitleTrack=function(u,a){var s,C=this.tracksInGroup;if(!this.media){this.queuedDefaultTrack=u;return}if(this.trackId!==u&&this.toggleTrackModes(u),this.trackId===u&&(u===-1||(s=C[u])!==null&&s!==void 0&&s.details)||u<-1||u>=C.length)return;this.clearTimer();var _=C[u];if(this.log("Switching to subtitle track "+u),this.trackId=u,_){var w=_.id,O=_.groupId,R=O===void 0?"":O,S=_.name,T=_.type,E=_.url;this.hls.trigger(z.Events.SUBTITLE_TRACK_SWITCH,{id:w,groupId:R,name:S,type:T,url:E});var c=this.switchParams(_.url,a==null?void 0:a.details);this.loadPlaylist(c)}else this.hls.trigger(z.Events.SUBTITLE_TRACK_SWITCH,{id:u})},p.onTextTracksChanged=function(){if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),!this.media||!this.hls.config.renderTextTracksNatively)return;for(var u=-1,a=m(this.media.textTracks),s=0;s<a.length;s++)if(a[s].mode==="hidden")u=s;else if(a[s].mode==="showing"){u=s;break}this.subtitleTrack!==u&&(this.subtitleTrack=u)},n(o,[{key:"subtitleTracks",get:function(){return this.tracksInGroup}},{key:"subtitleTrack",get:function(){return this.trackId},set:function(u){this.selectDefaultTrack=!1;var a=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0;this.setSubtitleTrack(u,a)}}]),o}(L.default);function m(h){for(var o=[],p=0;p<h.length;p++){var l=h[p];l.kind==="subtitles"&&l.label&&o.push(h[p])}return o}$.default=f},"./src/controller/timeline-controller.ts":function(oe,$,k){"use strict";k.r($),k.d($,"TimelineController",function(){return m});var z=k("./src/polyfills/number.ts"),U=k("./src/events.ts"),L=k("./src/utils/cea-608-parser.ts"),W=k("./src/utils/output-filter.ts"),H=k("./src/utils/webvtt-parser.ts"),n=k("./src/utils/texttrack-utils.ts"),I=k("./src/utils/imsc1-ttml-parser.ts"),g=k("./src/types/loader.ts"),f=k("./src/utils/logger.ts"),m=function(){function l(a){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=p(),this.captionsProperties=void 0,this.hls=a,this.config=a.config,this.Cues=a.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 s=new W.default(this,"textTrack1"),C=new W.default(this,"textTrack2"),_=new W.default(this,"textTrack3"),w=new W.default(this,"textTrack4");this.cea608Parser1=new L.default(1,s,C),this.cea608Parser2=new L.default(3,_,w)}a.on(U.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),a.on(U.Events.MEDIA_DETACHING,this.onMediaDetaching,this),a.on(U.Events.MANIFEST_LOADING,this.onManifestLoading,this),a.on(U.Events.MANIFEST_LOADED,this.onManifestLoaded,this),a.on(U.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),a.on(U.Events.FRAG_LOADING,this.onFragLoading,this),a.on(U.Events.FRAG_LOADED,this.onFragLoaded,this),a.on(U.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),a.on(U.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),a.on(U.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),a.on(U.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),a.on(U.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)}var u=l.prototype;return u.destroy=function(){var s=this.hls;s.off(U.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),s.off(U.Events.MEDIA_DETACHING,this.onMediaDetaching,this),s.off(U.Events.MANIFEST_LOADING,this.onManifestLoading,this),s.off(U.Events.MANIFEST_LOADED,this.onManifestLoaded,this),s.off(U.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),s.off(U.Events.FRAG_LOADING,this.onFragLoading,this),s.off(U.Events.FRAG_LOADED,this.onFragLoaded,this),s.off(U.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),s.off(U.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),s.off(U.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),s.off(U.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),s.off(U.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),this.hls=this.config=this.cea608Parser1=this.cea608Parser2=null},u.addCues=function(s,C,_,w,O){for(var R=!1,S=O.length;S--;){var T=O[S],E=o(T[0],T[1],C,_);if(E>=0&&(T[0]=Math.min(T[0],C),T[1]=Math.max(T[1],_),R=!0,E/(_-C)>.5))return}if(R||O.push([C,_]),this.config.renderTextTracksNatively){var c=this.captionsTracks[s];this.Cues.newCue(c,C,_,w)}else{var x=this.Cues.newCue(null,C,_,w);this.hls.trigger(U.Events.CUES_PARSED,{type:"captions",cues:x,track:s})}},u.onInitPtsFound=function(s,C){var _=this,w=C.frag,O=C.id,R=C.initPTS,S=C.timescale,T=this.unparsedVttFrags;O==="main"&&(this.initPTS[w.cc]=R,this.timescale[w.cc]=S),T.length&&(this.unparsedVttFrags=[],T.forEach(function(E){_.onFragLoaded(U.Events.FRAG_LOADED,E)}))},u.getExistingTrack=function(s){var C=this.media;if(C)for(var _=0;_<C.textTracks.length;_++){var w=C.textTracks[_];if(w[s])return w}return null},u.createCaptionsTrack=function(s){this.config.renderTextTracksNatively?this.createNativeTrack(s):this.createNonNativeTrack(s)},u.createNativeTrack=function(s){if(this.captionsTracks[s])return;var C=this.captionsProperties,_=this.captionsTracks,w=this.media,O=C[s],R=O.label,S=O.languageCode,T=this.getExistingTrack(s);if(T)_[s]=T,Object(n.clearCurrentCues)(_[s]),Object(n.sendAddTrackEvent)(_[s],w);else{var E=this.createTextTrack("captions",R,S);E&&(E[s]=!0,_[s]=E)}},u.createNonNativeTrack=function(s){if(this.nonNativeCaptionsTracks[s])return;var C=this.captionsProperties[s];if(!C)return;var _=C.label,w={_id:s,label:_,kind:"captions",default:C.media?!!C.media.default:!1,closedCaptions:C.media};this.nonNativeCaptionsTracks[s]=w,this.hls.trigger(U.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:[w]})},u.createTextTrack=function(s,C,_){var w=this.media;return w?w.addTextTrack(s,C,_):void 0},u.onMediaAttaching=function(s,C){this.media=C.media,this._cleanTracks()},u.onMediaDetaching=function(){var s=this.captionsTracks;Object.keys(s).forEach(function(C){Object(n.clearCurrentCues)(s[C]),delete s[C]}),this.nonNativeCaptionsTracks={}},u.onManifestLoading=function(){this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=p(),this._cleanTracks(),this.tracks=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.textTracks=[],this.unparsedVttFrags=this.unparsedVttFrags||[],this.initPTS=[],this.timescale=[],this.cea608Parser1&&this.cea608Parser2&&(this.cea608Parser1.reset(),this.cea608Parser2.reset())},u._cleanTracks=function(){var s=this.media;if(!s)return;var C=s.textTracks;if(C)for(var _=0;_<C.length;_++)Object(n.clearCurrentCues)(C[_])},u.onSubtitleTracksUpdated=function(s,C){var _=this;this.textTracks=[];var w=C.subtitleTracks||[],O=w.some(function(E){return E.textCodec===I.IMSC1_CODEC});if(this.config.enableWebVTT||O&&this.config.enableIMSC1){var R=this.tracks&&w&&this.tracks.length===w.length;if(this.tracks=w||[],this.config.renderTextTracksNatively){var S=this.media?this.media.textTracks:[];this.tracks.forEach(function(E,c){var x;if(c<S.length){for(var v=null,y=0;y<S.length;y++)if(h(S[y],E)){v=S[y];break}v&&(x=v)}x?Object(n.clearCurrentCues)(x):(x=_.createTextTrack("subtitles",E.name,E.lang),x&&(x.mode="disabled")),x&&(x.groupId=E.groupId,_.textTracks.push(x))})}else if(!R&&this.tracks&&this.tracks.length){var T=this.tracks.map(function(E){return{label:E.name,kind:E.type.toLowerCase(),default:E.default,subtitleTrack:E}});this.hls.trigger(U.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:T})}}},u.onManifestLoaded=function(s,C){var _=this;this.config.enableCEA708Captions&&C.captions&&C.captions.forEach(function(w){var O=/(?:CC|SERVICE)([1-4])/.exec(w.instreamId);if(!O)return;var R="textTrack"+O[1],S=_.captionsProperties[R];if(!S)return;S.label=w.name,w.lang&&(S.languageCode=w.lang),S.media=w})},u.onFragLoading=function(s,C){var _=this.cea608Parser1,w=this.cea608Parser2,O=this.lastSn,R=this.lastPartIndex;if(!this.enabled||!(_&&w))return;if(C.frag.type===g.PlaylistLevelType.MAIN){var S,T,E=C.frag.sn,c=(S=C==null||((T=C.part)===null||T===void 0)?void 0:T.index)!=null?S:-1;E===O+1||E===O&&c===R+1||(_.reset(),w.reset()),this.lastSn=E,this.lastPartIndex=c}},u.onFragLoaded=function(s,C){var _=C.frag,w=C.payload,O=this.initPTS,R=this.unparsedVttFrags;if(_.type===g.PlaylistLevelType.SUBTITLE)if(w.byteLength){if(!Object(z.isFiniteNumber)(O[_.cc])){R.push(C),O.length&&this.hls.trigger(U.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:_,error:new Error("Missing initial subtitle PTS")});return}var S=_.decryptdata;if(S==null||S.key==null||S.method!=="AES-128"){var T=this.tracks[_.level],E=this.vttCCs;E[_.cc]||(E[_.cc]={start:_.start,prevCC:this.prevCC,new:!0},this.prevCC=_.cc),T&&T.textCodec===I.IMSC1_CODEC?this._parseIMSC1(_,w):this._parseVTTs(_,w,E)}}else this.hls.trigger(U.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:_,error:new Error("Empty subtitle payload")})},u._parseIMSC1=function(s,C){var _=this,w=this.hls;Object(I.parseIMSC1)(C,this.initPTS[s.cc],this.timescale[s.cc],function(O){_._appendCues(O,s.level),w.trigger(U.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:s})},function(O){f.logger.log("Failed to parse IMSC1: "+O),w.trigger(U.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:s,error:O})})},u._parseVTTs=function(s,C,_){var w=this,O=this.hls;Object(H.parseWebVTT)(C,this.initPTS[s.cc],this.timescale[s.cc],_,s.cc,s.start,function(R){w._appendCues(R,s.level),O.trigger(U.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:s})},function(R){w._fallbackToIMSC1(s,C),f.logger.log("Failed to parse VTT cue: "+R),O.trigger(U.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:s,error:R})})},u._fallbackToIMSC1=function(s,C){var _=this,w=this.tracks[s.level];w.textCodec||Object(I.parseIMSC1)(C,this.initPTS[s.cc],this.timescale[s.cc],function(){w.textCodec=I.IMSC1_CODEC,_._parseIMSC1(s,C)},function(){w.textCodec="wvtt"})},u._appendCues=function(s,C){var _=this.hls;if(this.config.renderTextTracksNatively){var w=this.textTracks[C];if(w.mode==="disabled")return;s.forEach(function(S){return Object(n.addCueToTrack)(w,S)})}else{var O=this.tracks[C],R=O.default?"default":"subtitles"+C;_.trigger(U.Events.CUES_PARSED,{type:"subtitles",cues:s,track:R})}},u.onFragDecrypted=function(s,C){var _=C.frag;if(_.type===g.PlaylistLevelType.SUBTITLE){if(!Object(z.isFiniteNumber)(this.initPTS[_.cc])){this.unparsedVttFrags.push(C);return}this.onFragLoaded(U.Events.FRAG_LOADED,C)}},u.onSubtitleTracksCleared=function(){this.tracks=[],this.captionsTracks={}},u.onFragParsingUserdata=function(s,C){var _=this.cea608Parser1,w=this.cea608Parser2;if(!this.enabled||!(_&&w))return;for(var O=0;O<C.samples.length;O++){var R=C.samples[O].bytes;if(R){var S=this.extractCea608Data(R);_.addData(C.samples[O].pts,S[0]),w.addData(C.samples[O].pts,S[1])}}},u.onBufferFlushing=function(s,C){var _=C.startOffset,w=C.endOffset,O=C.endOffsetSubtitles,R=C.type,S=this.media;if(!S||S.currentTime<w)return;if(!R||R==="video"){var T=this.captionsTracks;Object.keys(T).forEach(function(c){return Object(n.removeCuesInRange)(T[c],_,w)})}if(this.config.renderTextTracksNatively&&(_===0&&O!==void 0)){var E=this.textTracks;Object.keys(E).forEach(function(c){return Object(n.removeCuesInRange)(E[c],_,O)})}},u.extractCea608Data=function(s){for(var C=s[0]&31,_=2,w=[[],[]],O=0;O<C;O++){var R=s[_++],S=127&s[_++],T=127&s[_++],E=(4&R)!==0,c=3&R;if(S===0&&T===0)continue;E&&((c===0||c===1)&&(w[c].push(S),w[c].push(T)))}return w},l}();function h(l,u){return l&&l.label===u.name&&!(l.textTrack1||l.textTrack2)}function o(l,u,a,s){return Math.min(u,s)-Math.max(l,a)}function p(){return{ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!1}}}},"./src/crypt/aes-crypto.ts":function(oe,$,k){"use strict";k.r($),k.d($,"default",function(){return z});var z=function(){function U(W,H){this.subtle=void 0,this.aesIV=void 0,this.subtle=W,this.aesIV=H}var L=U.prototype;return L.decrypt=function(H,n){return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},n,H)},U}()},"./src/crypt/aes-decryptor.ts":function(oe,$,k){"use strict";k.r($),k.d($,"removePadding",function(){return U}),k.d($,"default",function(){return L});var z=k("./src/utils/typed-array.ts");function U(W){var H=W.byteLength,n=H&&new DataView(W.buffer).getUint8(H-1);return n?Object(z.sliceUint8)(W,0,H-n):W}var L=function(){function W(){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 H=W.prototype;return H.uint8ArrayToUint32Array_=function(I){for(var g=new DataView(I),f=new Uint32Array(4),m=0;m<4;m++)f[m]=g.getUint32(m*4);return f},H.initTable=function(){var I=this.sBox,g=this.invSBox,f=this.subMix,m=f[0],h=f[1],o=f[2],p=f[3],l=this.invSubMix,u=l[0],a=l[1],s=l[2],C=l[3],_=new Uint32Array(256),w=0,O=0,R=0;for(R=0;R<256;R++)R<128?_[R]=R<<1:_[R]=R<<1^283;for(R=0;R<256;R++){var S=O^O<<1^O<<2^O<<3^O<<4;S=S>>>8^S&255^99,I[w]=S,g[S]=w;var T=_[w],E=_[T],c=_[E],x=_[S]*257^S*16843008;m[w]=x<<24|x>>>8,h[w]=x<<16|x>>>16,o[w]=x<<8|x>>>24,p[w]=x,x=c*16843009^E*65537^T*257^w*16843008,u[S]=x<<24|x>>>8,a[S]=x<<16|x>>>16,s[S]=x<<8|x>>>24,C[S]=x,w?(w=T^_[_[_[c^T]]],O^=_[_[O]]):w=O=1}},H.expandKey=function(I){for(var g=this.uint8ArrayToUint32Array_(I),f=!0,m=0;m<g.length&&f;)f=g[m]===this.key[m],m++;if(f)return;this.key=g;var h=this.keySize=g.length;if(h!==4&&h!==6&&h!==8)throw new Error("Invalid aes key size="+h);var o=this.ksRows=(h+6+1)*4,p,l,u=this.keySchedule=new Uint32Array(o),a=this.invKeySchedule=new Uint32Array(o),s=this.sBox,C=this.rcon,_=this.invSubMix,w=_[0],O=_[1],R=_[2],S=_[3],T,E;for(p=0;p<o;p++){if(p<h){T=u[p]=g[p];continue}E=T,p%h===0?(E=E<<8|E>>>24,E=s[E>>>24]<<24|s[E>>>16&255]<<16|s[E>>>8&255]<<8|s[E&255],E^=C[p/h|0]<<24):h>6&&p%h===4&&(E=s[E>>>24]<<24|s[E>>>16&255]<<16|s[E>>>8&255]<<8|s[E&255]),u[p]=T=(u[p-h]^E)>>>0}for(l=0;l<o;l++)p=o-l,l&3?E=u[p]:E=u[p-4],l<4||p<=4?a[l]=E:a[l]=w[s[E>>>24]]^O[s[E>>>16&255]]^R[s[E>>>8&255]]^S[s[E&255]],a[l]=a[l]>>>0},H.networkToHostOrderSwap=function(I){return I<<24|(I&65280)<<8|(I&16711680)>>8|I>>>24},H.decrypt=function(I,g,f){for(var m=this.keySize+6,h=this.invKeySchedule,o=this.invSBox,p=this.invSubMix,l=p[0],u=p[1],a=p[2],s=p[3],C=this.uint8ArrayToUint32Array_(f),_=C[0],w=C[1],O=C[2],R=C[3],S=new Int32Array(I),T=new Int32Array(S.length),E,c,x,v,y,F,B,A,j,P,b,V,re,ce,me=this.networkToHostOrderSwap;g<S.length;){for(j=me(S[g]),P=me(S[g+1]),b=me(S[g+2]),V=me(S[g+3]),y=j^h[0],F=V^h[1],B=b^h[2],A=P^h[3],re=4,ce=1;ce<m;ce++)E=l[y>>>24]^u[F>>16&255]^a[B>>8&255]^s[A&255]^h[re],c=l[F>>>24]^u[B>>16&255]^a[A>>8&255]^s[y&255]^h[re+1],x=l[B>>>24]^u[A>>16&255]^a[y>>8&255]^s[F&255]^h[re+2],v=l[A>>>24]^u[y>>16&255]^a[F>>8&255]^s[B&255]^h[re+3],y=E,F=c,B=x,A=v,re=re+4;E=o[y>>>24]<<24^o[F>>16&255]<<16^o[B>>8&255]<<8^o[A&255]^h[re],c=o[F>>>24]<<24^o[B>>16&255]<<16^o[A>>8&255]<<8^o[y&255]^h[re+1],x=o[B>>>24]<<24^o[A>>16&255]<<16^o[y>>8&255]<<8^o[F&255]^h[re+2],v=o[A>>>24]<<24^o[y>>16&255]<<16^o[F>>8&255]<<8^o[B&255]^h[re+3],T[g]=me(E^_),T[g+1]=me(v^w),T[g+2]=me(x^O),T[g+3]=me(c^R),_=j,w=P,O=b,R=V,g=g+4}return T.buffer},W}()},"./src/crypt/decrypter.ts":function(oe,$,k){"use strict";k.r($),k.d($,"default",function(){return g});var z=k("./src/crypt/aes-crypto.ts"),U=k("./src/crypt/fast-aes-key.ts"),L=k("./src/crypt/aes-decryptor.ts"),W=k("./src/utils/logger.ts"),H=k("./src/utils/mp4-tools.ts"),n=k("./src/utils/typed-array.ts"),I=16,g=function(){function f(h,o,p){var l=p===void 0?{}:p,u=l.removePKCS7Padding,a=u===void 0?!0:u;if(this.logEnabled=!0,this.observer=void 0,this.config=void 0,this.removePKCS7Padding=void 0,this.subtle=null,this.softwareDecrypter=null,this.key=null,this.fastAesKey=null,this.remainderData=null,this.currentIV=null,this.currentResult=null,this.observer=h,this.config=o,this.removePKCS7Padding=a,a)try{var s=self.crypto;s&&(this.subtle=s.subtle||s.webkitSubtle)}catch(C){}this.subtle===null&&(this.config.enableSoftwareAES=!0)}var m=f.prototype;return m.destroy=function(){this.observer=null},m.isSync=function(){return this.config.enableSoftwareAES},m.flush=function(){var o=this.currentResult;if(!o){this.reset();return}var p=new Uint8Array(o);return this.reset(),this.removePKCS7Padding?Object(L.removePadding)(p):p},m.reset=function(){this.currentResult=null,this.currentIV=null,this.remainderData=null,this.softwareDecrypter&&(this.softwareDecrypter=null)},m.decrypt=function(o,p,l,u){if(this.config.enableSoftwareAES){this.softwareDecrypt(new Uint8Array(o),p,l);var a=this.flush();a&&u(a.buffer)}else this.webCryptoDecrypt(new Uint8Array(o),p,l).then(u)},m.softwareDecrypt=function(o,p,l){var u=this.currentIV,a=this.currentResult,s=this.remainderData;this.logOnce("JS AES decrypt"),s&&(o=Object(H.appendUint8Array)(s,o),this.remainderData=null);var C=this.getValidChunk(o);if(!C.length)return null;u&&(l=u);var _=this.softwareDecrypter;_||(_=this.softwareDecrypter=new L.default),_.expandKey(p);var w=a;return this.currentResult=_.decrypt(C.buffer,0,l),this.currentIV=Object(n.sliceUint8)(C,-16).buffer,w||null},m.webCryptoDecrypt=function(o,p,l){var u=this,a=this.subtle;return(this.key!==p||!this.fastAesKey)&&(this.key=p,this.fastAesKey=new U.default(a,p)),this.fastAesKey.expandKey().then(function(s){if(!a)return Promise.reject(new Error("web crypto not initialized"));var C=new z.default(a,l);return C.decrypt(o.buffer,s)}).catch(function(s){return u.onWebCryptoError(s,o,p,l)})},m.onWebCryptoError=function(o,p,l,u){return W.logger.warn("[decrypter.ts]: WebCrypto Error, disable WebCrypto API:",o),this.config.enableSoftwareAES=!0,this.logEnabled=!0,this.softwareDecrypt(p,l,u)},m.getValidChunk=function(o){var p=o,l=o.length-o.length%I;return l!==o.length&&(p=Object(n.sliceUint8)(o,0,l),this.remainderData=Object(n.sliceUint8)(o,l)),p},m.logOnce=function(o){if(!this.logEnabled)return;W.logger.log("[decrypter.ts]: "+o),this.logEnabled=!1},f}()},"./src/crypt/fast-aes-key.ts":function(oe,$,k){"use strict";k.r($),k.d($,"default",function(){return z});var z=function(){function U(W,H){this.subtle=void 0,this.key=void 0,this.subtle=W,this.key=H}var L=U.prototype;return L.expandKey=function(){return this.subtle.importKey("raw",this.key,{name:"AES-CBC"},!1,["encrypt","decrypt"])},U}()},"./src/demux/aacdemuxer.ts":function(oe,$,k){"use strict";k.r($);var z=k("./src/demux/base-audio-demuxer.ts"),U=k("./src/demux/adts.ts"),L=k("./src/utils/logger.ts"),W=k("./src/demux/id3.ts");function H(g,f){g.prototype=Object.create(f.prototype),g.prototype.constructor=g,n(g,f)}function n(g,f){return n=Object.setPrototypeOf||function(h,o){return h.__proto__=o,h},n(g,f)}var I=function(g){H(f,g);function f(h,o){var p;return p=g.call(this)||this,p.observer=void 0,p.config=void 0,p.observer=h,p.config=o,p}var m=f.prototype;return m.resetInitSegment=function(o,p,l){g.prototype.resetInitSegment.call(this,o,p,l),this._audioTrack={container:"audio/adts",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!0,samples:[],manifestCodec:o,duration:l,inputTimeScale:9e4,dropped:0}},f.probe=function(o){if(!o)return!1;for(var p=W.getID3Data(o,0)||[],l=p.length,u=o.length;l<u;l++)if(U.probe(o,l))return L.logger.log("ADTS sync word found !"),!0;return!1},m.canParse=function(o,p){return U.canParse(o,p)},m.appendFrame=function(o,p,l){U.initTrackConfig(o,this.observer,p,l,o.manifestCodec);var u=U.appendFrame(o,p,l,this.initPTS,this.frameIndex);if(u&&u.missing===0)return u},f}(z.default);I.minProbeByteLength=9,$.default=I},"./src/demux/adts.ts":function(oe,$,k){"use strict";k.r($),k.d($,"getAudioConfig",function(){return W}),k.d($,"isHeaderPattern",function(){return H}),k.d($,"getHeaderLength",function(){return n}),k.d($,"getFullFrameLength",function(){return I}),k.d($,"canGetFrameLength",function(){return g}),k.d($,"isHeader",function(){return f}),k.d($,"canParse",function(){return m}),k.d($,"probe",function(){return h}),k.d($,"initTrackConfig",function(){return o}),k.d($,"getFrameDuration",function(){return p}),k.d($,"parseFrameHeader",function(){return l}),k.d($,"appendFrame",function(){return u});var z=k("./src/utils/logger.ts"),U=k("./src/errors.ts"),L=k("./src/events.ts");function W(a,s,C,_){var w,O,R,S,T=navigator.userAgent.toLowerCase(),E=_,c=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];w=((s[C+2]&192)>>>6)+1;var x=(s[C+2]&60)>>>2;if(x>c.length-1){a.trigger(L.Events.ERROR,{type:U.ErrorTypes.MEDIA_ERROR,details:U.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"invalid ADTS sampling index:"+x});return}return R=(s[C+2]&1)<<2,R|=(s[C+3]&192)>>>6,z.logger.log("manifest codec:"+_+", ADTS type:"+w+", samplingIndex:"+x),/firefox/i.test(T)?x>=6?(w=5,S=new Array(4),O=x-3):(w=2,S=new Array(2),O=x):T.indexOf("android")!==-1?(w=2,S=new Array(2),O=x):(w=5,S=new Array(4),_&&(_.indexOf("mp4a.40.29")!==-1||_.indexOf("mp4a.40.5")!==-1)||!_&&x>=6?O=x-3:((_&&_.indexOf("mp4a.40.2")!==-1&&(x>=6&&R===1||/vivaldi/i.test(T))||!_&&R===1)&&(w=2,S=new Array(2)),O=x)),S[0]=w<<3,S[0]|=(x&14)>>1,S[1]|=(x&1)<<7,S[1]|=R<<3,w===5&&(S[1]|=(O&14)>>1,S[2]=(O&1)<<7,S[2]|=2<<2,S[3]=0),{config:S,samplerate:c[x],channelCount:R,codec:"mp4a.40."+w,manifestCodec:E}}function H(a,s){return a[s]===255&&(a[s+1]&246)===240}function n(a,s){return a[s+1]&1?7:9}function I(a,s){return(a[s+3]&3)<<11|a[s+4]<<3|(a[s+5]&224)>>>5}function g(a,s){return s+5<a.length}function f(a,s){return s+1<a.length&&H(a,s)}function m(a,s){return g(a,s)&&H(a,s)&&I(a,s)<=a.length-s}function h(a,s){if(f(a,s)){var C=n(a,s);if(s+C>=a.length)return!1;var _=I(a,s);if(_<=C)return!1;var w=s+_;return w===a.length||f(a,w)}return!1}function o(a,s,C,_,w){if(!a.samplerate){var O=W(s,C,_,w);if(!O)return;a.config=O.config,a.samplerate=O.samplerate,a.channelCount=O.channelCount,a.codec=O.codec,a.manifestCodec=O.manifestCodec,z.logger.log("parsed codec:"+a.codec+", rate:"+O.samplerate+", channels:"+O.channelCount)}}function p(a){return 1024*9e4/a}function l(a,s,C,_,w){var O=n(a,s),R=I(a,s);if(R-=O,R>0){var S=C+_*w;return{headerLength:O,frameLength:R,stamp:S}}}function u(a,s,C,_,w){var O=p(a.samplerate),R=l(s,C,_,w,O);if(R){var S=R.frameLength,T=R.headerLength,E=R.stamp,c=T+S,x=Math.max(0,C+c-s.length),v;x?(v=new Uint8Array(c-T),v.set(s.subarray(C+T,s.length),0)):v=s.subarray(C+T,C+c);var y={unit:v,pts:E};return x||a.samples.push(y),{sample:y,length:c,missing:x}}}},"./src/demux/base-audio-demuxer.ts":function(oe,$,k){"use strict";k.r($),k.d($,"initPTSFn",function(){return I});var z=k("./src/polyfills/number.ts"),U=k("./src/demux/id3.ts"),L=k("./src/demux/dummy-demuxed-track.ts"),W=k("./src/utils/mp4-tools.ts"),H=k("./src/utils/typed-array.ts"),n=function(){function g(){this._audioTrack=void 0,this._id3Track=void 0,this.frameIndex=0,this.cachedData=null,this.initPTS=null}var f=g.prototype;return f.resetInitSegment=function(h,o,p){this._id3Track={type:"id3",id:3,pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0}},f.resetTimeStamp=function(){},f.resetContiguity=function(){},f.canParse=function(h,o){return!1},f.appendFrame=function(h,o,p){},f.demux=function(h,o){this.cachedData&&(h=Object(W.appendUint8Array)(this.cachedData,h),this.cachedData=null);var p=U.getID3Data(h,0),l=p?p.length:0,u,a,s=this._audioTrack,C=this._id3Track,_=p?U.getTimeStamp(p):void 0,w=h.length;for((this.frameIndex===0||this.initPTS===null)&&(this.initPTS=I(_,o)),p&&p.length>0&&C.samples.push({pts:this.initPTS,dts:this.initPTS,data:p}),a=this.initPTS;l<w;){if(this.canParse(h,l)){var O=this.appendFrame(s,h,l);O?(this.frameIndex++,a=O.sample.pts,l+=O.length,u=l):l=w}else U.canParse(h,l)?(p=U.getID3Data(h,l),C.samples.push({pts:a,dts:a,data:p}),l+=p.length,u=l):l++;if(l===w&&u!==w){var R=Object(H.sliceUint8)(h,u);this.cachedData?this.cachedData=Object(W.appendUint8Array)(this.cachedData,R):this.cachedData=R}}return{audioTrack:s,avcTrack:Object(L.dummyTrack)(),id3Track:C,textTrack:Object(L.dummyTrack)()}},f.demuxSampleAes=function(h,o,p){return Promise.reject(new Error("["+this+"] This demuxer does not support Sample-AES decryption"))},f.flush=function(h){var o=this.cachedData;return o&&(this.cachedData=null,this.demux(o,0)),this.frameIndex=0,{audioTrack:this._audioTrack,avcTrack:Object(L.dummyTrack)(),id3Track:this._id3Track,textTrack:Object(L.dummyTrack)()}},f.destroy=function(){},g}(),I=function(f,m){return Object(z.isFiniteNumber)(f)?f*90:m*9e4};$.default=n},"./src/demux/chunk-cache.ts":function(oe,$,k){"use strict";k.r($),k.d($,"default",function(){return z});var z=function(){function L(){this.chunks=[],this.dataLength=0}var W=L.prototype;return W.push=function(n){this.chunks.push(n),this.dataLength+=n.length},W.flush=function(){var n=this.chunks,I=this.dataLength,g;if(n.length)n.length===1?g=n[0]:g=U(n,I);else return new Uint8Array(0);return this.reset(),g},W.reset=function(){this.chunks.length=0,this.dataLength=0},L}();function U(L,W){for(var H=new Uint8Array(W),n=0,I=0;I<L.length;I++){var g=L[I];H.set(g,n),n+=g.length}return H}},"./src/demux/dummy-demuxed-track.ts":function(oe,$,k){"use strict";k.r($),k.d($,"dummyTrack",function(){return z});function z(){return{type:"",id:-1,pid:-1,inputTimeScale:9e4,sequenceNumber:-1,samples:[],dropped:0}}},"./src/demux/exp-golomb.ts":function(oe,$,k){"use strict";k.r($);var z=k("./src/utils/logger.ts"),U=function(){function L(H){this.data=void 0,this.bytesAvailable=void 0,this.word=void 0,this.bitsAvailable=void 0,this.data=H,this.bytesAvailable=H.byteLength,this.word=0,this.bitsAvailable=0}var W=L.prototype;return W.loadWord=function(){var n=this.data,I=this.bytesAvailable,g=n.byteLength-I,f=new Uint8Array(4),m=Math.min(4,I);if(m===0)throw new Error("no bytes available");f.set(n.subarray(g,g+m)),this.word=new DataView(f.buffer).getUint32(0),this.bitsAvailable=m*8,this.bytesAvailable-=m},W.skipBits=function(n){var I;this.bitsAvailable>n?(this.word<<=n,this.bitsAvailable-=n):(n-=this.bitsAvailable,I=n>>3,n-=I>>3,this.bytesAvailable-=I,this.loadWord(),this.word<<=n,this.bitsAvailable-=n)},W.readBits=function(n){var I=Math.min(this.bitsAvailable,n),g=this.word>>>32-I;return n>32&&z.logger.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=I,this.bitsAvailable>0?this.word<<=I:this.bytesAvailable>0&&this.loadWord(),I=n-I,I>0&&this.bitsAvailable?g<<I|this.readBits(I):g},W.skipLZ=function(){var n;for(n=0;n<this.bitsAvailable;++n)if((this.word&2147483648>>>n)!==0)return this.word<<=n,this.bitsAvailable-=n,n;return this.loadWord(),n+this.skipLZ()},W.skipUEG=function(){this.skipBits(1+this.skipLZ())},W.skipEG=function(){this.skipBits(1+this.skipLZ())},W.readUEG=function(){var n=this.skipLZ();return this.readBits(n+1)-1},W.readEG=function(){var n=this.readUEG();return 1&n?1+n>>>1:-1*(n>>>1)},W.readBoolean=function(){return this.readBits(1)===1},W.readUByte=function(){return this.readBits(8)},W.readUShort=function(){return this.readBits(16)},W.readUInt=function(){return this.readBits(32)},W.skipScalingList=function(n){for(var I=8,g=8,f,m=0;m<n;m++)g!==0&&(f=this.readEG(),g=(I+f+256)%256),I=g===0?I:g},W.readSPS=function(){var n=0,I=0,g=0,f=0,m,h,o,p=this.readUByte.bind(this),l=this.readBits.bind(this),u=this.readUEG.bind(this),a=this.readBoolean.bind(this),s=this.skipBits.bind(this),C=this.skipEG.bind(this),_=this.skipUEG.bind(this),w=this.skipScalingList.bind(this);p();var O=p();if(l(5),s(3),p(),_(),O===100||O===110||O===122||O===244||O===44||O===83||O===86||O===118||O===128){var R=u();if(R===3&&s(1),_(),_(),s(1),a())for(h=R!==3?8:12,o=0;o<h;o++)a()&&(o<6?w(16):w(64))}_();var S=u();if(S===0)u();else if(S===1)for(s(1),C(),C(),m=u(),o=0;o<m;o++)C();_(),s(1);var T=u(),E=u(),c=l(1);c===0&&s(1),s(1),a()&&(n=u(),I=u(),g=u(),f=u());var x=[1,1];if(a()&&a()){var v=p();switch(v){case 1:x=[1,1];break;case 2:x=[12,11];break;case 3:x=[10,11];break;case 4:x=[16,11];break;case 5:x=[40,33];break;case 6:x=[24,11];break;case 7:x=[20,11];break;case 8:x=[32,11];break;case 9:x=[80,33];break;case 10:x=[18,11];break;case 11:x=[15,11];break;case 12:x=[64,33];break;case 13:x=[160,99];break;case 14:x=[4,3];break;case 15:x=[3,2];break;case 16:x=[2,1];break;case 255:{x=[p()<<8|p(),p()<<8|p()];break}}}return{width:Math.ceil((T+1)*16-n*2-I*2),height:(2-c)*(E+1)*16-(c?2:4)*(g+f),pixelRatio:x}},W.readSliceType=function(){return this.readUByte(),this.readUEG(),this.readUEG()},L}();$.default=U},"./src/demux/id3.ts":function(oe,$,k){"use strict";k.r($),k.d($,"isHeader",function(){return z}),k.d($,"isFooter",function(){return U}),k.d($,"getID3Data",function(){return L}),k.d($,"canParse",function(){return H}),k.d($,"getTimeStamp",function(){return n}),k.d($,"isTimeStampFrame",function(){return I}),k.d($,"getID3Frames",function(){return f}),k.d($,"decodeFrame",function(){return m}),k.d($,"utf8ArrayToStr",function(){return u}),k.d($,"testables",function(){return a});var z=function(w,O){return O+10<=w.length&&(w[O]===73&&w[O+1]===68&&w[O+2]===51&&(w[O+3]<255&&w[O+4]<255&&(w[O+6]<128&&w[O+7]<128&&w[O+8]<128&&w[O+9]<128)))},U=function(w,O){return O+10<=w.length&&(w[O]===51&&w[O+1]===68&&w[O+2]===73&&(w[O+3]<255&&w[O+4]<255&&(w[O+6]<128&&w[O+7]<128&&w[O+8]<128&&w[O+9]<128)))},L=function(w,O){for(var R=O,S=0;z(w,O);){S+=10;var T=W(w,O+6);S+=T,U(w,O+10)&&(S+=10),O+=S}return S>0?w.subarray(R,R+S):void 0},W=function(w,O){var R=0;return R=(w[O]&127)<<21,R|=(w[O+1]&127)<<14,R|=(w[O+2]&127)<<7,R|=w[O+3]&127,R},H=function(w,O){return z(w,O)&&W(w,O+6)+10<=w.length-O},n=function(w){for(var O=f(w),R=0;R<O.length;R++){var S=O[R];if(I(S))return l(S)}return},I=function(w){return w&&w.key==="PRIV"&&w.info==="com.apple.streaming.transportStreamTimestamp"},g=function(w){var O=String.fromCharCode(w[0],w[1],w[2],w[3]),R=W(w,4),S=10;return{type:O,size:R,data:w.subarray(S,S+R)}},f=function(w){for(var O=0,R=[];z(w,O);){var S=W(w,O+6);O+=10;for(var T=O+S;O+8<T;){var E=g(w.subarray(O)),c=m(E);c&&R.push(c),O+=E.size+10}U(w,O)&&(O+=10)}return R},m=function(w){return w.type==="PRIV"?h(w):w.type[0]==="W"?p(w):o(w)},h=function(w){if(w.size<2)return;var O=u(w.data,!0),R=new Uint8Array(w.data.subarray(O.length+1));return{key:w.type,info:O,data:R.buffer}},o=function(w){if(w.size<2)return;if(w.type==="TXXX"){var O=1,R=u(w.data.subarray(O),!0);O+=R.length+1;var S=u(w.data.subarray(O));return{key:w.type,info:R,data:S}}var T=u(w.data.subarray(1));return{key:w.type,data:T}},p=function(w){if(w.type==="WXXX"){if(w.size<2)return;var O=1,R=u(w.data.subarray(O),!0);O+=R.length+1;var S=u(w.data.subarray(O));return{key:w.type,info:R,data:S}}var T=u(w.data);return{key:w.type,data:T}},l=function(w){if(w.data.byteLength===8){var O=new Uint8Array(w.data),R=O[3]&1,S=(O[4]<<23)+(O[5]<<15)+(O[6]<<7)+O[7];return S/=45,R&&(S+=4772185884e-2),Math.round(S)}return},u=function(w,O){O===void 0&&(O=!1);var R=C();if(R){var S=R.decode(w);if(O){var T=S.indexOf("\0");return T!==-1?S.substring(0,T):S}return S.replace(/\0/g,"")}for(var E=w.length,c,x,v,y="",F=0;F<E;){if(c=w[F++],c===0&&O)return y;if(c===0||c===3)continue;switch(c>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:y+=String.fromCharCode(c);break;case 12:case 13:x=w[F++],y+=String.fromCharCode((c&31)<<6|x&63);break;case 14:x=w[F++],v=w[F++],y+=String.fromCharCode((c&15)<<12|(x&63)<<6|(v&63)<<0);break;default:}}return y},a={decodeTextFrame:o},s;function C(){return!s&&typeof self.TextDecoder!="undefined"&&(s=new self.TextDecoder("utf-8")),s}},"./src/demux/mp3demuxer.ts":function(oe,$,k){"use strict";k.r($);var z=k("./src/demux/base-audio-demuxer.ts"),U=k("./src/demux/id3.ts"),L=k("./src/utils/logger.ts"),W=k("./src/demux/mpegaudio.ts");function H(g,f){g.prototype=Object.create(f.prototype),g.prototype.constructor=g,n(g,f)}function n(g,f){return n=Object.setPrototypeOf||function(h,o){return h.__proto__=o,h},n(g,f)}var I=function(g){H(f,g);function f(){return g.apply(this,arguments)||this}var m=f.prototype;return m.resetInitSegment=function(o,p,l){g.prototype.resetInitSegment.call(this,o,p,l),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!1,samples:[],manifestCodec:o,duration:l,inputTimeScale:9e4,dropped:0}},f.probe=function(o){if(!o)return!1;for(var p=U.getID3Data(o,0)||[],l=p.length,u=o.length;l<u;l++)if(W.probe(o,l))return L.logger.log("MPEG Audio sync word found !"),!0;return!1},m.canParse=function(o,p){return W.canParse(o,p)},m.appendFrame=function(o,p,l){return this.initPTS===null?void 0:W.appendFrame(o,p,l,this.initPTS,this.frameIndex)},f}(z.default);I.minProbeByteLength=4,$.default=I},"./src/demux/mp4demuxer.ts":function(oe,$,k){"use strict";k.r($);var z=k("./src/utils/mp4-tools.ts"),U=k("./src/demux/dummy-demuxed-track.ts"),L=function(){function W(n,I){this.remainderData=null,this.config=void 0,this.config=I}var H=W.prototype;return H.resetTimeStamp=function(){},H.resetInitSegment=function(){},H.resetContiguity=function(){},W.probe=function(I){return Object(z.findBox)({data:I,start:0,end:Math.min(I.length,16384)},["moof"]).length>0},H.demux=function(I){var g=I,f=Object(U.dummyTrack)();if(this.config.progressive){this.remainderData&&(g=Object(z.appendUint8Array)(this.remainderData,I));var m=Object(z.segmentValidRange)(g);this.remainderData=m.remainder,f.samples=m.valid||new Uint8Array}else f.samples=g;return{audioTrack:Object(U.dummyTrack)(),avcTrack:f,id3Track:Object(U.dummyTrack)(),textTrack:Object(U.dummyTrack)()}},H.flush=function(){var I=Object(U.dummyTrack)();return I.samples=this.remainderData||new Uint8Array,this.remainderData=null,{audioTrack:Object(U.dummyTrack)(),avcTrack:I,id3Track:Object(U.dummyTrack)(),textTrack:Object(U.dummyTrack)()}},H.demuxSampleAes=function(I,g,f){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))},H.destroy=function(){},W}();L.minProbeByteLength=1024,$.default=L},"./src/demux/mpegaudio.ts":function(oe,$,k){"use strict";k.r($),k.d($,"appendFrame",function(){return n}),k.d($,"parseHeader",function(){return I}),k.d($,"isHeaderPattern",function(){return g}),k.d($,"isHeader",function(){return f}),k.d($,"canParse",function(){return m}),k.d($,"probe",function(){return h});var z=null,U=[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],L=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],W=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],H=[0,1,1,4];function n(o,p,l,u,a){if(l+24>p.length)return;var s=I(p,l);if(s&&l+s.frameLength<=p.length){var C=s.samplesPerFrame*9e4/s.sampleRate,_=u+a*C,w={unit:p.subarray(l,l+s.frameLength),pts:_,dts:_};return o.config=[],o.channelCount=s.channelCount,o.samplerate=s.sampleRate,o.samples.push(w),{sample:w,length:s.frameLength,missing:0}}}function I(o,p){var l=o[p+1]>>3&3,u=o[p+1]>>1&3,a=o[p+2]>>4&15,s=o[p+2]>>2&3;if(l!==1&&a!==0&&a!==15&&s!==3){var C=o[p+2]>>1&1,_=o[p+3]>>6,w=l===3?3-u:u===3?3:4,O=U[w*14+a-1]*1e3,R=l===3?0:l===2?1:2,S=L[R*3+s],T=_===3?1:2,E=W[l][u],c=H[u],x=E*8*c,v=Math.floor(E*O/S+C)*c;if(z===null){var y=navigator.userAgent||"",F=y.match(/Chrome\/(\d+)/i);z=F?parseInt(F[1]):0}var B=!!z&&z<=87;return B&&u===2&&O>=224e3&&_===0&&(o[p+3]=o[p+3]|128),{sampleRate:S,channelCount:T,frameLength:v,samplesPerFrame:x}}}function g(o,p){return o[p]===255&&(o[p+1]&224)===224&&(o[p+1]&6)!==0}function f(o,p){return p+1<o.length&&g(o,p)}function m(o,p){var l=4;return g(o,p)&&l<=o.length-p}function h(o,p){if(p+1<o.length&&g(o,p)){var l=4,u=I(o,p),a=l;u!=null&&u.frameLength&&(a=u.frameLength);var s=p+a;return s===o.length||f(o,s)}return!1}},"./src/demux/sample-aes.ts":function(oe,$,k){"use strict";k.r($);var z=k("./src/crypt/decrypter.ts"),U=k("./src/demux/tsdemuxer.ts"),L=function(){function W(n,I,g){this.keyData=void 0,this.decrypter=void 0,this.keyData=g,this.decrypter=new z.default(n,I,{removePKCS7Padding:!1})}var H=W.prototype;return H.decryptBuffer=function(I,g){this.decrypter.decrypt(I,this.keyData.key.buffer,this.keyData.iv.buffer,g)},H.decryptAacSample=function(I,g,f,m){var h=I[g].unit,o=h.subarray(16,h.length-h.length%16),p=o.buffer.slice(o.byteOffset,o.byteOffset+o.length),l=this;this.decryptBuffer(p,function(u){var a=new Uint8Array(u);h.set(a,16),m||l.decryptAacSamples(I,g+1,f)})},H.decryptAacSamples=function(I,g,f){for(;;g++){if(g>=I.length){f();return}if(I[g].unit.length<32)continue;var m=this.decrypter.isSync();if(this.decryptAacSample(I,g,f,m),!m)return}},H.getAvcEncryptedData=function(I){for(var g=Math.floor((I.length-48)/160)*16+16,f=new Int8Array(g),m=0,h=32;h<=I.length-16;h+=160,m+=16)f.set(I.subarray(h,h+16),m);return f},H.getAvcDecryptedUnit=function(I,g){for(var f=new Uint8Array(g),m=0,h=32;h<=I.length-16;h+=160,m+=16)I.set(f.subarray(m,m+16),h);return I},H.decryptAvcSample=function(I,g,f,m,h,o){var p=Object(U.discardEPB)(h.data),l=this.getAvcEncryptedData(p),u=this;this.decryptBuffer(l.buffer,function(a){h.data=u.getAvcDecryptedUnit(p,a),o||u.decryptAvcSamples(I,g,f+1,m)})},H.decryptAvcSamples=function(I,g,f,m){if(I instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;g++,f=0){if(g>=I.length){m();return}for(var h=I[g].units;!(f>=h.length);f++){var o=h[f];if(o.data.length<=48||o.type!==1&&o.type!==5)continue;var p=this.decrypter.isSync();if(this.decryptAvcSample(I,g,f,m,o,p),!p)return}}},W}();$.default=L},"./src/demux/transmuxer-interface.ts":function(oe,$,k){"use strict";k.r($),k.d($,"default",function(){return h});var z=k("./node_modules/webworkify-webpack/index.js"),U=k.n(z),L=k("./src/events.ts"),W=k("./src/demux/transmuxer.ts"),H=k("./src/utils/logger.ts"),n=k("./src/errors.ts"),I=k("./src/utils/mediasource-helper.ts"),g=k("./node_modules/eventemitter3/index.js"),f=k.n(g),m=Object(I.getMediaSource)()||{isTypeSupported:function(){return!1}},h=function(){function o(l,u,a,s){var C=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=l,this.id=u,this.onTransmuxComplete=a,this.onFlush=s;var _=l.config,w=function(E,c){c=c||{},c.frag=C.frag,c.id=C.id,l.trigger(E,c)};this.observer=new g.EventEmitter,this.observer.on(L.Events.FRAG_DECRYPTED,w),this.observer.on(L.Events.ERROR,w);var O={mp4:m.isTypeSupported("video/mp4"),mpeg:m.isTypeSupported("audio/mpeg"),mp3:m.isTypeSupported('audio/mp4; codecs="mp3"')},R=navigator.vendor;if(_.enableWorker&&typeof Worker!="undefined"){H.logger.log("demuxing in webworker");var S;try{S=this.worker=z("./src/demux/transmuxer-worker.ts"),this.onwmsg=this.onWorkerMessage.bind(this),S.addEventListener("message",this.onwmsg),S.onerror=function(T){l.trigger(L.Events.ERROR,{type:n.ErrorTypes.OTHER_ERROR,details:n.ErrorDetails.INTERNAL_EXCEPTION,fatal:!0,event:"demuxerWorker",error:new Error(T.message+" ("+T.filename+":"+T.lineno+")")})},S.postMessage({cmd:"init",typeSupported:O,vendor:R,id:u,config:JSON.stringify(_)})}catch(T){H.logger.warn("Error in worker:",T),H.logger.error("Error while initializing DemuxerWorker, fallback to inline"),S&&self.URL.revokeObjectURL(S.objectURL),this.transmuxer=new W.default(this.observer,O,_,R,u),this.worker=null}}else this.transmuxer=new W.default(this.observer,O,_,R,u)}var p=o.prototype;return p.destroy=function(){var u=this.worker;if(u)u.removeEventListener("message",this.onwmsg),u.terminate(),this.worker=null;else{var a=this.transmuxer;a&&(a.destroy(),this.transmuxer=null)}var s=this.observer;s&&s.removeAllListeners(),this.observer=null},p.push=function(u,a,s,C,_,w,O,R,S,T){var E=this;S.transmuxing.start=self.performance.now();var c=this.transmuxer,x=this.worker,v=w?w.start:_.start,y=_.decryptdata,F=this.frag,B=!(F&&_.cc===F.cc),A=!(F&&S.level===F.level),j=F?S.sn-F.sn:-1,P=this.part?S.part-this.part.index:1,b=!A&&(j===1||j===0&&P===1),V=self.performance.now();(A||j||_.stats.parsing.start===0)&&(_.stats.parsing.start=V),w&&(P||!b)&&(w.stats.parsing.start=V);var re=new W.TransmuxState(B,b,R,A,v);if(!b||B){H.logger.log("[transmuxer-interface, "+_.type+"]: Starting new transmux session for sn: "+S.sn+" p: "+S.part+" level: "+S.level+" id: "+S.id+`
discontinuity: `+B+`
trackSwitch: `+A+`
contiguous: `+b+`
accurateTimeOffset: `+R+`
timeOffset: `+v);var ce=new W.TransmuxConfig(s,C,a,O,T);this.configureTransmuxer(ce)}if(this.frag=_,this.part=w,x)x.postMessage({cmd:"demux",data:u,decryptdata:y,chunkMeta:S,state:re},u instanceof ArrayBuffer?[u]:[]);else if(c){var me=c.push(u,y,S,re);Object(W.isPromise)(me)?me.then(function(De){E.handleTransmuxComplete(De)}):this.handleTransmuxComplete(me)}},p.flush=function(u){var a=this;u.transmuxing.start=self.performance.now();var s=this.transmuxer,C=this.worker;if(C)C.postMessage({cmd:"flush",chunkMeta:u});else if(s){var _=s.flush(u);Object(W.isPromise)(_)?_.then(function(w){a.handleFlushResult(w,u)}):this.handleFlushResult(_,u)}},p.handleFlushResult=function(u,a){var s=this;u.forEach(function(C){s.handleTransmuxComplete(C)}),this.onFlush(a)},p.onWorkerMessage=function(u){var a=u.data,s=this.hls;switch(a.event){case"init":{self.URL.revokeObjectURL(this.worker.objectURL);break}case"transmuxComplete":{this.handleTransmuxComplete(a.data);break}case"flush":{this.onFlush(a.data);break}default:{a.data=a.data||{},a.data.frag=this.frag,a.data.id=this.id,s.trigger(a.event,a.data);break}}},p.configureTransmuxer=function(u){var a=this.worker,s=this.transmuxer;a?a.postMessage({cmd:"configure",config:u}):s&&s.configure(u)},p.handleTransmuxComplete=function(u){u.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(u)},o}()},"./src/demux/transmuxer-worker.ts":function(oe,$,k){"use strict";k.r($),k.d($,"default",function(){return n});var z=k("./src/demux/transmuxer.ts"),U=k("./src/events.ts"),L=k("./src/utils/logger.ts"),W=k("./node_modules/eventemitter3/index.js"),H=k.n(W);function n(h){var o=new W.EventEmitter,p=function(u,a){h.postMessage({event:u,data:a})};o.on(U.Events.FRAG_DECRYPTED,p),o.on(U.Events.ERROR,p),h.addEventListener("message",function(l){var u=l.data;switch(u.cmd){case"init":{var a=JSON.parse(u.config);h.transmuxer=new z.default(o,u.typeSupported,a,u.vendor,u.id),Object(L.enableLogs)(a.debug),p("init",null);break}case"configure":{h.transmuxer.configure(u.config);break}case"demux":{var s=h.transmuxer.push(u.data,u.decryptdata,u.chunkMeta,u.state);Object(z.isPromise)(s)?s.then(function(w){I(h,w)}):I(h,s);break}case"flush":{var C=u.chunkMeta,_=h.transmuxer.flush(C);Object(z.isPromise)(_)?_.then(function(w){f(h,w,C)}):f(h,_,C);break}default:break}})}function I(h,o){if(m(o.remuxResult))return;var p=[],l=o.remuxResult,u=l.audio,a=l.video;u&&g(p,u),a&&g(p,a),h.postMessage({event:"transmuxComplete",data:o},p)}function g(h,o){o.data1&&h.push(o.data1.buffer),o.data2&&h.push(o.data2.buffer)}function f(h,o,p){o.forEach(function(l){I(h,l)}),h.postMessage({event:"flush",data:p})}function m(h){return!h.audio&&!h.video&&!h.text&&!h.id3&&!h.initSegment}},"./src/demux/transmuxer.ts":function(oe,$,k){"use strict";k.r($),k.d($,"default",function(){return a}),k.d($,"isPromise",function(){return _}),k.d($,"TransmuxConfig",function(){return w}),k.d($,"TransmuxState",function(){return O});var z=k("./src/events.ts"),U=k("./src/errors.ts"),L=k("./src/crypt/decrypter.ts"),W=k("./src/demux/aacdemuxer.ts"),H=k("./src/demux/mp4demuxer.ts"),n=k("./src/demux/tsdemuxer.ts"),I=k("./src/demux/mp3demuxer.ts"),g=k("./src/remux/mp4-remuxer.ts"),f=k("./src/remux/passthrough-remuxer.ts"),m=k("./src/demux/chunk-cache.ts"),h=k("./src/utils/mp4-tools.ts"),o=k("./src/utils/logger.ts"),p;try{p=self.performance.now.bind(self.performance)}catch(R){o.logger.debug("Unable to use Performance API on this environment"),p=self.Date.now}var l=[{demux:n.default,remux:g.default},{demux:H.default,remux:f.default},{demux:W.default,remux:g.default},{demux:I.default,remux:g.default}],u=1024;l.forEach(function(R){var S=R.demux;u=Math.max(u,S.minProbeByteLength)});var a=function(){function R(T,E,c,x,v){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 m.default,this.observer=T,this.typeSupported=E,this.config=c,this.vendor=x,this.id=v}var S=R.prototype;return S.configure=function(E){this.transmuxConfig=E,this.decrypter&&this.decrypter.reset()},S.push=function(E,c,x,v){var y=this,F=x.transmuxing;F.executeStart=p();var B=new Uint8Array(E),A=this.cache,j=this.config,P=this.currentTransmuxState,b=this.transmuxConfig;v&&(this.currentTransmuxState=v);var V=s(B,c);if(V&&V.method==="AES-128"){var re=this.getDecrypter();if(j.enableSoftwareAES){var ce=re.softwareDecrypt(B,V.key.buffer,V.iv.buffer);if(!ce)return F.executeEnd=p(),C(x);B=new Uint8Array(ce)}else return this.decryptionPromise=re.webCryptoDecrypt(B,V.key.buffer,V.iv.buffer).then(function(Se){var Pe=y.push(Se,null,x);return y.decryptionPromise=null,Pe}),this.decryptionPromise}var me=v||P,De=me.contiguous,we=me.discontinuity,Le=me.trackSwitch,Re=me.accurateTimeOffset,Ie=me.timeOffset,ye=b.audioCodec,X=b.videoCodec,M=b.defaultInitPts,N=b.duration,Y=b.initSegmentData;if((we||Le)&&this.resetInitSegment(Y,ye,X,N),we&&this.resetInitialTimestamp(M),De||this.resetContiguity(),this.needsProbing(B,we,Le)){if(A.dataLength){var ie=A.flush();B=Object(h.appendUint8Array)(ie,B)}this.configureTransmuxer(B,b)}var K=this.transmux(B,V,Ie,Re,x),pe=this.currentTransmuxState;return pe.contiguous=!0,pe.discontinuity=!1,pe.trackSwitch=!1,F.executeEnd=p(),K},S.flush=function(E){var c=this,x=E.transmuxing;x.executeStart=p();var v=this.decrypter,y=this.cache,F=this.currentTransmuxState,B=this.decryptionPromise;if(B)return B.then(function(){return c.flush(E)});var A=[],j=F.timeOffset;if(v){var P=v.flush();P&&A.push(this.push(P,null,E))}var b=y.dataLength;y.reset();var V=this.demuxer,re=this.remuxer;if(!V||!re)return b>=u&&this.observer.emit(z.Events.ERROR,z.Events.ERROR,{type:U.ErrorTypes.MEDIA_ERROR,details:U.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"no demux matching with content found"}),x.executeEnd=p(),[C(E)];var ce=V.flush(j);return _(ce)?ce.then(function(me){return c.flushRemux(A,me,E),A}):(this.flushRemux(A,ce,E),A)},S.flushRemux=function(E,c,x){var v=c.audioTrack,y=c.avcTrack,F=c.id3Track,B=c.textTrack,A=this.currentTransmuxState,j=A.accurateTimeOffset,P=A.timeOffset;o.logger.log("[transmuxer.ts]: Flushed fragment "+x.sn+(x.part>-1?" p: "+x.part:"")+" of level "+x.level);var b=this.remuxer.remux(v,y,F,B,P,j,!0,this.id);E.push({remuxResult:b,chunkMeta:x}),x.transmuxing.executeEnd=p()},S.resetInitialTimestamp=function(E){var c=this.demuxer,x=this.remuxer;if(!c||!x)return;c.resetTimeStamp(E),x.resetTimeStamp(E)},S.resetContiguity=function(){var E=this.demuxer,c=this.remuxer;if(!E||!c)return;E.resetContiguity(),c.resetNextTimestamp()},S.resetInitSegment=function(E,c,x,v){var y=this.demuxer,F=this.remuxer;if(!y||!F)return;y.resetInitSegment(c,x,v),F.resetInitSegment(E,c,x)},S.destroy=function(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)},S.transmux=function(E,c,x,v,y){var F;return c&&c.method==="SAMPLE-AES"?F=this.transmuxSampleAes(E,c,x,v,y):F=this.transmuxUnencrypted(E,x,v,y),F},S.transmuxUnencrypted=function(E,c,x,v){var y=this.demuxer.demux(E,c,!1,!this.config.progressive),F=y.audioTrack,B=y.avcTrack,A=y.id3Track,j=y.textTrack,P=this.remuxer.remux(F,B,A,j,c,x,!1,this.id);return{remuxResult:P,chunkMeta:v}},S.transmuxSampleAes=function(E,c,x,v,y){var F=this;return this.demuxer.demuxSampleAes(E,c,x).then(function(B){var A=F.remuxer.remux(B.audioTrack,B.avcTrack,B.id3Track,B.textTrack,x,v,!1,F.id);return{remuxResult:A,chunkMeta:y}})},S.configureTransmuxer=function(E,c){for(var x=this.config,v=this.observer,y=this.typeSupported,F=this.vendor,B=c.audioCodec,A=c.defaultInitPts,j=c.duration,P=c.initSegmentData,b=c.videoCodec,V,re=0,ce=l.length;re<ce;re++)if(l[re].demux.probe(E)){V=l[re];break}V||(o.logger.warn("Failed to find demuxer by probing frag, treating as mp4 passthrough"),V={demux:H.default,remux:f.default});var me=this.demuxer,De=this.remuxer,we=V.remux,Le=V.demux;(!De||!(De instanceof we))&&(this.remuxer=new we(v,x,y,F)),(!me||!(me instanceof Le))&&(this.demuxer=new Le(v,x,y),this.probe=Le.probe),this.resetInitSegment(P,B,b,j),this.resetInitialTimestamp(A)},S.needsProbing=function(E,c,x){return!this.demuxer||!this.remuxer||c||x},S.getDecrypter=function(){var E=this.decrypter;return E||(E=this.decrypter=new L.default(this.observer,this.config)),E},R}();function s(R,S){var T=null;return R.byteLength>0&&S!=null&&S.key!=null&&S.iv!==null&&S.method!=null&&(T=S),T}var C=function(S){return{remuxResult:{},chunkMeta:S}};function _(R){return"then"in R&&R.then instanceof Function}var w=function(S,T,E,c,x){this.audioCodec=void 0,this.videoCodec=void 0,this.initSegmentData=void 0,this.duration=void 0,this.defaultInitPts=void 0,this.audioCodec=S,this.videoCodec=T,this.initSegmentData=E,this.duration=c,this.defaultInitPts=x},O=function(S,T,E,c,x){this.discontinuity=void 0,this.contiguous=void 0,this.accurateTimeOffset=void 0,this.trackSwitch=void 0,this.timeOffset=void 0,this.discontinuity=S,this.contiguous=T,this.accurateTimeOffset=E,this.trackSwitch=c,this.timeOffset=x}},"./src/demux/tsdemuxer.ts":function(oe,$,k){"use strict";k.r($),k.d($,"discardEPB",function(){return C});var z=k("./src/demux/adts.ts"),U=k("./src/demux/mpegaudio.ts"),L=k("./src/demux/exp-golomb.ts"),W=k("./src/demux/id3.ts"),H=k("./src/demux/sample-aes.ts"),n=k("./src/events.ts"),I=k("./src/utils/mp4-tools.ts"),g=k("./src/utils/logger.ts"),f=k("./src/errors.ts"),m={video:1,audio:2,id3:3,text:4},h=function(){function _(O,R,S){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=O,this.config=R,this.typeSupported=S}_.probe=function(R){var S=_.syncOffset(R);return S<0?!1:(S&&g.logger.warn("MPEG2-TS detected but first sync word found @ offset "+S+", junk ahead ?"),!0)},_.syncOffset=function(R){for(var S=Math.min(1e3,R.length-3*188),T=0;T<S;){if(R[T]===71&&R[T+188]===71&&R[T+2*188]===71)return T;T++}return-1},_.createTrack=function(R,S){return{container:R==="video"||R==="audio"?"video/mp2t":void 0,type:R,id:m[R],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0,duration:R==="audio"?S:void 0}};var w=_.prototype;return w.resetInitSegment=function(R,S,T){this.pmtParsed=!1,this._pmtId=-1,this._avcTrack=_.createTrack("video",T),this._audioTrack=_.createTrack("audio",T),this._id3Track=_.createTrack("id3",T),this._txtTrack=_.createTrack("text",T),this._audioTrack.isAAC=!0,this.aacOverFlow=null,this.aacLastPTS=null,this.avcSample=null,this.audioCodec=R,this.videoCodec=S,this._duration=T},w.resetTimeStamp=function(){},w.resetContiguity=function(){var R=this._audioTrack,S=this._avcTrack,T=this._id3Track;R&&(R.pesData=null),S&&(S.pesData=null),T&&(T.pesData=null),this.aacOverFlow=null,this.aacLastPTS=null},w.demux=function(R,S,T,E){T===void 0&&(T=!1),E===void 0&&(E=!1),T||(this.sampleAes=null);var c,x=this._avcTrack,v=this._audioTrack,y=this._id3Track,F=x.pid,B=x.pesData,A=v.pid,j=y.pid,P=v.pesData,b=y.pesData,V=!1,re=this.pmtParsed,ce=this._pmtId,me=R.length;if(this.remainderData&&(R=Object(I.appendUint8Array)(this.remainderData,R),me=R.length,this.remainderData=null),me<188&&!E)return this.remainderData=R,{audioTrack:v,avcTrack:x,id3Track:y,textTrack:this._txtTrack};var De=Math.max(0,_.syncOffset(R));me-=(me+De)%188,me<R.byteLength&&!E&&(this.remainderData=new Uint8Array(R.buffer,me,R.buffer.byteLength-me));for(var we=De;we<me;we+=188)if(R[we]===71){var Le=!!(R[we+1]&64),Re=((R[we+1]&31)<<8)+R[we+2],Ie=(R[we+3]&48)>>4,ye=void 0;if(Ie>1){if(ye=we+5+R[we+4],ye===we+188)continue}else ye=we+4;switch(Re){case F:Le&&(B&&(c=u(B))&&this.parseAVCPES(c,!1),B={data:[],size:0}),B&&(B.data.push(R.subarray(ye,we+188)),B.size+=we+188-ye);break;case A:Le&&(P&&(c=u(P))&&(v.isAAC?this.parseAACPES(c):this.parseMPEGPES(c)),P={data:[],size:0}),P&&(P.data.push(R.subarray(ye,we+188)),P.size+=we+188-ye);break;case j:Le&&(b&&(c=u(b))&&this.parseID3PES(c),b={data:[],size:0}),b&&(b.data.push(R.subarray(ye,we+188)),b.size+=we+188-ye);break;case 0:Le&&(ye+=R[ye]+1),ce=this._pmtId=p(R,ye);break;case ce:{Le&&(ye+=R[ye]+1);var X=l(R,ye,this.typeSupported.mpeg===!0||this.typeSupported.mp3===!0,T);F=X.avc,F>0&&(x.pid=F),A=X.audio,A>0&&(v.pid=A,v.isAAC=X.isAAC),j=X.id3,j>0&&(y.pid=j),V&&!re&&(g.logger.log("reparse from beginning"),V=!1,we=De-188),re=this.pmtParsed=!0;break}case 17:case 8191:break;default:V=!0;break}}else this.observer.emit(n.Events.ERROR,n.Events.ERROR,{type:f.ErrorTypes.MEDIA_ERROR,details:f.ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,reason:"TS packet did not start with 0x47"});x.pesData=B,v.pesData=P,y.pesData=b;var M={audioTrack:v,avcTrack:x,id3Track:y,textTrack:this._txtTrack};return E&&this.extractRemainingSamples(M),M},w.flush=function(){var R=this.remainderData;this.remainderData=null;var S;return R?S=this.demux(R,-1,!1,!0):S={audioTrack:this._audioTrack,avcTrack:this._avcTrack,textTrack:this._txtTrack,id3Track:this._id3Track},this.extractRemainingSamples(S),this.sampleAes?this.decrypt(S,this.sampleAes):S},w.extractRemainingSamples=function(R){var S=R.audioTrack,T=R.avcTrack,E=R.id3Track,c=T.pesData,x=S.pesData,v=E.pesData,y;c&&(y=u(c))?(this.parseAVCPES(y,!0),T.pesData=null):T.pesData=c,x&&(y=u(x))?(S.isAAC?this.parseAACPES(y):this.parseMPEGPES(y),S.pesData=null):(x!=null&&x.size&&g.logger.log("last AAC PES packet truncated,might overlap between fragments"),S.pesData=x),v&&(y=u(v))?(this.parseID3PES(y),E.pesData=null):E.pesData=v},w.demuxSampleAes=function(R,S,T){var E=this.demux(R,T,!0,!this.config.progressive),c=this.sampleAes=new H.default(this.observer,this.config,S);return this.decrypt(E,c)},w.decrypt=function(R,S){return new Promise(function(T){var E=R.audioTrack,c=R.avcTrack;E.samples&&E.isAAC?S.decryptAacSamples(E.samples,0,function(){c.samples?S.decryptAvcSamples(c.samples,0,0,function(){T(R)}):T(R)}):c.samples&&S.decryptAvcSamples(c.samples,0,0,function(){T(R)})})},w.destroy=function(){this._initPTS=this._initDTS=null,this._duration=0},w.parseAVCPES=function(R,S){var T=this,E=this._avcTrack,c=this.parseAVCNALu(R.data),x=!1,v=this.avcSample,y,F=!1;R.data=null,v&&c.length&&!E.audFound&&(a(v,E),v=this.avcSample=o(!1,R.pts,R.dts,"")),c.forEach(function(B){switch(B.type){case 1:{y=!0,v||(v=T.avcSample=o(!0,R.pts,R.dts,"")),x&&(v.debug+="NDR "),v.frame=!0;var A=B.data;if(F&&A.length>4){var j=new L.default(A).readSliceType();(j===2||j===4||j===7||j===9)&&(v.key=!0)}break}case 5:y=!0,v||(v=T.avcSample=o(!0,R.pts,R.dts,"")),x&&(v.debug+="IDR "),v.key=!0,v.frame=!0;break;case 6:{y=!0,x&&v&&(v.debug+="SEI ");var P=new L.default(C(B.data));P.readUByte();for(var b=0,V=0,re=!1,ce=0;!re&&P.bytesAvailable>1;){b=0;do ce=P.readUByte(),b+=ce;while(ce===255);V=0;do ce=P.readUByte(),V+=ce;while(ce===255);if(b===4&&P.bytesAvailable!==0){re=!0;var me=P.readUByte();if(me===181){var De=P.readUShort();if(De===49){var we=P.readUInt();if(we===1195456820){var Le=P.readUByte();if(Le===3){for(var Re=P.readUByte(),Ie=P.readUByte(),ye=31&Re,X=[Re,Ie],M=0;M<ye;M++)X.push(P.readUByte()),X.push(P.readUByte()),X.push(P.readUByte());s(T._txtTrack.samples,{type:3,pts:R.pts,bytes:X})}}}}}else if(b===5&&P.bytesAvailable!==0){if(re=!0,V>16){for(var N=[],Y=0;Y<16;Y++)N.push(P.readUByte().toString(16)),(Y===3||Y===5||Y===7||Y===9)&&N.push("-");for(var ie=V-16,K=new Uint8Array(ie),pe=0;pe<ie;pe++)K[pe]=P.readUByte();s(T._txtTrack.samples,{pts:R.pts,payloadType:b,uuid:N.join(""),userData:Object(W.utf8ArrayToStr)(K),userDataBytes:K})}}else if(V<P.bytesAvailable)for(var Se=0;Se<V;Se++)P.readUByte()}break}case 7:if(y=!0,F=!0,x&&v&&(v.debug+="SPS "),!E.sps){var Pe=new L.default(B.data),he=Pe.readSPS();E.width=he.width,E.height=he.height,E.pixelRatio=he.pixelRatio,E.sps=[B.data],E.duration=T._duration;for(var ve=B.data.subarray(1,4),xe="avc1.",Ce=0;Ce<3;Ce++){var Be=ve[Ce].toString(16);Be.length<2&&(Be="0"+Be),xe+=Be}E.codec=xe}break;case 8:y=!0,x&&v&&(v.debug+="PPS "),E.pps||(E.pps=[B.data]);break;case 9:y=!1,E.audFound=!0,v&&a(v,E),v=T.avcSample=o(!1,R.pts,R.dts,x?"AUD ":"");break;case 12:y=!1;break;default:y=!1,v&&(v.debug+="unknown NAL "+B.type+" ");break}if(v&&y){var Ne=v.units;Ne.push(B)}}),S&&v&&(a(v,E),this.avcSample=null)},w.getLastNalUnit=function(){var R,S=this.avcSample,T;if(!S||S.units.length===0){var E=this._avcTrack.samples;S=E[E.length-1]}if((R=S)!==null&&R!==void 0&&R.units){var c=S.units;T=c[c.length-1]}return T},w.parseAVCNALu=function(R){var S=R.byteLength,T=this._avcTrack,E=T.naluState||0,c=E,x=[],v=0,y,F,B,A=-1,j=0;for(E===-1&&(A=0,j=R[0]&31,E=0,v=1);v<S;){if(y=R[v++],!E){E=y?0:1;continue}if(E===1){E=y?0:2;continue}if(!y)E=3;else if(y===1){if(A>=0){var P={data:R.subarray(A,v-E-1),type:j};x.push(P)}else{var b=this.getLastNalUnit();if(b&&(c&&v<=4-c&&(b.state&&(b.data=b.data.subarray(0,b.data.byteLength-c))),F=v-E-1,F>0)){var V=new Uint8Array(b.data.byteLength+F);V.set(b.data,0),V.set(R.subarray(0,F),b.data.byteLength),b.data=V,b.state=0}}v<S?(B=R[v]&31,A=v,j=B,E=0):E=-1}else E=0}if(A>=0&&E>=0){var re={data:R.subarray(A,S),type:j,state:E};x.push(re)}if(x.length===0){var ce=this.getLastNalUnit();if(ce){var me=new Uint8Array(ce.data.byteLength+R.byteLength);me.set(ce.data,0),me.set(R,ce.data.byteLength),ce.data=me}}return T.naluState=E,x},w.parseAACPES=function(R){var S=0,T=this._audioTrack,E=this.aacOverFlow,c=R.data;if(E){this.aacOverFlow=null;var x=E.sample.unit.byteLength,v=Math.min(E.missing,x),y=x-v;E.sample.unit.set(c.subarray(0,v),y),T.samples.push(E.sample),S=E.missing}var F,B;for(F=S,B=c.length;F<B-1&&!z.isHeader(c,F);F++);if(F!==S){var A,j;if(F<B-1?(A="AAC PES did not start with ADTS header,offset:"+F,j=!1):(A="no ADTS header found in AAC PES",j=!0),g.logger.warn("parsing error:"+A),this.observer.emit(n.Events.ERROR,n.Events.ERROR,{type:f.ErrorTypes.MEDIA_ERROR,details:f.ErrorDetails.FRAG_PARSING_ERROR,fatal:j,reason:A}),j)return}z.initTrackConfig(T,this.observer,c,F,this.audioCodec);var P;if(R.pts!==void 0)P=R.pts;else if(E){var b=z.getFrameDuration(T.samplerate);P=E.sample.pts+b}else{g.logger.warn("[tsdemuxer]: AAC PES unknown PTS");return}for(var V=0;F<B;)if(z.isHeader(c,F)){if(F+5<B){var re=z.appendFrame(T,c,F,P,V);if(re)if(re.missing)this.aacOverFlow=re;else{F+=re.length,V++;continue}}break}else F++},w.parseMPEGPES=function(R){var S=R.data,T=S.length,E=0,c=0,x=R.pts;if(x===void 0){g.logger.warn("[tsdemuxer]: MPEG PES unknown PTS");return}for(;c<T;)if(U.isHeader(S,c)){var v=U.appendFrame(this._audioTrack,S,c,x,E);if(v)c+=v.length,E++;else break}else c++},w.parseID3PES=function(R){if(R.pts===void 0){g.logger.warn("[tsdemuxer]: ID3 PES unknown PTS");return}this._id3Track.samples.push(R)},_}();h.minProbeByteLength=188;function o(_,w,O,R){return{key:_,frame:!1,pts:w,dts:O,units:[],debug:R,length:0}}function p(_,w){return(_[w+10]&31)<<8|_[w+11]}function l(_,w,O,R){var S={audio:-1,avc:-1,id3:-1,isAAC:!0},T=(_[w+1]&15)<<8|_[w+2],E=w+3+T-4,c=(_[w+10]&15)<<8|_[w+11];for(w+=12+c;w<E;){var x=(_[w+1]&31)<<8|_[w+2];switch(_[w]){case 207:if(!R){g.logger.log("ADTS AAC with AES-128-CBC frame encryption found in unencrypted stream");break}case 15:S.audio===-1&&(S.audio=x);break;case 21:S.id3===-1&&(S.id3=x);break;case 219:if(!R){g.logger.log("H.264 with AES-128-CBC slice encryption found in unencrypted stream");break}case 27:S.avc===-1&&(S.avc=x);break;case 3:case 4:O?S.audio===-1&&(S.audio=x,S.isAAC=!1):g.logger.log("MPEG audio found, not supported in this browser");break;case 36:g.logger.warn("Unsupported HEVC stream type found");break;default:break}w+=((_[w+3]&15)<<8|_[w+4])+5}return S}function u(_){var w=0,O,R,S,T,E,c=_.data;if(!_||_.size===0)return null;for(;c[0].length<19&&c.length>1;){var x=new Uint8Array(c[0].length+c[1].length);x.set(c[0]),x.set(c[1],c[0].length),c[0]=x,c.splice(1,1)}O=c[0];var v=(O[0]<<16)+(O[1]<<8)+O[2];if(v===1){if(R=(O[4]<<8)+O[5],R&&R>_.size-6)return null;var y=O[7];y&192&&(T=(O[9]&14)*536870912+(O[10]&255)*4194304+(O[11]&254)*16384+(O[12]&255)*128+(O[13]&254)/2,y&64?(E=(O[14]&14)*536870912+(O[15]&255)*4194304+(O[16]&254)*16384+(O[17]&255)*128+(O[18]&254)/2,T-E>60*9e4&&(g.logger.warn(Math.round((T-E)/9e4)+"s delta between PTS and DTS, align them"),T=E)):E=T),S=O[8];var F=S+9;if(_.size<=F)return null;_.size-=F;for(var B=new Uint8Array(_.size),A=0,j=c.length;A<j;A++){O=c[A];var P=O.byteLength;if(F)if(F>P){F-=P;continue}else O=O.subarray(F),P-=F,F=0;B.set(O,w),w+=P}return R&&(R-=S+3),{data:B,pts:T,dts:E,len:R}}return null}function a(_,w){if(_.units.length&&_.frame){if(_.pts===void 0){var O=w.samples,R=O.length;if(R){var S=O[R-1];_.pts=S.pts,_.dts=S.dts}else{w.dropped++;return}}w.samples.push(_)}_.debug.length&&g.logger.log(_.pts+"/"+_.dts+":"+_.debug)}function s(_,w){var O=_.length;if(O>0){if(w.pts>=_[O-1].pts)_.push(w);else for(var R=O-1;R>=0;R--)if(w.pts<_[R].pts){_.splice(R,0,w);break}}else _.push(w)}function C(_){for(var w=_.byteLength,O=[],R=1;R<w-2;)_[R]===0&&_[R+1]===0&&_[R+2]===3?(O.push(R+2),R+=2):R++;if(O.length===0)return _;var S=w-O.length,T=new Uint8Array(S),E=0;for(R=0;R<S;E++,R++)E===O[0]&&(E++,O.shift()),T[R]=_[E];return T}$.default=h},"./src/errors.ts":function(oe,$,k){"use strict";k.r($),k.d($,"ErrorTypes",function(){return z}),k.d($,"ErrorDetails",function(){return U});var z;(function(L){L.NETWORK_ERROR="networkError",L.MEDIA_ERROR="mediaError",L.KEY_SYSTEM_ERROR="keySystemError",L.MUX_ERROR="muxError",L.OTHER_ERROR="otherError"})(z||(z={}));var U;(function(L){L.KEY_SYSTEM_NO_KEYS="keySystemNoKeys",L.KEY_SYSTEM_NO_ACCESS="keySystemNoAccess",L.KEY_SYSTEM_NO_SESSION="keySystemNoSession",L.KEY_SYSTEM_LICENSE_REQUEST_FAILED="keySystemLicenseRequestFailed",L.KEY_SYSTEM_NO_INIT_DATA="keySystemNoInitData",L.MANIFEST_LOAD_ERROR="manifestLoadError",L.MANIFEST_LOAD_TIMEOUT="manifestLoadTimeOut",L.MANIFEST_PARSING_ERROR="manifestParsingError",L.MANIFEST_INCOMPATIBLE_CODECS_ERROR="manifestIncompatibleCodecsError",L.LEVEL_EMPTY_ERROR="levelEmptyError",L.LEVEL_LOAD_ERROR="levelLoadError",L.LEVEL_LOAD_TIMEOUT="levelLoadTimeOut",L.LEVEL_SWITCH_ERROR="levelSwitchError",L.AUDIO_TRACK_LOAD_ERROR="audioTrackLoadError",L.AUDIO_TRACK_LOAD_TIMEOUT="audioTrackLoadTimeOut",L.SUBTITLE_LOAD_ERROR="subtitleTrackLoadError",L.SUBTITLE_TRACK_LOAD_TIMEOUT="subtitleTrackLoadTimeOut",L.FRAG_LOAD_ERROR="fragLoadError",L.FRAG_LOAD_TIMEOUT="fragLoadTimeOut",L.FRAG_DECRYPT_ERROR="fragDecryptError",L.FRAG_PARSING_ERROR="fragParsingError",L.REMUX_ALLOC_ERROR="remuxAllocError",L.KEY_LOAD_ERROR="keyLoadError",L.KEY_LOAD_TIMEOUT="keyLoadTimeOut",L.BUFFER_ADD_CODEC_ERROR="bufferAddCodecError",L.BUFFER_INCOMPATIBLE_CODECS_ERROR="bufferIncompatibleCodecsError",L.BUFFER_APPEND_ERROR="bufferAppendError",L.BUFFER_APPENDING_ERROR="bufferAppendingError",L.BUFFER_STALLED_ERROR="bufferStalledError",L.BUFFER_FULL_ERROR="bufferFullError",L.BUFFER_SEEK_OVER_HOLE="bufferSeekOverHole",L.BUFFER_NUDGE_ON_STALL="bufferNudgeOnStall",L.INTERNAL_EXCEPTION="internalException",L.INTERNAL_ABORTED="aborted",L.UNKNOWN="unknown"})(U||(U={}))},"./src/events.ts":function(oe,$,k){"use strict";k.r($),k.d($,"Events",function(){return z});var z;(function(U){U.MEDIA_ATTACHING="hlsMediaAttaching",U.MEDIA_ATTACHED="hlsMediaAttached",U.MEDIA_DETACHING="hlsMediaDetaching",U.MEDIA_DETACHED="hlsMediaDetached",U.BUFFER_RESET="hlsBufferReset",U.BUFFER_CODECS="hlsBufferCodecs",U.BUFFER_CREATED="hlsBufferCreated",U.BUFFER_APPENDING="hlsBufferAppending",U.BUFFER_APPENDED="hlsBufferAppended",U.BUFFER_EOS="hlsBufferEos",U.BUFFER_FLUSHING="hlsBufferFlushing",U.BUFFER_FLUSHED="hlsBufferFlushed",U.MANIFEST_LOADING="hlsManifestLoading",U.MANIFEST_LOADED="hlsManifestLoaded",U.MANIFEST_PARSED="hlsManifestParsed",U.LEVEL_SWITCHING="hlsLevelSwitching",U.LEVEL_SWITCHED="hlsLevelSwitched",U.LEVEL_LOADING="hlsLevelLoading",U.LEVEL_LOADED="hlsLevelLoaded",U.LEVEL_UPDATED="hlsLevelUpdated",U.LEVEL_PTS_UPDATED="hlsLevelPtsUpdated",U.LEVELS_UPDATED="hlsLevelsUpdated",U.AUDIO_TRACKS_UPDATED="hlsAudioTracksUpdated",U.AUDIO_TRACK_SWITCHING="hlsAudioTrackSwitching",U.AUDIO_TRACK_SWITCHED="hlsAudioTrackSwitched",U.AUDIO_TRACK_LOADING="hlsAudioTrackLoading",U.AUDIO_TRACK_LOADED="hlsAudioTrackLoaded",U.SUBTITLE_TRACKS_UPDATED="hlsSubtitleTracksUpdated",U.SUBTITLE_TRACKS_CLEARED="hlsSubtitleTracksCleared",U.SUBTITLE_TRACK_SWITCH="hlsSubtitleTrackSwitch",U.SUBTITLE_TRACK_LOADING="hlsSubtitleTrackLoading",U.SUBTITLE_TRACK_LOADED="hlsSubtitleTrackLoaded",U.SUBTITLE_FRAG_PROCESSED="hlsSubtitleFragProcessed",U.CUES_PARSED="hlsCuesParsed",U.NON_NATIVE_TEXT_TRACKS_FOUND="hlsNonNativeTextTracksFound",U.INIT_PTS_FOUND="hlsInitPtsFound",U.FRAG_LOADING="hlsFragLoading",U.FRAG_LOAD_EMERGENCY_ABORTED="hlsFragLoadEmergencyAborted",U.FRAG_LOADED="hlsFragLoaded",U.FRAG_DECRYPTED="hlsFragDecrypted",U.FRAG_PARSING_INIT_SEGMENT="hlsFragParsingInitSegment",U.FRAG_PARSING_USERDATA="hlsFragParsingUserdata",U.FRAG_PARSING_METADATA="hlsFragParsingMetadata",U.FRAG_PARSED="hlsFragParsed",U.FRAG_BUFFERED="hlsFragBuffered",U.FRAG_CHANGED="hlsFragChanged",U.FPS_DROP="hlsFpsDrop",U.FPS_DROP_LEVEL_CAPPING="hlsFpsDropLevelCapping",U.ERROR="hlsError",U.DESTROYING="hlsDestroying",U.KEY_LOADING="hlsKeyLoading",U.KEY_LOADED="hlsKeyLoaded",U.LIVE_BACK_BUFFER_REACHED="hlsLiveBackBufferReached",U.BACK_BUFFER_REACHED="hlsBackBufferReached"})(z||(z={}))},"./src/hls.ts":function(oe,$,k){"use strict";k.r($),k.d($,"default",function(){return _});var z=k("./node_modules/url-toolkit/src/url-toolkit.js"),U=k.n(z),L=k("./src/loader/playlist-loader.ts"),W=k("./src/loader/key-loader.ts"),H=k("./src/controller/id3-track-controller.ts"),n=k("./src/controller/latency-controller.ts"),I=k("./src/controller/level-controller.ts"),g=k("./src/controller/fragment-tracker.ts"),f=k("./src/controller/stream-controller.ts"),m=k("./src/is-supported.ts"),h=k("./src/utils/logger.ts"),o=k("./src/config.ts"),p=k("./node_modules/eventemitter3/index.js"),l=k.n(p),u=k("./src/events.ts"),a=k("./src/errors.ts");function s(w,O){for(var R=0;R<O.length;R++){var S=O[R];S.enumerable=S.enumerable||!1,S.configurable=!0,"value"in S&&(S.writable=!0),Object.defineProperty(w,S.key,S)}}function C(w,O,R){return O&&s(w.prototype,O),R&&s(w,R),w}var _=function(){w.isSupported=function(){return Object(m.isSupported)()};function w(R){R===void 0&&(R={}),this.config=void 0,this.userConfig=void 0,this.coreComponents=void 0,this.networkControllers=void 0,this._emitter=new p.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 S=this.config=Object(o.mergeConfig)(w.DefaultConfig,R);this.userConfig=R,Object(h.enableLogs)(S.debug),this._autoLevelCapping=-1,S.progressive&&Object(o.enableStreamingMode)(S);var T=S.abrController,E=S.bufferController,c=S.capLevelController,x=S.fpsController,v=this.abrController=new T(this),y=this.bufferController=new E(this),F=this.capLevelController=new c(this),B=new x(this),A=new L.default(this),j=new W.default(this),P=new H.default(this),b=this.levelController=new I.default(this),V=new g.FragmentTracker(this),re=this.streamController=new f.default(this,V);F.setStreamController(re),B.setStreamController(re);var ce=[b,re];this.networkControllers=ce;var me=[A,j,v,y,F,B,P,V];this.audioTrackController=this.createController(S.audioTrackController,null,ce),this.createController(S.audioStreamController,V,ce),this.subtitleTrackController=this.createController(S.subtitleTrackController,null,ce),this.createController(S.subtitleStreamController,V,ce),this.createController(S.timelineController,null,me),this.emeController=this.createController(S.emeController,null,me),this.cmcdController=this.createController(S.cmcdController,null,me),this.latencyController=this.createController(n.default,null,me),this.coreComponents=me}var O=w.prototype;return O.createController=function(S,T,E){if(S){var c=T?new S(this,T):new S(this);return E&&E.push(c),c}return null},O.on=function(S,T,E){E===void 0&&(E=this),this._emitter.on(S,T,E)},O.once=function(S,T,E){E===void 0&&(E=this),this._emitter.once(S,T,E)},O.removeAllListeners=function(S){this._emitter.removeAllListeners(S)},O.off=function(S,T,E,c){E===void 0&&(E=this),this._emitter.off(S,T,E,c)},O.listeners=function(S){return this._emitter.listeners(S)},O.emit=function(S,T,E){return this._emitter.emit(S,T,E)},O.trigger=function(S,T){if(this.config.debug)return this.emit(S,S,T);try{return this.emit(S,S,T)}catch(E){h.logger.error("An internal error happened while handling event "+S+'. Error message: "'+E.message+'". Here is a stacktrace:',E),this.trigger(u.Events.ERROR,{type:a.ErrorTypes.OTHER_ERROR,details:a.ErrorDetails.INTERNAL_EXCEPTION,fatal:!1,event:S,error:E})}return!1},O.listenerCount=function(S){return this._emitter.listenerCount(S)},O.destroy=function(){h.logger.log("destroy"),this.trigger(u.Events.DESTROYING,void 0),this.detachMedia(),this.removeAllListeners(),this._autoLevelCapping=-1,this.url=null,this.networkControllers.forEach(function(S){return S.destroy()}),this.networkControllers.length=0,this.coreComponents.forEach(function(S){return S.destroy()}),this.coreComponents.length=0},O.attachMedia=function(S){h.logger.log("attachMedia"),this._media=S,this.trigger(u.Events.MEDIA_ATTACHING,{media:S})},O.detachMedia=function(){h.logger.log("detachMedia"),this.trigger(u.Events.MEDIA_DETACHING,void 0),this._media=null},O.loadSource=function(S){this.stopLoad();var T=this.media,E=this.url,c=this.url=z.buildAbsoluteURL(self.location.href,S,{alwaysNormalize:!0});h.logger.log("loadSource:"+c),T&&E&&E!==c&&this.bufferController.hasSourceTypes()&&(this.detachMedia(),this.attachMedia(T)),this.trigger(u.Events.MANIFEST_LOADING,{url:S})},O.startLoad=function(S){S===void 0&&(S=-1),h.logger.log("startLoad("+S+")"),this.networkControllers.forEach(function(T){T.startLoad(S)})},O.stopLoad=function(){h.logger.log("stopLoad"),this.networkControllers.forEach(function(S){S.stopLoad()})},O.swapAudioCodec=function(){h.logger.log("swapAudioCodec"),this.streamController.swapAudioCodec()},O.recoverMediaError=function(){h.logger.log("recoverMediaError");var S=this._media;this.detachMedia(),S&&this.attachMedia(S)},O.removeLevel=function(S,T){T===void 0&&(T=0),this.levelController.removeLevel(S,T)},C(w,[{key:"levels",get:function(){var S=this.levelController.levels;return S||[]}},{key:"currentLevel",get:function(){return this.streamController.currentLevel},set:function(S){h.logger.log("set currentLevel:"+S),this.loadLevel=S,this.abrController.clearTimer(),this.streamController.immediateLevelSwitch()}},{key:"nextLevel",get:function(){return this.streamController.nextLevel},set:function(S){h.logger.log("set nextLevel:"+S),this.levelController.manualLevel=S,this.streamController.nextLevelSwitch()}},{key:"loadLevel",get:function(){return this.levelController.level},set:function(S){h.logger.log("set loadLevel:"+S),this.levelController.manualLevel=S}},{key:"nextLoadLevel",get:function(){return this.levelController.nextLoadLevel},set:function(S){this.levelController.nextLoadLevel=S}},{key:"firstLevel",get:function(){return Math.max(this.levelController.firstLevel,this.minAutoLevel)},set:function(S){h.logger.log("set firstLevel:"+S),this.levelController.firstLevel=S}},{key:"startLevel",get:function(){return this.levelController.startLevel},set:function(S){h.logger.log("set startLevel:"+S),S!==-1&&(S=Math.max(S,this.minAutoLevel)),this.levelController.startLevel=S}},{key:"capLevelToPlayerSize",get:function(){return this.config.capLevelToPlayerSize},set:function(S){var T=!!S;T!==this.config.capLevelToPlayerSize&&(T?this.capLevelController.startCapping():(this.capLevelController.stopCapping(),this.autoLevelCapping=-1,this.streamController.nextLevelSwitch()),this.config.capLevelToPlayerSize=T)}},{key:"autoLevelCapping",get:function(){return this._autoLevelCapping},set:function(S){this._autoLevelCapping!==S&&(h.logger.log("set autoLevelCapping:"+S),this._autoLevelCapping=S)}},{key:"bandwidthEstimate",get:function(){var S=this.abrController.bwEstimator;return S?S.getEstimate():NaN}},{key:"autoLevelEnabled",get:function(){return this.levelController.manualLevel===-1}},{key:"manualLevel",get:function(){return this.levelController.manualLevel}},{key:"minAutoLevel",get:function(){var S=this.levels,T=this.config.minAutoBitrate;if(!S)return 0;for(var E=S.length,c=0;c<E;c++)if(S[c].maxBitrate>T)return c;return 0}},{key:"maxAutoLevel",get:function(){var S=this.levels,T=this.autoLevelCapping,E;return T===-1&&S&&S.length?E=S.length-1:E=T,E}},{key:"nextAutoLevel",get:function(){return Math.min(Math.max(this.abrController.nextAutoLevel,this.minAutoLevel),this.maxAutoLevel)},set:function(S){this.abrController.nextAutoLevel=Math.max(this.minAutoLevel,S)}},{key:"audioTracks",get:function(){var S=this.audioTrackController;return S?S.audioTracks:[]}},{key:"audioTrack",get:function(){var S=this.audioTrackController;return S?S.audioTrack:-1},set:function(S){var T=this.audioTrackController;T&&(T.audioTrack=S)}},{key:"subtitleTracks",get:function(){var S=this.subtitleTrackController;return S?S.subtitleTracks:[]}},{key:"subtitleTrack",get:function(){var S=this.subtitleTrackController;return S?S.subtitleTrack:-1},set:function(S){var T=this.subtitleTrackController;T&&(T.subtitleTrack=S)}},{key:"media",get:function(){return this._media}},{key:"subtitleDisplay",get:function(){var S=this.subtitleTrackController;return S?S.subtitleDisplay:!1},set:function(S){var T=this.subtitleTrackController;T&&(T.subtitleDisplay=S)}},{key:"lowLatencyMode",get:function(){return this.config.lowLatencyMode},set:function(S){this.config.lowLatencyMode=S}},{key:"liveSyncPosition",get:function(){return this.latencyController.liveSyncPosition}},{key:"latency",get:function(){return this.latencyController.latency}},{key:"maxLatency",get:function(){return this.latencyController.maxLatency}},{key:"targetLatency",get:function(){return this.latencyController.targetLatency}},{key:"drift",get:function(){return this.latencyController.drift}},{key:"forceStartLoad",get:function(){return this.streamController.forceStartLoad}}],[{key:"version",get:function(){return"1.1.2"}},{key:"Events",get:function(){return u.Events}},{key:"ErrorTypes",get:function(){return a.ErrorTypes}},{key:"ErrorDetails",get:function(){return a.ErrorDetails}},{key:"DefaultConfig",get:function(){return w.defaultConfig?w.defaultConfig:o.hlsDefaultConfig},set:function(S){w.defaultConfig=S}}]),w}();_.defaultConfig=void 0},"./src/is-supported.ts":function(oe,$,k){"use strict";k.r($),k.d($,"isSupported",function(){return L}),k.d($,"changeTypeSupported",function(){return W});var z=k("./src/utils/mediasource-helper.ts");function U(){return self.SourceBuffer||self.WebKitSourceBuffer}function L(){var H=Object(z.getMediaSource)();if(!H)return!1;var n=U(),I=H&&typeof H.isTypeSupported=="function"&&H.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"'),g=!n||n.prototype&&typeof n.prototype.appendBuffer=="function"&&typeof n.prototype.remove=="function";return!!I&&!!g}function W(){var H,n=U();return typeof(n==null||((H=n.prototype)===null||H===void 0)?void 0:H.changeType)=="function"}},"./src/loader/fragment-loader.ts":function(oe,$,k){"use strict";k.r($),k.d($,"default",function(){return h}),k.d($,"LoadError",function(){return p});var z=k("./src/polyfills/number.ts"),U=k("./src/errors.ts");function L(l,u){l.prototype=Object.create(u.prototype),l.prototype.constructor=l,g(l,u)}function W(l){var u=typeof Map=="function"?new Map:void 0;return W=function(s){if(s===null||!I(s))return s;if(typeof s!="function")throw new TypeError("Super expression must either be null or a function");if(typeof u!="undefined"){if(u.has(s))return u.get(s);u.set(s,C)}function C(){return H(s,arguments,f(this).constructor)}return C.prototype=Object.create(s.prototype,{constructor:{value:C,enumerable:!1,writable:!0,configurable:!0}}),g(C,s)},W(l)}function H(l,u,a){return n()?H=Reflect.construct:H=function(C,_,w){var O=[null];O.push.apply(O,_);var R=Function.bind.apply(C,O),S=new R;return w&&g(S,w.prototype),S},H.apply(null,arguments)}function n(){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(l){return!1}}function I(l){return Function.toString.call(l).indexOf("[native code]")!==-1}function g(l,u){return g=Object.setPrototypeOf||function(s,C){return s.__proto__=C,s},g(l,u)}function f(l){return f=Object.setPrototypeOf?Object.getPrototypeOf:function(a){return a.__proto__||Object.getPrototypeOf(a)},f(l)}var m=Math.pow(2,17),h=function(){function l(a){this.config=void 0,this.loader=null,this.partLoadTimeout=-1,this.config=a}var u=l.prototype;return u.destroy=function(){this.loader&&(this.loader.destroy(),this.loader=null)},u.abort=function(){this.loader&&this.loader.abort()},u.load=function(s,C){var _=this,w=s.url;if(!w)return Promise.reject(new p({type:U.ErrorTypes.NETWORK_ERROR,details:U.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:s,networkDetails:null},"Fragment does not have a "+(w?"part list":"url")));this.abort();var O=this.config,R=O.fLoader,S=O.loader;return new Promise(function(T,E){_.loader&&_.loader.destroy();var c=_.loader=s.loader=R?new R(O):new S(O),x=o(s),v={timeout:O.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:O.fragLoadingMaxRetryTimeout,highWaterMark:m};s.stats=c.stats,c.load(x,v,{onSuccess:function(F,B,A,j){_.resetLoader(s,c),T({frag:s,part:null,payload:F.data,networkDetails:j})},onError:function(F,B,A){_.resetLoader(s,c),E(new p({type:U.ErrorTypes.NETWORK_ERROR,details:U.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:s,response:F,networkDetails:A}))},onAbort:function(F,B,A){_.resetLoader(s,c),E(new p({type:U.ErrorTypes.NETWORK_ERROR,details:U.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:s,networkDetails:A}))},onTimeout:function(F,B,A){_.resetLoader(s,c),E(new p({type:U.ErrorTypes.NETWORK_ERROR,details:U.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:s,networkDetails:A}))},onProgress:function(F,B,A,j){C&&C({frag:s,part:null,payload:A,networkDetails:j})}})})},u.loadPart=function(s,C,_){var w=this;this.abort();var O=this.config,R=O.fLoader,S=O.loader;return new Promise(function(T,E){w.loader&&w.loader.destroy();var c=w.loader=s.loader=R?new R(O):new S(O),x=o(s,C),v={timeout:O.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:O.fragLoadingMaxRetryTimeout,highWaterMark:m};C.stats=c.stats,c.load(x,v,{onSuccess:function(F,B,A,j){w.resetLoader(s,c),w.updateStatsFromPart(s,C);var P={frag:s,part:C,payload:F.data,networkDetails:j};_(P),T(P)},onError:function(F,B,A){w.resetLoader(s,c),E(new p({type:U.ErrorTypes.NETWORK_ERROR,details:U.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:s,part:C,response:F,networkDetails:A}))},onAbort:function(F,B,A){s.stats.aborted=C.stats.aborted,w.resetLoader(s,c),E(new p({type:U.ErrorTypes.NETWORK_ERROR,details:U.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:s,part:C,networkDetails:A}))},onTimeout:function(F,B,A){w.resetLoader(s,c),E(new p({type:U.ErrorTypes.NETWORK_ERROR,details:U.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:s,part:C,networkDetails:A}))}})})},u.updateStatsFromPart=function(s,C){var _=s.stats,w=C.stats,O=w.total;if(_.loaded+=w.loaded,O){var R=Math.round(s.duration/C.duration),S=Math.min(Math.round(_.loaded/O),R),T=R-S,E=T*Math.round(_.loaded/S);_.total=_.loaded+E}else _.total=Math.max(_.loaded,_.total);var c=_.loading,x=w.loading;c.start?c.first+=x.first-x.start:(c.start=x.start,c.first=x.first),c.end=x.end},u.resetLoader=function(s,C){s.loader=null,this.loader===C&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),C.destroy()},l}();function o(l,u){u===void 0&&(u=null);var a=u||l,s={frag:l,part:u,responseType:"arraybuffer",url:a.url,headers:{},rangeStart:0,rangeEnd:0},C=a.byteRangeStartOffset,_=a.byteRangeEndOffset;return Object(z.isFiniteNumber)(C)&&Object(z.isFiniteNumber)(_)&&(s.rangeStart=C,s.rangeEnd=_),s}var p=function(l){L(u,l);function u(a){for(var s,C=arguments.length,_=new Array(C>1?C-1:0),w=1;w<C;w++)_[w-1]=arguments[w];return s=l.call.apply(l,[this].concat(_))||this,s.data=void 0,s.data=a,s}return u}(W(Error))},"./src/loader/fragment.ts":function(oe,$,k){"use strict";k.r($),k.d($,"ElementaryStreamTypes",function(){return h}),k.d($,"BaseSegment",function(){return o}),k.d($,"Fragment",function(){return p}),k.d($,"Part",function(){return l});var z=k("./src/polyfills/number.ts"),U=k("./node_modules/url-toolkit/src/url-toolkit.js"),L=k.n(U),W=k("./src/utils/logger.ts"),H=k("./src/loader/level-key.ts"),n=k("./src/loader/load-stats.ts");function I(u,a){u.prototype=Object.create(a.prototype),u.prototype.constructor=u,g(u,a)}function g(u,a){return g=Object.setPrototypeOf||function(C,_){return C.__proto__=_,C},g(u,a)}function f(u,a){for(var s=0;s<a.length;s++){var C=a[s];C.enumerable=C.enumerable||!1,C.configurable=!0,"value"in C&&(C.writable=!0),Object.defineProperty(u,C.key,C)}}function m(u,a,s){return a&&f(u.prototype,a),s&&f(u,s),u}var h;(function(u){u.AUDIO="audio",u.VIDEO="video",u.AUDIOVIDEO="audiovideo"})(h||(h={}));var o=function(){function u(s){var C;this._byteRange=null,this._url=null,this.baseurl=void 0,this.relurl=void 0,this.elementaryStreams=(C={},C[h.AUDIO]=null,C[h.VIDEO]=null,C[h.AUDIOVIDEO]=null,C),this.baseurl=s}var a=u.prototype;return a.setByteRange=function(C,_){var w=C.split("@",2),O=[];w.length===1?O[0]=_?_.byteRangeEndOffset:0:O[0]=parseInt(w[1]),O[1]=parseInt(w[0])+O[0],this._byteRange=O},m(u,[{key:"byteRange",get:function(){return this._byteRange?this._byteRange:[]}},{key:"byteRangeStartOffset",get:function(){return this.byteRange[0]}},{key:"byteRangeEndOffset",get:function(){return this.byteRange[1]}},{key:"url",get:function(){return!this._url&&this.baseurl&&this.relurl&&(this._url=Object(U.buildAbsoluteURL)(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url||""},set:function(C){this._url=C}}]),u}(),p=function(u){I(a,u);function a(C,_){var w;return w=u.call(this,_)||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 n.LoadStats,w.urlId=0,w.data=void 0,w.bitrateTest=!1,w.title=null,w.initSegment=null,w.type=C,w}var s=a.prototype;return s.createInitializationVector=function(_){for(var w=new Uint8Array(16),O=12;O<16;O++)w[O]=_>>8*(15-O)&255;return w},s.setDecryptDataFromLevelKey=function(_,w){var O=_;return(_==null?void 0:_.method)==="AES-128"&&_.uri&&!_.iv&&(O=H.LevelKey.fromURI(_.uri),O.method=_.method,O.iv=this.createInitializationVector(w),O.keyFormat="identity"),O},s.setElementaryStreamInfo=function(_,w,O,R,S,T){T===void 0&&(T=!1);var E=this.elementaryStreams,c=E[_];if(!c){E[_]={startPTS:w,endPTS:O,startDTS:R,endDTS:S,partial:T};return}c.startPTS=Math.min(c.startPTS,w),c.endPTS=Math.max(c.endPTS,O),c.startDTS=Math.min(c.startDTS,R),c.endDTS=Math.max(c.endDTS,S)},s.clearElementaryStreamInfo=function(){var _=this.elementaryStreams;_[h.AUDIO]=null,_[h.VIDEO]=null,_[h.AUDIOVIDEO]=null},m(a,[{key:"decryptdata",get:function(){if(!this.levelkey&&!this._decryptdata)return null;if(!this._decryptdata&&this.levelkey){var _=this.sn;typeof _!="number"&&(this.levelkey&&this.levelkey.method==="AES-128"&&!this.levelkey.iv&&W.logger.warn('missing IV for initialization segment with method="'+this.levelkey.method+'" - compliance issue'),_=0),this._decryptdata=this.setDecryptDataFromLevelKey(this.levelkey,_)}return this._decryptdata}},{key:"end",get:function(){return this.start+this.duration}},{key:"endProgramDateTime",get:function(){if(this.programDateTime===null)return null;if(!Object(z.isFiniteNumber)(this.programDateTime))return null;var _=Object(z.isFiniteNumber)(this.duration)?this.duration:0;return this.programDateTime+_*1e3}},{key:"encrypted",get:function(){var _;return!!((_=this.decryptdata)!==null&&_!==void 0&&_.keyFormat&&this.decryptdata.uri)}}]),a}(o),l=function(u){I(a,u);function a(s,C,_,w,O){var R;R=u.call(this,_)||this,R.fragOffset=0,R.duration=0,R.gap=!1,R.independent=!1,R.relurl=void 0,R.fragment=void 0,R.index=void 0,R.stats=new n.LoadStats,R.duration=s.decimalFloatingPoint("DURATION"),R.gap=s.bool("GAP"),R.independent=s.bool("INDEPENDENT"),R.relurl=s.enumeratedString("URI"),R.fragment=C,R.index=w;var S=s.enumeratedString("BYTERANGE");return S&&R.setByteRange(S,O),O&&(R.fragOffset=O.fragOffset+O.duration),R}return m(a,[{key:"start",get:function(){return this.fragment.start+this.fragOffset}},{key:"end",get:function(){return this.start+this.duration}},{key:"loaded",get:function(){var C=this.elementaryStreams;return!!(C.audio||C.video||C.audiovideo)}}]),a}(o)},"./src/loader/key-loader.ts":function(oe,$,k){"use strict";k.r($),k.d($,"default",function(){return W});var z=k("./src/events.ts"),U=k("./src/errors.ts"),L=k("./src/utils/logger.ts"),W=function(){function H(I){this.hls=void 0,this.loaders={},this.decryptkey=null,this.decrypturl=null,this.hls=I,this._registerListeners()}var n=H.prototype;return n._registerListeners=function(){this.hls.on(z.Events.KEY_LOADING,this.onKeyLoading,this)},n._unregisterListeners=function(){this.hls.off(z.Events.KEY_LOADING,this.onKeyLoading)},n.destroy=function(){this._unregisterListeners();for(var g in this.loaders){var f=this.loaders[g];f&&f.destroy()}this.loaders={}},n.onKeyLoading=function(g,f){var m=f.frag,h=m.type,o=this.loaders[h];if(!m.decryptdata){L.logger.warn("Missing decryption data on fragment in onKeyLoading");return}var p=m.decryptdata.uri;if(p!==this.decrypturl||this.decryptkey===null){var l=this.hls.config;if(o&&(L.logger.warn("abort previous key loader for type:"+h),o.abort()),!p){L.logger.warn("key uri is falsy");return}var u=l.loader,a=m.loader=this.loaders[h]=new u(l);this.decrypturl=p,this.decryptkey=null;var s={url:p,frag:m,responseType:"arraybuffer"},C={timeout:l.fragLoadingTimeOut,maxRetry:0,retryDelay:l.fragLoadingRetryDelay,maxRetryDelay:l.fragLoadingMaxRetryTimeout,highWaterMark:0},_={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};a.load(s,C,_)}else this.decryptkey&&(m.decryptdata.key=this.decryptkey,this.hls.trigger(z.Events.KEY_LOADED,{frag:m}))},n.loadsuccess=function(g,f,m){var h=m.frag;if(!h.decryptdata){L.logger.error("after key load, decryptdata unset");return}this.decryptkey=h.decryptdata.key=new Uint8Array(g.data),h.loader=null,delete this.loaders[h.type],this.hls.trigger(z.Events.KEY_LOADED,{frag:h})},n.loaderror=function(g,f){var m=f.frag,h=m.loader;h&&h.abort(),delete this.loaders[m.type],this.hls.trigger(z.Events.ERROR,{type:U.ErrorTypes.NETWORK_ERROR,details:U.ErrorDetails.KEY_LOAD_ERROR,fatal:!1,frag:m,response:g})},n.loadtimeout=function(g,f){var m=f.frag,h=m.loader;h&&h.abort(),delete this.loaders[m.type],this.hls.trigger(z.Events.ERROR,{type:U.ErrorTypes.NETWORK_ERROR,details:U.ErrorDetails.KEY_LOAD_TIMEOUT,fatal:!1,frag:m})},H}()},"./src/loader/level-details.ts":function(oe,$,k){"use strict";k.r($),k.d($,"LevelDetails",function(){return H});var z=k("./src/polyfills/number.ts");function U(n,I){for(var g=0;g<I.length;g++){var f=I[g];f.enumerable=f.enumerable||!1,f.configurable=!0,"value"in f&&(f.writable=!0),Object.defineProperty(n,f.key,f)}}function L(n,I,g){return I&&U(n.prototype,I),g&&U(n,g),n}var W=10,H=function(){function n(g){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=g}var I=n.prototype;return I.reloaded=function(f){if(!f){this.advanced=!0,this.updated=!0;return}var m=this.lastPartSn-f.lastPartSn,h=this.lastPartIndex-f.lastPartIndex;this.updated=this.endSN!==f.endSN||!!h||!!m,this.advanced=this.endSN>f.endSN||m>0||m===0&&h>0,this.updated||this.advanced?this.misses=Math.floor(f.misses*.6):this.misses=f.misses+1,this.availabilityDelay=f.availabilityDelay},L(n,[{key:"hasProgramDateTime",get:function(){return this.fragments.length?Object(z.isFiniteNumber)(this.fragments[this.fragments.length-1].programDateTime):!1}},{key:"levelTargetDuration",get:function(){return this.averagetargetduration||this.targetduration||W}},{key:"drift",get:function(){var f=this.driftEndTime-this.driftStartTime;if(f>0){var m=this.driftEnd-this.driftStart;return m*1e3/f}return 1}},{key:"edge",get:function(){return this.partEnd||this.fragmentEnd}},{key:"partEnd",get:function(){var f;return(f=this.partList)!==null&&f!==void 0&&f.length?this.partList[this.partList.length-1].end:this.fragmentEnd}},{key:"fragmentEnd",get:function(){var f;return(f=this.fragments)!==null&&f!==void 0&&f.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 f;return(f=this.partList)!==null&&f!==void 0&&f.length?this.partList[this.partList.length-1].index:-1}},{key:"lastPartSn",get:function(){var f;return(f=this.partList)!==null&&f!==void 0&&f.length?this.partList[this.partList.length-1].fragment.sn:this.endSN}}]),n}()},"./src/loader/level-key.ts":function(oe,$,k){"use strict";k.r($),k.d($,"LevelKey",function(){return H});var z=k("./node_modules/url-toolkit/src/url-toolkit.js"),U=k.n(z);function L(n,I){for(var g=0;g<I.length;g++){var f=I[g];f.enumerable=f.enumerable||!1,f.configurable=!0,"value"in f&&(f.writable=!0),Object.defineProperty(n,f.key,f)}}function W(n,I,g){return I&&L(n.prototype,I),g&&L(n,g),n}var H=function(){n.fromURL=function(g,f){return new n(g,f)},n.fromURI=function(g){return new n(g)};function n(I,g){this._uri=null,this.method=null,this.keyFormat=null,this.keyFormatVersions=null,this.keyID=null,this.key=null,this.iv=null,g?this._uri=Object(z.buildAbsoluteURL)(I,g,{alwaysNormalize:!0}):this._uri=I}return W(n,[{key:"uri",get:function(){return this._uri}}]),n}()},"./src/loader/load-stats.ts":function(oe,$,k){"use strict";k.r($),k.d($,"LoadStats",function(){return z});var z=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(oe,$,k){"use strict";k.r($),k.d($,"default",function(){return a});var z=k("./src/polyfills/number.ts"),U=k("./node_modules/url-toolkit/src/url-toolkit.js"),L=k.n(U),W=k("./src/loader/fragment.ts"),H=k("./src/loader/level-details.ts"),n=k("./src/loader/level-key.ts"),I=k("./src/utils/attr-list.ts"),g=k("./src/utils/logger.ts"),f=k("./src/utils/codecs.ts"),m=/#EXT-X-STREAM-INF:([^\r\n]*)(?:[\r\n](?:#[^\r\n]*)?)*([^\r\n]+)|#EXT-X-SESSION-DATA:([^\r\n]*)[\r\n]+/g,h=/#EXT-X-MEDIA:(.*)/g,o=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/(?!#) *(\S[\S ]*)/.source,/#EXT-X-BYTERANGE:*(.+)/.source,/#EXT-X-PROGRAM-DATE-TIME:(.+)/.source,/#.*/.source].join("|"),"g"),p=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("|")),l=/\.(mp4|m4s|m4v|m4a)$/i;function u(O){var R,S;return l.test((R=(S=U.parseURL(O))===null||S===void 0?void 0:S.path)!=null?R:"")}var a=function(){function O(){}return O.findGroup=function(S,T){for(var E=0;E<S.length;E++){var c=S[E];if(c.id===T)return c}},O.convertAVC1ToAVCOTI=function(S){var T=S.split(".");if(T.length>2){var E=T.shift()+".";return E+=parseInt(T.shift()).toString(16),E+=("000"+parseInt(T.shift()).toString(16)).substr(-4),E}return S},O.resolve=function(S,T){return U.buildAbsoluteURL(T,S,{alwaysNormalize:!0})},O.parseMasterPlaylist=function(S,T){var E=[],c={},x=!1;m.lastIndex=0;for(var v;(v=m.exec(S))!=null;)if(v[1]){var y=new I.AttrList(v[1]),F={attrs:y,bitrate:y.decimalInteger("AVERAGE-BANDWIDTH")||y.decimalInteger("BANDWIDTH"),name:y.NAME,url:O.resolve(v[2],T)},B=y.decimalResolution("RESOLUTION");B&&(F.width=B.width,F.height=B.height),s((y.CODECS||"").split(/[ ,]+/).filter(function(j){return j}),F),F.videoCodec&&F.videoCodec.indexOf("avc1")!==-1&&(F.videoCodec=O.convertAVC1ToAVCOTI(F.videoCodec)),E.push(F)}else if(v[3]){var A=new I.AttrList(v[3]);A["DATA-ID"]&&(x=!0,c[A["DATA-ID"]]=A)}return{levels:E,sessionData:x?c:null}},O.parseMasterPlaylistMedia=function(S,T,E,c){c===void 0&&(c=[]);var x,v=[],y=0;for(h.lastIndex=0;(x=h.exec(S))!==null;){var F=new I.AttrList(x[1]);if(F.TYPE===E){var B={attrs:F,bitrate:0,id:y++,groupId:F["GROUP-ID"],instreamId:F["INSTREAM-ID"],name:F.NAME||F.LANGUAGE||"",type:E,default:F.bool("DEFAULT"),autoselect:F.bool("AUTOSELECT"),forced:F.bool("FORCED"),lang:F.LANGUAGE,url:F.URI?O.resolve(F.URI,T):""};if(c.length){var A=O.findGroup(c,B.groupId)||c[0];C(B,A,"audioCodec"),C(B,A,"textCodec")}v.push(B)}}return v},O.parseLevelPlaylist=function(S,T,E,c,x){var v=new H.LevelDetails(T),y=v.fragments,F=null,B=0,A=0,j=0,P=0,b=null,V=new W.Fragment(c,T),re,ce,me,De=-1,we=!1;for(o.lastIndex=0,v.m3u8=S;(re=o.exec(S))!==null;){we&&(we=!1,V=new W.Fragment(c,T),V.start=j,V.sn=B,V.cc=P,V.level=E,F&&(V.initSegment=F,V.rawProgramDateTime=F.rawProgramDateTime));var Le=re[1];if(Le){V.duration=parseFloat(Le);var Re=(" "+re[2]).slice(1);V.title=Re||null,V.tagList.push(Re?["INF",Le,Re]:["INF",Le])}else if(re[3])Object(z.isFiniteNumber)(V.duration)&&(V.start=j,me&&(V.levelkey=me),V.sn=B,V.level=E,V.cc=P,V.urlId=x,y.push(V),V.relurl=(" "+re[3]).slice(1),w(V,b),b=V,j+=V.duration,B++,A=0,we=!0);else if(re[4]){var Ie=(" "+re[4]).slice(1);b?V.setByteRange(Ie,b):V.setByteRange(Ie)}else if(re[5])V.rawProgramDateTime=(" "+re[5]).slice(1),V.tagList.push(["PROGRAM-DATE-TIME",V.rawProgramDateTime]),De===-1&&(De=y.length);else{if(re=re[0].match(p),!re){g.logger.warn("No matches on slow regex match for level playlist!");continue}for(ce=1;ce<re.length&&!(typeof re[ce]!="undefined");ce++);var ye=(" "+re[ce]).slice(1),X=(" "+re[ce+1]).slice(1),M=re[ce+2]?(" "+re[ce+2]).slice(1):"";switch(ye){case"PLAYLIST-TYPE":v.type=X.toUpperCase();break;case"MEDIA-SEQUENCE":B=v.startSN=parseInt(X);break;case"SKIP":{var N=new I.AttrList(X),Y=N.decimalInteger("SKIPPED-SEGMENTS");if(Object(z.isFiniteNumber)(Y)){v.skippedSegments=Y;for(var ie=Y;ie--;)y.unshift(null);B+=Y}var K=N.enumeratedString("RECENTLY-REMOVED-DATERANGES");K&&(v.recentlyRemovedDateranges=K.split(" "));break}case"TARGETDURATION":v.targetduration=parseFloat(X);break;case"VERSION":v.version=parseInt(X);break;case"EXTM3U":break;case"ENDLIST":v.live=!1;break;case"#":(X||M)&&V.tagList.push(M?[X,M]:[X]);break;case"DIS":P++;case"GAP":V.tagList.push([ye]);break;case"BITRATE":V.tagList.push([ye,X]);break;case"DISCONTINUITY-SEQ":P=parseInt(X);break;case"KEY":{var pe,Se=new I.AttrList(X),Pe=Se.enumeratedString("METHOD"),he=Se.URI,ve=Se.hexadecimalInteger("IV"),xe=Se.enumeratedString("KEYFORMATVERSIONS"),Ce=Se.enumeratedString("KEYID"),Be=(pe=Se.enumeratedString("KEYFORMAT"))!=null?pe:"identity",Ne=["com.apple.streamingkeydelivery","com.microsoft.playready","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed","com.widevine"];if(Ne.indexOf(Be)>-1){g.logger.warn("Keyformat "+Be+" is not supported from the manifest");continue}else if(Be!=="identity")continue;Pe&&(me=n.LevelKey.fromURL(T,he),he&&["AES-128","SAMPLE-AES","SAMPLE-AES-CENC"].indexOf(Pe)>=0&&(me.method=Pe,me.keyFormat=Be,Ce&&(me.keyID=Ce),xe&&(me.keyFormatVersions=xe),me.iv=ve));break}case"START":{var Ue=new I.AttrList(X),He=Ue.decimalFloatingPoint("TIME-OFFSET");Object(z.isFiniteNumber)(He)&&(v.startTimeOffset=He);break}case"MAP":{var ze=new I.AttrList(X);V.relurl=ze.URI,ze.BYTERANGE&&V.setByteRange(ze.BYTERANGE),V.level=E,V.sn="initSegment",me&&(V.levelkey=me),V.initSegment=null,F=V,we=!0;break}case"SERVER-CONTROL":{var Ge=new I.AttrList(X);v.canBlockReload=Ge.bool("CAN-BLOCK-RELOAD"),v.canSkipUntil=Ge.optionalFloat("CAN-SKIP-UNTIL",0),v.canSkipDateRanges=v.canSkipUntil>0&&Ge.bool("CAN-SKIP-DATERANGES"),v.partHoldBack=Ge.optionalFloat("PART-HOLD-BACK",0),v.holdBack=Ge.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{var Je=new I.AttrList(X);v.partTarget=Je.decimalFloatingPoint("PART-TARGET");break}case"PART":{var ke=v.partList;ke||(ke=v.partList=[]);var Qe=A>0?ke[ke.length-1]:void 0,Ze=A++,le=new W.Part(new I.AttrList(X),V,T,Ze,Qe);ke.push(le),V.duration+=le.duration;break}case"PRELOAD-HINT":{var Z=new I.AttrList(X);v.preloadHint=Z;break}case"RENDITION-REPORT":{var q=new I.AttrList(X);v.renditionReports=v.renditionReports||[],v.renditionReports.push(q);break}default:g.logger.warn("line parsed but not handled: "+re);break}}}b&&!b.relurl?(y.pop(),j-=b.duration,v.partList&&(v.fragmentHint=b)):v.partList&&(w(V,b),V.cc=P,v.fragmentHint=V);var ae=y.length,ue=y[0],ne=y[ae-1];if(j+=v.skippedSegments*v.targetduration,j>0&&ae&&ne){v.averagetargetduration=j/ae;var te=ne.sn;v.endSN=te!=="initSegment"?te:0,ue&&(v.startCC=ue.cc,ue.initSegment||v.fragments.every(function(de){return de.relurl&&u(de.relurl)})&&(g.logger.warn("MP4 fragments found but no init segment (probably no MAP, incomplete M3U8), trying to fetch SIDX"),V=new W.Fragment(c,T),V.relurl=ne.relurl,V.level=E,V.sn="initSegment",ue.initSegment=V,v.needSidxRanges=!0))}else v.endSN=0,v.startCC=0;return v.fragmentHint&&(j+=v.fragmentHint.duration),v.totalduration=j,v.endCC=P,De>0&&_(y,De),v},O}();function s(O,R){["video","audio","text"].forEach(function(S){var T=O.filter(function(c){return Object(f.isCodecType)(c,S)});if(T.length){var E=T.filter(function(c){return c.lastIndexOf("avc1",0)===0||c.lastIndexOf("mp4a",0)===0});R[S+"Codec"]=E.length>0?E[0]:T[0],O=O.filter(function(c){return T.indexOf(c)===-1})}}),R.unknownCodecs=O}function C(O,R,S){var T=R[S];T&&(O[S]=T)}function _(O,R){for(var S=O[R],T=R;T--;){var E=O[T];if(!E)return;E.programDateTime=S.programDateTime-E.duration*1e3,S=E}}function w(O,R){O.rawProgramDateTime?O.programDateTime=Date.parse(O.rawProgramDateTime):R!=null&&R.programDateTime&&(O.programDateTime=R.endProgramDateTime),Object(z.isFiniteNumber)(O.programDateTime)||(O.programDateTime=null,O.rawProgramDateTime=null)}},"./src/loader/playlist-loader.ts":function(oe,$,k){"use strict";k.r($);var z=k("./src/polyfills/number.ts"),U=k("./src/events.ts"),L=k("./src/errors.ts"),W=k("./src/utils/logger.ts"),H=k("./src/utils/mp4-tools.ts"),n=k("./src/loader/m3u8-parser.ts"),I=k("./src/types/loader.ts"),g=k("./src/utils/attr-list.ts");function f(o){var p=o.type;switch(p){case I.PlaylistContextType.AUDIO_TRACK:return I.PlaylistLevelType.AUDIO;case I.PlaylistContextType.SUBTITLE_TRACK:return I.PlaylistLevelType.SUBTITLE;default:return I.PlaylistLevelType.MAIN}}function m(o,p){var l=o.url;return(l===void 0||l.indexOf("data:")===0)&&(l=p.url),l}var h=function(){function o(l){this.hls=void 0,this.loaders=Object.create(null),this.hls=l,this.registerListeners()}var p=o.prototype;return p.registerListeners=function(){var u=this.hls;u.on(U.Events.MANIFEST_LOADING,this.onManifestLoading,this),u.on(U.Events.LEVEL_LOADING,this.onLevelLoading,this),u.on(U.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),u.on(U.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},p.unregisterListeners=function(){var u=this.hls;u.off(U.Events.MANIFEST_LOADING,this.onManifestLoading,this),u.off(U.Events.LEVEL_LOADING,this.onLevelLoading,this),u.off(U.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),u.off(U.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},p.createInternalLoader=function(u){var a=this.hls.config,s=a.pLoader,C=a.loader,_=s||C,w=new _(a);return u.loader=w,this.loaders[u.type]=w,w},p.getInternalLoader=function(u){return this.loaders[u.type]},p.resetInternalLoader=function(u){this.loaders[u]&&delete this.loaders[u]},p.destroyInternalLoaders=function(){for(var u in this.loaders){var a=this.loaders[u];a&&a.destroy(),this.resetInternalLoader(u)}},p.destroy=function(){this.unregisterListeners(),this.destroyInternalLoaders()},p.onManifestLoading=function(u,a){var s=a.url;this.load({id:null,groupId:null,level:0,responseType:"text",type:I.PlaylistContextType.MANIFEST,url:s,deliveryDirectives:null})},p.onLevelLoading=function(u,a){var s=a.id,C=a.level,_=a.url,w=a.deliveryDirectives;this.load({id:s,groupId:null,level:C,responseType:"text",type:I.PlaylistContextType.LEVEL,url:_,deliveryDirectives:w})},p.onAudioTrackLoading=function(u,a){var s=a.id,C=a.groupId,_=a.url,w=a.deliveryDirectives;this.load({id:s,groupId:C,level:null,responseType:"text",type:I.PlaylistContextType.AUDIO_TRACK,url:_,deliveryDirectives:w})},p.onSubtitleTrackLoading=function(u,a){var s=a.id,C=a.groupId,_=a.url,w=a.deliveryDirectives;this.load({id:s,groupId:C,level:null,responseType:"text",type:I.PlaylistContextType.SUBTITLE_TRACK,url:_,deliveryDirectives:w})},p.load=function(u){var a,s=this.hls.config,C=this.getInternalLoader(u);if(C){var _=C.context;if(_&&_.url===u.url){W.logger.trace("[playlist-loader]: playlist request ongoing");return}W.logger.log("[playlist-loader]: aborting previous loader for type: "+u.type),C.abort()}var w,O,R,S;switch(u.type){case I.PlaylistContextType.MANIFEST:w=s.manifestLoadingMaxRetry,O=s.manifestLoadingTimeOut,R=s.manifestLoadingRetryDelay,S=s.manifestLoadingMaxRetryTimeout;break;case I.PlaylistContextType.LEVEL:case I.PlaylistContextType.AUDIO_TRACK:case I.PlaylistContextType.SUBTITLE_TRACK:w=0,O=s.levelLoadingTimeOut;break;default:w=s.levelLoadingMaxRetry,O=s.levelLoadingTimeOut,R=s.levelLoadingRetryDelay,S=s.levelLoadingMaxRetryTimeout;break}if(C=this.createInternalLoader(u),(a=u.deliveryDirectives)!==null&&a!==void 0&&a.part){var T;if(u.type===I.PlaylistContextType.LEVEL&&u.level!==null?T=this.hls.levels[u.level].details:u.type===I.PlaylistContextType.AUDIO_TRACK&&u.id!==null?T=this.hls.audioTracks[u.id].details:u.type===I.PlaylistContextType.SUBTITLE_TRACK&&u.id!==null&&(T=this.hls.subtitleTracks[u.id].details),T){var E=T.partTarget,c=T.targetduration;E&&c&&(O=Math.min(Math.max(E*3,c*.8)*1e3,O))}}var x={timeout:O,maxRetry:w,retryDelay:R,maxRetryDelay:S,highWaterMark:0},v={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};C.load(u,x,v)},p.loadsuccess=function(u,a,s,C){if(C===void 0&&(C=null),s.isSidxRequest){this.handleSidxRequest(u,s),this.handlePlaylistLoaded(u,a,s,C);return}this.resetInternalLoader(s.type);var _=u.data;if(_.indexOf("#EXTM3U")!==0){this.handleManifestParsingError(u,s,"no EXTM3U delimiter",C);return}a.parsing.start=performance.now(),_.indexOf("#EXTINF:")>0||_.indexOf("#EXT-X-TARGETDURATION:")>0?this.handleTrackOrLevelPlaylist(u,a,s,C):this.handleMasterPlaylist(u,a,s,C)},p.loaderror=function(u,a,s){s===void 0&&(s=null),this.handleNetworkError(a,s,!1,u)},p.loadtimeout=function(u,a,s){s===void 0&&(s=null),this.handleNetworkError(a,s,!0)},p.handleMasterPlaylist=function(u,a,s,C){var _=this.hls,w=u.data,O=m(u,s),R=n.default.parseMasterPlaylist(w,O),S=R.levels,T=R.sessionData;if(!S.length){this.handleManifestParsingError(u,s,"no level found in manifest",C);return}var E=S.map(function(B){return{id:B.attrs.AUDIO,audioCodec:B.audioCodec}}),c=S.map(function(B){return{id:B.attrs.SUBTITLES,textCodec:B.textCodec}}),x=n.default.parseMasterPlaylistMedia(w,O,"AUDIO",E),v=n.default.parseMasterPlaylistMedia(w,O,"SUBTITLES",c),y=n.default.parseMasterPlaylistMedia(w,O,"CLOSED-CAPTIONS");if(x.length){var F=x.some(function(B){return!B.url});!F&&S[0].audioCodec&&!S[0].attrs.AUDIO&&(W.logger.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),x.unshift({type:"main",name:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new g.AttrList({}),bitrate:0,url:""}))}_.trigger(U.Events.MANIFEST_LOADED,{levels:S,audioTracks:x,subtitles:v,captions:y,url:O,stats:a,networkDetails:C,sessionData:T})},p.handleTrackOrLevelPlaylist=function(u,a,s,C){var _=this.hls,w=s.id,O=s.level,R=s.type,S=m(u,s),T=Object(z.isFiniteNumber)(w)?w:0,E=Object(z.isFiniteNumber)(O)?O:T,c=f(s),x=n.default.parseLevelPlaylist(u.data,S,E,c,T);if(!x.fragments.length){_.trigger(U.Events.ERROR,{type:L.ErrorTypes.NETWORK_ERROR,details:L.ErrorDetails.LEVEL_EMPTY_ERROR,fatal:!1,url:S,reason:"no fragments found in level",level:typeof s.level=="number"?s.level:void 0});return}if(R===I.PlaylistContextType.MANIFEST){var v={attrs:new g.AttrList({}),bitrate:0,details:x,name:"",url:S};_.trigger(U.Events.MANIFEST_LOADED,{levels:[v],audioTracks:[],url:S,stats:a,networkDetails:C,sessionData:null})}if(a.parsing.end=performance.now(),x.needSidxRanges){var y,F=(y=x.fragments[0].initSegment)===null||y===void 0?void 0:y.url;this.load({url:F,isSidxRequest:!0,type:R,level:O,levelDetails:x,id:w,groupId:null,rangeStart:0,rangeEnd:2048,responseType:"arraybuffer",deliveryDirectives:null});return}s.levelDetails=x,this.handlePlaylistLoaded(u,a,s,C)},p.handleSidxRequest=function(u,a){var s=Object(H.parseSegmentIndex)(new Uint8Array(u.data));if(!s)return;var C=s.references,_=a.levelDetails;C.forEach(function(w,O){var R=w.info,S=_.fragments[O];S.byteRange.length===0&&S.setByteRange(String(1+R.end-R.start)+"@"+String(R.start)),S.initSegment&&S.initSegment.setByteRange(String(s.moovEndOffset)+"@0")})},p.handleManifestParsingError=function(u,a,s,C){this.hls.trigger(U.Events.ERROR,{type:L.ErrorTypes.NETWORK_ERROR,details:L.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:a.type===I.PlaylistContextType.MANIFEST,url:u.url,reason:s,response:u,context:a,networkDetails:C})},p.handleNetworkError=function(u,a,s,C){s===void 0&&(s=!1),W.logger.warn("[playlist-loader]: A network "+(s?"timeout":"error")+" occurred while loading "+u.type+" level: "+u.level+" id: "+u.id+' group-id: "'+u.groupId+'"');var _=L.ErrorDetails.UNKNOWN,w=!1,O=this.getInternalLoader(u);switch(u.type){case I.PlaylistContextType.MANIFEST:_=s?L.ErrorDetails.MANIFEST_LOAD_TIMEOUT:L.ErrorDetails.MANIFEST_LOAD_ERROR,w=!0;break;case I.PlaylistContextType.LEVEL:_=s?L.ErrorDetails.LEVEL_LOAD_TIMEOUT:L.ErrorDetails.LEVEL_LOAD_ERROR,w=!1;break;case I.PlaylistContextType.AUDIO_TRACK:_=s?L.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:L.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,w=!1;break;case I.PlaylistContextType.SUBTITLE_TRACK:_=s?L.ErrorDetails.SUBTITLE_TRACK_LOAD_TIMEOUT:L.ErrorDetails.SUBTITLE_LOAD_ERROR,w=!1;break}O&&this.resetInternalLoader(u.type);var R={type:L.ErrorTypes.NETWORK_ERROR,details:_,fatal:w,url:u.url,loader:O,context:u,networkDetails:a};C&&(R.response=C),this.hls.trigger(U.Events.ERROR,R)},p.handlePlaylistLoaded=function(u,a,s,C){var _=s.type,w=s.level,O=s.id,R=s.groupId,S=s.loader,T=s.levelDetails,E=s.deliveryDirectives;if(!(T!=null&&T.targetduration)){this.handleManifestParsingError(u,s,"invalid target duration",C);return}if(!S)return;T.live&&(S.getCacheAge&&(T.ageHeader=S.getCacheAge()||0),(!S.getCacheAge||isNaN(T.ageHeader))&&(T.ageHeader=0));switch(_){case I.PlaylistContextType.MANIFEST:case I.PlaylistContextType.LEVEL:this.hls.trigger(U.Events.LEVEL_LOADED,{details:T,level:w||0,id:O||0,stats:a,networkDetails:C,deliveryDirectives:E});break;case I.PlaylistContextType.AUDIO_TRACK:this.hls.trigger(U.Events.AUDIO_TRACK_LOADED,{details:T,id:O||0,groupId:R||"",stats:a,networkDetails:C,deliveryDirectives:E});break;case I.PlaylistContextType.SUBTITLE_TRACK:this.hls.trigger(U.Events.SUBTITLE_TRACK_LOADED,{details:T,id:O||0,groupId:R||"",stats:a,networkDetails:C,deliveryDirectives:E});break}},o}();$.default=h},"./src/polyfills/number.ts":function(oe,$,k){"use strict";k.r($),k.d($,"isFiniteNumber",function(){return z}),k.d($,"MAX_SAFE_INTEGER",function(){return U});var z=Number.isFinite||function(L){return typeof L=="number"&&isFinite(L)},U=Number.MAX_SAFE_INTEGER||9007199254740991},"./src/remux/aac-helper.ts":function(oe,$,k){"use strict";k.r($);var z=function(){function U(){}return U.getSilentFrame=function(W,H){switch(W){case"mp4a.40.2":if(H===1)return new Uint8Array([0,200,0,128,35,128]);if(H===2)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(H===3)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(H===4)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(H===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(H===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(H===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(H===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(H===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},U}();$.default=z},"./src/remux/mp4-generator.ts":function(oe,$,k){"use strict";k.r($);var z=Math.pow(2,32)-1,U=function(){function L(){}return L.init=function(){L.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 H;for(H in L.types)L.types.hasOwnProperty(H)&&(L.types[H]=[H.charCodeAt(0),H.charCodeAt(1),H.charCodeAt(2),H.charCodeAt(3)]);var n=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]),I=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]);L.HDLR_TYPES={video:n,audio:I};var g=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),f=new Uint8Array([0,0,0,0,0,0,0,0]);L.STTS=L.STSC=L.STCO=f,L.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),L.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),L.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),L.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);var m=new Uint8Array([105,115,111,109]),h=new Uint8Array([97,118,99,49]),o=new Uint8Array([0,0,0,1]);L.FTYP=L.box(L.types.ftyp,m,o,m,h),L.DINF=L.box(L.types.dinf,L.box(L.types.dref,g))},L.box=function(H){for(var n=8,I=arguments.length,g=new Array(I>1?I-1:0),f=1;f<I;f++)g[f-1]=arguments[f];for(var m=g.length,h=m;m--;)n+=g[m].byteLength;var o=new Uint8Array(n);for(o[0]=n>>24&255,o[1]=n>>16&255,o[2]=n>>8&255,o[3]=n&255,o.set(H,4),m=0,n=8;m<h;m++)o.set(g[m],n),n+=g[m].byteLength;return o},L.hdlr=function(H){return L.box(L.types.hdlr,L.HDLR_TYPES[H])},L.mdat=function(H){return L.box(L.types.mdat,H)},L.mdhd=function(H,n){n*=H;var I=Math.floor(n/(z+1)),g=Math.floor(n%(z+1));return L.box(L.types.mdhd,new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,H>>24&255,H>>16&255,H>>8&255,H&255,I>>24,I>>16&255,I>>8&255,I&255,g>>24,g>>16&255,g>>8&255,g&255,85,196,0,0]))},L.mdia=function(H){return L.box(L.types.mdia,L.mdhd(H.timescale,H.duration),L.hdlr(H.type),L.minf(H))},L.mfhd=function(H){return L.box(L.types.mfhd,new Uint8Array([0,0,0,0,H>>24,H>>16&255,H>>8&255,H&255]))},L.minf=function(H){return H.type==="audio"?L.box(L.types.minf,L.box(L.types.smhd,L.SMHD),L.DINF,L.stbl(H)):L.box(L.types.minf,L.box(L.types.vmhd,L.VMHD),L.DINF,L.stbl(H))},L.moof=function(H,n,I){return L.box(L.types.moof,L.mfhd(H),L.traf(I,n))},L.moov=function(H){for(var n=H.length,I=[];n--;)I[n]=L.trak(H[n]);return L.box.apply(null,[L.types.moov,L.mvhd(H[0].timescale,H[0].duration)].concat(I).concat(L.mvex(H)))},L.mvex=function(H){for(var n=H.length,I=[];n--;)I[n]=L.trex(H[n]);return L.box.apply(null,[L.types.mvex].concat(I))},L.mvhd=function(H,n){n*=H;var I=Math.floor(n/(z+1)),g=Math.floor(n%(z+1)),f=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,H>>24&255,H>>16&255,H>>8&255,H&255,I>>24,I>>16&255,I>>8&255,I&255,g>>24,g>>16&255,g>>8&255,g&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 L.box(L.types.mvhd,f)},L.sdtp=function(H){var n=H.samples||[],I=new Uint8Array(4+n.length),g,f;for(g=0;g<n.length;g++)f=n[g].flags,I[g+4]=f.dependsOn<<4|f.isDependedOn<<2|f.hasRedundancy;return L.box(L.types.sdtp,I)},L.stbl=function(H){return L.box(L.types.stbl,L.stsd(H),L.box(L.types.stts,L.STTS),L.box(L.types.stsc,L.STSC),L.box(L.types.stsz,L.STSZ),L.box(L.types.stco,L.STCO))},L.avc1=function(H){var n=[],I=[],g,f,m;for(g=0;g<H.sps.length;g++)f=H.sps[g],m=f.byteLength,n.push(m>>>8&255),n.push(m&255),n=n.concat(Array.prototype.slice.call(f));for(g=0;g<H.pps.length;g++)f=H.pps[g],m=f.byteLength,I.push(m>>>8&255),I.push(m&255),I=I.concat(Array.prototype.slice.call(f));var h=L.box(L.types.avcC,new Uint8Array([1,n[3],n[4],n[5],252|3,224|H.sps.length].concat(n).concat([H.pps.length]).concat(I))),o=H.width,p=H.height,l=H.pixelRatio[0],u=H.pixelRatio[1];return L.box(L.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,o>>8&255,o&255,p>>8&255,p&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]),h,L.box(L.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),L.box(L.types.pasp,new Uint8Array([l>>24,l>>16&255,l>>8&255,l&255,u>>24,u>>16&255,u>>8&255,u&255])))},L.esds=function(H){var n=H.config.length;return new Uint8Array([0,0,0,0,3,23+n,0,1,0,4,15+n,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([n]).concat(H.config).concat([6,1,2]))},L.mp4a=function(H){var n=H.samplerate;return L.box(L.types.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,H.channelCount,0,16,0,0,0,0,n>>8&255,n&255,0,0]),L.box(L.types.esds,L.esds(H)))},L.mp3=function(H){var n=H.samplerate;return L.box(L.types[".mp3"],new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,H.channelCount,0,16,0,0,0,0,n>>8&255,n&255,0,0]))},L.stsd=function(H){return H.type==="audio"?!H.isAAC&&H.codec==="mp3"?L.box(L.types.stsd,L.STSD,L.mp3(H)):L.box(L.types.stsd,L.STSD,L.mp4a(H)):L.box(L.types.stsd,L.STSD,L.avc1(H))},L.tkhd=function(H){var n=H.id,I=H.duration*H.timescale,g=H.width,f=H.height,m=Math.floor(I/(z+1)),h=Math.floor(I%(z+1));return L.box(L.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,n>>24&255,n>>16&255,n>>8&255,n&255,0,0,0,0,m>>24,m>>16&255,m>>8&255,m&255,h>>24,h>>16&255,h>>8&255,h&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,g>>8&255,g&255,0,0,f>>8&255,f&255,0,0]))},L.traf=function(H,n){var I=L.sdtp(H),g=H.id,f=Math.floor(n/(z+1)),m=Math.floor(n%(z+1));return L.box(L.types.traf,L.box(L.types.tfhd,new Uint8Array([0,0,0,0,g>>24,g>>16&255,g>>8&255,g&255])),L.box(L.types.tfdt,new Uint8Array([1,0,0,0,f>>24,f>>16&255,f>>8&255,f&255,m>>24,m>>16&255,m>>8&255,m&255])),L.trun(H,I.length+16+20+8+16+8+8),I)},L.trak=function(H){return H.duration=H.duration||4294967295,L.box(L.types.trak,L.tkhd(H),L.mdia(H))},L.trex=function(H){var n=H.id;return L.box(L.types.trex,new Uint8Array([0,0,0,0,n>>24,n>>16&255,n>>8&255,n&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))},L.trun=function(H,n){var I=H.samples||[],g=I.length,f=12+16*g,m=new Uint8Array(f),h,o,p,l,u,a;for(n+=8+f,m.set([0,0,15,1,g>>>24&255,g>>>16&255,g>>>8&255,g&255,n>>>24&255,n>>>16&255,n>>>8&255,n&255],0),h=0;h<g;h++)o=I[h],p=o.duration,l=o.size,u=o.flags,a=o.cts,m.set([p>>>24&255,p>>>16&255,p>>>8&255,p&255,l>>>24&255,l>>>16&255,l>>>8&255,l&255,u.isLeading<<2|u.dependsOn,u.isDependedOn<<6|u.hasRedundancy<<4|u.paddingValue<<1|u.isNonSync,u.degradPrio&240<<8,u.degradPrio&15,a>>>24&255,a>>>16&255,a>>>8&255,a&255],12+16*h);return L.box(L.types.trun,m)},L.initSegment=function(H){L.types||L.init();var n=L.moov(H),I=new Uint8Array(L.FTYP.byteLength+n.byteLength);return I.set(L.FTYP),I.set(n,L.FTYP.byteLength),I},L}();U.types=void 0,U.HDLR_TYPES=void 0,U.STTS=void 0,U.STSC=void 0,U.STCO=void 0,U.STSZ=void 0,U.VMHD=void 0,U.SMHD=void 0,U.STSD=void 0,U.FTYP=void 0,U.DINF=void 0,$.default=U},"./src/remux/mp4-remuxer.ts":function(oe,$,k){"use strict";k.r($),k.d($,"default",function(){return a}),k.d($,"normalizePts",function(){return s});var z=k("./src/polyfills/number.ts"),U=k("./src/remux/aac-helper.ts"),L=k("./src/remux/mp4-generator.ts"),W=k("./src/events.ts"),H=k("./src/errors.ts"),n=k("./src/utils/logger.ts"),I=k("./src/types/loader.ts"),g=k("./src/utils/timescale-conversion.ts");function f(){return f=Object.assign||function(O){for(var R=1;R<arguments.length;R++){var S=arguments[R];for(var T in S)Object.prototype.hasOwnProperty.call(S,T)&&(O[T]=S[T])}return O},f.apply(this,arguments)}var m=10*1e3,h=1024,o=1152,p=null,l=null,u=!1,a=function(){function O(S,T,E,c){if(c===void 0&&(c=""),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=S,this.config=T,this.typeSupported=E,this.ISGenerated=!1,p===null){var x=navigator.userAgent||"",v=x.match(/Chrome\/(\d+)/i);p=v?parseInt(v[1]):0}if(l===null){var y=navigator.userAgent.match(/Safari\/(\d+)/i);l=y?parseInt(y[1]):0}u=!!p&&p<75||!!l&&l<600}var R=O.prototype;return R.destroy=function(){},R.resetTimeStamp=function(T){n.logger.log("[mp4-remuxer]: initPTS & initDTS reset"),this._initPTS=this._initDTS=T},R.resetNextTimestamp=function(){n.logger.log("[mp4-remuxer]: reset next timestamp"),this.isVideoContiguous=!1,this.isAudioContiguous=!1},R.resetInitSegment=function(){n.logger.log("[mp4-remuxer]: ISGenerated flag reset"),this.ISGenerated=!1},R.getVideoStartPts=function(T){var E=!1,c=T.reduce(function(x,v){var y=v.pts-x;return y<-4294967296?(E=!0,s(x,v.pts)):y>0?x:v.pts},T[0].pts);return E&&n.logger.debug("PTS rollover detected"),c},R.remux=function(T,E,c,x,v,y,F,B){var A,j,P,b,V,re,ce=v,me=v,De=T.pid>-1,we=E.pid>-1,Le=E.samples.length,Re=T.samples.length>0,Ie=Le>1,ye=(!De||Re)&&(!we||Ie)||this.ISGenerated||F;if(ye){this.ISGenerated||(P=this.generateIS(T,E,v));var X=this.isVideoContiguous,M=-1;if(Ie&&(M=C(E.samples),!X&&this.config.forceKeyFrameOnDiscontinuity))if(re=!0,M>0){n.logger.warn("[mp4-remuxer]: Dropped "+M+" out of "+Le+" video samples due to a missing keyframe");var N=this.getVideoStartPts(E.samples);E.samples=E.samples.slice(M),E.dropped+=M,me+=(E.samples[0].pts-N)/(E.timescale||9e4)}else M===-1&&(n.logger.warn("[mp4-remuxer]: No keyframe found out of "+Le+" video samples"),re=!1);if(this.ISGenerated){if(Re&&Ie){var Y=this.getVideoStartPts(E.samples),ie=s(T.samples[0].pts,Y)-Y,K=ie/E.inputTimeScale;ce+=Math.max(0,K),me+=Math.max(0,-K)}if(Re){if(T.samplerate||(n.logger.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),P=this.generateIS(T,E,v)),j=this.remuxAudio(T,ce,this.isAudioContiguous,y,we||Ie||B===I.PlaylistLevelType.AUDIO?me:void 0),Ie){var pe=j?j.endPTS-j.startPTS:0;E.inputTimeScale||(n.logger.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),P=this.generateIS(T,E,v)),A=this.remuxVideo(E,me,X,pe)}}else Ie&&(A=this.remuxVideo(E,me,X,0));A&&(A.firstKeyFrame=M,A.independent=M!==-1)}}return this.ISGenerated&&(c.samples.length&&(V=this.remuxID3(c,v)),x.samples.length&&(b=this.remuxText(x,v))),{audio:j,video:A,initSegment:P,independent:re,text:b,id3:V}},R.generateIS=function(T,E,c){var x=T.samples,v=E.samples,y=this.typeSupported,F={},B=!Object(z.isFiniteNumber)(this._initPTS),A="audio/mp4",j,P,b;if(B&&(j=P=Infinity),T.config&&x.length&&(T.timescale=T.samplerate,T.isAAC||(y.mpeg?(A="audio/mpeg",T.codec=""):y.mp3&&(T.codec="mp3")),F.audio={id:"audio",container:A,codec:T.codec,initSegment:!T.isAAC&&y.mpeg?new Uint8Array(0):L.default.initSegment([T]),metadata:{channelCount:T.channelCount}},B&&(b=T.inputTimeScale,j=P=x[0].pts-Math.round(b*c))),E.sps&&E.pps&&v.length&&(E.timescale=E.inputTimeScale,F.video={id:"main",container:"video/mp4",codec:E.codec,initSegment:L.default.initSegment([E]),metadata:{width:E.width,height:E.height}},B)){b=E.inputTimeScale;var V=this.getVideoStartPts(v),re=Math.round(b*c);P=Math.min(P,s(v[0].dts,V)-re),j=Math.min(j,V-re)}if(Object.keys(F).length)return this.ISGenerated=!0,B&&(this._initPTS=j,this._initDTS=P),{tracks:F,initPTS:j,timescale:b}},R.remuxVideo=function(T,E,c,x){var v=T.inputTimeScale,y=T.samples,F=[],B=y.length,A=this._initPTS,j=this.nextAvcDts,P=8,b,V,re,ce=Number.POSITIVE_INFINITY,me=Number.NEGATIVE_INFINITY,De=0,we=!1;if(!c||j===null){var Le=E*v,Re=y[0].pts-s(y[0].dts,y[0].pts);j=Le-Re}for(var Ie=0;Ie<B;Ie++){var ye=y[Ie];if(ye.pts=s(ye.pts-A,j),ye.dts=s(ye.dts-A,j),ye.dts>ye.pts){var X=9e4*.2;De=Math.max(Math.min(De,ye.pts-ye.dts),-1*X)}ye.dts<y[Ie>0?Ie-1:Ie].dts&&(we=!0)}we&&y.sort(function(Tt,ot){var $e=Tt.dts-ot.dts,yt=Tt.pts-ot.pts;return $e||yt}),V=y[0].dts,re=y[y.length-1].dts;var M=Math.round((re-V)/(B-1));if(De<0){if(De<M*-2){n.logger.warn("PTS < DTS detected in video samples, offsetting DTS from PTS by "+Object(g.toMsFromMpegTsClock)(-M,!0)+" ms");for(var N=De,Y=0;Y<B;Y++)y[Y].dts=N=Math.max(N,y[Y].pts-M),y[Y].pts=Math.max(N,y[Y].pts)}else{n.logger.warn("PTS < DTS detected in video samples, shifting DTS by "+Object(g.toMsFromMpegTsClock)(De,!0)+" ms to overcome this issue");for(var ie=0;ie<B;ie++)y[ie].dts=y[ie].dts+De}V=y[0].dts}if(c){var K=V-j,pe=K>M,Se=K<-1;if(pe||Se){pe?n.logger.warn("AVC: "+Object(g.toMsFromMpegTsClock)(K,!0)+" ms ("+K+"dts) hole between fragments detected, filling it"):n.logger.warn("AVC: "+Object(g.toMsFromMpegTsClock)(-K,!0)+" ms ("+K+"dts) overlapping between fragments detected"),V=j;var Pe=y[0].pts-K;y[0].dts=V,y[0].pts=Pe,n.logger.log("Video: First PTS/DTS adjusted: "+Object(g.toMsFromMpegTsClock)(Pe,!0)+"/"+Object(g.toMsFromMpegTsClock)(V,!0)+", delta: "+Object(g.toMsFromMpegTsClock)(K,!0)+" ms")}}u&&(V=Math.max(0,V));for(var he=0,ve=0,xe=0;xe<B;xe++){for(var Ce=y[xe],Be=Ce.units,Ne=Be.length,Ue=0,He=0;He<Ne;He++)Ue+=Be[He].data.length;ve+=Ue,he+=Ne,Ce.length=Ue,Ce.dts=Math.max(Ce.dts,V),Ce.pts=Math.max(Ce.pts,Ce.dts,0),ce=Math.min(Ce.pts,ce),me=Math.max(Ce.pts,me)}re=y[B-1].dts;var ze=ve+4*he+8,Ge;try{Ge=new Uint8Array(ze)}catch(Tt){this.observer.emit(W.Events.ERROR,W.Events.ERROR,{type:H.ErrorTypes.MUX_ERROR,details:H.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:ze,reason:"fail allocating video mdat "+ze});return}var Je=new DataView(Ge.buffer);Je.setUint32(0,ze),Ge.set(L.default.types.mdat,4);for(var ke=0;ke<B;ke++){for(var Qe=y[ke],Ze=Qe.units,le=0,Z=0,q=Ze.length;Z<q;Z++){var ae=Ze[Z],ue=ae.data,ne=ae.data.byteLength;Je.setUint32(P,ne),P+=4,Ge.set(ue,P),P+=ne,le+=4+ne}if(ke<B-1)b=y[ke+1].dts-Qe.dts;else{var te=this.config,de=Qe.dts-y[ke>0?ke-1:ke].dts;if(te.stretchShortVideoTrack&&this.nextAudioPts!==null){var fe=Math.floor(te.maxBufferHole*v),be=(x?ce+x*v:this.nextAudioPts)-Qe.pts;be>fe?(b=be-de,b<0&&(b=de),n.logger.log("[mp4-remuxer]: It is approximately "+be/90+" ms to the next segment; using duration "+b/90+" ms for the last video frame.")):b=de}else b=de}var Te=Math.round(Qe.pts-Qe.dts);F.push(new _(Qe.key,b,le,Te))}if(F.length&&p&&p<70){var Me=F[0].flags;Me.dependsOn=2,Me.isNonSync=0}console.assert(b!==void 0,"mp4SampleDuration must be computed"),this.nextAvcDts=j=re+b,this.isVideoContiguous=!0;var je=L.default.moof(T.sequenceNumber++,V,f({},T,{samples:F})),nt="video",it={data1:je,data2:Ge,startPTS:ce/v,endPTS:(me+b)/v,startDTS:V/v,endDTS:j/v,type:nt,hasAudio:!1,hasVideo:!0,nb:F.length,dropped:T.dropped};return T.samples=[],T.dropped=0,console.assert(Ge.length,"MDAT length must not be zero"),it},R.remuxAudio=function(T,E,c,x,v){var y=T.inputTimeScale,F=T.samplerate?T.samplerate:y,B=y/F,A=T.isAAC?h:o,j=A*B,P=this._initPTS,b=!T.isAAC&&this.typeSupported.mpeg,V=[],re=T.samples,ce=b?0:8,me=this.nextAudioPts||-1,De=E*y;if(this.isAudioContiguous=c=c||re.length&&me>0&&(x&&Math.abs(De-me)<9e3||Math.abs(s(re[0].pts-P,De)-me)<20*j),re.forEach(function(ue){ue.pts=s(ue.pts-P,De)}),!c||me<0){if(re=re.filter(function(ue){return ue.pts>=0}),!re.length)return;v===0?me=0:x?me=Math.max(0,De):me=re[0].pts}if(T.isAAC)for(var we=v!==void 0,Le=this.config.maxAudioFramesDrift,Re=0,Ie=me;Re<re.length;Re++){var ye=re[Re],X=ye.pts,M=X-Ie,N=Math.abs(1e3*M/y);if(M<=-Le*j&&we)Re===0&&(n.logger.warn("Audio frame @ "+(X/y).toFixed(3)+"s overlaps nextAudioPts by "+Math.round(1e3*M/y)+" ms."),this.nextAudioPts=me=Ie=X);else if(M>=Le*j&&N<m&&we){var Y=Math.round(M/j);Ie=X-Y*j,Ie<0&&(Y--,Ie+=j),Re===0&&(this.nextAudioPts=me=Ie),n.logger.warn("[mp4-remuxer]: Injecting "+Y+" audio frame @ "+(Ie/y).toFixed(3)+"s due to "+Math.round(1e3*M/y)+" ms gap.");for(var ie=0;ie<Y;ie++){var K=Math.max(Ie,0),pe=U.default.getSilentFrame(T.manifestCodec||T.codec,T.channelCount);pe||(n.logger.log("[mp4-remuxer]: Unable to get silent frame for given audio codec; duplicating last frame instead."),pe=ye.unit.subarray()),re.splice(Re,0,{unit:pe,pts:K}),Ie+=j,Re++}}ye.pts=Ie,Ie+=j}for(var Se=null,Pe=null,he,ve=0,xe=re.length;xe--;)ve+=re[xe].unit.byteLength;for(var Ce=0,Be=re.length;Ce<Be;Ce++){var Ne=re[Ce],Ue=Ne.unit,He=Ne.pts;if(Pe!==null){var ze=V[Ce-1];ze.duration=Math.round((He-Pe)/B)}else if(c&&T.isAAC&&(He=me),Se=He,ve>0){ve+=ce;try{he=new Uint8Array(ve)}catch(ue){this.observer.emit(W.Events.ERROR,W.Events.ERROR,{type:H.ErrorTypes.MUX_ERROR,details:H.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:ve,reason:"fail allocating audio mdat "+ve});return}if(!b){var Ge=new DataView(he.buffer);Ge.setUint32(0,ve),he.set(L.default.types.mdat,4)}}else return;he.set(Ue,ce);var Je=Ue.byteLength;ce+=Je,V.push(new _(!0,A,Je,0)),Pe=He}var ke=V.length;if(!ke)return;var Qe=V[V.length-1];this.nextAudioPts=me=Pe+B*Qe.duration;var Ze=b?new Uint8Array(0):L.default.moof(T.sequenceNumber++,Se/B,f({},T,{samples:V}));T.samples=[];var le=Se/y,Z=me/y,q="audio",ae={data1:Ze,data2:he,startPTS:le,endPTS:Z,startDTS:le,endDTS:Z,type:q,hasAudio:!0,hasVideo:!1,nb:ke};return this.isAudioContiguous=!0,console.assert(he.length,"MDAT length must not be zero"),ae},R.remuxEmptyAudio=function(T,E,c,x){var v=T.inputTimeScale,y=T.samplerate?T.samplerate:v,F=v/y,B=this.nextAudioPts,A=(B!==null?B:x.startDTS*v)+this._initDTS,j=x.endDTS*v+this._initDTS,P=F*h,b=Math.ceil((j-A)/P),V=U.default.getSilentFrame(T.manifestCodec||T.codec,T.channelCount);if(n.logger.warn("[mp4-remuxer]: remux empty Audio"),!V){n.logger.trace("[mp4-remuxer]: Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec");return}for(var re=[],ce=0;ce<b;ce++){var me=A+ce*P;re.push({unit:V,pts:me,dts:me})}return T.samples=re,this.remuxAudio(T,E,c,!1)},R.remuxID3=function(T,E){var c=T.samples.length;if(!c)return;for(var x=T.inputTimeScale,v=this._initPTS,y=this._initDTS,F=0;F<c;F++){var B=T.samples[F];B.pts=s(B.pts-v,E*x)/x,B.dts=s(B.dts-y,E*x)/x}var A=T.samples;return T.samples=[],{samples:A}},R.remuxText=function(T,E){var c=T.samples.length;if(!c)return;for(var x=T.inputTimeScale,v=this._initPTS,y=0;y<c;y++){var F=T.samples[y];F.pts=s(F.pts-v,E*x)/x}T.samples.sort(function(A,j){return A.pts-j.pts});var B=T.samples;return T.samples=[],{samples:B}},O}();function s(O,R){var S;if(R===null)return O;for(R<O?S=-8589934592:S=8589934592;Math.abs(O-R)>4294967296;)O+=S;return O}function C(O){for(var R=0;R<O.length;R++)if(O[R].key)return R;return-1}var _=function(R,S,T,E){this.size=void 0,this.duration=void 0,this.cts=void 0,this.flags=void 0,this.duration=S,this.size=T,this.cts=E,this.flags=new w(R)},w=function(R){this.isLeading=0,this.isDependedOn=0,this.hasRedundancy=0,this.degradPrio=0,this.dependsOn=1,this.isNonSync=1,this.dependsOn=R?2:1,this.isNonSync=R?0:1}},"./src/remux/passthrough-remuxer.ts":function(oe,$,k){"use strict";k.r($);var z=k("./src/polyfills/number.ts"),U=k("./src/utils/mp4-tools.ts"),L=k("./src/loader/fragment.ts"),W=k("./src/utils/logger.ts"),H=function(){function g(){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 f=g.prototype;return f.destroy=function(){},f.resetTimeStamp=function(h){this.initPTS=h,this.lastEndDTS=null},f.resetNextTimestamp=function(){this.lastEndDTS=null},f.resetInitSegment=function(h,o,p){this.audioCodec=o,this.videoCodec=p,this.generateInitSegment(h),this.emitInitSegment=!0},f.generateInitSegment=function(h){var o=this.audioCodec,p=this.videoCodec;if(!h||!h.byteLength){this.initTracks=void 0,this.initData=void 0;return}var l=this.initData=Object(U.parseInitSegment)(h);o||(o=I(l.audio,L.ElementaryStreamTypes.AUDIO)),p||(p=I(l.video,L.ElementaryStreamTypes.VIDEO));var u={};l.audio&&l.video?u.audiovideo={container:"video/mp4",codec:o+","+p,initSegment:h,id:"main"}:l.audio?u.audio={container:"audio/mp4",codec:o,initSegment:h,id:"audio"}:l.video?u.video={container:"video/mp4",codec:p,initSegment:h,id:"main"}:W.logger.warn("[passthrough-remuxer.ts]: initSegment does not contain moov or trak boxes."),this.initTracks=u},f.remux=function(h,o,p,l,u){var a=this.initPTS,s=this.lastEndDTS,C={audio:void 0,video:void 0,text:l,id3:p,initSegment:void 0};Object(z.isFiniteNumber)(s)||(s=this.lastEndDTS=u||0);var _=o.samples;if(!_||!_.length)return C;var w={initPTS:void 0,timescale:1},O=this.initData;if((!O||!O.length)&&(this.generateInitSegment(_),O=this.initData),!O||!O.length)return W.logger.warn("[passthrough-remuxer.ts]: Failed to generate initSegment."),C;this.emitInitSegment&&(w.tracks=this.initTracks,this.emitInitSegment=!1),Object(z.isFiniteNumber)(a)||(this.initPTS=w.initPTS=a=n(O,_,s));var R=Object(U.getDuration)(_,O),S=s,T=R+S;Object(U.offsetStartDTS)(O,_,a),R>0?this.lastEndDTS=T:(W.logger.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());var E=!!O.audio,c=!!O.video,x="";E&&(x+="audio"),c&&(x+="video");var v={data1:_,startPTS:S,startDTS:S,endPTS:T,endDTS:T,type:x,hasAudio:E,hasVideo:c,nb:1,dropped:0};return C.audio=v.type==="audio"?v:void 0,C.video=v.type!=="audio"?v:void 0,C.text=l,C.id3=p,C.initSegment=w,C},g}(),n=function(f,m,h){return Object(U.getStartDTS)(f,m)-h};function I(g,f){var m=g==null?void 0:g.codec;return m&&m.length>4?m:m==="hvc1"?"hvc1.1.c.L120.90":m==="av01"?"av01.0.04M.08":m==="avc1"||f===L.ElementaryStreamTypes.VIDEO?"avc1.42e01e":"mp4a.40.5"}$.default=H},"./src/task-loop.ts":function(oe,$,k){"use strict";k.r($),k.d($,"default",function(){return z});var z=function(){function U(){this._boundTick=void 0,this._tickTimer=null,this._tickInterval=null,this._tickCallCount=0,this._boundTick=this.tick.bind(this)}var L=U.prototype;return L.destroy=function(){this.onHandlerDestroying(),this.onHandlerDestroyed()},L.onHandlerDestroying=function(){this.clearNextTick(),this.clearInterval()},L.onHandlerDestroyed=function(){},L.hasInterval=function(){return!!this._tickInterval},L.hasNextTick=function(){return!!this._tickTimer},L.setInterval=function(H){return this._tickInterval?!1:(this._tickInterval=self.setInterval(this._boundTick,H),!0)},L.clearInterval=function(){return this._tickInterval?(self.clearInterval(this._tickInterval),this._tickInterval=null,!0):!1},L.clearNextTick=function(){return this._tickTimer?(self.clearTimeout(this._tickTimer),this._tickTimer=null,!0):!1},L.tick=function(){this._tickCallCount++,this._tickCallCount===1&&(this.doTick(),this._tickCallCount>1&&this.tickImmediate(),this._tickCallCount=0)},L.tickImmediate=function(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)},L.doTick=function(){},U}()},"./src/types/cmcd.ts":function(oe,$,k){"use strict";k.r($),k.d($,"CMCDVersion",function(){return z}),k.d($,"CMCDObjectType",function(){return U}),k.d($,"CMCDStreamingFormat",function(){return L}),k.d($,"CMCDStreamType",function(){return W});var z=1,U;(function(H){H.MANIFEST="m",H.AUDIO="a",H.VIDEO="v",H.MUXED="av",H.INIT="i",H.CAPTION="c",H.TIMED_TEXT="tt",H.KEY="k",H.OTHER="o"})(U||(U={}));var L;(function(H){H.DASH="d",H.HLS="h",H.SMOOTH="s",H.OTHER="o"})(L||(L={}));var W;(function(H){H.VOD="v",H.LIVE="l"})(W||(W={}))},"./src/types/level.ts":function(oe,$,k){"use strict";k.r($),k.d($,"HlsSkip",function(){return L}),k.d($,"getSkipValue",function(){return W}),k.d($,"HlsUrlParameters",function(){return H}),k.d($,"Level",function(){return n});function z(I,g){for(var f=0;f<g.length;f++){var m=g[f];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(I,m.key,m)}}function U(I,g,f){return g&&z(I.prototype,g),f&&z(I,f),I}var L;(function(I){I.No="",I.Yes="YES",I.v2="v2"})(L||(L={}));function W(I,g){var f=I.canSkipUntil,m=I.canSkipDateRanges,h=I.endSN,o=g!==void 0?g-h:0;return f&&o<f?m?L.v2:L.Yes:L.No}var H=function(){function I(f,m,h){this.msn=void 0,this.part=void 0,this.skip=void 0,this.msn=f,this.part=m,this.skip=h}var g=I.prototype;return g.addDirectives=function(m){var h=new self.URL(m);return this.msn!==void 0&&h.searchParams.set("_HLS_msn",this.msn.toString()),this.part!==void 0&&h.searchParams.set("_HLS_part",this.part.toString()),this.skip&&h.searchParams.set("_HLS_skip",this.skip),h.toString()},I}(),n=function(){function I(g){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=[g.url],this.attrs=g.attrs,this.bitrate=g.bitrate,g.details&&(this.details=g.details),this.id=g.id||0,this.name=g.name,this.width=g.width||0,this.height=g.height||0,this.audioCodec=g.audioCodec,this.videoCodec=g.videoCodec,this.unknownCodecs=g.unknownCodecs,this.codecSet=[g.videoCodec,g.audioCodec].filter(function(f){return f}).join(",").replace(/\.[^.,]+/g,"")}return U(I,[{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(f){var m=f%this.url.length;this._urlId!==m&&(this.details=void 0,this._urlId=m)}}]),I}()},"./src/types/loader.ts":function(oe,$,k){"use strict";k.r($),k.d($,"PlaylistContextType",function(){return z}),k.d($,"PlaylistLevelType",function(){return U});var z;(function(L){L.MANIFEST="manifest",L.LEVEL="level",L.AUDIO_TRACK="audioTrack",L.SUBTITLE_TRACK="subtitleTrack"})(z||(z={}));var U;(function(L){L.MAIN="main",L.AUDIO="audio",L.SUBTITLE="subtitle"})(U||(U={}))},"./src/types/transmuxer.ts":function(oe,$,k){"use strict";k.r($),k.d($,"ChunkMetadata",function(){return z});var z=function(W,H,n,I,g,f){I===void 0&&(I=0),g===void 0&&(g=-1),f===void 0&&(f=!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=U(),this.buffering={audio:U(),video:U(),audiovideo:U()},this.level=W,this.sn=H,this.id=n,this.size=I,this.part=g,this.partial=f};function U(){return{start:0,executeStart:0,executeEnd:0,end:0}}},"./src/utils/attr-list.ts":function(oe,$,k){"use strict";k.r($),k.d($,"AttrList",function(){return L});var z=/^(\d+)x(\d+)$/,U=/\s*(.+?)\s*=((?:\".*?\")|.*?)(?:,|$)/g,L=function(){function W(n){typeof n=="string"&&(n=W.parseAttrList(n));for(var I in n)n.hasOwnProperty(I)&&(this[I]=n[I])}var H=W.prototype;return H.decimalInteger=function(I){var g=parseInt(this[I],10);return g>Number.MAX_SAFE_INTEGER?Infinity:g},H.hexadecimalInteger=function(I){if(this[I]){var g=(this[I]||"0x").slice(2);g=(g.length&1?"0":"")+g;for(var f=new Uint8Array(g.length/2),m=0;m<g.length/2;m++)f[m]=parseInt(g.slice(m*2,m*2+2),16);return f}else return null},H.hexadecimalIntegerAsNumber=function(I){var g=parseInt(this[I],16);return g>Number.MAX_SAFE_INTEGER?Infinity:g},H.decimalFloatingPoint=function(I){return parseFloat(this[I])},H.optionalFloat=function(I,g){var f=this[I];return f?parseFloat(f):g},H.enumeratedString=function(I){return this[I]},H.bool=function(I){return this[I]==="YES"},H.decimalResolution=function(I){var g=z.exec(this[I]);return g===null?void 0:{width:parseInt(g[1],10),height:parseInt(g[2],10)}},W.parseAttrList=function(I){var g,f={},m='"';for(U.lastIndex=0;(g=U.exec(I))!==null;){var h=g[2];h.indexOf(m)===0&&h.lastIndexOf(m)===h.length-1&&(h=h.slice(1,-1)),f[g[1]]=h}return f},W}()},"./src/utils/binary-search.ts":function(oe,$,k){"use strict";k.r($);var z={search:function(L,W){for(var H=0,n=L.length-1,I=null,g=null;H<=n;){I=(H+n)/2|0,g=L[I];var f=W(g);if(f>0)H=I+1;else if(f<0)n=I-1;else return g}return null}};$.default=z},"./src/utils/buffer-helper.ts":function(oe,$,k){"use strict";k.r($),k.d($,"BufferHelper",function(){return L});var z=k("./src/utils/logger.ts"),U={length:0,start:function(){return 0},end:function(){return 0}},L=function(){function W(){}return W.isBuffered=function(n,I){try{if(n){for(var g=W.getBuffered(n),f=0;f<g.length;f++)if(I>=g.start(f)&&I<=g.end(f))return!0}}catch(m){}return!1},W.bufferInfo=function(n,I,g){try{if(n){var f=W.getBuffered(n),m=[],h;for(h=0;h<f.length;h++)m.push({start:f.start(h),end:f.end(h)});return this.bufferedInfo(m,I,g)}}catch(o){}return{len:0,start:I,end:I,nextStart:void 0}},W.bufferedInfo=function(n,I,g){I=Math.max(0,I),n.sort(function(w,O){var R=w.start-O.start;return R||O.end-w.end});var f=[];if(g)for(var m=0;m<n.length;m++){var h=f.length;if(h){var o=f[h-1].end;n[m].start-o<g?n[m].end>o&&(f[h-1].end=n[m].end):f.push(n[m])}else f.push(n[m])}else f=n;for(var p=0,l,u=I,a=I,s=0;s<f.length;s++){var C=f[s].start,_=f[s].end;if(I+g>=C&&I<_)u=C,a=_,p=a-I;else if(I+g<C){l=C;break}}return{len:p,start:u||0,end:a||0,nextStart:l}},W.getBuffered=function(n){try{return n.buffered}catch(I){return z.logger.log("failed to get media.buffered",I),U}},W}()},"./src/utils/cea-608-parser.ts":function(oe,$,k){"use strict";k.r($),k.d($,"Row",function(){return a}),k.d($,"CaptionScreen",function(){return s});var z=k("./src/utils/logger.ts"),U={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},L=function(T){var E=T;return U.hasOwnProperty(T)&&(E=U[T]),String.fromCharCode(E)},W=15,H=100,n={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},I={17:2,18:4,21:6,22:8,23:10,19:13,20:15},g={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},f={25:2,26:4,29:6,30:8,31:10,27:13,28:15},m=["white","green","blue","cyan","red","yellow","magenta","black","transparent"],h;(function(S){S[S.ERROR=0]="ERROR",S[S.TEXT=1]="TEXT",S[S.WARNING=2]="WARNING",S[S.INFO=2]="INFO",S[S.DEBUG=3]="DEBUG",S[S.DATA=3]="DATA"})(h||(h={}));var o=function(){function S(){this.time=null,this.verboseLevel=h.ERROR}var T=S.prototype;return T.log=function(c,x){this.verboseLevel>=c&&z.logger.log(this.time+" ["+c+"] "+x)},S}(),p=function(T){for(var E=[],c=0;c<T.length;c++)E.push(T[c].toString(16));return E},l=function(){function S(E,c,x,v,y){this.foreground=void 0,this.underline=void 0,this.italics=void 0,this.background=void 0,this.flash=void 0,this.foreground=E||"white",this.underline=c||!1,this.italics=x||!1,this.background=v||"black",this.flash=y||!1}var T=S.prototype;return T.reset=function(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1},T.setStyles=function(c){for(var x=["foreground","underline","italics","background","flash"],v=0;v<x.length;v++){var y=x[v];c.hasOwnProperty(y)&&(this[y]=c[y])}},T.isDefault=function(){return this.foreground==="white"&&!this.underline&&!this.italics&&this.background==="black"&&!this.flash},T.equals=function(c){return this.foreground===c.foreground&&this.underline===c.underline&&this.italics===c.italics&&this.background===c.background&&this.flash===c.flash},T.copy=function(c){this.foreground=c.foreground,this.underline=c.underline,this.italics=c.italics,this.background=c.background,this.flash=c.flash},T.toString=function(){return"color="+this.foreground+", underline="+this.underline+", italics="+this.italics+", background="+this.background+", flash="+this.flash},S}(),u=function(){function S(E,c,x,v,y,F){this.uchar=void 0,this.penState=void 0,this.uchar=E||" ",this.penState=new l(c,x,v,y,F)}var T=S.prototype;return T.reset=function(){this.uchar=" ",this.penState.reset()},T.setChar=function(c,x){this.uchar=c,this.penState.copy(x)},T.setPenState=function(c){this.penState.copy(c)},T.equals=function(c){return this.uchar===c.uchar&&this.penState.equals(c.penState)},T.copy=function(c){this.uchar=c.uchar,this.penState.copy(c.penState)},T.isEmpty=function(){return this.uchar===" "&&this.penState.isDefault()},S}(),a=function(){function S(E){this.chars=void 0,this.pos=void 0,this.currPenState=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chars=[];for(var c=0;c<H;c++)this.chars.push(new u);this.logger=E,this.pos=0,this.currPenState=new l}var T=S.prototype;return T.equals=function(c){for(var x=!0,v=0;v<H;v++)if(!this.chars[v].equals(c.chars[v])){x=!1;break}return x},T.copy=function(c){for(var x=0;x<H;x++)this.chars[x].copy(c.chars[x])},T.isEmpty=function(){for(var c=!0,x=0;x<H;x++)if(!this.chars[x].isEmpty()){c=!1;break}return c},T.setCursor=function(c){this.pos!==c&&(this.pos=c),this.pos<0?(this.logger.log(h.DEBUG,"Negative cursor position "+this.pos),this.pos=0):this.pos>H&&(this.logger.log(h.DEBUG,"Too large cursor position "+this.pos),this.pos=H)},T.moveCursor=function(c){var x=this.pos+c;if(c>1)for(var v=this.pos+1;v<x+1;v++)this.chars[v].setPenState(this.currPenState);this.setCursor(x)},T.backSpace=function(){this.moveCursor(-1),this.chars[this.pos].setChar(" ",this.currPenState)},T.insertChar=function(c){c>=144&&this.backSpace();var x=L(c);if(this.pos>=H){this.logger.log(h.ERROR,"Cannot insert "+c.toString(16)+" ("+x+") at position "+this.pos+". Skipping it!");return}this.chars[this.pos].setChar(x,this.currPenState),this.moveCursor(1)},T.clearFromPos=function(c){var x;for(x=c;x<H;x++)this.chars[x].reset()},T.clear=function(){this.clearFromPos(0),this.pos=0,this.currPenState.reset()},T.clearToEndOfRow=function(){this.clearFromPos(this.pos)},T.getTextString=function(){for(var c=[],x=!0,v=0;v<H;v++){var y=this.chars[v].uchar;y!==" "&&(x=!1),c.push(y)}return x?"":c.join("")},T.setPenStyles=function(c){this.currPenState.setStyles(c);var x=this.chars[this.pos];x.setPenState(this.currPenState)},S}(),s=function(){function S(E){this.rows=void 0,this.currRow=void 0,this.nrRollUpRows=void 0,this.lastOutputScreen=void 0,this.logger=void 0,this.rows=[];for(var c=0;c<W;c++)this.rows.push(new a(E));this.logger=E,this.currRow=W-1,this.nrRollUpRows=null,this.lastOutputScreen=null,this.reset()}var T=S.prototype;return T.reset=function(){for(var c=0;c<W;c++)this.rows[c].clear();this.currRow=W-1},T.equals=function(c){for(var x=!0,v=0;v<W;v++)if(!this.rows[v].equals(c.rows[v])){x=!1;break}return x},T.copy=function(c){for(var x=0;x<W;x++)this.rows[x].copy(c.rows[x])},T.isEmpty=function(){for(var c=!0,x=0;x<W;x++)if(!this.rows[x].isEmpty()){c=!1;break}return c},T.backSpace=function(){var c=this.rows[this.currRow];c.backSpace()},T.clearToEndOfRow=function(){var c=this.rows[this.currRow];c.clearToEndOfRow()},T.insertChar=function(c){var x=this.rows[this.currRow];x.insertChar(c)},T.setPen=function(c){var x=this.rows[this.currRow];x.setPenStyles(c)},T.moveCursor=function(c){var x=this.rows[this.currRow];x.moveCursor(c)},T.setCursor=function(c){this.logger.log(h.INFO,"setCursor: "+c);var x=this.rows[this.currRow];x.setCursor(c)},T.setPAC=function(c){this.logger.log(h.INFO,"pacData = "+JSON.stringify(c));var x=c.row-1;if(this.nrRollUpRows&&x<this.nrRollUpRows-1&&(x=this.nrRollUpRows-1),this.nrRollUpRows&&this.currRow!==x){for(var v=0;v<W;v++)this.rows[v].clear();var y=this.currRow+1-this.nrRollUpRows,F=this.lastOutputScreen;if(F){var B=F.rows[y].cueStartTime,A=this.logger.time;if(B&&A!==null&&B<A)for(var j=0;j<this.nrRollUpRows;j++)this.rows[x-this.nrRollUpRows+j+1].copy(F.rows[y+j])}}this.currRow=x;var P=this.rows[this.currRow];if(c.indent!==null){var b=c.indent,V=Math.max(b-1,0);P.setCursor(c.indent),c.color=P.chars[V].penState.foreground}var re={foreground:c.color,underline:c.underline,italics:c.italics,background:"black",flash:!1};this.setPen(re)},T.setBkgData=function(c){this.logger.log(h.INFO,"bkgData = "+JSON.stringify(c)),this.backSpace(),this.setPen(c),this.insertChar(32)},T.setRollUpRows=function(c){this.nrRollUpRows=c},T.rollUp=function(){if(this.nrRollUpRows===null){this.logger.log(h.DEBUG,"roll_up but nrRollUpRows not set yet");return}this.logger.log(h.TEXT,this.getDisplayText());var c=this.currRow+1-this.nrRollUpRows,x=this.rows.splice(c,1)[0];x.clear(),this.rows.splice(this.currRow,0,x),this.logger.log(h.INFO,"Rolling up")},T.getDisplayText=function(c){c=c||!1;for(var x=[],v="",y=-1,F=0;F<W;F++){var B=this.rows[F].getTextString();B&&(y=F+1,c?x.push("Row "+y+": '"+B+"'"):x.push(B.trim()))}return x.length>0&&(c?v="["+x.join(" | ")+"]":v=x.join(`
`)),v},T.getTextAndFormat=function(){return this.rows},S}(),C=function(){function S(E,c,x){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=E,this.outputFilter=c,this.mode=null,this.verbose=0,this.displayedMemory=new s(x),this.nonDisplayedMemory=new s(x),this.lastOutputScreen=new s(x),this.currRollUpRow=this.displayedMemory.rows[W-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=x}var T=S.prototype;return T.reset=function(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.outputFilter.reset(),this.currRollUpRow=this.displayedMemory.rows[W-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null},T.getHandler=function(){return this.outputFilter},T.setHandler=function(c){this.outputFilter=c},T.setPAC=function(c){this.writeScreen.setPAC(c)},T.setBkgData=function(c){this.writeScreen.setBkgData(c)},T.setMode=function(c){if(c===this.mode)return;this.mode=c,this.logger.log(h.INFO,"MODE="+c),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=c},T.insertChars=function(c){for(var x=0;x<c.length;x++)this.writeScreen.insertChar(c[x]);var v=this.writeScreen===this.displayedMemory?"DISP":"NON_DISP";this.logger.log(h.INFO,v+": "+this.writeScreen.getDisplayText(!0)),(this.mode==="MODE_PAINT-ON"||this.mode==="MODE_ROLL-UP")&&(this.logger.log(h.TEXT,"DISPLAYED: "+this.displayedMemory.getDisplayText(!0)),this.outputDataUpdate())},T.ccRCL=function(){this.logger.log(h.INFO,"RCL - Resume Caption Loading"),this.setMode("MODE_POP-ON")},T.ccBS=function(){if(this.logger.log(h.INFO,"BS - BackSpace"),this.mode==="MODE_TEXT")return;this.writeScreen.backSpace(),this.writeScreen===this.displayedMemory&&this.outputDataUpdate()},T.ccAOF=function(){},T.ccAON=function(){},T.ccDER=function(){this.logger.log(h.INFO,"DER- Delete to End of Row"),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate()},T.ccRU=function(c){this.logger.log(h.INFO,"RU("+c+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(c)},T.ccFON=function(){this.logger.log(h.INFO,"FON - Flash On"),this.writeScreen.setPen({flash:!0})},T.ccRDC=function(){this.logger.log(h.INFO,"RDC - Resume Direct Captioning"),this.setMode("MODE_PAINT-ON")},T.ccTR=function(){this.logger.log(h.INFO,"TR"),this.setMode("MODE_TEXT")},T.ccRTD=function(){this.logger.log(h.INFO,"RTD"),this.setMode("MODE_TEXT")},T.ccEDM=function(){this.logger.log(h.INFO,"EDM - Erase Displayed Memory"),this.displayedMemory.reset(),this.outputDataUpdate(!0)},T.ccCR=function(){this.logger.log(h.INFO,"CR - Carriage Return"),this.writeScreen.rollUp(),this.outputDataUpdate(!0)},T.ccENM=function(){this.logger.log(h.INFO,"ENM - Erase Non-displayed Memory"),this.nonDisplayedMemory.reset()},T.ccEOC=function(){if(this.logger.log(h.INFO,"EOC - End Of Caption"),this.mode==="MODE_POP-ON"){var c=this.displayedMemory;this.displayedMemory=this.nonDisplayedMemory,this.nonDisplayedMemory=c,this.writeScreen=this.nonDisplayedMemory,this.logger.log(h.TEXT,"DISP: "+this.displayedMemory.getDisplayText())}this.outputDataUpdate(!0)},T.ccTO=function(c){this.logger.log(h.INFO,"TO("+c+") - Tab Offset"),this.writeScreen.moveCursor(c)},T.ccMIDROW=function(c){var x={flash:!1};if(x.underline=c%2===1,x.italics=c>=46,x.italics)x.foreground="white";else{var v=Math.floor(c/2)-16,y=["white","green","blue","cyan","red","yellow","magenta"];x.foreground=y[v]}this.logger.log(h.INFO,"MIDROW: "+JSON.stringify(x)),this.writeScreen.setPen(x)},T.outputDataUpdate=function(c){c===void 0&&(c=!1);var x=this.logger.time;if(x===null)return;this.outputFilter&&(this.cueStartTime===null&&!this.displayedMemory.isEmpty()?this.cueStartTime=x:this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime,x,this.lastOutputScreen),c&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:x),this.lastOutputScreen.copy(this.displayedMemory))},T.cueSplitAtTime=function(c){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,c,this.displayedMemory),this.cueStartTime=c))},S}(),_=function(){function S(E,c,x){this.channels=void 0,this.currentChannel=0,this.cmdHistory=void 0,this.logger=void 0;var v=new o;this.channels=[null,new C(E,c,v),new C(E+1,x,v)],this.cmdHistory=R(),this.logger=v}var T=S.prototype;return T.getHandler=function(c){return this.channels[c].getHandler()},T.setHandler=function(c,x){this.channels[c].setHandler(x)},T.addData=function(c,x){var v,y,F,B=!1;this.logger.time=c;for(var A=0;A<x.length;A+=2){if(y=x[A]&127,F=x[A+1]&127,y===0&&F===0)continue;if(this.logger.log(h.DATA,"["+p([x[A],x[A+1]])+"] -> ("+p([y,F])+")"),v=this.parseCmd(y,F),v||(v=this.parseMidrow(y,F)),v||(v=this.parsePAC(y,F)),v||(v=this.parseBackgroundAttributes(y,F)),!v&&(B=this.parseChars(y,F),B)){var j=this.currentChannel;if(j&&j>0){var P=this.channels[j];P.insertChars(B)}else this.logger.log(h.WARNING,"No channel found yet. TEXT-MODE?")}!v&&!B&&this.logger.log(h.WARNING,"Couldn't parse cleaned data "+p([y,F])+" orig: "+p([x[A],x[A+1]]))}},T.parseCmd=function(c,x){var v=this.cmdHistory,y=(c===20||c===28||c===21||c===29)&&x>=32&&x<=47,F=(c===23||c===31)&&x>=33&&x<=35;if(!(y||F))return!1;if(O(c,x,v))return w(null,null,v),this.logger.log(h.DEBUG,"Repeated command ("+p([c,x])+") is dropped"),!0;var B=c===20||c===21||c===23?1:2,A=this.channels[B];return c===20||c===21||c===28||c===29?x===32?A.ccRCL():x===33?A.ccBS():x===34?A.ccAOF():x===35?A.ccAON():x===36?A.ccDER():x===37?A.ccRU(2):x===38?A.ccRU(3):x===39?A.ccRU(4):x===40?A.ccFON():x===41?A.ccRDC():x===42?A.ccTR():x===43?A.ccRTD():x===44?A.ccEDM():x===45?A.ccCR():x===46?A.ccENM():x===47&&A.ccEOC():A.ccTO(x-32),w(c,x,v),this.currentChannel=B,!0},T.parseMidrow=function(c,x){var v=0;if((c===17||c===25)&&x>=32&&x<=47){if(c===17?v=1:v=2,v!==this.currentChannel)return this.logger.log(h.ERROR,"Mismatch channel in midrow parsing"),!1;var y=this.channels[v];return y?(y.ccMIDROW(x),this.logger.log(h.DEBUG,"MIDROW ("+p([c,x])+")"),!0):!1}return!1},T.parsePAC=function(c,x){var v,y=this.cmdHistory,F=(c>=17&&c<=23||c>=25&&c<=31)&&x>=64&&x<=127,B=(c===16||c===24)&&x>=64&&x<=95;if(!(F||B))return!1;if(O(c,x,y))return w(null,null,y),!0;var A=c<=23?1:2;x>=64&&x<=95?v=A===1?n[c]:g[c]:v=A===1?I[c]:f[c];var j=this.channels[A];return j?(j.setPAC(this.interpretPAC(v,x)),w(c,x,y),this.currentChannel=A,!0):!1},T.interpretPAC=function(c,x){var v,y={color:null,italics:!1,indent:null,underline:!1,row:c};return x>95?v=x-96:v=x-64,y.underline=(v&1)===1,v<=13?y.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(v/2)]:v<=15?(y.italics=!0,y.color="white"):y.indent=Math.floor((v-16)/2)*4,y},T.parseChars=function(c,x){var v,y=null,F=null;if(c>=25?(v=2,F=c-8):(v=1,F=c),F>=17&&F<=19){var B;F===17?B=x+80:F===18?B=x+112:B=x+144,this.logger.log(h.INFO,"Special char '"+L(B)+"' in channel "+v),y=[B]}else c>=32&&c<=127&&(y=x===0?[c]:[c,x]);if(y){var A=p(y);this.logger.log(h.DEBUG,"Char codes = "+A.join(",")),w(c,x,this.cmdHistory)}return y},T.parseBackgroundAttributes=function(c,x){var v=(c===16||c===24)&&x>=32&&x<=47,y=(c===23||c===31)&&x>=45&&x<=47;if(!(v||y))return!1;var F,B={};c===16||c===24?(F=Math.floor((x-32)/2),B.background=m[F],x%2===1&&(B.background=B.background+"_semi")):x===45?B.background="transparent":(B.foreground="black",x===47&&(B.underline=!0));var A=c<=23?1:2,j=this.channels[A];return j.setBkgData(B),w(c,x,this.cmdHistory),!0},T.reset=function(){for(var c=0;c<Object.keys(this.channels).length;c++){var x=this.channels[c];x&&x.reset()}this.cmdHistory=R()},T.cueSplitAtTime=function(c){for(var x=0;x<this.channels.length;x++){var v=this.channels[x];v&&v.cueSplitAtTime(c)}},S}();function w(S,T,E){E.a=S,E.b=T}function O(S,T,E){return E.a===S&&E.b===T}function R(){return{a:null,b:null}}$.default=_},"./src/utils/codecs.ts":function(oe,$,k){"use strict";k.r($),k.d($,"isCodecType",function(){return U}),k.d($,"isCodecSupportedInMp4",function(){return L});var z={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 U(W,H){var n=z[H];return!!n&&n[W.slice(0,4)]===!0}function L(W,H){return MediaSource.isTypeSupported((H||"video")+'/mp4;codecs="'+W+'"')}},"./src/utils/cues.ts":function(oe,$,k){"use strict";k.r($);var z=k("./src/utils/vttparser.ts"),U=k("./src/utils/webvtt-parser.ts"),L=k("./src/utils/texttrack-utils.ts"),W=/\s/,H={newCue:function(I,g,f,m){for(var h=[],o,p,l,u,a,s=self.VTTCue||self.TextTrackCue,C=0;C<m.rows.length;C++)if(o=m.rows[C],l=!0,u=0,a="",!o.isEmpty()){for(var _=0;_<o.chars.length;_++)W.test(o.chars[_].uchar)&&l?u++:(a+=o.chars[_].uchar,l=!1);o.cueStartTime=g,g===f&&(f+=1e-4),u>=16?u--:u++;var w=Object(z.fixLineBreaks)(a.trim()),O=Object(U.generateCueId)(g,f,w);(!I||!I.cues||!I.cues.getCueById(O))&&(p=new s(g,f,w),p.id=O,p.line=C+1,p.align="left",p.position=10+Math.min(80,Math.floor(u*8/32)*10),h.push(p))}return I&&h.length&&(h.sort(function(R,S){return R.line==="auto"||S.line==="auto"?0:R.line>8&&S.line>8?S.line-R.line:R.line-S.line}),h.forEach(function(R){return Object(L.addCueToTrack)(I,R)})),h}};$.default=H},"./src/utils/discontinuities.ts":function(oe,$,k){"use strict";k.r($),k.d($,"findFirstFragWithCC",function(){return W}),k.d($,"shouldAlignOnDiscontinuities",function(){return H}),k.d($,"findDiscontinuousReferenceFrag",function(){return n}),k.d($,"adjustSlidingStart",function(){return g}),k.d($,"alignStream",function(){return f}),k.d($,"alignPDT",function(){return h}),k.d($,"alignFragmentByPDTDelta",function(){return o}),k.d($,"alignMediaPlaylistByPDT",function(){return p});var z=k("./src/polyfills/number.ts"),U=k("./src/utils/logger.ts"),L=k("./src/controller/level-helper.ts");function W(l,u){for(var a=null,s=0,C=l.length;s<C;s++){var _=l[s];if(_&&_.cc===u){a=_;break}}return a}function H(l,u,a){return!!(u.details&&(a.endCC>a.startCC||l&&l.cc<a.startCC))}function n(l,u){var a=l.fragments,s=u.fragments;if(!s.length||!a.length){U.logger.log("No fragments to align");return}var C=W(a,s[0].cc);if(!C||C&&!C.startPTS){U.logger.log("No frag in previous level to align on");return}return C}function I(l,u){if(l){var a=l.start+u;l.start=l.startPTS=a,l.endPTS=a+l.duration}}function g(l,u){for(var a=u.fragments,s=0,C=a.length;s<C;s++)I(a[s],l);u.fragmentHint&&I(u.fragmentHint,l),u.alignedSliding=!0}function f(l,u,a){if(!u)return;m(l,a,u),!a.alignedSliding&&u.details&&h(a,u.details),!a.alignedSliding&&u.details&&!a.skippedSegments&&Object(L.adjustSliding)(u.details,a)}function m(l,u,a){if(H(l,a,u)){var s=n(a.details,u);s&&Object(z.isFiniteNumber)(s.start)&&(U.logger.log("Adjusting PTS using last level due to CC increase within current level "+u.url),g(s.start,u))}}function h(l,u){if(!u.fragments.length||!l.hasProgramDateTime||!u.hasProgramDateTime)return;var a=u.fragments[0].programDateTime,s=l.fragments[0].programDateTime,C=(s-a)/1e3+u.fragments[0].start;C&&Object(z.isFiniteNumber)(C)&&(U.logger.log("Adjusting PTS using programDateTime delta "+(s-a)+"ms, sliding:"+C.toFixed(3)+" "+l.url+" "),g(C,l))}function o(l,u){var a=l.programDateTime;if(!a)return;var s=(a-u)/1e3;l.start=l.startPTS=s,l.endPTS=s+l.duration}function p(l,u){if(!u.fragments.length||!l.hasProgramDateTime||!u.hasProgramDateTime)return;var a=u.fragments[0].programDateTime,s=u.fragments[0].start,C=a-s*1e3;l.fragments.forEach(function(_){o(_,C)}),l.fragmentHint&&o(l.fragmentHint,C),l.alignedSliding=!0}},"./src/utils/ewma-bandwidth-estimator.ts":function(oe,$,k){"use strict";k.r($);var z=k("./src/utils/ewma.ts"),U=function(){function L(H,n,I){this.defaultEstimate_=void 0,this.minWeight_=void 0,this.minDelayMs_=void 0,this.slow_=void 0,this.fast_=void 0,this.defaultEstimate_=I,this.minWeight_=.001,this.minDelayMs_=50,this.slow_=new z.default(H),this.fast_=new z.default(n)}var W=L.prototype;return W.update=function(n,I){var g=this.slow_,f=this.fast_;this.slow_.halfLife!==n&&(this.slow_=new z.default(n,g.getEstimate(),g.getTotalWeight())),this.fast_.halfLife!==I&&(this.fast_=new z.default(I,f.getEstimate(),f.getTotalWeight()))},W.sample=function(n,I){n=Math.max(n,this.minDelayMs_);var g=8*I,f=n/1e3,m=g/f;this.fast_.sample(f,m),this.slow_.sample(f,m)},W.canEstimate=function(){var n=this.fast_;return n&&n.getTotalWeight()>=this.minWeight_},W.getEstimate=function(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_},W.destroy=function(){},L}();$.default=U},"./src/utils/ewma.ts":function(oe,$,k){"use strict";k.r($);var z=function(){function U(W,H,n){H===void 0&&(H=0),n===void 0&&(n=0),this.halfLife=void 0,this.alpha_=void 0,this.estimate_=void 0,this.totalWeight_=void 0,this.halfLife=W,this.alpha_=W?Math.exp(Math.log(.5)/W):0,this.estimate_=H,this.totalWeight_=n}var L=U.prototype;return L.sample=function(H,n){var I=Math.pow(this.alpha_,H);this.estimate_=n*(1-I)+I*this.estimate_,this.totalWeight_+=H},L.getTotalWeight=function(){return this.totalWeight_},L.getEstimate=function(){if(this.alpha_){var H=1-Math.pow(this.alpha_,this.totalWeight_);if(H)return this.estimate_/H}return this.estimate_},U}();$.default=z},"./src/utils/fetch-loader.ts":function(oe,$,k){"use strict";k.r($),k.d($,"fetchSupported",function(){return o});var z=k("./src/polyfills/number.ts"),U=k("./src/loader/load-stats.ts"),L=k("./src/demux/chunk-cache.ts");function W(s,C){s.prototype=Object.create(C.prototype),s.prototype.constructor=s,f(s,C)}function H(s){var C=typeof Map=="function"?new Map:void 0;return H=function(w){if(w===null||!g(w))return w;if(typeof w!="function")throw new TypeError("Super expression must either be null or a function");if(typeof C!="undefined"){if(C.has(w))return C.get(w);C.set(w,O)}function O(){return n(w,arguments,m(this).constructor)}return O.prototype=Object.create(w.prototype,{constructor:{value:O,enumerable:!1,writable:!0,configurable:!0}}),f(O,w)},H(s)}function n(s,C,_){return I()?n=Reflect.construct:n=function(O,R,S){var T=[null];T.push.apply(T,R);var E=Function.bind.apply(O,T),c=new E;return S&&f(c,S.prototype),c},n.apply(null,arguments)}function I(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(s){return!1}}function g(s){return Function.toString.call(s).indexOf("[native code]")!==-1}function f(s,C){return f=Object.setPrototypeOf||function(w,O){return w.__proto__=O,w},f(s,C)}function m(s){return m=Object.setPrototypeOf?Object.getPrototypeOf:function(_){return _.__proto__||Object.getPrototypeOf(_)},m(s)}function h(){return h=Object.assign||function(s){for(var C=1;C<arguments.length;C++){var _=arguments[C];for(var w in _)Object.prototype.hasOwnProperty.call(_,w)&&(s[w]=_[w])}return s},h.apply(this,arguments)}function o(){if(self.fetch&&self.AbortController&&self.ReadableStream&&self.Request)try{return new self.ReadableStream({}),!0}catch(s){}return!1}var p=function(){function s(_){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=_.fetchSetup||u,this.controller=new self.AbortController,this.stats=new U.LoadStats}var C=s.prototype;return C.destroy=function(){this.loader=this.callbacks=null,this.abortInternal()},C.abortInternal=function(){var w=this.response;(!w||!w.ok)&&(this.stats.aborted=!0,this.controller.abort())},C.abort=function(){var w;this.abortInternal(),(w=this.callbacks)!==null&&w!==void 0&&w.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.response)},C.load=function(w,O,R){var S=this,T=this.stats;if(T.loading.start)throw new Error("Loader can only be used once.");T.loading.start=self.performance.now();var E=l(w,this.controller.signal),c=R.onProgress,x=w.responseType==="arraybuffer",v=x?"byteLength":"length";this.context=w,this.config=O,this.callbacks=R,this.request=this.fetchSetup(w,E),self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(function(){S.abortInternal(),R.onTimeout(T,w,S.response)},O.timeout),self.fetch(this.request).then(function(y){if(S.response=S.loader=y,!y.ok){var F=y.status,B=y.statusText;throw new a(B||"fetch, bad network response",F,y)}return T.loading.first=Math.max(self.performance.now(),T.loading.start),T.total=parseInt(y.headers.get("Content-Length")||"0"),c&&Object(z.isFiniteNumber)(O.highWaterMark)?S.loadProgressively(y,T,w,O.highWaterMark,c):x?y.arrayBuffer():y.text()}).then(function(y){var F=S.response;self.clearTimeout(S.requestTimeout),T.loading.end=Math.max(self.performance.now(),T.loading.first),T.loaded=T.total=y[v];var B={url:F.url,data:y};c&&!Object(z.isFiniteNumber)(O.highWaterMark)&&c(T,w,y,F),R.onSuccess(B,T,w,F)}).catch(function(y){if(self.clearTimeout(S.requestTimeout),T.aborted)return;var F=y.code||0;R.onError({code:F,text:y.message},w,y.details)})},C.getCacheAge=function(){var w=null;if(this.response){var O=this.response.headers.get("age");w=O?parseFloat(O):null}return w},C.loadProgressively=function(w,O,R,S,T){S===void 0&&(S=0);var E=new L.default,c=w.body.getReader(),x=function v(){return c.read().then(function(y){if(y.done)return E.dataLength&&T(O,R,E.flush(),w),Promise.resolve(new ArrayBuffer(0));var F=y.value,B=F.length;return O.loaded+=B,B<S||E.dataLength?(E.push(F),E.dataLength>=S&&T(O,R,E.flush(),w)):T(O,R,F,w),v()}).catch(function(){return Promise.reject()})};return x()},s}();function l(s,C){var _={method:"GET",mode:"cors",credentials:"same-origin",signal:C,headers:new self.Headers(h({},s.headers))};return s.rangeEnd&&_.headers.set("Range","bytes="+s.rangeStart+"-"+String(s.rangeEnd-1)),_}function u(s,C){return new self.Request(s.url,C)}var a=function(s){W(C,s);function C(_,w,O){var R;return R=s.call(this,_)||this,R.code=void 0,R.details=void 0,R.code=w,R.details=O,R}return C}(H(Error));$.default=p},"./src/utils/imsc1-ttml-parser.ts":function(oe,$,k){"use strict";k.r($),k.d($,"IMSC1_CODEC",function(){return g}),k.d($,"parseIMSC1",function(){return o});var z=k("./src/utils/mp4-tools.ts"),U=k("./src/utils/vttparser.ts"),L=k("./src/utils/vttcue.ts"),W=k("./src/demux/id3.ts"),H=k("./src/utils/timescale-conversion.ts"),n=k("./src/utils/webvtt-parser.ts");function I(){return I=Object.assign||function(S){for(var T=1;T<arguments.length;T++){var E=arguments[T];for(var c in E)Object.prototype.hasOwnProperty.call(E,c)&&(S[c]=E[c])}return S},I.apply(this,arguments)}var g="stpp.ttml.im1t",f=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,m=/^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/,h={left:"start",center:"center",right:"end",start:"start",end:"end"};function o(S,T,E,c,x){var v=Object(z.findBox)(new Uint8Array(S),["mdat"]);if(v.length===0){x(new Error("Could not parse IMSC1 mdat"));return}var y=v[0],F=Object(W.utf8ArrayToStr)(new Uint8Array(S,y.start,y.end-y.start)),B=Object(H.toTimescaleFromScale)(T,1,E);try{c(p(F,B))}catch(A){x(A)}}function p(S,T){var E=new DOMParser,c=E.parseFromString(S,"text/xml"),x=c.getElementsByTagName("tt")[0];if(!x)throw new Error("Invalid ttml");var v={frameRate:30,subFrameRate:1,frameRateMultiplier:0,tickRate:0},y=Object.keys(v).reduce(function(P,b){return P[b]=x.getAttribute("ttp:"+b)||v[b],P},{}),F=x.getAttribute("xml:space")!=="preserve",B=u(l(x,"styling","style")),A=u(l(x,"layout","region")),j=l(x,"body","[begin]");return[].map.call(j,function(P){var b=a(P,F);if(!b||!P.hasAttribute("begin"))return null;var V=w(P.getAttribute("begin"),y),re=w(P.getAttribute("dur"),y),ce=w(P.getAttribute("end"),y);if(V===null)throw _(P);if(ce===null){if(re===null)throw _(P);ce=V+re}var me=new L.default(V-T,ce-T,b);me.id=Object(n.generateCueId)(me.startTime,me.endTime,me.text);var De=A[P.getAttribute("region")],we=B[P.getAttribute("style")];me.position=10,me.size=80;var Le=s(De,we),Re=Le.textAlign;if(Re){var Ie=h[Re];Ie&&(me.lineAlign=Ie),me.align=Re}return I(me,Le),me}).filter(function(P){return P!==null})}function l(S,T,E){var c=S.getElementsByTagName(T)[0];return c?[].slice.call(c.querySelectorAll(E)):[]}function u(S){return S.reduce(function(T,E){var c=E.getAttribute("xml:id");return c&&(T[c]=E),T},{})}function a(S,T){return[].slice.call(S.childNodes).reduce(function(E,c,x){var v;return c.nodeName==="br"&&x?E+`
`:(v=c.childNodes)!==null&&v!==void 0&&v.length?a(c,T):T?E+c.textContent.trim().replace(/\s+/g," "):E+c.textContent},"")}function s(S,T){var E="http://www.w3.org/ns/ttml#styling",c=["displayAlign","textAlign","color","backgroundColor","fontSize","fontFamily"];return c.reduce(function(x,v){var y=C(T,E,v)||C(S,E,v);return y&&(x[v]=y),x},{})}function C(S,T,E){return S.hasAttributeNS(T,E)?S.getAttributeNS(T,E):null}function _(S){return new Error("Could not parse ttml timestamp "+S)}function w(S,T){if(!S)return null;var E=Object(U.parseTimeStamp)(S);return E===null&&(f.test(S)?E=O(S,T):m.test(S)&&(E=R(S,T))),E}function O(S,T){var E=f.exec(S),c=(E[4]|0)+(E[5]|0)/T.subFrameRate;return(E[1]|0)*3600+(E[2]|0)*60+(E[3]|0)+c/T.frameRate}function R(S,T){var E=m.exec(S),c=Number(E[1]),x=E[2];switch(x){case"h":return c*3600;case"m":return c*60;case"ms":return c*1e3;case"f":return c/T.frameRate;case"t":return c/T.tickRate}return c}},"./src/utils/logger.ts":function(oe,$,k){"use strict";k.r($),k.d($,"enableLogs",function(){return n}),k.d($,"logger",function(){return I});var z=function(){},U={trace:z,debug:z,log:z,warn:z,info:z,error:z},L=U;function W(g){var f=self.console[g];return f?f.bind(self.console,"["+g+"] >"):z}function H(g){for(var f=arguments.length,m=new Array(f>1?f-1:0),h=1;h<f;h++)m[h-1]=arguments[h];m.forEach(function(o){L[o]=g[o]?g[o].bind(g):W(o)})}function n(g){if(self.console&&g===!0||typeof g=="object"){H(g,"debug","log","info","warn","error");try{L.log()}catch(f){L=U}}else L=U}var I=L},"./src/utils/mediakeys-helper.ts":function(oe,$,k){"use strict";k.r($),k.d($,"KeySystems",function(){return z}),k.d($,"requestMediaKeySystemAccess",function(){return U});var z;(function(L){L.WIDEVINE="com.widevine.alpha",L.PLAYREADY="com.microsoft.playready"})(z||(z={}));var U=function(){return typeof self!="undefined"&&self.navigator&&self.navigator.requestMediaKeySystemAccess?self.navigator.requestMediaKeySystemAccess.bind(self.navigator):null}()},"./src/utils/mediasource-helper.ts":function(oe,$,k){"use strict";k.r($),k.d($,"getMediaSource",function(){return z});function z(){return self.MediaSource||self.WebKitMediaSource}},"./src/utils/mp4-tools.ts":function(oe,$,k){"use strict";k.r($),k.d($,"bin2str",function(){return H}),k.d($,"readUint16",function(){return n}),k.d($,"readUint32",function(){return I}),k.d($,"writeUint32",function(){return g}),k.d($,"findBox",function(){return f}),k.d($,"parseSegmentIndex",function(){return m}),k.d($,"parseInitSegment",function(){return h}),k.d($,"getStartDTS",function(){return o}),k.d($,"getDuration",function(){return p}),k.d($,"computeRawDurationFromSamples",function(){return l}),k.d($,"offsetStartDTS",function(){return u}),k.d($,"segmentValidRange",function(){return a}),k.d($,"appendUint8Array",function(){return s});var z=k("./src/utils/typed-array.ts"),U=k("./src/loader/fragment.ts"),L=Math.pow(2,32)-1,W=[].push;function H(C){return String.fromCharCode.apply(null,C)}function n(C,_){"data"in C&&(_+=C.start,C=C.data);var w=C[_]<<8|C[_+1];return w<0?65536+w:w}function I(C,_){"data"in C&&(_+=C.start,C=C.data);var w=C[_]<<24|C[_+1]<<16|C[_+2]<<8|C[_+3];return w<0?4294967296+w:w}function g(C,_,w){"data"in C&&(_+=C.start,C=C.data),C[_]=w>>24,C[_+1]=w>>16&255,C[_+2]=w>>8&255,C[_+3]=w&255}function f(C,_){var w=[];if(!_.length)return w;var O,R,S;"data"in C?(O=C.data,R=C.start,S=C.end):(O=C,R=0,S=O.byteLength);for(var T=R;T<S;){var E=I(O,T),c=H(O.subarray(T+4,T+8)),x=E>1?T+E:S;if(c===_[0])if(_.length===1)w.push({data:O,start:T+8,end:x});else{var v=f({data:O,start:T+8,end:x},_.slice(1));v.length&&W.apply(w,v)}T=x}return w}function m(C){var _=f(C,["moov"]),w=_[0],O=w?w.end:null,R=f(C,["sidx"]);if(!R||!R[0])return null;var S=[],T=R[0],E=T.data[0],c=E===0?8:16,x=I(T,c);c+=4;var v=0,y=0;E===0?c+=8:c+=16,c+=2;var F=T.end+y,B=n(T,c);c+=2;for(var A=0;A<B;A++){var j=c,P=I(T,j);j+=4;var b=P&2147483647,V=(P&2147483648)>>>31;if(V===1)return console.warn("SIDX has hierarchical references (not supported)"),null;var re=I(T,j);j+=4,S.push({referenceSize:b,subsegmentDuration:re,info:{duration:re/x,start:F,end:F+b-1}}),F+=b,j+=4,c=j}return{earliestPresentationTime:v,timescale:x,version:E,referencesCount:B,references:S,moovEndOffset:O}}function h(C){for(var _=[],w=f(C,["moov","trak"]),O=0;O<w.length;O++){var R=w[O],S=f(R,["tkhd"])[0];if(S){var T=S.data[S.start],E=T===0?12:20,c=I(S,E),x=f(R,["mdia","mdhd"])[0];if(x){T=x.data[x.start],E=T===0?12:20;var v=I(x,E),y=f(R,["mdia","hdlr"])[0];if(y){var F=H(y.data.subarray(y.start+8,y.start+12)),B={soun:U.ElementaryStreamTypes.AUDIO,vide:U.ElementaryStreamTypes.VIDEO}[F];if(B){var A=f(R,["mdia","minf","stbl","stsd"])[0],j=void 0;A&&(j=H(A.data.subarray(A.start+12,A.start+16))),_[c]={timescale:v,type:B},_[B]={timescale:v,id:c,codec:j}}}}}}var P=f(C,["moov","mvex","trex"]);return P.forEach(function(b){var V=I(b,4),re=_[V];re&&(re.default={duration:I(b,12),flags:I(b,20)})}),_}function o(C,_){return f(_,["moof","traf"]).reduce(function(w,O){var R=f(O,["tfdt"])[0],S=R.data[R.start],T=f(O,["tfhd"]).reduce(function(E,c){var x=I(c,4),v=C[x];if(v){var y=I(R,4);S===1&&(y*=Math.pow(2,32),y+=I(R,8));var F=v.timescale||9e4,B=y/F;if(isFinite(B)&&(E===null||B<E))return B}return E},null);return T!==null&&isFinite(T)&&(w===null||T<w)?T:w},null)||0}function p(C,_){for(var w=0,O=0,R=0,S=f(C,["moof","traf"]),T=0;T<S.length;T++){var E=S[T],c=f(E,["tfhd"])[0],x=I(c,4),v=_[x];if(!v)continue;var y=v.default,F=I(c,0)|(y==null?void 0:y.flags),B=y==null?void 0:y.duration;F&8&&(F&2?B=I(c,12):B=I(c,8));for(var A=v.timescale||9e4,j=f(E,["trun"]),P=0;P<j.length;P++){if(B){var b=I(j[P],4);w=B*b}else w=l(j[P]);v.type===U.ElementaryStreamTypes.VIDEO?O+=w/A:v.type===U.ElementaryStreamTypes.AUDIO&&(R+=w/A)}}if(O===0&&R===0){var V=m(C);if(V!=null&&V.references)return V.references.reduce(function(re,ce){return re+ce.info.duration||0},0)}return O||R}function l(C){var _=I(C,0),w=8;_&1&&(w+=4),_&4&&(w+=4);for(var O=0,R=I(C,4),S=0;S<R;S++){if(_&256){var T=I(C,w);O+=T,w+=4}_&512&&(w+=4),_&1024&&(w+=4),_&2048&&(w+=4)}return O}function u(C,_,w){f(_,["moof","traf"]).forEach(function(O){f(O,["tfhd"]).forEach(function(R){var S=I(R,4),T=C[S];if(!T)return;var E=T.timescale||9e4;f(O,["tfdt"]).forEach(function(c){var x=c.data[c.start],v=I(c,4);if(x===0)g(c,4,v-w*E);else{v*=Math.pow(2,32),v+=I(c,8),v-=w*E,v=Math.max(v,0);var y=Math.floor(v/(L+1)),F=Math.floor(v%(L+1));g(c,4,y),g(c,8,F)}})})})}function a(C){var _={valid:null,remainder:null},w=f(C,["moof"]);if(w){if(w.length<2)return _.remainder=C,_}else return _;var O=w[w.length-1];return _.valid=Object(z.sliceUint8)(C,0,O.start-8),_.remainder=Object(z.sliceUint8)(C,O.start-8),_}function s(C,_){var w=new Uint8Array(C.length+_.length);return w.set(C),w.set(_,C.length),w}},"./src/utils/output-filter.ts":function(oe,$,k){"use strict";k.r($),k.d($,"default",function(){return z});var z=function(){function U(W,H){this.timelineController=void 0,this.cueRanges=[],this.trackName=void 0,this.startTime=null,this.endTime=null,this.screen=null,this.timelineController=W,this.trackName=H}var L=U.prototype;return L.dispatchCue=function(){if(this.startTime===null)return;this.timelineController.addCues(this.trackName,this.startTime,this.endTime,this.screen,this.cueRanges),this.startTime=null},L.newCue=function(H,n,I){(this.startTime===null||this.startTime>H)&&(this.startTime=H),this.endTime=n,this.screen=I,this.timelineController.createCaptionsTrack(this.trackName)},L.reset=function(){this.cueRanges=[]},U}()},"./src/utils/texttrack-utils.ts":function(oe,$,k){"use strict";k.r($),k.d($,"sendAddTrackEvent",function(){return U}),k.d($,"addCueToTrack",function(){return L}),k.d($,"clearCurrentCues",function(){return W}),k.d($,"removeCuesInRange",function(){return H}),k.d($,"getCuesInRange",function(){return I});var z=k("./src/utils/logger.ts");function U(g,f){var m;try{m=new Event("addtrack")}catch(h){m=document.createEvent("Event"),m.initEvent("addtrack",!1,!1)}m.track=g,f.dispatchEvent(m)}function L(g,f){var m=g.mode;if(m==="disabled"&&(g.mode="hidden"),g.cues&&!g.cues.getCueById(f.id))try{if(g.addCue(f),!g.cues.getCueById(f.id))throw new Error("addCue is failed for: "+f)}catch(o){z.logger.debug("[texttrack-utils]: "+o);var h=new self.TextTrackCue(f.startTime,f.endTime,f.text);h.id=f.id,g.addCue(h)}m==="disabled"&&(g.mode=m)}function W(g){var f=g.mode;if(f==="disabled"&&(g.mode="hidden"),g.cues)for(var m=g.cues.length;m--;)g.removeCue(g.cues[m]);f==="disabled"&&(g.mode=f)}function H(g,f,m){var h=g.mode;if(h==="disabled"&&(g.mode="hidden"),g.cues&&g.cues.length>0)for(var o=I(g.cues,f,m),p=0;p<o.length;p++)g.removeCue(o[p]);h==="disabled"&&(g.mode=h)}function n(g,f){if(f<g[0].startTime)return 0;var m=g.length-1;if(f>g[m].endTime)return-1;for(var h=0,o=m;h<=o;){var p=Math.floor((o+h)/2);if(f<g[p].startTime)o=p-1;else if(f>g[p].startTime&&h<m)h=p+1;else return p}return g[h].startTime-f<f-g[o].startTime?h:o}function I(g,f,m){var h=[],o=n(g,f);if(o>-1)for(var p=o,l=g.length;p<l;p++){var u=g[p];if(u.startTime>=f&&u.endTime<=m)h.push(u);else if(u.startTime>m)return h}return h}},"./src/utils/time-ranges.ts":function(oe,$,k){"use strict";k.r($);var z={toString:function(L){for(var W="",H=L.length,n=0;n<H;n++)W+="["+L.start(n).toFixed(3)+","+L.end(n).toFixed(3)+"]";return W}};$.default=z},"./src/utils/timescale-conversion.ts":function(oe,$,k){"use strict";k.r($),k.d($,"toTimescaleFromBase",function(){return U}),k.d($,"toTimescaleFromScale",function(){return L}),k.d($,"toMsFromMpegTsClock",function(){return W}),k.d($,"toMpegTsClockFromTimescale",function(){return H});var z=9e4;function U(n,I,g,f){g===void 0&&(g=1),f===void 0&&(f=!1);var m=n*I*g;return f?Math.round(m):m}function L(n,I,g,f){return g===void 0&&(g=1),f===void 0&&(f=!1),U(n,I,1/g,f)}function W(n,I){return I===void 0&&(I=!1),U(n,1e3,1/z,I)}function H(n,I){return I===void 0&&(I=1),U(n,z,1/I)}},"./src/utils/typed-array.ts":function(oe,$,k){"use strict";k.r($),k.d($,"sliceUint8",function(){return z});function z(U,L,W){return Uint8Array.prototype.slice?U.slice(L,W):new Uint8Array(Array.prototype.slice.call(U,L,W))}},"./src/utils/vttcue.ts":function(oe,$,k){"use strict";k.r($),$.default=function(){if(typeof self!="undefined"&&self.VTTCue)return self.VTTCue;var z=["","lr","rl"],U=["start","middle","end","left","right"];function L(g,f){if(typeof f!="string")return!1;if(!Array.isArray(g))return!1;var m=f.toLowerCase();return~g.indexOf(m)?m:!1}function W(g){return L(z,g)}function H(g){return L(U,g)}function n(g){for(var f=arguments.length,m=new Array(f>1?f-1:0),h=1;h<f;h++)m[h-1]=arguments[h];for(var o=1;o<arguments.length;o++){var p=arguments[o];for(var l in p)g[l]=p[l]}return g}function I(g,f,m){var h=this,o={enumerable:!0};h.hasBeenReset=!1;var p="",l=!1,u=g,a=f,s=m,C=null,_="",w=!0,O="auto",R="start",S=50,T="middle",E=50,c="middle";Object.defineProperty(h,"id",n({},o,{get:function(){return p},set:function(v){p=""+v}})),Object.defineProperty(h,"pauseOnExit",n({},o,{get:function(){return l},set:function(v){l=!!v}})),Object.defineProperty(h,"startTime",n({},o,{get:function(){return u},set:function(v){if(typeof v!="number")throw new TypeError("Start time must be set to a number.");u=v,this.hasBeenReset=!0}})),Object.defineProperty(h,"endTime",n({},o,{get:function(){return a},set:function(v){if(typeof v!="number")throw new TypeError("End time must be set to a number.");a=v,this.hasBeenReset=!0}})),Object.defineProperty(h,"text",n({},o,{get:function(){return s},set:function(v){s=""+v,this.hasBeenReset=!0}})),Object.defineProperty(h,"region",n({},o,{get:function(){return C},set:function(v){C=v,this.hasBeenReset=!0}})),Object.defineProperty(h,"vertical",n({},o,{get:function(){return _},set:function(v){var y=W(v);if(y===!1)throw new SyntaxError("An invalid or illegal string was specified.");_=y,this.hasBeenReset=!0}})),Object.defineProperty(h,"snapToLines",n({},o,{get:function(){return w},set:function(v){w=!!v,this.hasBeenReset=!0}})),Object.defineProperty(h,"line",n({},o,{get:function(){return O},set:function(v){if(typeof v!="number"&&v!=="auto")throw new SyntaxError("An invalid number or illegal string was specified.");O=v,this.hasBeenReset=!0}})),Object.defineProperty(h,"lineAlign",n({},o,{get:function(){return R},set:function(v){var y=H(v);if(!y)throw new SyntaxError("An invalid or illegal string was specified.");R=y,this.hasBeenReset=!0}})),Object.defineProperty(h,"position",n({},o,{get:function(){return S},set:function(v){if(v<0||v>100)throw new Error("Position must be between 0 and 100.");S=v,this.hasBeenReset=!0}})),Object.defineProperty(h,"positionAlign",n({},o,{get:function(){return T},set:function(v){var y=H(v);if(!y)throw new SyntaxError("An invalid or illegal string was specified.");T=y,this.hasBeenReset=!0}})),Object.defineProperty(h,"size",n({},o,{get:function(){return E},set:function(v){if(v<0||v>100)throw new Error("Size must be between 0 and 100.");E=v,this.hasBeenReset=!0}})),Object.defineProperty(h,"align",n({},o,{get:function(){return c},set:function(v){var y=H(v);if(!y)throw new SyntaxError("An invalid or illegal string was specified.");c=y,this.hasBeenReset=!0}})),h.displayState=void 0}return I.prototype.getCueAsHTML=function(){var g=self.WebVTT;return g.convertCueToDOMTree(self,this.text)},I}()},"./src/utils/vttparser.ts":function(oe,$,k){"use strict";k.r($),k.d($,"parseTimeStamp",function(){return L}),k.d($,"fixLineBreaks",function(){return f}),k.d($,"VTTParser",function(){return m});var z=k("./src/utils/vttcue.ts"),U=function(){function h(){}var o=h.prototype;return o.decode=function(l,u){if(!l)return"";if(typeof l!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(l))},h}();function L(h){function o(l,u,a,s){return(l|0)*3600+(u|0)*60+(a|0)+parseFloat(s||0)}var p=h.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return p?parseFloat(p[2])>59?o(p[2],p[3],0,p[4]):o(p[1],p[2],p[3],p[4]):null}var W=function(){function h(){this.values=Object.create(null)}var o=h.prototype;return o.set=function(l,u){!this.get(l)&&u!==""&&(this.values[l]=u)},o.get=function(l,u,a){return a?this.has(l)?this.values[l]:u[a]:this.has(l)?this.values[l]:u},o.has=function(l){return l in this.values},o.alt=function(l,u,a){for(var s=0;s<a.length;++s)if(u===a[s]){this.set(l,u);break}},o.integer=function(l,u){/^-?\d+$/.test(u)&&this.set(l,parseInt(u,10))},o.percent=function(l,u){if(/^([\d]{1,3})(\.[\d]*)?%$/.test(u)){var a=parseFloat(u);if(a>=0&&a<=100)return this.set(l,a),!0}return!1},h}();function H(h,o,p,l){var u=l?h.split(l):[h];for(var a in u){if(typeof u[a]!="string")continue;var s=u[a].split(p);if(s.length!==2)continue;var C=s[0],_=s[1];o(C,_)}}var n=new z.default(0,0,""),I=n.align==="middle"?"middle":"center";function g(h,o,p){var l=h;function u(){var C=L(h);if(C===null)throw new Error("Malformed timestamp: "+l);return h=h.replace(/^[^\sa-zA-Z-]+/,""),C}function a(C,_){var w=new W;H(C,function(S,T){var E;switch(S){case"region":for(var c=p.length-1;c>=0;c--)if(p[c].id===T){w.set(S,p[c].region);break}break;case"vertical":w.alt(S,T,["rl","lr"]);break;case"line":E=T.split(","),w.integer(S,E[0]),w.percent(S,E[0])&&w.set("snapToLines",!1),w.alt(S,E[0],["auto"]),E.length===2&&w.alt("lineAlign",E[1],["start",I,"end"]);break;case"position":E=T.split(","),w.percent(S,E[0]),E.length===2&&w.alt("positionAlign",E[1],["start",I,"end","line-left","line-right","auto"]);break;case"size":w.percent(S,T);break;case"align":w.alt(S,T,["start",I,"end","left","right"]);break}},/:/,/\s/),_.region=w.get("region",null),_.vertical=w.get("vertical","");var O=w.get("line","auto");O==="auto"&&n.line===-1&&(O=-1),_.line=O,_.lineAlign=w.get("lineAlign","start"),_.snapToLines=w.get("snapToLines",!0),_.size=w.get("size",100),_.align=w.get("align",I);var R=w.get("position","auto");R==="auto"&&n.position===50&&(R=_.align==="start"||_.align==="left"?0:_.align==="end"||_.align==="right"?100:50),_.position=R}function s(){h=h.replace(/^\s+/,"")}if(s(),o.startTime=u(),s(),h.substr(0,3)!=="-->")throw new Error("Malformed time stamp (time stamps must be separated by '-->'): "+l);h=h.substr(3),s(),o.endTime=u(),s(),a(h,o)}function f(h){return h.replace(/<br(?: \/)?>/gi,`
`)}var m=function(){function h(){this.state="INITIAL",this.buffer="",this.decoder=new U,this.regionList=[],this.cue=null,this.oncue=void 0,this.onparsingerror=void 0,this.onflush=void 0}var o=h.prototype;return o.parse=function(l){var u=this;l&&(u.buffer+=u.decoder.decode(l,{stream:!0}));function a(){var R=u.buffer,S=0;for(R=f(R);S<R.length&&R[S]!=="\r"&&R[S]!==`
`;)++S;var T=R.substr(0,S);return R[S]==="\r"&&++S,R[S]===`
`&&++S,u.buffer=R.substr(S),T}function s(R){H(R,function(S,T){},/:/)}try{var C="";if(u.state==="INITIAL"){if(!/\r\n|\n/.test(u.buffer))return this;C=a();var _=C.match(/^()?WEBVTT([ \t].*)?$/);if(!_||!_[0])throw new Error("Malformed WebVTT signature.");u.state="HEADER"}for(var w=!1;u.buffer;){if(!/\r\n|\n/.test(u.buffer))return this;w?w=!1:C=a();switch(u.state){case"HEADER":/:/.test(C)?s(C):C||(u.state="ID");continue;case"NOTE":C||(u.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(C)){u.state="NOTE";break}if(!C)continue;if(u.cue=new z.default(0,0,""),u.state="CUE",C.indexOf("-->")===-1){u.cue.id=C;continue}case"CUE":if(!u.cue){u.state="BADCUE";continue}try{g(C,u.cue,u.regionList)}catch(R){u.cue=null,u.state="BADCUE";continue}u.state="CUETEXT";continue;case"CUETEXT":{var O=C.indexOf("-->")!==-1;if(!C||O&&(w=!0)){u.oncue&&u.cue&&u.oncue(u.cue),u.cue=null,u.state="ID";continue}if(u.cue===null)continue;u.cue.text&&(u.cue.text+=`
`),u.cue.text+=C}continue;case"BADCUE":C||(u.state="ID")}}}catch(R){u.state==="CUETEXT"&&u.cue&&u.oncue&&u.oncue(u.cue),u.cue=null,u.state=u.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this},o.flush=function(){var l=this;try{if((l.cue||l.state==="HEADER")&&(l.buffer+=`
`,l.parse()),l.state==="INITIAL"||l.state==="BADWEBVTT")throw new Error("Malformed WebVTT signature.")}catch(u){l.onparsingerror&&l.onparsingerror(u)}return l.onflush&&l.onflush(),this},h}()},"./src/utils/webvtt-parser.ts":function(oe,$,k){"use strict";k.r($),k.d($,"generateCueId",function(){return m}),k.d($,"parseWebVTT",function(){return o});var z=k("./src/polyfills/number.ts"),U=k("./src/utils/vttparser.ts"),L=k("./src/demux/id3.ts"),W=k("./src/utils/timescale-conversion.ts"),H=k("./src/remux/mp4-remuxer.ts"),n=/\r\n|\n\r|\n|\r/g,I=function(l,u,a){return a===void 0&&(a=0),l.substr(a,u.length)===u},g=function(l){var u=parseInt(l.substr(-3)),a=parseInt(l.substr(-6,2)),s=parseInt(l.substr(-9,2)),C=l.length>9?parseInt(l.substr(0,l.indexOf(":"))):0;if(!Object(z.isFiniteNumber)(u)||!Object(z.isFiniteNumber)(a)||!Object(z.isFiniteNumber)(s)||!Object(z.isFiniteNumber)(C))throw Error("Malformed X-TIMESTAMP-MAP: Local:"+l);return u+=1e3*a,u+=60*1e3*s,u+=60*60*1e3*C,u},f=function(l){for(var u=5381,a=l.length;a;)u=u*33^l.charCodeAt(--a);return(u>>>0).toString()};function m(p,l,u){return f(p.toString())+f(l.toString())+f(u)}var h=function(l,u,a){var s=l[u],C=l[s.prevCC];if(!C||!C.new&&s.new){l.ccOffset=l.presentationOffset=s.start,s.new=!1;return}for(;(_=C)!==null&&_!==void 0&&_.new;){var _;l.ccOffset+=s.start-C.start,s.new=!1,s=C,C=l[s.prevCC]}l.presentationOffset=a};function o(p,l,u,a,s,C,_,w){var O=new U.VTTParser,R=Object(L.utf8ArrayToStr)(new Uint8Array(p)).trim().replace(n,`
`).split(`
`),S=[],T=Object(W.toMpegTsClockFromTimescale)(l,u),E="00:00.000",c=0,x=0,v,y=!0,F=!1;O.oncue=function(B){var A=a[s],j=a.ccOffset,P=(c-T)/9e4;if(A!=null&&A.new&&(x!==void 0?j=a.ccOffset=A.start:h(a,s,P)),P&&(j=P-a.presentationOffset),F){var b=B.endTime-B.startTime,V=Object(H.normalizePts)((B.startTime+j-x)*9e4,C*9e4)/9e4;B.startTime=V,B.endTime=V+b}var re=B.text.trim();B.text=decodeURIComponent(encodeURIComponent(re)),B.id||(B.id=m(B.startTime,B.endTime,re)),B.endTime>0&&S.push(B)},O.onparsingerror=function(B){v=B},O.onflush=function(){if(v){w(v);return}_(S)},R.forEach(function(B){if(y)if(I(B,"X-TIMESTAMP-MAP=")){y=!1,F=!0,B.substr(16).split(",").forEach(function(A){I(A,"LOCAL:")?E=A.substr(6):I(A,"MPEGTS:")&&(c=parseInt(A.substr(7)))});try{x=g(E)/1e3}catch(A){F=!1,v=A}return}else B===""&&(y=!1);O.parse(B+`
`)}),O.flush()}},"./src/utils/xhr-loader.ts":function(oe,$,k){"use strict";k.r($);var z=k("./src/utils/logger.ts"),U=k("./src/loader/load-stats.ts"),L=/^age:\s*[\d.]+\s*$/m,W=function(){function H(I){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=I?I.xhrSetup:null,this.stats=new U.LoadStats,this.retryDelay=0}var n=H.prototype;return n.destroy=function(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null},n.abortInternal=function(){var g=this.loader;self.clearTimeout(this.requestTimeout),self.clearTimeout(this.retryTimeout),g&&(g.onreadystatechange=null,g.onprogress=null,g.readyState!==4&&(this.stats.aborted=!0,g.abort()))},n.abort=function(){var g;this.abortInternal(),(g=this.callbacks)!==null&&g!==void 0&&g.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)},n.load=function(g,f,m){if(this.stats.loading.start)throw new Error("Loader can only be used once.");this.stats.loading.start=self.performance.now(),this.context=g,this.config=f,this.callbacks=m,this.retryDelay=f.retryDelay,this.loadInternal()},n.loadInternal=function(){var g=this.config,f=this.context;if(!g)return;var m=this.loader=new self.XMLHttpRequest,h=this.stats;h.loading.first=0,h.loaded=0;var o=this.xhrSetup;try{if(o)try{o(m,f.url)}catch(u){m.open("GET",f.url,!0),o(m,f.url)}m.readyState||m.open("GET",f.url,!0);var p=this.context.headers;if(p)for(var l in p)m.setRequestHeader(l,p[l])}catch(u){this.callbacks.onError({code:m.status,text:u.message},f,m);return}f.rangeEnd&&m.setRequestHeader("Range","bytes="+f.rangeStart+"-"+(f.rangeEnd-1)),m.onreadystatechange=this.readystatechange.bind(this),m.onprogress=this.loadprogress.bind(this),m.responseType=f.responseType,self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),g.timeout),m.send()},n.readystatechange=function(){var g=this.context,f=this.loader,m=this.stats;if(!g||!f)return;var h=f.readyState,o=this.config;if(m.aborted)return;if(h>=2)if(self.clearTimeout(this.requestTimeout),m.loading.first===0&&(m.loading.first=Math.max(self.performance.now(),m.loading.start)),h===4){f.onreadystatechange=null,f.onprogress=null;var p=f.status;if(p>=200&&p<300){m.loading.end=Math.max(self.performance.now(),m.loading.first);var l,u;if(g.responseType==="arraybuffer"?(l=f.response,u=l.byteLength):(l=f.responseText,u=l.length),m.loaded=m.total=u,!this.callbacks)return;var a=this.callbacks.onProgress;if(a&&a(m,g,l,f),!this.callbacks)return;var s={url:f.responseURL,data:l};this.callbacks.onSuccess(s,m,g,f)}else m.retry>=o.maxRetry||p>=400&&p<499?(z.logger.error(p+" while loading "+g.url),this.callbacks.onError({code:p,text:f.statusText},g,f)):(z.logger.warn(p+" while loading "+g.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,o.maxRetryDelay),m.retry++)}else self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),o.timeout)},n.loadtimeout=function(){z.logger.warn("timeout while loading "+this.context.url);var g=this.callbacks;g&&(this.abortInternal(),g.onTimeout(this.stats,this.context,this.loader))},n.loadprogress=function(g){var f=this.stats;f.loaded=g.loaded,g.lengthComputable&&(f.total=g.total)},n.getCacheAge=function(){var g=null;if(this.loader&&L.test(this.loader.getAllResponseHeaders())){var f=this.loader.getResponseHeader("age");g=f?parseFloat(f):null}return g},H}();$.default=W}}).default})},vHTk:function(tt,Ee,J){tt.exports={wrp:"wrp___z2l1F",bgBlack:"bgBlack___3ezfX",monaco:"monaco___1ypjT",darkBlue:"darkBlue___2ViJc",close:"close___3q-z4",embed:"embed___3dQqc"}}}]);